@antv/g-canvas 1.0.0-alpha.27 → 1.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +16 -0
- package/{dist → es}/Canvas2DContextService.d.ts +16 -16
- package/es/Canvas2DContextService.js +87 -0
- package/{dist → es}/ContextRegisterPlugin.d.ts +6 -6
- package/es/ContextRegisterPlugin.js +28 -0
- package/es/index.d.ts +9 -0
- package/es/index.js +38 -0
- package/{dist → es}/utils/browser.d.ts +1 -1
- package/es/utils/browser.js +1 -0
- package/{dist → es}/utils/dom.d.ts +1 -1
- package/es/utils/dom.js +8 -0
- package/lib/Canvas2DContextService.d.ts +16 -0
- package/lib/Canvas2DContextService.js +97 -0
- package/lib/ContextRegisterPlugin.d.ts +6 -0
- package/lib/ContextRegisterPlugin.js +37 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +64 -0
- package/lib/utils/browser.d.ts +1 -0
- package/lib/utils/browser.js +8 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/dom.js +17 -0
- package/package.json +21 -13
- package/dist/index.d.ts +0 -4
- package/dist/index.esm.js +0 -204
- package/dist/index.js +0 -307
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("mana-syringe"),require("@antv/g")):"function"==typeof define&&define.amd?define(["mana-syringe","@antv/g"],n):"object"==typeof exports?exports.Canvas2D=n(require("mana-syringe"),require("@antv/g")):(t.G=t.G||{},t.G.Canvas2D=n(t.G.ManaSyringe,t.G))}(window,(function(t,n){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=52)}([function(t,n,e){"use strict";e.r(n),e.d(n,"__extends",(function(){return o})),e.d(n,"__assign",(function(){return i})),e.d(n,"__rest",(function(){return a})),e.d(n,"__decorate",(function(){return u})),e.d(n,"__param",(function(){return c})),e.d(n,"__metadata",(function(){return f})),e.d(n,"__awaiter",(function(){return s})),e.d(n,"__generator",(function(){return d})),e.d(n,"__createBinding",(function(){return l})),e.d(n,"__exportStar",(function(){return h})),e.d(n,"__values",(function(){return v})),e.d(n,"__read",(function(){return p})),e.d(n,"__spread",(function(){return y})),e.d(n,"__spreadArrays",(function(){return m})),e.d(n,"__spreadArray",(function(){return g})),e.d(n,"__await",(function(){return M})),e.d(n,"__asyncGenerator",(function(){return b})),e.d(n,"__asyncDelegator",(function(){return P})),e.d(n,"__asyncValues",(function(){return _})),e.d(n,"__makeTemplateObject",(function(){return x})),e.d(n,"__importStar",(function(){return E})),e.d(n,"__importDefault",(function(){return S})),e.d(n,"__classPrivateFieldGet",(function(){return A})),e.d(n,"__classPrivateFieldSet",(function(){return j}));
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(t,n)};function o(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var i=function(){return(i=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function a(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function u(t,n,e,r){var o,i=arguments.length,a=i<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,n,e,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(n,e,a):o(n,e))||a);return i>3&&a&&Object.defineProperty(n,e,a),a}function c(t,n){return function(e,r){n(e,r,t)}}function f(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function s(t,n,e,r){return new(e||(e=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(a,u)}c((r=r.apply(t,n||[])).next())}))}function d(t,n){var e,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=n.call(t,a)}catch(t){i=[6,t],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var l=Object.create?function(t,n,e,r){void 0===r&&(r=e),Object.defineProperty(t,r,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,r){void 0===r&&(r=e),t[r]=n[e]};function h(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||l(n,t,e)}function v(t){var n="function"==typeof Symbol&&Symbol.iterator,e=n&&t[n],r=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(p(arguments[n]));return t}function m(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function g(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))}function M(t){return this instanceof M?(this.v=t,this):new M(t)}function b(t,n,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e.apply(t,n||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){o[t]&&(r[t]=function(n){return new Promise((function(e,r){i.push([t,n,e,r])>1||u(t,n)}))})}function u(t,n){try{(e=o[t](n)).value instanceof M?Promise.resolve(e.value.v).then(c,f):s(i[0][2],e)}catch(t){s(i[0][3],t)}var e}function c(t){u("next",t)}function f(t){u("throw",t)}function s(t,n){t(n),i.shift(),i.length&&u(i[0][0],i[0][1])}}function P(t){var n,e;return n={},r("next"),r("throw",(function(t){throw t})),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,o){n[r]=t[r]?function(n){return(e=!e)?{value:M(t[r](n)),done:"return"===r}:o?o(n):n}:o}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,e=t[Symbol.asyncIterator];return e?e.call(t):(t=v(t),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(e){n[e]=t[e]&&function(n){return new Promise((function(r,o){(function(t,n,e,r){Promise.resolve(r).then((function(n){t({value:n,done:e})}),n)})(r,o,(n=t[e](n)).done,n.value)}))}}}function x(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}var O=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};function E(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&l(n,t,e);return O(n,t),n}function S(t){return t&&t.__esModule?t:{default:t}}function A(t,n,e,r){if("a"===e&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?r:"a"===e?r.call(t):r?r.value:n.get(t)}function j(t,n,e,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,e):o?o.value=e:n.set(t,e),e}},function(n,e){n.exports=t},function(t,e){t.exports=n},function(t,n,e){"use strict";e.r(n),e.d(n,"contains",(function(){return o})),e.d(n,"includes",(function(){return o})),e.d(n,"difference",(function(){return a})),e.d(n,"find",(function(){return g})),e.d(n,"findIndex",(function(){return M})),e.d(n,"firstValue",(function(){return b})),e.d(n,"flatten",(function(){return P})),e.d(n,"flattenDeep",(function(){return x})),e.d(n,"getRange",(function(){return S})),e.d(n,"pull",(function(){return R})),e.d(n,"pullAt",(function(){return T})),e.d(n,"reduce",(function(){return B})),e.d(n,"remove",(function(){return k})),e.d(n,"sortBy",(function(){return L})),e.d(n,"union",(function(){return N})),e.d(n,"uniq",(function(){return D})),e.d(n,"valuesOfKey",(function(){return q})),e.d(n,"head",(function(){return F})),e.d(n,"last",(function(){return Y})),e.d(n,"startsWith",(function(){return G})),e.d(n,"endsWith",(function(){return X})),e.d(n,"filter",(function(){return i})),e.d(n,"every",(function(){return H})),e.d(n,"some",(function(){return V})),e.d(n,"group",(function(){return $})),e.d(n,"groupBy",(function(){return U})),e.d(n,"groupToMap",(function(){return z})),e.d(n,"getWrapBehavior",(function(){return Q})),e.d(n,"wrapBehavior",(function(){return Z})),e.d(n,"number2color",(function(){return J})),e.d(n,"parseRadius",(function(){return tt})),e.d(n,"clamp",(function(){return nt})),e.d(n,"fixedBase",(function(){return et})),e.d(n,"isDecimal",(function(){return ot})),e.d(n,"isEven",(function(){return it})),e.d(n,"isInteger",(function(){return at})),e.d(n,"isNegative",(function(){return ut})),e.d(n,"isNumberEqual",(function(){return ct})),e.d(n,"isOdd",(function(){return ft})),e.d(n,"isPositive",(function(){return st})),e.d(n,"max",(function(){return O})),e.d(n,"maxBy",(function(){return dt})),e.d(n,"min",(function(){return E})),e.d(n,"minBy",(function(){return lt})),e.d(n,"mod",(function(){return ht})),e.d(n,"toDegree",(function(){return pt})),e.d(n,"toInteger",(function(){return yt})),e.d(n,"toRadian",(function(){return gt})),e.d(n,"forIn",(function(){return Mt})),e.d(n,"has",(function(){return bt})),e.d(n,"hasKey",(function(){return Pt})),e.d(n,"hasValue",(function(){return xt})),e.d(n,"keys",(function(){return v})),e.d(n,"isMatch",(function(){return p})),e.d(n,"values",(function(){return _t})),e.d(n,"lowerCase",(function(){return Et})),e.d(n,"lowerFirst",(function(){return St})),e.d(n,"substitute",(function(){return At})),e.d(n,"upperCase",(function(){return jt})),e.d(n,"upperFirst",(function(){return wt})),e.d(n,"getType",(function(){return Ct})),e.d(n,"isArguments",(function(){return Tt})),e.d(n,"isArray",(function(){return d})),e.d(n,"isArrayLike",(function(){return r})),e.d(n,"isBoolean",(function(){return Bt})),e.d(n,"isDate",(function(){return kt})),e.d(n,"isError",(function(){return It})),e.d(n,"isFunction",(function(){return f})),e.d(n,"isFinite",(function(){return Lt})),e.d(n,"isNil",(function(){return s})),e.d(n,"isNull",(function(){return Dt})),e.d(n,"isNumber",(function(){return rt})),e.d(n,"isObject",(function(){return l})),e.d(n,"isObjectLike",(function(){return y})),e.d(n,"isPlainObject",(function(){return m})),e.d(n,"isPrototype",(function(){return qt})),e.d(n,"isRegExp",(function(){return Ft})),e.d(n,"isString",(function(){return I})),e.d(n,"isType",(function(){return c})),e.d(n,"isUndefined",(function(){return Yt})),e.d(n,"isElement",(function(){return Gt})),e.d(n,"requestAnimationFrame",(function(){return Xt})),e.d(n,"clearAnimationFrame",(function(){return Ht})),e.d(n,"augment",(function(){return Ut})),e.d(n,"clone",(function(){return $t})),e.d(n,"debounce",(function(){return Qt})),e.d(n,"memoize",(function(){return Zt})),e.d(n,"deepMix",(function(){return Jt})),e.d(n,"each",(function(){return h})),e.d(n,"extend",(function(){return tn})),e.d(n,"indexOf",(function(){return nn})),e.d(n,"isEmpty",(function(){return rn})),e.d(n,"isEqual",(function(){return an})),e.d(n,"isEqualWith",(function(){return un})),e.d(n,"map",(function(){return cn})),e.d(n,"mapValues",(function(){return sn})),e.d(n,"mix",(function(){return Wt})),e.d(n,"assign",(function(){return Wt})),e.d(n,"get",(function(){return dn})),e.d(n,"set",(function(){return ln})),e.d(n,"pick",(function(){return vn})),e.d(n,"omit",(function(){return pn})),e.d(n,"throttle",(function(){return yn})),e.d(n,"toArray",(function(){return mn})),e.d(n,"toString",(function(){return Ot})),e.d(n,"uniqueId",(function(){return Mn})),e.d(n,"noop",(function(){return bn})),e.d(n,"identity",(function(){return Pn})),e.d(n,"size",(function(){return _n})),e.d(n,"measureTextWidth",(function(){return En})),e.d(n,"getEllipsisText",(function(){return Sn})),e.d(n,"Cache",(function(){return An}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},o=function(t,n){return!!r(t)&&t.indexOf(n)>-1},i=function(t,n){if(!r(t))return t;for(var e=[],o=0;o<t.length;o++){var i=t[o];n(i,o)&&e.push(i)}return e},a=function(t,n){return void 0===n&&(n=[]),i(t,(function(t){return!o(n,t)}))},u={}.toString,c=function(t,n){return u.call(t)==="[object "+n+"]"},f=function(t){return c(t,"Function")},s=function(t){return null==t},d=function(t){return Array.isArray?Array.isArray(t):c(t,"Array")},l=function(t){var n=typeof t;return null!==t&&"object"===n||"function"===n};var h=function(t,n){if(t)if(d(t))for(var e=0,r=t.length;e<r&&!1!==n(t[e],e);e++);else if(l(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break},v=Object.keys?function(t){return Object.keys(t)}:function(t){var n=[];return h(t,(function(e,r){f(t)&&"prototype"===r||n.push(r)})),n};var p=function(t,n){var e=v(n),r=e.length;if(s(t))return!r;for(var o=0;o<r;o+=1){var i=e[o];if(n[i]!==t[i]||!(i in t))return!1}return!0},y=function(t){return"object"==typeof t&&null!==t},m=function(t){if(!y(t)||!c(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n};var g=function(t,n){if(!d(t))return null;var e;if(f(n)&&(e=n),m(n)&&(e=function(t){return p(t,n)}),e)for(var r=0;r<t.length;r+=1)if(e(t[r]))return t[r];return null};var M=function(t,n,e){void 0===e&&(e=0);for(var r=e;r<t.length;r++)if(n(t[r],r))return r;return-1},b=function(t,n){for(var e=null,r=0;r<t.length;r++){var o=t[r][n];if(!s(o)){e=d(o)?o[0]:o;break}}return e},P=function(t){if(!d(t))return[];for(var n=[],e=0;e<t.length;e++)n=n.concat(t[e]);return n},_=function(t,n){if(void 0===n&&(n=[]),d(t))for(var e=0;e<t.length;e+=1)_(t[e],n);else n.push(t);return n},x=_,O=function(t){if(d(t))return t.reduce((function(t,n){return Math.max(t,n)}),t[0])},E=function(t){if(d(t))return t.reduce((function(t,n){return Math.min(t,n)}),t[0])},S=function(t){var n=t.filter((function(t){return!isNaN(t)}));if(!n.length)return{min:0,max:0};if(d(t[0])){for(var e=[],r=0;r<t.length;r++)e=e.concat(t[r]);n=e}var o=O(n);return{min:E(n),max:o}},A=Array.prototype,j=A.splice,w=A.indexOf,R=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var r=0;r<n.length;r++)for(var o=n[r],i=-1;(i=w.call(t,o))>-1;)j.call(t,i,1);return t},C=Array.prototype.splice,T=function(t,n){if(!r(t))return[];for(var e=t?n.length:0,o=e-1;e--;){var i=void 0,a=n[e];e!==o&&a===i||(i=a,C.call(t,a,1))}return t},B=function(t,n,e){if(!d(t)&&!m(t))return t;var r=e;return h(t,(function(t,e){r=n(r,t,e)})),r},k=function(t,n){var e=[];if(!r(t))return e;for(var o=-1,i=[],a=t.length;++o<a;){var u=t[o];n(u,o,t)&&(e.push(u),i.push(o))}return T(t,i),e},I=function(t){return c(t,"String")};var L=function(t,n){var e;if(f(n))e=function(t,e){return n(t)-n(e)};else{var r=[];I(n)?r.push(n):d(n)&&(r=n),e=function(t,n){for(var e=0;e<r.length;e+=1){var o=r[e];if(t[o]>n[o])return 1;if(t[o]<n[o])return-1}return 0}}return t.sort(e),t};function D(t,n){void 0===n&&(n=new Map);var e=[];if(Array.isArray(t))for(var r=0,o=t.length;r<o;r++){var i=t[r];n.has(i)||(e.push(i),n.set(i,!0))}return e}var N=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return D([].concat.apply([],t))},q=function(t,n){for(var e=[],r={},o=0;o<t.length;o++){var i=t[o][n];if(!s(i)){d(i)||(i=[i]);for(var a=0;a<i.length;a++){var u=i[a];r[u]||(e.push(u),r[u]=!0)}}}return e};function F(t){if(r(t))return t[0]}function Y(t){if(r(t)){return t[t.length-1]}}var G=function(t,n){return!(!d(t)&&!I(t))&&t[0]===n};var X=function(t,n){return!(!d(t)&&!I(t))&&t[t.length-1]===n},H=function(t,n){for(var e=0;e<t.length;e++)if(!n(t[e],e))return!1;return!0},V=function(t,n){for(var e=0;e<t.length;e++)if(n(t[e],e))return!0;return!1},W=Object.prototype.hasOwnProperty;var U=function(t,n){if(!n||!d(t))return{};for(var e,r={},o=f(n)?n:function(t){return t[n]},i=0;i<t.length;i++){var a=t[i];e=o(a),W.call(r,e)?r[e].push(a):r[e]=[a]}return r};function z(t,n){if(!n)return{0:t};if(!f(n)){var e=d(n)?n:n.replace(/\s+/g,"").split("*");n=function(t){for(var n="_",r=0,o=e.length;r<o;r++)n+=t[e[r]]&&t[e[r]].toString();return n}}return U(t,n)}var $=function(t,n){if(!n)return[t];var e=z(t,n),r=[];for(var o in e)r.push(e[o]);return r};var Q=function(t,n){return t["_wrap_"+n]};var Z=function(t,n){if(t["_wrap_"+n])return t["_wrap_"+n];var e=function(e){t[n](e)};return t["_wrap_"+n]=e,e},K={};var J=function(t){var n=K[t];if(!n){for(var e=t.toString(16),r=e.length;r<6;r++)e="0"+e;n="#"+e,K[t]=n}return n};var tt=function(t){var n=0,e=0,r=0,o=0;return d(t)?1===t.length?n=e=r=o=t[0]:2===t.length?(n=r=t[0],e=o=t[1]):3===t.length?(n=t[0],e=o=t[1],r=t[2]):(n=t[0],e=t[1],r=t[2],o=t[3]):n=e=r=o=t,{r1:n,r2:e,r3:r,r4:o}},nt=function(t,n,e){return t<n?n:t>e?e:t},et=function(t,n){var e=n.toString(),r=e.indexOf(".");if(-1===r)return Math.round(t);var o=e.substr(r+1).length;return o>20&&(o=20),parseFloat(t.toFixed(o))},rt=function(t){return c(t,"Number")},ot=function(t){return rt(t)&&t%1!=0},it=function(t){return rt(t)&&t%2==0},at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},ut=function(t){return rt(t)&&t<0};function ct(t,n,e){return void 0===e&&(e=1e-5),Math.abs(t-n)<e}var ft=function(t){return rt(t)&&t%2!=0},st=function(t){return rt(t)&&t>0},dt=function(t,n){if(d(t)){for(var e,r=-1/0,o=0;o<t.length;o++){var i=t[o],a=f(n)?n(i):i[n];a>r&&(e=i,r=a)}return e}},lt=function(t,n){if(d(t)){for(var e,r=1/0,o=0;o<t.length;o++){var i=t[o],a=f(n)?n(i):i[n];a<r&&(e=i,r=a)}return e}},ht=function(t,n){return(t%n+n)%n},vt=180/Math.PI,pt=function(t){return vt*t},yt=parseInt,mt=Math.PI/180,gt=function(t){return mt*t},Mt=h,bt=function(t,n){return t.hasOwnProperty(n)},Pt=bt,_t=Object.values?function(t){return Object.values(t)}:function(t){var n=[];return h(t,(function(e,r){f(t)&&"prototype"===r||n.push(e)})),n},xt=function(t,n){return o(_t(t),n)},Ot=function(t){return s(t)?"":t.toString()},Et=function(t){return Ot(t).toLowerCase()},St=function(t){var n=Ot(t);return n.charAt(0).toLowerCase()+n.substring(1)};var At=function(t,n){return t&&n?t.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]})):t},jt=function(t){return Ot(t).toUpperCase()},wt=function(t){var n=Ot(t);return n.charAt(0).toUpperCase()+n.substring(1)},Rt={}.toString,Ct=function(t){return Rt.call(t).replace(/^\[object /,"").replace(/]$/,"")},Tt=function(t){return c(t,"Arguments")},Bt=function(t){return c(t,"Boolean")},kt=function(t){return c(t,"Date")},It=function(t){return c(t,"Error")},Lt=function(t){return rt(t)&&isFinite(t)},Dt=function(t){return null===t},Nt=Object.prototype,qt=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Nt)},Ft=function(t){return c(t,"RegExp")},Yt=function(t){return void 0===t},Gt=function(t){return t instanceof Element||t instanceof HTMLDocument};function Xt(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}function Ht(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}function Vt(t,n){for(var e in n)n.hasOwnProperty(e)&&"constructor"!==e&&void 0!==n[e]&&(t[e]=n[e])}function Wt(t,n,e,r){return n&&Vt(t,n),e&&Vt(t,e),r&&Vt(t,r),t}var Ut=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var e=t[0],r=1;r<t.length;r++){var o=t[r];f(o)&&(o=o.prototype),Wt(e.prototype,o)}},zt=function(t){if("object"!=typeof t||null===t)return t;var n;if(d(t)){n=[];for(var e=0,r=t.length;e<r;e++)"object"==typeof t[e]&&null!=t[e]?n[e]=zt(t[e]):n[e]=t[e]}else for(var o in n={},t)"object"==typeof t[o]&&null!=t[o]?n[o]=zt(t[o]):n[o]=t[o];return n},$t=zt;var Qt=function(t,n,e){var r;return function(){var o=this,i=arguments,a=function(){r=null,e||t.apply(o,i)},u=e&&!r;clearTimeout(r),r=setTimeout(a,n),u&&t.apply(o,i)}},Zt=function(t,n){if(!f(t))throw new TypeError("Expected a function");var e=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=n?n.apply(this,r):r[0],a=e.cache;if(a.has(i))return a.get(i);var u=t.apply(this,r);return a.set(i,u),u};return e.cache=new Map,e};function Kt(t,n,e,r){for(var o in e=e||0,r=r||5,n)if(n.hasOwnProperty(o)){var i=n[o];null!==i&&m(i)?(m(t[o])||(t[o]={}),e<r?Kt(t[o],i,e+1,r):t[o]=n[o]):d(i)?(t[o]=[],t[o]=t[o].concat(i)):void 0!==i&&(t[o]=i)}}var Jt=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var r=0;r<n.length;r+=1)Kt(t,n[r]);return t},tn=function(t,n,e,r){f(n)||(e=n,n=t,t=function(){});var o=Object.create?function(t,n){return Object.create(t,{constructor:{value:n}})}:function(t,n){function e(){}e.prototype=t;var r=new e;return r.constructor=n,r},i=o(n.prototype,t);return t.prototype=Wt(i,t.prototype),t.superclass=o(n.prototype,n),Wt(i,e),Wt(t,r),t},nn=function(t,n){if(!r(t))return-1;var e=Array.prototype.indexOf;if(e)return e.call(t,n);for(var o=-1,i=0;i<t.length;i++)if(t[i]===n){o=i;break}return o},en=Object.prototype.hasOwnProperty;var rn=function(t){if(s(t))return!0;if(r(t))return!t.length;var n=Ct(t);if("Map"===n||"Set"===n)return!t.size;if(qt(t))return!Object.keys(t).length;for(var e in t)if(en.call(t,e))return!1;return!0},on=function(t,n){if(t===n)return!0;if(!t||!n)return!1;if(I(t)||I(n))return!1;if(r(t)||r(n)){if(t.length!==n.length)return!1;for(var e=!0,o=0;o<t.length&&(e=on(t[o],n[o]));o++);return e}if(y(t)||y(n)){var i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length)return!1;for(e=!0,o=0;o<i.length&&(e=on(t[i[o]],n[i[o]]));o++);return e}return!1},an=on,un=function(t,n,e){return f(e)?!!e(t,n):an(t,n)},cn=function(t,n){if(!r(t))return t;for(var e=[],o=0;o<t.length;o++){var i=t[o];e.push(n(i,o))}return e},fn=function(t){return t},sn=function(t,n){void 0===n&&(n=fn);var e={};return l(t)&&!s(t)&&Object.keys(t).forEach((function(r){e[r]=n(t[r],r)})),e},dn=function(t,n,e){for(var r=0,o=I(n)?n.split("."):n;t&&r<o.length;)t=t[o[r++]];return void 0===t||r<o.length?e:t},ln=function(t,n,e){var r=t,o=I(n)?n.split("."):n;return o.forEach((function(t,n){n<o.length-1?(l(r[t])||(r[t]=rt(o[n+1])?[]:{}),r=r[t]):r[t]=e})),t},hn=Object.prototype.hasOwnProperty,vn=function(t,n){if(null===t||!m(t))return{};var e={};return h(n,(function(n){hn.call(t,n)&&(e[n]=t[n])})),e},pn=function(t,n){return B(t,(function(t,e,r){return n.includes(r)||(t[r]=e),t}),{})},yn=function(t,n,e){var r,o,i,a,u=0;e||(e={});var c=function(){u=!1===e.leading?0:Date.now(),r=null,a=t.apply(o,i),r||(o=i=null)},f=function(){var f=Date.now();u||!1!==e.leading||(u=f);var s=n-(f-u);return o=this,i=arguments,s<=0||s>n?(r&&(clearTimeout(r),r=null),u=f,a=t.apply(o,i),r||(o=i=null)):r||!1===e.trailing||(r=setTimeout(c,s)),a};return f.cancel=function(){clearTimeout(r),u=0,r=o=i=null},f},mn=function(t){return r(t)?Array.prototype.slice.call(t):[]},gn={},Mn=function(t){return gn[t=t||"g"]?gn[t]+=1:gn[t]=1,t+gn[t]},bn=function(){},Pn=function(t){return t};function _n(t){return s(t)?0:r(t)?t.length:Object.keys(t).length}var xn,On=e(0),En=Zt((function(t,n){void 0===n&&(n={});var e=n.fontSize,r=n.fontFamily,o=n.fontWeight,i=n.fontStyle,a=n.fontVariant;return xn||(xn=document.createElement("canvas").getContext("2d")),xn.font=[i,a,o,e+"px",r].join(" "),xn.measureText(I(t)?t:"").width}),(function(t,n){return void 0===n&&(n={}),Object(On.__spreadArrays)([t],_t(n)).join("")})),Sn=function(t,n,e,r){void 0===r&&(r="...");var o,i,a=En(r,e),u=I(t)?t:Ot(t),c=n,f=[];if(En(t,e)<=n)return t;for(;o=u.substr(0,16),!((i=En(o,e))+a>c&&i>c);)if(f.push(o),c-=i,!(u=u.substr(16)))return f.join("");for(;o=u.substr(0,1),!((i=En(o,e))+a>c);)if(f.push(o),c-=i,!(u=u.substr(1)))return f.join("");return""+f.join("")+r},An=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,n){var e=this.map[t];return void 0===e?n:e},t.prototype.set=function(t,n){this.map[t]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.distance=function(t,n,e,r){var o=t-e,i=n-r;return Math.sqrt(o*o+i*i)},n.getBBoxByArray=function(t,n){var e=(0,r.min)(t),o=(0,r.min)(n),i=(0,r.max)(t),a=(0,r.max)(n);return{x:e,y:o,width:i-e,height:a-o}},n.getBBoxRange=function(t,n,e,o){return{minX:(0,r.min)([t,e]),maxX:(0,r.max)([t,e]),minY:(0,r.min)([n,o]),maxY:(0,r.max)([n,o])}},n.isNumberEqual=function(t,n){return Math.abs(t-n)<.001},n.piMod=function(t){return(t+2*Math.PI)%(2*Math.PI)};var r=e(3)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.distance=o,n.inArc=function(t,n,e,r,i,a,u,c){var f=(Math.atan2(c-n,u-t)+2*Math.PI)%(2*Math.PI);if(f<r||f>i)return!1;var s={x:t+e*Math.cos(f),y:n+e*Math.sin(f)};return o(s.x,s.y,u,c)<=a/2},n.inBox=i,n.inLine=a,n.inPolygon=f,n.inPolygons=function(t,n,e){for(var r=!1,o=0;o<t.length;o++){var i=t[o];if(r=f(i,n,e))break}return r},n.inPolyline=function(t,n,e,r,o){var i=t.length;if(i<2)return!1;for(var u=0;u<i-1;u++){var c=t[u][0],f=t[u][1],s=t[u+1][0],d=t[u+1][1];if(a(c,f,s,d,n,e,r))return!0}if(o){var l=t[0],h=t[i-1];if(a(l[0],l[1],h[0],h[1],n,e,r))return!0}return!1},n.inRect=function(t,n,e,r,o,a,u){var c=o/2;return i(t-c,n-c,e,o,a,u)||i(t+e-c,n-c,o,r,a,u)||i(t+c,n+r-c,e,o,a,u)||i(t-c,n+c,o,r,a,u)};var r=e(21);function o(t,n,e,r){var o=t-e,i=n-r;return Math.sqrt(o*o+i*i)}function i(t,n,e,r,o,i){return o>=t&&o<=t+e&&i>=n&&i<=n+r}function a(t,n,e,o,i,a,u){var c=Math.min(t,e),f=Math.max(t,e),s=Math.min(n,o),d=Math.max(n,o),l=i/2;return a>=c-l&&a<=f+l&&u>=s-l&&u<=d+l&&r.Line.pointToLine(t,n,e,o,a,u)<=i/2}function u(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function c(t,n,e){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])&&Math.min(t[0],n[0])<=e[0]&&e[0]<=Math.max(t[0],n[0])&&Math.min(t[1],n[1])<=e[1]&&e[1]<=Math.max(t[1],n[1])}function f(t,n,e){var r=!1,o=t.length;if(o<=2)return!1;for(var i=0;i<o;i++){var a=t[i],f=t[(i+1)%o];if(c(a,f,[n,e]))return!0;u(a[1]-e)>0!=u(f[1]-e)>0&&u(n-(e-a[1])*(a[0]-f[0])/(a[1]-f[1])-a[0])<0&&(r=!r)}return r}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StyleRendererFactory=n.StyleRenderer=void 0;var r=e(1),o=r.Syringe.defineToken("StyleRendererFactory");n.StyleRendererFactory=o;var i=r.Syringe.defineToken("StyleRenderer");n.StyleRenderer=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ImagePool=void 0;var r=e(0),o=e(1),i=function(){function t(){this.imageCache={},this.patternCache={}}return t.prototype.getImageSync=function(t){return this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;return this.imageCache[t]?Promise.resolve(this.imageCache[t]):new Promise((function(e,r){var o=new window.Image;o.onload=function(){e(o)},o.onerror=function(t){r(t)},o.crossOrigin="Anonymous",o.src=t,n.imageCache[t]=o}))},t.prototype.getPatternSync=function(t){var n=this.generatePatternKey(t);if(this.patternCache[n])return this.patternCache[n]},t.prototype.createPattern=function(t,n){var e=this;return this.getOrCreateImage(t.src).then((function(r){var o=e.generatePatternKey(t),i=n.createPattern(r,t.repetition);return i&&(e.patternCache[o]=i),e.patternCache[o]}))},t.prototype.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t=(0,r.__decorate)([(0,o.singleton)()],t)}();n.ImagePool=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e(4),o=e(9),i={box:function(t,n,e,o){return(0,r.getBBoxByArray)([t,e],[n,o])},length:function(t,n,e,o){return(0,r.distance)(t,n,e,o)},pointAt:function(t,n,e,r,o){return{x:(1-o)*t+o*e,y:(1-o)*n+o*r}},pointDistance:function(t,n,e,o,i,a){var u=(e-t)*(i-t)+(o-n)*(a-n);return u<0?(0,r.distance)(t,n,i,a):u>(e-t)*(e-t)+(o-n)*(o-n)?(0,r.distance)(e,o,i,a):this.pointToLine(t,n,e,o,i,a)},pointToLine:function(t,n,e,r,i,a){var u=[e-t,r-n];if(o.vec2.exactEquals(u,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-n)*(a-n));var c=[-u[1],u[0]];o.vec2.normalize(c,c);var f=[i-t,a-n];return Math.abs(o.vec2.dot(f,c))},tangentAngle:function(t,n,e,r){return Math.atan2(r-n,e-t)}};n.default=i},function(t,n,e){"use strict";e.r(n),e.d(n,"glMatrix",(function(){return r})),e.d(n,"mat2",(function(){return o})),e.d(n,"mat2d",(function(){return i})),e.d(n,"mat3",(function(){return a})),e.d(n,"mat4",(function(){return u})),e.d(n,"quat",(function(){return s})),e.d(n,"quat2",(function(){return d})),e.d(n,"vec2",(function(){return l})),e.d(n,"vec3",(function(){return c})),e.d(n,"vec4",(function(){return f}));var r={};e.r(r),e.d(r,"EPSILON",(function(){return h})),e.d(r,"ARRAY_TYPE",(function(){return v})),e.d(r,"RANDOM",(function(){return p})),e.d(r,"setMatrixArrayType",(function(){return y})),e.d(r,"toRadian",(function(){return g})),e.d(r,"equals",(function(){return M}));var o={};e.r(o),e.d(o,"create",(function(){return b})),e.d(o,"clone",(function(){return P})),e.d(o,"copy",(function(){return _})),e.d(o,"identity",(function(){return x})),e.d(o,"fromValues",(function(){return O})),e.d(o,"set",(function(){return E})),e.d(o,"transpose",(function(){return S})),e.d(o,"invert",(function(){return A})),e.d(o,"adjoint",(function(){return j})),e.d(o,"determinant",(function(){return w})),e.d(o,"multiply",(function(){return R})),e.d(o,"rotate",(function(){return C})),e.d(o,"scale",(function(){return T})),e.d(o,"fromRotation",(function(){return B})),e.d(o,"fromScaling",(function(){return k})),e.d(o,"str",(function(){return I})),e.d(o,"frob",(function(){return L})),e.d(o,"LDU",(function(){return D})),e.d(o,"add",(function(){return N})),e.d(o,"subtract",(function(){return q})),e.d(o,"exactEquals",(function(){return F})),e.d(o,"equals",(function(){return Y})),e.d(o,"multiplyScalar",(function(){return G})),e.d(o,"multiplyScalarAndAdd",(function(){return X})),e.d(o,"mul",(function(){return H})),e.d(o,"sub",(function(){return V}));var i={};e.r(i),e.d(i,"create",(function(){return W})),e.d(i,"clone",(function(){return U})),e.d(i,"copy",(function(){return z})),e.d(i,"identity",(function(){return $})),e.d(i,"fromValues",(function(){return Q})),e.d(i,"set",(function(){return Z})),e.d(i,"invert",(function(){return K})),e.d(i,"determinant",(function(){return J})),e.d(i,"multiply",(function(){return tt})),e.d(i,"rotate",(function(){return nt})),e.d(i,"scale",(function(){return et})),e.d(i,"translate",(function(){return rt})),e.d(i,"fromRotation",(function(){return ot})),e.d(i,"fromScaling",(function(){return it})),e.d(i,"fromTranslation",(function(){return at})),e.d(i,"str",(function(){return ut})),e.d(i,"frob",(function(){return ct})),e.d(i,"add",(function(){return ft})),e.d(i,"subtract",(function(){return st})),e.d(i,"multiplyScalar",(function(){return dt})),e.d(i,"multiplyScalarAndAdd",(function(){return lt})),e.d(i,"exactEquals",(function(){return ht})),e.d(i,"equals",(function(){return vt})),e.d(i,"mul",(function(){return pt})),e.d(i,"sub",(function(){return yt}));var a={};e.r(a),e.d(a,"create",(function(){return mt})),e.d(a,"fromMat4",(function(){return gt})),e.d(a,"clone",(function(){return Mt})),e.d(a,"copy",(function(){return bt})),e.d(a,"fromValues",(function(){return Pt})),e.d(a,"set",(function(){return _t})),e.d(a,"identity",(function(){return xt})),e.d(a,"transpose",(function(){return Ot})),e.d(a,"invert",(function(){return Et})),e.d(a,"adjoint",(function(){return St})),e.d(a,"determinant",(function(){return At})),e.d(a,"multiply",(function(){return jt})),e.d(a,"translate",(function(){return wt})),e.d(a,"rotate",(function(){return Rt})),e.d(a,"scale",(function(){return Ct})),e.d(a,"fromTranslation",(function(){return Tt})),e.d(a,"fromRotation",(function(){return Bt})),e.d(a,"fromScaling",(function(){return kt})),e.d(a,"fromMat2d",(function(){return It})),e.d(a,"fromQuat",(function(){return Lt})),e.d(a,"normalFromMat4",(function(){return Dt})),e.d(a,"projection",(function(){return Nt})),e.d(a,"str",(function(){return qt})),e.d(a,"frob",(function(){return Ft})),e.d(a,"add",(function(){return Yt})),e.d(a,"subtract",(function(){return Gt})),e.d(a,"multiplyScalar",(function(){return Xt})),e.d(a,"multiplyScalarAndAdd",(function(){return Ht})),e.d(a,"exactEquals",(function(){return Vt})),e.d(a,"equals",(function(){return Wt})),e.d(a,"mul",(function(){return Ut})),e.d(a,"sub",(function(){return zt}));var u={};e.r(u),e.d(u,"create",(function(){return $t})),e.d(u,"clone",(function(){return Qt})),e.d(u,"copy",(function(){return Zt})),e.d(u,"fromValues",(function(){return Kt})),e.d(u,"set",(function(){return Jt})),e.d(u,"identity",(function(){return tn})),e.d(u,"transpose",(function(){return nn})),e.d(u,"invert",(function(){return en})),e.d(u,"adjoint",(function(){return rn})),e.d(u,"determinant",(function(){return on})),e.d(u,"multiply",(function(){return an})),e.d(u,"translate",(function(){return un})),e.d(u,"scale",(function(){return cn})),e.d(u,"rotate",(function(){return fn})),e.d(u,"rotateX",(function(){return sn})),e.d(u,"rotateY",(function(){return dn})),e.d(u,"rotateZ",(function(){return ln})),e.d(u,"fromTranslation",(function(){return hn})),e.d(u,"fromScaling",(function(){return vn})),e.d(u,"fromRotation",(function(){return pn})),e.d(u,"fromXRotation",(function(){return yn})),e.d(u,"fromYRotation",(function(){return mn})),e.d(u,"fromZRotation",(function(){return gn})),e.d(u,"fromRotationTranslation",(function(){return Mn})),e.d(u,"fromQuat2",(function(){return bn})),e.d(u,"getTranslation",(function(){return Pn})),e.d(u,"getScaling",(function(){return _n})),e.d(u,"getRotation",(function(){return xn})),e.d(u,"fromRotationTranslationScale",(function(){return On})),e.d(u,"fromRotationTranslationScaleOrigin",(function(){return En})),e.d(u,"fromQuat",(function(){return Sn})),e.d(u,"frustum",(function(){return An})),e.d(u,"perspectiveNO",(function(){return jn})),e.d(u,"perspective",(function(){return wn})),e.d(u,"perspectiveZO",(function(){return Rn})),e.d(u,"perspectiveFromFieldOfView",(function(){return Cn})),e.d(u,"orthoNO",(function(){return Tn})),e.d(u,"ortho",(function(){return Bn})),e.d(u,"orthoZO",(function(){return kn})),e.d(u,"lookAt",(function(){return In})),e.d(u,"targetTo",(function(){return Ln})),e.d(u,"str",(function(){return Dn})),e.d(u,"frob",(function(){return Nn})),e.d(u,"add",(function(){return qn})),e.d(u,"subtract",(function(){return Fn})),e.d(u,"multiplyScalar",(function(){return Yn})),e.d(u,"multiplyScalarAndAdd",(function(){return Gn})),e.d(u,"exactEquals",(function(){return Xn})),e.d(u,"equals",(function(){return Hn})),e.d(u,"mul",(function(){return Vn})),e.d(u,"sub",(function(){return Wn}));var c={};e.r(c),e.d(c,"create",(function(){return Un})),e.d(c,"clone",(function(){return zn})),e.d(c,"length",(function(){return $n})),e.d(c,"fromValues",(function(){return Qn})),e.d(c,"copy",(function(){return Zn})),e.d(c,"set",(function(){return Kn})),e.d(c,"add",(function(){return Jn})),e.d(c,"subtract",(function(){return te})),e.d(c,"multiply",(function(){return ne})),e.d(c,"divide",(function(){return ee})),e.d(c,"ceil",(function(){return re})),e.d(c,"floor",(function(){return oe})),e.d(c,"min",(function(){return ie})),e.d(c,"max",(function(){return ae})),e.d(c,"round",(function(){return ue})),e.d(c,"scale",(function(){return ce})),e.d(c,"scaleAndAdd",(function(){return fe})),e.d(c,"distance",(function(){return se})),e.d(c,"squaredDistance",(function(){return de})),e.d(c,"squaredLength",(function(){return le})),e.d(c,"negate",(function(){return he})),e.d(c,"inverse",(function(){return ve})),e.d(c,"normalize",(function(){return pe})),e.d(c,"dot",(function(){return ye})),e.d(c,"cross",(function(){return me})),e.d(c,"lerp",(function(){return ge})),e.d(c,"hermite",(function(){return Me})),e.d(c,"bezier",(function(){return be})),e.d(c,"random",(function(){return Pe})),e.d(c,"transformMat4",(function(){return _e})),e.d(c,"transformMat3",(function(){return xe})),e.d(c,"transformQuat",(function(){return Oe})),e.d(c,"rotateX",(function(){return Ee})),e.d(c,"rotateY",(function(){return Se})),e.d(c,"rotateZ",(function(){return Ae})),e.d(c,"angle",(function(){return je})),e.d(c,"zero",(function(){return we})),e.d(c,"str",(function(){return Re})),e.d(c,"exactEquals",(function(){return Ce})),e.d(c,"equals",(function(){return Te})),e.d(c,"sub",(function(){return ke})),e.d(c,"mul",(function(){return Ie})),e.d(c,"div",(function(){return Le})),e.d(c,"dist",(function(){return De})),e.d(c,"sqrDist",(function(){return Ne})),e.d(c,"len",(function(){return qe})),e.d(c,"sqrLen",(function(){return Fe})),e.d(c,"forEach",(function(){return Ye}));var f={};e.r(f),e.d(f,"create",(function(){return Ge})),e.d(f,"clone",(function(){return Xe})),e.d(f,"fromValues",(function(){return He})),e.d(f,"copy",(function(){return Ve})),e.d(f,"set",(function(){return We})),e.d(f,"add",(function(){return Ue})),e.d(f,"subtract",(function(){return ze})),e.d(f,"multiply",(function(){return $e})),e.d(f,"divide",(function(){return Qe})),e.d(f,"ceil",(function(){return Ze})),e.d(f,"floor",(function(){return Ke})),e.d(f,"min",(function(){return Je})),e.d(f,"max",(function(){return tr})),e.d(f,"round",(function(){return nr})),e.d(f,"scale",(function(){return er})),e.d(f,"scaleAndAdd",(function(){return rr})),e.d(f,"distance",(function(){return or})),e.d(f,"squaredDistance",(function(){return ir})),e.d(f,"length",(function(){return ar})),e.d(f,"squaredLength",(function(){return ur})),e.d(f,"negate",(function(){return cr})),e.d(f,"inverse",(function(){return fr})),e.d(f,"normalize",(function(){return sr})),e.d(f,"dot",(function(){return dr})),e.d(f,"cross",(function(){return lr})),e.d(f,"lerp",(function(){return hr})),e.d(f,"random",(function(){return vr})),e.d(f,"transformMat4",(function(){return pr})),e.d(f,"transformQuat",(function(){return yr})),e.d(f,"zero",(function(){return mr})),e.d(f,"str",(function(){return gr})),e.d(f,"exactEquals",(function(){return Mr})),e.d(f,"equals",(function(){return br})),e.d(f,"sub",(function(){return Pr})),e.d(f,"mul",(function(){return _r})),e.d(f,"div",(function(){return xr})),e.d(f,"dist",(function(){return Or})),e.d(f,"sqrDist",(function(){return Er})),e.d(f,"len",(function(){return Sr})),e.d(f,"sqrLen",(function(){return Ar})),e.d(f,"forEach",(function(){return jr}));var s={};e.r(s),e.d(s,"create",(function(){return wr})),e.d(s,"identity",(function(){return Rr})),e.d(s,"setAxisAngle",(function(){return Cr})),e.d(s,"getAxisAngle",(function(){return Tr})),e.d(s,"getAngle",(function(){return Br})),e.d(s,"multiply",(function(){return kr})),e.d(s,"rotateX",(function(){return Ir})),e.d(s,"rotateY",(function(){return Lr})),e.d(s,"rotateZ",(function(){return Dr})),e.d(s,"calculateW",(function(){return Nr})),e.d(s,"exp",(function(){return qr})),e.d(s,"ln",(function(){return Fr})),e.d(s,"pow",(function(){return Yr})),e.d(s,"slerp",(function(){return Gr})),e.d(s,"random",(function(){return Xr})),e.d(s,"invert",(function(){return Hr})),e.d(s,"conjugate",(function(){return Vr})),e.d(s,"fromMat3",(function(){return Wr})),e.d(s,"fromEuler",(function(){return Ur})),e.d(s,"str",(function(){return zr})),e.d(s,"clone",(function(){return no})),e.d(s,"fromValues",(function(){return eo})),e.d(s,"copy",(function(){return ro})),e.d(s,"set",(function(){return oo})),e.d(s,"add",(function(){return io})),e.d(s,"mul",(function(){return ao})),e.d(s,"scale",(function(){return uo})),e.d(s,"dot",(function(){return co})),e.d(s,"lerp",(function(){return fo})),e.d(s,"length",(function(){return so})),e.d(s,"len",(function(){return lo})),e.d(s,"squaredLength",(function(){return ho})),e.d(s,"sqrLen",(function(){return vo})),e.d(s,"normalize",(function(){return po})),e.d(s,"exactEquals",(function(){return yo})),e.d(s,"equals",(function(){return mo})),e.d(s,"rotationTo",(function(){return go})),e.d(s,"sqlerp",(function(){return Mo})),e.d(s,"setAxes",(function(){return bo}));var d={};e.r(d),e.d(d,"create",(function(){return Po})),e.d(d,"clone",(function(){return _o})),e.d(d,"fromValues",(function(){return xo})),e.d(d,"fromRotationTranslationValues",(function(){return Oo})),e.d(d,"fromRotationTranslation",(function(){return Eo})),e.d(d,"fromTranslation",(function(){return So})),e.d(d,"fromRotation",(function(){return Ao})),e.d(d,"fromMat4",(function(){return jo})),e.d(d,"copy",(function(){return wo})),e.d(d,"identity",(function(){return Ro})),e.d(d,"set",(function(){return Co})),e.d(d,"getReal",(function(){return To})),e.d(d,"getDual",(function(){return Bo})),e.d(d,"setReal",(function(){return ko})),e.d(d,"setDual",(function(){return Io})),e.d(d,"getTranslation",(function(){return Lo})),e.d(d,"translate",(function(){return Do})),e.d(d,"rotateX",(function(){return No})),e.d(d,"rotateY",(function(){return qo})),e.d(d,"rotateZ",(function(){return Fo})),e.d(d,"rotateByQuatAppend",(function(){return Yo})),e.d(d,"rotateByQuatPrepend",(function(){return Go})),e.d(d,"rotateAroundAxis",(function(){return Xo})),e.d(d,"add",(function(){return Ho})),e.d(d,"multiply",(function(){return Vo})),e.d(d,"mul",(function(){return Wo})),e.d(d,"scale",(function(){return Uo})),e.d(d,"dot",(function(){return zo})),e.d(d,"lerp",(function(){return $o})),e.d(d,"invert",(function(){return Qo})),e.d(d,"conjugate",(function(){return Zo})),e.d(d,"length",(function(){return Ko})),e.d(d,"len",(function(){return Jo})),e.d(d,"squaredLength",(function(){return ti})),e.d(d,"sqrLen",(function(){return ni})),e.d(d,"normalize",(function(){return ei})),e.d(d,"str",(function(){return ri})),e.d(d,"exactEquals",(function(){return oi})),e.d(d,"equals",(function(){return ii}));var l={};e.r(l),e.d(l,"create",(function(){return ai})),e.d(l,"clone",(function(){return ui})),e.d(l,"fromValues",(function(){return ci})),e.d(l,"copy",(function(){return fi})),e.d(l,"set",(function(){return si})),e.d(l,"add",(function(){return di})),e.d(l,"subtract",(function(){return li})),e.d(l,"multiply",(function(){return hi})),e.d(l,"divide",(function(){return vi})),e.d(l,"ceil",(function(){return pi})),e.d(l,"floor",(function(){return yi})),e.d(l,"min",(function(){return mi})),e.d(l,"max",(function(){return gi})),e.d(l,"round",(function(){return Mi})),e.d(l,"scale",(function(){return bi})),e.d(l,"scaleAndAdd",(function(){return Pi})),e.d(l,"distance",(function(){return _i})),e.d(l,"squaredDistance",(function(){return xi})),e.d(l,"length",(function(){return Oi})),e.d(l,"squaredLength",(function(){return Ei})),e.d(l,"negate",(function(){return Si})),e.d(l,"inverse",(function(){return Ai})),e.d(l,"normalize",(function(){return ji})),e.d(l,"dot",(function(){return wi})),e.d(l,"cross",(function(){return Ri})),e.d(l,"lerp",(function(){return Ci})),e.d(l,"random",(function(){return Ti})),e.d(l,"transformMat2",(function(){return Bi})),e.d(l,"transformMat2d",(function(){return ki})),e.d(l,"transformMat3",(function(){return Ii})),e.d(l,"transformMat4",(function(){return Li})),e.d(l,"rotate",(function(){return Di})),e.d(l,"angle",(function(){return Ni})),e.d(l,"zero",(function(){return qi})),e.d(l,"str",(function(){return Fi})),e.d(l,"exactEquals",(function(){return Yi})),e.d(l,"equals",(function(){return Gi})),e.d(l,"len",(function(){return Xi})),e.d(l,"sub",(function(){return Hi})),e.d(l,"mul",(function(){return Vi})),e.d(l,"div",(function(){return Wi})),e.d(l,"dist",(function(){return Ui})),e.d(l,"sqrDist",(function(){return zi})),e.d(l,"sqrLen",(function(){return $i})),e.d(l,"forEach",(function(){return Qi}));var h=1e-6,v="undefined"!=typeof Float32Array?Float32Array:Array,p=Math.random;function y(t){v=t}var m=Math.PI/180;function g(t){return t*m}function M(t,n){return Math.abs(t-n)<=h*Math.max(1,Math.abs(t),Math.abs(n))}function b(){var t=new v(4);return v!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function P(t){var n=new v(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function _(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function x(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function O(t,n,e,r){var o=new v(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o}function E(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t}function S(t,n){if(t===n){var e=n[1];t[1]=n[2],t[2]=e}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t}function A(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e*i-o*r;return a?(a=1/a,t[0]=i*a,t[1]=-r*a,t[2]=-o*a,t[3]=e*a,t):null}function j(t,n){var e=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=e,t}function w(t){return t[0]*t[3]-t[2]*t[1]}function R(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1],f=e[2],s=e[3];return t[0]=r*u+i*c,t[1]=o*u+a*c,t[2]=r*f+i*s,t[3]=o*f+a*s,t}function C(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+i*u,t[1]=o*c+a*u,t[2]=r*-u+i*c,t[3]=o*-u+a*c,t}function T(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1];return t[0]=r*u,t[1]=o*u,t[2]=i*c,t[3]=a*c,t}function B(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t}function k(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t}function I(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 D(t,n,e,r){return t[2]=r[2]/r[0],e[0]=r[0],e[1]=r[1],e[3]=r[3]-t[2]*e[1],[t,n,e]}function N(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t}function q(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function F(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function Y(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=n[0],u=n[1],c=n[2],f=n[3];return Math.abs(e-a)<=h*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-u)<=h*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=h*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-f)<=h*Math.max(1,Math.abs(i),Math.abs(f))}function G(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function X(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t}Math.hypot||(Math.hypot=function(){for(var t=0,n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var H=R,V=q;function W(){var t=new v(6);return v!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function U(t){var n=new v(6);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function z(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[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 Q(t,n,e,r,o,i){var a=new v(6);return a[0]=t,a[1]=n,a[2]=e,a[3]=r,a[4]=o,a[5]=i,a}function Z(t,n,e,r,o,i,a){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t}function K(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=e*i-r*o;return c?(c=1/c,t[0]=i*c,t[1]=-r*c,t[2]=-o*c,t[3]=e*c,t[4]=(o*u-i*a)*c,t[5]=(r*a-e*u)*c,t):null}function J(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=e[0],s=e[1],d=e[2],l=e[3],h=e[4],v=e[5];return t[0]=r*f+i*s,t[1]=o*f+a*s,t[2]=r*d+i*l,t[3]=o*d+a*l,t[4]=r*h+i*v+u,t[5]=o*h+a*v+c,t}function nt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=Math.sin(e),s=Math.cos(e);return t[0]=r*s+i*f,t[1]=o*s+a*f,t[2]=r*-f+i*s,t[3]=o*-f+a*s,t[4]=u,t[5]=c,t}function et(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=e[0],s=e[1];return t[0]=r*f,t[1]=o*f,t[2]=i*s,t[3]=a*s,t[4]=u,t[5]=c,t}function rt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=e[0],s=e[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=r*f+i*s+u,t[5]=o*f+a*s+c,t}function ot(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=-e,t[3]=r,t[4]=0,t[5]=0,t}function it(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t}function at(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t}function ut(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 ft(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t}function st(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t}function dt(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t}function lt(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t}function ht(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]}function vt(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=n[0],f=n[1],s=n[2],d=n[3],l=n[4],v=n[5];return Math.abs(e-c)<=h*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(r-f)<=h*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(o-s)<=h*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(i-d)<=h*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-l)<=h*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(u-v)<=h*Math.max(1,Math.abs(u),Math.abs(v))}var pt=tt,yt=st;function mt(){var t=new v(9);return v!=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 gt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function Mt(t){var n=new v(9);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n}function bt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function Pt(t,n,e,r,o,i,a,u,c){var f=new v(9);return f[0]=t,f[1]=n,f[2]=e,f[3]=r,f[4]=o,f[5]=i,f[6]=a,f[7]=u,f[8]=c,f}function _t(t,n,e,r,o,i,a,u,c,f){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=u,t[7]=c,t[8]=f,t}function xt(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 Ot(t,n){if(t===n){var e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function Et(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],f=n[7],s=n[8],d=s*a-u*f,l=-s*i+u*c,h=f*i-a*c,v=e*d+r*l+o*h;return v?(v=1/v,t[0]=d*v,t[1]=(-s*r+o*f)*v,t[2]=(u*r-o*a)*v,t[3]=l*v,t[4]=(s*e-o*c)*v,t[5]=(-u*e+o*i)*v,t[6]=h*v,t[7]=(-f*e+r*c)*v,t[8]=(a*e-r*i)*v,t):null}function St(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],f=n[7],s=n[8];return t[0]=a*s-u*f,t[1]=o*f-r*s,t[2]=r*u-o*a,t[3]=u*c-i*s,t[4]=e*s-o*c,t[5]=o*i-e*u,t[6]=i*f-a*c,t[7]=r*c-e*f,t[8]=e*a-r*i,t}function At(t){var n=t[0],e=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6],c=t[7],f=t[8];return n*(f*i-a*c)+e*(-f*o+a*u)+r*(c*o-i*u)}function jt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=n[8],l=e[0],h=e[1],v=e[2],p=e[3],y=e[4],m=e[5],g=e[6],M=e[7],b=e[8];return t[0]=l*r+h*a+v*f,t[1]=l*o+h*u+v*s,t[2]=l*i+h*c+v*d,t[3]=p*r+y*a+m*f,t[4]=p*o+y*u+m*s,t[5]=p*i+y*c+m*d,t[6]=g*r+M*a+b*f,t[7]=g*o+M*u+b*s,t[8]=g*i+M*c+b*d,t}function wt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=n[8],l=e[0],h=e[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=u,t[5]=c,t[6]=l*r+h*a+f,t[7]=l*o+h*u+s,t[8]=l*i+h*c+d,t}function Rt(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=n[8],l=Math.sin(e),h=Math.cos(e);return t[0]=h*r+l*a,t[1]=h*o+l*u,t[2]=h*i+l*c,t[3]=h*a-l*r,t[4]=h*u-l*o,t[5]=h*c-l*i,t[6]=f,t[7]=s,t[8]=d,t}function Ct(t,n,e){var r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function Tt(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t}function Bt(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function kt(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function It(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t}function Lt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e+e,u=r+r,c=o+o,f=e*a,s=r*a,d=r*u,l=o*a,h=o*u,v=o*c,p=i*a,y=i*u,m=i*c;return t[0]=1-d-v,t[3]=s-m,t[6]=l+y,t[1]=s+m,t[4]=1-f-v,t[7]=h-p,t[2]=l-y,t[5]=h+p,t[8]=1-f-d,t}function Dt(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],f=n[7],s=n[8],d=n[9],l=n[10],h=n[11],v=n[12],p=n[13],y=n[14],m=n[15],g=e*u-r*a,M=e*c-o*a,b=e*f-i*a,P=r*c-o*u,_=r*f-i*u,x=o*f-i*c,O=s*p-d*v,E=s*y-l*v,S=s*m-h*v,A=d*y-l*p,j=d*m-h*p,w=l*m-h*y,R=g*w-M*j+b*A+P*S-_*E+x*O;return R?(R=1/R,t[0]=(u*w-c*j+f*A)*R,t[1]=(c*S-a*w-f*E)*R,t[2]=(a*j-u*S+f*O)*R,t[3]=(o*j-r*w-i*A)*R,t[4]=(e*w-o*S+i*E)*R,t[5]=(r*S-e*j-i*O)*R,t[6]=(p*x-y*_+m*P)*R,t[7]=(y*b-v*x-m*M)*R,t[8]=(v*_-p*b+m*g)*R,t):null}function Nt(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function qt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Ft(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Yt(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t}function Gt(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}function Xt(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t}function Ht(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t}function Vt(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}function Wt(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=t[6],f=t[7],s=t[8],d=n[0],l=n[1],v=n[2],p=n[3],y=n[4],m=n[5],g=n[6],M=n[7],b=n[8];return Math.abs(e-d)<=h*Math.max(1,Math.abs(e),Math.abs(d))&&Math.abs(r-l)<=h*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-v)<=h*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(i-p)<=h*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-y)<=h*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(u-m)<=h*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(c-g)<=h*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(f-M)<=h*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(s-b)<=h*Math.max(1,Math.abs(s),Math.abs(b))}var Ut=jt,zt=Gt;function $t(){var t=new v(16);return v!=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 Qt(t){var n=new v(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Zt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function Kt(t,n,e,r,o,i,a,u,c,f,s,d,l,h,p,y){var m=new v(16);return m[0]=t,m[1]=n,m[2]=e,m[3]=r,m[4]=o,m[5]=i,m[6]=a,m[7]=u,m[8]=c,m[9]=f,m[10]=s,m[11]=d,m[12]=l,m[13]=h,m[14]=p,m[15]=y,m}function Jt(t,n,e,r,o,i,a,u,c,f,s,d,l,h,v,p,y){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=u,t[7]=c,t[8]=f,t[9]=s,t[10]=d,t[11]=l,t[12]=h,t[13]=v,t[14]=p,t[15]=y,t}function tn(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 nn(t,n){if(t===n){var e=n[1],r=n[2],o=n[3],i=n[6],a=n[7],u=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=e,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=i,t[11]=n[14],t[12]=o,t[13]=a,t[14]=u}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function en(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],f=n[7],s=n[8],d=n[9],l=n[10],h=n[11],v=n[12],p=n[13],y=n[14],m=n[15],g=e*u-r*a,M=e*c-o*a,b=e*f-i*a,P=r*c-o*u,_=r*f-i*u,x=o*f-i*c,O=s*p-d*v,E=s*y-l*v,S=s*m-h*v,A=d*y-l*p,j=d*m-h*p,w=l*m-h*y,R=g*w-M*j+b*A+P*S-_*E+x*O;return R?(R=1/R,t[0]=(u*w-c*j+f*A)*R,t[1]=(o*j-r*w-i*A)*R,t[2]=(p*x-y*_+m*P)*R,t[3]=(l*_-d*x-h*P)*R,t[4]=(c*S-a*w-f*E)*R,t[5]=(e*w-o*S+i*E)*R,t[6]=(y*b-v*x-m*M)*R,t[7]=(s*x-l*b+h*M)*R,t[8]=(a*j-u*S+f*O)*R,t[9]=(r*S-e*j-i*O)*R,t[10]=(v*_-p*b+m*g)*R,t[11]=(d*b-s*_-h*g)*R,t[12]=(u*E-a*A-c*O)*R,t[13]=(e*A-r*E+o*O)*R,t[14]=(p*M-v*P-y*g)*R,t[15]=(s*P-d*M+l*g)*R,t):null}function rn(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=n[4],u=n[5],c=n[6],f=n[7],s=n[8],d=n[9],l=n[10],h=n[11],v=n[12],p=n[13],y=n[14],m=n[15];return t[0]=u*(l*m-h*y)-d*(c*m-f*y)+p*(c*h-f*l),t[1]=-(r*(l*m-h*y)-d*(o*m-i*y)+p*(o*h-i*l)),t[2]=r*(c*m-f*y)-u*(o*m-i*y)+p*(o*f-i*c),t[3]=-(r*(c*h-f*l)-u*(o*h-i*l)+d*(o*f-i*c)),t[4]=-(a*(l*m-h*y)-s*(c*m-f*y)+v*(c*h-f*l)),t[5]=e*(l*m-h*y)-s*(o*m-i*y)+v*(o*h-i*l),t[6]=-(e*(c*m-f*y)-a*(o*m-i*y)+v*(o*f-i*c)),t[7]=e*(c*h-f*l)-a*(o*h-i*l)+s*(o*f-i*c),t[8]=a*(d*m-h*p)-s*(u*m-f*p)+v*(u*h-f*d),t[9]=-(e*(d*m-h*p)-s*(r*m-i*p)+v*(r*h-i*d)),t[10]=e*(u*m-f*p)-a*(r*m-i*p)+v*(r*f-i*u),t[11]=-(e*(u*h-f*d)-a*(r*h-i*d)+s*(r*f-i*u)),t[12]=-(a*(d*y-l*p)-s*(u*y-c*p)+v*(u*l-c*d)),t[13]=e*(d*y-l*p)-s*(r*y-o*p)+v*(r*l-o*d),t[14]=-(e*(u*y-c*p)-a*(r*y-o*p)+v*(r*c-o*u)),t[15]=e*(u*l-c*d)-a*(r*l-o*d)+s*(r*c-o*u),t}function on(t){var n=t[0],e=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6],c=t[7],f=t[8],s=t[9],d=t[10],l=t[11],h=t[12],v=t[13],p=t[14],y=t[15];return(n*a-e*i)*(d*y-l*p)-(n*u-r*i)*(s*y-l*v)+(n*c-o*i)*(s*p-d*v)+(e*u-r*a)*(f*y-l*h)-(e*c-o*a)*(f*p-d*h)+(r*c-o*u)*(f*v-s*h)}function an(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=n[8],l=n[9],h=n[10],v=n[11],p=n[12],y=n[13],m=n[14],g=n[15],M=e[0],b=e[1],P=e[2],_=e[3];return t[0]=M*r+b*u+P*d+_*p,t[1]=M*o+b*c+P*l+_*y,t[2]=M*i+b*f+P*h+_*m,t[3]=M*a+b*s+P*v+_*g,M=e[4],b=e[5],P=e[6],_=e[7],t[4]=M*r+b*u+P*d+_*p,t[5]=M*o+b*c+P*l+_*y,t[6]=M*i+b*f+P*h+_*m,t[7]=M*a+b*s+P*v+_*g,M=e[8],b=e[9],P=e[10],_=e[11],t[8]=M*r+b*u+P*d+_*p,t[9]=M*o+b*c+P*l+_*y,t[10]=M*i+b*f+P*h+_*m,t[11]=M*a+b*s+P*v+_*g,M=e[12],b=e[13],P=e[14],_=e[15],t[12]=M*r+b*u+P*d+_*p,t[13]=M*o+b*c+P*l+_*y,t[14]=M*i+b*f+P*h+_*m,t[15]=M*a+b*s+P*v+_*g,t}function un(t,n,e){var r,o,i,a,u,c,f,s,d,l,h,v,p=e[0],y=e[1],m=e[2];return n===t?(t[12]=n[0]*p+n[4]*y+n[8]*m+n[12],t[13]=n[1]*p+n[5]*y+n[9]*m+n[13],t[14]=n[2]*p+n[6]*y+n[10]*m+n[14],t[15]=n[3]*p+n[7]*y+n[11]*m+n[15]):(r=n[0],o=n[1],i=n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=n[8],l=n[9],h=n[10],v=n[11],t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=u,t[5]=c,t[6]=f,t[7]=s,t[8]=d,t[9]=l,t[10]=h,t[11]=v,t[12]=r*p+u*y+d*m+n[12],t[13]=o*p+c*y+l*m+n[13],t[14]=i*p+f*y+h*m+n[14],t[15]=a*p+s*y+v*m+n[15]),t}function cn(t,n,e){var r=e[0],o=e[1],i=e[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*i,t[9]=n[9]*i,t[10]=n[10]*i,t[11]=n[11]*i,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function fn(t,n,e,r){var o,i,a,u,c,f,s,d,l,v,p,y,m,g,M,b,P,_,x,O,E,S,A,j,w=r[0],R=r[1],C=r[2],T=Math.hypot(w,R,C);return T<h?null:(w*=T=1/T,R*=T,C*=T,o=Math.sin(e),a=1-(i=Math.cos(e)),u=n[0],c=n[1],f=n[2],s=n[3],d=n[4],l=n[5],v=n[6],p=n[7],y=n[8],m=n[9],g=n[10],M=n[11],b=w*w*a+i,P=R*w*a+C*o,_=C*w*a-R*o,x=w*R*a-C*o,O=R*R*a+i,E=C*R*a+w*o,S=w*C*a+R*o,A=R*C*a-w*o,j=C*C*a+i,t[0]=u*b+d*P+y*_,t[1]=c*b+l*P+m*_,t[2]=f*b+v*P+g*_,t[3]=s*b+p*P+M*_,t[4]=u*x+d*O+y*E,t[5]=c*x+l*O+m*E,t[6]=f*x+v*O+g*E,t[7]=s*x+p*O+M*E,t[8]=u*S+d*A+y*j,t[9]=c*S+l*A+m*j,t[10]=f*S+v*A+g*j,t[11]=s*S+p*A+M*j,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)}function sn(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[4],a=n[5],u=n[6],c=n[7],f=n[8],s=n[9],d=n[10],l=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=i*o+f*r,t[5]=a*o+s*r,t[6]=u*o+d*r,t[7]=c*o+l*r,t[8]=f*o-i*r,t[9]=s*o-a*r,t[10]=d*o-u*r,t[11]=l*o-c*r,t}function dn(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[0],a=n[1],u=n[2],c=n[3],f=n[8],s=n[9],d=n[10],l=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=i*o-f*r,t[1]=a*o-s*r,t[2]=u*o-d*r,t[3]=c*o-l*r,t[8]=i*r+f*o,t[9]=a*r+s*o,t[10]=u*r+d*o,t[11]=c*r+l*o,t}function ln(t,n,e){var r=Math.sin(e),o=Math.cos(e),i=n[0],a=n[1],u=n[2],c=n[3],f=n[4],s=n[5],d=n[6],l=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=i*o+f*r,t[1]=a*o+s*r,t[2]=u*o+d*r,t[3]=c*o+l*r,t[4]=f*o-i*r,t[5]=s*o-a*r,t[6]=d*o-u*r,t[7]=l*o-c*r,t}function hn(t,n){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]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function vn(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pn(t,n,e){var r,o,i,a=e[0],u=e[1],c=e[2],f=Math.hypot(a,u,c);return f<h?null:(a*=f=1/f,u*=f,c*=f,r=Math.sin(n),i=1-(o=Math.cos(n)),t[0]=a*a*i+o,t[1]=u*a*i+c*r,t[2]=c*a*i-u*r,t[3]=0,t[4]=a*u*i-c*r,t[5]=u*u*i+o,t[6]=c*u*i+a*r,t[7]=0,t[8]=a*c*i+u*r,t[9]=u*c*i-a*r,t[10]=c*c*i+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function yn(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=e,t[7]=0,t[8]=0,t[9]=-e,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mn(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-e,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=e,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function gn(t,n){var e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=0,t[4]=-e,t[5]=r,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 Mn(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=r+r,c=o+o,f=i+i,s=r*u,d=r*c,l=r*f,h=o*c,v=o*f,p=i*f,y=a*u,m=a*c,g=a*f;return t[0]=1-(h+p),t[1]=d+g,t[2]=l-m,t[3]=0,t[4]=d-g,t[5]=1-(s+p),t[6]=v+y,t[7]=0,t[8]=l+m,t[9]=v-y,t[10]=1-(s+h),t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function bn(t,n){var e=new v(3),r=-n[0],o=-n[1],i=-n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=r*r+o*o+i*i+a*a;return d>0?(e[0]=2*(u*a+s*r+c*i-f*o)/d,e[1]=2*(c*a+s*o+f*r-u*i)/d,e[2]=2*(f*a+s*i+u*o-c*r)/d):(e[0]=2*(u*a+s*r+c*i-f*o),e[1]=2*(c*a+s*o+f*r-u*i),e[2]=2*(f*a+s*i+u*o-c*r)),Mn(t,n,e),t}function Pn(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function _n(t,n){var e=n[0],r=n[1],o=n[2],i=n[4],a=n[5],u=n[6],c=n[8],f=n[9],s=n[10];return t[0]=Math.hypot(e,r,o),t[1]=Math.hypot(i,a,u),t[2]=Math.hypot(c,f,s),t}function xn(t,n){var e=new v(3);_n(e,n);var r=1/e[0],o=1/e[1],i=1/e[2],a=n[0]*r,u=n[1]*o,c=n[2]*i,f=n[4]*r,s=n[5]*o,d=n[6]*i,l=n[8]*r,h=n[9]*o,p=n[10]*i,y=a+s+p,m=0;return y>0?(m=2*Math.sqrt(y+1),t[3]=.25*m,t[0]=(d-h)/m,t[1]=(l-c)/m,t[2]=(u-f)/m):a>s&&a>p?(m=2*Math.sqrt(1+a-s-p),t[3]=(d-h)/m,t[0]=.25*m,t[1]=(u+f)/m,t[2]=(l+c)/m):s>p?(m=2*Math.sqrt(1+s-a-p),t[3]=(l-c)/m,t[0]=(u+f)/m,t[1]=.25*m,t[2]=(d+h)/m):(m=2*Math.sqrt(1+p-a-s),t[3]=(u-f)/m,t[0]=(l+c)/m,t[1]=(d+h)/m,t[2]=.25*m),t}function On(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=n[3],c=o+o,f=i+i,s=a+a,d=o*c,l=o*f,h=o*s,v=i*f,p=i*s,y=a*s,m=u*c,g=u*f,M=u*s,b=r[0],P=r[1],_=r[2];return t[0]=(1-(v+y))*b,t[1]=(l+M)*b,t[2]=(h-g)*b,t[3]=0,t[4]=(l-M)*P,t[5]=(1-(d+y))*P,t[6]=(p+m)*P,t[7]=0,t[8]=(h+g)*_,t[9]=(p-m)*_,t[10]=(1-(d+v))*_,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function En(t,n,e,r,o){var i=n[0],a=n[1],u=n[2],c=n[3],f=i+i,s=a+a,d=u+u,l=i*f,h=i*s,v=i*d,p=a*s,y=a*d,m=u*d,g=c*f,M=c*s,b=c*d,P=r[0],_=r[1],x=r[2],O=o[0],E=o[1],S=o[2],A=(1-(p+m))*P,j=(h+b)*P,w=(v-M)*P,R=(h-b)*_,C=(1-(l+m))*_,T=(y+g)*_,B=(v+M)*x,k=(y-g)*x,I=(1-(l+p))*x;return t[0]=A,t[1]=j,t[2]=w,t[3]=0,t[4]=R,t[5]=C,t[6]=T,t[7]=0,t[8]=B,t[9]=k,t[10]=I,t[11]=0,t[12]=e[0]+O-(A*O+R*E+B*S),t[13]=e[1]+E-(j*O+C*E+k*S),t[14]=e[2]+S-(w*O+T*E+I*S),t[15]=1,t}function Sn(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e+e,u=r+r,c=o+o,f=e*a,s=r*a,d=r*u,l=o*a,h=o*u,v=o*c,p=i*a,y=i*u,m=i*c;return t[0]=1-d-v,t[1]=s+m,t[2]=l-y,t[3]=0,t[4]=s-m,t[5]=1-f-v,t[6]=h+p,t[7]=0,t[8]=l+y,t[9]=h-p,t[10]=1-f-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function An(t,n,e,r,o,i,a){var u=1/(e-n),c=1/(o-r),f=1/(i-a);return t[0]=2*i*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*c,t[6]=0,t[7]=0,t[8]=(e+n)*u,t[9]=(o+r)*c,t[10]=(a+i)*f,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*i*2*f,t[15]=0,t}function jn(t,n,e,r,o){var i,a=1/Math.tan(n/2);return t[0]=a/e,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!=o&&o!==1/0?(i=1/(r-o),t[10]=(o+r)*i,t[14]=2*o*r*i):(t[10]=-1,t[14]=-2*r),t}var wn=jn;function Rn(t,n,e,r,o){var i,a=1/Math.tan(n/2);return t[0]=a/e,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!=o&&o!==1/0?(i=1/(r-o),t[10]=o*i,t[14]=o*r*i):(t[10]=-1,t[14]=-r),t}function Cn(t,n,e,r){var o=Math.tan(n.upDegrees*Math.PI/180),i=Math.tan(n.downDegrees*Math.PI/180),a=Math.tan(n.leftDegrees*Math.PI/180),u=Math.tan(n.rightDegrees*Math.PI/180),c=2/(a+u),f=2/(o+i);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=-(a-u)*c*.5,t[9]=(o-i)*f*.5,t[10]=r/(e-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*e/(e-r),t[15]=0,t}function Tn(t,n,e,r,o,i,a){var u=1/(n-e),c=1/(r-o),f=1/(i-a);return t[0]=-2*u,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*f,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=(a+i)*f,t[15]=1,t}var Bn=Tn;function kn(t,n,e,r,o,i,a){var u=1/(n-e),c=1/(r-o),f=1/(i-a);return t[0]=-2*u,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]=f,t[11]=0,t[12]=(n+e)*u,t[13]=(o+r)*c,t[14]=i*f,t[15]=1,t}function In(t,n,e,r){var o,i,a,u,c,f,s,d,l,v,p=n[0],y=n[1],m=n[2],g=r[0],M=r[1],b=r[2],P=e[0],_=e[1],x=e[2];return Math.abs(p-P)<h&&Math.abs(y-_)<h&&Math.abs(m-x)<h?tn(t):(s=p-P,d=y-_,l=m-x,o=M*(l*=v=1/Math.hypot(s,d,l))-b*(d*=v),i=b*(s*=v)-g*l,a=g*d-M*s,(v=Math.hypot(o,i,a))?(o*=v=1/v,i*=v,a*=v):(o=0,i=0,a=0),u=d*a-l*i,c=l*o-s*a,f=s*i-d*o,(v=Math.hypot(u,c,f))?(u*=v=1/v,c*=v,f*=v):(u=0,c=0,f=0),t[0]=o,t[1]=u,t[2]=s,t[3]=0,t[4]=i,t[5]=c,t[6]=d,t[7]=0,t[8]=a,t[9]=f,t[10]=l,t[11]=0,t[12]=-(o*p+i*y+a*m),t[13]=-(u*p+c*y+f*m),t[14]=-(s*p+d*y+l*m),t[15]=1,t)}function Ln(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=r[0],c=r[1],f=r[2],s=o-e[0],d=i-e[1],l=a-e[2],h=s*s+d*d+l*l;h>0&&(s*=h=1/Math.sqrt(h),d*=h,l*=h);var v=c*l-f*d,p=f*s-u*l,y=u*d-c*s;return(h=v*v+p*p+y*y)>0&&(v*=h=1/Math.sqrt(h),p*=h,y*=h),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=d*y-l*p,t[5]=l*v-s*y,t[6]=s*p-d*v,t[7]=0,t[8]=s,t[9]=d,t[10]=l,t[11]=0,t[12]=o,t[13]=i,t[14]=a,t[15]=1,t}function Dn(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 Nn(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 qn(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t[9]=n[9]+e[9],t[10]=n[10]+e[10],t[11]=n[11]+e[11],t[12]=n[12]+e[12],t[13]=n[13]+e[13],t[14]=n[14]+e[14],t[15]=n[15]+e[15],t}function Fn(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t[9]=n[9]-e[9],t[10]=n[10]-e[10],t[11]=n[11]-e[11],t[12]=n[12]-e[12],t[13]=n[13]-e[13],t[14]=n[14]-e[14],t[15]=n[15]-e[15],t}function Yn(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12]*e,t[13]=n[13]*e,t[14]=n[14]*e,t[15]=n[15]*e,t}function Gn(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t[9]=n[9]+e[9]*r,t[10]=n[10]+e[10]*r,t[11]=n[11]+e[11]*r,t[12]=n[12]+e[12]*r,t[13]=n[13]+e[13]*r,t[14]=n[14]+e[14]*r,t[15]=n[15]+e[15]*r,t}function Xn(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]}function Hn(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=t[6],f=t[7],s=t[8],d=t[9],l=t[10],v=t[11],p=t[12],y=t[13],m=t[14],g=t[15],M=n[0],b=n[1],P=n[2],_=n[3],x=n[4],O=n[5],E=n[6],S=n[7],A=n[8],j=n[9],w=n[10],R=n[11],C=n[12],T=n[13],B=n[14],k=n[15];return Math.abs(e-M)<=h*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(r-b)<=h*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(o-P)<=h*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(i-_)<=h*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-x)<=h*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(u-O)<=h*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(c-E)<=h*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(f-S)<=h*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(s-A)<=h*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(d-j)<=h*Math.max(1,Math.abs(d),Math.abs(j))&&Math.abs(l-w)<=h*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(v-R)<=h*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(p-C)<=h*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(y-T)<=h*Math.max(1,Math.abs(y),Math.abs(T))&&Math.abs(m-B)<=h*Math.max(1,Math.abs(m),Math.abs(B))&&Math.abs(g-k)<=h*Math.max(1,Math.abs(g),Math.abs(k))}var Vn=an,Wn=Fn;function Un(){var t=new v(3);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function zn(t){var n=new v(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function $n(t){var n=t[0],e=t[1],r=t[2];return Math.hypot(n,e,r)}function Qn(t,n,e){var r=new v(3);return r[0]=t,r[1]=n,r[2]=e,r}function Zn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function Kn(t,n,e,r){return t[0]=n,t[1]=e,t[2]=r,t}function Jn(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function te(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t}function ne(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t}function ee(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t}function re(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t}function oe(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t}function ie(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t}function ae(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t}function ue(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t}function ce(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function fe(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t}function se(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return Math.hypot(e,r,o)}function de(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2];return e*e+r*r+o*o}function le(t){var n=t[0],e=t[1],r=t[2];return n*n+e*e+r*r}function he(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function ve(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function pe(t,n){var e=n[0],r=n[1],o=n[2],i=e*e+r*r+o*o;return i>0&&(i=1/Math.sqrt(i)),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t}function ye(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function me(t,n,e){var r=n[0],o=n[1],i=n[2],a=e[0],u=e[1],c=e[2];return t[0]=o*c-i*u,t[1]=i*a-r*c,t[2]=r*u-o*a,t}function ge(t,n,e,r){var o=n[0],i=n[1],a=n[2];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t}function Me(t,n,e,r,o,i){var a=i*i,u=a*(2*i-3)+1,c=a*(i-2)+i,f=a*(i-1),s=a*(3-2*i);return t[0]=n[0]*u+e[0]*c+r[0]*f+o[0]*s,t[1]=n[1]*u+e[1]*c+r[1]*f+o[1]*s,t[2]=n[2]*u+e[2]*c+r[2]*f+o[2]*s,t}function be(t,n,e,r,o,i){var a=1-i,u=a*a,c=i*i,f=u*a,s=3*i*u,d=3*c*a,l=c*i;return t[0]=n[0]*f+e[0]*s+r[0]*d+o[0]*l,t[1]=n[1]*f+e[1]*s+r[1]*d+o[1]*l,t[2]=n[2]*f+e[2]*s+r[2]*d+o[2]*l,t}function Pe(t,n){n=n||1;var e=2*p()*Math.PI,r=2*p()-1,o=Math.sqrt(1-r*r)*n;return t[0]=Math.cos(e)*o,t[1]=Math.sin(e)*o,t[2]=r*n,t}function _e(t,n,e){var r=n[0],o=n[1],i=n[2],a=e[3]*r+e[7]*o+e[11]*i+e[15];return a=a||1,t[0]=(e[0]*r+e[4]*o+e[8]*i+e[12])/a,t[1]=(e[1]*r+e[5]*o+e[9]*i+e[13])/a,t[2]=(e[2]*r+e[6]*o+e[10]*i+e[14])/a,t}function xe(t,n,e){var r=n[0],o=n[1],i=n[2];return t[0]=r*e[0]+o*e[3]+i*e[6],t[1]=r*e[1]+o*e[4]+i*e[7],t[2]=r*e[2]+o*e[5]+i*e[8],t}function Oe(t,n,e){var r=e[0],o=e[1],i=e[2],a=e[3],u=n[0],c=n[1],f=n[2],s=o*f-i*c,d=i*u-r*f,l=r*c-o*u,h=o*l-i*d,v=i*s-r*l,p=r*d-o*s,y=2*a;return s*=y,d*=y,l*=y,h*=2,v*=2,p*=2,t[0]=u+s+h,t[1]=c+d+v,t[2]=f+l+p,t}function Ee(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0],i[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),i[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Se(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),i[1]=o[1],i[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function Ae(t,n,e,r){var o=[],i=[];return o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],i[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),i[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),i[2]=o[2],t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function je(t,n){var e=t[0],r=t[1],o=t[2],i=n[0],a=n[1],u=n[2],c=Math.sqrt(e*e+r*r+o*o)*Math.sqrt(i*i+a*a+u*u),f=c&&ye(t,n)/c;return Math.acos(Math.min(Math.max(f,-1),1))}function we(t){return t[0]=0,t[1]=0,t[2]=0,t}function Re(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Ce(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function Te(t,n){var e=t[0],r=t[1],o=t[2],i=n[0],a=n[1],u=n[2];return Math.abs(e-i)<=h*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-a)<=h*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-u)<=h*Math.max(1,Math.abs(o),Math.abs(u))}var Be,ke=te,Ie=ne,Le=ee,De=se,Ne=de,qe=$n,Fe=le,Ye=(Be=Un(),function(t,n,e,r,o,i){var a,u;for(n||(n=3),e||(e=0),u=r?Math.min(r*n+e,t.length):t.length,a=e;a<u;a+=n)Be[0]=t[a],Be[1]=t[a+1],Be[2]=t[a+2],o(Be,Be,i),t[a]=Be[0],t[a+1]=Be[1],t[a+2]=Be[2];return t});function Ge(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Xe(t){var n=new v(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function He(t,n,e,r){var o=new v(4);return o[0]=t,o[1]=n,o[2]=e,o[3]=r,o}function Ve(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function We(t,n,e,r,o){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t}function Ue(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t}function ze(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t}function $e(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t[2]=n[2]*e[2],t[3]=n[3]*e[3],t}function Qe(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t[2]=n[2]/e[2],t[3]=n[3]/e[3],t}function Ze(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function Ke(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function Je(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t[2]=Math.min(n[2],e[2]),t[3]=Math.min(n[3],e[3]),t}function tr(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t[2]=Math.max(n[2],e[2]),t[3]=Math.max(n[3],e[3]),t}function nr(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function er(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t}function rr(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t}function or(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],i=n[3]-t[3];return Math.hypot(e,r,o,i)}function ir(t,n){var e=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],i=n[3]-t[3];return e*e+r*r+o*o+i*i}function ar(t){var n=t[0],e=t[1],r=t[2],o=t[3];return Math.hypot(n,e,r,o)}function ur(t){var n=t[0],e=t[1],r=t[2],o=t[3];return n*n+e*e+r*r+o*o}function cr(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function fr(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function sr(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e*e+r*r+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e*a,t[1]=r*a,t[2]=o*a,t[3]=i*a,t}function dr(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function lr(t,n,e,r){var o=e[0]*r[1]-e[1]*r[0],i=e[0]*r[2]-e[2]*r[0],a=e[0]*r[3]-e[3]*r[0],u=e[1]*r[2]-e[2]*r[1],c=e[1]*r[3]-e[3]*r[1],f=e[2]*r[3]-e[3]*r[2],s=n[0],d=n[1],l=n[2],h=n[3];return t[0]=d*f-l*c+h*u,t[1]=-s*f+l*a-h*i,t[2]=s*c-d*a+h*o,t[3]=-s*u+d*i-l*o,t}function hr(t,n,e,r){var o=n[0],i=n[1],a=n[2],u=n[3];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t[2]=a+r*(e[2]-a),t[3]=u+r*(e[3]-u),t}function vr(t,n){var e,r,o,i,a,u;n=n||1;do{a=(e=2*p()-1)*e+(r=2*p()-1)*r}while(a>=1);do{u=(o=2*p()-1)*o+(i=2*p()-1)*i}while(u>=1);var c=Math.sqrt((1-a)/u);return t[0]=n*e,t[1]=n*r,t[2]=n*o*c,t[3]=n*i*c,t}function pr(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3];return t[0]=e[0]*r+e[4]*o+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*o+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*o+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*o+e[11]*i+e[15]*a,t}function yr(t,n,e){var r=n[0],o=n[1],i=n[2],a=e[0],u=e[1],c=e[2],f=e[3],s=f*r+u*i-c*o,d=f*o+c*r-a*i,l=f*i+a*o-u*r,h=-a*r-u*o-c*i;return t[0]=s*f+h*-a+d*-c-l*-u,t[1]=d*f+h*-u+l*-a-s*-c,t[2]=l*f+h*-c+s*-u-d*-a,t[3]=n[3],t}function mr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function gr(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Mr(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function br(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=n[0],u=n[1],c=n[2],f=n[3];return Math.abs(e-a)<=h*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-u)<=h*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(o-c)<=h*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(i-f)<=h*Math.max(1,Math.abs(i),Math.abs(f))}var Pr=ze,_r=$e,xr=Qe,Or=or,Er=ir,Sr=ar,Ar=ur,jr=function(){var t=Ge();return function(n,e,r,o,i,a){var u,c;for(e||(e=4),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],t[2]=n[u+2],t[3]=n[u+3],i(t,t,a),n[u]=t[0],n[u+1]=t[1],n[u+2]=t[2],n[u+3]=t[3];return n}}();function wr(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Rr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Cr(t,n,e){e*=.5;var r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function Tr(t,n){var e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>h?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function Br(t,n){var e=co(t,n);return Math.acos(2*e*e-1)}function kr(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1],f=e[2],s=e[3];return t[0]=r*s+a*u+o*f-i*c,t[1]=o*s+a*c+i*u-r*f,t[2]=i*s+a*f+r*c-o*u,t[3]=a*s-r*u-o*c-i*f,t}function Ir(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+a*u,t[1]=o*c+i*u,t[2]=i*c-o*u,t[3]=a*c-r*u,t}function Lr(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c-i*u,t[1]=o*c+a*u,t[2]=i*c+r*u,t[3]=a*c-o*u,t}function Dr(t,n,e){e*=.5;var r=n[0],o=n[1],i=n[2],a=n[3],u=Math.sin(e),c=Math.cos(e);return t[0]=r*c+o*u,t[1]=o*c-r*u,t[2]=i*c+a*u,t[3]=a*c-i*u,t}function Nr(t,n){var e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t}function qr(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=Math.sqrt(e*e+r*r+o*o),u=Math.exp(i),c=a>0?u*Math.sin(a)/a:0;return t[0]=e*c,t[1]=r*c,t[2]=o*c,t[3]=u*Math.cos(a),t}function Fr(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=Math.sqrt(e*e+r*r+o*o),u=a>0?Math.atan2(a,i)/a:0;return t[0]=e*u,t[1]=r*u,t[2]=o*u,t[3]=.5*Math.log(e*e+r*r+o*o+i*i),t}function Yr(t,n,e){return Fr(t,n),uo(t,t,e),qr(t,t),t}function Gr(t,n,e,r){var o,i,a,u,c,f=n[0],s=n[1],d=n[2],l=n[3],v=e[0],p=e[1],y=e[2],m=e[3];return(i=f*v+s*p+d*y+l*m)<0&&(i=-i,v=-v,p=-p,y=-y,m=-m),1-i>h?(o=Math.acos(i),a=Math.sin(o),u=Math.sin((1-r)*o)/a,c=Math.sin(r*o)/a):(u=1-r,c=r),t[0]=u*f+c*v,t[1]=u*s+c*p,t[2]=u*d+c*y,t[3]=u*l+c*m,t}function Xr(t){var n=p(),e=p(),r=p(),o=Math.sqrt(1-n),i=Math.sqrt(n);return t[0]=o*Math.sin(2*Math.PI*e),t[1]=o*Math.cos(2*Math.PI*e),t[2]=i*Math.sin(2*Math.PI*r),t[3]=i*Math.cos(2*Math.PI*r),t}function Hr(t,n){var e=n[0],r=n[1],o=n[2],i=n[3],a=e*e+r*r+o*o+i*i,u=a?1/a:0;return t[0]=-e*u,t[1]=-r*u,t[2]=-o*u,t[3]=i*u,t}function Vr(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function Wr(t,n){var e,r=n[0]+n[4]+n[8];if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{var o=0;n[4]>n[0]&&(o=1),n[8]>n[3*o+o]&&(o=2);var i=(o+1)%3,a=(o+2)%3;e=Math.sqrt(n[3*o+o]-n[3*i+i]-n[3*a+a]+1),t[o]=.5*e,e=.5/e,t[3]=(n[3*i+a]-n[3*a+i])*e,t[i]=(n[3*i+o]+n[3*o+i])*e,t[a]=(n[3*a+o]+n[3*o+a])*e}return t}function Ur(t,n,e,r){var o=.5*Math.PI/180;n*=o,e*=o,r*=o;var i=Math.sin(n),a=Math.cos(n),u=Math.sin(e),c=Math.cos(e),f=Math.sin(r),s=Math.cos(r);return t[0]=i*c*s-a*u*f,t[1]=a*u*s+i*c*f,t[2]=a*c*f-i*u*s,t[3]=a*c*s+i*u*f,t}function zr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var $r,Qr,Zr,Kr,Jr,to,no=Xe,eo=He,ro=Ve,oo=We,io=Ue,ao=kr,uo=er,co=dr,fo=hr,so=ar,lo=so,ho=ur,vo=ho,po=sr,yo=Mr,mo=br,go=($r=Un(),Qr=Qn(1,0,0),Zr=Qn(0,1,0),function(t,n,e){var r=ye(n,e);return r<-.999999?(me($r,Qr,n),qe($r)<1e-6&&me($r,Zr,n),pe($r,$r),Cr(t,$r,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(me($r,n,e),t[0]=$r[0],t[1]=$r[1],t[2]=$r[2],t[3]=1+r,po(t,t))}),Mo=(Kr=wr(),Jr=wr(),function(t,n,e,r,o,i){return Gr(Kr,n,o,i),Gr(Jr,e,r,i),Gr(t,Kr,Jr,2*i*(1-i)),t}),bo=(to=mt(),function(t,n,e,r){return to[0]=e[0],to[3]=e[1],to[6]=e[2],to[1]=r[0],to[4]=r[1],to[7]=r[2],to[2]=-n[0],to[5]=-n[1],to[8]=-n[2],po(t,Wr(t,to))});function Po(){var t=new v(8);return v!=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 _o(t){var n=new v(8);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n}function xo(t,n,e,r,o,i,a,u){var c=new v(8);return c[0]=t,c[1]=n,c[2]=e,c[3]=r,c[4]=o,c[5]=i,c[6]=a,c[7]=u,c}function Oo(t,n,e,r,o,i,a){var u=new v(8);u[0]=t,u[1]=n,u[2]=e,u[3]=r;var c=.5*o,f=.5*i,s=.5*a;return u[4]=c*r+f*e-s*n,u[5]=f*r+s*t-c*e,u[6]=s*r+c*n-f*t,u[7]=-c*t-f*n-s*e,u}function Eo(t,n,e){var r=.5*e[0],o=.5*e[1],i=.5*e[2],a=n[0],u=n[1],c=n[2],f=n[3];return t[0]=a,t[1]=u,t[2]=c,t[3]=f,t[4]=r*f+o*c-i*u,t[5]=o*f+i*a-r*c,t[6]=i*f+r*u-o*a,t[7]=-r*a-o*u-i*c,t}function So(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*n[0],t[5]=.5*n[1],t[6]=.5*n[2],t[7]=0,t}function Ao(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function jo(t,n){var e=wr();xn(e,n);var r=new v(3);return Pn(r,n),Eo(t,e,r),t}function wo(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t}function Ro(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 Co(t,n,e,r,o,i,a,u,c){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=i,t[5]=a,t[6]=u,t[7]=c,t}var To=ro;function Bo(t,n){return t[0]=n[4],t[1]=n[5],t[2]=n[6],t[3]=n[7],t}var ko=ro;function Io(t,n){return t[4]=n[0],t[5]=n[1],t[6]=n[2],t[7]=n[3],t}function Lo(t,n){var e=n[4],r=n[5],o=n[6],i=n[7],a=-n[0],u=-n[1],c=-n[2],f=n[3];return t[0]=2*(e*f+i*a+r*c-o*u),t[1]=2*(r*f+i*u+o*a-e*c),t[2]=2*(o*f+i*c+e*u-r*a),t}function Do(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=.5*e[0],c=.5*e[1],f=.5*e[2],s=n[4],d=n[5],l=n[6],h=n[7];return t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=a*u+o*f-i*c+s,t[5]=a*c+i*u-r*f+d,t[6]=a*f+r*c-o*u+l,t[7]=-r*u-o*c-i*f+h,t}function No(t,n,e){var r=-n[0],o=-n[1],i=-n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=u*a+s*r+c*i-f*o,l=c*a+s*o+f*r-u*i,h=f*a+s*i+u*o-c*r,v=s*a-u*r-c*o-f*i;return Ir(t,n,e),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+v*r+l*i-h*o,t[5]=l*a+v*o+h*r-d*i,t[6]=h*a+v*i+d*o-l*r,t[7]=v*a-d*r-l*o-h*i,t}function qo(t,n,e){var r=-n[0],o=-n[1],i=-n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=u*a+s*r+c*i-f*o,l=c*a+s*o+f*r-u*i,h=f*a+s*i+u*o-c*r,v=s*a-u*r-c*o-f*i;return Lr(t,n,e),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+v*r+l*i-h*o,t[5]=l*a+v*o+h*r-d*i,t[6]=h*a+v*i+d*o-l*r,t[7]=v*a-d*r-l*o-h*i,t}function Fo(t,n,e){var r=-n[0],o=-n[1],i=-n[2],a=n[3],u=n[4],c=n[5],f=n[6],s=n[7],d=u*a+s*r+c*i-f*o,l=c*a+s*o+f*r-u*i,h=f*a+s*i+u*o-c*r,v=s*a-u*r-c*o-f*i;return Dr(t,n,e),r=t[0],o=t[1],i=t[2],a=t[3],t[4]=d*a+v*r+l*i-h*o,t[5]=l*a+v*o+h*r-d*i,t[6]=h*a+v*i+d*o-l*r,t[7]=v*a-d*r-l*o-h*i,t}function Yo(t,n,e){var r=e[0],o=e[1],i=e[2],a=e[3],u=n[0],c=n[1],f=n[2],s=n[3];return t[0]=u*a+s*r+c*i-f*o,t[1]=c*a+s*o+f*r-u*i,t[2]=f*a+s*i+u*o-c*r,t[3]=s*a-u*r-c*o-f*i,u=n[4],c=n[5],f=n[6],s=n[7],t[4]=u*a+s*r+c*i-f*o,t[5]=c*a+s*o+f*r-u*i,t[6]=f*a+s*i+u*o-c*r,t[7]=s*a-u*r-c*o-f*i,t}function Go(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1],f=e[2],s=e[3];return t[0]=r*s+a*u+o*f-i*c,t[1]=o*s+a*c+i*u-r*f,t[2]=i*s+a*f+r*c-o*u,t[3]=a*s-r*u-o*c-i*f,u=e[4],c=e[5],f=e[6],s=e[7],t[4]=r*s+a*u+o*f-i*c,t[5]=o*s+a*c+i*u-r*f,t[6]=i*s+a*f+r*c-o*u,t[7]=a*s-r*u-o*c-i*f,t}function Xo(t,n,e,r){if(Math.abs(r)<h)return wo(t,n);var o=Math.hypot(e[0],e[1],e[2]);r*=.5;var i=Math.sin(r),a=i*e[0]/o,u=i*e[1]/o,c=i*e[2]/o,f=Math.cos(r),s=n[0],d=n[1],l=n[2],v=n[3];t[0]=s*f+v*a+d*c-l*u,t[1]=d*f+v*u+l*a-s*c,t[2]=l*f+v*c+s*u-d*a,t[3]=v*f-s*a-d*u-l*c;var p=n[4],y=n[5],m=n[6],g=n[7];return t[4]=p*f+g*a+y*c-m*u,t[5]=y*f+g*u+m*a-p*c,t[6]=m*f+g*c+p*u-y*a,t[7]=g*f-p*a-y*u-m*c,t}function Ho(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t}function Vo(t,n,e){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[4],c=e[5],f=e[6],s=e[7],d=n[4],l=n[5],h=n[6],v=n[7],p=e[0],y=e[1],m=e[2],g=e[3];return t[0]=r*g+a*p+o*m-i*y,t[1]=o*g+a*y+i*p-r*m,t[2]=i*g+a*m+r*y-o*p,t[3]=a*g-r*p-o*y-i*m,t[4]=r*s+a*u+o*f-i*c+d*g+v*p+l*m-h*y,t[5]=o*s+a*c+i*u-r*f+l*g+v*y+h*p-d*m,t[6]=i*s+a*f+r*c-o*u+h*g+v*m+d*y-l*p,t[7]=a*s-r*u-o*c-i*f+v*g-d*p-l*y-h*m,t}var Wo=Vo;function Uo(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t}var zo=co;function $o(t,n,e,r){var o=1-r;return zo(n,e)<0&&(r=-r),t[0]=n[0]*o+e[0]*r,t[1]=n[1]*o+e[1]*r,t[2]=n[2]*o+e[2]*r,t[3]=n[3]*o+e[3]*r,t[4]=n[4]*o+e[4]*r,t[5]=n[5]*o+e[5]*r,t[6]=n[6]*o+e[6]*r,t[7]=n[7]*o+e[7]*r,t}function Qo(t,n){var e=ti(n);return t[0]=-n[0]/e,t[1]=-n[1]/e,t[2]=-n[2]/e,t[3]=n[3]/e,t[4]=-n[4]/e,t[5]=-n[5]/e,t[6]=-n[6]/e,t[7]=n[7]/e,t}function Zo(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t[4]=-n[4],t[5]=-n[5],t[6]=-n[6],t[7]=n[7],t}var Ko=so,Jo=Ko,ti=ho,ni=ti;function ei(t,n){var e=ti(n);if(e>0){e=Math.sqrt(e);var r=n[0]/e,o=n[1]/e,i=n[2]/e,a=n[3]/e,u=n[4],c=n[5],f=n[6],s=n[7],d=r*u+o*c+i*f+a*s;t[0]=r,t[1]=o,t[2]=i,t[3]=a,t[4]=(u-r*d)/e,t[5]=(c-o*d)/e,t[6]=(f-i*d)/e,t[7]=(s-a*d)/e}return t}function ri(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function oi(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]}function ii(t,n){var e=t[0],r=t[1],o=t[2],i=t[3],a=t[4],u=t[5],c=t[6],f=t[7],s=n[0],d=n[1],l=n[2],v=n[3],p=n[4],y=n[5],m=n[6],g=n[7];return Math.abs(e-s)<=h*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(r-d)<=h*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(o-l)<=h*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(i-v)<=h*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(a-p)<=h*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(u-y)<=h*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=h*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(f-g)<=h*Math.max(1,Math.abs(f),Math.abs(g))}function ai(){var t=new v(2);return v!=Float32Array&&(t[0]=0,t[1]=0),t}function ui(t){var n=new v(2);return n[0]=t[0],n[1]=t[1],n}function ci(t,n){var e=new v(2);return e[0]=t,e[1]=n,e}function fi(t,n){return t[0]=n[0],t[1]=n[1],t}function si(t,n,e){return t[0]=n,t[1]=e,t}function di(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t}function li(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t}function hi(t,n,e){return t[0]=n[0]*e[0],t[1]=n[1]*e[1],t}function vi(t,n,e){return t[0]=n[0]/e[0],t[1]=n[1]/e[1],t}function pi(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function yi(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function mi(t,n,e){return t[0]=Math.min(n[0],e[0]),t[1]=Math.min(n[1],e[1]),t}function gi(t,n,e){return t[0]=Math.max(n[0],e[0]),t[1]=Math.max(n[1],e[1]),t}function Mi(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function bi(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t}function Pi(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t}function _i(t,n){var e=n[0]-t[0],r=n[1]-t[1];return Math.hypot(e,r)}function xi(t,n){var e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function Oi(t){var n=t[0],e=t[1];return Math.hypot(n,e)}function Ei(t){var n=t[0],e=t[1];return n*n+e*e}function Si(t,n){return t[0]=-n[0],t[1]=-n[1],t}function Ai(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function ji(t,n){var e=n[0],r=n[1],o=e*e+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=n[0]*o,t[1]=n[1]*o,t}function wi(t,n){return t[0]*n[0]+t[1]*n[1]}function Ri(t,n,e){var r=n[0]*e[1]-n[1]*e[0];return t[0]=t[1]=0,t[2]=r,t}function Ci(t,n,e,r){var o=n[0],i=n[1];return t[0]=o+r*(e[0]-o),t[1]=i+r*(e[1]-i),t}function Ti(t,n){n=n||1;var e=2*p()*Math.PI;return t[0]=Math.cos(e)*n,t[1]=Math.sin(e)*n,t}function Bi(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o,t[1]=e[1]*r+e[3]*o,t}function ki(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[2]*o+e[4],t[1]=e[1]*r+e[3]*o+e[5],t}function Ii(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[3]*o+e[6],t[1]=e[1]*r+e[4]*o+e[7],t}function Li(t,n,e){var r=n[0],o=n[1];return t[0]=e[0]*r+e[4]*o+e[12],t[1]=e[1]*r+e[5]*o+e[13],t}function Di(t,n,e,r){var o=n[0]-e[0],i=n[1]-e[1],a=Math.sin(r),u=Math.cos(r);return t[0]=o*u-i*a+e[0],t[1]=o*a+i*u+e[1],t}function Ni(t,n){var e=t[0],r=t[1],o=n[0],i=n[1],a=Math.sqrt(e*e+r*r)*Math.sqrt(o*o+i*i),u=a&&(e*o+r*i)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function qi(t){return t[0]=0,t[1]=0,t}function Fi(t){return"vec2("+t[0]+", "+t[1]+")"}function Yi(t,n){return t[0]===n[0]&&t[1]===n[1]}function Gi(t,n){var e=t[0],r=t[1],o=n[0],i=n[1];return Math.abs(e-o)<=h*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(r-i)<=h*Math.max(1,Math.abs(r),Math.abs(i))}var Xi=Oi,Hi=li,Vi=hi,Wi=vi,Ui=_i,zi=xi,$i=Ei,Qi=function(){var t=ai();return function(n,e,r,o,i,a){var u,c;for(e||(e=2),r||(r=0),c=o?Math.min(o*e+r,n.length):n.length,u=r;u<c;u+=e)t[0]=n[u],t[1]=n[u+1],i(t,t,a),n[u]=t[0],n[u+1]=t[1];return n}}()},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PathGenerator",{enumerable:!0,get:function(){return d.PathGenerator}}),Object.defineProperty(n,"PathGeneratorFactory",{enumerable:!0,get:function(){return d.PathGeneratorFactory}}),n.Plugin=void 0,Object.defineProperty(n,"RBush",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"RBushNode",{enumerable:!0,get:function(){return p.RBushNode}}),Object.defineProperty(n,"RBushRoot",{enumerable:!0,get:function(){return h.RBushRoot}}),Object.defineProperty(n,"StyleRenderer",{enumerable:!0,get:function(){return u.StyleRenderer}});var r,o=e(2),i=e(1),a=(r=e(14))&&r.__esModule?r:{default:r},u=e(15),c=e(16),f=e(18),s=e(7),d=e(19),l=e(17),h=e(36),v=e(37),p=e(20);o.world.registerComponent(p.RBushNode),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Circle},useValue:d.CirclePath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Ellipse},useValue:d.EllipsePath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Rect},useValue:d.RectPath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Line},useValue:d.LinePath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Polyline},useValue:d.PolylinePath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Polygon},useValue:d.PolygonPath}),o.globalContainer.register({token:{token:d.PathGenerator,named:o.SHAPE.Path},useValue:d.PathPath}),o.globalContainer.register({token:d.PathGeneratorFactory,useFactory:function(t){return function(n){return t.container.isBoundNamed(d.PathGenerator,n)?t.container.getNamed(d.PathGenerator,n):null}}});var y=(0,i.Module)((function(t){t(s.ImagePool),t({token:h.RBushRoot,useValue:new a.default}),t(u.DefaultRenderer),t(c.ImageRenderer),t(l.TextRenderer),t({token:u.StyleRendererFactory,useFactory:function(t){return function(n){return t.container.isBoundNamed(u.StyleRenderer,n)?t.container.getNamed(u.StyleRenderer,n):null}}}),t(f.GradientPool),t(h.CanvasRendererPlugin),t(v.LoadImagePlugin)})),m=function(){function t(){}return t.prototype.init=function(t){t.load(y,!0)},t.prototype.destroy=function(t){t.remove(s.ImagePool),t.remove(h.RBushRoot),t.remove(u.DefaultRenderer),t.remove(c.ImageRenderer),t.remove(l.TextRenderer),t.remove(u.StyleRenderer),t.remove(u.StyleRendererFactory),t.remove(f.GradientPool),t.remove(h.CanvasRendererPlugin),t.remove(v.LoadImagePlugin)},t}();n.Plugin=m},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Plugin=void 0;var r=e(1),o=e(25),i=(0,r.Module)((function(t){t(o.DOMInteractionPlugin)})),a=function(){function t(){}return t.prototype.init=function(t){t.load(i,!0)},t.prototype.destroy=function(t){t.remove(o.DOMInteractionPlugin)},t}();n.Plugin=a},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Plugin=void 0;var r=e(2),o=e(1),i=e(38),a=e(39),u=e(45),c=e(46),f=e(47),s=e(48),d=e(49),l=e(50),h=(0,o.Module)((function(t){t({token:i.PointInPathPickerFactory,useFactory:function(t){return function(t){return t===r.SHAPE.Circle?a.isPointInPath:t===r.SHAPE.Ellipse?u.isPointInPath:t===r.SHAPE.Rect?d.isPointInPath:t===r.SHAPE.Line?c.isPointInPath:t===r.SHAPE.Polyline?f.isPointInPath:t===r.SHAPE.Polygon?l.isPointInPath:t===r.SHAPE.Path?s.isPointInPath:t===r.SHAPE.Image||t===r.SHAPE.Text?function(){return!0}:null}}}),t(i.CanvasPickerPlugin)})),v=function(){function t(){}return t.prototype.init=function(t){t.load(h,!0)},t.prototype.destroy=function(t){t.remove(i.PointInPathPickerFactory),t.remove(i.CanvasPickerPlugin)},t}();n.Plugin=v},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Plugin=void 0;var r=e(1),o=e(51),i=(0,r.Module)((function(t){t(o.HTMLRenderingPlugin)})),a=function(){function t(){}return t.prototype.init=function(t){t.load(i,!0)},t.prototype.destroy=function(t){t.remove(o.HTMLRenderingPlugin)},t}();n.Plugin=a},function(t,n,e){t.exports=function(){"use strict";function t(t,r,o,i,a){!function t(e,r,o,i,a){for(;i>o;){if(i-o>600){var u=i-o+1,c=r-o+1,f=Math.log(u),s=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*s*(u-s)/u)*(c-u/2<0?-1:1);t(e,r,Math.max(o,Math.floor(r-c*s/u+d)),Math.min(i,Math.floor(r+(u-c)*s/u+d)),a)}var l=e[r],h=o,v=i;for(n(e,o,r),a(e[i],l)>0&&n(e,o,i);h<v;){for(n(e,h,v),h++,v--;a(e[h],l)<0;)h++;for(;a(e[v],l)>0;)v--}0===a(e[o],l)?n(e,o,v):n(e,++v,i),v<=r&&(o=v+1),r<=v&&(i=v-1)}}(t,r,o||0,i||t.length-1,a||e)}function n(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function e(t,n){return t<n?-1:t>n?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,n,e){if(!e)return n.indexOf(t);for(var r=0;r<n.length;r++)if(e(t,n[r]))return r;return-1}function i(t,n){a(t,0,t.children.length,n,t)}function a(t,n,e,r,o){o||(o=v(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var i=n;i<e;i++){var a=t.children[i];u(o,t.leaf?r(a):a)}return o}function u(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function c(t,n){return t.minX-n.minX}function f(t,n){return t.minY-n.minY}function s(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function h(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,e,r,o,i){for(var a=[e,r];a.length;)if(!((r=a.pop())-(e=a.pop())<=o)){var u=e+Math.ceil((r-e)/o/2)*o;t(n,u,e,r,i),a.push(e,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,e=[];if(!h(t,n))return e;for(var r=this.toBBox,o=[];n;){for(var i=0;i<n.children.length;i++){var a=n.children[i],u=n.leaf?r(a):a;h(t,u)&&(n.leaf?e.push(a):l(t,u)?this._all(a,e):o.push(a))}n=o.pop()}return e},r.prototype.collides=function(t){var n=this.data;if(!h(t,n))return!1;for(var e=[];n;){for(var r=0;r<n.children.length;r++){var o=n.children[r],i=n.leaf?this.toBBox(o):o;if(h(t,i)){if(n.leaf||l(t,i))return!0;e.push(o)}}n=e.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var r=this.data;this.data=e,e=r}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var e,r,i,a=this.data,u=this.toBBox(t),c=[],f=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],e=f.pop(),i=!0),a.leaf){var s=o(t,a.children,n);if(-1!==s)return a.children.splice(s,1),c.push(a),this._condense(c),this}i||a.leaf||!l(a,u)?r?(e++,a=r.children[e],i=!1):a=null:(c.push(a),f.push(e),e=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var e=[];t;)t.leaf?n.push.apply(n,t.children):e.push.apply(e,t.children),t=e.pop();return n},r.prototype._build=function(t,n,e,r){var o,a=e-n+1,u=this._maxEntries;if(a<=u)return i(o=v(t.slice(n,e+1)),this.toBBox),o;r||(r=Math.ceil(Math.log(a)/Math.log(u)),u=Math.ceil(a/Math.pow(u,r-1))),(o=v([])).leaf=!1,o.height=r;var c=Math.ceil(a/u),f=c*Math.ceil(Math.sqrt(u));p(t,n,e,f,this.compareMinX);for(var s=n;s<=e;s+=f){var d=Math.min(s+f-1,e);p(t,s,d,c,this.compareMinY);for(var l=s;l<=d;l+=c){var h=Math.min(l+c-1,d);o.children.push(this._build(t,l,h,r-1))}}return i(o,this.toBBox),o},r.prototype._chooseSubtree=function(t,n,e,r){for(;r.push(n),!n.leaf&&r.length-1!==e;){for(var o=1/0,i=1/0,a=void 0,u=0;u<n.children.length;u++){var c=n.children[u],f=s(c),d=(l=t,h=c,(Math.max(h.maxX,l.maxX)-Math.min(h.minX,l.minX))*(Math.max(h.maxY,l.maxY)-Math.min(h.minY,l.minY))-f);d<i?(i=d,o=f<o?f:o,a=c):d===i&&f<o&&(o=f,a=c)}n=a||n.children[0]}var l,h;return n},r.prototype._insert=function(t,n,e){var r=e?t:this.toBBox(t),o=[],i=this._chooseSubtree(r,this.data,n,o);for(i.children.push(t),u(i,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)},r.prototype._split=function(t,n){var e=t[n],r=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,r);var a=this._chooseSplitIndex(e,o,r),u=v(e.children.splice(a,e.children.length-a));u.height=e.height,u.leaf=e.leaf,i(e,this.toBBox),i(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(e,u)},r.prototype._splitRoot=function(t,n){this.data=v([t,n]),this.data.height=t.height+1,this.data.leaf=!1,i(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,e){for(var r,o,i,u,c,f,d,l=1/0,h=1/0,v=n;v<=e-n;v++){var p=a(t,0,v,this.toBBox),y=a(t,v,e,this.toBBox),m=(o=p,i=y,u=Math.max(o.minX,i.minX),c=Math.max(o.minY,i.minY),f=Math.min(o.maxX,i.maxX),d=Math.min(o.maxY,i.maxY),Math.max(0,f-u)*Math.max(0,d-c)),g=s(p)+s(y);m<l?(l=m,r=v,h=g<h?g:h):m===l&&g<h&&(h=g,r=v)}return r||e-n},r.prototype._chooseSplitAxis=function(t,n,e){var r=t.leaf?this.compareMinX:c,o=t.leaf?this.compareMinY:f;this._allDistMargin(t,n,e,r)<this._allDistMargin(t,n,e,o)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,e,r){t.children.sort(r);for(var o=this.toBBox,i=a(t,0,n,o),c=a(t,e-n,e,o),f=d(i)+d(c),s=n;s<e-n;s++){var l=t.children[s];u(i,t.leaf?o(l):l),f+=d(i)}for(var h=e-n-1;h>=n;h--){var v=t.children[h];u(c,t.leaf?o(v):v),f+=d(c)}return f},r.prototype._adjustParentBBoxes=function(t,n,e){for(var r=e;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,e=void 0;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():i(t[n],this.toBBox)},r}()},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(6);Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in n&&n[t]===r[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return r[t]}}))}));var o=e(27);Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in n&&n[t]===o[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return o[t]}}))}));var i=e(16);Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in n&&n[t]===i[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return i[t]}}))}));var a=e(17);Object.keys(a).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in n&&n[t]===a[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return a[t]}}))}))},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ImageRenderer=void 0;var r=e(0),o=e(2),i=e(1),a=e(3),u=e(7),c=e(6),f=function(){function t(){}return t.prototype.render=function(t,n){var e,r=n.width,o=void 0===r?0:r,i=n.height,u=void 0===i?0:i,c=n.img,f=o,s=u;(0,a.isString)(c)?e=this.imagePool.getImageSync(c):(f||(f=c.width),s||(s=c.height),e=c),t.drawImage(e,0,0,f,s)},(0,r.__decorate)([(0,i.inject)(u.ImagePool),(0,r.__metadata)("design:type",u.ImagePool)],t.prototype,"imagePool",void 0),t=(0,r.__decorate)([(0,i.singleton)({token:{token:c.StyleRenderer,named:o.SHAPE.Image}})],t)}();n.ImageRenderer=f},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TextRenderer=void 0;var r=e(0),o=e(2),i=e(1),a=e(3),u=e(6),c=function(){function t(){}return t.prototype.render=function(t,n){n.text;var e=n.lineWidth,r=void 0===e?0:e,o=(n.textAlign,n.textBaseline),i=n.lineJoin,u=n.miterLimit,c=void 0===u?0:u,f=n.padding,s=void 0===f?0:f,d=n.letterSpacing,l=void 0===d?0:d,h=n.stroke,v=n.fill,p=n.fillOpacity,y=n.strokeOpacity,m=n.opacity,g=n.metrics,M=g.font,b=g.lines,P=g.height,_=g.lineHeight;t.font=M,t.lineWidth=r,t.textBaseline=o,t.lineJoin=i,t.miterLimit=c;var x=0;"middle"===o?x=-P/2-_/2:"bottom"===o||"alphabetic"===o||"ideographic"===o?x=-P:"top"!==o&&"hanging"!==o||(x=-_);for(var O=0;O<b.length;O++){var E=r/2;x+=_,!(0,a.isNil)(h)&&r&&this.drawLetterSpacing(t,b[O],E+s,x+s,l,p,y,m,!0),(0,a.isNil)(v)||this.drawLetterSpacing(t,b[O],E+s,x+s,l,p,y,m)}},t.prototype.drawLetterSpacing=function(t,n,e,r,o,i,a,u,c){if(void 0===c&&(c=!1),0!==o)for(var f=e,s=Array.from(n),d=t.measureText(n).width,l=0,h=0;h<s.length;++h){var v=s[h];c?this.strokeText(t,v,f,r,a):this.fillText(t,v,f,r,i,u),f+=d-(l=t.measureText(n.substring(h+1)).width)+o,d=l}else c?this.strokeText(t,n,e,r,a):this.fillText(t,n,e,r,i,u)},t.prototype.fillText=function(t,n,e,r,o,i){var u=!(0,a.isNil)(o)&&1!==o;u&&(t.globalAlpha=o),t.fillText(n,e,r),u&&(t.globalAlpha=i)},t.prototype.strokeText=function(t,n,e,r,o){!(0,a.isNil)(o)&&1!==o&&(t.globalAlpha=o),t.strokeText(n,e,r)},(0,r.__decorate)([(0,i.inject)(o.TextService),(0,r.__metadata)("design:type",o.TextService)],t.prototype,"textService",void 0),t=(0,r.__decorate)([(0,i.singleton)({token:{token:u.StyleRenderer,named:o.SHAPE.Text}})],t)}();n.TextRenderer=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.GradientPool=void 0;var r=e(0),o=e(2),i=e(1),a=function(){function t(){this.gradientCache={}}return t.prototype.getOrCreateGradient=function(t,n){var e=this.generateCacheKey(t),i=t.type,a=t.x0,u=t.y0,c=t.x1,f=t.y1,s=t.steps,d=t.width,l=t.height;if(this.gradientCache[e])return this.gradientCache[e];var h=null;if(i===o.PARSED_COLOR_TYPE.LinearGradient)h=n.createLinearGradient(a*d,u*l,c*d,f*l);else if(i===o.PARSED_COLOR_TYPE.RadialGradient){var v=Math.sqrt(d*d+l*l)/2;h=n.createRadialGradient(a*d,u*l,0,c*d,f*l,t.r1*v)}return h&&(s.forEach((function(t){var n=(0,r.__read)(t,2),e=n[0],o=n[1];null==h||h.addColorStop(Number(e),o)})),this.gradientCache[e]=h),this.gradientCache[e]},t.prototype.generateCacheKey=function(t){var n=t.type,e=t.x0,r=t.y0,o=t.x1,i=t.y1,a=t.r1,u=t.steps;return"gradient-"+n+"-"+e+"-"+r+"-"+o+"-"+i+"-"+(a||0)+"-"+t.width+"-"+t.height+"-"+u.map((function(t){return t.join("")})).join("-")},t=(0,r.__decorate)([(0,i.singleton)()],t)}();n.GradientPool=a},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"CirclePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(n,"EllipsePath",{enumerable:!0,get:function(){return o.generatePath}}),Object.defineProperty(n,"LinePath",{enumerable:!0,get:function(){return a.generatePath}}),n.PathGeneratorFactory=n.PathGenerator=void 0,Object.defineProperty(n,"PathPath",{enumerable:!0,get:function(){return f.generatePath}}),Object.defineProperty(n,"PolygonPath",{enumerable:!0,get:function(){return c.generatePath}}),Object.defineProperty(n,"PolylinePath",{enumerable:!0,get:function(){return u.generatePath}}),Object.defineProperty(n,"RectPath",{enumerable:!0,get:function(){return i.generatePath}});var r=e(28),o=e(29),i=e(30),a=e(32),u=e(33),c=e(34),f=e(35);n.PathGeneratorFactory="PathGeneratorFactory";n.PathGenerator="PathGenerator"},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RBushNode=void 0;var r=e(0),o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,r.__extends)(n,t),n.tag="c-canvas-rbush-node",n}(e(2).Component);n.RBushNode=o},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Arc",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"Cubic",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"Line",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"Polygon",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"Polyline",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(n,"Quad",{enumerable:!0,get:function(){return o.default}}),n.Util=void 0;var o=l(e(40)),i=l(e(41)),a=l(e(42)),u=l(e(8)),c=l(e(44)),f=l(e(24)),s=function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var e=d(n);if(e&&e.has(t))return e.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=i?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(o,a,u):o[a]=t[a]}o.default=t,e&&e.set(t,o);return o}(e(4));function d(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,e=new WeakMap;return(d=function(t){return t?e:n})(t)}function l(t){return t&&t.__esModule?t:{default:t}}n.Util=s},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.nearestPoint=function(t,n,e,o,i,a){var u=-1,c=1/0,f=[e,o],s=20;a&&a>200&&(s=a/10);for(var d=1/s,l=d/10,h=0;h<=s;h++){var v=h*d,p=[i.apply(null,t.concat([v])),i.apply(null,n.concat([v]))];(M=(0,r.distance)(f[0],f[1],p[0],p[1]))<c&&(u=v,c=M)}if(0===u)return{x:t[0],y:n[0]};if(1===u){var y=t.length;return{x:t[y-1],y:n[y-1]}}c=1/0;for(h=0;h<32&&!(l<1e-4);h++){var m=u-l,g=u+l,M=(p=[i.apply(null,t.concat([m])),i.apply(null,n.concat([m]))],(0,r.distance)(f[0],f[1],p[0],p[1]));if(m>=0&&M<c)u=m,c=M;else{var b=[i.apply(null,t.concat([g])),i.apply(null,n.concat([g]))],P=(0,r.distance)(f[0],f[1],b[0],b[1]);g<=1&&P<c?(u=g,c=P):l*=.5}}return{x:i.apply(null,t.concat([u])),y:i.apply(null,n.concat([u]))}},n.snapLength=function(t,n){for(var e=0,o=t.length,i=0;i<o;i++){var a=t[i],u=n[i],c=t[(i+1)%o],f=n[(i+1)%o];e+=(0,r.distance)(a,u,c,f)}return e/2};var r=e(4)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.angleAtSegments=function(t,n){if(n>1||n<0||t.length<2)return 0;for(var e=a(t),r=e.segments,o=e.totalLength,i=0,u=0,c=0;c<r.length;c++){var f=r[c],s=f.from,d=f.to,l=f.length/o;if(n>=i&&n<=i+l){u=Math.atan2(d[1]-s[1],d[0]-s[0]);break}i+=l}return u},n.distanceAtSegment=function(t,n,e){for(var r=1/0,i=0;i<t.length-1;i++){var a=t[i],u=t[i+1],c=o.default.pointDistance(a[0],a[1],u[0],u[1],n,e);c<r&&(r=c)}return r},n.lengthOfSegment=function(t){if(t.length<2)return 0;for(var n=0,e=0;e<t.length-1;e++){var r=t[e],o=t[e+1];n+=(0,i.distance)(r[0],r[1],o[0],o[1])}return n},n.pointAtSegments=function(t,n){if(n>1||n<0||t.length<2)return null;var e=a(t),r=e.segments,i=e.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var u=0,c=null,f=0;f<r.length;f++){var s=r[f],d=s.from,l=s.to,h=s.length/i;if(n>=u&&n<=u+h){var v=(n-u)/h;c=o.default.pointAt(d[0],d[1],l[0],l[1],v);break}u+=h}return c};var r,o=(r=e(8))&&r.__esModule?r:{default:r},i=e(4);function a(t){for(var n=0,e=[],r=0;r<t.length-1;r++){var o=t[r],a=t[r+1],u=(0,i.distance)(o[0],o[1],a[0],a[1]),c={from:o,to:a,length:u};e.push(c),n+=u}return{segments:e,totalLength:n}}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e(23),o=e(4),i={box:function(t){for(var n=[],e=[],r=0;r<t.length;r++){var i=t[r];n.push(i[0]),e.push(i[1])}return(0,o.getBBoxByArray)(n,e)},length:function(t){return(0,r.lengthOfSegment)(t)},pointAt:function(t,n){return(0,r.pointAtSegments)(t,n)},pointDistance:function(t,n,e){return(0,r.distanceAtSegment)(t,n,e)},tangentAngle:function(t,n){return(0,r.angleAtSegments)(t,n)}};n.default=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DOMInteractionPlugin=void 0;var r=e(0),o=e(2),i=e(1),a=e(26),u=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){t.hooks.pointerMove.call(n)},o=function(n){t.hooks.pointerUp.call(n)},i=function(n){t.hooks.pointerDown.call(n)},u=function(n){t.hooks.pointerOver.call(n)},c=function(n){t.hooks.pointerOut.call(n)},f=function(n){t.hooks.pointerWheel.call(n)};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getDomElement();a.supportsPointerEvents?(self.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",u,!0),self.addEventListener("pointerup",o,!0)):(self.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",u,!0),self.addEventListener("mouseup",o,!0)),a.supportsTouchEvents&&(t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",r,!0)),t.addEventListener("wheel",f,{passive:!0,capture:!0})})),t.hooks.destroy.tap(n.tag,(function(){var t=e.contextService.getDomElement();a.supportsPointerEvents?(self.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",u,!0),self.removeEventListener("pointerup",o,!0)):(self.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",u,!0),self.removeEventListener("mouseup",o,!0)),a.supportsTouchEvents&&(t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)),t.removeEventListener("wheel",f,!0)}))},t.tag="DOMInteractionPlugin",(0,r.__decorate)([(0,i.inject)(o.ContextService),(0,r.__metadata)("design:type",Object)],t.prototype,"contextService",void 0),t=n=(0,r.__decorate)([(0,i.singleton)({contrib:o.RenderingPluginContribution})],t)}();n.DOMInteractionPlugin=u},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isMouseEvent=function(t){return!self.MouseEvent||t instanceof MouseEvent&&(!o||!(t instanceof self.PointerEvent))},n.isTouchEvent=function(t){return r&&t instanceof TouchEvent},n.supportsTouchEvents=n.supportsPointerEvents=void 0;var r="ontouchstart"in self;n.supportsTouchEvents=r;var o=!!self.PointerEvent;n.supportsPointerEvents=o},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DefaultRenderer=void 0;var r=e(0),o=e(2),i=e(1),a=e(3),u=e(6),c=function(){function t(){}return t.prototype.render=function(t,n){var e=n.fill,r=n.opacity,o=n.fillOpacity,i=n.stroke,u=n.strokeOpacity,c=n.lineWidth,f=n.lineCap,s=n.lineJoin;if((0,a.isNil)(e)||((0,a.isNil)(o)||1===o?t.fill():(t.globalAlpha=o,t.fill(),t.globalAlpha=r)),!(0,a.isNil)(i)&&c&&c>0){!(0,a.isNil)(u)&&1!==u&&(t.globalAlpha=u),t.lineWidth=c,(0,a.isNil)(f)||(t.lineCap=f),(0,a.isNil)(s)||(t.lineJoin=s);var d=t.shadowBlur,l=t.shadowColor;(0,a.isNil)(d)||(t.shadowColor="transparent",t.shadowBlur=0);var h=t.filter;!(0,a.isNil)(h)&&h.indexOf("drop-shadow")>-1&&(t.filter=h.replace(/drop-shadow\([^)]*\)/,"").trim()||"none"),t.stroke(),(0,a.isNil)(d)||(t.shadowColor=l,t.shadowBlur=d),(0,a.isNil)(h)||(t.filter=h)}},t=(0,r.__decorate)([(0,i.singleton)({token:[{token:u.StyleRenderer,named:o.SHAPE.Circle},{token:u.StyleRenderer,named:o.SHAPE.Ellipse},{token:u.StyleRenderer,named:o.SHAPE.Rect},{token:u.StyleRenderer,named:o.SHAPE.Line},{token:u.StyleRenderer,named:o.SHAPE.Polyline},{token:u.StyleRenderer,named:o.SHAPE.Polygon},{token:u.StyleRenderer,named:o.SHAPE.Path}]})],t)}();n.DefaultRenderer=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){t.beginPath();var e=n.r,r=void 0===e?0:e;t.arc(r,r,r,0,2*Math.PI,!1)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.rx,r=n.ry;if(t.beginPath(),t.ellipse)t.ellipse(e,r,e,r,0,0,2*Math.PI,!1);else{var o=e>r?e:r,i=e>r?1:e/r,a=e>r?r/e:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI),t.closePath(),t.restore()}}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.radius,i=void 0===e?0:e,a=n.width,u=void 0===a?0:a,c=n.height,f=void 0===c?0:c;if(t.beginPath(),0===i)t.rect(0,0,u,f);else{var s=(0,r.__read)((0,o.parseRadius)(i),4),d=s[0],l=s[1],h=s[2],v=s[3];t.moveTo(d,0),t.lineTo(u-l,0),0!==l&&t.arc(u-l,l,l,-Math.PI/2,0),t.lineTo(u,f-h),0!==h&&t.arc(u-h,f-h,h,0,Math.PI/2),t.lineTo(v,f),0!==v&&t.arc(v,f-v,v,Math.PI/2,Math.PI),t.lineTo(0,d),0!==d&&t.arc(d,d,d,Math.PI,1.5*Math.PI),t.closePath()}};var r=e(0),o=e(31)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.parseRadius=function(t){var n=0,e=0,o=0,i=0;(0,r.isArray)(t)?1===t.length?n=e=o=i=t[0]:2===t.length?(n=o=t[0],e=i=t[1]):3===t.length?(n=t[0],e=i=t[1],o=t[2]):(n=t[0],e=t[1],o=t[2],i=t[3]):n=e=o=i=t;return[n,e,o,i]};var r=e(3)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.x1,r=n.y1,o=n.x2,i=n.y2,a=n.defX,u=void 0===a?0:a,c=n.defY,f=void 0===c?0:c;t.beginPath(),t.moveTo(e-u,r-f),t.lineTo(o-u,i-f)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.points.points,u=a.length,c=a[0][0]-r,f=a[0][1]-i,s=a[u-1][0]-r,d=a[u-1][1]-i;t.beginPath(),t.moveTo(c,f);for(var l=0;l<u-1;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-i)}t.lineTo(s,d)}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.points.points,u=a.length,c=a[0][0]-r,f=a[0][1]-i,s=a[u-1][0]-r,d=a[u-1][1]-i;t.beginPath(),t.moveTo(c,f);for(var l=0;l<u-1;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-i)}t.lineTo(s,d),t.closePath()}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.generatePath=function(t,n){var e=n.defX,r=void 0===e?0:e,o=n.defY,i=void 0===o?0:o,a=n.path,u=a.curve,c=a.zCommandIndexes,f=u;c.forEach((function(t,n){f.splice(t+n,0,["Z"])}));var s=[-r,-i];t.beginPath();for(var d=0;d<f.length;d++){var l=f[d],h=l[0];switch(h){case"M":t.moveTo(l[1]-r,l[2]-i),s=[l[1]-r,l[2]-i];break;case"C":t.bezierCurveTo(l[1]-r,l[2]-i,l[3]-r,l[4]-i,l[5]-r,l[6]-i);break;case"Z":t.closePath()}if("Z"===h)s;else{var v=l.length;[l[v-2]-r,l[v-1]-i]}}}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RBushRoot=n.CanvasRendererPlugin=void 0;var r,o=e(0),i=e(2),a=e(3),u=e(1),c=e(9),f=(r=e(14))&&r.__esModule?r:{default:r},s=e(19),d=e(15),l=e(18),h=e(7),v=e(20);n.RBushRoot="RBushRoot";var p={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"},y=function(){function t(){this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){t.target.entity.addComponent(v.RBushNode),u(t)},a=function(t){var n=t.target,r=n.entity.getComponent(v.RBushNode);e.rBush.remove(r.aabb),n.entity.removeComponent(v.RBushNode)},u=function(t){var n;(null===(n=t.target.ownerDocument)||void 0===n?void 0:n.documentElement)===e.renderingContext.root&&t.composedPath().slice(0,-2).forEach((function(t){e.insertRBushNode(t)}))};t.hooks.init.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.contextService.getDPR();t&&t.scale(n,n),e.renderingContext.root.addEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(i.ElementEvent.UNMOUNTED,a),e.renderingContext.root.addEventListener(i.ElementEvent.BOUNDS_CHANGED,u)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(i.ElementEvent.UNMOUNTED,a),e.renderingContext.root.removeEventListener(i.ElementEvent.BOUNDS_CHANGED,u)})),t.hooks.beginFrame.tap(n.tag,(function(){var t=e.contextService.getContext(),n=e.canvasConfig.renderer.getConfig(),r=n.enableDirtyRectangleRendering;n.enableDirtyRectangleRenderingDebug;e.clearFullScreen=!r||e.renderingContext.renderReasons.has(i.RENDER_REASON.CameraChanged),t&&(t.save(),e.clearFullScreen&&t.clearRect(0,0,e.canvasConfig.width,e.canvasConfig.height),e.applyTransform(t,e.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(n.tag,(function(){var n=e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering,r=e.contextService.getContext();if(n){var i=e.safeMergeAABB.apply(e,(0,o.__spreadArray)([e.mergeDirtyAABBs(e.renderQueue)],(0,o.__read)(e.renderingContext.removedRenderBoundsList),!1));if(e.renderingContext.removedRenderBoundsList=[],!i)return;var a=e.convertAABB2Rect(i),u=a.x,c=a.y,f=a.width,s=a.height;r.clearRect(u,c,f,s),r.beginPath(),r.rect(u,c,f,s),r.clip(),e.searchDirtyObjects(i).sort(e.sceneGraphService.sort).forEach((function(n){n.isVisible()&&e.renderDisplayObject(n,t)})),e.renderQueue.forEach((function(t){e.saveDirtyAABB(t)})),e.renderQueue=[]}e.restoreStack.forEach((function(t){r.restore()})),e.restoreStack=[],r.restore()})),t.hooks.render.tap(n.tag,(function(n){e.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?e.renderQueue.push(n):e.renderDisplayObject(n,t)}))},t.prototype.renderDisplayObject=function(t,n){for(var e=this,r=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)r.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=t.nodeName;r.save(),this.applyTransform(r,t.getLocalTransform());var u=t.style.clipPath;if(u){r.save(),this.applyTransform(r,u.getLocalTransform());var c=this.pathGeneratorFactory(u.nodeName);c&&this.useAnchor(r,u,(function(){c(r,u.parsedStyle)})),r.restore(),r.clip()}r.save(),this.applyAttributesToContext(r,t,n),this.useAnchor(r,t,(function(){var n=e.pathGeneratorFactory(t.nodeName);n&&n(r,t.parsedStyle);var o=e.styleRendererFactory(a);o&&o.render(r,t.parsedStyle,t)})),r.restore(),t.entity.getComponent(i.Renderable).dirty=!1,this.restoreStack.push(t)},t.prototype.convertAABB2Rect=function(t){var n=t.getMin(),e=t.getMax(),r=Math.floor(n[0]),o=Math.floor(n[1]);return{x:r,y:o,width:Math.ceil(e[0])-r,height:Math.ceil(e[1])-o}},t.prototype.insertRBushNode=function(t){var n=t.entity.getComponent(v.RBushNode);if(n){this.rBush.remove(n.aabb);var e=t.getRenderBounds();if(e){var r=(0,o.__read)(e.getMin(),2),i=r[0],a=r[1],u=(0,o.__read)(e.getMax(),2),c=u[0],f=u[1];n.aabb={name:t.entity.getName(),minX:i,minY:a,maxX:c,maxY:f}}this.rBush.insert(n.aabb)}},t.prototype.mergeDirtyAABBs=function(t){var n;return t.forEach((function(t){var e=t.getRenderBounds();e&&(n?n.add(e):n=new i.AABB(e.center,e.halfExtents));var r=t.entity.getComponent(i.Renderable).dirtyRenderBounds;r&&(n?n.add(r):n=new i.AABB(r.center,r.halfExtents))})),n},t.prototype.searchDirtyObjects=function(t){var n=this,e=(0,o.__read)(t.getMin(),2),r=e[0],i=e[1],a=(0,o.__read)(t.getMax(),2),u=a[0],c=a[1];return this.rBush.search({minX:r,minY:i,maxX:u,maxY:c}).map((function(t){var e=t.name;return n.displayObjectPool.getByName(e)}))},t.prototype.saveDirtyAABB=function(t){var n=t.entity.getComponent(i.Renderable);n.dirtyRenderBounds||(n.dirtyRenderBounds=new i.AABB);var e=t.getRenderBounds();e&&n.dirtyRenderBounds.update(e.center,e.halfExtents)},t.prototype.drawDirtyRectangle=function(t,n){var e=n.x,r=n.y,o=n.width,i=n.height;t.beginPath(),t.rect(e+1,r+1,o-1,i-1),t.closePath(),t.lineWidth=1,t.stroke()},t.prototype.applyTransform=function(t,n){var e=(0,o.__read)(c.mat4.getTranslation(c.vec3.create(),n),2),r=e[0],a=e[1],u=(0,o.__read)(c.mat4.getScaling(c.vec3.create(),n),2),f=u[0],s=u[1],d=c.mat4.getRotation(c.quat.create(),n),l=(0,o.__read)((0,i.getEuler)(c.vec3.create(),d),3),h=l[0],v=(l[1],l[2]),p=(0,i.fromRotationTranslationScale)(h||v,r,a,f,s);t.transform(p[0],p[1],p[3],p[4],p[6],p[7])},t.prototype.applyAttributesToContext=function(t,n,e){var r=n.attributes,u=n.parsedStyle;for(var c in r)if("transform"!==c){var f=r[c],s=p[c]?p[c]:c;if("lineDash"===s&&t.setLineDash)(0,a.isArray)(f)&&t.setLineDash(f);else{if("strokeStyle"===s||"fillStyle"===s){var d=u[c];if(d.type===i.PARSED_COLOR_TYPE.LinearGradient||d.type===i.PARSED_COLOR_TYPE.RadialGradient){var l=n.getGeometryBounds(),h=l&&2*l.halfExtents[0]||0,v=l&&2*l.halfExtents[1]||0;f=this.gradientPool.getOrCreateGradient((0,o.__assign)((0,o.__assign)({type:d.type},d.value),{width:h,height:v}),t)}else if(d.type===i.PARSED_COLOR_TYPE.Pattern){var y=this.imagePool.getPatternSync(d.value);y?f=y:this.imagePool.createPattern(d.value,t).then((function(){n.entity.getComponent(i.Renderable).dirty=!0,e.dirtify()}))}else f=d.formatted}else"globalAlpha"===s&&(f*=t.globalAlpha);t[s]=f}}},t.prototype.useAnchor=function(t,n,e){var r=n.getGeometryBounds();if(r){var o=r.halfExtents;t.save();var i=(n.parsedStyle||{}).anchor,a=void 0===i?[0,0]:i;t.translate(-a[0]*o[0]*2,-a[1]*o[1]*2),e(),t.restore()}else e()},t.prototype.safeMergeAABB=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.forEach((function(n){n&&(t?t.add(n):t=n)})),t},t.tag="CanvasRendererPlugin",(0,o.__decorate)([(0,u.inject)(i.CanvasConfig),(0,o.__metadata)("design:type",Object)],t.prototype,"canvasConfig",void 0),(0,o.__decorate)([(0,u.inject)(i.DefaultCamera),(0,o.__metadata)("design:type",i.Camera)],t.prototype,"camera",void 0),(0,o.__decorate)([(0,u.inject)(i.ContextService),(0,o.__metadata)("design:type",Object)],t.prototype,"contextService",void 0),(0,o.__decorate)([(0,u.inject)(i.SceneGraphService),(0,o.__metadata)("design:type",Object)],t.prototype,"sceneGraphService",void 0),(0,o.__decorate)([(0,u.inject)(i.RenderingContext),(0,o.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),(0,o.__decorate)([(0,u.inject)(h.ImagePool),(0,o.__metadata)("design:type",h.ImagePool)],t.prototype,"imagePool",void 0),(0,o.__decorate)([(0,u.inject)(l.GradientPool),(0,o.__metadata)("design:type",l.GradientPool)],t.prototype,"gradientPool",void 0),(0,o.__decorate)([(0,u.inject)(s.PathGeneratorFactory),(0,o.__metadata)("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),(0,o.__decorate)([(0,u.inject)(d.StyleRendererFactory),(0,o.__metadata)("design:type",Function)],t.prototype,"styleRendererFactory",void 0),(0,o.__decorate)([(0,u.inject)(i.DisplayObjectPool),(0,o.__metadata)("design:type",i.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),(0,o.__decorate)([(0,u.inject)("RBushRoot"),(0,o.__metadata)("design:type",f.default)],t.prototype,"rBush",void 0),t=n=(0,o.__decorate)([(0,u.singleton)({contrib:i.RenderingPluginContribution})],t)}();n.CanvasRendererPlugin=y},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LoadImagePlugin=void 0;var r=e(0),o=e(1),i=e(2),a=e(7),u=e(3),c=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(n){var r=n.target,o=r.nodeName,a=r.attributes;if(o===i.SHAPE.Image){var c=a.img;(0,u.isString)(c)&&e.imagePool.getOrCreateImage(c).then((function(){r.entity.getComponent(i.Renderable).dirty=!0,t.dirtify()}))}},o=function(n){var r=n.target,o=n.detail,a=o.attributeName,c=o.newValue;r.nodeName===i.SHAPE.Image&&"img"===a&&(0,u.isString)(c)&&e.imagePool.getOrCreateImage(c).then((function(){r.entity.getComponent(i.Renderable).dirty=!0,t.dirtify()}))};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(i.ElementEvent.ATTRIBUTE_CHANGED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(i.ElementEvent.ATTRIBUTE_CHANGED,o)}))},t.tag="LoadImagePlugin",(0,r.__decorate)([(0,o.inject)(a.ImagePool),(0,r.__metadata)("design:type",a.ImagePool)],t.prototype,"imagePool",void 0),(0,r.__decorate)([(0,o.inject)(i.RenderingContext),(0,r.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=(0,r.__decorate)([(0,o.singleton)({contrib:i.RenderingPluginContribution})],t)}();n.LoadImagePlugin=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PointInPathPickerFactory=n.CanvasPickerPlugin=void 0;var r=e(0),o=e(2),i=e(10),a=e(9),u=e(1);n.PointInPathPickerFactory="PointInPathPicker";var c=function(){function t(){var t=this;this.isHit=function(n,e,r){var i=t.pointInPathPickerFactory(n.nodeName);if(i){var u=a.mat4.invert(a.mat4.create(),r),c=a.vec3.transformMat4(a.vec3.create(),a.vec3.fromValues(e[0],e[1],0),u),f=n.getGeometryBounds().halfExtents,s=n.parsedStyle.anchor,d=void 0===s?[0,0]:s;if(c[0]+=d[0]*f[0]*2,c[1]+=d[1]*f[1]*2,i(n,new o.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(n,e){var r=t.offscreenCanvas.getOrCreateContext(),o=t.pathGeneratorFactory(n.nodeName);return o&&o(r,n.parsedStyle),r.isPointInPath(e.x,e.y)}}var n;return n=t,t.prototype.apply=function(t){var e=this;t.hooks.pick.tap(n.tag,(function(t){var n=t.position,r=n.x,o=n.y,i=a.vec3.fromValues(r,o,0),u=[],c=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),f=c.map((function(t){return t.name}));return c.forEach((function(t){var n=t.name,r=e.displayObjectPool.getByName(n);if(r.isVisible()&&r.interactive){if(r.parentNode&&-1===f.indexOf(r.parentNode.entity.getName()))return;var o=r.style.clipPath||r,c=r.getWorldTransform();r.style.clipPath&&(c=a.mat4.multiply(a.mat4.create(),c,r.style.clipPath.getLocalTransform())),e.isHit(o,i,c)&&u.push(r)}})),u.sort(e.sceneGraphService.sort),t.picked=u[u.length-1]||null,t}))},t.tag="CanvasPickerPlugin",(0,r.__decorate)([(0,u.inject)(o.SceneGraphService),(0,r.__metadata)("design:type",Object)],t.prototype,"sceneGraphService",void 0),(0,r.__decorate)([(0,u.inject)(o.DisplayObjectPool),(0,r.__metadata)("design:type",o.DisplayObjectPool)],t.prototype,"displayObjectPool",void 0),(0,r.__decorate)([(0,u.inject)(o.OffscreenCanvasCreator),(0,r.__metadata)("design:type",o.OffscreenCanvasCreator)],t.prototype,"offscreenCanvas",void 0),(0,r.__decorate)([(0,u.inject)(i.RBushRoot),(0,r.__metadata)("design:type",Function)],t.prototype,"rBush",void 0),(0,r.__decorate)([(0,u.inject)(i.PathGeneratorFactory),(0,r.__metadata)("design:type",Function)],t.prototype,"pathGeneratorFactory",void 0),(0,r.__decorate)([(0,u.inject)("PointInPathPicker"),(0,r.__metadata)("design:type",Function)],t.prototype,"pointInPathPickerFactory",void 0),t=n=(0,r.__decorate)([(0,u.singleton)({contrib:o.RenderingPluginContribution})],t)}();n.CanvasPickerPlugin=c},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n){var e=t.parsedStyle,o=e.r,i=void 0===o?0:o,a=e.fill,u=e.stroke,c=e.lineWidth,f=void 0===c?0:c,s=e.clipPathTargets,d=f/2,l=(0,r.distance)(i,i,n.x,n.y),h=!!(null==s?void 0:s.length);if(a&&u||h)return l<=i+d;if(a)return l<=i;if(u)return l>=i-d&&l<=i+d;return!1};var r=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=(r=e(8))&&r.__esModule?r:{default:r},i=e(4),a=e(22);function u(t,n,e,r){var o=1-r;return o*o*t+2*r*o*n+r*r*e}function c(t,n,e){var r=t+e-2*n;if((0,i.isNumberEqual)(r,0))return[.5];var o=(t-n)/r;return o<=1&&o>=0?[o]:[]}function f(t,n,e,r){return 2*(1-r)*(n-t)+2*r*(e-n)}function s(t,n,e,r,i,a,c){var f=u(t,e,i,c),s=u(n,r,a,c),d=o.default.pointAt(t,n,e,r,c),l=o.default.pointAt(e,r,i,a,c);return[[t,n,d.x,d.y,f,s],[f,s,l.x,l.y,i,a]]}var d={box:function(t,n,e,r,o,a){var f=c(t,e,o)[0],s=c(n,r,a)[0],d=[t,o],l=[n,a];return void 0!==f&&d.push(u(t,e,o,f)),void 0!==s&&l.push(u(n,r,a,s)),(0,i.getBBoxByArray)(d,l)},length:function(t,n,e,r,o,a){return function t(n,e,r,o,a,u,c){if(0===c)return((0,i.distance)(n,e,r,o)+(0,i.distance)(r,o,a,u)+(0,i.distance)(n,e,a,u))/2;var f=s(n,e,r,o,a,u,.5),d=f[0],l=f[1];return d.push(c-1),l.push(c-1),t.apply(null,d)+t.apply(null,l)}(t,n,e,r,o,a,3)},nearestPoint:function(t,n,e,r,o,i,c,f){return(0,a.nearestPoint)([t,e,o],[n,r,i],c,f,u)},pointDistance:function(t,n,e,r,o,a,u,c){var f=this.nearestPoint(t,n,e,r,o,a,u,c);return(0,i.distance)(f.x,f.y,u,c)},interpolationAt:u,pointAt:function(t,n,e,r,o,i,a){return{x:u(t,e,o,a),y:u(n,r,i,a)}},divide:function(t,n,e,r,o,i,a){return s(t,n,e,r,o,i,a)},tangentAngle:function(t,n,e,r,o,a,u){var c=f(t,e,o,u),s=f(n,r,a,u),d=Math.atan2(s,c);return(0,i.piMod)(d)}};n.default=d},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=e(0),i=e(4),a=(r=e(8))&&r.__esModule?r:{default:r},u=e(22);function c(t,n,e,r,o){var i=1-o;return i*i*i*t+3*n*o*i*i+3*e*o*o*i+r*o*o*o}function f(t,n,e,r,o){var i=1-o;return 3*(i*i*(n-t)+2*i*o*(e-n)+o*o*(r-e))}function s(t,n,e,r){var o,a,u,c=-3*t+9*n-9*e+3*r,f=6*t-12*n+6*e,s=3*n-3*t,d=[];if((0,i.isNumberEqual)(c,0))(0,i.isNumberEqual)(f,0)||(o=-s/f)>=0&&o<=1&&d.push(o);else{var l=f*f-4*c*s;(0,i.isNumberEqual)(l,0)?d.push(-f/(2*c)):l>0&&(a=(-f-(u=Math.sqrt(l)))/(2*c),(o=(-f+u)/(2*c))>=0&&o<=1&&d.push(o),a>=0&&a<=1&&d.push(a))}return d}function d(t,n,e,r,o,i,u,f,s){var d=c(t,e,o,u,s),l=c(n,r,i,f,s),h=a.default.pointAt(t,n,e,r,s),v=a.default.pointAt(e,r,o,i,s),p=a.default.pointAt(o,i,u,f,s),y=a.default.pointAt(h.x,h.y,v.x,v.y,s),m=a.default.pointAt(v.x,v.y,p.x,p.y,s);return[[t,n,h.x,h.y,y.x,y.y,d,l],[d,l,m.x,m.y,p.x,p.y,u,f]]}var l={extrema:s,box:function(t,n,e,r,o,a,u,f){for(var d=[t,u],l=[n,f],h=s(t,e,o,u),v=s(n,r,a,f),p=0;p<h.length;p++)d.push(c(t,e,o,u,h[p]));for(p=0;p<v.length;p++)l.push(c(n,r,a,f,v[p]));return(0,i.getBBoxByArray)(d,l)},length:function(t,n,e,r,i,a,c,f){return function t(n,e,r,i,a,c,f,s,l){if(0===l)return(0,u.snapLength)([n,r,a,f],[e,i,c,s]);var h=d(n,e,r,i,a,c,f,s,.5),v=(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(h[0]),!1),[l-1],!1),p=(0,o.__spreadArray)((0,o.__spreadArray)([],(0,o.__read)(h[1]),!1),[l-1],!1);return t.apply(null,v)+t.apply(null,p)}(t,n,e,r,i,a,c,f,3)},nearestPoint:function(t,n,e,r,o,i,a,f,s,d,l){return(0,u.nearestPoint)([t,e,o,a],[n,r,i,f],s,d,c,l)},pointDistance:function(t,n,e,r,o,a,u,c,f,s,d){var l=this.nearestPoint(t,n,e,r,o,a,u,c,f,s,d);return(0,i.distance)(l.x,l.y,f,s)},interpolationAt:c,pointAt:function(t,n,e,r,o,i,a,u,f){return{x:c(t,e,o,a,f),y:c(n,r,i,u,f)}},divide:function(t,n,e,r,o,i,a,u,c){return d(t,n,e,r,o,i,a,u,c)},tangentAngle:function(t,n,e,r,o,a,u,c,s){var d=f(t,e,o,u,s),l=f(n,r,a,c,s);return(0,i.piMod)(Math.atan2(l,d))}};n.default=l},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=e(0),i=e(4),a=(r=e(43))&&r.__esModule?r:{default:r};function u(t,n,e,r,o,i){return e*Math.cos(o)*Math.cos(i)-r*Math.sin(o)*Math.sin(i)+t}function c(t,n,e,r,o,i){return e*Math.sin(o)*Math.cos(i)+r*Math.cos(o)*Math.sin(i)+n}function f(t,n,e){return{x:t*Math.cos(e),y:n*Math.sin(e)}}function s(t,n,e){var r=Math.cos(e),o=Math.sin(e);return[t*r-n*o,t*o+n*r]}var d={box:function(t,n,e,r,o,i,a){for(var f=function(t,n,e){return Math.atan(-n/t*Math.tan(e))}(e,r,o),s=1/0,d=-1/0,l=[i,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var v=f+h;i<a?i<v&&v<a&&l.push(v):a<v&&v<i&&l.push(v)}for(h=0;h<l.length;h++){var p=u(t,0,e,r,o,l[h]);p<s&&(s=p),p>d&&(d=p)}var y=function(t,n,e){return Math.atan(n/(t*Math.tan(e)))}(e,r,o),m=1/0,g=-1/0,M=[i,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var b=y+h;i<a?i<b&&b<a&&M.push(b):a<b&&b<i&&M.push(b)}for(h=0;h<M.length;h++){var P=c(0,n,e,r,o,M[h]);P<m&&(m=P),P>g&&(g=P)}return{x:s,y:m,width:d-s,height:g-m}},length:function(t,n,e,r,o,i,a){},nearestPoint:function(t,n,e,r,i,u,c,d,l){var h=s(d-t,l-n,-i),v=(0,o.__read)(h,2),p=v[0],y=v[1],m=a.default.nearestPoint(0,0,e,r,p,y),g=function(t,n,e,r){return(Math.atan2(r*t,e*n)+2*Math.PI)%(2*Math.PI)}(e,r,m.x,m.y);g<u?m=f(e,r,u):g>c&&(m=f(e,r,c));var M=s(m.x,m.y,i);return{x:M[0]+t,y:M[1]+n}},pointDistance:function(t,n,e,r,o,a,u,c,f){var s=this.nearestPoint(t,n,e,r,o,a,u,c,f);return(0,i.distance)(s.x,s.y,c,f)},pointAt:function(t,n,e,r,o,i,a,f){var s=(a-i)*f+i;return{x:u(t,0,e,r,o,s),y:c(0,n,e,r,o,s)}},tangentAngle:function(t,n,e,r,o,a,u,c){var f=(u-a)*c+a,s=function(t,n,e,r,o,i,a,u){return-1*e*Math.cos(o)*Math.sin(u)-r*Math.sin(o)*Math.cos(u)}(0,0,e,r,o,0,0,f),d=function(t,n,e,r,o,i,a,u){return-1*e*Math.sin(o)*Math.sin(u)+r*Math.cos(o)*Math.cos(u)}(0,0,e,r,o,0,0,f);return(0,i.piMod)(Math.atan2(d,s))}};n.default=d},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e(4);function o(t,n){var e=Math.abs(t);return n>0?e:-1*e}var i={box:function(t,n,e,r){return{x:t-e,y:n-r,width:2*e,height:2*r}},length:function(t,n,e,r){return Math.PI*(3*(e+r)-Math.sqrt((3*e+r)*(e+3*r)))},nearestPoint:function(t,n,e,r,i,a){var u=e,c=r;if(0===u||0===c)return{x:t,y:n};for(var f=i-t,s=a-n,d=Math.abs(f),l=Math.abs(s),h=u*u,v=c*c,p=Math.PI/4,y=0,m=0,g=0;g<4;g++){y=u*Math.cos(p),m=c*Math.sin(p);var M=(h-v)*Math.pow(Math.cos(p),3)/u,b=(v-h)*Math.pow(Math.sin(p),3)/c,P=y-M,_=m-b,x=d-M,O=l-b,E=Math.hypot(_,P),S=Math.hypot(O,x);p+=E*Math.asin((P*O-_*x)/(E*S))/Math.sqrt(h+v-y*y-m*m),p=Math.min(Math.PI/2,Math.max(0,p))}return{x:t+o(y,f),y:n+o(m,s)}},pointDistance:function(t,n,e,o,i,a){var u=this.nearestPoint(t,n,e,o,i,a);return(0,r.distance)(u.x,u.y,i,a)},pointAt:function(t,n,e,r,o){var i=2*Math.PI*o;return{x:t+e*Math.cos(i),y:n+r*Math.sin(i)}},tangentAngle:function(t,n,e,o,i){var a=2*Math.PI*i,u=Math.atan2(o*Math.cos(a),-e*Math.sin(a));return(0,r.piMod)(u)}};n.default=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=e(23),i=(r=e(24))&&r.__esModule?r:{default:r};function a(t){var n=t.slice(0);return t.length&&n.push(t[0]),n}var u={box:function(t){return i.default.box(t)},length:function(t){return(0,o.lengthOfSegment)(a(t))},pointAt:function(t,n){return(0,o.pointAtSegments)(a(t),n)},pointDistance:function(t,n,e){return(0,o.distanceAtSegment)(a(t),n,e)},tangentAngle:function(t,n){return(0,o.angleAtSegments)(a(t),n)}};n.default=u},function(t,n,e){"use strict";function r(t,n,e,r){return t/(e*e)+n/(r*r)}Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n){var e=n.x,o=n.y,i=t.parsedStyle,a=i.rx,u=void 0===a?0:a,c=i.ry,f=void 0===c?0:c,s=i.fill,d=i.stroke,l=i.lineWidth,h=void 0===l?0:l,v=i.clipPathTargets,p=!!(null==v?void 0:v.length),y=h/2,m=(e-u)*(e-u),g=(o-f)*(o-f);if(s&&d||p)return r(m,g,u+y,f+y)<=1;if(s)return r(m,g,u,f)<=1;if(d)return r(m,g,u-y,f-y)>=1&&r(m,g,u+y,f+y)<=1;return!1}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n){var e=t.parsedStyle,o=e.x1,i=e.y1,a=e.x2,u=e.y2,c=e.lineWidth,f=void 0===c?0:c,s=e.defX,d=void 0===s?0:s,l=e.defY,h=void 0===l?0:l;return(0,r.inLine)(o,i,a,u,f,n.x+d,n.y+h)};var r=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n){var e=t.parsedStyle,o=e.stroke,i=e.lineWidth,a=void 0===i?0:i,u=e.points,c=e.defX,f=void 0===c?0:c,s=e.defY,d=void 0===s?0:s,l=e.clipPathTargets,h=!!(null==l?void 0:l.length);if(!o&&!h||!a)return!1;return(0,r.inPolyline)(u.points,a,n.x+f,n.y+d,!1)};var r=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n,e){var a=t.parsedStyle,u=a.lineWidth,c=void 0===u?0:u,f=a.stroke,s=a.fill,d=a.defX,l=void 0===d?0:d,h=a.defY,v=void 0===h?0:h,p=a.clipPathTargets,y=a.path,m=y.segments,g=y.hasArc,M=y.polylines,b=y.polygons,P=y.totalLength,_=!!(null==p?void 0:p.length),x=!1;(f||_)&&(x=function(t,n,e,a,u,c,f){for(var s=!1,d=n/2,l=0;l<t.length;l++){var h=t[l],v=h.currentPoint,p=h.params,y=h.prePoint,m=h.box;if(!m||(0,i.inBox)(m.x-d,m.y-d,m.width+n,m.height+n,e,a)){switch(h.command){case"L":case"Z":s=(0,i.inLine)(y[0],y[1],v[0],v[1],n,e,a);break;case"Q":var g=o.Quad.pointDistance(y[0],y[1],p[1],p[2],p[3],p[4],e,a);s=g<=n/2;break;case"C":var M=o.Cubic.pointDistance(y[0],y[1],p[1],p[2],p[3],p[4],p[5],p[6],e,a,u);s=M<=n/2;break;case"A":var b=h.arcParams,P=b.cx,_=b.cy,x=b.rx,O=b.ry,E=b.startAngle,S=b.endAngle,A=b.xRotation,j=x>O?x:O,w=x>O?1:x/O,R=x>O?O/x:1,C=r.mat3.fromTranslation(r.mat3.create(),[-P,-_]);r.mat3.multiply(C,r.mat3.fromRotation(r.mat3.create(),-A),C),r.mat3.multiply(C,r.mat3.fromScaling(r.mat3.create(),[1/w,1/R]),C);var T=r.vec2.fromValues(e,a);T=r.vec2.transformMat3(T,T,C),s=(0,i.inArc)(0,0,j,E,S,n,T[0],T[1])}if(s)break}}return s}(m,c,n.x+l,n.y+v,P));x||!s&&!_||(x=g?e(t,n):(0,i.inPolygons)(b,n.x+l,n.y+v)||(0,i.inPolygons)(M,n.x+l,n.y+v));return x};var r=e(9),o=e(21),i=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n,e){var o=t.parsedStyle,i=o.radius,a=o.fill,u=o.stroke,c=o.lineWidth,f=void 0===c?0:c,s=o.width,d=o.height,l=o.clipPathTargets,h=!!(null==l?void 0:l.length);if(i){var v=!1;return(u||h)&&(v=function(t,n,e,o,i,a,u,c){return(0,r.inLine)(t+i,n,t+e-i,n,a,u,c)||(0,r.inLine)(t+e,n+i,t+e,n+o-i,a,u,c)||(0,r.inLine)(t+e-i,n+o,t+i,n+o,a,u,c)||(0,r.inLine)(t,n+o-i,t,n+i,a,u,c)||(0,r.inArc)(t+e-i,n+i,i,1.5*Math.PI,2*Math.PI,a,u,c)||(0,r.inArc)(t+e-i,n+o-i,i,0,.5*Math.PI,a,u,c)||(0,r.inArc)(t+i,n+o-i,i,.5*Math.PI,Math.PI,a,u,c)||(0,r.inArc)(t+i,n+i,i,Math.PI,1.5*Math.PI,a,u,c)}(0,0,s,d,i,f,n.x,n.y)),v||!a&&!h||(v=e(t,n)),v}var p=f/2;if(a&&u||h)return(0,r.inBox)(0-p,0-p,s+p,d+p,n.x,n.y);if(a)return(0,r.inBox)(0,0,s,d,n.x,n.y);if(u)return(0,r.inRect)(0,0,s,d,f,n.x,n.y);return!1};var r=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isPointInPath=function(t,n){var e=t.parsedStyle,o=e.stroke,i=e.fill,a=e.lineWidth,u=void 0===a?0:a,c=e.points,f=e.defX,s=void 0===f?0:f,d=e.defY,l=void 0===d?0:d,h=e.clipPathTargets,v=!!(null==h?void 0:h.length),p=!1;(o||v)&&(p=(0,r.inPolyline)(c.points,u,n.x+s,n.y+l,!0));p||!i&&!v||(p=(0,r.inPolygon)(c.points,n.x+s,n.y+l));return p};var r=e(5)},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.HTMLRenderingPlugin=void 0;var r=e(0),o=e(1),i=e(2),a=e(3),u=function(){function t(){}var n;return n=t,t.prototype.apply=function(t){var e=this,r=function(t){var n=t.target;if(n.nodeName===i.SHAPE.HTML){var r=n.parsedStyle.innerHTML,o="g-html-"+n.entity.getName(),u=e.contextService.getDomElement().parentNode;if(!u.querySelector("#"+o)){var c=document.createElement("div");n.parsedStyle.$el=c,c.id=o,(0,a.isString)(r)?c.innerHTML=r:c.appendChild(r),u.appendChild(c)}}},o=function(t){var n=t.target;if(n.nodeName===i.SHAPE.HTML){var r="g-html-"+n.entity.getName(),o=e.contextService.getDomElement().parentNode,a=o.querySelector("#"+r);a&&o.removeChild(a)}};t.hooks.init.tap(n.tag,(function(){e.renderingContext.root.addEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.addEventListener(i.ElementEvent.UNMOUNTED,o)})),t.hooks.destroy.tap(n.tag,(function(){e.renderingContext.root.removeEventListener(i.ElementEvent.MOUNTED,r),e.renderingContext.root.removeEventListener(i.ElementEvent.UNMOUNTED,o)})),t.hooks.render.tap(n.tag,(function(t){if(t.nodeName===i.SHAPE.HTML){var n="g-html-"+t.entity.getName(),r=e.contextService.getDomElement().parentNode.querySelector("#"+n);e.updateCSSStyle(r,t.parsedStyle,t)}}))},t.prototype.updateCSSStyle=function(t,n,e){var r=n.zIndex,o=void 0===r?0:r,a=n.visibility,u=void 0===a?"visible":a,c=n.opacity,f=void 0===c?1:c,s=n.fill,d=n.lineWidth,l=void 0===d?0:d,h=n.lineDash,v=n.stroke,p=n.anchor,y=n.width,m=void 0===y?0:y,g=n.height,M=void 0===g?0:g,b=n.style,P=void 0===b?"":b,_=n.className,x=void 0===_?"":_,O={position:"absolute",top:0,left:0};if(O.width=m+"px",O.height=M+"px",O.transform="matrix3d("+e.getWorldTransform().join(",")+")",p&&(O.transform+=" translate("+100*p[0]+"%, "+100*p[0]+"%)"),e.style.transformOrigin&&(O["transform-origin"]=e.style.transformOrigin),O["z-index"]=o,O.visibility=u,O.opacity=f,s){var E="";if(s.type===i.PARSED_COLOR_TYPE.Constant)E=s.formatted;else if(s.type===i.PARSED_COLOR_TYPE.LinearGradient){E="linear-gradient(to right, "+s.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}else s.type===i.PARSED_COLOR_TYPE.RadialGradient||(s.type,i.PARSED_COLOR_TYPE.Pattern);O.background=E}O["border-width"]=l+"px",v&&v.type===i.PARSED_COLOR_TYPE.Constant&&(O["border-color"]=v.formatted,O["border-style"]="solid"),h&&(O["border-style"]="dashed"),e.style.filter&&(O.filter=e.style.filter),x&&(Array.isArray(x)?x.forEach((function(n){t.classList.add(n)})):t.classList.add(x)),t.setAttribute("style",Object.keys(O).map((function(t){return t+":"+O[t]})).join(";")+P)},t.tag="HTMLRenderingPlugin",(0,r.__decorate)([(0,o.inject)(i.ContextService),(0,r.__metadata)("design:type",Object)],t.prototype,"contextService",void 0),(0,r.__decorate)([(0,o.inject)(i.RenderingContext),(0,r.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),t=n=(0,r.__decorate)([(0,o.singleton)({contrib:i.RenderingPluginContribution})],t)}();n.HTMLRenderingPlugin=u},function(t,n,e){"use strict";e.r(n),e.d(n,"DomInteraction",(function(){return i})),e.d(n,"CanvasRenderer",(function(){return a})),e.d(n,"CanvasPicker",(function(){return u})),e.d(n,"HTMLRenderer",(function(){return c})),e.d(n,"Renderer",(function(){return p}));var r=e(0),o=e(2),i=e(11),a=e(10),u=e(12),c=e(13),f=e(1),s=e(3),d="undefined"!=typeof window&&void 0!==window.document;var l=function(){function t(){}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,e=t.width,r=t.height;if(this.$container=Object(s.isString)(n)?document.getElementById(n):n,this.$container){var o=document.createElement("canvas");this.context=o.getContext("2d"),this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o;var i=window.devicePixelRatio||1;i=i>=1?Math.ceil(i):1,this.dpr=i,this.resize(e,r)}},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){var t;return null===(t=this.$canvas)||void 0===t?void 0:t.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,function(t,n,e){d&&(t.style.width=n+"px",t.style.height=e+"px")}(this.$canvas,t,n))},t.prototype.applyCursorStyle=function(t){this.$container&&(this.$container.style.cursor=t)},Object(r.__decorate)([Object(f.inject)(o.CanvasConfig),Object(r.__metadata)("design:type",Object)],t.prototype,"canvasConfig",void 0),t=Object(r.__decorate)([Object(f.singleton)({token:o.ContextService})],t)}(),h=Object(f.Module)((function(t){t(l)})),v=function(){function t(){}return t.prototype.init=function(t){t.load(h,!0)},t.prototype.destroy=function(t){t.remove(l)},t}(),p=function(t){function n(n){var e=t.call(this,n)||this;return e.registerPlugin(new v),e.registerPlugin(new a.Plugin),e.registerPlugin(new i.Plugin),e.registerPlugin(new u.Plugin),e.registerPlugin(new c.Plugin),e}return Object(r.__extends)(n,t),n}(o.AbstractRenderer)}])}));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ContextService } from '@antv/g';
|
|
2
|
-
export declare class Canvas2DContextService implements ContextService<CanvasRenderingContext2D> {
|
|
3
|
-
private $container;
|
|
4
|
-
private $canvas;
|
|
5
|
-
private dpr;
|
|
6
|
-
private context;
|
|
7
|
-
private canvasConfig;
|
|
8
|
-
init(): void;
|
|
9
|
-
getContext(): CanvasRenderingContext2D;
|
|
10
|
-
getDomElement(): HTMLCanvasElement;
|
|
11
|
-
getDPR(): number;
|
|
12
|
-
getBoundingClientRect(): DOMRect;
|
|
13
|
-
destroy(): void;
|
|
14
|
-
resize(width: number, height: number): void;
|
|
15
|
-
applyCursorStyle(cursor: string): void;
|
|
16
|
-
}
|
|
1
|
+
import { ContextService } from '@antv/g';
|
|
2
|
+
export declare class Canvas2DContextService implements ContextService<CanvasRenderingContext2D> {
|
|
3
|
+
private $container;
|
|
4
|
+
private $canvas;
|
|
5
|
+
private dpr;
|
|
6
|
+
private context;
|
|
7
|
+
private canvasConfig;
|
|
8
|
+
init(): void;
|
|
9
|
+
getContext(): CanvasRenderingContext2D;
|
|
10
|
+
getDomElement(): HTMLCanvasElement;
|
|
11
|
+
getDPR(): number;
|
|
12
|
+
getBoundingClientRect(): DOMRect;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
resize(width: number, height: number): void;
|
|
15
|
+
applyCursorStyle(cursor: string): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { CanvasConfig, ContextService } from '@antv/g';
|
|
3
|
+
import { inject, singleton } from 'mana-syringe';
|
|
4
|
+
import { isString } from '@antv/util';
|
|
5
|
+
import { setDOMSize } from './utils/dom';
|
|
6
|
+
|
|
7
|
+
var Canvas2DContextService =
|
|
8
|
+
/** @class */
|
|
9
|
+
function () {
|
|
10
|
+
function Canvas2DContextService() {}
|
|
11
|
+
|
|
12
|
+
Canvas2DContextService.prototype.init = function () {
|
|
13
|
+
var _a = this.canvasConfig,
|
|
14
|
+
container = _a.container,
|
|
15
|
+
width = _a.width,
|
|
16
|
+
height = _a.height; // create container
|
|
17
|
+
|
|
18
|
+
this.$container = isString(container) ? document.getElementById(container) : container;
|
|
19
|
+
|
|
20
|
+
if (this.$container) {
|
|
21
|
+
// create canvas
|
|
22
|
+
var $canvas = document.createElement('canvas');
|
|
23
|
+
this.context = $canvas.getContext('2d');
|
|
24
|
+
this.$container.appendChild($canvas);
|
|
25
|
+
|
|
26
|
+
if (!this.$container.style.position) {
|
|
27
|
+
this.$container.style.position = 'relative';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
this.$canvas = $canvas;
|
|
31
|
+
var dpr = window.devicePixelRatio || 1;
|
|
32
|
+
dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
|
|
33
|
+
this.dpr = dpr;
|
|
34
|
+
this.resize(width, height);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Canvas2DContextService.prototype.getContext = function () {
|
|
39
|
+
return this.context;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
Canvas2DContextService.prototype.getDomElement = function () {
|
|
43
|
+
return this.$canvas;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
Canvas2DContextService.prototype.getDPR = function () {
|
|
47
|
+
return this.dpr;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Canvas2DContextService.prototype.getBoundingClientRect = function () {
|
|
51
|
+
var _a;
|
|
52
|
+
|
|
53
|
+
return (_a = this.$canvas) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
Canvas2DContextService.prototype.destroy = function () {
|
|
57
|
+
if (this.$container && this.$canvas && this.$canvas.parentNode) {
|
|
58
|
+
// destroy context
|
|
59
|
+
this.$container.removeChild(this.$canvas);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
Canvas2DContextService.prototype.resize = function (width, height) {
|
|
64
|
+
if (this.$canvas) {
|
|
65
|
+
// set canvas width & height
|
|
66
|
+
this.$canvas.width = this.dpr * width;
|
|
67
|
+
this.$canvas.height = this.dpr * height; // set CSS style width & height
|
|
68
|
+
|
|
69
|
+
setDOMSize(this.$canvas, width, height);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Canvas2DContextService.prototype.applyCursorStyle = function (cursor) {
|
|
74
|
+
if (this.$container) {
|
|
75
|
+
this.$container.style.cursor = cursor;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
__decorate([inject(CanvasConfig), __metadata("design:type", Object)], Canvas2DContextService.prototype, "canvasConfig", void 0);
|
|
80
|
+
|
|
81
|
+
Canvas2DContextService = __decorate([singleton({
|
|
82
|
+
token: ContextService
|
|
83
|
+
})], Canvas2DContextService);
|
|
84
|
+
return Canvas2DContextService;
|
|
85
|
+
}();
|
|
86
|
+
|
|
87
|
+
export { Canvas2DContextService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Syringe } from 'mana-syringe';
|
|
2
|
-
import { RendererPlugin } from '@antv/g';
|
|
3
|
-
export declare class ContextRegisterPlugin implements RendererPlugin {
|
|
4
|
-
init(container: Syringe.Container): void;
|
|
5
|
-
destroy(container: Syringe.Container): void;
|
|
6
|
-
}
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
2
|
+
import { RendererPlugin } from '@antv/g';
|
|
3
|
+
export declare class ContextRegisterPlugin implements RendererPlugin {
|
|
4
|
+
init(container: Syringe.Container): void;
|
|
5
|
+
destroy(container: Syringe.Container): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Module } from 'mana-syringe';
|
|
2
|
+
import { Canvas2DContextService } from './Canvas2DContextService';
|
|
3
|
+
var containerModule = Module(function (register) {
|
|
4
|
+
/**
|
|
5
|
+
* implements ContextService
|
|
6
|
+
*/
|
|
7
|
+
register(Canvas2DContextService);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
var ContextRegisterPlugin =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
13
|
+
function ContextRegisterPlugin() {}
|
|
14
|
+
|
|
15
|
+
ContextRegisterPlugin.prototype.init = function (container) {
|
|
16
|
+
container.load(containerModule, true);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
ContextRegisterPlugin.prototype.destroy = function (container) {
|
|
20
|
+
container.remove(Canvas2DContextService); // @ts-ignore
|
|
21
|
+
// container.container.unload(containerModule);
|
|
22
|
+
// container.remove(Canvas2DContextService);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return ContextRegisterPlugin;
|
|
26
|
+
}();
|
|
27
|
+
|
|
28
|
+
export { ContextRegisterPlugin };
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractRenderer, RendererConfig } from '@antv/g';
|
|
2
|
+
import * as DomInteraction from '@antv/g-plugin-dom-interaction';
|
|
3
|
+
import * as CanvasRenderer from '@antv/g-plugin-canvas-renderer';
|
|
4
|
+
import * as CanvasPicker from '@antv/g-plugin-canvas-picker';
|
|
5
|
+
import * as HTMLRenderer from '@antv/g-plugin-html-renderer';
|
|
6
|
+
export { DomInteraction, CanvasRenderer, CanvasPicker, HTMLRenderer };
|
|
7
|
+
export declare class Renderer extends AbstractRenderer {
|
|
8
|
+
constructor(config?: Partial<RendererConfig>);
|
|
9
|
+
}
|
package/es/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { AbstractRenderer } from '@antv/g';
|
|
3
|
+
import * as DomInteraction from '@antv/g-plugin-dom-interaction';
|
|
4
|
+
import * as CanvasRenderer from '@antv/g-plugin-canvas-renderer';
|
|
5
|
+
import * as CanvasPicker from '@antv/g-plugin-canvas-picker';
|
|
6
|
+
import * as HTMLRenderer from '@antv/g-plugin-html-renderer';
|
|
7
|
+
import { ContextRegisterPlugin } from './ContextRegisterPlugin';
|
|
8
|
+
export { DomInteraction, CanvasRenderer, CanvasPicker, HTMLRenderer };
|
|
9
|
+
|
|
10
|
+
var Renderer =
|
|
11
|
+
/** @class */
|
|
12
|
+
function (_super) {
|
|
13
|
+
__extends(Renderer, _super);
|
|
14
|
+
|
|
15
|
+
function Renderer(config) {
|
|
16
|
+
var _this = _super.call(this, config) || this; // register Canvas2DContext
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
_this.registerPlugin(new ContextRegisterPlugin()); // enable rendering with Canvas2D API
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
_this.registerPlugin(new CanvasRenderer.Plugin());
|
|
23
|
+
|
|
24
|
+
_this.registerPlugin(new DomInteraction.Plugin()); // enable picking with Canvas2D API
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
_this.registerPlugin(new CanvasPicker.Plugin()); // render HTML component
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
_this.registerPlugin(new HTMLRenderer.Plugin());
|
|
31
|
+
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return Renderer;
|
|
36
|
+
}(AbstractRenderer);
|
|
37
|
+
|
|
38
|
+
export { Renderer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isBrowser: boolean;
|
|
1
|
+
export declare const isBrowser: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function setDOMSize($el: HTMLElement, width: number, height: number): void;
|
|
1
|
+
export declare function setDOMSize($el: HTMLElement, width: number, height: number): void;
|