31 lines
2.0 MiB
31 lines
2.0 MiB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.G6=e():t.G6=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=547)}([function(t,e,n){"use strict";n.d(e,"j",(function(){return v})),n.d(e,"k",(function(){return b})),n.d(e,"x",(function(){return x})),n.d(e,"g",(function(){return i})),n.d(e,"H",(function(){return w})),n.d(e,"b",(function(){return _})),n.d(e,"h",(function(){return E})),n.d(e,"A",(function(){return M})),n.d(e,"E",(function(){return A})),n.d(e,"G",(function(){return T})),n.d(e,"m",(function(){return c})),n.d(e,"n",(function(){return P})),n.d(e,"o",(function(){return D})),n.d(e,"r",(function(){return s})),n.d(e,"s",(function(){return u})),n.d(e,"t",(function(){return S})),n.d(e,"u",(function(){return l})),n.d(e,"v",(function(){return g})),n.d(e,"w",(function(){return y})),n.d(e,"c",(function(){return G})),n.d(e,"d",(function(){return F})),n.d(e,"e",(function(){return z})),n.d(e,"f",(function(){return h})),n.d(e,"l",(function(){return W})),n.d(e,"p",(function(){return X})),n.d(e,"q",(function(){return Y})),n.d(e,"y",(function(){return H})),n.d(e,"z",(function(){return B})),n.d(e,"a",(function(){return B})),n.d(e,"i",(function(){return q})),n.d(e,"D",(function(){return Q})),n.d(e,"F",(function(){return K})),n.d(e,"B",(function(){return $})),n.d(e,"C",(function(){return J}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];e(o,i)&&n.push(o)}return n},o={}.toString,a=function(t,e){return o.call(t)==="[object "+e+"]"},s=function(t){return a(t,"Function")},u=function(t){return null==t},c=function(t){return Array.isArray?Array.isArray(t):a(t,"Array")};function f(t){return(f="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)}var l=function(t){var e=f(t);return null!==t&&"object"===e||"function"===e};var h=function(t,e){if(t)if(c(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(l(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;function d(t){return(d="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)}var p=function(t){return"object"===d(t)&&null!==t},g=function(t){if(!p(t)||!a(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var v=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(c(t[0])){for(var n=[],r=0;r<t.length;r++)n=n.concat(t[r]);e=n}var i=Math.max.apply(null,e);return{min:Math.min.apply(null,e),max:i}},m=Array.prototype,y=(m.splice,m.indexOf,Array.prototype.splice,function(t){return a(t,"String")});function b(t){if(r(t))return t[0]}function x(t){if(r(t)){return t[t.length-1]}}Object.prototype.hasOwnProperty;var w=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n};var _=function(t,e,n){return t<e?e:t>n?n:t},E=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},S=function(t){return a(t,"Number")};Number.isInteger&&Number.isInteger;var M=function(t,e){return(t%e+e)%e},O=(Math.PI,parseInt,Math.PI/180),A=function(t){return O*t},k=(Object.values,function(t){return u(t)?"":t.toString()});var T=function(t){var e=k(t);return e.charAt(0).toUpperCase()+e.substring(1)},I={}.toString,C=function(t){return I.call(t).replace(/^\[object /,"").replace(/]$/,"")},P=function(t){return a(t,"Boolean")},D=function(t){return a(t,"Date")},N=Object.prototype,R=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||N)};function j(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function B(t,e,n,r){return e&&j(t,e),n&&j(t,n),r&&j(t,r),t}function L(t){return(L="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)}var G=function t(e){if("object"!==L(e)||null===e)return e;var n;if(c(e)){n=[];for(var r=0,i=e.length;r<i;r++)"object"===L(e[r])&&null!=e[r]?n[r]=t(e[r]):n[r]=e[r]}else for(var o in n={},e)"object"===L(e[o])&&null!=e[o]?n[o]=t(e[o]):n[o]=e[o];return n};var F=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}};function U(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&g(o)?(g(t[i])||(t[i]={}),n<r?U(t[i],o,n+1,r):t[i]=e[i]):c(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var z=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)U(t,e[r]);return t},W=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i},V=Object.prototype.hasOwnProperty;var X=function(t){if(u(t))return!0;if(r(t))return!t.length;var e=C(t);if("Map"===e||"Set"===e)return!t.size;if(R(t))return!Object.keys(t).length;for(var n in t)if(V.call(t,n))return!1;return!0},Y=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(y(e)||y(n))return!1;if(r(e)||r(n)){if(e.length!==n.length)return!1;for(var i=!0,o=0;o<e.length&&(i=t(e[o],n[o]));o++);return i}if(p(e)||p(n)){var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(i=!0,o=0;o<a.length&&(i=t(e[a[o]],n[a[o]]));o++);return i}return!1},H=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(e(o,i))}return n},q=function(t,e,n){for(var r=0,i=y(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},Q=(Object.prototype.hasOwnProperty,function(t){return r(t)?Array.prototype.slice.call(t):[]}),Z={},K=function(t){return Z[t=t||"g"]?Z[t]+=1:Z[t]=1,t+Z[t]},$=function(){};function J(t){return u(t)?0:r(t)?t.length:Object.keys(t).length}!function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},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}}()},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"f",(function(){return c}));
|
||
/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */
|
||
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function c(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}Object.create},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return pn})),n.d(e,"e",(function(){return Dt})),n.d(e,"f",(function(){return o}));var r={};n.r(r),n.d(r,"create",(function(){return u})),n.d(r,"fromMat4",(function(){return c})),n.d(r,"clone",(function(){return f})),n.d(r,"copy",(function(){return l})),n.d(r,"fromValues",(function(){return h})),n.d(r,"set",(function(){return d})),n.d(r,"identity",(function(){return p})),n.d(r,"transpose",(function(){return g})),n.d(r,"invert",(function(){return v})),n.d(r,"adjoint",(function(){return m})),n.d(r,"determinant",(function(){return y})),n.d(r,"multiply",(function(){return b})),n.d(r,"translate",(function(){return x})),n.d(r,"rotate",(function(){return w})),n.d(r,"scale",(function(){return _})),n.d(r,"fromTranslation",(function(){return E})),n.d(r,"fromRotation",(function(){return S})),n.d(r,"fromScaling",(function(){return M})),n.d(r,"fromMat2d",(function(){return O})),n.d(r,"fromQuat",(function(){return A})),n.d(r,"normalFromMat4",(function(){return k})),n.d(r,"projection",(function(){return T})),n.d(r,"str",(function(){return I})),n.d(r,"frob",(function(){return C})),n.d(r,"add",(function(){return P})),n.d(r,"subtract",(function(){return D})),n.d(r,"multiplyScalar",(function(){return N})),n.d(r,"multiplyScalarAndAdd",(function(){return R})),n.d(r,"exactEquals",(function(){return j})),n.d(r,"equals",(function(){return B})),n.d(r,"mul",(function(){return L})),n.d(r,"sub",(function(){return G}));var i={};n.r(i),n.d(i,"create",(function(){return F})),n.d(i,"clone",(function(){return U})),n.d(i,"copy",(function(){return z})),n.d(i,"fromValues",(function(){return W})),n.d(i,"set",(function(){return V})),n.d(i,"identity",(function(){return X})),n.d(i,"transpose",(function(){return Y})),n.d(i,"invert",(function(){return H})),n.d(i,"adjoint",(function(){return q})),n.d(i,"determinant",(function(){return Q})),n.d(i,"multiply",(function(){return Z})),n.d(i,"translate",(function(){return K})),n.d(i,"scale",(function(){return $})),n.d(i,"rotate",(function(){return J})),n.d(i,"rotateX",(function(){return tt})),n.d(i,"rotateY",(function(){return et})),n.d(i,"rotateZ",(function(){return nt})),n.d(i,"fromTranslation",(function(){return rt})),n.d(i,"fromScaling",(function(){return it})),n.d(i,"fromRotation",(function(){return ot})),n.d(i,"fromXRotation",(function(){return at})),n.d(i,"fromYRotation",(function(){return st})),n.d(i,"fromZRotation",(function(){return ut})),n.d(i,"fromRotationTranslation",(function(){return ct})),n.d(i,"fromQuat2",(function(){return ft})),n.d(i,"getTranslation",(function(){return lt})),n.d(i,"getScaling",(function(){return ht})),n.d(i,"getRotation",(function(){return dt})),n.d(i,"fromRotationTranslationScale",(function(){return pt})),n.d(i,"fromRotationTranslationScaleOrigin",(function(){return gt})),n.d(i,"fromQuat",(function(){return vt})),n.d(i,"frustum",(function(){return mt})),n.d(i,"perspective",(function(){return yt})),n.d(i,"perspectiveFromFieldOfView",(function(){return bt})),n.d(i,"ortho",(function(){return xt})),n.d(i,"lookAt",(function(){return wt})),n.d(i,"targetTo",(function(){return _t})),n.d(i,"str",(function(){return Et})),n.d(i,"frob",(function(){return St})),n.d(i,"add",(function(){return Mt})),n.d(i,"subtract",(function(){return Ot})),n.d(i,"multiplyScalar",(function(){return At})),n.d(i,"multiplyScalarAndAdd",(function(){return kt})),n.d(i,"exactEquals",(function(){return Tt})),n.d(i,"equals",(function(){return It})),n.d(i,"mul",(function(){return Ct})),n.d(i,"sub",(function(){return Pt}));var o={};n.r(o),n.d(o,"create",(function(){return Nt})),n.d(o,"clone",(function(){return Rt})),n.d(o,"fromValues",(function(){return jt})),n.d(o,"copy",(function(){return Bt})),n.d(o,"set",(function(){return Lt})),n.d(o,"add",(function(){return Gt})),n.d(o,"subtract",(function(){return Ft})),n.d(o,"multiply",(function(){return Ut})),n.d(o,"divide",(function(){return zt})),n.d(o,"ceil",(function(){return Wt})),n.d(o,"floor",(function(){return Vt})),n.d(o,"min",(function(){return Xt})),n.d(o,"max",(function(){return Yt})),n.d(o,"round",(function(){return Ht})),n.d(o,"scale",(function(){return qt})),n.d(o,"scaleAndAdd",(function(){return Qt})),n.d(o,"distance",(function(){return Zt})),n.d(o,"squaredDistance",(function(){return Kt})),n.d(o,"length",(function(){return $t})),n.d(o,"squaredLength",(function(){return Jt})),n.d(o,"negate",(function(){return te})),n.d(o,"inverse",(function(){return ee})),n.d(o,"normalize",(function(){return ne})),n.d(o,"dot",(function(){return re})),n.d(o,"cross",(function(){return ie})),n.d(o,"lerp",(function(){return oe})),n.d(o,"random",(function(){return ae})),n.d(o,"transformMat4",(function(){return se})),n.d(o,"transformQuat",(function(){return ue})),n.d(o,"zero",(function(){return ce})),n.d(o,"str",(function(){return fe})),n.d(o,"exactEquals",(function(){return le})),n.d(o,"equals",(function(){return he})),n.d(o,"sub",(function(){return pe})),n.d(o,"mul",(function(){return ge})),n.d(o,"div",(function(){return ve})),n.d(o,"dist",(function(){return me})),n.d(o,"sqrDist",(function(){return ye})),n.d(o,"len",(function(){return be})),n.d(o,"sqrLen",(function(){return xe})),n.d(o,"forEach",(function(){return we}));var a={};n.r(a),n.d(a,"create",(function(){return _e})),n.d(a,"identity",(function(){return Ee})),n.d(a,"setAxisAngle",(function(){return Se})),n.d(a,"getAxisAngle",(function(){return Me})),n.d(a,"getAngle",(function(){return Oe})),n.d(a,"multiply",(function(){return Ae})),n.d(a,"rotateX",(function(){return ke})),n.d(a,"rotateY",(function(){return Te})),n.d(a,"rotateZ",(function(){return Ie})),n.d(a,"calculateW",(function(){return Ce})),n.d(a,"exp",(function(){return Pe})),n.d(a,"ln",(function(){return De})),n.d(a,"pow",(function(){return Ne})),n.d(a,"slerp",(function(){return Re})),n.d(a,"random",(function(){return je})),n.d(a,"invert",(function(){return Be})),n.d(a,"conjugate",(function(){return Le})),n.d(a,"fromMat3",(function(){return Ge})),n.d(a,"fromEuler",(function(){return Fe})),n.d(a,"str",(function(){return Ue})),n.d(a,"clone",(function(){return qe})),n.d(a,"fromValues",(function(){return Qe})),n.d(a,"copy",(function(){return Ze})),n.d(a,"set",(function(){return Ke})),n.d(a,"add",(function(){return $e})),n.d(a,"mul",(function(){return Je})),n.d(a,"scale",(function(){return tn})),n.d(a,"dot",(function(){return en})),n.d(a,"lerp",(function(){return nn})),n.d(a,"length",(function(){return rn})),n.d(a,"len",(function(){return on})),n.d(a,"squaredLength",(function(){return an})),n.d(a,"sqrLen",(function(){return sn})),n.d(a,"normalize",(function(){return un})),n.d(a,"exactEquals",(function(){return cn})),n.d(a,"equals",(function(){return fn})),n.d(a,"rotationTo",(function(){return ln})),n.d(a,"sqlerp",(function(){return hn})),n.d(a,"setAxes",(function(){return dn}));var s=n(9);function u(){var t=new s.a(9);return s.a!=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 c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function f(t){var e=new s.a(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,n,r,i,o,a,u,c){var f=new s.a(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=r,f[4]=i,f[5]=o,f[6]=a,f[7]=u,f[8]=c,f}function d(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function p(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 g(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function v(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=f*a-s*c,h=-f*o+s*u,d=c*o-a*u,p=n*l+r*h+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-f*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(f*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function m(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8];return t[0]=a*f-s*c,t[1]=i*c-r*f,t[2]=r*s-i*a,t[3]=s*u-o*f,t[4]=n*f-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function y(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*s+p*f,t[2]=h*o+d*u+p*l,t[3]=g*r+v*a+m*c,t[4]=g*i+v*s+m*f,t[5]=g*o+v*u+m*l,t[6]=y*r+b*a+x*c,t[7]=y*i+b*s+x*f,t[8]=y*o+b*u+x*l,t}function x(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*r+d*a+c,t[7]=h*i+d*s+f,t[8]=h*o+d*u+l,t}function w(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*r,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=f,t[8]=l,t}function _(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function E(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function S(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function A(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,f=r*a,l=r*s,h=i*a,d=i*s,p=i*u,g=o*a,v=o*s,m=o*u;return t[0]=1-l-p,t[3]=f-m,t[6]=h+v,t[1]=f+m,t[4]=1-c-p,t[7]=d-g,t[2]=h-v,t[5]=d+g,t[8]=1-c-l,t}function k(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,E=i*c-o*u,S=f*g-l*p,M=f*v-h*p,O=f*m-d*p,A=l*v-h*g,k=l*m-d*g,T=h*m-d*v,I=y*T-b*k+x*A+w*O-_*M+E*S;return I?(I=1/I,t[0]=(s*T-u*k+c*A)*I,t[1]=(u*O-a*T-c*M)*I,t[2]=(a*k-s*O+c*S)*I,t[3]=(i*k-r*T-o*A)*I,t[4]=(n*T-i*O+o*M)*I,t[5]=(r*O-n*k-o*S)*I,t[6]=(g*E-v*_+m*w)*I,t[7]=(v*x-p*E-m*b)*I,t[8]=(p*_-g*x+m*y)*I,t):null}function T(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function I(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function C(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function P(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function D(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function N(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function R(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function j(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function B(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=s.b*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-d)<=s.b*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-p)<=s.b*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-g)<=s.b*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-v)<=s.b*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-m)<=s.b*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(c-y)<=s.b*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(f-b)<=s.b*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(l-x)<=s.b*Math.max(1,Math.abs(l),Math.abs(x))}var L=b,G=D;function F(){var t=new s.a(16);return s.a!=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 U(t){var e=new s.a(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function z(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function W(t,e,n,r,i,o,a,u,c,f,l,h,d,p,g,v){var m=new s.a(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=u,m[8]=c,m[9]=f,m[10]=l,m[11]=h,m[12]=d,m[13]=p,m[14]=g,m[15]=v,m}function V(t,e,n,r,i,o,a,s,u,c,f,l,h,d,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=f,t[10]=l,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=v,t}function X(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 Y(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function H(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,E=i*c-o*u,S=f*g-l*p,M=f*v-h*p,O=f*m-d*p,A=l*v-h*g,k=l*m-d*g,T=h*m-d*v,I=y*T-b*k+x*A+w*O-_*M+E*S;return I?(I=1/I,t[0]=(s*T-u*k+c*A)*I,t[1]=(i*k-r*T-o*A)*I,t[2]=(g*E-v*_+m*w)*I,t[3]=(h*_-l*E-d*w)*I,t[4]=(u*O-a*T-c*M)*I,t[5]=(n*T-i*O+o*M)*I,t[6]=(v*x-p*E-m*b)*I,t[7]=(f*E-h*x+d*b)*I,t[8]=(a*k-s*O+c*S)*I,t[9]=(r*O-n*k-o*S)*I,t[10]=(p*_-g*x+m*y)*I,t[11]=(l*x-f*_-d*y)*I,t[12]=(s*M-a*A-u*S)*I,t[13]=(n*A-r*M+i*S)*I,t[14]=(g*b-p*w-v*y)*I,t[15]=(f*w-l*b+h*y)*I,t):null}function q(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(h*m-d*v)-l*(u*m-c*v)+g*(u*d-c*h),t[1]=-(r*(h*m-d*v)-l*(i*m-o*v)+g*(i*d-o*h)),t[2]=r*(u*m-c*v)-s*(i*m-o*v)+g*(i*c-o*u),t[3]=-(r*(u*d-c*h)-s*(i*d-o*h)+l*(i*c-o*u)),t[4]=-(a*(h*m-d*v)-f*(u*m-c*v)+p*(u*d-c*h)),t[5]=n*(h*m-d*v)-f*(i*m-o*v)+p*(i*d-o*h),t[6]=-(n*(u*m-c*v)-a*(i*m-o*v)+p*(i*c-o*u)),t[7]=n*(u*d-c*h)-a*(i*d-o*h)+f*(i*c-o*u),t[8]=a*(l*m-d*g)-f*(s*m-c*g)+p*(s*d-c*l),t[9]=-(n*(l*m-d*g)-f*(r*m-o*g)+p*(r*d-o*l)),t[10]=n*(s*m-c*g)-a*(r*m-o*g)+p*(r*c-o*s),t[11]=-(n*(s*d-c*l)-a*(r*d-o*l)+f*(r*c-o*s)),t[12]=-(a*(l*v-h*g)-f*(s*v-u*g)+p*(s*h-u*l)),t[13]=n*(l*v-h*g)-f*(r*v-i*g)+p*(r*h-i*l),t[14]=-(n*(s*v-u*g)-a*(r*v-i*g)+p*(r*u-i*s)),t[15]=n*(s*h-u*l)-a*(r*h-i*l)+f*(r*u-i*s),t}function Q(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],f=t[9],l=t[10],h=t[11],d=t[12],p=t[13],g=t[14],v=t[15];return(e*a-n*o)*(l*v-h*g)-(e*s-r*o)*(f*v-h*p)+(e*u-i*o)*(f*g-l*p)+(n*s-r*a)*(c*v-h*d)-(n*u-i*a)*(c*g-l*d)+(r*u-i*s)*(c*p-f*d)}function Z(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],_=n[3];return t[0]=b*r+x*s+w*l+_*g,t[1]=b*i+x*u+w*h+_*v,t[2]=b*o+x*c+w*d+_*m,t[3]=b*a+x*f+w*p+_*y,b=n[4],x=n[5],w=n[6],_=n[7],t[4]=b*r+x*s+w*l+_*g,t[5]=b*i+x*u+w*h+_*v,t[6]=b*o+x*c+w*d+_*m,t[7]=b*a+x*f+w*p+_*y,b=n[8],x=n[9],w=n[10],_=n[11],t[8]=b*r+x*s+w*l+_*g,t[9]=b*i+x*u+w*h+_*v,t[10]=b*o+x*c+w*d+_*m,t[11]=b*a+x*f+w*p+_*y,b=n[12],x=n[13],w=n[14],_=n[15],t[12]=b*r+x*s+w*l+_*g,t[13]=b*i+x*u+w*h+_*v,t[14]=b*o+x*c+w*d+_*m,t[15]=b*a+x*f+w*p+_*y,t}function K(t,e,n){var r,i,o,a,s,u,c,f,l,h,d,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*v+l*m+e[12],t[13]=i*g+u*v+h*m+e[13],t[14]=o*g+c*v+d*m+e[14],t[15]=a*g+f*v+p*m+e[15]),t}function $(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function J(t,e,n,r){var i,o,a,u,c,f,l,h,d,p,g,v,m,y,b,x,w,_,E,S,M,O,A,k,T=r[0],I=r[1],C=r[2],P=Math.hypot(T,I,C);return P<s.b?null:(T*=P=1/P,I*=P,C*=P,i=Math.sin(n),a=1-(o=Math.cos(n)),u=e[0],c=e[1],f=e[2],l=e[3],h=e[4],d=e[5],p=e[6],g=e[7],v=e[8],m=e[9],y=e[10],b=e[11],x=T*T*a+o,w=I*T*a+C*i,_=C*T*a-I*i,E=T*I*a-C*i,S=I*I*a+o,M=C*I*a+T*i,O=T*C*a+I*i,A=I*C*a-T*i,k=C*C*a+o,t[0]=u*x+h*w+v*_,t[1]=c*x+d*w+m*_,t[2]=f*x+p*w+y*_,t[3]=l*x+g*w+b*_,t[4]=u*E+h*S+v*M,t[5]=c*E+d*S+m*M,t[6]=f*E+p*S+y*M,t[7]=l*E+g*S+b*M,t[8]=u*O+h*A+v*k,t[9]=c*O+d*A+m*k,t[10]=f*O+p*A+y*k,t[11]=l*O+g*A+b*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],f=e[9],l=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=s*i+l*r,t[7]=u*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-s*r,t[11]=h*i-u*r,t}function et(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],f=e[9],l=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-f*r,t[2]=s*i-l*r,t[3]=u*i-h*r,t[8]=o*r+c*i,t[9]=a*r+f*i,t[10]=s*r+l*i,t[11]=u*r+h*i,t}function nt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],f=e[5],l=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+f*r,t[2]=s*i+l*r,t[3]=u*i+h*r,t[4]=c*i-o*r,t[5]=f*i-a*r,t[6]=l*i-s*r,t[7]=h*i-u*r,t}function rt(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function it(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ot(t,e,n){var r,i,o,a=n[0],u=n[1],c=n[2],f=Math.hypot(a,u,c);return f<s.b?null:(a*=f=1/f,u*=f,c*=f,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=u*a*o+c*r,t[2]=c*a*o-u*r,t[3]=0,t[4]=a*u*o-c*r,t[5]=u*u*o+i,t[6]=c*u*o+a*r,t[7]=0,t[8]=a*c*o+u*r,t[9]=u*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function at(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function st(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ut(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,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 ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,f=r*s,l=r*u,h=r*c,d=i*u,p=i*c,g=o*c,v=a*s,m=a*u,y=a*c;return t[0]=1-(d+g),t[1]=l+y,t[2]=h-m,t[3]=0,t[4]=l-y,t[5]=1-(f+g),t[6]=p+v,t[7]=0,t[8]=h+m,t[9]=p-v,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function ft(t,e){var n=new s.a(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],u=e[4],c=e[5],f=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(u*a+l*r+c*o-f*i)/h,n[1]=2*(c*a+l*i+f*r-u*o)/h,n[2]=2*(f*a+l*o+u*i-c*r)/h):(n[0]=2*(u*a+l*r+c*o-f*i),n[1]=2*(c*a+l*i+f*r-u*o),n[2]=2*(f*a+l*o+u*i-c*r)),ct(t,e,n),t}function lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ht(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,f),t}function dt(t,e){var n=new s.a(3);ht(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,c=e[2]*o,f=e[4]*r,l=e[5]*i,h=e[6]*o,d=e[8]*r,p=e[9]*i,g=e[10]*o,v=a+l+g,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(h-p)/m,t[1]=(d-c)/m,t[2]=(u-f)/m):a>l&&a>g?(m=2*Math.sqrt(1+a-l-g),t[3]=(h-p)/m,t[0]=.25*m,t[1]=(u+f)/m,t[2]=(d+c)/m):l>g?(m=2*Math.sqrt(1+l-a-g),t[3]=(d-c)/m,t[0]=(u+f)/m,t[1]=.25*m,t[2]=(h+p)/m):(m=2*Math.sqrt(1+g-a-l),t[3]=(u-f)/m,t[0]=(d+c)/m,t[1]=(h+p)/m,t[2]=.25*m),t}function pt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,f=a+a,l=i*u,h=i*c,d=i*f,p=o*c,g=o*f,v=a*f,m=s*u,y=s*c,b=s*f,x=r[0],w=r[1],_=r[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(l+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(d+y)*_,t[9]=(g-m)*_,t[10]=(1-(l+p))*_,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function gt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,f=a+a,l=s+s,h=o*c,d=o*f,p=o*l,g=a*f,v=a*l,m=s*l,y=u*c,b=u*f,x=u*l,w=r[0],_=r[1],E=r[2],S=i[0],M=i[1],O=i[2],A=(1-(g+m))*w,k=(d+x)*w,T=(p-b)*w,I=(d-x)*_,C=(1-(h+m))*_,P=(v+y)*_,D=(p+b)*E,N=(v-y)*E,R=(1-(h+g))*E;return t[0]=A,t[1]=k,t[2]=T,t[3]=0,t[4]=I,t[5]=C,t[6]=P,t[7]=0,t[8]=D,t[9]=N,t[10]=R,t[11]=0,t[12]=n[0]+S-(A*S+I*M+D*O),t[13]=n[1]+M-(k*S+C*M+N*O),t[14]=n[2]+O-(T*S+P*M+R*O),t[15]=1,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,f=r*a,l=r*s,h=i*a,d=i*s,p=i*u,g=o*a,v=o*s,m=o*u;return t[0]=1-l-p,t[1]=f+m,t[2]=h-v,t[3]=0,t[4]=f-m,t[5]=1-c-p,t[6]=d+g,t[7]=0,t[8]=h+v,t[9]=d-g,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mt(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function yt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function bt(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function xt(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}function wt(t,e,n,r){var i,o,a,u,c,f,l,h,d,p,g=e[0],v=e[1],m=e[2],y=r[0],b=r[1],x=r[2],w=n[0],_=n[1],E=n[2];return Math.abs(g-w)<s.b&&Math.abs(v-_)<s.b&&Math.abs(m-E)<s.b?X(t):(l=g-w,h=v-_,d=m-E,i=b*(d*=p=1/Math.hypot(l,h,d))-x*(h*=p),o=x*(l*=p)-y*d,a=y*h-b*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),u=h*a-d*o,c=d*i-l*a,f=l*o-h*i,(p=Math.hypot(u,c,f))?(u*=p=1/p,c*=p,f*=p):(u=0,c=0,f=0),t[0]=i,t[1]=u,t[2]=l,t[3]=0,t[4]=o,t[5]=c,t[6]=h,t[7]=0,t[8]=a,t[9]=f,t[10]=d,t[11]=0,t[12]=-(i*g+o*v+a*m),t[13]=-(u*g+c*v+f*m),t[14]=-(l*g+h*v+d*m),t[15]=1,t)}function _t(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],f=i-n[0],l=o-n[1],h=a-n[2],d=f*f+l*l+h*h;d>0&&(f*=d=1/Math.sqrt(d),l*=d,h*=d);var p=u*h-c*l,g=c*f-s*h,v=s*l-u*f;return(d=p*p+g*g+v*v)>0&&(p*=d=1/Math.sqrt(d),g*=d,v*=d),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=l*v-h*g,t[5]=h*p-f*v,t[6]=f*g-l*p,t[7]=0,t[8]=f,t[9]=l,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Et(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 St(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 Mt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Ot(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function At(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function kt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function Tt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function It(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],c=t[6],f=t[7],l=t[8],h=t[9],d=t[10],p=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=e[0],x=e[1],w=e[2],_=e[3],E=e[4],S=e[5],M=e[6],O=e[7],A=e[8],k=e[9],T=e[10],I=e[11],C=e[12],P=e[13],D=e[14],N=e[15];return Math.abs(n-b)<=s.b*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=s.b*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-w)<=s.b*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=s.b*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-E)<=s.b*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(u-S)<=s.b*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(c-M)<=s.b*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(f-O)<=s.b*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-A)<=s.b*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(h-k)<=s.b*Math.max(1,Math.abs(h),Math.abs(k))&&Math.abs(d-T)<=s.b*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-I)<=s.b*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(g-C)<=s.b*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-P)<=s.b*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(m-D)<=s.b*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(y-N)<=s.b*Math.max(1,Math.abs(y),Math.abs(N))}var Ct=Z,Pt=Ot,Dt=n(33);function Nt(){var t=new s.a(4);return s.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Rt(t){var e=new s.a(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function jt(t,e,n,r){var i=new s.a(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function Bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Lt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Gt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function Ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function Ut(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function zt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Wt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function Vt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function Xt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function Yt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function Ht(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function qt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Qt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function Zt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Kt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function $t(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Jt(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function te(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function ee(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function ne(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function re(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function ie(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],f=e[0],l=e[1],h=e[2],d=e[3];return t[0]=l*c-h*u+d*s,t[1]=-f*c+h*a-d*o,t[2]=f*u-l*a+d*i,t[3]=-f*s+l*o-h*i,t}function oe(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function ae(t,e){var n,r,i,o,a,u;e=e||1;do{a=(n=2*s.c()-1)*n+(r=2*s.c()-1)*r}while(a>=1);do{u=(i=2*s.c()-1)*i+(o=2*s.c()-1)*o}while(u>=1);var c=Math.sqrt((1-a)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*i*c,t[3]=e*o*c,t}function se(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function ue(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],f=c*r+s*o-u*i,l=c*i+u*r-a*o,h=c*o+a*i-s*r,d=-a*r-s*i-u*o;return t[0]=f*c+d*-a+l*-u-h*-s,t[1]=l*c+d*-s+h*-a-f*-u,t[2]=h*c+d*-u+f*-s-l*-a,t[3]=e[3],t}function ce(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function fe(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function le(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function he(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],u=e[1],c=e[2],f=e[3];return Math.abs(n-a)<=s.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-u)<=s.b*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=s.b*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(o-f)<=s.b*Math.max(1,Math.abs(o),Math.abs(f))}var de,pe=Ft,ge=Ut,ve=zt,me=Zt,ye=Kt,be=$t,xe=Jt,we=(de=Nt(),function(t,e,n,r,i,o){var a,s;for(e||(e=4),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)de[0]=t[a],de[1]=t[a+1],de[2]=t[a+2],de[3]=t[a+3],i(de,de,o),t[a]=de[0],t[a+1]=de[1],t[a+2]=de[2],t[a+3]=de[3];return t});function _e(){var t=new s.a(4);return s.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ee(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Se(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Me(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>s.b?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Oe(t,e){var n=en(t,e);return Math.acos(2*n*n-1)}function Ae(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*f+a*s+i*c-o*u,t[1]=i*f+a*u+o*s-r*c,t[2]=o*f+a*c+r*u-i*s,t[3]=a*f-r*s-i*u-o*c,t}function ke(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t}function Te(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t}function Ie(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function Ce(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function Pe(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function De(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Ne(t,e,n){return De(t,e),tn(t,t,n),Pe(t,t),t}function Re(t,e,n,r){var i,o,a,u,c,f=e[0],l=e[1],h=e[2],d=e[3],p=n[0],g=n[1],v=n[2],m=n[3];return(o=f*p+l*g+h*v+d*m)<0&&(o=-o,p=-p,g=-g,v=-v,m=-m),1-o>s.b?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/a):(u=1-r,c=r),t[0]=u*f+c*p,t[1]=u*l+c*g,t[2]=u*h+c*v,t[3]=u*d+c*m,t}function je(t){var e=s.c(),n=s.c(),r=s.c(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function Be(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Le(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ge(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function Fe(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*u*f-a*s*c,t[1]=a*s*f+o*u*c,t[2]=a*u*c-o*s*f,t[3]=a*u*f+o*s*c,t}function Ue(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var ze,We,Ve,Xe,Ye,He,qe=Rt,Qe=jt,Ze=Bt,Ke=Lt,$e=Gt,Je=Ae,tn=qt,en=re,nn=oe,rn=$t,on=rn,an=Jt,sn=an,un=ne,cn=le,fn=he,ln=(ze=Dt.create(),We=Dt.fromValues(1,0,0),Ve=Dt.fromValues(0,1,0),function(t,e,n){var r=Dt.dot(e,n);return r<-.999999?(Dt.cross(ze,We,e),Dt.len(ze)<1e-6&&Dt.cross(ze,Ve,e),Dt.normalize(ze,ze),Se(t,ze,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Dt.cross(ze,e,n),t[0]=ze[0],t[1]=ze[1],t[2]=ze[2],t[3]=1+r,un(t,t))}),hn=(Xe=_e(),Ye=_e(),function(t,e,n,r,i,o){return Re(Xe,e,i,o),Re(Ye,n,r,o),Re(t,Xe,Ye,2*o*(1-o)),t}),dn=(He=u(),function(t,e,n,r){return He[0]=n[0],He[3]=n[1],He[6]=n[2],He[1]=r[0],He[4]=r[1],He[7]=r[2],He[2]=-e[0],He[5]=-e[1],He[8]=-e[2],un(t,Ge(t,He))}),pn=n(129)},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26);e.METADATA_KEY=r;var i=n(485);e.Container=i.Container;var o=n(51);e.BindingScopeEnum=o.BindingScopeEnum,e.BindingTypeEnum=o.BindingTypeEnum,e.TargetTypeEnum=o.TargetTypeEnum;var a=n(501);e.AsyncContainerModule=a.AsyncContainerModule,e.ContainerModule=a.ContainerModule;var s=n(502);e.injectable=s.injectable;var u=n(503);e.tagged=u.tagged;var c=n(504);e.named=c.named;var f=n(243);e.inject=f.inject,e.LazyServiceIdentifer=f.LazyServiceIdentifer;var l=n(505);e.optional=l.optional;var h=n(506);e.unmanaged=h.unmanaged;var d=n(507);e.multiInject=d.multiInject;var p=n(508);e.targetName=p.targetName;var g=n(509);e.postConstruct=g.postConstruct;var v=n(241);e.MetadataReader=v.MetadataReader;var m=n(65);e.id=m.id;var y=n(57);e.decorate=y.decorate;var b=n(246);e.traverseAncerstors=b.traverseAncerstors,e.taggedConstraint=b.taggedConstraint,e.namedConstraint=b.namedConstraint,e.typeConstraint=b.typeConstraint;var x=n(85);e.getServiceIdentifierAsString=x.getServiceIdentifierAsString;var w=n(510);e.multiBindToService=w.multiBindToService},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.TextureCompressionBC="texture-compression-bc"}(e.ExtensionName||(e.ExtensionName={})),function(t){t.ClampToEdge="clamp-to-edge",t.Repeat="repeat",t.MirrorRepeat="mirror-repeat"}(e.AddressMode||(e.AddressMode={})),function(t){t.UniformBuffer="uniform-buffer",t.StorageBuffer="storage-buffer",t.ReadonlyStorageBuffer="readonly-storage-buffer",t.Sampler="sampler",t.ComparisonSampler="comparison-sampler",t.SampledTexture="sampled-texture",t.ReadonlyStorageTexture="readonly-storage-texture",t.WriteonlyStorageTexture="writeonly-storage-texture"}(e.BindingType||(e.BindingType={})),function(t){t.Zero="zero",t.One="one",t.SrcColor="src-color",t.OneMinusSrcColor="one-minus-src-color",t.SrcAlpha="src-alpha",t.OneMinusSrcAlpha="one-minus-src-alpha",t.DstColor="dst-color",t.OneMinusDstColor="one-minus-dst-color",t.DstAlpha="dst-alpha",t.OneMinusDstAlpha="one-minus-dst-alpha",t.SrcAlphaSaturated="src-alpha-saturated",t.BlendColor="blend-color",t.OneMinusBlendColor="one-minus-blend-color"}(e.BlendFactor||(e.BlendFactor={})),function(t){t.Add="add",t.Subtract="subtract",t.ReverseSubtract="reverse-subtract",t.Min="min",t.Max="max"}(e.BlendOperation||(e.BlendOperation={})),function(t){t.Never="never",t.Less="less",t.Equal="equal",t.LessEqual="less-equal",t.Greater="greater",t.NotEqual="not-equal",t.GreaterEqual="greater-equal",t.Always="always"}(e.CompareFunction||(e.CompareFunction={})),function(t){t.None="none",t.Front="front",t.Back="back"}(e.CullMode||(e.CullMode={})),function(t){t.Nearest="nearest",t.Linear="linear"}(e.FilterMode||(e.FilterMode={})),function(t){t.CCW="ccw",t.CW="cw"}(e.FrontFace||(e.FrontFace={})),function(t){t.Uint16="uint16",t.Uint32="uint32"}(e.IndexFormat||(e.IndexFormat={})),function(t){t.Vertex="vertex",t.Instance="instance"}(e.InputStepMode||(e.InputStepMode={})),function(t){t.Load="load"}(e.LoadOp||(e.LoadOp={})),function(t){t.PointList="point-list",t.LineList="line-list",t.LineStrip="line-strip",t.TriangleList="triangle-list",t.TriangleStrip="triangle-strip"}(e.PrimitiveTopology||(e.PrimitiveTopology={})),function(t){t.Keep="keep",t.Zero="zero",t.Replace="replace",t.Invert="invert",t.IncrementClamp="increment-clamp",t.DecrementClamp="decrement-clamp",t.IncrementWrap="increment-wrap",t.DecrementWrap="decrement-wrap"}(e.StencilOperation||(e.StencilOperation={})),function(t){t.Store="store",t.Clear="clear"}(e.StoreOp||(e.StoreOp={})),function(t){t.E1d="1d",t.E2d="2d",t.E3d="3d"}(e.TextureDimension||(e.TextureDimension={})),function(t){t.R8Unorm="r8unorm",t.R8Snorm="r8snorm",t.R8Uint="r8uint",t.R8Sint="r8sint",t.R16Uint="r16uint",t.R16Sint="r16sint",t.R16Float="r16float",t.RG8Unorm="rg8unorm",t.RG8Snorm="rg8snorm",t.RG8Uint="rg8uint",t.RG8Sint="rg8sint",t.R32Uint="r32uint",t.R32Sint="r32sint",t.R32Float="r32float",t.RG16Uint="rg16uint",t.RG16Sint="rg16sint",t.RG16Float="rg16float",t.RGBA8Unorm="rgba8unorm",t.RGBA8UnormSRGB="rgba8unorm-srgb",t.RGBA8Snorm="rgba8snorm",t.RGBA8Uint="rgba8uint",t.RGBA8Sint="rgba8sint",t.BGRA8Unorm="bgra8unorm",t.BGRA8UnormSRGB="bgra8unorm-srgb",t.RGB10A2Unorm="rgb10a2unorm",t.RG11B10Float="rg11b10float",t.RG32Uint="rg32uint",t.RG32Sint="rg32sint",t.RG32Float="rg32float",t.RGBA16Uint="rgba16uint",t.RGBA16Sint="rgba16sint",t.RGBA16Float="rgba16float",t.RGBA32Uint="rgba32uint",t.RGBA32Sint="rgba32sint",t.RGBA32Float="rgba32float",t.Depth32Float="depth32float",t.Depth24Plus="depth24plus",t.Depth24PlusStencil8="depth24plus-stencil8"}(e.TextureFormat||(e.TextureFormat={})),function(t){t.Float="float",t.Sint="sint",t.Uint="uint"}(e.TextureComponentType||(e.TextureComponentType={})),function(t){t.E1d="1d",t.E2d="2d",t.E2dArray="2d-array",t.Cube="cube",t.CubeArray="cube-array",t.E3d="3d"}(e.TextureViewDimension||(e.TextureViewDimension={})),function(t){t.Uchar2="uchar2",t.Uchar4="uchar4",t.Char2="char2",t.Char4="char4",t.Uchar2Norm="uchar2norm",t.Uchar4Norm="uchar4norm",t.Char2Norm="char2norm",t.Char4Norm="char4norm",t.Ushort2="ushort2",t.Ushort4="ushort4",t.Short2="short2",t.Short4="short4",t.Ushort2Norm="ushort2norm",t.Ushort4Norm="ushort4norm",t.Short2Norm="short2norm",t.Short4Norm="short4norm",t.Half2="half2",t.Half4="half4",t.Float="float",t.Float2="float2",t.Float3="float3",t.Float4="float4",t.Uint="uint",t.Uint2="uint2",t.Uint3="uint3",t.Uint4="uint4",t.Int="int",t.Int2="int2",t.Int3="int3",t.Int4="int4"}(e.VertexFormat||(e.VertexFormat={})),function(t){t.All="all",t.StencilOnly="stencil-only",t.DepthOnly="depth-only"}(e.TextureAspect||(e.TextureAspect={})),function(t){t.Error="error",t.Warning="warning",t.Info="info"}(e.CompilationMessageType||(e.CompilationMessageType={})),function(t){t.Occlusion="occlusion"}(e.QueryType||(e.QueryType={})),function(t){t[t.MapRead=1]="MapRead",t[t.MapWrite=2]="MapWrite",t[t.CopySrc=4]="CopySrc",t[t.CopyDst=8]="CopyDst",t[t.Index=16]="Index",t[t.Vertex=32]="Vertex",t[t.Uniform=64]="Uniform",t[t.Storage=128]="Storage",t[t.Indirect=256]="Indirect",t[t.QueryResolve=512]="QueryResolve"}(e.BufferUsage||(e.BufferUsage={})),function(t){t[t.Red=1]="Red",t[t.Green=2]="Green",t[t.Blue=4]="Blue",t[t.Alpha=8]="Alpha",t[t.All=15]="All"}(e.ColorWrite||(e.ColorWrite={})),function(t){t[t.Vertex=1]="Vertex",t[t.Fragment=2]="Fragment",t[t.Compute=4]="Compute"}(e.ShaderStage||(e.ShaderStage={})),function(t){t[t.CopySrc=1]="CopySrc",t[t.CopyDst=2]="CopyDst",t[t.Sampled=4]="Sampled",t[t.Storage=8]="Storage",t[t.OutputAttachment=16]="OutputAttachment"}(e.TextureUsage||(e.TextureUsage={})),function(t){t[t.Read=1]="Read",t[t.Write=2]="Write"}(e.MapMode||(e.MapMode={}))},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){t.exports=n(481)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e){t.exports=function(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}},function(t,e){t.exports=function(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,u,"next",t)}function u(t){n(a,i,o,s,u,"throw",t)}s(void 0)}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},i={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"}},function(t,e,n){"use strict";n.d(e,"d",(function(){return w})),n.d(e,"b",(function(){return _})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return S})),n.d(e,"l",(function(){return M})),n.d(e,"j",(function(){return O}));var r=n(68),i=n.n(r);n.d(e,"i",(function(){return i.a}));var o=n(52),a=n.n(o);n.d(e,"k",(function(){return a.a}));var s=n(79),u=n.n(s);n.d(e,"h",(function(){return u.a}));var c=n(37),f=n.n(c);n.d(e,"g",(function(){return f.a}));var l=n(53),h=n.n(l);n.d(e,"c",(function(){return h.a}));var d=n(87),p=n.n(d);n.d(e,"o",(function(){return p.a}));var g=n(86),v=n.n(g);n.d(e,"m",(function(){return v.a}));n(131);var m=n(175),y=n.n(m);n.d(e,"n",(function(){return y.a}));var b=n(176),x=n.n(b);function w(){return window?window.devicePixelRatio:1}function _(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function E(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function S(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)}function M(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function O(t,e){return t[0]===e[0]&&t[1]===e[1]}n.d(e,"a",(function(){return x.a}))},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){"use strict";n.d(e,"j",(function(){return m})),n.d(e,"c",(function(){return y})),n.d(e,"g",(function(){return b})),n.d(e,"b",(function(){return x}));var r=n(68),i=n.n(r);n.d(e,"e",(function(){return i.a}));var o=n(79),a=n.n(o);n.d(e,"d",(function(){return a.a}));var s=n(52),u=n.n(s);n.d(e,"h",(function(){return u.a}));var c=n(92),f=n.n(c);n.d(e,"f",(function(){return f.a}));n(37);var l=n(127),h=n.n(l);n.d(e,"i",(function(){return h.a}));var d=n(53),p=n.n(d);n.d(e,"a",(function(){return p.a}));var g=n(128),v=n.n(g);function m(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}n.d(e,"k",(function(){return v.a}));var y="undefined"!=typeof window&&void 0!==window.document;function b(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function x(t){return t.cfg.visible&&t.cfg.capture}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(13);function o(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function a(t){var e=i.a[t.type],n=t.getParent();if(!e)throw new Error("the type "+t.type+" is not supported by svg");var r=o(e);if(t.get("id")&&(r.id=t.get("id")),t.set("el",r),t.set("attrs",{}),n){var a=n.get("el");a||(a=n.createDom(),n.set("el",a)),a.appendChild(r)}return r}function s(t,e){var n=t.get("el"),i=Object(r.D)(n.children).sort(e),o=document.createDocumentFragment();i.forEach((function(t){o.appendChild(t)})),n.appendChild(o)}function u(t,e){var n=t.parentNode,r=Array.from(n.childNodes).filter((function(t){return 1===t.nodeType&&"defs"!==t.nodeName.toLowerCase()})),i=r[e],o=r.indexOf(t);if(i){if(o>e)n.insertBefore(t,i);else if(o<e){var a=r[e+1];a?n.insertBefore(t,a):n.appendChild(t)}}else n.appendChild(t)}},function(t,e,n){var r;try{r={cloneDeep:n(422),constant:n(143),defaults:n(423),each:n(202),filter:n(205),find:n(424),flatten:n(233),forEach:n(203),forIn:n(429),has:n(216),isUndefined:n(217),last:n(430),map:n(218),mapValues:n(431),max:n(432),merge:n(434),min:n(439),minBy:n(440),now:n(441),pick:n(442),range:n(447),reduce:n(220),sortBy:n(450),uniqueId:n(455),values:n(226),zipObject:n(456)}}catch(t){}r||(r=window._),t.exports=r},function(t,e,n){var r=n(513),i=n(514),o=n(239),a=n(515);t.exports=function(t){return r(t)||i(t)||o(t)||a()}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return g})),n.d(e,"e",(function(){return y})),n.d(e,"h",(function(){return b})),n.d(e,"f",(function(){return x})),n.d(e,"g",(function(){return w}));var r=n(0),i=n(120),o=n(14);function a(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function s(t,e){return a(t)*a(e)?(t[0]*e[0]+t[1]*e[1])/(a(t)*a(e)):1}function u(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(s(t,e))}function c(t,e){var n=e[1],r=e[2],i=Object(o.m)(Object(o.o)(e[3]),2*Math.PI),a=e[4],c=e[5],f=t[0],l=t[1],h=e[6],d=e[7],p=Math.cos(i)*(f-h)/2+Math.sin(i)*(l-d)/2,g=-1*Math.sin(i)*(f-h)/2+Math.cos(i)*(l-d)/2,v=p*p/(n*n)+g*g/(r*r);v>1&&(n*=Math.sqrt(v),r*=Math.sqrt(v));var m=n*n*(g*g)+r*r*(p*p),y=m?Math.sqrt((n*n*(r*r)-m)/m):1;a===c&&(y*=-1),isNaN(y)&&(y=0);var b=r?y*n*g/r:0,x=n?y*-r*p/n:0,w=(f+h)/2+Math.cos(i)*b-Math.sin(i)*x,_=(l+d)/2+Math.sin(i)*b+Math.cos(i)*x,E=[(p-b)/n,(g-x)/r],S=[(-1*p-b)/n,(-1*g-x)/r],M=u([1,0],E),O=u(E,S);return s(E,S)<=-1&&(O=Math.PI),s(E,S)>=1&&(O=0),0===c&&O>0&&(O-=2*Math.PI),1===c&&O<0&&(O+=2*Math.PI),{cx:w,cy:_,rx:Object(o.j)(t,[h,d])?0:n,ry:Object(o.j)(t,[h,d])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:a,sweepFlag:c}}var f=n(29),l={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function h(t,e){var n=e.attr();for(var o in n){var a=n[o],s=l[o]?l[o]:o;"matrix"===s&&a?t.transform(a[0],a[1],a[3],a[4],a[6],a[7]):"lineDash"===s&&t.setLineDash?Object(r.m)(a)&&t.setLineDash(a):("strokeStyle"===s||"fillStyle"===s?a=Object(i.b)(t,e,a):"globalAlpha"===s&&(a*=t.globalAlpha),t[s]=a)}}function d(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];i.cfg.visible?i.draw(t,n):i.skipDraw()}}function p(t,e,n){var i=t.get("refreshElements");Object(r.f)(i,(function(e){if(e!==t)for(var n=e.cfg.parent;n&&n!==t&&!n.cfg.refresh;)n.cfg.refresh=!0,n=n.cfg.parent})),i[0]===t?v(e,n):function t(e,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.cfg.visible)if(i.cfg.hasChanged)i.cfg.refresh=!0,i.isGroup()&&v(i.cfg.children,n);else if(i.cfg.refresh)i.isGroup()&&t(i.cfg.children,n);else{var o=m(i,n);i.cfg.refresh=o,o&&i.isGroup()&&t(i.cfg.children,n)}}}(e,n)}function g(t){for(var e=0;e<t.length;e++){var n=t[e];n.cfg.hasChanged=!1,n.isGroup()&&!n.destroyed&&g(n.cfg.children)}}function v(t,e){for(var n=0;n<t.length;n++){var r=t[n];r.cfg.refresh=!0,r.isGroup()&&v(r.get("children"),e)}}function m(t,e){var n=t.cfg.cacheCanvasBBox;return t.cfg.isInView&&n&&Object(o.f)(n,e)}function y(t,e,n,r){var i=n.path,o=n.startArrow,a=n.endArrow,s=[0,0],u=[0,0],l={dx:0,dy:0};e.beginPath();for(var h=0;h<i.length;h++){var d=i[h],p=d[0];if(0===h&&o&&o.d){var g=t.getStartTangent();l=f.c(g[0][0],g[0][1],g[1][0],g[1][1],o.d)}else if(h===i.length-2&&"Z"===i[h+1][0]&&a&&a.d){if("Z"===i[h+1][0]){g=t.getEndTangent();l=f.c(g[0][0],g[0][1],g[1][0],g[1][1],a.d)}}else if(h===i.length-1&&a&&a.d&&"Z"!==i[0]){g=t.getEndTangent();l=f.c(g[0][0],g[0][1],g[1][0],g[1][1],a.d)}var v=l.dx,m=l.dy;switch(p){case"M":e.moveTo(d[1]-v,d[2]-m),u=[d[1],d[2]];break;case"L":e.lineTo(d[1]-v,d[2]-m);break;case"Q":e.quadraticCurveTo(d[1],d[2],d[3]-v,d[4]-m);break;case"C":e.bezierCurveTo(d[1],d[2],d[3],d[4],d[5]-v,d[6]-m);break;case"A":var y=void 0;r?(y=r[h])||(y=c(s,d),r[h]=y):y=c(s,d);var b=y.cx,x=y.cy,w=y.rx,_=y.ry,E=y.startAngle,S=y.endAngle,M=y.xRotation,O=y.sweepFlag;if(e.ellipse)e.ellipse(b,x,w,_,M,E,S,1-O);else{var A=w>_?w:_,k=w>_?1:w/_,T=w>_?_/w:1;e.translate(b,x),e.rotate(M),e.scale(k,T),e.arc(0,0,A,E,S,1-O),e.scale(1/k,1/T),e.rotate(-M),e.translate(-b,-x)}break;case"Z":e.closePath()}if("Z"===p)s=u;else{var I=d.length;s=[d[I-2],d[I-1]]}}}function b(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function x(t){if(!t.length)return null;var e=[],n=[],i=[],a=[];return Object(r.f)(t,(function(t){var r=function(t){var e;if(t.destroyed)e=t._cacheCanvasBBox;else{var n=t.get("cacheCanvasBBox"),r=n&&!(!n.width||!n.height),i=t.getCanvasBBox(),a=i&&!(!i.width||!i.height);r&&a?e=Object(o.l)(n,i):r?e=n:a&&(e=i)}return e}(t);r&&(e.push(r.minX),n.push(r.minY),i.push(r.maxX),a.push(r.maxY))})),{minX:Math.min.apply(null,e),minY:Math.min.apply(null,n),maxX:Math.max.apply(null,i),maxY:Math.max.apply(null,a)}}function w(t,e){return t&&e&&Object(o.f)(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}},function(t,e,n){"use strict";var r=n(47);n.d(e,"PathUtil",(function(){return r}));n(169),n(170);var i=n(114);n.d(e,"Event",(function(){return i.a}));n(115);var o=n(266);n.d(e,"AbstractCanvas",(function(){return o.a}));var a=n(172);n.d(e,"AbstractGroup",(function(){return a.a}));var s=n(173);n.d(e,"AbstractShape",(function(){return s.a}));n(282).version},function(t,e,n){var r=n(511);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(88),i=n(28);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e){t.exports=function(t,e){throw new Error("Decorating class property failed. Please ensure that proposal-class-properties is enabled and runs after the decorators transform.")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(129);e.default={box:function(t,e,n,i){return r.getBBoxByArray([t,n],[e,i])},length:function(t,e,n,i){return r.distance(t,e,n,i)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,i,o,a){var s=(n-t)*(o-t)+(i-e)*(a-e);return s<0?r.distance(t,e,o,a):s>(n-t)*(n-t)+(i-e)*(i-e)?r.distance(n,i,o,a):this.pointToLine(t,e,n,i,o,a)},pointToLine:function(t,e,n,r,o,a){var s=[n-t,r-e];if(i.exactEquals(s,[0,0]))return Math.sqrt((o-t)*(o-t)+(a-e)*(a-e));var u=[-s[1],s[0]];i.normalize(u,u);var c=[o-t,a-e];return Math.abs(i.dot(c,u))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var r=n(1),i=n(54);function o(t){return(o="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)}var a=Math.sin,s=Math.cos,u=Math.atan2,c=Math.PI;function f(t,e,n,r,o,f,l){var h=e.stroke,d=e.lineWidth,p=u(r-f,n-o),g=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*s(c/6)+","+10*a(c/6)+" L0,0 L"+10*s(c/6)+",-"+10*a(c/6),stroke:h,lineWidth:d}});g.translate(o,f),g.rotateAtPoint(o,f,p),t.set(l?"startArrowShape":"endArrowShape",g)}function l(t,e,n,o,c,f,l){var h=e.startArrow,d=e.endArrow,p=e.stroke,g=e.lineWidth,v=l?h:d,m=v.d,y=v.fill,b=v.stroke,x=v.lineWidth,w=Object(r.e)(v,["d","fill","stroke","lineWidth"]),_=u(o-f,n-c);m&&(c-=s(_)*m,f-=a(_)*m);var E=new i.Path({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:Object(r.a)(Object(r.a)({},w),{stroke:b||p,lineWidth:x||g,fill:y})});E.translate(c,f),E.rotateAtPoint(c,f,_),t.set(l?"startArrowShape":"endArrowShape",E)}function h(t,e,n,r,i){var o=u(r-e,n-t);return{dx:s(o)*i,dy:a(o)*i}}function d(t,e,n,r,i,a){"object"===o(e.startArrow)?l(t,e,n,r,i,a,!0):e.startArrow?f(t,e,n,r,i,a,!0):t.set("startArrowShape",null)}function p(t,e,n,r,i,a){"object"===o(e.endArrow)?l(t,e,n,r,i,a,!1):e.endArrow?f(t,e,n,r,i,a,!1):t.set("startArrowShape",null)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(17);function i(t,e){var n=t.cfg.el,r=t.attr(),i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")}function o(t){var e=t.attr().matrix;if(e){for(var n=t.cfg.el,r=[],i=0;i<9;i+=3)r.push(e[i]+","+e[i+1]);-1===(r=r.join(",")).indexOf("NaN")?n.setAttribute("transform","matrix("+r+")"):console.warn("invalid matrix:",e)}}function a(t,e){var n=t.getClip(),i=t.get("el");if(n){if(n&&!i.hasAttribute("clip-path")){Object(r.a)(n),n.createPath(e);var o=e.addClip(n);i.setAttribute("clip-path","url(#"+o+")")}}else i.removeAttribute("clip-path")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0);return t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,o,a,s,u,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=i,f[4]=o,f[5]=a,f[6]=s,f[7]=u,f[8]=c,f},e.set=function(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t},e.identity=function(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},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=f*a-s*c,h=-f*o+s*u,d=c*o-a*u,p=n*l+r*h+i*d;if(!p)return null;return p=1/p,t[0]=l*p,t[1]=(-f*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(f*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8];return t[0]=a*f-s*c,t[1]=i*c-r*f,t[2]=r*s-i*a,t[3]=s*u-o*f,t[4]=n*f-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*r+d*a+c,t[7]=h*i+d*s+f,t[8]=h*o+d*u+l,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*s,t[2]=d*o+h*u,t[3]=d*a-h*r,t[4]=d*s-h*i,t[5]=d*u-h*o,t[6]=c,t[7]=f,t[8]=l,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,f=r*a,l=r*s,h=i*a,d=i*s,p=i*u,g=o*a,v=o*s,m=o*u;return t[0]=1-l-p,t[3]=f-m,t[6]=h+v,t[1]=f+m,t[4]=1-c-p,t[7]=d-g,t[2]=h-v,t[5]=d+g,t[8]=1-c-l,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,_=r*c-o*s,E=i*c-o*u,S=f*g-l*p,M=f*v-h*p,O=f*m-d*p,A=l*v-h*g,k=l*m-d*g,T=h*m-d*v,I=y*T-b*k+x*A+w*O-_*M+E*S;if(!I)return null;return I=1/I,t[0]=(s*T-u*k+c*A)*I,t[1]=(u*O-a*T-c*M)*I,t[2]=(a*k-s*O+c*S)*I,t[3]=(i*k-r*T-o*A)*I,t[4]=(n*T-i*O+o*M)*I,t[5]=(r*O-n*k-o*S)*I,t[6]=(g*E-v*_+m*w)*I,t[7]=(v*x-p*E-m*b)*I,t[8]=(p*_-g*x+m*y)*I,t},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(c-y)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(f-b)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(l-x)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(130));function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*s+p*f,t[2]=h*o+d*u+p*l,t[3]=g*r+v*a+m*c,t[4]=g*i+v*s+m*f,t[5]=g*o+v*u+m*l,t[6]=y*r+b*a+x*c,t[7]=y*i+b*s+x*f,t[8]=y*o+b*u+x*l,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=o},function(t,e,n){"use strict";var r=n(18),i=n(39).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"length",(function(){return a})),n.d(e,"fromValues",(function(){return s})),n.d(e,"copy",(function(){return u})),n.d(e,"set",(function(){return c})),n.d(e,"add",(function(){return f})),n.d(e,"subtract",(function(){return l})),n.d(e,"multiply",(function(){return h})),n.d(e,"divide",(function(){return d})),n.d(e,"ceil",(function(){return p})),n.d(e,"floor",(function(){return g})),n.d(e,"min",(function(){return v})),n.d(e,"max",(function(){return m})),n.d(e,"round",(function(){return y})),n.d(e,"scale",(function(){return b})),n.d(e,"scaleAndAdd",(function(){return x})),n.d(e,"distance",(function(){return w})),n.d(e,"squaredDistance",(function(){return _})),n.d(e,"squaredLength",(function(){return E})),n.d(e,"negate",(function(){return S})),n.d(e,"inverse",(function(){return M})),n.d(e,"normalize",(function(){return O})),n.d(e,"dot",(function(){return A})),n.d(e,"cross",(function(){return k})),n.d(e,"lerp",(function(){return T})),n.d(e,"hermite",(function(){return I})),n.d(e,"bezier",(function(){return C})),n.d(e,"random",(function(){return P})),n.d(e,"transformMat4",(function(){return D})),n.d(e,"transformMat3",(function(){return N})),n.d(e,"transformQuat",(function(){return R})),n.d(e,"rotateX",(function(){return j})),n.d(e,"rotateY",(function(){return B})),n.d(e,"rotateZ",(function(){return L})),n.d(e,"angle",(function(){return G})),n.d(e,"zero",(function(){return F})),n.d(e,"str",(function(){return U})),n.d(e,"exactEquals",(function(){return z})),n.d(e,"equals",(function(){return W})),n.d(e,"sub",(function(){return X})),n.d(e,"mul",(function(){return Y})),n.d(e,"div",(function(){return H})),n.d(e,"dist",(function(){return q})),n.d(e,"sqrDist",(function(){return Q})),n.d(e,"len",(function(){return Z})),n.d(e,"sqrLen",(function(){return K})),n.d(e,"forEach",(function(){return $}));var r=n(9);function i(){var t=new r.a(3);return r.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=new r.a(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function s(t,e,n){var i=new r.a(3);return i[0]=t,i[1]=e,i[2]=n,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function f(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function l(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function h(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function d(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function v(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function m(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function b(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function x(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function _(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function E(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function O(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function k(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function T(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function I(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*f,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*f,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*f,t}function C(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,f=3*o*s,l=3*u*a,h=u*o;return t[0]=e[0]*c+n[0]*f+r[0]*l+i[0]*h,t[1]=e[1]*c+n[1]*f+r[1]*l+i[1]*h,t[2]=e[2]*c+n[2]*f+r[2]*l+i[2]*h,t}function P(t,e){e=e||1;var n=2*r.c()*Math.PI,i=2*r.c()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t}function D(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function N(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function R(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],f=i*c-o*u,l=o*s-r*c,h=r*u-i*s,d=i*h-o*l,p=o*f-r*h,g=r*l-i*f,v=2*a;return f*=v,l*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+f+d,t[1]=u+l+p,t[2]=c+h+g,t}function j(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function L(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function G(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&A(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function F(t){return t[0]=0,t[1]=0,t[2]=0,t}function U(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function z(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function W(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.b*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.b*Math.max(1,Math.abs(o),Math.abs(u))}var V,X=l,Y=h,H=d,q=w,Q=_,Z=a,K=E,$=(V=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)V[0]=t[a],V[1]=t[a+1],V[2]=t[a+2],i(V,V,o),t[a]=V[0],t[a+1]=V[1],t[a+2]=V[2];return t})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},function(t,e,n){var r;try{r={clone:n(311),constant:n(143),each:n(202),filter:n(205),has:n(216),isArray:n(20),isEmpty:n(387),isFunction:n(80),isUndefined:n(217),keys:n(56),map:n(218),reduce:n(220),size:n(390),transform:n(396),union:n(397),values:n(226)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){function n(t){return(n="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)}t.exports=function(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(126);e.default=function(t){return Array.isArray?Array.isArray(t):r.default(t,"Array")}},function(t,e,n){var r=n(344),i=n(103),o=n(138),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},function(t,e,n){var r;try{r=n(309)}catch(t){}r||(r=window.graphlib),t.exports=r},function(t,e,n){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)}var i=n(184),o="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,a=i||o||Function("return this")();t.exports=a},function(t,e){function n(t){return(n="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)}t.exports=function(t){return null!=t&&"object"==n(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},function(t,e,n){"use strict";function r(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return n[0]=h*r+d*a+p*c,n[1]=h*i+d*s+p*f,n[2]=h*o+d*u+p*l,n[3]=g*r+v*a+m*c,n[4]=g*i+v*s+m*f,n[5]=g*o+v*u+m*l,n[6]=y*r+b*a+x*c,n[7]=y*i+b*s+x*f,n[8]=y*o+b*u+x*l,n}function i(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function o(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=t[8],l=f*a-s*c,h=-f*o+s*u,d=c*o-a*u,p=n*l+r*h+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-f*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=h*p,e[4]=(f*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=o,e.multiply=a,e.divide=s,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=f,e.squaredLength=l,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var s=i*i+o*o;s>0&&(s=1/Math.sqrt(s));var u=(n*i+r*o)*a*s;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(130));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function s(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function f(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function l(t){var e=t[0],n=t[1];return e*e+n*n}var h;e.len=f,e.sub=o,e.mul=a,e.div=s,e.dist=u,e.sqrDist=c,e.sqrLen=l,e.forEach=(h=i(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)h[0]=t[a],h[1]=t[a+1],i(h,h,o),t[a]=h[0],t[a+1]=h[1];return t})},function(t,e,n){"use strict";function r(t){return Math.min.apply(null,t)}function i(t){return Math.max.apply(null,t)}Object.defineProperty(e,"__esModule",{value:!0}),e.piMod=e.getBBoxRange=e.getBBoxByArray=e.isNumberEqual=e.distance=void 0,e.distance=function(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)},e.isNumberEqual=function(t,e){return Math.abs(t-e)<.001},e.getBBoxByArray=function(t,e){var n=r(t),o=r(e);return{x:n,y:o,width:i(t)-n,height:i(e)-o}},e.getBBoxRange=function(t,e,n,o){return{minX:r([t,n]),maxX:i([t,n]),minY:r([e,o]),maxY:i([e,o])}},e.piMod=function(t){return(t+2*Math.PI)%(2*Math.PI)}},function(t,e){},function(t,e,n){"use strict";n.r(e),n.d(e,"catmullRomToBezier",(function(){return u})),n.d(e,"fillPath",(function(){return I})),n.d(e,"fillPathByDiff",(function(){return D})),n.d(e,"formatPath",(function(){return j})),n.d(e,"intersection",(function(){return A})),n.d(e,"parsePathArray",(function(){return v})),n.d(e,"parsePathString",(function(){return s})),n.d(e,"pathToAbsolute",(function(){return f})),n.d(e,"pathToCurve",(function(){return p})),n.d(e,"rectPath",(function(){return _}));var r=n(0),i="\t\n\v\f\r \u2028\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),s=function(t){if(!t)return null;if(Object(r.m)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(r,i,o){var s=[],u=i.toLowerCase();if(o.replace(a,(function(t,e){e&&s.push(+e)})),"m"===u&&s.length>2&&(n.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&n.push([i,s[0]]),"r"===u)n.push([i].concat(s));else for(;s.length>=e[u]&&(n.push([i].concat(s.splice(0,e[u]))),e[u]););return t})),n},u=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},c=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},f=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,f=0,l=0;"M"===t[0][0]&&(a=i=+t[0][1],f=o=+t[0][2],l++,r[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),d=void 0,p=void 0,g=l,v=t.length;g<v;g++){if(r.push(d=[]),(e=(p=t[g])[0])!==e.toUpperCase())switch(d[0]=e.toUpperCase(),d[0]){case"A":d[1]=p[1],d[2]=p[2],d[3]=p[3],d[4]=p[4],d[5]=p[5],d[6]=+p[6]+i,d[7]=+p[7]+o;break;case"V":d[1]=+p[1]+o;break;case"H":d[1]=+p[1]+i;break;case"R":for(var m=2,y=(n=[i,o].concat(p.slice(1))).length;m<y;m++)n[m]=+n[m]+i,n[++m]=+n[m]+o;r.pop(),r=r.concat(u(n,h));break;case"O":r.pop(),(n=c(i,o,p[1],p[2])).push(n[0]),r=r.concat(n);break;case"U":r.pop(),r=r.concat(c(i,o,p[1],p[2],p[3])),d=["U"].concat(r[r.length-1].slice(-2));break;case"M":a=+p[1]+i,f=+p[2]+o;break;default:for(m=1,y=p.length;m<y;m++)d[m]=+p[m]+(m%2?i:o)}else if("R"===e)n=[i,o].concat(p.slice(1)),r.pop(),r=r.concat(u(n,h)),d=["R"].concat(p.slice(-2));else if("O"===e)r.pop(),(n=c(i,o,p[1],p[2])).push(n[0]),r=r.concat(n);else if("U"===e)r.pop(),r=r.concat(c(i,o,p[1],p[2],p[3])),d=["U"].concat(r[r.length-1].slice(-2));else for(var b=0,x=p.length;b<x;b++)d[b]=p[b];if("O"!==(e=e.toUpperCase()))switch(d[0]){case"Z":i=+a,o=+f;break;case"H":i=d[1];break;case"V":o=d[1];break;case"M":a=d[d.length-2],f=d[d.length-1];break;default:i=d[d.length-2],o=d[d.length-1]}}return r},l=function(t,e,n,r){return[t,e,n,r,n,r]},h=function(t,e,n,r,i,o){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]},d=function t(e,n,r,i,o,a,s,u,c,f){r===i&&(r+=1);var l,h,d,p,g,v=120*Math.PI/180,m=Math.PI/180*(+o||0),y=[],b=function(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}};if(f)h=f[0],d=f[1],p=f[2],g=f[3];else{e=(l=b(e,n,-m)).x,n=l.y,u=(l=b(u,c,-m)).x,c=l.y,e===u&&n===c&&(u+=1,c+=1);var x=(e-u)/2,w=(n-c)/2,_=x*x/(r*r)+w*w/(i*i);_>1&&(r*=_=Math.sqrt(_),i*=_);var E=r*r,S=i*i,M=(a===s?-1:1)*Math.sqrt(Math.abs((E*S-E*w*w-S*x*x)/(E*w*w+S*x*x)));p=M*r*w/i+(e+u)/2,g=M*-i*x/r+(n+c)/2,h=Math.asin(((n-g)/i).toFixed(9)),d=Math.asin(((c-g)/i).toFixed(9)),h=e<p?Math.PI-h:h,d=u<p?Math.PI-d:d,h<0&&(h=2*Math.PI+h),d<0&&(d=2*Math.PI+d),s&&h>d&&(h-=2*Math.PI),!s&&d>h&&(d-=2*Math.PI)}var O=d-h;if(Math.abs(O)>v){var A=d,k=u,T=c;d=h+v*(s&&d>h?1:-1),y=t(u=p+r*Math.cos(d),c=g+i*Math.sin(d),r,i,o,0,s,k,T,[d,A,p,g])}O=d-h;var I=Math.cos(h),C=Math.sin(h),P=Math.cos(d),D=Math.sin(d),N=Math.tan(O/4),R=4/3*r*N,j=4/3*i*N,B=[e,n],L=[e+R*C,n-j*I],G=[u+R*D,c-j*P],F=[u,c];if(L[0]=2*B[0]-L[0],L[1]=2*B[1]-L[1],f)return[L,G,F].concat(y);for(var U=[],z=0,W=(y=[L,G,F].concat(y).join().split(",")).length;z<W;z++)U[z]=z%2?b(y[z-1],y[z],m).y:b(y[z],y[z+1],m).x;return U},p=function(t,e){var n,r=f(t),i=e&&f(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],u=[],c="",p="",g=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(d.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(h(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(h(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(l(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(l(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(l(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(l(e.x,e.y,e.X,e.Y))}return t},v=function(t,e){if(t[e].length>7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},m=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var y=0;y<n;y++){r[y]&&(c=r[y][0]),"C"!==c&&(s[y]=c,y&&(p=s[y-1])),r[y]=g(r[y],o,p),"A"!==s[y]&&"C"===c&&(s[y]="C"),v(r,y),i&&(i[y]&&(c=i[y][0]),"C"!==c&&(u[y]=c,y&&(p=u[y-1])),i[y]=g(i[y],a,p),"A"!==u[y]&&"C"===c&&(u[y]="C"),v(i,y)),m(r,i,o,a,y),m(i,r,a,o,y);var b=r[y],x=i&&i[y],w=b.length,_=i&&x.length;o.x=b[w-2],o.y=b[w-1],o.bx=parseFloat(b[w-4])||o.x,o.by=parseFloat(b[w-3])||o.y,a.bx=i&&(parseFloat(x[_-4])||a.x),a.by=i&&(parseFloat(x[_-3])||a.y),a.x=i&&x[_-2],a.y=i&&x[_-1]}return i?[r,i]:r},g=/,?([a-z]),?/gi,v=function(t){return t.join(",").replace(g,"$1")},m=function(t,e,n,r,i){return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n},y=function(t,e,n,r,i,o,a,s,u){null===u&&(u=1);for(var c=(u=u>1?1:u<0?0:u)/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],l=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var p=c*f[d]+c,g=m(p,t,n,i,a),v=m(p,e,r,o,s),y=g*g+v*v;h+=l[d]*Math.sqrt(y)}return c*h},b=function(t,e,n,r,i,o,a,s){for(var u,c,f,l,h=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,f=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,f=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(l=-f/c)>0&&l<1&&h.push(l)}else{var g=c*c-4*f*u,v=Math.sqrt(g);if(!(g<0)){var m=(-c+v)/(2*u);m>0&&m<1&&h.push(m);var y=(-c-v)/(2*u);y>0&&y<1&&h.push(y)}}for(var b,x=h.length,w=x;x--;)b=1-(l=h[x]),d[0][x]=b*b*b*t+3*b*b*l*n+3*b*l*l*i+l*l*l*a,d[1][x]=b*b*b*e+3*b*b*l*r+3*b*l*l*o+l*l*l*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},x=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)<Math.min(i,a)||Math.min(t,n)>Math.max(i,a)||Math.max(e,r)<Math.min(o,s)||Math.min(e,r)>Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,f=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,l=+c.toFixed(2),h=+f.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||h<+Math.min(e,r).toFixed(2)||h>+Math.max(e,r).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:c,y:f}}}},w=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},_=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=v,o},E=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:_(t,e,n,r),vb:[t,e,n,r].join(" ")}},S=function(t,e,n,i,o,a,s,u){Object(r.m)(t)||(t=[t,e,n,i,o,a,s,u]);var c=b.apply(null,t);return E(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},M=function(t,e,n,r,i,o,a,s,u){var c=1-u,f=Math.pow(c,3),l=Math.pow(c,2),h=u*u,d=h*u,p=t+2*u*(n-t)+h*(i-2*n+t),g=e+2*u*(r-e)+h*(o-2*r+e),v=n+2*u*(i-n)+h*(a-2*i+n),m=r+2*u*(o-r)+h*(s-2*o+r);return{x:f*t+3*l*u*n+3*c*u*u*i+d*a,y:f*e+3*l*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:m},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-v,g-m)/Math.PI}},O=function(t,e,n){if(!function(t,e){return t=E(t),e=E(e),w(e,t.x,t.y)||w(e,t.x2,t.y)||w(e,t.x,t.y2)||w(e,t.x2,t.y2)||w(t,e.x,e.y)||w(t,e.x2,e.y)||w(t,e.x,e.y2)||w(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}(S(t),S(e)))return n?0:[];for(var r=~~(y.apply(0,t)/8),i=~~(y.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c<r+1;c++){var f=M.apply(0,t.concat(c/r));o.push({x:f.x,y:f.y,t:c/r})}for(c=0;c<i+1;c++){f=M.apply(0,e.concat(c/i));a.push({x:f.x,y:f.y,t:c/i})}for(c=0;c<r;c++)for(var l=0;l<i;l++){var h=o[c],d=o[c+1],p=a[l],g=a[l+1],v=Math.abs(d.x-h.x)<.001?"y":"x",m=Math.abs(g.x-p.x)<.001?"y":"x",b=x(h.x,h.y,d.x,d.y,p.x,p.y,g.x,g.y);if(b){if(s[b.x.toFixed(4)]===b.y.toFixed(4))continue;s[b.x.toFixed(4)]=b.y.toFixed(4);var _=h.t+Math.abs((b[v]-h[v])/(d[v]-h[v]))*(d.t-h.t),O=p.t+Math.abs((b[m]-p[m])/(g[m]-p[m]))*(g.t-p.t);_>=0&&_<=1&&O>=0&&O<=1&&(n?u+=1:u.push({x:b.x,y:b.y,t1:_,t2:O}))}}return u},A=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,f,l,h;t=p(t),e=p(e);for(var d=n?0:[],g=0,v=t.length;g<v;g++){var m=t[g];if("M"===m[0])r=s=m[1],i=u=m[2];else{"C"===m[0]?(l=[r,i].concat(m.slice(1)),r=l[6],i=l[7]):(l=[r,i,r,i,s,u,s,u],r=s,i=u);for(var y=0,b=e.length;y<b;y++){var x=e[y];if("M"===x[0])o=c=x[1],a=f=x[2];else{"C"===x[0]?(h=[o,a].concat(x.slice(1)),o=h[6],a=h[7]):(h=[o,a,o,a,c,f,c,f],o=c,a=f);var w=O(l,h,n);if(n)d+=w;else{for(var _=0,E=w.length;_<E;_++)w[_].segment1=g,w[_].segment2=y,w[_].bez1=l,w[_].bez2=h;d=d.concat(w)}}}}}return d}(t,e)};function k(t,e){var n=[],r=[];return t.length&&function t(e,i){if(1===e.length)n.push(e[0]),r.push(e[0]);else{for(var o=[],a=0;a<e.length-1;a++)0===a&&n.push(e[0]),a===e.length-2&&r.push(e[a+1]),o[a]=[(1-i)*e[a][0]+i*e[a+1][0],(1-i)*e[a][1]+i*e[a+1][1]];t(o,i)}}(t,e),{left:n,right:r.reverse()}}var T=function(t,e,n){if(1===n)return[[].concat(t)];var r=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])r=r.concat(function(t,e,n){var r=[[t[1],t[2]]];n=n||2;var i=[];"A"===e[0]?(r.push(e[6]),r.push(e[7])):"C"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var o=r,a=1/n,s=0;s<n-1;s++){var u=k(o,a/(1-a*s));i.push(u.left),o=u.right}return i.push(o),i.map((function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},I=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a<r-n;a++)t.push(t[0]);return t}for(a=0;a<r;a++){var s=Math.floor(i*a);o[s]=(o[s]||0)+1}var u=o.reduce((function(e,r,i){return i===n?e.concat(t[n]):e.concat(T(t[i],t[i+1],r))}),[]);return u.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||u.push("Z"),u},C=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(r.f)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function P(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var D=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],u=0;u<=i;u++)s[u]=[],s[u][0]={min:u};for(var c=0;c<=o;c++)s[0][c]={min:c};for(u=1;u<=i;u++){n=t[u-1];for(c=1;c<=o;c++){r=e[c-1],a=C(n,r)?0:1;var f=s[u-1][c].min+1,l=s[u][c-1].min+1,h=s[u-1][c-1].min+a;s[u][c]=P(f,l,h)}}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i].min!==r){for(var u=1;u<=r;u++){var c=n[u][u].min;s=u;for(var f=a;f<=i;f++)n[u][f].min<c&&(c=n[u][f].min,s=f);a=s,n[u][a].type&&o.push({index:u-1,type:n[u][a].type})}for(u=o.length-1;u>=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var l=i-(r=t.length);if(r<i)for(u=0;u<l;u++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function N(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=R(e)[0],s=1;s<=n;s++)o*=s,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function R(t){var e=[];switch(t[0]){case"M":case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var j=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=R(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=N(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=N(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=N(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},function(t,e,n){"use strict";n(54),n(179),n(180),n(22);var r=n(268);n.d(e,"Canvas",(function(){return r.a}));n(74),n(307).version},function(t,e,n){var r=n(80),i=n(137);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){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)}var i=n(367),o=n(377),a=n(64),s=n(20),u=n(384);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?s(t)?o(t[0],t[1]):i(t):u(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(126);e.default=function(t){return r.default(t,"String")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(37),i=n(92);e.default=function(t,e){if(t)if(r.default(t))for(var n=0,o=t.length;n<o&&!1!==e(t[n],n);n++);else if(i.default(t))for(var a in t)if(t.hasOwnProperty(a)&&!1===e(t[a],a))break}},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return f})),n.d(e,"Circle",(function(){return l})),n.d(e,"Ellipse",(function(){return d})),n.d(e,"Image",(function(){return g})),n.d(e,"Line",(function(){return x})),n.d(e,"Marker",(function(){return M})),n.d(e,"Path",(function(){return W})),n.d(e,"Polygon",(function(){return X})),n.d(e,"Polyline",(function(){return q})),n.d(e,"Rect",(function(){return Z})),n.d(e,"Text",(function(){return $}));var r={};n.r(r),n.d(r,"Base",(function(){return f})),n.d(r,"Circle",(function(){return l})),n.d(r,"Ellipse",(function(){return d})),n.d(r,"Image",(function(){return g})),n.d(r,"Line",(function(){return x})),n.d(r,"Marker",(function(){return M})),n.d(r,"Path",(function(){return W})),n.d(r,"Polygon",(function(){return X})),n.d(r,"Polyline",(function(){return q})),n.d(r,"Rect",(function(){return Z})),n.d(r,"Text",(function(){return $}));var i=n(1),o=n(22),a=n(14),s=n(21),u=n(121),c=n(74),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return c.a},e.prototype.onCanvasChange=function(t){Object(s.h)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=Object(u.getBBoxMethod)(t)(this),r=e/2,i=n.x-r,o=n.y-r,a=n.x+n.width+r,s=n.y+n.height+r;return{x:i,minX:i,y:o,minY:o,width:n.width+e,height:n.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(s.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);var r=this.getCanvasBBox();if(!Object(a.f)(e,r))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),Object(s.a)(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Object(a.f)(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(o.AbstractShape),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.r,f=i/2,l=Object(a.b)(s,u,t,e);return r&&n?l<=c+f:r?l<=c:!!n&&(l>=c-f&&l<=c+f)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(f);function h(t,e,n,r){return t/(n*n)+e/(r*r)}var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,f=o.ry,l=(t-s)*(t-s),d=(e-u)*(e-u);return r&&n?h(l,d,c+a,f+a)<=1:r?h(l,d,c,f)<=1:!!n&&(h(l,d,c-a,f-a)>=1&&h(l,d,c+a,f+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(f);function p(t){return t instanceof HTMLElement&&Object(a.k)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(Object(a.k)(t)){var r=new Image;r.onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):p(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,s=e.sx,u=e.sy,c=e.swidth,f=e.sheight,l=e.img;(l instanceof Image||p(l))&&(Object(a.i)(s)||Object(a.i)(u)||Object(a.i)(c)||Object(a.i)(f)?t.drawImage(l,n,r,i,o):t.drawImage(l,s,u,c,f,n,r,i,o))},e}(f),v=n(27),m=n.n(v);function y(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),f=Math.max(e,r),l=i/2;return o>=s-l&&o<=u+l&&a>=c-l&&a<=f+l&&m.a.pointToLine(t,e,n,r,o,a)<=i/2}var b=n(29),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&b.b(this,t,r,i,e,n),a&&b.a(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return y(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=b.c(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=b.c(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return m.a.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return m.a.pointAt(n,r,i,o,t)},e}(f),w=n(0),_=n(123),E=n.n(_),S={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return Object(w.s)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,s=r.symbol||"circle",u=this._getR(r);return Object(a.h)(s)?(n=(t=s)(i,o,u),n=E()(n)):n=(t=e.Symbols[s])(i,o,u),t?n:(console.warn(s+" marker is not supported."),null)},e.prototype.createPath=function(t){var e=this._getPath(),n=this.get("paramsCache");Object(s.e)(this,t,{path:e},n)},e.Symbols=S,e}(f),O=n(66),A=n.n(O),k=n(163),T=n.n(k),I=n(161);function C(t,e,n){var r=Object(I.getOffScreenContext)();return t.createPath(r),r.isPointInPath(e,n)}function P(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function D(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function N(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(D(a,s,[e,n]))return!0;P(a[1]-n)>0!=P(s[1]-n)>0&&P(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var R=n(162),j=n.n(R);function B(t,e,n,r,i,o,s,u){var c=(Math.atan2(u-e,s-t)+2*Math.PI)%(2*Math.PI);if(c<r||c>i)return!1;var f={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Object(a.b)(f.x,f.y,s,u)<=o/2}var L=n(125),G=n(33),F=L.a.transform;var U=Object(i.a)({hasArc:function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e},extractPolygons:function(t){for(var e=t.length,n=[],r=[],i=[],o=0;o<e;o++){var a=t[o],s=a[0];"M"===s?(i.length&&(r.push(i),i=[]),i.push([a[1],a[2]])):"Z"===s?i.length&&(n.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,s=e/2,u=0;u<t.length;u++){var c=t[u],f=c.currentPoint,l=c.params,h=c.prePoint,d=c.box;if(!d||Object(a.e)(d.x-s,d.y-s,d.width+e,d.height+e,n,r)){switch(c.command){case"L":case"Z":o=y(h[0],h[1],f[0],f[1],e,n,r);break;case"Q":o=j.a.pointDistance(h[0],h[1],l[1],l[2],l[3],l[4],n,r)<=e/2;break;case"C":o=A.a.pointDistance(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6],n,r,i)<=e/2;break;case"A":var p=c.arcParams,g=p.cx,v=p.cy,m=p.rx,b=p.ry,x=p.startAngle,w=p.endAngle,_=p.xRotation,E=[n,r,1],S=m>b?m:b,M=F(null,[["t",-g,-v],["r",-_],["s",1/(m>b?1:m/b),1/(m>b?b/m:1)]]);G.transformMat3(E,E,M),o=B(0,0,S,x,w,e,E[0],E[1])}if(o)break}}return o}},o.PathUtil);function z(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=N(t[i],e,n))break}return r}var W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"path"===e&&this._setPathArr(n),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=E()(t);var e=U.hasArc(t);this.set("hasArc",e),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=T()(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t=this.attr(),e=t.startArrow,n=t.endArrow;if(e){var r=this.getStartTangent();b.b(this,t,r[0][0],r[0][1],r[1][0],r[1][1])}if(n){r=this.getEndTangent();b.a(this,t,r[0][0],r[0][1],r[1][0],r[1][1])}},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.getSegments(),a=this.get("hasArc"),s=!1;if(n){var u=this.getTotalLength();s=U.isPointInStroke(o,i,t,e,u)}if(!s&&r)if(a)s=C(this,t,e);else{var c=this.attr("path"),f=U.extractPolygons(c);s=z(f.polygons,t,e)||z(f.polylines,t,e)}return s},e.prototype.createPath=function(t){var e=this.attr(),n=this.get("paramsCache");Object(s.e)(this,t,e,n)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return Object(w.s)(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var e,n,r=this.get("tCache");r||(this._calculateCurve(),this._setTcache(),r=this.get("tCache"));var i=this.get("curve");if(!r||0===r.length)return i?{x:i[0][1],y:i[0][2]}:null;Object(w.f)(r,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(Object(w.s)(o)||Object(w.s)(n))return null;var a=o.length,s=i[n+1];return A.a.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",U.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(Object(w.f)(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=A.a.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(Object(w.f)(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=A.a.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(f);function V(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(y(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],u=t[o-1];if(y(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr().points,a=!1;return n&&(a=V(o,i,t,e,!0)),!a&&r&&(a=N(o,t,e)),a},e.prototype.createPath=function(t){var e=this.attr().points;if(!(e.length<2)){t.beginPath();for(var n=0;n<e.length;n++){var r=e[n];0===n?t.moveTo(r[0],r[1]):t.lineTo(r[0],r[1])}t.closePath()}},e}(f),Y=n(124),H=n.n(Y),q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow(),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),e=this.attrs,n=e.points,r=e.startArrow,i=e.endArrow,o=n.length,a=n[0][0],s=n[0][1],u=n[o-1][0],c=n[o-1][1];r&&b.b(this,t,n[1][0],n[1][1],a,s),i&&b.a(this,t,n[o-2][0],n[o-2][1],u,c)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!(!n||!i)&&V(this.attr().points,i,t,e,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var e=this.attr(),n=e.points,r=e.startArrow,i=e.endArrow,o=n.length;if(!(n.length<2)){var a,s=n[0][0],u=n[0][1],c=n[o-1][0],f=n[o-1][1];if(r&&r.d)s+=(a=b.c(s,u,n[1][0],n[1][1],r.d)).dx,u+=a.dy;if(i&&i.d)c-=(a=b.c(n[o-2][0],n[o-2][1],c,f,i.d)).dx,f-=a.dy;t.beginPath(),t.moveTo(s,u);for(var l=0;l<o-1;l++){var h=n[l];t.lineTo(h[0],h[1])}t.lineTo(c,f)}},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(w.s)(e)?(this.set("totalLength",H.a.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),Object(w.f)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),m.a.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(w.f)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=m.a.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(f),Q=n(120);var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),s=o.x,u=o.y,c=o.width,f=o.height,l=o.radius;if(l){var h=!1;return n&&(h=function(t,e,n,r,i,o,a,s){return y(t+i,e,t+n-i,e,o,a,s)||y(t+n,e+i,t+n,e+r-i,o,a,s)||y(t+n-i,e+r,t+i,e+r,o,a,s)||y(t,e+r-i,t,e+i,o,a,s)||B(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||B(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||B(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||B(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(s,u,c,f,l,i,t,e)),!h&&r&&(h=C(this,t,e)),h}var d=i/2;return r&&n?Object(a.e)(s-d,u-d,c+d,f+d,t,e):r?Object(a.e)(s,u,c,f,t,e):n?function(t,e,n,r,i,o,s){var u=i/2;return Object(a.e)(t-u,e-u,n,i,o,s)||Object(a.e)(t+n-u,e-u,i,r,o,s)||Object(a.e)(t+u,e+r-u,n,i,o,s)||Object(a.e)(t-u,e+u,i,r,o,s)}(s,u,c,f,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=Object(Q.a)(a),u=s[0],c=s[1],f=s[2],l=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-f),0!==f&&t.arc(n+i-f,r+o-f,f,0,Math.PI/2),t.lineTo(n+l,r+o),0!==l&&t.arc(n+l,r+o-l,l,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(f),K=n(122),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Object(K.assembleFont)(t)},e.prototype._setText=function(t){var e=null;Object(a.k)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,o=i.textBaseline,s=i.x,u=i.y,c=1*i.fontSize,f=this._getSpaceingY(),l=Object(K.getTextHeight)(i.text,i.fontSize,i.lineHeight);Object(a.c)(e,(function(e,i){r=u+i*(f+c)-l+c,"middle"===o&&(r+=l-c-(l-c)/2),"top"===o&&(r+=l-c),n?t.fillText(e,s,r):t.strokeText(e,s,r)}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;e?t.fillText(a,r,i):t.strokeText(a,r,i)}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(Object(a.i)(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(Object(a.i)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(f)},function(t,e,n){var r=n(70),i=n(323),o=n(324),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(188),i=n(139),o=n(49);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(26);function o(t,e,n,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[u];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var h=l[f];if(h.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+h.key.toString())}else c=[];c.push(i),a[u]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function s(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([s(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},function(t,e,n){var r=n(482),i=n(483),o=n(239),a=n(484);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()}},function(t,e,n){var r=n(55),i=n(41);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==r(t)}},function(t,e,n){"use strict";n(76),n(181),n(182),n(22);var r=n(267);n.d(e,"Canvas",(function(){return r.a}));n(75),n(308).version},function(t,e,n){var r=n(257),i=n(256),o=n(264),a=n(159),s=n(265),u=[0,0];t.exports.computeMiter=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(u,-n[1],n[0]),c/s(e,u)},t.exports.normal=function(t,e){return i(t,-e[1],e[0]),t},t.exports.direction=function(t,e,n){return a(t,e,n),o(t,t),t}},function(t,e,n){var r=n(322),i=n(327);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(188),i=n(347),o=n(49);t.exports=function(t){return o(t)?r(t,!0):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=0;e.id=function(){return r++}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(27),o=n(177);function a(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function s(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function u(t,e,n,i){var o,a,s,u=-3*t+9*e-9*n+3*i,c=6*t-12*e+6*n,f=3*e-3*t,l=[];if(r.isNumberEqual(u,0))r.isNumberEqual(c,0)||(o=-f/c)>=0&&o<=1&&l.push(o);else{var h=c*c-4*u*f;r.isNumberEqual(h,0)?l.push(-c/(2*u)):h>0&&(a=(-c-(s=Math.sqrt(h)))/(2*u),(o=(-c+s)/(2*u))>=0&&o<=1&&l.push(o),a>=0&&a<=1&&l.push(a))}return l}function c(t,e,n,r,o,s,u,c,f){var l=a(t,n,o,u,f),h=a(e,r,s,c,f),d=i.default.pointAt(t,e,n,r,f),p=i.default.pointAt(n,r,o,s,f),g=i.default.pointAt(o,s,u,c,f),v=i.default.pointAt(d.x,d.y,p.x,p.y,f),m=i.default.pointAt(p.x,p.y,g.x,g.y,f);return[[t,e,d.x,d.y,v.x,v.y,l,h],[l,h,m.x,m.y,g.x,g.y,u,c]]}e.default={extrema:u,box:function(t,e,n,i,o,s,c,f){for(var l=[t,c],h=[e,f],d=u(t,n,o,c),p=u(e,i,s,f),g=0;g<d.length;g++)l.push(a(t,n,o,c,d[g]));for(g=0;g<p.length;g++)h.push(a(e,i,s,f,p[g]));return r.getBBoxByArray(l,h)},length:function(t,e,n,r,i,a,s,u){return function t(e,n,r,i,a,s,u,f,l){if(0===l)return o.snapLength([e,r,a,u],[n,i,s,f]);var h=c(e,n,r,i,a,s,u,f,.5),d=h[0],p=h[1];return d.push(l-1),p.push(l-1),t.apply(null,d)+t.apply(null,p)}(t,e,n,r,i,a,s,u,3)},nearestPoint:function(t,e,n,r,i,s,u,c,f,l,h){return o.nearestPoint([t,n,i,u],[e,r,s,c],f,l,a,h)},pointDistance:function(t,e,n,i,o,a,s,u,c,f,l){var h=this.nearestPoint(t,e,n,i,o,a,s,u,c,f,l);return r.distance(h.x,h.y,c,f)},interpolationAt:a,pointAt:function(t,e,n,r,i,o,s,u,c){return{x:a(t,n,i,s,c),y:a(e,r,o,u,c)}},divide:function(t,e,n,r,i,o,a,s,u){return c(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,i,o,a,u,c,f){var l=s(t,n,o,u,f),h=s(e,i,a,c,f);return r.piMod(Math.atan2(h,l))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(30),i=n(17);function o(t,e){e.forEach((function(e){e.draw(t)}))}function a(t,e){var n=t.get("canvas");if(n&&n.get("autoDraw")){var o=n.get("context"),a=t.getParent(),s=a?a.getChildren():[n],u=t.get("el");if("remove"===e)if(t.get("isClipShape")){var c=u&&u.parentNode,f=c&&c.parentNode;c&&f&&f.removeChild(c)}else u&&u.parentNode&&u.parentNode.removeChild(u);else if("show"===e)u.setAttribute("visibility","visible");else if("hide"===e)u.setAttribute("visibility","hidden");else if("zIndex"===e)Object(i.c)(u,s.indexOf(t));else if("sort"===e){var l=t.get("children");l&&l.length&&Object(i.d)(t,(function(t,e){return l.indexOf(t)-l.indexOf(e)?1:0}))}else"clear"===e?u&&(u.innerHTML=""):"matrix"===e?Object(r.c)(t):"clip"===e?Object(r.a)(t,o):"attr"===e||"add"===e&&t.draw(o)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){return null==t}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(40).Symbol;t.exports=r},function(t,e,n){(function(t){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)}var i=n(40),o=n(343),a="object"==r(e)&&e&&!e.nodeType&&e,s=a&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===a?i.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;t.exports=c}).call(this,n(83)(t))},function(t,e,n){var r=n(352),i=n(134),o=n(353),a=n(197),s=n(354),u=n(55),c=n(186),f=c(r),l=c(i),h=c(o),d=c(a),p=c(s),g=u;(r&&"[object DataView]"!=g(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=g(new i)||o&&"[object Promise]"!=g(o.resolve())||a&&"[object Set]"!=g(new a)||s&&"[object WeakMap]"!=g(new s))&&(g=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=g},function(t,e,n){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)}var i=n(55),o=n(41);t.exports=function(t){return"symbol"==r(t)||o(t)&&"[object Symbol]"==i(t)}},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(54),a=n(21),s=n(0),u=n(14),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.onCanvasChange=function(t){Object(a.h)(this,t)},e.prototype.getShapeBase=function(){return o},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),Object(a.a)(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];Object(s.f)(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=Math.min.apply(null,e),o=Math.max.apply(null,e),a=Math.min.apply(null,n),c=Math.max.apply(null,n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:c,width:o-i,height:c-a};var f=this.cfg.canvas;if(f){var l=f.getViewRange();this.set("isInView",Object(u.f)(r,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),Object(a.a)(t,this),this._applyClip(t,this.getClip()),Object(a.d)(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(i.AbstractGroup);e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(0),a=n(76),s=n(67),u=n(30),c=n(13),f=n(17),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=Object(f.b)("g");this.set("el",t);var e=this.getParent();if(e){var n=e.get("el");n||(n=e.createDom(),e.set("el",n)),n.appendChild(t)}return t},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.createPath(r,e)}},e.prototype.onCanvasChange=function(t){Object(s.b)(this,t)},e.prototype.getShapeBase=function(){return a},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var e=this.getChildren(),n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||this.createDom(),Object(u.a)(this,t),this.createPath(t),e.length&&Object(s.a)(t,e))},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(o.f)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),Object(u.c)(this)},e}(i.AbstractGroup);e.a=l},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return h})),n.d(e,"Circle",(function(){return p})),n.d(e,"Dom",(function(){return g})),n.d(e,"Ellipse",(function(){return v})),n.d(e,"Image",(function(){return m})),n.d(e,"Line",(function(){return x})),n.d(e,"Marker",(function(){return E})),n.d(e,"Path",(function(){return S})),n.d(e,"Polygon",(function(){return M})),n.d(e,"Polyline",(function(){return k})),n.d(e,"Rect",(function(){return T})),n.d(e,"Text",(function(){return N}));var r={};n.r(r),n.d(r,"Base",(function(){return h})),n.d(r,"Circle",(function(){return p})),n.d(r,"Dom",(function(){return g})),n.d(r,"Ellipse",(function(){return v})),n.d(r,"Image",(function(){return m})),n.d(r,"Line",(function(){return x})),n.d(r,"Marker",(function(){return E})),n.d(r,"Path",(function(){return S})),n.d(r,"Polygon",(function(){return M})),n.d(r,"Polyline",(function(){return k})),n.d(r,"Rect",(function(){return T})),n.d(r,"Text",(function(){return N}));var i=n(1),o=n(22),a=n(30),s=n(17),u=n(67),c=n(13),f=n(75),l=n(121),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="svg",e.canFill=!1,e.canStroke=!1,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e);var n=this.get("canvas");if(n&&n.get("autoDraw")){var r=n.get("context");this.draw(r,e)}},e.prototype.getShapeBase=function(){return r},e.prototype.getGroupBase=function(){return f.a},e.prototype.onCanvasChange=function(t){Object(u.b)(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),e=null;if(t)e=t.getBBox();else{var n=Object(l.getBBoxMethod)(this.get("type"));n&&(e=n(this))}if(e){var r=e.x,i=e.y,o=e.width,a=e.height,s=this.getHitLineWidth(),u=s/2,c=r-u,f=i-u;return{x:c,y:f,minX:c,minY:f,maxX:r+o+u,maxY:i+a+u,width:o+s,height:a+s}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),e=t.fill,n=t.fillStyle;return(e||n||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),e=t.stroke,n=t.strokeStyle;return(e||n)&&this.canStroke},e.prototype.draw=function(t,e){var n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||Object(s.a)(this),Object(a.a)(this,t),this.createPath(t,e),this.shadow(t,e),this.strokeAndFill(t,e),this.transform(e))},e.prototype.createPath=function(t,e){},e.prototype.strokeAndFill=function(t,e){var n=e||this.attr(),r=n.fill,i=n.fillStyle,o=n.stroke,a=n.strokeStyle,s=n.fillOpacity,u=n.strokeOpacity,f=n.lineWidth,l=this.get("el");this.canFill&&(e?"fill"in n?this._setColor(t,"fill",r):"fillStyle"in n&&this._setColor(t,"fill",i):this._setColor(t,"fill",r||i),s&&l.setAttribute(c.b.fillOpacity,s)),this.canStroke&&f>0&&(e?"stroke"in n?this._setColor(t,"stroke",o):"strokeStyle"in n&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&l.setAttribute(c.b.strokeOpacity,u),f&&l.setAttribute(c.b.lineWidth,f))},e.prototype._setColor=function(t,e,n){var r=this.get("el");if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n))(i=t.find("gradient",n))||(i=t.addGradient(n)),r.setAttribute(c.b[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(n)){var i;(i=t.find("pattern",n))||(i=t.addPattern(n)),r.setAttribute(c.b[e],"url(#"+i+")")}else r.setAttribute(c.b[e],n);else r.setAttribute(c.b[e],"none")},e.prototype.shadow=function(t,e){var n=this.attr(),r=e||n,i=r.shadowOffsetX,o=r.shadowOffsetY,s=r.shadowBlur,u=r.shadowColor;(i||o||s||u)&&Object(a.b)(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&Object(a.c)(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var n=this.get("el"),r=this.get("canvas").get("el").getBoundingClientRect(),i=t+r.left,o=e+r.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},e}(o.AbstractShape),d=n(0),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(d.f)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return Object(i.c)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");if(Object(d.f)(e||n,(function(t,e){c.b[e]&&r.setAttribute(c.b[e],t)})),"function"==typeof n.html){var i=n.html.call(this,n);if(i instanceof Element||i instanceof HTMLDocument){for(var o=r.childNodes,a=o.length-1;a>=0;a--)r.removeChild(o[a]);r.appendChild(i)}else r.innerHTML=i}else r.innerHTML=n.html},e}(h),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(d.f)(e||n,(function(t,e){"x"===e||"y"===e?r.setAttribute("c"+e,t):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(d.f)(e||r,(function(t,e){"img"===e?n._setImage(r.img):c.b[e]&&i.setAttribute(c.b[e],t)}))},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(Object(d.w)(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&Object(d.w)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var r=document.createElement("canvas");r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",r.toDataURL())}},e}(h),y=n(27),b=n.n(y),x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(d.f)(e||n,(function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=Object(d.u)(e)?t.addArrow(n,c.b[i]):t.getDefaultArrow(n,c.b[i]);r.setAttribute(c.b[i],"url(#"+o+")")}else r.removeAttribute(c.b[i]);else c.b[i]&&r.setAttribute(c.b[i],e)}))},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return b.a.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return b.a.pointAt(n,r,i,o,t)},e}(h),w={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},_={get:function(t){return w[t]},register:function(t,e){w[t]=e},remove:function(t){delete w[t]},getAll:function(){return w}},E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return Object(d.m)(t)?t.map((function(t){return t.join(" ")})).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),n=e.x,r=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=Object(d.r)(o)?o:_.get(o))?t(n,r,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=_,e}(h),S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");Object(d.f)(e||r,(function(e,o){if("path"===o&&Object(d.m)(e))i.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=Object(d.u)(e)?t.addArrow(r,c.b[o]):t.getDefaultArrow(r,c.b[o]);i.setAttribute(c.b[o],"url(#"+a+")")}else i.removeAttribute(c.b[o]);else c.b[o]&&i.setAttribute(c.b[o],e)}))},e.prototype._formatPath=function(t){var e=t.map((function(t){return t.join(" ")})).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(0===n)return null;var r=e?e.getPointAtLength(t*n):null;return r?{x:r.x,y:r.y}:null},e}(h),M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(d.f)(e||n,(function(t,e){"points"===e&&Object(d.m)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e}(h),O=n(124),A=n.n(O),k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var n=this.attr(),r=this.get("el");Object(d.f)(e||n,(function(t,e){"points"===e&&Object(d.m)(t)&&t.length>=2?r.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):c.b[e]&&r.setAttribute(c.b[e],t)}))},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(d.s)(e)?(this.set("totalLength",A.a.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),Object(d.f)(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),b.a.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];Object(d.f)(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=b.a.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(h);var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];Object(d.f)(e||r,(function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&c.b[e]&&i.setAttribute(c.b[e],t):(i.setAttribute("d",n._assembleRect(r)),o=!0)}))},e.prototype._assembleRect=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+n+" l "+r+",0 l 0,"+i+" l"+-r+" 0 z";var a=function(t){var e=0,n=0,r=0,i=0;return Object(d.m)(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}}(o);return Object(d.m)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+n],["l "+(r-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-r)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(h),I=n(119),C={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},P={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},D={left:"left",start:"left",center:"middle",right:"end",end:"end"},N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return Object(i.c)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(i.a)(Object(i.a)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var n=this,r=this.attr(),i=this.get("el");this._setFont(),Object(d.f)(e||r,(function(t,e){"text"===e?n._setText(""+t):"matrix"===e&&t?Object(a.c)(n):c.b[e]&&i.setAttribute(c.b[e],t)})),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,r=e.textAlign,i=Object(I.a)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",P[n]||"alphabetic"):t.setAttribute("alignment-baseline",C[n]||"baseline"),t.setAttribute("text-anchor",D[r]||"left")},e.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),r=n.x,i=n.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";Object(d.f)(a,(function(t,e){0===e?"alphabetic"===o?u+='<tspan x="'+r+'" dy="'+-s+'em">'+t+"</tspan>":"top"===o?u+='<tspan x="'+r+'" dy="0.9em">'+t+"</tspan>":"middle"===o?u+='<tspan x="'+r+'" dy="'+-(s-1)/2+'em">'+t+"</tspan>":"bottom"===o?u+='<tspan x="'+r+'" dy="-'+(s+.3)+'em">'+t+"</tspan>":"hanging"===o&&(u+='<tspan x="'+r+'" dy="'+(-(s-1)-.3)+'em">'+t+"</tspan>"):u+='<tspan x="'+r+'" dy="1em">'+t+"</tspan>"})),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(h)},function(t,e){var n=[],r=[];function i(t,e){if(e=e||{},void 0===t)throw new Error("insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).");var i,o=!0===e.prepend?"prepend":"append",a=void 0!==e.container?e.container:document.querySelector("head"),s=n.indexOf(a);return-1===s&&(s=n.push(a)-1,r[s]={}),void 0!==r[s]&&void 0!==r[s][o]?i=r[s][o]:(i=r[s][o]=function(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}(),"prepend"===o?a.insertBefore(i,a.childNodes[0]):a.appendChild(i)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),i.styleSheet?i.styleSheet.cssText+=t:i.textContent+=t,i}t.exports=i,t.exports.insertCss=i},function(t,e,n){"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)}var i=n(284),o=n(288),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach((function(t){u[a.call(o[t].labels).sort().join("")]=t}));var c={};function f(t,e){if(!(this instanceof f))return new f(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof f)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var l=i.get(t);if(null===l)throw new Error("Unable to parse color from string: "+t);this.model=l.model,r=o[this.model].channels,this.color=l.value.slice(0,r),this.valpha="number"==typeof l.value[r]?l.value[r]:1}else if(t.length){this.model=e||"rgb",r=o[this.model].channels;var h=a.call(t,0,r);this.color=p(h,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=d.sort().join("");if(!(g in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[g];var v=o[this.model].labels,m=[];for(n=0;n<v.length;n++)m.push(t[v[n]]);this.color=p(m)}if(c[this.model])for(r=o[this.model].channels,n=0;n<r;n++){var y=c[this.model][n];y&&(this.color[n]=y(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function l(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(c[t]||(c[t]=[]))[e]=n})),t=t[0],function(r){var i;return arguments.length?(n&&(r=n(r)),(i=this[t]()).color[e]=r,i):(i=this[t]().color[e],n&&(i=n(i)),i)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function d(t){return Array.isArray(t)?t:[t]}function p(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}f.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in i.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return i.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return i.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=o[this.model].channels,n=o[this.model].labels,r=0;r<e;r++)t[n[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new f(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new f(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:l("rgb",0,h(255)),green:l("rgb",1,h(255)),blue:l("rgb",2,h(255)),hue:l(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:l("hsl",1,h(100)),lightness:l("hsl",2,h(100)),saturationv:l("hsv",1,h(100)),value:l("hsv",2,h(100)),chroma:l("hcg",1,h(100)),gray:l("hcg",2,h(100)),white:l("hwb",1,h(100)),wblack:l("hwb",2,h(100)),cyan:l("cmyk",0,h(100)),magenta:l("cmyk",1,h(100)),yellow:l("cmyk",2,h(100)),black:l("cmyk",3,h(100)),x:l("xyz",0,h(100)),y:l("xyz",1,h(100)),z:l("xyz",2,h(100)),l:l("lab",0,h(100)),a:l("lab",1),b:l("lab",2),keyword:function(t){return arguments.length?new f(t):o[this.model].keyword(this.color)},hex:function(t){return arguments.length?new f(t):i.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],n=0;n<t.length;n++){var r=t[n]/255;e[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return f.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,c=1-u;return f.rgb(u*n.red()+c*i.red(),u*n.green()+c*i.green(),u*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===s.indexOf(t)){var e=o[t].channels;f.prototype[t]=function(){if(this.model===t)return new f(this);if(arguments.length)return new f(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new f(d(o[this.model][t].raw(this.color)).concat(n),t)},f[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new f(n,t)}}})),t.exports=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(126);e.default=function(t){return r.default(t,"Function")}},function(t,e,n){var r=n(55),i=n(36);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(100),i=n(101);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var c=e[s],f=o?o(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),a?i(n,c,f):r(n,c,f)}return n}},function(t,e,n){var r=n(342),i=n(41),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(73);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){"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(e,"__esModule",{value:!0});var i=n(34);function o(t){return"function"==typeof t?t.name:"symbol"===r(t)?t.toString():t}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=o,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(function t(e,n){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===n||t(e.parentRequest,n))}(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=o(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(i.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){return(t%e+e)%e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Math.PI/180;e.default=function(t){return r*t}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r;function i(t){return(i="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)}!function(o){var a=/^\s+/,s=/\s+$/,u=0,c=o.round,f=o.min,l=o.max,h=o.random;function d(t,e){if(e=e||{},(t=t||"")instanceof d)return t;if(!(this instanceof d))return new d(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,u=null,c=null,h=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(s,"").toLowerCase();var e,n=!1;if(C[t])t=C[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=V.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=V.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=V.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=V.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=V.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=V.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=V.hex8.exec(t))return{r:j(e[1]),g:j(e[2]),b:j(e[3]),a:F(e[4]),format:n?"name":"hex8"};if(e=V.hex6.exec(t))return{r:j(e[1]),g:j(e[2]),b:j(e[3]),format:n?"name":"hex"};if(e=V.hex4.exec(t))return{r:j(e[1]+""+e[1]),g:j(e[2]+""+e[2]),b:j(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=V.hex3.exec(t))return{r:j(e[1]+""+e[1]),g:j(e[2]+""+e[2]),b:j(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==i(t)&&(X(t.r)&&X(t.g)&&X(t.b)?(p=t.r,g=t.g,v=t.b,e={r:255*N(p,255),g:255*N(g,255),b:255*N(v,255)},h=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):X(t.h)&&X(t.s)&&X(t.v)?(r=L(t.s),u=L(t.v),e=function(t,e,n){t=6*N(t,360),e=N(e,100),n=N(n,100);var r=o.floor(t),i=t-r,a=n*(1-e),s=n*(1-i*e),u=n*(1-(1-i)*e),c=r%6;return{r:255*[n,s,a,a,u,n][c],g:255*[u,n,n,s,a,a][c],b:255*[a,a,u,n,n,s][c]}}(t.h,r,u),h=!0,d="hsv"):X(t.h)&&X(t.s)&&X(t.l)&&(r=L(t.s),c=L(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=N(t,360),e=N(e,100),n=N(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,c),h=!0,d="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,g,v;return n=D(n),{ok:h,format:t.format||d,r:f(255,l(e.r,0)),g:f(255,l(e.g,0)),b:f(255,l(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=u++}function p(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=f(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,l:s}}function g(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=f(t,e,n),s=o,u=o-a;if(i=0===o?0:u/o,o==a)r=0;else{switch(o){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:i,v:s}}function v(t,e,n,r){var i=[B(c(t).toString(16)),B(c(e).toString(16)),B(c(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function m(t,e,n,r){return[B(G(r)),B(c(t).toString(16)),B(c(e).toString(16)),B(c(n).toString(16))].join("")}function y(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.s-=e/100,n.s=R(n.s),d(n)}function b(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.s+=e/100,n.s=R(n.s),d(n)}function x(t){return d(t).desaturate(100)}function w(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.l+=e/100,n.l=R(n.l),d(n)}function _(t,e){e=0===e?0:e||10;var n=d(t).toRgb();return n.r=l(0,f(255,n.r-c(-e/100*255))),n.g=l(0,f(255,n.g-c(-e/100*255))),n.b=l(0,f(255,n.b-c(-e/100*255))),d(n)}function E(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.l-=e/100,n.l=R(n.l),d(n)}function S(t,e){var n=d(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,d(n)}function M(t){var e=d(t).toHsl();return e.h=(e.h+180)%360,d(e)}function O(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+120)%360,s:e.s,l:e.l}),d({h:(n+240)%360,s:e.s,l:e.l})]}function A(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+90)%360,s:e.s,l:e.l}),d({h:(n+180)%360,s:e.s,l:e.l}),d({h:(n+270)%360,s:e.s,l:e.l})]}function k(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+72)%360,s:e.s,l:e.l}),d({h:(n+216)%360,s:e.s,l:e.l})]}function T(t,e,n){e=e||6,n=n||30;var r=d(t).toHsl(),i=360/n,o=[d(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(d(r));return o}function I(t,e){e=e||6;for(var n=d(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(d({h:r,s:i,v:o})),o=(o+s)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=D(t),this._roundA=c(100*this._a)/100,this},toHsv:function(){var t=g(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=g(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[B(c(t).toString(16)),B(c(e).toString(16)),B(c(n).toString(16)),B(G(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*N(this._r,255))+"%",g:c(100*N(this._g,255))+"%",b:c(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%)":"rgba("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(P[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+m(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=d(t);n="#"+m(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(M,arguments)},monochromatic:function(){return this._applyCombination(I,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(O,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},d.fromRatio=function(t,e){if("object"==i(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:L(t[r]));t=n}return d(t,e)},d.equals=function(t,e){return!(!t||!e)&&d(t).toRgbString()==d(e).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(t,e,n){n=0===n?0:n||50;var r=d(t).toRgb(),i=d(e).toRgb(),o=n/100;return d({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},d.readability=function(t,e){var n=d(t),r=d(e);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(t,e,n){var r,i,o=d.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},d.mostReadable=function(t,e,n){var r,i,o,a,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<e.length;c++)(r=d.readability(t,e[c]))>u&&(u=r,s=d(e[c]));return d.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,d.mostReadable(t,["#fff","#000"],n))};var C=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=d.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(C);function D(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=f(e,l(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),o.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function R(t){return f(1,l(0,t))}function j(t){return parseInt(t,16)}function B(t){return 1==t.length?"0"+t:""+t}function L(t){return t<=1&&(t=100*t+"%"),t}function G(t){return o.round(255*parseFloat(t)).toString(16)}function F(t){return j(t)/255}var U,z,W,V=(z="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",W="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+W),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+W),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+W),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function X(t){return!!V.CSS_UNIT.exec(t)}t.exports?t.exports=d:void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){t.exports={EPSILON:n(254),create:n(255),clone:n(516),fromValues:n(517),copy:n(518),set:n(256),equals:n(519),exactEquals:n(520),add:n(257),subtract:n(159),sub:n(521),multiply:n(258),mul:n(522),divide:n(259),div:n(523),inverse:n(524),min:n(525),max:n(526),rotate:n(527),floor:n(528),ceil:n(529),round:n(530),scale:n(531),scaleAndAdd:n(532),distance:n(260),dist:n(533),squaredDistance:n(261),sqrDist:n(534),length:n(262),len:n(535),squaredLength:n(263),sqrLen:n(536),negate:n(537),normalize:n(264),dot:n(265),cross:n(538),lerp:n(539),random:n(540),transformMat2:n(541),transformMat2d:n(542),transformMat3:n(543),transformMat4:n(544),forEach:n(545),limit:n(546)}},function(t,e,n){"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(e,"__esModule",{value:!0}),e.default=function(t){var e=r(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){var r=n(96),i=n(317),o=n(318),a=n(319),s=n(320),u=n(321);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(312),i=n(313),o=n(314),a=n(315),s=n(316);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(69);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(62)(Object,"create");t.exports=r},function(t,e,n){var r=n(336);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(101),i=n(69),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(187);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){function n(t){return(n="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)}var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=n(t);return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(189)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(144),i=n(365)(r);t.exports=i},function(t,e,n){var r=n(108),i=n(84);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(20),i=n(147),o=n(379),a=n(212);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(64),i=n(221),o=n(222);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){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)}var i=n(69),o=n(49),a=n(102),s=n(36);t.exports=function(t,e,n){if(!s(n))return!1;var u=r(e);return!!("number"==u?o(n)&&a(e,n.length):"string"==u&&e in n)&&i(n[e],t)}},function(t,e,n){"use strict";var r=n(18);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},function(t,e){},function(t,e,n){"use strict";var r=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();e.a=r},function(t,e,n){"use strict";var r=n(1),i=n(116),o=n(16),a=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(o.i)(r,e),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(i.a);e.a=a},function(t,e,n){"use strict";var r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();e.a=r},function(t,e,n){"use strict";var r=n(1),i=n(118),o=n(16),a={};var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],a=[],s=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return s.length>0?(Object(o.a)(s,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],a=[],s=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return s.length>0?(Object(o.a)(s,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(o.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];Object(o.f)(n)?r=n:r.type=n;var i=a[r.type];i||(i=Object(o.k)(r.type),a[r.type]=i);var s=this.getShapeBase(),u=new s[i](r);return this.add(u),u},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(Object(o.d)(r))n=new r(i||{parent:this});else{var a=r||{},s=this.getGroupBase();n=new s(a)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!Object(o.b)(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var a=[t,e,1];a=this.invertFromMatrix(a),this.isClipped(a[0],a[1])||(r=this._findShape(i,a[0],a[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,a=t.length-1;a>=0;a--){var s=t[a];if(Object(o.b)(s)&&(s.isGroup()?i=s.getShape(e,n,r):s.isHit(e,n)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(o.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(o.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(o.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(o.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(i.a);e.a=s},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(125),a=n(16),s=n(43),u=n(115),c=o.a.transform,f=["zIndex","capture","visible","type"],l=["repeat"];function h(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function d(t,e){var n={},r=e.attr();return Object(i.f)(t,(function(t,e){-1!==l.indexOf(e)||Object(i.q)(r[e],t)||(n[e]=t)})),n}function p(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return Object(i.f)(t,(function(t){n+r<t.startTime+t.delay+t.duration&&o>t.delay&&Object(i.f)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var g=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(i.z)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e[1];if(!r)return this.attrs;if(Object(i.u)(r)){for(var a in r)this.setAttr(a,r[a]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,o),this.afterAttrsChange(((t={})[r]=o,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(Object(a.j)(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr("matrix",this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr("matrix")},e.prototype.setMatrix=function(t){this.attr("matrix",t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Object(s.b)(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Object(s.b)(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?Object(s.c)(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=Object(s.a)(e);if(n)return Object(s.c)(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[Object(i.G)(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};Object(i.f)(e,(function(t,r){Object(i.m)(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)Object(i.m)(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return Object(i.f)(f,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var o,a,s,u,c,f=t[0],l=t[1],g=t[2],v=void 0===g?"easeLinear":g,m=t[3],y=void 0===m?i.B:m,b=t[4],x=void 0===b?0:b;Object(i.r)(f)?(o=f,f={}):Object(i.u)(f)&&f.onFrame&&(o=f.onFrame,a=f.repeat),Object(i.u)(l)?(l=(c=l).duration,v=c.easing||"easeLinear",x=c.delay||0,a=c.repeat||a||!1,y=c.callback||i.B,s=c.pauseCallback||i.B,u=c.resumeCallback||i.B):(Object(i.t)(y)&&(x=y,y=null),Object(i.r)(v)?(y=v,v="easeLinear"):v=v||"easeLinear");var w=d(f,this),_={fromAttrs:h(w,this),toAttrs:w,duration:l,easing:v,repeat:a,callback:y,pauseCallback:s,resumeCallback:u,delay:x,startTime:n.getTime(),id:Object(i.F)(),onFrame:o,pathFormatted:!1};r.length>0?r=p(r,_):n.addAnimator(this),r.push(_),this.set("animations",r),this.set("_pause",{isPaused:!1})},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(i.f)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(i.f)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(i.f)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var s=function(t){var s=o[t],c=s.get("name");if(c){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&n&&Object(a.g)(s,n))return"break";Object(i.m)(c)?Object(i.f)(c,(function(t){r.emitDelegateEvent(s,t,e)})):u.emitDelegateEvent(s,c,e)}},u=this,c=0;c<o.length;c++){if("break"===s(c))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=c(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=c(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=c(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=c(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=c(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(u.a);e.a=g},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},i=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},a=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},s=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,f=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],l=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function h(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&f.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],o=e[1];if("searchbot"===n)return new s;var u=o[1]&&o[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=r(u,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length))):u=[];var f=u.join("."),h=function(t){for(var e=0,n=l.length;e<n;e++){var r=l[e],i=r[0];if(r[1].exec(t))return i}return null}(t),p=c.exec(t);return p&&p[1]?new a(n,f,h,p[1]):new i(n,f,h)}}).call(this,n(171))},function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var r=n(14),i=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,o=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,a=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,s=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function u(t,e){var n=t.match(s);Object(r.c)(n,(function(t){var n=t.split(":");e.addColorStop(n[0],n[1])}))}function c(t,e,n){if(Object(r.k)(n)){if("("===n[1]||"("===n[2]){if("l"===n[0])return function(t,e,n){var r,o,a=i.exec(n),s=parseFloat(a[1])%360*(Math.PI/180),c=a[2],f=e.getBBox();s>=0&&s<.5*Math.PI?(r={x:f.minX,y:f.minY},o={x:f.maxX,y:f.maxY}):.5*Math.PI<=s&&s<Math.PI?(r={x:f.maxX,y:f.minY},o={x:f.minX,y:f.maxY}):Math.PI<=s&&s<1.5*Math.PI?(r={x:f.maxX,y:f.maxY},o={x:f.minX,y:f.minY}):(r={x:f.minX,y:f.maxY},o={x:f.maxX,y:f.minY});var l=Math.tan(s),h=l*l,d=(o.x-r.x+l*(o.y-r.y))/(h+1)+r.x,p=l*(o.x-r.x+l*(o.y-r.y))/(h+1)+r.y,g=t.createLinearGradient(r.x,r.y,d,p);return u(c,g),g}(t,e,n);if("r"===n[0])return function(t,e,n){var r=o.exec(n),i=parseFloat(r[1]),a=parseFloat(r[2]),c=parseFloat(r[3]),f=r[4];if(0===c){var l=f.match(s);return l[l.length-1].split(":")[1]}var h=e.getBBox(),d=h.maxX-h.minX,p=h.maxY-h.minY,g=Math.sqrt(d*d+p*p)/2,v=t.createRadialGradient(h.minX+d*i,h.minY+p*a,0,h.minX+d/2,h.minY+p/2,c*g);return u(f,v),v}(t,e,n);if("p"===n[0])return function(t,e,n){if(e.get("patternSource")&&e.get("patternSource")===n)return e.get("pattern");var r,i,o=a.exec(n),s=o[1],u=o[2];function c(){r=t.createPattern(i,s),e.set("pattern",r),e.set("patternSource",n)}switch(s){case"a":s="repeat";break;case"x":s="repeat-x";break;case"y":s="repeat-y";break;case"n":s="no-repeat";break;default:s="no-repeat"}return i=new Image,u.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=u,i.complete?c():(i.onload=c,i.src=i.src),r}(t,e,n)}return n}}function f(t){var e=0,n=0,i=0,o=0;return Object(r.g)(t)?1===t.length?e=n=i=o=t[0]:2===t.length?(e=i=t[0],n=o=t[1]):3===t.length?(e=t[0],n=o=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],o=t[3]):e=n=i=o=t,[e,n,i,o]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBBoxMethod=void 0;var r=n(293);Object.defineProperty(e,"getBBoxMethod",{enumerable:!0,get:function(){return r.getMethod}});var i=n(294),o=n(295),a=n(296),s=n(297),u=n(298),c=n(299),f=n(303),l=n(304);r.register("rect",i.default),r.register("image",i.default),r.register("circle",o.default),r.register("marker",o.default),r.register("polyline",a.default),r.register("polygon",s.default),r.register("text",u.default),r.register("path",c.default),r.register("line",f.default),r.register("ellipse",l.default)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assembleFont=e.getTextWidth=e.getLineSpaceing=e.getTextHeight=void 0;var r=n(160),i=n(161);function o(t,e){return e?e-t:.14*t}e.getTextHeight=function(t,e,n){var i=1;return r.isString(t)&&(i=t.split("\n").length),i>1?e*i+o(e,n)*(i-1):e},e.getLineSpaceing=o,e.getTextWidth=function(t,e){var n=i.getOffScreenContext(),o=0;if(r.isNil(t)||""===t)return o;if(n.save(),n.font=e,r.isString(t)&&t.includes("\n")){var a=t.split("\n");r.each(a,(function(t){var e=n.measureText(t).width;o<e&&(o=e)}))}else o=n.measureText(t).width;return n.restore(),o},e.assembleFont=function(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(305),i=/[a-z]/;function o(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}e.default=function(t){var e=r.default(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,a=0;a<e.length;a++){var s=e[a][0];if(i.test(s)||["V","H","T","S"].indexOf(s)>=0){n=!0;break}}if(!n)return e;var u=[],c=0,f=0,l=0,h=0,d=0,p=e[0];"M"!==p[0]&&"m"!==p[0]||(l=c=+p[1],h=f=+p[2],d++,u[0]=["M",c,f]),a=d;for(var g=e.length;a<g;a++){var v=e[a],m=u[a-1],y=[],b=(s=v[0]).toUpperCase();if(s!==b)switch(y[0]=b,b){case"A":y[1]=v[1],y[2]=v[2],y[3]=v[3],y[4]=v[4],y[5]=v[5],y[6]=+v[6]+c,y[7]=+v[7]+f;break;case"V":y[1]=+v[1]+f;break;case"H":y[1]=+v[1]+c;break;case"M":l=+v[1]+c,h=+v[2]+f;break;default:for(var x=1,w=v.length;x<w;x++)y[x]=+v[x]+(x%2?c:f)}else y=e[a];switch(b){case"Z":c=+l,f=+h;break;case"H":y=["L",c=y[1],f];break;case"V":y=["L",c,f=y[1]];break;case"T":c=y[1],f=y[2];var _=o([m[1],m[2]],[m[3],m[4]]);y=["Q",_[0],_[1],c,f];break;case"S":c=y[y.length-2],f=y[y.length-1];var E=m.length,S=o([m[E-4],m[E-3]],[m[E-2],m[E-1]]);y=["C",S[0],S[1],y[1],y[2],c,f];break;case"M":l=y[y.length-2],h=y[y.length-1];break;default:c=y[y.length-2],f=y[y.length-1]}u.push(y)}return u}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(306),i=n(45);e.default={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var o=t[r];e.push(o[0]),n.push(o[1])}return i.getBBoxByArray(e,n)},length:function(t){return r.lengthOfSegment(t)},pointAt:function(t,e){return r.pointAtSegments(t,e)},pointDistance:function(t,e,n){return r.distanceAtSegment(t,e,n)},tangentAngle:function(t,e){return r.angleAtSegments(t,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r={};n.r(r),n.d(r,"leftTranslate",(function(){return o})),n.d(r,"leftRotate",(function(){return a})),n.d(r,"leftScale",(function(){return s})),n.d(r,"transform",(function(){return u})),n.d(r,"direction",(function(){return c})),n.d(r,"angleTo",(function(){return f})),n.d(r,"vertical",(function(){return l}));var i=n(2);function o(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromTranslation(r,n),i.a.multiply(t,r,e)}function a(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromRotation(r,n),i.a.multiply(t,r,e)}function s(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromScaling(r,n),i.a.multiply(t,r,e)}function u(t,e){for(var n,r,u,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],f=0,l=e.length;f<l;f++){var h=e[f];switch(h[0]){case"t":o(c,c,[h[1],h[2]]);break;case"s":s(c,c,[h[1],h[2]]);break;case"r":a(c,c,h[1]);break;case"m":n=c,r=c,u=h[1],i.a.multiply(n,u,r)}}return c}function c(t,e){return t[0]*e[1]-e[0]*t[1]}function f(t,e,n){var r=i.d.angle(t,e),o=c(t,e)>=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function l(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={}.toString;e.default=function(t,e){return r.call(t)==="[object "+e+"]"}},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(283);e.default=function(t){var e=r.default(t);return e.charAt(0).toUpperCase()+e.substring(1)}},function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"fromValues",(function(){return a})),n.d(e,"copy",(function(){return s})),n.d(e,"set",(function(){return u})),n.d(e,"add",(function(){return c})),n.d(e,"subtract",(function(){return f})),n.d(e,"multiply",(function(){return l})),n.d(e,"divide",(function(){return h})),n.d(e,"ceil",(function(){return d})),n.d(e,"floor",(function(){return p})),n.d(e,"min",(function(){return g})),n.d(e,"max",(function(){return v})),n.d(e,"round",(function(){return m})),n.d(e,"scale",(function(){return y})),n.d(e,"scaleAndAdd",(function(){return b})),n.d(e,"distance",(function(){return x})),n.d(e,"squaredDistance",(function(){return w})),n.d(e,"length",(function(){return _})),n.d(e,"squaredLength",(function(){return E})),n.d(e,"negate",(function(){return S})),n.d(e,"inverse",(function(){return M})),n.d(e,"normalize",(function(){return O})),n.d(e,"dot",(function(){return A})),n.d(e,"cross",(function(){return k})),n.d(e,"lerp",(function(){return T})),n.d(e,"random",(function(){return I})),n.d(e,"transformMat2",(function(){return C})),n.d(e,"transformMat2d",(function(){return P})),n.d(e,"transformMat3",(function(){return D})),n.d(e,"transformMat4",(function(){return N})),n.d(e,"rotate",(function(){return R})),n.d(e,"angle",(function(){return j})),n.d(e,"zero",(function(){return B})),n.d(e,"str",(function(){return L})),n.d(e,"exactEquals",(function(){return G})),n.d(e,"equals",(function(){return F})),n.d(e,"len",(function(){return z})),n.d(e,"sub",(function(){return W})),n.d(e,"mul",(function(){return V})),n.d(e,"div",(function(){return X})),n.d(e,"dist",(function(){return Y})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return q})),n.d(e,"forEach",(function(){return Q}));var r=n(9);function i(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.a(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function f(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function l(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function h(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function m(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function y(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function _(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function E(t){var e=t[0],n=t[1];return e*e+n*n}function S(t,e){return t[0]=-e[0],t[1]=-e[1],t}function M(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function O(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]}function k(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function T(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function I(t,e){e=e||1;var n=2*r.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function C(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function P(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function D(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function R(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function j(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function B(t){return t[0]=0,t[1]=0,t}function L(t){return"vec2("+t[0]+", "+t[1]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]}function F(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.b*Math.max(1,Math.abs(i),Math.abs(a))}var U,z=_,W=f,V=l,X=h,Y=x,H=w,q=E,Q=(U=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)U[0]=t[a],U[1]=t[a+1],i(U,U,o),t[a]=U[0],t[a+1]=U[1];return t})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*i},e.equals=function(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))};var r=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var i=Math.PI/180},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}},function(t,e,n){"use strict";function r(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}Object.defineProperty(e,"__esModule",{value:!0}),e.mergeArrowBBox=e.mergeBBox=void 0,e.mergeBBox=r,e.mergeArrowBBox=function(t,e){var n=t.get("startArrowShape"),i=t.get("endArrowShape");return n&&(e=r(e,n.getCanvasBBox())),i&&(e=r(e,i.getCanvasBBox())),e}},function(t,e,n){"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)}var i=n(35);t.exports=o;function o(t){this._isDirected=!i.has(t,"directed")||t.directed,this._isMultigraph=!!i.has(t,"multigraph")&&t.multigraph,this._isCompound=!!i.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=i.constant(void 0),this._defaultEdgeLabelFn=i.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function s(t,e){--t[e]||delete t[e]}function u(t,e,n,r){var o=""+e,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}return o+""+a+""+(i.isUndefined(r)?"\0":r)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function f(t,e){return u(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return i.keys(this._nodes)},o.prototype.sources=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,r=this;return i.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},o.prototype.setNode=function(t,e){return i.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return i.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(i.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],i.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),i.each(i.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],i.each(i.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(e))e="\0";else{for(var n=e+="";!i.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},o.prototype.children=function(t){if(i.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return i.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return i.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return i.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return i.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;i.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),i.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};return this._isCompound&&i.each(e.nodes(),(function(t){e.setParent(t,function t(i){var o=n.parent(i);return void 0===o||e.hasNode(o)?(r[i]=o,o):o in r?r[o]:t(o)}(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return i.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,r=arguments;return i.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},o.prototype.setEdge=function(){var t,e,n,o,s=!1,f=arguments[0];"object"===r(f)&&null!==f&&"v"in f?(t=f.v,e=f.w,n=f.name,2===arguments.length&&(o=arguments[1],s=!0)):(t=f,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,e=""+e,i.isUndefined(n)||(n=""+n);var l=u(this._isDirected,t,e,n);if(i.has(this._edgeLabels,l))return s&&(this._edgeLabels[l]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=s?o:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n);return i.has(this._edgeLabels,r)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):u(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.v===e})):r}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.w===e})):r}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(62)(n(40),"Map");t.exports=r},function(t,e,n){var r=n(328),i=n(335),o=n(337),a=n(338),s=n(339);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){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)}var i=n(184),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=u}).call(this,n(83)(t))},function(t,e,n){var r=n(104),i=n(345),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(192),i=n(193),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(198);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(145),i=n(56);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(364)();t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){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)}var i=n(20),o=n(73),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(i(t))return!1;var n=r(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(s.test(t)||!a.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(141),i=n(398);t.exports=function t(e,n,o,a,s){var u=-1,c=e.length;for(o||(o=i),s||(s=[]);++u<c;){var f=e[u];n>0&&o(f)?n>1?t(f,n-1,o,a,s):r(s,f):a||(s[s.length]=f)}return s}},function(t,e,n){var r=n(73);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(151),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(150),i=n(246),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAllowCapture=e.isParent=e.isBrowser=e.removeFromArray=void 0,e.removeFromArray=function(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)},e.isBrowser="undefined"!=typeof window&&void 0!==window.document;var r=n(68);Object.defineProperty(e,"isNil",{enumerable:!0,get:function(){return r.default}});var i=n(79);Object.defineProperty(e,"isFunction",{enumerable:!0,get:function(){return i.default}});var o=n(52);Object.defineProperty(e,"isString",{enumerable:!0,get:function(){return o.default}});var a=n(92);Object.defineProperty(e,"isObject",{enumerable:!0,get:function(){return a.default}});var s=n(37);Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return s.default}});var u=n(127);Object.defineProperty(e,"mix",{enumerable:!0,get:function(){return u.default}});var c=n(53);Object.defineProperty(e,"each",{enumerable:!0,get:function(){return c.default}});var f=n(128);Object.defineProperty(e,"upperFirst",{enumerable:!0,get:function(){return f.default}}),e.isParent=function(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r},e.isAllowCapture=function(t){return t.cfg.visible&&t.cfg.capture}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOffScreenContext=void 0;var r=null;e.getOffScreenContext=function(){if(!r){var t=document.createElement("canvas");t.width=1,t.height=1,r=t.getContext("2d")}return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(27),i=n(45),o=n(177);function a(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function s(t,e,n){var r=t+n-2*e;if(i.isNumberEqual(r,0))return[.5];var o=(t-e)/r;return o<=1&&o>=0?[o]:[]}function u(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function c(t,e,n,i,o,s,u){var c=a(t,n,o,u),f=a(e,i,s,u),l=r.default.pointAt(t,e,n,i,u),h=r.default.pointAt(n,i,o,s,u);return[[t,e,l.x,l.y,c,f],[c,f,h.x,h.y,o,s]]}e.default={box:function(t,e,n,r,o,u){var c=s(t,n,o)[0],f=s(e,r,u)[0],l=[t,o],h=[e,u];return void 0!==c&&l.push(a(t,n,o,c)),void 0!==f&&h.push(a(e,r,u,f)),i.getBBoxByArray(l,h)},length:function(t,e,n,r,o,a){return function t(e,n,r,o,a,s,u){if(0===u)return(i.distance(e,n,r,o)+i.distance(r,o,a,s)+i.distance(e,n,a,s))/2;var f=c(e,n,r,o,a,s,.5),l=f[0],h=f[1];return l.push(u-1),h.push(u-1),t.apply(null,l)+t.apply(null,h)}(t,e,n,r,o,a,3)},nearestPoint:function(t,e,n,r,i,s,u,c){return o.nearestPoint([t,n,i],[e,r,s],u,c,a)},pointDistance:function(t,e,n,r,o,a,s,u){var c=this.nearestPoint(t,e,n,r,o,a,s,u);return i.distance(c.x,c.y,s,u)},interpolationAt:a,pointAt:function(t,e,n,r,i,o,s){return{x:a(t,n,i,s),y:a(e,r,o,s)}},divide:function(t,e,n,r,i,o,a){return c(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,o,a,s){var c=u(t,n,o,s),f=u(e,r,a,s),l=Math.atan2(f,c);return i.piMod(l)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(178),i=n(178),o=n(302);function a(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}e.default=function(t){for(var e=[],n=null,s=null,u=null,c=0,f=(t=o.default(t)).length,l=0;l<f;l++){var h=t[l];s=t[l+1];var d=h[0],p={command:d,prePoint:n,params:h,startTangent:null,endTangent:null};switch(d){case"M":u=[h[1],h[2]],c=l;break;case"A":var g=r.default(n,h);p.arcParams=g}if("Z"===d)n=u,s=t[c+1];else{var v=h.length;n=[h[v-2],h[v-1]]}s&&"Z"===s[0]&&(s=t[c],e[c]&&(e[c].prePoint=n)),p.currentPoint=n,e[c]&&i.isSamePoint(n,e[c].currentPoint)&&(e[c].prePoint=p.prePoint);var m=s?[s[s.length-2],s[s.length-1]]:null;p.nextPoint=m;var y=p.prePoint;if(["L","H","V"].includes(d))p.startTangent=[y[0]-n[0],y[1]-n[1]],p.endTangent=[n[0]-y[0],n[1]-y[1]];else if("Q"===d){var b=[h[1],h[2]];p.startTangent=[y[0]-b[0],y[1]-b[1]],p.endTangent=[n[0]-b[0],n[1]-b[1]]}else if("T"===d){b=a((_=e[l-1]).currentPoint,y);"Q"===_.command?(p.command="Q",p.startTangent=[y[0]-b[0],y[1]-b[1]],p.endTangent=[n[0]-b[0],n[1]-b[1]]):(p.command="TL",p.startTangent=[y[0]-n[0],y[1]-n[1]],p.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("C"===d){var x=[h[1],h[2]],w=[h[3],h[4]];p.startTangent=[y[0]-x[0],y[1]-x[1]],p.endTangent=[n[0]-w[0],n[1]-w[1]]}else if("S"===d){var _;x=a((_=e[l-1]).currentPoint,y),w=[h[1],h[2]];"C"===_.command?(p.command="C",p.startTangent=[y[0]-x[0],y[1]-x[1]],p.endTangent=[n[0]-w[0],n[1]-w[1]]):(p.command="SQ",p.startTangent=[y[0]-w[0],y[1]-w[1]],p.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===d){var E=.001,S=p.arcParams||{},M=S.cx,O=void 0===M?0:M,A=S.cy,k=void 0===A?0:A,T=S.rx,I=void 0===T?0:T,C=S.ry,P=void 0===C?0:C,D=S.sweepFlag,N=void 0===D?0:D,R=S.startAngle,j=void 0===R?0:R,B=S.endAngle,L=void 0===B?0:B;0===N&&(E*=-1);var G=I*Math.cos(j-E)+O,F=P*Math.sin(j-E)+k;p.startTangent=[G-u[0],F-u[1]];var U=I*Math.cos(j+L+E)+O,z=P*Math.sin(j+L-E)+k;p.endTangent=[y[0]-U,y[1]-z]}e.push(p)}return e}},function(t,e,n){var r=n(55),i=n(105),o=n(41),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,f=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==f}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.invert=e.multiplyVec2=e.multiplyMatrix=void 0,e.multiplyMatrix=function(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=e[6],b=e[7],x=e[8];return n[0]=h*r+d*a+p*c,n[1]=h*i+d*s+p*f,n[2]=h*o+d*u+p*l,n[3]=g*r+v*a+m*c,n[4]=g*i+v*s+m*f,n[5]=g*o+v*u+m*l,n[6]=y*r+b*a+x*c,n[7]=y*i+b*s+x*f,n[8]=y*o+b*u+x*l,n},e.multiplyVec2=function(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n},e.invert=function(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=t[8],l=f*a-s*c,h=-f*o+s*u,d=c*o-a*u,p=n*l+r*h+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-f*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=h*p,e[4]=(f*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}},function(t,e,n){t.exports={graphlib:n(39),layout:n(421),debug:n(479),util:{time:n(32).time,notime:n(32).notime},version:n(480)}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,o,a){var s=i?i+t:t;if(!this._events[s])return!1;var u,c,f=this._events[s],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,n),!0;case 4:return f.fn.call(f.context,e,n,r),!0;case 5:return f.fn.call(f.context,e,n,r,o),!0;case 6:return f.fn.call(f.context,e,n,r,o,a),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,n);break;case 4:f[c].fn.call(f[c].context,e,n,r);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},c.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||u(this,o);else{for(var s=0,c=[],f=a.length;s<f;s++)(a[s].fn!==e||r&&!a[s].once||n&&a[s].context!==n)&&c.push(a[s]);c.length?this._events[o]=1===c.length?c[0]:c:u(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},function(t,e,n){(function(t){var n,r,i,o;function a(t){return(a="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)}"undefined"!=typeof self&&self,o=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=31)}([function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Array.isArray?Array.isArray(t):Object(r.a)(t,"Array")}},function(t,e,n){"use strict";e.a=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}},function(t,e,n){"use strict";var r=n(0),i=n(13);e.a=function(t,e){if(t)if(Object(r.a)(t))for(var n=0,o=t.length;n<o&&!1!==e(t[n],n);n++);else if(Object(i.a)(t))for(var a in t)if(t.hasOwnProperty(a)&&!1===e(t[a],a))break}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Function")}},function(t,e,n){"use strict";var r={}.toString;e.a=function(t,e){return r.call(t)==="[object "+e+"]"}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Number")}},function(t,e,n){"use strict";e.a=function(t){return null==t}},function(t,e,n){var r=n(33).mix;t.exports={assign:r}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"String")}},function(t,e,n){"use strict";var r=n(15),i=n(4);e.a=function(t){if(!Object(r.a)(t)||!Object(i.a)(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}},function(t,e,n){"use strict";var r=n(6);e.a=function(t){return Object(r.a)(t)?"":t.toString()}},function(t,e,n){var r=n(18),i=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=r(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=i},function(t,e,n){"use strict";var r=n(1);e.a=function(t,e){return!!Object(r.a)(t)&&t.indexOf(e)>-1}},function(t,e,n){"use strict";e.a=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){"use strict";var r=n(2),i=n(1);e.a=function(t,e){if(!Object(i.a)(t))return t;var n=[];return Object(r.a)(t,(function(t,r){e(t,r)&&n.push(t)})),n}},function(t,e,n){"use strict";e.a=function(t){return"object"===a(t)&&null!==t}},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}e.a=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){var r=n(30),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=r(t,e),c=u.left,f=u.right;n(c,e),n(f,e),e.isHorizontal?c.right2left():c.bottom2top(),f.translate(c.x-f.x,c.y-f.y),t.x=c.x,t.y=f.y;var l=t.getBoundingBox();e.isHorizontal?l.top<0&&t.translate(0,-l.top):l.left<0&&t.translate(-l.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(7),i={getId:function(t){return t.id||t.name},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.width=e.getWidth(t),n.height=e.getHeight(t),n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e}))},right2left:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.x=e.x-2*(e.x-t.left)-e.width})),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.y=e.y-2*(e.y-t.top)-e.height})),this.translate(0,t.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),u=[s];if(!n&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),f=c?c.length:0;if(a.children=new Array(f),c&&f)for(var l=0;l<f;l++){var h=new o(c[l],e);a.children[l]=h,u.push(h),h.parent=a,h.depth=a.depth+1}}return s}},function(t,e,n){"use strict";var r=n(6),i=n(20);e.a=function(t,e){var n=Object(i.a)(e),o=n.length;if(Object(r.a)(t))return!o;for(var a=0;a<o;a+=1){var s=n[a];if(e[s]!==t[s]||!(s in t))return!1}return!0}},function(t,e,n){"use strict";var r=n(2),i=n(3),o=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(r)})),e};e.a=o},function(t,e,n){"use strict";var r=n(1),i=Array.prototype.splice;e.a=function(t,e){if(!Object(r.a)(t))return[];for(var n=t?e.length:0,o=n-1;n--;){var a=void 0,s=e[n];n!==o&&s===a||(a=s,i.call(t,s,1))}return t}},function(t,e,n){"use strict";var r=n(12),i=n(2);e.a=function(t){var e=[];return Object(i.a)(t,(function(t){Object(r.a)(e,t)||e.push(t)})),e}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(24);e.a=function(t,e){if(!e)return{0:t};if(!Object(i.a)(e)){var n=Object(r.a)(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return Object(o.a)(t,e)}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3),a=Object.prototype.hasOwnProperty;e.a=function(t,e){if(!e||!Object(i.a)(t))return{};var n,s={},u=Object(o.a)(e)?e:function(t){return t[e]};return Object(r.a)(t,(function(t){n=u(t),a.call(s,n)?s[n].push(t):s[n]=[t]})),s}},function(t,e,n){"use strict";e.a=function(t,e){return t.hasOwnProperty(e)}},function(t,e,n){"use strict";var r=n(2),i=n(3),o=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Object(r.a)(t,(function(n,r){Object(i.a)(t)&&"prototype"===r||e.push(n)})),e};e.a=o},function(t,e,n){"use strict";var r={}.toString;e.a=function(t){return r.call(t).replace(/^\[object /,"").replace(/]$/,"")}},function(t,e,n){"use strict";var r=Object.prototype;e.a=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,n){"use strict";var r=n(15),i=n(1),o=n(8);e.a=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Object(o.a)(e)||Object(o.a)(n))return!1;if(Object(i.a)(e)||Object(i.a)(n)){if(e.length!==n.length)return!1;for(var a=!0,s=0;s<e.length&&(a=t(e[s],n[s]));s++);return a}if(Object(r.a)(e)||Object(r.a)(n)){var u=Object.keys(e),c=Object.keys(n);if(u.length!==c.length)return!1;for(a=!0,s=0;s<u.length&&(a=t(e[u[s]],n[u[s]]));s++);return a}return!1}},function(t,e,n){var r=n(18);t.exports=function(t,e){for(var n=r(t.data,e,!0),i=r(t.data,e,!0),o=t.children.length,a=Math.round(o/2),s=e.getSide||function(t,e){return e<a?"right":"left"},u=0;u<o;u++){var c=t.children[u];"right"===s(c,u)?i.children.push(c):n.children.push(c)}return n.eachNode((function(t){t.isRoot()||(t.side="left")})),i.eachNode((function(t){t.isRoot()||(t.side="right")})),{left:n,right:i}}},function(t,e,n){var r={compactBox:n(32),dendrogram:n(114),indented:n(116),mindmap:n(118)};t.exports=r},function(t,e,n){var r=n(11),i=n(113),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12);n.d(e,"contains",(function(){return r.a})),n.d(e,"includes",(function(){return r.a}));var i=n(34);n.d(e,"difference",(function(){return i.a}));var o=n(35);n.d(e,"find",(function(){return o.a}));var a=n(36);n.d(e,"findIndex",(function(){return a.a}));var s=n(37);n.d(e,"firstValue",(function(){return s.a}));var u=n(38);n.d(e,"flatten",(function(){return u.a}));var c=n(39);n.d(e,"flattenDeep",(function(){return c.a}));var f=n(40);n.d(e,"getRange",(function(){return f.a}));var l=n(41);n.d(e,"pull",(function(){return l.a}));var h=n(21);n.d(e,"pullAt",(function(){return h.a}));var d=n(42);n.d(e,"reduce",(function(){return d.a}));var p=n(43);n.d(e,"remove",(function(){return p.a}));var g=n(44);n.d(e,"sortBy",(function(){return g.a}));var v=n(45);n.d(e,"union",(function(){return v.a}));var m=n(22);n.d(e,"uniq",(function(){return m.a}));var y=n(46);n.d(e,"valuesOfKey",(function(){return y.a}));var b=n(47);n.d(e,"head",(function(){return b.a}));var x=n(48);n.d(e,"last",(function(){return x.a}));var w=n(49);n.d(e,"startsWith",(function(){return w.a}));var _=n(50);n.d(e,"endsWith",(function(){return _.a}));var E=n(14);n.d(e,"filter",(function(){return E.a}));var S=n(51);n.d(e,"every",(function(){return S.a}));var M=n(52);n.d(e,"some",(function(){return M.a}));var O=n(53);n.d(e,"group",(function(){return O.a}));var A=n(24);n.d(e,"groupBy",(function(){return A.a}));var k=n(23);n.d(e,"groupToMap",(function(){return k.a}));var T=n(54);n.d(e,"getWrapBehavior",(function(){return T.a}));var I=n(55);n.d(e,"wrapBehavior",(function(){return I.a}));var C=n(56);n.d(e,"number2color",(function(){return C.a}));var P=n(57);n.d(e,"parseRadius",(function(){return P.a}));var D=n(58);n.d(e,"clamp",(function(){return D.a}));var N=n(59);n.d(e,"fixedBase",(function(){return N.a}));var R=n(60);n.d(e,"isDecimal",(function(){return R.a}));var j=n(61);n.d(e,"isEven",(function(){return j.a}));var B=n(62);n.d(e,"isInteger",(function(){return B.a}));var L=n(63);n.d(e,"isNegative",(function(){return L.a}));var G=n(64);n.d(e,"isNumberEqual",(function(){return G.a}));var F=n(65);n.d(e,"isOdd",(function(){return F.a}));var U=n(66);n.d(e,"isPositive",(function(){return U.a}));var z=n(67);n.d(e,"maxBy",(function(){return z.a}));var W=n(68);n.d(e,"minBy",(function(){return W.a}));var V=n(69);n.d(e,"mod",(function(){return V.a}));var X=n(70);n.d(e,"toDegree",(function(){return X.a}));var Y=n(71);n.d(e,"toInteger",(function(){return Y.a}));var H=n(72);n.d(e,"toRadian",(function(){return H.a}));var q=n(73);n.d(e,"forIn",(function(){return q.a}));var Q=n(25);n.d(e,"has",(function(){return Q.a}));var Z=n(74);n.d(e,"hasKey",(function(){return Z.a}));var K=n(75);n.d(e,"hasValue",(function(){return K.a}));var $=n(20);n.d(e,"keys",(function(){return $.a}));var J=n(19);n.d(e,"isMatch",(function(){return J.a}));var tt=n(26);n.d(e,"values",(function(){return tt.a}));var et=n(76);n.d(e,"lowerCase",(function(){return et.a}));var nt=n(77);n.d(e,"lowerFirst",(function(){return nt.a}));var rt=n(78);n.d(e,"substitute",(function(){return rt.a}));var it=n(79);n.d(e,"upperCase",(function(){return it.a}));var ot=n(80);n.d(e,"upperFirst",(function(){return ot.a}));var at=n(27);n.d(e,"getType",(function(){return at.a}));var st=n(81);n.d(e,"isArguments",(function(){return st.a}));var ut=n(0);n.d(e,"isArray",(function(){return ut.a}));var ct=n(1);n.d(e,"isArrayLike",(function(){return ct.a}));var ft=n(82);n.d(e,"isBoolean",(function(){return ft.a}));var lt=n(83);n.d(e,"isDate",(function(){return lt.a}));var ht=n(84);n.d(e,"isError",(function(){return ht.a}));var dt=n(3);n.d(e,"isFunction",(function(){return dt.a}));var pt=n(85);n.d(e,"isFinite",(function(){return pt.a}));var gt=n(6);n.d(e,"isNil",(function(){return gt.a}));var vt=n(86);n.d(e,"isNull",(function(){return vt.a}));var mt=n(5);n.d(e,"isNumber",(function(){return mt.a}));var yt=n(13);n.d(e,"isObject",(function(){return yt.a}));var bt=n(15);n.d(e,"isObjectLike",(function(){return bt.a}));var xt=n(9);n.d(e,"isPlainObject",(function(){return xt.a}));var wt=n(28);n.d(e,"isPrototype",(function(){return wt.a}));var _t=n(87);n.d(e,"isRegExp",(function(){return _t.a}));var Et=n(8);n.d(e,"isString",(function(){return Et.a}));var St=n(4);n.d(e,"isType",(function(){return St.a}));var Mt=n(88);n.d(e,"isUndefined",(function(){return Mt.a}));var Ot=n(89);n.d(e,"isElement",(function(){return Ot.a}));var At=n(90);n.d(e,"requestAnimationFrame",(function(){return At.a}));var kt=n(91);n.d(e,"clearAnimationFrame",(function(){return kt.a}));var Tt=n(92);n.d(e,"augment",(function(){return Tt.a}));var It=n(93);n.d(e,"clone",(function(){return It.a}));var Ct=n(94);n.d(e,"debounce",(function(){return Ct.a}));var Pt=n(95);n.d(e,"memoize",(function(){return Pt.a}));var Dt=n(96);n.d(e,"deepMix",(function(){return Dt.a}));var Nt=n(2);n.d(e,"each",(function(){return Nt.a}));var Rt=n(97);n.d(e,"extend",(function(){return Rt.a}));var jt=n(98);n.d(e,"indexOf",(function(){return jt.a}));var Bt=n(99);n.d(e,"isEmpty",(function(){return Bt.a}));var Lt=n(29);n.d(e,"isEqual",(function(){return Lt.a}));var Gt=n(100);n.d(e,"isEqualWith",(function(){return Gt.a}));var Ft=n(101);n.d(e,"map",(function(){return Ft.a}));var Ut=n(102);n.d(e,"mapValues",(function(){return Ut.a}));var zt=n(16);n.d(e,"mix",(function(){return zt.a})),n.d(e,"assign",(function(){return zt.a}));var Wt=n(103);n.d(e,"get",(function(){return Wt.a}));var Vt=n(104);n.d(e,"set",(function(){return Vt.a}));var Xt=n(105);n.d(e,"pick",(function(){return Xt.a}));var Yt=n(106);n.d(e,"throttle",(function(){return Yt.a}));var Ht=n(107);n.d(e,"toArray",(function(){return Ht.a}));var qt=n(10);n.d(e,"toString",(function(){return qt.a}));var Qt=n(108);n.d(e,"uniqueId",(function(){return Qt.a}));var Zt=n(109);n.d(e,"noop",(function(){return Zt.a}));var Kt=n(110);n.d(e,"identity",(function(){return Kt.a}));var $t=n(111);n.d(e,"size",(function(){return $t.a}));var Jt=n(112);n.d(e,"Cache",(function(){return Jt.a}))},function(t,e,n){"use strict";var r=n(14),i=n(12);e.a=function(t,e){return void 0===e&&(e=[]),Object(r.a)(t,(function(t){return!Object(i.a)(e,t)}))}},function(t,e,n){"use strict";var r=n(3),i=n(19),o=n(0),a=n(9);e.a=function(t,e){if(!Object(o.a)(t))return null;var n;if(Object(r.a)(e)&&(n=e),Object(a.a)(e)&&(n=function(t){return Object(i.a)(t,e)}),n)for(var s=0;s<t.length;s+=1)if(n(t[s]))return t[s];return null}},function(t,e,n){"use strict";e.a=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1}},function(t,e,n){"use strict";var r=n(6),i=n(0);e.a=function(t,e){for(var n=null,o=0;o<t.length;o++){var a=t[o][e];if(!Object(r.a)(a)){n=Object(i.a)(a)?a[0]:a;break}}return n}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){if(!Object(r.a)(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e}},function(t,e,n){"use strict";var r=n(0);e.a=function t(e,n){if(void 0===n&&(n=[]),Object(r.a)(e))for(var i=0;i<e.length;i+=1)t(e[i],n);else n.push(e);return n}},function(t,e,n){"use strict";var r=n(0),i=n(14);e.a=function(t){if(!(t=Object(i.a)(t,(function(t){return!isNaN(t)}))).length)return{min:0,max:0};if(Object(r.a)(t[0])){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);t=e}var o=Math.max.apply(null,t);return{min:Math.min.apply(null,t),max:o}}},function(t,e,n){"use strict";var r=Array.prototype,i=r.splice,o=r.indexOf;e.a=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var a=e[r],s=-1;(s=o.call(t,a))>-1;)i.call(t,s,1);return t}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(9);e.a=function(t,e,n){if(!Object(i.a)(t)&&!Object(o.a)(t))return t;var a=n;return Object(r.a)(t,(function(t,n){a=e(a,t,n)})),a}},function(t,e,n){"use strict";var r=n(1),i=n(21);e.a=function(t,e){var n=[];if(!Object(r.a)(t))return n;for(var o=-1,a=[],s=t.length;++o<s;){var u=t[o];e(u,o,t)&&(n.push(u),a.push(o))}return Object(i.a)(t,a),n}},function(t,e,n){"use strict";var r=n(0),i=n(8),o=n(3);e.a=function(t,e){var n;if(Object(o.a)(e))n=function(t,n){return e(t)-e(n)};else{var a=[];Object(i.a)(e)?a.push(e):Object(r.a)(e)&&(a=e),n=function(t,e){for(var n=0;n<a.length;n+=1){var r=a[n];if(t[r]>e[r])return 1;if(t[r]<e[r])return-1}return 0}}return t.sort(n),t}},function(t,e,n){"use strict";var r=n(22);e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(r.a)([].concat.apply([],t))}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(6);e.a=function(t,e){var n=[],a={};return t.forEach((function(t){var s=t[e];Object(o.a)(s)||(Object(i.a)(s)||(s=[s]),Object(r.a)(s,(function(t){a[t]||(n.push(t),a[t]=!0)})))})),n}},function(t,e,n){"use strict";e.a=function(t){if(Object(r.a)(t))return t[0]};var r=n(1)},function(t,e,n){"use strict";e.a=function(t){if(Object(r.a)(t))return t[t.length-1]};var r=n(1)},function(t,e,n){"use strict";var r=n(0),i=n(8);e.a=function(t,e){return!(!Object(r.a)(t)&&!Object(i.a)(t))&&t[0]===e}},function(t,e,n){"use strict";var r=n(0),i=n(8);e.a=function(t,e){return!(!Object(r.a)(t)&&!Object(i.a)(t))&&t[t.length-1]===e}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0}},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1}},function(t,e,n){"use strict";var r=n(23);e.a=function(t,e){if(!e)return[t];var n=Object(r.a)(t,e),i=[];for(var o in n)i.push(n[o]);return i}},function(t,e,n){"use strict";e.a=function(t,e){return t["_wrap_"+e]}},function(t,e,n){"use strict";e.a=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n}},function(t,e,n){"use strict";var r={};e.a=function(t){var e=r[t];if(!e){for(var n=t.toString(16),i=n.length;i<6;i++)n="0"+n;e="#"+n,r[t]=e}return e}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){var e=0,n=0,i=0,o=0;return Object(r.a)(t)?1===t.length?e=n=i=o=t[0]:2===t.length?(e=i=t[0],n=o=t[1]):3===t.length?(e=t[0],n=o=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],o=t[3]):e=n=i=o=t,{r1:e,r2:n,r3:i,r4:o}}},function(t,e,n){"use strict";e.a=function(t,e,n){return t<e?e:t>n?n:t}},function(t,e,n){"use strict";e.a=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%1!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2==0}},function(t,e,n){"use strict";var r=n(5),i=Number.isInteger?Number.isInteger:function(t){return Object(r.a)(t)&&t%1==0};e.a=i},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t<0}},function(t,e,n){"use strict";e.a=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t%2!=0}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&t>0}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])>n&&(s=t,n=a)})),s}}},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(3);e.a=function(t,e){if(Object(i.a)(t)){var n,a,s=t[0];return n=Object(o.a)(e)?e(t[0]):t[0][e],Object(r.a)(t,(function(t){(a=Object(o.a)(e)?e(t):t[e])<n&&(s=t,n=a)})),s}}},function(t,e,n){"use strict";e.a=function(t,e){return(t%e+e)%e}},function(t,e,n){"use strict";var r=180/Math.PI;e.a=function(t){return r*t}},function(t,e,n){"use strict";e.a=parseInt},function(t,e,n){"use strict";var r=Math.PI/180;e.a=function(t){return r*t}},function(t,e,n){"use strict";var r=n(2);e.a=r.a},function(t,e,n){"use strict";var r=n(25);e.a=r.a},function(t,e,n){"use strict";var r=n(12),i=n(26);e.a=function(t,e){return Object(r.a)(Object(i.a)(t),e)}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){return Object(r.a)(t).toLowerCase()}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){var e=Object(r.a)(t);return e.charAt(0).toLowerCase()+e.substring(1)}},function(t,e,n){"use strict";e.a=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){return Object(r.a)(t).toUpperCase()}},function(t,e,n){"use strict";var r=n(10);e.a=function(t){var e=Object(r.a)(t);return e.charAt(0).toUpperCase()+e.substring(1)}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Arguments")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Boolean")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Date")}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"Error")}},function(t,e,n){"use strict";var r=n(5);e.a=function(t){return Object(r.a)(t)&&isFinite(t)}},function(t,e,n){"use strict";e.a=function(t){return null===t}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){return Object(r.a)(t,"RegExp")}},function(t,e,n){"use strict";e.a=function(t){return void 0===t}},function(t,e,n){"use strict";e.a=function(t){return t instanceof Element||t instanceof HTMLDocument}},function(t,e,n){"use strict";e.a=function(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}},function(t,e,n){"use strict";e.a=function(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}},function(t,e,n){"use strict";var r=n(16),i=n(3);e.a=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],o=1;o<t.length;o++){var a=t[o];Object(i.a)(a)&&(a=a.prototype),Object(r.a)(n.prototype,a)}}},function(t,e,n){"use strict";var r=n(0);e.a=function t(e){if("object"!==a(e)||null===e)return e;var n;if(Object(r.a)(e)){n=[];for(var i=0,o=e.length;i<o;i++)"object"===a(e[i])&&null!=e[i]?n[i]=t(e[i]):n[i]=e[i]}else for(var s in n={},e)"object"===a(e[s])&&null!=e[s]?n[s]=t(e[s]):n[s]=e[s];return n}},function(t,e,n){"use strict";e.a=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}},function(t,e,n){"use strict";var r=n(3);e.a=function(t,e){if(!Object(r.a)(t))throw new TypeError("Expected a function");var n=function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n}},function(t,e,n){"use strict";var r=n(0),i=n(9);function o(t,e,n,a){for(var s in n=n||0,a=a||5,e)if(e.hasOwnProperty(s)){var u=e[s];null!==u&&Object(i.a)(u)?(Object(i.a)(t[s])||(t[s]={}),n<a?o(t[s],u,n+1,a):t[s]=e[s]):Object(r.a)(u)?(t[s]=[],t[s]=t[s].concat(u)):void 0!==u&&(t[s]=u)}}e.a=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)o(t,e[r]);return t}},function(t,e,n){"use strict";var r=n(16),i=n(3);e.a=function(t,e,n,o){Object(i.a)(e)||(n=e,e=t,t=function(){});var a=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},s=a(e.prototype,t);return t.prototype=Object(r.a)(s,t.prototype),t.superclass=a(e.prototype,e),Object(r.a)(s,n),Object(r.a)(t,o),t}},function(t,e,n){"use strict";var r=n(1);e.a=function(t,e){if(!Object(r.a)(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i}},function(t,e,n){"use strict";var r=n(6),i=n(1),o=n(27),a=n(28),s=Object.prototype.hasOwnProperty;e.a=function(t){if(Object(r.a)(t))return!0;if(Object(i.a)(t))return!t.length;var e=Object(o.a)(t);if("Map"===e||"Set"===e)return!t.size;if(Object(a.a)(t))return!Object.keys(t).length;for(var n in t)if(s.call(t,n))return!1;return!0}},function(t,e,n){"use strict";var r=n(3),i=n(29);e.a=function(t,e,n){return Object(r.a)(n)?!!n(t,e):Object(i.a)(t,e)}},function(t,e,n){"use strict";var r=n(2),i=n(1);e.a=function(t,e){if(!Object(i.a)(t))return t;var n=[];return Object(r.a)(t,(function(t,r){n.push(e(t,r))})),n}},function(t,e,n){"use strict";var r=n(6),i=n(13),o=function(t){return t};e.a=function(t,e){void 0===e&&(e=o);var n={};return Object(i.a)(t)&&!Object(r.a)(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}},function(t,e,n){"use strict";var r=n(8);e.a=function(t,e,n){for(var i=0,o=Object(r.a)(e)?e.split("."):e;t&&i<o.length;)t=t[o[i++]];return void 0===t||i<o.length?n:t}},function(t,e,n){"use strict";var r=n(13),i=n(8),o=n(5);e.a=function(t,e,n){var a=t,s=Object(i.a)(e)?e.split("."):e;return s.forEach((function(t,e){e<s.length-1?(Object(r.a)(a[t])||(a[t]=Object(o.a)(s[e+1])?[]:{}),a=a[t]):a[t]=n})),t}},function(t,e,n){"use strict";var r=n(2),i=n(9),o=Object.prototype.hasOwnProperty;e.a=function(t,e){if(null===t||!Object(i.a)(t))return{};var n={};return Object(r.a)(e,(function(e){o.call(t,e)&&(n[e]=t[e])})),n}},function(t,e,n){"use strict";e.a=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();s||!1!==n.leading||(s=c);var f=e-(c-s);return i=this,o=arguments,f<=0||f>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}},function(t,e,n){"use strict";var r=n(1);e.a=function(t){return Object(r.a)(t)?Array.prototype.slice.call(t):[]}},function(t,e,n){"use strict";var r={};e.a=function(t){return r[t=t||"g"]?r[t]+=1:r[t]=1,t+r[t]}},function(t,e,n){"use strict";e.a=function(){}},function(t,e,n){"use strict";e.a=function(t){return t}},function(t,e,n){"use strict";e.a=function(t){return Object(r.a)(t)?0:Object(i.a)(t)?t.length:Object.keys(t).length};var r=n(6),i=n(1)},function(t,e,n){"use strict";var r=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},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}();e.a=r},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){var n=function t(e,n){var r=n?e.y:e.x;return e.children.forEach((function(e){r=Math.min(t(e,n),r)})),r}(t,e);!function t(e,n,r){r?e.y+=n:e.x+=n,e.children.forEach((function(e){t(e,n,r)}))}(t,-n,e)}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var i=e.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){f(r)>n.low&&(n=n.nxt);var l=i+r.prelim+r.w-(a+o.prelim);l>0&&(a+=l,s(t,e,n.index,l));var h=f(r),d=f(o);h<=d&&null!==(r=c(r))&&(i+=r.mod),h>=d&&null!==(o=u(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function s(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function u(t){return 0===t.cs?t.tl:t.c[0]}function c(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function f(t){return t.y+t.h}function l(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}!function t(e,n,r){void 0===r&&(r=0),n?(e.x=r,r+=e.width):(e.y=r,r+=e.height),e.children.forEach((function(e){t(e,n,r)}))}(t,i);var h=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=l(f(e.c[0].el),0,null),r=1;r<e.cs;++r){t(e.c[r]);var i=f(e.c[r].er);a(e,r,n),n=l(i,r,n)}!function(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}(e),o(e)}else o(e)}(h),function t(e,n){n+=e.mod,e.x=e.prelim+n,function(t){for(var e=0,n=0,r=0;r<t.cs;r++)e+=t.c[r].shift,n+=e+t.c[r].change,t.c[r].mod+=n}(e);for(var r=0;r<e.cs;r++)t(e.c[r],n)}(h,0),function t(e,n,r){r?n.y=e.x:n.x=e.x,e.c.forEach((function(e,i){t(e,n.children[i],r)}))}(h,t,i),r(t,i),t}},function(t,e,n){var r=n(11),i=n(115),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return this.rootNode.width=0,o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){var r=n(7);function i(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var n=this;n.x=n.y=0,n.leftChild=n.rightChild=null,n.height=0,n.children=e}var o={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},o,e);var n,a=0,s=function t(e){if(!e)return null;e.width=0,e.depth&&e.depth>a&&(a=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=a;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(s),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(s),function t(e,n,r){r?(n.x=e.x,n.y=e.y):(n.x=e.y,n.y=e.x),e.children.forEach((function(e,i){t(e,n.children[i],r)}))}(s,t,e.isHorizontal),t}},function(t,e,n){var r=n(11),i=n(117),o=n(30),a=n(7),s=["LR","RL","H"],u=s[0],c=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,a=t.dropCap,c=void 0===a||a,f=t.direction||u;if(f&&-1===s.indexOf(f))throw new TypeError("Invalid direction: "+f);if(f===s[0])i(e,r,c);else if(f===s[1])i(e,r,c),e.right2left();else if(f===s[2]){var l=o(e,t),h=l.left,d=l.right;i(h,r,c),h.right2left(),i(d,r,c);var p=h.getBoundingBox();d.translate(p.width,0),e.x=d.x-e.width/2}return e},r}(r),f={};t.exports=function(t,e){return e=a.assign({},f,e),new c(t,e).execute()}},function(t,e){t.exports=function(t,e,n){var r=null;t.eachNode((function(t){!function(t,e,n,r){if(!r)try{if(t.id===t.parent.children[0].id)return t.x+=n*t.depth,void(t.y=e?e.y:0)}catch(t){}t.x+=n*t.depth,t.y=e?e.y+e.height:0}(t,r,e,n),r=t}))}},function(t,e,n){var r=n(11),i=n(119),o=n(17),a=n(7),s=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.execute=function(){return o(this.rootNode,this.options,i)},r}(r),u={};t.exports=function(t,e){return e=a.assign({},u,e),new s(t,e).execute()}},function(t,e,n){var r=n(7),i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,function t(e,n){var r=0;return e.children.length?e.children.forEach((function(e){r+=t(e,n)})):r=e.height,e._subTreeSep=n.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,r)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;i<n;i++){var o=e[i];o.startY=e[i-1].startY+e[i-1].totalHeight,o.y=o.startY+o.totalHeight/2-o.height/2}}}})),function t(e){var n=e.children,r=n.length;if(r){n.forEach((function(e){t(e)}));var i=n[0],o=n[r-1],a=o.y-i.y+o.height,s=0;if(n.forEach((function(t){s+=t.totalHeight})),a>e.height)e.y=i.y+a/2-e.height/2;else if(1!==n.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;n.forEach((function(t){t.translate(0,u)}))}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}}])},"object"===a(e)&&"object"===a(t)?t.exports=o():(r=[],void 0===(i="function"==typeof(n=o)?n.apply(e,r):n)||(t.exports=i))}).call(this,n(83)(t))},function(t,e){},function(t,e){},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e},e}(n(117).a);e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(118),o=n(43),a=function(t){function e(e){return t.call(this,e)||this}return Object(r.c)(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var s=Object(o.c)(e,[t.minX,t.minY]),u=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),f=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(s[0],u[0],c[0],f[0]),i=Math.max(s[0],u[0],c[0],f[0]),r=Math.min(s[1],u[1],c[1],f[1]),a=Math.max(s[1],u[1],c[1],f[1])}var l=this.attrs;if(l.shadowColor){var h=l.shadowBlur,d=void 0===h?0:h,p=l.shadowOffsetX,g=void 0===p?0:p,v=l.shadowOffsetY,m=void 0===v?0:v,y=n-d+g,b=i+d+g,x=r-d+m,w=a+d+m;n=Math.min(n,y),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(i.a);e.a=a},function(t,e,n){var r=n(289),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),f=c-Math.min(a,s,u),l=function(t){return(c-t)/6/f+.5};return 0===f?i=o=0:(o=f/c,e=l(a),n=l(s),r=l(u),a===c?i=r-n:s===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],f=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));f<s&&(s=f,n=u)}return n},a.keyword.rgb=function(t){return r[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,f=t[2]/100,l=c+f;switch(l>1&&(c/=l,f/=l),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-f)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.snapLength=e.nearestPoint=void 0;var r=n(45);e.nearestPoint=function(t,e,n,i,o,a){var s,u=1/0,c=[n,i],f=20;a&&a>200&&(f=a/10);for(var l=1/f,h=l/10,d=0;d<=f;d++){var p=d*l,g=[o.apply(null,t.concat([p])),o.apply(null,e.concat([p]))];(b=r.distance(c[0],c[1],g[0],g[1]))<u&&(s=p,u=b)}if(0===s)return{x:t[0],y:e[0]};if(1===s){var v=t.length;return{x:t[v-1],y:e[v-1]}}for(u=1/0,d=0;d<32&&!(h<1e-4);d++){var m=s-h,y=s+h,b=(g=[o.apply(null,t.concat([m])),o.apply(null,e.concat([m]))],r.distance(c[0],c[1],g[0],g[1]));if(m>=0&&b<u)s=m,u=b;else{var x=[o.apply(null,t.concat([y])),o.apply(null,e.concat([y]))],w=r.distance(c[0],c[1],x[0],x[1]);y<=1&&w<u?(s=y,u=w):h*=.5}}return{x:o.apply(null,t.concat([s])),y:o.apply(null,e.concat([s]))}},e.snapLength=function(t,e){for(var n=0,i=t.length,o=0;o<i;o++){var a=t[o],s=e[o],u=t[(o+1)%i],c=e[(o+1)%i];n+=r.distance(a,s,u,c)}return n/2}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86),i=n(87);function o(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function a(t,e){return o(t)*o(e)?(t[0]*e[0]+t[1]*e[1])/(o(t)*o(e)):1}function s(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(a(t,e))}function u(t,e){return t[0]===e[0]&&t[1]===e[1]}e.isSamePoint=u,e.default=function(t,e){var n=e[1],o=e[2],c=r.default(i.default(e[3]),2*Math.PI),f=e[4],l=e[5],h=t[0],d=t[1],p=e[6],g=e[7],v=Math.cos(c)*(h-p)/2+Math.sin(c)*(d-g)/2,m=-1*Math.sin(c)*(h-p)/2+Math.cos(c)*(d-g)/2,y=v*v/(n*n)+m*m/(o*o);y>1&&(n*=Math.sqrt(y),o*=Math.sqrt(y));var b=n*n*(m*m)+o*o*(v*v),x=b?Math.sqrt((n*n*(o*o)-b)/b):1;f===l&&(x*=-1),isNaN(x)&&(x=0);var w=o?x*n*m/o:0,_=n?x*-o*v/n:0,E=(h+p)/2+Math.cos(c)*w-Math.sin(c)*_,S=(d+g)/2+Math.sin(c)*w+Math.cos(c)*_,M=[(v-w)/n,(m-_)/o],O=[(-1*v-w)/n,(-1*m-_)/o],A=s([1,0],M),k=s(M,O);return a(M,O)<=-1&&(k=Math.PI),a(M,O)>=1&&(k=0),0===l&&k>0&&(k-=2*Math.PI),1===l&&k<0&&(k+=2*Math.PI),{cx:E,cy:S,rx:u(t,[p,g])?0:n,ry:u(t,[p,g])?0:o,startAngle:A,endAngle:A+k,xRotation:c,arcFlag:f,sweepFlag:l}}},function(t,e,n){"use strict";n(93)},function(t,e,n){"use strict";n(94)},function(t,e,n){"use strict";n(93)},function(t,e,n){"use strict";n(94)},function(t,e,n){var r=n(95),i=n(136),o=n(100),a=n(340),s=n(346),u=n(190),c=n(191),f=n(349),l=n(350),h=n(195),d=n(351),p=n(72),g=n(355),v=n(356),m=n(200),y=n(20),b=n(71),x=n(360),w=n(36),_=n(362),E=n(56),S=n(63),M={};M["[object Arguments]"]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M["[object Object]"]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M["[object Function]"]=M["[object WeakMap]"]=!1,t.exports=function t(e,n,O,A,k,T){var I,C=1&n,P=2&n,D=4&n;if(O&&(I=k?O(e,A,k,T):O(e)),void 0!==I)return I;if(!w(e))return e;var N=y(e);if(N){if(I=g(e),!C)return c(e,I)}else{var R=p(e),j="[object Function]"==R||"[object GeneratorFunction]"==R;if(b(e))return u(e,C);if("[object Object]"==R||"[object Arguments]"==R||j&&!k){if(I=P||j?{}:m(e),!C)return P?l(e,s(I,e)):f(e,a(I,e))}else{if(!M[R])return k?e:{};I=v(e,R,C)}}T||(T=new r);var B=T.get(e);if(B)return B;T.set(e,I),_(e)?e.forEach((function(r){I.add(t(r,n,O,r,e,T))})):x(e)&&e.forEach((function(r,i){I.set(i,t(r,n,O,i,e,T))}));var L=N?void 0:(D?P?d:h:P?S:E)(e);return i(L||e,(function(r,i){L&&(r=e[i=r]),o(I,i,t(r,n,O,i,e,T))})),I}},function(t,e,n){(function(e){function n(t){return(n="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)}var r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(this,n(185))},function(t,e){function n(t){return(n="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)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(62),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(341),i=n(82),o=n(20),a=n(71),s=n(102),u=n(38),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&u(t),d=n||f||l||h,p=d?r(t.length,String):[],g=p.length;for(var v in t)!e&&!c.call(t,v)||d&&("length"==v||l&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||p.push(v);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){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)}var i=n(40),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o?i.Buffer:void 0,u=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(83)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(141),i=n(105),o=n(140),a=n(193),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=s},function(t,e,n){var r=n(196),i=n(140),o=n(56);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(141),i=n(20);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e,n){var r=n(62)(n(40),"Set");t.exports=r},function(t,e,n){var r=n(40).Uint8Array;t.exports=r},function(t,e,n){var r=n(142);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(201),i=n(105),o=n(104);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},function(t,e,n){var r=n(36),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},function(t,e,n){t.exports=n(203)},function(t,e,n){var r=n(136),i=n(106),o=n(204),a=n(20);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},function(t,e,n){var r=n(64);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e,n){var r=n(192),i=n(366),o=n(50),a=n(20);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},function(t,e,n){var r=n(369),i=n(41);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},function(t,e,n){var r=n(208),i=n(372),o=n(209);t.exports=function(t,e,n,a,s,u){var c=1&n,f=t.length,l=e.length;if(f!=l&&!(c&&l>f))return!1;var h=u.get(t),d=u.get(e);if(h&&d)return h==e&&d==t;var p=-1,g=!0,v=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p<f;){var m=t[p],y=e[p];if(a)var b=c?a(y,m,p,e,t,u):a(m,y,p,t,e,u);if(void 0!==b){if(b)continue;g=!1;break}if(v){if(!i(e,(function(t,e){if(!o(v,e)&&(m===t||s(m,t,n,a,u)))return v.push(e)}))){g=!1;break}}else if(m!==y&&!s(m,y,n,a,u)){g=!1;break}}return u.delete(t),u.delete(e),g}},function(t,e,n){var r=n(135),i=n(370),o=n(371);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(36);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(382);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(383),i=n(214);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e,n){var r=n(108),i=n(82),o=n(20),a=n(102),s=n(137),u=n(84);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=u(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&s(f)&&a(h,f)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(386),i=n(214);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t){return void 0===t}},function(t,e,n){var r=n(109),i=n(50),o=n(219),a=n(20);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},function(t,e,n){var r=n(106),i=n(49);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(388),i=n(106),o=n(50),a=n(389),s=n(20);t.exports=function(t,e,n){var u=s(t)?r:a,c=arguments.length<3;return u(t,o(e,4),n,c,i)}},function(t,e,n){var r=n(399),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),u=Array(s);++a<s;)u[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(u),r(t,this,c)}}},function(t,e,n){var r=n(400),i=n(401)(r);t.exports=i},function(t,e,n){var r=n(208),i=n(402),o=n(406),a=n(209),s=n(407),u=n(146);t.exports=function(t,e,n){var c=-1,f=i,l=t.length,h=!0,d=[],p=d;if(n)h=!1,f=o;else if(l>=200){var g=e?null:s(t);if(g)return u(g);h=!1,f=a,p=new r}else p=e?[]:d;t:for(;++c<l;){var v=t[c],m=e?e(v):v;if(v=n||0!==v?v:0,h&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue t;e&&p.push(m),d.push(v)}else f(p,m,n)||(p!==d&&p.push(m),d.push(v))}return d}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(49),i=n(41);t.exports=function(t){return i(t)&&r(t)}},function(t,e,n){var r=n(409),i=n(56);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(35),i=n(228);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,s={},u=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=s[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,u.decrease(e,c))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;s[t]={distance:n},u.add(t,n)}));for(;u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(35);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},function(t,e,n){var r=n(35);t.exports=function(t){var e=0,n=[],i={},o=[];return t.nodes().forEach((function(a){r.has(i,a)||function a(s){var u=i[s]={onStack:!0,lowlink:e,index:e++};if(n.push(s),t.successors(s).forEach((function(t){r.has(i,t)?i[t].onStack&&(u.lowlink=Math.min(u.lowlink,i[t].index)):(a(t),u.lowlink=Math.min(u.lowlink,i[t].lowlink))})),u.lowlink===u.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(s!==c);o.push(f)}}(a)})),o}},function(t,e,n){var r=n(35);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(e,s)||(n[s]=!0,e[s]=!0,r.each(t.predecessors(s),a),delete n[s],i.push(s))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=new Error},function(t,e,n){var r=n(35);t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],a={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,n,i,o,a,s){r.has(o,n)||(o[n]=!0,i||s.push(n),r.each(a(n),(function(n){t(e,n,i,o,a,s)})),i&&s.push(n))}(t,e,"post"===n,a,i,o)})),o}},function(t,e,n){var r=n(428);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(148);t.exports=function(t){return(null==t?0:t.length)?r(t,1):[]}},function(t,e,n){var r=n(101),i=n(69);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e){t.exports=function(t,e){return t<e}},function(t,e,n){"use strict";var r=n(18),i=n(39).Graph,o=n(112).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function s(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function u(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports=function(t){var e,n,r=new i({directed:!1}),c=t.nodes()[0],f=t.nodeCount();r.setNode(c,{});for(;a(r,t)<f;)e=s(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),u(r,t,n);return r}},function(t,e,n){(function(t,e){function n(t){return(n="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)}
|
||
/*! *****************************************************************************
|
||
Copyright (C) Microsoft. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var r;!function(r){!function(i){var o="object"===(void 0===e?"undefined":n(e))?e:"object"===("undefined"==typeof self?"undefined":n(self))?self:"object"===n(this)?this:Function("return this;")(),a=s(r);function s(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===o.Reflect?o.Reflect=r:a=s(o.Reflect,a),function(e){var r=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,o=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,c=!s&&!u,f={create:s?function(){return N(Object.create(null))}:u?function(){return N({__proto__:null})}:function(){return N({})},has:c?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:c?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"===(void 0===t?"undefined":n(t))&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[a]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,i)},e.prototype.entries=function(){return new n(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[a]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function i(t,e){return e}function o(t,e){return[t,e]}}():Map,p=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new d}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[a]=function(){return this.keys()},t}():Set,g=new(h||"function"!=typeof WeakMap?function(){var t=f.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&f.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?f.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+a()}while(f.has(t,e));return t[e]=!0,e}function i(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:f.create()})}return t[e]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function v(t,e,n){var r=g.get(t);if(_(r)){if(!n)return;r=new d,g.set(t,r)}var i=r.get(e);if(_(i)){if(!n)return;i=new d,r.set(e,i)}return i}function m(t,e,n){var r=v(e,n,!1);return!_(r)&&!!r.has(t)}function y(t,e,n){var r=v(e,n,!1);if(!_(r))return r.get(t)}function b(t,e,n,r){v(n,r,!0).set(t,e)}function x(t,e){var n=[],r=v(t,e,!1);if(_(r))return n;for(var i=function(t){var e=I(t,a);if(!k(e))throw new TypeError;var n=e.call(t);if(!S(n))throw new TypeError;return n}(r.keys()),o=0;;){var s=C(i);if(!s)return n.length=o,n;var u=s.value;try{n[o]=u}catch(t){try{P(i)}finally{throw t}}o++}}function w(t){if(null===t)return 1;switch(n(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function _(t){return void 0===t}function E(t){return null===t}function S(t){return"object"===n(t)?null!==t:"function"==typeof t}function M(t,e){switch(w(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=I(t,o);if(void 0!==r){var i=r.call(t,n);if(S(i))throw new TypeError;return i}return function(t,e){if("string"===e){var n=t.toString;if(k(n))if(!S(i=n.call(t)))return i;if(k(r=t.valueOf))if(!S(i=r.call(t)))return i}else{var r;if(k(r=t.valueOf))if(!S(i=r.call(t)))return i;var i,o=t.toString;if(k(o))if(!S(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function O(t){var e=M(t,3);return"symbol"===n(e)?e:function(t){return""+t}(e)}function A(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function T(t){return"function"==typeof t}function I(t,e){var n=t[e];if(null!=n){if(!k(n))throw new TypeError;return n}}function C(t){var e=t.next();return!e.done&&e}function P(t){var e=t.return;e&&e.call(t)}function D(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function N(t){return t.__=void 0,delete t.__,t}e("decorate",(function(t,e,n,r){if(_(n)){if(!A(t))throw new TypeError;if(!T(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!_(r)&&!E(r)){if(!T(r))throw new TypeError;e=r}}return e}(t,e)}if(!A(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(r)&&!_(r)&&!E(r))throw new TypeError;return E(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!_(o)&&!E(o)){if(!S(o))throw new TypeError;r=o}}return r}(t,e,n=O(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!S(n))throw new TypeError;if(!_(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!S(n))throw new TypeError;return _(r)||(r=O(r)),b(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return _(n)||(n=O(n)),function t(e,n,r){if(m(e,n,r))return!0;var i=D(n);return!E(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return _(n)||(n=O(n)),m(t,e,n)})),e("getMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return _(n)||(n=O(n)),function t(e,n,r){if(m(e,n,r))return y(e,n,r);var i=D(n);return E(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return _(n)||(n=O(n)),y(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return _(e)||(e=O(e)),function t(e,n){var r=x(e,n),i=D(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new p,s=[],u=0,c=r;u<c.length;u++){var f=c[u];a.has(f)||(a.add(f),s.push(f))}for(var l=0,h=o;l<h.length;l++){f=h[l];a.has(f)||(a.add(f),s.push(f))}return s}(t,e)})),e("getOwnMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return _(e)||(e=O(e)),x(t,e)})),e("deleteMetadata",(function(t,e,n){if(!S(e))throw new TypeError;_(n)||(n=O(n));var r=v(e,n,!1);if(_(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=g.get(e);return i.delete(n),i.size>0||g.delete(e),!0}))}(a)}()}(r||(r={}))}).call(this,n(171),n(185))},function(t,e,n){var r=n(240);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(26),o=n(42),a=n(57),s=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=s,e.inject=function(t){return function(e,n,s){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var u=new o.Metadata(i.INJECT_TAG,t);"number"==typeof s?a.tagParameter(e,n,s,u):a.tagProperty(e,n,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(65),o=n(42),a=n(492),s=function(){function t(t,e,n,s){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(r.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return t.key!==r.INJECT_TAG&&t.key!==r.MULTI_INJECT_TAG&&t.key!==r.NAME_TAG&&t.key!==r.UNMANAGED_TAG&&t.key!==r.NAMED_TAG}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return t.key!==r.INJECT_TAG&&t.key!==r.MULTI_INJECT_TAG&&t.key!==r.NAME_TAG&&t.key!==r.UNMANAGED_TAG&&t.key!==r.NAMED_TAG})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(150),i=n(151),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42);e.traverseAncerstors=function t(e,n){var r=e.parentRequest;return null!==r&&(!!n(r)||t(r,n))};var o=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=o;var a=o(r.NAMED_TAG);e.namedConstraint=a;e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return A})),n.d(r,"easeQuad",(function(){return I})),n.d(r,"easeQuadIn",(function(){return k})),n.d(r,"easeQuadOut",(function(){return T})),n.d(r,"easeQuadInOut",(function(){return I})),n.d(r,"easeCubic",(function(){return D})),n.d(r,"easeCubicIn",(function(){return C})),n.d(r,"easeCubicOut",(function(){return P})),n.d(r,"easeCubicInOut",(function(){return D})),n.d(r,"easePoly",(function(){return j})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return R})),n.d(r,"easePolyInOut",(function(){return j})),n.d(r,"easeSin",(function(){return U})),n.d(r,"easeSinIn",(function(){return G})),n.d(r,"easeSinOut",(function(){return F})),n.d(r,"easeSinInOut",(function(){return U})),n.d(r,"easeExp",(function(){return X})),n.d(r,"easeExpIn",(function(){return W})),n.d(r,"easeExpOut",(function(){return V})),n.d(r,"easeExpInOut",(function(){return X})),n.d(r,"easeCircle",(function(){return q})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return H})),n.d(r,"easeCircleInOut",(function(){return q})),n.d(r,"easeBounce",(function(){return K})),n.d(r,"easeBounceIn",(function(){return Z})),n.d(r,"easeBounceOut",(function(){return K})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return et})),n.d(r,"easeBackIn",(function(){return J})),n.d(r,"easeBackOut",(function(){return tt})),n.d(r,"easeBackInOut",(function(){return et})),n.d(r,"easeElastic",(function(){return it})),n.d(r,"easeElasticIn",(function(){return rt})),n.d(r,"easeElasticOut",(function(){return it})),n.d(r,"easeElasticInOut",(function(){return ot}));var i=n(1),o=n(119),a=n(117),s=n(16),u=n(0);function c(t){return(c="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)}var f,l,h=0,d=0,p=0,g=0,v=0,m=0,y="object"===("undefined"==typeof performance?"undefined":c(performance))&&performance.now?performance:Date,b="object"===("undefined"==typeof window?"undefined":c(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function x(){return v||(b(w),v=y.now()+m)}function w(){v=0}function _(){this._call=this._time=this._next=null}function E(t,e,n){var r=new _;return r.restart(t,e,n),r}function S(){v=(g=y.now())+m,h=d=0;try{!function(){x(),++h;for(var t,e=f;e;)(t=v-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=f,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:f=e);l=t,O(r)}(),v=0}}function M(){var t=y.now(),e=t-g;e>1e3&&(m-=e,g=t)}function O(t){h||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(S,t-y.now()-m)),p&&(p=clearInterval(p))):(p||(g=y.now(),p=setInterval(M,1e3)),h=1,b(S)))}function A(t){return+t}function k(t){return t*t}function T(t){return t*(2-t)}function I(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function C(t){return t*t*t}function P(t){return--t*t*t+1}function D(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}_.prototype=E.prototype={constructor:_,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||l===this||(l?l._next=this:f=this,l=this),this._call=t,this._time=n,O()},stop:function(){this._call&&(this._call=null,this._time=1/0,O())}};var N=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),R=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),j=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),B=Math.PI,L=B/2;function G(t){return 1==+t?1:1-Math.cos(t*L)}function F(t){return Math.sin(t*L)}function U(t){return(1-Math.cos(B*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function W(t){return z(1-+t)}function V(t){return 1-z(t)}function X(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function q(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Q=7.5625;function Z(t){return 1-K(1-t)}function K(t){return(t=+t)<4/11?Q*t*t:t<8/11?Q*(t-=6/11)*t+3/4:t<10/11?Q*(t-=9/11)*t+15/16:Q*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-K(1-t):K(t-1)+1)/2}var J=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function st(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ct="\\s*([+-]?\\d+)\\s*",ft="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ht=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\("+[ct,ct,ct]+"\\)$"),pt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),gt=new RegExp("^rgba\\("+[ct,ct,ct,ft]+"\\)$"),vt=new RegExp("^rgba\\("+[lt,lt,lt,ft]+"\\)$"),mt=new RegExp("^hsl\\("+[ft,lt,lt]+"\\)$"),yt=new RegExp("^hsla\\("+[ft,lt,lt,ft]+"\\)$"),bt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function wt(){return this.rgb().formatRgb()}function _t(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Et(e):3===n?new At(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?St(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?St(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dt.exec(t))?new At(e[1],e[2],e[3],1):(e=pt.exec(t))?new At(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gt.exec(t))?St(e[1],e[2],e[3],e[4]):(e=vt.exec(t))?St(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mt.exec(t))?Ct(e[1],e[2]/100,e[3]/100,1):(e=yt.exec(t))?Ct(e[1],e[2]/100,e[3]/100,e[4]):bt.hasOwnProperty(t)?Et(bt[t]):"transparent"===t?new At(NaN,NaN,NaN,0):null}function Et(t){return new At(t>>16&255,t>>8&255,255&t,1)}function St(t,e,n,r){return r<=0&&(t=e=n=NaN),new At(t,e,n,r)}function Mt(t){return t instanceof ut||(t=_t(t)),t?new At((t=t.rgb()).r,t.g,t.b,t.opacity):new At}function Ot(t,e,n,r){return 1===arguments.length?Mt(t):new At(t,e,n,null==r?1:r)}function At(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function kt(){return"#"+It(this.r)+It(this.g)+It(this.b)}function Tt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function It(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ct(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Dt(t,e,n,r)}function Pt(t){if(t instanceof Dt)return new Dt(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=_t(t)),!t)return new Dt;if(t instanceof Dt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Dt(a,s,u,t.opacity)}function Dt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Rt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}at(ut,_t,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Pt(this).formatHsl()},formatRgb:wt,toString:wt}),at(At,Ot,st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new At(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new At(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kt,formatHex:kt,formatRgb:Tt,toString:Tt})),at(Dt,(function(t,e,n,r){return 1===arguments.length?Pt(t):new Dt(t,e,n,null==r?1:r)}),st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Dt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Dt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new At(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var jt=function(t){return function(){return t}};function Bt(t,e){return function(n){return t+n*e}}function Lt(t){return 1==(t=+t)?Gt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):jt(isNaN(e)?n:e)}}function Gt(t,e){var n=e-t;return n?Bt(t,n):jt(isNaN(t)?e:t)}var Ft=function t(e){var n=Lt(e);function r(t,e){var r=n((t=Ot(t)).r,(e=Ot(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Gt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ut(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=Ot(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}Ut((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Rt((n-r/e)*e,a,i,o,s)}})),Ut((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Rt((n-r/e)*e,i,o,a,s)}}));var zt=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Wt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vt(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Jt(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Xt=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},Yt=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}};function Ht(t){return(Ht="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)}var qt=function(t,e){var n,r={},i={};for(n in null!==t&&"object"===Ht(t)||(t={}),null!==e&&"object"===Ht(e)||(e={}),e)n in t?r[n]=Jt(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Qt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zt=new RegExp(Qt.source,"g");var Kt=function(t,e){var n,r,i,o=Qt.lastIndex=Zt.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Qt.exec(t))&&(r=Zt.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Yt(n,r)})),o=Zt.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})};function $t(t){return($t="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)}var Jt=function(t,e){var n,r=$t(e);return null==e||"boolean"===r?jt(e):("number"===r?Yt:"string"===r?(n=_t(e))?(e=n,Ft):Kt:e instanceof _t?Ft:e instanceof Date?Xt:Wt(e)?zt:Array.isArray(e)?Vt:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?qt:Yt)(t,e)},te=n(47),ee=[1,0,0,0,1,0,0,0,1];function ne(t,e,n){var i,o=e.startTime;if(n<o+e.delay||e._paused)return!1;var a=e.duration,s=e.easing;if(n=n-o-e.delay,e.repeat)i=n%a/a,i=r[s](i);else{if(!((i=n/a)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;i=r[s](i)}if(e.onFrame){var c=e.onFrame(i);t.attr(c)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,s,c,f;for(var l in o)if(!Object(u.q)(i[l],o[l]))if("path"===l){var h=o[l],d=i[l];h.length>d.length?(h=te.parsePathString(o[l]),d=te.parsePathString(i[l]),d=te.fillPathByDiff(d,h),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h):e.pathFormatted||(h=te.parsePathString(o[l]),d=te.parsePathString(i[l]),d=te.formatPath(d,h),e.fromAttrs.path=d,e.toAttrs.path=h,e.pathFormatted=!0),r[l]=[];for(var p=0;p<h.length;p++){for(var g=h[p],v=d[p],m=[],y=0;y<g.length;y++)Object(u.t)(g[y])&&v&&Object(u.t)(v[y])?(a=Jt(v[y],g[y]),m.push(a(n))):m.push(g[y]);r[l].push(m)}}else if("matrix"===l){var b=(c=i[l]||ee,(Wt(f=o[l]||ee)?zt:Vt)(c,f))(n);r[l]=b}else["fill","stroke","fillStyle","strokeStyle"].includes(l)&&(s=o[l],/^[r,R,L,l]{1}[\s]*\(/.test(s))?r[l]=o[l]:Object(u.r)(o[l])||(a=Jt(i[l],o[l]),r[l]=a(n));t.attr(r)}}(t,e,i);return!1}var re=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=E((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],ne(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ie=n(114),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function se(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(s.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ue=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ie.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,f=a.clientY-t.clientY;u>120||c*c+f*f>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,ae(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||se(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ae(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ce=Object(o.a)(),fe=ce&&"firefox"===ce.name,le=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(s.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new ue({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");s.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");s.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(fe&&!Object(s.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(s.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(a.a);e.a=le},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(13),a=n(67),s=n(30),u=n(17),c=n(76),f=n(75),l=n(0),h=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,p=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function g(t){var e=t.match(p);if(!e)return"";var n="";return e.sort((function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])})),Object(l.f)(e,(function(t){t=t.split(":"),n+='<stop offset="'+t[0]+'" stop-color="'+t[1]+'"></stop>'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(l.F)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=h.exec(t),o=Object(l.A)(Object(l.E)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o<Math.PI?(n={x:1,y:0},r={x:0,y:1}):Math.PI<=o&&o<1.5*Math.PI?(n={x:1,y:1},r={x:0,y:0}):(n={x:0,y:1},r={x:1,y:0});var s=Math.tan(o),u=s*s,c=(r.x-n.x+s*(r.y-n.y))/(u+1)+n.x,f=s*(r.x-n.x+s*(r.y-n.y))/(u+1)+n.y;e.setAttribute("x1",n.x),e.setAttribute("y1",n.y),e.setAttribute("x2",c),e.setAttribute("y2",f),e.innerHTML=g(a)}(t,e=Object(u.b)("linearGradient")):function(t,e){var n=d.exec(t),r=parseFloat(n[1]),i=parseFloat(n[2]),o=parseFloat(n[3]),a=n[4];e.setAttribute("cx",r),e.setAttribute("cy",i),e.setAttribute("r",o),e.innerHTML=g(a)}(t,e=Object(u.b)("radialGradient")),e.setAttribute("id",n),this.el=e,this.id=n,this.cfg=t,this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),m={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},y={x:"-40%",y:"-40%",width:"200%",height:"200%"},b=function(){function t(t){this.type="filter",this.cfg={},this.type="filter";var e=Object(u.b)("filter");return Object(l.f)(y,(function(t,n){e.setAttribute(n,t)})),this.el=e,this.id=Object(l.F)("filter_"),this.el.id=this.id,this.cfg=t,this._parseShadow(t,e),this}return t.prototype.match=function(t,e){if(this.type!==t)return!1;var n=!0,r=this.cfg;return Object(l.f)(Object.keys(r),(function(t){if(r[t]!==e[t])return n=!1,!1})),n},t.prototype.update=function(t,e){var n=this.cfg;return n[m[t]]=e,this._parseShadow(n,this.el),this},t.prototype._parseShadow=function(t,e){var n='<feDropShadow\n dx="'+(t.dx||0)+'"\n dy="'+(t.dy||0)+'"\n stdDeviation="'+(t.blur?t.blur/10:0)+'"\n flood-color="'+(t.color?t.color:"#000")+'"\n flood-opacity="'+(t.opacity?t.opacity:1)+'"\n />';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(l.F)("marker_");n.setAttribute("id",r);var i=Object(u.b)("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;Object(l.m)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),w=function(){function t(t){this.type="clip",this.cfg={};var e=Object(u.b)("clipPath");this.el=e,this.id=Object(l.F)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),_=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,E=function(){function t(t){this.cfg={};var e=Object(u.b)("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Object(u.b)("image");e.appendChild(n);var r=Object(l.F)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=_.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),S=function(){function t(t){var e=Object(u.b)("defs"),n=Object(l.F)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i<n.length;i++)if(n[i].match(t,e)){r=n[i].id;break}return r},t.prototype.findById=function(t){for(var e=this.children,n=null,r=0;r<e.length;r++)if(e[r].id===t){n=e[r];break}return n},t.prototype.add=function(t){this.children.push(t),t.canvas=this.canvas,t.parent=this},t.prototype.getDefaultArrow=function(t,e){var n=t.stroke||t.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var r=new x(t,e);return this.defaultArrow[n]=r,this.el.appendChild(r.el),this.add(r),r.id},t.prototype.addGradient=function(t){var e=new v(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addArrow=function(t,e){var n=new x(t,e);return this.el.appendChild(n.el),this.add(n),n.id},t.prototype.addShadow=function(t){var e=new b(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addPattern=function(t){var e=new E(t);return this.el.appendChild(e.el),this.add(e),e.id},t.prototype.addClip=function(t){var e=new w(t);return this.el.appendChild(e.el),this.add(e),e.id},t}(),M=function(t){function e(e){return t.call(this,Object(r.a)(Object(r.a)({},e),{autoDraw:!0,renderer:"svg"}))||this}return Object(r.c)(e,t),e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return f.a},e.prototype.getShape=function(t,e,n){var r=n.target||n.srcElement;if(!o.a[r.tagName]){for(var i=r.parentNode;i&&!o.a[i.tagName];)i=i.parentNode;r=i}return this.find((function(t){return t.get("el")===r}))},e.prototype.createDom=function(){var t=Object(u.b)("svg"),e=new S(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",e),t},e.prototype.onCanvasChange=function(t){var e=this.get("context"),n=this.get("el");if("sort"===t){var r=this.get("children");r&&r.length&&Object(u.d)(this,(function(t,e){return r.indexOf(t)-r.indexOf(e)?1:0}))}else if("clear"===t){if(n){n.innerHTML="";var i=e.el;i.innerHTML="",n.appendChild(i)}}else"matrix"===t?Object(s.c)(this):"clip"===t?Object(s.a)(this,e):"changeSize"===t&&(n.setAttribute("width",""+this.get("width")),n.setAttribute("height",""+this.get("height")))},e.prototype.draw=function(){var t=this.get("context"),e=this.getChildren();Object(s.a)(this,t),e.length&&Object(a.a)(t,e)},e}(i.AbstractCanvas);e.a=M},function(t,e,n){"use strict";var r=n(1),i=n(22),o=n(160),a=n(165);function s(t,e,n){var r=t.getTotalMatrix();if(r){var i=function(t,e){if(e){var n=Object(a.invert)(e);return Object(a.multiplyVec2)(n,t)}return t}([e,n,1],r);return[i[0],i[1]]}return[e,n]}function u(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!Object(o.isAllowCapture)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=s(t,e,n),i=r[0],a=r[1];if(t.isClipped(i,a))return!1}var u=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var c=n(54),f=n(74),l=n(14),h=n(21),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return f.a},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Object(l.d)();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!u(e,n,r))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var c=o[a];if(c.isGroup())i=t(c,n,r);else if(u(c,n,r)){var f=c,l=s(c,n,r),h=l[0],d=l[1];f.isInShape(h,d)&&(i=c)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=Object(h.f)(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=Object(h.g)(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(l.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Object(h.a)(t,this),Object(h.d)(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Object(h.a)(t,this),Object(h.b)(this,n,r),Object(h.d)(t,n,r),t.restore()):e.length&&Object(h.c)(e),Object(l.c)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(l.n)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e}(i.AbstractCanvas);e.a=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},e.length=o,e.fromValues=a,e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},e.subtract=s,e.multiply=u,e.divide=c,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},e.distance=f,e.squaredDistance=l,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},e.normalize=d,e.dot=p,e.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},e.hermite=function(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*f,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*f,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*f,t},e.bezier=function(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,f=3*o*s,l=3*u*a,h=u*o;return t[0]=e[0]*c+n[0]*f+r[0]*l+i[0]*h,t[1]=e[1]*c+n[1]*f+r[1]*l+i[1]*h,t[2]=e[2]*c+n[2]*f+r[2]*l+i[2]*h,t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,i=2*r.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},e.transformQuat=function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],f=i*c-o*u,l=o*s-r*c,h=r*u-i*s,d=i*h-o*l,p=o*f-r*h,g=r*l-i*f,v=2*a;return f*=v,l*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+f+d,t[1]=u+l+p,t[2]=c+h+g,t},e.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.angle=function(t,e){var n=a(t[0],t[1],t[2]),r=a(e[0],e[1],e[2]);d(n,n),d(r,r);var i=p(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(130));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function a(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function h(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}var g;e.sub=s,e.mul=u,e.div=c,e.dist=f,e.sqrDist=l,e.len=o,e.sqrLen=h,e.forEach=(g=i(),function(t,e,n,r,i,o){var a=void 0,s=void 0;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)g[0]=t[a],g[1]=t[a+1],g[2]=t[a+2],i(g,g,o),t[a]=g[0],t[a+1]=g[1],t[a+2]=g[2];return t})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(291),i=n(292),o=n(52);e.default=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(o.default(e)||o.default(n))return!1;if(i.default(e)||i.default(n)){if(e.length!==n.length)return!1;for(var a=!0,s=0;s<e.length&&(a=t(e[s],n[s]));s++);return a}if(r.default(e)||r.default(n)){var u=Object.keys(e),c=Object.keys(n);if(u.length!==c.length)return!1;for(a=!0,s=0;s<u.length&&(a=t(e[u[s]],n[u[s]]));s++);return a}return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(512);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){var r=n(223);t.exports=function(t){return t&&t.length?r(t):[]}},function(t,e,n){var r,i,o;function a(t){return(a="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)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t};function n(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,e){t||n(e)}function i(t){return t?": "+t:""}function o(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"===a(t);case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"===a(t)}}function s(t,e,r){e.indexOf(t)<0&&n("invalid value"+i(r)+". must be one of: "+e)}var u=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function g(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new l(0,""));for(var s=0;s<r.length;++s){var u=r[s],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);if(c)switch(c[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,u))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function v(t){t._commandRef=d()}function m(t,e){var r=p();n(t+" in command "+(e||d())+("unknown"===r?"":" called from "+r))}function y(t,e,n,r){o(t,e)||m("invalid parameter type"+i(n)+". expected "+e+", got "+a(t),r||d())}var b={};function x(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:b[t]*e}function w(t){return!(t&t-1||!t)}b[5120]=b[5121]=1,b[5122]=b[5123]=b[36193]=b[33635]=b[32819]=b[32820]=2,b[5124]=b[5125]=b[5126]=b[34042]=4;var _=e(r,{optional:function(t){t()},raise:n,commandRaise:m,command:function(t,e,n){t||m(e,n||d())},parameter:function(t,e,r){t in e||n("unknown parameter ("+t+")"+i(r)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||m("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){u.indexOf(t)<0&&n('invalid regl constructor argument "'+t+'". must be one of '+u)}))},type:function(t,e,r){o(t,e)||n("invalid parameter type"+i(r)+". expected "+e+", got "+a(t))},commandType:y,isTypedArray:function(e,r){t(e)||n("invalid parameter type"+i(r)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:s,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";y(n,"string",s+" shader source must be a string",o);var u=g(n,o),f=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))}(u,f),Object.keys(u).forEach((function(t){var e=u[t];if(e.hasErrors){var n=[""],r=[""];i("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var r=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(c("| ",6)),i(c("^^^",e+3)+"\n","font-weight:bold"),i(c("| ",6)),i(r+"\n","font-weight:bold")})),i(c("| ",6)+"\n")}else i(c(t.number,4)+"| "),i(t.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+s+" shader, "+u[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=g(n,o),u='Error linking program with vertex shader, "'+g(i,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+a),r.raise(u)}},callSite:p,saveCommandRef:v,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}v(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?s(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):s(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var i,o=e.width,a=e.height,s=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(w(o)&&w(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(w(o)&&w(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(i=0;i<16;++i)if(u[i]){var c=o>>i,f=a>>i;r(e.mipmask&1<<i,"missing mipmap data");var l=u[i];if(r(l.width===c&&l.height===f,"invalid shape for mip images"),r(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var h=Math.ceil(x(l.type,s)*c/l.unpackAlignment)*l.unpackAlignment;r(l.data.byteLength===h*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||r(0==(e.mipmask&1<<i),"extra mipmap data");e.compressed&&r(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,i){var o=t.width,a=t.height,s=t.channels;r(o>0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var u=0;u<n.length;++u){var c=n[u];r(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(r(!c.compressed,"can not generate mipmap for compressed textures"),r(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var h=f[l];if(h){var d=o>>l,p=a>>l;r(c.mipmask&1<<l,"missing mipmap data"),r(h.width===d&&h.height===p,"invalid shape for mip images"),r(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed||(h.data?r(h.data.byteLength===d*p*Math.max(x(h.type,s),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),E=0;function S(t,e){this.id=E++,this.type=t,this.data=e}function M(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function O(t){return"["+function t(e){if(0===e.length)return[];var n=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&n===r&&('"'===n||"'"===n))return['"'+M(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+M(e)+'"'];for(var a=[],s=0;s<o.length;++s)a=a.concat(t(o[s]));return a}(t).join("][")+"]"}var A={DynamicVariable:S,define:function(t,e){return new S(t,O(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof S},unbox:function t(e,n){return"function"==typeof e?new S(0,e):"number"==typeof e||"boolean"==typeof e?new S(5,e):Array.isArray(e)?new S(6,e.map((function(e,r){return t(e,n+"["+r+"]")}))):e instanceof S?e:void _(!1,"invalid option type in uniform "+n)},accessor:O},k={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},T="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function I(t){return"string"==typeof t?t.split():(_(Array.isArray(t),"invalid extension array"),t)}function C(t){return"string"==typeof t?(_("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function P(t){var n,r,i,o,s,u=t||{},c={},f=[],l=[],h="undefined"==typeof window?1:window.devicePixelRatio,d=!1,p=function(t){t&&_.raise(t)},g=function(){};if("string"==typeof u?(_("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),_(n,"invalid query string for element")):"object"===a(u)?"string"==typeof(s=u).nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?i=(o=u).canvas:(_.constructor(u),"gl"in u?o=u.gl:"canvas"in u?i=C(u.canvas):"container"in u&&(r=C(u.container)),"attributes"in u&&(c=u.attributes,_.type(c,"object","invalid context attributes")),"extensions"in u&&(f=I(u.extensions)),"optionalExtensions"in u&&(l=I(u.optionalExtensions)),"onDone"in u&&(_.type(u.onDone,"function","invalid or missing onDone callback"),p=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(h=+u.pixelRatio,_(h>0,"invalid pixel ratio"))):_.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){_("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!v)return null;i=v.canvas,g=v.onDestroy}void 0===c.premultipliedAlpha&&(c.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,c)}return o?{gl:o,canvas:i,container:r,extensions:f,optionalExtensions:l,pixelRatio:h,profile:d,onDone:p,onDestroy:g}:(g(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function D(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function N(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function R(){var t=D(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[N(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var j=R();function B(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}j.zero=R();var L=function(t){return Object.keys(t).map((function(e){return t[e]}))},G={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||j.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],s=0;s<n;++s)r[i++]=a[s]}(t,e[0],e[1],a);break;case 3:F(t,e[0],e[1],e[2],a,0);break;default:!function t(e,n,r,i,o){for(var a=1,s=r+1;s<n.length;++s)a*=n[s];var u=n[r];if(n.length-r==4){var c=n[r+1],f=n[r+2],l=n[r+3];for(s=0;s<u;++s)F(e[s],c,f,l,i,o),o+=a}else for(s=0;s<u;++s)t(e[s],n,r+1,i,o),o+=a}(t,e,0,a,0)}return a}};function F(t,e,n,r,i,o){for(var a=o,s=0;s<e;++s)for(var u=t[s],c=0;c<n;++c)for(var f=u[c],l=0;l<r;++l)i[a++]=f[l]}var U={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},z={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},W={dynamic:35048,stream:35040,static:35044},V=G.flatten,X=G.shape,Y=[];function H(t){return 0|U[Object.prototype.toString.call(t)]}function q(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function Q(t,e,n,r,i,o,a){for(var s=0,u=0;u<n;++u)for(var c=0;c<r;++c)t[s++]=e[i*u+o*c+a]}Y[5120]=1,Y[5122]=2,Y[5124]=4,Y[5121]=1,Y[5123]=2,Y[5125]=4,Y[5126]=4;var Z={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},K=new Float32Array(1),$=new Uint32Array(K.buffer);function J(t){for(var e=j.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{K[0]=t[n];var r=$[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function tt(e){return Array.isArray(e)||t(e)}var et=function(t){return!(t&t-1||!t)},nt=[9984,9986,9985,9987],rt=[0,6409,6410,6407,6408],it={};function ot(t){return"[object "+t+"]"}it[6409]=it[6406]=it[6402]=1,it[34041]=it[6410]=2,it[6407]=it[35904]=3,it[6408]=it[35906]=4;var at=ot("HTMLCanvasElement"),st=ot("OffscreenCanvas"),ut=ot("CanvasRenderingContext2D"),ct=ot("ImageBitmap"),ft=ot("HTMLImageElement"),lt=ot("HTMLVideoElement"),ht=Object.keys(U).concat([at,st,ut,ct,ft,lt]),dt=[];dt[5121]=1,dt[5126]=4,dt[36193]=2,dt[5123]=2,dt[5125]=4;var pt=[];function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function vt(t){return!!Array.isArray(t)&&!(0===t.length||!tt(t[0]))}function mt(t){return Object.prototype.toString.call(t)}function yt(t){return mt(t)===at}function bt(t){return mt(t)===st}function xt(t){if(!t)return!1;var e=mt(t);return ht.indexOf(e)>=0||gt(t)||vt(t)||B(t)}function wt(t){return 0|U[Object.prototype.toString.call(t)]}function _t(t,e){return j.allocType(36193===t.type?5126:t.type,e)}function Et(t,e){36193===t.type?(t.data=J(e),j.freeType(e)):t.data=e}function St(t,e,n,r,i,o){var a;if(a=void 0!==pt[t]?pt[t]:it[t]*dt[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Mt(n,r,i,o,s,u,c){var f={"don't care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},d=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),p={none:0,browser:37444},g={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},m={};r.ext_srgb&&(v.srgb=35904,v.srgba=35906),r.oes_texture_float&&(g.float32=g.float=5126),r.oes_texture_half_float&&(g.float16=g["half float"]=36193),r.webgl_depth_texture&&(e(v,{depth:6402,"depth stencil":34041}),e(g,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(m,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(m,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(m,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(m["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(m).forEach((function(t){var e=m[t];y.indexOf(e)>=0&&(v[t]=e)}));var b=Object.keys(v);i.textureFormats=b;var x=[];Object.keys(v).forEach((function(t){var e=v[t];x[e]=t}));var w=[];Object.keys(g).forEach((function(t){var e=g[t];w[e]=t}));var E=[];Object.keys(h).forEach((function(t){E[h[t]]=t}));var S=[];Object.keys(d).forEach((function(t){var e=d[t];S[e]=t}));var M=[];Object.keys(l).forEach((function(t){M[l[t]]=t}));var O=b.reduce((function(t,e){var n=v[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function A(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function k(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function T(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(_.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(_.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(_.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(_.parameter(e.colorSpace,p,"invalid colorSpace"),t.colorSpace=p[e.colorSpace]),"type"in e){var n=e.type;_(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),_(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),_(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),_.parameter(n,g,"invalid texture type"),t.type=g[n]}var o=t.width,s=t.height,u=t.channels,c=!1;"shape"in e?(_(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],_(u>0&&u<=4,"invalid number of channels"),c=!0),_(o>=0&&o<=i.maxTextureSize,"invalid width"),_(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,_(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,_(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,_(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,_(u>0&&u<=4,"invalid number of channels"),c=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var f=!1;if("format"in e){var l=e.format;_(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),_.parameter(l,v,"invalid texture format");var h=t.internalformat=v[l];t.format=O[h],l in g&&("type"in e||(t.type=g[l])),l in m&&(t.compressed=!0),f=!0}!c&&f?t.channels=it[t.format]:c&&!f?t.channels!==rt[t.format]&&(t.format=t.internalformat=rt[t.channels]):f&&c&&_(t.channels===it[t.format],"number of channels inconsistent with specified format")}}function I(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function C(){A.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function P(e,n){var r=null;if(xt(n)?r=n:n&&(_.type(n,"object","invalid pixel data type"),T(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),xt(n.data)&&(r=n.data)),_(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){_(!r,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,_(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<a&&e.width>0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=wt(r));else if(gt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=j.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=J(e);break;default:_.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(B(r)){var u=r.data;Array.isArray(u)||5121!==e.type||(e.type=wt(u));var c,f,l,h,d,p,g=r.shape,v=r.stride;3===g.length?(l=g[2],p=v[2]):(_(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=g[0],f=g[1],h=v[0],d=v[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=rt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=_t(t,a*s*u),f=0,l=0;l<s;++l)for(var h=0;h<a;++h)for(var d=0;d<u;++d)c[f++]=e[n*h+r*l+i*d+o];Et(t,c)}(e,u,h,d,p,r.offset)}else if(yt(r)||bt(r)||mt(r)===ut)yt(r)||bt(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return mt(t)===ct}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return mt(t)===ft}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return mt(t)===lt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(vt(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=tt(r[0][0])?b||r[0][0].length:b||1;for(var x=G.shape(r),w=1,E=0;E<x.length;++E)w*=x[E];var S=_t(e,w);G.flatten(r,x,"",S),Et(e,S),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=rt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;5126===e.type?_(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):36193===e.type&&_(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function D(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,f=t.width,l=t.height;I(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,u,f,l,0,u,c,a||null)}function N(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;I(t),s?n.texSubImage2D(e,a,r,i,f,l,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,u)}var R=[];function F(){return R.pop()||new C}function U(t){t.needsFree&&j.freeType(t.data),C.call(t),R.push(t)}function z(){A.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function W(t,e,n){var r=t.images[0]=F();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function V(t,e){var n=null;if(xt(e))k(n=t.images[0]=F(),t),P(n,e),t.mipmask=1;else if(T(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)k(n=t.images[i]=F(),t),n.width>>=i,n.height>>=i,P(n,r[i]),t.mipmask|=1<<i;else k(n=t.images[0]=F(),t),P(n,e),t.mipmask=1;k(t,t.images[0]),!t.compressed||33776!==t.internalformat&&33777!==t.internalformat&&33778!==t.internalformat&&33779!==t.internalformat||_(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function X(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;D(n[r],e,r)}}var Y=[];function H(){var t=Y.pop()||new z;A.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function q(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&U(e[n]),e[n]=null;Y.push(t)}function Q(){this.minFilter=9728,this.magFilter=9728,this.wrapS=33071,this.wrapT=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function Z(t,e){if("min"in e){var n=e.min;_.parameter(n,d),t.minFilter=d[n],nt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;_.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(_.parameter(u,l),o=s=l[u]):Array.isArray(u)&&(_.parameter(u[0],l),_.parameter(u[1],l),o=l[u[0]],s=l[u[1]])}else{if("wrapS"in e){var c=e.wrapS;_.parameter(c,l),o=l[c]}if("wrapT"in e){var p=e.wrapT;_.parameter(p,l),s=l[p]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var g=e.anisotropic;_("number"==typeof g&&g>=1&&g<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(a(e.mipmap)){case"string":_.parameter(e.mipmap,f,"invalid mipmap hint"),t.mipmapHint=f[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":_(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:_.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=9984)}}function K(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,ot={},at=i.maxTextureUnits,st=Array(at).map((function(){return null}));function ht(t){A.call(this),this.mipmask=0,this.internalformat=6408,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Q,c.profile&&(this.stats={size:0})}function dt(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function pt(){var t=st[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Mt(t){var e=t.texture;_(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),st[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ot[t.id],u.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e<at;++e){var r=st[e];if(r){if(r.bindCount>0)continue;r.unit=-1}st[e]=this,t=e;break}t>=at&&_.raise("insufficient number of texture units"),c.profile&&u.maxTextureUnits<t+1&&(u.maxTextureUnits=t+1),this.unit=t,n.activeTexture(33984+t),n.bindTexture(this.target,this.texture)}return t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Mt(this)}}),c.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(ot).forEach((function(e){t+=ot[e].stats.size})),t}),{create2D:function(t,e){var r=new ht(3553);function o(t,e){var n=r.texInfo;Q.call(n);var a=H();return"number"==typeof t?W(a,0|t,"number"==typeof e?0|e:0|t):t?(_.type(t,"object","invalid arguments to regl.texture"),Z(n,t),V(a,t)):W(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,k(r,a),_.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,dt(r),X(a,3553),K(n,3553),pt(),q(a),c.profile&&(r.stats.size=St(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=x[r.internalformat],o.type=w[r.type],o.mag=E[n.magFilter],o.min=S[n.minFilter],o.wrapS=M[n.wrapS],o.wrapT=M[n.wrapT],o}return ot[r.id]=r,u.textureCount++,o(t,e),o.subimage=function(t,e,n,i){_(!!t,"must specify image data");var a=0|e,s=0|n,u=0|i,c=F();return k(c,r),c.width=0,c.height=0,P(c,t),c.width=c.width||(r.width>>u)-a,c.height=c.height||(r.height>>u)-s,_(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),_(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),_(r.mipmask&1<<u,"missing mipmap data"),_(c.data||c.element||c.needsCopy,"missing image data"),dt(r),N(c,3553,a,s,u),pt(),U(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,dt(r);for(var s=0;r.mipmask>>s;++s){var u=i>>s,f=a>>s;if(!u||!f)break;n.texImage2D(3553,s,r.format,u,f,0,r.format,r.type,null)}return pt(),c.profile&&(r.stats.size=St(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,c.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,s,f){var l=new ht(34067);ot[l.id]=l,u.cubeCount++;var h=new Array(6);function d(t,e,n,r,o,s){var u,f=l.texInfo;for(Q.call(f),u=0;u<6;++u)h[u]=H();if("number"!=typeof t&&t)if("object"===a(t))if(e)V(h[0],t),V(h[1],e),V(h[2],n),V(h[3],r),V(h[4],o),V(h[5],s);else if(Z(f,t),T(l,t),"faces"in t){var p=t.faces;for(_(Array.isArray(p)&&6===p.length,"cube faces must be a length 6 array"),u=0;u<6;++u)_("object"===a(p[u])&&!!p[u],"invalid input for cube map face"),k(h[u],l),V(h[u],p[u])}else for(u=0;u<6;++u)V(h[u],t);else _.raise("invalid arguments to cube map");else{var g=0|t||1;for(u=0;u<6;++u)W(h[u],g,g)}for(k(l,h[0]),i.npotTextureCube||_(et(l.width)&&et(l.height),"your browser does not support non power or two texture dimensions"),f.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,_.textureCube(l,f,h,i),l.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,dt(l),u=0;u<6;++u)X(h[u],34069+u);for(K(f,34067),pt(),c.profile&&(l.stats.size=St(l.internalformat,l.type,d.width,d.height,f.genMipmaps,!0)),d.format=x[l.internalformat],d.type=w[l.type],d.mag=E[f.magFilter],d.min=S[f.minFilter],d.wrapS=M[f.wrapS],d.wrapT=M[f.wrapT],u=0;u<6;++u)q(h[u]);return d}return d(t,e,r,o,s,f),d.subimage=function(t,e,n,r,i){_(!!e,"must specify image data"),_("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=F();return k(u,l),u.width=0,u.height=0,P(u,e),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,_(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),_(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),_(l.mipmask&1<<s,"missing mipmap data"),_(u.data||u.element||u.needsCopy,"missing image data"),dt(l),N(u,34069+t,o,a,s),pt(),U(u),d},d.resize=function(t){var e=0|t;if(e!==l.width){d.width=l.width=e,d.height=l.height=e,dt(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return pt(),c.profile&&(l.stats.size=St(l.internalformat,l.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=l,c.profile&&(d.stats=l.stats),d.destroy=function(){l.decRef()},d},clear:function(){for(var t=0;t<at;++t)n.activeTexture(33984+t),n.bindTexture(3553,null),st[t]=null;L(ot).forEach(Mt),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<at;++t){var e=st[t];e&&(e.bindCount=0,e.unit=-1,st[t]=null)}L(ot).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(3553===t.target)n.texImage2D(3553,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);K(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<at;++t){var e=st[t];e&&(e.bindCount=0,e.unit=-1,st[t]=null),n.activeTexture(33984+t),n.bindTexture(3553,null),n.bindTexture(34067,null)}}}}pt[32854]=2,pt[32855]=2,pt[36194]=2,pt[34041]=4,pt[33776]=.5,pt[33777]=.5,pt[33778]=1,pt[33779]=1,pt[35986]=.5,pt[35987]=1,pt[34798]=1,pt[35840]=.5,pt[35841]=.25,pt[35842]=.5,pt[35843]=.25,pt[36196]=.5;var Ot=[];function At(t,e,n){return Ot[t]*e*n}Ot[32854]=2,Ot[32855]=2,Ot[36194]=2,Ot[33189]=2,Ot[36168]=1,Ot[34041]=4,Ot[35907]=4,Ot[34836]=16,Ot[34842]=8,Ot[34843]=6;var kt=[6407,6408],Tt=[];Tt[6408]=4,Tt[6407]=3;var It=[];It[5121]=1,It[5126]=4,It[36193]=2;var Ct=[32854,32855,36194,35907,34842,34843,34836],Pt={};function Dt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function Nt(e,n,r,i,o,a,s){function u(u){var c;null===n.next?(_(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=5121):(_(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(_(5121===c||5126===c,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),5126===c&&_(s.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):_(5121===c,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;t(u)?p=u:u&&(_.type(u,"object","invalid arguments to regl.read()"),f=0|u.x,l=0|u.y,_(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),_(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(u.width||i.framebufferWidth-f),d=0|(u.height||i.framebufferHeight-l),p=u.data||null),p&&(5121===c?_(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):5126===c&&_(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),_(h>0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),_(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var g=h*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),_.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),_(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function Rt(t){return Array.prototype.slice.call(t)}function jt(t){return Rt(t).join("")}Pt[36053]="complete",Pt[36054]="incomplete attachment",Pt[36057]="incomplete dimensions",Pt[36055]="incomplete, missing attachment",Pt[36061]="unsupported";var Bt="xyzw".split(""),Lt="profile",Gt="framebuffer",Ft="vert",Ut="frag",zt="elements",Wt="primitive",Vt="count",Xt="offset",Yt="instances",Ht="vao",qt=Gt+"Width",Qt=Gt+"Height",Zt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Kt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},$t=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Jt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},te={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ee={frag:35632,vert:35633},ne={cw:2304,ccw:2305};function re(e){return Array.isArray(e)||t(e)||B(e)}function ie(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1}))}function oe(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function ae(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function se(t){return new oe(!1,!1,!1,t)}function ue(t,e){var n=t.type;if(0===n){var r=t.data.length;return new oe(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new oe(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new oe(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u<t.data.length;++u){var c=t.data[u];if(1===c.type)s=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new oe(o,a,s,e)}return new oe(3===n,2===n,1===n,e)}var ce=new oe(!1,!1,!1,(function(){}));function fe(t,n,r,i,o,s,u,c,f,l,h,d,p,g,v){var m=l.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,w={dirty:!0,profile:v.profile},E={},S=[],M={},O={};function k(t){return t.replace(".","_")}function T(t,e,n){var r=k(t);S.push(t),E[r]=w[r]=!!n,M[r]=e}function I(t,e,n){var r=k(t);S.push(t),Array.isArray(n)?(w[r]=n.slice(),E[r]=n.slice()):w[r]=E[r]=n,O[r]=e}T("dither",3024),T("blend.enable",3042),I("blend.color","blendColor",[0,0,0,0]),I("blend.equation","blendEquationSeparate",[32774,32774]),I("blend.func","blendFuncSeparate",[1,0,1,0]),T("depth.enable",2929,!0),I("depth.func","depthFunc",513),I("depth.range","depthRange",[0,1]),I("depth.mask","depthMask",!0),I("colorMask","colorMask",[!0,!0,!0,!0]),T("cull.enable",2884),I("cull.face","cullFace",1029),I("frontFace","frontFace",2305),I("lineWidth","lineWidth",1),T("polygonOffset.enable",32823),I("polygonOffset.offset","polygonOffset",[0,0]),T("sample.alpha",32926),T("sample.enable",32928),I("sample.coverage","sampleCoverage",[1,!1]),T("stencil.enable",2960),I("stencil.mask","stencilMask",-1),I("stencil.func","stencilFunc",[519,0,-1]),I("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),I("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),T("scissor.enable",3089),I("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),I("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var C={gl:t,context:p,strings:n,next:E,current:w,draw:d,elements:s,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:f,framebuffer:c,extensions:r,timer:g,isBufferArgs:re},P={primTypes:Z,compareFuncs:Jt,blendFuncs:Kt,blendEquations:y,stencilOps:te,glTypes:z,orientationType:ne};_.optional((function(){C.isArrayLike=tt})),x&&(P.backBuffer=[1029],P.drawBuffer=D(i.maxDrawbuffers,(function(t){return 0===t?[0]:D(t,(function(t){return 36064+t}))})));var N=0;function R(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Rt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Rt(arguments)),n.push(";")),e},toString:function(){return jt([r.length>0?"var "+r.join(",")+";":"",jt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Rt(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var u=o(),c=u.toString;return s[t]=e(u,{arg:i,toString:function(){return jt(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=jt(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Rt(arguments)),this},else:function(){return r.apply(r,Rt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),jt(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(s).forEach((function(e){t.push('"',e,'":',s[e].toString(),",")})),t.push("}");var e=jt(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=N++,t.batchId="0";var o=r(C),a=t.shared={props:"a0"};Object.keys(C).forEach((function(t){a[t]=i.def(o,".",t)})),_.optional((function(){t.CHECK=r(_),t.commandStr=_.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},P.invalidBlendCombinations=$t}));var s=t.next={},u=t.current={};Object.keys(O).forEach((function(t){Array.isArray(w[t])&&(s[t]=i.def(a.next,".",t),u[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(P).forEach((function(t){c[t]=i.def(JSON.stringify(P[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var f={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in f)return f[e];var i=l.scope[e];return i||(i=l.scope[e]=new m),f[e]=r(i)},t}function j(t,e,u,f,d){var p=t.static,g=t.dynamic;_.optional((function(){var t=[Gt,Ft,Ut,zt,Wt,Xt,Vt,Yt,Lt,Ht].concat(S);function e(e){Object.keys(e).forEach((function(e){_.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',d.commandStr)}))}e(p),e(g)}));var v=function(t,e){var n=t.static;if("string"==typeof n[Ut]&&"string"==typeof n[Ft]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)_("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),x=function(t,e){var n=t.static,r=t.dynamic;if(Gt in n){var i=n[Gt];return i?(i=c.getFramebuffer(i),_.command(i,"invalid framebuffer object"),se((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+qt,n+".width"),e.set(o,"."+Qt,n+".height"),n}))):se((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+qt,r+".drawingBufferWidth"),e.set(r,"."+Qt,r+".drawingBufferHeight"),"null"}))}if(Gt in r){var o=r[Gt];return ue(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");_.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var s=r.context;return e.set(s,"."+qt,a+"?"+a+".width:"+s+".drawingBufferWidth"),e.set(s,"."+Qt,a+"?"+a+".height:"+s+".drawingBufferHeight"),a}))}return null}(t),w=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];_.commandType(o,"object","invalid "+t,n.commandStr);var a,s,u=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,_.command(a>=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,_.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new oe(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",qt,"-",c));var i=s;return"height"in o||(i=e.def(n,".",Qt,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=ue(l,(function(e,n){var r=e.invoke(n,l);_.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",qt,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",Qt,"-",a,")");return _.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new oe(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",qt),e.def(n,".",Qt)]})):null}var a=o("viewport");if(a){var s=a;a=new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,x,d),E=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];re(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),_.command(t,"invalid elements",e.commandStr));var i=se((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return ue(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return _.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return _.command(!o||a>=0,"invalid "+t,e.commandStr),se((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return ue(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,_.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?se((function(t,e){return t.OFFSET="0",0})):null}var a=o(Xt,!0);return{elements:i,primitive:function(){if(Wt in n){var t=n[Wt];return _.commandParameter(t,Z,"invalid primitve",e.commandStr),se((function(e,n){return Z[t]}))}if(Wt in r){var o=r[Wt];return ue(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return _.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Z))})),e.def(n,"[",r,"]")}))}return i?ae(i)?i.value?se((function(t,e){return e.def(t.ELEMENTS,".primType")})):se((function(){return 4})):new oe(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Vt in n){var t=0|n[Vt];return _.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),se((function(){return t}))}if(Vt in r){var o=r[Vt];return ue(o,(function(t,e){var n=t.invoke(e,o);return _.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(ae(i)){if(i)return a?new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return _.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):se((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var s=se((function(){return-1}));return _.optional((function(){s.MISSING=!0})),s}var u=new oe(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return _.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:a}}(t,d),M=function(t,e){var n=t.static,r=t.dynamic,o={};return S.forEach((function(t){var s=k(t);function u(e,i){if(t in n){var a=e(n[t]);o[s]=se((function(){return a}))}else if(t in r){var u=r[t];o[s]=ue(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return u((function(n){return _.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return _.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return u((function(n){return _.commandParameter(n,Jt,"invalid "+t,e.commandStr),Jt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return _.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Jt))})),n.def(i,"[",r,"]")}));case"depth.range":return u((function(t){return _.command(tt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return _.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case"blend.func":return u((function(t){_.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return _.commandParameter(n,Kt,s+".srcRGB",e.commandStr),_.commandParameter(r,Kt,s+".srcAlpha",e.commandStr),_.commandParameter(i,Kt,s+".dstRGB",e.commandStr),_.commandParameter(o,Kt,s+".dstAlpha",e.commandStr),_.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Kt[n],Kt[i],Kt[r],Kt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return _.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Kt))})),s}_.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");_.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return u((function(n){return"string"==typeof n?(_.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"===a(n)?(_.commandParameter(n.rgb,y,t+".rgb",e.commandStr),_.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void _.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return _.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return u((function(t){return _.command(tt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),D(4,(function(e){return+t[e]}))}),(function(t,e,n){return _.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),D(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return u((function(t){return _.commandType(t,"number",s,e.commandStr),0|t}),(function(t,e,n){return _.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return u((function(n){_.commandType(n,"object",s,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return _.commandParameter(r,Jt,t+".cmp",e.commandStr),_.commandType(i,"number",t+".ref",e.commandStr),_.commandType(o,"number",t+".mask",e.commandStr),[Jt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return _.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return u((function(n){_.commandType(n,"object",s,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return _.commandParameter(r,te,t+".fail",e.commandStr),_.commandParameter(i,te,t+".zfail",e.commandStr),_.commandParameter(o,te,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,te[r],te[i],te[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return _.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(te))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return _.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return u((function(t){_.commandType(t,"object",s,e.commandStr);var n=0|t.factor,r=0|t.units;return _.commandType(n,"number",s+".factor",e.commandStr),_.commandType(r,"number",s+".units",e.commandStr),[n,r]}),(function(e,n,r){return _.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return u((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),_.command(!!n,s,e.commandStr),n}),(function(t,e,n){return _.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return u((function(t){return _.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return _.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return u((function(t){return _.commandParameter(t,ne,s,e.commandStr),ne[t]}),(function(t,e,n){return _.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:2305')}));case"colorMask":return u((function(t){return _.command(tt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return _.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),D(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return u((function(t){_.command("object"===a(t)&&t,s,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return _.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return _.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,d),O=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);_.optional((function(){h.shader(ee[t],e,_.guessCommand())}));var r=se((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return ue(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return _.optional((function(){n(e.shared.shader,".shader(",ee[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Ut),c=a(Ft),f=null;return ae(u)&&ae(c)?(f=h.program(c.id,u.id,null,r),s=se((function(t,e){return t.link(f)}))):s=new oe(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Ut);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Ft))+","+n;return _.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:f}}(t,0,v);function A(t){var e=w[t];e&&(M[t]=e)}A("viewport"),A(k("scissor.box"));var T=Object.keys(M).length>0,I={framebuffer:x,draw:E,shader:O,state:M,dirty:T,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(I.profile=function(t){var e,n=t.static,r=t.dynamic;if(Lt in n){var i=!!n[Lt];(e=se((function(t,e){return i}))).enable=i}else if(Lt in r){var o=r[Lt];e=ue(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),I.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=se((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=se((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(_.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=se((function(t){return t.link(o.color[0])}))):_.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else tt(o)?r=se((function(e){return e.global.def("[",D(o.length,(function(n){return _.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):_.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=ue(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,d),I.drawVAO=I.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Ht in n){var i=n[Ht];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),se((function(t){return t.link(l.getVAO(i))}))}if(Ht in r){var o=r[Ht];return ue(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!I.drawVAO&&O.program&&!v&&r.angle_instanced_arrays){var C=!0,P=O.program.attributes.map((function(t){var n=e.static[t];return C=C&&!!n,n}));if(C&&P.length>0){var N=l.getVAO(l.createVAO(P));I.drawVAO=new oe(null,null,null,(function(t,e){return t.link(N)})),I.useVAO=!0}}return v?I.useVAO=!0:I.attributes=function(t,e){var r=t.static,i=t.dynamic,s={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),c=new m;if(re(i))c.state=1,c.buffer=o.getBuffer(o.create(i,34962,!1,!0)),c.type=0;else{var f=o.getBuffer(i);if(f)c.state=1,c.buffer=f,c.type=0;else if(_.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;c.buffer="null",c.state=2,"number"==typeof l?c.x=l:(_.command(tt(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Bt.forEach((function(t,e){e<l.length&&(c[t]=l[e])})))}else{f=re(i.buffer)?o.getBuffer(o.create(i.buffer,34962,!1,!0)):o.getBuffer(i.buffer),_.command(!!f,'missing buffer for attribute "'+t+'"',e.commandStr);var h=0|i.offset;_.command(h>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|i.stride;_.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var p=0|i.size;_.command(!("size"in i)||p>0&&p<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var g=!!i.normalized,v=0;"type"in i&&(_.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),v=z[i.type]);var y=0|i.divisor;"divisor"in i&&(_.command(0===y||b,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),_.command(y>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),_.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){_.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),c.buffer=f,c.state=1,c.size=p,c.normalized=g,c.type=v||f.dtype,c.offset=h,c.stride=d,c.divisor=y}}s[t]=se((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(c).forEach((function(t){r[t]=c[t]})),c.buffer&&(r.buffer=t.link(c.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];s[t]=ue(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;_.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new m;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",l,"=",u,".createStream(",34962,",",i,");",h,"=",l,".dtype;","}else{",l,"=",u,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Bt[0]],"=",i,".constant;",Bt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Bt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",l,"=",u,".createStream(",34962,",",i,".buffer);","}else{",l,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",l,");","}"),c}))})),s}(e,d),I.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=se((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=ue(e,(function(t,n){return t.invoke(n,e)}))})),r}(f),I}function B(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,f=c.drawBuffer,l=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),x&&e(i,".drawBuffersWEBGL(",f,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),x&&e(i,".drawBuffersWEBGL(",l,");"),e("}",s,".cur=",u,";"),r||e("}")}function G(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".dirty");S.forEach((function(e){var r,f,l=k(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=D(w[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",O[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",l);var d=t.cond(r,"!==",s,".",l);c(d),l in M?d(t.cond(r).then(i,".enable(",M[l],");").else(i,".disable(",M[l],");"),s,".",l,"=",r,";"):d(i,".",O[l],"(",r,");",s,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;ie(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(M[i]){var f=M[i];ae(u)?e(s,c?".enable(":".disable(",f,");"):e(t.cond(c).then(s,".enable(",f,");").else(s,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(tt(c)){var l=o[i];e(s,".",O[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(s,".",O[i],"(",c,");",a,".",i,"=",c,";")}}))}function U(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function W(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,f=u.current,l=u.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function p(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),g&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),g&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function m(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(ae(h))return void(h.enable?(p(e),v(e.exit),m("true")):m("false"));m(s=h.append(t,e))}else s=e.def(f,".profile");var y=t.block();p(y),e("if(",s,"){",y,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function V(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ce))return;var c=t.scopeAttrib(s);_.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new m).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",h.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",f,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",h.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Bt.map((function(t,e){return u+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",l,");",Bt.map((function(t,e){return u+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function X(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c<i.length;++c){var f,l=i[c],h=l.name,d=l.info.type,p=r.uniforms[h],g=t.link(l)+".location";if(p){if(!o(p))continue;if(ae(p)){var v=p.value;if(_.command(null!=v,'missing uniform "'+h+'"',t.commandStr),35678===d||35680===d){_.command("function"==typeof v&&(35678===d&&("texture2d"===v._reglType||"framebuffer"===v._reglType)||35680===d&&("textureCube"===v._reglType||"framebufferCube"===v._reglType)),"invalid texture for uniform "+h,t.commandStr);var m=t.link(v._texture||v.color[0]._texture);e(u,".uniform1i(",g,",",m+".bind());"),e.exit(m,".unbind();")}else if(35674===d||35675===d||35676===d){_.optional((function(){_.command(tt(v),"invalid matrix for uniform "+h,t.commandStr),_.command(35674===d&&4===v.length||35675===d&&9===v.length||35676===d&&16===v.length,"invalid length for matrix uniform "+h,t.commandStr)}));var y=t.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),b=2;35675===d?b=3:35676===d&&(b=4),e(u,".uniformMatrix",b,"fv(",g,",false,",y,");")}else{switch(d){case 5126:_.commandType(v,"number","uniform "+h,t.commandStr),a="1f";break;case 35664:_.command(tt(v)&&2===v.length,"uniform "+h,t.commandStr),a="2f";break;case 35665:_.command(tt(v)&&3===v.length,"uniform "+h,t.commandStr),a="3f";break;case 35666:_.command(tt(v)&&4===v.length,"uniform "+h,t.commandStr),a="4f";break;case 35670:_.commandType(v,"boolean","uniform "+h,t.commandStr),a="1i";break;case 5124:_.commandType(v,"number","uniform "+h,t.commandStr),a="1i";break;case 35671:case 35667:_.command(tt(v)&&2===v.length,"uniform "+h,t.commandStr),a="2i";break;case 35672:case 35668:_.command(tt(v)&&3===v.length,"uniform "+h,t.commandStr),a="3i";break;case 35673:case 35669:_.command(tt(v)&&4===v.length,"uniform "+h,t.commandStr),a="4i"}e(u,".uniform",a,"(",g,",",tt(v)?Array.prototype.slice.call(v):v,");")}continue}f=p.append(t,e)}else{if(!o(ce))continue;f=e.def(s.uniforms,"[",n.id(h),"]")}35678===d?(_(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):35680===d&&(_(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),_.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+h+'". '+r)}function r(t){_(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?_(f.length===e,"must have length "+e):n(s.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){_(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case 5124:r("number");break;case 35667:i(2);break;case 35668:i(3);break;case 35669:i(4);break;case 5126:r("number");break;case 35664:i(2);break;case 35665:i(3);break;case 35666:i(4);break;case 35670:r("boolean");break;case 35671:i(2);break;case 35672:i(3);break;case 35673:case 35674:i(4);break;case 35675:i(9);break;case 35676:i(16);break;case 35678:o(3553);break;case 35680:o(34067)}}));var x=1;switch(d){case 35678:case 35680:var w=e.def(f,"._texture");e(u,".uniform1i(",g,",",w,".bind());"),e.exit(w,".unbind();");continue;case 5124:case 35670:a="1i";break;case 35667:case 35671:a="2i",x=2;break;case 35668:case 35672:a="3i",x=3;break;case 35669:case 35673:a="4i",x=4;break;case 5126:a="1f";break;case 35664:a="2f",x=2;break;case 35665:a="3f",x=3;break;case 35666:a="4f",x=4;break;case 35674:a="Matrix2fv";break;case 35675:a="Matrix3fv";break;case 35676:a="Matrix4fv"}if(e(u,".uniform",a,"(",g,","),"M"===a.charAt(0)){var E=Math.pow(d-35674+2,2),S=t.global.def("new Float32Array(",E,")");Array.isArray(f)?e("false,(",D(E,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",D(E,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else x>1?e(D(x,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(_(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function Y(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(Wt),d=c(Xt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),_.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",Vt),_.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");b&&(f=c(Yt),l=t.instancing);var g=u+".type",v=s.elements&&ae(s.elements);function m(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,g,d+"<<(("+g+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function y(){function t(){n(o+".drawElements("+[h,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}b&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),m(),n("}else if(",f,"<0){"),y(),n("}")):m():y()}function H(t,e,n,r,i){var o=R(),a=o.proc("body",i);return _.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function q(t,e,n,r){U(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),V(t,e,n,r.attributes,(function(){return!0}))),X(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function Q(t,e,n,r){function i(){return!0}t.batchId="a1",U(t,e),V(t,e,n,r.attributes,i),X(t,e,n,r.uniforms,i),Y(t,e,e,n)}function K(t,e,n,r){U(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&B(t,u,n.context),n.needsFramebuffer&&L(t,u,n.framebuffer),F(t,u,n.state,c),n.profile&&c(n.profile)&&W(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),V(t,s,n,r.attributes,f),V(t,u,n,r.attributes,c)),X(t,s,n,r.uniforms,f),X(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,u),d=u.def(h,".id"),p=u.def(l,"[",d,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return H(Q,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"===a(t)&&!tt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(A.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),s=!1,u=!1,c=!1,f=t.global.def("{}");o.forEach((function(e){var n=r[e];if(A.isDynamic(n)){"function"==typeof n&&(n=r[e]=A.unbox(n));var o=ue(n,null);s=s||o.thisDep,c=c||o.propDep,u=u||o.contextDep}else{switch(i(f,".",e,"="),a(n)){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new A.DynamicVariable(4,{thisDep:s,contextDep:u,propDep:c,ref:f,append:function(t,e){o.forEach((function(n){var i=r[n];if(A.isDynamic(i)){var o=t.invoke(e,i);e(f,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:E,current:w,procs:function(){var t=R(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,s=t.shared,u=s.gl,c=s.next,f=s.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),b&&(a=t.link(b)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var h=n.def(s.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(u,".enableVertexAttribArray(",l,");",u,".bindBuffer(",34962,",",h,".buffer.buffer);",u,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(u,".disableVertexAttribArray(",l,");",u,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),b&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(M).forEach((function(r){var i=M[r],a=o.def(c,".",r),s=t.block();s("if(",a,"){",u,".enable(",i,")}else{",u,".disable(",i,")}",f,".",r,"=",a,";"),n(s),e("if(",a,"!==",f,".",r,"){",s,"}")})),Object.keys(O).forEach((function(r){var i,a,s=O[r],l=w[r],h=t.block();if(h(u,".",s,"("),tt(l)){var d=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),h(D(d,(function(t){return i+"["+t+"]"})),");",D(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",D(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),h(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",h,"}");n(h)})),t.compile()}(),compile:function(t,r,i,o,a){var s=R();s.stats=s.link(a),Object.keys(r.static).forEach((function(t){$(s,r,t)})),Zt.forEach((function(e){$(s,t,e)}));var u=j(t,r,i,o,s);return function(t,e){var n=t.proc("draw",1);U(t,n),B(t,n,e.context),L(t,n,e.framebuffer),G(t,n,e),F(t,n,e.state),W(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)q(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return H(q,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}B(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),ie(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);tt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),W(t,r,e,!0,!0),[zt,Xt,Vt,Yt,Wt].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new m).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Ft),a(Ut),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",U(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(B(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),G(t,n,e),F(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||W(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)K(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)K(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return H(K,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<u.length;++n){var h=u[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=f[p]-f[d];var g=l[d],v=l[p];v===g?(h.stats.gpuTime+=h.sum/1e6,s(h)):(h.startQueryIndex=g,h.endQueryIndex=v,u[t++]=h)}u.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}};function he(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=P(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),s=i.isContextLost(),u=function(t,e){var n={};function r(e){_.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!u)return null;var c,f,l=(c={"":0},f=[""],{id:function(t){var e=c[t];return e||(e=c[t]=f.length,f.push(t),e)},str:function(t){return f[t]}}),h={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=u.extensions,p=le(0,d),g=T(),v=i.drawingBufferWidth,m=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:v,viewportHeight:m,framebufferWidth:v,framebufferHeight:m,drawingBufferWidth:v,drawingBufferHeight:m,pixelRatio:r.pixelRatio},b=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=t.createFramebuffer();if(t.bindFramebuffer(36160,s),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=j.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),j.freeType(u)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=j.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,6408,3,3,0,6408,5121,l),j.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,d),x=function(e,n,r,i){var o=0,a={};function s(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}s.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){l(this)};var u=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var s,u;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||5126,n.length>0)if(Array.isArray(n[0])){s=X(n);for(var f=1,l=1;l<s.length;++l)f*=s[l];e.dimension=f,c(e,u=V(n,s,e.dtype),r),a?e.persistentData=u:j.freeType(u)}else if("number"==typeof n[0]){e.dimension=o;var h=j.allocType(e.dtype,n.length);q(h,n),c(e,h,r),a?e.persistentData=h:j.freeType(h)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||H(n[0])||5126,c(e,u=V(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=u:j.freeType(u)):_.raise("invalid buffer data")}else if(t(n))e.dtype=i||H(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(B(n)){s=n.shape;var d=n.stride,p=n.offset,g=0,v=0,m=0,y=0;1===s.length?(g=s[0],v=1,m=d[0],y=0):2===s.length?(g=s[0],v=s[1],m=d[0],y=d[1]):_.raise("invalid shape"),e.dtype=i||H(n.data)||5126,e.dimension=v;var b=j.allocType(e.dtype,g*v);Q(b,n.data,g,v,m,y,p),c(e,b,r),a?e.persistentData=b:j.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=5121,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):_.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;_(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,u,c){n.bufferCount++;var h=new s(o);function d(n){var i=35044,o=null,a=0,s=0,u=1;return Array.isArray(n)||t(n)||B(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(_.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(_(null===o||Array.isArray(o)||t(o)||B(o),"invalid data for buffer"),o=n.data),"usage"in n&&(_.parameter(n.usage,W,"invalid buffer usage"),i=W[n.usage]),"type"in n&&(_.parameter(n.type,z,"invalid buffer type"),s=z[n.type]),"dimension"in n&&(_.type(n.dimension,"number","invalid dimension"),u=0|n.dimension),"length"in n&&(_.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?f(h,o,i,s,u,c):(a&&e.bufferData(h.type,a,i),h.dtype=s||5121,h.usage=i,h.dimension=u,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*Y[h.dtype]),d}function p(t,n){_(n+t.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),e.bufferSubData(h.type,n,t)}return a[h.id]=h,u||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(e,n){var r,i=0|(n||0);if(h.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=j.allocType(h.dtype,e.length);q(o,e),p(o,i),j.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=X(e);var a=V(e,r,h.dtype);p(a,i),j.freeType(a)}else _.raise("invalid buffer data")}else if(B(e)){r=e.shape;var s=e.stride,u=0,c=0,f=0,l=0;1===r.length?(u=r[0],c=1,f=s[0],l=0):2===r.length?(u=r[0],c=r[1],f=s[0],l=s[1]):_.raise("invalid shape");var g=Array.isArray(e.data)?h.dtype:H(e.data),v=j.allocType(g,u*c);Q(v,e.data,u,c,f,l,e.offset),p(v,i),j.freeType(v)}else _.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){L(a).forEach(l),u.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){L(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,h,r,(function(t){return w.destroyBuffer(t)})),w=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u<a;++u)s[u]=new Dt;var c=0,f={},l={Record:Dt,scope:{},state:s,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&L(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function s(e){_(Array.isArray(e),"arguments to vertex array constructor must be an array"),_(e.length<a,"too many attributes"),_(e.length>0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=u[c]=new Dt,d=l.data||l;Array.isArray(d)||t(d)||B(d)?(r.buffers[c]&&(f=r.buffers[c],t(d)&&f._buffer.byteLength>=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(_.parameter(l.type,z,"invalid buffer type"),h.type=z[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,_(h.size>=1&&h.size<=4,"size must be between 1 and 4"),_(h.offset>=0,"invalid offset"),_(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),_(h.divisor>=0,"divisor must be positive"),_(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(_(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):_(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),s}return i.vaoCount+=1,s.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},s._vao=r,s._reglType="vao",s(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<s.length;++n){var r=s[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(t){if(t!==l.currentVAO){var e=h();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<s.length;++r){var i=s[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:h()?function(){L(f).forEach((function(t){t.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=h();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=h();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=h();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,d,b,h,x),E=function(e,n,r,i){var o={},a=0,s={uint8:5121,uint16:5123};function u(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(s.uint32=5125),u.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,s,u,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!B(o)||t(o.data))||(h=n.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,o,a,h,3)}else e.bufferData(34963,c,a),i.buffer.dtype=l||5121,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125;break;default:_.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,_(5125!==l||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=u;d<0&&(d=i.buffer.byteLength,5123===l?d>>=1:5125===l&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function l(t){i.elementsCount--,_(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,l=0,h=0;Array.isArray(e)||t(e)||B(e)?n=e:(_.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,_(Array.isArray(n)||t(n)||B(n),"invalid data for element buffer")),"usage"in e&&(_.parameter(e.usage,W,"invalid element buffer usage"),r=W[e.usage]),"primitive"in e&&(_.parameter(e.primitive,Z,"invalid element buffer primitive"),i=Z[e.primitive]),"count"in e&&(_("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(_.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?l=0|e.length:(l=u,5123===h||5122===h?l*=2:5125!==h&&5124!==h||(l*=4))),f(a,n,r,i,u,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new u(r.create(null,34963,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){L(o).forEach(l)}}}(i,d,x,h),S=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var s=35632===e?o:a,u=s[r];if(!u){var c=n.str(r);u=t.createShader(e),t.shaderSource(u,c),t.compileShader(u),_.shaderError(t,u,c,e,i),s[r]=u}return u}var f={},l=[],h=0;function d(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),h=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,l),t.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),_.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var g=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=g);var v=e.uniforms;for(a=0;a<g;++a)if(f=t.getActiveUniform(d,a))if(f.size>1)for(var m=0;m<f.size;++m){var y=f.name.replace("[0]","["+m+"]");u(v,new s(y,n.id(y),t.getUniformLocation(d,y),f))}else u(v,new s(f.name,n.id(f.name),t.getUniformLocation(d,f.name),f));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var x=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(d,a))&&u(x,new s(f.name,n.id(f.name),t.getAttribLocation(d,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);L(o).forEach(e),o={},L(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,s,u){_.command(n>=0,"missing vertex shader",s),_.command(i>=0,"missing fragment shader",s);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!u))return h;var g=new d(i,n);return r.shaderCount++,p(g,s,u),h||(c[n]=g),l.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=l.indexOf(g);l.splice(e,1),r.shaderCount--}c[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete f[g.fragId][g.vertId]),Object.keys(f[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete f[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,l,h,r),M=Mt(i,d,b,(function(){C.procs.poll()}),y,h,r),O=function(t,e,n,r,i){var o={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var s=[];Object.keys(o).forEach((function(t){var e=o[t];s[e]=t}));var u=0,c={};function f(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function l(e){var n=e.renderbuffer;_(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete c[e.id],r.renderbufferCount--}return f.prototype.decRef=function(){--this.refCount<=0&&l(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,u){var l=new f(t.createRenderbuffer());function h(e,r){var u=0,c=0,f=32854;if("object"===a(e)&&e){var d=e;if("shape"in d){var p=d.shape;_(Array.isArray(p)&&p.length>=2,"invalid renderbuffer shape"),u=0|p[0],c=0|p[1]}else"radius"in d&&(u=c=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(c=0|d.height);"format"in d&&(_.parameter(d.format,o,"invalid renderbuffer format"),f=o[d.format])}else"number"==typeof e?(u=0|e,c="number"==typeof r?0|r:u):e?_.raise("invalid arguments to renderbuffer constructor"):u=c=1;if(_(u>0&&c>0&&u<=n.maxRenderbufferSize&&c<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==l.width||c!==l.height||f!==l.format)return h.width=l.width=u,h.height=l.height=c,l.format=f,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,f,u,c),_(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=At(l.format,l.width,l.height)),h.format=s[l.format],h}return c[l.id]=l,r.renderbufferCount++,h(e,u),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(_(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),_(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=At(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){L(c).forEach(l)},restore:function(){L(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,d,b,h,r),I=function(t,n,r,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},c=["rgba"],f=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&f.push("srgba"),n.ext_color_buffer_half_float&&f.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&f.push("rgba32f");var l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);_(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;_(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function g(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=3553,n=null,r=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),_.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,_(3553===e)):"textureCube"===o?(n=i,_(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):_.raise("invalid regl object for attachment"),new h(e,n,r)}function m(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(3553,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(36161,null,u)}function y(t){return t&&(t.texture||t.renderbuffer)}function b(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var x=0,w={};function E(){this.id=x++,w[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function M(e){var n=e.framebuffer;_(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,s.framebufferCount--,delete w[e.id]}function O(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)g(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),g(36096,e.depthAttachment),g(36128,e.stencilAttachment),g(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(36160);t.isContextLost()||36053===o||_.raise("framebuffer configuration not supported, status = "+Pt[o]),t.bindFramebuffer(36160,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function A(t,i){var o=new E;function a(t,e){var i;_(u.next!==o,"can not update framebuffer which is currently in use");var s=0,h=0,d=!0,g=!0,b=null,x=!0,w="rgba",E="uint8",M=1,A=null,k=null,T=null,I=!1;if("number"==typeof t)s=0|t,h=0|e||s;else if(t){_.type(t,"object","invalid arguments for framebuffer");var C=t;if("shape"in C){var P=C.shape;_(Array.isArray(P)&&P.length>=2,"invalid shape for framebuffer"),s=P[0],h=P[1]}else"radius"in C&&(s=h=C.radius),"width"in C&&(s=C.width),"height"in C&&(h=C.height);("color"in C||"colors"in C)&&(b=C.color||C.colors,Array.isArray(b)&&_(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in C&&(M=0|C.colorCount,_(M>0,"invalid color buffer count")),"colorTexture"in C&&(x=!!C.colorTexture,w="rgba4"),"colorType"in C&&(E=C.colorType,x?(_(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),_(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(_(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==E&&"float32"!==E||(_(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),_.oneOf(E,l,"invalid color type")),"colorFormat"in C&&(w=C.colorFormat,c.indexOf(w)>=0?x=!0:f.indexOf(w)>=0?x=!1:x?_.oneOf(C.colorFormat,c,"invalid color format for texture"):_.oneOf(C.colorFormat,f,"invalid color format for renderbuffer"))),("depthTexture"in C||"depthStencilTexture"in C)&&(I=!(!C.depthTexture&&!C.depthStencilTexture),_(!I||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in C&&("boolean"==typeof C.depth?d=C.depth:(A=C.depth,g=!1)),"stencil"in C&&("boolean"==typeof C.stencil?g=C.stencil:(k=C.stencil,d=!1)),"depthStencil"in C&&("boolean"==typeof C.depthStencil?d=g=C.depthStencil:(T=C.depthStencil,d=!1,g=!1))}else s=h=1;var D=null,N=null,R=null,j=null;if(Array.isArray(b))D=b.map(v);else if(b)D=[v(b)];else for(D=new Array(M),i=0;i<M;++i)D[i]=m(s,h,x,w,E);_(n.webgl_draw_buffers||D.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),_(D.length<=r.maxColorAttachments,"too many color attachments, not supported"),s=s||D[0].width,h=h||D[0].height,A?N=v(A):d&&!g&&(N=m(s,h,I,"depth","uint32")),k?R=v(k):g&&!d&&(R=m(s,h,!1,"stencil","uint8")),T?j=v(T):!A&&!k&&g&&d&&(j=m(s,h,I,"depth stencil","depth stencil")),_(!!A+!!k+!!T<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var B=null;for(i=0;i<D.length;++i)if(p(D[i],s,h),_(!D[i]||D[i].texture&&kt.indexOf(D[i].texture._texture.format)>=0||D[i].renderbuffer&&Ct.indexOf(D[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),D[i]&&D[i].texture){var L=Tt[D[i].texture._texture.format]*It[D[i].texture._texture.type];null===B?B=L:_(B===L,"all color attachments much have the same number of bits per pixel.")}return p(N,s,h),_(!N||N.texture&&6402===N.texture._texture.format||N.renderbuffer&&33189===N.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),p(R,s,h),_(!R||R.renderbuffer&&36168===R.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),p(j,s,h),_(!j||j.texture&&34041===j.texture._texture.format||j.renderbuffer&&34041===j.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=s,o.height=h,o.colorAttachments=D,o.depthAttachment=N,o.stencilAttachment=R,o.depthStencilAttachment=j,a.color=D.map(y),a.depth=y(N),a.stencil=y(R),a.depthStencil=y(j),a.width=o.width,a.height=o.height,O(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){_(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return a;for(var i=o.colorAttachments,s=0;s<i.length;++s)b(i[s],n,r);return b(o.depthAttachment,n,r),b(o.stencilAttachment,n,r),b(o.depthStencilAttachment,n,r),o.width=a.width=n,o.height=a.height=r,O(o),a},_reglType:"framebuffer",_framebuffer:o,destroy:function(){M(o),S(o)},use:function(t){u.setFBO({framebuffer:a},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof E)return e}return null},create:A,createCube:function(t){var o=Array(6);function a(t){var r;_(o.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var s,f={color:null},h=0,d=null,p="rgba",g="uint8",v=1;if("number"==typeof t)h=0|t;else if(t){_.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;_(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),_(y[0]===y[1],"cube framebuffer must be square"),h=y[0]}else"radius"in m&&(h=0|m.radius),"width"in m?(h=0|m.width,"height"in m&&_(m.height===h,"must be square")):"height"in m&&(h=0|m.height);("color"in m||"colors"in m)&&(d=m.color||m.colors,Array.isArray(d)&&_(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in m&&(v=0|m.colorCount,_(v>0,"invalid color buffer count")),"colorType"in m&&(_.oneOf(m.colorType,l,"invalid color type"),g=m.colorType),"colorFormat"in m&&(p=m.colorFormat,_.oneOf(m.colorFormat,c,"invalid color format for texture"))),"depth"in m&&(f.depth=m.depth),"stencil"in m&&(f.stencil=m.stencil),"depthStencil"in m&&(f.depthStencil=m.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(s=[],r=0;r<d.length;++r)s[r]=d[r];else s=[d];else{s=Array(v);var b={radius:h,format:p,type:g};for(r=0;r<v;++r)s[r]=i.createCube(b)}for(f.color=Array(s.length),r=0;r<s.length;++r){var x=s[r];_("function"==typeof x&&"textureCube"===x._reglType,"invalid cube map"),h=h||x.width,_(x.width===h&&x.height===h,"invalid cube map shape"),f.color[r]={target:34069,data:s[r]}}for(r=0;r<6;++r){for(var w=0;w<s.length;++w)f.color[w].target=34069+r;r>0&&(f.depth=o[0].depth,f.stencil=o[0].stencil,f.depthStencil=o[0].depthStencil),o[r]?o[r](f):o[r]=A(f)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(_(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){L(w).forEach(M)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,L(w).forEach((function(e){e.framebuffer=t.createFramebuffer(),O(e)}))}})}(i,d,b,M,O,h),C=fe(i,l,d,b,x,E,0,I,{},w,S,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,p,r),D=Nt(i,I,C.procs.poll,y,o,d,b),N=C.next,R=i.canvas,G=[],F=[],U=[],K=[r.onDestroy],$=null;function J(){if(0===G.length)return p&&p.update(),void($=null);$=k.next(J),ct();for(var t=G.length-1;t>=0;--t){var e=G[t];e&&e(y,null,0)}i.flush(),p&&p.update()}function tt(){!$&&G.length>0&&($=k.next(J))}function et(){$&&(k.cancel(J),$=null)}function nt(t){t.preventDefault(),s=!0,et(),F.forEach((function(t){t()}))}function rt(t){i.getError(),s=!1,u.restore(),S.restore(),x.restore(),M.restore(),O.restore(),I.restore(),w.restore(),p&&p.restore(),C.procs.refresh(),tt(),U.forEach((function(t){t()}))}function it(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(A.isDynamic(o))r[i]=A.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(A.isDynamic(o[a]))return void(r[i]=A.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}_(!!t,"invalid args to regl({...})"),_.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),a=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),u={gpuTime:0,cpuTime:0,count:0},c=C.compile(a,o,i,r,u),f=c.draw,l=c.batch,h=c.scope,d=[];return e((function(t,e){var n;if(s&&_.raise("context lost"),"function"==typeof t)return h.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)h.call(this,null,e,n);else{if(!Array.isArray(t))return h.call(this,t,e,0);for(n=0;n<t.length;++n)h.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:u,destroy:function(){c.destroy()}})}R&&(R.addEventListener("webglcontextlost",nt,!1),R.addEventListener("webglcontextrestored",rt,!1));var ot=I.setFBO=it({framebuffer:A.define.call(null,1,"framebuffer")});function at(t,e){var n=0;C.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),_(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function st(t){return _.type(t,"function","regl.frame() callback must be a function"),G.push(t),tt(),{cancel:function(){var e=he(G,t);_(e>=0,"cannot cancel a frame twice"),G[e]=function t(){var e=he(G,t);G[e]=G[G.length-1],G.length-=1,G.length<=0&&et()}}}}function ut(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ct(){y.tick+=1,y.time=lt(),ut(),C.procs.poll()}function ft(){M.refresh(),ut(),C.procs.refresh(),p&&p.update()}function lt(){return(T()-g)/1e3}ft();var ht=e(it,{clear:function(t){if(_("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)ot(e({framebuffer:t.framebuffer.faces[n]},t),at);else ot(t,at);else at(0,t)},prop:A.define.bind(null,1),context:A.define.bind(null,2),this:A.define.bind(null,3),draw:it({}),buffer:function(t){return x.create(t,34962,!1,!1)},elements:function(t){return E.create(t,!1)},texture:M.create2D,cube:M.createCube,renderbuffer:O.create,framebuffer:I.create,framebufferCube:I.createCube,vao:w.createVAO,attributes:o,frame:st,on:function(t,e){var n;switch(_.type(e,"function","listener callback must be a function"),t){case"frame":return st(e);case"lost":n=F;break;case"restore":n=U;break;case"destroy":n=K;break;default:_.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:b,hasExtension:function(t){return b.extensions.indexOf(t.toLowerCase())>=0},read:D,destroy:function(){G.length=0,et(),R&&(R.removeEventListener("webglcontextlost",nt),R.removeEventListener("webglcontextrestored",rt)),S.clear(),I.clear(),O.clear(),M.clear(),E.clear(),x.clear(),w.clear(),p&&p.clear(),K.forEach((function(t){t()}))},_gl:i,_refresh:ft,poll:function(){ct(),p&&p.update()},now:lt,stats:h});return r.onDone(null,ht),ht}},"object"===a(e)&&void 0!==t?t.exports=o():void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e,n){"use strict";t.exports=function(t,e,n,r){try{try{var i;try{i=new window.Blob([t])}catch(e){(i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),i=i.getBlob()}var o=window.URL||window.webkitURL,a=o.createObjectURL(i),s=new window[e](a,n);return o.revokeObjectURL(a),s}catch(r){return new window[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new window[e](r,n)}}},,,,,,,,function(t){t.exports=JSON.parse('{"name":"@antv/g-base","version":"0.5.1","description":"A common util collection for antv projects","main":"lib/index.js","module":"esm/index.js","types":"lib/index.d.ts","files":["package.json","esm","lib","LICENSE","README.md"],"scripts":{"build":"npm run clean && run-p build:*","build:esm":"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm","build:cjs":"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib","clean":"rm -rf esm lib","watch:cjs":"tsc-watch -p tsconfig.json --target ES5 --module commonjs --outDir lib --compiler typescript/bin/tsc","coverage":"npm run coverage-generator && npm run coverage-viewer","coverage-generator":"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts","coverage-viewer":"torch-coverage","test":"torch --renderer --compile --opts tests/mocha.opts","test-live":"torch --compile --interactive tests/unit","tsc":"tsc --noEmit","typecheck":"tsc --noEmit"},"repository":{"type":"git","url":"git+https://github.com/antvis/util.git"},"keywords":["util","antv","g"],"publishConfig":{"access":"public"},"author":"https://github.com/orgs/antvis/people","license":"ISC","bugs":{"url":"https://github.com/antvis/util/issues"},"devDependencies":{"@antv/torch":"^1.0.0","gl-matrix":"^3.0.0","less":"^3.9.0","npm-run-all":"^4.1.5","tsc-watch":"^4.0.0"},"homepage":"https://github.com/antvis/util#readme","dependencies":{"@antv/event-emitter":"^0.1.1","@antv/g-math":"^0.1.5","@antv/matrix-util":"^3.1.0-beta.1","@antv/path-util":"~2.0.5","@antv/util":"~2.0.0","@types/d3-timer":"^1.0.9","d3-ease":"^1.0.5","d3-interpolate":"^1.3.2","d3-timer":"^1.0.9","detect-browser":"^5.1.0"},"__npminstall_done":true,"gitHead":"ba7ecf8b8deac37682414ac0b7fc2c3e903398bd","_from":"@antv/g-base@0.5.1","_resolved":"https://registry.npm.alibaba-inc.com/@antv/g-base/download/@antv/g-base-0.5.1.tgz"}')},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(68);e.default=function(t){return r.default(t)?"":t.toString()}},function(t,e,n){var r=n(285),i=n(286),o={};for(var a in r)r.hasOwnProperty(a)&&(o[r[a]]=a);var s=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}s.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=s.get.hsl(t),n="hsl";break;case"hwb":e=s.get.hwb(t),n="hwb";break;default:e=s.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},s.get.rgb=function(t){if(!t)return null;var e,n,i,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var a=2*n;o[n]=parseInt(e.slice(a,a+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(e=t.match(/(\D+)/))?"transparent"===e[1]?[0,0,0,0]:(o=r[e[1]])?(o[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},s.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},s.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},s.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},s.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},s.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(287),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},function(t,e){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){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)}var i=n(174),o=n(290),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===r(n))for(var i=n.length,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),a[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(174);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),o=Object.keys(r[i]),a=o.length,s=0;s<a;s++){var u=o[s],c=e[u];-1===c.distance&&(c.distance=e[i].distance+1,c.parent=i,n.unshift(u))}return e}function o(t,e){return function(n){return e(t(n))}}function a(t,e){for(var n=[e[t].parent,t],i=r[e[t].parent][t],a=e[t].parent;e[a].parent;)n.unshift(e[a].parent),i=o(r[e[a].parent][a],i),a=e[a].parent;return i.conversion=n,i}t.exports=function(t){for(var e=i(t),n={},r=Object.keys(e),o=r.length,s=0;s<o;s++){var u=r[s];null!==e[u].parent&&(n[u]=a(u,e))}return n}},function(t,e,n){"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(e,"__esModule",{value:!0});e.default=function(t){return"object"===r(t)&&null!==t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMethod=e.register=void 0;var r=new Map;e.register=function(t,e){r.set(t,e)},e.getMethod=function(t){return r.get(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(132);e.default=function(t){for(var e=t.attr().points,n=[],o=[],a=0;a<e.length;a++){var s=e[a];n.push(s[0]),o.push(s[1])}var u=r.getBBoxByArray(n,o),c=u.x,f=u.y,l={minX:c,minY:f,maxX:c+u.width,maxY:f+u.height};return{x:(l=i.mergeArrowBBox(t,l)).minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);e.default=function(t){for(var e=t.attr().points,n=[],i=[],o=0;o<e.length;o++){var a=e[o];n.push(a[0]),i.push(a[1])}return r.getBBoxByArray(n,i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(122);e.default=function(t){var e=t.attr(),n=e.x,i=e.y,o=e.text,a=e.fontSize,s=e.lineHeight,u=e.font;u||(u=r.assembleFont(e));var c,f=r.getTextWidth(o,u);if(f){var l=e.textAlign,h=e.textBaseline,d=r.getTextHeight(o,a,s),p={x:n,y:i-d};l&&("end"===l||"right"===l?p.x-=f:"center"===l&&(p.x-=f/2)),h&&("top"===h?p.y+=d:"middle"===h&&(p.y+=d/2)),c={x:p.x,y:p.y,width:f,height:d}}else c={x:n,y:i,width:0,height:0};return c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(162),i=n(66),o=n(300),a=n(163),s=n(131),u=n(132);function c(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),u=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-u)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||s.default(c,0))return{xExtra:0,yExtra:0};var f=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return f=f>Math.PI/2?Math.PI-f:f,l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(c/2-f)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(l-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}e.default=function(t){var e=t.attr(),n=e.path,s=e.stroke?e.lineWidth:0,f=function(t,e){for(var n=[],a=[],s=[],u=0;u<t.length;u++){var f=(b=t[u]).currentPoint,l=b.params,h=b.prePoint,d=void 0;switch(b.command){case"Q":d=r.default.box(h[0],h[1],l[1],l[2],l[3],l[4]);break;case"C":d=i.default.box(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var p=b.arcParams;d=o.default.box(p.cx,p.cy,p.rx,p.ry,p.xRotation,p.startAngle,p.endAngle);break;default:n.push(f[0]),a.push(f[1])}d&&(b.box=d,n.push(d.x,d.x+d.width),a.push(d.y,d.y+d.height)),e&&("L"===b.command||"M"===b.command)&&b.prePoint&&b.nextPoint&&s.push(b)}n=n.filter((function(t){return!Number.isNaN(t)})),a=a.filter((function(t){return!Number.isNaN(t)}));var g=Math.min.apply(null,n),v=Math.min.apply(null,a),m=Math.max.apply(null,n),y=Math.max.apply(null,a);if(0===s.length)return{x:g,y:v,width:m-g,height:y-v};for(u=0;u<s.length;u++){var b;(f=(b=s[u]).currentPoint)[0]===g?g-=c(b,e).xExtra:f[0]===m&&(m+=c(b,e).xExtra),f[1]===v?v-=c(b,e).yExtra:f[1]===y&&(y+=c(b,e).yExtra)}return{x:g,y:v,width:m-g,height:y-v}}(t.get("segments")||a.default(n),s),l=f.x,h=f.y,d={minX:l,minY:h,maxX:l+f.width,maxY:h+f.height};return{x:(d=u.mergeArrowBBox(t,d)).minX,y:d.minY,width:d.maxX-d.minX,height:d.maxY-d.minY}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(301);function o(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function a(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function s(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function u(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}e.default={box:function(t,e,n,r,i,s,u){for(var c=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),f=1/0,l=-1/0,h=[s,u],d=2*-Math.PI;d<=2*Math.PI;d+=Math.PI){var p=c+d;s<u?s<p&&p<u&&h.push(p):u<p&&p<s&&h.push(p)}for(d=0;d<h.length;d++){var g=o(t,0,n,r,i,h[d]);g<f&&(f=g),g>l&&(l=g)}var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,b=[s,u];for(d=2*-Math.PI;d<=2*Math.PI;d+=Math.PI){var x=v+d;s<u?s<x&&x<u&&b.push(x):u<x&&x<s&&b.push(x)}for(d=0;d<b.length;d++){var w=a(0,e,n,r,i,b[d]);w<m&&(m=w),w>y&&(y=w)}return{x:f,y:m,width:l-f,height:y-m}},length:function(t,e,n,r,i,o,a){},nearestPoint:function(t,e,n,r,o,a,c,f,l){var h=u(f-t,l-e,-o),d=h[0],p=h[1],g=i.default.nearestPoint(0,0,n,r,d,p),v=function(t,e,n,r){return(Math.atan2(r*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,r,g.x,g.y);v<a?g=s(n,r,a):v>c&&(g=s(n,r,c));var m=u(g.x,g.y,o);return{x:m[0]+t,y:m[1]+e}},pointDistance:function(t,e,n,i,o,a,s,u,c){var f=this.nearestPoint(t,e,n,i,u,c);return r.distance(f.x,f.y,u,c)},pointAt:function(t,e,n,r,i,s,u,c){var f=(u-s)*c+s;return{x:o(t,0,n,r,i,f),y:a(0,e,n,r,i,f)}},tangentAngle:function(t,e,n,i,o,a,s,u){var c=(s-a)*u+a,f=function(t,e,n,r,i,o,a,s){return-1*n*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}(0,0,n,i,o,0,0,c),l=function(t,e,n,r,i,o,a,s){return-1*n*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}(0,0,n,i,o,0,0,c);return r.piMod(Math.atan2(l,f))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);function i(t,e){var n=Math.abs(t);return e>0?n:-1*n}e.default={box:function(t,e,n,r){return{x:t-n,y:e-r,width:2*n,height:2*r}},length:function(t,e,n,r){return Math.PI*(3*(n+r)-Math.sqrt((3*n+r)*(n+3*r)))},nearestPoint:function(t,e,n,r,o,a){var s=n,u=r;if(0===s||0===u)return{x:t,y:e};for(var c,f,l=o-t,h=a-e,d=Math.abs(l),p=Math.abs(h),g=s*s,v=u*u,m=Math.PI/4,y=0;y<4;y++){c=s*Math.cos(m),f=u*Math.sin(m);var b=(g-v)*Math.pow(Math.cos(m),3)/s,x=(v-g)*Math.pow(Math.sin(m),3)/u,w=c-b,_=f-x,E=d-b,S=p-x,M=Math.hypot(_,w),O=Math.hypot(S,E);m+=M*Math.asin((w*S-_*E)/(M*O))/Math.sqrt(g+v-c*c-f*f),m=Math.min(Math.PI/2,Math.max(0,m))}return{x:t+i(c,l),y:e+i(f,h)}},pointDistance:function(t,e,n,i,o,a){var s=this.nearestPoint(t,e,n,i,o,a);return r.distance(s.x,s.y,o,a)},pointAt:function(t,e,n,r,i){var o=2*Math.PI*i;return{x:t+n*Math.cos(o),y:e+r*Math.sin(o)}},tangentAngle:function(t,e,n,i,o){var a=2*Math.PI*o,s=Math.atan2(i*Math.cos(a),-n*Math.sin(a));return r.piMod(s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(53),i=n(37),o=n(52),a=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,s=/[^\s\,]+/gi;e.default=function(t){var e=t||[];return i.default(e)?e:o.default(e)?(e=e.match(a),r.default(e,(function(t,n){if((t=t.match(s))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}r.default(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(132);e.default=function(t){var e=t.attr(),n=e.x1,i=e.y1,o=e.x2,a=e.y2,s={minX:Math.min(n,o),maxX:Math.max(n,o),minY:Math.min(i,a),maxY:Math.max(i,a)};return{x:(s=r.mergeArrowBBox(t,s)).minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;return{x:n-i,y:r-o,width:2*i,height:2*o}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(37),i="\t\n\v\f\r \u2028\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig");e.default=function(t){if(!t)return null;if(r.default(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(t,r,i){var o=[],s=r.toLowerCase();if(i.replace(a,(function(t,e){e&&o.push(+e)})),"m"===s&&o.length>2&&(n.push([r].concat(o.splice(0,2))),s="l",r="m"===r?"l":"L"),"o"===s&&1===o.length&&n.push([r,o[0]]),"r"===s)n.push([r].concat(o));else for(;o.length>=e[s]&&(n.push([r].concat(o.splice(0,e[s]))),e[s]););return""})),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distanceAtSegment=e.angleAtSegments=e.pointAtSegments=e.lengthOfSegment=void 0;var r=n(27),i=n(45);function o(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var o=t[r],a=t[r+1],s=i.distance(o[0],o[1],a[0],a[1]),u={from:o,to:a,length:s};n.push(u),e+=s}return{segments:n,totalLength:e}}e.lengthOfSegment=function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],o=t[n+1];e+=i.distance(r[0],r[1],o[0],o[1])}return e},e.pointAtSegments=function(t,e){if(e>1||e<0||t.length<2)return null;var n=o(t),i=n.segments,a=n.totalLength;if(0===a)return{x:t[0][0],y:t[0][1]};for(var s=0,u=null,c=0;c<i.length;c++){var f=i[c],l=f.from,h=f.to,d=f.length/a;if(e>=s&&e<=s+d){var p=(e-s)/d;u=r.default.pointAt(l[0],l[1],h[0],h[1],p);break}s+=d}return u},e.angleAtSegments=function(t,e){if(e>1||e<0||t.length<2)return 0;for(var n=o(t),r=n.segments,i=n.totalLength,a=0,s=0,u=0;u<r.length;u++){var c=r[u],f=c.from,l=c.to,h=c.length/i;if(e>=a&&e<=a+h){s=Math.atan2(l[1]-f[1],l[0]-f[0]);break}a+=h}return s},e.distanceAtSegment=function(t,e,n){for(var i=1/0,o=0;o<t.length-1;o++){var a=t[o],s=t[o+1],u=r.default.pointDistance(a[0],a[1],s[0],s[1],e,n);u<i&&(i=u)}return i}},function(t){t.exports=JSON.parse('{"name":"@antv/g-canvas","version":"0.5.3","description":"A canvas library which providing 2d","main":"lib/index.js","module":"esm/index.js","unpkg":"dist/g.min.js","types":"lib/index.d.ts","files":["package.json","esm","lib","dist","LICENSE","README.md"],"scripts":{"build":"npm run clean && run-p build:*","build:esm":"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm","build:cjs":"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib","build:umd":"webpack --config webpack.config.js --mode production","clean":"rm -rf esm lib dist","coverage":"npm run coverage-generator && npm run coverage-viewer","coverage-generator":"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts","coverage-viewer":"torch-coverage","test":"torch --renderer --compile --opts tests/mocha.opts","test-live":"torch --compile --interactive tests/unit","tsc":"tsc --noEmit","typecheck":"tsc --noEmit","dist":"webpack --config webpack.config.js --mode production"},"repository":{"type":"git","url":"git+https://github.com/antvis/g.git"},"keywords":["util","antv","g"],"publishConfig":{"access":"public"},"author":"https://github.com/orgs/antvis/people","license":"ISC","bugs":{"url":"https://github.com/antvis/g/issues"},"devDependencies":{"@antv/torch":"^1.0.0","less":"^3.9.0","npm-run-all":"^4.1.5","webpack":"^4.26.1","webpack-cli":"^3.1.2"},"homepage":"https://github.com/antvis/g#readme","dependencies":{"@antv/g-base":"^0.5.1","@antv/g-math":"^0.1.5","@antv/matrix-util":"^3.1.0-beta.1","@antv/path-util":"~2.0.5","@antv/util":"~2.0.0","gl-matrix":"^3.0.0"},"__npminstall_done":true,"gitHead":"32a887ab3fb022a62ac3d561a0d5931d4fda3763","_from":"@antv/g-canvas@0.5.3","_resolved":"https://registry.npm.alibaba-inc.com/@antv/g-canvas/download/@antv/g-canvas-0.5.3.tgz"}')},function(t){t.exports=JSON.parse('{"name":"@antv/g-svg","version":"0.5.2","description":"A canvas library which providing 2d","main":"lib/index.js","module":"esm/index.js","unpkg":"dist/g.min.js","types":"lib/index.d.ts","files":["package.json","esm","lib","dist","LICENSE","README.md"],"scripts":{"build":"npm run clean && run-p build:*","build:esm":"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm","build:cjs":"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib","build:umd":"webpack --config webpack.config.js --mode production","clean":"rm -rf esm lib dist","coverage":"npm run coverage-generator && npm run coverage-viewer","coverage-generator":"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts","coverage-viewer":"torch-coverage","test":"torch --renderer --compile --opts tests/mocha.opts","test-live":"torch --compile --interactive --opts tests/mocha.opts","tsc":"tsc --noEmit","typecheck":"tsc --noEmit"},"repository":{"type":"git","url":"git+https://github.com/antvis/g.git"},"keywords":["util","antv","g"],"publishConfig":{"access":"public"},"author":"https://github.com/orgs/antvis/people","license":"ISC","bugs":{"url":"https://github.com/antvis/g/issues"},"devDependencies":{"@antv/torch":"^1.0.0","less":"^3.9.0","npm-run-all":"^4.1.5","webpack":"^4.39.3","webpack-cli":"^3.3.7"},"homepage":"https://github.com/antvis/g#readme","dependencies":{"@antv/g-base":"^0.5.1","@antv/g-math":"^0.1.5","@antv/util":"~2.0.0","detect-browser":"^5.0.0"},"__npminstall_done":true,"gitHead":"0897860426646ae3ec41c74da25723ad071e83bb","_from":"@antv/g-svg@0.5.2","_resolved":"https://registry.npm.alibaba-inc.com/@antv/g-svg/download/@antv/g-svg-0.5.2.tgz"}')},function(t,e,n){var r=n(310);t.exports={Graph:r.Graph,json:n(411),alg:n(412),version:r.version}},function(t,e,n){t.exports={Graph:n(133),version:n(410)}},function(t,e,n){var r=n(183);t.exports=function(t){return r(t,4)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(97),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(97);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(97);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(97);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(96);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(96),i=n(134),o=n(135);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(80),i=n(325),o=n(36),a=n(186),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(a(t))}},function(t,e,n){var r=n(70),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(326),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(40)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(329),i=n(96),o=n(134);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(330),i=n(331),o=n(332),a=n(333),s=n(334);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(98);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(98),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(98),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(98);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(99);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){function n(t){return(n="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)}t.exports=function(t){var e=n(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(99);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(99);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(99);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(81),i=n(56);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(55),i=n(41);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(55),i=n(137),o=n(41),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(189)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(81),i=n(63);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(36),i=n(104),o=n(348),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(81),i=n(140);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(81),i=n(194);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(196),i=n(194),o=n(63);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(62)(n(40),"DataView");t.exports=r},function(t,e,n){var r=n(62)(n(40),"Promise");t.exports=r},function(t,e,n){var r=n(62)(n(40),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(142),i=n(357),o=n(358),a=n(359),s=n(199);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(t,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return o(t);case"[object Set]":return new u;case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(142);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(70),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},function(t,e,n){var r=n(361),i=n(103),o=n(138),a=o&&o.isMap,s=a?i(a):r;t.exports=s},function(t,e,n){var r=n(72),i=n(41);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(363),i=n(103),o=n(138),a=o&&o.isSet,s=a?i(a):r;t.exports=s},function(t,e,n){var r=n(72),i=n(41);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}},function(t,e,n){var r=n(49);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,s=Object(n);(e?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(t,e,n){var r=n(106);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},function(t,e,n){var r=n(368),i=n(376),o=n(211);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(95),i=n(206);t.exports=function(t,e,n,o){var a=n.length,s=a,u=!o;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var f=(c=n[a])[0],l=t[f],h=c[1];if(u&&c[2]){if(void 0===l&&!(f in t))return!1}else{var d=new r;if(o)var p=o(l,h,f,t,e,d);if(!(void 0===p?i(h,l,3,o,d):p))return!1}}return!0}},function(t,e,n){var r=n(95),i=n(207),o=n(373),a=n(375),s=n(72),u=n(20),c=n(71),f=n(38),l="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,d,p,g){var v=u(t),m=u(e),y=v?"[object Array]":s(t),b=m?"[object Array]":s(e),x=(y="[object Arguments]"==y?l:y)==l,w=(b="[object Arguments]"==b?l:b)==l,_=y==b;if(_&&c(t)){if(!c(e))return!1;v=!0,x=!1}if(_&&!x)return g||(g=new r),v||f(t)?i(t,e,n,d,p,g):o(t,e,y,n,d,p,g);if(!(1&n)){var E=x&&h.call(t,"__wrapped__"),S=w&&h.call(e,"__wrapped__");if(E||S){var M=E?t.value():t,O=S?e.value():e;return g||(g=new r),p(M,O,n,d,g)}}return!!_&&(g||(g=new r),a(t,e,n,d,p,g))}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(70),i=n(198),o=n(69),a=n(207),s=n(374),u=n(146),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,l,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var d=s;case"[object Set]":var p=1&r;if(d||(d=u),t.size!=e.size&&!p)return!1;var g=h.get(t);if(g)return g==e;r|=2,h.set(t,e);var v=a(d(t),d(e),r,c,l,h);return h.delete(t),v;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(195),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var u=1&n,c=r(t),f=c.length;if(f!=r(e).length&&!u)return!1;for(var l=f;l--;){var h=c[l];if(!(u?h in e:i.call(e,h)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);for(var v=u;++l<f;){var m=t[h=c[l]],y=e[h];if(o)var b=u?o(y,m,h,e,t,s):o(m,y,h,t,e,s);if(!(void 0===b?m===y||a(m,y,n,o,s):b)){g=!1;break}v||(v="constructor"==h)}if(g&&!v){var x=t.constructor,w=e.constructor;x==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(g=!1)}return s.delete(t),s.delete(e),g}},function(t,e,n){var r=n(210),i=n(56);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},function(t,e,n){var r=n(206),i=n(378),o=n(213),a=n(147),s=n(210),u=n(211),c=n(84);t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},function(t,e,n){var r=n(107);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(380),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(381);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(135);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(70),i=n(109),o=n(20),a=n(73),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(215),i=n(385),o=n(147),a=n(84);t.exports=function(t){return o(t)?r(a(t)):i(t)}},function(t,e,n){var r=n(107);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(139),i=n(72),o=n(82),a=n(20),s=n(49),u=n(71),c=n(104),f=n(38),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||f(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(l.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e){t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},function(t,e,n){var r=n(139),i=n(72),o=n(49),a=n(391),s=n(392);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?s(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},function(t,e,n){var r=n(55),i=n(20),o=n(41);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},function(t,e,n){var r=n(393),i=n(394),o=n(395);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e,n){var r=n(215)("length");t.exports=r},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?"+u+("(?:\\u200d(?:"+[o,a,s].join("|")+")[\\ufe0e\\ufe0f]?"+u+")*"),f="(?:"+[o+r+"?",r,a,s,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+f+c,"g");t.exports=function(t){for(var e=l.lastIndex=0;l.test(t);)++e;return e}},function(t,e,n){var r=n(136),i=n(201),o=n(144),a=n(50),s=n(105),u=n(20),c=n(71),f=n(80),l=n(36),h=n(38);t.exports=function(t,e,n){var d=u(t),p=d||c(t)||h(t);if(e=a(e,4),null==n){var g=t&&t.constructor;n=p?d?new g:[]:l(t)&&f(g)?i(s(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},function(t,e,n){var r=n(148),i=n(110),o=n(223),a=n(225),s=i((function(t){return o(r(t,1,a,!0))}));t.exports=s},function(t,e,n){var r=n(70),i=n(82),o=n(20),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(143),i=n(187),o=n(64),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(403);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(224),i=n(404),o=n(405);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(197),i=n(408),o=n(146),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(109);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e){t.exports="2.1.8"},function(t,e,n){var r=n(35),i=n(133);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};r.isUndefined(t.graph())||(e.value=r.clone(t.graph()));return e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},function(t,e,n){t.exports={components:n(413),dijkstra:n(227),dijkstraAll:n(414),findCycles:n(415),floydWarshall:n(416),isAcyclic:n(417),postorder:n(418),preorder:n(419),prim:n(420),tarjan:n(229),topsort:n(230)}},function(t,e,n){var r=n(35);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},function(t,e,n){var r=n(227),i=n(35);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},function(t,e,n){var r=n(35),i=n(229);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(35);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},function(t,e,n){var r=n(230);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},function(t,e,n){var r=n(231);t.exports=function(t,e){return r(t,e,"post")}},function(t,e,n){var r=n(231);t.exports=function(t,e){return r(t,e,"pre")}},function(t,e,n){var r=n(35),i=n(133),o=n(228);t.exports=function(t,e){var n,a=new i,s={},u=new o;function c(t){var r=t.v===n?t.w:t.v,i=u.priority(r);if(void 0!==i){var o=e(t);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){u.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),u.decrease(t.nodes()[0],0);var f=!1;for(;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(18),i=n(458),o=n(461),a=n(462),s=n(32).normalizeRanks,u=n(464),c=n(32).removeEmptyRanks,f=n(465),l=n(466),h=n(467),d=n(468),p=n(477),g=n(32),v=n(39).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=O(t.graph());return e.setGraph(r.merge({},y,M(n,m),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=O(t.node(n));e.setNode(n,r.defaults(M(i,x),w)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=O(t.edge(n));e.setEdge(n,r.merge({},E,M(i,_),r.pick(i,S)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){f.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){f.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){l(t)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function M(t,e){return r.mapValues(r.pick(t,e),Number)}function O(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(183);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(110),i=n(69),o=n(111),a=n(63),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var f=e[n],l=a(f),h=-1,d=l.length;++h<d;){var p=l[h],g=t[p];(void 0===g||i(g,s[p])&&!u.call(t,p))&&(t[p]=f[p])}return t}));t.exports=c},function(t,e,n){var r=n(425)(n(426));t.exports=r},function(t,e,n){var r=n(50),i=n(49),o=n(56);t.exports=function(t){return function(e,n,a){var s=Object(e);if(!i(e)){var u=r(n,3);e=o(e),n=function(t){return u(s[t],t,s)}}var c=t(e,n,a);return c>-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(224),i=n(50),o=n(427),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},function(t,e,n){var r=n(232);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(36),i=n(73),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(145),i=n(204),o=n(63);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(101),i=n(144),o=n(50);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(149),i=n(433),o=n(64);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(435),i=n(438)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(95),i=n(234),o=n(145),a=n(436),s=n(36),u=n(63),c=n(235);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(e,n,u,f,t,l,h);else{var d=l?l(c(e,u),o,u+"",e,n,h):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(234),i=n(190),o=n(199),a=n(191),s=n(200),u=n(82),c=n(20),f=n(225),l=n(71),h=n(80),d=n(36),p=n(164),g=n(38),v=n(235),m=n(437);t.exports=function(t,e,n,y,b,x,w){var _=v(t,n),E=v(e,n),S=w.get(E);if(S)r(t,n,S);else{var M=x?x(_,E,n+"",t,e,w):void 0,O=void 0===M;if(O){var A=c(E),k=!A&&l(E),T=!A&&!k&&g(E);M=E,A||k||T?c(_)?M=_:f(_)?M=a(_):k?(O=!1,M=i(E,!0)):T?(O=!1,M=o(E,!0)):M=[]:p(E)||u(E)?(M=_,u(_)?M=m(_):d(_)&&!h(_)||(M=s(E))):O=!1}O&&(w.set(E,M),b(M,E,y,x,w),w.delete(E)),r(t,n,M)}}},function(t,e,n){var r=n(81),i=n(63);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(110),i=n(111);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}},function(t,e,n){var r=n(149),i=n(236),o=n(64);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(149),i=n(50),o=n(236);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},function(t,e,n){var r=n(40);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(443),i=n(446)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},function(t,e,n){var r=n(444),i=n(213);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},function(t,e,n){var r=n(107),i=n(445),o=n(108);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],f=r(t,c);n(f,c)&&i(u,o(c,t),f)}return u}},function(t,e,n){var r=n(100),i=n(108),o=n(102),a=n(36),s=n(84);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,f=(e=i(e,t)).length,l=f-1,h=t;null!=h&&++c<f;){var d=s(e[c]),p=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(c!=l){var g=h[d];void 0===(p=u?u(g,d,h):void 0)&&(p=a(g)?g:o(e[c+1])?[]:{})}r(h,d,p),h=h[d]}return t}},function(t,e,n){var r=n(233),i=n(221),o=n(222);t.exports=function(t){return o(i(t,void 0,r),t+"")}},function(t,e,n){var r=n(448)();t.exports=r},function(t,e,n){var r=n(449),i=n(111),o=n(232);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,i,o){for(var a=-1,s=r(n((e-t)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=t,t+=i;return u}},function(t,e,n){var r=n(148),i=n(451),o=n(110),a=n(111),s=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(109),i=n(107),o=n(50),a=n(219),s=n(452),u=n(103),c=n(453),f=n(64),l=n(20);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(454);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(73);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,f=r(e);if(!u&&!f&&!a&&t>e||a&&s&&c&&!u&&!f||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!f&&t<e||f&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},function(t,e,n){var r=n(212),i=0;t.exports=function(t){var e=++i;return r(t)+e}},function(t,e,n){var r=n(100),i=n(457);t.exports=function(t,e){return i(t||[],e||[],r)}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}},function(t,e,n){"use strict";var r=n(18),i=n(459);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])}return r.forEach(t.nodes(),o),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},function(t,e,n){var r=n(18),i=n(39).Graph,o=n(460);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),s=Math.max(s,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),f=a+1;return r.forEach(n.nodes(),(function(t){u(c,f,n.node(t))})),{graph:n,buckets:c,zeroIdx:f}}(t,e||a),c=function(t,e,n){var r,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;r=a.dequeue();)s(t,e,n,r);for(;r=o.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,u(e,n,a)})),t.removeNode(i.v),a}function u(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(18),i=n(32);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,f=e.name,l=t.edge(e),h=l.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;s<c;++o,++s)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:s},n=i.addDummyNode(t,"edge",r,"_d"),s===h&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(a,n,{weight:l.weight},f),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,u,{weight:l.weight},f)}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},function(t,e,n){"use strict";var r=n(112).longestPath,i=n(237),o=n(463);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":s(t);break;case"tight-tree":!function(t){r(t),i(t)}(t);break;case"longest-path":a(t);break;default:s(t)}};var a=r;function s(t){o(t)}},function(t,e,n){"use strict";var r=n(18),i=n(237),o=n(112).slack,a=n(112).longestPath,s=n(39).alg.preorder,u=n(39).alg.postorder,c=n(32).simplify;function f(t){t=c(t),a(t);var e,n=i(t);for(d(n),l(n,t);e=g(n);)m(n,t,e,v(n,t,e))}function l(t,e){var n=u(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=h(t,e,n)}(t,e,n)}))}function h(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),s=0;return a||(o=!1,a=e.edge(i,n)),s=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,u,c=r.v===n,f=c?r.w:r.v;if(f!==i){var l=c===o,h=e.edge(r).weight;if(s+=l?h:-h,a=n,u=f,t.hasEdge(a,u)){var d=t.edge(n,f).cutvalue;s+=l?-d:d}}})),s}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,s=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function v(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var s=t.node(i),u=t.node(a),c=s,f=!1;s.lim>u.lim&&(c=u,f=!0);var l=r.filter(e.edges(),(function(e){return f===y(t,t.node(e.v),c)&&f!==y(t,t.node(e.w),c)}));return r.minBy(l,(function(t){return o(e,t)}))}function m(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),l(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=f,f.initLowLimValues=d,f.initCutValues=l,f.calcCutValue=h,f.leaveEdge=g,f.enterEdge=v,f.exchangeEdges=m},function(t,e,n){var r=n(18);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[u])!==s&&t.node(c).maxRank<r.rank;)u++;c===s&&(f=!1)}if(!f){for(;u<a.length-1&&t.node(c=a[u+1]).minRank<=r.rank;)u++;c=a[u]}t.setParent(n,c),n=t.successors(n)[0]}}))}},function(t,e,n){var r=n(18),i=n(32);t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};return r.forEach(t.children(),(function(n){!function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)}));e[i]=o}(n,1)})),e}(t),o=r.max(r.values(n))-1,a=2*o+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=a}));var s=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(u){!function t(e,n,o,a,s,u,c){var f=e.children(c);if(!f.length)return void(c!==n&&e.setEdge(n,c,{weight:0,minlen:o}));var l=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),d=e.node(c);e.setParent(l,c),d.borderTop=l,e.setParent(h,c),d.borderBottom=h,r.forEach(f,(function(r){t(e,n,o,a,s,u,r);var i=e.node(r),f=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,g=f!==d?1:s-u[c]+1;e.setEdge(l,f,{weight:p,minlen:g,nestingEdge:!0}),e.setEdge(d,h,{weight:p,minlen:g,nestingEdge:!0})})),e.parent(c)||e.setEdge(n,l,{weight:0,minlen:s+u[c]})}(t,e,a,s,o,n,u)})),t.graph().nodeRankFactor=a},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},function(t,e,n){var r=n(18),i=n(32);function o(t,e,n,r,o,a){var s={width:0,height:0,rank:a,borderType:e},u=o[e][a-1],c=i.addDummyNode(t,"border",s,n);o[e][a]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(t,"borderLeft","_bl",n,a,s),o(t,"borderRight","_br",n,a,s)}}))}},function(t,e,n){"use strict";var r=n(18);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function s(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){r.forEach(t.nodes(),(function(e){s(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(t),i(t))}}},function(t,e,n){"use strict";var r=n(18),i=n(469),o=n(470),a=n(471),s=n(475),u=n(476),c=n(39).Graph,f=n(32);function l(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function h(t,e){var n=new c;r.forEach(t,(function(t){var i=t.graph().root,o=a(t,i,n,e);r.forEach(o.vs,(function(e,n){t.node(e).order=n})),u(t,n,o.vs)}))}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=f.maxRank(t),n=l(t,r.range(1,e+1),"inEdges"),a=l(t,r.range(e-1,-1,-1),"outEdges"),s=i(t);d(t,s);for(var u,c=Number.POSITIVE_INFINITY,p=0,g=0;g<4;++p,++g){h(p%2?n:a,p%4>=2),s=f.buildLayerMatrix(t);var v=o(t,s);v<c&&(g=0,u=r.cloneDeep(s),c=v)}d(t,u)}},function(t,e,n){"use strict";var r=n(18);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(e){return t.node(e).rank}));return r.forEach(a,(function n(i){if(r.has(e,i))return;e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)})),o}},function(t,e,n){"use strict";var r=n(18);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},function(t,e,n){var r=n(18),i=n(472),o=n(473),a=n(474);t.exports=function t(e,n,s,u){var c=e.children(n),f=e.node(n),l=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};l&&(c=r.filter(c,(function(t){return t!==l&&t!==h})));var p=i(e,c);r.forEach(p,(function(n){if(e.children(n.v).length){var i=t(e,n.v,s,u);d[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(p,s);!function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(g,d);var v=a(g,u);if(l&&(v.vs=r.flatten([l,v.vs,h],!0),e.predecessors(l).length)){var m=e.node(e.predecessors(l)[0]),y=e.node(e.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+m.order+y.order)/(v.weight+2),v.weight+=2}return v}},function(t,e,n){var r=n(18);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},function(t,e,n){"use strict";var r=n(18);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(18),i=n(32);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e){var n=i.partition(t,(function(t){return r.has(t,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(t){return-t.i})),u=[],c=0,f=0,l=0;a.sort((h=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:h?e.i-t.i:t.i-e.i})),l=o(u,s,l),r.forEach(a,(function(t){l+=t.vs.length,u.push(t.vs),c+=t.barycenter*t.weight,f+=t.weight,l=o(u,s,l)}));var h;var d={vs:r.flatten(u,!0)};f&&(d.barycenter=c/f,d.weight=f);return d}},function(t,e,n){var r=n(18),i=n(39).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),u=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},function(t,e,n){var r=n(18);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},function(t,e,n){"use strict";var r=n(18),i=n(32),o=n(478).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(18),i=n(39).Graph,o=n(32);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,f){var l=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=l?t.node(l).order:s;(l||e===c)&&(r.forEach(i.slice(a,f+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||h<a)||i.dummy&&t.node(e).dummy||u(n,r,e)}))})),a=f+1,o=h)})),i})),n}function s(t,e){var n={};function i(e,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function f(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=i(t);if(u.length)for(var f=((u=r.sortBy(u,(function(t){return s[t]}))).length-1)/2,l=Math.floor(f),h=Math.ceil(f);l<=h;++l){var d=u[l];a[t]===t&&e<s[d]&&!c(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],e=s[d])}}))})),{root:o,align:a}}function l(t,e,n,o,a){var s={},u=function(t,e,n,o){var a=new i,s=t.graph(),u=function(t,e,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),f=0;if(f+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(f+=n?s:-s),s=0,f+=(u.dummy?e:t)/2,f+=(c.dummy?e:t)/2,f+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(f+=n?s:-s),s=0,f}}(s.nodesep,s.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(t,e,i),s||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function f(t,e){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return f((function(t){s[t]=u.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),f((function(e){var n=u.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[e]=Math.max(s[e],n))}),u.successors.bind(u)),r.forEach(o,(function(t){s[t]=s[n[t]]})),s}function h(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function d(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=t[u];if(c!==e){var f=r.values(c);(s="l"===a?i-r.min(f):o-r.max(f))&&(t[u]=r.mapValues(c,(function(t){return t+s})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),s(t,n)),u={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=f(t,e,i,a),c=l(t,e,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),u[o+n]=c}))}));var c=h(t,u);return d(u,c),p(u,t.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:c,verticalAlignment:f,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:h,balance:p}},function(t,e,n){var r=n(18),i=n(32),o=n(39).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},function(t,e){t.exports="0.8.5"},function(t,e,n){(function(t){function e(t){return(e="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)}var n=function(t){"use strict";var n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function h(){}function d(){}function p(){}var g={};g[o]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(M([])));m&&m!==n&&r.call(m,o)&&(g=m);var y=p.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,n){var i;this._invoke=function(o,a){function s(){return new n((function(i,s){!function i(o,a,s,u){var c=f(t[o],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"===e(h)&&r.call(h,"__await")?n.resolve(h.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):n.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return i("throw",t,s,u)}))}u(c.arg)}(o,a,i,s)}))}return i=i?i.then(s,s):s()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function M(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=y.constructor=p,p.constructor=d,d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(x.prototype),x.prototype[a]=function(){return this},t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),u(y,s,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=M,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}}).call(this,n(83)(t))},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){"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)}var i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(486),s=n(34),u=n(51),c=n(26),f=n(241),l=n(487),h=n(494),d=n(496),p=n(65),g=n(85),v=n(499),m=n(500),y=function(){function t(t){var e=t||{};if("object"!==r(e))throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=u.BindingScopeEnum.Transient;else if(e.defaultScope!==u.BindingScopeEnum.Singleton&&e.defaultScope!==u.BindingScopeEnum.Transient&&e.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new m.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){var r=new t,i=l.getBindingDictionary(r),o=l.getBindingDictionary(e),a=l.getBindingDictionary(n);function s(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s(o,i),s(a,i),r},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){var e,n,r,i,a;return o(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,o.label=1;case 1:return n<r.length?(i=r[n],a=e(i.id),[4,i.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||u.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(s.CANNOT_UNBIND+" "+g.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new m.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(v.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(s.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,u.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,u.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,u.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,u={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),h.resolve(n)}},t}();e.Container=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(51),i=n(65),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(488),i=n(34),o=n(51),a=n(26),s=n(242),u=n(85),c=n(489),f=n(42),l=n(490),h=n(491),d=n(493),p=n(244);function g(t){return t._bindingDictionary}function v(t,e,n,o,a){var s=m(n.container,a.serviceIdentifier),c=[];return s.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),s=m(n.container,a.serviceIdentifier)),c=e?s:s.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=u.getServiceIdentifierAsString(t),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,n),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;a=u.getServiceIdentifierAsString(t),s=i.AMBIGUOUS_MATCH+" "+a;throw s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s)}}(a.serviceIdentifier,c,a,n.container),c}function m(t,e){var n=[],r=g(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=g,e.plan=function(t,e,n,r,g,m,y,b){void 0===b&&(b=!1);var x=new c.Context(e),w=function(t,e,n,r,i,o){var s=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new f.Metadata(s,n),c=new p.Target(e,r,n,u);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,g,"",m,y);try{return function t(e,n,r,a,s,u){var c,f;if(null===s){c=v(e,n,a,null,u),f=new d.Request(r,a,null,c,u);var p=new l.Plan(a,f);a.addPlan(p)}else c=v(e,n,a,s,u),f=s.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(n){var r=null;if(u.isArray())r=f.addChildRequest(n.serviceIdentifier,n,u);else{if(n.cache)return;r=f}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var s=h.getDependencies(e,n.implementationType);if(!a.container.options.skipBaseClassChecks){var c=h.getBaseClassDependencyCount(e,n.implementationType);if(s.length<c){var l=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(n.implementationType));throw new Error(l)}}s.forEach((function(n){t(e,!1,n.serviceIdentifier,a,r,n)}))}}))}(t,b,g,x,null,w),x}catch(t){throw s.isStackOverflowExeption(t)&&x.plan&&u.circularDependencyToException(x.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(65),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){this.parentContext=t,this.rootRequest=e};e.Plan=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(243),i=n(34),o=n(51),a=n(26),s=n(85);e.getFunctionName=s.getFunctionName;var u=n(244);function c(t,e,n,r){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s){var c=i.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(c)}var h=a.userGeneratedMetadata,d=Object.keys(h),p=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var s=f(a,t,e,n,r);null!==s&&o.push(s)}return o}(r,e,s,h,0===n.length&&d.length>0?d.length:n.length),g=function t(e,n){for(var r=e.getPropertiesMetadata(n),i=[],a=Object.keys(r),s=0,c=a;s<c.length;s++){var f=c[s],h=r[f],d=l(r[f]),p=d.targetName||f,g=d.inject||d.multiInject,v=new u.Target(o.TargetTypeEnum.ClassProperty,p,g);v.metadata=h,i.push(v)}var m=Object.getPrototypeOf(n.prototype).constructor;if(m!==Object){var y=t(e,m);i=i.concat(y)}return i}(t,n);return p.concat(g)}function f(t,e,n,a,s){var c=s[t.toString()]||[],f=l(c),h=!0!==f.unmanaged,d=a[t],p=f.inject||f.multiInject;if((d=p||d)instanceof r.LazyServiceIdentifer&&(d=d.unwrap()),h){if(!e&&(d===Object||d===Function||void 0===d)){var g=i.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(g)}var v=new u.Target(o.TargetTypeEnum.ConstructorArgument,f.targetName,d);return v.metadata=c,v}return null}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[a.INJECT_TAG],multiInject:e[a.MULTI_INJECT_TAG],targetName:e[a.NAME_TAG],unmanaged:e[a.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return c(t,s.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=c(e,s.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===a.UNMANAGED_TAG}))})),u=[].concat.apply([],o).length,f=i.length-u;return f>0?f:t(e,r)}return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(65),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(51),o=n(242),a=n(85),s=n(495),u=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var o=n.bindings,c=n.childRequests,f=n.target&&n.target.isArray(),l=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(f&&l)return c.map((function(n){return t(e)(n)}));var h=null;if(!n.target.isOptional()||0!==o.length){var d=o[0],p=d.scope===i.BindingScopeEnum.Singleton,g=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(g&&null!==e&&e.has(d.id))return e.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache;else if(d.type===i.BindingTypeEnum.Function)h=d.cache;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=u("toFactory",d.serviceIdentifier,(function(){return d.factory(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=u("toProvider",d.serviceIdentifier,(function(){return d.provider(n.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var v=a.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}h=s.resolveInstance(d.implementationType,c,t(e))}return"function"==typeof d.onActivation&&(h=d.onActivation(n.parentContext,h)),p&&(d.cache=h,d.activated=!0),g&&null!==e&&!e.has(d.id)&&e.set(d.id,h),h}}}(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(51),o=n(26);e.resolveInstance=function(t,e,n){var a,s,u=null;if(e.length>0){var c=e.filter((function(t){return null!==t.target&&t.target.type===i.TargetTypeEnum.ConstructorArgument})).map(n);s=c,u=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===i.TargetTypeEnum.ClassProperty})),o=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var i=o[n];t[r]=i})),t}(u=new((a=t).bind.apply(a,[void 0].concat(s))),e,n)}else u=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(r.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,u),u}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(51),o=n(497),a=n(245),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(498),i=n(150),o=n(151),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(51),i=n(245),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(65),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(26);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(42),i=n(57);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42),o=n(57);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42),o=n(57);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42),o=n(57);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42),o=n(57);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),i=n(42),o=n(57);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),i=n(26),o=n(42);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Symbol.for("INJECTION");function i(t,e,n,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(r,this,e)&&Reflect.defineMetadata(r,n(),this,e),Reflect.hasMetadata(r,this,e)?Reflect.getMetadata(r,this,e):n()},set:function(t){Reflect.defineMetadata(r,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,r){return function(o,a){i(o,a,(function(){return t.getNamed(n,r)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,r,o){return function(a,s){i(a,s,(function(){return t.getTagged(n,r,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.getAll(n)}),e)}}}},function(t,e,n){var r=n(240);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},function(t,e){t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},function(t,e,n){t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(254)},function(t,e){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},function(t,e,n){t.exports=n(159)},function(t,e,n){t.exports=n(258)},function(t,e,n){t.exports=n(259)},function(t,e){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},function(t,e){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},function(t,e,n){t.exports=n(260)},function(t,e,n){t.exports=n(261)},function(t,e,n){t.exports=n(262)},function(t,e,n){t.exports=n(263)},function(t,e){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},function(t,e){t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},function(t,e){t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},function(t,e){t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},function(t,e,n){t.exports=function(t,e,n,i,o,a){var s,u;e||(e=2);n||(n=0);u=i?Math.min(i*e+n,t.length):t.length;for(s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],o(r,r,a),t[s]=r[0],t[s+1]=r[1];return t};var r=n(255)()},function(t,e){t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},function(t,e,n){"use strict";n.r(e),n.d(e,"registerNode",(function(){return gv})),n.d(e,"registerCombo",(function(){return mv})),n.d(e,"Graph",(function(){return Xh})),n.d(e,"TreeGraph",(function(){return qh})),n.d(e,"Util",(function(){return Dd})),n.d(e,"registerEdge",(function(){return vv})),n.d(e,"Layout",(function(){return gh})),n.d(e,"Global",(function(){return z})),n.d(e,"registerLayout",(function(){return bv})),n.d(e,"Minimap",(function(){return xv})),n.d(e,"Grid",(function(){return wv})),n.d(e,"Bundling",(function(){return _v})),n.d(e,"Menu",(function(){return Ev})),n.d(e,"Fisheye",(function(){return Sv})),n.d(e,"registerBehavior",(function(){return yv})),n.d(e,"Algorithm",(function(){return c})),n.d(e,"ToolBar",(function(){return Mv})),n.d(e,"Tooltip",(function(){return Ov})),n.d(e,"TimeBar",(function(){return Av})),n.d(e,"ImageMinimap",(function(){return kv})),n.d(e,"EdgeFilterLens",(function(){return Tv}));var r={};n.r(r),n.d(r,"formatPadding",(function(){return v})),n.d(r,"cloneEvent",(function(){return m})),n.d(r,"isViewportChanged",(function(){return y})),n.d(r,"isNaN",(function(){return b})),n.d(r,"calculationItemsBBox",(function(){return x})),n.d(r,"processParallelEdges",(function(){return w})),n.d(r,"gpuDetector",(function(){return _}));var i={};n.r(i),n.d(i,"mixColor",(function(){return L})),n.d(i,"getColorsWithSubjectColor",(function(){return G})),n.d(i,"getColorSetsBySubjectColors",(function(){return F}));var o={};n.r(o),n.d(o,"compare",(function(){return xt})),n.d(o,"getLineIntersect",(function(){return _t})),n.d(o,"getRectIntersectByPoint",(function(){return Et})),n.d(o,"getCircleIntersectByPoint",(function(){return St})),n.d(o,"getEllipseIntersectByPoint",(function(){return Mt})),n.d(o,"applyMatrix",(function(){return Ot})),n.d(o,"invertMatrix",(function(){return At})),n.d(o,"getCircleCenterByPoints",(function(){return kt})),n.d(o,"distance",(function(){return Tt})),n.d(o,"scaleMatrix",(function(){return It})),n.d(o,"floydWarshall",(function(){return Ct})),n.d(o,"getAdjMatrix",(function(){return Pt})),n.d(o,"translate",(function(){return Dt})),n.d(o,"move",(function(){return Nt})),n.d(o,"scale",(function(){return Rt})),n.d(o,"rotate",(function(){return jt})),n.d(o,"getDegree",(function(){return Bt})),n.d(o,"isPointInPolygon",(function(){return Gt})),n.d(o,"intersectBBox",(function(){return Ft})),n.d(o,"isPolygonsIntersect",(function(){return Ut})),n.d(o,"Line",(function(){return zt})),n.d(o,"getBBoxBoundLine",(function(){return Wt})),n.d(o,"itemIntersectByLine",(function(){return Xt})),n.d(o,"fractionToLine",(function(){return Yt})),n.d(o,"getPointsCenter",(function(){return Ht})),n.d(o,"squareDist",(function(){return qt})),n.d(o,"pointLineSquareDist",(function(){return Qt})),n.d(o,"isPointsOverlap",(function(){return Zt})),n.d(o,"pointRectSquareDist",(function(){return Kt}));var a={};n.r(a),n.d(a,"getSpline",(function(){return ae})),n.d(a,"getControlPoint",(function(){return se})),n.d(a,"pointsToPolygon",(function(){return ue})),n.d(a,"pathToPoints",(function(){return ce})),n.d(a,"getClosedSpline",(function(){return fe})),n.d(a,"roundedHull",(function(){return pe})),n.d(a,"paddedHull",(function(){return ge}));var s={};n.r(s),n.d(s,"getBBox",(function(){return Ne})),n.d(s,"getLoopCfgs",(function(){return Re})),n.d(s,"getLabelPosition",(function(){return je})),n.d(s,"traverseTree",(function(){return Ge})),n.d(s,"traverseTreeUp",(function(){return Fe})),n.d(s,"radialLayout",(function(){return Ue})),n.d(s,"getLetterWidth",(function(){return ze})),n.d(s,"getTextSize",(function(){return We})),n.d(s,"plainCombosToTrees",(function(){return Ve})),n.d(s,"reconstructTree",(function(){return Xe})),n.d(s,"getComboBBox",(function(){return Ye})),n.d(s,"getChartRegion",(function(){return He}));var u={};n.r(u),n.d(u,"default",(function(){return Sp})),n.d(u,"assign",(function(){return ip})),n.d(u,"format",(function(){return _p})),n.d(u,"parse",(function(){return Ep})),n.d(u,"defaultI18n",(function(){return up})),n.d(u,"setGlobalDateI18n",(function(){return fp})),n.d(u,"setGlobalDateMasks",(function(){return wp}));var c={};n.r(c),n.d(c,"depthFirstSearch",(function(){return Hg})),n.d(c,"breadthFirstSearch",(function(){return Qg})),n.d(c,"detectDirectedCycle",(function(){return ev})),n.d(c,"degree",(function(){return kh})),n.d(c,"adjMatrix",(function(){return Dh})),n.d(c,"floydWarshall",(function(){return Nh})),n.d(c,"getConnectedComponents",(function(){return Kg})),n.d(c,"detectAllCycles",(function(){return tv})),n.d(c,"detectAllDirectedCycle",(function(){return Jg})),n.d(c,"detectAllUndirectedCycle",(function(){return $g})),n.d(c,"findShortestPath",(function(){return rv})),n.d(c,"findAllPath",(function(){return iv})),n.d(c,"minimumSpanningTree",(function(){return fv})),n.d(c,"getPageRank",(function(){return lv})),n.d(c,"louvain",(function(){return dv})),n.d(c,"labelPropagation",(function(){return pv}));var f,l=n(0),h={getDefaultCfg:function(){return{}},getEvents:function(){return{}},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!0),Object(l.f)(n,(function(e,n){t.on(n,e)})),document.addEventListener("visibilitychange",(function(){e.keydown=!1}))},unbind:function(t){var e=this.events;"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!1),Object(l.f)(e,(function(e,n){t.off(n,e)}))},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}},d=function(){function t(){}return t.registerBehavior=function(e,n){if(!n)throw new Error("please specify handler for this behavior: "+e);var r=Object(l.c)(h);Object.assign(r,n);var i=function(t){var e=this;Object.assign(this,this.getDefaultCfg(),t);var n=this.getEvents();this.events=null;var r={};n&&(Object(l.f)(n,(function(t,n){r[n]=Object(l.H)(e,t)})),this.events=r)};i.prototype=r,t.types[e]=i},t.hasBehavior=function(e){return!!t.types[e]},t.getBehavior=function(e){return t.types[e]},t.types={},t}();!function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.MOUSEDOWN="mousedown",t.MOUDEUP="mouseup",t.CONTEXTMENU="contextmenu",t.MOUSEENTER="mouseenter",t.MOUSEOUT="mouseout",t.MOUSEOVER="mouseover",t.MOUSEMOVE="mousemove",t.MOUSELEAVE="mouseleave",t.DRAGSTART="dragstart",t.DRAGEND="dragend",t.DRAG="drag",t.DRAGENTER="dragenter",t.DRAGLEAVE="dragleave",t.DRAGOVER="dragover",t.DRAGOUT="dragout",t.DDROP="drop",t.KEYUP="keyup",t.KEYDOWN="keydown",t.WHEEL="wheel",t.FOCUS="focus",t.BLUR="blur",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_CLICK="node:click",t.NODE_DBLCLICK="node:dblclick",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEOUT="node:mouseout",t.NODE_MOUSEOVER="node:mouseover",t.NODE_DROP="node:drop",t.NODE_DRAGOVER="node:dragover",t.NODE_DRAGENTER="node:dragenter",t.NODE_DRAGLEAVE="node:dragleave",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DRAGEND="node:dragend",t.COMBO_CONTEXTMENU="combo:contextmenu",t.COMBO_CLICK="combo:click",t.COMBO_DBLCLICK="combo:dblclick",t.COMBO_MOUSEDOWN="combo:mousedown",t.COMBO_MOUSEUP="combo:mouseup",t.COMBO_MOUSEENTER="combo:mouseenter",t.COMBO_MOUSELEAVE="combo:mouseleave",t.COMBO_MOUSEMOVE="combo:mousemove",t.COMBO_MOUSEOUT="combo:mouseout",t.COMBO_MOUSEOVER="combo:mouseover",t.COMBO_DROP="combo:drop",t.COMBO_DRAGOVER="combo:dragover",t.COMBO_DRAGENTER="combo:dragenter",t.COMBO_DRAGLEAVE="combo:dragleave",t.COMBO_DRAGSTART="combo:dragstart",t.COMBO_DRAG="combo:drag",t.COMBO_DRAGEND="combo:dragend",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_CLICK="edge:click",t.EDGE_DBLCLICK="edge:dblclick",t.EDGE_MOUSEDOWN="edge:mousedown",t.EDGE_MOUSEUP="edge:mouseup",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_MOUSEMOVE="edge:mousemove",t.EDGE_MOUSEOUT="edge:mouseout",t.EDGE_MOUSEOVER="edge:mouseover",t.EDGE_DROP="edge:drop",t.EDGE_DRAGOVER="edge:dragover",t.EDGE_DRAGENTER="edge:dragenter",t.EDGE_DRAGLEAVE="edge:dragleave",t.CANVAS_CONTEXTMENU="canvas:contextmenu",t.CANVAS_CLICK="canvas:click",t.CANVAS_DBLCLICK="canvas:dblclick",t.CANVAS_MOUSEDOWN="canvas:mousedown",t.CANVAS_MOUSEUP="canvas:mouseup",t.CANVAS_MOUSEENTER="canvas:mouseenter",t.CANVAS_MOUSELEAVE="canvas:mouseleave",t.CANVAS_MOUSEMOVE="canvas:mousemove",t.CANVAS_MOUSEOUT="canvas:mouseout",t.CANVAS_MOUSEOVER="canvas:mouseover",t.CANVAS_DROP="canvas:drop",t.CANVAS_DRAGENTER="canvas:dragenter",t.CANVAS_DRAGLEAVE="canvas:dragleave",t.CANVAS_DRAGSTART="canvas:dragstart",t.CANVAS_DRAG="canvas:drag",t.CANVAS_DRAGEND="canvas:dragend",t.BEFORERENDER="beforerender",t.AFTERRENDER="afterrender",t.BEFOREADDITEM="beforeadditem",t.AFTERADDITEM="afteradditem",t.BEFOREREMOVEITEM="beforeremoveitem",t.AFTERREMOVEITEM="afterremoveitem",t.BEFOREUPDATEITEM="beforeupdateitem",t.AFTERUPDATEITEM="afterupdateitem",t.BEFOREITEMVISIBILITYCHANGE="beforeitemvisibilitychange",t.AFTERITEMVISIBILITYCHANGE="afteritemvisibilitychange",t.BEFOREITEMSTATECHANGE="beforeitemstatechange",t.AFTERITEMSTATECHANGE="afteritemstatechange",t.BEFOREITEMREFRESH="beforeitemrefresh",t.AFTERITEMREFRESH="afteritemrefresh",t.BEFOREITEMSTATESCLEAR="beforeitemstatesclear",t.AFTERITEMSTATESCLEAR="afteritemstatesclear",t.BEFOREMODECHANGE="beforemodechange",t.AFTERMODECHANGE="aftermodechange",t.BEFORELAYOUT="beforelayout",t.AFTERLAYOUT="afterlayout",t.BEFORECREATEEDGE="beforecreateedge",t.AFTERCREATEEDGE="aftercreateedge",t.BEFOREGRAPHREFRESHPOSITION="beforegraphrefreshposition",t.AFTERGRAPHREFRESHPOSITION="aftergraphrefreshposition",t.BEFOREGRAPHREFRESH="beforegraphrefresh",t.AFTERGRAPHREFRESH="aftergraphrefresh",t.BEFOREANIMATE="beforeanimate",t.AFTERANIMATE="afteranimate",t.BEFOREPAINT="beforepaint",t.AFTERPAINT="afterpaint",t.GRAPHSTATECHANGE="graphstatechange",t.AFTERACTIVATERELATIONS="afteractivaterelations",t.NODESELECTCHANGE="nodeselectchange",t.TOOLTIPCHANGE="tooltipchange",t.WHEELZOOM="wheelzoom",t.VIEWPORTCHANGE="viewportchange",t.DRAGNODEEND="dragnodeend",t.STACKCHANGE="stackchange"}(f||(f={}));var p=n(1),g=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.item=n.item,r.canvasX=n.canvasX,r.canvasY=n.canvasY,r.wheelDelta=n.wheelDelta,r.detail=n.detail,r}return Object(p.c)(e,t),e}(n(22).Event),v=function(t){var e=0,n=0,r=0,i=0;if(Object(l.t)(t))e=n=r=i=t;else if(Object(l.w)(t)){e=n=r=i=parseInt(t,10)}else Object(l.m)(t)&&(e=t[0],r=Object(l.s)(t[1])?t[0]:t[1],i=Object(l.s)(t[2])?t[0]:t[2],n=Object(l.s)(t[3])?r:t[3]);return[e,r,i,n]},m=function(t){var e=new g(t.type,t);return e.clientX=t.clientX,e.clientY=t.clientY,e.x=t.x,e.y=t.y,e.target=t.target,e.currentTarget=t.currentTarget,e.bubbles=!0,e.item=t.item,e},y=function(t){if(!t)return!1;for(var e=[1,0,0,0,1,0,0,0,1],n=0;n<9;n++)if(t[n]!==e[n])return!0;return!1},b=function(t){return Number.isNaN(Number(t))},x=function(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o].getBBox(),s=a.minX,u=a.minY,c=a.maxX,f=a.maxY;s<e&&(e=s),u<r&&(r=u),c>n&&(n=c),f>i&&(i=f)}return{x:Math.floor(e),y:Math.floor(r),width:Math.ceil(n)-Math.floor(e),height:Math.ceil(i)-Math.floor(r),minX:e,minY:r,maxX:n,maxY:i}},w=function(t,e,n,r){void 0===e&&(e=15),void 0===n&&(n="quadratic"),void 0===r&&(r="line");for(var i=t.length,o=2*e,a=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],s={},u=[],c={},f=0;f<i;f++){var l=t[f],h=l.source,d=l.target,p=h+"-"+d;if(!u[f]){s[p]||(s[p]=[]),u[f]=!0,s[p].push(l);for(var g=0;g<i;g++)if(f!==g){var v=t[g],m=v.source,y=v.target;u[g]||(h===y&&d===m?(s[p].push(v),u[g]=!0,c[m+"|"+y+"|"+(s[p].length-1)]=!0):h===m&&d===y&&(s[p].push(v),u[g]=!0))}}}for(var b in s)for(var x=s[b],w=x.length,_=0;_<w;_++){var E=x[_];if(E.source!==E.target)if(1!==w){E.type=n;var S=(_%2==0?1:-1)*(c[E.source+"|"+E.target+"|"+_]?-1:1);E.curveOffset=w%2==1?S*Math.ceil(_/2)*o:S*(Math.floor(_/2)*o+e)}else E.type=r;else E.type="loop",E.loopCfg={position:a[_%8],dist:20*Math.floor(_/8)+50}}return t},_=function(){return"undefined"==typeof window||"undefined"==typeof document?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join("\n"):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join("\n")),t},addGetWebGLMessage:function(t){var e=void 0!==(t=t||{}).parent?t.parent:document.body,n=void 0!==t.id?t.id:"oldie",r=_().getWebGLErrorMessage();r.id=n,e.appendChild(r)}}},E=Math.abs,S=["shift","ctrl","alt","control"],M={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0}},getEvents:function(){return{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onMouseDown",touchmove:"onMouseMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!b(n)&&!b(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox();(u.minX<=a+this.scalableRange&&u.minX+i>a+this.scalableRange||u.maxX+this.scalableRange>=0&&u.maxX+this.scalableRange+i<0)&&(i=0),(u.minY<=s+this.scalableRange&&u.minY+o>s+this.scalableRange||u.maxY+this.scalableRange>=0&&u.maxY+this.scalableRange+o<0)&&(o=0),this.graph.translate(i,o)}},onMouseDown:function(t){var e=t.originalEvent;if((!e||0===e.button)&&(t.name===f.TOUCHSTART||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&!this.keydown&&t.target&&t.target.isCanvas&&t.target.isCanvas()&&(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize)){for(var n=this.graph,r=n.getEdges(),i=0,o=r.length;i<o;i++){var a=r[i].get("group").get("children");a&&a.forEach((function(t){t.set("ori-visibility",t.get("visible")),t.hide()}))}for(var s=n.getNodes(),u=0,c=s.length;u<c;u++)for(var l=0,h=s[u].getContainer().get("children");l<h.length;l++){var d=h[l];d.get("isKeyShape")||(d.set("ori-visibility",d.get("visible")),d.hide())}}},onMouseMove:function(t){var e=this.graph;if(!this.keydown&&t.target&&t.target.isCanvas&&t.target.isCanvas()&&(t=m(t),this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(E(this.origin.x-t.clientX)+E(this.origin.y-t.clientY)<10)return;this.shouldBegin.call(this,t)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.dragging=!0)}this.shouldUpdate.call(this,t)&&this.updateViewport(t)}},onMouseUp:function(t){var e=this.graph;if(!this.keydown){if(this.enableOptimize){for(var n=e.getEdges(),r=0,i=n.length;r<i;r++){var o=n[r].get("group").get("children");o&&o.forEach((function(t){t.get("ori-visibility")&&t.show()}))}for(var a=e.getNodes(),s=0,u=a.length;s<u;s++)for(var c=0,f=a[s].getContainer().get("children");c<f.length;c++){var l=f[c];if(!l.get("isKeyShape"))l.get("ori-visibility")&&l.show()}}this.dragging?(t=m(t),this.shouldEnd.call(this,t)&&this.updateViewport(t),t.type="dragend",e.emit("canvas:dragend",t),this.endDrag()):this.origin=null}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1},onKeyDown:function(t){var e=t.key;e&&(S.indexOf(e.toLowerCase())>-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1}},O=n(78),A=n.n(O),k=n(90),T=n.n(k),I=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function C(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function P(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function D(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function N(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=T()(t),i=5;i>0;i-=1){var o=r.toHsv(),a=T()({h:C(o,i,!0),s:P(o,i,!0),v:D(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=T()({h:C(u,s),s:P(u,s),v:D(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?I.map((function(t){var r=t.index,i=t.opacity;return T.a.mix(e.backgroundColor||"#141414",n[r],100*i).toHexString()})):n}var R={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},j={},B={};Object.keys(R).forEach((function(t){j[t]=N(R[t]),j[t].primary=j[t][5],B[t]=N(R[t],{theme:"dark",backgroundColor:"#141414"}),B[t].primary=B[t][5]}));j.red,j.volcano,j.gold,j.orange,j.yellow,j.lime,j.green,j.cyan,j.blue,j.geekblue,j.purple,j.magenta,j.grey;var L=function(t,e,n){var r=A()(t),i=A()(e);return A()([(1-n)*r.color[0]+n*i.color[0],(1-n)*r.color[1]+n*i.color[1],(1-n)*r.color[2]+n*i.color[2]]).rgb()},G=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=L(e,t,.05).rgb().toString(),i=L(e,t,.1).rgb().toString(),o=L(e,t,.2).rgb().toString(),a=L(e,t,.4).rgb().toString(),s=L(e,n,.02).rgb().toString(),u=L(e,n,.05).rgb().toString(),c=L(e,n,.1).rgb().toString(),f=L(e,n,.2).rgb().toString(),l=L(e,n,.3).rgb().toString(),h=N(t,{theme:"default",backgroundColor:e}),d=A()(t).hex().toLowerCase(),p=h.indexOf(d),g=t;return-1!==p&&(g=h[p+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:r,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:l,disableFill:u,edgeMainStroke:l,edgeActiveStroke:t,edgeInactiveStroke:f,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:l,comboMainFill:s,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:l,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:s,comboDisableStroke:f,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=L(e,t,.2).rgb().toString(),i=L(e,t,.3).rgb().toString(),o=L(e,t,.6).rgb().toString(),a=L(e,t,.8).rgb().toString(),s=L(e,n,.2).rgb().toString(),u=L(e,n,.25).rgb().toString(),c=L(e,n,.3).rgb().toString(),f=L(e,n,.4).rgb().toString(),l=L(e,n,.5).rgb().toString(),h=N(t,{theme:"dark",backgroundColor:e}),d=A()(t).hex().toLowerCase(),p=h.indexOf(d),g=t;return-1!==p&&(g=h[p+1]),{mainStroke:a,mainFill:r,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:o,disableStroke:l,disableFill:u,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:f,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:f,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:f,comboDisableFill:s}}(t,e,"#777")},F=function(t,e,n,r){void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)");var i=[];return t.forEach((function(t){i.push(G(t,e,n,r))})),i},U=G("rgb(95, 149, 255)","rgb(255, 255, 255)"),z={version:"4.0.3",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:U.mainStroke,fill:U.mainFill},size:20,color:U.mainStroke,linkPoints:{size:8,lineWidth:1,fill:U.activeFill,stroke:U.activeStroke}},nodeStateStyles:{active:{fill:U.activeFill,stroke:U.activeStroke,lineWidth:2,shadowColor:U.mainStroke,shadowBlur:10},selected:{fill:U.selectedFill,stroke:U.selectedStroke,lineWidth:4,shadowColor:U.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:U.highlightFill,stroke:U.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:U.inactiveFill,stroke:U.inactiveStroke,lineWidth:1},disable:{fill:U.disableFill,stroke:U.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:U.edgeMainStroke,lineAppendWidth:2},color:U.edgeMainStroke},edgeStateStyles:{active:{stroke:U.edgeActiveStroke,lineWidth:1},selected:{stroke:U.edgeSelectedStroke,lineWidth:2,shadowColor:U.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:U.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:U.edgeInactiveStroke,lineWidth:1},disable:{stroke:U.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:U.comboMainFill,lineWidth:1,stroke:U.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:U.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:U.comboActiveStroke,lineWidth:1,fill:U.comboActiveFill},selected:{stroke:U.comboSelectedStroke,lineWidth:2,fill:U.comboSelectedFill,shadowColor:U.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:U.comboHighlightStroke,lineWidth:2,fill:U.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:U.comboInactiveStroke,fill:U.comboInactiveFill,lineWidth:1},disable:{stroke:U.comboDisableStroke,fill:U.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},W={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected"}},getEvents:function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onDragStart:function(t){var e=this;if(this.shouldBegin.call(this,t)){var n=t.item;if(n&&!n.destroyed&&!n.hasLocked()){n.getContainer().set("capture",!1);var r=t.target;if(r)if(r.get("isAnchorPoint"))return;var i=this.graph;this.targets=[],this.targetCombo=null;var o=i.findAllByState("node",this.selectedState),a=n.get("id");0===o.filter((function(t){var e=t.get("id");return a===e})).length?this.targets.push(n):o.length>1?o.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(n);var s=[];this.targets.forEach((function(t){s.push(Object(l.c)(t.getModel()))})),this.set("beforeDragNodes",s),this.origin={x:t.x,y:t.y},this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;this.origin&&this.shouldUpdate(this,t)&&(this.get("enableDelegate")?this.updateDelegate(t):this.targets.map((function(n){e.update(n,t)})))},onDragEnd:function(t){if(this.origin&&this.shouldEnd.call(this,t)){var e=t.item;if(e)e.getContainer().set("capture",!0);this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.updatePositions(t);var n=this.graph;if(n.get("enabledStack")){var r={before:{nodes:this.get("beforeDragNodes"),edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.targets.forEach((function(t){r.after.nodes.push(t.getModel())})),n.pushStack("update",Object(l.c)(r))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.validationCombo(e)){this.updatePositions(t);var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.targets&&0!==this.targets.length&&(this.updatePositions(t),this.onlyChangeComboSize?e.updateCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.graph,r=e.getModel().comboId;if(r){var i=n.findById(r);this.comboActiveState&&n.setItemState(i,this.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();r!==e.comboId&&n.updateComboTree(t,r)})),n.updateCombo(i)}else this.targets.map((function(t){t.getModel().comboId&&n.updateComboTree(t)}));n.emit("dragnodeend",{items:this.targets,targetItem:e})}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t){var e=this;this.targets&&0!==this.targets.length&&this.get("enableDelegate")&&this.targets.map((function(n){return e.update(n,t)}))},update:function(t,e){var n=this.origin,r=t.get("model"),i=t.get("id");this.point[i]||(this.point[i]={x:r.x||0,y:r.y||0});var o={x:e.x-n.x+this.point[i].x,y:e.y-n.y+this.point[i].y};this.get("updateEdge")?this.graph.updateItem(t,o,!1):t.updatePosition(o)},updateDelegate:function(t){this.graph;if(this.delegateRect){var e=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:e,y:n})}else{var r=this.graph.get("group"),i=Object(l.e)({},z.delegateStyle,this.delegateStyle),o=this.calculationGroupPosition(t),a=o.x,s=o.y,u=o.width,c=o.height,f=o.minX,h=o.minY;this.originPoint={x:a,y:s,width:u,height:c,minX:f,minY:h},this.delegateRect=r.addShape("rect",{attrs:Object(p.a)({width:u,height:c,x:a,y:s},i),name:"rect-delegate-shape"}),this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.graph.findAllByState("node",this.selectedState);0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;a<e.length;a++){var s=e[a].getBBox(),u=s.minX,c=s.minY,f=s.maxX,l=s.maxY;u<n&&(n=u),c<i&&(i=c),f>r&&(r=f),l>o&&(o=l)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}}},V=Math.min,X=Math.max,Y=Math.abs,H=["drag","shift","ctrl","alt","control"],q={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return H.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,n=this.brush;e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),this.selectedNodes=[],this.selectedEdges=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedNodes:function(t){var e=this,n=this.graph,r=this.originPoint,i=this.shouldUpdate,o=this.selectedState,a={x:t.x,y:t.y},s=n.getPointByCanvas(r.x,r.y),u=V(a.x,s.x),c=X(a.x,s.x),f=V(a.y,s.y),l=X(a.y,s.y),h=[],d=[];n.getNodes().forEach((function(t){var e=t.getBBox();if(e.centerX>=u&&e.centerX<=c&&e.centerY>=f&&e.centerY<=l&&i(t,"select")){h.push(t);var r=t.getModel();d.push(r.id),n.setItemState(t,o,!0)}}));var p=[];this.includeEdges&&h.forEach((function(t){t.getOutEdges().forEach((function(t){var r=t.getModel(),o=r.source,a=r.target;d.includes(o)&&d.includes(a)&&i(t,"select")&&(p.push(t),n.setItemState(t,e.selectedState,!0))}))})),this.selectedEdges=p,this.selectedNodes=h,this.onSelect&&this.onSelect(h,p),n.emit("nodeselectchange",{selectedItems:{nodes:h,edges:p},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:Y(t.canvasX-e.x),height:Y(t.canvasY-e.y),x:V(t.canvasX,e.x),y:V(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.keydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},Q=["shift","ctrl","alt","control"],Z={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected"}},getEvents:function(){return Q.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.multiple?{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){var r=n.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if(e.shouldBegin.call(e,t)){if(!o||!a){var u=i.findAllByState(r,e.selectedState);Object(l.f)(u,(function(t){t!==n&&i.setItemState(t,e.selectedState,!1)}))}if(n.hasState(e.selectedState)){s.call(e,t)&&i.setItemState(n,e.selectedState,!1);var c=i.findAllByState("node",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:f},select:!1})}else{s.call(e,t)&&i.setItemState(n,e.selectedState,!0);c=i.findAllByState("node",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:f},select:!0})}}}},onCanvasClick:function(){var t=this,e=this.graph,n=e.findAllByState("node",this.selectedState);Object(l.f)(n,(function(n){e.setItemState(n,t.selectedState,!1)}));var r=e.findAllByState("combo",this.selectedState);Object(l.f)(r,(function(n){e.setItemState(n,t.selectedState,!1)})),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},K=n(31);K.translate=function(t,e,n){var r=new Array(9);return K.fromTranslation(r,n),K.multiply(t,r,e)},K.rotate=function(t,e,n){var r=new Array(9);return K.fromRotation(r,n),K.multiply(t,r,e)},K.scale=function(t,e,n){var r=new Array(9);return K.fromScaling(r,n),K.multiply(t,r,e)},K.transform=function(t,e){for(var n=[].concat(t),r=0,i=e.length;r<i;r++){var o=e[r];switch(o[0]){case"t":K.translate(n,n,[o[1],o[2]]);break;case"s":K.scale(n,n,[o[1],o[2]]);break;case"r":K.rotate(n,n,o[1])}}return n};var $=K,J=n(44);J.angle=function(t,e){var n=J.dot(t,e)/(J.length(t)*J.length(e));return Math.acos(Object(l.b)(n,-1,1))},J.direction=function(t,e){return t[0]*e[1]-e[0]*t[1]},J.angleTo=function(t,e,n){var r=J.angle(t,e),i=J.direction(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r},J.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t};var tt,et,nt,rt,it=J,ot=n(269),at=function(t,e){var n=t?Object(l.c)(t):[1,0,0,0,1,0,0,0,1];return Object(l.f)(e,(function(t){switch(t[0]){case"t":$.translate(n,n,[t[1],t[2]]);break;case"s":$.scale(n,n,[t[1],t[2]]);break;case"r":$.rotate(n,n,t[1]);break;case"m":$.multiply(n,n,t[1]);break;default:return!1}})),n},st={getDefaultCfg:function(){return{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],r=e[1];t.preventDefault(),r&&(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,r&&(this.endPoint={pageX:r.pageX,pageY:r.pageY}),this.originScale=this.currentScale||1)},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],r=e[1];if(r){this.endPoint||(this.endPoint={pageX:r.pageX,pageY:r.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:n.pageX,y:n.pageY},{x:r.pageX,y:r.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a<s)){var u=this.graph.get("canvas").getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(a,{x:u.x,y:u.y}),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,n=this.graph,r=this.fixSelectedItems;if(this.shouldUpdate.call(this,t)){t.preventDefault();var i,o=n.get("canvas").getPointByClient(t.clientX,t.clientY),a=this.get("sensitivity"),s=n.getZoom();i=s*(t.wheelDelta<0?1-.05*a:1/(1-.05*a));var u=this.get("minZoom")||n.get("minZoom");if(!(i>(this.get("maxZoom")||n.get("maxZoom"))||i<u)){if(this.get("enableOptimize")){var c=this.get("optimizeZoom"),f=this.get("optimized"),h=n.getNodes(),d=n.getEdges(),p=h.length,g=d.length;if(!f){for(var v=0;v<p;v++){if(!(O=h[v]).destroyed)for(var m=(q=O.get("group").get("children")).length,y=0;y<m;y++){(j=q[y]).destoryed||j.get("isKeyShape")||(j.set("ori-visibility",j.get("visible")),j.hide())}}for(var b=0;b<g;b++)for(m=(q=(H=d[b]).get("group").get("children")).length,y=0;y<m;y++){(j=q[y]).set("ori-visibility",j.get("visible")),j.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var x=setTimeout((function(){var t=n.getZoom();if(e.get("optimized")){e.set("optimized",!1);for(var r=0;r<p;r++){var i=h[r],o=(f=i.get("group").get("children")).length;if(t<c)(s=(l=i.getKeyShape()).get("ori-visibility"))&&l.show();else for(var a=0;a<o;a++){var s=(m=f[a]).get("ori-visibility");!m.get("visible")&&s&&s&&m.show()}}for(var u=0;u<g;u++){var f,l,v=d[u];o=(f=v.get("group").get("children")).length;if(t<c)(s=(l=v.getKeyShape()).get("ori-visibility"))&&l.show();else for(a=0;a<o;a++){var m;if(!(m=f[a]).get("visible"))(s=m.get("ori-visibility"))&&m.show()}}}}),500);this.set("timeout",x)}if(s<=1){var w=void 0,_=void 0;if(r.fixAll||r.fixLineWidth||r.fixLabel){w=n.findAllByState("node",r.fixState),_=n.findAllByState("edge",r.fixState);for(var E=s/i,S=w.length,M=0;M<S;M++){var O,A=(O=w[M]).getContainer(),k=O.getModel(),T=O.getOriginStyle(),I=O.getStateStyle(r.fixState),C=O.get("shapeFactory").getShape(k.type).getStateStyle(r.fixState,O)[r.fixState];if(r.fixAll){if(i<=1){var P=Object(l.c)(A.getMatrix());P||(P=[1,0,0,0,1,0,0,0,1]);var D=O.getModel(),N=D.x,R=D.y;$.translate(P,P,[-N,-R]),$.scale(P,P,[E,E]),$.translate(P,P,[N,R]),A.setMatrix(P)}}else for(m=(q=A.get("children")).length,y=0;y<m;y++){var j=q[y],B=void 0,L=void 0;if(r.fixLabel)if("text"===j.get("type")){B=j.attr("fontSize")||12;var G=I[j.get("name")],F=C[j.get("name")],U=G?G.fontSize:12,z=F?F.fontSize:12,W=U||z||12;if(i<=1&&j.attr("fontSize",W/i),L)break}if(r.fixLineWidth&&j.get("isKeyShape")){L=j.attr("lineWidth")||0;var V=I.lineWidth||C.lineWidth||T.lineWidth||0;if(i<=1&&j.attr("lineWidth",V/i),B)break}}}for(var X=_.length,Y=0;Y<X;Y++){var H,q=(A=(H=_[Y]).getContainer()).get("children");for(k=H.getModel(),I=H.getStateStyle(r.fixState),C=H.get("shapeFactory").getShape(k.type).getStateStyle(r.fixState,H)[r.fixState],m=q.length,y=0;y<m;y++){j=q[y],B=void 0,L=void 0;if(r.fixLabel||r.fixAll)if("text"===j.get("type")){B=j.attr("fontSize")||12;G=I[j.get("name")],F=C[j.get("name")],U=G?G.fontSize:12,z=F?F.fontSize:12,W=U||z||12;if(i<=1&&j.attr("fontSize",W/i),L)break}if((r.fixLineWidth||r.fixAll)&&j.get("isKeyShape")){L=j.attr("lineWidth")||0;V=I.lineWidth||C.lineWidth||1;if(i<=1&&j.attr("lineWidth",V/i),B)break}}}}}n.zoomTo(i,{x:o.x,y:o.y}),n.emit("wheelzoom",t)}}}};function ut(t,e,n){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}}}function ct(t){tt||(tt=document.createElement("table"),et=document.createElement("tr"),nt=/^\s*<(\w+|!)[^>]*>/,rt={tr:document.createElement("tbody"),tbody:tt,thead:tt,tfoot:tt,td:et,th:et,"*":document.createElement("div")});var e=nt.test(t)&&RegExp.$1;e&&e in rt||(e="*");var n=rt[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var r=n.childNodes[0];return n.removeChild(r),r}function ft(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}var lt={onMouseEnter:function(t){var e=t.item;this.currentTarget=e,this.showTooltip(t),this.graph.emit("tooltipchange",{item:t.item,action:"show"})},onMouseMove:function(t){this.shouldUpdate(t)?this.currentTarget&&t.item===this.currentTarget&&this.updatePosition(t):this.hideTooltip()},onMouseLeave:function(t){this.shouldEnd(t)&&(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(t){var e=this.container;if(t.item&&!t.item.destroyed){e||(e=this.createTooltip(this.graph.get("canvas")),this.container=e);var n=this.formatText(t.item.get("model"),t);e.innerHTML=n,ft(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){ft(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),n=this.width,r=this.height,i=this.container,o=this.graph;if(e(t)){var a=o.getPointByClient(t.clientX,t.clientY),s=o.getCanvasByPoint(a.x,a.y),u=s.x,c=s.y,f=i.getBoundingClientRect();u>n/2?u-=f.width:u+=this.offset,c>r/2?c-=f.height:c+=this.offset;var l=u+"px",h=c+"px";ft(this.container,{left:l,top:h,visibility:"visible"})}else ft(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=ct('<div class="g6-tooltip g6-'+this.item+'-tooltip"></div>');return e.parentNode.appendChild(n),ft(n,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},ht=Object(p.a)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},lt),dt=Object(p.a)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: "+t.source+" target: "+t.target}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},lt),pt=["click","dblclick"],gt={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return pt.includes(this.trigger)?e=this.trigger:(e="click",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:"+e]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=t.item,n=this.graph.findDataById(e.get("id"));if(n){var r=n.children;if(r&&0!==r.length){var i=!n.collapsed;if(this.shouldBegin(t,i)&&(n.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i))){try{this.onChange(e,i)}catch(t){console.warn("G6 自 3.0.4 版本支持直接从 item.getModel() 获取源数据(临时通知,将在3.2.0版本中清除)",t)}this.graph.layout()}}}}},vt=function(t,e){if(!1!==e(t)&&t){var n=t.get("combos");if(0===n.length)return!1;Object(l.f)(n,(function(t){vt(t,e)}))}},mt={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected"}},getEvents:function(){return{"combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(this,t)&&"combo"===e.getType())},onDragStart:function(t){var e=this,n=this.graph,r=t.item;if(this.validationCombo(t)){this.targets=[];var i=n.findAllByState("combo",this.selectedState),o=r.get("id");0===i.filter((function(t){var e=t.get("id");return o===e})).length?this.targets.push(r):this.targets=i,this.activeState&&this.targets.map((function(t){var r=t.getModel();if(r.parentId){var i=n.findById(r.parentId);i&&n.setItemState(i,e.activeState,!0)}})),this.point={},this.originPoint={},this.origin={x:t.x,y:t.y},this.currentItemChildCombos=[],vt(r,(function(t){if(t.destroyed)return!1;var n=t.getModel();return e.currentItemChildCombos.push(n.id),!0}))}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,r=t.item,i=r.getModel(),o=n.getCombos(),a=r.getBBox(),s=a.centerX,u=a.centerY,c=a.width;o.filter((function(t){var n=t.getModel();return i.parentId,n.id!==i.id&&!e.currentItemChildCombos.includes(n.id)})).map((function(t){var r=t.getBBox(),i=r.centerX,o=r.centerY,a=r.width,f=s-i,l=u-o,h=2*Math.sqrt(f*f+l*l);c+a-h>.8*c?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}Object(l.f)(this.targets,(function(n){e.updateCombo(n,t)}))}},updatePositions:function(t){var e=this;this.enableDelegate&&Object(l.f)(this.targets,(function(n){e.updateCombo(n,t)}))},onDrop:function(t){var e=this,n=t.item;if(n&&this.targets&&!n.destroyed){this.updatePositions(t);var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){this.updatePositions(t);var n,r=this.graph,i=t.item.getModel().comboId;if(i){if(this.activeState){var o=r.findById(i);r.setItemState(o,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):i!==t.getID()&&(n=r.findById(i),i!==t.getModel().parentId&&r.updateComboTree(t,i))}))}else this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t)}));this.endComparison=!0,this.end(n,t)}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;t&&this.activeState&&r.setItemState(t,this.activeState,!1),t||this.targets.map((function(t){n.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t)})),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e){var n=this;if(!1!==e(t)&&t){var r=t.get("combos");Object(l.f)(r,(function(t){n.traverse(t,e)}));var i=t.get("nodes");Object(l.f)(i,(function(t){n.traverse(t,e)}))}},updateCombo:function(t,e){var n=this;this.traverse(t,(function(t){return!t.destroyed&&(n.updateSignleItem(t,e),!0)}))},updateSignleItem:function(t,e){var n=this.origin,r=this.graph,i=t.getModel(),o=t.get("id");this.point[o]||(this.point[o]={x:i.x,y:i.y});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r.updateItem(t,{x:a,y:s})},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,r=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:r})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?x(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,c=o.height,f=o.minX,l=o.minY;this.originPoint={x:a,y:s,width:u,height:c,minX:f,minY:l};var h=Object(p.a)(Object(p.a)({},z.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:Object(p.a)({width:o.width,height:o.height,x:o.x,y:o.y},h),name:"combo-delegate-shape"})}}},yt=["click","dblclick"],bt={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return yt.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:"+e]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}},xt=function(t){return function(e,n){return e[t]-n[t]}},wt=function(t,e,n){return t>=e&&t<=n},_t=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,f=a*c-s*u,l=null;if(f*f>.001*(a*a+s*s)*(u*u+c*c)){var h=(i*c-o*u)/f,d=(i*s-o*a)/f;wt(h,0,1)&&wt(d,0,1)&&(l={x:t.x+h*a,y:t.y+h*s})}return l},Et=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=[],s={x:n+i/2,y:r+o/2};a.push({x:n,y:r}),a.push({x:n+i,y:r}),a.push({x:n+i,y:r+o}),a.push({x:n,y:r+o}),a.push({x:n,y:r});for(var u=null,c=1;c<a.length&&!(u=_t(a[c-1],a[c],s,e));c++);return u},St=function(t,e){var n=t.x,r=t.y,i=t.r,o=e.x-n,a=e.y-r;if(Math.sqrt(o*o+a*a)<i)return null;var s=Math.sign(o),u=Math.sign(a),c=Math.atan(a/o);return{x:n+Math.abs(i*Math.cos(c))*s,y:r+Math.abs(i*Math.sin(c))*u}},Mt=function(t,e){var n=t.rx,r=t.ry,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=Math.atan2(s/r,a/n);return u<0&&(u+=2*Math.PI),{x:i+n*Math.cos(u),y:o+r*Math.sin(u)}},Ot=function(t,e,n){void 0===n&&(n=1);var r=[t.x,t.y,n];return e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]),ot.transformMat3(r,r,e),{x:r[0],y:r[1]}},At=function(t,e,n){void 0===n&&(n=1),e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]);var r=$.invert([],e);r||(r=[1,0,0,0,1,0,0,0,1]);var i=[t.x,t.y,n];return ot.transformMat3(i,i,r),{x:i[0],y:i[1]}},kt=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=t.x-n.x,a=t.y-n.y,s=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,u=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,c=i*o-r*a;return{x:-(a*s-i*u)/c,y:-(r*u-o*s)/c}},Tt=function(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},It=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n},Ct=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},Pt=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},Dt=function(t,e){t.translate(e.x,e.y)},Nt=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=t.getCanvasBBox(),i=e.x-r.minX,o=e.y-r.minY,a=at(n,[["t",i,o]]);t.setMatrix(a)},Rt=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;Object(l.m)(e)||(r=[e,e]),Object(l.m)(e)&&1===e.length&&(r=[e[0],e[0]]),n=at(n,[["s",r[0],r[1]]]),t.setMatrix(n)},jt=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=at(n,[["r",e]]),t.setMatrix(n)},Bt=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n.forEach((function(t){t.source&&(r[e[t.source]]+=1),t.target&&(r[e[t.target]]+=1)})),r};function Lt(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}var Gt=function(t,e,n){var r=!1,i=t.length;function o(t){return Math.abs(t)<1e-6?0:t<0?-1:1}if(i<=2)return!1;for(var a=0;a<i;a++){var s=t[a],u=t[(a+1)%i];if(Lt(s,u,[e,n]))return!0;o(s[1]-n)>0!=o(u[1]-n)>0&&o(e-(n-s[1])*(s[0]-u[0])/(s[1]-u[1])-s[0])<0&&(r=!r)}return r},Ft=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},Ut=function(t,e){var n=function(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}},r=function(t){for(var e=[],n=t.length,r=0;r<n-1;r++){var i=t[r],o=t[r+1];e.push({from:{x:i[0],y:i[1]},to:{x:o[0],y:o[1]}})}if(e.length>1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=n(t),o=n(e);if(!Ft(i,o))return!1;var a=!1;if(Object(l.f)(e,(function(e){if(Gt(t,e[0],e[1]))return a=!0,!1})),a)return!0;if(Object(l.f)(t,(function(t){if(Gt(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),u=r(e),c=!1;return Object(l.f)(u,(function(t){if(function(t,e){var n=!1;return Object(l.f)(t,(function(t){if(_t(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return c=!0,!1})),c},zt=function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},t}(),Wt=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},Vt=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=n/i,a=r/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},Xt=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=Wt(r,n[a]),u=s[0],c=s[1],f=s[2],l=s[3];o[a]=_t({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:f,y:l}),o[a]&&(i+=1)}return[o,i]},Yt=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=Wt(r,n[a]),u=s[0],c=s[1],f=s[2],l=s[3],h=Vt(e,new zt(u,c,f,l));(h=Math.abs(h-.5))>=0&&h<=1&&(o+=1,i=h<i?h:i)}return 0===o?-1:i},Ht=function(t){var e=0,n=0;if(t.length>0){for(var r=0,i=t;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},qt=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},Qt=function(t,e){var n,r=e.x1,i=e.y1,o=e.x2-r,a=e.y2-i,s=t.x-r,u=t.y-i,c=s*o+u*a;n=c<=0||(c=(s=o-s)*o+(u=a-u)*a)<=0?0:c*c/(o*o+a*a);var f=s*s+u*u-n;return f<0&&(f=0),f},Zt=function(t,e,n){return void 0===n&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},Kt=function(t,e){var n=t.x<e.x,r=t.x>e.x+e.width,i=t.y>e.y+e.height,o=t.y<e.y;if(!(n||r||i||o))return 0;if(i&&!n&&!r)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!r)return Math.pow(t.y-e.y,2);if(n&&!i&&!o)return Math.pow(e.x-t.x,2);if(r&&!i&&!o)return Math.pow(e.x+e.width-t.x,2);var a=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),s=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return a*a+s*s},$t=(n(53),n(37)),Jt=n.n($t);n(52);function te(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}n(270);var ee="\t\n\v\f\r \u2028\u2029",ne=new RegExp("([a-z])["+ee+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+ee+"]*,?["+ee+"]*)+)","ig"),re=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+ee+"]*,?["+ee+"]*","ig");function ie(t){if(!t)return null;if(Jt()(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(ne,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(re,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}n(86),n(87);var oe=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){if("\\"===t.charAt(0))return t.slice(1);var r=e[n];return 0===r&&(r="0"),r||""})):t},ae=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);for(var n=0,r=t;n<r.length;n++){var i=r[n],o=i.x,a=i.y;e.push(o),e.push(a)}var s=te(e);return s.unshift(["M",t[0].x,t[0].y]),s},se=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i={x:(1-n)*t.x+n*e.x,y:(1-n)*t.y+n*e.y},o=[];it.normalize(o,[e.x-t.x,e.y-t.y]),0===o.length&&(o=[0,0]);var a=[-o[1]*r,o[0]*r];return i.x+=a[0],i.y+=a[1],i},ue=function(t,e){var n=t.length;if(!n)return"";for(var r="",i=0;i<n;i++){var o=t[i];r+=oe(0===i?"M{x} {y}":"L{x} {y}",o)}return e&&(r+="Z"),r},ce=function(t){var e=[];return t.forEach((function(t){if("A"!==t[0])for(var n=1;n<t.length;n+=2)e.push([t[n],t[n+1]]);else{var r=t.length;e.push([t[r-2],t[r-1]])}})),e},fe=function(t){if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);var e=t[0],n=t[1],r=t[t.length-1],i=t[t.length-2];t.unshift(r),t.unshift(i),t.push(e),t.push(n);for(var o=[],a=1;a<t.length-2;a+=1){var s=t[a-1].x,u=t[a-1].y,c=t[a].x,f=t[a].y,l=t[a+1].x,h=t[a+1].y,d=c+(l-s)/6,p=f+(h-u)/6,g=l-((a!==t.length-2?t[a+2].x:l)-c)/6,v=h-((a!==t.length-2?t[a+2].y:h)-f)/6;o.push(["C",d,p,g,v,l,h])}return o.unshift(["M",r.x,r.y]),o},le=function(t,e){return it.scale([],it.normalize([],t),e)},he=function(t,e){var n=[t[1]-e[1],e[0]-t[0]],r=Math.sqrt(n[0]*n[0]+n[1]*n[1]);if(0===r)throw new Error("p0 should not be equal to p1");return[n[0]/r,n[1]/r]},de=function(t,e){return[e[0]-t[0],e[1]-t[1]]};function pe(t,e){if(!t||t.length<1)return"";if(1===t.length)return function(t){var n=[t[0][0],t[0][1]-e],r=[t[0][0],t[0][1]+e];return"M "+n+" A "+e+","+e+",0,0,0,"+r+" A "+e+","+e+",0,0,0,"+n}(t);if(2===t.length)return function(t){var n=it.scale([],he(t[0],t[1]),e),r=it.scale([],n,-1),i=it.add([],t[0],n),o=it.add([],t[1],n),a=it.add([],t[1],r),s=it.add([],t[0],r);return"M "+i+" L "+o+" A "+[e,e,"0,0,0",a].join(",")+" L "+s+" A "+[e,e,"0,0,0",i].join(",")}(t);for(var n=new Array(t.length),r=0;r<n.length;++r){var i=0===r?t[t.length-1]:t[r-1],o=t[r],a=it.scale([],he(i,o),e);n[r]=[it.add([],i,a),it.add([],o,a)]}var s="A "+[e,e,"0,0,0,"].join(",");return(n=n.map((function(t,e){var r="";return 0===e&&(r="M "+n[n.length-1][1]+" "),r+=s+t[0]+" L "+t[1]}))).join(" ")}function ge(t,e){var n,r,i,o=t.length;if(!t||o<1)return"";if(1===o)return r=[(n=t)[0][0],n[0][1]-e],i=[n[0][0],n[0][1]+e],"M "+r+" A "+[e,e,"0,0,0",i].join(",")+" A "+[e,e,"0,0,0",r].join(",");if(2===o)return function(t){var n=de(t[0],t[1]),r=le(n,e),i=it.add([],t[0],it.scale([],r,-1)),o=it.add([],t[1],r),a=1.2*e,s=le(it.normalize([],n),a),u=it.scale([],s,-1),c=it.add([],i,u),f=it.add([],o,u),l=it.add([],i,s);return"M "+i+" C "+[c,f,o].join(",")+" S "+[l,i].join(",")+" Z"}(t);for(var a=t.map((function(e,n){var r=t[(n+1)%o];return{p:e,v:it.normalize([],de(e,r))}})),s=0;s<a.length;++s){var u=s>0?s-1:o-1,c=it.normalize([],it.add([],a[u].v,it.scale([],a[s].v,-1)));a[s].p=it.add([],a[s].p,it.scale([],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var ve=["drag","shift","ctrl","alt","control"],me=["click","drag"],ye=["shift","ctrl","control","alt","meta",void 0],be=["shift","ctrl","alt","control"],xe={"drag-canvas":M,"zoom-canvas":st,"drag-node":W,"activate-relations":{getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","canvas:click":"clearAllItemStates"}},setAllItemStates:function(t){var e=t.item,n=this.graph;if(this.item=e,this.shouldUpdate(t.item,{event:t,action:"activate"})){for(var r=this.activeState,i=this.inactiveState,o=n.getNodes(),a=n.getEdges(),s=o.length,u=a.length,c=0;c<s;c++){var f=o[c],l=f.hasState("selected");this.resetSelected&&l&&n.setItemState(f,"selected",!1),n.setItemState(f,r,!1),i&&n.setItemState(f,i,!0)}for(c=0;c<u;c++){var h=a[c];n.setItemState(h,r,!1),i&&n.setItemState(h,i,!0)}i&&n.setItemState(e,i,!1),n.setItemState(e,r,!0);var d=e.getEdges(),p=d.length;for(c=0;c<p;c++){var g=void 0;g=(h=d[c]).getSource()===e?h.getTarget():h.getSource(),i&&n.setItemState(g,i,!1),n.setItemState(g,r,!0),n.setItemState(h,i,!1),n.setItemState(h,r,!0),h.toFront()}n.emit("afteractivaterelations",{item:t.item,action:"activate"})}},clearActiveState:function(t){var e=this.get("graph");if(this.shouldUpdate(t.item,{event:t,action:"deactivate"})){var n=this.activeState,r=this.inactiveState,i=e.get("autoPaint");e.setAutoPaint(!1);for(var o=e.getNodes(),a=e.getEdges(),s=o.length,u=a.length,c=0;c<s;c++){var f=o[c];e.clearItemStates(f,[n,r])}for(c=0;c<u;c++){var l=a[c];e.clearItemStates(l,[n,r,"deactivate"])}e.paint(),e.setAutoPaint(i),e.emit("afteractivaterelations",{item:t.item||this.get("item"),action:"deactivate"})}},clearAllItemStates:function(t){var e=this.graph;if(this.shouldUpdate(t.item,{event:t,action:"deactivate"})){for(var n=this.activeState,r=this.inactiveState,i=e.getNodes(),o=e.getEdges(),a=i.length,s=o.length,u=0;u<a;u++){var c=i[u];e.clearItemStates(c,[n,r])}for(u=0;u<s;u++){var f=o[u];e.clearItemStates(f,[n,r,"deactivate"])}e.emit("afteractivaterelations",{item:t.item||this.get("item"),action:"deactivate"})}}},"brush-select":q,"click-select":Z,"lasso-select":{getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return ve.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach((function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(){var t=this.graph,e=this.selectedState,n=t.findAllByState("node",e),r=t.findAllByState("edge",e);n.forEach((function(n){return t.setItemState(n,e,!1)})),r.forEach((function(n){return t.setItemState(n,e,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,n=this.shouldUpdate,r=this.points.map((function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]})),i=this.selectedState,o=[],a=[];e.getNodes().forEach((function(t){if(function(t,e){var n,r=t.getKeyShape();if("path"===t.get("type"))n=ce(r.attr("path"));else{var i=r.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return Ut(e,n)}(t,r)&&n(t,"select")){o.push(t);var s=t.getModel();a.push(s.id),e.setItemState(t,i,!0)}}));var s=[];this.includeEdges&&o.forEach((function(r){r.getOutEdges().forEach((function(r){var i=r.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&n(r,"select")&&(s.push(r),e.setItemState(r,t.selectedState,!0))}))})),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:Object(p.a)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},tooltip:ht,"edge-tooltip":dt,"collapse-expand":gt,"drag-combo":mt,"collapse-expand-combo":bt,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{}}},getEvents:function(){var t;return me.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===ye.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,n=this.graph,r=e.getModel();if(this.addingEdge&&this.edge){if(!this.shouldEnd.call(this,t))return;var i={target:r.id};this.source===r.id&&(i.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(this.edge,i),n.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin.call(this,t))return;this.edge=n.addItem("edge",Object(p.a)({source:r.id,target:r.id},this.edgeConfig),!1),this.source=r.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){if(!this.key||this.keydown){var e=this.graph,n=t.item;if(this.addingEdge&&t.target&&t.target.isCanvas&&t.target.isCanvas())return e.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1);if(this.addingEdge&&this.edge===n){var r=!0;if(!e.get("groupByTypes"))for(var i=t.x,o=t.y,a=e.getNodes(),s=a.length,u=0;u<s;u++){var c=a[u],f=c.getModel(),l=c.getBBox();if(i<=l.maxX&&i>=l.minX&&o<=l.maxY&&o>=l.minY){if(!this.shouldEnd.call(this,{x:t.x,y:t.y,canvasX:t.canvasX,canvasY:t.canvasY,clientX:t.clientX,clientY:t.clientY,item:c}))return;e.emit("beforecreateedge",{}),e.updateItem(this.edge,{target:f.id}),e.emit("aftercreateedge",{edge:this.edge}),r=!1;break}}r&&e.removeItem(this.edge,!1),this.edge=null,this.addingEdge=!1}}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}},"shortcuts-call":{getDefaultCfg:function(){return{trigger:"ctrl",combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return be.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="ctrl",console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '"+this.trigger+"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),r=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=r===n||"control"===r&&"ctrl"===n||"ctrl"===r&&"control"===n);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '"+this.functionName+"' 不合法,它不是 Graph 的一个函数名"),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(r===o||"control"===r&&"ctrl"===o||"ctrl"===r&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}}};Object(l.f)(xe,(function(t,e){d.registerBehavior(e,t)}));var we=d,_e=n(116),Ee=n(48),Se=n(60),Me=function(){function t(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return t.prototype.formatModes=function(){var t=this.modes;Object(l.f)(t,(function(t){Object(l.f)(t,(function(e,n){Object(l.w)(e)&&(t[n]={type:e})}))}))},t.prototype.setBehaviors=function(t){var e,n=this.graph,r=this.modes[t],i=[];Object(l.f)(r||[],(function(t){var r=d.getBehavior(t.type);r&&(e=new r(t))&&(e.bind(n),i.push(e))})),this.currentBehaves=i},t.mergeBehaviors=function(t,e){return Object(l.f)(e,(function(e){t.indexOf(e)<0&&(Object(l.w)(e)&&(e={type:e}),t.push(e))})),t},t.filterBehaviors=function(t,e){var n=[];return t.forEach((function(t){var r="";r=Object(l.w)(t)?t:t.type,e.indexOf(r)<0&&n.push(t)})),n},t.prototype.setMode=function(t){var e=this.modes,n=this.graph,r=t;e[r]&&(n.emit("beforemodechange",{mode:t}),Object(l.f)(this.currentBehaves,(function(t){t.unbind(n)})),this.setBehaviors(r),n.emit("aftermodechange",{mode:t}),this.mode=t)},t.prototype.getMode=function(){return this.mode},t.prototype.manipulateBehaviors=function(e,n,r){var i,o=this;if(i=Object(l.m)(e)?e:[e],Object(l.m)(n))return Object(l.f)(n,(function(e){o.modes[e]?o.modes[e]=r?t.mergeBehaviors(o.modes[e]||[],i):t.filterBehaviors(o.modes[e]||[],i):r&&(o.modes[e]=i)})),this;var a=n;return n||(a=this.mode),this.modes[a]||r&&(this.modes[a]=i),this.modes[a]=r?t.mergeBehaviors(this.modes[a]||[],i):t.filterBehaviors(this.modes[a]||[],i),this.setMode(this.mode),this},t.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},t}(),Oe=function(){function t(t){this.destroyed=!1,this.graph=t,this.destroyed=!1}return t.prototype.getViewCenter=function(){var t=this.getFormatPadding(),e=this.graph,n=this.graph.get("width"),r=e.get("height");return{x:(n-t[1]-t[3])/2+t[3],y:(r-t[0]-t[2])/2+t[0]}},t.prototype.fitCenter=function(){var t=this.graph,e=t.get("group");e.resetMatrix();var n=e.getCanvasBBox();if(0!==n.width&&0!==n.height){var r=this.getViewCenter(),i=n.x+n.width/2,o=n.y+n.height/2;t.translate(r.x-i,r.y-o)}},t.prototype.fitView=function(){var t=this.graph,e=this.getFormatPadding(),n=t.get("width"),r=t.get("height"),i=t.get("group");i.resetMatrix();var o=i.getCanvasBBox();if(0!==o.width&&0!==o.height){var a=this.getViewCenter(),s=o.x+o.width/2,u=o.y+o.height/2;t.translate(a.x-s,a.y-u);var c=(n-e[1]-e[3])/o.width,f=(r-e[0]-e[2])/o.height,l=c;c>f&&(l=f),t.zoom(l,a)}},t.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return v(t)},t.prototype.focusPoint=function(t,e,n){var r=this,i=this.getViewCenter(),o=this.getPointByCanvas(i.x,i.y),a=this.graph.get("group").getMatrix();if(a||(a=[1,0,0,0,1,0,0,0,1]),e){var s=(o.x-t.x)*a[0],u=(o.y-t.y)*a[4],c=0,f=0,l=0,h=0;this.graph.get("canvas").animate((function(t){l=s*t,h=u*t,r.graph.translate(l-c,h-f),c=l,f=h}),Object(p.a)({},n))}else this.graph.translate((o.x-t.x)*a[0],(o.y-t.y)*a[4])},t.prototype.getPointByCanvas=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),At({x:t,y:e},n)},t.prototype.getPointByClient=function(t,e){var n=this.graph.get("canvas").getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},t.prototype.getClientByPoint=function(t,e){var n=this.graph.get("canvas"),r=this.getCanvasByPoint(t,e),i=n.getClientByPoint(r.x,r.y);return{x:i.x,y:i.y}},t.prototype.getCanvasByPoint=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),Ot({x:t,y:e},n)},t.prototype.focus=function(t,e,n){Object(l.w)(t)&&(t=this.graph.findById(t));var r=t.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),t&&this.focusPoint({x:r[6],y:r[7]},e,n)},t.prototype.changeSize=function(t,e){var n=this.graph;if(!Object(l.t)(t)||!Object(l.t)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:t,height:e}),n.get("canvas").changeSize(t,e),n.get("plugins").forEach((function(r){if(r.get("gridContainer")){var i=n.get("minZoom");ft(r.get("container"),{width:t+"px",height:e+"px"}),ft(r.get("gridContainer"),{width:t/i+"px",height:e/i+"px",left:0,top:0})}}))},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}(),Ae=function(){function t(t){this.preItem=null,this.graph=t,this.extendEvents=[],this.dragging=!1,this.destroyed=!1,this.initEvents()}return t.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,n=t.get("canvas"),r=n.get("el"),i=Object(l.H)(this,"onCanvasEvents"),o=Object(l.H)(this,"onExtendEvents"),a=Object(l.H)(this,"onWheelEvent");n.on("*",i),this.canvasHandler=i,e.push(ut(r,"DOMMouseScroll",a)),e.push(ut(r,"mousewheel",a)),"undefined"!=typeof window&&(e.push(ut(window,"keydown",o)),e.push(ut(window,"keyup",o)),e.push(ut(window,"focus",o)))},t.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},t.prototype.onCanvasEvents=function(e){var n=this.graph,r=n.get("canvas"),i=e.target,o=e.type;e.canvasX=e.x,e.canvasY=e.y;var a={x:e.canvasX,y:e.canvasY},s=n.get("group").getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),y(s)&&(a=n.getPointByClient(e.clientX,e.clientY)),e.x=a.x,e.y=a.y,e.currentTarget=n,i===r)return"mousemove"===o&&this.handleMouseMove(e,"canvas"),e.target=r,e.item=null,n.emit(o,e),void n.emit("canvas:"+o,e);var u=t.getItemRoot(i);if(u){var c=u.get("item");if(!c.destroyed){var f=c.getType();if(e.target=i,e.item=c,e.canvasX===e.x&&e.canvasY===e.y){var l=n.getCanvasByPoint(e.x,e.y);e.canvasX=l.x,e.canvasY=l.y}n.emit(o,e),e.name&&!e.name.includes(":")?n.emit(f+":"+o,e):n.emit(e.name,e),"dragstart"===o&&(this.dragging=!0),"dragend"===o&&(this.dragging=!1),"mousemove"===o&&this.handleMouseMove(e,f)}}else n.emit(o,e)},t.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},t.prototype.onWheelEvent=function(t){Object(l.s)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},t.prototype.handleMouseMove=function(t,e){var n=this.graph,r=this.preItem,i=n.get("canvas"),o=t.target===i?null:t.item;t=m(t),r&&r!==o&&!r.destroyed&&(t.item=r,this.emitCustomEvent(r.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(r.getType(),"dragleave",t)),o&&r!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},t.prototype.emitCustomEvent=function(t,e,n){n.type=e,this.graph.emit(t+":"+e,n)},t.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,n=this.extendEvents;t.get("canvas").off("*",e),Object(l.f)(n,(function(t){t.remove()})),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},t}(),ke={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875},Te=Math.PI,Ie=Math.sin,Ce=Math.cos,Pe=Ie(Te/8),De=Ce(Te/8),Ne=function(t,e){var n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),r=Ot(r,o),i=Ot(i,o)}var a=r.x,s=r.y,u=i.x,c=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:c,width:u-a,height:c-s}},Re=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e.getKeyShape().getBBox(),i=t.loopCfg||{},o=i.dist||2*Math.max(r.width,r.height),a=i.position||z.defaultLoopPosition,s=[n[6],n[7]],u=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],f=r.height/2,l=r.height/2,h=f*Pe,d=f*De,p=l*Pe,g=l*De;if(u[0]===c[0]&&u[1]===c[1]){switch(a){case"top":u=[s[0]-h,s[1]-d],c=[s[0]+p,s[1]-g];break;case"top-right":f=r.height/2,l=r.width/2,u=[s[0]+(h=f*Pe),s[1]-(d=f*De)],c=[s[0]+(g=l*De),s[1]-(p=l*Pe)];break;case"right":f=r.width/2,l=r.width/2,u=[s[0]+(d=f*De),s[1]-(h=f*Pe)],c=[s[0]+(g=l*De),s[1]+(p=l*Pe)];break;case"bottom-right":f=r.width/2,l=r.height/2,u=[s[0]+(d=f*De),s[1]+(h=f*Pe)],c=[s[0]+(p=l*Pe),s[1]+(g=l*De)];break;case"bottom":f=r.height/2,l=r.height/2,u=[s[0]+(h=f*Pe),s[1]+(d=f*De)],c=[s[0]-(p=l*Pe),s[1]+(g=l*De)];break;case"bottom-left":f=r.height/2,l=r.width/2,u=[s[0]-(h=f*Pe),s[1]+(d=f*De)],c=[s[0]-(g=l*De),s[1]+(p=l*Pe)];break;case"left":f=r.width/2,l=r.width/2,u=[s[0]-(d=f*De),s[1]+(h=f*Pe)],c=[s[0]-(g=l*De),s[1]-(p=l*Pe)];break;case"top-left":f=r.width/2,l=r.height/2,u=[s[0]-(d=f*De),s[1]-(h=f*Pe)],c=[s[0]-(p=l*Pe),s[1]-(g=l*De)];break;default:f=r.width/2,l=r.width/2,u=[s[0]-(h=f*Pe),s[1]-(d=f*De)],c=[s[0]+(p=l*Pe),s[1]-(g=l*De)]}if(!1===i.clockwise){var v=[u[0],u[1]];u=[c[0],c[1]],c=[v[0],v[1]]}}var m=[u[0]-s[0],u[1]-s[1]],y=(f+o)/f,b=(l+o)/l;!1===i.clockwise&&(y=(l+o)/l,b=(f+o)/f);var x=it.scale([],m,y),w=[s[0]+x[0],s[1]+x[1]],_=[c[0]-s[0],c[1]-s[1]],E=it.scale([],_,b),S=[s[0]+E[0],s[1]+E[1]];return t.startPoint={x:u[0],y:u[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:w[0],y:w[1]},{x:S[0],y:S[1]}],t},je=function(t,e,n,r,i){var o=[],a=t.getPoint(e);if(null===a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*Te),n&&(a.x+=Ce(u)*n,a.y+=Ie(u)*n),r){var c=u-Te/2;u>.5*Te&&u<1.5*Te&&(c-=Te),a.x+=Ce(c)*r,a.y+=Ie(c)*r}var f={x:a.x,y:a.y,angle:u};return i?(u>.5*Te&&u<1.5*Te&&(u-=Te),Object(p.a)({rotate:u},f)):f},Be=function(t,e){if(!1===e(t))return!1;if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!Be(t.children[n],e))return!1;return!0},Le=function(t,e){if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!Le(t.children[n],e))return;return!1!==e(t)},Ge=function(t,e){"function"==typeof e&&Be(t,e)},Fe=function(t,e){"function"==typeof e&&Le(t,e)},Ue=function(t,e){var n={x:1/0,y:1/0},r={x:-1/0,y:-1/0},i="x",o="y";e&&["V","TB","BT"].indexOf(e)>=0&&(o="x",i="y");var a=0;Ge(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.x<n.x&&(n.x=t.x),t.y>r.y&&(r.y=t.y),t.y<n.y&&(n.y=t.y),!0}));var s=2*Te/a,u=r[o]-n[o];return 0===u||Ge(t,(function(e){var r=(e[o]-n[o])/u*(2*Te-s)+s,a=Math.abs("x"===i?e.x-t.x:e.y-t.y);return e.x=a*Math.cos(r),e.y=a*Math.sin(r),!0})),t},ze=function(t,e){return e*(ke[t]||1)},We=function(t,e){var n=0,r=new RegExp("[一-龥]+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=ze(t,e)})),[n,e]},Ve=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=Object(l.c)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo "+o.id+" can not be the same as the combo's id"),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo "+o.id+" does not exist!"),delete o.parentId);var a=r[o.id];if(a){if(o.children=a.children,r[o.id]=o,!(a=o).parentId)return void n.push(a);var s=r[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var u={id:a.parentId,children:[a]};r[a.parentId]=u,r[o.id]=o}}else{if(Object(l.w)(t.parentId))if(u=r[t.parentId])u.children?u.children.push(o):u.children=[o],r[o.id]=o;else{var c={id:t.parentId,children:[o]};r[c.id]=c,r[o.id]=o}else n.push(o),r[o.id]=o}}));var o={};(e||[]).forEach((function(t){o[t.id]=t;var e=r[t.comboId];if(e){var n={id:t.id,comboId:t.comboId};e.children?e.children.push(n):e.children=[n],n.itemType="node",r[t.id]=n}}));var a=0;return n.forEach((function(t){t.depth=a+10,Be(t,(function(t){var e,n=r[t.id].itemType;e="node"===n?r[t.comboId]:r[t.parentId],t.depth=e&&"node"===n?a+1:a+10,a<t.depth&&(a=t.depth);var i=o[t.id];return i&&(i.depth=t.depth),!0}))})),n},Xe=function(t,e,n){var r,i=t,o={root:{children:t}},a=!1,s="root";(t||[]).forEach((function(t){if(!a)return t.id===e?(r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,void(a=!0)):void Ge(t,(function(t){return o[t.id]={children:t.children},i=o[t.parentId||t.comboId||"root"].children,!t||!t.removed&&e!==t.id||!i||(s=t.parentId||t.comboId||"root",r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,a=!0,!1)}))}));var u=(i=o[s].children)?i.indexOf(r):-1;if(u>-1&&i.splice(u,1),a||(r={id:e,itemType:"node",comboId:n},o[e]={children:void 0}),e){var c=!1;if(n){var f=0;(t||[]).forEach((function(t){c||Ge(t,(function(t){return n!==t.id||(c=!0,t.children?t.children.push(r):t.children=[r],f=t.depth,"node"===r.itemType?r.depth=f+2:r.depth=f+1,!1)}))}))}else n&&c||"node"===r.itemType||t.push(r);var l=r.depth;Ge(r,(function(t){return"node"===t.itemType?l+=2:l+=1,t.depth=l,!0}))}return t},Ye=function(t,e){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};return t&&0!==t.length?(t.forEach((function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxX<i.maxX&&(n.maxX=i.maxX),i.y&&n.maxY<i.maxY&&(n.maxY=i.maxY)}})),n.x=(n.minX+n.maxX)/2,n.y=(n.minY+n.maxY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,Object.keys(n).forEach((function(t){n[t]!==1/0&&n[t]!==-1/0||(n[t]=void 0)})),n):n},He=function(t){var e=t.group,n=t.height,r=t.width,i=t.x,o=t.y,a=e.get("canvas"),s=a.get("width"),u=a.get("height"),c={start:{x:0,y:0},end:{x:0,y:0}};return c.start.x=i/s,c.start.y=o/u,c.end.x=(i+r)/s,c.end.y=(o+n)/u,c};function qe(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},n=e(t);if("string"!=typeof n)return n;for(var r=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return r(a)===t}))},u=null,c=0,f="";c<i.length;){var l=i[c],h=s('"',"'");if(h||l.trim()){var d="\\"===i[c-1],p=s("}"),g=s("]"),v=s(","),m=r(o);if(h)if(r(a)!==l||d)f+=l;else{a.pop();var y=e(f);m.push(y),u=y,f=""}else if(g&&","===l)f&&(m.push(e(f)),f="");else if(p&&":"===l)a.push(","),f&&(m.push(f),f="");else if(v&&","===l)f&&(m.push(e(f)),f=""),a.pop();else if("}"===l&&(p||v)){f&&(m.push(e(f)),f=""),v&&a.pop();for(var b={},x=1;x<m.length;x+=2)b[m[x-1]]=m[x];o.pop(),o.length&&r(o).push(b),a.pop(),u=b}else"]"===l&&g?(f&&(m.push(e(f)),f=""),o.pop(),o.length&&r(o).push(m),a.pop(),u=m):"{"===l?(o.push([]),a.push("}")):"["===l?(o.push([]),a.push("]")):'"'===l?a.push('"'):"'"===l?a.push("'"):f+=l;c+=1}else c+=1}return u||f}function Qe(t,e){var n;void 0===e&&(e={x:0,y:0});var r=Object(p.a)({x:0,y:0,width:0,height:0},e);if(null===(n=t.children)||void 0===n?void 0:n.length){var i=t.attrs,o=void 0===i?{}:i,a=o.marginTop,s=Object(p.a)({},e);a&&(s.y+=a);for(var u=0;u<t.children.length;u++){t.children[u].attrs.key=(o.key||"root")+" -"+u+" ";var c=Qe(t.children[u],s);if(c.bbox){var f=c.bbox;"inline"===c.attrs.next?s.x+=c.bbox.width:s.y+=c.bbox.height,f.width+f.x>r.width&&(r.width=f.width+f.x),f.height+f.y>r.height&&(r.height=f.height+f.y)}}}return t.bbox=function(t,e,n){var r,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:n.width||0,height:n.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,r=2*a.r);break;case"text":a.text&&(i=We(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=Object(p.a)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(r=a.height)}return r>=0&&(s.height=r),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,r),t.attrs=Object(p.a)(Object(p.a)({},t.attrs),t.bbox),t}function Ze(t){var e={},n=function(e){var n=function(t){return function(e){for(var n=t.length,r=[],i=0,o="";i<n;)if("{"===t[i]&&"{"===t[i+1])r.push(o),o="",i+=2;else if("}"===t[i]&&"}"===t[i+1]){if(r.length){var a=r.pop();o=Object(l.i)(e,o,a.endsWith("=")?'"{'+o+'}"':o),r.push(a+o)}i+=2,o=""}else o+=t[i],i+=1;return r.push(o),r.map((function(t,e){return r[e-1]&&r[e-1].endsWith("=")?'"{'+t+'}"':t})).join("")}}("function"==typeof t?t(e):t)(e),r=document.createElement("div");r.innerHTML=n;var i=Qe(function t(e,n){var r={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map((function(e){return t(e,n)})),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(r.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach((function(t){var n=t.split("-").reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)})),i=e.getAttribute(t);try{if("style"===n||"attrs"===n){var o=qe(i);r=Object(p.a)(Object(p.a)({},r),o)}else a[n]=qe(i)}catch(t){if("style"===n)throw t;a[n]=i}})),a.attrs=r,n&&n.style&&a.name&&"object"==typeof n.style[a.name]&&(a.attrs=Object(p.a)(Object(p.a)({},a.attrs),n.style[a.name])),n&&n.style&&a.keyshape&&(a.attrs=Object(p.a)(Object(p.a)({},a.attrs),n.style)),o.length&&(a.children=o),a}(r.children[0],e));return r.remove(),i};return{draw:function(t,r){var i=n(t),o=r,a=function(t){var e=t.attrs,n=void 0===e?{}:e,i=t.bbox,s=t.type,u=t.children,c=Object(p.e)(t,["attrs","bbox","type","children"]);if("group"!==t.type){var f=r.addShape(t.type,Object(p.a)({attrs:n,origin:{bbox:i,type:s,children:u}},c));t.keyshape&&(o=f)}t.children&&t.children.forEach((function(t){return a(t)}))};return a(i),e[t.id]=[i],o},update:function(t,r){e[t.id]||(e[t.id]=[]);var i=r.getContainer(),o=i.get("children"),a=n(t),s=function t(e,n){var r,i,o,a,s=(e||{}).type,u=((null==n?void 0:n.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&n)return{action:"delete",val:n,type:s,key:u};if(e&&!n)return{action:"add",val:e,type:s};if(!e&&!n)return{action:"same",type:s};var c=[];if((null===(r=e.children)||void 0===r?void 0:r.length)>0||(null===(i=n.children)||void 0===i?void 0:i.length)>0)for(var f=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=n.children)||void 0===a?void 0:a.length),l=n.children||[],h=e.children||[],d=0;d<f;d+=1)c.push(t(h[d],l[d]));var p=Object.keys(n.attrs),g=Object.keys(e.attrs);return n.type!==e.type?{action:"restructure",nowTarget:e,formerTarget:n,key:u,children:c}:p.filter((function(t){return"children"!==t})).some((function(t){return e.attrs[t]!==n.attrs[t]||!g.includes(t)}))?{action:"change",val:e,children:c,type:s,key:u}:{action:"same",children:c,type:s,key:u}}(a,e[t.id].pop()),u=function(t){var e;"group"!==t.type&&i.addShape(t.type,{attrs:t.attrs}),(null===(e=t.children)||void 0===e?void 0:e.length)&&t.children.map((function(t){return u(t)}))},c=function(t){var e,n=o.find((function(e){return e.attrs.key===t.attrs.key}));n&&i.removeChild(n),(null===(e=t.children)||void 0===e?void 0:e.length)&&t.children.map((function(t){return c(t)}))},f=function(t){var e=t.key;if("group"!==t.type){var n=o.find((function(t){return t.attrs.key===e}));switch(t.action){case"change":if(n){var i=t.val.keyshape?r.getOriginStyle():{};n.attr(Object(p.a)(Object(p.a)({},i),t.val.attrs))}break;case"add":u(t.val);break;case"delete":c(t.val);break;case"restructure":c(t.formerTarget),u(t.nowTarget)}}t.children&&t.children.forEach((function(t){return f(t)}))};f(s),e[t.id].push(a)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var Ke={};function $e(t){return Ke[t]||(Ke[t]=Object(l.G)(t)),Ke[t]}var Je={defaultShapeType:"defaultType",className:null,getShape:function(t){return this[t]||this[this.defaultShapeType]},draw:function(t,e,n){var r=this.getShape(t),i=r.draw(e,n);return r.afterDraw&&r.afterDraw(e,n,i),i},baseUpdate:function(t,e,n){var r=this.getShape(t);r.update&&r.update(e,n),r.afterUpdate&&r.afterUpdate(e,n)},setState:function(t,e,n,r){this.getShape(t).setState(e,n,r)},shouldUpdate:function(t){return!!this.getShape(t).update},getControlPoints:function(t,e){return this.getShape(t).getControlPoints(e)},getAnchorPoints:function(t,e){return this.getShape(t).getAnchorPoints(e)}},tn={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints;return t.anchorPoints||e}},en=function(){function t(){}return t.registerFactory=function(e,n){var r=$e(e),i=Je,o=Object(p.a)(Object(p.a)({},i),n);return t[r]=o,o.className=r,o},t.getFactory=function(e){return t[$e(e)]},t.registerNode=function(e,n,r){var i,o=t.Node;if("string"==typeof n||"function"==typeof n){var a=Ze(n);i=Object(p.a)(Object(p.a)({},o.getShape("single-node")),a)}else if(n.jsx){a=Ze(n.jsx);i=Object(p.a)(Object(p.a)(Object(p.a)({},o.getShape("single-node")),a),n)}else{var s=r?o.getShape(r):tn;i=Object(p.a)(Object(p.a)({},s),n)}return i.type=e,i.itemType="node",o[e]=i,i},t.registerEdge=function(e,n,r){var i=t.Edge,o=r?i.getShape(r):tn,a=Object(p.a)(Object(p.a)({},o),n);return a.type=e,a.itemType="edge",i[e]=a,a},t.registerCombo=function(e,n,r){var i=t.Combo,o=r?i.getShape(r):tn,a=Object(p.a)(Object(p.a)({},o),n);return a.type=e,a.itemType="combo",i[e]=a,a},t}(),nn=en;en.registerFactory("node",{defaultShapeType:"circle"}),en.registerFactory("edge",{defaultShapeType:"line"}),en.registerFactory("combo",{defaultShapeType:"circle"});var rn=["startArrow","endArrow"],on=function(){function t(t){this._cfg={},this.destroyed=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var n=this.get("model"),r=n.id,i=this.get("type");r||(r=Object(l.F)(i),this.get("model").id=r),this.set("id",r);var o=t.group;o&&(o.set("item",this),o.set("id",r)),this.init(),this.draw();var a=n.shape||n.type||("edge"===i?"line":"circle"),s=this.get("shapeFactory");if(s&&s[a]){var u=s[a].options;if(u&&u.stateStyles){var c=this.get("styles")||n.stateStyles;c=Object(l.e)({},u.stateStyles,c),this.set("styles",c)}}}return t.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=Ne(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=Ne(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.drawInner=function(){var t=this.get("shapeFactory"),e=this.get("group"),n=this.get("model");e.clear();var r=n.visible;if(void 0===r||r||this.changeVisibility(r),t){this.updatePosition(n);var i=this.getShapeCfg(n),o=i.type,a=t.draw(o,i,e);a&&(this.set("keyShape",a),a.set("isKeyShape",!0),a.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(t,o)}},t.prototype.setOriginStyle=function(t){var e={},n=this.get("group").get("children"),r=this.getKeyShape(),i=this,o=r.get("name");this.get("originStyle")||Object(l.f)(n,(function(t){var n=t.get("name");if(n&&n!==o)e[n]=i.getShapeStyleByName(n);else{var r=i.getShapeStyleByName();r.path&&delete r.path,r.matrix&&delete r.matrix,o?e[o]=r:Object.assign(e,r)}}));var a=this.get("type"),s=this.getModel(),u=s.type;if(!u)switch(a){case"edge":u="line";break;default:u="circle"}var c=nn.getFactory(a)[u];c||(c=nn.getFactory(a).getShape());var f=c.getOptions?c.getOptions(s):{},h=f.style||{},d=f.size;if("edge"===a?h.lineWidth||(h.lineWidth=d||z.defaultEdge.size):(h.r||(h.r=d/2||z.defaultNode.size/2),h.width||(h.width=(Object(l.m)(d)?d[0]:d)||z.defaultNode.size/2),h.height||(h.height=(Object(l.m)(d)?d[1]:d)||z.defaultNode.size/2)),o){var p={};for(var g in h){var v=h[g];Object(l.v)(v)&&!rn.includes(g)||(p[g]=v)}p.path&&delete p.path,p.matrix&&delete p.matrix,e[o]?e[o]=Object.assign(p,e[o]):e[o]=p}else Object.assign(e,h);var m=this.getOriginStyle(),y={};(y=t?Object(l.e)({},m,e,t.style,{labelCfg:t.labelCfg}):Object(l.e)({},m,e)).path&&delete y.path,y.matrix&&delete y.matrix,i.set("originStyle",y)},t.prototype.restoreStates=function(t,e){var n=this,r=n.get("states");Object(l.f)(r,(function(r){t.setState(e,r,!0,n)}))},t.prototype.init=function(){var t=nn.getFactory(this.get("type"));this.set("shapeFactory",t)},t.prototype.get=function(t){return this._cfg[t]},t.prototype.set=function(t,e){Object(l.v)(t)?this._cfg=Object(p.a)(Object(p.a)({},this._cfg),t):this._cfg[t]=e},t.prototype.getDefaultCfg=function(){return{}},t.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null)},t.prototype.beforeDraw=function(){},t.prototype.afterDraw=function(){},t.prototype.afterUpdate=function(){},t.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},t.prototype.getShapeStyleByName=function(t){var e=this.get("group"),n=this.getKeyShape();if(t&&(n=e.find((function(e){return e.get("name")===t}))),n){var r={};return Object(l.f)(n.attr(),(function(t,e){"img"!==e&&(r[e]=t)})),r}return{}},t.prototype.getShapeCfg=function(t){var e=this.get("styles");if(e){var n=t;return n.style=Object(p.a)(Object(p.a)({},e),t.style),n}return t},t.prototype.getStateStyle=function(t){var e=this.get("styles");return e&&e[t]},t.prototype.getOriginStyle=function(){return this.get("originStyle")},t.prototype.getCurrentStatesStyle=function(){var t=this,e={},n=t.getStates();return n&&n.length?(Object(l.f)(t.getStates(),(function(n){e=Object.assign(e,t.getStateStyle(n))})),e):this.getOriginStyle()},t.prototype.setState=function(t,e){var n=this.get("states"),r=this.get("shapeFactory"),i=t,o=t;Object(l.w)(e)&&(i=t+":"+e,o=t+":");var a=n;if(Object(l.n)(e)){var s=n.indexOf(o);if(e){if(s>-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if(Object(l.w)(e)){var u=n.filter((function(t){return t.includes(o)}));u.length>0&&this.clearStates(u),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var c=this.get("model").type;r.setState(c,t,e,this)}},t.prototype.clearStates=function(t){var e=this,n=e.getStates(),r=e.get("shapeFactory"),i=e.get("model").type;t||(t=n),Object(l.w)(t)&&(t=[t]);var o=n.filter((function(e){return-1===t.indexOf(e)}));e.set("states",o),t.forEach((function(t){r.setState(i,t,!1,e)}))},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(){var t=this.get("model");this.updatePosition(t),this.updateShape(),this.afterUpdate(),this.clearCache()},t.prototype.isOnlyMove=function(t){return!1},t.prototype.update=function(t,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=n.x,a=n.y;t.x=isNaN(t.x)?n.x:t.x,t.y=isNaN(t.y)?n.y:t.y;var s=this.get("styles");if(t.stateStyles){var u=t.stateStyles;Object(l.z)(s,u),delete t.stateStyles}Object.assign(n,t),e?this.updatePosition(t):(o===t.x&&a===t.y||this.updatePosition(t),this.updateShape()),this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(){var t=this.get("shapeFactory"),e=this.get("model"),n=e.type;if(t.shouldUpdate(n)&&n===this.get("currentShape")){var r=this.getShapeCfg(e);t.baseUpdate(n,r,this)}else this.draw();this.setOriginStyle(e),this.restoreStates(t,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),n=Object(l.s)(t.x)?e.x:t.x,r=Object(l.s)(t.y)?e.y:t.y,i=this.get("group");Object(l.s)(n)||Object(l.s)(r)||(i.resetMatrix(),Dt(i,{x:n,y:r}),e.x=n,e.y=r,this.clearCache())},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),an={source:"start",target:"end"},sn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var n=an[t]+"Point",r=t+"Node",i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),Object(l.v)(e)?(this.set(n,e),this.set(r,null)):(e.addEdge(this),this.set(r,e),this.set(n,null))},e.prototype.getLinkPoint=function(t,e,n){var r=an[t]+"Point",i=t+"Node",o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,n),c=e[s];Object(l.s)(c)||(o=a.getLinkPointByAnchor(c)),o=o||a.getLinkPoint(u),Object(l.s)(o.index)||this.set(t+"AnchorIndex",o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var n="source"===t?"target":"source";return this.getEndPoint(n)},e.prototype.getEndPoint=function(t){var e=t+"Node",n=an[t]+"Point",r=this.get(e);return r?r.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),n=this.getEndPoint("target"),r=this.get("shapeFactory"),i=t.type;return r.getControlPoints(i,{startPoint:e,endPoint:n})},e.prototype.getEndCenter=function(t){var e=t+"Node",n=an[t]+"Point",r=this.get(e);if(r){var i=r.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e){var n=this.get("linkCenter"),r=t.prototype.getShapeCfg.call(this,e);if(n)r.startPoint=this.getEndCenter("source"),r.endPoint=this.getEndCenter("target");else{var i=r.controlPoints||this.getControlPointsByCenter(r);r.startPoint=this.getLinkPoint("source",e,i),r.endPoint=this.getLinkPoint("target",e,i)}return r.sourceNode=this.get("sourceNode"),r.targetNode=this.get("targetNode"),r},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("sourceNode"),n=this.get("targetNode");return e?delete t.sourceNode:t.source=this.get("startPoint"),n?delete t.targetNode:t.target=this.get("endPoint"),Object(l.w)(t.source)||Object(l.v)(t.source)||(t.source=t.source.getID()),Object(l.w)(t.target)||Object(l.v)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){},e.prototype.update=function(t,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("styles");if(t.stateStyles){var a=t.stateStyles;Object(l.z)(o,a),delete t.stateStyles}Object.assign(n,t),this.updateShape(),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var e=this.get("sourceNode"),n=this.get("targetNode");e&&!e.destroyed&&e.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),t.prototype.destroy.call(this)},e}(on),un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=Tt(t[0],e),o=0;o<t.length;o++){var a=t[o],s=Tt(a,e);s<i&&(r=a,i=s,n=o)}return r.anchorIndex=n,r},e.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getInEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("target")===t}))},e.prototype.getOutEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("source")===t}))},e.prototype.getNeighbors=function(t){var e=this,n=this.get("edges");if("target"===t){return n.filter((function(t){return t.getSource()===e})).map((function(t){return t.getTarget()}))}if("source"===t){return n.filter((function(t){return t.getTarget()===e})).map((function(t){return t.getSource()}))}return n.map((function(t){return t.getSource()===e?t.getTarget():t.getSource()}))},e.prototype.getLinkPointByAnchor=function(t){return this.getAnchorPoints()[t]},e.prototype.getLinkPoint=function(t){var e,n,r=this.get("keyShape").get("type"),i=this.get("type"),o=this.getBBox();"combo"===i?(e=(o.maxX+o.minX)/2,n=(o.maxY+o.minY)/2):(e=o.centerX,n=o.centerY);var a,s=this.getAnchorPoints();switch(r){case"circle":a=St({x:e,y:n,r:o.width/2},t);break;case"ellipse":a=Mt({x:e,y:n,rx:o.width/2,ry:o.height/2},t);break;default:a=Et(o,t)}var u=a;return s.length&&(u||(u=t),u=this.getNearestPoint(s,u)),u||(u={x:e,y:n}),u},e.prototype.getAnchorPoints=function(){var t=this.get("anchorPointsCache");if(!t){t=[];var e=this.get("shapeFactory"),n=this.getBBox(),r=this.get("model"),i=this.getShapeCfg(r),o=r.type,a=e.getAnchorPoints(o,i)||[];Object(l.f)(a,(function(e,r){var i=Object(l.z)({x:n.minX+e[0]*n.width,y:n.minY+e[1]*n.height},e[2],{index:r});t.push(i)})),this.set("anchorPointsCache",t)}return t},e.prototype.addEdge=function(t){this.get("edges").push(t)},e.prototype.lock=function(){this.set("locked",!0)},e.prototype.unlock=function(){this.set("locked",!1)},e.prototype.hasLocked=function(){return this.get("locked")},e.prototype.removeEdge=function(t){var e=this.getEdges(),n=e.indexOf(t);n>-1&&e.splice(n,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.isOnlyMove=function(t){if(!t)return!1;var e=!Object(l.s)(t.x),n=!Object(l.s)(t.y),r=Object.keys(t);return 1===r.length&&(e||n)||2===r.length&&e&&n},e}(on),cn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var e=this.get("styles"),n=this.get("bbox");if(e&&n){var r=t,i={r:Math.hypot(n.height,n.width)/2||z.defaultCombo.size[0]/2,width:n.width||z.defaultCombo.size[0],height:n.height||z.defaultCombo.size[1]};r.style=Object(p.a)(Object(p.a)(Object(p.a)({},e),t.style),i);var o=t.padding||z.defaultCombo.padding;return Object(l.t)(o)?(i.r+=o,i.width+=2*o,i.height+=2*o):(i.r+=o[0],i.width+=o[1]+o[3]||2*o[1],i.height+=o[0]+o[2]||2*o[0]),this.set("sizeCache",i),r}return t},e.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=Ne(t,e);n.x=n.minX,n.y=n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;var r=this.get("sizeCache");r?("circle"===t.get("type")?(n.width=2*r.r,n.height=2*r.r):(n.width=r.width,n.height=r.height),n.minX=n.centerX-n.width/2,n.minY=n.centerY-n.height/2,n.maxX=n.centerX+n.width/2,n.maxY=n.centerY+n.height/2):(n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2);return n},e.prototype.getChildren=function(){return{nodes:this.getNodes(),combos:this.getCombos()}},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.addChild=function(t){switch(t.getType()){case"node":this.addNode(t);break;case"combo":this.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){return this.get("combos").push(t),!0},e.prototype.addNode=function(t){return this.get("nodes").push(t),!0},e.prototype.removeChild=function(t){switch(t.getType()){case"node":this.removeNode(t);break;case"combo":this.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(t){var e=this.getCombos(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.isOnlyMove=function(t){return!1},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(un),fn=Object.hasOwnProperty,ln=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var n=this,r=this.graph,i="vedge"===t?"edge":t,o=r.get(i+"Group")||r.get("group"),a=Object(l.G)(i),s=null,u=r.get(i+Object(l.G)("stateStyles"))||{},c=r.get("default"+a);e.stateStyles&&(u=e.stateStyles);var f=r.get(i+"Mapper");if(f){var h=f(e);h.stateStyles&&(u=h.stateStyles,delete h.stateStyles),e=Object(l.e)({},c,e,h)}else c&&Object(l.f)(c,(function(t,n){fn.call(e,n)||(Object(l.u)(t)?e[n]=Object(l.c)(t):e[n]=c[n])}));if(r.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var d=void 0,p=void 0;if(d=e.source,p=e.target,d&&Object(l.w)(d)&&(d=r.findById(d)),p&&Object(l.w)(p)&&(p=r.findById(p)),!d||!p)return void console.warn("The source or target node of edge "+e.id+" does not exist!");d.getType&&"combo"===d.getType()&&(e.isComboEdge=!0,r.updateCombo(d)),p.getType&&"combo"===p.getType()&&(e.isComboEdge=!0,r.updateCombo(p)),s=new sn({model:e,source:d,target:p,styles:u,linkCenter:r.get("linkCenter"),group:o.addGroup()})}else if("node"===t)s=new un({model:e,styles:u,group:o.addGroup()});else if("combo"===t){var g=e.children,v=Ye(g,r);e.x=v.x||e.x||100*Math.random(),e.y=v.y||e.y||100*Math.random();var m=o.addGroup();m.setZIndex(e.depth);var y=(s=new cn({model:e,styles:u,bbox:v,group:m})).getModel();(g||[]).forEach((function(t){var e=r.findById(t.id);s.addChild(e),t.depth=y.depth+2})),e.collapsed&&setTimeout((function(){r.collapseCombo(s),n.updateCombo(s,[])}),250)}if(s)return r.get(t+"s").push(s),r.get("itemMap")[s.get("id")]=s,r.emit("afteradditem",{item:s,model:e}),s},t.prototype.updateItem=function(t,e){var n=this.graph;if(Object(l.w)(t)&&(t=n.findById(t)),t&&!t.destroyed){var r="";t.getType&&(r=t.getType());var i=n.get(r+"Mapper"),o=t.getModel(),a=t.isOnlyMove(e);if(i){var s=i(Object(l.e)({},o,e)),u=Object(l.e)({},o,s,e);s.stateStyles&&(t.set("styles",u.stateStyles),delete u.stateStyles),Object(l.f)(u,(function(t,n){e[n]=t}))}else Object(l.f)(e,(function(t,n){o[n]&&Object(l.u)(t)&&!Object(l.m)(t)&&(e[n]=Object(p.a)(Object(p.a)({},o[n]),e[n]))}));if(n.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===r){if(e.source){var c=e.source;Object(l.w)(c)&&(c=n.findById(c)),t.setSource(c)}if(e.target){var f=e.target;Object(l.w)(f)&&(f=n.findById(f)),t.setTarget(f)}t.update(e)}if("node"===r||"combo"===r){t.update(e,a);var h=t.getEdges();Object(l.f)(h,(function(t){t.refresh()}))}n.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e){var n=this.graph;if(Object(l.w)(t)&&(t=n.findById(t)),t&&!t.destroyed){var r=Ye(e,n);t.set("bbox",r),t.update({x:r.x,y:r.y});for(var i=t.getEdges()||[],o=i.length,a=0;a<o;a++){var s=i[a];null==s||s.refresh()}}},t.prototype.collapseCombo=function(t){var e=this.graph;Object(l.w)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.hideItem(t)})),n.combos.forEach((function(t){e.hideItem(t)}))},t.prototype.expandCombo=function(t){var e=this.graph;Object(l.w)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.showItem(t)})),n.combos.forEach((function(t){t.getModel().collapsed?t.show():e.showItem(t)}))},t.prototype.removeItem=function(t){var e=this,n=this.graph;if(Object(l.w)(t)&&(t=n.findById(t)),t&&!t.destroyed){var r=Object(l.c)(t.getModel());n.emit("beforeremoveitem",{item:r});var i="";t.getType&&(i=t.getType());var o=n.get(i+"s"),a=o.indexOf(t);if(a>-1&&o.splice(a,1),"edge"===i){var s=n.get("v"+i+"s"),u=s.indexOf(t);u>-1&&s.splice(u,1)}var c=t.get("id");delete n.get("itemMap")[c];var f=n.get("comboTrees"),h=t.get("id");if("node"===i){var d=t.getModel().comboId;if(f){var p=f,g=!1;f.forEach((function(t){g||Ge(t,(function(t){if(t.id===h&&p){var e=p.indexOf(t);return p.splice(e,1),g=!0,!1}return p=t.children,!0}))}))}for(var v=(x=t.getEdges()).length-1;v>=0;v--)n.removeItem(x[v],!1);d&&n.updateCombo(d)}else if("combo"===i){var m,y=t.getModel().parentId,b=!1;(f||[]).forEach((function(t){b||Ge(t,(function(t){return t.id!==h||(m=t,b=!0,!1)}))})),m.removed=!0,m&&m.children&&m.children.forEach((function(t){e.removeItem(t.id)}));var x;for(v=(x=t.getEdges()).length;v>=0;v--)n.removeItem(x[v],!1);y&&n.updateCombo(y)}t.destroy(),n.emit("afterremoveitem",{item:r})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;Object(l.w)(n)&&(i=e+":"+n),t.hasState(i)===n||Object(l.w)(n)&&t.hasState(i)||(r.emit("beforeitemstatechange",{item:t,state:i,enabled:n}),t.setState(e,n),r.autoPaint(),r.emit("afteritemstatechange",{item:t,state:i,enabled:n}))},t.prototype.priorityState=function(t,e){var n=this.graph,r=t;Object(l.w)(t)&&(r=n.findById(t)),this.setItemState(r,e,!1),this.setItemState(r,e,!0)},t.prototype.clearItemStates=function(t,e){var n=this.graph;Object(l.w)(t)&&(t=n.findById(t)),n.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),n.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;Object(l.w)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var n=this,r=this.graph;(t||[]).forEach((function(t){Fe(t,(function(t){var r;return e.forEach((function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,r=e)})),r&&n.addItem("combo",r),!0}))}));var i=r.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var n=this,r=this.graph;if(Object(l.w)(t)&&(t=r.findById(t)),t){if(r.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();Object(l.f)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}else if(t.getType&&"combo"===t.getType()){var o=r.get("comboTrees"),a=t.get("id"),s=[],u=!1;(o||[]).forEach((function(t){u||t.children&&0!==t.children.length&&Ge(t,(function(t){return t.id!==a||(s=t.children,u=!0,!1)}))})),s.forEach((function(t){var i=r.findById(t.id);n.changeItemVisibility(i,e)}));i=t.getEdges();Object(l.f)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}return r.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),hn=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1}return t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(){},t.prototype.executeWithWorker=function(){},t.prototype.layout=function(t){this.init(t),this.execute()},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){Object(l.z)(this,t)},t.prototype.destroy=function(){this.positions=null,this.nodes=null,this.edges=null,this.destroyed=!0},t}(),dn={registerLayout:function(t,e,n){if(void 0===n&&(n=hn),!e)throw new Error("please specify handler for this layout: "+t);var r=function(t){function n(n){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object(l.z)(o,a,e,n),Object(l.f)(o,(function(t,e){i[e]=t})),r}return Object(p.c)(n,t),n}(n);dn[t]=r}},pn=dn;function gn(t,e){return t.degree<e.degree?-1:t.degree>e.degree?1:0}var vn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.radius=null,e.startRadius=null,e.endRadius=null,e.startAngle=0,e.endAngle=2*Math.PI,e.clockwise=!0,e.divisions=1,e.ordering=null,e.angleRatio=1,e.nodes=[],e.edges=[],e.nodeMap={},e.degrees=[],e.width=300,e.height=300,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t=this.nodes,e=this.edges,n=t.length,r=this.center;if(0!==n){if(1===n)return t[0].x=r[0],void(t[0].y=r[1]);var i=this.radius,o=this.startRadius,a=this.endRadius,s=this.divisions,u=this.startAngle,c=this.endAngle,f=(c-u)/n,l={};t.forEach((function(t,e){l[t.id]=e})),this.nodeMap=l;var h=Bt(t.length,l,e);this.degrees=h,this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),i||o||a?!o&&a?o=a:o&&!a&&(a=o):i=this.height>this.width?this.width/2:this.height/2;var d=f*this.angleRatio;this.astep=d;var p=this.ordering,g=[];g="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():t;for(var v=this.clockwise,m=Math.ceil(n/s),y=0;y<n;++y){var b=i;b||null===o||null===a||(b=o+y*(a-o)/(n-1)),b||(b=10+100*y/(n-1));var x=u+y%m*d+2*Math.PI/s*Math.floor(y/m);v||(x=c-y%m*d-2*Math.PI/s*Math.floor(y/m)),g[y].x=r[0]+Math.cos(x)*b,g[y].y=r[1]+Math.sin(x)*b,g[y].weight=h[y]}}},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this.degrees,n=this.edges,r=this.nodes,i=Object(l.c)(r),o=this.nodeMap,a=[i[0]],s=[r[0]],u=[],c=r.length;u[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=0;e.source&&(r=n[e.source]);var i=0;e.target&&(i=n[e.target]),t[r].children.push(t[i].id),t[i].parent.push(t[r].id)})):e.forEach((function(e){var r=0;e.source&&(r=n[e.source]);var i=0;e.target&&(i=n[e.target]),t[r].children.push(t[i].id),t[i].children.push(t[r].id)}))}(i,n,o,t);var f=0;return i.forEach((function(t,l){if(0!==l)if(l!==c-1&&e[l]===e[l+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++)if(t.id===n[i].source&&e.id===n[i].target||e.id===n[i].source&&t.id===n[i].target)return!0;return!1}(a[f],t,n)||!0===u[l]){for(var h=a[f].children,d=!1,p=0;p<h.length;p++){var g=o[h[p]];if(e[g]===e[l]&&!0!==u[g]){a.push(i[g]),s.push(r[o[i[g].id]]),u[g]=!0,d=!0;break}}for(var v=0;!d&&(u[v]||(a.push(i[v]),s.push(r[o[i[v].id]]),u[v]=!0,d=!0),++v!==c););}else a.push(t),s.push(r[o[t.id]]),u[l]=!0,f++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(gn),e},e}(hn),mn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.nodeSize=30,e.minNodeSpacing=10,e.preventOverlap=!1,e.equidistant=!1,e.startAngle=1.5*Math.PI,e.clockwise=!0,e.sortBy="degree",e.nodes=[],e.edges=[],e.width=300,e.height=300,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=e.length,i=t.center;if(0!==r){if(1===r)return e[0].x=i[0],void(e[0].y=i[1]);var o,a=[];o=Object(l.m)(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,e.forEach((function(t){a.push(t);var e=o;Object(l.m)(t.size)?e=Math.max(t.size[0],t.size[1]):Object(l.t)(t.size)&&(e=t.size),o=Math.max(o,e)})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.clockwise=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise;var s={},u={};if(a.forEach((function(t,e){s[t.id]=t,u[t.id]=e})),!("degree"!==t.sortBy&&Object(l.w)(t.sortBy)&&void 0!==a[0][t.sortBy]||(t.sortBy="degree",Object(l.t)(e[0].degree)))){var c=Bt(e.length,u,n);a.forEach((function(t,e){t.degree=c[e]}))}a.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.maxValueNode=a[0],t.maxLevelDiff=t.maxLevelDiff||t.maxValueNode[t.sortBy]/4;var f=[[]],h=f[0];a.forEach((function(e){if(h.length>0){var n=Math.abs(h[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(h=[],f.push(h))}h.push(e)}));var d=o+t.minNodeSpacing;if(!t.preventOverlap){var p=f.length>0&&f[0].length>1,g=(Math.min(t.width,t.height)/2-d)/(f.length+(p?1:0));d=Math.min(d,g)}var v=0;if(f.forEach((function(e){var n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);var r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(d*d/(i*i+o*o));v=Math.max(a,v)}e.r=v,v+=d})),t.equidistant){for(var m=0,y=0,b=0;b<f.length;b++){var x=f[b].r-y;m=Math.max(m,x)}y=0,f.forEach((function(t,e){0===e&&(y=t.r),t.r=y,y+=m}))}f.forEach((function(e){var n=e.dTheta,r=e.r;e.forEach((function(e,o){var a=t.startAngle+(t.clockwise?1:-1)*n*o;e.x=i[0]+r*Math.cos(a),e.y=i[1]+r*Math.sin(a)}))}))}},e}(hn),yn=n(166),bn=n.n(yn),xn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rankdir="TB",e.nodesep=50,e.ranksep=50,e.controlPoints=!1,e.sortByCombo=!1,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.nodeSize,r=t.rankdir;if(e){var i,o=t.edges||[],a=new bn.a.graphlib.Graph;i=n?Object(l.m)(n)?function(){return n}:function(){return[n,n]}:function(t){return t.size?Object(l.m)(t.size)?t.size:[t.size,t.size]:[40,40]};var s,u=wn(t.nodesepFunc,t.nodesep,50),c=wn(t.ranksepFunc,t.ranksep,50);"LR"!==r&&"RL"!==r||(u=wn(t.ranksepFunc,t.ranksep,50),c=wn(t.nodesepFunc,t.nodesep,50)),a.setDefaultEdgeLabel((function(){return{}})),a.setGraph(t),e.forEach((function(t){var e=i(t),n=c(t),r=u(t),o=e[0]+2*r,s=e[1]+2*n;a.setNode(t.id,{width:o,height:s})})),o.forEach((function(t){a.setEdge(t.source,t.target,{weight:t.weight||1})})),bn.a.layout(a),a.nodes().forEach((function(t){s=a.node(t);var n=e.findIndex((function(e){return e.id===t}));e[n].x=s.x,e[n].y=s.y})),a.edges().forEach((function(e){s=a.edge(e);var n=o.findIndex((function(t){return t.source===e.v&&t.target===e.w}));t.controlPoints&&"loop"!==o[n].type&&(o[n].controlPoints=s.points.slice(1,s.points.length-1))})),t.sortByCombo&&t.sortLevel("comboId")}},e.prototype.sortLevel=function(t){var e=this.nodes,n={};e.forEach((function(t){n[t.y]||(n[t.y]={y:t.y,nodes:[]}),n[t.y].nodes.push(t)})),Object.keys(n).forEach((function(e){var r=n[e].nodes,i=r.length,o={};if(r.forEach((function(t){var e=t.comboId;o[e]||(o[e]={x:0,y:0,count:0}),o[e].x+=t.x,o[e].y+=t.y,o[e].count++})),Object.keys(o).forEach((function(t){o[t].x/=o[t].count,o[t].y/=o[t].count})),1!==i){var a=r.sort((function(t,e){return t.x-e.x})),s=a[0].x,u=(a[i-1].x-s)/(i-1);r.sort((function(e,n){var r=e[t]||"undefined",i=n[t]||"undefined";return r<i?-1:r>i?1:0})).forEach((function(t,e){t.x=s+e*u}))}}))},e}(hn);function wn(t,e,n){return t||(Object(l.t)(e)?function(){return e}:function(){return n})}function _n(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,f,l,h,d=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(g+m)/2))?g=o:m=o,(f=n>=(a=(v+y)/2))?v=a:y=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+m)/2))?g=o:m=o,(f=n>=(a=(v+y)/2))?v=a:y=a}while((l=f<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=d,i[l]=p,t}var En=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function Sn(t){return t[0]}function Mn(t){return t[1]}function On(t,e,n){var r=new An(null==e?Sn:e,null==n?Mn:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function An(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function kn(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Tn=On.prototype=An.prototype;Tn.copy=function(){var t,e,n=new An(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=kn(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=kn(e));return n},Tn.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return _n(this.cover(e,n),e,n,t)},Tn.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(u>f||c>l)return this;for(this.cover(u,c).cover(f,l),n=0;n<o;++n)_n(this,a[n],s[n],t[n]);return this},Tn.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},Tn.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Tn.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Tn.find=function(t,e,n){var r,i,o,a,s,u,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new En(g,f,l,h,d)),null==n?n=1/0:(f=t-n,l=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<f||(s=u.y1)<l))if(g.length){var v=(i+a)/2,m=(o+s)/2;p.push(new En(g[3],v,m,a,s),new En(g[2],i,m,v,s),new En(g[1],v,o,a,m),new En(g[0],i,o,v,m)),(c=(e>=m)<<1|t>=v)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);f=t-w,l=e-w,h=t+w,d=e+w,r=g.data}}return r},Tn.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,f,l,h,d=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(s=(p+v)/2))?p=s:v=s,(f=a>=(u=(g+m)/2))?g=u:m=u,e=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Tn.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Tn.root=function(){return this._root},Tn.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Tn.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new En(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,f=(i+a)/2;(n=u[3])&&s.push(new En(n,c,f,o,a)),(n=u[2])&&s.push(new En(n,r,f,c,a)),(n=u[1])&&s.push(new En(n,c,i,o,f)),(n=u[0])&&s.push(new En(n,r,i,c,f))}return this},Tn.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new En(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,f=(a+u)/2,l=(s+c)/2;(o=i[0])&&n.push(new En(o,a,s,f,l)),(o=i[1])&&n.push(new En(o,f,s,u,l)),(o=i[2])&&n.push(new En(o,a,l,f,c)),(o=i[3])&&n.push(new En(o,f,l,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Tn.x=function(t){return arguments.length?(this._x=t,this):this._x},Tn.y=function(t){return arguments.length?(this._y=t,this):this._y};var In=function(t){return function(){return t}},Cn=function(t){return 1e-6*(t()-.5)},Pn={value:function(){}};function Dn(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Nn(r)}function Nn(t){this._=t}function Rn(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function jn(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Bn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Pn,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Nn.prototype=Dn.prototype={constructor:Nn,on:function(t,e){var n,r=this._,i=Rn(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Bn(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Bn(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=jn(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Nn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var Ln=Dn;function Gn(t){return(Gn="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)}var Fn,Un,zn=0,Wn=0,Vn=0,Xn=0,Yn=0,Hn=0,qn="object"===("undefined"==typeof performance?"undefined":Gn(performance))&&performance.now?performance:Date,Qn="object"===("undefined"==typeof window?"undefined":Gn(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Zn(){return Yn||(Qn(Kn),Yn=qn.now()+Hn)}function Kn(){Yn=0}function $n(){this._call=this._time=this._next=null}function Jn(t,e,n){var r=new $n;return r.restart(t,e,n),r}function tr(){Yn=(Xn=qn.now())+Hn,zn=Wn=0;try{!function(){Zn(),++zn;for(var t,e=Fn;e;)(t=Yn-e._time)>=0&&e._call.call(null,t),e=e._next;--zn}()}finally{zn=0,function(){var t,e,n=Fn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Fn=e);Un=t,nr(r)}(),Yn=0}}function er(){var t=qn.now(),e=t-Xn;e>1e3&&(Hn-=e,Xn=t)}function nr(t){zn||(Wn&&(Wn=clearTimeout(Wn)),t-Yn>24?(t<1/0&&(Wn=setTimeout(tr,t-qn.now()-Hn)),Vn&&(Vn=clearInterval(Vn))):(Vn||(Xn=qn.now(),Vn=setInterval(er,1e3)),zn=1,Qn(tr)))}$n.prototype=Jn.prototype={constructor:$n,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Zn():+n)+(null==e?0:+e),this._next||Un===this||(Un?Un._next=this:Fn=this,Un=this),this._call=t,this._time=n,nr()},stop:function(){this._call&&(this._call=null,this._time=1/0,nr())}};function rr(t){return t.x}function ir(t){return t.y}var or=Math.PI*(3-Math.sqrt(5)),ar=function(t){var e,n,r=1,i=.001,o=1-Math.pow(i,1/300),a=0,s=.6,u=new Map,c=Jn(h),f=Ln("tick","end"),l=(n=1,function(){return(n=(1664525*n+1013904223)%4294967296)/4294967296});function h(){d(),f.call("tick",e),r<i&&(c.stop(),f.call("end",e))}function d(n){var i,c,f=t.length;void 0===n&&(n=1);for(var l=0;l<n;++l)for(r+=(a-r)*o,u.forEach((function(t){t(r)})),i=0;i<f;++i)null==(c=t[i]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return e}function p(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*or;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function g(e){return e.initialize&&e.initialize(t,l),e}return null==t&&(t=[]),p(),e={tick:d,restart:function(){return c.restart(h),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),u.forEach(g),e):t},alpha:function(t){return arguments.length?(r=+t,e):r},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(o=+t,e):+o},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(s=1-t,e):1-s},randomSource:function(t){return arguments.length?(l=t,u.forEach(g),e):l},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,g(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(f.on(t,n),e):f.on(t)}}},sr=function(){var t,e,n,r,i,o=In(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=On(t,rr,ir).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,h=t.y-e.y,d=f-o,p=l*l+h*h;if(d*d/u<p)return p<s&&(0===l&&(p+=(l=Cn(n))*l),0===h&&(p+=(h=Cn(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===l&&(p+=(l=Cn(n))*l),0===h&&(p+=(h=Cn(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=l*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:In(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c};function ur(t){return(ur="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)}function cr(t){return t.index}function fr(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}var lr=function(t){var e,n,r,i,o,a,s=cr,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=In(30),f=1;function l(r){for(var i=0,s=t.length;i<f;++i)for(var u,c,l,h,d,p,g,v=0;v<s;++v)c=(u=t[v]).source,h=(l=u.target).x+l.vx-c.x-c.vx||Cn(a),d=l.y+l.vy-c.y-c.vy||Cn(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[v])/p*r*e[v],d*=p,l.vx-=h*(g=o[v]),l.vy-=d*g,c.vx+=h*(g=1-g),c.vy+=d*g}function h(){if(r){var a,u,c=r.length,f=t.length,l=new Map(r.map((function(t,e){return[s(t,e,r),t]})));for(a=0,i=new Array(c);a<f;++a)(u=t[a]).index=a,"object"!==ur(u.source)&&(u.source=fr(l,u.source)),"object"!==ur(u.target)&&(u.target=fr(l,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(f),d(),n=new Array(f),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,h()},l.links=function(e){return arguments.length?(t=e,h(),l):t},l.id=function(t){return arguments.length?(s=t,l):s},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(u="function"==typeof t?t:In(+t),d(),l):u},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:In(+t),p(),l):c},l};function hr(t){return t.x+t.vx}function dr(t){return t.y+t.vy}var pr=function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=On(e,hr,dr).visitAfter(s),t=0;t<d;++t)u=e[t],l=n[u.index],h=l*l,c=u.x+u.vx,f=u.y+u.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,d=t.r,p=l+d;if(!s)return e>c+p||o<c-p||n>f+p||a<f-p;if(s.index>u.index){var g=c-s.x-s.vx,v=f-s.y-s.vy,m=g*g+v*v;m<p*p&&(0===g&&(m+=(g=Cn(r))*g),0===v&&(m+=(v=Cn(r))*v),m=(p-(m=Math.sqrt(m)))/m*i,u.vx+=(g*=m)*(p=(d*=d)/(h+d)),u.vy+=(v*=m)*p,s.vx-=g*(p=1-p),s.vy-=v*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=In(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:In(+e),u(),a):t},a};function gr(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),s=[0,0],u=[],c={},f=[],l=100,h=100,d={none:{x:0,y:0}},p=[],g="force",v=!0,m=.1;function y(t){if(!v)return y;e.tick(),x();for(var r=0,i=u.length,o=void 0,a=t*m;r<i;++r)(o=u[r]).vx+=(d[n(o)].x-o.x)*a,o.vy+=(d[n(o)].y-o.y)*a}function b(){u&&function(){if(!u||!u.length)return;if(void 0===n(u[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t=(d=[],g=[],v={},m=[],s=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(u),m=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=n(c[t.source]),r=n(c[t.target]);return e<=r?e+"~"+r:r+"~"+e}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(s).forEach((function(t,e){var n=s[t];d.push({id:t,size:n.count,r:Math.sqrt(n.sumforceNodeSize/Math.PI)}),v[t]=e})),m.forEach((function(t){var e=v[t.source],n=v[t.target];void 0!==e&&void 0!==n&&g.push({source:e,target:n,count:t.count})})),{nodes:d,links:g});var s,d,g,v,m;e=ar(t.nodes).force("x",function(t){var e,n,r,i=In(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=In(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:In(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:In(+e),a(),o):t},o}(l).strength(.1)).force("y",function(t){var e,n,r,i=In(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=In(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:In(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:In(+e),a(),o):t},o}(h).strength(.1)).force("collide",pr((function(t){return t.r})).iterations(4)).force("charge",sr().strength(i)).force("links",lr(t.nodes.length?t.links:[]).distance(o).strength(a)),p=e.nodes(),x()}()}function x(){return d={none:{x:0,y:0}},p.forEach((function(t){d[t.id]={x:t.x-s[0],y:t.y-s[1]}})),d}function w(t){c={},t.forEach((function(t){c[t.id]=t}))}return y.initialize=function(t){u=t,b()},y.template=function(t){return arguments.length?(g=t,b(),y):g},y.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},y):(n=t,y):n},y.enableGrouping=function(t){return arguments.length?(v=t,y):v},y.strength=function(t){return arguments.length?(m=t,y):m},y.centerX=function(t){return arguments.length?(l=t,y):l},y.centerY=function(t){return arguments.length?(h=t,y):h},y.nodes=function(t){return arguments.length?(w(t||[]),u=t||[],y):u},y.links=function(t){return arguments.length?(f=t||[],b(),y):f},y.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),b(),y):r},y.nodeSize=y.forceNodeSize,y.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),b(),y):i},y.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),b(),y):o},y.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),b(),y):a},y.offset=function(t){return arguments.length?(s=t,y):s},y.getFocis=x,y}var vr="LAYOUT_RUN",mr="LAYOUT_END",yr="LAYOUT_ERROR",br="LAYOUT_TICK",xr="GPU_LAYOUT_RUN",wr="GPU_LAYOUT_END",_r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.nodeStrength=null,e.edgeStrength=null,e.preventOverlap=!1,e.clusterNodeStrength=null,e.clusterEdgeStrength=null,e.clusterEdgeDistance=null,e.clusterNodeSize=null,e.clusterFociStrength=null,e.linkDistance=50,e.alphaDecay=.028,e.alphaMin=.001,e.alpha=.3,e.collideStrength=1,e.workerEnabled=!1,e.tick=function(){},e.onLayoutEnd=function(){},e.onTick=function(){},e.ticking=void 0,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},onTick:function(){},workerEnabled:!1}},e.prototype.init=function(t){this.nodes=t.nodes||[];var e=t.edges||[];this.edges=e.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),this.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),e.edgeForce.links(r)),e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0;else try{var u=sr();if(e.nodeStrength&&u.strength(e.nodeStrength),i=ar().nodes(n),e.clustering){var c=gr();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=lr().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!Er()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),h=1;h<=l;h++)i.tick(),postMessage({type:br,currentTick:h,totalTicks:l,nodes:n},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this.nodeSize,i=this.nodeSpacing,o=this.collideStrength;if(n=Object(l.t)(i)?function(){return i}:Object(l.r)(i)?i:function(){return 0},r)if(Object(l.r)(r))e=function(t){return r(t)+n(t)};else if(Object(l.m)(r)){var a=(r[0]>r[1]?r[0]:r[1])/2;e=function(t){return a+n(t)}}else if(Object(l.t)(r)){var s=r/2;e=function(t){return s+n(t)}}else e=function(){return 10};else e=function(t){return t.size?Object(l.m)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",pr(e).strength(o))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object(l.z)(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(hn);function Er(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Sr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=500,e.gravity=10,e.clustering=!1,e.clusterGravity=10,e.linkDistance=50,e.alpha=1,e.alphaMin=.001,e.alphaDecay=1-Math.pow(e.alphaMin,1/300),e.alphaTarget=0,e.velocityDecay=.6,e.linkStrength=1,e.nodeStrength=30,e.preventOverlap=!1,e.collideStrength=1,e.optimizeRangeFactor=1,e.tick=function(){},e.nodes=[],e.edges=[],e.width=300,e.height=300,e.bias=[],e.nodeMap={},e.nodeIdxMap={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,clustering:!1,clusterGravity:10,preventOverlap:!1,nodeSpacing:void 0,collideStrength:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(t&&0!==t.length){if(1===t.length)return t[0].x=e[0],void(t[0].y=e[1]);var n={},r={};t.forEach((function(t,e){n[t.id]=t,r[t.id]=e})),this.nodeMap=n,this.nodeIdxMap=r,this.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var i,o=t.center,a=t.velocityDecay,s=t.clustering;t.initVals(),s&&(i=t.getClusterMap());for(var u=function(r){var o=[];e.forEach((function(t,e){o[e]={x:0,y:0}})),t.applyCalculate(e,n,o),s&&t.applyClusterForce(i,o),e.forEach((function(t,e){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(t.x+=o[e].x*a,t.y+=o[e].y*a)})),c.alpha+=(c.alphaTarget-c.alpha)*c.alphaDecay,t.tick()},c=this,f=0;f<r;f++)u();var h=[0,0];e.forEach((function(t){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(h[0]+=t.x,h[1]+=t.y)})),h[0]/=e.length,h[1]/=e.length;var d=[o[0]-h[0],o[1]-h[1]];e.forEach((function(t,e){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(t.x+=d[0],t.y+=d[1])}))},e.prototype.initVals=function(){for(var t=this.edges,e={},n=0;n<t.length;++n)e[t[n].source]?e[t[n].source]++:e[t[n].source]=1,e[t[n].target]?e[t[n].target]++:e[t[n].target]=1;var r=[];for(n=0;n<t.length;++n)r[n]=e[t[n].source]/(e[t[n].source]+e[t[n].target]);this.bias=r;var i,o,a=this.nodeSize,s=this.nodeSpacing;if(o=Object(l.t)(s)?function(){return s}:Object(l.r)(s)?s:function(){return 0},a)if(Object(l.r)(a))i=function(t){return a(t)+o(t)};else if(Object(l.m)(a)){var u=(a[0]>a[1]?a[0]:a[1])/2;i=function(t){return u+o(t)}}else if(Object(l.t)(a)){var c=a/2;i=function(t){return c+o(t)}}else i=function(){return 10};else i=function(t){return t.size?Object(l.m)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+o(t):t.size/2+o(t):10+o(t)};this.nodeSize=i;var f,h=this.linkDistance;h||(h=50),Object(l.t)(h)&&(f=function(t){return h}),this.linkDistance=f;var d,p=this.linkStrength;p||(p=1),Object(l.t)(p)&&(d=function(t){return p}),this.linkStrength=d;var g,v=this.nodeStrength;v||(v=30),Object(l.t)(v)&&(g=function(t){return v}),this.nodeStrength=g},e.prototype.getClusterMap=function(){var t=this.nodes,e={};for(var n in t.forEach((function(t){if(void 0===e[t.cluster]){var n={name:t.cluster,cx:0,cy:0,count:0};e[t.cluster]=n}var r=e[t.cluster];Object(l.t)(t.x)&&(r.cx+=t.x),Object(l.t)(t.y)&&(r.cy+=t.y),r.count++})),e)e[n].cx/=e[n].count,e[n].cy/=e[n].count;return e},e.prototype.applyClusterForce=function(t,e){var n=this.gravity,r=this.nodes,i=this.clusterGravity||n,o=this.alpha;for(var a in r.forEach((function(n,r){if(Object(l.t)(n.x)&&Object(l.t)(n.y)){var a=t[n.cluster],s=n.x-a.cx,u=n.y-a.cy,c=Math.sqrt(s*s+u*u);e[r].x-=s*i*o/c,e[r].y-=u*i*o/c}})),t)t[a].cx=0,t[a].cy=0,t[a].count=0;for(var a in r.forEach((function(e){var n=t[e.cluster];Object(l.t)(e.x)&&(n.cx+=e.x),Object(l.t)(e.y)&&(n.cy+=e.y),n.count++})),t)t[a].cx/=t[a].count,t[a].cy/=t[a].count},e.prototype.applyCalculate=function(t,e,n){var r={};t.forEach((function(e,i){n[i]={x:0,y:0},t.forEach((function(t,n){if(!(i<n)){var o=e.x-t.x,a=e.y-t.y,s=o*o+a*a;s<1&&(s=Math.sqrt(s)),0===o&&(s+=(o=.01*Math.random())*o),0===a&&(s+=(a=.01*Math.random())*a);var u=Math.sqrt(s);r[e.id+"-"+t.id]={vx:o,vy:a,vl:s,sqrtVl:u},r[t.id+"-"+e.id]={vx:-o,vy:-a,vl:s,sqrtVl:u}}}))})),this.calRepulsive(t,n,r),this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){var r=this.width*this.optimizeRangeFactor*this.width*this.optimizeRangeFactor,i=this.nodeStrength,o=this.alpha,a=this.collideStrength,s=this.preventOverlap,u=this.nodeSize;t.forEach((function(c,f){t.forEach((function(t,h){if(f!==h&&Object(l.t)(c.x)&&Object(l.t)(t.x)&&Object(l.t)(c.y)&&Object(l.t)(t.y)){var d=n[c.id+"-"+t.id],p=d.vl,g=d.vx,v=d.vy;if(!(p>r)&&(e[f].x+=g*i(t)*o/p,e[f].y+=v*i(t)*o/p,s&&f<h)){var m=u(c),y=u(t),b=m+y;if(p<b*b){var x=n[c.id+"-"+t.id].sqrtVl,w=(b-x)/x*a,_=y*y/(m*m+y*y),E=g*w,S=v*w;e[f].x+=E*_,e[f].y+=S*_,_=1-_,e[h].x-=E*_,e[h].y-=S*_}}}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this,i=this.linkDistance,o=this.alpha,a=this.linkStrength,s=this.bias;t.forEach((function(t,u){if(t.source&&t.target){var c=r.nodeIdxMap[t.source],f=r.nodeIdxMap[t.target];if(c!==f){var h=r.nodeMap[t.source],d=r.nodeMap[t.target];if(Object(l.t)(d.x)&&Object(l.t)(h.x)&&Object(l.t)(d.y)&&Object(l.t)(h.y)){var p=n[t.target+"-"+t.source],g=(p.vl,p.sqrtVl),v=p.vx,m=p.vy,y=(g-i(t))/g*o*a(t),b=v*y,x=m*y,w=s[u];e[f].x-=b*w,e[f].y-=x*w,e[c].x+=b*(1-w),e[c].y+=x*(1-w)}}}}))},e}(hn),Mr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.gravity=10,e.speed=1,e.clustering=!1,e.clusterGravity=10,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=this.nodes,n=this.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var r={},i={};e.forEach((function(e,n){Object(l.t)(e.x)||(e.x=Math.random()*t.width),Object(l.t)(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),this.nodeMap=r,this.nodeIdxMap=i,this.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var i=t.center,o=t.height*t.width,a=Math.sqrt(o)/10,s=o/(e.length+1),u=Math.sqrt(s),c=t.gravity,f=t.speed,h=t.clustering,d={};if(h)for(var p in e.forEach((function(t){if(void 0===d[t.cluster]){var e={name:t.cluster,cx:0,cy:0,count:0};d[t.cluster]=e}var n=d[t.cluster];Object(l.t)(t.x)&&(n.cx+=t.x),Object(l.t)(t.y)&&(n.cy+=t.y),n.count++})),d)d[p].cx/=d[p].count,d[p].cy/=d[p].count;for(var g=function(r){var o=[];if(e.forEach((function(t,e){o[e]={x:0,y:0}})),t.applyCalculate(e,n,o,u,s),h){var p=t.clusterGravity||c;for(var g in e.forEach((function(t,e){if(Object(l.t)(t.x)&&Object(l.t)(t.y)){var n=d[t.cluster],r=Math.sqrt((t.x-n.cx)*(t.x-n.cx)+(t.y-n.cy)*(t.y-n.cy)),i=u*p;o[e].x-=i*(t.x-n.cx)/r,o[e].y-=i*(t.y-n.cy)/r}})),d)d[g].cx=0,d[g].cy=0,d[g].count=0;for(var g in e.forEach((function(t){var e=d[t.cluster];Object(l.t)(t.x)&&(e.cx+=t.x),Object(l.t)(t.y)&&(e.cy+=t.y),e.count++})),d)d[g].cx/=d[g].count,d[g].cy/=d[g].count}e.forEach((function(t,e){if(Object(l.t)(t.x)&&Object(l.t)(t.y)){var n=.01*u*c;o[e].x-=n*(t.x-i[0]),o[e].y-=n*(t.y-i[1])}})),e.forEach((function(t,e){if(Object(l.t)(t.x)&&Object(l.t)(t.y)){var n=Math.sqrt(o[e].x*o[e].x+o[e].y*o[e].y);if(n>0){var r=Math.min(a*(f/800),n);t.x+=o[e].x/n*r,t.y+=o[e].y/n*r}}}))},v=0;v<r;v++)g()},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&Object(l.t)(r.x)&&Object(l.t)(t.x)&&Object(l.t)(r.y)&&Object(l.t)(t.y)){var a=r.x-t.x,s=r.y-t.y,u=a*a+s*s;if(0===u){u=1;var c=i>o?1:-1;a=.01*c,s=.01*c}var f=n/u;e[i].x+=a*f,e[i].y+=s*f}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){if(t.source&&t.target){var i=r.nodeIdxMap[t.source],o=r.nodeIdxMap[t.target];if(i!==o){var a=r.nodeMap[t.source],s=r.nodeMap[t.target];if(Object(l.t)(s.x)&&Object(l.t)(a.x)&&Object(l.t)(s.y)&&Object(l.t)(a.y)){var u=s.x-a.x,c=s.y-a.y,f=Math.sqrt(u*u+c*c),h=f*f/n;e[o].x-=u/f*h,e[o].y-=c/f*h,e[i].x+=u/f*h,e[i].y+=c/f*h}}}}))},e}(hn),Or=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.begin=[0,0],e.preventOverlap=!0,e.preventOverlapPadding=10,e.condense=!1,e.sortBy="degree",e.nodeSize=30,e.nodes=[],e.edges=[],e.center=[0,0],e.width=300,e.height=300,e.row=0,e.col=0,e.cellWidth=0,e.cellHeight=0,e.cellUsed={},e.id2manPos={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,e=t.nodes,n=e.length,r=t.center;if(0!==n){if(1===n)return e[0].x=r[0],void(e[0].y=r[1]);var i=t.edges,o=[];e.forEach((function(t){o.push(t)}));var a={};if(o.forEach((function(t,e){a[t.id]=e})),("degree"===t.sortBy||!Object(l.w)(t.sortBy)||void 0===o[0][t.sortBy])&&(t.sortBy="degree",b(e[0].degree))){var s=Bt(o.length,a,i);o.forEach((function(t,e){t.degree=s[e]}))}o.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var u=t.rows,c=null!=t.cols?t.cols:t.columns;if(t.cells=n,null!=u&&null!=c?(t.rows=u,t.cols=c):null!=u&&null==c?(t.rows=u,t.cols=Math.ceil(t.cells/t.rows)):null==u&&null!=c?(t.cols=c,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((h=t.small())-1)*(f=t.large())>=t.cells?t.small(h-1):(f-1)*h>=t.cells&&t.large(f-1);else for(;t.cols*t.rows<t.cells;){var f,h=t.small();((f=t.large())+1)*h>=t.cells?t.large(f+1):t.small(h+1)}t.cellWidth=t.width/t.cols,t.cellHeight=t.height/t.rows,t.condense&&(t.cellWidth=0,t.cellHeight=0),t.preventOverlap&&o.forEach((function(e){var n,r;e.x&&e.y||(e.x=0,e.y=0),Object(l.m)(e.size)?(n=e.size[0],r=e.size[1]):Object(l.t)(e.size)&&(n=e.size,r=e.size),void 0!==n&&void 0!==r||(Object(l.m)(t.nodeSize)?(n=t.nodeSize[0],r=t.nodeSize[1]):Object(l.t)(t.nodeSize)?(n=t.nodeSize,r=t.nodeSize):(n=30,r=30));var i=t.preventOverlapPadding,o=n+i,a=r+i;t.cellWidth=Math.max(t.cellWidth,o),t.cellHeight=Math.max(t.cellHeight,a)})),t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var d=0;d<o.length;d++){var p=o[d],g=void 0;if(t.position&&(g=t.position(p)),g&&(void 0!==g.row||void 0!==g.col)){var v={row:g.row,col:g.col};if(void 0===v.col)for(v.col=0;t.used(v.row,v.col);)v.col++;else if(void 0===v.row)for(v.row=0;t.used(v.row,v.col);)v.row++;t.id2manPos[p.id]=v,t.use(v.row,v.col)}t.getPos(p)}}},e.prototype.small=function(t){var e,n=this.rows||5,r=this.cols||5;null==t?e=Math.min(n,r):Math.min(n,r)===this.rows?this.rows=t:this.cols=t;return e},e.prototype.large=function(t){var e,n=this.rows||5,r=this.cols||5;null==t?e=Math.max(n,r):Math.max(n,r)===this.rows?this.rows=t:this.cols=t;return e},e.prototype.used=function(t,e){return this.cellUsed["c-"+t+"-"+e]||!1},e.prototype.use=function(t,e){this.cellUsed["c-"+t+"-"+e]=!0},e.prototype.moveToNextCell=function(){var t=this.cols||5;this.col++,this.col>=t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,n,r=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+r[0],n=a.row*o+o/2+r[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+r[0],n=this.row*o+o/2+r[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=n},e}(hn),Ar=Object.prototype.toString;function kr(t){return Ar.call(t).endsWith("Array]")}var Tr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!kr(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],s=r+1;s<o;s++)t[s]>a&&(a=t[s]);return a};var Ir=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!kr(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],s=r+1;s<o;s++)t[s]<a&&(a=t[s]);return a};var Cr=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!kr(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!kr(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=Ir(t),i=Tr(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,s=n.max,u=void 0===s?n.autoMinMax?i:1:s;if(a>=u)throw new RangeError("min option must be smaller than max option");for(var c=(u-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e},Pr=" ".repeat(2),Dr=" ".repeat(4);function Nr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxRows,r=void 0===n?15:n,i=e.maxColumns,o=void 0===i?10:i,a=e.maxNumSize,s=void 0===a?8:a;return"".concat(t.constructor.name," {\n").concat(Pr,"[\n").concat(Dr).concat(Rr(t,r,o,s),"\n").concat(Pr,"]\n").concat(Pr,"rows: ").concat(t.rows,"\n").concat(Pr,"columns: ").concat(t.columns,"\n}")}function Rr(t,e,n,r){for(var i=t.rows,o=t.columns,a=Math.min(i,e),s=Math.min(o,n),u=[],c=0;c<a;c++){for(var f=[],l=0;l<s;l++)f.push(jr(t.get(c,l),r));u.push("".concat(f.join(" ")))}return s!==o&&(u[u.length-1]+=" ... ".concat(o-n," more columns")),a!==i&&u.push("... ".concat(i-e," more rows")),u.join("\n".concat(Dr))}function jr(t,e){var n=String(t);if(n.length<=e)return n.padEnd(e," ");var r=t.toPrecision(e-2);if(r.length<=e)return r;var i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function Br(t){return(Br="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)}function Lr(t,e,n){var r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Gr(t,e,n){var r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Fr(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ur(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function zr(t,e){if("object"!==Br(e))throw new TypeError("unexpected type for row indices");if(e.some((function(e){return e<0||e>=t.rows})))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Wr(t,e){if("object"!==Br(e))throw new TypeError("unexpected type for column indices");if(e.some((function(e){return e<0||e>=t.columns})))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Vr(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(Yr("startRow",e),Yr("endRow",n),Yr("startColumn",r),Yr("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Xr(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<t;r++)n.push(e);return n}function Yr(t,e){if("number"!=typeof e)throw new TypeError("".concat(t," must be a number"))}function Hr(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<r;a++){for(var s=0,u=0,c=0,f=0;f<i;f++)s+=c=t.get(a,f)-n[a],u+=c*c;e?o.push((u-s*s/i)/(i-1)):o.push((u-s*s/i)/i)}return o}function qr(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<i;a++){for(var s=0,u=0,c=0,f=0;f<r;f++)s+=c=t.get(f,a)-n[a],u+=c*c;e?o.push((u-s*s/r)/(r-1)):o.push((u-s*s/r)/r)}return o}function Qr(t,e,n){for(var r=t.rows,i=t.columns,o=r*i,a=0,s=0,u=0,c=0;c<r;c++)for(var f=0;f<i;f++)a+=u=t.get(c,f)-n,s+=u*u;return e?(s-a*a/o)/(o-1):(s-a*a/o)/o}function Zr(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}function Kr(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}function $r(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}function Jr(t){for(var e=[],n=0;n<t.rows;n++){for(var r=0,i=0;i<t.columns;i++)r+=Math.pow(t.get(n,i),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}function ti(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}function ei(t){for(var e=[],n=0;n<t.columns;n++){for(var r=0,i=0;i<t.rows;i++)r+=Math.pow(t.get(i,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}function ni(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}function ri(t){for(var e=t.size-1,n=0,r=0;r<t.columns;r++)for(var i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}function ii(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}function oi(t,e){return(oi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ai(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ui(t);if(e){var i=ui(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return si(this,n)}}function si(t,e){return!e||"object"!==ci(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ui(t){return(ui=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ci(t){return(ci="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)}function fi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function li(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function hi(t,e,n){return e&&li(t.prototype,e),n&&li(t,n),t}var di=function(){function t(){fi(this,t)}return hi(t,[{key:"apply",value:function(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.call(this,e,n);return this}},{key:"to1DArray",value:function(){for(var t=[],e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.push(this.get(e,n));return t}},{key:"to2DArray",value:function(){for(var t=[],e=0;e<this.rows;e++){t.push([]);for(var n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}},{key:"toJSON",value:function(){return this.to2DArray()}},{key:"isRowVector",value:function(){return 1===this.rows}},{key:"isColumnVector",value:function(){return 1===this.columns}},{key:"isVector",value:function(){return 1===this.rows||1===this.columns}},{key:"isSquare",value:function(){return this.rows===this.columns}},{key:"isSymmetric",value:function(){if(this.isSquare()){for(var t=0;t<this.rows;t++)for(var e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}},{key:"isEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(var o=e+1;o<this.rows;o++)0!==this.get(t,o)&&(r=!1);t++}return r}},{key:"echelonForm",value:function(){for(var t=this.clone(),e=0,n=0;e<t.rows&&n<t.columns;){for(var r=e,i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);for(var o=t.get(e,n),a=n;a<t.columns;a++)t.set(e,a,t.get(e,a)/o);for(var s=e+1;s<t.rows;s++){var u=t.get(s,n)/t.get(e,n);t.set(s,n,0);for(var c=n+1;c<t.columns;c++)t.set(s,c,t.get(s,c)-t.get(e,c)*u)}e++,n++}}return t}},{key:"reducedEchelonForm",value:function(){for(var t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;r>=0;)if(0===t.maxRow(r))r--;else{for(var i=0,o=!1;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(var a=0;a<r;a++)for(var s=t.get(a,i),u=i;u<e;u++){var c=t.get(a,u)-s*t.get(r,u);t.set(a,u,c)}r--}return t}},{key:"set",value:function(){throw new Error("set method is unimplemented")}},{key:"get",value:function(){throw new Error("get method is unimplemented")}},{key:"repeat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==ci(t))throw new TypeError("options must be an object");var e=t.rows,n=void 0===e?1:e,r=t.columns,i=void 0===r?1:r;if(!Number.isInteger(n)||n<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new mi(this.rows*n,this.columns*i),a=0;a<n;a++)for(var s=0;s<i;s++)o.setSubMatrix(this,this.rows*a,this.columns*s);return o}},{key:"fill",value:function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,t);return this}},{key:"neg",value:function(){return this.mulS(-1)}},{key:"getRow",value:function(t){Lr(this,t);for(var e=[],n=0;n<this.columns;n++)e.push(this.get(t,n));return e}},{key:"getRowVector",value:function(t){return mi.rowVector(this.getRow(t))}},{key:"setRow",value:function(t,e){Lr(this,t),e=Fr(this,e);for(var n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}},{key:"swapRows",value:function(t,e){Lr(this,t),Lr(this,e);for(var n=0;n<this.columns;n++){var r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}},{key:"getColumn",value:function(t){Gr(this,t);for(var e=[],n=0;n<this.rows;n++)e.push(this.get(n,t));return e}},{key:"getColumnVector",value:function(t){return mi.columnVector(this.getColumn(t))}},{key:"setColumn",value:function(t,e){Gr(this,t),e=Ur(this,e);for(var n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}},{key:"swapColumns",value:function(t,e){Gr(this,t),Gr(this,e);for(var n=0;n<this.rows;n++){var r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}},{key:"addRowVector",value:function(t){t=Fr(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}},{key:"subRowVector",value:function(t){t=Fr(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}},{key:"mulRowVector",value:function(t){t=Fr(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}},{key:"divRowVector",value:function(t){t=Fr(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}},{key:"addColumnVector",value:function(t){t=Ur(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}},{key:"subColumnVector",value:function(t){t=Ur(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}},{key:"mulColumnVector",value:function(t){t=Ur(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}},{key:"divColumnVector",value:function(t){t=Ur(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}},{key:"mulRow",value:function(t,e){Lr(this,t);for(var n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}},{key:"mulColumn",value:function(t,e){Gr(this,t);for(var n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}},{key:"max",value:function(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}},{key:"minIndex",value:function(){for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"maxRow",value:function(t){Lr(this,t);for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}},{key:"maxRowIndex",value:function(t){Lr(this,t);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}},{key:"minRow",value:function(t){Lr(this,t);for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}},{key:"minRowIndex",value:function(t){Lr(this,t);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}},{key:"maxColumn",value:function(t){Gr(this,t);for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}},{key:"maxColumnIndex",value:function(t){Gr(this,t);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}},{key:"minColumn",value:function(t){Gr(this,t);for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}},{key:"minColumnIndex",value:function(t){Gr(this,t);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}},{key:"diag",value:function(){for(var t=Math.min(this.rows,this.columns),e=[],n=0;n<t;n++)e.push(this.get(n,n));return e}},{key:"norm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)e+=this.get(n,r)*this.get(n,r);return Math.sqrt(e)}throw new RangeError("unknown norm type: ".concat(t))}},{key:"cumulativeSum",value:function(){for(var t=0,e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}},{key:"dot",value:function(e){t.isMatrix(e)&&(e=e.to1DArray());var n=this.to1DArray();if(n.length!==e.length)throw new RangeError("vectors do not have the same size");for(var r=0,i=0;i<n.length;i++)r+=n[i]*e[i];return r}},{key:"mmul",value:function(t){t=mi.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.columns,i=new mi(e,r),o=new Float64Array(n),a=0;a<r;a++){for(var s=0;s<n;s++)o[s]=t.get(s,a);for(var u=0;u<e;u++){for(var c=0,f=0;f<n;f++)c+=this.get(u,f)*o[f];i.set(u,a,c)}}return i}},{key:"strassen2x2",value:function(t){t=mi.checkMatrix(t);var e=new mi(2,2),n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),s=t.get(1,0),u=this.get(1,1),c=t.get(1,1),f=(n+u)*(r+c),l=(a+u)*r,h=n*(o-c),d=u*(s-r),p=(n+i)*c,g=f+d-p+(i-u)*(s+c),v=h+p,m=l+d,y=f-l+h+(a-n)*(r+o);return e.set(0,0,g),e.set(0,1,v),e.set(1,0,m),e.set(1,1,y),e}},{key:"strassen3x3",value:function(t){t=mi.checkMatrix(t);var e=new mi(3,3),n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),s=this.get(1,2),u=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),h=t.get(0,1),d=t.get(0,2),p=t.get(1,0),g=t.get(1,1),v=t.get(1,2),m=t.get(2,0),y=t.get(2,1),b=t.get(2,2),x=(n-o)*(-h+g),w=(-n+o+a)*(l-h+g),_=(o+a)*(-l+h),E=n*l,S=(-n+u+c)*(l-d+v),M=(-n+u)*(d-v),O=(u+c)*(-l+d),A=(-i+c+f)*(g+m-y),k=(i-f)*(g-y),T=i*m,I=(c+f)*(-m+y),C=(-i+a+s)*(v+m-b),P=(i-s)*(v-b),D=(a+s)*(-m+b),N=E+T+r*p,R=(n+r+i-o-a-c-f)*g+w+_+E+A+T+I,j=E+S+O+(n+r+i-a-s-u-c)*v+T+C+D,B=x+a*(-l+h+p-g-v-m+b)+w+E+T+C+P,L=x+w+_+E+s*y,G=T+C+P+D+o*d,F=E+S+M+c*(-l+d+p-g-v-m+y)+A+k+T,U=A+k+T+I+u*h,z=E+S+M+O+f*b;return e.set(0,0,N),e.set(0,1,R),e.set(0,2,j),e.set(1,0,B),e.set(1,1,L),e.set(1,2,G),e.set(2,0,F),e.set(2,1,U),e.set(2,2,z),e}},{key:"mmulStrassen",value:function(e){e=mi.checkMatrix(e);var n=this.clone(),r=n.rows,i=n.columns,o=e.rows,a=e.columns;function s(e,n,r){var i=e.rows,o=e.columns;if(i===n&&o===r)return e;var a=t.zeros(n,r);return a=a.setSubMatrix(e,0,0)}i!==o&&console.warn("Multiplying ".concat(r," x ").concat(i," and ").concat(o," x ").concat(a," matrix: dimensions do not match."));var u=Math.max(r,o),c=Math.max(i,a);return function e(n,r,i,o){if(i<=512||o<=512)return n.mmul(r);i%2==1&&o%2==1?(n=s(n,i+1,o+1),r=s(r,i+1,o+1)):i%2==1?(n=s(n,i+1,o),r=s(r,i+1,o)):o%2==1&&(n=s(n,i,o+1),r=s(r,i,o+1));var a=parseInt(n.rows/2,10),u=parseInt(n.columns/2,10),c=n.subMatrix(0,a-1,0,u-1),f=r.subMatrix(0,a-1,0,u-1),l=n.subMatrix(0,a-1,u,n.columns-1),h=r.subMatrix(0,a-1,u,r.columns-1),d=n.subMatrix(a,n.rows-1,0,u-1),p=r.subMatrix(a,r.rows-1,0,u-1),g=n.subMatrix(a,n.rows-1,u,n.columns-1),v=r.subMatrix(a,r.rows-1,u,r.columns-1),m=e(t.add(c,g),t.add(f,v),a,u),y=e(t.add(d,g),f,a,u),b=e(c,t.sub(h,v),a,u),x=e(g,t.sub(p,f),a,u),w=e(t.add(c,l),v,a,u),_=e(t.sub(d,c),t.add(f,h),a,u),E=e(t.sub(l,g),t.add(p,v),a,u),S=t.add(m,x);S.sub(w),S.add(E);var M=t.add(b,w),O=t.add(y,x),A=t.sub(m,y);A.add(b),A.add(_);var k=t.zeros(2*S.rows,2*S.columns);return(k=(k=(k=(k=k.setSubMatrix(S,0,0)).setSubMatrix(M,S.rows,0)).setSubMatrix(O,0,S.columns)).setSubMatrix(A,S.rows,S.columns)).subMatrix(0,i-1,0,o-1)}(n=s(n,u,c),e=s(e,u,c),u,c)}},{key:"scaleRows",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==ci(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new mi(this.rows,this.columns),a=0;a<this.rows;a++){var s=this.getRow(a);Cr(s,{min:n,max:i,output:s}),o.setRow(a,s)}return o}},{key:"scaleColumns",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==ci(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new mi(this.rows,this.columns),a=0;a<this.columns;a++){var s=this.getColumn(a);Cr(s,{min:n,max:i,output:s}),o.setColumn(a,s)}return o}},{key:"flipRows",value:function(){for(var t=Math.ceil(this.columns/2),e=0;e<this.rows;e++)for(var n=0;n<t;n++){var r=this.get(e,n),i=this.get(e,this.columns-1-n);this.set(e,n,i),this.set(e,this.columns-1-n,r)}return this}},{key:"flipColumns",value:function(){for(var t=Math.ceil(this.rows/2),e=0;e<this.columns;e++)for(var n=0;n<t;n++){var r=this.get(n,e),i=this.get(this.rows-1-n,e);this.set(n,e,i),this.set(this.rows-1-n,e,r)}return this}},{key:"kroneckerProduct",value:function(t){t=mi.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new mi(e*r,n*i),a=0;a<e;a++)for(var s=0;s<n;s++)for(var u=0;u<r;u++)for(var c=0;c<i;c++)o.set(r*a+u,i*s+c,this.get(a,s)*t.get(u,c));return o}},{key:"transpose",value:function(){for(var t=new mi(this.columns,this.rows),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}},{key:"sortRows",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi,e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}},{key:"sortColumns",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pi,e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}},{key:"subMatrix",value:function(t,e,n,r){Vr(this,t,e,n,r);for(var i=new mi(e-t+1,r-n+1),o=t;o<=e;o++)for(var a=n;a<=r;a++)i.set(o-t,a-n,this.get(o,a));return i}},{key:"subMatrixRow",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");for(var r=new mi(t.length,n-e+1),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));r.set(i,o-e,this.get(t[i],o))}return r}},{key:"subMatrixColumn",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");for(var r=new mi(n-e+1,t.length),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));r.set(o-e,i,this.get(o,t[i]))}return r}},{key:"setSubMatrix",value:function(t,e,n){Vr(this,e,e+(t=mi.checkMatrix(t)).rows-1,n,n+t.columns-1);for(var r=0;r<t.rows;r++)for(var i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}},{key:"selection",value:function(t,e){for(var n=function(t,e,n){return{row:zr(t,e),column:Wr(t,n)}}(this,t,e),r=new mi(t.length,e.length),i=0;i<n.row.length;i++)for(var o=n.row[i],a=0;a<n.column.length;a++){var s=n.column[a];r.set(i,a,this.get(o,s))}return r}},{key:"trace",value:function(){for(var t=Math.min(this.rows,this.columns),e=0,n=0;n<t;n++)e+=this.get(n,n);return e}},{key:"clone",value:function(){for(var t=new mi(this.rows,this.columns),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}},{key:"sum",value:function(t){switch(t){case"row":return function(t){for(var e=Xr(t.rows),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){for(var e=Xr(t.columns),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=0,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"product",value:function(t){switch(t){case"row":return function(t){for(var e=Xr(t.rows,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){for(var e=Xr(t.columns,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=1,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"mean",value:function(t){var e=this.sum(t);switch(t){case"row":for(var n=0;n<this.rows;n++)e[n]/=this.columns;return e;case"column":for(var r=0;r<this.columns;r++)e[r]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error("invalid option: ".concat(t))}}},{key:"variance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===ci(t)&&(e=t,t=void 0),"object"!==ci(e))throw new TypeError("options must be an object");var n=e,r=n.unbiased,i=void 0===r||r,o=n.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return Hr(this,i,a);case"column":if(!Array.isArray(a))throw new TypeError("mean must be an array");return qr(this,i,a);case void 0:if("number"!=typeof a)throw new TypeError("mean must be a number");return Qr(this,i,a);default:throw new Error("invalid option: ".concat(t))}}},{key:"standardDeviation",value:function(t,e){"object"===ci(t)&&(e=t,t=void 0);var n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(var r=0;r<n.length;r++)n[r]=Math.sqrt(n[r]);return n}},{key:"center",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===ci(t)&&(e=t,t=void 0),"object"!==ci(e))throw new TypeError("options must be an object");var n=e,r=n.center,i=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(i))throw new TypeError("center must be an array");return Zr(this,i),this;case"column":if(!Array.isArray(i))throw new TypeError("center must be an array");return Kr(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return $r(this,i),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"scale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===ci(t)&&(e=t,t=void 0),"object"!==ci(e))throw new TypeError("options must be an object");var n=e.scale;switch(t){case"row":if(void 0===n)n=Jr(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return ti(this,n),this;case"column":if(void 0===n)n=ei(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return ni(this,n),this;case void 0:if(void 0===n)n=ri(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return ii(this,n),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"toString",value:function(t){return Nr(this,t)}},{key:"size",get:function(){return this.rows*this.columns}}],[{key:"from1DArray",value:function(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");for(var r=new mi(t,e),i=0;i<t;i++)for(var o=0;o<e;o++)r.set(i,o,n[i*e+o]);return r}},{key:"rowVector",value:function(t){for(var e=new mi(1,t.length),n=0;n<t.length;n++)e.set(0,n,t[n]);return e}},{key:"columnVector",value:function(t){for(var e=new mi(t.length,1),n=0;n<t.length;n++)e.set(n,0,t[n]);return e}},{key:"zeros",value:function(t,e){return new mi(t,e)}},{key:"ones",value:function(t,e){return new mi(t,e).fill(1)}},{key:"rand",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==ci(n))throw new TypeError("options must be an object");for(var r=n.random,i=void 0===r?Math.random:r,o=new mi(t,e),a=0;a<t;a++)for(var s=0;s<e;s++)o.set(a,s,i());return o}},{key:"randInt",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==ci(n))throw new TypeError("options must be an object");var r=n.min,i=void 0===r?0:r,o=n.max,a=void 0===o?1e3:o,s=n.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var c=a-i,f=new mi(t,e),l=0;l<t;l++)for(var h=0;h<e;h++){var d=i+Math.round(u()*c);f.set(l,h,d)}return f}},{key:"eye",value:function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);for(var r=Math.min(t,e),i=this.zeros(t,e),o=0;o<r;o++)i.set(o,o,n);return i}},{key:"diag",value:function(t,e,n){var r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);for(var i=Math.min(r,e,n),o=this.zeros(e,n),a=0;a<i;a++)o.set(a,a,t[a]);return o}},{key:"min",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new mi(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.min(t.get(o,a),e.get(o,a)));return i}},{key:"max",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new this(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.max(t.get(o,a),e.get(o,a)));return i}},{key:"checkMatrix",value:function(e){return t.isMatrix(e)?e:new mi(e)}},{key:"isMatrix",value:function(t){return null!=t&&"Matrix"===t.klass}}]),t}();function pi(t,e){return t-e}di.prototype.klass="Matrix","undefined"!=typeof Symbol&&(di.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Nr(this)}),di.random=di.rand,di.randomInt=di.randInt,di.diagonal=di.diag,di.prototype.diagonal=di.prototype.diag,di.identity=di.eye,di.prototype.negate=di.prototype.neg,di.prototype.tensorProduct=di.prototype.kroneckerProduct;var gi,vi,mi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&oi(t,e)}(n,t);var e=ai(n);function n(t,r){var i;if(fi(this,n),i=e.call(this),n.isMatrix(t))return si(i,t.clone());if(Number.isInteger(t)&&t>0){if(i.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var o=0;o<t;o++)i.data.push(new Float64Array(r))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");var a=t;if(t=a.length,"number"!=typeof(r=a[0].length)||0===r)throw new TypeError("Data must be a 2D array with at least one element");i.data=[];for(var s=0;s<t;s++){if(a[s].length!==r)throw new RangeError("Inconsistent array dimensions");i.data.push(Float64Array.from(a[s]))}}return i.rows=t,i.columns=r,i}return hi(n,[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}},{key:"removeRow",value:function(t){if(Lr(this,t),1===this.rows)throw new RangeError("A matrix cannot have less than one row");return this.data.splice(t,1),this.rows-=1,this}},{key:"addRow",value:function(t,e){return void 0===e&&(e=t,t=this.rows),Lr(this,t,!0),e=Float64Array.from(Fr(this,e)),this.data.splice(t,0,e),this.rows+=1,this}},{key:"removeColumn",value:function(t){if(Gr(this,t),1===this.columns)throw new RangeError("A matrix cannot have less than one column");for(var e=0;e<this.rows;e++){for(var n=new Float64Array(this.columns-1),r=0;r<t;r++)n[r]=this.data[e][r];for(var i=t+1;i<this.columns;i++)n[i-1]=this.data[e][i];this.data[e]=n}return this.columns-=1,this}},{key:"addColumn",value:function(t,e){void 0===e&&(e=t,t=this.columns),Gr(this,t,!0),e=Ur(this,e);for(var n=0;n<this.rows;n++){for(var r=new Float64Array(this.columns+1),i=0;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}]),n}(di);function yi(t){return(yi="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)}function bi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ei(t);if(e){var i=Ei(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _i(this,n)}}function _i(t,e){return!e||"object"!==yi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ei(t){return(Ei=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}vi=mi,(gi=di).prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},gi.prototype.addS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},gi.prototype.addM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},gi.add=function(t,e){return new vi(t).add(e)},gi.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},gi.prototype.subS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},gi.prototype.subM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},gi.sub=function(t,e){return new vi(t).sub(e)},gi.prototype.subtract=gi.prototype.sub,gi.prototype.subtractS=gi.prototype.subS,gi.prototype.subtractM=gi.prototype.subM,gi.subtract=gi.sub,gi.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},gi.prototype.mulS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},gi.prototype.mulM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},gi.mul=function(t,e){return new vi(t).mul(e)},gi.prototype.multiply=gi.prototype.mul,gi.prototype.multiplyS=gi.prototype.mulS,gi.prototype.multiplyM=gi.prototype.mulM,gi.multiply=gi.mul,gi.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},gi.prototype.divS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},gi.prototype.divM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},gi.div=function(t,e){return new vi(t).div(e)},gi.prototype.divide=gi.prototype.div,gi.prototype.divideS=gi.prototype.divS,gi.prototype.divideM=gi.prototype.divM,gi.divide=gi.div,gi.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},gi.prototype.modS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},gi.prototype.modM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},gi.mod=function(t,e){return new vi(t).mod(e)},gi.prototype.modulus=gi.prototype.mod,gi.prototype.modulusS=gi.prototype.modS,gi.prototype.modulusM=gi.prototype.modM,gi.modulus=gi.mod,gi.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},gi.prototype.andS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},gi.prototype.andM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},gi.and=function(t,e){return new vi(t).and(e)},gi.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},gi.prototype.orS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},gi.prototype.orM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},gi.or=function(t,e){return new vi(t).or(e)},gi.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},gi.prototype.xorS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},gi.prototype.xorM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},gi.xor=function(t,e){return new vi(t).xor(e)},gi.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},gi.prototype.leftShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},gi.prototype.leftShiftM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},gi.leftShift=function(t,e){return new vi(t).leftShift(e)},gi.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},gi.prototype.signPropagatingRightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},gi.prototype.signPropagatingRightShiftM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},gi.signPropagatingRightShift=function(t,e){return new vi(t).signPropagatingRightShift(e)},gi.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},gi.prototype.rightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},gi.prototype.rightShiftM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},gi.rightShift=function(t,e){return new vi(t).rightShift(e)},gi.prototype.zeroFillRightShift=gi.prototype.rightShift,gi.prototype.zeroFillRightShiftS=gi.prototype.rightShiftS,gi.prototype.zeroFillRightShiftM=gi.prototype.rightShiftM,gi.zeroFillRightShift=gi.rightShift,gi.prototype.not=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},gi.not=function(t){return new vi(t).not()},gi.prototype.abs=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},gi.abs=function(t){return new vi(t).abs()},gi.prototype.acos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},gi.acos=function(t){return new vi(t).acos()},gi.prototype.acosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},gi.acosh=function(t){return new vi(t).acosh()},gi.prototype.asin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},gi.asin=function(t){return new vi(t).asin()},gi.prototype.asinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},gi.asinh=function(t){return new vi(t).asinh()},gi.prototype.atan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},gi.atan=function(t){return new vi(t).atan()},gi.prototype.atanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},gi.atanh=function(t){return new vi(t).atanh()},gi.prototype.cbrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},gi.cbrt=function(t){return new vi(t).cbrt()},gi.prototype.ceil=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},gi.ceil=function(t){return new vi(t).ceil()},gi.prototype.clz32=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},gi.clz32=function(t){return new vi(t).clz32()},gi.prototype.cos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},gi.cos=function(t){return new vi(t).cos()},gi.prototype.cosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},gi.cosh=function(t){return new vi(t).cosh()},gi.prototype.exp=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},gi.exp=function(t){return new vi(t).exp()},gi.prototype.expm1=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},gi.expm1=function(t){return new vi(t).expm1()},gi.prototype.floor=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},gi.floor=function(t){return new vi(t).floor()},gi.prototype.fround=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},gi.fround=function(t){return new vi(t).fround()},gi.prototype.log=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},gi.log=function(t){return new vi(t).log()},gi.prototype.log1p=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},gi.log1p=function(t){return new vi(t).log1p()},gi.prototype.log10=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},gi.log10=function(t){return new vi(t).log10()},gi.prototype.log2=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},gi.log2=function(t){return new vi(t).log2()},gi.prototype.round=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},gi.round=function(t){return new vi(t).round()},gi.prototype.sign=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},gi.sign=function(t){return new vi(t).sign()},gi.prototype.sin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},gi.sin=function(t){return new vi(t).sin()},gi.prototype.sinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},gi.sinh=function(t){return new vi(t).sinh()},gi.prototype.sqrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},gi.sqrt=function(t){return new vi(t).sqrt()},gi.prototype.tan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},gi.tan=function(t){return new vi(t).tan()},gi.prototype.tanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},gi.tanh=function(t){return new vi(t).tanh()},gi.prototype.trunc=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},gi.trunc=function(t){return new vi(t).trunc()},gi.pow=function(t,e){return new vi(t).pow(e)},gi.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},gi.prototype.powS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},gi.prototype.powM=function(t){if(t=vi.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this};var Si=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(o,t);var e,n,r,i=wi(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).data=t,e.rows=t.length,e.columns=t[0].length,e}return e=o,(n=[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}}])&&bi(e.prototype,n),r&&bi(e,r),o}(di);function Mi(t,e){var n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}function Oi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ai(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ki=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Oi(this,t);var r,i=(e=Si.checkMatrix(e)).rows,o=e.columns,a=n.computeLeftSingularVectors,s=void 0===a||a,u=n.computeRightSingularVectors,c=void 0===u||u,f=n.autoTranspose,l=void 0!==f&&f,h=Boolean(s),d=Boolean(c),p=!1;if(i<o)if(l){i=(r=e.transpose()).rows,o=r.columns,p=!0;var g=h;h=d,d=g}else r=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else r=e.clone();for(var v=Math.min(i,o),m=Math.min(i+1,o),y=new Float64Array(m),b=new mi(i,v),x=new mi(o,o),w=new Float64Array(o),_=new Float64Array(i),E=new Float64Array(m),S=0;S<m;S++)E[S]=S;for(var M=Math.min(i-1,o),O=Math.max(0,Math.min(o-2,i)),A=Math.max(M,O),k=0;k<A;k++){if(k<M){y[k]=0;for(var T=k;T<i;T++)y[k]=Mi(y[k],r.get(T,k));if(0!==y[k]){r.get(k,k)<0&&(y[k]=-y[k]);for(var I=k;I<i;I++)r.set(I,k,r.get(I,k)/y[k]);r.set(k,k,r.get(k,k)+1)}y[k]=-y[k]}for(var C=k+1;C<o;C++){if(k<M&&0!==y[k]){for(var P=0,D=k;D<i;D++)P+=r.get(D,k)*r.get(D,C);P=-P/r.get(k,k);for(var N=k;N<i;N++)r.set(N,C,r.get(N,C)+P*r.get(N,k))}w[C]=r.get(k,C)}if(h&&k<M)for(var R=k;R<i;R++)b.set(R,k,r.get(R,k));if(k<O){w[k]=0;for(var j=k+1;j<o;j++)w[k]=Mi(w[k],w[j]);if(0!==w[k]){w[k+1]<0&&(w[k]=0-w[k]);for(var B=k+1;B<o;B++)w[B]/=w[k];w[k+1]+=1}if(w[k]=-w[k],k+1<i&&0!==w[k]){for(var L=k+1;L<i;L++)_[L]=0;for(var G=k+1;G<i;G++)for(var F=k+1;F<o;F++)_[G]+=w[F]*r.get(G,F);for(var U=k+1;U<o;U++)for(var z=-w[U]/w[k+1],W=k+1;W<i;W++)r.set(W,U,r.get(W,U)+z*_[W])}if(d)for(var V=k+1;V<o;V++)x.set(V,k,w[V])}}var X=Math.min(o,i+1);if(M<o&&(y[M]=r.get(M,M)),i<X&&(y[X-1]=0),O+1<X&&(w[O]=r.get(O,X-1)),w[X-1]=0,h){for(var Y=M;Y<v;Y++){for(var H=0;H<i;H++)b.set(H,Y,0);b.set(Y,Y,1)}for(var q=M-1;q>=0;q--)if(0!==y[q]){for(var Q=q+1;Q<v;Q++){for(var Z=0,K=q;K<i;K++)Z+=b.get(K,q)*b.get(K,Q);Z=-Z/b.get(q,q);for(var $=q;$<i;$++)b.set($,Q,b.get($,Q)+Z*b.get($,q))}for(var J=q;J<i;J++)b.set(J,q,-b.get(J,q));b.set(q,q,1+b.get(q,q));for(var tt=0;tt<q-1;tt++)b.set(tt,q,0)}else{for(var et=0;et<i;et++)b.set(et,q,0);b.set(q,q,1)}}if(d)for(var nt=o-1;nt>=0;nt--){if(nt<O&&0!==w[nt])for(var rt=nt+1;rt<o;rt++){for(var it=0,ot=nt+1;ot<o;ot++)it+=x.get(ot,nt)*x.get(ot,rt);it=-it/x.get(nt+1,nt);for(var at=nt+1;at<o;at++)x.set(at,rt,x.get(at,rt)+it*x.get(at,nt))}for(var st=0;st<o;st++)x.set(st,nt,0);x.set(nt,nt,1)}for(var ut=X-1,ct=Number.EPSILON;X>0;){var ft=void 0,lt=void 0;for(ft=X-2;ft>=-1&&-1!==ft;ft--){var ht=Number.MIN_VALUE+ct*Math.abs(y[ft]+Math.abs(y[ft+1]));if(Math.abs(w[ft])<=ht||Number.isNaN(w[ft])){w[ft]=0;break}}if(ft===X-2)lt=4;else{var dt=void 0;for(dt=X-1;dt>=ft&&dt!==ft;dt--){var pt=(dt!==X?Math.abs(w[dt]):0)+(dt!==ft+1?Math.abs(w[dt-1]):0);if(Math.abs(y[dt])<=ct*pt){y[dt]=0;break}}dt===ft?lt=3:dt===X-1?lt=1:(lt=2,ft=dt)}switch(ft++,lt){case 1:var gt=w[X-2];w[X-2]=0;for(var vt=X-2;vt>=ft;vt--){var mt=Mi(y[vt],gt),yt=y[vt]/mt,bt=gt/mt;if(y[vt]=mt,vt!==ft&&(gt=-bt*w[vt-1],w[vt-1]=yt*w[vt-1]),d)for(var xt=0;xt<o;xt++)mt=yt*x.get(xt,vt)+bt*x.get(xt,X-1),x.set(xt,X-1,-bt*x.get(xt,vt)+yt*x.get(xt,X-1)),x.set(xt,vt,mt)}break;case 2:var wt=w[ft-1];w[ft-1]=0;for(var _t=ft;_t<X;_t++){var Et=Mi(y[_t],wt),St=y[_t]/Et,Mt=wt/Et;if(y[_t]=Et,wt=-Mt*w[_t],w[_t]=St*w[_t],h)for(var Ot=0;Ot<i;Ot++)Et=St*b.get(Ot,_t)+Mt*b.get(Ot,ft-1),b.set(Ot,ft-1,-Mt*b.get(Ot,_t)+St*b.get(Ot,ft-1)),b.set(Ot,_t,Et)}break;case 3:var At=Math.max(Math.abs(y[X-1]),Math.abs(y[X-2]),Math.abs(w[X-2]),Math.abs(y[ft]),Math.abs(w[ft])),kt=y[X-1]/At,Tt=y[X-2]/At,It=w[X-2]/At,Ct=y[ft]/At,Pt=w[ft]/At,Dt=((Tt+kt)*(Tt-kt)+It*It)/2,Nt=kt*It*(kt*It),Rt=0;0===Dt&&0===Nt||(Rt=Nt/(Dt+(Rt=Dt<0?0-Math.sqrt(Dt*Dt+Nt):Math.sqrt(Dt*Dt+Nt))));for(var jt=(Ct+kt)*(Ct-kt)+Rt,Bt=Ct*Pt,Lt=ft;Lt<X-1;Lt++){var Gt=Mi(jt,Bt);0===Gt&&(Gt=Number.MIN_VALUE);var Ft=jt/Gt,Ut=Bt/Gt;if(Lt!==ft&&(w[Lt-1]=Gt),jt=Ft*y[Lt]+Ut*w[Lt],w[Lt]=Ft*w[Lt]-Ut*y[Lt],Bt=Ut*y[Lt+1],y[Lt+1]=Ft*y[Lt+1],d)for(var zt=0;zt<o;zt++)Gt=Ft*x.get(zt,Lt)+Ut*x.get(zt,Lt+1),x.set(zt,Lt+1,-Ut*x.get(zt,Lt)+Ft*x.get(zt,Lt+1)),x.set(zt,Lt,Gt);if(0===(Gt=Mi(jt,Bt))&&(Gt=Number.MIN_VALUE),Ft=jt/Gt,Ut=Bt/Gt,y[Lt]=Gt,jt=Ft*w[Lt]+Ut*y[Lt+1],y[Lt+1]=-Ut*w[Lt]+Ft*y[Lt+1],Bt=Ut*w[Lt+1],w[Lt+1]=Ft*w[Lt+1],h&&Lt<i-1)for(var Wt=0;Wt<i;Wt++)Gt=Ft*b.get(Wt,Lt)+Ut*b.get(Wt,Lt+1),b.set(Wt,Lt+1,-Ut*b.get(Wt,Lt)+Ft*b.get(Wt,Lt+1)),b.set(Wt,Lt,Gt)}w[X-2]=jt,1;break;case 4:if(y[ft]<=0&&(y[ft]=y[ft]<0?-y[ft]:0,d))for(var Vt=0;Vt<=ut;Vt++)x.set(Vt,ft,-x.get(Vt,ft));for(;ft<ut&&!(y[ft]>=y[ft+1]);){var Xt=y[ft];if(y[ft]=y[ft+1],y[ft+1]=Xt,d&&ft<o-1)for(var Yt=0;Yt<o;Yt++)Xt=x.get(Yt,ft+1),x.set(Yt,ft+1,x.get(Yt,ft)),x.set(Yt,ft,Xt);if(h&&ft<i-1)for(var Ht=0;Ht<i;Ht++)Xt=b.get(Ht,ft+1),b.set(Ht,ft+1,b.get(Ht,ft)),b.set(Ht,ft,Xt);ft++}0,X--}}if(p){var qt=x;x=b,b=qt}this.m=i,this.n=o,this.s=y,this.U=b,this.V=x}var e,n,r;return e=t,(n=[{key:"solve",value:function(t){for(var e=t,n=this.threshold,r=this.s.length,i=mi.zeros(r,r),o=0;o<r;o++)Math.abs(this.s[o])<=n?i.set(o,o,0):i.set(o,o,1/this.s[o]);for(var a=this.U,s=this.rightSingularVectors,u=s.mmul(i),c=s.rows,f=a.rows,l=mi.zeros(c,f),h=0;h<c;h++)for(var d=0;d<f;d++){for(var p=0,g=0;g<r;g++)p+=u.get(h,g)*a.get(d,g);l.set(h,d,p)}return l.mmul(e)}},{key:"solveForDiagonal",value:function(t){return this.solve(mi.diag(t))}},{key:"inverse",value:function(){for(var t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new mi(n,this.s.length),o=0;o<n;o++)for(var a=0;a<r;a++)Math.abs(this.s[a])>e&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,u=s.rows,c=s.columns,f=new mi(n,u),l=0;l<n;l++)for(var h=0;h<u;h++){for(var d=0,p=0;p<c;p++)d+=i.get(l,p)*s.get(h,p);f.set(l,h,d)}return f}},{key:"condition",get:function(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}},{key:"norm2",get:function(){return this.s[0]}},{key:"rank",get:function(){for(var t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s,r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return mi.diag(this.s)}}])&&Ai(e.prototype,n),r&&Ai(e,r),t}(),Ti=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.linkDistance=50,e.scaledDistances=null,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this.nodes,e=this.edges,n=void 0===e?[]:e,r=this.center;if(t&&0!==t.length){if(1===t.length)return t[0].x=r[0],void(t[0].y=r[1]);var i=this.linkDistance,o=Pt({nodes:t,edges:n},!1),a=Ct(o);this.handleInfinity(a);var s=It(a,i);this.scaledDistances=s;var u=this.runMDS();this.positions=u,u.forEach((function(e,n){t[n].x=e[0]+r[0],t[n].y=e[1]+r[1]}))}},e.prototype.runMDS=function(){var t=this.scaledDistances,e=mi.mul(mi.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new ki(e),a=mi.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return mi.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e}(hn),Ii=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this.dimension,e=this.distances,n=this.linkDistance;try{var r=mi.mul(mi.pow(e,2),-.5),i=r.mean("row"),o=r.mean("column"),a=r.mean();r.add(a).subRowVector(i).subColumnVector(o);var s=new ki(r),u=mi.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(e){return mi.mul([e],[u]).toJSON()[0].splice(0,t)}))}catch(t){for(var c=[],f=0;f<e.length;f++){var l=Math.random()*n,h=Math.random()*n;c.push([l,h])}return c}},t}(),Ci=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],n=this.iterations,r=this.width/10;this.maxDisplace=r,this.disp=e;for(var i=0;i<n;i++)t.forEach((function(t,n){e[n]={x:0,y:0}})),this.getRepulsion(),this.updatePositions();return t},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,s){r[s]={x:0,y:0},e.forEach((function(e,u){if(s!==u&&o[s]===o[u]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var h=s>u?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[s])/2+t.nodeSizeFunc(n[u])/2){var d=i*i/l;r[s].x+=c/l*d,r[s].y+=f/l*d}}}))}))},t.prototype.updatePositions=function(){var t=this.positions,e=this.disp,n=this.speed,r=this.strictRadial,i=this.focusID,o=this.maxDisplace||this.width/10;r&&e.forEach((function(e,n){var r=t[n][0]-t[i][0],o=t[n][1]-t[i][1],a=Math.sqrt(r*r+o*o),s=o/a,u=-r/a,c=Math.sqrt(e.x*e.x+e.y*e.y),f=Math.acos((s*e.x+u*e.y)/c);f>Math.PI/2&&(f-=Math.PI/2,s*=-1,u*=-1);var l=Math.cos(f)*c;e.x=s*l,e.y=u*l}));var a=this.radii;t.forEach((function(s,u){if(u!==i){var c=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(c>0&&u!==i){var f=Math.min(o*(n/800),c);if(s[0]+=e[u].x/c*f,s[1]+=e[u].y/c*f,r){var l=s[0]-t[i][0],h=s[1]-t[i][1],d=Math.sqrt(l*l+h*h);l=l/d*a[u],h=h/d*a[u],s[0]=t[i][0]+l,s[1]=t[i][1]+h}}}}))},t}();function Pi(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Di=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.focusNode=null,e.unitRadius=null,e.linkDistance=50,e.preventOverlap=!1,e.strictRadial=!0,e.maxPreventOverlapIteration=200,e.sortStrength=10,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges||[],r=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=r[0],void(e[0].y=r[1]);var i=t.linkDistance,o=null;if(Object(l.w)(t.focusNode)){for(var a=!1,s=0;s<e.length;s++)e[s].id===t.focusNode&&(o=e[s],t.focusNode=o,a=!0,s=e.length);a||(o=null)}else o=t.focusNode;o||(o=e[0],t.focusNode=o);var u,c,f,h=(u=e,c=o.id,f=-1,u.forEach((function(t,e){t.id===c&&(f=e)})),f);t.focusIndex=h;var d=Pt({nodes:e,edges:n},!1),p=Ct(d),g=t.maxToFocus(p,h);t.handleInfinity(p,h,g+1),t.distances=p;var v=p[h];t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var m=t.width||500,y=t.height||500,x=m-r[0]>r[0]?r[0]:m-r[0],w=y-r[1]>r[1]?r[1]:y-r[1];0===x&&(x=m/2),0===w&&(w=y/2);var _=w>x?x:w,E=Math.max.apply(Math,v),S=[];v.forEach((function(e,n){t.unitRadius||(t.unitRadius=_/E),S[n]=e*t.unitRadius})),t.radii=S;var M=t.eIdealDisMatrix();t.eIdealDistances=M;var O=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(M);t.weights=O;var A=new Ii({distances:M,linkDistance:i}).layout();A.forEach((function(t){b(t[0])&&(t[0]=Math.random()*i),b(t[1])&&(t[1]=Math.random()*i)})),t.positions=A,A.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]})),A.forEach((function(t){t[0]-=A[h][0],t[1]-=A[h][1]})),t.run();var k=t.preventOverlap,T=t.nodeSize,I=t.strictRadial;if(k){var C,P=t.nodeSpacing;C=Object(l.t)(P)?function(){return P}:Object(l.r)(P)?P:function(){return 0};var D={nodeSizeFunc:T?Object(l.m)(T)?function(t){return(T[0]>T[1]?T[0]:T[1])+C(t)}:function(t){return T+C(t)}:function(t){return t.size?Object(l.m)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+C(t):t.size+C(t):10+C(t)},adjMatrix:d,positions:A,radii:S,height:y,width:m,strictRadial:I,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:A.length/4.5,nodes:e},N=new Ci(D);A=N.layout()}A.forEach((function(t,n){e[n].x=t[0]+r[0],e[n].y=t[1]+r[1]}))}},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],n=this.weights||[],r=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,r,n)}},e.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(s,u){var c=Pi(s,[0,0]),f=0===c?0:1/c;if(u!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(u!==e){var n=Pi(s,t),o=0===n?0:1/n,a=r[e][u];d+=i[u][e],l+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),h+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}}));var p=0===n[u]?0:1/n[u];d*=o,d+=t*p*p,l*=o,l+=t*p*s[0]*f,s[0]=l/d,h*=o,h+=t*p*s[1]*f,s[1]=h/d}}))},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,r=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,a=[];return n&&n.forEach((function(n,s){var u=[];n.forEach((function(n,a){if(s===a)u.push(0);else if(i[s]===i[a])if("data"===t.sortBy)u.push(n*(Math.abs(s-a)*t.sortStrength)/(i[s]/o));else if(t.sortBy){var c=e[s][t.sortBy]||0,f=e[a][t.sortBy]||0;Object(l.w)(c)&&(c=c.charCodeAt(0)),Object(l.w)(f)&&(f=f.charCodeAt(0)),u.push(n*(Math.abs(c-f)*t.sortStrength)/(i[s]/o))}else u.push(n*r/(i[s]/o));else{var h=(r+o)/2;u.push(n*h)}})),a.push(u)})),a},e.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},e.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},e}(hn),Ni=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.width=300,e.height=300,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]}))},e}(hn),Ri=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=100,e.gravity=10,e.comboGravity=10,e.linkDistance=10,e.alpha=1,e.alphaMin=.001,e.alphaDecay=1-Math.pow(e.alphaMin,1/300),e.alphaTarget=0,e.velocityDecay=.6,e.edgeStrength=.2,e.nodeStrength=30,e.preventOverlap=!1,e.preventNodeOverlap=!1,e.preventComboOverlap=!1,e.collideStrength=void 0,e.nodeCollideStrength=void 0,e.comboCollideStrength=void 0,e.optimizeRangeFactor=1,e.onTick=function(){},e.onLayoutEnd=function(){},e.depthAttractiveForceScale=1,e.depthRepulsiveForceScale=2,e.nodes=[],e.edges=[],e.combos=[],e.comboTrees=[],e.width=300,e.height=300,e.bias=[],e.nodeMap={},e.oriComboMap={},e.nodeIdxMap={},e.comboMap={},e.previousLayouted=!1,e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],void(t[0].y=e[1]);this.initVals(),this.run(),this.onLayoutEnd()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var a=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)a();var u=[0,0];e.forEach((function(t){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(u[0]+=t.x,u[1]+=t.y)})),u[0]/=e.length,u[1]/=e.length;var c=[r[0]-u[0],r[1]-u[1]];e.forEach((function(t,e){Object(l.t)(t.x)&&Object(l.t)(t.y)&&(t.x+=c[0],t.y+=c[1])})),t.combos.forEach((function(t){var e=o[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this.edges,e=this.nodes,n=this.combos,r={},i={},o={};e.forEach((function(t,e){i[t.id]=t,o[t.id]=e})),this.nodeMap=i,this.nodeIdxMap=o;var a={};n.forEach((function(t){a[t.id]=t})),this.oriComboMap=a,this.comboMap=this.getComboMap();var s=this.preventOverlap;this.preventComboOverlap=this.preventComboOverlap||s,this.preventNodeOverlap=this.preventNodeOverlap||s;var u=this.collideStrength;u&&(this.comboCollideStrength=u,this.nodeCollideStrength=u);for(var c=0;c<t.length;++c)r[t[c].source]?r[t[c].source]++:r[t[c].source]=1,r[t[c].target]?r[t[c].target]++:r[t[c].target]=1;var f=[];for(c=0;c<t.length;++c)f[c]=r[t[c].source]/(r[t[c].source]+r[t[c].target]);this.bias=f;var h,d,p=this.nodeSize,g=this.nodeSpacing;if(d=Object(l.t)(g)?function(){return g}:Object(l.r)(g)?g:function(){return 0},this.nodeSpacing=d,p)if(Object(l.r)(p))h=function(t){return p(t)};else if(Object(l.m)(p)){var v=(p[0]>p[1]?p[0]:p[1])/2;h=function(t){return v}}else{var m=p/2;h=function(t){return m}}else h=function(t){return t.size?Object(l.m)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:t.size/2:10};this.nodeSize=h;var y,b=this.comboSpacing;y=Object(l.t)(b)?function(){return b}:Object(l.r)(b)?b:function(){return 0},this.comboSpacing=y;var x,w=this.comboPadding;x=Object(l.t)(w)?function(){return w}:Object(l.m)(w)?function(){return Math.max.apply(null,w)}:Object(l.r)(w)?w:function(){return 0},this.comboPadding=x;var _,E=this.linkDistance;E||(E=10),_=Object(l.t)(E)?function(t){return E}:E,this.linkDistance=_;var S,M=this.edgeStrength;M||(M=1),S=Object(l.t)(M)?function(t){return M}:M,this.edgeStrength=S;var O,A=this.nodeStrength;A||(A=30),O=Object(l.t)(A)?function(t){return A}:A,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){if(e.comboId){var r=t[e.comboId];e.x=r.cx+100/(n+1),e.y=r.cy+100/(n+1)}else e.x=100/(n+1),e.y=100/(n+1)}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.nodeIdxMap,r=t.comboTrees,i=t.oriComboMap,o={};return(r||[]).forEach((function(r){var a=[];Fe(r,(function(r){if("node"===r.itemType)return!0;if(!i[r.id])return!0;if(void 0===o[r.id]){var s={name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth,children:[]};o[r.id]=s}var u=r.children;u&&u.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;a.push(t)}));var c=o[r.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var f=i[r.id],h=Object.keys(e).length,d=r.id+"-visual-child-"+h,p={id:d,x:f.x,y:f.y,depth:c.depth+1,itemType:"node"};t.nodes.push(p),e[d]=p,n[d]=h,c.cx=f.x,c.cy=f.y,a.push(p)}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=o[t.id];return Object(l.t)(n.cx)&&(c.cx+=n.cx),void(Object(l.t)(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(Object(l.t)(r.x)&&(c.cx+=r.x),Object(l.t)(r.y)&&(c.cy+=r.y))})),c.cx/=c.count,c.cy/=c.count,c.children=a,!0}))})),o},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,n=this.comboGravity||e,r=this.alpha,i=this.comboTrees,o=this.nodeIdxMap,a=this.nodeMap,s=this.comboMap;(i||[]).forEach((function(e){Fe(e,(function(e){if("node"===e.itemType)return!0;if(!s[e.id])return!0;var i=s[e.id],u=(i.depth+1)/10*.5,c=i.cx,f=i.cy;return i.cx=0,i.cy=0,i.children.forEach((function(e){if("node"!==e.itemType){var h=s[e.id];return h&&Object(l.t)(h.cx)&&(i.cx+=h.cx),void(h&&Object(l.t)(h.cy)&&(i.cy+=h.cy))}var d=a[e.id],p=d.x-c||.005,g=d.y-f||.005,v=Math.sqrt(p*p+g*g),m=o[d.id],y=n*r/v*u;t[m].x-=p*y,t[m].y-=g*y,Object(l.t)(d.x)&&(i.cx+=d.x),Object(l.t)(d.y)&&(i.cy+=d.y)})),i.cx/=i.count,i.cy/=i.count,!0}))}))},e.prototype.applyCalculate=function(t){var e=this.comboMap,n=this.nodes,r={};n.forEach((function(t,e){n.forEach((function(n,i){if(!(e<i)){var o=t.x-n.x||.005,a=t.y-n.y||.005,s=o*o+a*a,u=Math.sqrt(s);s<1&&(s=u),r[t.id+"-"+n.id]={vx:o,vy:a,vl2:s,vl:u},r[n.id+"-"+t.id]={vx:-o,vy:-a,vl2:s,vl:u}}}))})),this.updateComboSizes(e),this.calRepulsive(t,r),this.calAttractive(t,r),this.preventComboOverlap&&this.comboNonOverlapping(t,e)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,o=e.comboSpacing,a=e.comboPadding;(n||[]).forEach((function(n){var s=[];Fe(n,(function(n){if("node"===n.itemType)return!0;var u=t[n.id];if(u){var c=n.children;c&&c.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),u.minX=1/0,u.minY=1/0,u.maxX=-1/0,u.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=i(e),o=e.x-n,a=e.y-n,s=e.x+n,c=e.y+n;u.minX>o&&(u.minX=o),u.minY>a&&(u.minY=a),u.maxX<s&&(u.maxX=s),u.maxY<c&&(u.maxY=c)}));var f=e.oriComboMap[n.id].size||z.defaultCombo.size;Object(l.m)(f)&&(f=f[0]);var h=Math.max(u.maxX-u.minX,u.maxY-u.minY,f);return u.r=h/2+o(u)/2+a(u),!0}}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this.comboTree,r=this.comboCollideStrength,i=this.nodeIdxMap,o=this.nodeMap;Fe(n,(function(n){if(e[n.id]||o[n.id]||"comboTreeRoot"===n.id){var a=n.children;return a&&a.length>1&&a.forEach((function(n,s){if("node"!==n.itemType){var u=e[n.id];u&&a.forEach((function(a,c){if(!(s<=c)&&"node"!==a.itemType){var f=e[a.id];if(f){var l=u.cx-f.cx||.005,h=u.cy-f.cy||.005,d=l*l+h*h,p=u.r,g=f.r,v=p+g,m=g*g,y=p*p;if(d<v*v){var b=n.children;if(!b||0===b.length)return;var x=a.children;if(!x||0===x.length)return;var w=Math.sqrt(d),_=(v-w)/w*r,E=l*_,S=h*_,M=m/(y+m),O=1-M;b.forEach((function(e){if("node"===e.itemType&&o[e.id]){var n=i[e.id];x.forEach((function(e){if("node"===e.itemType&&o[e.id]){var r=i[e.id];t[n].x+=E*M,t[n].y+=S*M,t[r].x-=E*O,t[r].y-=S*O}}))}}))}}}}))}})),!0}}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,s=n.nodeCollideStrength,u=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,h=n.center;r.forEach((function(d,p){if(d.x&&d.y){if(h){var g=n.gravity,v=d.x-h[0]||.005,m=d.y-h[1]||.005,y=Math.sqrt(v*v+m*m);t[p].x-=v*g*a/y,t[p].y-=m*g*a/y}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var h=e[d.id+"-"+n.id],g=h.vl2,v=h.vl;if(!(v>i)){var m=e[d.id+"-"+n.id],y=m.vx,b=m.vy,x=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;x=x<1?1:x,n.comboId!==d.comboId&&(x+=1);var w=x?Math.pow(l,x):1,_=o(n)*a/g*w;if(t[p].x+=y*_,t[p].y+=b*_,p<r&&u){var E=c(d)+f(d),S=c(n)+f(n),M=E+S;if(g<M*M){var O=(M-v)/v*s,A=S*S,k=A/(E*E+A),T=y*O,I=b*O;t[p].x+=T*k,t[p].y+=I*k,k=1-k,t[r].x-=T*k,t[r].y-=I*k}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,i=n.linkDistance,o=n.alpha,a=n.edgeStrength,s=n.bias,u=n.depthAttractiveForceScale;r.forEach((function(r,c){if(r.source&&r.target&&r.source!==r.target){var f=n.nodeIdxMap[r.source],h=n.nodeIdxMap[r.target],d=n.nodeMap[r.source],p=n.nodeMap[r.target],g=Math.log(Math.abs(d.depth-p.depth)/10);d.comboId===p.comboId&&(g/=2);var v=g?Math.pow(u,g):1;if(d.comboId!==p.comboId&&1===v?v=u/2:d.comboId===p.comboId&&(v=2),Object(l.t)(p.x)&&Object(l.t)(d.x)&&Object(l.t)(p.y)&&Object(l.t)(d.y)){var m=e[r.target+"-"+r.source],y=m.vl,b=m.vx,x=m.vy,w=(y-i(r))/y*o*a(r)*v,_=b*w,E=x*w,S=s[c];t[h].x-=_*S,t[h].y-=E*S,t[f].x+=_*(1-S),t[f].y+=E*(1-S)}}}))},e}(hn),ji=n(10),Bi=n.n(ji),Li=n(4),Gi=n.n(Li),Fi=n(7),Ui=n.n(Fi),zi=n(11),Wi=n.n(zi),Vi=(n(25),n(238),n(8)),Xi=n.n(Vi),Yi=n(12),Hi=n.n(Yi),qi=1;function Qi(){return qi++}var Zi=function t(e){Gi()(this,t)},Ki=function(){function t(e){Gi()(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return Ui()(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++){if(t(this.getComponent(e),e))return e}return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=Hi()(Xi.a.mark((function t(e){var n,r,i,o,a;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}(),$i=n(58),Ji=n.n($i),to=n(5),eo={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter")},no=function t(){Gi()(this,t),this.index=void 0},ro=function t(){Gi()(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},io=function(){function t(){Gi()(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return Ui()(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}(),oo=n(23),ao=n.n(oo),so=n(24),uo=n.n(so),co=n(15),fo=n.n(co);function lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var ho,po,go,vo,mo,yo=function(t){ao()(n,t);var e=lo(n);function n(){var t;Gi()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return Ui()(n,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),n}((function t(){Gi()(this,t),this.first=void 0,this.last=void 0})),bo=function t(){Gi()(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function xo(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return wo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wo(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function wo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var _o=(ho=Object(to.injectable)(),po=Object(to.inject)(eo.RenderEngine),ho((vo=function(){function t(){Gi()(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],Bi()(this,"engine",mo,this)}var e,n;return Ui()(t,[{key:"execute",value:(n=Hi()(Xi.a.mark((function t(e){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new ro;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new io;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=xo(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=xo(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var s=i.value;0===s.readerCount&&o.push(s)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var u=o.pop(),c=u&&u.writer;if(c&&0==--c.refCount){var f,l=xo(c.reads);try{for(l.s();!(f=l.n()).done;){var h=f.value,d=this.resourceNodes[h.index];0==--d.readerCount&&o.push(d)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,g=xo(this.passNodes);try{for(g.s();!(p=g.n()).done;){var v=p.value;if(v.refCount){var m,y=xo(v.reads);try{for(y.s();!(m=y.n()).done;){var b=m.value,x=this.resourceNodes[b.index].resource;x.first=x.first?x.first:v,x.last=v}}catch(t){y.e(t)}finally{y.f()}var w,_=xo(v.writes);try{for(_.s();!(w=_.n()).done;){var E=w.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:v,S.last=v}}catch(t){_.e(t)}finally{_.f()}}}}catch(t){g.e(t)}finally{g.f()}for(var M=0;M<2;M++){var O,A=xo(this.resourceNodes);try{for(A.s();!(O=A.n()).done;){var k=O.value.resource;if(k.priority===M&&k.refs){var T=k.first,I=k.last;T&&I&&(T.devirtualize.push(k),I.destroy.push(k))}}}catch(t){A.e(t)}finally{A.f()}}}},{key:"executePassNodes",value:(e=Hi()(Xi.a.mark((function t(e){var n,r,i,o,a,s,u,c,f,l,h,d,p;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=xo(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Ji()(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}s=xo(a.devirtualize);try{for(s.s();!(u=s.n()).done;)u.value.preExecuteDevirtualize(this.engine)}catch(t){s.e(t)}finally{s.f()}c=xo(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=xo(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=xo(a.destroy);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){d.e(t)}finally{d.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new bo;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new no;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new yo;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new yo;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),Hi()(Xi.a.mark((function t(){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),mo=Wi()(vo.prototype,"engine",[po],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),go=vo))||go),Eo=n(3),So=n.n(Eo),Mo=n(28),Oo=n.n(Mo);function Ao(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ko(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ao(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ao(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function To(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var Io,Co,Po,Do,No,Ro,jo,Bo,Lo,Go=function(t){ao()(n,t);var e=To(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).dirty=!0,r.attributes=[],r.indices=void 0,r.indicesBuffer=void 0,r.vertexCount=void 0,r.maxInstancedCount=void 0,r.aabb=void 0,Object.assign(Oo()(r),t),r}return Ui()(n,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(ko(ko({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}}]),n}(Zi),Fo=(n(247),n(2)),Uo=function(){function t(e,n){Gi()(this,t),this.center=void 0,this.halfExtents=void 0,this.min=Fo.e.create(),this.max=Fo.e.create(),this.update(e,n)}return Ui()(t,[{key:"update",value:function(t,e){this.center=t||Fo.e.create(),this.halfExtents=e||Fo.e.fromValues(.5,.5,.5),this.min=Fo.e.sub(this.min,this.center,this.halfExtents),this.max=Fo.e.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Fo.e.add(this.center,e,t),Fo.e.scale(this.center,this.center,.5),Fo.e.sub(this.halfExtents,e,t),Fo.e.scale(this.halfExtents,this.halfExtents,.5),Fo.e.copy(this.min,t),Fo.e.copy(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],s=o[1],u=o[2],c=n-a,f=n+a,l=r-s,h=r+s,d=i-u,p=i+u,g=t.center,v=g[0],m=g[1],y=g[2],b=t.halfExtents,x=b[0],w=b[1],_=b[2],E=v-x,S=v+x,M=m-w,O=m+w,A=y-_,k=y+_;E<c&&(c=E),S>f&&(f=S),M<l&&(l=M),O>h&&(h=O),A<d&&(d=A),k>p&&(p=k),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Fo.e.copy(Fo.e.create(),this.min):272===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.max[1],this.min[2]):Fo.e.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Fo.e.copy(Fo.e.create(),this.max):272===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?Fo.e.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?Fo.e.fromValues(this.min[0],this.min[1],this.max[2]):Fo.e.fromValues(this.min[0],this.min[1],this.min[2])}}]),t}();function zo(t){for(var e=new Uo,n=Fo.e.fromValues(t[0],t[1],t[2]),r=Fo.e.fromValues(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],s=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),s<n[2]&&(n[2]=s),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),s>r[2]&&(r[2]=s)}return e.setMinMax(n,r),e}(Co=Io||(Io={}))[Co.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",Co[Co.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",Co[Co.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",Co[Co.POINTS=0]="POINTS",Co[Co.LINES=1]="LINES",Co[Co.LINE_LOOP=2]="LINE_LOOP",Co[Co.LINE_STRIP=3]="LINE_STRIP",Co[Co.TRIANGLES=4]="TRIANGLES",Co[Co.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Co[Co.TRIANGLE_FAN=6]="TRIANGLE_FAN",Co[Co.ZERO=0]="ZERO",Co[Co.ONE=1]="ONE",Co[Co.SRC_COLOR=768]="SRC_COLOR",Co[Co.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",Co[Co.SRC_ALPHA=770]="SRC_ALPHA",Co[Co.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",Co[Co.DST_ALPHA=772]="DST_ALPHA",Co[Co.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",Co[Co.DST_COLOR=774]="DST_COLOR",Co[Co.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",Co[Co.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",Co[Co.FUNC_ADD=32774]="FUNC_ADD",Co[Co.BLEND_EQUATION=32777]="BLEND_EQUATION",Co[Co.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",Co[Co.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",Co[Co.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",Co[Co.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",Co[Co.MAX_EXT=32776]="MAX_EXT",Co[Co.MIN_EXT=32775]="MIN_EXT",Co[Co.BLEND_DST_RGB=32968]="BLEND_DST_RGB",Co[Co.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",Co[Co.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",Co[Co.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",Co[Co.CONSTANT_COLOR=32769]="CONSTANT_COLOR",Co[Co.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",Co[Co.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",Co[Co.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",Co[Co.BLEND_COLOR=32773]="BLEND_COLOR",Co[Co.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Co[Co.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",Co[Co.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",Co[Co.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",Co[Co.STREAM_DRAW=35040]="STREAM_DRAW",Co[Co.STATIC_DRAW=35044]="STATIC_DRAW",Co[Co.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",Co[Co.BUFFER_SIZE=34660]="BUFFER_SIZE",Co[Co.BUFFER_USAGE=34661]="BUFFER_USAGE",Co[Co.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",Co[Co.FRONT=1028]="FRONT",Co[Co.BACK=1029]="BACK",Co[Co.FRONT_AND_BACK=1032]="FRONT_AND_BACK",Co[Co.CULL_FACE=2884]="CULL_FACE",Co[Co.BLEND=3042]="BLEND",Co[Co.DITHER=3024]="DITHER",Co[Co.STENCIL_TEST=2960]="STENCIL_TEST",Co[Co.DEPTH_TEST=2929]="DEPTH_TEST",Co[Co.SCISSOR_TEST=3089]="SCISSOR_TEST",Co[Co.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",Co[Co.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",Co[Co.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",Co[Co.NO_ERROR=0]="NO_ERROR",Co[Co.INVALID_ENUM=1280]="INVALID_ENUM",Co[Co.INVALID_VALUE=1281]="INVALID_VALUE",Co[Co.INVALID_OPERATION=1282]="INVALID_OPERATION",Co[Co.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",Co[Co.CW=2304]="CW",Co[Co.CCW=2305]="CCW",Co[Co.LINE_WIDTH=2849]="LINE_WIDTH",Co[Co.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",Co[Co.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",Co[Co.CULL_FACE_MODE=2885]="CULL_FACE_MODE",Co[Co.FRONT_FACE=2886]="FRONT_FACE",Co[Co.DEPTH_RANGE=2928]="DEPTH_RANGE",Co[Co.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",Co[Co.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",Co[Co.DEPTH_FUNC=2932]="DEPTH_FUNC",Co[Co.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",Co[Co.STENCIL_FUNC=2962]="STENCIL_FUNC",Co[Co.STENCIL_FAIL=2964]="STENCIL_FAIL",Co[Co.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",Co[Co.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",Co[Co.STENCIL_REF=2967]="STENCIL_REF",Co[Co.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",Co[Co.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",Co[Co.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",Co[Co.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",Co[Co.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",Co[Co.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",Co[Co.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",Co[Co.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",Co[Co.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",Co[Co.VIEWPORT=2978]="VIEWPORT",Co[Co.SCISSOR_BOX=3088]="SCISSOR_BOX",Co[Co.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",Co[Co.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",Co[Co.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",Co[Co.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",Co[Co.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",Co[Co.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",Co[Co.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",Co[Co.RED_BITS=3410]="RED_BITS",Co[Co.GREEN_BITS=3411]="GREEN_BITS",Co[Co.BLUE_BITS=3412]="BLUE_BITS",Co[Co.ALPHA_BITS=3413]="ALPHA_BITS",Co[Co.DEPTH_BITS=3414]="DEPTH_BITS",Co[Co.STENCIL_BITS=3415]="STENCIL_BITS",Co[Co.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",Co[Co.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",Co[Co.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",Co[Co.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",Co[Co.SAMPLES=32937]="SAMPLES",Co[Co.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",Co[Co.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",Co[Co.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",Co[Co.DONT_CARE=4352]="DONT_CARE",Co[Co.FASTEST=4353]="FASTEST",Co[Co.NICEST=4354]="NICEST",Co[Co.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",Co[Co.BYTE=5120]="BYTE",Co[Co.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",Co[Co.SHORT=5122]="SHORT",Co[Co.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",Co[Co.INT=5124]="INT",Co[Co.UNSIGNED_INT=5125]="UNSIGNED_INT",Co[Co.FLOAT=5126]="FLOAT",Co[Co.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",Co[Co.ALPHA=6406]="ALPHA",Co[Co.RGB=6407]="RGB",Co[Co.RGBA=6408]="RGBA",Co[Co.LUMINANCE=6409]="LUMINANCE",Co[Co.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",Co[Co.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",Co[Co.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",Co[Co.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",Co[Co.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",Co[Co.VERTEX_SHADER=35633]="VERTEX_SHADER",Co[Co.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",Co[Co.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",Co[Co.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",Co[Co.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",Co[Co.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",Co[Co.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",Co[Co.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",Co[Co.SHADER_TYPE=35663]="SHADER_TYPE",Co[Co.DELETE_STATUS=35712]="DELETE_STATUS",Co[Co.LINK_STATUS=35714]="LINK_STATUS",Co[Co.VALIDATE_STATUS=35715]="VALIDATE_STATUS",Co[Co.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",Co[Co.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",Co[Co.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",Co[Co.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",Co[Co.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",Co[Co.NEVER=512]="NEVER",Co[Co.LESS=513]="LESS",Co[Co.EQUAL=514]="EQUAL",Co[Co.LEQUAL=515]="LEQUAL",Co[Co.GREATER=516]="GREATER",Co[Co.NOTEQUAL=517]="NOTEQUAL",Co[Co.GEQUAL=518]="GEQUAL",Co[Co.ALWAYS=519]="ALWAYS",Co[Co.KEEP=7680]="KEEP",Co[Co.REPLACE=7681]="REPLACE",Co[Co.INCR=7682]="INCR",Co[Co.DECR=7683]="DECR",Co[Co.INVERT=5386]="INVERT",Co[Co.INCR_WRAP=34055]="INCR_WRAP",Co[Co.DECR_WRAP=34056]="DECR_WRAP",Co[Co.VENDOR=7936]="VENDOR",Co[Co.RENDERER=7937]="RENDERER",Co[Co.VERSION=7938]="VERSION",Co[Co.NEAREST=9728]="NEAREST",Co[Co.LINEAR=9729]="LINEAR",Co[Co.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",Co[Co.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",Co[Co.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",Co[Co.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",Co[Co.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",Co[Co.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",Co[Co.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",Co[Co.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",Co[Co.TEXTURE_2D=3553]="TEXTURE_2D",Co[Co.TEXTURE=5890]="TEXTURE",Co[Co.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",Co[Co.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",Co[Co.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",Co[Co.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",Co[Co.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",Co[Co.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",Co[Co.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",Co[Co.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",Co[Co.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",Co[Co.TEXTURE0=33984]="TEXTURE0",Co[Co.TEXTURE1=33985]="TEXTURE1",Co[Co.TEXTURE2=33986]="TEXTURE2",Co[Co.TEXTURE3=33987]="TEXTURE3",Co[Co.TEXTURE4=33988]="TEXTURE4",Co[Co.TEXTURE5=33989]="TEXTURE5",Co[Co.TEXTURE6=33990]="TEXTURE6",Co[Co.TEXTURE7=33991]="TEXTURE7",Co[Co.TEXTURE8=33992]="TEXTURE8",Co[Co.TEXTURE9=33993]="TEXTURE9",Co[Co.TEXTURE10=33994]="TEXTURE10",Co[Co.TEXTURE11=33995]="TEXTURE11",Co[Co.TEXTURE12=33996]="TEXTURE12",Co[Co.TEXTURE13=33997]="TEXTURE13",Co[Co.TEXTURE14=33998]="TEXTURE14",Co[Co.TEXTURE15=33999]="TEXTURE15",Co[Co.TEXTURE16=34e3]="TEXTURE16",Co[Co.TEXTURE17=34001]="TEXTURE17",Co[Co.TEXTURE18=34002]="TEXTURE18",Co[Co.TEXTURE19=34003]="TEXTURE19",Co[Co.TEXTURE20=34004]="TEXTURE20",Co[Co.TEXTURE21=34005]="TEXTURE21",Co[Co.TEXTURE22=34006]="TEXTURE22",Co[Co.TEXTURE23=34007]="TEXTURE23",Co[Co.TEXTURE24=34008]="TEXTURE24",Co[Co.TEXTURE25=34009]="TEXTURE25",Co[Co.TEXTURE26=34010]="TEXTURE26",Co[Co.TEXTURE27=34011]="TEXTURE27",Co[Co.TEXTURE28=34012]="TEXTURE28",Co[Co.TEXTURE29=34013]="TEXTURE29",Co[Co.TEXTURE30=34014]="TEXTURE30",Co[Co.TEXTURE31=34015]="TEXTURE31",Co[Co.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",Co[Co.REPEAT=10497]="REPEAT",Co[Co.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",Co[Co.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",Co[Co.FLOAT_VEC2=35664]="FLOAT_VEC2",Co[Co.FLOAT_VEC3=35665]="FLOAT_VEC3",Co[Co.FLOAT_VEC4=35666]="FLOAT_VEC4",Co[Co.INT_VEC2=35667]="INT_VEC2",Co[Co.INT_VEC3=35668]="INT_VEC3",Co[Co.INT_VEC4=35669]="INT_VEC4",Co[Co.BOOL=35670]="BOOL",Co[Co.BOOL_VEC2=35671]="BOOL_VEC2",Co[Co.BOOL_VEC3=35672]="BOOL_VEC3",Co[Co.BOOL_VEC4=35673]="BOOL_VEC4",Co[Co.FLOAT_MAT2=35674]="FLOAT_MAT2",Co[Co.FLOAT_MAT3=35675]="FLOAT_MAT3",Co[Co.FLOAT_MAT4=35676]="FLOAT_MAT4",Co[Co.SAMPLER_2D=35678]="SAMPLER_2D",Co[Co.SAMPLER_CUBE=35680]="SAMPLER_CUBE",Co[Co.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",Co[Co.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",Co[Co.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",Co[Co.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",Co[Co.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",Co[Co.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",Co[Co.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",Co[Co.COMPILE_STATUS=35713]="COMPILE_STATUS",Co[Co.LOW_FLOAT=36336]="LOW_FLOAT",Co[Co.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",Co[Co.HIGH_FLOAT=36338]="HIGH_FLOAT",Co[Co.LOW_INT=36339]="LOW_INT",Co[Co.MEDIUM_INT=36340]="MEDIUM_INT",Co[Co.HIGH_INT=36341]="HIGH_INT",Co[Co.FRAMEBUFFER=36160]="FRAMEBUFFER",Co[Co.RENDERBUFFER=36161]="RENDERBUFFER",Co[Co.RGBA4=32854]="RGBA4",Co[Co.RGB5_A1=32855]="RGB5_A1",Co[Co.RGB565=36194]="RGB565",Co[Co.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",Co[Co.STENCIL_INDEX=6401]="STENCIL_INDEX",Co[Co.STENCIL_INDEX8=36168]="STENCIL_INDEX8",Co[Co.DEPTH_STENCIL=34041]="DEPTH_STENCIL",Co[Co.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",Co[Co.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",Co[Co.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",Co[Co.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",Co[Co.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",Co[Co.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",Co[Co.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",Co[Co.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",Co[Co.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",Co[Co.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",Co[Co.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",Co[Co.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",Co[Co.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",Co[Co.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",Co[Co.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",Co[Co.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",Co[Co.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",Co[Co.NONE=0]="NONE",Co[Co.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",Co[Co.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",Co[Co.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",Co[Co.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",Co[Co.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",Co[Co.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",Co[Co.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",Co[Co.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",Co[Co.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",Co[Co.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",Co[Co.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",Co[Co.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",Co[Co.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",Co[Co.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",Co[Co.COPY_SRC=1]="COPY_SRC",Co[Co.COPY_DST=2]="COPY_DST",Co[Co.SAMPLED=4]="SAMPLED",Co[Co.STORAGE=8]="STORAGE",Co[Co.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT";var Wo=(Po=Object(to.injectable)(),Do=Object(to.inject)(eo.GeometryComponentManager),No=Object(to.inject)(eo.RenderEngine),Po((jo=function(){function t(){Gi()(this,t),Bi()(this,"geometry",Bo,this),Bi()(this,"engine",Lo,this)}var e;return Ui()(t,[{key:"execute",value:(e=Hi()(Xi.a.mark((function t(){var e=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Io.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Io.UNSIGNED_INT,usage:Io.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Qi();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Qi();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}},{key:"createBox",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.widthSegments||1,n=t.heightSegments||1,r=t.depthSegments||1,i=t.halfExtents||Fo.e.fromValues(.5,.5,.5),o=Ji()(i,3),a=o[0],s=o[1],u=o[2],c=[Fo.e.fromValues(-a,-s,u),Fo.e.fromValues(a,-s,u),Fo.e.fromValues(a,s,u),Fo.e.fromValues(-a,s,u),Fo.e.fromValues(a,-s,-u),Fo.e.fromValues(-a,-s,-u),Fo.e.fromValues(-a,s,-u),Fo.e.fromValues(a,s,-u)],f=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],l=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],h={FRONT:0,BACK:1,TOP:2,BOTTOM:3,RIGHT:4,LEFT:5},d=[],p=[],g=[],v=[],m=[],y=0,b=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var s=Fo.e.create(),u=Fo.e.create(),h=Fo.e.create(),b=Fo.e.create();Fo.e.lerp(s,c[f[t][0]],c[f[t][1]],o/e),Fo.e.lerp(u,c[f[t][0]],c[f[t][2]],a/n),Fo.e.sub(h,u,c[f[t][0]]),Fo.e.add(b,s,h),r=o/e,i=a/n,d.push(b[0],b[1],b[2]),p.push(l[t][0],l[t][1],l[t][2]),g.push(r,i),r=.875*(r/=3)+4/64,i=.875*(i/=3)+4/64,r+=t%3/3,i+=Math.floor(t/3)/3,v.push(r,i),o<e&&a<n&&(m.push(y+n+1,y+1,y),m.push(y+n+1,y+n+2,y+1)),y++}};b(h.FRONT,e,n),b(h.BACK,e,n),b(h.TOP,e,r),b(h.BOTTOM,e,r),b(h.RIGHT,r,n),b(h.LEFT,r,n);var x=zo(d),w=Qi();return this.geometry.create(w,{indices:Uint32Array.from(m),aabb:x,attributes:[{dirty:!0,name:"position",data:Float32Array.from(d),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]}]})}}]),t}(),Bo=Wi()(jo.prototype,"geometry",[Do],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lo=Wi()(jo.prototype,"engine",[No],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ro=jo))||Ro);n(248);function Vo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var Xo,Yo,Ho,qo,Qo,Zo,Ko,$o,Jo,ta=function(t){ao()(n,t);var e=Vo(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).vertexShaderGLSL=void 0,r.fragmentShaderGLSL=void 0,r.dirty=!0,r.uniforms=[],r.cull={enable:!0,face:Io.BACK},r.depth={enable:!0},r.blend=void 0,Object.assign(Oo()(r),t),r}return Ui()(n,[{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),n}(Zi);function ea(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function na(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ea(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ea(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ra,ia=(Xo=Object(to.injectable)(),Yo=Object(to.inject)(eo.MaterialComponentManager),Ho=Object(to.inject)(eo.RenderEngine),qo=Object(to.inject)(eo.ShaderModuleService),Xo((Zo=function(){function t(){Gi()(this,t),Bi()(this,"material",Ko,this),Bi()(this,"engine",$o,this),Bi()(this,"shaderModule",Jo,this)}var e;return Ui()(t,[{key:"execute",value:(e=Hi()(Xi.a.mark((function t(){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.material.map(function(){var t=Hi()(Xi.a.mark((function t(e,n){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createBasicMaterial",value:function(){var t=Qi();return this.material.create(t,{vertexShaderGLSL:this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":"attribute vec3 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n}",fragmentShaderGLSL:this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":"varying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"})}},{key:"createShaderMaterial",value:function(t){var e=Qi(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,na(na({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),Ko=Wi()(Zo.prototype,"material",[Yo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$o=Wi()(Zo.prototype,"engine",[Ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jo=Wi()(Zo.prototype,"shaderModule",[qo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qo=Zo))||Qo);function oa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}!function(t){t[t.Standard=0]="Standard"}(ra||(ra={}));var aa=function(t){ao()(n,t);var e=oa(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).strategy=ra.Standard,r.visibilityPlaneMask=0,r.visible=!1,Object.assign(Oo()(r),t),r}return n}(Zi);n(249);function sa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var ua,ca=function(t){ao()(n,t);var e=sa(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).material=void 0,r.geometry=void 0,r.aabb=new Uo,r.aabbDirty=!0,r.model=void 0,r.visible=!0,Object.assign(Oo()(r),t),r}return n}(Zi),fa=function(){function t(e,n){Gi()(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||Fo.e.fromValues(0,1,0),this.updatePNVertexFlag()}return Ui()(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Fo.e.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Fo.e.len(this.normal);Fo.e.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&Fo.e.lerp(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(ua||(ua={}));var la,ha,da,pa,ga,va,ma,ya,ba,xa,wa,_a,Ea,Sa=function(){function t(e){if(Gi()(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fa)}return Ui()(t,[{key:"extractFromVPMatrix",value:function(t){var e=Ji()(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],g=e[13],v=e[14],m=e[15];Fo.e.set(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(m-p),Fo.e.set(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(m+p),Fo.e.set(this.planes[2].normal,o+r,c+s,d+l),this.planes[2].distance=-(m+g),Fo.e.set(this.planes[3].normal,o-r,c-s,d-l),this.planes[3].distance=-(m-g),Fo.e.set(this.planes[4].normal,o-i,c-u,d-h),this.planes[4].distance=-(m-v),Fo.e.set(this.planes[5].normal,o+i,c+u,d+h),this.planes[5].distance=-(m+v),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}(),Ma=n(59),Oa=n.n(Ma);function Aa(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ka(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ka(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ka(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ta,Ia,Ca,Pa,Da,Na,Ra,ja,Ba,La,Ga,Fa,Ua,za,Wa,Va,Xa,Ya,Ha,qa,Qa,Za,Ka,$a,Ja=(la=Object(to.injectable)(),ha=Object(to.inject)(eo.MeshComponentManager),da=Object(to.inject)(eo.CullableComponentManager),pa=Object(to.inject)(eo.GeometryComponentManager),ga=Object(to.inject)(eo.HierarchyComponentManager),va=Object(to.inject)(eo.TransformComponentManager),la((ya=function(){function t(){Gi()(this,t),Bi()(this,"mesh",ba,this),Bi()(this,"cullable",xa,this),Bi()(this,"geometry",wa,this),Bi()(this,"hierarchy",_a,this),Bi()(this,"transform",Ea,this),this.planes=void 0}var e;return Ui()(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=Hi()(Xi.a.mark((function t(e){var n,r,i,o=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Aa(e);try{for(i=function(){var t=r.value,e=(t.getScene(),t.getCamera());o.mesh.forEach((function(t,n){var r,i,a=o.hierarchy.getComponentByEntity(t),s=o.cullable.getComponentByEntity(t),u=n.geometry,c=o.transform.getComponentByEntity(t);if(u&&u.aabb&&c&&n.aabbDirty){var f=c.worldTransform,l=u.aabb,h=l.center,d=l.halfExtents,p=Fo.e.transformMat4(Fo.e.create(),h,f),g=(r=f,(i=Fo.a.create())[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[4],i[4]=r[5],i[5]=r[6],i[6]=r[8],i[7]=r[9],i[8]=r[10],i),v=Fo.e.transformMat3(Fo.e.create(),d,g);n.aabb.update(p,v),n.aabbDirty=!1}if(s&&u){var m=o.cullable.getComponentByEntity((null==a?void 0:a.parentID)||-1);s.visibilityPlaneMask=o.computeVisibilityWithPlaneMask(n.aabb,(null==m?void 0:m.visibilityPlaneMask)||ua.INDETERMINATE,o.planes||e.getFrustum().planes),s.visible=s.visibilityPlaneMask!==ua.OUTSIDE}}))},n.s();!(r=n.n()).done;)i()}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===ua.OUTSIDE||e===ua.INSIDE)return e;for(var r=ua.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var s=n[i],u=s.normal,c=s.distance;if(Fo.e.dot(u,t.getNegativeFarPoint(n[i]))+c>0)return ua.OUTSIDE;Fo.e.dot(u,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),ba=Wi()(ya.prototype,"mesh",[ha],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xa=Wi()(ya.prototype,"cullable",[da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wa=Wi()(ya.prototype,"geometry",[pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_a=Wi()(ya.prototype,"hierarchy",[ga],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ea=Wi()(ya.prototype,"transform",[va],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ma=ya))||ma);function ts(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return es(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function es(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ns,rs,is,os,as,ss,us,cs,fs,ls,hs,ds,ps,gs,vs,ms,ys,bs,xs,ws,_s,Es,Ss=(Ta=Object(to.injectable)(),Ia=Object(to.inject)(eo.MeshComponentManager),Ca=Object(to.inject)(eo.GeometryComponentManager),Pa=Object(to.inject)(eo.MaterialComponentManager),Da=Object(to.inject)(eo.CullableComponentManager),Na=Object(to.inject)(eo.TransformComponentManager),Ra=Object(to.inject)(eo.HierarchyComponentManager),ja=Object(to.inject)(eo.Systems),Ba=Object(to.named)(eo.FrameGraphSystem),La=Object(to.inject)(eo.RenderEngine),Ga=Object(to.inject)(eo.ResourcePool),Ta(($a=Ka=function(){function t(){var e=this;Gi()(this,t),Bi()(this,"mesh",za,this),Bi()(this,"geometry",Wa,this),Bi()(this,"material",Va,this),Bi()(this,"cullable",Xa,this),Bi()(this,"transform",Ya,this),Bi()(this,"hierarchy",Ha,this),Bi()(this,"frameGraphSystem",qa,this),Bi()(this,"engine",Qa,this),Bi()(this,"resourcePool",Za,this),this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Io.RENDER_ATTACHMENT|Io.SAMPLED|Io.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=Hi()(Xi.a.mark((function t(n,r,i){var o,a,s,u,c,f;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),s=ts(i),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=11;break}return c=u.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),s.e(t.t0);case 16:return t.prev=16,s.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=ts(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return Ui()(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Fo.b.multiply(Fo.b.create(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,s=o.y,u=o.width,c=o.height;this.engine.viewport({x:a,y:s,width:u,height:c});var f,l=ts(e.getEntities());try{for(l.s();!(f=l.n()).done;){var h=f.value;this.renderMesh(h,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=this,r=e.camera,i=e.view,o=e.viewMatrix,a=this.mesh.getComponentByEntity(t);if(a.visible){this.hierarchy.forEach((function(e,a){a.parentID===t&&n.renderMesh(e,{camera:r,view:i,viewMatrix:o})}));var s=a.material,u=a.geometry;if(u&&!u.dirty&&s){var c=this.transform.getComponentByEntity(t),f=Fo.b.multiply(Fo.b.create(),o,c.worldTransform),l=i.getViewport(),h=l.width,d=l.height;s.setUniform({projectionMatrix:r.getPerspective(),modelViewMatrix:f,modelMatrix:c.worldTransform,viewMatrix:o,cameraPosition:r.getPosition(),u_viewport:[h,d]}),a.model&&(a.model.draw({uniforms:s.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),s.uniforms.forEach((function(t){t.dirty=!1})),s.dirty=!1)}}}},{key:"initMesh",value:(n=Hi()(Xi.a.mark((function t(e,n){var r,i,o,a,s,u,c,f=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.mesh.getComponentByEntity(e),i=r.material,o=r.geometry,t.next=5,this.hierarchy.forEachAsync(function(){var t=Hi()(Xi.a.mark((function t(r,i){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.parentID!==e){t.next=4;break}return t.next=4,f.initMesh(r,n);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}());case 5:if(o&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=19;break}return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),a=this.engine,s=a.createModel,u=a.createAttribute,c={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=u({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(c.cull=i.cull),i.depth&&(c.depth=i.depth),i.blend&&(c.blend=i.blend),o.indicesBuffer&&(c.elements=o.indicesBuffer),o.maxInstancedCount&&(c.instances=o.maxInstancedCount,c.count=o.vertexCount||3),t.next=18,s(c);case 18:r.model=t.sent;case 19:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=Hi()(Xi.a.mark((function t(e){var n,r,i,o;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=ts(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),Ka.IDENTIFIER="Render Pass",Ua=$a,za=Wi()(Ua.prototype,"mesh",[Ia],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wa=Wi()(Ua.prototype,"geometry",[Ca],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Va=Wi()(Ua.prototype,"material",[Pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xa=Wi()(Ua.prototype,"cullable",[Da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ya=Wi()(Ua.prototype,"transform",[Na],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ha=Wi()(Ua.prototype,"hierarchy",[Ra],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qa=Wi()(Ua.prototype,"frameGraphSystem",[ja,Ba],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qa=Wi()(Ua.prototype,"engine",[La],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Za=Wi()(Ua.prototype,"resourcePool",[Ga],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fa=Ua))||Fa),Ms=(ns=Object(to.injectable)(),rs=Object(to.inject)(eo.RenderEngine),is=Object(to.inject)(eo.ResourcePool),ns((fs=cs=function t(){var e=this;Gi()(this,t),Bi()(this,"engine",ss,this),Bi()(this,"resourcePool",us,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Ss.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=Hi()(Xi.a.mark((function t(n,r){var i,o,a,s,u,c,f;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,s=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:s({data:[-4,-4,4,-4,0,4],type:Io.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:u=t.sent,e.model=u;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},cs.IDENTIFIER="Copy Pass",as=fs,ss=Wi()(as.prototype,"engine",[rs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),us=Wi()(as.prototype,"resourcePool",[is],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),os=as))||os);function Os(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return As(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return As(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function As(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ks,Ts,Is,Cs,Ps,Ds,Ns,Rs,js,Bs,Ls,Gs,Fs=1,Us=2,zs=(ls=Object(to.injectable)(),hs=Object(to.inject)(eo.RenderEngine),ds=Object(to.inject)(eo.ResourcePool),ps=Object(to.inject)(eo.RenderPassFactory),gs=Object(to.inject)(eo.MeshComponentManager),ls((Es=_s=function(){function t(){var e=this;Gi()(this,t),Bi()(this,"engine",ys,this),Bi()(this,"resourcePool",bs,this),Bi()(this,"renderPassFactory",xs,this),Bi()(this,"mesh",ws,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=Hi()(Xi.a.mark((function t(n,r,i){var o,a,s;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=Os(i);try{for(s=function(){var t=a.value,i=t.getViewport(),o=i.width,s=i.height;e.alreadyInRendering=!0;var u=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(u.resource),e.pickingFBO.resize({width:o,height:s}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Ss.IDENTIFIER),i=[],o=Os(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,s=e.mesh.getComponentByEntity(a);s.material.setUniform("u_PickingStage",Fs),i.push(s)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",Us)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)s()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,s=e.engine,u=s.readPixels,c=s.useFramebuffer,f=n.getViewport(),l=f.width,h=f.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>l||d<0||p>h||p<0))return c(e.pickingFBO,(function(){var t,o;0===(r=u({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=r,o=Ji()(t,3),i=o[0]+256*o[1]+65536*o[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return Ui()(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=Os(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",Us),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),_s.IDENTIFIER="PixelPicking Pass",ms=Es,ys=Wi()(ms.prototype,"engine",[hs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bs=Wi()(ms.prototype,"resourcePool",[ds],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xs=Wi()(ms.prototype,"renderPassFactory",[ps],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ws=Wi()(ms.prototype,"mesh",[gs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vs=ms))||vs),Ws=(ks=Object(to.injectable)(),Ts=Object(to.inject)(eo.Systems),Is=Object(to.named)(eo.FrameGraphSystem),Cs=Object(to.inject)(eo.RenderPassFactory),Ps=Object(to.inject)(eo.ConfigService),Ds=Object(to.inject)(eo.ResourcePool),ks((Rs=function(){function t(){Gi()(this,t),Bi()(this,"frameGraphSystem",js,this),Bi()(this,"renderPassFactory",Bs,this),Bi()(this,"configService",Ls,this),Bi()(this,"resourcePool",Gs,this)}var e;return Ui()(t,[{key:"execute",value:(e=Hi()(Xi.a.mark((function t(e){var n,r,i,o,a,s,u,c;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Ss.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Ss.IDENTIFIER,r,i),o=this.renderPassFactory(Ms.IDENTIFIER),a=o.setup,s=o.execute,u=o.tearDown,c=this.frameGraphSystem.addPass(Ms.IDENTIFIER,a,s,u),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(zs.IDENTIFIER).pick(t,e)}}]),t}(),js=Wi()(Rs.prototype,"frameGraphSystem",[Ts,Is],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bs=Wi()(Rs.prototype,"renderPassFactory",[Cs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ls=Wi()(Rs.prototype,"configService",[Ps],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gs=Wi()(Rs.prototype,"resourcePool",[Ds],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ns=Rs))||Ns);function Vs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var Xs,Ys,Hs,qs,Qs,Zs,Ks,$s,Js,tu=function(t){ao()(n,t);var e=Vs(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).parentID=void 0,Object.assign(Oo()(r),t),r}return n}(Zi),eu=(Xs=Object(to.injectable)(),Ys=Object(to.inject)(eo.HierarchyComponentManager),Hs=Object(to.inject)(eo.TransformComponentManager),qs=Object(to.inject)(eo.MeshComponentManager),Xs((Zs=function(){function t(){Gi()(this,t),Bi()(this,"hierarchy",Ks,this),Bi()(this,"transform",$s,this),Bi()(this,"mesh",Js,this)}var e;return Ui()(t,[{key:"execute",value:(e=Hi()(Xi.a.mark((function t(){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){if(n.isDirty()){var r=t.mesh.getComponentByEntity(e);r&&(r.aabbDirty=!0),n.updateTransform()}}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){if(this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e}),this.hierarchy.getCount()>1)for(var r=this.hierarchy.getCount()-1;r>0;--r)for(var i=this.hierarchy.getEntity(r),o=0;o<r;++o){if(this.hierarchy.getComponent(o).parentID===i){this.hierarchy.moveItem(r,o),++r;break}}this.hierarchy.getComponentByEntity(t);var a=this.transform.getComponentByEntity(e);null===a&&(a=this.transform.create(e));var s=this.transform.getComponentByEntity(t);null===s&&(s=this.transform.create(t),a=this.transform.getComponentByEntity(e)),!n&&a&&(s.matrixTransform(Fo.b.invert(Fo.b.create(),a.worldTransform)),s.updateTransform()),a&&s.updateTransformWithParent(a)}},{key:"detach",value:function(t){if(null!==this.hierarchy.getComponentByEntity(t)){var e=this.transform.getComponentByEntity(t);null!==e&&e.applyTransform(),this.hierarchy.removeKeepSorted(t)}}},{key:"detachChildren",value:function(t){for(var e=0;e<this.hierarchy.getCount();){var n;if((null===(n=this.hierarchy.getComponent(e))||void 0===n?void 0:n.parentID)===t){var r=this.hierarchy.getEntity(e);this.detach(r)}else++e}}}]),t}(),Ks=Wi()(Zs.prototype,"hierarchy",[Ys],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$s=Wi()(Zs.prototype,"transform",[Hs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Js=Wi()(Zs.prototype,"mesh",[qs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qs=Zs))||Qs);function nu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var ru=function(t){ao()(n,t);var e=nu(n);function n(t){var r,i,o,a,s,u,c,f,l,h,d,p,g,v,m;return Gi()(this,n),(r=e.call(this,t)).dirtyFlag=void 0,r.localTranslation=Fo.e.fromValues(0,0,0),r.localRotation=Fo.c.fromValues(0,0,0,1),r.localScale=Fo.e.fromValues(1,1,1),r.localTransform=Fo.b.create(),r.worldTransform=Fo.b.create(),r.getRotation=(i=Fo.c.create(),function(){return Fo.b.getRotation(i,r.worldTransform),i}),r.getScale=(o=Fo.e.create(),function(){return Fo.b.getScaling(o,r.worldTransform),o}),r.getPosition=(a=Fo.e.create(),function(){return Fo.b.getTranslation(a,r.worldTransform),a}),r.getLocalMatrix=(s=Fo.b.create(),function(){return Fo.b.fromRotationTranslationScale(s,r.localRotation,r.localTranslation,r.localScale),s}),r.matrixTransform=(u=Fo.b.create(),function(t){Fo.b.multiply(u,r.getLocalMatrix(),t),Fo.b.getScaling(r.localScale,u),Fo.b.getTranslation(r.localTranslation,u),Fo.b.getRotation(r.localRotation,u)}),r.rotateRollPitchYaw=(c=Fo.c.create(),f=Fo.c.create(),l=Fo.c.create(),function(t,e,n){r.setDirty(),Fo.c.fromEuler(c,t,0,0),Fo.c.fromEuler(f,0,e,0),Fo.c.fromEuler(l,0,0,n),Fo.c.multiply(r.localRotation,c,r.localRotation),Fo.c.multiply(r.localRotation,r.localRotation,f),Fo.c.multiply(r.localRotation,l,r.localRotation),Fo.c.normalize(r.localRotation,r.localRotation)}),r.lerp=(h=Fo.e.create(),d=Fo.c.create(),p=Fo.e.create(),g=Fo.e.create(),v=Fo.c.create(),m=Fo.e.create(),function(t,e,n){r.setDirty(),Fo.b.getScaling(h,t.worldTransform),Fo.b.getTranslation(p,t.worldTransform),Fo.b.getRotation(d,t.worldTransform),Fo.b.getScaling(g,e.worldTransform),Fo.b.getTranslation(m,e.worldTransform),Fo.b.getRotation(v,e.worldTransform),Fo.e.lerp(r.localScale,h,g,n),Fo.c.slerp(r.localRotation,d,v,n),Fo.e.lerp(r.localTranslation,p,m,n)}),r}return Ui()(n,[{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=n.DIRTY:this.dirtyFlag&=~n.DIRTY}},{key:"updateTransform",value:function(){this.isDirty()&&(this.setDirty(!1),Fo.b.copy(this.worldTransform,this.getLocalMatrix()))}},{key:"updateTransformWithParent",value:function(t){Fo.b.multiply(this.worldTransform,this.getLocalMatrix(),t.worldTransform)}},{key:"applyTransform",value:function(){this.setDirty(),Fo.b.getScaling(this.localScale,this.worldTransform),Fo.b.getTranslation(this.localTranslation,this.worldTransform),Fo.b.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localTranslation=Fo.e.fromValues(0,0,0),this.localRotation=Fo.c.fromValues(0,0,0,1),this.localScale=Fo.e.fromValues(1,1,1)}},{key:"translate",value:function(t){return this.setDirty(),Fo.e.add(this.localTranslation,this.localTranslation,t),this}},{key:"scale",value:function(t){return this.setDirty(),Fo.e.multiply(this.localScale,this.localScale,t),this}},{key:"rotate",value:function(t){return this.setDirty(),Fo.c.multiply(this.localRotation,this.localRotation,t),Fo.c.normalize(this.localRotation,this.localRotation),this}}]),n}(Zi);ru.DIRTY=1;n(152),n(153),n(250),n(154),n(155),n(113),n(156),n(46),n(157),n(251);var iu,ou,au,su,uu,cu=n(167),fu=n(271),lu=n.n(fu),hu=(iu=Object(to.injectable)(),ou=Object(to.inject)(eo.RenderEngine),iu((su=function(){function t(){Gi()(this,t),Bi()(this,"engine",uu,this),this.resourcePool={}}return Ui()(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Io.CLAMP_TO_EDGE,wrapT:Io.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),uu=Wi()(su.prototype,"engine",[ou],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),au=su))||au);function du(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var pu,gu,vu=function(t){ao()(n,t);var e=du(n);function n(t){var r;return Gi()(this,n),(r=e.call(this,t)).name=void 0,r.name=t.name||"",r}return n}(Zi),mu=Object(to.injectable)()(pu=function(){function t(){Gi()(this,t),this.config=void 0}return Ui()(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}())||pu,yu=Object(to.injectable)()(gu=function(){function t(){Gi()(this,t)}return Ui()(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||gu,bu=n(272),xu=n.n(bu);var wu,_u=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Eu(t){var e={};return{content:t=t.replace(_u,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function Su(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Su(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ou=/precision\s+(high|low|medium)p\s+float/,Au=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,ku=Object(to.injectable)()(wu=function(){function t(){Gi()(this,t),this.moduleCache={},this.rawContentCache={}}return Ui()(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=e.fs,i=e.uniforms,o=Eu(n),a=o.content,s=o.uniforms,u=Eu(r),c=u.content,f=u.uniforms;this.rawContentCache[t]={fs:c,uniforms:Mu(Mu(Mu({},s),f),i),vs:a}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n=this.rawContentCache[t].vs,r=this.rawContentCache[t].fs,i=this.processModule(n,[],"vs"),o=i.content,a=i.includeList,s=this.processModule(r,[],"fs"),u=s.content,c=s.includeList,f=u,l=xu()(a.concat(c).concat(t)).reduce((function(t,n){return Mu(Mu({},t),e.rawContentCache[n].uniforms)}),{});return Ou.test(u)||(f="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+u),this.moduleCache[t]={fs:f.trim(),uniforms:l,vs:o.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(Au,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a,e,n).content})),includeList:e}}}]),t}())||wu,Tu=new to.Container;Object(to.decorate)(Object(to.injectable)(),cu.EventEmitter),Tu.bind(eo.IEventEmitter).to(cu.EventEmitter);lu()(Tu,!1);function Iu(){var t=new to.Container;return t.parent=Tu,t.bind(eo.Systems).to(eu).inSingletonScope().whenTargetNamed(eo.SceneGraphSystem),t.bind(eo.Systems).to(_o).inSingletonScope().whenTargetNamed(eo.FrameGraphSystem),t.bind(eo.Systems).to(Ja).inSingletonScope().whenTargetNamed(eo.MeshSystem),t.bind(eo.Systems).to(Wo).inSingletonScope().whenTargetNamed(eo.GeometrySystem),t.bind(eo.Systems).to(ia).inSingletonScope().whenTargetNamed(eo.MaterialSystem),t.bind(eo.Systems).to(Ws).inSingletonScope().whenTargetNamed(eo.RendererSystem),t.bind(eo.ResourcePool).to(hu).inSingletonScope(),t.bind(eo.ConfigService).to(mu).inSingletonScope(),t.bind(eo.InteractorService).to(yu).inSingletonScope(),t.bind(eo.RenderPass).to(Ss).inSingletonScope().whenTargetNamed(Ss.IDENTIFIER),t.bind(eo.RenderPass).to(Ms).inSingletonScope().whenTargetNamed(Ms.IDENTIFIER),t.bind(eo.RenderPass).to(zs).inSingletonScope().whenTargetNamed(zs.IDENTIFIER),t.bind(eo.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(eo.RenderPass,e)}})),t}Tu.bind(eo.ShaderModuleService).to(ku).inSingletonScope(),Tu.bind(eo.NameComponentManager).toConstantValue(new Ki(vu)),Tu.bind(eo.HierarchyComponentManager).toConstantValue(new Ki(tu)),Tu.bind(eo.TransformComponentManager).toConstantValue(new Ki(ru)),Tu.bind(eo.MeshComponentManager).toConstantValue(new Ki(ca)),Tu.bind(eo.CullableComponentManager).toConstantValue(new Ki(aa)),Tu.bind(eo.GeometryComponentManager).toConstantValue(new Ki(Go)),Tu.bind(eo.MaterialComponentManager).toConstantValue(new Ki(ta));var Cu;n(252),n(158);!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Cu||(Cu={}));n(253);var Pu,Du,Nu,Ru,ju="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);!function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(Pu||(Pu={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(Du||(Du={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(Nu||(Nu={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(Ru||(Ru={}));function Bu(t){return void 0===t?0:t>360||t<-360?t%360:t}function Lu(t,e,n){return Oa()(t)?Fo.e.fromValues(t,e,n):3===t.length?Fo.e.clone(t):Fo.e.fromValues(t[0],t[1],t[2])}var Gu,Fu,Uu,zu,Wu,Vu,Xu,Yu,Hu=function(){function t(e,n){Gi()(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=Fo.b.clone(n.matrix),this.right=Fo.e.clone(n.right),this.up=Fo.e.clone(n.up),this.forward=Fo.e.clone(n.forward),this.position=Fo.e.clone(n.position),this.focalPoint=Fo.e.clone(n.focalPoint),this.distanceVector=Fo.e.clone(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return Ui()(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=Fo.b.copy(t.matrix,this.matrix),t.right=Fo.e.copy(t.right,this.right),t.up=Fo.e.copy(t.up,this.up),t.forward=Fo.e.copy(t.forward,this.forward),t.position=Fo.e.copy(t.position,this.position),t.focalPoint=Fo.e.copy(t.focalPoint,this.focalPoint),t.distanceVector=Fo.e.copy(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(Vu||(Vu={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(Xu||(Xu={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(Yu||(Yu={}));var qu,Qu,Zu,Ku,$u,Ju,tc,ec=Math.PI/180,nc=180/Math.PI,rc=(Gu=Object(to.injectable)(),Fu=Object(to.inject)(eo.InteractorService),Gu((zu=function(){function t(){Gi()(this,t),this.matrix=Fo.b.create(),this.right=Fo.e.fromValues(1,0,0),this.up=Fo.e.fromValues(0,1,0),this.forward=Fo.e.fromValues(0,0,1),this.position=Fo.e.fromValues(0,0,1),this.focalPoint=Fo.e.fromValues(0,0,0),this.distanceVector=Fo.e.fromValues(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.rotateWorld=!1,Bi()(this,"interactor",Wu,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=Fo.b.create(),this.view=void 0,this.following=void 0,this.type=Vu.EXPLORING,this.trackingMode=Xu.DEFAULT,this.projectionMode=Yu.PERSPECTIVE,this.frustum=new Sa,this.landmarks=[],this.landmarkAnimationID=void 0}return Ui()(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===Vu.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Vu.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Vu.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return Fo.b.invert(Fo.b.create(),this.matrix)}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===Yu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Yu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=Yu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,Fo.b.perspective(this.perspective,this.fov*ec,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=Yu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),s=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=u-a,l=u+a,h=c+s,d=c-s;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,d=(h-=g*this.view.offsetY)-g*this.view.height}return Fo.b.ortho(this.perspective,f,l,h,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r=Fo.e.fromValues(0,1,0);if(this.focalPoint=Lu(t,e,n),this.trackingMode===Xu.CINEMATIC){var i=Fo.e.subtract(Fo.e.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Fo.e.length(i),a=Math.asin(e/o)*nc,s=90+Math.atan2(n,t)*nc,u=Fo.b.create();Fo.b.rotateY(u,u,s*ec),Fo.b.rotateX(u,u,a*ec),r=Fo.e.transformMat4(Fo.e.create(),[0,1,0],u)}return Fo.b.invert(this.matrix,Fo.b.lookAt(Fo.b.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=Fo.e.create();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=Bu(t),this.computeMatrix(),this._getAxes(),this.type===Vu.ORBITING||this.type===Vu.EXPLORING?this._getPosition():this.type===Vu.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Bu(t),this.computeMatrix(),this._getAxes(),this.type===Vu.ORBITING||this.type===Vu.EXPLORING?this._getPosition():this.type===Vu.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=Bu(t),this.computeMatrix(),this._getAxes(),this.type===Vu.ORBITING||this.type===Vu.EXPLORING?this._getPosition():this.type===Vu.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===Vu.EXPLORING){t=Bu(t),e=Bu(e),n=Bu(n);var r=Fo.c.setAxisAngle(Fo.c.create(),[1,0,0],(this.rotateWorld?1:-1)*e*ec),i=Fo.c.setAxisAngle(Fo.c.create(),[0,1,0],(this.rotateWorld?1:-1)*t*ec),o=Fo.c.setAxisAngle(Fo.c.create(),[0,0,1],n*ec),a=Fo.c.multiply(Fo.c.create(),i,r);a=Fo.c.multiply(Fo.c.create(),a,o);var s=Fo.b.fromQuat(Fo.b.create(),a);Fo.b.translate(this.matrix,this.matrix,[0,0,-this.distance]),Fo.b.multiply(this.matrix,this.matrix,s),Fo.b.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=Bu(e),this.relAzimuth=Bu(t),this.relRoll=Bu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===Vu.ORBITING||this.type===Vu.EXPLORING?this._getPosition():this.type===Vu.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Lu(t,e,0),r=Fo.e.clone(this.position);return Fo.e.add(r,r,Fo.e.scale(Fo.e.create(),this.right,n[0])),Fo.e.add(r,r,Fo.e.scale(Fo.e.create(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=Fo.e.clone(this.position),r=t*this.dollyingStep;return n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Vu.ORBITING||this.type===Vu.EXPLORING?this._getDistance():this.type===Vu.TRACKING&&Fo.e.add(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new Hu(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new Hu(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),s=r.getRoll(),u=function t(r){void 0===i&&(i=r);var u,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=Fo.e.create(),h=Fo.e.create();if(Fo.e.lerp(l,e.focalPoint,a,f),Fo.e.lerp(h,e.position,o,f),u=e.roll*(1-f)+s*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(u),e.computeMatrix(),!(Fo.e.dist(l,a)+Fo.e.dist(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(u),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(u)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=Fo.c.setAxisAngle(Fo.c.create(),[0,0,1],this.roll*ec);Fo.b.identity(this.matrix),t=Fo.c.setAxisAngle(Fo.c.create(),[1,0,0],(this.rotateWorld&&this.type!==Vu.TRACKING||this.type===Vu.TRACKING?1:-1)*this.elevation*ec),e=Fo.c.setAxisAngle(Fo.c.create(),[0,1,0],(this.rotateWorld&&this.type!==Vu.TRACKING||this.type===Vu.TRACKING?1:-1)*this.azimuth*ec);var r=Fo.c.multiply(Fo.c.create(),e,t);r=Fo.c.multiply(Fo.c.create(),r,n);var i=Fo.b.fromQuat(Fo.b.create(),r);this.type===Vu.ORBITING||this.type===Vu.EXPLORING?(Fo.b.translate(this.matrix,this.matrix,this.focalPoint),Fo.b.multiply(this.matrix,this.matrix,i),Fo.b.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===Vu.TRACKING&&(Fo.b.translate(this.matrix,this.matrix,this.position),Fo.b.multiply(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=Lu(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){Fo.e.copy(this.right,Lu(Fo.f.transformMat4(Fo.f.create(),[1,0,0,0],this.matrix))),Fo.e.copy(this.up,Lu(Fo.f.transformMat4(Fo.f.create(),[0,1,0,0],this.matrix))),Fo.e.copy(this.forward,Lu(Fo.f.transformMat4(Fo.f.create(),[0,0,1,0],this.matrix))),Fo.e.normalize(this.right,this.right),Fo.e.normalize(this.up,this.up),Fo.e.normalize(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Fo.e.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Vu.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*nc,this.azimuth=Math.atan2(-t,-n)*nc):(this.elevation=-Math.asin(e/r)*nc,this.azimuth=-Math.atan2(-t,-n)*nc)}},{key:"_getPosition",value:function(){Fo.e.copy(this.position,Lu(Fo.f.transformMat4(Fo.f.create(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){Fo.e.transformMat3(this.distanceVector,[0,0,-this.distance],Fo.a.fromMat4(Fo.a.create(),this.matrix)),Fo.e.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Fo.e.subtract(Fo.e.create(),this.focalPoint,this.position),this.distance=Fo.e.length(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),Wu=Wi()(zu.prototype,"interactor",[Fu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Uu=zu))||Uu),ic=n(38),oc=n.n(ic),ac=n(20),sc=n.n(ac),uc=n(6);function cc(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function fc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?fc(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var hc,dc,pc,gc,vc,mc,yc,bc,xc,wc,_c,Ec,Sc,Mc,Oc,Ac,kc,Tc,Ic,Cc,Pc,Dc,Nc,Rc,jc,Bc,Lc,Gc,Fc=(qu=Object(to.injectable)(),Qu=Object(to.inject)(eo.RenderEngine),Zu=Object(to.inject)(eo.ConfigService),qu(($u=function(){function t(){Gi()(this,t),Bi()(this,"engine",Ju,this),Bi()(this,"configService",tc,this),this.entity=Qi(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return Ui()(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(lc({canvas:e||cc(),swapChainFormat:uc.TextureFormat.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n=this;if("string"==typeof t){var r=Oa()(e)||oc()(e)||sc()(e);if(this.compiledBundle&&this.compiledBundle.context){var i=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(i)return i.value=e,this;var o=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));o&&(r?(o.data=e,o.isReferer=!1,o.storageClass===Nu.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(o.isReferer=!0,o.data=e))}}else Object.keys(t).forEach((function(e){n.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Hi()(Xi.a.mark((function t(){var e,n,r=this,i=arguments;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Hi()(Xi.a.mark((function t(){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Hi()(Xi.a.mark((function t(){var e,n,r;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=lc({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?Ru.WGSL:Ru.GLSL450:Ru.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===Nu.StorageBuffer){var n=1;t.type===Pu.FloatArray?n=1:t.type===Pu.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Ju=Wi()($u.prototype,"engine",[Qu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tc=Wi()($u.prototype,"configService",[Zu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ku=$u))||Ku),Uc=(hc=Object(to.injectable)(),dc=Object(to.inject)(eo.MeshComponentManager),pc=Object(to.inject)(eo.CullableComponentManager),gc=Object(to.inject)(eo.TransformComponentManager),vc=Object(to.inject)(eo.Systems),mc=Object(to.named)(eo.SceneGraphSystem),hc((Mc=Sc=function(){function t(){Gi()(this,t),this.config=void 0,Bi()(this,"mesh",xc,this),Bi()(this,"cullable",wc,this),Bi()(this,"transform",_c,this),Bi()(this,"sceneGraphSystem",Ec,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return Ui()(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.afterEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setVisible",value:function(t){return this.meshComponent.visible=t,this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"afterEntityCreated",value:function(){}}]),t}(),Sc.POINT="point",Sc.LINE="line",bc=Mc,xc=Wi()(bc.prototype,"mesh",[dc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wc=Wi()(bc.prototype,"cullable",[pc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_c=Wi()(bc.prototype,"transform",[gc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ec=Wi()(bc.prototype,"sceneGraphSystem",[vc,mc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yc=bc))||yc),zc=n(273),Wc=n.n(zc),Vc=function(){function t(e,n){Gi()(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,s=n.size,u=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:u||0},s&&(this.attribute.size=s)}return Ui()(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Xc=(Oc={},So()(Oc,Io.POINTS,"points"),So()(Oc,Io.LINES,"lines"),So()(Oc,Io.LINE_LOOP,"line loop"),So()(Oc,Io.LINE_STRIP,"line strip"),So()(Oc,Io.TRIANGLES,"triangles"),So()(Oc,Io.TRIANGLE_FAN,"triangle fan"),So()(Oc,Io.TRIANGLE_STRIP,"triangle strip"),Oc),Yc=(Ac={},So()(Ac,Io.STATIC_DRAW,"static"),So()(Ac,Io.DYNAMIC_DRAW,"dynamic"),So()(Ac,Io.STREAM_DRAW,"stream"),Ac),Hc=(kc={},So()(kc,Io.BYTE,"int8"),So()(kc,Io.UNSIGNED_INT,"int16"),So()(kc,Io.INT,"int32"),So()(kc,Io.UNSIGNED_BYTE,"uint8"),So()(kc,Io.UNSIGNED_SHORT,"uint16"),So()(kc,Io.UNSIGNED_INT,"uint32"),So()(kc,Io.FLOAT,"float"),kc),qc=(Tc={},So()(Tc,Io.ALPHA,"alpha"),So()(Tc,Io.LUMINANCE,"luminance"),So()(Tc,Io.LUMINANCE_ALPHA,"luminance alpha"),So()(Tc,Io.RGB,"rgb"),So()(Tc,Io.RGBA,"rgba"),So()(Tc,Io.RGBA4,"rgba4"),So()(Tc,Io.RGB5_A1,"rgb5 a1"),So()(Tc,Io.RGB565,"rgb565"),So()(Tc,Io.DEPTH_COMPONENT,"depth"),So()(Tc,Io.DEPTH_STENCIL,"depth stencil"),Tc),Qc=(Ic={},So()(Ic,Io.DONT_CARE,"dont care"),So()(Ic,Io.NICEST,"nice"),So()(Ic,Io.FASTEST,"fast"),Ic),Zc=(Cc={},So()(Cc,Io.NEAREST,"nearest"),So()(Cc,Io.LINEAR,"linear"),So()(Cc,Io.LINEAR_MIPMAP_LINEAR,"mipmap"),So()(Cc,Io.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),So()(Cc,Io.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),So()(Cc,Io.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),Cc),Kc=(Pc={},So()(Pc,Io.REPEAT,"repeat"),So()(Pc,Io.CLAMP_TO_EDGE,"clamp"),So()(Pc,Io.MIRRORED_REPEAT,"mirror"),Pc),$c=(Dc={},So()(Dc,Io.NONE,"none"),So()(Dc,Io.BROWSER_DEFAULT_WEBGL,"browser"),Dc),Jc=(Nc={},So()(Nc,Io.NEVER,"never"),So()(Nc,Io.ALWAYS,"always"),So()(Nc,Io.LESS,"less"),So()(Nc,Io.LEQUAL,"lequal"),So()(Nc,Io.GREATER,"greater"),So()(Nc,Io.GEQUAL,"gequal"),So()(Nc,Io.EQUAL,"equal"),So()(Nc,Io.NOTEQUAL,"notequal"),Nc),tf=(Rc={},So()(Rc,Io.FUNC_ADD,"add"),So()(Rc,Io.MIN_EXT,"min"),So()(Rc,Io.MAX_EXT,"max"),So()(Rc,Io.FUNC_SUBTRACT,"subtract"),So()(Rc,Io.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Rc),ef=(jc={},So()(jc,Io.ZERO,"zero"),So()(jc,Io.ONE,"one"),So()(jc,Io.SRC_COLOR,"src color"),So()(jc,Io.ONE_MINUS_SRC_COLOR,"one minus src color"),So()(jc,Io.SRC_ALPHA,"src alpha"),So()(jc,Io.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),So()(jc,Io.DST_COLOR,"dst color"),So()(jc,Io.ONE_MINUS_DST_COLOR,"one minus dst color"),So()(jc,Io.DST_ALPHA,"dst alpha"),So()(jc,Io.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),So()(jc,Io.CONSTANT_COLOR,"constant color"),So()(jc,Io.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),So()(jc,Io.CONSTANT_ALPHA,"constant alpha"),So()(jc,Io.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),So()(jc,Io.SRC_ALPHA_SATURATE,"src alpha saturate"),jc),nf=(Bc={},So()(Bc,Io.NEVER,"never"),So()(Bc,Io.ALWAYS,"always"),So()(Bc,Io.LESS,"less"),So()(Bc,Io.LEQUAL,"lequal"),So()(Bc,Io.GREATER,"greater"),So()(Bc,Io.GEQUAL,"gequal"),So()(Bc,Io.EQUAL,"equal"),So()(Bc,Io.NOTEQUAL,"notequal"),Bc),rf=(Lc={},So()(Lc,Io.ZERO,"zero"),So()(Lc,Io.KEEP,"keep"),So()(Lc,Io.REPLACE,"replace"),So()(Lc,Io.INVERT,"invert"),So()(Lc,Io.INCR,"increment"),So()(Lc,Io.DECR,"decrement"),So()(Lc,Io.INCR_WRAP,"increment wrap"),So()(Lc,Io.DECR_WRAP,"decrement wrap"),Lc),of=(Gc={},So()(Gc,Io.FRONT,"front"),So()(Gc,Io.BACK,"back"),Gc),af=function(){function t(e,n){Gi()(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Yc[i||Io.STATIC_DRAW],type:Hc[o||Io.UNSIGNED_BYTE]})}return Ui()(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}(),sf=n(19),uf=n.n(sf);function cf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ff(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cf(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var lf=0,hf=function(){function t(e,n){var r=this;Gi()(this,t),this.reGl=e,this.context=n,this.entity=Qi(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,s=t.storageClass;if(s===Nu.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var u=r.textureCache[e],c=u.textureWidth,f=u.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(s===Nu.Uniform){if(o&&(Array.isArray(o)||oc()(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var u={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(u)}var e;return Ui()(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Hi()(Xi.a.mark((function t(){var e,n,r,i,o,a,s,u,c=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u<e.length;u+=4)1===i?s.push(e[u]):2===i?s.push(e[u],e[u+1]):s.push(e[u],e[u+1],e[u+2]);else s=e;return t.abrupt("return",new a(s.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return ff(ff({},t),{},{id:lf++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Pu.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,s=Math.ceil(a/r),u=Math.ceil(Math.sqrt(s)),c=u*u;s<c&&i.push.apply(i,uf()(new Array(4*(c-s)).fill(0)));var f=this.reGl.texture({width:u,height:u,data:i,type:"float"});return{id:lf++,data:i,originalDataLength:a,typedArrayConstructor:oc()(n)?n.constructor:void 0,textureWidth:u,texture:f,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),df=function(){function t(e,n){Gi()(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Yc[i||Io.STATIC_DRAW],type:Hc[o||Io.UNSIGNED_BYTE],count:a})}return Ui()(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),pf=function(){function t(e,n){Gi()(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,s=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(s.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(s.color=o.get()),this.framebuffer=e.framebuffer(s)}return Ui()(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}(),gf=n(88),vf=n.n(gf),mf=n(164),yf=n.n(mf);function bf(t){var e={};return Object.keys(t).forEach((function(n){!function t(e,n,r,i){if(null===n||"number"==typeof n||"boolean"==typeof n||Array.isArray(n)&&"number"==typeof n[0]||oc()(n)||""===n||"resize"in n)return void(r["".concat(i&&i+".").concat(e)]=n);yf()(n)&&Object.keys(n).forEach((function(o){t(o,n[o],r,"".concat(i&&i+".").concat(e))}));Array.isArray(n)&&n.forEach((function(n,o){Object.keys(n).forEach((function(a){t(a,n[a],r,"".concat(i&&i+".").concat(e,"[").concat(o,"]"))}))}))}(n,t[n],e,"")})),e}function xf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xf(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _f,Ef,Sf=function(){function t(e,n){Gi()(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.attributes,a=n.uniforms,s=n.primitive,u=n.count,c=n.elements,f=n.depth,l=n.blend,h=n.stencil,d=n.cull,p=n.instances,g=n.scissor,v=n.viewport,m={};a&&(this.uniforms=bf(a),Object.keys(a).forEach((function(t){m[t]=e.prop(t)})));var y={};Object.keys(o).forEach((function(t){y[t]=o[t].get()}));var b={attributes:y,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(i),uniforms:m,vert:r,primitive:Xc[void 0===s?Io.TRIANGLES:s]};p&&(b.instances=p),u&&(b.count=u),c&&(b.elements=c.get()),g&&(b.scissor=g),v&&(b.viewport=v),this.initDepthDrawParams({depth:f},b),this.initBlendDrawParams({blend:l},b),this.initStencilDrawParams({stencil:h},b),this.initCullDrawParams({cull:d},b),this.drawCommand=e(b)}return Ui()(t,[{key:"addUniforms",value:function(t){this.uniforms=wf(wf({},this.uniforms),bf(t))}},{key:"draw",value:function(t){var e=wf(wf({},this.uniforms),bf(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=vf()(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:n[t]=e[t].get()})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Jc[n.func||Io.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,s=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:ef[i&&i.srcRGB||Io.SRC_ALPHA],srcAlpha:ef[i&&i.srcAlpha||Io.SRC_ALPHA],dstRGB:ef[i&&i.dstRGB||Io.ONE_MINUS_SRC_ALPHA],dstAlpha:ef[i&&i.dstAlpha||Io.ONE_MINUS_SRC_ALPHA]},equation:{rgb:tf[o&&o.rgb||Io.FUNC_ADD],alpha:tf[o&&o.alpha||Io.FUNC_ADD]},color:s}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,s=void 0===a?{cmp:Io.ALWAYS,ref:0,mask:-1}:a,u=n.opFront,c=void 0===u?{fail:Io.KEEP,zfail:Io.KEEP,zpass:Io.KEEP}:u,f=n.opBack,l=void 0===f?{fail:Io.KEEP,zfail:Io.KEEP,zpass:Io.KEEP}:f;e.stencil={enable:!!r,mask:o,func:wf(wf({},s),{},{cmp:nf[s.cmp]}),opFront:{fail:rf[c.fail],zfail:rf[c.zfail],zpass:rf[c.zpass]},opBack:{fail:rf[l.fail],zfail:rf[l.zfail],zpass:rf[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Io.BACK:i;e.cull={enable:!!r,face:of[o]}}}}]),t}(),Mf=function(){function t(e,n){Gi()(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Io.UNSIGNED_BYTE:i,a=n.width,s=n.height,u=n.flipY,c=void 0!==u&&u,f=n.format,l=void 0===f?Io.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,g=void 0===p?Io.CLAMP_TO_EDGE:p,v=n.wrapT,m=void 0===v?Io.CLAMP_TO_EDGE:v,y=n.aniso,b=void 0===y?0:y,x=n.alignment,w=void 0===x?1:x,_=n.premultiplyAlpha,E=void 0!==_&&_,S=n.mag,M=void 0===S?Io.NEAREST:S,O=n.min,A=void 0===O?Io.NEAREST:O,k=n.colorSpace,T=void 0===k?Io.BROWSER_DEFAULT_WEBGL:k;this.width=a,this.height=s;var I={width:a,height:s,type:Hc[o],format:qc[l],wrapS:Kc[g],wrapT:Kc[m],mag:Zc[M],min:Zc[A],alignment:w,flipY:c,colorSpace:$c[T],premultiplyAlpha:E,aniso:b};r&&(I.data=r),"number"==typeof d?I.mipmap=Qc[d]:"boolean"==typeof d&&(I.mipmap=d),this.texture=e.texture(I)}return Ui()(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),Of=Object(to.injectable)()(_f=function(){function t(){var e=this;Gi()(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Hi()(Xi.a.mark((function t(n){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Sf(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Vc(e.gl,t)},this.createBuffer=function(t){return new af(e.gl,t)},this.createElements=function(t){return new df(e.gl,t)},this.createTexture2D=function(t){return new Mf(e.gl,t)},this.createFramebuffer=function(t){return new pf(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Hi()(Xi.a.mark((function t(n){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new hf(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,s={color:n,depth:r,stencil:i};s.framebuffer=null===a?a:a.get(),e.gl.clear(s)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Io.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Io.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return Ui()(t,[{key:"init",value:(e=Hi()(Xi.a.mark((function t(e){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Wc()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}())||_f;function Af(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}function kf(t,e){return new Promise((function(e,n){Af(t,(function(){e()}),(function(t,e){n(e)}))}))}var Tf=function(){return If.apply(this,arguments)};function If(){return(If=Hi()(Xi.a.mark((function t(){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Ef){t.next=2;break}return t.abrupt("return",Ef);case 2:return t.next=4,kf("https://preview.babylonjs.com/glslang/glslang.js");case 4:return Ef=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",Ef);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Cf,Pf,Df,Nf,Rf,jf,Bf,Lf=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,s=r.normalized,u=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,h=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:s||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},u&&(this.attribute.size=u)}return Ui()(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Gf=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type;this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||uc.BufferUsage.Vertex|uc.BufferUsage.CopyDst)}return Ui()(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(ju?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),Ff=n(89),Uf=n.n(Ff),zf=function(){function t(e,n){Gi()(this,t),this.engine=e,this.context=n,this.entity=Qi(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return Ui()(t,[{key:"init",value:(r=Hi()(Xi.a.mark((function t(){var e,n,r,i,o,a,s,u=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===Nu.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===Nu.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,s=[],i.forEach((function(t){if(Oa()(t.data))u.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,s.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,s.push(0)),s.push.apply(s,uf()(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,s.push(0);s.push.apply(s,uf()(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new Gf(this.engine,{data:s instanceof Array?new Float32Array(s):s,usage:uc.BufferUsage.Uniform|uc.BufferUsage.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;Uf()(t.data)||t.type!==Pu.Vector4FloatArray&&t.type!==Pu.FloatArray||(t.name===u.context.output.name?(e=new Gf(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:uc.BufferUsage.Storage|uc.BufferUsage.CopyDst|uc.BufferUsage.CopySrc}),u.outputBuffer=e,u.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new Gf(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:uc.BufferUsage.Storage|uc.BufferUsage.CopyDst|uc.BufferUsage.CopySrc}),u.vertexBuffers[t.name]=e,u.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++)})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Hi()(Xi.a.mark((function t(){var e,n,r,i,o,a,s,u,c;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(s=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(ju?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([s.finish()]),t.next=12,a.mapAsync(uc.MapMode.Read);case 12:return u=a.getMappedRange(),c=new r(u.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,uf()(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(ju?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Hi()(Xi.a.mark((function t(e){var n;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:ju}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Wf=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new Gf(e,{data:i instanceof Array?new Uint16Array(i):i,usage:uc.BufferUsage.Index|uc.BufferUsage.CopyDst})}return Ui()(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Vf=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil;i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return Ui()(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i}));this.width=r,this.height=i}}]),t}(),Xf=(Cf={},So()(Cf,Io.POINTS,uc.PrimitiveTopology.PointList),So()(Cf,Io.LINES,uc.PrimitiveTopology.LineList),So()(Cf,Io.LINE_LOOP,uc.PrimitiveTopology.LineList),So()(Cf,Io.LINE_STRIP,uc.PrimitiveTopology.LineStrip),So()(Cf,Io.TRIANGLES,uc.PrimitiveTopology.TriangleList),So()(Cf,Io.TRIANGLE_FAN,uc.PrimitiveTopology.TriangleList),So()(Cf,Io.TRIANGLE_STRIP,uc.PrimitiveTopology.TriangleStrip),Cf),Yf=(Pf={},So()(Pf,Io.NEVER,uc.CompareFunction.Never),So()(Pf,Io.ALWAYS,uc.CompareFunction.Always),So()(Pf,Io.LESS,uc.CompareFunction.Less),So()(Pf,Io.LEQUAL,uc.CompareFunction.LessEqual),So()(Pf,Io.GREATER,uc.CompareFunction.Greater),So()(Pf,Io.GEQUAL,uc.CompareFunction.GreaterEqual),So()(Pf,Io.EQUAL,uc.CompareFunction.Equal),So()(Pf,Io.NOTEQUAL,uc.CompareFunction.NotEqual),Pf),Hf=(Df={},So()(Df,Io.FUNC_ADD,uc.BlendOperation.Add),So()(Df,Io.MIN_EXT,uc.BlendOperation.Min),So()(Df,Io.MAX_EXT,uc.BlendOperation.Max),So()(Df,Io.FUNC_SUBTRACT,uc.BlendOperation.Subtract),So()(Df,Io.FUNC_REVERSE_SUBTRACT,uc.BlendOperation.ReverseSubtract),Df),qf=(Nf={},So()(Nf,Io.ZERO,uc.BlendFactor.Zero),So()(Nf,Io.ONE,uc.BlendFactor.One),So()(Nf,Io.SRC_COLOR,uc.BlendFactor.SrcColor),So()(Nf,Io.ONE_MINUS_SRC_COLOR,uc.BlendFactor.OneMinusSrcColor),So()(Nf,Io.SRC_ALPHA,uc.BlendFactor.SrcAlpha),So()(Nf,Io.ONE_MINUS_SRC_ALPHA,uc.BlendFactor.OneMinusSrcAlpha),So()(Nf,Io.DST_COLOR,uc.BlendFactor.DstColor),So()(Nf,Io.ONE_MINUS_DST_COLOR,uc.BlendFactor.OneMinusDstColor),So()(Nf,Io.DST_ALPHA,uc.BlendFactor.DstAlpha),So()(Nf,Io.ONE_MINUS_DST_ALPHA,uc.BlendFactor.OneMinusDstAlpha),So()(Nf,Io.CONSTANT_COLOR,uc.BlendFactor.BlendColor),So()(Nf,Io.ONE_MINUS_CONSTANT_COLOR,uc.BlendFactor.OneMinusBlendColor),So()(Nf,Io.SRC_ALPHA_SATURATE,uc.BlendFactor.SrcAlphaSaturated),Nf),Qf=(Rf={},So()(Rf,Io.ALPHA,"r8unorm"),So()(Rf,Io.RGBA,"rgba8unorm"),So()(Rf,Io.DEPTH_COMPONENT,"depth32float"),So()(Rf,Io.DEPTH_STENCIL,"depth24plus-stencil8"),Rf),Zf=(jf={},So()(jf,Io.NEAREST,"nearest"),So()(jf,Io.LINEAR,"linear"),jf),Kf=(Bf={},So()(Bf,Io.REPEAT,"repeat"),So()(Bf,Io.CLAMP_TO_EDGE,"clamp-to-edge"),So()(Bf,Io.MIRRORED_REPEAT,"mirror-repeat"),Bf);function $f(t){var e=t.cull;return e&&e.enable?e.face?e.face===Io.FRONT?uc.CullMode.Front:uc.CullMode.Back:void 0:uc.CullMode.None}function Jf(t){var e=t.depth,n=(t.stencil,{compare:uc.CompareFunction.Always,depthFailOp:uc.StencilOperation.Keep,failOp:uc.StencilOperation.Keep,passOp:uc.StencilOperation.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Yf[(null==e?void 0:e.func)||Io.ALWAYS],format:uc.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function tl(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:qf[n&&n.func&&n.func.srcAlpha||Io.ONE],dstFactor:qf[n&&n.func&&n.func.dstAlpha||Io.ZERO],operation:Hf[n&&n.equation&&n.equation.alpha||Io.FUNC_ADD]},colorBlend:{srcFactor:qf[n&&n.func&&n.func.srcRGB||Io.ONE],dstFactor:qf[n&&n.func&&n.func.dstRGB||Io.ZERO],operation:Hf[n&&n.equation&&n.equation.rgb||Io.FUNC_ADD]},writeMask:uc.ColorWrite.All}]}function el(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?el(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rl(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];e+=s.length}for(var u=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];u.set(h,c),c+=h.length}return u}var il,ol=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return Ui()(t,[{key:"init",value:(n=Hi()(Xi.a.mark((function t(){var e,n,r,i,o,a,s,u,c,f,l,h,d,p,g,v,m=this;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,s=e.elements,u=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:h=t.sent,d=h.vertexStage,p=h.fragmentStage,o&&this.buildUniformBindGroup(o),s&&(this.indexBuffer=s.get(),this.indexCount=s.indexCount),g={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,s=r.attributes;return m.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:s}}))},v={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Xf[a||Io.TRIANGLES],rasterizationState:nl(nl({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:$f({cull:l})}),depthStencilState:Jf({depth:u,stencil:f}),colorStates:tl({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:g},this.renderPipeline=this.engine.device.createRenderPipeline(v);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=nl(nl({},this.uniforms),bf(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=nl(nl({},this.uniforms),bf(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=vf()(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;Uf()(a)||e.uniformBuffer.subData({data:r[t],offset:a})}else{var s,u=null===(s=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===s?void 0:s.offset;if(!Uf()(u)){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:u,resource:h}),u++),i.push({binding:u,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),uc.IndexFormat.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Hi()(Xi.a.mark((function t(e,n,r){var i,o,a;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:ju}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:ju}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:uc.FrontFace.CCW,cullMode:uc.CullMode.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=rl.apply(void 0,[Float32Array].concat(uf()(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:uc.ShaderStage.Fragment|uc.ShaderStage.Vertex,type:uc.BindingType.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:uc.ShaderStage.Fragment,type:uc.BindingType.Sampler},{binding:2*n+(o?1:0)+1,visibility:uc.ShaderStage.Fragment,type:uc.BindingType.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new Gf(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:uc.BufferUsage.Uniform|uc.BufferUsage.CopyDst}))}}]),t}(),al=function(){function t(e,n){Gi()(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return Ui()(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(t.data,t.type),n=(void 0===e&&Io.UNSIGNED_BYTE,t.width),r=t.height,i=(t.flipY,t.format),o=void 0===i?Io.RGBA:i,a=(t.mipmap,t.wrapS),s=void 0===a?Io.CLAMP_TO_EDGE:a,u=t.wrapT,c=void 0===u?Io.CLAMP_TO_EDGE:u,f=t.aniso,l=void 0===f?0:f,h=(t.alignment,t.premultiplyAlpha,t.mag),d=void 0===h?Io.NEAREST:h,p=t.min,g=void 0===p?Io.NEAREST:p,v=t.colorSpace,m=(void 0===v&&Io.BROWSER_DEFAULT_WEBGL,t.usage);this.width=n,this.height=r,this.texture=this.engine.device.createTexture({size:[n,r,1],mipLevelCount:1,sampleCount:1,dimension:uc.TextureDimension.E2d,format:Qf[o],usage:m||uc.TextureUsage.Sampled|uc.TextureUsage.CopyDst}),(!m||m&uc.TextureUsage.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:Kf[s],addressModeV:Kf[c],addressModeW:Kf[s],magFilter:Zf[d],minFilter:Zf[g],maxAnisotropy:l}))}}]),t}(),sl=Object(to.injectable)()(il=function(){function t(){var e=this;Gi()(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||uc.LoadOp.Load,e.mainDepthAttachment.depthLoadValue=r||uc.LoadOp.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:uc.LoadOp.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Hi()(Xi.a.mark((function t(n){var r;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new ol(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Lf(e,t)},this.createBuffer=function(t){return new Gf(e,t)},this.createElements=function(t){return new Wf(e,t)},this.createTexture2D=function(t){return new al(e,t)},this.createFramebuffer=function(t){return new Vf(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:uc.TextureViewDimension.E2d,arrayLayerCount:1,aspect:uc.TextureAspect.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Hi()(Xi.a.mark((function t(n){var r;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new zf(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;if(e.currentRenderPass){if(e.transientViewport.x!==1/0){e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1)}else if(n!==e.cachedViewport.x||r!==e.cachedViewport.y||i!==e.cachedViewport.width||o!==e.cachedViewport.height){e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)}}else e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return Ui()(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Hi()(Xi.a.mark((function t(e){return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),ju?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Hi()(Xi.a.mark((function t(){var e,n;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Tf();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(ju?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:uc.TextureUsage.OutputAttachment|uc.TextureUsage.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:uc.TextureDimension.E2d,format:uc.TextureFormat.BGRA8Unorm,usage:uc.TextureUsage.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:ju?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:uc.StoreOp.Store}]}else this.mainColorAttachments=[{attachment:ju?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:uc.StoreOp.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:uc.TextureDimension.E2d,format:ju?"depth32float-stencil8":uc.TextureFormat.Depth24PlusStencil8,usage:uc.TextureUsage.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:ju?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:uc.StoreOp.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:uc.StoreOp.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=ju?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=ju?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=null===(r=t.get().color)||void 0===r?void 0:r.texture;s&&(o=s.createView(this.currentRenderTargetViewDescriptor));var u,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(u=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:uc.LoadOp.Load,storeOp:uc.StoreOp.Store}],depthStencilAttachment:c&&u?{attachment:u,depthLoadValue:n?this.clearDepthValue:uc.LoadOp.Load,depthStoreOp:uc.StoreOp.Store,stencilLoadValue:a?this.clearStencilValue:uc.LoadOp.Load,stencilStoreOp:uc.StoreOp.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}())||il,ul=n(91),cl=n(61);function fl(t,e,n,r,i){ll(e,r,-i),ll(e,r,i),t.push(n),t.push(n)}function ll(t,e,n){t.push([[e[0],e[1]],n])}var hl,dl,pl,gl,vl,ml,yl,bl,xl;function wl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var _l,El,Sl,Ml,Ol,Al,kl,Tl,Il,Cl=(hl=Object(to.injectable)(),dl=Object(to.inject)(eo.Systems),pl=Object(to.named)(eo.MaterialSystem),gl=Object(to.inject)(eo.Systems),vl=Object(to.named)(eo.GeometrySystem),hl((yl=function(t){ao()(n,t);var e=wl(n);function n(){var t;Gi()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Bi()(t,"materialSystem",bl,Oo()(t)),Bi()(t,"geometrySystem",xl,Oo()(t)),t}return Ui()(n,[{key:"afterEntityCreated",value:function(){var t=this,e=this.materialSystem.createShaderMaterial({vertexShader:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fragmentShader:"uniform float u_dash_array;\nuniform float u_dash_offset;\nuniform float u_dash_ratio;\nuniform float u_thickness;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});e.setCull({enable:!1,face:Io.BACK}).setUniform({u_dash_array:this.config.dashArray||.02,u_dash_offset:this.config.dashOffset||0,u_dash_ratio:this.config.dashRatio||0,u_thickness:this.config.thickness||.02});var n=function(t,e,n){var r=[0,0],i=[0,0],o=[0,0],a=[0,0],s=-1,u=!1,c=null,f=Object(ul.create)(),l=n||0,h=[],d=[],p=[],g=[0,0];e&&(t=t.slice()).push(t[0]);for(var v=t.length,m=1;m<v;m++){var y=l,b=t[m-1],x=t[m],w=m<t.length-1?t[m+1]:null;if(g.push(m/v,m/v),Object(cl.direction)(r,x,b),c||(c=[0,0],Object(cl.normal)(c,r)),u||(u=!0,fl(d,h,b,c,1)),p.push([y+0,y+1,y+2]),w){Object(cl.direction)(i,w,x);var _=Object(cl.computeMiter)(o,a,r,i,1),E=Object(ul.dot)(o,c)<0?-1:1,S=_>3;if(!isFinite(_)){Object(cl.normal)(c,r),fl(d,h,x,c,1),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),l+=2,s=E;continue}S?(_=3,g.push(m/v),ll(h,c,-E),d.push(x),ll(h,a,_*E),d.push(x),p.push(s!==-E?[y,y+2,y+3]:[y+2,y+1,y+3]),p.push([y+2,y+3,y+4]),Object(cl.normal)(f,i),Object(ul.copy)(c,f),ll(h,c,-E),d.push(x),l+=3):(fl(d,h,x,a,_),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),E=-1,Object(ul.copy)(c,a),l+=2),s=E}else Object(cl.normal)(c,r),fl(d,h,x,c,1),p.push(1===s?[y,y+2,y+3]:[y+2,y+1,y+3]),l+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:g}}(this.config.points,!1),r=n.normals,i=n.attrIndex,o=n.attrPos,a=n.attrCounters,s=o.length,u=this.geometrySystem.createBufferGeometry({vertexCount:s}),c=[],f=[];r.forEach((function(t){var e=t[0],n=t[1];c.push([e[0],e[1]]),f.push(n)})),u.setIndex(i.reduce((function(t,e){return[].concat(uf()(t),uf()(e))}),[])),u.setAttribute("a_pos",Float32Array.from(o.reduce((function(t,e){return[].concat(uf()(t),uf()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var l=new Array(s).fill(void 0).map((function(){return uf()(t.config.color)})).reduce((function(t,e){return[].concat(uf()(t),uf()(e))}),[]);u.setAttribute("a_color",Float32Array.from(l),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),u.setAttribute("a_line_miter",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),u.setAttribute("a_line_normal",Float32Array.from(c.reduce((function(t,e){return[].concat(uf()(t),uf()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),u.setAttribute("a_counters",Float32Array.from(a),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),this.setMaterial(e),this.setGeometry(u)}}]),n}(Uc),bl=Wi()(yl.prototype,"materialSystem",[dl,pl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xl=Wi()(yl.prototype,"geometrySystem",[gl,vl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ml=yl))||ml);function Pl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo()(t);if(e){var i=fo()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return uo()(this,n)}}var Dl,Nl,Rl,jl,Bl,Ll,Gl,Fl,Ul,zl=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],Wl=(_l=Object(to.injectable)(),El=Object(to.inject)(eo.Systems),Sl=Object(to.named)(eo.MaterialSystem),Ml=Object(to.inject)(eo.Systems),Ol=Object(to.named)(eo.GeometrySystem),_l((kl=function(t){ao()(n,t);var e=Pl(n);function n(){var t;Gi()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Bi()(t,"materialSystem",Tl,Oo()(t)),Bi()(t,"geometrySystem",Il,Oo()(t)),t}return Ui()(n,[{key:"afterEntityCreated",value:function(){var t=this.materialSystem.createShaderMaterial({vertexShader:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fragmentShader:"uniform float u_blur;\nuniform float u_opacity;\nuniform float u_stroke_width;\nuniform vec4 u_stroke_color;\nuniform float u_stroke_opacity;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}",cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Io.SRC_ALPHA,dstRGB:Io.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});t.setUniform({u_stroke_width:.01,u_device_pixel_ratio:window.devicePixelRatio,u_stroke_color:[0,0,0,0],u_stroke_opacity:1,u_opacity:.35,u_blur:0});var e=this.buildAttributes(),n=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:e.instancedOffsets.length/2,vertexCount:6});n.setIndex([0,2,1,0,3,2]),n.setAttribute("position",Float32Array.from(e.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),n.setAttribute("offset",Float32Array.from(e.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),n.setAttribute("color",Float32Array.from(e.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),n.setAttribute("size",Float32Array.from(e.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),n.setAttribute("shape",Float32Array.from(e.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),n.setAttribute("a_PickingColor",Float32Array.from(e.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(t),this.setGeometry(n)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,s;(r=e.instancedPickingColors).push.apply(r,uf()([(s=t.id||n)+1&255,s+1>>8&255,s+1>>8>>8&255])),e.instancedShapes.push(zl.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,uf()(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,uf()(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,uf()(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),n}(Uc),Tl=Wi()(kl.prototype,"materialSystem",[El,Sl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Il=Wi()(kl.prototype,"geometrySystem",[Ml,Ol],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Al=kl))||Al);function Vl(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xl(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Yl,Hl,ql,Ql,Zl,Kl,$l,Jl,th,eh,nh,rh,ih=(Dl=Object(to.injectable)(),Nl=Object(to.inject)(eo.RenderEngine),Rl=Object(to.inject)(eo.ShaderModuleService),jl=Object(to.inject)(eo.ConfigService),Dl((Ll=function(){function t(){Gi()(this,t),Bi()(this,"engine",Gl,this),Bi()(this,"shaderModule",Fl,this),Bi()(this,"configService",Ul,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0,this.container=void 0}var e,n;return Ui()(t,[{key:"init",value:(n=Hi()(Xi.a.mark((function t(){var e,n,r,i,o;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),e=this.container.getAll(eo.Systems),!(n=this.configService.get()).canvas){t.next=25;break}return t.next=6,this.engine.init({canvas:n.canvas,swapChainFormat:uc.TextureFormat.BGRA8Unorm,antialiasing:!1});case 6:r=Vl(e),t.prev=7,r.s();case 9:if((i=r.n()).done){t.next=16;break}if(!(o=i.value).initialize){t.next=14;break}return t.next=14,o.initialize();case 14:t.next=9;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(7),r.e(t.t0);case 21:return t.prev=21,r.f(),t.finish(21);case 24:this.inited=!0;case 25:case"end":return t.stop()}}),t,this,[[7,18,21,24]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Hi()(Xi.a.mark((function t(){var e,n,r,i,o,a,s,u=arguments;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(eo.Systems),n=u.length,r=new Array(n),i=0;i<n;i++)r[i]=u[i];o=Vl(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(s=a.value).execute){t.next=15;break}return t.next=15,s.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),Gl=Wi()(Ll.prototype,"engine",[Nl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fl=Wi()(Ll.prototype,"shaderModule",[Rl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ul=Wi()(Ll.prototype,"configService",[jl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bl=Ll))||Bl),oh=Object(to.injectable)()(Yl=function(){function t(){Gi()(this,t),this.entities=[]}return Ui()(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}())||Yl,ah=(Hl=Object(to.injectable)(),ql=Object(to.inject)(eo.Systems),Ql=Object(to.named)(eo.RendererSystem),Hl((Kl=function(){function t(){Gi()(this,t),Bi()(this,"rendererSystem",$l,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return Ui()(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),$l=Wi()(Kl.prototype,"rendererSystem",[ql,Ql],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zl=Kl))||Zl);function sh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function uh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sh(Object(n),!0).forEach((function(e){So()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ch=(Jl=Object(to.injectable)(),th=Object(to.inject)(eo.ConfigService),Jl((nh=function(){function t(){Gi()(this,t),Bi()(this,"configService",rh,this),this.container=void 0}var e;return Ui()(t,[{key:"getEngine",value:(e=Hi()(Xi.a.mark((function t(){var e,n,r,i;return Xi.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(eo.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(uh({canvas:r||cc(),swapChainFormat:uc.TextureFormat.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(eo.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(eo.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Qi()}},{key:"createScene",value:function(){return this.container.get(oh)}},{key:"createCamera",value:function(){return this.container.get(rc)}},{key:"createView",value:function(){return this.container.get(ah)}},{key:"createRenderable",value:function(t,e,n){var r=e?this.container.getNamed(eo.Renderable,e):this.container.get(Uc);return r.setConfig(n),r.setEntity(t),r}},{key:"createBoxGeometry",value:function(t){return this.container.getNamed(eo.Systems,eo.GeometrySystem).createBox(t)}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(eo.Systems,eo.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(eo.Systems,eo.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createBasicMaterial",value:function(){return this.container.getNamed(eo.Systems,eo.MaterialSystem).createBasicMaterial()}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(eo.Systems,eo.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(Fc);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(ih);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(eo.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(eo.RenderEngine).destroy(),this.container.get(eo.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Iu(),r=navigator.gpu?sl:Of;n.isBound(eo.RenderEngine)||n.bind(eo.RenderEngine).to(r).inSingletonScope(),n.bind(ih).toSelf(),n.bind(Fc).toSelf(),n.bind(Uc).toSelf(),n.bind(ah).toSelf(),n.bind(rc).toSelf(),n.bind(oh).toSelf(),n.bind(t).toSelf(),n.bind(eo.Renderable).to(Wl).whenTargetNamed(Uc.POINT),n.bind(eo.Renderable).to(Cl).whenTargetNamed(Uc.LINE);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),rh=Wi()(nh.prototype,"configService",[th],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),eh=nh))||eh),fh=function(t,e){return t?Object(l.t)(t)?function(e){return t}:t:function(t){return e||1}},lh=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},hh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.gravity=10,e.speed=1,e.clustering=!1,e.clusterField="cluster",e.clusterGravity=10,e.workerEnabled=!1,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,speed:.1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=this.nodes,n=this.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var r={},i={};e.forEach((function(e,n){Object(l.t)(e.x)||(e.x=Math.random()*t.width),Object(l.t)(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),this.nodeMap=r,this.nodeIdxMap=i,this.run()}},e.prototype.executeWithWorker=function(t,e){var n=this,r=this.nodes,i=this.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var o={},a={};r.forEach((function(t,e){Object(l.t)(t.x)||(t.x=Math.random()*n.width),Object(l.t)(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,a[t.id]=e})),this.nodeMap=o,this.nodeIdxMap=a,this.run(t,e)}},e.prototype.run=function(t,e){var n=this,r=this.nodes,i=this.edges,o=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);var a,s,u,c,f,l,h=this.center,d=this.height*this.width,g=Math.sqrt(d)/10,v=d/(r.length+1),m=Math.sqrt(v),y=this.speed,b=this.clustering,x=(a=[this.clusterField],s=r,u=[],c=a.length,f={},s.forEach((function(t){a.forEach((function(e,n){if(void 0===f[t[e]]&&(f[t[e]]=Object.keys(f).length),u.push(f[t[e]]),n===c-1)for(;u.length%4!=0;)u.push(0)}))})),{array:new Float32Array(u),count:Object.keys(f).length}),w=x.array,_=x.count,E=r.length,S=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var s=e[o];r[i[s.source]].push(i[s.target]),r[i[s.target]].push(i[s.source])}var u=0;for(o=0;o<t.length;o++){var c=n.length,f=r[o],l=f.length;n[4*o+2]=c,n[4*o+3]=f.length,u=Math.max(u,f.length);for(var h=0;h<l;++h){var d=f[h];n.push(+d)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:u}}(r,i),M=S.maxEdgePerVetex,O=S.array;l=this.workerEnabled?ch.create({canvas:t,engineOptions:{supportCompute:!0}}):ch.create({engineOptions:{supportCompute:!0}});for(var A=this.onLayoutEnd,k=[],T=0;T<_;T++)k.push(0,0,0,0);var I,C=l.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([E,1,1]).setBinding({u_Data:O,u_K:m,u_K2:v,u_Gravity:this.gravity,u_ClusterGravity:this.clusterGravity,u_Speed:y,u_MaxDisplace:g,u_Clustering:b?1:0,u_Center:h,u_AttributeArray:w,u_ClusterCenters:k,MAX_EDGE_PER_VERTEX:M,VERTEX_COUNT:E});b&&(I=l.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([_,1,1]).setBinding({u_Data:O,u_NodeAttributes:w,u_ClusterCenters:k,VERTEX_COUNT:E,CLUSTER_COUNT:_}));Object(p.b)(n,void 0,void 0,(function(){var n,i;return Object(p.d)(this,(function(a){switch(a.label){case 0:n=0,a.label=1;case 1:return n<o?[4,C.execute()]:[3,6];case 2:return a.sent(),b?(I.setBinding({u_Data:C}),[4,I.execute()]):[3,4];case 3:a.sent(),C.setBinding({u_ClusterCenters:I}),a.label=4;case 4:C.setBinding({u_MaxDisplace:g*=.99}),a.label=5;case 5:return n++,[3,1];case 6:return[4,C.getOutput()];case 7:return i=a.sent(),t?e.postMessage({type:wr,vertexEdgeData:i}):r.forEach((function(t,e){var n=i[4*e],r=i[4*e+1];t.x=n,t.y=r})),A&&A(),[2]}}))}))},e}(hn),dh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.edgeStrength=200,e.nodeStrength=1e3,e.coulombDisScale=.005,e.damping=.9,e.maxSpeed=1e3,e.minMovement=1,e.interval=.02,e.factor=1,e.linkDistance=1,e.gravity=10,e.workerEnabled=!1,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,center:[0,0],gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var r={},i={};e.forEach((function(e,n){Object(l.t)(e.x)||(e.x=Math.random()*t.width),Object(l.t)(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=fh(t.nodeStrength,1),t.edgeStrength=fh(t.edgeStrength,1),t.run()}},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,i=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var o={},a={};r.forEach((function(t,e){Object(l.t)(t.x)||(t.x=Math.random()*n.width),Object(l.t)(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,a[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=a,n.nodeStrength=fh(n.nodeStrength,1),n.edgeStrength=fh(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){var n=this,r=this,i=r.nodes,o=r.edges,a=r.maxIteration;r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight);var s=i.length;r.linkDistance=fh(r.linkDistance),r.edgeStrength=fh(r.edgeStrength);var u=function(t,e,n,r){var i=[],o=[],a={},s=0;for(s=0;s<t.length;s++){var u=t[s];a[u.id]=s,i.push(u.x),i.push(u.y),i.push(0),i.push(0),o.push([])}for(s=0;s<e.length;s++){var c=e[s];o[a[c.source]].push(a[c.target]),o[a[c.source]].push(n(c)),o[a[c.source]].push(r(c)),o[a[c.source]].push(0),o[a[c.target]].push(a[c.source]),o[a[c.target]].push(n(c)),o[a[c.target]].push(r(c)),o[a[c.target]].push(0)}var f=0;for(s=0;s<t.length;s++){var l=i.length,h=o[s],d=h.length;i[4*s+2]=l+1048576*d/4,i[4*s+3]=0,f=Math.max(f,d/4);for(var p=0;p<d;++p){var g=h[p];i.push(+g)}}for(;i.length%4!=0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:f}}(i,o,r.linkDistance,r.edgeStrength),c=u.maxEdgePerVetex,f=u.array;r.degrees=Bt(i.length,r.nodeIdxMap,o);var h=[],d=[],g=[],v=[],m=[];r.getMass||(r.getMass=function(t){return r.degrees[r.nodeIdxMap[t.id]]||1});var y=r.gravity,b=r.center;i.forEach((function(t,e){h.push(r.getMass(t)),d.push(r.nodeStrength(t)),r.degrees[e]||(r.degrees[e]=0);var n=[b[0],b[1],y];if(r.getCenter){var i=r.getCenter(t,r.degrees[e]);i&&Object(l.t)(i[0])&&Object(l.t)(i[1])&&Object(l.t)(i[2])&&(n=i)}g.push(n[0]),v.push(n[1]),m.push(n[2])}));var x,w=lh([h,r.degrees,d]),_=lh([g,v,m]);x=r.workerEnabled?ch.create({canvas:t,engineOptions:{supportCompute:!0}}):ch.create({engineOptions:{supportCompute:!0}});var E=r.onLayoutEnd,S=[];f.forEach((function(t){S.push(t)}));for(var M=0;M<4;M++)S.push(0);var O=x.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = dist * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (1000.0 * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.w;\\nvar ay : f32 = vy * attributes2.w;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = dist * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (1000.0 * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.w;\\nfloat ay = vy * attributes2.w;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = dist * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (1000.0 * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.w;\\nfloat ay = vy * attributes2.w;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([s,1,1]).setBinding({u_Data:f,u_damping:r.damping,u_maxSpeed:r.maxSpeed,u_minMovement:r.minMovement,u_coulombDisScale:r.coulombDisScale,u_factor:r.factor,u_NodeAttributeArray1:w,u_NodeAttributeArray2:_,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:s,u_AveMovement:S,u_interval:r.interval}),A=x.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:s,u_AveMovement:[0,0,0,0]});Object(p.b)(n,void 0,void 0,(function(){var n,o,s;return Object(p.d)(this,(function(u){switch(u.label){case 0:n=0,u.label=1;case 1:return n<a?[4,O.execute()]:[3,5];case 2:return u.sent(),A.setBinding({u_Data:O}),[4,A.execute()];case 3:u.sent(),o=Math.max(.02,r.interval-.002*n),O.setBinding({u_interval:o,u_AveMovement:A}),u.label=4;case 4:return n++,[3,1];case 5:return[4,O.getOutput()];case 6:return s=u.sent(),t?e.postMessage({type:wr,vertexEdgeData:s}):i.forEach((function(t,e){var n=s[4*e],r=s[4*e+1];t.x=n,t.y=r})),E&&E(),[2]}}))}))},e}(hn),ph={circular:vn,concentric:mn,dagre:xn,force:_r,g6force:Sr,comboForce:Ri,fruchterman:Mr,grid:Or,mds:Ti,radial:Di,random:Ni,gForce:function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.edgeStrength=200,e.nodeStrength=1e3,e.coulombDisScale=.005,e.damping=.9,e.maxSpeed=1e3,e.minMovement=.5,e.interval=.02,e.factor=1,e.linkDistance=1,e.gravity=10,e.preventOverlap=!0,e.tick=function(){},e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(p.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,center:[0,0],gravity:10,enableTick:!0}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(void 0!==t.timeInterval&&"undefined"!=typeof window&&window.clearInterval(t.timeInterval),e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var r={},i={};e.forEach((function(e,n){Object(l.t)(e.x)||(e.x=Math.random()*t.width),Object(l.t)(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.linkDistance=fh(t.linkDistance,1),t.nodeStrength=fh(t.nodeStrength,1),t.edgeStrength=fh(t.edgeStrength,1);var o,a=t.nodeSize;if(t.preventOverlap){var s,u=t.nodeSpacing;s=Object(l.t)(u)?function(){return u}:Object(l.r)(u)?u:function(){return 0},o=a?Object(l.m)(a)?function(t){return(a[0]>a[1]?a[0]:a[1])+s(t)}:function(t){return a+s(t)}:function(t){return t.size?Object(l.m)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+s(t):t.size+s(t):10+s(t)}}t.nodeSize=o;var c=t.edges;t.degrees=Bt(e.length,t.nodeIdxMap,c),t.getMass||(t.getMass=function(e){return t.degrees[t.nodeIdxMap[e.id]]}),t.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;if(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),"undefined"!=typeof window){var i=0;this.timeInterval=window.setInterval((function(){var o=[],a=[];e.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),t.calRepulsive(o,e),t.calAttractive(o,n),t.calGravity(o,e);var s=Math.max(.02,t.interval-.002*i);t.updateVelocity(o,a,s,e);var u=[];e.forEach((function(t){u.push({x:t.x,y:t.y})})),t.updatePosition(a,s,e),t.tick&&t.tick();var c=0;e.forEach((function(t,e){var n=t.x-u[e].x,r=t.y-u[e].y;c+=Math.sqrt(n*n+r*r)})),(c/=e.length)<t.minMovement&&window.clearInterval(t.timeInterval),++i>r&&window.clearInterval(t.timeInterval)}),0),t.onLayoutEnd&&t.onLayoutEnd()}},e.prototype.calRepulsive=function(t,e){var n=this.getMass,r=this.nodeStrength,i=this.factor,o=this.coulombDisScale,a=this.preventOverlap,s=this.nodeSize;e.forEach((function(u,c){var f=n(u)||1;e.forEach((function(e,l){if(!(c>=l)){var h=u.x-e.x,d=u.y-e.y,p=Math.sqrt(h*h+d*d)+.01,g=(p+.1)*o,v=h/p,m=d/p,y=(r(u)+r(e))/2*i/(g*g),b=n(e)||1;if(t[2*c]+=v*y/f,t[2*c+1]+=m*y/f,t[2*l]-=v*y/b,t[2*l+1]-=m*y/b,a&&p<(s(u)+s(e))/2){var x=(r(u)+r(e))/2/(p*p);t[2*c]+=v*x/f,t[2*c+1]+=m*x/f,t[2*l]-=v*x/b,t[2*l+1]-=m*x/b}}}))}))},e.prototype.calAttractive=function(t,e){var n=this.nodeMap,r=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,a=this.getMass;e.forEach((function(e,s){var u=n[e.source],c=n[e.target],f=c.x-u.x,l=c.y-u.y,h=Math.sqrt(f*f+l*l)+.01,d=f/h,p=l/h,g=((i(e)||1)-h)*o(e),v=r[e.source],m=r[e.target],y=a(u)||1,b=a(c)||1;t[2*v]-=d*g/y,t[2*v+1]-=p*g/y,t[2*m]+=d*g/b,t[2*m+1]+=p*g/b}))},e.prototype.calGravity=function(t,e){for(var n=this.center,r=this.gravity,i=this.degrees,o=e.length,a=0;a<o;a++){var s=e[a],u=s.x-n[0],c=s.y-n[1],f=r;if(this.getCenter){var h=this.getCenter(s,i[a]);h&&Object(l.t)(h[0])&&Object(l.t)(h[1])&&Object(l.t)(h[2])&&(u=s.x-h[0],c=s.y-h[1],f=h[2])}f&&(t[2*a]-=f*u,t[2*a+1]-=f*c)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,s=t[2*r+1]*o||.01,u=Math.sqrt(a*a+s*s);if(u>i.maxSpeed){var c=i.maxSpeed/u;a*=c,s*=c}e[2*r]=a,e[2*r+1]=s}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e}(hn),"fruchterman-gpu":hh,"gForce-gpu":dh};Object(l.f)(ph,(function(t,e){pn.registerLayout(e,{},t)}));var gh=pn,vh=n(274),mh=n.n(vh),yh=function(){return mh()('!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=478)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return o})),n.d(e,"f",(function(){return a}));var r={};n.r(r),n.d(r,"create",(function(){return h})),n.d(r,"fromMat4",(function(){return d})),n.d(r,"clone",(function(){return p})),n.d(r,"copy",(function(){return v})),n.d(r,"fromValues",(function(){return m})),n.d(r,"set",(function(){return g})),n.d(r,"identity",(function(){return y})),n.d(r,"transpose",(function(){return b})),n.d(r,"invert",(function(){return x})),n.d(r,"adjoint",(function(){return _})),n.d(r,"determinant",(function(){return w})),n.d(r,"multiply",(function(){return E})),n.d(r,"translate",(function(){return S})),n.d(r,"rotate",(function(){return A})),n.d(r,"scale",(function(){return T})),n.d(r,"fromTranslation",(function(){return M})),n.d(r,"fromRotation",(function(){return k})),n.d(r,"fromScaling",(function(){return I})),n.d(r,"fromMat2d",(function(){return O})),n.d(r,"fromQuat",(function(){return C})),n.d(r,"normalFromMat4",(function(){return D})),n.d(r,"projection",(function(){return R})),n.d(r,"str",(function(){return N})),n.d(r,"frob",(function(){return P})),n.d(r,"add",(function(){return j})),n.d(r,"subtract",(function(){return G})),n.d(r,"multiplyScalar",(function(){return L})),n.d(r,"multiplyScalarAndAdd",(function(){return B})),n.d(r,"exactEquals",(function(){return U})),n.d(r,"equals",(function(){return F})),n.d(r,"mul",(function(){return z})),n.d(r,"sub",(function(){return V}));var i={};n.r(i),n.d(i,"create",(function(){return W})),n.d(i,"clone",(function(){return X})),n.d(i,"copy",(function(){return q})),n.d(i,"fromValues",(function(){return H})),n.d(i,"set",(function(){return Y})),n.d(i,"identity",(function(){return K})),n.d(i,"transpose",(function(){return Z})),n.d(i,"invert",(function(){return Q})),n.d(i,"adjoint",(function(){return $})),n.d(i,"determinant",(function(){return J})),n.d(i,"multiply",(function(){return tt})),n.d(i,"translate",(function(){return et})),n.d(i,"scale",(function(){return nt})),n.d(i,"rotate",(function(){return rt})),n.d(i,"rotateX",(function(){return it})),n.d(i,"rotateY",(function(){return ot})),n.d(i,"rotateZ",(function(){return at})),n.d(i,"fromTranslation",(function(){return ut})),n.d(i,"fromScaling",(function(){return st})),n.d(i,"fromRotation",(function(){return ct})),n.d(i,"fromXRotation",(function(){return ft})),n.d(i,"fromYRotation",(function(){return lt})),n.d(i,"fromZRotation",(function(){return ht})),n.d(i,"fromRotationTranslation",(function(){return dt})),n.d(i,"fromQuat2",(function(){return pt})),n.d(i,"getTranslation",(function(){return vt})),n.d(i,"getScaling",(function(){return mt})),n.d(i,"getRotation",(function(){return gt})),n.d(i,"fromRotationTranslationScale",(function(){return yt})),n.d(i,"fromRotationTranslationScaleOrigin",(function(){return bt})),n.d(i,"fromQuat",(function(){return xt})),n.d(i,"frustum",(function(){return _t})),n.d(i,"perspective",(function(){return wt})),n.d(i,"perspectiveFromFieldOfView",(function(){return Et})),n.d(i,"ortho",(function(){return St})),n.d(i,"lookAt",(function(){return At})),n.d(i,"targetTo",(function(){return Tt})),n.d(i,"str",(function(){return Mt})),n.d(i,"frob",(function(){return kt})),n.d(i,"add",(function(){return It})),n.d(i,"subtract",(function(){return Ot})),n.d(i,"multiplyScalar",(function(){return Ct})),n.d(i,"multiplyScalarAndAdd",(function(){return Dt})),n.d(i,"exactEquals",(function(){return Rt})),n.d(i,"equals",(function(){return Nt})),n.d(i,"mul",(function(){return Pt})),n.d(i,"sub",(function(){return jt}));var o={};n.r(o),n.d(o,"create",(function(){return Gt})),n.d(o,"clone",(function(){return Lt})),n.d(o,"length",(function(){return Bt})),n.d(o,"fromValues",(function(){return Ut})),n.d(o,"copy",(function(){return Ft})),n.d(o,"set",(function(){return zt})),n.d(o,"add",(function(){return Vt})),n.d(o,"subtract",(function(){return Wt})),n.d(o,"multiply",(function(){return Xt})),n.d(o,"divide",(function(){return qt})),n.d(o,"ceil",(function(){return Ht})),n.d(o,"floor",(function(){return Yt})),n.d(o,"min",(function(){return Kt})),n.d(o,"max",(function(){return Zt})),n.d(o,"round",(function(){return Qt})),n.d(o,"scale",(function(){return $t})),n.d(o,"scaleAndAdd",(function(){return Jt})),n.d(o,"distance",(function(){return te})),n.d(o,"squaredDistance",(function(){return ee})),n.d(o,"squaredLength",(function(){return ne})),n.d(o,"negate",(function(){return re})),n.d(o,"inverse",(function(){return ie})),n.d(o,"normalize",(function(){return oe})),n.d(o,"dot",(function(){return ae})),n.d(o,"cross",(function(){return ue})),n.d(o,"lerp",(function(){return se})),n.d(o,"hermite",(function(){return ce})),n.d(o,"bezier",(function(){return fe})),n.d(o,"random",(function(){return le})),n.d(o,"transformMat4",(function(){return he})),n.d(o,"transformMat3",(function(){return de})),n.d(o,"transformQuat",(function(){return pe})),n.d(o,"rotateX",(function(){return ve})),n.d(o,"rotateY",(function(){return me})),n.d(o,"rotateZ",(function(){return ge})),n.d(o,"angle",(function(){return ye})),n.d(o,"zero",(function(){return be})),n.d(o,"str",(function(){return xe})),n.d(o,"exactEquals",(function(){return _e})),n.d(o,"equals",(function(){return we})),n.d(o,"sub",(function(){return Se})),n.d(o,"mul",(function(){return Ae})),n.d(o,"div",(function(){return Te})),n.d(o,"dist",(function(){return Me})),n.d(o,"sqrDist",(function(){return ke})),n.d(o,"len",(function(){return Ie})),n.d(o,"sqrLen",(function(){return Oe})),n.d(o,"forEach",(function(){return Ce}));var a={};n.r(a),n.d(a,"create",(function(){return De})),n.d(a,"clone",(function(){return Re})),n.d(a,"fromValues",(function(){return Ne})),n.d(a,"copy",(function(){return Pe})),n.d(a,"set",(function(){return je})),n.d(a,"add",(function(){return Ge})),n.d(a,"subtract",(function(){return Le})),n.d(a,"multiply",(function(){return Be})),n.d(a,"divide",(function(){return Ue})),n.d(a,"ceil",(function(){return Fe})),n.d(a,"floor",(function(){return ze})),n.d(a,"min",(function(){return Ve})),n.d(a,"max",(function(){return We})),n.d(a,"round",(function(){return Xe})),n.d(a,"scale",(function(){return qe})),n.d(a,"scaleAndAdd",(function(){return He})),n.d(a,"distance",(function(){return Ye})),n.d(a,"squaredDistance",(function(){return Ke})),n.d(a,"length",(function(){return Ze})),n.d(a,"squaredLength",(function(){return Qe})),n.d(a,"negate",(function(){return $e})),n.d(a,"inverse",(function(){return Je})),n.d(a,"normalize",(function(){return tn})),n.d(a,"dot",(function(){return en})),n.d(a,"cross",(function(){return nn})),n.d(a,"lerp",(function(){return rn})),n.d(a,"random",(function(){return on})),n.d(a,"transformMat4",(function(){return an})),n.d(a,"transformQuat",(function(){return un})),n.d(a,"zero",(function(){return sn})),n.d(a,"str",(function(){return cn})),n.d(a,"exactEquals",(function(){return fn})),n.d(a,"equals",(function(){return ln})),n.d(a,"sub",(function(){return hn})),n.d(a,"mul",(function(){return dn})),n.d(a,"div",(function(){return pn})),n.d(a,"dist",(function(){return vn})),n.d(a,"sqrDist",(function(){return mn})),n.d(a,"len",(function(){return gn})),n.d(a,"sqrLen",(function(){return yn})),n.d(a,"forEach",(function(){return bn}));var u={};n.r(u),n.d(u,"create",(function(){return xn})),n.d(u,"identity",(function(){return _n})),n.d(u,"setAxisAngle",(function(){return wn})),n.d(u,"getAxisAngle",(function(){return En})),n.d(u,"getAngle",(function(){return Sn})),n.d(u,"multiply",(function(){return An})),n.d(u,"rotateX",(function(){return Tn})),n.d(u,"rotateY",(function(){return Mn})),n.d(u,"rotateZ",(function(){return kn})),n.d(u,"calculateW",(function(){return In})),n.d(u,"exp",(function(){return On})),n.d(u,"ln",(function(){return Cn})),n.d(u,"pow",(function(){return Dn})),n.d(u,"slerp",(function(){return Rn})),n.d(u,"random",(function(){return Nn})),n.d(u,"invert",(function(){return Pn})),n.d(u,"conjugate",(function(){return jn})),n.d(u,"fromMat3",(function(){return Gn})),n.d(u,"fromEuler",(function(){return Ln})),n.d(u,"str",(function(){return Bn})),n.d(u,"clone",(function(){return qn})),n.d(u,"fromValues",(function(){return Hn})),n.d(u,"copy",(function(){return Yn})),n.d(u,"set",(function(){return Kn})),n.d(u,"add",(function(){return Zn})),n.d(u,"mul",(function(){return Qn})),n.d(u,"scale",(function(){return $n})),n.d(u,"dot",(function(){return Jn})),n.d(u,"lerp",(function(){return tr})),n.d(u,"length",(function(){return er})),n.d(u,"len",(function(){return nr})),n.d(u,"squaredLength",(function(){return rr})),n.d(u,"sqrLen",(function(){return ir})),n.d(u,"normalize",(function(){return or})),n.d(u,"exactEquals",(function(){return ar})),n.d(u,"equals",(function(){return ur})),n.d(u,"rotationTo",(function(){return sr})),n.d(u,"sqlerp",(function(){return cr})),n.d(u,"setAxes",(function(){return fr}));var s={};n.r(s),n.d(s,"create",(function(){return lr})),n.d(s,"clone",(function(){return hr})),n.d(s,"fromValues",(function(){return dr})),n.d(s,"copy",(function(){return pr})),n.d(s,"set",(function(){return vr})),n.d(s,"add",(function(){return mr})),n.d(s,"subtract",(function(){return gr})),n.d(s,"multiply",(function(){return yr})),n.d(s,"divide",(function(){return br})),n.d(s,"ceil",(function(){return xr})),n.d(s,"floor",(function(){return _r})),n.d(s,"min",(function(){return wr})),n.d(s,"max",(function(){return Er})),n.d(s,"round",(function(){return Sr})),n.d(s,"scale",(function(){return Ar})),n.d(s,"scaleAndAdd",(function(){return Tr})),n.d(s,"distance",(function(){return Mr})),n.d(s,"squaredDistance",(function(){return kr})),n.d(s,"length",(function(){return Ir})),n.d(s,"squaredLength",(function(){return Or})),n.d(s,"negate",(function(){return Cr})),n.d(s,"inverse",(function(){return Dr})),n.d(s,"normalize",(function(){return Rr})),n.d(s,"dot",(function(){return Nr})),n.d(s,"cross",(function(){return Pr})),n.d(s,"lerp",(function(){return jr})),n.d(s,"random",(function(){return Gr})),n.d(s,"transformMat2",(function(){return Lr})),n.d(s,"transformMat2d",(function(){return Br})),n.d(s,"transformMat3",(function(){return Ur})),n.d(s,"transformMat4",(function(){return Fr})),n.d(s,"rotate",(function(){return zr})),n.d(s,"angle",(function(){return Vr})),n.d(s,"zero",(function(){return Wr})),n.d(s,"str",(function(){return Xr})),n.d(s,"exactEquals",(function(){return qr})),n.d(s,"equals",(function(){return Hr})),n.d(s,"len",(function(){return Yr})),n.d(s,"sub",(function(){return Kr})),n.d(s,"mul",(function(){return Zr})),n.d(s,"div",(function(){return Qr})),n.d(s,"dist",(function(){return $r})),n.d(s,"sqrDist",(function(){return Jr})),n.d(s,"sqrLen",(function(){return ti})),n.d(s,"forEach",(function(){return ei}));var c=1e-6,f="undefined"!=typeof Float32Array?Float32Array:Array,l=Math.random;Math.PI;function h(){var t=new f(9);return f!=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 d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function p(t){var e=new f(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function v(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function m(t,e,n,r,i,o,a,u,s){var c=new f(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=u,c[8]=s,c}function g(t,e,n,r,i,o,a,u,s,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t[8]=c,t}function y(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 b(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function x(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=f*a-u*c,h=-f*o+u*s,d=c*o-a*s,p=n*l+r*h+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-f*r+i*c)*p,t[2]=(u*r-i*a)*p,t[3]=h*p,t[4]=(f*n-i*s)*p,t[5]=(-u*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*s)*p,t[8]=(a*n-r*o)*p,t):null}function _(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8];return t[0]=a*f-u*c,t[1]=i*c-r*f,t[2]=r*u-i*a,t[3]=u*s-o*f,t[4]=n*f-i*s,t[5]=i*o-n*u,t[6]=o*c-a*s,t[7]=r*s-n*c,t[8]=n*a-r*o,t}function w(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],c=t[8];return e*(c*o-a*s)+n*(-c*i+a*u)+r*(s*i-o*u)}function E(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1],p=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*u+p*f,t[2]=h*o+d*s+p*l,t[3]=v*r+m*a+g*c,t[4]=v*i+m*u+g*f,t[5]=v*o+m*s+g*l,t[6]=y*r+b*a+x*c,t[7]=y*i+b*u+x*f,t[8]=y*o+b*s+x*l,t}function S(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=h*r+d*a+c,t[7]=h*i+d*u+f,t[8]=h*o+d*s+l,t}function A(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*u,t[2]=d*o+h*s,t[3]=d*a-h*r,t[4]=d*u-h*i,t[5]=d*s-h*o,t[6]=c,t[7]=f,t[8]=l,t}function T(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function M(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function k(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function I(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function C(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,m=o*u,g=o*s;return t[0]=1-l-p,t[3]=f-g,t[6]=h+m,t[1]=f+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-m,t[5]=d+v,t[8]=1-c-l,t}function D(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=n*u-r*a,b=n*s-i*a,x=n*c-o*a,_=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*m-h*p,T=f*g-d*p,M=l*m-h*v,k=l*g-d*v,I=h*g-d*m,O=y*I-b*k+x*M+_*T-w*A+E*S;return O?(O=1/O,t[0]=(u*I-s*k+c*M)*O,t[1]=(s*T-a*I-c*A)*O,t[2]=(a*k-u*T+c*S)*O,t[3]=(i*k-r*I-o*M)*O,t[4]=(n*I-i*T+o*A)*O,t[5]=(r*T-n*k-o*S)*O,t[6]=(v*E-m*w+g*_)*O,t[7]=(m*x-p*E-g*b)*O,t[8]=(p*w-v*x+g*y)*O,t):null}function R(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function N(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function P(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function j(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function G(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function L(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function B(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function F(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],v=e[3],m=e[4],g=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=c*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-d)<=c*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-p)<=c*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-v)<=c*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(a-m)<=c*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(u-g)<=c*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(s-y)<=c*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(f-b)<=c*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(l-x)<=c*Math.max(1,Math.abs(l),Math.abs(x))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var z=E,V=G;function W(){var t=new f(16);return f!=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 X(t){var e=new f(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function q(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function H(t,e,n,r,i,o,a,u,s,c,l,h,d,p,v,m){var g=new f(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=u,g[8]=s,g[9]=c,g[10]=l,g[11]=h,g[12]=d,g[13]=p,g[14]=v,g[15]=m,g}function Y(t,e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t[8]=c,t[9]=f,t[10]=l,t[11]=h,t[12]=d,t[13]=p,t[14]=v,t[15]=m,t}function K(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 Z(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Q(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=n*u-r*a,b=n*s-i*a,x=n*c-o*a,_=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*m-h*p,T=f*g-d*p,M=l*m-h*v,k=l*g-d*v,I=h*g-d*m,O=y*I-b*k+x*M+_*T-w*A+E*S;return O?(O=1/O,t[0]=(u*I-s*k+c*M)*O,t[1]=(i*k-r*I-o*M)*O,t[2]=(v*E-m*w+g*_)*O,t[3]=(h*w-l*E-d*_)*O,t[4]=(s*T-a*I-c*A)*O,t[5]=(n*I-i*T+o*A)*O,t[6]=(m*x-p*E-g*b)*O,t[7]=(f*E-h*x+d*b)*O,t[8]=(a*k-u*T+c*S)*O,t[9]=(r*T-n*k-o*S)*O,t[10]=(p*w-v*x+g*y)*O,t[11]=(l*x-f*w-d*y)*O,t[12]=(u*A-a*M-s*S)*O,t[13]=(n*M-r*A+i*S)*O,t[14]=(v*b-p*_-m*y)*O,t[15]=(f*_-l*b+h*y)*O,t):null}function $(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return t[0]=u*(h*g-d*m)-l*(s*g-c*m)+v*(s*d-c*h),t[1]=-(r*(h*g-d*m)-l*(i*g-o*m)+v*(i*d-o*h)),t[2]=r*(s*g-c*m)-u*(i*g-o*m)+v*(i*c-o*s),t[3]=-(r*(s*d-c*h)-u*(i*d-o*h)+l*(i*c-o*s)),t[4]=-(a*(h*g-d*m)-f*(s*g-c*m)+p*(s*d-c*h)),t[5]=n*(h*g-d*m)-f*(i*g-o*m)+p*(i*d-o*h),t[6]=-(n*(s*g-c*m)-a*(i*g-o*m)+p*(i*c-o*s)),t[7]=n*(s*d-c*h)-a*(i*d-o*h)+f*(i*c-o*s),t[8]=a*(l*g-d*v)-f*(u*g-c*v)+p*(u*d-c*l),t[9]=-(n*(l*g-d*v)-f*(r*g-o*v)+p*(r*d-o*l)),t[10]=n*(u*g-c*v)-a*(r*g-o*v)+p*(r*c-o*u),t[11]=-(n*(u*d-c*l)-a*(r*d-o*l)+f*(r*c-o*u)),t[12]=-(a*(l*m-h*v)-f*(u*m-s*v)+p*(u*h-s*l)),t[13]=n*(l*m-h*v)-f*(r*m-i*v)+p*(r*h-i*l),t[14]=-(n*(u*m-s*v)-a*(r*m-i*v)+p*(r*s-i*u)),t[15]=n*(u*h-s*l)-a*(r*h-i*l)+f*(r*s-i*u),t}function J(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],c=t[8],f=t[9],l=t[10],h=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*a-n*o)*(l*m-h*v)-(e*u-r*o)*(f*m-h*p)+(e*s-i*o)*(f*v-l*p)+(n*u-r*a)*(c*m-h*d)-(n*s-i*a)*(c*v-l*d)+(r*s-i*u)*(c*p-f*d)}function tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],y=e[15],b=n[0],x=n[1],_=n[2],w=n[3];return t[0]=b*r+x*u+_*l+w*v,t[1]=b*i+x*s+_*h+w*m,t[2]=b*o+x*c+_*d+w*g,t[3]=b*a+x*f+_*p+w*y,b=n[4],x=n[5],_=n[6],w=n[7],t[4]=b*r+x*u+_*l+w*v,t[5]=b*i+x*s+_*h+w*m,t[6]=b*o+x*c+_*d+w*g,t[7]=b*a+x*f+_*p+w*y,b=n[8],x=n[9],_=n[10],w=n[11],t[8]=b*r+x*u+_*l+w*v,t[9]=b*i+x*s+_*h+w*m,t[10]=b*o+x*c+_*d+w*g,t[11]=b*a+x*f+_*p+w*y,b=n[12],x=n[13],_=n[14],w=n[15],t[12]=b*r+x*u+_*l+w*v,t[13]=b*i+x*s+_*h+w*m,t[14]=b*o+x*c+_*d+w*g,t[15]=b*a+x*f+_*p+w*y,t}function et(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v=n[0],m=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*g+e[12],t[13]=e[1]*v+e[5]*m+e[9]*g+e[13],t[14]=e[2]*v+e[6]*m+e[10]*g+e[14],t[15]=e[3]*v+e[7]*m+e[11]*g+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+u*m+l*g+e[12],t[13]=i*v+s*m+h*g+e[13],t[14]=o*v+c*m+d*g+e[14],t[15]=a*v+f*m+p*g+e[15]),t}function nt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function rt(t,e,n,r){var i,o,a,u,s,f,l,h,d,p,v,m,g,y,b,x,_,w,E,S,A,T,M,k,I=r[0],O=r[1],C=r[2],D=Math.hypot(I,O,C);return D<c?null:(I*=D=1/D,O*=D,C*=D,i=Math.sin(n),a=1-(o=Math.cos(n)),u=e[0],s=e[1],f=e[2],l=e[3],h=e[4],d=e[5],p=e[6],v=e[7],m=e[8],g=e[9],y=e[10],b=e[11],x=I*I*a+o,_=O*I*a+C*i,w=C*I*a-O*i,E=I*O*a-C*i,S=O*O*a+o,A=C*O*a+I*i,T=I*C*a+O*i,M=O*C*a-I*i,k=C*C*a+o,t[0]=u*x+h*_+m*w,t[1]=s*x+d*_+g*w,t[2]=f*x+p*_+y*w,t[3]=l*x+v*_+b*w,t[4]=u*E+h*S+m*A,t[5]=s*E+d*S+g*A,t[6]=f*E+p*S+y*A,t[7]=l*E+v*S+b*A,t[8]=u*T+h*M+m*k,t[9]=s*T+d*M+g*k,t[10]=f*T+p*M+y*k,t[11]=l*T+v*M+b*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function it(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=u*i+l*r,t[7]=s*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=h*i-s*r,t}function ot(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[8],f=e[9],l=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-f*r,t[2]=u*i-l*r,t[3]=s*i-h*r,t[8]=o*r+c*i,t[9]=a*r+f*i,t[10]=u*r+l*i,t[11]=s*r+h*i,t}function at(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[4],f=e[5],l=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+f*r,t[2]=u*i+l*r,t[3]=s*i+h*r,t[4]=c*i-o*r,t[5]=f*i-a*r,t[6]=l*i-u*r,t[7]=h*i-s*r,t}function ut(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function st(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ct(t,e,n){var r,i,o,a=n[0],u=n[1],s=n[2],f=Math.hypot(a,u,s);return f<c?null:(a*=f=1/f,u*=f,s*=f,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=u*a*o+s*r,t[2]=s*a*o-u*r,t[3]=0,t[4]=a*u*o-s*r,t[5]=u*u*o+i,t[6]=s*u*o+a*r,t[7]=0,t[8]=a*s*o+u*r,t[9]=u*s*o-a*r,t[10]=s*s*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ft(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function lt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ht(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,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 dt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=r+r,s=i+i,c=o+o,f=r*u,l=r*s,h=r*c,d=i*s,p=i*c,v=o*c,m=a*u,g=a*s,y=a*c;return t[0]=1-(d+v),t[1]=l+y,t[2]=h-g,t[3]=0,t[4]=l-y,t[5]=1-(f+v),t[6]=p+m,t[7]=0,t[8]=h+g,t[9]=p-m,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function pt(t,e){var n=new f(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],u=e[4],s=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(u*a+l*r+s*o-c*i)/h,n[1]=2*(s*a+l*i+c*r-u*o)/h,n[2]=2*(c*a+l*o+u*i-s*r)/h):(n[0]=2*(u*a+l*r+s*o-c*i),n[1]=2*(s*a+l*i+c*r-u*o),n[2]=2*(c*a+l*o+u*i-s*r)),dt(t,e,n),t}function vt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function mt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],u=e[6],s=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(s,c,f),t}function gt(t,e){var n=new f(3);mt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,s=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,d=e[8]*r,p=e[9]*i,v=e[10]*o,m=a+l+v,g=0;return m>0?(g=2*Math.sqrt(m+1),t[3]=.25*g,t[0]=(h-p)/g,t[1]=(d-s)/g,t[2]=(u-c)/g):a>l&&a>v?(g=2*Math.sqrt(1+a-l-v),t[3]=(h-p)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(d+s)/g):l>v?(g=2*Math.sqrt(1+l-a-v),t[3]=(d-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(h+p)/g):(g=2*Math.sqrt(1+v-a-l),t[3]=(u-c)/g,t[0]=(d+s)/g,t[1]=(h+p)/g,t[2]=.25*g),t}function yt(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3],s=i+i,c=o+o,f=a+a,l=i*s,h=i*c,d=i*f,p=o*c,v=o*f,m=a*f,g=u*s,y=u*c,b=u*f,x=r[0],_=r[1],w=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*_,t[5]=(1-(l+m))*_,t[6]=(v+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(v-g)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function bt(t,e,n,r,i){var o=e[0],a=e[1],u=e[2],s=e[3],c=o+o,f=a+a,l=u+u,h=o*c,d=o*f,p=o*l,v=a*f,m=a*l,g=u*l,y=s*c,b=s*f,x=s*l,_=r[0],w=r[1],E=r[2],S=i[0],A=i[1],T=i[2],M=(1-(v+g))*_,k=(d+x)*_,I=(p-b)*_,O=(d-x)*w,C=(1-(h+g))*w,D=(m+y)*w,R=(p+b)*E,N=(m-y)*E,P=(1-(h+v))*E;return t[0]=M,t[1]=k,t[2]=I,t[3]=0,t[4]=O,t[5]=C,t[6]=D,t[7]=0,t[8]=R,t[9]=N,t[10]=P,t[11]=0,t[12]=n[0]+S-(M*S+O*A+R*T),t[13]=n[1]+A-(k*S+C*A+N*T),t[14]=n[2]+T-(I*S+D*A+P*T),t[15]=1,t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,m=o*u,g=o*s;return t[0]=1-l-p,t[1]=f+g,t[2]=h-m,t[3]=0,t[4]=f-g,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+m,t[9]=d-v,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _t(t,e,n,r,i,o,a){var u=1/(n-e),s=1/(i-r),c=1/(o-a);return t[0]=2*o*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*s,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(i+r)*s,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function wt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function Et(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),s=2/(a+u),c=2/(i+o);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-u)*s*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function St(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1,t}function At(t,e,n,r){var i,o,a,u,s,f,l,h,d,p,v=e[0],m=e[1],g=e[2],y=r[0],b=r[1],x=r[2],_=n[0],w=n[1],E=n[2];return Math.abs(v-_)<c&&Math.abs(m-w)<c&&Math.abs(g-E)<c?K(t):(l=v-_,h=m-w,d=g-E,i=b*(d*=p=1/Math.hypot(l,h,d))-x*(h*=p),o=x*(l*=p)-y*d,a=y*h-b*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),u=h*a-d*o,s=d*i-l*a,f=l*o-h*i,(p=Math.hypot(u,s,f))?(u*=p=1/p,s*=p,f*=p):(u=0,s=0,f=0),t[0]=i,t[1]=u,t[2]=l,t[3]=0,t[4]=o,t[5]=s,t[6]=h,t[7]=0,t[8]=a,t[9]=f,t[10]=d,t[11]=0,t[12]=-(i*v+o*m+a*g),t[13]=-(u*v+s*m+f*g),t[14]=-(l*v+h*m+d*g),t[15]=1,t)}function Tt(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=r[0],s=r[1],c=r[2],f=i-n[0],l=o-n[1],h=a-n[2],d=f*f+l*l+h*h;d>0&&(f*=d=1/Math.sqrt(d),l*=d,h*=d);var p=s*h-c*l,v=c*f-u*h,m=u*l-s*f;return(d=p*p+v*v+m*m)>0&&(p*=d=1/Math.sqrt(d),v*=d,m*=d),t[0]=p,t[1]=v,t[2]=m,t[3]=0,t[4]=l*m-h*v,t[5]=h*p-f*m,t[6]=f*v-l*p,t[7]=0,t[8]=f,t[9]=l,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Mt(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 kt(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 It(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Ot(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Ct(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Dt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function Rt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Nt(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],f=t[7],l=t[8],h=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],E=e[4],S=e[5],A=e[6],T=e[7],M=e[8],k=e[9],I=e[10],O=e[11],C=e[12],D=e[13],R=e[14],N=e[15];return Math.abs(n-b)<=c*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=c*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-_)<=c*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(o-w)<=c*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-E)<=c*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(u-S)<=c*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(s-A)<=c*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(f-T)<=c*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(l-M)<=c*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(h-k)<=c*Math.max(1,Math.abs(h),Math.abs(k))&&Math.abs(d-I)<=c*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-O)<=c*Math.max(1,Math.abs(p),Math.abs(O))&&Math.abs(v-C)<=c*Math.max(1,Math.abs(v),Math.abs(C))&&Math.abs(m-D)<=c*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-R)<=c*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(y-N)<=c*Math.max(1,Math.abs(y),Math.abs(N))}var Pt=tt,jt=Ot;function Gt(){var t=new f(3);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Lt(t){var e=new f(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Bt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Ut(t,e,n){var r=new f(3);return r[0]=t,r[1]=e,r[2]=n,r}function Ft(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Vt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Wt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Xt(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function qt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Ht(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Yt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Kt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function Zt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function Qt(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function $t(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Jt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function te(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function ee(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function ne(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function re(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function ie(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function oe(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ae(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ue(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2];return t[0]=i*s-o*u,t[1]=o*a-r*s,t[2]=r*u-i*a,t}function se(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function ce(t,e,n,r,i,o){var a=o*o,u=a*(2*o-3)+1,s=a*(o-2)+o,c=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*u+n[0]*s+r[0]*c+i[0]*f,t[1]=e[1]*u+n[1]*s+r[1]*c+i[1]*f,t[2]=e[2]*u+n[2]*s+r[2]*c+i[2]*f,t}function fe(t,e,n,r,i,o){var a=1-o,u=a*a,s=o*o,c=u*a,f=3*o*u,l=3*s*a,h=s*o;return t[0]=e[0]*c+n[0]*f+r[0]*l+i[0]*h,t[1]=e[1]*c+n[1]*f+r[1]*l+i[1]*h,t[2]=e[2]*c+n[2]*f+r[2]*l+i[2]*h,t}function le(t,e){e=e||1;var n=2*l()*Math.PI,r=2*l()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function he(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function de(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function pe(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=i*c-o*s,l=o*u-r*c,h=r*s-i*u,d=i*h-o*l,p=o*f-r*h,v=r*l-i*f,m=2*a;return f*=m,l*=m,h*=m,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=s+l+p,t[2]=c+h+v,t}function ve(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function me(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function ge(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function ye(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],u=e[2],s=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+u*u),c=s&&ae(t,e)/s;return Math.acos(Math.min(Math.max(c,-1),1))}function be(t){return t[0]=0,t[1]=0,t[2]=0,t}function xe(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function _e(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function we(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],u=e[2];return Math.abs(n-o)<=c*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=c*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=c*Math.max(1,Math.abs(i),Math.abs(u))}var Ee,Se=Wt,Ae=Xt,Te=qt,Me=te,ke=ee,Ie=Bt,Oe=ne,Ce=(Ee=Gt(),function(t,e,n,r,i,o){var a,u;for(e||(e=3),n||(n=0),u=r?Math.min(r*e+n,t.length):t.length,a=n;a<u;a+=e)Ee[0]=t[a],Ee[1]=t[a+1],Ee[2]=t[a+2],i(Ee,Ee,o),t[a]=Ee[0],t[a+1]=Ee[1],t[a+2]=Ee[2];return t});function De(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Re(t){var e=new f(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Ne(t,e,n,r){var i=new f(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function Pe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function je(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Ge(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function Le(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function Be(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function Ue(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Fe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ze(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function Ve(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function We(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function Xe(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function qe(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function He(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function Ye(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Ke(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function Ze(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Qe(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function $e(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Je(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function tn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function en(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function nn(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],u=n[1]*r[2]-n[2]*r[1],s=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],f=e[0],l=e[1],h=e[2],d=e[3];return t[0]=l*c-h*s+d*u,t[1]=-f*c+h*a-d*o,t[2]=f*s-l*a+d*i,t[3]=-f*u+l*o-h*i,t}function rn(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=u+r*(n[3]-u),t}function on(t,e){var n,r,i,o,a,u;e=e||1;do{a=(n=2*l()-1)*n+(r=2*l()-1)*r}while(a>=1);do{u=(i=2*l()-1)*i+(o=2*l()-1)*o}while(u>=1);var s=Math.sqrt((1-a)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*i*s,t[3]=e*o*s,t}function an(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function un(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2],c=n[3],f=c*r+u*o-s*i,l=c*i+s*r-a*o,h=c*o+a*i-u*r,d=-a*r-u*i-s*o;return t[0]=f*c+d*-a+l*-s-h*-u,t[1]=l*c+d*-u+h*-a-f*-s,t[2]=h*c+d*-s+f*-u-l*-a,t[3]=e[3],t}function sn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function cn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function fn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function ln(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],u=e[1],s=e[2],f=e[3];return Math.abs(n-a)<=c*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-u)<=c*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-s)<=c*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-f)<=c*Math.max(1,Math.abs(o),Math.abs(f))}var hn=Le,dn=Be,pn=Ue,vn=Ye,mn=Ke,gn=Ze,yn=Qe,bn=function(){var t=De();return function(e,n,r,i,o,a){var u,s;for(n||(n=4),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,u=r;u<s;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],t[3]=e[u+3],o(t,t,a),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2],e[u+3]=t[3];return e}}();function xn(){var t=new f(4);return f!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function _n(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function wn(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function En(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>c?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Sn(t,e){var n=Jn(t,e);return Math.acos(2*n*n-1)}function An(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1],c=n[2],f=n[3];return t[0]=r*f+a*u+i*c-o*s,t[1]=i*f+a*s+o*u-r*c,t[2]=o*f+a*c+r*s-i*u,t[3]=a*f-r*u-i*s-o*c,t}function Tn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+a*u,t[1]=i*s+o*u,t[2]=o*s-i*u,t[3]=a*s-r*u,t}function Mn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s-o*u,t[1]=i*s+a*u,t[2]=o*s+r*u,t[3]=a*s-i*u,t}function kn(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+i*u,t[1]=i*s-r*u,t[2]=o*s+a*u,t[3]=a*s-o*u,t}function In(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function On(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),u=Math.exp(o),s=a>0?u*Math.sin(a)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=u*Math.cos(a),t}function Cn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),u=a>0?Math.atan2(a,o)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Dn(t,e,n){return Cn(t,e),$n(t,t,n),On(t,t),t}function Rn(t,e,n,r){var i,o,a,u,s,f=e[0],l=e[1],h=e[2],d=e[3],p=n[0],v=n[1],m=n[2],g=n[3];return(o=f*p+l*v+h*m+d*g)<0&&(o=-o,p=-p,v=-v,m=-m,g=-g),1-o>c?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(u=1-r,s=r),t[0]=u*f+s*p,t[1]=u*l+s*v,t[2]=u*h+s*m,t[3]=u*d+s*g,t}function Nn(t){var e=l(),n=l(),r=l(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function Pn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function jn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Gn(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function Ln(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*s*f-a*u*c,t[1]=a*u*f+o*s*c,t[2]=a*s*c-o*u*f,t[3]=a*s*f+o*u*c,t}function Bn(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Un,Fn,zn,Vn,Wn,Xn,qn=Re,Hn=Ne,Yn=Pe,Kn=je,Zn=Ge,Qn=An,$n=qe,Jn=en,tr=rn,er=Ze,nr=er,rr=Qe,ir=rr,or=tn,ar=fn,ur=ln,sr=(Un=Gt(),Fn=Ut(1,0,0),zn=Ut(0,1,0),function(t,e,n){var r=ae(e,n);return r<-.999999?(ue(Un,Fn,e),Ie(Un)<1e-6&&ue(Un,zn,e),oe(Un,Un),wn(t,Un,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(ue(Un,e,n),t[0]=Un[0],t[1]=Un[1],t[2]=Un[2],t[3]=1+r,or(t,t))}),cr=(Vn=xn(),Wn=xn(),function(t,e,n,r,i,o){return Rn(Vn,e,i,o),Rn(Wn,n,r,o),Rn(t,Vn,Wn,2*o*(1-o)),t}),fr=(Xn=h(),function(t,e,n,r){return Xn[0]=n[0],Xn[3]=n[1],Xn[6]=n[2],Xn[1]=r[0],Xn[4]=r[1],Xn[7]=r[2],Xn[2]=-e[0],Xn[5]=-e[1],Xn[8]=-e[2],or(t,Gn(t,Xn))});function lr(){var t=new f(2);return f!=Float32Array&&(t[0]=0,t[1]=0),t}function hr(t){var e=new f(2);return e[0]=t[0],e[1]=t[1],e}function dr(t,e){var n=new f(2);return n[0]=t,n[1]=e,n}function pr(t,e){return t[0]=e[0],t[1]=e[1],t}function vr(t,e,n){return t[0]=e,t[1]=n,t}function mr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function gr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function yr(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function br(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function xr(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function _r(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function wr(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function Er(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function Sr(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function Ar(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function Tr(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function Mr(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function kr(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ir(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function Or(t){var e=t[0],n=t[1];return e*e+n*n}function Cr(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Dr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Rr(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Nr(t,e){return t[0]*e[0]+t[1]*e[1]}function Pr(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function jr(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function Gr(t,e){e=e||1;var n=2*l()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function Lr(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function Br(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function Ur(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function Fr(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function zr(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),u=Math.cos(r);return t[0]=i*u-o*a+n[0],t[1]=i*a+o*u+n[1],t}function Vr(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),u=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function Wr(t){return t[0]=0,t[1]=0,t}function Xr(t){return"vec2("+t[0]+", "+t[1]+")"}function qr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Hr(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=c*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=c*Math.max(1,Math.abs(r),Math.abs(o))}var Yr=Ir,Kr=gr,Zr=yr,Qr=br,$r=Mr,Jr=kr,ti=Or,ei=function(){var t=lr();return function(e,n,r,i,o,a){var u,s;for(n||(n=2),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,u=r;u<s;u+=n)t[0]=e[u],t[1]=e[u+1],o(t,t,a),e[u]=t[0],e[u+1]=t[1];return e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"n",(function(){return b})),n.d(e,"d",(function(){return s})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return g})),n.d(e,"i",(function(){return f})),n.d(e,"j",(function(){return v})),n.d(e,"b",(function(){return E})),n.d(e,"c",(function(){return l})),n.d(e,"e",(function(){return S})),n.d(e,"k",(function(){return _})),n.d(e,"m",(function(){return T})),n.d(e,"l",(function(){return M}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i={}.toString,o=function(t,e){return i.call(t)==="[object "+e+"]"},a=function(t){return o(t,"Function")},u=function(t){return null==t},s=function(t){return Array.isArray?Array.isArray(t):o(t,"Array")};function c(t){return(c="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)}var f=function(t){var e=c(t);return null!==t&&"object"===e||"function"===e};var l=function(t,e){if(t)if(s(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(f(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;function h(t){return(h="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)}var d=function(t){return"object"===h(t)&&null!==t};var p=Array.prototype,v=(p.splice,p.indexOf,Array.prototype.splice,function(t){return o(t,"String")});Object.prototype.hasOwnProperty;var m=function(t,e,n){return t<e?e:t>n?n:t},g=function(t){return o(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI,Object.values;var y=function(t){return u(t)?"":t.toString()};var b=function(t){var e=y(t);return e.charAt(0).toUpperCase()+e.substring(1)};Object.prototype;function x(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function _(t,e,n,r){return e&&x(t,e),n&&x(t,n),r&&x(t,r),t}function w(t){return(w="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)}var E=function t(e){if("object"!==w(e)||null===e)return e;var n;if(s(e)){n=[];for(var r=0,i=e.length;r<i;r++)"object"===w(e[r])&&null!=e[r]?n[r]=t(e[r]):n[r]=e[r]}else for(var o in n={},e)"object"===w(e[o])&&null!=e[o]?n[o]=t(e[o]):n[o]=e[o];return n};Object.prototype.hasOwnProperty;var S=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(v(e)||v(n))return!1;if(r(e)||r(n)){if(e.length!==n.length)return!1;for(var i=!0,o=0;o<e.length&&(i=t(e[o],n[o]));o++);return i}if(d(e)||d(n)){var a=Object.keys(e),u=Object.keys(n);if(a.length!==u.length)return!1;for(i=!0,o=0;o<a.length&&(i=t(e[a[o]],n[a[o]]));o++);return i}return!1},A=(Object.prototype.hasOwnProperty,{}),T=function(t){return A[t=t||"g"]?A[t]+=1:A[t]=1,t+A[t]},M=function(){};!function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},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}}()},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20);e.METADATA_KEY=r;var i=n(416);e.Container=i.Container;var o=n(38);e.BindingScopeEnum=o.BindingScopeEnum,e.BindingTypeEnum=o.BindingTypeEnum,e.TargetTypeEnum=o.TargetTypeEnum;var a=n(432);e.AsyncContainerModule=a.AsyncContainerModule,e.ContainerModule=a.ContainerModule;var u=n(433);e.injectable=u.injectable;var s=n(434);e.tagged=s.tagged;var c=n(435);e.named=c.named;var f=n(194);e.inject=f.inject,e.LazyServiceIdentifer=f.LazyServiceIdentifer;var l=n(436);e.optional=l.optional;var h=n(437);e.unmanaged=h.unmanaged;var d=n(438);e.multiInject=d.multiInject;var p=n(439);e.targetName=p.targetName;var v=n(440);e.postConstruct=v.postConstruct;var m=n(192);e.MetadataReader=m.MetadataReader;var g=n(48);e.id=g.id;var y=n(41);e.decorate=y.decorate;var b=n(197);e.traverseAncerstors=b.traverseAncerstors,e.taggedConstraint=b.taggedConstraint,e.namedConstraint=b.namedConstraint,e.typeConstraint=b.typeConstraint;var x=n(59);e.getServiceIdentifierAsString=x.getServiceIdentifierAsString;var _=n(441);e.multiBindToService=_.multiBindToService},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.TextureCompressionBC="texture-compression-bc"}(e.ExtensionName||(e.ExtensionName={})),function(t){t.ClampToEdge="clamp-to-edge",t.Repeat="repeat",t.MirrorRepeat="mirror-repeat"}(e.AddressMode||(e.AddressMode={})),function(t){t.UniformBuffer="uniform-buffer",t.StorageBuffer="storage-buffer",t.ReadonlyStorageBuffer="readonly-storage-buffer",t.Sampler="sampler",t.ComparisonSampler="comparison-sampler",t.SampledTexture="sampled-texture",t.ReadonlyStorageTexture="readonly-storage-texture",t.WriteonlyStorageTexture="writeonly-storage-texture"}(e.BindingType||(e.BindingType={})),function(t){t.Zero="zero",t.One="one",t.SrcColor="src-color",t.OneMinusSrcColor="one-minus-src-color",t.SrcAlpha="src-alpha",t.OneMinusSrcAlpha="one-minus-src-alpha",t.DstColor="dst-color",t.OneMinusDstColor="one-minus-dst-color",t.DstAlpha="dst-alpha",t.OneMinusDstAlpha="one-minus-dst-alpha",t.SrcAlphaSaturated="src-alpha-saturated",t.BlendColor="blend-color",t.OneMinusBlendColor="one-minus-blend-color"}(e.BlendFactor||(e.BlendFactor={})),function(t){t.Add="add",t.Subtract="subtract",t.ReverseSubtract="reverse-subtract",t.Min="min",t.Max="max"}(e.BlendOperation||(e.BlendOperation={})),function(t){t.Never="never",t.Less="less",t.Equal="equal",t.LessEqual="less-equal",t.Greater="greater",t.NotEqual="not-equal",t.GreaterEqual="greater-equal",t.Always="always"}(e.CompareFunction||(e.CompareFunction={})),function(t){t.None="none",t.Front="front",t.Back="back"}(e.CullMode||(e.CullMode={})),function(t){t.Nearest="nearest",t.Linear="linear"}(e.FilterMode||(e.FilterMode={})),function(t){t.CCW="ccw",t.CW="cw"}(e.FrontFace||(e.FrontFace={})),function(t){t.Uint16="uint16",t.Uint32="uint32"}(e.IndexFormat||(e.IndexFormat={})),function(t){t.Vertex="vertex",t.Instance="instance"}(e.InputStepMode||(e.InputStepMode={})),function(t){t.Load="load"}(e.LoadOp||(e.LoadOp={})),function(t){t.PointList="point-list",t.LineList="line-list",t.LineStrip="line-strip",t.TriangleList="triangle-list",t.TriangleStrip="triangle-strip"}(e.PrimitiveTopology||(e.PrimitiveTopology={})),function(t){t.Keep="keep",t.Zero="zero",t.Replace="replace",t.Invert="invert",t.IncrementClamp="increment-clamp",t.DecrementClamp="decrement-clamp",t.IncrementWrap="increment-wrap",t.DecrementWrap="decrement-wrap"}(e.StencilOperation||(e.StencilOperation={})),function(t){t.Store="store",t.Clear="clear"}(e.StoreOp||(e.StoreOp={})),function(t){t.E1d="1d",t.E2d="2d",t.E3d="3d"}(e.TextureDimension||(e.TextureDimension={})),function(t){t.R8Unorm="r8unorm",t.R8Snorm="r8snorm",t.R8Uint="r8uint",t.R8Sint="r8sint",t.R16Uint="r16uint",t.R16Sint="r16sint",t.R16Float="r16float",t.RG8Unorm="rg8unorm",t.RG8Snorm="rg8snorm",t.RG8Uint="rg8uint",t.RG8Sint="rg8sint",t.R32Uint="r32uint",t.R32Sint="r32sint",t.R32Float="r32float",t.RG16Uint="rg16uint",t.RG16Sint="rg16sint",t.RG16Float="rg16float",t.RGBA8Unorm="rgba8unorm",t.RGBA8UnormSRGB="rgba8unorm-srgb",t.RGBA8Snorm="rgba8snorm",t.RGBA8Uint="rgba8uint",t.RGBA8Sint="rgba8sint",t.BGRA8Unorm="bgra8unorm",t.BGRA8UnormSRGB="bgra8unorm-srgb",t.RGB10A2Unorm="rgb10a2unorm",t.RG11B10Float="rg11b10float",t.RG32Uint="rg32uint",t.RG32Sint="rg32sint",t.RG32Float="rg32float",t.RGBA16Uint="rgba16uint",t.RGBA16Sint="rgba16sint",t.RGBA16Float="rgba16float",t.RGBA32Uint="rgba32uint",t.RGBA32Sint="rgba32sint",t.RGBA32Float="rgba32float",t.Depth32Float="depth32float",t.Depth24Plus="depth24plus",t.Depth24PlusStencil8="depth24plus-stencil8"}(e.TextureFormat||(e.TextureFormat={})),function(t){t.Float="float",t.Sint="sint",t.Uint="uint"}(e.TextureComponentType||(e.TextureComponentType={})),function(t){t.E1d="1d",t.E2d="2d",t.E2dArray="2d-array",t.Cube="cube",t.CubeArray="cube-array",t.E3d="3d"}(e.TextureViewDimension||(e.TextureViewDimension={})),function(t){t.Uchar2="uchar2",t.Uchar4="uchar4",t.Char2="char2",t.Char4="char4",t.Uchar2Norm="uchar2norm",t.Uchar4Norm="uchar4norm",t.Char2Norm="char2norm",t.Char4Norm="char4norm",t.Ushort2="ushort2",t.Ushort4="ushort4",t.Short2="short2",t.Short4="short4",t.Ushort2Norm="ushort2norm",t.Ushort4Norm="ushort4norm",t.Short2Norm="short2norm",t.Short4Norm="short4norm",t.Half2="half2",t.Half4="half4",t.Float="float",t.Float2="float2",t.Float3="float3",t.Float4="float4",t.Uint="uint",t.Uint2="uint2",t.Uint3="uint3",t.Uint4="uint4",t.Int="int",t.Int2="int2",t.Int3="int3",t.Int4="int4"}(e.VertexFormat||(e.VertexFormat={})),function(t){t.All="all",t.StencilOnly="stencil-only",t.DepthOnly="depth-only"}(e.TextureAspect||(e.TextureAspect={})),function(t){t.Error="error",t.Warning="warning",t.Info="info"}(e.CompilationMessageType||(e.CompilationMessageType={})),function(t){t.Occlusion="occlusion"}(e.QueryType||(e.QueryType={})),function(t){t[t.MapRead=1]="MapRead",t[t.MapWrite=2]="MapWrite",t[t.CopySrc=4]="CopySrc",t[t.CopyDst=8]="CopyDst",t[t.Index=16]="Index",t[t.Vertex=32]="Vertex",t[t.Uniform=64]="Uniform",t[t.Storage=128]="Storage",t[t.Indirect=256]="Indirect",t[t.QueryResolve=512]="QueryResolve"}(e.BufferUsage||(e.BufferUsage={})),function(t){t[t.Red=1]="Red",t[t.Green=2]="Green",t[t.Blue=4]="Blue",t[t.Alpha=8]="Alpha",t[t.All=15]="All"}(e.ColorWrite||(e.ColorWrite={})),function(t){t[t.Vertex=1]="Vertex",t[t.Fragment=2]="Fragment",t[t.Compute=4]="Compute"}(e.ShaderStage||(e.ShaderStage={})),function(t){t[t.CopySrc=1]="CopySrc",t[t.CopyDst=2]="CopyDst",t[t.Sampled=4]="Sampled",t[t.Storage=8]="Storage",t[t.OutputAttachment=16]="OutputAttachment"}(e.TextureUsage||(e.TextureUsage={})),function(t){t[t.Read=1]="Read",t[t.Write=2]="Write"}(e.MapMode||(e.MapMode={}))},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){t.exports=n(412)},function(t,e){t.exports=function(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}},function(t,e){t.exports=function(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}},function(t,e){function n(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function u(t){n(a,i,o,u,s,"next",t)}function s(t){n(a,i,o,u,s,"throw",t)}u(void 0)}))}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return u}));\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}Object.create;Object.create},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){"use strict";n.d(e,"j",(function(){return g})),n.d(e,"c",(function(){return y})),n.d(e,"g",(function(){return b})),n.d(e,"b",(function(){return x}));var r=n(106),i=n.n(r);n.d(e,"e",(function(){return i.a}));var o=n(180),a=n.n(o);n.d(e,"d",(function(){return a.a}));var u=n(181),s=n.n(u);n.d(e,"h",(function(){return s.a}));var c=n(108),f=n.n(c);n.d(e,"f",(function(){return f.a}));n(109);var l=n(182),h=n.n(l);n.d(e,"i",(function(){return h.a}));var d=n(183),p=n.n(d);n.d(e,"a",(function(){return p.a}));var v=n(184),m=n.n(v);function g(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}n.d(e,"k",(function(){return m.a}));var y="undefined"!=typeof window&&void 0!==window.document;function b(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function x(t){return t.cfg.visible&&t.cfg.capture}},function(t,e,n){var r;try{r={cloneDeep:n(344),constant:n(99),defaults:n(345),each:n(142),filter:n(145),find:n(346),flatten:n(173),forEach:n(143),forIn:n(351),has:n(156),isUndefined:n(157),last:n(352),map:n(158),mapValues:n(353),max:n(354),merge:n(356),min:n(361),minBy:n(362),now:n(363),pick:n(364),range:n(369),reduce:n(160),sortBy:n(372),uniqueId:n(377),values:n(166),zipObject:n(378)}}catch(t){}r||(r=window._),t.exports=r},function(t,e,n){var r=n(444),i=n(445),o=n(190),a=n(446);t.exports=function(t){return r(t)||i(t)||o(t)||a()}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(442);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(60),i=n(21);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e){t.exports=function(t,e){throw new Error("Decorating class property failed. Please ensure that proposal-class-properties is enabled and runs after the decorators transform.")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct"},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0);return t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,o,a,u,s,c){var f=new r.ARRAY_TYPE(9);return f[0]=t,f[1]=e,f[2]=n,f[3]=i,f[4]=o,f[5]=a,f[6]=u,f[7]=s,f[8]=c,f},e.set=function(t,e,n,r,i,o,a,u,s,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t[8]=c,t},e.identity=function(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},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=f*a-u*c,h=-f*o+u*s,d=c*o-a*s,p=n*l+r*h+i*d;if(!p)return null;return p=1/p,t[0]=l*p,t[1]=(-f*r+i*c)*p,t[2]=(u*r-i*a)*p,t[3]=h*p,t[4]=(f*n-i*s)*p,t[5]=(-u*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*s)*p,t[8]=(a*n-r*o)*p,t},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8];return t[0]=a*f-u*c,t[1]=i*c-r*f,t[2]=r*u-i*a,t[3]=u*s-o*f,t[4]=n*f-i*s,t[5]=i*o-n*u,t[6]=o*c-a*s,t[7]=r*s-n*c,t[8]=n*a-r*o,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],c=t[8];return e*(c*o-a*s)+n*(-c*i+a*u)+r*(s*i-o*u)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=h*r+d*a+c,t[7]=h*i+d*u+f,t[8]=h*o+d*s+l,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*u,t[2]=d*o+h*s,t[3]=d*a-h*r,t[4]=d*u-h*i,t[5]=d*s-h*o,t[6]=c,t[7]=f,t[8]=l,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,m=o*u,g=o*s;return t[0]=1-l-p,t[3]=f-g,t[6]=h+m,t[1]=f+g,t[4]=1-c-p,t[7]=d-v,t[2]=h-m,t[5]=d+v,t[8]=1-c-l,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=n*u-r*a,b=n*s-i*a,x=n*c-o*a,_=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*m-h*p,T=f*g-d*p,M=l*m-h*v,k=l*g-d*v,I=h*g-d*m,O=y*I-b*k+x*M+_*T-w*A+E*S;if(!O)return null;return O=1/O,t[0]=(u*I-s*k+c*M)*O,t[1]=(s*T-a*I-c*A)*O,t[2]=(a*k-u*T+c*S)*O,t[3]=(i*k-r*I-o*M)*O,t[4]=(n*I-i*T+o*A)*O,t[5]=(r*T-n*k-o*S)*O,t[6]=(v*E-m*w+g*_)*O,t[7]=(m*x-p*E-g*b)*O,t[8]=(p*w-v*x+g*y)*O,t},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],v=e[3],m=e[4],g=e[5],y=e[6],b=e[7],x=e[8];return Math.abs(n-h)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-v)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-m)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(s-g)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(c-y)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(f-b)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(l-x)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(x))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(88));function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=n[0],d=n[1],p=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*u+p*f,t[2]=h*o+d*s+p*l,t[3]=v*r+m*a+g*c,t[4]=v*i+m*u+g*f,t[5]=v*o+m*s+g*l,t[6]=y*r+b*a+x*c,t[7]=y*i+b*u+x*f,t[8]=y*o+b*s+x*l,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=o},function(t,e,n){"use strict";var r=n(14),i=n(28).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string (\'singleton\' or \'transient\').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the \'"+t[0]+"\' bindings. Please investigate bindings withservice identifier \'"+t[1]+"\'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},function(t,e,n){var r;try{r={clone:n(233),constant:n(99),each:n(142),filter:n(145),has:n(156),isArray:n(16),isEmpty:n(309),isFunction:n(55),isUndefined:n(157),keys:n(40),map:n(158),reduce:n(160),size:n(312),transform:n(318),union:n(319),values:n(166)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){function n(t){return(n="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)}t.exports=function(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(266),i=n(73),o=n(94),a=o&&o.isTypedArray,u=a?i(a):r;t.exports=u},function(t,e,n){var r;try{r=n(231)}catch(t){}r||(r=window.graphlib),t.exports=r},function(t,e,n){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)}var i=n(124),o="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,a=i||o||Function("return this")();t.exports=a},function(t,e){function n(t){return(n="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)}t.exports=function(t){return null!=t&&"object"==n(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},function(t,e,n){"use strict";function r(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],u=t[4],s=t[5],c=t[6],f=t[7],l=t[8],h=e[0],d=e[1],p=e[2],v=e[3],m=e[4],g=e[5],y=e[6],b=e[7],x=e[8];return n[0]=h*r+d*a+p*c,n[1]=h*i+d*u+p*f,n[2]=h*o+d*s+p*l,n[3]=v*r+m*a+g*c,n[4]=v*i+m*u+g*f,n[5]=v*o+m*s+g*l,n[6]=y*r+b*a+x*c,n[7]=y*i+b*u+x*f,n[8]=y*o+b*s+x*l,n}function i(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function o(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],c=t[7],f=t[8],l=f*a-u*c,h=-f*o+u*s,d=c*o-a*s,p=n*l+r*h+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-f*r+i*c)*p,e[2]=(u*r-i*a)*p,e[3]=h*p,e[4]=(f*n-i*s)*p,e[5]=(-u*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*s)*p,e[8]=(a*n-r*o)*p,e):null}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=o,e.multiply=a,e.divide=u,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=s,e.squaredDistance=c,e.length=f,e.squaredLength=l,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),u=Math.cos(r);return t[0]=i*u-o*a+n[0],t[1]=i*a+o*u+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var u=i*i+o*o;u>0&&(u=1/Math.sqrt(u));var s=(n*i+r*o)*a*u;return s>1?0:s<-1?Math.PI:Math.acos(s)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(88));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function u(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function s(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function f(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function l(t){var e=t[0],n=t[1];return e*e+n*n}var h;e.len=f,e.sub=o,e.mul=a,e.div=u,e.dist=s,e.sqrDist=c,e.sqrLen=l,e.forEach=(h=i(),function(t,e,n,r,i,o){var a=void 0,u=void 0;for(e||(e=2),n||(n=0),u=r?Math.min(r*e+n,t.length):t.length,a=n;a<u;a+=e)h[0]=t[a],h[1]=t[a+1],i(h,h,o),t[a]=h[0],t[a+1]=h[1];return t})},function(t,e){},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return u}));var r=n(1),i="\\t\\n\\v\\f\\r \\u2028\\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?)["+i+"]*,?["+i+"]*","ig"),u=function(t){if(!t)return null;if(Object(r.d)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(r,i,o){var u=[],s=i.toLowerCase();if(o.replace(a,(function(t,e){e&&u.push(+e)})),"m"===s&&u.length>2&&(n.push([i].concat(u.splice(0,2))),s="l",i="m"===i?"l":"L"),"o"===s&&1===u.length&&n.push([i,u[0]]),"r"===s)n.push([i].concat(u));else for(;u.length>=e[s]&&(n.push([i].concat(u.splice(0,e[s]))),e[s]););return t})),n};var s=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(r.c)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function c(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var f=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var u=[],f=0;f<=i;f++)u[f]=[],u[f][0]={min:f};for(var l=0;l<=o;l++)u[0][l]={min:l};for(f=1;f<=i;f++){n=t[f-1];for(l=1;l<=o;l++){r=e[l-1],a=s(n,r)?0:1;var h=u[f-1][l].min+1,d=u[f][l-1].min+1,p=u[f-1][l-1].min+a;u[f][l]=c(h,d,p)}}return u}(t,e),r=t.length,i=e.length,o=[],a=1,u=1;if(n[r][i].min!==r){for(var f=1;f<=r;f++){var l=n[f][f].min;u=f;for(var h=a;h<=i;h++)n[f][h].min<l&&(l=n[f][h].min,u=h);a=u,n[f][a].type&&o.push({index:f-1,type:n[f][a].type})}for(f=o.length-1;f>=0;f--)a=o[f].index,"add"===o[f].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var d=i-(r=t.length);if(r<i)for(f=0;f<d;f++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function l(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=h(e)[0],u=1;u<=n;u++)o*=u,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function h(t){var e=[];switch(t[0]){case"M":case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var d=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=h(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},function(t,e,n){var r=n(55),i=n(93);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){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)}var i=n(289),o=n(299),a=n(47),u=n(16),s=n(306);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?u(t)?o(t[0],t[1]):i(t):s(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(t,e,n){var r=n(50),i=n(245),o=n(246),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(128),i=n(95),o=n(36);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(20);function o(t,e,n,i,o){var a={},u="number"==typeof o,s=void 0!==o&&u?o.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var h=l[f];if(h.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+h.key.toString())}else c=[];c.push(i),a[s]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function u(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([u(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},function(t,e,n){var r=n(413),i=n(414),o=n(190),a=n(415);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()}},function(t,e,n){var r=n(39),i=n(30);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==r(t)}},function(t,e,n){var r=n(208),i=n(207),o=n(215),a=n(119),u=n(216),s=[0,0];t.exports.computeMiter=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(s,-n[1],n[0]),c/u(e,s)},t.exports.normal=function(t,e){return i(t,-e[1],e[0]),t},t.exports.direction=function(t,e,n){return a(t,e,n),o(t,t),t}},function(t,e,n){var r=n(244),i=n(249);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(128),i=n(269),o=n(36);t.exports=function(t){return o(t)?r(t,!0):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=0;e.id=function(){return r++}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(29).Symbol;t.exports=r},function(t,e,n){(function(t){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)}var i=n(29),o=n(265),a="object"==r(e)&&e&&!e.nodeType&&e,u=a&&"object"==r(t)&&t&&!t.nodeType&&t,s=u&&u.exports===a?i.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;t.exports=c}).call(this,n(71)(t))},function(t,e,n){var r=n(274),i=n(90),o=n(275),a=n(137),u=n(276),s=n(39),c=n(126),f=c(r),l=c(i),h=c(o),d=c(a),p=c(u),v=s;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||a&&"[object Set]"!=v(new a)||u&&"[object WeakMap]"!=v(new u))&&(v=function(t){var e=s(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=v},function(t,e,n){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)}var i=n(39),o=n(30);t.exports=function(t){return"symbol"==r(t)||o(t)&&"[object Symbol]"==i(t)}},function(t,e,n){"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)}var i=n(405),o=n(409),a=[].slice,u=["keyword","gray","hex"],s={};Object.keys(o).forEach((function(t){s[a.call(o[t].labels).sort().join("")]=t}));var c={};function f(t,e){if(!(this instanceof f))return new f(t,e);if(e&&e in u&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof f)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var l=i.get(t);if(null===l)throw new Error("Unable to parse color from string: "+t);this.model=l.model,r=o[this.model].channels,this.color=l.value.slice(0,r),this.valpha="number"==typeof l.value[r]?l.value[r]:1}else if(t.length){this.model=e||"rgb",r=o[this.model].channels;var h=a.call(t,0,r);this.color=p(h,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var v=d.sort().join("");if(!(v in s))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=s[v];var m=o[this.model].labels,g=[];for(n=0;n<m.length;n++)g.push(t[m[n]]);this.color=p(g)}if(c[this.model])for(r=o[this.model].channels,n=0;n<r;n++){var y=c[this.model][n];y&&(this.color[n]=y(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function l(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(c[t]||(c[t]=[]))[e]=n})),t=t[0],function(r){var i;return arguments.length?(n&&(r=n(r)),(i=this[t]()).color[e]=r,i):(i=this[t]().color[e],n&&(i=n(i)),i)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function d(t){return Array.isArray(t)?t:[t]}function p(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}f.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in i.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return i.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return i.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=o[this.model].channels,n=o[this.model].labels,r=0;r<e;r++)t[n[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new f(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new f(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:l("rgb",0,h(255)),green:l("rgb",1,h(255)),blue:l("rgb",2,h(255)),hue:l(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:l("hsl",1,h(100)),lightness:l("hsl",2,h(100)),saturationv:l("hsv",1,h(100)),value:l("hsv",2,h(100)),chroma:l("hcg",1,h(100)),gray:l("hcg",2,h(100)),white:l("hwb",1,h(100)),wblack:l("hwb",2,h(100)),cyan:l("cmyk",0,h(100)),magenta:l("cmyk",1,h(100)),yellow:l("cmyk",2,h(100)),black:l("cmyk",3,h(100)),x:l("xyz",0,h(100)),y:l("xyz",1,h(100)),z:l("xyz",2,h(100)),l:l("lab",0,h(100)),a:l("lab",1),b:l("lab",2),keyword:function(t){return arguments.length?new f(t):o[this.model].keyword(this.color)},hex:function(t){return arguments.length?new f(t):i.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],n=0;n<t.length;n++){var r=t[n]/255;e[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return f.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,u=n.alpha()-i.alpha(),s=((a*u==-1?a:(a+u)/(1+a*u))+1)/2,c=1-s;return f.rgb(s*n.red()+c*i.red(),s*n.green()+c*i.green(),s*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===u.indexOf(t)){var e=o[t].channels;f.prototype[t]=function(){if(this.model===t)return new f(this);if(arguments.length)return new f(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new f(d(o[this.model][t].raw(this.color)).concat(n),t)},f[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new f(n,t)}}})),t.exports=f},function(t,e,n){var r=n(39),i=n(26);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(69),i=n(70);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var u=-1,s=e.length;++u<s;){var c=e[u],f=o?o(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),a?i(n,c,f):r(n,c,f)}return n}},function(t,e,n){var r=n(264),i=n(30),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=s},function(t,e,n){var r=n(53);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){"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(e,"__esModule",{value:!0});var i=n(24);function o(t){return"function"==typeof t?t.name:"symbol"===r(t)?t.toString():t}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\\s*([^\\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=o,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(function t(e,n){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===n||t(e.parentRequest,n))}(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=o(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\\x3e ")}(e);throw new Error(i.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\\n"}))," "+t+"\\n "+t+" - "+n}return" "+t},e.getFunctionName=a},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){return null==t}},function(t,e,n){var r;function i(t){return(i="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)}!function(o){var a=/^\\s+/,u=/\\s+$/,s=0,c=o.round,f=o.min,l=o.max,h=o.random;function d(t,e){if(e=e||{},(t=t||"")instanceof d)return t;if(!(this instanceof d))return new d(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,s=null,c=null,h=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(u,"").toLowerCase();var e,n=!1;if(C[t])t=C[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=W.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=W.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=W.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=W.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=W.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=W.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=W.hex8.exec(t))return{r:j(e[1]),g:j(e[2]),b:j(e[3]),a:U(e[4]),format:n?"name":"hex8"};if(e=W.hex6.exec(t))return{r:j(e[1]),g:j(e[2]),b:j(e[3]),format:n?"name":"hex"};if(e=W.hex4.exec(t))return{r:j(e[1]+""+e[1]),g:j(e[2]+""+e[2]),b:j(e[3]+""+e[3]),a:U(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=W.hex3.exec(t))return{r:j(e[1]+""+e[1]),g:j(e[2]+""+e[2]),b:j(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==i(t)&&(X(t.r)&&X(t.g)&&X(t.b)?(p=t.r,v=t.g,m=t.b,e={r:255*N(p,255),g:255*N(v,255),b:255*N(m,255)},h=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):X(t.h)&&X(t.s)&&X(t.v)?(r=L(t.s),s=L(t.v),e=function(t,e,n){t=6*N(t,360),e=N(e,100),n=N(n,100);var r=o.floor(t),i=t-r,a=n*(1-e),u=n*(1-i*e),s=n*(1-(1-i)*e),c=r%6;return{r:255*[n,u,a,a,s,n][c],g:255*[s,n,n,u,a,a][c],b:255*[a,a,s,n,n,u][c]}}(t.h,r,s),h=!0,d="hsv"):X(t.h)&&X(t.s)&&X(t.l)&&(r=L(t.s),c=L(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=N(t,360),e=N(e,100),n=N(n,100),0===e)r=i=o=n;else{var u=n<.5?n*(1+e):n+e-n*e,s=2*n-u;r=a(s,u,t+1/3),i=a(s,u,t),o=a(s,u,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,c),h=!0,d="hsl"),t.hasOwnProperty("a")&&(n=t.a));var p,v,m;return n=R(n),{ok:h,format:t.format||d,r:f(255,l(e.r,0)),g:f(255,l(e.g,0)),b:f(255,l(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=s++}function p(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=f(t,e,n),u=(o+a)/2;if(o==a)r=i=0;else{var s=o-a;switch(i=u>.5?s/(2-o-a):s/(o+a),o){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:r,s:i,l:u}}function v(t,e,n){t=N(t,255),e=N(e,255),n=N(n,255);var r,i,o=l(t,e,n),a=f(t,e,n),u=o,s=o-a;if(i=0===o?0:s/o,o==a)r=0;else{switch(o){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:r,s:i,v:u}}function m(t,e,n,r){var i=[G(c(t).toString(16)),G(c(e).toString(16)),G(c(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function g(t,e,n,r){return[G(B(r)),G(c(t).toString(16)),G(c(e).toString(16)),G(c(n).toString(16))].join("")}function y(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.s-=e/100,n.s=P(n.s),d(n)}function b(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.s+=e/100,n.s=P(n.s),d(n)}function x(t){return d(t).desaturate(100)}function _(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.l+=e/100,n.l=P(n.l),d(n)}function w(t,e){e=0===e?0:e||10;var n=d(t).toRgb();return n.r=l(0,f(255,n.r-c(-e/100*255))),n.g=l(0,f(255,n.g-c(-e/100*255))),n.b=l(0,f(255,n.b-c(-e/100*255))),d(n)}function E(t,e){e=0===e?0:e||10;var n=d(t).toHsl();return n.l-=e/100,n.l=P(n.l),d(n)}function S(t,e){var n=d(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,d(n)}function A(t){var e=d(t).toHsl();return e.h=(e.h+180)%360,d(e)}function T(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+120)%360,s:e.s,l:e.l}),d({h:(n+240)%360,s:e.s,l:e.l})]}function M(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+90)%360,s:e.s,l:e.l}),d({h:(n+180)%360,s:e.s,l:e.l}),d({h:(n+270)%360,s:e.s,l:e.l})]}function k(t){var e=d(t).toHsl(),n=e.h;return[d(t),d({h:(n+72)%360,s:e.s,l:e.l}),d({h:(n+216)%360,s:e.s,l:e.l})]}function I(t,e,n){e=e||6,n=n||30;var r=d(t).toHsl(),i=360/n,o=[d(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(d(r));return o}function O(t,e){e=e||6;for(var n=d(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],u=1/e;e--;)a.push(d({h:r,s:i,v:o})),o=(o+u)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=R(t),this._roundA=c(100*this._a)/100,this},toHsv:function(){var t=v(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=v(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return m(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[G(c(t).toString(16)),G(c(e).toString(16)),G(c(n).toString(16)),G(B(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*N(this._r,255))+"%",g:c(100*N(this._g,255))+"%",b:c(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%)":"rgba("+c(100*N(this._r,255))+"%, "+c(100*N(this._g,255))+"%, "+c(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+g(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=d(t);n="#"+g(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(I,arguments)},complement:function(){return this._applyCombination(A,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(T,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},d.fromRatio=function(t,e){if("object"==i(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:L(t[r]));t=n}return d(t,e)},d.equals=function(t,e){return!(!t||!e)&&d(t).toRgbString()==d(e).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(t,e,n){n=0===n?0:n||50;var r=d(t).toRgb(),i=d(e).toRgb(),o=n/100;return d({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},d.readability=function(t,e){var n=d(t),r=d(e);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(t,e,n){var r,i,o=d.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},d.mostReadable=function(t,e,n){var r,i,o,a,u=null,s=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<e.length;c++)(r=d.readability(t,e[c]))>s&&(s=r,u=d(e[c]));return d.isReadable(t,u,{level:o,size:a})||!i?u:(n.includeFallbackColors=!1,d.mostReadable(t,["#fff","#000"],n))};var C=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=d.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(C);function R(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function N(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=f(e,l(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),o.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function P(t){return f(1,l(0,t))}function j(t){return parseInt(t,16)}function G(t){return 1==t.length?"0"+t:""+t}function L(t){return t<=1&&(t=100*t+"%"),t}function B(t){return o.round(255*parseFloat(t)).toString(16)}function U(t){return j(t)/255}var F,z,V,W=(z="[\\\\s|\\\\(]+("+(F="(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)")+")[,|\\\\s]+("+F+")[,|\\\\s]+("+F+")\\\\s*\\\\)?",V="[\\\\s|\\\\(]+("+F+")[,|\\\\s]+("+F+")[,|\\\\s]+("+F+")[,|\\\\s]+("+F+")\\\\s*\\\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+V),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+V),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+V),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function X(t){return!!W.CSS_UNIT.exec(t)}t.exports?t.exports=d:void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){t.exports={EPSILON:n(205),create:n(206),clone:n(447),fromValues:n(448),copy:n(449),set:n(207),equals:n(450),exactEquals:n(451),add:n(208),subtract:n(119),sub:n(452),multiply:n(209),mul:n(453),divide:n(210),div:n(454),inverse:n(455),min:n(456),max:n(457),rotate:n(458),floor:n(459),ceil:n(460),round:n(461),scale:n(462),scaleAndAdd:n(463),distance:n(211),dist:n(464),squaredDistance:n(212),sqrDist:n(465),length:n(213),len:n(466),squaredLength:n(214),sqrLen:n(467),negate:n(468),normalize:n(215),dot:n(216),cross:n(469),lerp:n(470),random:n(471),transformMat2:n(472),transformMat2d:n(473),transformMat3:n(474),transformMat4:n(475),forEach:n(476),limit:n(477)}},function(t,e,n){var r=n(65),i=n(239),o=n(240),a=n(241),u=n(242),s=n(243);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(234),i=n(235),o=n(236),a=n(237),u=n(238);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(49);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(45)(Object,"create");t.exports=r},function(t,e,n){var r=n(258);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(70),i=n(49),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(127);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t){return(n="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)}var r=/^(?:0|[1-9]\\d*)$/;t.exports=function(t,e){var i=n(t);return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(129)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(100),i=n(287)(r);t.exports=i},function(t,e,n){var r=n(78),i=n(58);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(16),i=n(103),o=n(301),a=n(152);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e,n){var r=n(47),i=n(161),o=n(162);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){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)}var i=n(49),o=n(36),a=n(72),u=n(26);t.exports=function(t,e,n){if(!u(n))return!1;var s=r(e);return!!("number"==s?o(n)&&a(e,n.length):"string"==s&&e in n)&&i(n[e],t)}},function(t,e,n){"use strict";var r=n(14);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},function(t,e){},function(t,e,n){"use strict";var r=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();e.a=r},function(t,e,n){"use strict";var r=n(11),i=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],u=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),u.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),o=n(13),a=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(o.i)(r,e),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(i);e.a=a},function(t,e,n){"use strict";var r=n(11),i=n(87),o=n(13),a={};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],a=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(o.a)(u,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],a=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(o.a)(u,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Math.min.apply(null,i),e=Math.max.apply(null,i),n=Math.min.apply(null,a),r=Math.max.apply(null,a)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(o.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];Object(o.f)(n)?r=n:r.type=n;var i=a[r.type];i||(i=Object(o.k)(r.type),a[r.type]=i);var u=this.getShapeBase(),s=new u[i](r);return this.add(s),s},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(Object(o.d)(r))n=new r(i||{parent:this});else{var a=r||{},u=this.getGroupBase();n=new u(a)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!Object(o.b)(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var a=[t,e,1];a=this.invertFromMatrix(a),this.isClipped(a[0],a[1])||(r=this._findShape(i,a[0],a[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,a=t.length-1;a>=0;a--){var u=t[a];if(Object(o.b)(u)&&(u.isGroup()?i=u.getShape(e,n,r):u.isHit(e,n)&&(i=u)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(o.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(o.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(o.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(o.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(i.a);e.a=u},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"leftTranslate",(function(){return u})),n.d(r,"leftRotate",(function(){return s})),n.d(r,"leftScale",(function(){return c})),n.d(r,"transform",(function(){return f})),n.d(r,"direction",(function(){return l})),n.d(r,"angleTo",(function(){return h})),n.d(r,"vertical",(function(){return d}));var i=n(11),o=n(1),a=n(0);function u(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return a.a.fromTranslation(r,n),a.a.multiply(t,r,e)}function s(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return a.a.fromRotation(r,n),a.a.multiply(t,r,e)}function c(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return a.a.fromScaling(r,n),a.a.multiply(t,r,e)}function f(t,e){for(var n,r,i,o=t?[].concat(t):[1,0,0,0,1,0,0,0,1],f=0,l=e.length;f<l;f++){var h=e[f];switch(h[0]){case"t":u(o,o,[h[1],h[2]]);break;case"s":c(o,o,[h[1],h[2]]);break;case"r":s(o,o,h[1]);break;case"m":n=o,r=o,i=h[1],a.a.multiply(n,i,r)}}return o}function l(t,e){return t[0]*e[1]-e[0]*t[1]}function h(t,e,n){var r=a.d.angle(t,e),i=l(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function d(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}var p=n(13),v=n(32),m=n(85),g=r.transform,y=["zIndex","capture","visible","type"],b=["repeat"];function x(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function _(t,e){var n={},r=e.attr();return Object(o.c)(t,(function(t,e){-1!==b.indexOf(e)||Object(o.e)(r[e],t)||(n[e]=t)})),n}function w(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,i=e.duration,a=Object.prototype.hasOwnProperty;return Object(o.c)(t,(function(t){n+r<t.startTime+t.delay+t.duration&&i>t.delay&&Object(o.c)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var E=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(o.k)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],i=e[1];if(!r)return this.attrs;if(Object(o.i)(r)){for(var a in r)this.setAttr(a,r[a]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,i),this.afterAttrsChange(((t={})[r]=i,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(Object(p.j)(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr("matrix",this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr("matrix")},e.prototype.setMatrix=function(t){this.attr("matrix",t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Object(v.b)(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Object(v.b)(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?Object(v.c)(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=Object(v.a)(e);if(n)return Object(v.c)(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[Object(o.n)(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};Object(o.c)(e,(function(t,r){Object(o.d)(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)Object(o.d)(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return Object(o.c)(y,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var i,a,u,s,c,f=t[0],l=t[1],h=t[2],d=void 0===h?"easeLinear":h,p=t[3],v=void 0===p?o.l:p,m=t[4],g=void 0===m?0:m;Object(o.f)(f)?(i=f,f={}):Object(o.i)(f)&&f.onFrame&&(i=f.onFrame,a=f.repeat),Object(o.i)(l)?(l=(c=l).duration,d=c.easing||"easeLinear",g=c.delay||0,a=c.repeat||a||!1,v=c.callback||o.l,u=c.pauseCallback||o.l,s=c.resumeCallback||o.l):(Object(o.h)(v)&&(g=v,v=null),Object(o.f)(d)?(v=d,d="easeLinear"):d=d||"easeLinear");var y=_(f,this),b={fromAttrs:x(y,this),toAttrs:y,duration:l,easing:d,repeat:a,callback:v,pauseCallback:u,resumeCallback:s,delay:g,startTime:n.getTime(),id:Object(o.m)(),onFrame:i,pathFormatted:!1};r.length>0?r=w(r,b):n.addAnimator(this),r.push(b),this.set("animations",r),this.set("_pause",{isPaused:!1})},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(o.c)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(o.c)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(o.c)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,i=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var a=function(t){var a=i[t],s=a.get("name");if(s){if((a.isGroup()||a.isCanvas&&a.isCanvas())&&n&&Object(p.g)(a,n))return"break";Object(o.d)(s)?Object(o.c)(s,(function(t){r.emitDelegateEvent(a,t,e)})):u.emitDelegateEvent(a,s,e)}},u=this,s=0;s<i.length;s++){if("break"===a(s))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=g(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=g(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=g(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=g(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=g(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(m.a);e.a=E},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*i},e.equals=function(t,e){return Math.abs(t-e)<=r*Math.max(1,Math.abs(t),Math.abs(e))};var r=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var i=Math.PI/180},function(t,e,n){"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)}var i=n(25);t.exports=o;function o(t){this._isDirected=!i.has(t,"directed")||t.directed,this._isMultigraph=!!i.has(t,"multigraph")&&t.multigraph,this._isCompound=!!i.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=i.constant(void 0),this._defaultEdgeLabelFn=i.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function u(t,e){--t[e]||delete t[e]}function s(t,e,n,r){var o=""+e,a=""+n;if(!t&&o>a){var u=o;o=a,a=u}return o+""+a+""+(i.isUndefined(r)?"\\0":r)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function f(t,e){return s(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return i.keys(this._nodes)},o.prototype.sources=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return i.filter(this.nodes(),(function(e){return i.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,r=this;return i.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},o.prototype.setNode=function(t,e){return i.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\\0",this._children[t]={},this._children["\\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return i.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(i.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],i.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),i.each(i.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],i.each(i.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(e))e="\\0";else{for(var n=e+="";!i.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\\0"!==e)return e}},o.prototype.children=function(t){if(i.isUndefined(t)&&(t="\\0"),this._isCompound){var e=this._children[t];if(e)return i.keys(e)}else{if("\\0"===t)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return i.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return i.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return i.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;i.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),i.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};return this._isCompound&&i.each(e.nodes(),(function(t){e.setParent(t,function t(i){var o=n.parent(i);return void 0===o||e.hasNode(o)?(r[i]=o,o):o in r?r[o]:t(o)}(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return i.isFunction(t)||(t=i.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return i.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,r=arguments;return i.reduce(t,(function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this},o.prototype.setEdge=function(){var t,e,n,o,u=!1,f=arguments[0];"object"===r(f)&&null!==f&&"v"in f?(t=f.v,e=f.w,n=f.name,2===arguments.length&&(o=arguments[1],u=!0)):(t=f,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],u=!0)),t=""+t,e=""+e,i.isUndefined(n)||(n=""+n);var l=s(this._isDirected,t,e,n);if(i.has(this._edgeLabels,l))return u&&(this._edgeLabels[l]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=u?o:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return i.has(this._edgeLabels,r)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[e],t),u(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.v===e})):r}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=i.values(n);return e?i.filter(r,(function(t){return t.w===e})):r}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(45)(n(29),"Map");t.exports=r},function(t,e,n){var r=n(250),i=n(257),o=n(259),a=n(260),u=n(261);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){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)}var i=n(124),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,u=a&&a.exports===o&&i.process,s=function(){try{var t=a&&a.require&&a.require("util").types;return t||u&&u.binding&&u.binding("util")}catch(t){}}();t.exports=s}).call(this,n(71)(t))},function(t,e,n){var r=n(74),i=n(267),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(132),i=n(133),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(138);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(101),i=n(40);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(286)();t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){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)}var i=n(16),o=n(53),a=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,u=/^\\w*$/;t.exports=function(t,e){if(i(t))return!1;var n=r(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(u.test(t)||!a.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(97),i=n(320);t.exports=function t(e,n,o,a,u){var s=-1,c=e.length;for(o||(o=i),u||(u=[]);++s<c;){var f=e[s];n>0&&o(f)?n>1?t(f,n-1,o,a,u):r(u,f):a||(u[u.length]=f)}return u}},function(t,e,n){var r=n(53);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],u=e(a);if(null!=u&&(void 0===s?u==u&&!r(u):n(u,s)))var s=u,c=a}return c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){return null==t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={}.toString;e.default=function(t,e){return r.call(t)==="[object "+e+"]"}},function(t,e,n){"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(e,"__esModule",{value:!0}),e.default=function(t){var e=r(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(107);e.default=function(t){return Array.isArray?Array.isArray(t):r.default(t,"Array")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(111),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(110),i=n(197),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},function(t,e,n){var r=n(39),i=n(75),o=n(30),a=Function.prototype,u=Object.prototype,s=a.toString,c=u.hasOwnProperty,f=s.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},function(t,e,n){t.exports={graphlib:n(28),layout:n(343),debug:n(401),util:{time:n(23).time,notime:n(23).notime},version:n(402)}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function u(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var u=new a(n,r||t,o),s=i?i+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],u]:t._events[s].push(u):(t._events[s]=u,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,o,a){var u=i?i+t:t;if(!this._events[u])return!1;var s,c,f=this._events[u],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,n),!0;case 4:return f.fn.call(f.context,e,n,r),!0;case 5:return f.fn.call(f.context,e,n,r,o),!0;case 6:return f.fn.call(f.context,e,n,r,o,a),!0}for(c=1,s=new Array(l-1);c<l;c++)s[c-1]=arguments[c];f.fn.apply(f.context,s)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,n);break;case 4:f[c].fn.call(f[c].context,e,n,r);break;default:if(!s)for(h=1,s=new Array(l-1);h<l;h++)s[h-1]=arguments[h];f[c].fn.apply(f[c].context,s)}}return!0},c.prototype.on=function(t,e,n){return u(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return u(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],f=a.length;u<f;u++)(a[u].fn!==e||r&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&s(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},function(t,e,n){var r=n(64),i=n(92),o=n(69),a=n(262),u=n(268),s=n(130),c=n(131),f=n(271),l=n(272),h=n(135),d=n(273),p=n(52),v=n(277),m=n(278),g=n(140),y=n(16),b=n(51),x=n(282),_=n(26),w=n(284),E=n(40),S=n(46),A={};A["[object Arguments]"]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A["[object Object]"]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A["[object Function]"]=A["[object WeakMap]"]=!1,t.exports=function t(e,n,T,M,k,I){var O,C=1&n,D=2&n,R=4&n;if(T&&(O=k?T(e,M,k,I):T(e)),void 0!==O)return O;if(!_(e))return e;var N=y(e);if(N){if(O=v(e),!C)return c(e,O)}else{var P=p(e),j="[object Function]"==P||"[object GeneratorFunction]"==P;if(b(e))return s(e,C);if("[object Object]"==P||"[object Arguments]"==P||j&&!k){if(O=D||j?{}:g(e),!C)return D?l(e,u(O,e)):f(e,a(O,e))}else{if(!A[P])return k?e:{};O=m(e,P,C)}}I||(I=new r);var G=I.get(e);if(G)return G;I.set(e,O),w(e)?e.forEach((function(r){O.add(t(r,n,T,r,e,I))})):x(e)&&e.forEach((function(r,i){O.set(i,t(r,n,T,i,e,I))}));var L=N?void 0:(R?D?d:h:D?S:E)(e);return i(L||e,(function(r,i){L&&(r=e[i=r]),o(O,i,t(r,n,T,i,e,I))})),O}},function(t,e,n){(function(e){function n(t){return(n="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)}var r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(this,n(125))},function(t,e){function n(t){return(n="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)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(45),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(263),i=n(57),o=n(16),a=n(51),u=n(72),s=n(27),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&s(t),d=n||f||l||h,p=d?r(t.length,String):[],v=p.length;for(var m in t)!e&&!c.call(t,m)||d&&("length"==m||l&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||p.push(m);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){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)}var i=n(29),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,u=a&&a.exports===o?i.Buffer:void 0,s=u?u.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(71)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(97),i=n(75),o=n(96),a=n(133),u=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=u},function(t,e,n){var r=n(136),i=n(96),o=n(40);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(97),i=n(16);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e,n){var r=n(45)(n(29),"Set");t.exports=r},function(t,e,n){var r=n(29).Uint8Array;t.exports=r},function(t,e,n){var r=n(98);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(141),i=n(75),o=n(74);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},function(t,e,n){var r=n(26),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},function(t,e,n){t.exports=n(143)},function(t,e,n){var r=n(92),i=n(76),o=n(144),a=n(16);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},function(t,e,n){var r=n(47);t.exports=function(t){return"function"==typeof t?t:r}},function(t,e,n){var r=n(132),i=n(288),o=n(37),a=n(16);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},function(t,e,n){var r=n(291),i=n(30);t.exports=function t(e,n,o,a,u){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,u))}},function(t,e,n){var r=n(148),i=n(294),o=n(149);t.exports=function(t,e,n,a,u,s){var c=1&n,f=t.length,l=e.length;if(f!=l&&!(c&&l>f))return!1;var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=-1,v=!0,m=2&n?new r:void 0;for(s.set(t,e),s.set(e,t);++p<f;){var g=t[p],y=e[p];if(a)var b=c?a(y,g,p,e,t,s):a(g,y,p,t,e,s);if(void 0!==b){if(b)continue;v=!1;break}if(m){if(!i(e,(function(t,e){if(!o(m,e)&&(g===t||u(g,t,n,a,s)))return m.push(e)}))){v=!1;break}}else if(g!==y&&!u(g,y,n,a,s)){v=!1;break}}return s.delete(t),s.delete(e),v}},function(t,e,n){var r=n(91),i=n(292),o=n(293);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(26);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(304);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(305),i=n(154);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e,n){var r=n(78),i=n(57),o=n(16),a=n(72),u=n(93),s=n(58);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=s(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&u(f)&&a(h,f)&&(o(t)||i(t))}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(308),i=n(154);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t){return void 0===t}},function(t,e,n){var r=n(79),i=n(37),o=n(159),a=n(16);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},function(t,e,n){var r=n(76),i=n(36);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(310),i=n(76),o=n(37),a=n(311),u=n(16);t.exports=function(t,e,n){var s=u(t)?r:a,c=arguments.length<3;return s(t,o(e,4),n,c,i)}},function(t,e,n){var r=n(321),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,u=i(o.length-e,0),s=Array(u);++a<u;)s[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(s),r(t,this,c)}}},function(t,e,n){var r=n(322),i=n(323)(r);t.exports=i},function(t,e,n){var r=n(148),i=n(324),o=n(328),a=n(149),u=n(329),s=n(102);t.exports=function(t,e,n){var c=-1,f=i,l=t.length,h=!0,d=[],p=d;if(n)h=!1,f=o;else if(l>=200){var v=e?null:u(t);if(v)return s(v);h=!1,f=a,p=new r}else p=e?[]:d;t:for(;++c<l;){var m=t[c],g=e?e(m):m;if(m=n||0!==m?m:0,h&&g==g){for(var y=p.length;y--;)if(p[y]===g)continue t;e&&p.push(g),d.push(m)}else f(p,g,n)||(p!==d&&p.push(g),d.push(m))}return d}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e,n){var r=n(36),i=n(30);t.exports=function(t){return i(t)&&r(t)}},function(t,e,n){var r=n(331),i=n(40);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(25),i=n(168);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,u={},s=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=u[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,s.decrease(e,c))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;u[t]={distance:n},s.add(t,n)}));for(;s.size()>0&&(o=s.removeMin(),(a=u[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return u}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},function(t,e,n){var r=n(25);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},function(t,e,n){var r=n(25);t.exports=function(t){var e=0,n=[],i={},o=[];return t.nodes().forEach((function(a){r.has(i,a)||function a(u){var s=i[u]={onStack:!0,lowlink:e,index:e++};if(n.push(u),t.successors(u).forEach((function(t){r.has(i,t)?i[t].onStack&&(s.lowlink=Math.min(s.lowlink,i[t].index)):(a(t),s.lowlink=Math.min(s.lowlink,i[t].lowlink))})),s.lowlink===s.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(u!==c);o.push(f)}}(a)})),o}},function(t,e,n){var r=n(25);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(u){if(r.has(n,u))throw new o;r.has(e,u)||(n[u]=!0,e[u]=!0,r.each(t.predecessors(u),a),delete n[u],i.push(u))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=new Error},function(t,e,n){var r=n(25);t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],a={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,n,i,o,a,u){r.has(o,n)||(o[n]=!0,i||u.push(n),r.each(a(n),(function(n){t(e,n,i,o,a,u)})),i&&u.push(n))}(t,e,"post"===n,a,i,o)})),o}},function(t,e,n){var r=n(350);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(104);t.exports=function(t){return(null==t?0:t.length)?r(t,1):[]}},function(t,e,n){var r=n(70),i=n(49);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e){t.exports=function(t,e){return t<e}},function(t,e,n){"use strict";var r=n(14),i=n(28).Graph,o=n(82).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,u=i===a?r.w:a;t.hasNode(u)||o(e,r)||(t.setNode(u,{}),t.setEdge(i,u,{}),n(u))}))})),t.nodeCount()}function u(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function s(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports=function(t){var e,n,r=new i({directed:!1}),c=t.nodes()[0],f=t.nodeCount();r.setNode(c,{});for(;a(r,t)<f;)e=u(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),s(r,t,n);return r}},function(t,e){},function(t,e){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(107);e.default=function(t){return r.default(t,"Function")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(107);e.default=function(t){return r.default(t,"String")}},function(t,e,n){"use strict";function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,i){return e&&r(t,e),n&&r(t,n),i&&r(t,i),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(109),i=n(108);e.default=function(t,e){if(t)if(r.default(t))for(var n=0,o=t.length;n<o&&!1!==e(t[n],n);n++);else if(i.default(t))for(var a in t)if(t.hasOwnProperty(a)&&!1===e(t[a],a))break}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(404);e.default=function(t){var e=r.default(t);return e.charAt(0).toUpperCase()+e.substring(1)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],f=!1,l=-1;function h(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=u(h);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||f||u(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(11);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Object(r.c)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e}}(n(86).a)},function(t,e,n){"use strict";var r=n(11),i=n(87),o=n(32);!function(t){function e(e){return t.call(this,e)||this}Object(r.c)(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var u=Object(o.c)(e,[t.minX,t.minY]),s=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),f=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(u[0],s[0],c[0],f[0]),i=Math.max(u[0],s[0],c[0],f[0]),r=Math.min(u[1],s[1],c[1],f[1]),a=Math.max(u[1],s[1],c[1],f[1])}var l=this.attrs;if(l.shadowColor){var h=l.shadowBlur,d=void 0===h?0:h,p=l.shadowOffsetX,v=void 0===p?0:p,m=l.shadowOffsetY,g=void 0===m?0:m,y=n-d+v,b=i+d+v,x=r-d+g,_=a+d+g;n=Math.min(n,y),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,_)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],u=this._isInBBox(o,a);if(this.isOnlyHitBox())return u;if(u&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1}}(i.a)},function(t,e,n){var r=n(410),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var u in a)if(a.hasOwnProperty(u)){if(!("channels"in a[u]))throw new Error("missing channels property: "+u);if(!("labels"in a[u]))throw new Error("missing channel labels property: "+u);if(a[u].labels.length!==a[u].channels)throw new Error("channel and label counts mismatch: "+u);var s=a[u].channels,c=a[u].labels;delete a[u].channels,delete a[u].labels,Object.defineProperty(a[u],"channels",{value:s}),Object.defineProperty(a[u],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),u=Math.max(r,i,o),s=u-a;return u===a?e=0:r===u?e=(i-o)/s:i===u?e=2+(o-r)/s:o===u&&(e=4+(r-i)/s),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+u)/2,[e,100*(u===a?0:n<=.5?s/(u+a):s/(2-u-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,u=t[1]/255,s=t[2]/255,c=Math.max(a,u,s),f=c-Math.min(a,u,s),l=function(t){return(c-t)/6/f+.5};return 0===f?i=o=0:(o=f/c,e=l(a),n=l(u),r=l(s),a===c?i=r-n:u===c?i=1/3+e-r:s===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,u=1/0;for(var s in r)if(r.hasOwnProperty(s)){var c=r[s],f=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));f<u&&(u=f,n=s)}return n},a.keyword.rgb=function(t){return r[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,u=t[1]/100,s=t[2]/100;if(0===u)return[o=255*s,o,o];e=2*s-(n=s<.5?s*(1+u):s+u-s*u),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),u=255*r*(1-n*o),s=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,s,a];case 1:return[u,r,a];case 2:return[a,r,s];case 3:return[a,u,r];case 4:return[s,a,r];case 5:return[r,a,u]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,u=Math.max(a,.01);return r=(2-o)*a,n=o*u,[i,100*(n=(n/=(e=(2-o)*u)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,u,s=t[0]/360,c=t[1]/100,f=t[2]/100,l=c+f;switch(l>1&&(c/=l,f/=l),r=6*s-(e=Math.floor(6*s)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-f)-c),e){default:case 6:case 0:o=n,a=i,u=c;break;case 1:o=i,a=n,u=c;break;case 2:o=c,a=n,u=i;break;case 3:o=c,a=i,u=n;break;case 4:o=i,a=c,u=n;break;case 5:o=n,a=c,u=i}return[255*o,255*a,255*u]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),u=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),u=o-a;return e=u<=0?0:o===n?(r-i)/u%6:o===r?2+(i-n)/u:4+(n-r)/u+4,e/=6,[360*(e%=1),100*u,100*(u<1?a/(1-u):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,u=a%1,s=1-u;switch(Math.floor(a)){case 0:o[0]=1,o[1]=u,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=u;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=u,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},function(t,e,n){(function(t,e){function n(t){return(n="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)}\n/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the "License"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */var r;!function(r){!function(i){var o="object"===(void 0===e?"undefined":n(e))?e:"object"===("undefined"==typeof self?"undefined":n(self))?self:"object"===n(this)?this:Function("return this;")(),a=u(r);function u(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===o.Reflect?o.Reflect=r:a=u(o.Reflect,a),function(e){var r=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,o=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",u="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!u&&!s,f={create:u?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:c?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:c?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"===(void 0===t?"undefined":n(t))&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[a]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,i)},e.prototype.entries=function(){return new n(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[a]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function i(t,e){return e}function o(t,e){return[t,e]}}():Map,p=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new d}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[a]=function(){return this.keys()},t}():Set,v=new(h||"function"!=typeof WeakMap?function(){var t=f.create(),e=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&f.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?f.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+a()}while(f.has(t,e));return t[e]=!0,e}function i(t,n){if(!r.call(t,e)){if(!n)return;Object.defineProperty(t,e,{value:f.create()})}return t[e]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function m(t,e,n){var r=v.get(t);if(w(r)){if(!n)return;r=new d,v.set(t,r)}var i=r.get(e);if(w(i)){if(!n)return;i=new d,r.set(e,i)}return i}function g(t,e,n){var r=m(e,n,!1);return!w(r)&&!!r.has(t)}function y(t,e,n){var r=m(e,n,!1);if(!w(r))return r.get(t)}function b(t,e,n,r){m(n,r,!0).set(t,e)}function x(t,e){var n=[],r=m(t,e,!1);if(w(r))return n;for(var i=function(t){var e=O(t,a);if(!k(e))throw new TypeError;var n=e.call(t);if(!S(n))throw new TypeError;return n}(r.keys()),o=0;;){var u=C(i);if(!u)return n.length=o,n;var s=u.value;try{n[o]=s}catch(t){try{D(i)}finally{throw t}}o++}}function _(t){if(null===t)return 1;switch(n(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function w(t){return void 0===t}function E(t){return null===t}function S(t){return"object"===n(t)?null!==t:"function"==typeof t}function A(t,e){switch(_(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=O(t,o);if(void 0!==r){var i=r.call(t,n);if(S(i))throw new TypeError;return i}return function(t,e){if("string"===e){var n=t.toString;if(k(n))if(!S(i=n.call(t)))return i;if(k(r=t.valueOf))if(!S(i=r.call(t)))return i}else{var r;if(k(r=t.valueOf))if(!S(i=r.call(t)))return i;var i,o=t.toString;if(k(o))if(!S(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function T(t){var e=A(t,3);return"symbol"===n(e)?e:function(t){return""+t}(e)}function M(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function k(t){return"function"==typeof t}function I(t){return"function"==typeof t}function O(t,e){var n=t[e];if(null!=n){if(!k(n))throw new TypeError;return n}}function C(t){var e=t.next();return!e.done&&e}function D(t){var e=t.return;e&&e.call(t)}function R(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function N(t){return t.__=void 0,delete t.__,t}e("decorate",(function(t,e,n,r){if(w(n)){if(!M(t))throw new TypeError;if(!I(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!w(r)&&!E(r)){if(!I(r))throw new TypeError;e=r}}return e}(t,e)}if(!M(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(r)&&!w(r)&&!E(r))throw new TypeError;return E(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!w(o)&&!E(o)){if(!S(o))throw new TypeError;r=o}}return r}(t,e,n=T(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!S(n))throw new TypeError;if(!w(r)&&!function(t){switch(_(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!S(n))throw new TypeError;return w(r)||(r=T(r)),b(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=T(n)),function t(e,n,r){if(g(e,n,r))return!0;var i=R(n);return!E(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=T(n)),g(t,e,n)})),e("getMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=T(n)),function t(e,n,r){if(g(e,n,r))return y(e,n,r);var i=R(n);return E(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=T(n)),y(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=T(e)),function t(e,n){var r=x(e,n),i=R(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new p,u=[],s=0,c=r;s<c.length;s++){var f=c[s];a.has(f)||(a.add(f),u.push(f))}for(var l=0,h=o;l<h.length;l++){f=h[l];a.has(f)||(a.add(f),u.push(f))}return u}(t,e)})),e("getOwnMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=T(e)),x(t,e)})),e("deleteMetadata",(function(t,e,n){if(!S(e))throw new TypeError;w(n)||(n=T(n));var r=m(e,n,!1);if(w(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=v.get(e);return i.delete(n),i.size>0||v.delete(e),!0}))}(a)}()}(r||(r={}))}).call(this,n(185),n(125))},function(t,e,n){var r=n(191);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(20),o=n(31),a=n(41),u=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=u,e.inject=function(t){return function(e,n,u){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var s=new o.Metadata(i.INJECT_TAG,t);"number"==typeof u?a.tagParameter(e,n,u,s):a.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(48),o=n(31),a=n(423),u=function(){function t(t,e,n,u){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new o.Metadata(r.NAMED_TAG,u):u instanceof o.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return t.key!==r.INJECT_TAG&&t.key!==r.MULTI_INJECT_TAG&&t.key!==r.NAME_TAG&&t.key!==r.UNMANAGED_TAG&&t.key!==r.NAMED_TAG}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return t.key!==r.INJECT_TAG&&t.key!==r.MULTI_INJECT_TAG&&t.key!==r.NAME_TAG&&t.key!==r.UNMANAGED_TAG&&t.key!==r.NAMED_TAG})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(110),i=n(111),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31);e.traverseAncerstors=function t(e,n){var r=e.parentRequest;return null!==r&&(!!n(r)||t(r,n))};var o=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=o;var a=o(r.NAMED_TAG);e.namedConstraint=a;e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return M})),n.d(r,"easeQuad",(function(){return O})),n.d(r,"easeQuadIn",(function(){return k})),n.d(r,"easeQuadOut",(function(){return I})),n.d(r,"easeQuadInOut",(function(){return O})),n.d(r,"easeCubic",(function(){return R})),n.d(r,"easeCubicIn",(function(){return C})),n.d(r,"easeCubicOut",(function(){return D})),n.d(r,"easeCubicInOut",(function(){return R})),n.d(r,"easePoly",(function(){return j})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return P})),n.d(r,"easePolyInOut",(function(){return j})),n.d(r,"easeSin",(function(){return F})),n.d(r,"easeSinIn",(function(){return B})),n.d(r,"easeSinOut",(function(){return U})),n.d(r,"easeSinInOut",(function(){return F})),n.d(r,"easeExp",(function(){return X})),n.d(r,"easeExpIn",(function(){return V})),n.d(r,"easeExpOut",(function(){return W})),n.d(r,"easeExpInOut",(function(){return X})),n.d(r,"easeCircle",(function(){return Y})),n.d(r,"easeCircleIn",(function(){return q})),n.d(r,"easeCircleOut",(function(){return H})),n.d(r,"easeCircleInOut",(function(){return Y})),n.d(r,"easeBounce",(function(){return Q})),n.d(r,"easeBounceIn",(function(){return Z})),n.d(r,"easeBounceOut",(function(){return Q})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return et})),n.d(r,"easeBackIn",(function(){return J})),n.d(r,"easeBackOut",(function(){return tt})),n.d(r,"easeBackInOut",(function(){return et})),n.d(r,"easeElastic",(function(){return it})),n.d(r,"easeElasticIn",(function(){return rt})),n.d(r,"easeElasticOut",(function(){return it})),n.d(r,"easeElasticInOut",(function(){return ot}));var i=n(11),o=n(220),a=n(86),u=n(13),s=n(1);function c(t){return(c="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)}var f,l,h=0,d=0,p=0,v=0,m=0,g=0,y="object"===("undefined"==typeof performance?"undefined":c(performance))&&performance.now?performance:Date,b="object"===("undefined"==typeof window?"undefined":c(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function x(){return m||(b(_),m=y.now()+g)}function _(){m=0}function w(){this._call=this._time=this._next=null}function E(t,e,n){var r=new w;return r.restart(t,e,n),r}function S(){m=(v=y.now())+g,h=d=0;try{!function(){x(),++h;for(var t,e=f;e;)(t=m-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=f,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:f=e);l=t,T(r)}(),m=0}}function A(){var t=y.now(),e=t-v;e>1e3&&(g-=e,v=t)}function T(t){h||(d&&(d=clearTimeout(d)),t-m>24?(t<1/0&&(d=setTimeout(S,t-y.now()-g)),p&&(p=clearInterval(p))):(p||(v=y.now(),p=setInterval(A,1e3)),h=1,b(S)))}function M(t){return+t}function k(t){return t*t}function I(t){return t*(2-t)}function O(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function C(t){return t*t*t}function D(t){return--t*t*t+1}function R(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}w.prototype=E.prototype={constructor:w,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||l===this||(l?l._next=this:f=this,l=this),this._call=t,this._time=n,T()},stop:function(){this._call&&(this._call=null,this._time=1/0,T())}};var N=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),P=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),j=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),G=Math.PI,L=G/2;function B(t){return 1==+t?1:1-Math.cos(t*L)}function U(t){return Math.sin(t*L)}function F(t){return(1-Math.cos(G*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function V(t){return z(1-+t)}function W(t){return 1-z(t)}function X(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function q(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function Y(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var K=7.5625;function Z(t){return 1-Q(1-t)}function Q(t){return(t=+t)<4/11?K*t*t:t<8/11?K*(t-=6/11)*t+3/4:t<10/11?K*(t-=9/11)*t+15/16:K*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-Q(1-t):Q(t-1)+1)/2}var J=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function ut(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function st(){}var ct="\\\\s*([+-]?\\\\d+)\\\\s*",ft="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*",lt="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*",ht=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\\\("+[ct,ct,ct]+"\\\\)$"),pt=new RegExp("^rgb\\\\("+[lt,lt,lt]+"\\\\)$"),vt=new RegExp("^rgba\\\\("+[ct,ct,ct,ft]+"\\\\)$"),mt=new RegExp("^rgba\\\\("+[lt,lt,lt,ft]+"\\\\)$"),gt=new RegExp("^hsl\\\\("+[ft,lt,lt]+"\\\\)$"),yt=new RegExp("^hsla\\\\("+[ft,lt,lt,ft]+"\\\\)$"),bt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function _t(){return this.rgb().formatRgb()}function wt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Et(e):3===n?new Mt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?St(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?St(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dt.exec(t))?new Mt(e[1],e[2],e[3],1):(e=pt.exec(t))?new Mt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=vt.exec(t))?St(e[1],e[2],e[3],e[4]):(e=mt.exec(t))?St(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=gt.exec(t))?Ct(e[1],e[2]/100,e[3]/100,1):(e=yt.exec(t))?Ct(e[1],e[2]/100,e[3]/100,e[4]):bt.hasOwnProperty(t)?Et(bt[t]):"transparent"===t?new Mt(NaN,NaN,NaN,0):null}function Et(t){return new Mt(t>>16&255,t>>8&255,255&t,1)}function St(t,e,n,r){return r<=0&&(t=e=n=NaN),new Mt(t,e,n,r)}function At(t){return t instanceof st||(t=wt(t)),t?new Mt((t=t.rgb()).r,t.g,t.b,t.opacity):new Mt}function Tt(t,e,n,r){return 1===arguments.length?At(t):new Mt(t,e,n,null==r?1:r)}function Mt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function kt(){return"#"+Ot(this.r)+Ot(this.g)+Ot(this.b)}function It(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ot(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ct(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Rt(t,e,n,r)}function Dt(t){if(t instanceof Rt)return new Rt(t.h,t.s,t.l,t.opacity);if(t instanceof st||(t=wt(t)),!t)return new Rt;if(t instanceof Rt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n<r):n===o?(r-e)/u+2:(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new Rt(a,u,s,t.opacity)}function Rt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Pt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}at(st,wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Dt(this).formatHsl()},formatRgb:_t,toString:_t}),at(Mt,Tt,ut(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kt,formatHex:kt,formatRgb:It,toString:It})),at(Rt,(function(t,e,n,r){return 1===arguments.length?Dt(t):new Rt(t,e,n,null==r?1:r)}),ut(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Rt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Rt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Mt(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var jt=function(t){return function(){return t}};function Gt(t,e){return function(n){return t+n*e}}function Lt(t){return 1==(t=+t)?Bt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):jt(isNaN(e)?n:e)}}function Bt(t,e){var n=e-t;return n?Gt(t,n):jt(isNaN(t)?e:t)}var Ut=function t(e){var n=Lt(e);function r(t,e){var r=n((t=Tt(t)).r,(e=Tt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Bt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ft(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;n<i;++n)r=Tt(e[n]),o[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}Ft((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<e-1?t[r+2]:2*o-i;return Pt((n-r/e)*e,a,i,o,u)}})),Ft((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return Pt((n-r/e)*e,i,o,a,u)}}));var zt=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Vt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Wt(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Jt(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Xt=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},qt=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}};function Ht(t){return(Ht="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)}var Yt=function(t,e){var n,r={},i={};for(n in null!==t&&"object"===Ht(t)||(t={}),null!==e&&"object"===Ht(e)||(e={}),e)n in t?r[n]=Jt(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Kt=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Zt=new RegExp(Kt.source,"g");var Qt=function(t,e){var n,r,i,o=Kt.lastIndex=Zt.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=Kt.exec(t))&&(r=Zt.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:qt(n,r)})),o=Zt.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})};function $t(t){return($t="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)}var Jt=function(t,e){var n,r=$t(e);return null==e||"boolean"===r?jt(e):("number"===r?qt:"string"===r?(n=wt(e))?(e=n,Ut):Qt:e instanceof wt?Ut:e instanceof Date?Xt:Vt(e)?zt:Array.isArray(e)?Wt:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Yt:qt)(t,e)},te=n(35),ee=[1,0,0,0,1,0,0,0,1];function ne(t,e,n){var i,o=e.startTime;if(n<o+e.delay||e._paused)return!1;var a=e.duration,u=e.easing;if(n=n-o-e.delay,e.repeat)i=n%a/a,i=r[u](i);else{if(!((i=n/a)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;i=r[u](i)}if(e.onFrame){var c=e.onFrame(i);t.attr(c)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,u,c,f;for(var l in o)if(!Object(s.e)(i[l],o[l]))if("path"===l){var h=o[l],d=i[l];h.length>d.length?(h=te.c(o[l]),d=te.c(i[l]),d=te.a(d,h),d=te.b(d,h),e.fromAttrs.path=d,e.toAttrs.path=h):e.pathFormatted||(h=te.c(o[l]),d=te.c(i[l]),d=te.b(d,h),e.fromAttrs.path=d,e.toAttrs.path=h,e.pathFormatted=!0),r[l]=[];for(var p=0;p<h.length;p++){for(var v=h[p],m=d[p],g=[],y=0;y<v.length;y++)Object(s.h)(v[y])&&m&&Object(s.h)(m[y])?(a=Jt(m[y],v[y]),g.push(a(n))):g.push(v[y]);r[l].push(g)}}else if("matrix"===l){var b=(c=i[l]||ee,(Vt(f=o[l]||ee)?zt:Wt)(c,f))(n);r[l]=b}else["fill","stroke","fillStyle","strokeStyle"].includes(l)&&(u=o[l],/^[r,R,L,l]{1}[\\s]*\\(/.test(u))?r[l]=o[l]:Object(s.f)(o[l])||(a=Jt(i[l],o[l]),r[l]=a(n));t.attr(r)}}(t,e,i);return!1}var re=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=E((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],ne(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ie=n(84),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function ue(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(u.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var se=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(u.a)(oe,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(u.a)(oe,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ie.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var u=this.canvas;u.get("el").style.cursor=r.attr("cursor")||u.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var u=this.mousedownShape,s=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,f=a.clientY-t.clientY;s>120||c*c+f*f>40?u&&u.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,ae(r,t,a);for(var u=r.getParent();u;)u.emitDelegation(t,a),a.propagationStopped||ue(u,t,a),a.propagationPath.push(u),u=u.getParent()}else{ae(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ce=Object(o.a)(),fe=ce&&"firefox"===ce.name;!function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(u.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new se({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");u.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");u.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(fe&&!Object(u.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(u.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))}}(a.a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},e.length=o,e.fromValues=a,e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},e.subtract=u,e.multiply=s,e.divide=c,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},e.distance=f,e.squaredDistance=l,e.squaredLength=h,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},e.normalize=d,e.dot=p,e.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2];return t[0]=i*s-o*u,t[1]=o*a-r*s,t[2]=r*u-i*a,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},e.hermite=function(t,e,n,r,i,o){var a=o*o,u=a*(2*o-3)+1,s=a*(o-2)+o,c=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*u+n[0]*s+r[0]*c+i[0]*f,t[1]=e[1]*u+n[1]*s+r[1]*c+i[1]*f,t[2]=e[2]*u+n[2]*s+r[2]*c+i[2]*f,t},e.bezier=function(t,e,n,r,i,o){var a=1-o,u=a*a,s=o*o,c=u*a,f=3*o*u,l=3*s*a,h=s*o;return t[0]=e[0]*c+n[0]*f+r[0]*l+i[0]*h,t[1]=e[1]*c+n[1]*f+r[1]*l+i[1]*h,t[2]=e[2]*c+n[2]*f+r[2]*l+i[2]*h,t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI,i=2*r.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},e.transformQuat=function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=i*c-o*s,l=o*u-r*c,h=r*s-i*u,d=i*h-o*l,p=o*f-r*h,v=r*l-i*f,m=2*a;return f*=m,l*=m,h*=m,d*=2,p*=2,v*=2,t[0]=u+f+d,t[1]=s+l+p,t[2]=c+h+v,t},e.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},e.angle=function(t,e){var n=a(t[0],t[1],t[2]),r=a(e[0],e[1],e[2]);d(n,n),d(r,r);var i=p(n,r);return i>1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],u=e[1],s=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-s)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(s))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(88));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function a(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function u(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function f(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function h(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function d(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}var v;e.sub=u,e.mul=s,e.div=c,e.dist=f,e.sqrDist=l,e.len=o,e.sqrLen=h,e.forEach=(v=i(),function(t,e,n,r,i,o){var a=void 0,u=void 0;for(e||(e=3),n||(n=0),u=r?Math.min(r*e+n,t.length):t.length,a=n;a<u;a+=e)v[0]=t[a],v[1]=t[a+1],v[2]=t[a+2],i(v,v,o),t[a]=v[0],t[a+1]=v[1],t[a+2]=v[2];return t})},function(t,e,n){"use strict";n(35),n(178),n(179);var r=n(84);n.d(e,"Event",(function(){return r.a}));n(85),n(217),n(186),n(187),n(403).version},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r},i=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},a=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},u=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},s=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/,f=[["aol",/AOLShield\\/([0-9\\._]+)/],["edge",/Edge\\/([0-9\\._]+)/],["edge-ios",/EdgiOS\\/([0-9\\._]+)/],["yandexbrowser",/YaBrowser\\/([0-9\\._]+)/],["kakaotalk",/KAKAOTALK\\s([0-9\\.]+)/],["samsung",/SamsungBrowser\\/([0-9\\.]+)/],["silk",/\\bSilk\\/([0-9._-]+)\\b/],["miui",/MiuiBrowser\\/([0-9\\.]+)$/],["beaker",/BeakerBrowser\\/([0-9\\.]+)/],["edge-chromium",/EdgA?\\/([0-9\\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],["phantomjs",/PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],["crios",/CriOS\\/([0-9\\.]+)(:?\\s|$)/],["firefox",/Firefox\\/([0-9\\.]+)(?:\\s|$)/],["fxios",/FxiOS\\/([0-9\\.]+)/],["opera-mini",/Opera Mini.*Version\\/([0-9\\.]+)/],["opera",/Opera\\/([0-9\\.]+)(?:\\s|$)/],["opera",/OPR\\/([0-9\\.]+)(:?\\s|$)/],["ie",/Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],["ie",/MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],["ie",/MSIE\\s(7\\.0)/],["bb10",/BB10;\\sTouch.*Version\\/([0-9\\.]+)/],["android",/Android\\s([0-9\\.]+)/],["ios",/Version\\/([0-9\\._]+).*Mobile.*Safari.*/],["safari",/Version\\/([0-9\\._]+).*Safari/],["facebook",/FBAV\\/([0-9\\.]+)/],["instagram",/Instagram\\s([0-9\\.]+)/],["ios-webview",/AppleWebKit\\/([0-9\\.]+).*Mobile/],["ios-webview",/AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],l=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\\/2/]];function h(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new s:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&f.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],o=e[1];if("searchbot"===n)return new u;var s=o[1]&&o[1].split(/[._]/).slice(0,3);s?s.length<3&&(s=r(s,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-s.length))):s=[];var f=s.join("."),h=function(t){for(var e=0,n=l.length;e<n;e++){var r=l[e],i=r[0];if(r[1].exec(t))return i}return null}(t),p=c.exec(t);return p&&p[1]?new a(n,f,h,p[1]):new i(n,f,h)}}).call(this,n(185))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(443);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){var r=n(163);t.exports=function(t){return t&&t.length?r(t):[]}},function(t,e,n){var r,i,o;function a(t){return(a="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)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t};function n(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,e){t||n(e)}function i(t){return t?": "+t:""}function o(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"===a(t);case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"===a(t)}}function u(t,e,r){e.indexOf(t)<0&&n("invalid value"+i(r)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\\n\\s*at.*\\((.*)\\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\\n\\s*at\\s+(.*)(\\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\\n\\s+at.*\\((.*)\\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\\n\\s+at\\s+(.*)\\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\\s*#\\s*(\\w+)\\s+(.+)\\s*$/.exec(s);if(c)switch(c[1]){case"line":var h=/(\\d+)(\\s+\\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function m(t){t._commandRef=d()}function g(t,e){var r=p();n(t+" in command "+(e||d())+("unknown"===r?"":" called from "+r))}function y(t,e,n,r){o(t,e)||g("invalid parameter type"+i(n)+". expected "+e+", got "+a(t),r||d())}var b={};function x(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:b[t]*e}function _(t){return!(t&t-1||!t)}b[5120]=b[5121]=1,b[5122]=b[5123]=b[36193]=b[33635]=b[32819]=b[32820]=2,b[5124]=b[5125]=b[5126]=b[34042]=4;var w=e(r,{optional:function(t){t()},raise:n,commandRaise:g,command:function(t,e,n){t||g(e,n||d())},parameter:function(t,e,r){t in e||n("unknown parameter ("+t+")"+i(r)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||g("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&n(\'invalid regl constructor argument "\'+t+\'". must be one of \'+s)}))},type:function(t,e,r){o(t,e)||n("invalid parameter type"+i(r)+". expected "+e+", got "+a(t))},commandType:y,isTypedArray:function(e,r){t(e)||n("invalid parameter type"+i(r)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),u=i===t.FRAGMENT_SHADER?"fragment":"vertex";y(n,"string",u+" shader source must be a string",o);var s=v(n,o),f=function(t){var e=[];return t.split("\\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\\s+(\\d+):(\\d+):\\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))}(s,f),Object.keys(s).forEach((function(t){var e=s[t];if(e.hasErrors){var n=[""],r=[""];i("file number "+t+": "+e.name+"\\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var r=n.message,o=/^\\s*\'(.*)\'\\s*:\\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(c("| ",6)),i(c("^^^",e+3)+"\\n","font-weight:bold"),i(c("| ",6)),i(r+"\\n","font-weight:bold")})),i(c("| ",6)+"\\n")}else i(c(t.number,4)+"| "),i(t.line+"\\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+u+" shader, "+s[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),u=v(n,o),s=\'Error linking program with vertex shader, "\'+v(i,o)[0].name+\'", and fragment shader "\'+u[0].name+\'"\';"undefined"!=typeof document?console.log("%c"+s+"\\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(s+"\\n"+a),r.raise(s)}},callSite:p,saveCommandRef:m,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}m(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var u=t._attributeSet={};o(u,n.static),o(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var i,o=e.width,a=e.height,u=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(_(o)&&_(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(_(o)&&_(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(i=0;i<16;++i)if(s[i]){var c=o>>i,f=a>>i;r(e.mipmask&1<<i,"missing mipmap data");var l=s[i];if(r(l.width===c&&l.height===f,"invalid shape for mip images"),r(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var h=Math.ceil(x(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;r(l.data.byteLength===h*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||r(0==(e.mipmask&1<<i),"extra mipmap data");e.compressed&&r(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,i){var o=t.width,a=t.height,u=t.channels;r(o>0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];r(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(r(!c.compressed,"can not generate mipmap for compressed textures"),r(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var h=f[l];if(h){var d=o>>l,p=a>>l;r(c.mipmask&1<<l,"missing mipmap data"),r(h.width===d&&h.height===p,"invalid shape for mip images"),r(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed||(h.data?r(h.data.byteLength===d*p*Math.max(x(h.type,u),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),E=0;function S(t,e){this.id=E++,this.type=t,this.data=e}function A(t){return t.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function T(t){return"["+function t(e){if(0===e.length)return[];var n=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&n===r&&(\'"\'===n||"\'"===n))return[\'"\'+A(e.substr(1,e.length-2))+\'"\'];var i=/\\[(false|true|null|\\d+|\'[^\']*\'|"[^"]*")\\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return[\'"\'+A(e)+\'"\'];for(var a=[],u=0;u<o.length;++u)a=a.concat(t(o[u]));return a}(t).join("][")+"]"}var M={DynamicVariable:S,define:function(t,e){return new S(t,T(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof S},unbox:function t(e,n){return"function"==typeof e?new S(0,e):"number"==typeof e||"boolean"==typeof e?new S(5,e):Array.isArray(e)?new S(6,e.map((function(e,r){return t(e,n+"["+r+"]")}))):e instanceof S?e:void w(!1,"invalid option type in uniform "+n)},accessor:T},k={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},I="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function O(t){return"string"==typeof t?t.split():(w(Array.isArray(t),"invalid extension array"),t)}function C(t){return"string"==typeof t?(w("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function D(t){var n,r,i,o,u,s=t||{},c={},f=[],l=[],h="undefined"==typeof window?1:window.devicePixelRatio,d=!1,p=function(t){t&&w.raise(t)},v=function(){};if("string"==typeof s?(w("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),w(n,"invalid query string for element")):"object"===a(s)?"string"==typeof(u=s).nodeName&&"function"==typeof u.appendChild&&"function"==typeof u.getBoundingClientRect?n=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(w.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=C(s.canvas):"container"in s&&(r=C(s.container)),"attributes"in s&&(c=s.attributes,w.type(c,"object","invalid context attributes")),"extensions"in s&&(f=O(s.extensions)),"optionalExtensions"in s&&(l=O(s.optionalExtensions)),"onDone"in s&&(w.type(s.onDone,"function","invalid or missing onDone callback"),p=s.onDone),"profile"in s&&(d=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,w(h>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){w("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var m=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!m)return null;i=m.canvas,v=m.onDestroy}void 0===c.premultipliedAlpha&&(c.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,c)}return o?{gl:o,canvas:i,container:r,extensions:f,optionalExtensions:l,pixelRatio:h,profile:d,onDone:p,onDestroy:v}:(v(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function R(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function N(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function P(){var t=R(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[N(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var j=P();function G(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}j.zero=P();var L=function(t){return Object.keys(t).map((function(e){return t[e]}))},B={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||j.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],u=0;u<n;++u)r[i++]=a[u]}(t,e[0],e[1],a);break;case 3:U(t,e[0],e[1],e[2],a,0);break;default:!function t(e,n,r,i,o){for(var a=1,u=r+1;u<n.length;++u)a*=n[u];var s=n[r];if(n.length-r==4){var c=n[r+1],f=n[r+2],l=n[r+3];for(u=0;u<s;++u)U(e[u],c,f,l,i,o),o+=a}else for(u=0;u<s;++u)t(e[u],n,r+1,i,o),o+=a}(t,e,0,a,0)}return a}};function U(t,e,n,r,i,o){for(var a=o,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[a++]=f[l]}var F={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},z={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},V={dynamic:35048,stream:35040,static:35044},W=B.flatten,X=B.shape,q=[];function H(t){return 0|F[Object.prototype.toString.call(t)]}function Y(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function K(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[i*s+o*c+a]}q[5120]=1,q[5122]=2,q[5124]=4,q[5121]=1,q[5123]=2,q[5125]=4,q[5126]=4;var Z={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Q=new Float32Array(1),$=new Uint32Array(Q.buffer);function J(t){for(var e=j.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{Q[0]=t[n];var r=$[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var u=-14-o;e[n]=i+(a+1024>>u)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function tt(e){return Array.isArray(e)||t(e)}var et=function(t){return!(t&t-1||!t)},nt=[9984,9986,9985,9987],rt=[0,6409,6410,6407,6408],it={};function ot(t){return"[object "+t+"]"}it[6409]=it[6406]=it[6402]=1,it[34041]=it[6410]=2,it[6407]=it[35904]=3,it[6408]=it[35906]=4;var at=ot("HTMLCanvasElement"),ut=ot("OffscreenCanvas"),st=ot("CanvasRenderingContext2D"),ct=ot("ImageBitmap"),ft=ot("HTMLImageElement"),lt=ot("HTMLVideoElement"),ht=Object.keys(F).concat([at,ut,st,ct,ft,lt]),dt=[];dt[5121]=1,dt[5126]=4,dt[36193]=2,dt[5123]=2,dt[5125]=4;var pt=[];function vt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function mt(t){return!!Array.isArray(t)&&!(0===t.length||!tt(t[0]))}function gt(t){return Object.prototype.toString.call(t)}function yt(t){return gt(t)===at}function bt(t){return gt(t)===ut}function xt(t){if(!t)return!1;var e=gt(t);return ht.indexOf(e)>=0||vt(t)||mt(t)||G(t)}function _t(t){return 0|F[Object.prototype.toString.call(t)]}function wt(t,e){return j.allocType(36193===t.type?5126:t.type,e)}function Et(t,e){36193===t.type?(t.data=J(e),j.freeType(e)):t.data=e}function St(t,e,n,r,i,o){var a;if(a=void 0!==pt[t]?pt[t]:it[t]*dt[e],o&&(a*=6),i){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function At(n,r,i,o,u,s,c){var f={"don\'t care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},d=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),p={none:0,browser:37444},v={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},m={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},g={};r.ext_srgb&&(m.srgb=35904,m.srgba=35906),r.oes_texture_float&&(v.float32=v.float=5126),r.oes_texture_half_float&&(v.float16=v["half float"]=36193),r.webgl_depth_texture&&(e(m,{depth:6402,"depth stencil":34041}),e(v,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(m[t]=e)}));var b=Object.keys(m);i.textureFormats=b;var x=[];Object.keys(m).forEach((function(t){var e=m[t];x[e]=t}));var _=[];Object.keys(v).forEach((function(t){var e=v[t];_[e]=t}));var E=[];Object.keys(h).forEach((function(t){E[h[t]]=t}));var S=[];Object.keys(d).forEach((function(t){var e=d[t];S[e]=t}));var A=[];Object.keys(l).forEach((function(t){A[l[t]]=t}));var T=b.reduce((function(t,e){var n=m[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function M(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function k(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function I(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(w.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(w.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(w.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(w.parameter(e.colorSpace,p,"invalid colorSpace"),t.colorSpace=p[e.colorSpace]),"type"in e){var n=e.type;w(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),w(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),w(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(n,v,"invalid texture type"),t.type=v[n]}var o=t.width,u=t.height,s=t.channels,c=!1;"shape"in e?(w(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],u=e.shape[1],3===e.shape.length&&(s=e.shape[2],w(s>0&&s<=4,"invalid number of channels"),c=!0),w(o>=0&&o<=i.maxTextureSize,"invalid width"),w(u>=0&&u<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=u=e.radius,w(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,w(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(u=e.height,w(u>=0&&u<=i.maxTextureSize,"invalid height")),"channels"in e&&(s=e.channels,w(s>0&&s<=4,"invalid number of channels"),c=!0)),t.width=0|o,t.height=0|u,t.channels=0|s;var f=!1;if("format"in e){var l=e.format;w(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(l,m,"invalid texture format");var h=t.internalformat=m[l];t.format=T[h],l in v&&("type"in e||(t.type=v[l])),l in g&&(t.compressed=!0),f=!0}!c&&f?t.channels=it[t.format]:c&&!f?t.channels!==rt[t.format]&&(t.format=t.internalformat=rt[t.channels]):f&&c&&w(t.channels===it[t.format],"number of channels inconsistent with specified format")}}function O(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function C(){M.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function D(e,n){var r=null;if(xt(n)?r=n:n&&(w.type(n,"object","invalid pixel data type"),I(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),xt(n.data)&&(r=n.data)),w(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){w(!r,"can not specify copy and data field for the same texture");var o=u.viewportWidth,a=u.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,w(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<a&&e.width>0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=_t(r));else if(vt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=j.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=J(e);break;default:w.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(G(r)){var s=r.data;Array.isArray(s)||5121!==e.type||(e.type=_t(s));var c,f,l,h,d,p,v=r.shape,m=r.stride;3===v.length?(l=v[2],p=m[2]):(w(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],h=m[0],d=m[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=rt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,u=t.height,s=t.channels,c=wt(t,a*u*s),f=0,l=0;l<u;++l)for(var h=0;h<a;++h)for(var d=0;d<s;++d)c[f++]=e[n*h+r*l+i*d+o];Et(t,c)}(e,s,h,d,p,r.offset)}else if(yt(r)||bt(r)||gt(r)===st)yt(r)||bt(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return gt(t)===ct}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return gt(t)===ft}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return gt(t)===lt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(mt(r)){var g=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=tt(r[0][0])?b||r[0][0].length:b||1;for(var x=B.shape(r),_=1,E=0;E<x.length;++E)_*=x[E];var S=wt(e,_);B.flatten(r,x,"",S),Et(e,S),e.alignment=1,e.width=g,e.height=y,e.channels=b,e.format=e.internalformat=rt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;5126===e.type?w(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):36193===e.type&&w(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function R(t,e,r){var i=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;O(t),i?n.texImage2D(e,r,s,s,c,i):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function N(t,e,r,i,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;O(t),u?n.texSubImage2D(e,a,r,i,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,s):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,s)}var P=[];function U(){return P.pop()||new C}function F(t){t.needsFree&&j.freeType(t.data),C.call(t),P.push(t)}function z(){M.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function V(t,e,n){var r=t.images[0]=U();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function W(t,e){var n=null;if(xt(e))k(n=t.images[0]=U(),t),D(n,e),t.mipmask=1;else if(I(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)k(n=t.images[i]=U(),t),n.width>>=i,n.height>>=i,D(n,r[i]),t.mipmask|=1<<i;else k(n=t.images[0]=U(),t),D(n,e),t.mipmask=1;k(t,t.images[0]),!t.compressed||33776!==t.internalformat&&33777!==t.internalformat&&33778!==t.internalformat&&33779!==t.internalformat||w(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function X(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;R(n[r],e,r)}}var q=[];function H(){var t=q.pop()||new z;M.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function Y(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&F(e[n]),e[n]=null;q.push(t)}function K(){this.minFilter=9728,this.magFilter=9728,this.wrapS=33071,this.wrapT=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function Z(t,e){if("min"in e){var n=e.min;w.parameter(n,d),t.minFilter=d[n],nt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;w.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,u=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(w.parameter(s,l),o=u=l[s]):Array.isArray(s)&&(w.parameter(s[0],l),w.parameter(s[1],l),o=l[s[0]],u=l[s[1]])}else{if("wrapS"in e){var c=e.wrapS;w.parameter(c,l),o=l[c]}if("wrapT"in e){var p=e.wrapT;w.parameter(p,l),u=l[p]}}if(t.wrapS=o,t.wrapT=u,"anisotropic"in e){var v=e.anisotropic;w("number"==typeof v&&v>=1&&v<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var m=!1;switch(a(e.mipmap)){case"string":w.parameter(e.mipmap,f,"invalid mipmap hint"),t.mipmapHint=f[e.mipmap],t.genMipmaps=!0,m=!0;break;case"boolean":m=t.genMipmaps=e.mipmap;break;case"object":w(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,m=!0;break;default:w.raise("invalid mipmap type")}m&&!("min"in e)&&(t.minFilter=9984)}}function Q(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,ot={},at=i.maxTextureUnits,ut=Array(at).map((function(){return null}));function ht(t){M.call(this),this.mipmask=0,this.internalformat=6408,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new K,c.profile&&(this.stats={size:0})}function dt(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function pt(){var t=ut[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function At(t){var e=t.texture;w(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),ut[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ot[t.id],s.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e<at;++e){var r=ut[e];if(r){if(r.bindCount>0)continue;r.unit=-1}ut[e]=this,t=e;break}t>=at&&w.raise("insufficient number of texture units"),c.profile&&s.maxTextureUnits<t+1&&(s.maxTextureUnits=t+1),this.unit=t,n.activeTexture(33984+t),n.bindTexture(this.target,this.texture)}return t},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&At(this)}}),c.profile&&(s.getTotalTextureSize=function(){var t=0;return Object.keys(ot).forEach((function(e){t+=ot[e].stats.size})),t}),{create2D:function(t,e){var r=new ht(3553);function o(t,e){var n=r.texInfo;K.call(n);var a=H();return"number"==typeof t?V(a,0|t,"number"==typeof e?0|e:0|t):t?(w.type(t,"object","invalid arguments to regl.texture"),Z(n,t),W(a,t)):V(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,k(r,a),w.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,dt(r),X(a,3553),Q(n,3553),pt(),Y(a),c.profile&&(r.stats.size=St(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=x[r.internalformat],o.type=_[r.type],o.mag=E[n.magFilter],o.min=S[n.minFilter],o.wrapS=A[n.wrapS],o.wrapT=A[n.wrapT],o}return ot[r.id]=r,s.textureCount++,o(t,e),o.subimage=function(t,e,n,i){w(!!t,"must specify image data");var a=0|e,u=0|n,s=0|i,c=U();return k(c,r),c.width=0,c.height=0,D(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,w(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),w(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),w(r.mipmask&1<<s,"missing mipmap data"),w(c.data||c.element||c.needsCopy,"missing image data"),dt(r),N(c,3553,a,u,s),pt(),F(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,dt(r);for(var u=0;r.mipmask>>u;++u){var s=i>>u,f=a>>u;if(!s||!f)break;n.texImage2D(3553,u,r.format,s,f,0,r.format,r.type,null)}return pt(),c.profile&&(r.stats.size=St(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,c.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,u,f){var l=new ht(34067);ot[l.id]=l,s.cubeCount++;var h=new Array(6);function d(t,e,n,r,o,u){var s,f=l.texInfo;for(K.call(f),s=0;s<6;++s)h[s]=H();if("number"!=typeof t&&t)if("object"===a(t))if(e)W(h[0],t),W(h[1],e),W(h[2],n),W(h[3],r),W(h[4],o),W(h[5],u);else if(Z(f,t),I(l,t),"faces"in t){var p=t.faces;for(w(Array.isArray(p)&&6===p.length,"cube faces must be a length 6 array"),s=0;s<6;++s)w("object"===a(p[s])&&!!p[s],"invalid input for cube map face"),k(h[s],l),W(h[s],p[s])}else for(s=0;s<6;++s)W(h[s],t);else w.raise("invalid arguments to cube map");else{var v=0|t||1;for(s=0;s<6;++s)V(h[s],v,v)}for(k(l,h[0]),i.npotTextureCube||w(et(l.width)&&et(l.height),"your browser does not support non power or two texture dimensions"),f.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,w.textureCube(l,f,h,i),l.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,dt(l),s=0;s<6;++s)X(h[s],34069+s);for(Q(f,34067),pt(),c.profile&&(l.stats.size=St(l.internalformat,l.type,d.width,d.height,f.genMipmaps,!0)),d.format=x[l.internalformat],d.type=_[l.type],d.mag=E[f.magFilter],d.min=S[f.minFilter],d.wrapS=A[f.wrapS],d.wrapT=A[f.wrapT],s=0;s<6;++s)Y(h[s]);return d}return d(t,e,r,o,u,f),d.subimage=function(t,e,n,r,i){w(!!e,"must specify image data"),w("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,u=0|i,s=U();return k(s,l),s.width=0,s.height=0,D(s,e),s.width=s.width||(l.width>>u)-o,s.height=s.height||(l.height>>u)-a,w(l.type===s.type&&l.format===s.format&&l.internalformat===s.internalformat,"incompatible format for texture.subimage"),w(o>=0&&a>=0&&o+s.width<=l.width&&a+s.height<=l.height,"texture.subimage write out of bounds"),w(l.mipmask&1<<u,"missing mipmap data"),w(s.data||s.element||s.needsCopy,"missing image data"),dt(l),N(s,34069+t,o,a,u),pt(),F(s),d},d.resize=function(t){var e=0|t;if(e!==l.width){d.width=l.width=e,d.height=l.height=e,dt(l);for(var r=0;r<6;++r)for(var i=0;l.mipmask>>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return pt(),c.profile&&(l.stats.size=St(l.internalformat,l.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=l,c.profile&&(d.stats=l.stats),d.destroy=function(){l.decRef()},d},clear:function(){for(var t=0;t<at;++t)n.activeTexture(33984+t),n.bindTexture(3553,null),ut[t]=null;L(ot).forEach(At),s.cubeCount=0,s.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<at;++t){var e=ut[t];e&&(e.bindCount=0,e.unit=-1,ut[t]=null)}L(ot).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(3553===t.target)n.texImage2D(3553,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Q(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<at;++t){var e=ut[t];e&&(e.bindCount=0,e.unit=-1,ut[t]=null),n.activeTexture(33984+t),n.bindTexture(3553,null),n.bindTexture(34067,null)}}}}pt[32854]=2,pt[32855]=2,pt[36194]=2,pt[34041]=4,pt[33776]=.5,pt[33777]=.5,pt[33778]=1,pt[33779]=1,pt[35986]=.5,pt[35987]=1,pt[34798]=1,pt[35840]=.5,pt[35841]=.25,pt[35842]=.5,pt[35843]=.25,pt[36196]=.5;var Tt=[];function Mt(t,e,n){return Tt[t]*e*n}Tt[32854]=2,Tt[32855]=2,Tt[36194]=2,Tt[33189]=2,Tt[36168]=1,Tt[34041]=4,Tt[35907]=4,Tt[34836]=16,Tt[34842]=8,Tt[34843]=6;var kt=[6407,6408],It=[];It[6408]=4,It[6407]=3;var Ot=[];Ot[5121]=1,Ot[5126]=4,Ot[36193]=2;var Ct=[32854,32855,36194,35907,34842,34843,34836],Dt={};function Rt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function Nt(e,n,r,i,o,a,u){function s(s){var c;null===n.next?(w(o.preserveDrawingBuffer,\'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer\'),c=5121):(w(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(w(5121===c||5126===c,"Reading from a framebuffer is only allowed for the types \'uint8\' and \'float\'"),5126===c&&w(u.readFloat,"Reading \'float\' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):w(5121===c,"Reading from a framebuffer is only allowed for the type \'uint8\'"));var f=0,l=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;t(s)?p=s:s&&(w.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,w(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),w(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(s.width||i.framebufferWidth-f),d=0|(s.height||i.framebufferHeight-l),p=s.data||null),p&&(5121===c?w(p instanceof Uint8Array,"buffer must be \'Uint8Array\' when reading from a framebuffer of type \'uint8\'"):5126===c&&w(p instanceof Float32Array,"buffer must be \'Float32Array\' when reading from a framebuffer of type \'float\'")),w(h>0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),w(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var v=h*d*4;return p||(5121===c?p=new Uint8Array(v):5126===c&&(p=p||new Float32Array(v))),w.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),w(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Pt(t){return Array.prototype.slice.call(t)}function jt(t){return Pt(t).join("")}Dt[36053]="complete",Dt[36054]="incomplete attachment",Dt[36057]="incomplete dimensions",Dt[36055]="incomplete, missing attachment",Dt[36061]="unsupported";var Gt="xyzw".split(""),Lt="profile",Bt="framebuffer",Ut="vert",Ft="frag",zt="elements",Vt="primitive",Wt="count",Xt="offset",qt="instances",Ht="vao",Yt=Bt+"Width",Kt=Bt+"Height",Zt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Qt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},$t=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Jt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},te={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ee={frag:35632,vert:35633},ne={cw:2304,ccw:2305};function re(e){return Array.isArray(e)||t(e)||G(e)}function ie(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1}))}function oe(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function ae(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function ue(t){return new oe(!1,!1,!1,t)}function se(t,e){var n=t.type;if(0===n){var r=t.data.length;return new oe(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new oe(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new oe(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(1===c.type)u=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new oe(o,a,u,e)}return new oe(3===n,2===n,1===n,e)}var ce=new oe(!1,!1,!1,(function(){}));function fe(t,n,r,i,o,u,s,c,f,l,h,d,p,v,m){var g=l.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var b=r.angle_instanced_arrays,x=r.webgl_draw_buffers,_={dirty:!0,profile:m.profile},E={},S=[],A={},T={};function k(t){return t.replace(".","_")}function I(t,e,n){var r=k(t);S.push(t),E[r]=_[r]=!!n,A[r]=e}function O(t,e,n){var r=k(t);S.push(t),Array.isArray(n)?(_[r]=n.slice(),E[r]=n.slice()):_[r]=E[r]=n,T[r]=e}I("dither",3024),I("blend.enable",3042),O("blend.color","blendColor",[0,0,0,0]),O("blend.equation","blendEquationSeparate",[32774,32774]),O("blend.func","blendFuncSeparate",[1,0,1,0]),I("depth.enable",2929,!0),O("depth.func","depthFunc",513),O("depth.range","depthRange",[0,1]),O("depth.mask","depthMask",!0),O("colorMask","colorMask",[!0,!0,!0,!0]),I("cull.enable",2884),O("cull.face","cullFace",1029),O("frontFace","frontFace",2305),O("lineWidth","lineWidth",1),I("polygonOffset.enable",32823),O("polygonOffset.offset","polygonOffset",[0,0]),I("sample.alpha",32926),I("sample.enable",32928),O("sample.coverage","sampleCoverage",[1,!1]),I("stencil.enable",2960),O("stencil.mask","stencilMask",-1),O("stencil.func","stencilFunc",[519,0,-1]),O("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),O("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),I("scissor.enable",3089),O("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),O("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var C={gl:t,context:p,strings:n,next:E,current:_,draw:d,elements:u,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:f,framebuffer:c,extensions:r,timer:v,isBufferArgs:re},D={primTypes:Z,compareFuncs:Jt,blendFuncs:Qt,blendEquations:y,stencilOps:te,glTypes:z,orientationType:ne};w.optional((function(){C.isArrayLike=tt})),x&&(D.backBuffer=[1029],D.drawBuffer=R(i.maxDrawbuffers,(function(t){return 0===t?[0]:R(t,(function(t){return 36064+t}))})));var N=0;function P(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Pt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Pt(arguments)),n.push(";")),e},toString:function(){return jt([r.length>0?"var "+r.join(",")+";":"",jt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Pt(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),u={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var s=o(),c=s.toString;return u[t]=e(s,{arg:i,toString:function(){return jt(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=jt(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Pt(arguments)),this},else:function(){return r.apply(r,Pt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),jt(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=[\'"use strict";\',a,"return {"];Object.keys(u).forEach((function(e){t.push(\'"\',e,\'":\',u[e].toString(),",")})),t.push("}");var e=jt(t).replace(/;/g,";\\n").replace(/}/g,"}\\n").replace(/{/g,"{\\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=N++,t.batchId="0";var o=r(C),a=t.shared={props:"a0"};Object.keys(C).forEach((function(t){a[t]=i.def(o,".",t)})),w.optional((function(){t.CHECK=r(w),t.commandStr=w.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},D.invalidBlendCombinations=$t}));var u=t.next={},s=t.current={};Object.keys(T).forEach((function(t){Array.isArray(_[t])&&(u[t]=i.def(a.next,".",t),s[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(D).forEach((function(t){c[t]=i.def(JSON.stringify(D[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var f={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in f)return f[e];var i=l.scope[e];return i||(i=l.scope[e]=new g),f[e]=r(i)},t}function j(t,e,s,f,d){var p=t.static,v=t.dynamic;w.optional((function(){var t=[Bt,Ut,Ft,zt,Vt,Xt,Wt,qt,Lt,Ht].concat(S);function e(e){Object.keys(e).forEach((function(e){w.command(t.indexOf(e)>=0,\'unknown parameter "\'+e+\'"\',d.commandStr)}))}e(p),e(v)}));var m=function(t,e){var n=t.static;if("string"==typeof n[Ft]&&"string"==typeof n[Ut]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)w("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),x=function(t,e){var n=t.static,r=t.dynamic;if(Bt in n){var i=n[Bt];return i?(i=c.getFramebuffer(i),w.command(i,"invalid framebuffer object"),ue((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+Yt,n+".width"),e.set(o,"."+Kt,n+".height"),n}))):ue((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+Yt,r+".drawingBufferWidth"),e.set(r,"."+Kt,r+".drawingBufferHeight"),"null"}))}if(Bt in r){var o=r[Bt];return se(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");w.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var u=r.context;return e.set(u,"."+Yt,a+"?"+a+".width:"+u+".drawingBufferWidth"),e.set(u,"."+Kt,a+"?"+a+".height:"+u+".drawingBufferHeight"),a}))}return null}(t),_=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];w.commandType(o,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,w.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in o?(u=0|o.height,w.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new oe(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",Yt,"-",c));var i=u;return"height"in o||(i=e.def(n,".",Kt,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=se(l,(function(e,n){var r=e.invoke(n,l);w.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def(\'"width" in \',r,"?",r,".width|0:","(",i,".",Yt,"-",o,")"),s=n.def(\'"height" in \',r,"?",r,".height|0:","(",i,".",Kt,"-",a,")");return w.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[o,a,u,s]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new oe(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Yt),e.def(n,".",Kt)]})):null}var a=o("viewport");if(a){var u=a;a=new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,x,d),E=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];re(t)?t=u.getElements(u.create(t,!0)):t&&(t=u.getElements(t),w.command(t,"invalid elements",e.commandStr));var i=ue((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return se(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",i,".createStream(",a,");").else(u,"=",i,".getElements(",a,");");return w.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(i,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return w.command(!o||a>=0,"invalid "+t,e.commandStr),ue((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return se(u,(function(e,n){var r=e.invoke(n,u);return o&&(e.OFFSET=r,w.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?ue((function(t,e){return t.OFFSET="0",0})):null}var a=o(Xt,!0);return{elements:i,primitive:function(){if(Vt in n){var t=n[Vt];return w.commandParameter(t,Z,"invalid primitve",e.commandStr),ue((function(e,n){return Z[t]}))}if(Vt in r){var o=r[Vt];return se(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return w.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Z))})),e.def(n,"[",r,"]")}))}return i?ae(i)?i.value?ue((function(t,e){return e.def(t.ELEMENTS,".primType")})):ue((function(){return 4})):new oe(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Wt in n){var t=0|n[Wt];return w.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ue((function(){return t}))}if(Wt in r){var o=r[Wt];return se(o,(function(t,e){var n=t.invoke(e,o);return w.optional((function(){t.assert(e,"typeof "+n+\'==="number"&&\'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(ae(i)){if(i)return a?new oe(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return w.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):ue((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var u=ue((function(){return-1}));return w.optional((function(){u.MISSING=!0})),u}var s=new oe(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return w.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:o(qt,!1),offset:a}}(t,d),A=function(t,e){var n=t.static,r=t.dynamic,o={};return S.forEach((function(t){var u=k(t);function s(e,i){if(t in n){var a=e(n[t]);o[u]=ue((function(){return a}))}else if(t in r){var s=r[t];o[u]=se(s,(function(t,e){return i(t,e,t.invoke(e,s))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return s((function(n){return w.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return w.optional((function(){e.assert(n,"typeof "+r+\'==="boolean"\',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return s((function(n){return w.commandParameter(n,Jt,"invalid "+t,e.commandStr),Jt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return w.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Jt))})),n.def(i,"[",r,"]")}));case"depth.range":return s((function(t){return w.command(tt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+\'[0]==="number"&&typeof \'+n+\'[1]==="number"&&\'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case"blend.func":return s((function(t){w.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return w.commandParameter(n,Qt,u+".srcRGB",e.commandStr),w.commandParameter(r,Qt,u+".srcAlpha",e.commandStr),w.commandParameter(i,Qt,u+".dstRGB",e.commandStr),w.commandParameter(o,Qt,u+".dstAlpha",e.commandStr),w.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Qt[n],Qt[i],Qt[r],Qt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var u=n.def(\'"\',o,a,\'" in \',r,"?",r,".",o,a,":",r,".",o);return w.optional((function(){e.assert(n,u+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Qt))})),u}w.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid blend func, must be an object")}));var a=o("src","RGB"),u=o("dst","RGB");w.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+\'+", "+\'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return s((function(n){return"string"==typeof n?(w.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"===a(n)?(w.commandParameter(n.rgb,y,t+".rgb",e.commandStr),w.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void w.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),u=e.cond("typeof ",r,\'==="string"\');return w.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+\'==="object"\',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(o,"=",a,"=",i,"[",r,"];"),u.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(u),[o,a]}));case"blend.color":return s((function(t){return w.command(tt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),R(4,(function(e){return+t[e]}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),R(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return s((function(t){return w.commandType(t,"number",u,e.commandStr),0|t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+\'==="number"\',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return s((function(n){w.commandType(n,"object",u,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return w.commandParameter(r,Jt,t+".cmp",e.commandStr),w.commandType(i,"number",t+".ref",e.commandStr),w.commandType(o,"number",t+".mask",e.commandStr),[Jt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return w.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,\'==="object"\'),i(\'!("cmp" in \',n,")||(",n,".cmp in ",r,")")})),[e.def(\'"cmp" in \',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def(\'"mask" in \',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return s((function(n){w.commandType(n,"object",u,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return w.commandParameter(r,te,t+".fail",e.commandStr),w.commandParameter(i,te,t+".zfail",e.commandStr),w.commandParameter(o,te,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,te[r],te[i],te[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return w.optional((function(){e.assert(n,\'!("\'+o+\'" in \'+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(te))})),n.def(\'"\',o,\'" in \',r,"?",i,"[",r,".",o,"]:",7680)}return w.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return s((function(t){w.commandType(t,"object",u,e.commandStr);var n=0|t.factor,r=0|t.units;return w.commandType(n,"number",u+".factor",e.commandStr),w.commandType(r,"number",u+".units",e.commandStr),[n,r]}),(function(e,n,r){return w.optional((function(){e.assert(n,r+"&&typeof "+r+\'==="object"\',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return s((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),w.command(!!n,u,e.commandStr),n}),(function(t,e,n){return w.optional((function(){t.assert(e,n+\'==="front"||\'+n+\'==="back"\',"invalid cull.face")})),e.def(n,\'==="front"?\',1028,":",1029)}));case"lineWidth":return s((function(t){return w.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+\'==="number"&&\'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return s((function(t){return w.commandParameter(t,ne,u,e.commandStr),ne[t]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+\'==="cw"||\'+n+\'==="ccw"\',"invalid frontFace, must be one of cw,ccw")})),e.def(n+\'==="cw"?2304:2305\')}));case"colorMask":return s((function(t){return w.command(tt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),R(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return s((function(t){w.command("object"===a(t)&&t,u,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return w.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+"&&typeof "+n+\'==="object"\',"invalid sample.coverage")})),[e.def(\'"value" in \',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,d),T=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);w.optional((function(){h.shader(ee[t],e,w.guessCommand())}));var r=ue((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return se(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return w.optional((function(){n(e.shared.shader,".shader(",ee[t],",",i,",",e.command,");")})),i}))}return null}var u,s=a(Ft),c=a(Ut),f=null;return ae(s)&&ae(c)?(f=h.program(c.id,s.id,null,r),u=ue((function(t,e){return t.link(f)}))):u=new oe(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",Ft);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Ut))+","+n;return w.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,m);function M(t){var e=_[t];e&&(A[t]=e)}M("viewport"),M(k("scissor.box"));var I=Object.keys(A).length>0,O={framebuffer:x,draw:E,shader:T,state:A,dirty:I,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var e,n=t.static,r=t.dynamic;if(Lt in n){var i=!!n[Lt];(e=ue((function(t,e){return i}))).enable=i}else if(Lt in r){var o=r[Lt];e=se(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),O.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=ue((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=ue((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(w.command(o.color.length>0,\'missing color attachment for framebuffer sent to uniform "\'+t+\'"\',e.commandStr),r=ue((function(t){return t.link(o.color[0])}))):w.commandRaise(\'invalid data for uniform "\'+t+\'"\',e.commandStr)}else tt(o)?r=ue((function(e){return e.global.def("[",R(o.length,(function(n){return w.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):w.commandRaise(\'invalid or missing data for uniform "\'+t+\'"\',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),i}(s,d),O.drawVAO=O.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Ht in n){var i=n[Ht];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),ue((function(t){return t.link(l.getVAO(i))}))}if(Ht in r){var o=r[Ht];return se(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!O.drawVAO&&T.program&&!m&&r.angle_instanced_arrays){var C=!0,D=T.program.attributes.map((function(t){var n=e.static[t];return C=C&&!!n,n}));if(C&&D.length>0){var N=l.getVAO(l.createVAO(D));O.drawVAO=new oe(null,null,null,(function(t,e){return t.link(N)})),O.useVAO=!0}}return m?O.useVAO=!0:O.attributes=function(t,e){var r=t.static,i=t.dynamic,u={};return Object.keys(r).forEach((function(t){var i=r[t],s=n.id(t),c=new g;if(re(i))c.state=1,c.buffer=o.getBuffer(o.create(i,34962,!1,!0)),c.type=0;else{var f=o.getBuffer(i);if(f)c.state=1,c.buffer=f,c.type=0;else if(w.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;c.buffer="null",c.state=2,"number"==typeof l?c.x=l:(w.command(tt(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Gt.forEach((function(t,e){e<l.length&&(c[t]=l[e])})))}else{f=re(i.buffer)?o.getBuffer(o.create(i.buffer,34962,!1,!0)):o.getBuffer(i.buffer),w.command(!!f,\'missing buffer for attribute "\'+t+\'"\',e.commandStr);var h=0|i.offset;w.command(h>=0,\'invalid offset for attribute "\'+t+\'"\',e.commandStr);var d=0|i.stride;w.command(d>=0&&d<256,\'invalid stride for attribute "\'+t+\'", must be integer betweeen [0, 255]\',e.commandStr);var p=0|i.size;w.command(!("size"in i)||p>0&&p<=4,\'invalid size for attribute "\'+t+\'", must be 1,2,3,4\',e.commandStr);var v=!!i.normalized,m=0;"type"in i&&(w.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),m=z[i.type]);var y=0|i.divisor;"divisor"in i&&(w.command(0===y||b,\'cannot specify divisor for attribute "\'+t+\'", instancing not supported\',e.commandStr),w.command(y>=0,\'invalid divisor for attribute "\'+t+\'"\',e.commandStr)),w.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){w.command(r.indexOf(e)>=0,\'unknown parameter "\'+e+\'" for attribute pointer "\'+t+\'" (valid parameters are \'+r+")",n)}))})),c.buffer=f,c.state=1,c.size=p,c.normalized=v,c.type=m||f.dtype,c.offset=h,c.stride=d,c.divisor=y}}u[t]=ue((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(c).forEach((function(t){r[t]=c[t]})),c.buffer&&(r.buffer=t.link(c.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];u[t]=se(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,u=o.isBufferArgs,s=o.buffer;w.optional((function(){n.assert(r,i+"&&(typeof "+i+\'==="object"||typeof \'+i+\'==="function")&&(\'+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+\'.buffer)||("constant" in \'+i+"&&(typeof "+i+\'.constant==="number"||\'+o.isArrayLike+"("+i+".constant))))",\'invalid dynamic attribute "\'+t+\'"\')}));var c={isStream:r.def(!1)},f=new g;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",34962,",",i,");",h,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",\'}else if("constant" in \',i,"){",c.state,"=",2,";","if(typeof "+i+\'.constant === "number"){\',c[Gt[0]],"=",i,".constant;",Gt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Gt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",34962,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",h,\'="type" in \',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),u}(e,d),O.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=ue((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),r}(f),O}function G(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",36160,",",s,".framebuffer);"),x&&e(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),x&&e(i,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function B(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");S.forEach((function(e){var r,f,l=k(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=R(_[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",T[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var d=t.cond(r,"!==",u,".",l);c(d),l in A?d(t.cond(r).then(i,".enable(",A[l],");").else(i,".disable(",A[l],");"),u,".",l,"=",r,";"):d(i,".",T[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function U(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;ie(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(t,e);if(A[i]){var f=A[i];ae(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(tt(c)){var l=o[i];e(u,".",T[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",T[i],"(",c,");",a,".",i,"=",c,";")}}))}function F(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function V(t,e,n,r,i){var o,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function p(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),v&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function m(t){t(c,".cpuTime+=",d(),"-",o,";"),v&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function g(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(ae(h))return void(h.enable?(p(e),m(e.exit),g("true")):g("false"));g(u=h.append(t,e))}else u=e.def(f,".profile");var y=t.block();p(y),e("if(",u,"){",y,"}");var b=t.block();m(b),e.exit("if(",u,"){",b,"}")}function W(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(ce))return;var c=t.scopeAttrib(u);w.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,u=e.def(n,".location"),s=e.def(o.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",s,".type!==",o,"||",s,".size!==",n,"||",h.map((function(t){return s+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",s,".type=",o,";",s,".size=",n,";",h.map((function(t){return s+"."+t+"="+i[t]+";"})).join(""),"}"),b){var c=i.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",Gt.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",Gt.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function X(t,e,r,i,o){for(var a,u=t.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],h=l.name,d=l.info.type,p=r.uniforms[h],v=t.link(l)+".location";if(p){if(!o(p))continue;if(ae(p)){var m=p.value;if(w.command(null!=m,\'missing uniform "\'+h+\'"\',t.commandStr),35678===d||35680===d){w.command("function"==typeof m&&(35678===d&&("texture2d"===m._reglType||"framebuffer"===m._reglType)||35680===d&&("textureCube"===m._reglType||"framebufferCube"===m._reglType)),"invalid texture for uniform "+h,t.commandStr);var g=t.link(m._texture||m.color[0]._texture);e(s,".uniform1i(",v,",",g+".bind());"),e.exit(g,".unbind();")}else if(35674===d||35675===d||35676===d){w.optional((function(){w.command(tt(m),"invalid matrix for uniform "+h,t.commandStr),w.command(35674===d&&4===m.length||35675===d&&9===m.length||35676===d&&16===m.length,"invalid length for matrix uniform "+h,t.commandStr)}));var y=t.global.def("new Float32Array(["+Array.prototype.slice.call(m)+"])"),b=2;35675===d?b=3:35676===d&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(d){case 5126:w.commandType(m,"number","uniform "+h,t.commandStr),a="1f";break;case 35664:w.command(tt(m)&&2===m.length,"uniform "+h,t.commandStr),a="2f";break;case 35665:w.command(tt(m)&&3===m.length,"uniform "+h,t.commandStr),a="3f";break;case 35666:w.command(tt(m)&&4===m.length,"uniform "+h,t.commandStr),a="4f";break;case 35670:w.commandType(m,"boolean","uniform "+h,t.commandStr),a="1i";break;case 5124:w.commandType(m,"number","uniform "+h,t.commandStr),a="1i";break;case 35671:case 35667:w.command(tt(m)&&2===m.length,"uniform "+h,t.commandStr),a="2i";break;case 35672:case 35668:w.command(tt(m)&&3===m.length,"uniform "+h,t.commandStr),a="3i";break;case 35673:case 35669:w.command(tt(m)&&4===m.length,"uniform "+h,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",tt(m)?Array.prototype.slice.call(m):m,");")}continue}f=p.append(t,e)}else{if(!o(ce))continue;f=e.def(u.uniforms,"[",n.id(h),"]")}35678===d?(w(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,\'._reglType==="framebuffer"){\',f,"=",f,".color[0];","}")):35680===d&&(w(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,\'._reglType==="framebufferCube"){\',f,"=",f,".color[0];","}")),w.optional((function(){function n(n,r){t.assert(e,n,\'bad data or missing for uniform "\'+h+\'". \'+r)}function r(t){w(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+\'==="\'+t+\'"\',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?w(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){w(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+\'==="function"&&\'+f+\'._reglType==="texture\'+(3553===e?"2d":"Cube")+\'"\',"invalid texture type",t.commandStr)}switch(d){case 5124:r("number");break;case 35667:i(2);break;case 35668:i(3);break;case 35669:i(4);break;case 5126:r("number");break;case 35664:i(2);break;case 35665:i(3);break;case 35666:i(4);break;case 35670:r("boolean");break;case 35671:i(2);break;case 35672:i(3);break;case 35673:case 35674:i(4);break;case 35675:i(9);break;case 35676:i(16);break;case 35678:o(3553);break;case 35680:o(34067)}}));var x=1;switch(d){case 35678:case 35680:var _=e.def(f,"._texture");e(s,".uniform1i(",v,",",_,".bind());"),e.exit(_,".unbind();");continue;case 5124:case 35670:a="1i";break;case 35667:case 35671:a="2i",x=2;break;case 35668:case 35672:a="3i",x=3;break;case 35669:case 35673:a="4i",x=4;break;case 5126:a="1f";break;case 35664:a="2f",x=2;break;case 35665:a="3f",x=3;break;case 35666:a="4f",x=4;break;case 35674:a="Matrix2fv";break;case 35675:a="Matrix3fv";break;case 35676:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var E=Math.pow(d-35674+2,2),S=t.global.def("new Float32Array(",E,")");Array.isArray(f)?e("false,(",R(E,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",R(E,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else x>1?e(R(x,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(w(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function q(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,u=r.draw,s=function(){var i,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=u[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(Vt),d=c(Xt),p=function(){var i,o=u.count,s=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(s=n),i=o.append(t,s),w.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(s,i+">=0","missing vertex count")}))):(i=s.def(a,".",Wt),w.optional((function(){t.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");b&&(f=c(qt),l=t.instancing);var v=s+".type",m=u.elements&&ae(u.elements);function g(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,v,d+"<<(("+v+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}s?m?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function y(){function t(){n(o+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}s?m?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}b&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),g(),n("}else if(",f,"<0){"),y(),n("}")):g():y()}function H(t,e,n,r,i){var o=P(),a=o.proc("body",i);return w.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function Y(t,e,n,r){F(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),W(t,e,n,r.attributes,(function(){return!0}))),X(t,e,n,r.uniforms,(function(){return!0})),q(t,e,e,n)}function K(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),W(t,e,n,r.attributes,i),X(t,e,n,r.uniforms,i),q(t,e,e,n)}function Q(t,e,n,r){F(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",s,"}",u.exit),n.needsContext&&G(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),U(t,s,n.state,c),n.profile&&c(n.profile)&&V(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),W(t,u,n,r.attributes,f),W(t,s,n,r.attributes,c)),X(t,u,n,r.uniforms,f),X(t,s,n,r.uniforms,c),q(t,u,s,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,s),d=s.def(h,".id"),p=s.def(l,"[",d,"]");s(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return H(K,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"===a(t)&&!tt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(M.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),u=!1,s=!1,c=!1,f=t.global.def("{}");o.forEach((function(e){var n=r[e];if(M.isDynamic(n)){"function"==typeof n&&(n=r[e]=M.unbox(n));var o=se(n,null);u=u||o.thisDep,c=c||o.propDep,s=s||o.contextDep}else{switch(i(f,".",e,"="),a(n)){case"number":i(n);break;case"string":i(\'"\',n,\'"\');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new M.DynamicVariable(4,{thisDep:u,contextDep:s,propDep:c,ref:f,append:function(t,e){o.forEach((function(n){var i=r[n];if(M.isDynamic(i)){var o=t.invoke(e,i);e(f,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:E,current:_,procs:function(){var t=P(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),b&&(a=t.link(b)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var h=n.def(u.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",34962,",",h,".buffer.buffer);",s,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),b&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(A).forEach((function(r){var i=A[r],a=o.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(T).forEach((function(r){var i,a,u=T[r],l=_[r],h=t.block();if(h(s,".",u,"("),tt(l)){var d=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),h(R(d,(function(t){return i+"["+t+"]"})),");",R(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",R(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),h(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",h,"}");n(h)})),t.compile()}(),compile:function(t,r,i,o,a){var u=P();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){$(u,r,t)})),Zt.forEach((function(e){$(u,t,e)}));var s=j(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);F(t,n),G(t,n,e.context),L(t,n,e.framebuffer),B(t,n,e),U(t,n,e.state),V(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return H(Y,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}G(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),ie(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);tt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),V(t,r,e,!0,!0),[zt,Xt,Wt,qt,Vt].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Ut),a(Ft),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",F(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(G(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),B(t,n,e),U(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||V(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Q(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Q(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return H(Q,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<s.length;++n){var h=s[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=f[p]-f[d];var v=l[d],m=l[p];m===v?(h.stats.gpuTime+=h.sum/1e6,u(h)):(h.startQueryIndex=v,h.endQueryIndex=m,s[t++]=h)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}};function he(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=D(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),u=i.isContextLost(),s=function(t,e){var n={};function r(e){w.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone(\'"\'+o+\'" extension is not supported by the current WebGL context, try upgrading your system or a different browser\'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!s)return null;var c,f,l=(c={"":0},f=[""],{id:function(t){var e=c[t];return e||(e=c[t]=f.length,f.push(t),e)},str:function(t){return f[t]}}),h={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=s.extensions,p=le(0,d),v=I(),m=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:m,viewportHeight:g,framebufferWidth:m,framebufferHeight:g,drawingBufferWidth:m,drawingBufferHeight:g,pixelRatio:r.pixelRatio},b=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var u=t.createFramebuffer();if(t.bindFramebuffer(36160,u),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=j.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,s),t.getError()?o=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),o=1===s[0]),j.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=j.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,6408,3,3,0,6408,5121,l),j.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,d),x=function(e,n,r,i){var o=0,a={};function u(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||5126,n.length>0)if(Array.isArray(n[0])){u=X(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=W(n,u,e.dtype),r),a?e.persistentData=s:j.freeType(s)}else if("number"==typeof n[0]){e.dimension=o;var h=j.allocType(e.dtype,n.length);Y(h,n),c(e,h,r),a?e.persistentData=h:j.freeType(h)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||H(n[0])||5126,c(e,s=W(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:j.freeType(s)):w.raise("invalid buffer data")}else if(t(n))e.dtype=i||H(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(G(n)){u=n.shape;var d=n.stride,p=n.offset,v=0,m=0,g=0,y=0;1===u.length?(v=u[0],m=1,g=d[0],y=0):2===u.length?(v=u[0],m=u[1],g=d[0],y=d[1]):w.raise("invalid shape"),e.dtype=i||H(n.data)||5126,e.dimension=m;var b=j.allocType(e.dtype,v*m);K(b,n.data,v,m,g,y,p),c(e,b,r),a?e.persistentData=b:j.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=5121,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):w.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;w(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,s,c){n.bufferCount++;var h=new u(o);function d(n){var i=35044,o=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||G(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(w.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(w(null===o||Array.isArray(o)||t(o)||G(o),"invalid data for buffer"),o=n.data),"usage"in n&&(w.parameter(n.usage,V,"invalid buffer usage"),i=V[n.usage]),"type"in n&&(w.parameter(n.type,z,"invalid buffer type"),u=z[n.type]),"dimension"in n&&(w.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(w.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?f(h,o,i,u,s,c):(a&&e.bufferData(h.type,a,i),h.dtype=u||5121,h.usage=i,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*q[h.dtype]),d}function p(t,n){w(n+t.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can\'t write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),e.bufferSubData(h.type,n,t)}return a[h.id]=h,s||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(e,n){var r,i=0|(n||0);if(h.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=j.allocType(h.dtype,e.length);Y(o,e),p(o,i),j.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=X(e);var a=W(e,r,h.dtype);p(a,i),j.freeType(a)}else w.raise("invalid buffer data")}else if(G(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):w.raise("invalid shape");var v=Array.isArray(e.data)?h.dtype:H(e.data),m=j.allocType(v,s*c);K(m,e.data,s,c,f,l,e.offset),p(m,i),j.freeType(m)}else w.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){L(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){L(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,h,r,(function(t){return _.destroyBuffer(t)})),_=function(e,n,r,i,o){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new Rt;var c=0,f={},l={Record:Rt,scope:{},state:u,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&L(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){w(Array.isArray(e),"arguments to vertex array constructor must be an array"),w(e.length<a,"too many attributes"),w(e.length>0,"must specify at least one attribute");var i={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=s[c]=new Rt,d=l.data||l;Array.isArray(d)||t(d)||G(d)?(r.buffers[c]&&(f=r.buffers[c],t(d)&&f._buffer.byteLength>=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(w.parameter(l.type,z,"invalid buffer type"),h.type=z[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,w(h.size>=1&&h.size<=4,"size must be between 1 and 4"),w(h.offset>=0,"invalid offset"),w(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),w(h.divisor>=0,"divisor must be positive"),w(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(w(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):w(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(t){if(t!==l.currentVAO){var e=h();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<u.length;++r){var i=u[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:h()?function(){L(f).forEach((function(t){t.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=h();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=h();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=h();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,d,b,h,x),E=function(e,n,r,i){var o={},a=0,u={uint8:5121,uint16:5123};function s(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=5125),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,u,s,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!G(o)||t(o.data))||(h=n.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,o,a,h,3)}else e.bufferData(34963,c,a),i.buffer.dtype=l||5121,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125;break;default:w.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,w(5125!==l||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=s;d<0&&(d=i.buffer.byteLength,5123===l?d>>=1:5125===l&&(d>>=2)),i.vertCount=d;var p=u;if(u<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function l(t){i.elementsCount--,w(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new s(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,s=-1,l=0,h=0;Array.isArray(e)||t(e)||G(e)?n=e:(w.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,w(Array.isArray(n)||t(n)||G(n),"invalid data for element buffer")),"usage"in e&&(w.parameter(e.usage,V,"invalid element buffer usage"),r=V[e.usage]),"primitive"in e&&(w.parameter(e.primitive,Z,"invalid element buffer primitive"),i=Z[e.primitive]),"count"in e&&(w("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(w.parameter(e.type,u,"invalid buffer type"),h=u[e.type]),"length"in e?l=0|e.length:(l=s,5123===h||5122===h?l*=2:5125!==h&&5124!==h||(l*=4))),f(a,n,r,i,s,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,34963,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){L(o).forEach(l)}}}(i,d,x,h),S=function(t,n,r,i){var o={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var u=35632===e?o:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),w.shaderError(t,s,c,e,i),u[r]=s}return s}var f={},l=[],h=0;function d(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),h=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,l),t.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),w.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=v);var m=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(d,a))if(f.size>1)for(var g=0;g<f.size;++g){var y=f.name.replace("[0]","["+g+"]");s(m,new u(y,n.id(y),t.getUniformLocation(d,y),f))}else s(m,new u(f.name,n.id(f.name),t.getUniformLocation(d,f.name),f));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var x=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(d,a))&&s(x,new u(f.name,n.id(f.name),t.getAttribLocation(d,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);L(o).forEach(e),o={},L(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,u,s){w.command(n>=0,"missing vertex shader",u),w.command(i>=0,"missing fragment shader",u);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!s))return h;var v=new d(i,n);return r.shaderCount++,p(v,u,s),h||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete f[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,l,h,r),A=At(i,d,b,(function(){C.procs.poll()}),y,h,r),T=function(t,e,n,r,i){var o={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var u=[];Object.keys(o).forEach((function(t){var e=o[t];u[e]=t}));var s=0,c={};function f(t){this.id=s++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function l(e){var n=e.renderbuffer;w(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete c[e.id],r.renderbufferCount--}return f.prototype.decRef=function(){--this.refCount<=0&&l(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,s){var l=new f(t.createRenderbuffer());function h(e,r){var s=0,c=0,f=32854;if("object"===a(e)&&e){var d=e;if("shape"in d){var p=d.shape;w(Array.isArray(p)&&p.length>=2,"invalid renderbuffer shape"),s=0|p[0],c=0|p[1]}else"radius"in d&&(s=c=0|d.radius),"width"in d&&(s=0|d.width),"height"in d&&(c=0|d.height);"format"in d&&(w.parameter(d.format,o,"invalid renderbuffer format"),f=o[d.format])}else"number"==typeof e?(s=0|e,c="number"==typeof r?0|r:s):e?w.raise("invalid arguments to renderbuffer constructor"):s=c=1;if(w(s>0&&c>0&&s<=n.maxRenderbufferSize&&c<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==l.width||c!==l.height||f!==l.format)return h.width=l.width=s,h.height=l.height=c,l.format=f,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,f,s,c),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Mt(l.format,l.width,l.height)),h.format=u[l.format],h}return c[l.id]=l,r.renderbufferCount++,h(e,s),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(w(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Mt(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){L(c).forEach(l)},restore:function(){L(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,d,b,h,r),O=function(t,n,r,i,o,u){var s={cur:null,next:null,dirty:!1,setFBO:null},c=["rgba"],f=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&f.push("srgba"),n.ext_color_buffer_half_float&&f.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&f.push("rgba32f");var l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function p(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);w(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;w(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function v(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function m(t){var e=3553,n=null,r=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),w.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,w(3553===e)):"textureCube"===o?(n=i,w(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):w.raise("invalid regl object for attachment"),new h(e,n,r)}function g(t,e,n,r,a){if(n){var u=i.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new h(3553,u,null)}var s=o.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new h(36161,null,s)}function y(t){return t&&(t.texture||t.renderbuffer)}function b(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var x=0,_={};function E(){this.id=x++,_[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function A(e){var n=e.framebuffer;w(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,u.framebufferCount--,delete _[e.id]}function T(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)v(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),v(36096,e.depthAttachment),v(36128,e.stencilAttachment),v(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(36160);t.isContextLost()||36053===o||w.raise("framebuffer configuration not supported, status = "+Dt[o]),t.bindFramebuffer(36160,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function M(t,i){var o=new E;function a(t,e){var i;w(s.next!==o,"can not update framebuffer which is currently in use");var u=0,h=0,d=!0,v=!0,b=null,x=!0,_="rgba",E="uint8",A=1,M=null,k=null,I=null,O=!1;if("number"==typeof t)u=0|t,h=0|e||u;else if(t){w.type(t,"object","invalid arguments for framebuffer");var C=t;if("shape"in C){var D=C.shape;w(Array.isArray(D)&&D.length>=2,"invalid shape for framebuffer"),u=D[0],h=D[1]}else"radius"in C&&(u=h=C.radius),"width"in C&&(u=C.width),"height"in C&&(h=C.height);("color"in C||"colors"in C)&&(b=C.color||C.colors,Array.isArray(b)&&w(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in C&&(A=0|C.colorCount,w(A>0,"invalid color buffer count")),"colorTexture"in C&&(x=!!C.colorTexture,_="rgba4"),"colorType"in C&&(E=C.colorType,x?(w(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(w(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),_="rgba16f"):"float"!==E&&"float32"!==E||(w(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),_="rgba32f"),w.oneOf(E,l,"invalid color type")),"colorFormat"in C&&(_=C.colorFormat,c.indexOf(_)>=0?x=!0:f.indexOf(_)>=0?x=!1:x?w.oneOf(C.colorFormat,c,"invalid color format for texture"):w.oneOf(C.colorFormat,f,"invalid color format for renderbuffer"))),("depthTexture"in C||"depthStencilTexture"in C)&&(O=!(!C.depthTexture&&!C.depthStencilTexture),w(!O||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in C&&("boolean"==typeof C.depth?d=C.depth:(M=C.depth,v=!1)),"stencil"in C&&("boolean"==typeof C.stencil?v=C.stencil:(k=C.stencil,d=!1)),"depthStencil"in C&&("boolean"==typeof C.depthStencil?d=v=C.depthStencil:(I=C.depthStencil,d=!1,v=!1))}else u=h=1;var R=null,N=null,P=null,j=null;if(Array.isArray(b))R=b.map(m);else if(b)R=[m(b)];else for(R=new Array(A),i=0;i<A;++i)R[i]=g(u,h,x,_,E);w(n.webgl_draw_buffers||R.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),w(R.length<=r.maxColorAttachments,"too many color attachments, not supported"),u=u||R[0].width,h=h||R[0].height,M?N=m(M):d&&!v&&(N=g(u,h,O,"depth","uint32")),k?P=m(k):v&&!d&&(P=g(u,h,!1,"stencil","uint8")),I?j=m(I):!M&&!k&&v&&d&&(j=g(u,h,O,"depth stencil","depth stencil")),w(!!M+!!k+!!I<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var G=null;for(i=0;i<R.length;++i)if(p(R[i],u,h),w(!R[i]||R[i].texture&&kt.indexOf(R[i].texture._texture.format)>=0||R[i].renderbuffer&&Ct.indexOf(R[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),R[i]&&R[i].texture){var L=It[R[i].texture._texture.format]*Ot[R[i].texture._texture.type];null===G?G=L:w(G===L,"all color attachments much have the same number of bits per pixel.")}return p(N,u,h),w(!N||N.texture&&6402===N.texture._texture.format||N.renderbuffer&&33189===N.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),p(P,u,h),w(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),p(j,u,h),w(!j||j.texture&&34041===j.texture._texture.format||j.renderbuffer&&34041===j.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=u,o.height=h,o.colorAttachments=R,o.depthAttachment=N,o.stencilAttachment=P,o.depthStencilAttachment=j,a.color=R.map(y),a.depth=y(N),a.stencil=y(P),a.depthStencil=y(j),a.width=o.width,a.height=o.height,T(o),a}return u.framebufferCount++,a(t,i),e(a,{resize:function(t,e){w(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return a;for(var i=o.colorAttachments,u=0;u<i.length;++u)b(i[u],n,r);return b(o.depthAttachment,n,r),b(o.stencilAttachment,n,r),b(o.depthStencilAttachment,n,r),o.width=a.width=n,o.height=a.height=r,T(o),a},_reglType:"framebuffer",_framebuffer:o,destroy:function(){A(o),S(o)},use:function(t){s.setFBO({framebuffer:a},t)}})}return e(s,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof E)return e}return null},create:M,createCube:function(t){var o=Array(6);function a(t){var r;w(o.indexOf(s.next)<0,"can not update framebuffer which is currently in use");var u,f={color:null},h=0,d=null,p="rgba",v="uint8",m=1;if("number"==typeof t)h=0|t;else if(t){w.type(t,"object","invalid arguments for framebuffer");var g=t;if("shape"in g){var y=g.shape;w(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),w(y[0]===y[1],"cube framebuffer must be square"),h=y[0]}else"radius"in g&&(h=0|g.radius),"width"in g?(h=0|g.width,"height"in g&&w(g.height===h,"must be square")):"height"in g&&(h=0|g.height);("color"in g||"colors"in g)&&(d=g.color||g.colors,Array.isArray(d)&&w(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in g&&(m=0|g.colorCount,w(m>0,"invalid color buffer count")),"colorType"in g&&(w.oneOf(g.colorType,l,"invalid color type"),v=g.colorType),"colorFormat"in g&&(p=g.colorFormat,w.oneOf(g.colorFormat,c,"invalid color format for texture"))),"depth"in g&&(f.depth=g.depth),"stencil"in g&&(f.stencil=g.stencil),"depthStencil"in g&&(f.depthStencil=g.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(u=[],r=0;r<d.length;++r)u[r]=d[r];else u=[d];else{u=Array(m);var b={radius:h,format:p,type:v};for(r=0;r<m;++r)u[r]=i.createCube(b)}for(f.color=Array(u.length),r=0;r<u.length;++r){var x=u[r];w("function"==typeof x&&"textureCube"===x._reglType,"invalid cube map"),h=h||x.width,w(x.width===h&&x.height===h,"invalid cube map shape"),f.color[r]={target:34069,data:u[r]}}for(r=0;r<6;++r){for(var _=0;_<u.length;++_)f.color[_].target=34069+r;r>0&&(f.depth=o[0].depth,f.stencil=o[0].stencil,f.depthStencil=o[0].depthStencil),o[r]?o[r](f):o[r]=M(f)}return e(a,{width:h,height:h,color:u})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(w(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){L(_).forEach(A)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,L(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),T(e)}))}})}(i,d,b,A,T,h),C=fe(i,l,d,b,x,E,0,O,{},_,S,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,p,r),R=Nt(i,O,C.procs.poll,y,o,d,b),N=C.next,P=i.canvas,B=[],U=[],F=[],Q=[r.onDestroy],$=null;function J(){if(0===B.length)return p&&p.update(),void($=null);$=k.next(J),ct();for(var t=B.length-1;t>=0;--t){var e=B[t];e&&e(y,null,0)}i.flush(),p&&p.update()}function tt(){!$&&B.length>0&&($=k.next(J))}function et(){$&&(k.cancel(J),$=null)}function nt(t){t.preventDefault(),u=!0,et(),U.forEach((function(t){t()}))}function rt(t){i.getError(),u=!1,s.restore(),S.restore(),x.restore(),A.restore(),T.restore(),O.restore(),_.restore(),p&&p.restore(),C.procs.refresh(),tt(),F.forEach((function(t){t()}))}function it(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(M.isDynamic(o))r[i]=M.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(M.isDynamic(o[a]))return void(r[i]=M.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}w(!!t,"invalid args to regl({...})"),w.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),a=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=C.compile(a,o,i,r,s),f=c.draw,l=c.batch,h=c.scope,d=[];return e((function(t,e){var n;if(u&&w.raise("context lost"),"function"==typeof t)return h.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)h.call(this,null,e,n);else{if(!Array.isArray(t))return h.call(this,t,e,0);for(n=0;n<t.length;++n)h.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}P&&(P.addEventListener("webglcontextlost",nt,!1),P.addEventListener("webglcontextrestored",rt,!1));var ot=O.setFBO=it({framebuffer:M.define.call(null,1,"framebuffer")});function at(t,e){var n=0;C.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),w(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function ut(t){return w.type(t,"function","regl.frame() callback must be a function"),B.push(t),tt(),{cancel:function(){var e=he(B,t);w(e>=0,"cannot cancel a frame twice"),B[e]=function t(){var e=he(B,t);B[e]=B[B.length-1],B.length-=1,B.length<=0&&et()}}}}function st(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ct(){y.tick+=1,y.time=lt(),st(),C.procs.poll()}function ft(){A.refresh(),st(),C.procs.refresh(),p&&p.update()}function lt(){return(I()-v)/1e3}ft();var ht=e(it,{clear:function(t){if(w("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)ot(e({framebuffer:t.framebuffer.faces[n]},t),at);else ot(t,at);else at(0,t)},prop:M.define.bind(null,1),context:M.define.bind(null,2),this:M.define.bind(null,3),draw:it({}),buffer:function(t){return x.create(t,34962,!1,!1)},elements:function(t){return E.create(t,!1)},texture:A.create2D,cube:A.createCube,renderbuffer:T.create,framebuffer:O.create,framebufferCube:O.createCube,vao:_.createVAO,attributes:o,frame:ut,on:function(t,e){var n;switch(w.type(e,"function","listener callback must be a function"),t){case"frame":return ut(e);case"lost":n=U;break;case"restore":n=F;break;case"destroy":n=Q;break;default:w.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:b,hasExtension:function(t){return b.extensions.indexOf(t.toLowerCase())>=0},read:R,destroy:function(){B.length=0,et(),P&&(P.removeEventListener("webglcontextlost",nt),P.removeEventListener("webglcontextrestored",rt)),S.clear(),O.clear(),T.clear(),A.clear(),E.clear(),x.clear(),_.clear(),p&&p.clear(),Q.forEach((function(t){t()}))},_gl:i,_refresh:ft,poll:function(){ct(),p&&p.update()},now:lt,stats:h});return r.onDone(null,ht),ht}},"object"===a(e)&&void 0!==t?t.exports=o():void 0===(i="function"==typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)},,,,,,,,function(t,e,n){var r=n(232);t.exports={Graph:r.Graph,json:n(333),alg:n(334),version:r.version}},function(t,e,n){t.exports={Graph:n(89),version:n(332)}},function(t,e,n){var r=n(123);t.exports=function(t){return r(t,4)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(66),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(66);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(66);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(66);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(65);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(65),i=n(90),o=n(91);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(55),i=n(247),o=n(26),a=n(126),u=/^\\[object .+?Constructor\\]$/,s=Function.prototype,c=Object.prototype,f=s.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:u).test(a(t))}},function(t,e,n){var r=n(50),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[u]=n:delete t[u]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(248),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(29)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(251),i=n(65),o=n(90);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(252),i=n(253),o=n(254),a=n(255),u=n(256);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},function(t,e,n){var r=n(67);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(67),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(67),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(67);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(68);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){function n(t){return(n="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)}t.exports=function(t){var e=n(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(68);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(68);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(68);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(56),i=n(40);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(39),i=n(30);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(39),i=n(93),o=n(30),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},function(t,e,n){var r=n(129)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(56),i=n(46);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(26),i=n(74),o=n(270),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var u in t)("constructor"!=u||!e&&a.call(t,u))&&n.push(u);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(56),i=n(96);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(56),i=n(134);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(136),i=n(134),o=n(46);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(45)(n(29),"DataView");t.exports=r},function(t,e,n){var r=n(45)(n(29),"Promise");t.exports=r},function(t,e,n){var r=n(45)(n(29),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(98),i=n(279),o=n(280),a=n(281),u=n(139);t.exports=function(t,e,n){var s=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new s(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return u(t,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(t);case"[object RegExp]":return o(t);case"[object Set]":return new s;case"[object Symbol]":return a(t)}}},function(t,e,n){var r=n(98);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(50),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},function(t,e,n){var r=n(283),i=n(73),o=n(94),a=o&&o.isMap,u=a?i(a):r;t.exports=u},function(t,e,n){var r=n(52),i=n(30);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(285),i=n(73),o=n(94),a=o&&o.isSet,u=a?i(a):r;t.exports=u},function(t,e,n){var r=n(52),i=n(30);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}},function(t,e,n){var r=n(36);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,u=Object(n);(e?a--:++a<o)&&!1!==i(u[a],a,u););return n}}},function(t,e,n){var r=n(76);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},function(t,e,n){var r=n(290),i=n(298),o=n(151);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(64),i=n(146);t.exports=function(t,e,n,o){var a=n.length,u=a,s=!o;if(null==t)return!u;for(t=Object(t);a--;){var c=n[a];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<u;){var f=(c=n[a])[0],l=t[f],h=c[1];if(s&&c[2]){if(void 0===l&&!(f in t))return!1}else{var d=new r;if(o)var p=o(l,h,f,t,e,d);if(!(void 0===p?i(h,l,3,o,d):p))return!1}}return!0}},function(t,e,n){var r=n(64),i=n(147),o=n(295),a=n(297),u=n(52),s=n(16),c=n(51),f=n(27),l="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,d,p,v){var m=s(t),g=s(e),y=m?"[object Array]":u(t),b=g?"[object Array]":u(e),x=(y="[object Arguments]"==y?l:y)==l,_=(b="[object Arguments]"==b?l:b)==l,w=y==b;if(w&&c(t)){if(!c(e))return!1;m=!0,x=!1}if(w&&!x)return v||(v=new r),m||f(t)?i(t,e,n,d,p,v):o(t,e,y,n,d,p,v);if(!(1&n)){var E=x&&h.call(t,"__wrapped__"),S=_&&h.call(e,"__wrapped__");if(E||S){var A=E?t.value():t,T=S?e.value():e;return v||(v=new r),p(A,T,n,d,v)}}return!!w&&(v||(v=new r),a(t,e,n,d,p,v))}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(50),i=n(138),o=n(49),a=n(147),u=n(296),s=n(102),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,l,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var d=u;case"[object Set]":var p=1&r;if(d||(d=s),t.size!=e.size&&!p)return!1;var v=h.get(t);if(v)return v==e;r|=2,h.set(t,e);var m=a(d(t),d(e),r,c,l,h);return h.delete(t),m;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(135),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,u){var s=1&n,c=r(t),f=c.length;if(f!=r(e).length&&!s)return!1;for(var l=f;l--;){var h=c[l];if(!(s?h in e:i.call(e,h)))return!1}var d=u.get(t),p=u.get(e);if(d&&p)return d==e&&p==t;var v=!0;u.set(t,e),u.set(e,t);for(var m=s;++l<f;){var g=t[h=c[l]],y=e[h];if(o)var b=s?o(y,g,h,e,t,u):o(g,y,h,t,e,u);if(!(void 0===b?g===y||a(g,y,n,o,u):b)){v=!1;break}m||(m="constructor"==h)}if(v&&!m){var x=t.constructor,_=e.constructor;x==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof _&&_ instanceof _||(v=!1)}return u.delete(t),u.delete(e),v}},function(t,e,n){var r=n(150),i=n(40);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},function(t,e,n){var r=n(146),i=n(300),o=n(153),a=n(103),u=n(150),s=n(151),c=n(58);t.exports=function(t,e){return a(t)&&u(e)?s(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},function(t,e,n){var r=n(77);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(302),i=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,o=/\\\\(\\\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(303);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(91);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(50),i=n(79),o=n(16),a=n(53),u=r?r.prototype:void 0,s=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return s?s.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(155),i=n(307),o=n(103),a=n(58);t.exports=function(t){return o(t)?r(a(t)):i(t)}},function(t,e,n){var r=n(77);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(95),i=n(52),o=n(57),a=n(16),u=n(36),s=n(51),c=n(74),f=n(27),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(u(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||s(t)||f(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(l.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},function(t,e){t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},function(t,e,n){var r=n(95),i=n(52),o=n(36),a=n(313),u=n(314);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?u(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},function(t,e,n){var r=n(39),i=n(16),o=n(30);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},function(t,e,n){var r=n(315),i=n(316),o=n(317);t.exports=function(t){return i(t)?o(t):r(t)}},function(t,e,n){var r=n(155)("length");t.exports=r},function(t,e){var n=RegExp("[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n="[\\\\ud800-\\\\udfff]",r="[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]",i="\\\\ud83c[\\\\udffb-\\\\udfff]",o="[^\\\\ud800-\\\\udfff]",a="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",u="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",s="(?:"+r+"|"+i+")"+"?",c="[\\\\ufe0e\\\\ufe0f]?"+s+("(?:\\\\u200d(?:"+[o,a,u].join("|")+")[\\\\ufe0e\\\\ufe0f]?"+s+")*"),f="(?:"+[o+r+"?",r,a,u,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+f+c,"g");t.exports=function(t){for(var e=l.lastIndex=0;l.test(t);)++e;return e}},function(t,e,n){var r=n(92),i=n(141),o=n(100),a=n(37),u=n(75),s=n(16),c=n(51),f=n(55),l=n(26),h=n(27);t.exports=function(t,e,n){var d=s(t),p=d||c(t)||h(t);if(e=a(e,4),null==n){var v=t&&t.constructor;n=p?d?new v:[]:l(t)&&f(v)?i(u(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},function(t,e,n){var r=n(104),i=n(80),o=n(163),a=n(165),u=i((function(t){return o(r(t,1,a,!0))}));t.exports=u},function(t,e,n){var r=n(50),i=n(57),o=n(16),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(99),i=n(127),o=n(47),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(325);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(164),i=n(326),o=n(327);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(137),i=n(330),o=n(102),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(79);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e){t.exports="2.1.8"},function(t,e,n){var r=n(25),i=n(89);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};r.isUndefined(t.graph())||(e.value=r.clone(t.graph()));return e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},function(t,e,n){t.exports={components:n(335),dijkstra:n(167),dijkstraAll:n(336),findCycles:n(337),floydWarshall:n(338),isAcyclic:n(339),postorder:n(340),preorder:n(341),prim:n(342),tarjan:n(169),topsort:n(170)}},function(t,e,n){var r=n(25);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},function(t,e,n){var r=n(167),i=n(25);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},function(t,e,n){var r=n(25),i=n(169);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(25);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},function(t,e,n){var r=n(170);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},function(t,e,n){var r=n(171);t.exports=function(t,e){return r(t,e,"post")}},function(t,e,n){var r=n(171);t.exports=function(t,e){return r(t,e,"pre")}},function(t,e,n){var r=n(25),i=n(89),o=n(168);t.exports=function(t,e){var n,a=new i,u={},s=new o;function c(t){var r=t.v===n?t.w:t.v,i=s.priority(r);if(void 0!==i){var o=e(t);o<i&&(u[r]=n,s.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){s.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),s.decrease(t.nodes()[0],0);var f=!1;for(;s.size()>0;){if(n=s.removeMin(),r.has(u,n))a.setEdge(n,u[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(14),i=n(380),o=n(383),a=n(384),u=n(23).normalizeRanks,s=n(386),c=n(23).removeEmptyRanks,f=n(387),l=n(388),h=n(389),d=n(390),p=n(399),v=n(23),m=n(28).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?v.time:v.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new m({multigraph:!0,compound:!0}),n=T(t.graph());return e.setGraph(r.merge({},y,A(n,g),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=T(t.node(n));e.setNode(n,r.defaults(A(i,x),_)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=T(t.edge(n));e.setEdge(n,r.merge({},E,A(i,w),r.pick(i,S)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){f.run(t)})),e(" rank",(function(){a(v.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};v.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){f.cleanup(t)})),e(" normalizeRanks",(function(){u(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){s(t)})),e(" addBorderSegments",(function(){l(t)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=v.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){v.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),u=t.node(r.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),u=a.marginx||0,s=a.marginy||0;function c(t){var r=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,r-u/2),n=Math.max(n,r+u/2),i=Math.min(i,a-s/2),o=Math.max(o,a+s/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=u,i-=s,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+u,a.height=o-i+s}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var g=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],_={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function A(t,e){return r.mapValues(r.pick(t,e),Number)}function T(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(123);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(80),i=n(49),o=n(81),a=n(46),u=Object.prototype,s=u.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var f=e[n],l=a(f),h=-1,d=l.length;++h<d;){var p=l[h],v=t[p];(void 0===v||i(v,u[p])&&!s.call(t,p))&&(t[p]=f[p])}return t}));t.exports=c},function(t,e,n){var r=n(347)(n(348));t.exports=r},function(t,e,n){var r=n(37),i=n(36),o=n(40);t.exports=function(t){return function(e,n,a){var u=Object(e);if(!i(e)){var s=r(n,3);e=o(e),n=function(t){return s(u[t],t,u)}}var c=t(e,n,a);return c>-1?u[s?e[c]:c]:void 0}}},function(t,e,n){var r=n(164),i=n(37),o=n(349),a=Math.max;t.exports=function(t,e,n){var u=null==t?0:t.length;if(!u)return-1;var s=null==n?0:o(n);return s<0&&(s=a(u+s,0)),r(t,i(e,3),s)}},function(t,e,n){var r=n(172);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(26),i=n(53),o=/^\\s+|\\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=u.test(t);return n||s.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(101),i=n(144),o=n(46);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(70),i=n(100),o=n(37);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(105),i=n(355),o=n(47);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(357),i=n(360)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(64),i=n(174),o=n(101),a=n(358),u=n(26),s=n(46),c=n(175);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,s){if(h||(h=new r),u(o))a(e,n,s,f,t,l,h);else{var d=l?l(c(e,s),o,s+"",e,n,h):void 0;void 0===d&&(d=o),i(e,s,d)}}),s)}},function(t,e,n){var r=n(174),i=n(130),o=n(139),a=n(131),u=n(140),s=n(57),c=n(16),f=n(165),l=n(51),h=n(55),d=n(26),p=n(120),v=n(27),m=n(175),g=n(359);t.exports=function(t,e,n,y,b,x,_){var w=m(t,n),E=m(e,n),S=_.get(E);if(S)r(t,n,S);else{var A=x?x(w,E,n+"",t,e,_):void 0,T=void 0===A;if(T){var M=c(E),k=!M&&l(E),I=!M&&!k&&v(E);A=E,M||k||I?c(w)?A=w:f(w)?A=a(w):k?(T=!1,A=i(E,!0)):I?(T=!1,A=o(E,!0)):A=[]:p(E)||s(E)?(A=w,s(w)?A=g(w):d(w)&&!h(w)||(A=u(E))):T=!1}T&&(_.set(E,A),b(A,E,y,x,_),_.delete(E)),r(t,n,A)}}},function(t,e,n){var r=n(56),i=n(46);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(80),i=n(81);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(n[0],n[1],u)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}},function(t,e,n){var r=n(105),i=n(176),o=n(47);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(105),i=n(37),o=n(176);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},function(t,e,n){var r=n(29);t.exports=function(){return r.Date.now()}},function(t,e,n){var r=n(365),i=n(368)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},function(t,e,n){var r=n(366),i=n(153);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},function(t,e,n){var r=n(77),i=n(367),o=n(78);t.exports=function(t,e,n){for(var a=-1,u=e.length,s={};++a<u;){var c=e[a],f=r(t,c);n(f,c)&&i(s,o(c,t),f)}return s}},function(t,e,n){var r=n(69),i=n(78),o=n(72),a=n(26),u=n(58);t.exports=function(t,e,n,s){if(!a(t))return t;for(var c=-1,f=(e=i(e,t)).length,l=f-1,h=t;null!=h&&++c<f;){var d=u(e[c]),p=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(c!=l){var v=h[d];void 0===(p=s?s(v,d,h):void 0)&&(p=a(v)?v:o(e[c+1])?[]:{})}r(h,d,p),h=h[d]}return t}},function(t,e,n){var r=n(173),i=n(161),o=n(162);t.exports=function(t){return o(i(t,void 0,r),t+"")}},function(t,e,n){var r=n(370)();t.exports=r},function(t,e,n){var r=n(371),i=n(81),o=n(172);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},function(t,e){var n=Math.ceil,r=Math.max;t.exports=function(t,e,i,o){for(var a=-1,u=r(n((e-t)/(i||1)),0),s=Array(u);u--;)s[o?u:++a]=t,t+=i;return s}},function(t,e,n){var r=n(104),i=n(373),o=n(80),a=n(81),u=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=u},function(t,e,n){var r=n(79),i=n(77),o=n(37),a=n(159),u=n(374),s=n(73),c=n(375),f=n(47),l=n(16);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,s(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return u(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(376);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,u=o.length,s=n.length;++i<u;){var c=r(o[i],a[i]);if(c)return i>=s?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(53);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),u=void 0!==e,s=null===e,c=e==e,f=r(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||i&&u&&c||!n&&c||!o)return 1;if(!i&&!a&&!f&&t<e||f&&n&&o&&!i&&!a||s&&n&&o||!u&&o||!c)return-1}return 0}},function(t,e,n){var r=n(152),i=0;t.exports=function(t){var e=++i;return r(t)+e}},function(t,e,n){var r=n(69),i=n(379);t.exports=function(t,e){return i(t||[],e||[],r)}},function(t,e){t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}},function(t,e,n){"use strict";var r=n(14),i=n(381);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])}return r.forEach(t.nodes(),o),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},function(t,e,n){var r=n(14),i=n(28).Graph,o=n(382);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,u=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),u=Math.max(u,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(u+a+3).map((function(){return new o})),f=a+1;return r.forEach(n.nodes(),(function(t){s(c,f,n.node(t))})),{graph:n,buckets:c,zeroIdx:f}}(t,e||a),c=function(t,e,n){var r,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;r=a.dequeue();)u(t,e,n,r);for(;r=o.dequeue();)u(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){i=i.concat(u(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function u(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),u=t.node(r.v);o&&a.push({v:r.v,w:r.w}),u.out-=i,s(e,n,u)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,s(e,n,a)})),t.removeNode(i.v),a}function s(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(14),i=n(23);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,u=t.node(a).rank,s=e.w,c=t.node(s).rank,f=e.name,l=t.edge(e),h=l.labelRank;if(c===u+1)return;for(t.removeEdge(e),o=0,++u;u<c;++o,++u)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:u},n=i.addDummyNode(t,"edge",r,"_d"),u===h&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(a,n,{weight:l.weight},f),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,s,{weight:l.weight},f)}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},function(t,e,n){"use strict";var r=n(82).longestPath,i=n(177),o=n(385);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":u(t);break;case"tight-tree":!function(t){r(t),i(t)}(t);break;case"longest-path":a(t);break;default:u(t)}};var a=r;function u(t){o(t)}},function(t,e,n){"use strict";var r=n(14),i=n(177),o=n(82).slack,a=n(82).longestPath,u=n(28).alg.preorder,s=n(28).alg.postorder,c=n(23).simplify;function f(t){t=c(t),a(t);var e,n=i(t);for(d(n),l(n,t);e=v(n);)g(n,t,e,m(n,t,e))}function l(t,e){var n=s(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=h(t,e,n)}(t,e,n)}))}function h(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),u=0;return a||(o=!1,a=e.edge(i,n)),u=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,s,c=r.v===n,f=c?r.w:r.v;if(f!==i){var l=c===o,h=e.edge(r).weight;if(u+=l?h:-h,a=n,s=f,t.hasEdge(a,s)){var d=t.edge(n,f).cutvalue;u+=l?-d:d}}})),u}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,u=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),u.low=a,u.lim=n++,o?u.parent=o:delete u.parent,n}function v(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function m(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var u=t.node(i),s=t.node(a),c=u,f=!1;u.lim>s.lim&&(c=s,f=!0);var l=r.filter(e.edges(),(function(e){return f===y(t,t.node(e.v),c)&&f!==y(t,t.node(e.w),c)}));return r.minBy(l,(function(t){return o(e,t)}))}function g(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),l(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=u(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=f,f.initLowLimValues=d,f.initCutValues=l,f.calcCutValue=h,f.leaveEdge=v,f.enterEdge=m,f.exchangeEdges=g},function(t,e,n){var r=n(14);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)u.push(i);return{path:a.concat(u.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,u=o.lca,s=0,c=a[s],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}},function(t,e,n){var r=n(14),i=n(23);t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};return r.forEach(t.children(),(function(n){!function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)}));e[i]=o}(n,1)})),e}(t),o=r.max(r.values(n))-1,a=2*o+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=a}));var u=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(s){!function t(e,n,o,a,u,s,c){var f=e.children(c);if(!f.length)return void(c!==n&&e.setEdge(n,c,{weight:0,minlen:o}));var l=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),d=e.node(c);e.setParent(l,c),d.borderTop=l,e.setParent(h,c),d.borderBottom=h,r.forEach(f,(function(r){t(e,n,o,a,u,s,r);var i=e.node(r),f=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=f!==d?1:u-s[c]+1;e.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),e.setEdge(d,h,{weight:p,minlen:v,nestingEdge:!0})})),e.parent(c)||e.setEdge(n,l,{weight:0,minlen:u+s[c]})}(t,e,a,u,o,n,s)})),t.graph().nodeRankFactor=a},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},function(t,e,n){var r=n(14),i=n(23);function o(t,e,n,r,o,a){var u={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],c=i.addDummyNode(t,"border",u,n);o[e][a]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var u=a.minRank,s=a.maxRank+1;u<s;++u)o(t,"borderLeft","_bl",n,a,u),o(t,"borderRight","_br",n,a,u)}}))}},function(t,e,n){"use strict";var r=n(14);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function u(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){r.forEach(t.nodes(),(function(e){u(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,u),r.has(n,"x")&&u(n)}))}(t),i(t))}}},function(t,e,n){"use strict";var r=n(14),i=n(391),o=n(392),a=n(393),u=n(397),s=n(398),c=n(28).Graph,f=n(23);function l(t,e,n){return r.map(e,(function(e){return u(t,e,n)}))}function h(t,e){var n=new c;r.forEach(t,(function(t){var i=t.graph().root,o=a(t,i,n,e);r.forEach(o.vs,(function(e,n){t.node(e).order=n})),s(t,n,o.vs)}))}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=f.maxRank(t),n=l(t,r.range(1,e+1),"inEdges"),a=l(t,r.range(e-1,-1,-1),"outEdges"),u=i(t);d(t,u);for(var s,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),u=f.buildLayerMatrix(t);var m=o(t,u);m<c&&(v=0,s=r.cloneDeep(u),c=m)}d(t,s)}},function(t,e,n){"use strict";var r=n(14);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(e){return t.node(e).rank}));return r.forEach(a,(function n(i){if(r.has(e,i))return;e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)})),o}},function(t,e,n){"use strict";var r=n(14);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=r.map(new Array(u),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},function(t,e,n){var r=n(14),i=n(394),o=n(395),a=n(396);t.exports=function t(e,n,u,s){var c=e.children(n),f=e.node(n),l=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};l&&(c=r.filter(c,(function(t){return t!==l&&t!==h})));var p=i(e,c);r.forEach(p,(function(n){if(e.children(n.v).length){var i=t(e,n.v,u,s);d[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(p,u);!function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(v,d);var m=a(v,s);if(l&&(m.vs=r.flatten([l,m.vs,h],!0),e.predecessors(l).length)){var g=e.node(e.predecessors(l)[0]),y=e.node(e.predecessors(h)[0]);r.has(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+g.order+y.order)/(m.weight+2),m.weight+=2}return m}},function(t,e,n){var r=n(14);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},function(t,e,n){"use strict";var r=n(14);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(14),i=n(23);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e){var n=i.partition(t,(function(t){return r.has(t,"barycenter")})),a=n.lhs,u=r.sortBy(n.rhs,(function(t){return-t.i})),s=[],c=0,f=0,l=0;a.sort((h=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:h?e.i-t.i:t.i-e.i})),l=o(s,u,l),r.forEach(a,(function(t){l+=t.vs.length,s.push(t.vs),c+=t.barycenter*t.weight,f+=t.weight,l=o(s,u,l)}));var h;var d={vs:r.flatten(s,!0)};f&&(d.barycenter=c/f,d.weight=f);return d}},function(t,e,n){var r=n(14),i=n(28).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var u=t.node(i),s=t.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(a.setNode(i),a.setParent(i,s||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),u=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+u})})),r.has(u,"minRank")&&a.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),a}},function(t,e,n){var r=n(14);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,u=t.parent(n);u;){if((r=t.parent(u))?(a=o[r],o[r]=u):(a=i,i=u),a&&a!==u)return void e.setEdge(a,u);u=r}}))}},function(t,e,n){"use strict";var r=n(14),i=n(23),o=n(400).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(14),i=n(28).Graph,o=n(23);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,u=e.length,c=r.last(i);return r.forEach(i,(function(e,f){var l=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=l?t.node(l).order:u;(l||e===c)&&(r.forEach(i.slice(a,f+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||h<a)||i.dummy&&t.node(e).dummy||s(n,r,e)}))})),a=f+1,o=h)})),i})),n}function u(t,e){var n={};function i(e,i,o,a,u){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>u)&&s(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,u=0;return r.forEach(n,(function(r,s){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,u,s,a,o),u=s,a=o)}i(n,u,n.length,o,e.length)})),n})),n}function s(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function f(t,e,n,i){var o={},a={},u={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,u[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var s=i(t);if(s.length)for(var f=((s=r.sortBy(s,(function(t){return u[t]}))).length-1)/2,l=Math.floor(f),h=Math.ceil(f);l<=h;++l){var d=s[l];a[t]===t&&e<u[d]&&!c(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],e=u[d])}}))})),{root:o,align:a}}function l(t,e,n,o,a){var u={},s=function(t,e,n,o){var a=new i,u=t.graph(),s=function(t,e,n){return function(i,o,a){var u,s=i.node(o),c=i.node(a),f=0;if(f+=s.width/2,r.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=-s.width/2;break;case"r":u=s.width/2}if(u&&(f+=n?u:-u),u=0,f+=(s.dummy?e:t)/2,f+=(c.dummy?e:t)/2,f+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(f+=n?u:-u),u=0,f}}(u.nodesep,u.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],u=a.edge(o,r);a.setEdge(o,r,Math.max(s(t,e,i),u||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function f(t,e){for(var n=s.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return f((function(t){u[t]=s.inEdges(t).reduce((function(t,e){return Math.max(t,u[e.v]+s.edge(e))}),0)}),s.predecessors.bind(s)),f((function(e){var n=s.outEdges(e).reduce((function(t,e){return Math.min(t,u[e.w]-s.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(u[e]=Math.max(u[e],n))}),s.successors.bind(s)),r.forEach(o,(function(t){u[t]=u[n[t]]})),u}function h(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function d(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var u,s=n+a,c=t[s];if(c!==e){var f=r.values(c);(u="l"===a?i-r.min(f):o-r.max(f))&&(t[s]=r.mapValues(c,(function(t){return t+u})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),u(t,n)),s={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=f(t,e,i,a),c=l(t,e,u.root,u.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),s[o+n]=c}))}));var c=h(t,s);return d(s,c),p(s,t.graph().align)},findType1Conflicts:a,findType2Conflicts:u,addConflict:s,hasConflict:c,verticalAlignment:f,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:h,balance:p}},function(t,e,n){var r=n(14),i=n(23),o=n(28).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},function(t,e){t.exports="0.8.5"},function(t){t.exports=JSON.parse(\'{"name":"@antv/g-base","version":"0.5.1","description":"A common util collection for antv projects","main":"lib/index.js","module":"esm/index.js","types":"lib/index.d.ts","files":["package.json","esm","lib","LICENSE","README.md"],"scripts":{"build":"npm run clean && run-p build:*","build:esm":"tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm","build:cjs":"tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib","clean":"rm -rf esm lib","watch:cjs":"tsc-watch -p tsconfig.json --target ES5 --module commonjs --outDir lib --compiler typescript/bin/tsc","coverage":"npm run coverage-generator && npm run coverage-viewer","coverage-generator":"torch --coverage --compile --source-pattern src/*.js,src/**/*.js --opts tests/mocha.opts","coverage-viewer":"torch-coverage","test":"torch --renderer --compile --opts tests/mocha.opts","test-live":"torch --compile --interactive tests/unit","tsc":"tsc --noEmit","typecheck":"tsc --noEmit"},"repository":{"type":"git","url":"git+https://github.com/antvis/util.git"},"keywords":["util","antv","g"],"publishConfig":{"access":"public"},"author":"https://github.com/orgs/antvis/people","license":"ISC","bugs":{"url":"https://github.com/antvis/util/issues"},"devDependencies":{"@antv/torch":"^1.0.0","gl-matrix":"^3.0.0","less":"^3.9.0","npm-run-all":"^4.1.5","tsc-watch":"^4.0.0"},"homepage":"https://github.com/antvis/util#readme","dependencies":{"@antv/event-emitter":"^0.1.1","@antv/g-math":"^0.1.5","@antv/matrix-util":"^3.1.0-beta.1","@antv/path-util":"~2.0.5","@antv/util":"~2.0.0","@types/d3-timer":"^1.0.9","d3-ease":"^1.0.5","d3-interpolate":"^1.3.2","d3-timer":"^1.0.9","detect-browser":"^5.1.0"},"__npminstall_done":true,"gitHead":"ba7ecf8b8deac37682414ac0b7fc2c3e903398bd","_from":"@antv/g-base@0.5.1","_resolved":"https://registry.npm.alibaba-inc.com/@antv/g-base/download/@antv/g-base-0.5.1.tgz"}\')},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(106);e.default=function(t){return r.default(t)?"":t.toString()}},function(t,e,n){var r=n(406),i=n(407),o={};for(var a in r)r.hasOwnProperty(a)&&(o[r[a]]=a);var u=t.exports={to:{},get:{}};function s(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),n="hsl";break;case"hwb":e=u.get.hwb(t),n="hwb";break;default:e=u.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,n,i,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var a=2*n;o[n]=parseInt(e.slice(a,a+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/)))return(e=t.match(/(\\D+)/))?"transparent"===e[1]?[0,0,0,0]:(o=r[e[1]])?(o[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=s(o[n],0,255);return o[3]=s(o[3],0,1),o},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\\(\\s*([+-]?(?:\\d*\\.)?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(n)?1:n,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\\(\\s*([+-]?\\d*[\\.]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(n)?1:n,0,1)]}return null},u.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},u.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return o[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(408),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var u=t[n];r(u)?e=i.call(e,o.call(u)):e.push(u)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},function(t,e){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){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)}var i=n(188),o=n(411),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===r(n))for(var i=n.length,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),a[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(188);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),o=Object.keys(r[i]),a=o.length,u=0;u<a;u++){var s=o[u],c=e[s];-1===c.distance&&(c.distance=e[i].distance+1,c.parent=i,n.unshift(s))}return e}function o(t,e){return function(n){return e(t(n))}}function a(t,e){for(var n=[e[t].parent,t],i=r[e[t].parent][t],a=e[t].parent;e[a].parent;)n.unshift(e[a].parent),i=o(r[e[a].parent][a],i),a=e[a].parent;return i.conversion=n,i}t.exports=function(t){for(var e=i(t),n={},r=Object.keys(e),o=r.length,u=0;u<o;u++){var s=r[u];null!==e[s].parent&&(n[s]=a(s,e))}return n}},function(t,e,n){(function(t){function e(t){return(e="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)}var n=function(t){"use strict";var n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=_(a,n);if(u){if(u===l)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=f(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function h(){}function d(){}function p(){}var v={};v[o]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(A([])));g&&g!==n&&r.call(g,o)&&(v=g);var y=p.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,n){var i;this._invoke=function(o,a){function u(){return new n((function(i,u){!function i(o,a,u,s){var c=f(t[o],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"===e(h)&&r.call(h,"__await")?n.resolve(h.__await).then((function(t){i("next",t,u,s)}),(function(t){i("throw",t,u,s)})):n.resolve(h).then((function(t){l.value=t,u(l)}),(function(t){return i("throw",t,u,s)}))}s(c.arg)}(o,a,i,u)}))}return i=i?i.then(u,u):u()}}function _(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a \'throw\' method")}return l}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return d.prototype=y.constructor=p,p.constructor=d,d.displayName=s(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,u,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(x.prototype),x.prototype[a]=function(){return this},t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),s(y,u,"Generator"),y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=A,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}}).call(this,n(71)(t))},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){"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)}var i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,u)}s((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(417),u=n(24),s=n(38),c=n(20),f=n(192),l=n(418),h=n(425),d=n(427),p=n(48),v=n(59),m=n(430),g=n(431),y=function(){function t(t){var e=t||{};if("object"!==r(e))throw new Error(""+u.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new g.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){var r=new t,i=l.getBindingDictionary(r),o=l.getBindingDictionary(e),a=l.getBindingDictionary(n);function u(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return u(o,i),u(a,i),r},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){var e,n,r,i,a;return o(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,o.label=1;case 1:return n<r.length?(i=r[n],a=e(i.id),[4,i.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||s.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(u.CANNOT_UNBIND+" "+v.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new g.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(m.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(u.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(u.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),h.resolve(n)}},t}();e.Container=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(38),i=n(48),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=!1,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(419),i=n(24),o=n(38),a=n(20),u=n(193),s=n(59),c=n(420),f=n(31),l=n(421),h=n(422),d=n(424),p=n(195);function v(t){return t._bindingDictionary}function m(t,e,n,o,a){var u=g(n.container,a.serviceIdentifier),c=[];return u.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),u=g(n.container,a.serviceIdentifier)),c=e?u:u.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=s.getServiceIdentifierAsString(t),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(a,n),u+=s.listRegisteredBindingsForServiceIdentifier(o,a,g),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a;throw u+=s.listRegisteredBindingsForServiceIdentifier(o,a,g),new Error(u)}}(a.serviceIdentifier,c,a,n.container),c}function g(t,e){var n=[],r=v(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=g(t.parent,e)),n}e.getBindingDictionary=v,e.plan=function(t,e,n,r,v,g,y,b){void 0===b&&(b=!1);var x=new c.Context(e),_=function(t,e,n,r,i,o){var u=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,s=new f.Metadata(u,n),c=new p.Target(e,r,n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,v,"",g,y);try{return function t(e,n,r,a,u,s){var c,f;if(null===u){c=m(e,n,a,null,s),f=new d.Request(r,a,null,c,s);var p=new l.Plan(a,f);a.addPlan(p)}else c=m(e,n,a,u,s),f=u.addChildRequest(s.serviceIdentifier,c,s);c.forEach((function(n){var r=null;if(s.isArray())r=f.addChildRequest(n.serviceIdentifier,n,s);else{if(n.cache)return;r=f}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var u=h.getDependencies(e,n.implementationType);if(!a.container.options.skipBaseClassChecks){var c=h.getBaseClassDependencyCount(e,n.implementationType);if(u.length<c){var l=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(n.implementationType));throw new Error(l)}}u.forEach((function(n){t(e,!1,n.serviceIdentifier,a,r,n)}))}}))}(t,b,v,x,null,_),x}catch(t){throw u.isStackOverflowExeption(t)&&x.plan&&s.circularDependencyToException(x.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(48),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){this.parentContext=t,this.rootRequest=e};e.Plan=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(194),i=n(24),o=n(38),a=n(20),u=n(59);e.getFunctionName=u.getFunctionName;var s=n(195);function c(t,e,n,r){var a=t.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(void 0===u){var c=i.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(c)}var h=a.userGeneratedMetadata,d=Object.keys(h),p=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var u=f(a,t,e,n,r);null!==u&&o.push(u)}return o}(r,e,u,h,0===n.length&&d.length>0?d.length:n.length),v=function t(e,n){for(var r=e.getPropertiesMetadata(n),i=[],a=Object.keys(r),u=0,c=a;u<c.length;u++){var f=c[u],h=r[f],d=l(r[f]),p=d.targetName||f,v=d.inject||d.multiInject,m=new s.Target(o.TargetTypeEnum.ClassProperty,p,v);m.metadata=h,i.push(m)}var g=Object.getPrototypeOf(n.prototype).constructor;if(g!==Object){var y=t(e,g);i=i.concat(y)}return i}(t,n);return p.concat(v)}function f(t,e,n,a,u){var c=u[t.toString()]||[],f=l(c),h=!0!==f.unmanaged,d=a[t],p=f.inject||f.multiInject;if((d=p||d)instanceof r.LazyServiceIdentifer&&(d=d.unwrap()),h){if(!e&&(d===Object||d===Function||void 0===d)){var v=i.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(v)}var m=new s.Target(o.TargetTypeEnum.ConstructorArgument,f.targetName,d);return m.metadata=c,m}return null}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[a.INJECT_TAG],multiInject:e[a.MULTI_INJECT_TAG],targetName:e[a.NAME_TAG],unmanaged:e[a.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return c(t,u.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=c(e,u.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===a.UNMANAGED_TAG}))})),s=[].concat.apply([],o).length,f=i.length-s;return f>0?f:t(e,r)}return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(48),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(38),o=n(193),a=n(59),u=n(426),s=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var o=n.bindings,c=n.childRequests,f=n.target&&n.target.isArray(),l=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(f&&l)return c.map((function(n){return t(e)(n)}));var h=null;if(!n.target.isOptional()||0!==o.length){var d=o[0],p=d.scope===i.BindingScopeEnum.Singleton,v=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(v&&null!==e&&e.has(d.id))return e.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache;else if(d.type===i.BindingTypeEnum.Function)h=d.cache;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=s("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=s("toFactory",d.serviceIdentifier,(function(){return d.factory(n.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=s("toProvider",d.serviceIdentifier,(function(){return d.provider(n.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var m=a.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+m)}h=u.resolveInstance(d.implementationType,c,t(e))}return"function"==typeof d.onActivation&&(h=d.onActivation(n.parentContext,h)),p&&(d.cache=h,d.activated=!0),v&&null!==e&&!e.has(d.id)&&e.set(d.id,h),h}}}(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(38),o=n(20);e.resolveInstance=function(t,e,n){var a,u,s=null;if(e.length>0){var c=e.filter((function(t){return null!==t.target&&t.target.type===i.TargetTypeEnum.ConstructorArgument})).map(n);u=c,s=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===i.TargetTypeEnum.ClassProperty})),o=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var i=o[n];t[r]=i})),t}(s=new((a=t).bind.apply(a,[void 0].concat(u))),e,n)}else s=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(r.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,s),s}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(38),o=n(428),a=n(196),u=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(429),i=n(110),o=n(111),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(38),i=n(196),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(48),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(20);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(31),i=n(41);e.tagged=function(t,e){return function(n,o,a){var u=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,u):i.tagProperty(n,o,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31),o=n(41);e.named=function(t){return function(e,n,a){var u=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31),o=n(41);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31),o=n(41);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31),o=n(41);e.multiInject=function(t){return function(e,n,a){var u=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(31),o=n(41);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),i=n(20),o=n(31);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Symbol.for("INJECTION");function i(t,e,n,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(r,this,e)&&Reflect.defineMetadata(r,n(),this,e),Reflect.hasMetadata(r,this,e)?Reflect.getMetadata(r,this,e):n()},set:function(t){Reflect.defineMetadata(r,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,r){return function(o,a){i(o,a,(function(){return t.getNamed(n,r)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,r,o){return function(a,u){i(a,u,(function(){return t.getTagged(n,r,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(r,o){i(r,o,(function(){return t.getAll(n)}),e)}}}},function(t,e,n){var r=n(191);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},function(t,e){t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},function(t,e,n){t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(205)},function(t,e){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},function(t,e,n){t.exports=n(119)},function(t,e,n){t.exports=n(209)},function(t,e,n){t.exports=n(210)},function(t,e){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},function(t,e){t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},function(t,e){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},function(t,e){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},function(t,e,n){t.exports=n(211)},function(t,e,n){t.exports=n(212)},function(t,e,n){t.exports=n(213)},function(t,e,n){t.exports=n(214)},function(t,e){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},function(t,e){t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},function(t,e){t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},function(t,e){t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},function(t,e,n){t.exports=function(t,e,n,i,o,a){var u,s;e||(e=2);n||(n=0);s=i?Math.min(i*e+n,t.length):t.length;for(u=n;u<s;u+=e)r[0]=t[u],r[1]=t[u+1],o(r,r,a),t[u]=r[0],t[u+1]=r[1];return t};var r=n(206)()},function(t,e){t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n(11),o=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1}return t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(){},t.prototype.executeWithWorker=function(){},t.prototype.layout=function(t){this.init(t),this.execute()},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){Object(r.k)(this,t)},t.prototype.destroy=function(){this.positions=null,this.nodes=null,this.edges=null,this.destroyed=!0},t}(),a={registerLayout:function(t,e,n){if(void 0===n&&(n=o),!e)throw new Error("please specify handler for this layout: "+t);var u=function(t){function n(n){var i=t.call(this)||this,o=i,a={},u=o.getDefaultCfg();return Object(r.k)(a,u,e,n),Object(r.c)(a,(function(t,e){o[e]=t})),i}return Object(i.c)(n,t),n}(n);a[t]=u}},u=a,s=n(22);s.translate=function(t,e,n){var r=new Array(9);return s.fromTranslation(r,n),s.multiply(t,r,e)},s.rotate=function(t,e,n){var r=new Array(9);return s.fromRotation(r,n),s.multiply(t,r,e)},s.scale=function(t,e,n){var r=new Array(9);return s.fromScaling(r,n),s.multiply(t,r,e)},s.transform=function(t,e){for(var n=[].concat(t),r=0,i=e.length;r<i;r++){var o=e[r];switch(o[0]){case"t":s.translate(n,n,[o[1],o[2]]);break;case"s":s.scale(n,n,[o[1],o[2]]);break;case"r":s.rotate(n,n,o[1])}}return n};var c=n(33);c.angle=function(t,e){var n=c.dot(t,e)/(c.length(t)*c.length(e));return Math.acos(Object(r.a)(n,-1,1))},c.direction=function(t,e){return t[0]*e[1]-e[0]*t[1]},c.angleTo=function(t,e,n){var r=c.angle(t,e),i=c.direction(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r},c.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t};n(218);var f=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},l=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],u=o[r];i[a][u]=1,e||(i[u][a]=1)})),i},h=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n.forEach((function(t){t.source&&(r[e[t.source]]+=1),t.target&&(r[e[t.target]]+=1)})),r};!function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}}}();function d(t,e){return t.degree<e.degree?-1:t.degree>e.degree?1:0}var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.radius=null,e.startRadius=null,e.endRadius=null,e.startAngle=0,e.endAngle=2*Math.PI,e.clockwise=!0,e.divisions=1,e.ordering=null,e.angleRatio=1,e.nodes=[],e.edges=[],e.nodeMap={},e.degrees=[],e.width=300,e.height=300,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t=this.nodes,e=this.edges,n=t.length,r=this.center;if(0!==n){if(1===n)return t[0].x=r[0],void(t[0].y=r[1]);var i=this.radius,o=this.startRadius,a=this.endRadius,u=this.divisions,s=this.startAngle,c=this.endAngle,f=(c-s)/n,l={};t.forEach((function(t,e){l[t.id]=e})),this.nodeMap=l;var d=h(t.length,l,e);this.degrees=d,this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),i||o||a?!o&&a?o=a:o&&!a&&(a=o):i=this.height>this.width?this.width/2:this.height/2;var p=f*this.angleRatio;this.astep=p;var v=this.ordering,m=[];m="topology"===v?this.topologyOrdering():"topology-directed"===v?this.topologyOrdering(!0):"degree"===v?this.degreeOrdering():t;for(var g=this.clockwise,y=Math.ceil(n/u),b=0;b<n;++b){var x=i;x||null===o||null===a||(x=o+b*(a-o)/(n-1)),x||(x=10+100*b/(n-1));var _=s+b%y*p+2*Math.PI/u*Math.floor(b/y);g||(_=c-b%y*p-2*Math.PI/u*Math.floor(b/y)),m[b].x=r[0]+Math.cos(_)*x,m[b].y=r[1]+Math.sin(_)*x,m[b].weight=d[b]}}},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this.degrees,n=this.edges,i=this.nodes,o=Object(r.b)(i),a=this.nodeMap,u=[o[0]],s=[i[0]],c=[],f=i.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=0;e.source&&(r=n[e.source]);var i=0;e.target&&(i=n[e.target]),t[r].children.push(t[i].id),t[i].parent.push(t[r].id)})):e.forEach((function(e){var r=0;e.source&&(r=n[e.source]);var i=0;e.target&&(i=n[e.target]),t[r].children.push(t[i].id),t[i].children.push(t[r].id)}))}(o,n,a,t);var l=0;return o.forEach((function(t,r){if(0!==r)if(r!==f-1&&e[r]===e[r+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++)if(t.id===n[i].source&&e.id===n[i].target||e.id===n[i].source&&t.id===n[i].target)return!0;return!1}(u[l],t,n)||!0===c[r]){for(var h=u[l].children,d=!1,p=0;p<h.length;p++){var v=a[h[p]];if(e[v]===e[r]&&!0!==c[v]){u.push(o[v]),s.push(i[a[o[v].id]]),c[v]=!0,d=!0;break}}for(var m=0;!d&&(c[m]||(u.push(o[m]),s.push(i[a[o[m].id]]),c[m]=!0,d=!0),++m!==f););}else u.push(t),s.push(i[a[t.id]]),c[r]=!0,l++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(d),e},e}(o),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.nodeSize=30,e.minNodeSpacing=10,e.preventOverlap=!1,e.equidistant=!1,e.startAngle=1.5*Math.PI,e.clockwise=!0,e.sortBy="degree",e.nodes=[],e.edges=[],e.width=300,e.height=300,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,i=e.length,o=t.center;if(0!==i){if(1===i)return e[0].x=o[0],void(e[0].y=o[1]);var a,u=[];a=Object(r.d)(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,e.forEach((function(t){u.push(t);var e=a;Object(r.d)(t.size)?e=Math.max(t.size[0],t.size[1]):Object(r.h)(t.size)&&(e=t.size),a=Math.max(a,e)})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.clockwise=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise;var s={},c={};if(u.forEach((function(t,e){s[t.id]=t,c[t.id]=e})),!("degree"!==t.sortBy&&Object(r.j)(t.sortBy)&&void 0!==u[0][t.sortBy]||(t.sortBy="degree",Object(r.h)(e[0].degree)))){var f=h(e.length,c,n);u.forEach((function(t,e){t.degree=f[e]}))}u.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.maxValueNode=u[0],t.maxLevelDiff=t.maxLevelDiff||t.maxValueNode[t.sortBy]/4;var l=[[]],d=l[0];u.forEach((function(e){if(d.length>0){var n=Math.abs(d[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(d=[],l.push(d))}d.push(e)}));var p=a+t.minNodeSpacing;if(!t.preventOverlap){var v=l.length>0&&l[0].length>1,m=(Math.min(t.width,t.height)/2-p)/(l.length+(v?1:0));p=Math.min(p,m)}var g=0;if(l.forEach((function(e){var n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);var r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(p*p/(i*i+o*o));g=Math.max(a,g)}e.r=g,g+=p})),t.equidistant){for(var y=0,b=0,x=0;x<l.length;x++){var _=l[x].r-b;y=Math.max(y,_)}b=0,l.forEach((function(t,e){0===e&&(b=t.r),t.r=b,b+=y}))}l.forEach((function(e){var n=e.dTheta,r=e.r;e.forEach((function(e,i){var a=t.startAngle+(t.clockwise?1:-1)*n*i;e.x=o[0]+r*Math.cos(a),e.y=o[1]+r*Math.sin(a)}))}))}},e}(o),m=n(121),g=n.n(m),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rankdir="TB",e.nodesep=50,e.ranksep=50,e.controlPoints=!1,e.sortByCombo=!1,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.nodeSize,i=t.rankdir;if(e){var o,a=t.edges||[],u=new g.a.graphlib.Graph;o=n?Object(r.d)(n)?function(){return n}:function(){return[n,n]}:function(t){return t.size?Object(r.d)(t.size)?t.size:[t.size,t.size]:[40,40]};var s,c=b(t.nodesepFunc,t.nodesep,50),f=b(t.ranksepFunc,t.ranksep,50);"LR"!==i&&"RL"!==i||(c=b(t.ranksepFunc,t.ranksep,50),f=b(t.nodesepFunc,t.nodesep,50)),u.setDefaultEdgeLabel((function(){return{}})),u.setGraph(t),e.forEach((function(t){var e=o(t),n=f(t),r=c(t),i=e[0]+2*r,a=e[1]+2*n;u.setNode(t.id,{width:i,height:a})})),a.forEach((function(t){u.setEdge(t.source,t.target,{weight:t.weight||1})})),g.a.layout(u),u.nodes().forEach((function(t){s=u.node(t);var n=e.findIndex((function(e){return e.id===t}));e[n].x=s.x,e[n].y=s.y})),u.edges().forEach((function(e){s=u.edge(e);var n=a.findIndex((function(t){return t.source===e.v&&t.target===e.w}));t.controlPoints&&"loop"!==a[n].type&&(a[n].controlPoints=s.points.slice(1,s.points.length-1))})),t.sortByCombo&&t.sortLevel("comboId")}},e.prototype.sortLevel=function(t){var e=this.nodes,n={};e.forEach((function(t){n[t.y]||(n[t.y]={y:t.y,nodes:[]}),n[t.y].nodes.push(t)})),Object.keys(n).forEach((function(e){var r=n[e].nodes,i=r.length,o={};if(r.forEach((function(t){var e=t.comboId;o[e]||(o[e]={x:0,y:0,count:0}),o[e].x+=t.x,o[e].y+=t.y,o[e].count++})),Object.keys(o).forEach((function(t){o[t].x/=o[t].count,o[t].y/=o[t].count})),1!==i){var a=r.sort((function(t,e){return t.x-e.x})),u=a[0].x,s=(a[i-1].x-u)/(i-1);r.sort((function(e,n){var r=e[t]||"undefined",i=n[t]||"undefined";return r<i?-1:r>i?1:0})).forEach((function(t,e){t.x=u+e*s}))}}))},e}(o);function b(t,e,n){return t||(Object(r.h)(e)?function(){return e}:function(){return n})}function x(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,c,f,l,h,d=t._root,p={data:r},v=t._x0,m=t._y0,g=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(v+g)/2))?v=o:g=o,(f=n>=(a=(m+y)/2))?m=a:y=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(v+g)/2))?v=o:g=o,(f=n>=(a=(m+y)/2))?m=a:y=a}while((l=f<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}var _=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function w(t){return t[0]}function E(t){return t[1]}function S(t,e,n){var r=new A(null==e?w:e,null==n?E:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function A(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function T(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var M=S.prototype=A.prototype;M.copy=function(){var t,e,n=new A(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=T(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=T(e));return n},M.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return x(this.cover(e,n),e,n,t)},M.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<o;++n)x(this,a[n],u[n],t[n]);return this},M.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},M.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},M.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},M.find=function(t,e,n){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new _(v,f,l,h,d)),null==n?n=1/0:(f=t-n,l=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var m=(i+a)/2,g=(o+u)/2;p.push(new _(v[3],m,g,a,u),new _(v[2],i,g,m,u),new _(v[1],m,o,a,g),new _(v[0],i,o,m,g)),(c=(e>=g)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var y=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),x=y*y+b*b;if(x<n){var w=Math.sqrt(n=x);f=t-w,l=e-w,h=t+w,d=e+w,r=v.data}}return r},M.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,c,f,l,h,d=this._root,p=this._x0,v=this._y0,m=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(u=(p+m)/2))?p=u:m=u,(f=a>=(s=(v+g)/2))?v=s:g=s,e=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},M.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},M.root=function(){return this._root},M.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},M.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new _(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(n=s[3])&&u.push(new _(n,c,f,o,a)),(n=s[2])&&u.push(new _(n,r,f,c,a)),(n=s[1])&&u.push(new _(n,c,i,o,f)),(n=s[0])&&u.push(new _(n,r,i,c,f))}return this},M.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new _(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&n.push(new _(o,a,u,f,l)),(o=i[1])&&n.push(new _(o,f,u,s,l)),(o=i[2])&&n.push(new _(o,a,l,f,c)),(o=i[3])&&n.push(new _(o,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},M.x=function(t){return arguments.length?(this._x=t,this):this._x},M.y=function(t){return arguments.length?(this._y=t,this):this._y};var k=function(t){return function(){return t}},I=function(t){return 1e-6*(t()-.5)},O={value:function(){}};function C(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new D(r)}function D(t){this._=t}function R(t,e){return t.trim().split(/^|\\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function N(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function P(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=O,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}D.prototype=C.prototype={constructor:D,on:function(t,e){var n,r=this._,i=R(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=P(r[n],t.name,e);else if(null==e)for(n in r)r[n]=P(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=N(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new D(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var j=C;function G(t){return(G="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)}var L,B,U=0,F=0,z=0,V=0,W=0,X=0,q="object"===("undefined"==typeof performance?"undefined":G(performance))&&performance.now?performance:Date,H="object"===("undefined"==typeof window?"undefined":G(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Y(){return W||(H(K),W=q.now()+X)}function K(){W=0}function Z(){this._call=this._time=this._next=null}function Q(t,e,n){var r=new Z;return r.restart(t,e,n),r}function $(){W=(V=q.now())+X,U=F=0;try{!function(){Y(),++U;for(var t,e=L;e;)(t=W-e._time)>=0&&e._call.call(null,t),e=e._next;--U}()}finally{U=0,function(){var t,e,n=L,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:L=e);B=t,tt(r)}(),W=0}}function J(){var t=q.now(),e=t-V;e>1e3&&(X-=e,V=t)}function tt(t){U||(F&&(F=clearTimeout(F)),t-W>24?(t<1/0&&(F=setTimeout($,t-q.now()-X)),z&&(z=clearInterval(z))):(z||(V=q.now(),z=setInterval(J,1e3)),U=1,H($)))}Z.prototype=Q.prototype={constructor:Z,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Y():+n)+(null==e?0:+e),this._next||B===this||(B?B._next=this:L=this,B=this),this._call=t,this._time=n,tt()},stop:function(){this._call&&(this._call=null,this._time=1/0,tt())}};function et(t){return t.x}function nt(t){return t.y}var rt=Math.PI*(3-Math.sqrt(5)),it=function(t){var e,n,r=1,i=.001,o=1-Math.pow(i,1/300),a=0,u=.6,s=new Map,c=Q(h),f=j("tick","end"),l=(n=1,function(){return(n=(1664525*n+1013904223)%4294967296)/4294967296});function h(){d(),f.call("tick",e),r<i&&(c.stop(),f.call("end",e))}function d(n){var i,c,f=t.length;void 0===n&&(n=1);for(var l=0;l<n;++l)for(r+=(a-r)*o,s.forEach((function(t){t(r)})),i=0;i<f;++i)null==(c=t[i]).fx?c.x+=c.vx*=u:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=u:(c.y=c.fy,c.vy=0);return e}function p(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*rt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function v(e){return e.initialize&&e.initialize(t,l),e}return null==t&&(t=[]),p(),e={tick:d,restart:function(){return c.restart(h),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),s.forEach(v),e):t},alpha:function(t){return arguments.length?(r=+t,e):r},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(o=+t,e):+o},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},randomSource:function(t){return arguments.length?(l=t,s.forEach(v),e):l},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,v(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(u=t[c]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(f.on(t,n),e):f.on(t)}}},ot=function(){var t,e,n,r,i,o=k(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=S(t,et,nt).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function h(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,h=t.y-e.y,d=f-o,p=l*l+h*h;if(d*d/s<p)return p<u&&(0===l&&(p+=(l=I(n))*l),0===h&&(p+=(h=I(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=I(n))*l),0===h&&(p+=(h=I(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=l*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:k(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c};function at(t){return(at="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)}function ut(t){return t.index}function st(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}var ct=function(t){var e,n,r,i,o,a,u=ut,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=k(30),f=1;function l(r){for(var i=0,u=t.length;i<f;++i)for(var s,c,l,h,d,p,v,m=0;m<u;++m)c=(s=t[m]).source,h=(l=s.target).x+l.vx-c.x-c.vx||I(a),d=l.y+l.vy-c.y-c.vy||I(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[m])/p*r*e[m],d*=p,l.vx-=h*(v=o[m]),l.vy-=d*v,c.vx+=h*(v=1-v),c.vy+=d*v}function h(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map((function(t,e){return[u(t,e,r),t]})));for(a=0,i=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!==at(s.source)&&(s.source=st(l,s.source)),"object"!==at(s.target)&&(s.target=st(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(f),d(),n=new Array(f),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,h()},l.links=function(e){return arguments.length?(t=e,h(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:k(+t),d(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:k(+t),p(),l):c},l};function ft(t){return t.x+t.vx}function lt(t){return t.y+t.vy}var ht=function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=S(e,ft,lt).visitAfter(u),t=0;t<d;++t)s=e[t],l=n[s.index],h=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,o,a){var u=t.data,d=t.r,p=l+d;if(!u)return e>c+p||o<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,m=f-u.y-u.vy,g=v*v+m*m;g<p*p&&(0===v&&(g+=(v=I(r))*v),0===m&&(g+=(m=I(r))*m),g=(p-(g=Math.sqrt(g)))/g*i,s.vx+=(v*=g)*(p=(d*=d)/(h+d)),s.vy+=(m*=g)*p,u.vx-=v*(p=1-p),u.vy-=m*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=k(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:k(+e),s(),a):t},a};function dt(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,d={none:{x:0,y:0}},p=[],v="force",m=!0,g=.1;function y(t){if(!m)return y;e.tick(),x();for(var r=0,i=s.length,o=void 0,a=t*g;r<i;++r)(o=s[r]).vx+=(d[n(o)].x-o.x)*a,o.vy+=(d[n(o)].y-o.y)*a}function b(){s&&function(){if(!s||!s.length)return;if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy(\'clusterAttr\') before calling .links()");var t=(d=[],v=[],m={},g=[],u=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(s),g=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=n(c[t.source]),r=n(c[t.target]);return e<=r?e+"~"+r:r+"~"+e}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(u).forEach((function(t,e){var n=u[t];d.push({id:t,size:n.count,r:Math.sqrt(n.sumforceNodeSize/Math.PI)}),m[t]=e})),g.forEach((function(t){var e=m[t.source],n=m[t.target];void 0!==e&&void 0!==n&&v.push({source:e,target:n,count:t.count})})),{nodes:d,links:v});var u,d,v,m,g;e=it(t.nodes).force("x",function(t){var e,n,r,i=k(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=k(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:k(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:k(+e),a(),o):t},o}(l).strength(.1)).force("y",function(t){var e,n,r,i=k(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=k(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:k(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:k(+e),a(),o):t},o}(h).strength(.1)).force("collide",ht((function(t){return t.r})).iterations(4)).force("charge",ot().strength(i)).force("links",ct(t.nodes.length?t.links:[]).distance(o).strength(a)),p=e.nodes(),x()}()}function x(){return d={none:{x:0,y:0}},p.forEach((function(t){d[t.id]={x:t.x-u[0],y:t.y-u[1]}})),d}function _(t){c={},t.forEach((function(t){c[t.id]=t}))}return y.initialize=function(t){s=t,b()},y.template=function(t){return arguments.length?(v=t,b(),y):v},y.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},y):(n=t,y):n},y.enableGrouping=function(t){return arguments.length?(m=t,y):m},y.strength=function(t){return arguments.length?(g=t,y):g},y.centerX=function(t){return arguments.length?(l=t,y):l},y.centerY=function(t){return arguments.length?(h=t,y):h},y.nodes=function(t){return arguments.length?(_(t||[]),s=t||[],y):s},y.links=function(t){return arguments.length?(f=t||[],b(),y):f},y.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),b(),y):r},y.nodeSize=y.forceNodeSize,y.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),b(),y):i},y.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),b(),y):o},y.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),b(),y):a},y.offset=function(t){return arguments.length?(u=t,y):u},y.getFocis=x,y}var pt="LAYOUT_RUN",vt="LAYOUT_END",mt="LAYOUT_ERROR",gt="LAYOUT_TICK",yt="GPU_LAYOUT_RUN",bt="GPU_LAYOUT_END",xt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.nodeStrength=null,e.edgeStrength=null,e.preventOverlap=!1,e.clusterNodeStrength=null,e.clusterEdgeStrength=null,e.clusterEdgeDistance=null,e.clusterNodeSize=null,e.clusterFociStrength=null,e.linkDistance=50,e.alphaDecay=.028,e.alphaMin=.001,e.alpha=.3,e.collideStrength=1,e.workerEnabled=!1,e.tick=function(){},e.onLayoutEnd=function(){},e.onTick=function(){},e.ticking=void 0,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},onTick:function(){},workerEnabled:!1}},e.prototype.init=function(t){this.nodes=t.nodes||[];var e=t.edges||[];this.edges=e.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),this.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),e.edgeForce.links(r)),e.preventOverlap&&e.overlapProcess(i),i.alpha(u).restart(),this.ticking=!0;else try{var s=ot();if(e.nodeStrength&&s.strength(e.nodeStrength),i=it().nodes(n),e.clustering){var c=dt();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=ct().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!_t()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),h=1;h<=l;h++)i.tick(),postMessage({type:gt,currentTick:h,totalTicks:l,nodes:n},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,i=this.nodeSize,o=this.nodeSpacing,a=this.collideStrength;if(n=Object(r.h)(o)?function(){return o}:Object(r.f)(o)?o:function(){return 0},i)if(Object(r.f)(i))e=function(t){return i(t)+n(t)};else if(Object(r.d)(i)){var u=(i[0]>i[1]?i[0]:i[1])/2;e=function(t){return u+n(t)}}else if(Object(r.h)(i)){var s=i/2;e=function(t){return s+n(t)}}else e=function(){return 10};else e=function(t){return t.size?Object(r.d)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",ht(e).strength(a))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object(r.k)(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(o);function _t(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var wt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=500,e.gravity=10,e.clustering=!1,e.clusterGravity=10,e.linkDistance=50,e.alpha=1,e.alphaMin=.001,e.alphaDecay=1-Math.pow(e.alphaMin,1/300),e.alphaTarget=0,e.velocityDecay=.6,e.linkStrength=1,e.nodeStrength=30,e.preventOverlap=!1,e.collideStrength=1,e.optimizeRangeFactor=1,e.tick=function(){},e.nodes=[],e.edges=[],e.width=300,e.height=300,e.bias=[],e.nodeMap={},e.nodeIdxMap={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,clustering:!1,clusterGravity:10,preventOverlap:!1,nodeSpacing:void 0,collideStrength:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(t&&0!==t.length){if(1===t.length)return t[0].x=e[0],void(t[0].y=e[1]);var n={},r={};t.forEach((function(t,e){n[t.id]=t,r[t.id]=e})),this.nodeMap=n,this.nodeIdxMap=r,this.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var o,a=t.center,u=t.velocityDecay,s=t.clustering;t.initVals(),s&&(o=t.getClusterMap());for(var c=function(i){var a=[];e.forEach((function(t,e){a[e]={x:0,y:0}})),t.applyCalculate(e,n,a),s&&t.applyClusterForce(o,a),e.forEach((function(t,e){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(t.x+=a[e].x*u,t.y+=a[e].y*u)})),f.alpha+=(f.alphaTarget-f.alpha)*f.alphaDecay,t.tick()},f=this,l=0;l<i;l++)c();var h=[0,0];e.forEach((function(t){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(h[0]+=t.x,h[1]+=t.y)})),h[0]/=e.length,h[1]/=e.length;var d=[a[0]-h[0],a[1]-h[1]];e.forEach((function(t,e){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(t.x+=d[0],t.y+=d[1])}))},e.prototype.initVals=function(){for(var t=this.edges,e={},n=0;n<t.length;++n)e[t[n].source]?e[t[n].source]++:e[t[n].source]=1,e[t[n].target]?e[t[n].target]++:e[t[n].target]=1;var i=[];for(n=0;n<t.length;++n)i[n]=e[t[n].source]/(e[t[n].source]+e[t[n].target]);this.bias=i;var o,a,u=this.nodeSize,s=this.nodeSpacing;if(a=Object(r.h)(s)?function(){return s}:Object(r.f)(s)?s:function(){return 0},u)if(Object(r.f)(u))o=function(t){return u(t)+a(t)};else if(Object(r.d)(u)){var c=(u[0]>u[1]?u[0]:u[1])/2;o=function(t){return c+a(t)}}else if(Object(r.h)(u)){var f=u/2;o=function(t){return f+a(t)}}else o=function(){return 10};else o=function(t){return t.size?Object(r.d)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+a(t):t.size/2+a(t):10+a(t)};this.nodeSize=o;var l,h=this.linkDistance;h||(h=50),Object(r.h)(h)&&(l=function(t){return h}),this.linkDistance=l;var d,p=this.linkStrength;p||(p=1),Object(r.h)(p)&&(d=function(t){return p}),this.linkStrength=d;var v,m=this.nodeStrength;m||(m=30),Object(r.h)(m)&&(v=function(t){return m}),this.nodeStrength=v},e.prototype.getClusterMap=function(){var t=this.nodes,e={};for(var n in t.forEach((function(t){if(void 0===e[t.cluster]){var n={name:t.cluster,cx:0,cy:0,count:0};e[t.cluster]=n}var i=e[t.cluster];Object(r.h)(t.x)&&(i.cx+=t.x),Object(r.h)(t.y)&&(i.cy+=t.y),i.count++})),e)e[n].cx/=e[n].count,e[n].cy/=e[n].count;return e},e.prototype.applyClusterForce=function(t,e){var n=this.gravity,i=this.nodes,o=this.clusterGravity||n,a=this.alpha;for(var u in i.forEach((function(n,i){if(Object(r.h)(n.x)&&Object(r.h)(n.y)){var u=t[n.cluster],s=n.x-u.cx,c=n.y-u.cy,f=Math.sqrt(s*s+c*c);e[i].x-=s*o*a/f,e[i].y-=c*o*a/f}})),t)t[u].cx=0,t[u].cy=0,t[u].count=0;for(var u in i.forEach((function(e){var n=t[e.cluster];Object(r.h)(e.x)&&(n.cx+=e.x),Object(r.h)(e.y)&&(n.cy+=e.y),n.count++})),t)t[u].cx/=t[u].count,t[u].cy/=t[u].count},e.prototype.applyCalculate=function(t,e,n){var r={};t.forEach((function(e,i){n[i]={x:0,y:0},t.forEach((function(t,n){if(!(i<n)){var o=e.x-t.x,a=e.y-t.y,u=o*o+a*a;u<1&&(u=Math.sqrt(u)),0===o&&(u+=(o=.01*Math.random())*o),0===a&&(u+=(a=.01*Math.random())*a);var s=Math.sqrt(u);r[e.id+"-"+t.id]={vx:o,vy:a,vl:u,sqrtVl:s},r[t.id+"-"+e.id]={vx:-o,vy:-a,vl:u,sqrtVl:s}}}))})),this.calRepulsive(t,n,r),this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){var i=this.width*this.optimizeRangeFactor*this.width*this.optimizeRangeFactor,o=this.nodeStrength,a=this.alpha,u=this.collideStrength,s=this.preventOverlap,c=this.nodeSize;t.forEach((function(f,l){t.forEach((function(t,h){if(l!==h&&Object(r.h)(f.x)&&Object(r.h)(t.x)&&Object(r.h)(f.y)&&Object(r.h)(t.y)){var d=n[f.id+"-"+t.id],p=d.vl,v=d.vx,m=d.vy;if(!(p>i)&&(e[l].x+=v*o(t)*a/p,e[l].y+=m*o(t)*a/p,s&&l<h)){var g=c(f),y=c(t),b=g+y;if(p<b*b){var x=n[f.id+"-"+t.id].sqrtVl,_=(b-x)/x*u,w=y*y/(g*g+y*y),E=v*_,S=m*_;e[l].x+=E*w,e[l].y+=S*w,w=1-w,e[h].x-=E*w,e[h].y-=S*w}}}}))}))},e.prototype.calAttractive=function(t,e,n){var i=this,o=this.linkDistance,a=this.alpha,u=this.linkStrength,s=this.bias;t.forEach((function(t,c){if(t.source&&t.target){var f=i.nodeIdxMap[t.source],l=i.nodeIdxMap[t.target];if(f!==l){var h=i.nodeMap[t.source],d=i.nodeMap[t.target];if(Object(r.h)(d.x)&&Object(r.h)(h.x)&&Object(r.h)(d.y)&&Object(r.h)(h.y)){var p=n[t.target+"-"+t.source],v=(p.vl,p.sqrtVl),m=p.vx,g=p.vy,y=(v-o(t))/v*a*u(t),b=m*y,x=g*y,_=s[c];e[l].x-=b*_,e[l].y-=x*_,e[f].x+=b*(1-_),e[f].y+=x*(1-_)}}}}))},e}(o),Et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.gravity=10,e.speed=1,e.clustering=!1,e.clusterGravity=10,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=this.nodes,n=this.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var i={},o={};e.forEach((function(e,n){Object(r.h)(e.x)||(e.x=Math.random()*t.width),Object(r.h)(e.y)||(e.y=Math.random()*t.height),i[e.id]=e,o[e.id]=n})),this.nodeMap=i,this.nodeIdxMap=o,this.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var o=t.center,a=t.height*t.width,u=Math.sqrt(a)/10,s=a/(e.length+1),c=Math.sqrt(s),f=t.gravity,l=t.speed,h=t.clustering,d={};if(h)for(var p in e.forEach((function(t){if(void 0===d[t.cluster]){var e={name:t.cluster,cx:0,cy:0,count:0};d[t.cluster]=e}var n=d[t.cluster];Object(r.h)(t.x)&&(n.cx+=t.x),Object(r.h)(t.y)&&(n.cy+=t.y),n.count++})),d)d[p].cx/=d[p].count,d[p].cy/=d[p].count;for(var v=function(i){var a=[];if(e.forEach((function(t,e){a[e]={x:0,y:0}})),t.applyCalculate(e,n,a,c,s),h){var p=t.clusterGravity||f;for(var v in e.forEach((function(t,e){if(Object(r.h)(t.x)&&Object(r.h)(t.y)){var n=d[t.cluster],i=Math.sqrt((t.x-n.cx)*(t.x-n.cx)+(t.y-n.cy)*(t.y-n.cy)),o=c*p;a[e].x-=o*(t.x-n.cx)/i,a[e].y-=o*(t.y-n.cy)/i}})),d)d[v].cx=0,d[v].cy=0,d[v].count=0;for(var v in e.forEach((function(t){var e=d[t.cluster];Object(r.h)(t.x)&&(e.cx+=t.x),Object(r.h)(t.y)&&(e.cy+=t.y),e.count++})),d)d[v].cx/=d[v].count,d[v].cy/=d[v].count}e.forEach((function(t,e){if(Object(r.h)(t.x)&&Object(r.h)(t.y)){var n=.01*c*f;a[e].x-=n*(t.x-o[0]),a[e].y-=n*(t.y-o[1])}})),e.forEach((function(t,e){if(Object(r.h)(t.x)&&Object(r.h)(t.y)){var n=Math.sqrt(a[e].x*a[e].x+a[e].y*a[e].y);if(n>0){var i=Math.min(u*(l/800),n);t.x+=a[e].x/n*i,t.y+=a[e].y/n*i}}}))},m=0;m<i;m++)v()},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(i,o){e[o]={x:0,y:0},t.forEach((function(t,a){if(o!==a&&Object(r.h)(i.x)&&Object(r.h)(t.x)&&Object(r.h)(i.y)&&Object(r.h)(t.y)){var u=i.x-t.x,s=i.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=o>a?1:-1;u=.01*f,s=.01*f}var l=n/c;e[o].x+=u*l,e[o].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var i=this;t.forEach((function(t){if(t.source&&t.target){var o=i.nodeIdxMap[t.source],a=i.nodeIdxMap[t.target];if(o!==a){var u=i.nodeMap[t.source],s=i.nodeMap[t.target];if(Object(r.h)(s.x)&&Object(r.h)(u.x)&&Object(r.h)(s.y)&&Object(r.h)(u.y)){var c=s.x-u.x,f=s.y-u.y,l=Math.sqrt(c*c+f*f),h=l*l/n;e[a].x-=c/l*h,e[a].y-=f/l*h,e[o].x+=c/l*h,e[o].y+=f/l*h}}}}))},e}(o),St=(function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.item=n.item,r.canvasX=n.canvasX,r.canvasY=n.canvasY,r.wheelDelta=n.wheelDelta,r.detail=n.detail,r}Object(i.c)(e,t)}(n(219).Event),function(t){return Number.isNaN(Number(t))}),At=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.begin=[0,0],e.preventOverlap=!0,e.preventOverlapPadding=10,e.condense=!1,e.sortBy="degree",e.nodeSize=30,e.nodes=[],e.edges=[],e.center=[0,0],e.width=300,e.height=300,e.row=0,e.col=0,e.cellWidth=0,e.cellHeight=0,e.cellUsed={},e.id2manPos={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,e=t.nodes,n=e.length,i=t.center;if(0!==n){if(1===n)return e[0].x=i[0],void(e[0].y=i[1]);var o=t.edges,a=[];e.forEach((function(t){a.push(t)}));var u={};if(a.forEach((function(t,e){u[t.id]=e})),("degree"===t.sortBy||!Object(r.j)(t.sortBy)||void 0===a[0][t.sortBy])&&(t.sortBy="degree",St(e[0].degree))){var s=h(a.length,u,o);a.forEach((function(t,e){t.degree=s[e]}))}a.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var c=t.rows,f=null!=t.cols?t.cols:t.columns;if(t.cells=n,null!=c&&null!=f?(t.rows=c,t.cols=f):null!=c&&null==f?(t.rows=c,t.cols=Math.ceil(t.cells/t.rows)):null==c&&null!=f?(t.cols=f,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((d=t.small())-1)*(l=t.large())>=t.cells?t.small(d-1):(l-1)*d>=t.cells&&t.large(l-1);else for(;t.cols*t.rows<t.cells;){var l,d=t.small();((l=t.large())+1)*d>=t.cells?t.large(l+1):t.small(d+1)}t.cellWidth=t.width/t.cols,t.cellHeight=t.height/t.rows,t.condense&&(t.cellWidth=0,t.cellHeight=0),t.preventOverlap&&a.forEach((function(e){var n,i;e.x&&e.y||(e.x=0,e.y=0),Object(r.d)(e.size)?(n=e.size[0],i=e.size[1]):Object(r.h)(e.size)&&(n=e.size,i=e.size),void 0!==n&&void 0!==i||(Object(r.d)(t.nodeSize)?(n=t.nodeSize[0],i=t.nodeSize[1]):Object(r.h)(t.nodeSize)?(n=t.nodeSize,i=t.nodeSize):(n=30,i=30));var o=t.preventOverlapPadding,a=n+o,u=i+o;t.cellWidth=Math.max(t.cellWidth,a),t.cellHeight=Math.max(t.cellHeight,u)})),t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var p=0;p<a.length;p++){var v=a[p],m=void 0;if(t.position&&(m=t.position(v)),m&&(void 0!==m.row||void 0!==m.col)){var g={row:m.row,col:m.col};if(void 0===g.col)for(g.col=0;t.used(g.row,g.col);)g.col++;else if(void 0===g.row)for(g.row=0;t.used(g.row,g.col);)g.row++;t.id2manPos[v.id]=g,t.use(g.row,g.col)}t.getPos(v)}}},e.prototype.small=function(t){var e,n=this.rows||5,r=this.cols||5;null==t?e=Math.min(n,r):Math.min(n,r)===this.rows?this.rows=t:this.cols=t;return e},e.prototype.large=function(t){var e,n=this.rows||5,r=this.cols||5;null==t?e=Math.max(n,r):Math.max(n,r)===this.rows?this.rows=t:this.cols=t;return e},e.prototype.used=function(t,e){return this.cellUsed["c-"+t+"-"+e]||!1},e.prototype.use=function(t,e){this.cellUsed["c-"+t+"-"+e]=!0},e.prototype.moveToNextCell=function(){var t=this.cols||5;this.col++,this.col>=t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,n,r=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+r[0],n=a.row*o+o/2+r[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+r[0],n=this.row*o+o/2+r[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=n},e}(o),Tt=Object.prototype.toString;function Mt(t){return Tt.call(t).endsWith("Array]")}var kt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mt(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]>a&&(a=t[u]);return a};var It=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mt(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]<a&&(a=t[u]);return a};var Ot=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Mt(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!Mt(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=It(t),i=kt(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,u=n.max,s=void 0===u?n.autoMinMax?i:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e},Ct=" ".repeat(2),Dt=" ".repeat(4);function Rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxRows,r=void 0===n?15:n,i=e.maxColumns,o=void 0===i?10:i,a=e.maxNumSize,u=void 0===a?8:a;return"".concat(t.constructor.name," {\\n").concat(Ct,"[\\n").concat(Dt).concat(Nt(t,r,o,u),"\\n").concat(Ct,"]\\n").concat(Ct,"rows: ").concat(t.rows,"\\n").concat(Ct,"columns: ").concat(t.columns,"\\n}")}function Nt(t,e,n,r){for(var i=t.rows,o=t.columns,a=Math.min(i,e),u=Math.min(o,n),s=[],c=0;c<a;c++){for(var f=[],l=0;l<u;l++)f.push(Pt(t.get(c,l),r));s.push("".concat(f.join(" ")))}return u!==o&&(s[s.length-1]+=" ... ".concat(o-n," more columns")),a!==i&&s.push("... ".concat(i-e," more rows")),s.join("\\n".concat(Dt))}function Pt(t,e){var n=String(t);if(n.length<=e)return n.padEnd(e," ");var r=t.toPrecision(e-2);if(r.length<=e)return r;var i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function jt(t){return(jt="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)}function Gt(t,e,n){var r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Lt(t,e,n){var r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function Bt(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ut(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Ft(t,e){if("object"!==jt(e))throw new TypeError("unexpected type for row indices");if(e.some((function(e){return e<0||e>=t.rows})))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function zt(t,e){if("object"!==jt(e))throw new TypeError("unexpected type for column indices");if(e.some((function(e){return e<0||e>=t.columns})))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Vt(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(Xt("startRow",e),Xt("endRow",n),Xt("startColumn",r),Xt("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Wt(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<t;r++)n.push(e);return n}function Xt(t,e){if("number"!=typeof e)throw new TypeError("".concat(t," must be a number"))}function qt(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<r;a++){for(var u=0,s=0,c=0,f=0;f<i;f++)u+=c=t.get(a,f)-n[a],s+=c*c;e?o.push((s-u*u/i)/(i-1)):o.push((s-u*u/i)/i)}return o}function Ht(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<i;a++){for(var u=0,s=0,c=0,f=0;f<r;f++)u+=c=t.get(f,a)-n[a],s+=c*c;e?o.push((s-u*u/r)/(r-1)):o.push((s-u*u/r)/r)}return o}function Yt(t,e,n){for(var r=t.rows,i=t.columns,o=r*i,a=0,u=0,s=0,c=0;c<r;c++)for(var f=0;f<i;f++)a+=s=t.get(c,f)-n,u+=s*s;return e?(u-a*a/o)/(o-1):(u-a*a/o)/o}function Kt(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}function Zt(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}function Qt(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}function $t(t){for(var e=[],n=0;n<t.rows;n++){for(var r=0,i=0;i<t.columns;i++)r+=Math.pow(t.get(n,i),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}function Jt(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}function te(t){for(var e=[],n=0;n<t.columns;n++){for(var r=0,i=0;i<t.rows;i++)r+=Math.pow(t.get(i,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}function ee(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}function ne(t){for(var e=t.size-1,n=0,r=0;r<t.columns;r++)for(var i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}function re(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}function ie(t,e){return(ie=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function oe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ue(t);if(e){var i=ue(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ae(this,n)}}function ae(t,e){return!e||"object"!==se(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function ue(t){return(ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function se(t){return(se="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)}function ce(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function le(t,e,n){return e&&fe(t.prototype,e),n&&fe(t,n),t}var he=function(){function t(){ce(this,t)}return le(t,[{key:"apply",value:function(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.call(this,e,n);return this}},{key:"to1DArray",value:function(){for(var t=[],e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.push(this.get(e,n));return t}},{key:"to2DArray",value:function(){for(var t=[],e=0;e<this.rows;e++){t.push([]);for(var n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}},{key:"toJSON",value:function(){return this.to2DArray()}},{key:"isRowVector",value:function(){return 1===this.rows}},{key:"isColumnVector",value:function(){return 1===this.columns}},{key:"isVector",value:function(){return 1===this.rows||1===this.columns}},{key:"isSquare",value:function(){return this.rows===this.columns}},{key:"isSymmetric",value:function(){if(this.isSquare()){for(var t=0;t<this.rows;t++)for(var e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}},{key:"isEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(var o=e+1;o<this.rows;o++)0!==this.get(t,o)&&(r=!1);t++}return r}},{key:"echelonForm",value:function(){for(var t=this.clone(),e=0,n=0;e<t.rows&&n<t.columns;){for(var r=e,i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);for(var o=t.get(e,n),a=n;a<t.columns;a++)t.set(e,a,t.get(e,a)/o);for(var u=e+1;u<t.rows;u++){var s=t.get(u,n)/t.get(e,n);t.set(u,n,0);for(var c=n+1;c<t.columns;c++)t.set(u,c,t.get(u,c)-t.get(e,c)*s)}e++,n++}}return t}},{key:"reducedEchelonForm",value:function(){for(var t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;r>=0;)if(0===t.maxRow(r))r--;else{for(var i=0,o=!1;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(var a=0;a<r;a++)for(var u=t.get(a,i),s=i;s<e;s++){var c=t.get(a,s)-u*t.get(r,s);t.set(a,s,c)}r--}return t}},{key:"set",value:function(){throw new Error("set method is unimplemented")}},{key:"get",value:function(){throw new Error("get method is unimplemented")}},{key:"repeat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==se(t))throw new TypeError("options must be an object");var e=t.rows,n=void 0===e?1:e,r=t.columns,i=void 0===r?1:r;if(!Number.isInteger(n)||n<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new me(this.rows*n,this.columns*i),a=0;a<n;a++)for(var u=0;u<i;u++)o.setSubMatrix(this,this.rows*a,this.columns*u);return o}},{key:"fill",value:function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,t);return this}},{key:"neg",value:function(){return this.mulS(-1)}},{key:"getRow",value:function(t){Gt(this,t);for(var e=[],n=0;n<this.columns;n++)e.push(this.get(t,n));return e}},{key:"getRowVector",value:function(t){return me.rowVector(this.getRow(t))}},{key:"setRow",value:function(t,e){Gt(this,t),e=Bt(this,e);for(var n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}},{key:"swapRows",value:function(t,e){Gt(this,t),Gt(this,e);for(var n=0;n<this.columns;n++){var r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}},{key:"getColumn",value:function(t){Lt(this,t);for(var e=[],n=0;n<this.rows;n++)e.push(this.get(n,t));return e}},{key:"getColumnVector",value:function(t){return me.columnVector(this.getColumn(t))}},{key:"setColumn",value:function(t,e){Lt(this,t),e=Ut(this,e);for(var n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}},{key:"swapColumns",value:function(t,e){Lt(this,t),Lt(this,e);for(var n=0;n<this.rows;n++){var r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}},{key:"addRowVector",value:function(t){t=Bt(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}},{key:"subRowVector",value:function(t){t=Bt(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}},{key:"mulRowVector",value:function(t){t=Bt(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}},{key:"divRowVector",value:function(t){t=Bt(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}},{key:"addColumnVector",value:function(t){t=Ut(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}},{key:"subColumnVector",value:function(t){t=Ut(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}},{key:"mulColumnVector",value:function(t){t=Ut(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}},{key:"divColumnVector",value:function(t){t=Ut(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}},{key:"mulRow",value:function(t,e){Gt(this,t);for(var n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}},{key:"mulColumn",value:function(t,e){Lt(this,t);for(var n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}},{key:"max",value:function(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}},{key:"minIndex",value:function(){for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"maxRow",value:function(t){Gt(this,t);for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}},{key:"maxRowIndex",value:function(t){Gt(this,t);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}},{key:"minRow",value:function(t){Gt(this,t);for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}},{key:"minRowIndex",value:function(t){Gt(this,t);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}},{key:"maxColumn",value:function(t){Lt(this,t);for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}},{key:"maxColumnIndex",value:function(t){Lt(this,t);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}},{key:"minColumn",value:function(t){Lt(this,t);for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}},{key:"minColumnIndex",value:function(t){Lt(this,t);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}},{key:"diag",value:function(){for(var t=Math.min(this.rows,this.columns),e=[],n=0;n<t;n++)e.push(this.get(n,n));return e}},{key:"norm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)e+=this.get(n,r)*this.get(n,r);return Math.sqrt(e)}throw new RangeError("unknown norm type: ".concat(t))}},{key:"cumulativeSum",value:function(){for(var t=0,e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}},{key:"dot",value:function(e){t.isMatrix(e)&&(e=e.to1DArray());var n=this.to1DArray();if(n.length!==e.length)throw new RangeError("vectors do not have the same size");for(var r=0,i=0;i<n.length;i++)r+=n[i]*e[i];return r}},{key:"mmul",value:function(t){t=me.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.columns,i=new me(e,r),o=new Float64Array(n),a=0;a<r;a++){for(var u=0;u<n;u++)o[u]=t.get(u,a);for(var s=0;s<e;s++){for(var c=0,f=0;f<n;f++)c+=this.get(s,f)*o[f];i.set(s,a,c)}}return i}},{key:"strassen2x2",value:function(t){t=me.checkMatrix(t);var e=new me(2,2),n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,h=n*(o-c),d=s*(u-r),p=(n+i)*c,v=f+d-p+(i-s)*(u+c),m=h+p,g=l+d,y=f-l+h+(a-n)*(r+o);return e.set(0,0,v),e.set(0,1,m),e.set(1,0,g),e.set(1,1,y),e}},{key:"strassen3x3",value:function(t){t=me.checkMatrix(t);var e=new me(3,3),n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),h=t.get(0,1),d=t.get(0,2),p=t.get(1,0),v=t.get(1,1),m=t.get(1,2),g=t.get(2,0),y=t.get(2,1),b=t.get(2,2),x=(n-o)*(-h+v),_=(-n+o+a)*(l-h+v),w=(o+a)*(-l+h),E=n*l,S=(-n+s+c)*(l-d+m),A=(-n+s)*(d-m),T=(s+c)*(-l+d),M=(-i+c+f)*(v+g-y),k=(i-f)*(v-y),I=i*g,O=(c+f)*(-g+y),C=(-i+a+u)*(m+g-b),D=(i-u)*(m-b),R=(a+u)*(-g+b),N=E+I+r*p,P=(n+r+i-o-a-c-f)*v+_+w+E+M+I+O,j=E+S+T+(n+r+i-a-u-s-c)*m+I+C+R,G=x+a*(-l+h+p-v-m-g+b)+_+E+I+C+D,L=x+_+w+E+u*y,B=I+C+D+R+o*d,U=E+S+A+c*(-l+d+p-v-m-g+y)+M+k+I,F=M+k+I+O+s*h,z=E+S+A+T+f*b;return e.set(0,0,N),e.set(0,1,P),e.set(0,2,j),e.set(1,0,G),e.set(1,1,L),e.set(1,2,B),e.set(2,0,U),e.set(2,1,F),e.set(2,2,z),e}},{key:"mmulStrassen",value:function(e){e=me.checkMatrix(e);var n=this.clone(),r=n.rows,i=n.columns,o=e.rows,a=e.columns;function u(e,n,r){var i=e.rows,o=e.columns;if(i===n&&o===r)return e;var a=t.zeros(n,r);return a=a.setSubMatrix(e,0,0)}i!==o&&console.warn("Multiplying ".concat(r," x ").concat(i," and ").concat(o," x ").concat(a," matrix: dimensions do not match."));var s=Math.max(r,o),c=Math.max(i,a);return function e(n,r,i,o){if(i<=512||o<=512)return n.mmul(r);i%2==1&&o%2==1?(n=u(n,i+1,o+1),r=u(r,i+1,o+1)):i%2==1?(n=u(n,i+1,o),r=u(r,i+1,o)):o%2==1&&(n=u(n,i,o+1),r=u(r,i,o+1));var a=parseInt(n.rows/2,10),s=parseInt(n.columns/2,10),c=n.subMatrix(0,a-1,0,s-1),f=r.subMatrix(0,a-1,0,s-1),l=n.subMatrix(0,a-1,s,n.columns-1),h=r.subMatrix(0,a-1,s,r.columns-1),d=n.subMatrix(a,n.rows-1,0,s-1),p=r.subMatrix(a,r.rows-1,0,s-1),v=n.subMatrix(a,n.rows-1,s,n.columns-1),m=r.subMatrix(a,r.rows-1,s,r.columns-1),g=e(t.add(c,v),t.add(f,m),a,s),y=e(t.add(d,v),f,a,s),b=e(c,t.sub(h,m),a,s),x=e(v,t.sub(p,f),a,s),_=e(t.add(c,l),m,a,s),w=e(t.sub(d,c),t.add(f,h),a,s),E=e(t.sub(l,v),t.add(p,m),a,s),S=t.add(g,x);S.sub(_),S.add(E);var A=t.add(b,_),T=t.add(y,x),M=t.sub(g,y);M.add(b),M.add(w);var k=t.zeros(2*S.rows,2*S.columns);return(k=(k=(k=(k=k.setSubMatrix(S,0,0)).setSubMatrix(A,S.rows,0)).setSubMatrix(T,0,S.columns)).setSubMatrix(M,S.rows,S.columns)).subMatrix(0,i-1,0,o-1)}(n=u(n,s,c),e=u(e,s,c),s,c)}},{key:"scaleRows",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==se(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new me(this.rows,this.columns),a=0;a<this.rows;a++){var u=this.getRow(a);Ot(u,{min:n,max:i,output:u}),o.setRow(a,u)}return o}},{key:"scaleColumns",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==se(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new me(this.rows,this.columns),a=0;a<this.columns;a++){var u=this.getColumn(a);Ot(u,{min:n,max:i,output:u}),o.setColumn(a,u)}return o}},{key:"flipRows",value:function(){for(var t=Math.ceil(this.columns/2),e=0;e<this.rows;e++)for(var n=0;n<t;n++){var r=this.get(e,n),i=this.get(e,this.columns-1-n);this.set(e,n,i),this.set(e,this.columns-1-n,r)}return this}},{key:"flipColumns",value:function(){for(var t=Math.ceil(this.rows/2),e=0;e<this.columns;e++)for(var n=0;n<t;n++){var r=this.get(n,e),i=this.get(this.rows-1-n,e);this.set(n,e,i),this.set(this.rows-1-n,e,r)}return this}},{key:"kroneckerProduct",value:function(t){t=me.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new me(e*r,n*i),a=0;a<e;a++)for(var u=0;u<n;u++)for(var s=0;s<r;s++)for(var c=0;c<i;c++)o.set(r*a+s,i*u+c,this.get(a,u)*t.get(s,c));return o}},{key:"transpose",value:function(){for(var t=new me(this.columns,this.rows),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}},{key:"sortRows",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}},{key:"sortColumns",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}},{key:"subMatrix",value:function(t,e,n,r){Vt(this,t,e,n,r);for(var i=new me(e-t+1,r-n+1),o=t;o<=e;o++)for(var a=n;a<=r;a++)i.set(o-t,a-n,this.get(o,a));return i}},{key:"subMatrixRow",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");for(var r=new me(t.length,n-e+1),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));r.set(i,o-e,this.get(t[i],o))}return r}},{key:"subMatrixColumn",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");for(var r=new me(n-e+1,t.length),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));r.set(o-e,i,this.get(o,t[i]))}return r}},{key:"setSubMatrix",value:function(t,e,n){Vt(this,e,e+(t=me.checkMatrix(t)).rows-1,n,n+t.columns-1);for(var r=0;r<t.rows;r++)for(var i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}},{key:"selection",value:function(t,e){for(var n=function(t,e,n){return{row:Ft(t,e),column:zt(t,n)}}(this,t,e),r=new me(t.length,e.length),i=0;i<n.row.length;i++)for(var o=n.row[i],a=0;a<n.column.length;a++){var u=n.column[a];r.set(i,a,this.get(o,u))}return r}},{key:"trace",value:function(){for(var t=Math.min(this.rows,this.columns),e=0,n=0;n<t;n++)e+=this.get(n,n);return e}},{key:"clone",value:function(){for(var t=new me(this.rows,this.columns),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}},{key:"sum",value:function(t){switch(t){case"row":return function(t){for(var e=Wt(t.rows),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){for(var e=Wt(t.columns),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=0,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"product",value:function(t){switch(t){case"row":return function(t){for(var e=Wt(t.rows,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){for(var e=Wt(t.columns,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=1,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"mean",value:function(t){var e=this.sum(t);switch(t){case"row":for(var n=0;n<this.rows;n++)e[n]/=this.columns;return e;case"column":for(var r=0;r<this.columns;r++)e[r]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error("invalid option: ".concat(t))}}},{key:"variance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===se(t)&&(e=t,t=void 0),"object"!==se(e))throw new TypeError("options must be an object");var n=e,r=n.unbiased,i=void 0===r||r,o=n.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return qt(this,i,a);case"column":if(!Array.isArray(a))throw new TypeError("mean must be an array");return Ht(this,i,a);case void 0:if("number"!=typeof a)throw new TypeError("mean must be a number");return Yt(this,i,a);default:throw new Error("invalid option: ".concat(t))}}},{key:"standardDeviation",value:function(t,e){"object"===se(t)&&(e=t,t=void 0);var n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(var r=0;r<n.length;r++)n[r]=Math.sqrt(n[r]);return n}},{key:"center",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===se(t)&&(e=t,t=void 0),"object"!==se(e))throw new TypeError("options must be an object");var n=e,r=n.center,i=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(i))throw new TypeError("center must be an array");return Kt(this,i),this;case"column":if(!Array.isArray(i))throw new TypeError("center must be an array");return Zt(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return Qt(this,i),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"scale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===se(t)&&(e=t,t=void 0),"object"!==se(e))throw new TypeError("options must be an object");var n=e.scale;switch(t){case"row":if(void 0===n)n=$t(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return Jt(this,n),this;case"column":if(void 0===n)n=te(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return ee(this,n),this;case void 0:if(void 0===n)n=ne(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return re(this,n),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"toString",value:function(t){return Rt(this,t)}},{key:"size",get:function(){return this.rows*this.columns}}],[{key:"from1DArray",value:function(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");for(var r=new me(t,e),i=0;i<t;i++)for(var o=0;o<e;o++)r.set(i,o,n[i*e+o]);return r}},{key:"rowVector",value:function(t){for(var e=new me(1,t.length),n=0;n<t.length;n++)e.set(0,n,t[n]);return e}},{key:"columnVector",value:function(t){for(var e=new me(t.length,1),n=0;n<t.length;n++)e.set(n,0,t[n]);return e}},{key:"zeros",value:function(t,e){return new me(t,e)}},{key:"ones",value:function(t,e){return new me(t,e).fill(1)}},{key:"rand",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==se(n))throw new TypeError("options must be an object");for(var r=n.random,i=void 0===r?Math.random:r,o=new me(t,e),a=0;a<t;a++)for(var u=0;u<e;u++)o.set(a,u,i());return o}},{key:"randInt",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==se(n))throw new TypeError("options must be an object");var r=n.min,i=void 0===r?0:r,o=n.max,a=void 0===o?1e3:o,u=n.random,s=void 0===u?Math.random:u;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var c=a-i,f=new me(t,e),l=0;l<t;l++)for(var h=0;h<e;h++){var d=i+Math.round(s()*c);f.set(l,h,d)}return f}},{key:"eye",value:function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);for(var r=Math.min(t,e),i=this.zeros(t,e),o=0;o<r;o++)i.set(o,o,n);return i}},{key:"diag",value:function(t,e,n){var r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);for(var i=Math.min(r,e,n),o=this.zeros(e,n),a=0;a<i;a++)o.set(a,a,t[a]);return o}},{key:"min",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new me(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.min(t.get(o,a),e.get(o,a)));return i}},{key:"max",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new this(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.max(t.get(o,a),e.get(o,a)));return i}},{key:"checkMatrix",value:function(e){return t.isMatrix(e)?e:new me(e)}},{key:"isMatrix",value:function(t){return null!=t&&"Matrix"===t.klass}}]),t}();function de(t,e){return t-e}he.prototype.klass="Matrix","undefined"!=typeof Symbol&&(he.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Rt(this)}),he.random=he.rand,he.randomInt=he.randInt,he.diagonal=he.diag,he.prototype.diagonal=he.prototype.diag,he.identity=he.eye,he.prototype.negate=he.prototype.neg,he.prototype.tensorProduct=he.prototype.kroneckerProduct;var pe,ve,me=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ie(t,e)}(n,t);var e=oe(n);function n(t,r){var i;if(ce(this,n),i=e.call(this),n.isMatrix(t))return ae(i,t.clone());if(Number.isInteger(t)&&t>0){if(i.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var o=0;o<t;o++)i.data.push(new Float64Array(r))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");var a=t;if(t=a.length,"number"!=typeof(r=a[0].length)||0===r)throw new TypeError("Data must be a 2D array with at least one element");i.data=[];for(var u=0;u<t;u++){if(a[u].length!==r)throw new RangeError("Inconsistent array dimensions");i.data.push(Float64Array.from(a[u]))}}return i.rows=t,i.columns=r,i}return le(n,[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}},{key:"removeRow",value:function(t){if(Gt(this,t),1===this.rows)throw new RangeError("A matrix cannot have less than one row");return this.data.splice(t,1),this.rows-=1,this}},{key:"addRow",value:function(t,e){return void 0===e&&(e=t,t=this.rows),Gt(this,t,!0),e=Float64Array.from(Bt(this,e)),this.data.splice(t,0,e),this.rows+=1,this}},{key:"removeColumn",value:function(t){if(Lt(this,t),1===this.columns)throw new RangeError("A matrix cannot have less than one column");for(var e=0;e<this.rows;e++){for(var n=new Float64Array(this.columns-1),r=0;r<t;r++)n[r]=this.data[e][r];for(var i=t+1;i<this.columns;i++)n[i-1]=this.data[e][i];this.data[e]=n}return this.columns-=1,this}},{key:"addColumn",value:function(t,e){void 0===e&&(e=t,t=this.columns),Lt(this,t,!0),e=Ut(this,e);for(var n=0;n<this.rows;n++){for(var r=new Float64Array(this.columns+1),i=0;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}]),n}(he);function ge(t){return(ge="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)}function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function be(t,e){return(be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function xe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=we(t);if(e){var i=we(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _e(this,n)}}function _e(t,e){return!e||"object"!==ge(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function we(t){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ve=me,(pe=he).prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},pe.prototype.addS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},pe.prototype.addM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},pe.add=function(t,e){return new ve(t).add(e)},pe.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},pe.prototype.subS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},pe.prototype.subM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},pe.sub=function(t,e){return new ve(t).sub(e)},pe.prototype.subtract=pe.prototype.sub,pe.prototype.subtractS=pe.prototype.subS,pe.prototype.subtractM=pe.prototype.subM,pe.subtract=pe.sub,pe.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},pe.prototype.mulS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},pe.prototype.mulM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},pe.mul=function(t,e){return new ve(t).mul(e)},pe.prototype.multiply=pe.prototype.mul,pe.prototype.multiplyS=pe.prototype.mulS,pe.prototype.multiplyM=pe.prototype.mulM,pe.multiply=pe.mul,pe.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},pe.prototype.divS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},pe.prototype.divM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},pe.div=function(t,e){return new ve(t).div(e)},pe.prototype.divide=pe.prototype.div,pe.prototype.divideS=pe.prototype.divS,pe.prototype.divideM=pe.prototype.divM,pe.divide=pe.div,pe.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},pe.prototype.modS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},pe.prototype.modM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},pe.mod=function(t,e){return new ve(t).mod(e)},pe.prototype.modulus=pe.prototype.mod,pe.prototype.modulusS=pe.prototype.modS,pe.prototype.modulusM=pe.prototype.modM,pe.modulus=pe.mod,pe.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},pe.prototype.andS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},pe.prototype.andM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},pe.and=function(t,e){return new ve(t).and(e)},pe.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},pe.prototype.orS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},pe.prototype.orM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},pe.or=function(t,e){return new ve(t).or(e)},pe.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},pe.prototype.xorS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},pe.prototype.xorM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},pe.xor=function(t,e){return new ve(t).xor(e)},pe.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},pe.prototype.leftShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},pe.prototype.leftShiftM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},pe.leftShift=function(t,e){return new ve(t).leftShift(e)},pe.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},pe.prototype.signPropagatingRightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},pe.prototype.signPropagatingRightShiftM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},pe.signPropagatingRightShift=function(t,e){return new ve(t).signPropagatingRightShift(e)},pe.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},pe.prototype.rightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},pe.prototype.rightShiftM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},pe.rightShift=function(t,e){return new ve(t).rightShift(e)},pe.prototype.zeroFillRightShift=pe.prototype.rightShift,pe.prototype.zeroFillRightShiftS=pe.prototype.rightShiftS,pe.prototype.zeroFillRightShiftM=pe.prototype.rightShiftM,pe.zeroFillRightShift=pe.rightShift,pe.prototype.not=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},pe.not=function(t){return new ve(t).not()},pe.prototype.abs=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},pe.abs=function(t){return new ve(t).abs()},pe.prototype.acos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},pe.acos=function(t){return new ve(t).acos()},pe.prototype.acosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},pe.acosh=function(t){return new ve(t).acosh()},pe.prototype.asin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},pe.asin=function(t){return new ve(t).asin()},pe.prototype.asinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},pe.asinh=function(t){return new ve(t).asinh()},pe.prototype.atan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},pe.atan=function(t){return new ve(t).atan()},pe.prototype.atanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},pe.atanh=function(t){return new ve(t).atanh()},pe.prototype.cbrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},pe.cbrt=function(t){return new ve(t).cbrt()},pe.prototype.ceil=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},pe.ceil=function(t){return new ve(t).ceil()},pe.prototype.clz32=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},pe.clz32=function(t){return new ve(t).clz32()},pe.prototype.cos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},pe.cos=function(t){return new ve(t).cos()},pe.prototype.cosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},pe.cosh=function(t){return new ve(t).cosh()},pe.prototype.exp=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},pe.exp=function(t){return new ve(t).exp()},pe.prototype.expm1=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},pe.expm1=function(t){return new ve(t).expm1()},pe.prototype.floor=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},pe.floor=function(t){return new ve(t).floor()},pe.prototype.fround=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},pe.fround=function(t){return new ve(t).fround()},pe.prototype.log=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},pe.log=function(t){return new ve(t).log()},pe.prototype.log1p=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},pe.log1p=function(t){return new ve(t).log1p()},pe.prototype.log10=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},pe.log10=function(t){return new ve(t).log10()},pe.prototype.log2=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},pe.log2=function(t){return new ve(t).log2()},pe.prototype.round=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},pe.round=function(t){return new ve(t).round()},pe.prototype.sign=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},pe.sign=function(t){return new ve(t).sign()},pe.prototype.sin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},pe.sin=function(t){return new ve(t).sin()},pe.prototype.sinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},pe.sinh=function(t){return new ve(t).sinh()},pe.prototype.sqrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},pe.sqrt=function(t){return new ve(t).sqrt()},pe.prototype.tan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},pe.tan=function(t){return new ve(t).tan()},pe.prototype.tanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},pe.tanh=function(t){return new ve(t).tanh()},pe.prototype.trunc=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},pe.trunc=function(t){return new ve(t).trunc()},pe.pow=function(t,e){return new ve(t).pow(e)},pe.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},pe.prototype.powS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},pe.prototype.powM=function(t){if(t=ve.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this};var Ee=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&be(t,e)}(o,t);var e,n,r,i=xe(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).data=t,e.rows=t.length,e.columns=t[0].length,e}return e=o,(n=[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}}])&&ye(e.prototype,n),r&&ye(e,r),o}(he);function Se(t,e){var n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}function Ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Me=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ae(this,t);var r,i=(e=Ee.checkMatrix(e)).rows,o=e.columns,a=n.computeLeftSingularVectors,u=void 0===a||a,s=n.computeRightSingularVectors,c=void 0===s||s,f=n.autoTranspose,l=void 0!==f&&f,h=Boolean(u),d=Boolean(c),p=!1;if(i<o)if(l){i=(r=e.transpose()).rows,o=r.columns,p=!0;var v=h;h=d,d=v}else r=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else r=e.clone();for(var m=Math.min(i,o),g=Math.min(i+1,o),y=new Float64Array(g),b=new me(i,m),x=new me(o,o),_=new Float64Array(o),w=new Float64Array(i),E=new Float64Array(g),S=0;S<g;S++)E[S]=S;for(var A=Math.min(i-1,o),T=Math.max(0,Math.min(o-2,i)),M=Math.max(A,T),k=0;k<M;k++){if(k<A){y[k]=0;for(var I=k;I<i;I++)y[k]=Se(y[k],r.get(I,k));if(0!==y[k]){r.get(k,k)<0&&(y[k]=-y[k]);for(var O=k;O<i;O++)r.set(O,k,r.get(O,k)/y[k]);r.set(k,k,r.get(k,k)+1)}y[k]=-y[k]}for(var C=k+1;C<o;C++){if(k<A&&0!==y[k]){for(var D=0,R=k;R<i;R++)D+=r.get(R,k)*r.get(R,C);D=-D/r.get(k,k);for(var N=k;N<i;N++)r.set(N,C,r.get(N,C)+D*r.get(N,k))}_[C]=r.get(k,C)}if(h&&k<A)for(var P=k;P<i;P++)b.set(P,k,r.get(P,k));if(k<T){_[k]=0;for(var j=k+1;j<o;j++)_[k]=Se(_[k],_[j]);if(0!==_[k]){_[k+1]<0&&(_[k]=0-_[k]);for(var G=k+1;G<o;G++)_[G]/=_[k];_[k+1]+=1}if(_[k]=-_[k],k+1<i&&0!==_[k]){for(var L=k+1;L<i;L++)w[L]=0;for(var B=k+1;B<i;B++)for(var U=k+1;U<o;U++)w[B]+=_[U]*r.get(B,U);for(var F=k+1;F<o;F++)for(var z=-_[F]/_[k+1],V=k+1;V<i;V++)r.set(V,F,r.get(V,F)+z*w[V])}if(d)for(var W=k+1;W<o;W++)x.set(W,k,_[W])}}var X=Math.min(o,i+1);if(A<o&&(y[A]=r.get(A,A)),i<X&&(y[X-1]=0),T+1<X&&(_[T]=r.get(T,X-1)),_[X-1]=0,h){for(var q=A;q<m;q++){for(var H=0;H<i;H++)b.set(H,q,0);b.set(q,q,1)}for(var Y=A-1;Y>=0;Y--)if(0!==y[Y]){for(var K=Y+1;K<m;K++){for(var Z=0,Q=Y;Q<i;Q++)Z+=b.get(Q,Y)*b.get(Q,K);Z=-Z/b.get(Y,Y);for(var $=Y;$<i;$++)b.set($,K,b.get($,K)+Z*b.get($,Y))}for(var J=Y;J<i;J++)b.set(J,Y,-b.get(J,Y));b.set(Y,Y,1+b.get(Y,Y));for(var tt=0;tt<Y-1;tt++)b.set(tt,Y,0)}else{for(var et=0;et<i;et++)b.set(et,Y,0);b.set(Y,Y,1)}}if(d)for(var nt=o-1;nt>=0;nt--){if(nt<T&&0!==_[nt])for(var rt=nt+1;rt<o;rt++){for(var it=0,ot=nt+1;ot<o;ot++)it+=x.get(ot,nt)*x.get(ot,rt);it=-it/x.get(nt+1,nt);for(var at=nt+1;at<o;at++)x.set(at,rt,x.get(at,rt)+it*x.get(at,nt))}for(var ut=0;ut<o;ut++)x.set(ut,nt,0);x.set(nt,nt,1)}for(var st=X-1,ct=Number.EPSILON;X>0;){var ft=void 0,lt=void 0;for(ft=X-2;ft>=-1&&-1!==ft;ft--){var ht=Number.MIN_VALUE+ct*Math.abs(y[ft]+Math.abs(y[ft+1]));if(Math.abs(_[ft])<=ht||Number.isNaN(_[ft])){_[ft]=0;break}}if(ft===X-2)lt=4;else{var dt=void 0;for(dt=X-1;dt>=ft&&dt!==ft;dt--){var pt=(dt!==X?Math.abs(_[dt]):0)+(dt!==ft+1?Math.abs(_[dt-1]):0);if(Math.abs(y[dt])<=ct*pt){y[dt]=0;break}}dt===ft?lt=3:dt===X-1?lt=1:(lt=2,ft=dt)}switch(ft++,lt){case 1:var vt=_[X-2];_[X-2]=0;for(var mt=X-2;mt>=ft;mt--){var gt=Se(y[mt],vt),yt=y[mt]/gt,bt=vt/gt;if(y[mt]=gt,mt!==ft&&(vt=-bt*_[mt-1],_[mt-1]=yt*_[mt-1]),d)for(var xt=0;xt<o;xt++)gt=yt*x.get(xt,mt)+bt*x.get(xt,X-1),x.set(xt,X-1,-bt*x.get(xt,mt)+yt*x.get(xt,X-1)),x.set(xt,mt,gt)}break;case 2:var _t=_[ft-1];_[ft-1]=0;for(var wt=ft;wt<X;wt++){var Et=Se(y[wt],_t),St=y[wt]/Et,At=_t/Et;if(y[wt]=Et,_t=-At*_[wt],_[wt]=St*_[wt],h)for(var Tt=0;Tt<i;Tt++)Et=St*b.get(Tt,wt)+At*b.get(Tt,ft-1),b.set(Tt,ft-1,-At*b.get(Tt,wt)+St*b.get(Tt,ft-1)),b.set(Tt,wt,Et)}break;case 3:var Mt=Math.max(Math.abs(y[X-1]),Math.abs(y[X-2]),Math.abs(_[X-2]),Math.abs(y[ft]),Math.abs(_[ft])),kt=y[X-1]/Mt,It=y[X-2]/Mt,Ot=_[X-2]/Mt,Ct=y[ft]/Mt,Dt=_[ft]/Mt,Rt=((It+kt)*(It-kt)+Ot*Ot)/2,Nt=kt*Ot*(kt*Ot),Pt=0;0===Rt&&0===Nt||(Pt=Nt/(Rt+(Pt=Rt<0?0-Math.sqrt(Rt*Rt+Nt):Math.sqrt(Rt*Rt+Nt))));for(var jt=(Ct+kt)*(Ct-kt)+Pt,Gt=Ct*Dt,Lt=ft;Lt<X-1;Lt++){var Bt=Se(jt,Gt);0===Bt&&(Bt=Number.MIN_VALUE);var Ut=jt/Bt,Ft=Gt/Bt;if(Lt!==ft&&(_[Lt-1]=Bt),jt=Ut*y[Lt]+Ft*_[Lt],_[Lt]=Ut*_[Lt]-Ft*y[Lt],Gt=Ft*y[Lt+1],y[Lt+1]=Ut*y[Lt+1],d)for(var zt=0;zt<o;zt++)Bt=Ut*x.get(zt,Lt)+Ft*x.get(zt,Lt+1),x.set(zt,Lt+1,-Ft*x.get(zt,Lt)+Ut*x.get(zt,Lt+1)),x.set(zt,Lt,Bt);if(0===(Bt=Se(jt,Gt))&&(Bt=Number.MIN_VALUE),Ut=jt/Bt,Ft=Gt/Bt,y[Lt]=Bt,jt=Ut*_[Lt]+Ft*y[Lt+1],y[Lt+1]=-Ft*_[Lt]+Ut*y[Lt+1],Gt=Ft*_[Lt+1],_[Lt+1]=Ut*_[Lt+1],h&&Lt<i-1)for(var Vt=0;Vt<i;Vt++)Bt=Ut*b.get(Vt,Lt)+Ft*b.get(Vt,Lt+1),b.set(Vt,Lt+1,-Ft*b.get(Vt,Lt)+Ut*b.get(Vt,Lt+1)),b.set(Vt,Lt,Bt)}_[X-2]=jt,1;break;case 4:if(y[ft]<=0&&(y[ft]=y[ft]<0?-y[ft]:0,d))for(var Wt=0;Wt<=st;Wt++)x.set(Wt,ft,-x.get(Wt,ft));for(;ft<st&&!(y[ft]>=y[ft+1]);){var Xt=y[ft];if(y[ft]=y[ft+1],y[ft+1]=Xt,d&&ft<o-1)for(var qt=0;qt<o;qt++)Xt=x.get(qt,ft+1),x.set(qt,ft+1,x.get(qt,ft)),x.set(qt,ft,Xt);if(h&&ft<i-1)for(var Ht=0;Ht<i;Ht++)Xt=b.get(Ht,ft+1),b.set(Ht,ft+1,b.get(Ht,ft)),b.set(Ht,ft,Xt);ft++}0,X--}}if(p){var Yt=x;x=b,b=Yt}this.m=i,this.n=o,this.s=y,this.U=b,this.V=x}var e,n,r;return e=t,(n=[{key:"solve",value:function(t){for(var e=t,n=this.threshold,r=this.s.length,i=me.zeros(r,r),o=0;o<r;o++)Math.abs(this.s[o])<=n?i.set(o,o,0):i.set(o,o,1/this.s[o]);for(var a=this.U,u=this.rightSingularVectors,s=u.mmul(i),c=u.rows,f=a.rows,l=me.zeros(c,f),h=0;h<c;h++)for(var d=0;d<f;d++){for(var p=0,v=0;v<r;v++)p+=s.get(h,v)*a.get(d,v);l.set(h,d,p)}return l.mmul(e)}},{key:"solveForDiagonal",value:function(t){return this.solve(me.diag(t))}},{key:"inverse",value:function(){for(var t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new me(n,this.s.length),o=0;o<n;o++)for(var a=0;a<r;a++)Math.abs(this.s[a])>e&&i.set(o,a,t.get(o,a)/this.s[a]);for(var u=this.U,s=u.rows,c=u.columns,f=new me(n,s),l=0;l<n;l++)for(var h=0;h<s;h++){for(var d=0,p=0;p<c;p++)d+=i.get(l,p)*u.get(h,p);f.set(l,h,d)}return f}},{key:"condition",get:function(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}},{key:"norm2",get:function(){return this.s[0]}},{key:"rank",get:function(){for(var t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s,r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return me.diag(this.s)}}])&&Te(e.prototype,n),r&&Te(e,r),t}(),ke=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.linkDistance=50,e.scaledDistances=null,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this.nodes,e=this.edges,n=void 0===e?[]:e,r=this.center;if(t&&0!==t.length){if(1===t.length)return t[0].x=r[0],void(t[0].y=r[1]);var i=this.linkDistance,o=l({nodes:t,edges:n},!1),a=f(o);this.handleInfinity(a);var u,s,c=(u=i,s=[],a.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*u)})),s.push(e)})),s);this.scaledDistances=c;var h=this.runMDS();this.positions=h,h.forEach((function(e,n){t[n].x=e[0]+r[0],t[n].y=e[1]+r[1]}))}},e.prototype.runMDS=function(){var t=this.scaledDistances,e=me.mul(me.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new Me(e),a=me.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return me.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e}(o),Ie=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this.dimension,e=this.distances,n=this.linkDistance;try{var r=me.mul(me.pow(e,2),-.5),i=r.mean("row"),o=r.mean("column"),a=r.mean();r.add(a).subRowVector(i).subColumnVector(o);var u=new Me(r),s=me.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map((function(e){return me.mul([e],[s]).toJSON()[0].splice(0,t)}))}catch(t){for(var c=[],f=0;f<e.length;f++){var l=Math.random()*n,h=Math.random()*n;c.push([l,h])}return c}},t}(),Oe=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],n=this.iterations,r=this.width/10;this.maxDisplace=r,this.disp=e;for(var i=0;i<n;i++)t.forEach((function(t,n){e[n]={x:0,y:0}})),this.getRepulsion(),this.updatePositions();return t},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&o[u]===o[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var h=u>s?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var d=i*i/l;r[u].x+=c/l*d,r[u].y+=f/l*d}}}))}))},t.prototype.updatePositions=function(){var t=this.positions,e=this.disp,n=this.speed,r=this.strictRadial,i=this.focusID,o=this.maxDisplace||this.width/10;r&&e.forEach((function(e,n){var r=t[n][0]-t[i][0],o=t[n][1]-t[i][1],a=Math.sqrt(r*r+o*o),u=o/a,s=-r/a,c=Math.sqrt(e.x*e.x+e.y*e.y),f=Math.acos((u*e.x+s*e.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;e.x=u*l,e.y=s*l}));var a=this.radii;t.forEach((function(u,s){if(s!==i){var c=Math.sqrt(e[s].x*e[s].x+e[s].y*e[s].y);if(c>0&&s!==i){var f=Math.min(o*(n/800),c);if(u[0]+=e[s].x/c*f,u[1]+=e[s].y/c*f,r){var l=u[0]-t[i][0],h=u[1]-t[i][1],d=Math.sqrt(l*l+h*h);l=l/d*a[s],h=h/d*a[s],u[0]=t[i][0]+l,u[1]=t[i][1]+h}}}}))},t}();function Ce(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var De=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.focusNode=null,e.unitRadius=null,e.linkDistance=50,e.preventOverlap=!1,e.strictRadial=!0,e.maxPreventOverlapIteration=200,e.sortStrength=10,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges||[],i=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=i[0],void(e[0].y=i[1]);var o=t.linkDistance,a=null;if(Object(r.j)(t.focusNode)){for(var u=!1,s=0;s<e.length;s++)e[s].id===t.focusNode&&(a=e[s],t.focusNode=a,u=!0,s=e.length);u||(a=null)}else a=t.focusNode;a||(a=e[0],t.focusNode=a);var c,h,d,p=(c=e,h=a.id,d=-1,c.forEach((function(t,e){t.id===h&&(d=e)})),d);t.focusIndex=p;var v=l({nodes:e,edges:n},!1),m=f(v),g=t.maxToFocus(m,p);t.handleInfinity(m,p,g+1),t.distances=m;var y=m[p];t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var b=t.width||500,x=t.height||500,_=b-i[0]>i[0]?i[0]:b-i[0],w=x-i[1]>i[1]?i[1]:x-i[1];0===_&&(_=b/2),0===w&&(w=x/2);var E=w>_?_:w,S=Math.max.apply(Math,y),A=[];y.forEach((function(e,n){t.unitRadius||(t.unitRadius=E/S),A[n]=e*t.unitRadius})),t.radii=A;var T=t.eIdealDisMatrix();t.eIdealDistances=T;var M=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(T);t.weights=M;var k=new Ie({distances:T,linkDistance:o}).layout();k.forEach((function(t){St(t[0])&&(t[0]=Math.random()*o),St(t[1])&&(t[1]=Math.random()*o)})),t.positions=k,k.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]})),k.forEach((function(t){t[0]-=k[p][0],t[1]-=k[p][1]})),t.run();var I=t.preventOverlap,O=t.nodeSize,C=t.strictRadial;if(I){var D,R=t.nodeSpacing;D=Object(r.h)(R)?function(){return R}:Object(r.f)(R)?R:function(){return 0};var N={nodeSizeFunc:O?Object(r.d)(O)?function(t){return(O[0]>O[1]?O[0]:O[1])+D(t)}:function(t){return O+D(t)}:function(t){return t.size?Object(r.d)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+D(t):t.size+D(t):10+D(t)},adjMatrix:v,positions:k,radii:A,height:x,width:b,strictRadial:C,focusID:p,iterations:t.maxPreventOverlapIteration||200,k:k.length/4.5,nodes:e},P=new Oe(N);k=P.layout()}k.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]}))}},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],n=this.weights||[],r=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,r,n)}},e.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=Ce(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(s!==e){var n=Ce(u,t),o=0===n?0:1/n,a=r[e][s];d+=i[s][e],l+=i[s][e]*(t[0]+a*(u[0]-t[0])*o),h+=i[s][e]*(t[1]+a*(u[1]-t[1])*o)}}));var p=0===n[s]?0:1/n[s];d*=o,d+=t*p*p,l*=o,l+=t*p*u[0]*f,u[0]=l/d,h*=o,h+=t*p*u[1]*f,u[1]=h/d}}))},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var n=t.distances,i=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,u=[];return n&&n.forEach((function(n,s){var c=[];n.forEach((function(n,u){if(s===u)c.push(0);else if(o[s]===o[u])if("data"===t.sortBy)c.push(n*(Math.abs(s-u)*t.sortStrength)/(o[s]/a));else if(t.sortBy){var f=e[s][t.sortBy]||0,l=e[u][t.sortBy]||0;Object(r.j)(f)&&(f=f.charCodeAt(0)),Object(r.j)(l)&&(l=l.charCodeAt(0)),c.push(n*(Math.abs(f-l)*t.sortStrength)/(o[s]/a))}else c.push(n*i/(o[s]/a));else{var h=(i+a)/2;c.push(n*h)}})),u.push(c)})),u},e.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},e.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},e}(o),Re=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.width=300,e.height=300,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]}))},e}(o),Ne=n(54),Pe=n.n(Ne),je=n(62),Ge=n.n(je),Le=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Be(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function Ue(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Fe(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function ze(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Ge()(t),i=5;i>0;i-=1){var o=r.toHsv(),a=Ge()({h:Be(o,i,!0),s:Ue(o,i,!0),v:Fe(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var u=1;u<=4;u+=1){var s=r.toHsv(),c=Ge()({h:Be(s,u),s:Ue(s,u),v:Fe(s,u)}).toHexString();n.push(c)}return"dark"===e.theme?Le.map((function(t){var r=t.index,i=t.opacity;return Ge.a.mix(e.backgroundColor||"#141414",n[r],100*i).toHexString()})):n}var Ve={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},We={},Xe={};Object.keys(Ve).forEach((function(t){We[t]=ze(Ve[t]),We[t].primary=We[t][5],Xe[t]=ze(Ve[t],{theme:"dark",backgroundColor:"#141414"}),Xe[t].primary=Xe[t][5]}));We.red,We.volcano,We.gold,We.orange,We.yellow,We.lime,We.green,We.cyan,We.blue,We.geekblue,We.purple,We.magenta,We.grey;var qe=function(t,e,n){var r=Pe()(t),i=Pe()(e);return Pe()([(1-n)*r.color[0]+n*i.color[0],(1-n)*r.color[1]+n*i.color[1],(1-n)*r.color[2]+n*i.color[2]]).rgb()},He=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=qe(e,t,.05).rgb().toString(),i=qe(e,t,.1).rgb().toString(),o=qe(e,t,.2).rgb().toString(),a=qe(e,t,.4).rgb().toString(),u=qe(e,n,.02).rgb().toString(),s=qe(e,n,.05).rgb().toString(),c=qe(e,n,.1).rgb().toString(),f=qe(e,n,.2).rgb().toString(),l=qe(e,n,.3).rgb().toString(),h=ze(t,{theme:"default",backgroundColor:e}),d=Pe()(t).hex().toLowerCase(),p=h.indexOf(d),v=t;return-1!==p&&(v=h[p+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:r,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:v,highlightFill:o,disableStroke:l,disableFill:s,edgeMainStroke:l,edgeActiveStroke:t,edgeInactiveStroke:f,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:l,comboMainFill:u,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:l,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:u,comboDisableStroke:f,comboDisableFill:s}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=qe(e,t,.2).rgb().toString(),i=qe(e,t,.3).rgb().toString(),o=qe(e,t,.6).rgb().toString(),a=qe(e,t,.8).rgb().toString(),u=qe(e,n,.2).rgb().toString(),s=qe(e,n,.25).rgb().toString(),c=qe(e,n,.3).rgb().toString(),f=qe(e,n,.4).rgb().toString(),l=qe(e,n,.5).rgb().toString(),h=ze(t,{theme:"dark",backgroundColor:e}),d=Pe()(t).hex().toLowerCase(),p=h.indexOf(d),v=t;return-1!==p&&(v=h[p+1]),{mainStroke:a,mainFill:r,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:o,disableStroke:l,disableFill:s,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:c,comboMainStroke:f,comboMainFill:s,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:f,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:s,comboDisableStroke:f,comboDisableFill:u}}(t,e,"#777")},Ye=He("rgb(95, 149, 255)","rgb(255, 255, 255)"),Ke={version:"4.0.3",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:Ye.mainStroke,fill:Ye.mainFill},size:20,color:Ye.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Ye.activeFill,stroke:Ye.activeStroke}},nodeStateStyles:{active:{fill:Ye.activeFill,stroke:Ye.activeStroke,lineWidth:2,shadowColor:Ye.mainStroke,shadowBlur:10},selected:{fill:Ye.selectedFill,stroke:Ye.selectedStroke,lineWidth:4,shadowColor:Ye.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Ye.highlightFill,stroke:Ye.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Ye.inactiveFill,stroke:Ye.inactiveStroke,lineWidth:1},disable:{fill:Ye.disableFill,stroke:Ye.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Ye.edgeMainStroke,lineAppendWidth:2},color:Ye.edgeMainStroke},edgeStateStyles:{active:{stroke:Ye.edgeActiveStroke,lineWidth:1},selected:{stroke:Ye.edgeSelectedStroke,lineWidth:2,shadowColor:Ye.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Ye.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Ye.edgeInactiveStroke,lineWidth:1},disable:{stroke:Ye.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Ye.comboMainFill,lineWidth:1,stroke:Ye.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Ye.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Ye.comboActiveStroke,lineWidth:1,fill:Ye.comboActiveFill},selected:{stroke:Ye.comboSelectedStroke,lineWidth:2,fill:Ye.comboSelectedFill,shadowColor:Ye.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Ye.comboHighlightStroke,lineWidth:2,fill:Ye.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Ye.comboInactiveStroke,fill:Ye.comboInactiveFill,lineWidth:1},disable:{stroke:Ye.comboDisableStroke,fill:Ye.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},Ze=Math.PI,Qe=Math.sin,$e=Math.cos,Je=(Qe(Ze/8),$e(Ze/8),function(t,e){if(t&&t.children)for(var n=t.children.length-1;n>=0;n--)if(!Je(t.children[n],e))return;return!1!==e(t)}),tn=function(t,e){"function"==typeof e&&Je(t,e)},en=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=100,e.gravity=10,e.comboGravity=10,e.linkDistance=10,e.alpha=1,e.alphaMin=.001,e.alphaDecay=1-Math.pow(e.alphaMin,1/300),e.alphaTarget=0,e.velocityDecay=.6,e.edgeStrength=.2,e.nodeStrength=30,e.preventOverlap=!1,e.preventNodeOverlap=!1,e.preventComboOverlap=!1,e.collideStrength=void 0,e.nodeCollideStrength=void 0,e.comboCollideStrength=void 0,e.optimizeRangeFactor=1,e.onTick=function(){},e.onLayoutEnd=function(){},e.depthAttractiveForceScale=1,e.depthRepulsiveForceScale=2,e.nodes=[],e.edges=[],e.combos=[],e.comboTrees=[],e.width=300,e.height=300,e.bias=[],e.nodeMap={},e.oriComboMap={},e.nodeIdxMap={},e.comboMap={},e.previousLayouted=!1,e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],void(t[0].y=e[1]);this.initVals(),this.run(),this.onLayoutEnd()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var i=t.center,o=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var u=function(n){var i=[];e.forEach((function(t,e){i[e]={x:0,y:0}})),t.applyCalculate(i),t.applyComboCenterForce(i),e.forEach((function(t,e){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(t.x+=i[e].x*o,t.y+=i[e].y*o)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[i[0]-c[0],i[1]-c[1]];e.forEach((function(t,e){Object(r.h)(t.x)&&Object(r.h)(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=a[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this.edges,e=this.nodes,n=this.combos,i={},o={},a={};e.forEach((function(t,e){o[t.id]=t,a[t.id]=e})),this.nodeMap=o,this.nodeIdxMap=a;var u={};n.forEach((function(t){u[t.id]=t})),this.oriComboMap=u,this.comboMap=this.getComboMap();var s=this.preventOverlap;this.preventComboOverlap=this.preventComboOverlap||s,this.preventNodeOverlap=this.preventNodeOverlap||s;var c=this.collideStrength;c&&(this.comboCollideStrength=c,this.nodeCollideStrength=c);for(var f=0;f<t.length;++f)i[t[f].source]?i[t[f].source]++:i[t[f].source]=1,i[t[f].target]?i[t[f].target]++:i[t[f].target]=1;var l=[];for(f=0;f<t.length;++f)l[f]=i[t[f].source]/(i[t[f].source]+i[t[f].target]);this.bias=l;var h,d,p=this.nodeSize,v=this.nodeSpacing;if(d=Object(r.h)(v)?function(){return v}:Object(r.f)(v)?v:function(){return 0},this.nodeSpacing=d,p)if(Object(r.f)(p))h=function(t){return p(t)};else if(Object(r.d)(p)){var m=(p[0]>p[1]?p[0]:p[1])/2;h=function(t){return m}}else{var g=p/2;h=function(t){return g}}else h=function(t){return t.size?Object(r.d)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:t.size/2:10};this.nodeSize=h;var y,b=this.comboSpacing;y=Object(r.h)(b)?function(){return b}:Object(r.f)(b)?b:function(){return 0},this.comboSpacing=y;var x,_=this.comboPadding;x=Object(r.h)(_)?function(){return _}:Object(r.d)(_)?function(){return Math.max.apply(null,_)}:Object(r.f)(_)?_:function(){return 0},this.comboPadding=x;var w,E=this.linkDistance;E||(E=10),w=Object(r.h)(E)?function(t){return E}:E,this.linkDistance=w;var S,A=this.edgeStrength;A||(A=1),S=Object(r.h)(A)?function(t){return A}:A,this.edgeStrength=S;var T,M=this.nodeStrength;M||(M=30),T=Object(r.h)(M)?function(t){return M}:M,this.nodeStrength=T},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){if(e.comboId){var r=t[e.comboId];e.x=r.cx+100/(n+1),e.y=r.cy+100/(n+1)}else e.x=100/(n+1),e.y=100/(n+1)}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.nodeIdxMap,i=t.comboTrees,o=t.oriComboMap,a={};return(i||[]).forEach((function(i){var u=[];tn(i,(function(i){if("node"===i.itemType)return!0;if(!o[i.id])return!0;if(void 0===a[i.id]){var s={name:i.id,cx:0,cy:0,count:0,depth:t.oriComboMap[i.id].depth,children:[]};a[i.id]=s}var c=i.children;c&&c.forEach((function(t){if(!a[t.id]&&!e[t.id])return!0;u.push(t)}));var f=a[i.id];if(f.cx=0,f.cy=0,0===u.length){f.empty=!0;var l=o[i.id],h=Object.keys(e).length,d=i.id+"-visual-child-"+h,p={id:d,x:l.x,y:l.y,depth:f.depth+1,itemType:"node"};t.nodes.push(p),e[d]=p,n[d]=h,f.cx=l.x,f.cy=l.y,u.push(p)}return u.forEach((function(t){if(f.count++,"node"!==t.itemType){var n=a[t.id];return Object(r.h)(n.cx)&&(f.cx+=n.cx),void(Object(r.h)(n.cy)&&(f.cy+=n.cy))}var i=e[t.id];i&&(Object(r.h)(i.x)&&(f.cx+=i.x),Object(r.h)(i.y)&&(f.cy+=i.y))})),f.cx/=f.count,f.cy/=f.count,f.children=u,!0}))})),a},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,n=this.comboGravity||e,i=this.alpha,o=this.comboTrees,a=this.nodeIdxMap,u=this.nodeMap,s=this.comboMap;(o||[]).forEach((function(e){tn(e,(function(e){if("node"===e.itemType)return!0;if(!s[e.id])return!0;var o=s[e.id],c=(o.depth+1)/10*.5,f=o.cx,l=o.cy;return o.cx=0,o.cy=0,o.children.forEach((function(e){if("node"!==e.itemType){var h=s[e.id];return h&&Object(r.h)(h.cx)&&(o.cx+=h.cx),void(h&&Object(r.h)(h.cy)&&(o.cy+=h.cy))}var d=u[e.id],p=d.x-f||.005,v=d.y-l||.005,m=Math.sqrt(p*p+v*v),g=a[d.id],y=n*i/m*c;t[g].x-=p*y,t[g].y-=v*y,Object(r.h)(d.x)&&(o.cx+=d.x),Object(r.h)(d.y)&&(o.cy+=d.y)})),o.cx/=o.count,o.cy/=o.count,!0}))}))},e.prototype.applyCalculate=function(t){var e=this.comboMap,n=this.nodes,r={};n.forEach((function(t,e){n.forEach((function(n,i){if(!(e<i)){var o=t.x-n.x||.005,a=t.y-n.y||.005,u=o*o+a*a,s=Math.sqrt(u);u<1&&(u=s),r[t.id+"-"+n.id]={vx:o,vy:a,vl2:u,vl:s},r[n.id+"-"+t.id]={vx:-o,vy:-a,vl2:u,vl:s}}}))})),this.updateComboSizes(e),this.calRepulsive(t,r),this.calAttractive(t,r),this.preventComboOverlap&&this.comboNonOverlapping(t,e)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,i=e.nodeMap,o=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];tn(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(c){var f=n.children;f&&f.forEach((function(e){(t[e.id]||i[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=i[t.id];if(!e)return!0;var n=o(e),r=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>r&&(c.minX=r),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||Ke.defaultCombo.size;Object(r.d)(l)&&(l=l[0]);var h=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=h/2+a(c)/2+u(c),!0}}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this.comboTree,r=this.comboCollideStrength,i=this.nodeIdxMap,o=this.nodeMap;tn(n,(function(n){if(e[n.id]||o[n.id]||"comboTreeRoot"===n.id){var a=n.children;return a&&a.length>1&&a.forEach((function(n,u){if("node"!==n.itemType){var s=e[n.id];s&&a.forEach((function(a,c){if(!(u<=c)&&"node"!==a.itemType){var f=e[a.id];if(f){var l=s.cx-f.cx||.005,h=s.cy-f.cy||.005,d=l*l+h*h,p=s.r,v=f.r,m=p+v,g=v*v,y=p*p;if(d<m*m){var b=n.children;if(!b||0===b.length)return;var x=a.children;if(!x||0===x.length)return;var _=Math.sqrt(d),w=(m-_)/_*r,E=l*w,S=h*w,A=g/(y+g),T=1-A;b.forEach((function(e){if("node"===e.itemType&&o[e.id]){var n=i[e.id];x.forEach((function(e){if("node"===e.itemType&&o[e.id]){var r=i[e.id];t[n].x+=E*A,t[n].y+=S*A,t[r].x-=E*T,t[r].y-=S*T}}))}}))}}}}))}})),!0}}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,h=n.center;r.forEach((function(d,p){if(d.x&&d.y){if(h){var v=n.gravity,m=d.x-h[0]||.005,g=d.y-h[1]||.005,y=Math.sqrt(m*m+g*g);t[p].x-=m*v*a/y,t[p].y-=g*v*a/y}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var h=e[d.id+"-"+n.id],v=h.vl2,m=h.vl;if(!(m>i)){var g=e[d.id+"-"+n.id],y=g.vx,b=g.vy,x=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;x=x<1?1:x,n.comboId!==d.comboId&&(x+=1);var _=x?Math.pow(l,x):1,w=o(n)*a/v*_;if(t[p].x+=y*w,t[p].y+=b*w,p<r&&s){var E=c(d)+f(d),S=c(n)+f(n),A=E+S;if(v<A*A){var T=(A-m)/m*u,M=S*S,k=M/(E*E+M),I=y*T,O=b*T;t[p].x+=I*k,t[p].y+=O*k,k=1-k,t[r].x-=I*k,t[r].y-=O*k}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,i=n.edges,o=n.linkDistance,a=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;i.forEach((function(i,f){if(i.source&&i.target&&i.source!==i.target){var l=n.nodeIdxMap[i.source],h=n.nodeIdxMap[i.target],d=n.nodeMap[i.source],p=n.nodeMap[i.target],v=Math.log(Math.abs(d.depth-p.depth)/10);d.comboId===p.comboId&&(v/=2);var m=v?Math.pow(c,v):1;if(d.comboId!==p.comboId&&1===m?m=c/2:d.comboId===p.comboId&&(m=2),Object(r.h)(p.x)&&Object(r.h)(d.x)&&Object(r.h)(p.y)&&Object(r.h)(d.y)){var g=e[i.target+"-"+i.source],y=g.vl,b=g.vx,x=g.vy,_=(y-o(i))/y*a*u(i)*m,w=b*_,E=x*_,S=s[f];t[h].x-=w*S,t[h].y-=E*S,t[l].x+=w*(1-S),t[l].y+=E*(1-S)}}}))},e}(o),nn=n(8),rn=n.n(nn),on=n(3),an=n.n(on),un=n(6),sn=n.n(un),cn=n(9),fn=n.n(cn),ln=(n(19),n(189),n(7)),hn=n.n(ln),dn=n(10),pn=n.n(dn),vn=1;function mn(){return vn++}var gn=function t(e){an()(this,t)},yn=function(){function t(e){an()(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return sn()(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++){if(t(this.getComponent(e),e))return e}return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=pn()(hn.a.mark((function t(e){var n,r,i,o,a;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}(),bn=n(42),xn=n.n(bn),_n=n(4),wn={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter")},En=function t(){an()(this,t),this.index=void 0},Sn=function t(){an()(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},An=function(){function t(){an()(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return sn()(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}(),Tn=n(17),Mn=n.n(Tn),kn=n(18),In=n.n(kn),On=n(12),Cn=n.n(On);function Dn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var Rn,Nn,Pn,jn,Gn,Ln=function(t){Mn()(n,t);var e=Dn(n);function n(){var t;an()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return sn()(n,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),n}((function t(){an()(this,t),this.first=void 0,this.last=void 0})),Bn=function t(){an()(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function Un(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var zn=(Rn=Object(_n.injectable)(),Nn=Object(_n.inject)(wn.RenderEngine),Rn((jn=function(){function t(){an()(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],rn()(this,"engine",Gn,this)}var e,n;return sn()(t,[{key:"execute",value:(n=pn()(hn.a.mark((function t(e){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new Sn;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new An;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=Un(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=Un(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var u=i.value;0===u.readerCount&&o.push(u)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var s=o.pop(),c=s&&s.writer;if(c&&0==--c.refCount){var f,l=Un(c.reads);try{for(l.s();!(f=l.n()).done;){var h=f.value,d=this.resourceNodes[h.index];0==--d.readerCount&&o.push(d)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,v=Un(this.passNodes);try{for(v.s();!(p=v.n()).done;){var m=p.value;if(m.refCount){var g,y=Un(m.reads);try{for(y.s();!(g=y.n()).done;){var b=g.value,x=this.resourceNodes[b.index].resource;x.first=x.first?x.first:m,x.last=m}}catch(t){y.e(t)}finally{y.f()}var _,w=Un(m.writes);try{for(w.s();!(_=w.n()).done;){var E=_.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:m,S.last=m}}catch(t){w.e(t)}finally{w.f()}}}}catch(t){v.e(t)}finally{v.f()}for(var A=0;A<2;A++){var T,M=Un(this.resourceNodes);try{for(M.s();!(T=M.n()).done;){var k=T.value.resource;if(k.priority===A&&k.refs){var I=k.first,O=k.last;I&&O&&(I.devirtualize.push(k),O.destroy.push(k))}}}catch(t){M.e(t)}finally{M.f()}}}},{key:"executePassNodes",value:(e=pn()(hn.a.mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Un(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=xn()(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=Un(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=Un(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=Un(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=Un(a.destroy);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){d.e(t)}finally{d.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new Bn;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new En;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new Ln;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new Ln;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),pn()(hn.a.mark((function t(){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),Gn=fn()(jn.prototype,"engine",[Nn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pn=jn))||Pn),Vn=n(2),Wn=n.n(Vn),Xn=n(21),qn=n.n(Xn);function Hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hn(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var Zn,Qn,$n,Jn,tr,er,nr,rr,ir,or=function(t){Mn()(n,t);var e=Kn(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).dirty=!0,r.attributes=[],r.indices=void 0,r.indicesBuffer=void 0,r.vertexCount=void 0,r.maxInstancedCount=void 0,r.aabb=void 0,Object.assign(qn()(r),t),r}return sn()(n,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(Yn(Yn({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}}]),n}(gn),ar=(n(198),n(0)),ur=function(){function t(e,n){an()(this,t),this.center=void 0,this.halfExtents=void 0,this.min=ar.e.create(),this.max=ar.e.create(),this.update(e,n)}return sn()(t,[{key:"update",value:function(t,e){this.center=t||ar.e.create(),this.halfExtents=e||ar.e.fromValues(.5,.5,.5),this.min=ar.e.sub(this.min,this.center,this.halfExtents),this.max=ar.e.add(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){ar.e.add(this.center,e,t),ar.e.scale(this.center,this.center,.5),ar.e.sub(this.halfExtents,e,t),ar.e.scale(this.halfExtents,this.halfExtents,.5),ar.e.copy(this.min,t),ar.e.copy(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],u=o[1],s=o[2],c=n-a,f=n+a,l=r-u,h=r+u,d=i-s,p=i+s,v=t.center,m=v[0],g=v[1],y=v[2],b=t.halfExtents,x=b[0],_=b[1],w=b[2],E=m-x,S=m+x,A=g-_,T=g+_,M=y-w,k=y+w;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>h&&(h=T),M<d&&(d=M),k>p&&(p=k),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?ar.e.copy(ar.e.create(),this.min):272===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.max[1],this.min[2]):ar.e.fromValues(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?ar.e.copy(ar.e.create(),this.max):272===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?ar.e.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?ar.e.fromValues(this.min[0],this.min[1],this.max[2]):ar.e.fromValues(this.min[0],this.min[1],this.min[2])}}]),t}();function sr(t){for(var e=new ur,n=ar.e.fromValues(t[0],t[1],t[2]),r=ar.e.fromValues(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],u=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),u<n[2]&&(n[2]=u),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),u>r[2]&&(r[2]=u)}return e.setMinMax(n,r),e}(Qn=Zn||(Zn={}))[Qn.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",Qn[Qn.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",Qn[Qn.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",Qn[Qn.POINTS=0]="POINTS",Qn[Qn.LINES=1]="LINES",Qn[Qn.LINE_LOOP=2]="LINE_LOOP",Qn[Qn.LINE_STRIP=3]="LINE_STRIP",Qn[Qn.TRIANGLES=4]="TRIANGLES",Qn[Qn.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Qn[Qn.TRIANGLE_FAN=6]="TRIANGLE_FAN",Qn[Qn.ZERO=0]="ZERO",Qn[Qn.ONE=1]="ONE",Qn[Qn.SRC_COLOR=768]="SRC_COLOR",Qn[Qn.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",Qn[Qn.SRC_ALPHA=770]="SRC_ALPHA",Qn[Qn.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",Qn[Qn.DST_ALPHA=772]="DST_ALPHA",Qn[Qn.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",Qn[Qn.DST_COLOR=774]="DST_COLOR",Qn[Qn.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",Qn[Qn.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",Qn[Qn.FUNC_ADD=32774]="FUNC_ADD",Qn[Qn.BLEND_EQUATION=32777]="BLEND_EQUATION",Qn[Qn.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",Qn[Qn.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",Qn[Qn.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",Qn[Qn.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",Qn[Qn.MAX_EXT=32776]="MAX_EXT",Qn[Qn.MIN_EXT=32775]="MIN_EXT",Qn[Qn.BLEND_DST_RGB=32968]="BLEND_DST_RGB",Qn[Qn.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",Qn[Qn.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",Qn[Qn.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",Qn[Qn.CONSTANT_COLOR=32769]="CONSTANT_COLOR",Qn[Qn.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",Qn[Qn.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",Qn[Qn.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",Qn[Qn.BLEND_COLOR=32773]="BLEND_COLOR",Qn[Qn.ARRAY_BUFFER=34962]="ARRAY_BUFFER",Qn[Qn.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",Qn[Qn.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",Qn[Qn.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",Qn[Qn.STREAM_DRAW=35040]="STREAM_DRAW",Qn[Qn.STATIC_DRAW=35044]="STATIC_DRAW",Qn[Qn.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",Qn[Qn.BUFFER_SIZE=34660]="BUFFER_SIZE",Qn[Qn.BUFFER_USAGE=34661]="BUFFER_USAGE",Qn[Qn.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",Qn[Qn.FRONT=1028]="FRONT",Qn[Qn.BACK=1029]="BACK",Qn[Qn.FRONT_AND_BACK=1032]="FRONT_AND_BACK",Qn[Qn.CULL_FACE=2884]="CULL_FACE",Qn[Qn.BLEND=3042]="BLEND",Qn[Qn.DITHER=3024]="DITHER",Qn[Qn.STENCIL_TEST=2960]="STENCIL_TEST",Qn[Qn.DEPTH_TEST=2929]="DEPTH_TEST",Qn[Qn.SCISSOR_TEST=3089]="SCISSOR_TEST",Qn[Qn.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",Qn[Qn.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",Qn[Qn.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",Qn[Qn.NO_ERROR=0]="NO_ERROR",Qn[Qn.INVALID_ENUM=1280]="INVALID_ENUM",Qn[Qn.INVALID_VALUE=1281]="INVALID_VALUE",Qn[Qn.INVALID_OPERATION=1282]="INVALID_OPERATION",Qn[Qn.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",Qn[Qn.CW=2304]="CW",Qn[Qn.CCW=2305]="CCW",Qn[Qn.LINE_WIDTH=2849]="LINE_WIDTH",Qn[Qn.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",Qn[Qn.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",Qn[Qn.CULL_FACE_MODE=2885]="CULL_FACE_MODE",Qn[Qn.FRONT_FACE=2886]="FRONT_FACE",Qn[Qn.DEPTH_RANGE=2928]="DEPTH_RANGE",Qn[Qn.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",Qn[Qn.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",Qn[Qn.DEPTH_FUNC=2932]="DEPTH_FUNC",Qn[Qn.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",Qn[Qn.STENCIL_FUNC=2962]="STENCIL_FUNC",Qn[Qn.STENCIL_FAIL=2964]="STENCIL_FAIL",Qn[Qn.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",Qn[Qn.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",Qn[Qn.STENCIL_REF=2967]="STENCIL_REF",Qn[Qn.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",Qn[Qn.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",Qn[Qn.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",Qn[Qn.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",Qn[Qn.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",Qn[Qn.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",Qn[Qn.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",Qn[Qn.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",Qn[Qn.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",Qn[Qn.VIEWPORT=2978]="VIEWPORT",Qn[Qn.SCISSOR_BOX=3088]="SCISSOR_BOX",Qn[Qn.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",Qn[Qn.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",Qn[Qn.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",Qn[Qn.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",Qn[Qn.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",Qn[Qn.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",Qn[Qn.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",Qn[Qn.RED_BITS=3410]="RED_BITS",Qn[Qn.GREEN_BITS=3411]="GREEN_BITS",Qn[Qn.BLUE_BITS=3412]="BLUE_BITS",Qn[Qn.ALPHA_BITS=3413]="ALPHA_BITS",Qn[Qn.DEPTH_BITS=3414]="DEPTH_BITS",Qn[Qn.STENCIL_BITS=3415]="STENCIL_BITS",Qn[Qn.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",Qn[Qn.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",Qn[Qn.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",Qn[Qn.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",Qn[Qn.SAMPLES=32937]="SAMPLES",Qn[Qn.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",Qn[Qn.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",Qn[Qn.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",Qn[Qn.DONT_CARE=4352]="DONT_CARE",Qn[Qn.FASTEST=4353]="FASTEST",Qn[Qn.NICEST=4354]="NICEST",Qn[Qn.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",Qn[Qn.BYTE=5120]="BYTE",Qn[Qn.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",Qn[Qn.SHORT=5122]="SHORT",Qn[Qn.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",Qn[Qn.INT=5124]="INT",Qn[Qn.UNSIGNED_INT=5125]="UNSIGNED_INT",Qn[Qn.FLOAT=5126]="FLOAT",Qn[Qn.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",Qn[Qn.ALPHA=6406]="ALPHA",Qn[Qn.RGB=6407]="RGB",Qn[Qn.RGBA=6408]="RGBA",Qn[Qn.LUMINANCE=6409]="LUMINANCE",Qn[Qn.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",Qn[Qn.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",Qn[Qn.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",Qn[Qn.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",Qn[Qn.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",Qn[Qn.VERTEX_SHADER=35633]="VERTEX_SHADER",Qn[Qn.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",Qn[Qn.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",Qn[Qn.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",Qn[Qn.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",Qn[Qn.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",Qn[Qn.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",Qn[Qn.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",Qn[Qn.SHADER_TYPE=35663]="SHADER_TYPE",Qn[Qn.DELETE_STATUS=35712]="DELETE_STATUS",Qn[Qn.LINK_STATUS=35714]="LINK_STATUS",Qn[Qn.VALIDATE_STATUS=35715]="VALIDATE_STATUS",Qn[Qn.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",Qn[Qn.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",Qn[Qn.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",Qn[Qn.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",Qn[Qn.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",Qn[Qn.NEVER=512]="NEVER",Qn[Qn.LESS=513]="LESS",Qn[Qn.EQUAL=514]="EQUAL",Qn[Qn.LEQUAL=515]="LEQUAL",Qn[Qn.GREATER=516]="GREATER",Qn[Qn.NOTEQUAL=517]="NOTEQUAL",Qn[Qn.GEQUAL=518]="GEQUAL",Qn[Qn.ALWAYS=519]="ALWAYS",Qn[Qn.KEEP=7680]="KEEP",Qn[Qn.REPLACE=7681]="REPLACE",Qn[Qn.INCR=7682]="INCR",Qn[Qn.DECR=7683]="DECR",Qn[Qn.INVERT=5386]="INVERT",Qn[Qn.INCR_WRAP=34055]="INCR_WRAP",Qn[Qn.DECR_WRAP=34056]="DECR_WRAP",Qn[Qn.VENDOR=7936]="VENDOR",Qn[Qn.RENDERER=7937]="RENDERER",Qn[Qn.VERSION=7938]="VERSION",Qn[Qn.NEAREST=9728]="NEAREST",Qn[Qn.LINEAR=9729]="LINEAR",Qn[Qn.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",Qn[Qn.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",Qn[Qn.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",Qn[Qn.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",Qn[Qn.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",Qn[Qn.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",Qn[Qn.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",Qn[Qn.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",Qn[Qn.TEXTURE_2D=3553]="TEXTURE_2D",Qn[Qn.TEXTURE=5890]="TEXTURE",Qn[Qn.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",Qn[Qn.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",Qn[Qn.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",Qn[Qn.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",Qn[Qn.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",Qn[Qn.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",Qn[Qn.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",Qn[Qn.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",Qn[Qn.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",Qn[Qn.TEXTURE0=33984]="TEXTURE0",Qn[Qn.TEXTURE1=33985]="TEXTURE1",Qn[Qn.TEXTURE2=33986]="TEXTURE2",Qn[Qn.TEXTURE3=33987]="TEXTURE3",Qn[Qn.TEXTURE4=33988]="TEXTURE4",Qn[Qn.TEXTURE5=33989]="TEXTURE5",Qn[Qn.TEXTURE6=33990]="TEXTURE6",Qn[Qn.TEXTURE7=33991]="TEXTURE7",Qn[Qn.TEXTURE8=33992]="TEXTURE8",Qn[Qn.TEXTURE9=33993]="TEXTURE9",Qn[Qn.TEXTURE10=33994]="TEXTURE10",Qn[Qn.TEXTURE11=33995]="TEXTURE11",Qn[Qn.TEXTURE12=33996]="TEXTURE12",Qn[Qn.TEXTURE13=33997]="TEXTURE13",Qn[Qn.TEXTURE14=33998]="TEXTURE14",Qn[Qn.TEXTURE15=33999]="TEXTURE15",Qn[Qn.TEXTURE16=34e3]="TEXTURE16",Qn[Qn.TEXTURE17=34001]="TEXTURE17",Qn[Qn.TEXTURE18=34002]="TEXTURE18",Qn[Qn.TEXTURE19=34003]="TEXTURE19",Qn[Qn.TEXTURE20=34004]="TEXTURE20",Qn[Qn.TEXTURE21=34005]="TEXTURE21",Qn[Qn.TEXTURE22=34006]="TEXTURE22",Qn[Qn.TEXTURE23=34007]="TEXTURE23",Qn[Qn.TEXTURE24=34008]="TEXTURE24",Qn[Qn.TEXTURE25=34009]="TEXTURE25",Qn[Qn.TEXTURE26=34010]="TEXTURE26",Qn[Qn.TEXTURE27=34011]="TEXTURE27",Qn[Qn.TEXTURE28=34012]="TEXTURE28",Qn[Qn.TEXTURE29=34013]="TEXTURE29",Qn[Qn.TEXTURE30=34014]="TEXTURE30",Qn[Qn.TEXTURE31=34015]="TEXTURE31",Qn[Qn.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",Qn[Qn.REPEAT=10497]="REPEAT",Qn[Qn.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",Qn[Qn.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",Qn[Qn.FLOAT_VEC2=35664]="FLOAT_VEC2",Qn[Qn.FLOAT_VEC3=35665]="FLOAT_VEC3",Qn[Qn.FLOAT_VEC4=35666]="FLOAT_VEC4",Qn[Qn.INT_VEC2=35667]="INT_VEC2",Qn[Qn.INT_VEC3=35668]="INT_VEC3",Qn[Qn.INT_VEC4=35669]="INT_VEC4",Qn[Qn.BOOL=35670]="BOOL",Qn[Qn.BOOL_VEC2=35671]="BOOL_VEC2",Qn[Qn.BOOL_VEC3=35672]="BOOL_VEC3",Qn[Qn.BOOL_VEC4=35673]="BOOL_VEC4",Qn[Qn.FLOAT_MAT2=35674]="FLOAT_MAT2",Qn[Qn.FLOAT_MAT3=35675]="FLOAT_MAT3",Qn[Qn.FLOAT_MAT4=35676]="FLOAT_MAT4",Qn[Qn.SAMPLER_2D=35678]="SAMPLER_2D",Qn[Qn.SAMPLER_CUBE=35680]="SAMPLER_CUBE",Qn[Qn.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",Qn[Qn.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",Qn[Qn.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",Qn[Qn.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",Qn[Qn.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",Qn[Qn.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",Qn[Qn.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",Qn[Qn.COMPILE_STATUS=35713]="COMPILE_STATUS",Qn[Qn.LOW_FLOAT=36336]="LOW_FLOAT",Qn[Qn.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",Qn[Qn.HIGH_FLOAT=36338]="HIGH_FLOAT",Qn[Qn.LOW_INT=36339]="LOW_INT",Qn[Qn.MEDIUM_INT=36340]="MEDIUM_INT",Qn[Qn.HIGH_INT=36341]="HIGH_INT",Qn[Qn.FRAMEBUFFER=36160]="FRAMEBUFFER",Qn[Qn.RENDERBUFFER=36161]="RENDERBUFFER",Qn[Qn.RGBA4=32854]="RGBA4",Qn[Qn.RGB5_A1=32855]="RGB5_A1",Qn[Qn.RGB565=36194]="RGB565",Qn[Qn.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",Qn[Qn.STENCIL_INDEX=6401]="STENCIL_INDEX",Qn[Qn.STENCIL_INDEX8=36168]="STENCIL_INDEX8",Qn[Qn.DEPTH_STENCIL=34041]="DEPTH_STENCIL",Qn[Qn.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",Qn[Qn.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",Qn[Qn.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",Qn[Qn.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",Qn[Qn.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",Qn[Qn.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",Qn[Qn.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",Qn[Qn.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",Qn[Qn.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",Qn[Qn.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",Qn[Qn.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",Qn[Qn.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",Qn[Qn.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",Qn[Qn.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",Qn[Qn.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",Qn[Qn.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",Qn[Qn.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",Qn[Qn.NONE=0]="NONE",Qn[Qn.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",Qn[Qn.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",Qn[Qn.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",Qn[Qn.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",Qn[Qn.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",Qn[Qn.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",Qn[Qn.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",Qn[Qn.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",Qn[Qn.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",Qn[Qn.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",Qn[Qn.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",Qn[Qn.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",Qn[Qn.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",Qn[Qn.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",Qn[Qn.COPY_SRC=1]="COPY_SRC",Qn[Qn.COPY_DST=2]="COPY_DST",Qn[Qn.SAMPLED=4]="SAMPLED",Qn[Qn.STORAGE=8]="STORAGE",Qn[Qn.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT";var cr=($n=Object(_n.injectable)(),Jn=Object(_n.inject)(wn.GeometryComponentManager),tr=Object(_n.inject)(wn.RenderEngine),$n((nr=function(){function t(){an()(this,t),rn()(this,"geometry",rr,this),rn()(this,"engine",ir,this)}var e;return sn()(t,[{key:"execute",value:(e=pn()(hn.a.mark((function t(){var e=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Zn.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Zn.UNSIGNED_INT,usage:Zn.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=mn();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=mn();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}},{key:"createBox",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.widthSegments||1,n=t.heightSegments||1,r=t.depthSegments||1,i=t.halfExtents||ar.e.fromValues(.5,.5,.5),o=xn()(i,3),a=o[0],u=o[1],s=o[2],c=[ar.e.fromValues(-a,-u,s),ar.e.fromValues(a,-u,s),ar.e.fromValues(a,u,s),ar.e.fromValues(-a,u,s),ar.e.fromValues(a,-u,-s),ar.e.fromValues(-a,-u,-s),ar.e.fromValues(-a,u,-s),ar.e.fromValues(a,u,-s)],f=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],l=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],h={FRONT:0,BACK:1,TOP:2,BOTTOM:3,RIGHT:4,LEFT:5},d=[],p=[],v=[],m=[],g=[],y=0,b=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var u=ar.e.create(),s=ar.e.create(),h=ar.e.create(),b=ar.e.create();ar.e.lerp(u,c[f[t][0]],c[f[t][1]],o/e),ar.e.lerp(s,c[f[t][0]],c[f[t][2]],a/n),ar.e.sub(h,s,c[f[t][0]]),ar.e.add(b,u,h),r=o/e,i=a/n,d.push(b[0],b[1],b[2]),p.push(l[t][0],l[t][1],l[t][2]),v.push(r,i),r=.875*(r/=3)+4/64,i=.875*(i/=3)+4/64,r+=t%3/3,i+=Math.floor(t/3)/3,m.push(r,i),o<e&&a<n&&(g.push(y+n+1,y+1,y),g.push(y+n+1,y+n+2,y+1)),y++}};b(h.FRONT,e,n),b(h.BACK,e,n),b(h.TOP,e,r),b(h.BOTTOM,e,r),b(h.RIGHT,r,n),b(h.LEFT,r,n);var x=sr(d),_=mn();return this.geometry.create(_,{indices:Uint32Array.from(g),aabb:x,attributes:[{dirty:!0,name:"position",data:Float32Array.from(d),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]}]})}}]),t}(),rr=fn()(nr.prototype,"geometry",[Jn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ir=fn()(nr.prototype,"engine",[tr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),er=nr))||er);n(199);function fr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var lr,hr,dr,pr,vr,mr,gr,yr,br,xr=function(t){Mn()(n,t);var e=fr(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).vertexShaderGLSL=void 0,r.fragmentShaderGLSL=void 0,r.dirty=!0,r.uniforms=[],r.cull={enable:!0,face:Zn.BACK},r.depth={enable:!0},r.blend=void 0,Object.assign(qn()(r),t),r}return sn()(n,[{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),n}(gn);function _r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_r(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Er,Sr=(lr=Object(_n.injectable)(),hr=Object(_n.inject)(wn.MaterialComponentManager),dr=Object(_n.inject)(wn.RenderEngine),pr=Object(_n.inject)(wn.ShaderModuleService),lr((mr=function(){function t(){an()(this,t),rn()(this,"material",gr,this),rn()(this,"engine",yr,this),rn()(this,"shaderModule",br,this)}var e;return sn()(t,[{key:"execute",value:(e=pn()(hn.a.mark((function t(){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(this.material.map(function(){var t=pn()(hn.a.mark((function t(e,n){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createBasicMaterial",value:function(){var t=mn();return this.material.create(t,{vertexShaderGLSL:this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\\n vec4 color;\\n mat4 projectionMatrix;\\n mat4 modelViewMatrix;\\n} uniforms;\\n\\nlayout(location = 0) in vec3 position;\\n// layout(location = 1) in vec3 barycentric;\\n\\nlayout(location = 0) out vec4 fragColor;\\n// layout(location = 1) out vec3 v_Barycentric;\\n\\nvoid main() {\\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\\n fragColor = uniforms.color;\\n // v_Barycentric = barycentric;\\n}":"attribute vec3 position;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform vec4 color;\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\\n fragColor = color;\\n}",fragmentShaderGLSL:this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\\n// float lineWidth;\\n// vec4 lineColor;\\n// } wireframe;\\n\\nlayout(location = 0) in vec4 fragColor;\\n// layout(location = 1) in vec3 v_Barycentric;\\n\\nlayout(location = 0) out vec4 outColor;\\n\\n// wireframe\\n// float edgeFactor() {\\n// vec3 d = fwidth(v_Barycentric);\\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\\n// return min(min(a3.x, a3.y), a3.z);\\n// }\\n\\nvoid main() {\\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\\n outColor = fragColor;\\n}":"varying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}"})}},{key:"createShaderMaterial",value:function(t){var e=mn(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,wr(wr({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),gr=fn()(mr.prototype,"material",[hr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yr=fn()(mr.prototype,"engine",[dr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),br=fn()(mr.prototype,"shaderModule",[pr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vr=mr))||vr);function Ar(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}!function(t){t[t.Standard=0]="Standard"}(Er||(Er={}));var Tr=function(t){Mn()(n,t);var e=Ar(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).strategy=Er.Standard,r.visibilityPlaneMask=0,r.visible=!1,Object.assign(qn()(r),t),r}return n}(gn);n(200);function Mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var kr,Ir=function(t){Mn()(n,t);var e=Mr(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).material=void 0,r.geometry=void 0,r.aabb=new ur,r.aabbDirty=!0,r.model=void 0,r.visible=!0,Object.assign(qn()(r),t),r}return n}(gn),Or=function(){function t(e,n){an()(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||ar.e.fromValues(0,1,0),this.updatePNVertexFlag()}return sn()(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ar.e.dot(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/ar.e.len(this.normal);ar.e.scale(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&ar.e.lerp(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(kr||(kr={}));var Cr,Dr,Rr,Nr,Pr,jr,Gr,Lr,Br,Ur,Fr,zr,Vr,Wr=function(){function t(e){if(an()(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Or)}return sn()(t,[{key:"extractFromVPMatrix",value:function(t){var e=xn()(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];ar.e.set(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(g-p),ar.e.set(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(g+p),ar.e.set(this.planes[2].normal,o+r,c+u,d+l),this.planes[2].distance=-(g+v),ar.e.set(this.planes[3].normal,o-r,c-u,d-l),this.planes[3].distance=-(g-v),ar.e.set(this.planes[4].normal,o-i,c-s,d-h),this.planes[4].distance=-(g-m),ar.e.set(this.planes[5].normal,o+i,c+s,d+h),this.planes[5].distance=-(g+m),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}(),Xr=n(43),qr=n.n(Xr);function Hr(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Yr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Yr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Kr,Zr,Qr,$r,Jr,ti,ei,ni,ri,ii,oi,ai,ui,si,ci,fi,li,hi,di,pi,vi,mi,gi,yi,bi=(Cr=Object(_n.injectable)(),Dr=Object(_n.inject)(wn.MeshComponentManager),Rr=Object(_n.inject)(wn.CullableComponentManager),Nr=Object(_n.inject)(wn.GeometryComponentManager),Pr=Object(_n.inject)(wn.HierarchyComponentManager),jr=Object(_n.inject)(wn.TransformComponentManager),Cr((Lr=function(){function t(){an()(this,t),rn()(this,"mesh",Br,this),rn()(this,"cullable",Ur,this),rn()(this,"geometry",Fr,this),rn()(this,"hierarchy",zr,this),rn()(this,"transform",Vr,this),this.planes=void 0}var e;return sn()(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=pn()(hn.a.mark((function t(e){var n,r,i,o=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Hr(e);try{for(i=function(){var t=r.value,e=(t.getScene(),t.getCamera());o.mesh.forEach((function(t,n){var r,i,a=o.hierarchy.getComponentByEntity(t),u=o.cullable.getComponentByEntity(t),s=n.geometry,c=o.transform.getComponentByEntity(t);if(s&&s.aabb&&c&&n.aabbDirty){var f=c.worldTransform,l=s.aabb,h=l.center,d=l.halfExtents,p=ar.e.transformMat4(ar.e.create(),h,f),v=(r=f,(i=ar.a.create())[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[4],i[4]=r[5],i[5]=r[6],i[6]=r[8],i[7]=r[9],i[8]=r[10],i),m=ar.e.transformMat3(ar.e.create(),d,v);n.aabb.update(p,m),n.aabbDirty=!1}if(u&&s){var g=o.cullable.getComponentByEntity((null==a?void 0:a.parentID)||-1);u.visibilityPlaneMask=o.computeVisibilityWithPlaneMask(n.aabb,(null==g?void 0:g.visibilityPlaneMask)||kr.INDETERMINATE,o.planes||e.getFrustum().planes),u.visible=u.visibilityPlaneMask!==kr.OUTSIDE}}))},n.s();!(r=n.n()).done;)i()}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===kr.OUTSIDE||e===kr.INSIDE)return e;for(var r=kr.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var u=n[i],s=u.normal,c=u.distance;if(ar.e.dot(s,t.getNegativeFarPoint(n[i]))+c>0)return kr.OUTSIDE;ar.e.dot(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),Br=fn()(Lr.prototype,"mesh",[Dr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ur=fn()(Lr.prototype,"cullable",[Rr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fr=fn()(Lr.prototype,"geometry",[Nr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zr=fn()(Lr.prototype,"hierarchy",[Pr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vr=fn()(Lr.prototype,"transform",[jr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gr=Lr))||Gr);function xi(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return _i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _i(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function _i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var wi,Ei,Si,Ai,Ti,Mi,ki,Ii,Oi,Ci,Di,Ri,Ni,Pi,ji,Gi,Li,Bi,Ui,Fi,zi,Vi,Wi=(Kr=Object(_n.injectable)(),Zr=Object(_n.inject)(wn.MeshComponentManager),Qr=Object(_n.inject)(wn.GeometryComponentManager),$r=Object(_n.inject)(wn.MaterialComponentManager),Jr=Object(_n.inject)(wn.CullableComponentManager),ti=Object(_n.inject)(wn.TransformComponentManager),ei=Object(_n.inject)(wn.HierarchyComponentManager),ni=Object(_n.inject)(wn.Systems),ri=Object(_n.named)(wn.FrameGraphSystem),ii=Object(_n.inject)(wn.RenderEngine),oi=Object(_n.inject)(wn.ResourcePool),Kr((yi=gi=function(){function t(){var e=this;an()(this,t),rn()(this,"mesh",si,this),rn()(this,"geometry",ci,this),rn()(this,"material",fi,this),rn()(this,"cullable",li,this),rn()(this,"transform",hi,this),rn()(this,"hierarchy",di,this),rn()(this,"frameGraphSystem",pi,this),rn()(this,"engine",vi,this),rn()(this,"resourcePool",mi,this),this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Zn.RENDER_ATTACHMENT|Zn.SAMPLED|Zn.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=pn()(hn.a.mark((function t(n,r,i){var o,a,u,s,c,f;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=xi(i),t.prev=3,u.s();case 5:if((s=u.n()).done){t.next=11;break}return c=s.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),u.e(t.t0);case 16:return t.prev=16,u.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=xi(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return sn()(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=ar.b.multiply(ar.b.create(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,u=o.y,s=o.width,c=o.height;this.engine.viewport({x:a,y:u,width:s,height:c});var f,l=xi(e.getEntities());try{for(l.s();!(f=l.n()).done;){var h=f.value;this.renderMesh(h,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=this,r=e.camera,i=e.view,o=e.viewMatrix,a=this.mesh.getComponentByEntity(t);if(a.visible){this.hierarchy.forEach((function(e,a){a.parentID===t&&n.renderMesh(e,{camera:r,view:i,viewMatrix:o})}));var u=a.material,s=a.geometry;if(s&&!s.dirty&&u){var c=this.transform.getComponentByEntity(t),f=ar.b.multiply(ar.b.create(),o,c.worldTransform),l=i.getViewport(),h=l.width,d=l.height;u.setUniform({projectionMatrix:r.getPerspective(),modelViewMatrix:f,modelMatrix:c.worldTransform,viewMatrix:o,cameraPosition:r.getPosition(),u_viewport:[h,d]}),a.model&&(a.model.draw({uniforms:u.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),u.uniforms.forEach((function(t){t.dirty=!1})),u.dirty=!1)}}}},{key:"initMesh",value:(n=pn()(hn.a.mark((function t(e,n){var r,i,o,a,u,s,c,f=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.mesh.getComponentByEntity(e),i=r.material,o=r.geometry,t.next=5,this.hierarchy.forEachAsync(function(){var t=pn()(hn.a.mark((function t(r,i){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.parentID!==e){t.next=4;break}return t.next=4,f.initMesh(r,n);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}());case 5:if(o&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=19;break}return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),a=this.engine,u=a.createModel,s=a.createAttribute,c={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=s({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(c.cull=i.cull),i.depth&&(c.depth=i.depth),i.blend&&(c.blend=i.blend),o.indicesBuffer&&(c.elements=o.indicesBuffer),o.maxInstancedCount&&(c.instances=o.maxInstancedCount,c.count=o.vertexCount||3),t.next=18,u(c);case 18:r.model=t.sent;case 19:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=pn()(hn.a.mark((function t(e){var n,r,i,o;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=xi(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),gi.IDENTIFIER="Render Pass",ui=yi,si=fn()(ui.prototype,"mesh",[Zr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ci=fn()(ui.prototype,"geometry",[Qr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fi=fn()(ui.prototype,"material",[$r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),li=fn()(ui.prototype,"cullable",[Jr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hi=fn()(ui.prototype,"transform",[ti],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),di=fn()(ui.prototype,"hierarchy",[ei],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pi=fn()(ui.prototype,"frameGraphSystem",[ni,ri],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vi=fn()(ui.prototype,"engine",[ii],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mi=fn()(ui.prototype,"resourcePool",[oi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ai=ui))||ai),Xi=(wi=Object(_n.injectable)(),Ei=Object(_n.inject)(wn.RenderEngine),Si=Object(_n.inject)(wn.ResourcePool),wi((Oi=Ii=function t(){var e=this;an()(this,t),rn()(this,"engine",Mi,this),rn()(this,"resourcePool",ki,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Wi.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=pn()(hn.a.mark((function t(n,r){var i,o,a,u,s,c,f;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,u=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\\nlayout(location = 0) out vec2 v_UV;\\n\\nvoid main() {\\n v_UV = 0.5 * (a_Position + 1.0);\\n gl_Position = vec4(a_Position, 0., 1.);\\n}":"attribute vec2 a_Position;\\n\\nvarying vec2 v_UV;\\n\\nvoid main() {\\n v_UV = 0.5 * (a_Position + 1.0);\\n gl_Position = vec4(a_Position, 0., 1.);\\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\\n\\nlayout(location = 0) in vec2 v_UV;\\nlayout(location = 0) out vec4 outColor;\\n\\nvoid main() {\\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\\n}":"varying vec2 v_UV;\\n\\nuniform sampler2D u_Texture;\\n\\nvoid main() {\\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\\n}",attributes:{a_Position:a({buffer:u({data:[-4,-4,4,-4,0,4],type:Zn.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:s=t.sent,e.model=s;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},Ii.IDENTIFIER="Copy Pass",Ti=Oi,Mi=fn()(Ti.prototype,"engine",[Ei],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ki=fn()(Ti.prototype,"resourcePool",[Si],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ai=Ti))||Ai);function qi(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Hi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hi(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Hi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Yi,Ki,Zi,Qi,$i,Ji,to,eo,no,ro,io,oo,ao=1,uo=2,so=(Ci=Object(_n.injectable)(),Di=Object(_n.inject)(wn.RenderEngine),Ri=Object(_n.inject)(wn.ResourcePool),Ni=Object(_n.inject)(wn.RenderPassFactory),Pi=Object(_n.inject)(wn.MeshComponentManager),Ci((Vi=zi=function(){function t(){var e=this;an()(this,t),rn()(this,"engine",Li,this),rn()(this,"resourcePool",Bi,this),rn()(this,"renderPassFactory",Ui,this),rn()(this,"mesh",Fi,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=pn()(hn.a.mark((function t(n,r,i){var o,a,u;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=qi(i);try{for(u=function(){var t=a.value,i=t.getViewport(),o=i.width,u=i.height;e.alreadyInRendering=!0;var s=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(s.resource),e.pickingFBO.resize({width:o,height:u}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Wi.IDENTIFIER),i=[],o=qi(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,u=e.mesh.getComponentByEntity(a);u.material.setUniform("u_PickingStage",ao),i.push(u)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",uo)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)u()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,u=e.engine,s=u.readPixels,c=u.useFramebuffer,f=n.getViewport(),l=f.width,h=f.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>l||d<0||p>h||p<0))return c(e.pickingFBO,(function(){var t,o;0===(r=s({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=r,o=xn()(t,3),i=o[0]+256*o[1]+65536*o[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return sn()(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=qi(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",uo),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),zi.IDENTIFIER="PixelPicking Pass",Gi=Vi,Li=fn()(Gi.prototype,"engine",[Di],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Bi=fn()(Gi.prototype,"resourcePool",[Ri],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ui=fn()(Gi.prototype,"renderPassFactory",[Ni],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fi=fn()(Gi.prototype,"mesh",[Pi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ji=Gi))||ji),co=(Yi=Object(_n.injectable)(),Ki=Object(_n.inject)(wn.Systems),Zi=Object(_n.named)(wn.FrameGraphSystem),Qi=Object(_n.inject)(wn.RenderPassFactory),$i=Object(_n.inject)(wn.ConfigService),Ji=Object(_n.inject)(wn.ResourcePool),Yi((eo=function(){function t(){an()(this,t),rn()(this,"frameGraphSystem",no,this),rn()(this,"renderPassFactory",ro,this),rn()(this,"configService",io,this),rn()(this,"resourcePool",oo,this)}var e;return sn()(t,[{key:"execute",value:(e=pn()(hn.a.mark((function t(e){var n,r,i,o,a,u,s,c;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Wi.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Wi.IDENTIFIER,r,i),o=this.renderPassFactory(Xi.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass(Xi.IDENTIFIER,a,u,s),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(so.IDENTIFIER).pick(t,e)}}]),t}(),no=fn()(eo.prototype,"frameGraphSystem",[Ki,Zi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ro=fn()(eo.prototype,"renderPassFactory",[Qi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),io=fn()(eo.prototype,"configService",[$i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oo=fn()(eo.prototype,"resourcePool",[Ji],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),to=eo))||to);function fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var lo,ho,po,vo,mo,go,yo,bo,xo,_o=function(t){Mn()(n,t);var e=fo(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).parentID=void 0,Object.assign(qn()(r),t),r}return n}(gn),wo=(lo=Object(_n.injectable)(),ho=Object(_n.inject)(wn.HierarchyComponentManager),po=Object(_n.inject)(wn.TransformComponentManager),vo=Object(_n.inject)(wn.MeshComponentManager),lo((go=function(){function t(){an()(this,t),rn()(this,"hierarchy",yo,this),rn()(this,"transform",bo,this),rn()(this,"mesh",xo,this)}var e;return sn()(t,[{key:"execute",value:(e=pn()(hn.a.mark((function t(){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){if(n.isDirty()){var r=t.mesh.getComponentByEntity(e);r&&(r.aabbDirty=!0),n.updateTransform()}}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){if(this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e}),this.hierarchy.getCount()>1)for(var r=this.hierarchy.getCount()-1;r>0;--r)for(var i=this.hierarchy.getEntity(r),o=0;o<r;++o){if(this.hierarchy.getComponent(o).parentID===i){this.hierarchy.moveItem(r,o),++r;break}}this.hierarchy.getComponentByEntity(t);var a=this.transform.getComponentByEntity(e);null===a&&(a=this.transform.create(e));var u=this.transform.getComponentByEntity(t);null===u&&(u=this.transform.create(t),a=this.transform.getComponentByEntity(e)),!n&&a&&(u.matrixTransform(ar.b.invert(ar.b.create(),a.worldTransform)),u.updateTransform()),a&&u.updateTransformWithParent(a)}},{key:"detach",value:function(t){if(null!==this.hierarchy.getComponentByEntity(t)){var e=this.transform.getComponentByEntity(t);null!==e&&e.applyTransform(),this.hierarchy.removeKeepSorted(t)}}},{key:"detachChildren",value:function(t){for(var e=0;e<this.hierarchy.getCount();){var n;if((null===(n=this.hierarchy.getComponent(e))||void 0===n?void 0:n.parentID)===t){var r=this.hierarchy.getEntity(e);this.detach(r)}else++e}}}]),t}(),yo=fn()(go.prototype,"hierarchy",[ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bo=fn()(go.prototype,"transform",[po],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xo=fn()(go.prototype,"mesh",[vo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mo=go))||mo);function Eo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var So=function(t){Mn()(n,t);var e=Eo(n);function n(t){var r,i,o,a,u,s,c,f,l,h,d,p,v,m,g;return an()(this,n),(r=e.call(this,t)).dirtyFlag=void 0,r.localTranslation=ar.e.fromValues(0,0,0),r.localRotation=ar.c.fromValues(0,0,0,1),r.localScale=ar.e.fromValues(1,1,1),r.localTransform=ar.b.create(),r.worldTransform=ar.b.create(),r.getRotation=(i=ar.c.create(),function(){return ar.b.getRotation(i,r.worldTransform),i}),r.getScale=(o=ar.e.create(),function(){return ar.b.getScaling(o,r.worldTransform),o}),r.getPosition=(a=ar.e.create(),function(){return ar.b.getTranslation(a,r.worldTransform),a}),r.getLocalMatrix=(u=ar.b.create(),function(){return ar.b.fromRotationTranslationScale(u,r.localRotation,r.localTranslation,r.localScale),u}),r.matrixTransform=(s=ar.b.create(),function(t){ar.b.multiply(s,r.getLocalMatrix(),t),ar.b.getScaling(r.localScale,s),ar.b.getTranslation(r.localTranslation,s),ar.b.getRotation(r.localRotation,s)}),r.rotateRollPitchYaw=(c=ar.c.create(),f=ar.c.create(),l=ar.c.create(),function(t,e,n){r.setDirty(),ar.c.fromEuler(c,t,0,0),ar.c.fromEuler(f,0,e,0),ar.c.fromEuler(l,0,0,n),ar.c.multiply(r.localRotation,c,r.localRotation),ar.c.multiply(r.localRotation,r.localRotation,f),ar.c.multiply(r.localRotation,l,r.localRotation),ar.c.normalize(r.localRotation,r.localRotation)}),r.lerp=(h=ar.e.create(),d=ar.c.create(),p=ar.e.create(),v=ar.e.create(),m=ar.c.create(),g=ar.e.create(),function(t,e,n){r.setDirty(),ar.b.getScaling(h,t.worldTransform),ar.b.getTranslation(p,t.worldTransform),ar.b.getRotation(d,t.worldTransform),ar.b.getScaling(v,e.worldTransform),ar.b.getTranslation(g,e.worldTransform),ar.b.getRotation(m,e.worldTransform),ar.e.lerp(r.localScale,h,v,n),ar.c.slerp(r.localRotation,d,m,n),ar.e.lerp(r.localTranslation,p,g,n)}),r}return sn()(n,[{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=n.DIRTY:this.dirtyFlag&=~n.DIRTY}},{key:"updateTransform",value:function(){this.isDirty()&&(this.setDirty(!1),ar.b.copy(this.worldTransform,this.getLocalMatrix()))}},{key:"updateTransformWithParent",value:function(t){ar.b.multiply(this.worldTransform,this.getLocalMatrix(),t.worldTransform)}},{key:"applyTransform",value:function(){this.setDirty(),ar.b.getScaling(this.localScale,this.worldTransform),ar.b.getTranslation(this.localTranslation,this.worldTransform),ar.b.getRotation(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localTranslation=ar.e.fromValues(0,0,0),this.localRotation=ar.c.fromValues(0,0,0,1),this.localScale=ar.e.fromValues(1,1,1)}},{key:"translate",value:function(t){return this.setDirty(),ar.e.add(this.localTranslation,this.localTranslation,t),this}},{key:"scale",value:function(t){return this.setDirty(),ar.e.multiply(this.localScale,this.localScale,t),this}},{key:"rotate",value:function(t){return this.setDirty(),ar.c.multiply(this.localRotation,this.localRotation,t),ar.c.normalize(this.localRotation,this.localRotation),this}}]),n}(gn);So.DIRTY=1;n(112),n(113),n(201),n(114),n(115),n(83),n(116),n(34),n(117),n(202);var Ao,To,Mo,ko,Io,Oo=n(122),Co=n(221),Do=n.n(Co),Ro=(Ao=Object(_n.injectable)(),To=Object(_n.inject)(wn.RenderEngine),Ao((ko=function(){function t(){an()(this,t),rn()(this,"engine",Io,this),this.resourcePool={}}return sn()(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Zn.CLAMP_TO_EDGE,wrapT:Zn.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Io=fn()(ko.prototype,"engine",[To],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mo=ko))||Mo);function No(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var Po,jo,Go=function(t){Mn()(n,t);var e=No(n);function n(t){var r;return an()(this,n),(r=e.call(this,t)).name=void 0,r.name=t.name||"",r}return n}(gn),Lo=Object(_n.injectable)()(Po=function(){function t(){an()(this,t),this.config=void 0}return sn()(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}())||Po,Bo=Object(_n.injectable)()(jo=function(){function t(){an()(this,t)}return sn()(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||jo,Uo=n(222),Fo=n.n(Uo);var zo,Vo=/uniform\\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\\s+([\\s\\S]*?);/g;function Wo(t){var e={};return{content:t=t.replace(Vo,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\\n")})),uniforms:e}}function Xo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xo(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ho=/precision\\s+(high|low|medium)p\\s+float/,Yo=/#pragma include (["^+"]?["\\ "[a-zA-Z_0-9](.*)"]*?)/g,Ko=Object(_n.injectable)()(zo=function(){function t(){an()(this,t),this.moduleCache={},this.rawContentCache={}}return sn()(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\\nvarying vec4 v_PickingResult;\\n\\nuniform vec3 u_PickingColor : [0, 0, 0];\\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\\nuniform float u_PickingStage : 0.0;\\nuniform float u_PickingThreshold : 1.0;\\nuniform float u_PickingBuffer: 0.0;\\n\\n#define PICKING_ENCODE 1.0\\n#define PICKING_HIGHLIGHT 2.0\\n#define COLOR_SCALE 1. / 255.\\n\\nbool isVertexPicked(vec3 vertexColor) {\\n return\\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\\n}\\n\\nvoid setPickingColor(vec3 pickingColor) {\\n // compares only in highlight stage\\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\\n\\n // Stores the picking color so that the fragment shader can render it during picking\\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\\n}\\n\\nfloat setPickingSize(float x) {\\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\\n}",fs:"varying vec4 v_PickingResult;\\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\\nuniform float u_PickingStage : 0.0;\\n\\n#define PICKING_ENCODE 1.0\\n#define PICKING_HIGHLIGHT 2.0\\n#define COLOR_SCALE 1. / 255.\\n\\n/*\\n * Returns highlight color if this item is selected.\\n */\\nvec4 filterHighlightColor(vec4 color) {\\n bool selected = bool(v_PickingResult.a);\\n\\n if (selected) {\\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\\n\\n float highLightAlpha = highLightColor.a;\\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\\n\\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\\n return vec4(resultRGB, color.a);\\n } else {\\n return color;\\n }\\n}\\n\\n/*\\n * Returns picking color if picking enabled else unmodified argument.\\n */\\nvec4 filterPickingColor(vec4 color) {\\n vec3 pickingColor = v_PickingResult.rgb;\\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\\n discard;\\n }\\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\\n}\\n\\n/*\\n * Returns picking color if picking is enabled if not\\n * highlight color if this item is selected, otherwise unmodified argument.\\n */\\nvec4 filterColor(vec4 color) {\\n return filterPickingColor(filterHighlightColor(color));\\n}\\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\\n * 2D signed distance field functions\\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\\n */\\n\\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\\n\\nfloat sdCircle(vec2 p, float r) {\\n return length(p) - r;\\n}\\n\\nfloat sdEquilateralTriangle(vec2 p) {\\n float k = sqrt(3.0);\\n p.x = abs(p.x) - 1.0;\\n p.y = p.y + 1.0/k;\\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\\n p.x -= clamp( p.x, -2.0, 0.0 );\\n return -length(p)*sign(p.y);\\n}\\n\\nfloat sdBox(vec2 p, vec2 b) {\\n vec2 d = abs(p)-b;\\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\\n}\\n\\nfloat sdPentagon(vec2 p, float r) {\\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\\n p.x = abs(p.x);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagon(vec2 p, float r) {\\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdOctogon(vec2 p, float r) {\\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\\n p = abs(p);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagram(vec2 p, float r) {\\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdRhombus(vec2 p, vec2 b) {\\n vec2 q = abs(p);\\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\\n}\\n\\nfloat sdVesica(vec2 p, float r, float d) {\\n p = abs(p);\\n float b = sqrt(r*r-d*d); // can delay this sqrt\\n return ((p.y-b)*d>p.x*b)\\n ? length(p-vec2(0.0,b))\\n : length(p-vec2(-d,0.0))-r;\\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=e.fs,i=e.uniforms,o=Wo(n),a=o.content,u=o.uniforms,s=Wo(r),c=s.content,f=s.uniforms;this.rawContentCache[t]={fs:c,uniforms:qo(qo(qo({},u),f),i),vs:a}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n=this.rawContentCache[t].vs,r=this.rawContentCache[t].fs,i=this.processModule(n,[],"vs"),o=i.content,a=i.includeList,u=this.processModule(r,[],"fs"),s=u.content,c=u.includeList,f=s,l=Fo()(a.concat(c).concat(t)).reduce((function(t,n){return qo(qo({},t),e.rawContentCache[n].uniforms)}),{});return Ho.test(s)||(f="#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n #else\\n precision mediump float;\\n#endif\\n"+s),this.moduleCache[t]={fs:f.trim(),uniforms:l,vs:o.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(Yo,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a,e,n).content})),includeList:e}}}]),t}())||zo,Zo=new _n.Container;Object(_n.decorate)(Object(_n.injectable)(),Oo.EventEmitter),Zo.bind(wn.IEventEmitter).to(Oo.EventEmitter);Do()(Zo,!1);function Qo(){var t=new _n.Container;return t.parent=Zo,t.bind(wn.Systems).to(wo).inSingletonScope().whenTargetNamed(wn.SceneGraphSystem),t.bind(wn.Systems).to(zn).inSingletonScope().whenTargetNamed(wn.FrameGraphSystem),t.bind(wn.Systems).to(bi).inSingletonScope().whenTargetNamed(wn.MeshSystem),t.bind(wn.Systems).to(cr).inSingletonScope().whenTargetNamed(wn.GeometrySystem),t.bind(wn.Systems).to(Sr).inSingletonScope().whenTargetNamed(wn.MaterialSystem),t.bind(wn.Systems).to(co).inSingletonScope().whenTargetNamed(wn.RendererSystem),t.bind(wn.ResourcePool).to(Ro).inSingletonScope(),t.bind(wn.ConfigService).to(Lo).inSingletonScope(),t.bind(wn.InteractorService).to(Bo).inSingletonScope(),t.bind(wn.RenderPass).to(Wi).inSingletonScope().whenTargetNamed(Wi.IDENTIFIER),t.bind(wn.RenderPass).to(Xi).inSingletonScope().whenTargetNamed(Xi.IDENTIFIER),t.bind(wn.RenderPass).to(so).inSingletonScope().whenTargetNamed(so.IDENTIFIER),t.bind(wn.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(wn.RenderPass,e)}})),t}Zo.bind(wn.ShaderModuleService).to(Ko).inSingletonScope(),Zo.bind(wn.NameComponentManager).toConstantValue(new yn(Go)),Zo.bind(wn.HierarchyComponentManager).toConstantValue(new yn(_o)),Zo.bind(wn.TransformComponentManager).toConstantValue(new yn(So)),Zo.bind(wn.MeshComponentManager).toConstantValue(new yn(Ir)),Zo.bind(wn.CullableComponentManager).toConstantValue(new yn(Tr)),Zo.bind(wn.GeometryComponentManager).toConstantValue(new yn(or)),Zo.bind(wn.MaterialComponentManager).toConstantValue(new yn(xr));var $o;n(203),n(118);!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}($o||($o={}));n(204);var Jo,ta,ea,na,ra="undefined"!=typeof navigator&&/Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);!function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(Jo||(Jo={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(ta||(ta={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(ea||(ea={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(na||(na={}));function ia(t){return void 0===t?0:t>360||t<-360?t%360:t}function oa(t,e,n){return qr()(t)?ar.e.fromValues(t,e,n):3===t.length?ar.e.clone(t):ar.e.fromValues(t[0],t[1],t[2])}var aa,ua,sa,ca,fa,la,ha,da,pa=function(){function t(e,n){an()(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=ar.b.clone(n.matrix),this.right=ar.e.clone(n.right),this.up=ar.e.clone(n.up),this.forward=ar.e.clone(n.forward),this.position=ar.e.clone(n.position),this.focalPoint=ar.e.clone(n.focalPoint),this.distanceVector=ar.e.clone(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return sn()(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=ar.b.copy(t.matrix,this.matrix),t.right=ar.e.copy(t.right,this.right),t.up=ar.e.copy(t.up,this.up),t.forward=ar.e.copy(t.forward,this.forward),t.position=ar.e.copy(t.position,this.position),t.focalPoint=ar.e.copy(t.focalPoint,this.focalPoint),t.distanceVector=ar.e.copy(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(la||(la={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(ha||(ha={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(da||(da={}));var va,ma,ga,ya,ba,xa,_a,wa=Math.PI/180,Ea=180/Math.PI,Sa=(aa=Object(_n.injectable)(),ua=Object(_n.inject)(wn.InteractorService),aa((ca=function(){function t(){an()(this,t),this.matrix=ar.b.create(),this.right=ar.e.fromValues(1,0,0),this.up=ar.e.fromValues(0,1,0),this.forward=ar.e.fromValues(0,0,1),this.position=ar.e.fromValues(0,0,1),this.focalPoint=ar.e.fromValues(0,0,0),this.distanceVector=ar.e.fromValues(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.rotateWorld=!1,rn()(this,"interactor",fa,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=ar.b.create(),this.view=void 0,this.following=void 0,this.type=la.EXPLORING,this.trackingMode=ha.DEFAULT,this.projectionMode=da.PERSPECTIVE,this.frustum=new Wr,this.landmarks=[],this.landmarkAnimationID=void 0}return sn()(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===la.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===la.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==la.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return ar.b.invert(ar.b.create(),this.matrix)}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===da.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===da.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=da.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,ar.b.perspective(this.perspective,this.fov*wa,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=da.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),s=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=s-a,l=s+a,h=c+u,d=c-u;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,d=(h-=v*this.view.offsetY)-v*this.view.height}return ar.b.ortho(this.perspective,f,l,h,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r=ar.e.fromValues(0,1,0);if(this.focalPoint=oa(t,e,n),this.trackingMode===ha.CINEMATIC){var i=ar.e.subtract(ar.e.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=ar.e.length(i),a=Math.asin(e/o)*Ea,u=90+Math.atan2(n,t)*Ea,s=ar.b.create();ar.b.rotateY(s,s,u*wa),ar.b.rotateX(s,s,a*wa),r=ar.e.transformMat4(ar.e.create(),[0,1,0],s)}return ar.b.invert(this.matrix,ar.b.lookAt(ar.b.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=ar.e.create();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=ia(t),this.computeMatrix(),this._getAxes(),this.type===la.ORBITING||this.type===la.EXPLORING?this._getPosition():this.type===la.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=ia(t),this.computeMatrix(),this._getAxes(),this.type===la.ORBITING||this.type===la.EXPLORING?this._getPosition():this.type===la.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=ia(t),this.computeMatrix(),this._getAxes(),this.type===la.ORBITING||this.type===la.EXPLORING?this._getPosition():this.type===la.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===la.EXPLORING){t=ia(t),e=ia(e),n=ia(n);var r=ar.c.setAxisAngle(ar.c.create(),[1,0,0],(this.rotateWorld?1:-1)*e*wa),i=ar.c.setAxisAngle(ar.c.create(),[0,1,0],(this.rotateWorld?1:-1)*t*wa),o=ar.c.setAxisAngle(ar.c.create(),[0,0,1],n*wa),a=ar.c.multiply(ar.c.create(),i,r);a=ar.c.multiply(ar.c.create(),a,o);var u=ar.b.fromQuat(ar.b.create(),a);ar.b.translate(this.matrix,this.matrix,[0,0,-this.distance]),ar.b.multiply(this.matrix,this.matrix,u),ar.b.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=ia(e),this.relAzimuth=ia(t),this.relRoll=ia(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===la.ORBITING||this.type===la.EXPLORING?this._getPosition():this.type===la.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=oa(t,e,0),r=ar.e.clone(this.position);return ar.e.add(r,r,ar.e.scale(ar.e.create(),this.right,n[0])),ar.e.add(r,r,ar.e.scale(ar.e.create(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=ar.e.clone(this.position),r=t*this.dollyingStep;return n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===la.ORBITING||this.type===la.EXPLORING?this._getDistance():this.type===la.TRACKING&&ar.e.add(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new pa(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new pa(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function t(r){void 0===i&&(i=r);var s,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=ar.e.create(),h=ar.e.create();if(ar.e.lerp(l,e.focalPoint,a,f),ar.e.lerp(h,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),!(ar.e.dist(l,a)+ar.e.dist(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(s)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=ar.c.setAxisAngle(ar.c.create(),[0,0,1],this.roll*wa);ar.b.identity(this.matrix),t=ar.c.setAxisAngle(ar.c.create(),[1,0,0],(this.rotateWorld&&this.type!==la.TRACKING||this.type===la.TRACKING?1:-1)*this.elevation*wa),e=ar.c.setAxisAngle(ar.c.create(),[0,1,0],(this.rotateWorld&&this.type!==la.TRACKING||this.type===la.TRACKING?1:-1)*this.azimuth*wa);var r=ar.c.multiply(ar.c.create(),e,t);r=ar.c.multiply(ar.c.create(),r,n);var i=ar.b.fromQuat(ar.b.create(),r);this.type===la.ORBITING||this.type===la.EXPLORING?(ar.b.translate(this.matrix,this.matrix,this.focalPoint),ar.b.multiply(this.matrix,this.matrix,i),ar.b.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===la.TRACKING&&(ar.b.translate(this.matrix,this.matrix,this.position),ar.b.multiply(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=oa(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){ar.e.copy(this.right,oa(ar.f.transformMat4(ar.f.create(),[1,0,0,0],this.matrix))),ar.e.copy(this.up,oa(ar.f.transformMat4(ar.f.create(),[0,1,0,0],this.matrix))),ar.e.copy(this.forward,oa(ar.f.transformMat4(ar.f.create(),[0,0,1,0],this.matrix))),ar.e.normalize(this.right,this.right),ar.e.normalize(this.up,this.up),ar.e.normalize(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=ar.e.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===la.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Ea,this.azimuth=Math.atan2(-t,-n)*Ea):(this.elevation=-Math.asin(e/r)*Ea,this.azimuth=-Math.atan2(-t,-n)*Ea)}},{key:"_getPosition",value:function(){ar.e.copy(this.position,oa(ar.f.transformMat4(ar.f.create(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){ar.e.transformMat3(this.distanceVector,[0,0,-this.distance],ar.a.fromMat4(ar.a.create(),this.matrix)),ar.e.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ar.e.subtract(ar.e.create(),this.focalPoint,this.position),this.distance=ar.e.length(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),fa=fn()(ca.prototype,"interactor",[ua],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sa=ca))||sa),Aa=n(27),Ta=n.n(Aa),Ma=n(16),ka=n.n(Ma),Ia=n(5);function Oa(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function Ca(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Da(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ca(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ra,Na,Pa,ja,Ga,La,Ba,Ua,Fa,za,Va,Wa,Xa,qa,Ha,Ya,Ka,Za,Qa,$a,Ja,tu,eu,nu,ru,iu,ou,au,uu=(va=Object(_n.injectable)(),ma=Object(_n.inject)(wn.RenderEngine),ga=Object(_n.inject)(wn.ConfigService),va((ba=function(){function t(){an()(this,t),rn()(this,"engine",xa,this),rn()(this,"configService",_a,this),this.entity=mn(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return sn()(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Da({canvas:e||Oa(),swapChainFormat:Ia.TextureFormat.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n=this;if("string"==typeof t){var r=qr()(e)||Ta()(e)||ka()(e);if(this.compiledBundle&&this.compiledBundle.context){var i=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(i)return i.value=e,this;var o=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));o&&(r?(o.data=e,o.isReferer=!1,o.storageClass===ea.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(o.isReferer=!0,o.data=e))}}else Object.keys(t).forEach((function(e){n.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=pn()(hn.a.mark((function t(){var e,n,r=this,i=arguments;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=pn()(hn.a.mark((function t(){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=pn()(hn.a.mark((function t(){var e,n,r;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Da({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?na.WGSL:na.GLSL450:na.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===ea.StorageBuffer){var n=1;t.type===Jo.FloatArray?n=1:t.type===Jo.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),xa=fn()(ba.prototype,"engine",[ma],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_a=fn()(ba.prototype,"configService",[ga],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ya=ba))||ya),su=(Ra=Object(_n.injectable)(),Na=Object(_n.inject)(wn.MeshComponentManager),Pa=Object(_n.inject)(wn.CullableComponentManager),ja=Object(_n.inject)(wn.TransformComponentManager),Ga=Object(_n.inject)(wn.Systems),La=Object(_n.named)(wn.SceneGraphSystem),Ra((qa=Xa=function(){function t(){an()(this,t),this.config=void 0,rn()(this,"mesh",Fa,this),rn()(this,"cullable",za,this),rn()(this,"transform",Va,this),rn()(this,"sceneGraphSystem",Wa,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return sn()(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.afterEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setVisible",value:function(t){return this.meshComponent.visible=t,this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"afterEntityCreated",value:function(){}}]),t}(),Xa.POINT="point",Xa.LINE="line",Ua=qa,Fa=fn()(Ua.prototype,"mesh",[Na],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),za=fn()(Ua.prototype,"cullable",[Pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Va=fn()(Ua.prototype,"transform",[ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wa=fn()(Ua.prototype,"sceneGraphSystem",[Ga,La],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ba=Ua))||Ba),cu=n(223),fu=n.n(cu),lu=function(){function t(e,n){an()(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return sn()(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),hu=(Ha={},Wn()(Ha,Zn.POINTS,"points"),Wn()(Ha,Zn.LINES,"lines"),Wn()(Ha,Zn.LINE_LOOP,"line loop"),Wn()(Ha,Zn.LINE_STRIP,"line strip"),Wn()(Ha,Zn.TRIANGLES,"triangles"),Wn()(Ha,Zn.TRIANGLE_FAN,"triangle fan"),Wn()(Ha,Zn.TRIANGLE_STRIP,"triangle strip"),Ha),du=(Ya={},Wn()(Ya,Zn.STATIC_DRAW,"static"),Wn()(Ya,Zn.DYNAMIC_DRAW,"dynamic"),Wn()(Ya,Zn.STREAM_DRAW,"stream"),Ya),pu=(Ka={},Wn()(Ka,Zn.BYTE,"int8"),Wn()(Ka,Zn.UNSIGNED_INT,"int16"),Wn()(Ka,Zn.INT,"int32"),Wn()(Ka,Zn.UNSIGNED_BYTE,"uint8"),Wn()(Ka,Zn.UNSIGNED_SHORT,"uint16"),Wn()(Ka,Zn.UNSIGNED_INT,"uint32"),Wn()(Ka,Zn.FLOAT,"float"),Ka),vu=(Za={},Wn()(Za,Zn.ALPHA,"alpha"),Wn()(Za,Zn.LUMINANCE,"luminance"),Wn()(Za,Zn.LUMINANCE_ALPHA,"luminance alpha"),Wn()(Za,Zn.RGB,"rgb"),Wn()(Za,Zn.RGBA,"rgba"),Wn()(Za,Zn.RGBA4,"rgba4"),Wn()(Za,Zn.RGB5_A1,"rgb5 a1"),Wn()(Za,Zn.RGB565,"rgb565"),Wn()(Za,Zn.DEPTH_COMPONENT,"depth"),Wn()(Za,Zn.DEPTH_STENCIL,"depth stencil"),Za),mu=(Qa={},Wn()(Qa,Zn.DONT_CARE,"dont care"),Wn()(Qa,Zn.NICEST,"nice"),Wn()(Qa,Zn.FASTEST,"fast"),Qa),gu=($a={},Wn()($a,Zn.NEAREST,"nearest"),Wn()($a,Zn.LINEAR,"linear"),Wn()($a,Zn.LINEAR_MIPMAP_LINEAR,"mipmap"),Wn()($a,Zn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Wn()($a,Zn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Wn()($a,Zn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),$a),yu=(Ja={},Wn()(Ja,Zn.REPEAT,"repeat"),Wn()(Ja,Zn.CLAMP_TO_EDGE,"clamp"),Wn()(Ja,Zn.MIRRORED_REPEAT,"mirror"),Ja),bu=(tu={},Wn()(tu,Zn.NONE,"none"),Wn()(tu,Zn.BROWSER_DEFAULT_WEBGL,"browser"),tu),xu=(eu={},Wn()(eu,Zn.NEVER,"never"),Wn()(eu,Zn.ALWAYS,"always"),Wn()(eu,Zn.LESS,"less"),Wn()(eu,Zn.LEQUAL,"lequal"),Wn()(eu,Zn.GREATER,"greater"),Wn()(eu,Zn.GEQUAL,"gequal"),Wn()(eu,Zn.EQUAL,"equal"),Wn()(eu,Zn.NOTEQUAL,"notequal"),eu),_u=(nu={},Wn()(nu,Zn.FUNC_ADD,"add"),Wn()(nu,Zn.MIN_EXT,"min"),Wn()(nu,Zn.MAX_EXT,"max"),Wn()(nu,Zn.FUNC_SUBTRACT,"subtract"),Wn()(nu,Zn.FUNC_REVERSE_SUBTRACT,"reverse subtract"),nu),wu=(ru={},Wn()(ru,Zn.ZERO,"zero"),Wn()(ru,Zn.ONE,"one"),Wn()(ru,Zn.SRC_COLOR,"src color"),Wn()(ru,Zn.ONE_MINUS_SRC_COLOR,"one minus src color"),Wn()(ru,Zn.SRC_ALPHA,"src alpha"),Wn()(ru,Zn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Wn()(ru,Zn.DST_COLOR,"dst color"),Wn()(ru,Zn.ONE_MINUS_DST_COLOR,"one minus dst color"),Wn()(ru,Zn.DST_ALPHA,"dst alpha"),Wn()(ru,Zn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Wn()(ru,Zn.CONSTANT_COLOR,"constant color"),Wn()(ru,Zn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Wn()(ru,Zn.CONSTANT_ALPHA,"constant alpha"),Wn()(ru,Zn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Wn()(ru,Zn.SRC_ALPHA_SATURATE,"src alpha saturate"),ru),Eu=(iu={},Wn()(iu,Zn.NEVER,"never"),Wn()(iu,Zn.ALWAYS,"always"),Wn()(iu,Zn.LESS,"less"),Wn()(iu,Zn.LEQUAL,"lequal"),Wn()(iu,Zn.GREATER,"greater"),Wn()(iu,Zn.GEQUAL,"gequal"),Wn()(iu,Zn.EQUAL,"equal"),Wn()(iu,Zn.NOTEQUAL,"notequal"),iu),Su=(ou={},Wn()(ou,Zn.ZERO,"zero"),Wn()(ou,Zn.KEEP,"keep"),Wn()(ou,Zn.REPLACE,"replace"),Wn()(ou,Zn.INVERT,"invert"),Wn()(ou,Zn.INCR,"increment"),Wn()(ou,Zn.DECR,"decrement"),Wn()(ou,Zn.INCR_WRAP,"increment wrap"),Wn()(ou,Zn.DECR_WRAP,"decrement wrap"),ou),Au=(au={},Wn()(au,Zn.FRONT,"front"),Wn()(au,Zn.BACK,"back"),au),Tu=function(){function t(e,n){an()(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:du[i||Zn.STATIC_DRAW],type:pu[o||Zn.UNSIGNED_BYTE]})}return sn()(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}(),Mu=n(15),ku=n.n(Mu);function Iu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ou(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Iu(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Iu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Cu=0,Du=function(){function t(e,n){var r=this;an()(this,t),this.reGl=e,this.context=n,this.entity=mn(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,u=t.storageClass;if(u===ea.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(u===ea.Uniform){if(o&&(Array.isArray(o)||Ta()(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,u=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\\nattribute vec2 a_TexCoord;\\n\\nvarying vec2 v_TexCoord;\\n\\nvoid main() {\\n gl_Position = vec4(a_Position, 1.0);\\n v_TexCoord = a_TexCoord;\\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return sn()(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=pn()(hn.a.mark((function t(){var e,n,r,i,o,a,u,s,c=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,u=[],4!==i)for(s=0;s<e.length;s+=4)1===i?u.push(e[s]):2===i?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return Ou(Ou({},t),{},{id:Cu++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Jo.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,u=Math.ceil(a/r),s=Math.ceil(Math.sqrt(u)),c=s*s;u<c&&i.push.apply(i,ku()(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:Cu++,data:i,originalDataLength:a,typedArrayConstructor:Ta()(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),Ru=function(){function t(e,n){an()(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:du[i||Zn.STATIC_DRAW],type:pu[o||Zn.UNSIGNED_BYTE],count:a})}return sn()(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),Nu=function(){function t(e,n){an()(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(u.color=o.get()),this.framebuffer=e.framebuffer(u)}return sn()(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}(),Pu=n(60),ju=n.n(Pu),Gu=n(120),Lu=n.n(Gu);function Bu(t){var e={};return Object.keys(t).forEach((function(n){!function t(e,n,r,i){if(null===n||"number"==typeof n||"boolean"==typeof n||Array.isArray(n)&&"number"==typeof n[0]||Ta()(n)||""===n||"resize"in n)return void(r["".concat(i&&i+".").concat(e)]=n);Lu()(n)&&Object.keys(n).forEach((function(o){t(o,n[o],r,"".concat(i&&i+".").concat(e))}));Array.isArray(n)&&n.forEach((function(n,o){Object.keys(n).forEach((function(a){t(a,n[a],r,"".concat(i&&i+".").concat(e,"[").concat(o,"]"))}))}))}(n,t[n],e,"")})),e}function Uu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Fu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Uu(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zu,Vu,Wu=function(){function t(e,n){an()(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.attributes,a=n.uniforms,u=n.primitive,s=n.count,c=n.elements,f=n.depth,l=n.blend,h=n.stencil,d=n.cull,p=n.instances,v=n.scissor,m=n.viewport,g={};a&&(this.uniforms=Bu(a),Object.keys(a).forEach((function(t){g[t]=e.prop(t)})));var y={};Object.keys(o).forEach((function(t){y[t]=o[t].get()}));var b={attributes:y,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n".concat(i),uniforms:g,vert:r,primitive:hu[void 0===u?Zn.TRIANGLES:u]};p&&(b.instances=p),s&&(b.count=s),c&&(b.elements=c.get()),v&&(b.scissor=v),m&&(b.viewport=m),this.initDepthDrawParams({depth:f},b),this.initBlendDrawParams({blend:l},b),this.initStencilDrawParams({stencil:h},b),this.initCullDrawParams({cull:d},b),this.drawCommand=e(b)}return sn()(t,[{key:"addUniforms",value:function(t){this.uniforms=Fu(Fu({},this.uniforms),Bu(t))}},{key:"draw",value:function(t){var e=Fu(Fu({},this.uniforms),Bu(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=ju()(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:n[t]=e[t].get()})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:xu[n.func||Zn.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:wu[i&&i.srcRGB||Zn.SRC_ALPHA],srcAlpha:wu[i&&i.srcAlpha||Zn.SRC_ALPHA],dstRGB:wu[i&&i.dstRGB||Zn.ONE_MINUS_SRC_ALPHA],dstAlpha:wu[i&&i.dstAlpha||Zn.ONE_MINUS_SRC_ALPHA]},equation:{rgb:_u[o&&o.rgb||Zn.FUNC_ADD],alpha:_u[o&&o.alpha||Zn.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,u=void 0===a?{cmp:Zn.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Zn.KEEP,zfail:Zn.KEEP,zpass:Zn.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Zn.KEEP,zfail:Zn.KEEP,zpass:Zn.KEEP}:f;e.stencil={enable:!!r,mask:o,func:Fu(Fu({},u),{},{cmp:Eu[u.cmp]}),opFront:{fail:Su[c.fail],zfail:Su[c.zfail],zpass:Su[c.zpass]},opBack:{fail:Su[l.fail],zfail:Su[l.zfail],zpass:Su[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Zn.BACK:i;e.cull={enable:!!r,face:Au[o]}}}}]),t}(),Xu=function(){function t(e,n){an()(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Zn.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Zn.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Zn.CLAMP_TO_EDGE:p,m=n.wrapT,g=void 0===m?Zn.CLAMP_TO_EDGE:m,y=n.aniso,b=void 0===y?0:y,x=n.alignment,_=void 0===x?1:x,w=n.premultiplyAlpha,E=void 0!==w&&w,S=n.mag,A=void 0===S?Zn.NEAREST:S,T=n.min,M=void 0===T?Zn.NEAREST:T,k=n.colorSpace,I=void 0===k?Zn.BROWSER_DEFAULT_WEBGL:k;this.width=a,this.height=u;var O={width:a,height:u,type:pu[o],format:vu[l],wrapS:yu[v],wrapT:yu[g],mag:gu[A],min:gu[M],alignment:_,flipY:c,colorSpace:bu[I],premultiplyAlpha:E,aniso:b};r&&(O.data=r),"number"==typeof d?O.mipmap=mu[d]:"boolean"==typeof d&&(O.mipmap=d),this.texture=e.texture(O)}return sn()(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),qu=Object(_n.injectable)()(zu=function(){function t(){var e=this;an()(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=pn()(hn.a.mark((function t(n){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Wu(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new lu(e.gl,t)},this.createBuffer=function(t){return new Tu(e.gl,t)},this.createElements=function(t){return new Ru(e.gl,t)},this.createTexture2D=function(t){return new Xu(e.gl,t)},this.createFramebuffer=function(t){return new Nu(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=pn()(hn.a.mark((function t(n){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Du(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,u={color:n,depth:r,stencil:i};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Zn.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Zn.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return sn()(t,[{key:"init",value:(e=pn()(hn.a.mark((function t(e){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){fu()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}())||zu;function Hu(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script \'".concat(t,"\'"),e)},i.appendChild(o)}}function Yu(t,e){return new Promise((function(e,n){Hu(t,(function(){e()}),(function(t,e){n(e)}))}))}var Ku=function(){return Zu.apply(this,arguments)};function Zu(){return(Zu=pn()(hn.a.mark((function t(){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Vu){t.next=2;break}return t.abrupt("return",Vu);case 2:return t.next=4,Yu("https://preview.babylonjs.com/glslang/glslang.js");case 4:return Vu=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",Vu);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Qu,$u,Ju,ts,es,ns,rs,is=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,u=r.normalized,s=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,h=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:u||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},s&&(this.attribute.size=s)}return sn()(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),os=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type;this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||Ia.BufferUsage.Vertex|Ia.BufferUsage.CopyDst)}return sn()(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(ra?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),as=n(61),us=n.n(as),ss=function(){function t(e,n){an()(this,t),this.engine=e,this.context=n,this.entity=mn(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return sn()(t,[{key:"init",value:(r=pn()(hn.a.mark((function t(){var e,n,r,i,o,a,u,s=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===ea.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===ea.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,u=[],i.forEach((function(t){if(qr()(t.data))s.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,u.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,u.push(0)),u.push.apply(u,ku()(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,u.push(0);u.push.apply(u,ku()(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new os(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:Ia.BufferUsage.Uniform|Ia.BufferUsage.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;us()(t.data)||t.type!==Jo.Vector4FloatArray&&t.type!==Jo.FloatArray||(t.name===s.context.output.name?(e=new os(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Ia.BufferUsage.Storage|Ia.BufferUsage.CopyDst|Ia.BufferUsage.CopySrc}),s.outputBuffer=e,s.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new os(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Ia.BufferUsage.Storage|Ia.BufferUsage.CopyDst|Ia.BufferUsage.CopySrc}),s.vertexBuffers[t.name]=e,s.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++)})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=pn()(hn.a.mark((function t(){var e,n,r,i,o,a,u,s,c;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(u=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(ra?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(Ia.MapMode.Read);case 12:return s=a.getMappedRange(),c=new r(s.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,ku()(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(ra?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=pn()(hn.a.mark((function t(e){var n;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:ra}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),cs=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new os(e,{data:i instanceof Array?new Uint16Array(i):i,usage:Ia.BufferUsage.Index|Ia.BufferUsage.CopyDst})}return sn()(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),fs=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil;i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return sn()(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i}));this.width=r,this.height=i}}]),t}(),ls=(Qu={},Wn()(Qu,Zn.POINTS,Ia.PrimitiveTopology.PointList),Wn()(Qu,Zn.LINES,Ia.PrimitiveTopology.LineList),Wn()(Qu,Zn.LINE_LOOP,Ia.PrimitiveTopology.LineList),Wn()(Qu,Zn.LINE_STRIP,Ia.PrimitiveTopology.LineStrip),Wn()(Qu,Zn.TRIANGLES,Ia.PrimitiveTopology.TriangleList),Wn()(Qu,Zn.TRIANGLE_FAN,Ia.PrimitiveTopology.TriangleList),Wn()(Qu,Zn.TRIANGLE_STRIP,Ia.PrimitiveTopology.TriangleStrip),Qu),hs=($u={},Wn()($u,Zn.NEVER,Ia.CompareFunction.Never),Wn()($u,Zn.ALWAYS,Ia.CompareFunction.Always),Wn()($u,Zn.LESS,Ia.CompareFunction.Less),Wn()($u,Zn.LEQUAL,Ia.CompareFunction.LessEqual),Wn()($u,Zn.GREATER,Ia.CompareFunction.Greater),Wn()($u,Zn.GEQUAL,Ia.CompareFunction.GreaterEqual),Wn()($u,Zn.EQUAL,Ia.CompareFunction.Equal),Wn()($u,Zn.NOTEQUAL,Ia.CompareFunction.NotEqual),$u),ds=(Ju={},Wn()(Ju,Zn.FUNC_ADD,Ia.BlendOperation.Add),Wn()(Ju,Zn.MIN_EXT,Ia.BlendOperation.Min),Wn()(Ju,Zn.MAX_EXT,Ia.BlendOperation.Max),Wn()(Ju,Zn.FUNC_SUBTRACT,Ia.BlendOperation.Subtract),Wn()(Ju,Zn.FUNC_REVERSE_SUBTRACT,Ia.BlendOperation.ReverseSubtract),Ju),ps=(ts={},Wn()(ts,Zn.ZERO,Ia.BlendFactor.Zero),Wn()(ts,Zn.ONE,Ia.BlendFactor.One),Wn()(ts,Zn.SRC_COLOR,Ia.BlendFactor.SrcColor),Wn()(ts,Zn.ONE_MINUS_SRC_COLOR,Ia.BlendFactor.OneMinusSrcColor),Wn()(ts,Zn.SRC_ALPHA,Ia.BlendFactor.SrcAlpha),Wn()(ts,Zn.ONE_MINUS_SRC_ALPHA,Ia.BlendFactor.OneMinusSrcAlpha),Wn()(ts,Zn.DST_COLOR,Ia.BlendFactor.DstColor),Wn()(ts,Zn.ONE_MINUS_DST_COLOR,Ia.BlendFactor.OneMinusDstColor),Wn()(ts,Zn.DST_ALPHA,Ia.BlendFactor.DstAlpha),Wn()(ts,Zn.ONE_MINUS_DST_ALPHA,Ia.BlendFactor.OneMinusDstAlpha),Wn()(ts,Zn.CONSTANT_COLOR,Ia.BlendFactor.BlendColor),Wn()(ts,Zn.ONE_MINUS_CONSTANT_COLOR,Ia.BlendFactor.OneMinusBlendColor),Wn()(ts,Zn.SRC_ALPHA_SATURATE,Ia.BlendFactor.SrcAlphaSaturated),ts),vs=(es={},Wn()(es,Zn.ALPHA,"r8unorm"),Wn()(es,Zn.RGBA,"rgba8unorm"),Wn()(es,Zn.DEPTH_COMPONENT,"depth32float"),Wn()(es,Zn.DEPTH_STENCIL,"depth24plus-stencil8"),es),ms=(ns={},Wn()(ns,Zn.NEAREST,"nearest"),Wn()(ns,Zn.LINEAR,"linear"),ns),gs=(rs={},Wn()(rs,Zn.REPEAT,"repeat"),Wn()(rs,Zn.CLAMP_TO_EDGE,"clamp-to-edge"),Wn()(rs,Zn.MIRRORED_REPEAT,"mirror-repeat"),rs);function ys(t){var e=t.cull;return e&&e.enable?e.face?e.face===Zn.FRONT?Ia.CullMode.Front:Ia.CullMode.Back:void 0:Ia.CullMode.None}function bs(t){var e=t.depth,n=(t.stencil,{compare:Ia.CompareFunction.Always,depthFailOp:Ia.StencilOperation.Keep,failOp:Ia.StencilOperation.Keep,passOp:Ia.StencilOperation.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:hs[(null==e?void 0:e.func)||Zn.ALWAYS],format:Ia.TextureFormat.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function xs(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:ps[n&&n.func&&n.func.srcAlpha||Zn.ONE],dstFactor:ps[n&&n.func&&n.func.dstAlpha||Zn.ZERO],operation:ds[n&&n.equation&&n.equation.alpha||Zn.FUNC_ADD]},colorBlend:{srcFactor:ps[n&&n.func&&n.func.srcRGB||Zn.ONE],dstFactor:ps[n&&n.func&&n.func.dstRGB||Zn.ZERO],operation:ds[n&&n.equation&&n.equation.rgb||Zn.FUNC_ADD]},writeMask:Ia.ColorWrite.All}]}function _s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ws(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_s(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Es(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];e+=u.length}for(var s=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];s.set(h,c),c+=h.length}return s}var Ss,As=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return sn()(t,[{key:"init",value:(n=pn()(hn.a.mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,m,g=this;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,u=e.elements,s=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:h=t.sent,d=h.vertexStage,p=h.fragmentStage,o&&this.buildUniformBindGroup(o),u&&(this.indexBuffer=u.get(),this.indexCount=u.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,u=r.attributes;return g.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:u}}))},m={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:ls[a||Zn.TRIANGLES],rasterizationState:ws(ws({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:ys({cull:l})}),depthStencilState:bs({depth:s,stencil:f}),colorStates:xs({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:v},this.renderPipeline=this.engine.device.createRenderPipeline(m);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=ws(ws({},this.uniforms),Bu(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=ws(ws({},this.uniforms),Bu(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=ju()(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;us()(a)||e.uniformBuffer.subData({data:r[t],offset:a})}else{var u,s=null===(u=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===u?void 0:u.offset;if(!us()(s)){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:s,resource:h}),s++),i.push({binding:s,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),Ia.IndexFormat.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=pn()(hn.a.mark((function t(e,n,r){var i,o,a;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:ra}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:ra}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Ia.FrontFace.CCW,cullMode:Ia.CullMode.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Es.apply(void 0,[Float32Array].concat(ku()(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:Ia.ShaderStage.Fragment|Ia.ShaderStage.Vertex,type:Ia.BindingType.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:Ia.ShaderStage.Fragment,type:Ia.BindingType.Sampler},{binding:2*n+(o?1:0)+1,visibility:Ia.ShaderStage.Fragment,type:Ia.BindingType.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new os(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:Ia.BufferUsage.Uniform|Ia.BufferUsage.CopyDst}))}}]),t}(),Ts=function(){function t(e,n){an()(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return sn()(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(t.data,t.type),n=(void 0===e&&Zn.UNSIGNED_BYTE,t.width),r=t.height,i=(t.flipY,t.format),o=void 0===i?Zn.RGBA:i,a=(t.mipmap,t.wrapS),u=void 0===a?Zn.CLAMP_TO_EDGE:a,s=t.wrapT,c=void 0===s?Zn.CLAMP_TO_EDGE:s,f=t.aniso,l=void 0===f?0:f,h=(t.alignment,t.premultiplyAlpha,t.mag),d=void 0===h?Zn.NEAREST:h,p=t.min,v=void 0===p?Zn.NEAREST:p,m=t.colorSpace,g=(void 0===m&&Zn.BROWSER_DEFAULT_WEBGL,t.usage);this.width=n,this.height=r,this.texture=this.engine.device.createTexture({size:[n,r,1],mipLevelCount:1,sampleCount:1,dimension:Ia.TextureDimension.E2d,format:vs[o],usage:g||Ia.TextureUsage.Sampled|Ia.TextureUsage.CopyDst}),(!g||g&Ia.TextureUsage.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:gs[u],addressModeV:gs[c],addressModeW:gs[u],magFilter:ms[d],minFilter:ms[v],maxAnisotropy:l}))}}]),t}(),Ms=Object(_n.injectable)()(Ss=function(){function t(){var e=this;an()(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||Ia.LoadOp.Load,e.mainDepthAttachment.depthLoadValue=r||Ia.LoadOp.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:Ia.LoadOp.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=pn()(hn.a.mark((function t(n){var r;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new As(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new is(e,t)},this.createBuffer=function(t){return new os(e,t)},this.createElements=function(t){return new cs(e,t)},this.createTexture2D=function(t){return new Ts(e,t)},this.createFramebuffer=function(t){return new fs(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Ia.TextureViewDimension.E2d,arrayLayerCount:1,aspect:Ia.TextureAspect.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=pn()(hn.a.mark((function t(n){var r;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new ss(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;if(e.currentRenderPass){if(e.transientViewport.x!==1/0){e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1)}else if(n!==e.cachedViewport.x||r!==e.cachedViewport.y||i!==e.cachedViewport.width||o!==e.cachedViewport.height){e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)}}else e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return sn()(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=pn()(hn.a.mark((function t(e){return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),ra?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=pn()(hn.a.mark((function t(){var e,n;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ku();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(ra?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Ia.TextureUsage.OutputAttachment|Ia.TextureUsage.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Ia.TextureDimension.E2d,format:Ia.TextureFormat.BGRA8Unorm,usage:Ia.TextureUsage.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:ra?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Ia.StoreOp.Store}]}else this.mainColorAttachments=[{attachment:ra?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Ia.StoreOp.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Ia.TextureDimension.E2d,format:ra?"depth32float-stencil8":Ia.TextureFormat.Depth24PlusStencil8,usage:Ia.TextureUsage.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:ra?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Ia.StoreOp.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Ia.StoreOp.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=ra?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=ra?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=null===(r=t.get().color)||void 0===r?void 0:r.texture;u&&(o=u.createView(this.currentRenderTargetViewDescriptor));var s,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(s=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:Ia.LoadOp.Load,storeOp:Ia.StoreOp.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:Ia.LoadOp.Load,depthStoreOp:Ia.StoreOp.Store,stencilLoadValue:a?this.clearStencilValue:Ia.LoadOp.Load,stencilStoreOp:Ia.StoreOp.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}())||Ss,ks=n(63),Is=n(44);function Os(t,e,n,r,i){Cs(e,r,-i),Cs(e,r,i),t.push(n),t.push(n)}function Cs(t,e,n){t.push([[e[0],e[1]],n])}var Ds,Rs,Ns,Ps,js,Gs,Ls,Bs,Us;function Fs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var zs,Vs,Ws,Xs,qs,Hs,Ys,Ks,Zs,Qs=(Ds=Object(_n.injectable)(),Rs=Object(_n.inject)(wn.Systems),Ns=Object(_n.named)(wn.MaterialSystem),Ps=Object(_n.inject)(wn.Systems),js=Object(_n.named)(wn.GeometrySystem),Ds((Ls=function(t){Mn()(n,t);var e=Fs(n);function n(){var t;an()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),rn()(t,"materialSystem",Bs,qn()(t)),rn()(t,"geometrySystem",Us,qn()(t)),t}return sn()(n,[{key:"afterEntityCreated",value:function(){var t=this,e=this.materialSystem.createShaderMaterial({vertexShader:"attribute vec2 a_pos;\\nattribute vec4 a_color;\\nattribute float a_line_miter;\\nattribute vec2 a_line_normal;\\nattribute float a_counters;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform float u_thickness;\\nuniform vec2 u_viewport;\\n\\nvarying vec4 v_color;\\nvarying vec2 v_normal;\\nvarying float v_counters;\\n\\nvoid main() {\\n v_color = a_color;\\n v_counters = a_counters;\\n\\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\\n\\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\\n\\n v_normal = vec2(normal * sign(a_line_miter));\\n\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\\n}\\n",fragmentShader:"uniform float u_dash_array;\\nuniform float u_dash_offset;\\nuniform float u_dash_ratio;\\nuniform float u_thickness;\\n\\nvarying vec4 v_color;\\nvarying vec2 v_normal;\\nvarying float v_counters;\\n\\nvoid main() {\\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\\n\\n gl_FragColor = v_color;\\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\\n}"});e.setCull({enable:!1,face:Zn.BACK}).setUniform({u_dash_array:this.config.dashArray||.02,u_dash_offset:this.config.dashOffset||0,u_dash_ratio:this.config.dashRatio||0,u_thickness:this.config.thickness||.02});var n=function(t,e,n){var r=[0,0],i=[0,0],o=[0,0],a=[0,0],u=-1,s=!1,c=null,f=Object(ks.create)(),l=n||0,h=[],d=[],p=[],v=[0,0];e&&(t=t.slice()).push(t[0]);for(var m=t.length,g=1;g<m;g++){var y=l,b=t[g-1],x=t[g],_=g<t.length-1?t[g+1]:null;if(v.push(g/m,g/m),Object(Is.direction)(r,x,b),c||(c=[0,0],Object(Is.normal)(c,r)),s||(s=!0,Os(d,h,b,c,1)),p.push([y+0,y+1,y+2]),_){Object(Is.direction)(i,_,x);var w=Object(Is.computeMiter)(o,a,r,i,1),E=Object(ks.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){Object(Is.normal)(c,r),Os(d,h,x,c,1),p.push(1===u?[y,y+2,y+3]:[y+2,y+1,y+3]),l+=2,u=E;continue}S?(w=3,v.push(g/m),Cs(h,c,-E),d.push(x),Cs(h,a,w*E),d.push(x),p.push(u!==-E?[y,y+2,y+3]:[y+2,y+1,y+3]),p.push([y+2,y+3,y+4]),Object(Is.normal)(f,i),Object(ks.copy)(c,f),Cs(h,c,-E),d.push(x),l+=3):(Os(d,h,x,a,w),p.push(1===u?[y,y+2,y+3]:[y+2,y+1,y+3]),E=-1,Object(ks.copy)(c,a),l+=2),u=E}else Object(Is.normal)(c,r),Os(d,h,x,c,1),p.push(1===u?[y,y+2,y+3]:[y+2,y+1,y+3]),l+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:v}}(this.config.points,!1),r=n.normals,i=n.attrIndex,o=n.attrPos,a=n.attrCounters,u=o.length,s=this.geometrySystem.createBufferGeometry({vertexCount:u}),c=[],f=[];r.forEach((function(t){var e=t[0],n=t[1];c.push([e[0],e[1]]),f.push(n)})),s.setIndex(i.reduce((function(t,e){return[].concat(ku()(t),ku()(e))}),[])),s.setAttribute("a_pos",Float32Array.from(o.reduce((function(t,e){return[].concat(ku()(t),ku()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var l=new Array(u).fill(void 0).map((function(){return ku()(t.config.color)})).reduce((function(t,e){return[].concat(ku()(t),ku()(e))}),[]);s.setAttribute("a_color",Float32Array.from(l),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),s.setAttribute("a_line_miter",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),s.setAttribute("a_line_normal",Float32Array.from(c.reduce((function(t,e){return[].concat(ku()(t),ku()(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),s.setAttribute("a_counters",Float32Array.from(a),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),this.setMaterial(e),this.setGeometry(s)}}]),n}(su),Bs=fn()(Ls.prototype,"materialSystem",[Rs,Ns],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Us=fn()(Ls.prototype,"geometrySystem",[Ps,js],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gs=Ls))||Gs);function $s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Cn()(t);if(e){var i=Cn()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return In()(this,n)}}var Js,tc,ec,nc,rc,ic,oc,ac,uc,sc=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],cc=(zs=Object(_n.injectable)(),Vs=Object(_n.inject)(wn.Systems),Ws=Object(_n.named)(wn.MaterialSystem),Xs=Object(_n.inject)(wn.Systems),qs=Object(_n.named)(wn.GeometrySystem),zs((Ys=function(t){Mn()(n,t);var e=$s(n);function n(){var t;an()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),rn()(t,"materialSystem",Ks,qn()(t)),rn()(t,"geometrySystem",Zs,qn()(t)),t}return sn()(n,[{key:"afterEntityCreated",value:function(){var t=this.materialSystem.createShaderMaterial({vertexShader:\'attribute vec2 position;\\nattribute vec4 color;\\nattribute float shape;\\nattribute vec2 offset;\\nattribute float size;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\n\\nuniform float u_stroke_width;\\nuniform float u_device_pixel_ratio;\\nuniform vec2 u_viewport;\\n\\nvarying vec4 v_color;\\nvarying vec4 v_data;\\nvarying float v_radius;\\n\\n#pragma include "picking"\\n\\nvoid main() {\\n v_color = color;\\n v_radius = size;\\n\\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\\n\\n // construct point coords\\n v_data = vec4(position, antialiasblur, shape);\\n\\n gl_Position = projectionMatrix * modelViewMatrix\\n * vec4(position * size + offset, 0.0, 1.0);\\n\\n setPickingColor(a_PickingColor);\\n}\',fragmentShader:"uniform float u_blur;\\nuniform float u_opacity;\\nuniform float u_stroke_width;\\nuniform vec4 u_stroke_color;\\nuniform float u_stroke_opacity;\\n\\nvarying vec4 v_color;\\nvarying vec4 v_data;\\nvarying float v_radius;\\n\\n#pragma include \\"sdf2d\\"\\n#pragma include \\"picking\\"\\n\\nvoid main() {\\n int shape = int(floor(v_data.w + 0.5));\\n\\n float antialiasblur = v_data.z;\\n float antialiased_blur = -max(u_blur, antialiasblur);\\n float r = v_radius / (v_radius + u_stroke_width);\\n\\n float outer_df;\\n float inner_df;\\n // \'circle\', \'triangle\', \'square\', \'pentagon\', \'hexagon\', \'octogon\', \'hexagram\', \'rhombus\', \'vesica\'\\n if (shape == 0) {\\n outer_df = sdCircle(v_data.xy, 1.0);\\n inner_df = sdCircle(v_data.xy, r);\\n } else if (shape == 1) {\\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\\n } else if (shape == 2) {\\n outer_df = sdBox(v_data.xy, vec2(1.));\\n inner_df = sdBox(v_data.xy, vec2(r));\\n } else if (shape == 3) {\\n outer_df = sdPentagon(v_data.xy, 0.8);\\n inner_df = sdPentagon(v_data.xy, r * 0.8);\\n } else if (shape == 4) {\\n outer_df = sdHexagon(v_data.xy, 0.8);\\n inner_df = sdHexagon(v_data.xy, r * 0.8);\\n } else if (shape == 5) {\\n outer_df = sdOctogon(v_data.xy, 1.0);\\n inner_df = sdOctogon(v_data.xy, r);\\n } else if (shape == 6) {\\n outer_df = sdHexagram(v_data.xy, 0.52);\\n inner_df = sdHexagram(v_data.xy, r * 0.52);\\n } else if (shape == 7) {\\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\\n inner_df = sdRhombus(v_data.xy, vec2(r));\\n } else if (shape == 8) {\\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\\n }\\n\\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\\n\\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\\n antialiased_blur,\\n 0.0,\\n inner_df\\n );\\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\\n\\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\\n gl_FragColor.a = gl_FragColor.a * opacity_t;\\n\\n gl_FragColor = filterColor(gl_FragColor);\\n}",cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Zn.SRC_ALPHA,dstRGB:Zn.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});t.setUniform({u_stroke_width:.01,u_device_pixel_ratio:window.devicePixelRatio,u_stroke_color:[0,0,0,0],u_stroke_opacity:1,u_opacity:.35,u_blur:0});var e=this.buildAttributes(),n=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:e.instancedOffsets.length/2,vertexCount:6});n.setIndex([0,2,1,0,3,2]),n.setAttribute("position",Float32Array.from(e.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),n.setAttribute("offset",Float32Array.from(e.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),n.setAttribute("color",Float32Array.from(e.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),n.setAttribute("size",Float32Array.from(e.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),n.setAttribute("shape",Float32Array.from(e.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),n.setAttribute("a_PickingColor",Float32Array.from(e.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(t),this.setGeometry(n)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,u;(r=e.instancedPickingColors).push.apply(r,ku()([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(sc.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,ku()(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,ku()(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,ku()(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),n}(su),Ks=fn()(Ys.prototype,"materialSystem",[Vs,Ws],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zs=fn()(Ys.prototype,"geometrySystem",[Xs,qs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hs=Ys))||Hs);function fc(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return lc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function lc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var hc,dc,pc,vc,mc,gc,yc,bc,xc,_c,wc,Ec,Sc=(Js=Object(_n.injectable)(),tc=Object(_n.inject)(wn.RenderEngine),ec=Object(_n.inject)(wn.ShaderModuleService),nc=Object(_n.inject)(wn.ConfigService),Js((ic=function(){function t(){an()(this,t),rn()(this,"engine",oc,this),rn()(this,"shaderModule",ac,this),rn()(this,"configService",uc,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0,this.container=void 0}var e,n;return sn()(t,[{key:"init",value:(n=pn()(hn.a.mark((function t(){var e,n,r,i,o;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),e=this.container.getAll(wn.Systems),!(n=this.configService.get()).canvas){t.next=25;break}return t.next=6,this.engine.init({canvas:n.canvas,swapChainFormat:Ia.TextureFormat.BGRA8Unorm,antialiasing:!1});case 6:r=fc(e),t.prev=7,r.s();case 9:if((i=r.n()).done){t.next=16;break}if(!(o=i.value).initialize){t.next=14;break}return t.next=14,o.initialize();case 14:t.next=9;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(7),r.e(t.t0);case 21:return t.prev=21,r.f(),t.finish(21);case 24:this.inited=!0;case 25:case"end":return t.stop()}}),t,this,[[7,18,21,24]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=pn()(hn.a.mark((function t(){var e,n,r,i,o,a,u,s=arguments;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(wn.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=fc(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(u=a.value).execute){t.next=15;break}return t.next=15,u.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),oc=fn()(ic.prototype,"engine",[tc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ac=fn()(ic.prototype,"shaderModule",[ec],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uc=fn()(ic.prototype,"configService",[nc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rc=ic))||rc),Ac=Object(_n.injectable)()(hc=function(){function t(){an()(this,t),this.entities=[]}return sn()(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}())||hc,Tc=(dc=Object(_n.injectable)(),pc=Object(_n.inject)(wn.Systems),vc=Object(_n.named)(wn.RendererSystem),dc((gc=function(){function t(){an()(this,t),rn()(this,"rendererSystem",yc,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return sn()(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),yc=fn()(gc.prototype,"rendererSystem",[pc,vc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mc=gc))||mc);function Mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mc(Object(n),!0).forEach((function(e){Wn()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ic=(bc=Object(_n.injectable)(),xc=Object(_n.inject)(wn.ConfigService),bc((wc=function(){function t(){an()(this,t),rn()(this,"configService",Ec,this),this.container=void 0}var e;return sn()(t,[{key:"getEngine",value:(e=pn()(hn.a.mark((function t(){var e,n,r,i;return hn.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(wn.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(kc({canvas:r||Oa(),swapChainFormat:Ia.TextureFormat.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(wn.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(wn.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return mn()}},{key:"createScene",value:function(){return this.container.get(Ac)}},{key:"createCamera",value:function(){return this.container.get(Sa)}},{key:"createView",value:function(){return this.container.get(Tc)}},{key:"createRenderable",value:function(t,e,n){var r=e?this.container.getNamed(wn.Renderable,e):this.container.get(su);return r.setConfig(n),r.setEntity(t),r}},{key:"createBoxGeometry",value:function(t){return this.container.getNamed(wn.Systems,wn.GeometrySystem).createBox(t)}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(wn.Systems,wn.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(wn.Systems,wn.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createBasicMaterial",value:function(){return this.container.getNamed(wn.Systems,wn.MaterialSystem).createBasicMaterial()}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(wn.Systems,wn.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(uu);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(Sc);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(wn.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(wn.RenderEngine).destroy(),this.container.get(wn.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Qo(),r=navigator.gpu?Ms:qu;n.isBound(wn.RenderEngine)||n.bind(wn.RenderEngine).to(r).inSingletonScope(),n.bind(Sc).toSelf(),n.bind(uu).toSelf(),n.bind(su).toSelf(),n.bind(Tc).toSelf(),n.bind(Sa).toSelf(),n.bind(Ac).toSelf(),n.bind(t).toSelf(),n.bind(wn.Renderable).to(cc).whenTargetNamed(su.POINT),n.bind(wn.Renderable).to(Qs).whenTargetNamed(su.LINE);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Ec=fn()(wc.prototype,"configService",[xc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_c=wc))||_c),Oc=function(t,e){return t?Object(r.h)(t)?function(e){return t}:t:function(t){return e||1}},Cc=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},Dc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.gravity=10,e.speed=1,e.clustering=!1,e.clusterField="cluster",e.clusterGravity=10,e.workerEnabled=!1,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,center:[0,0],gravity:10,speed:.1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=this.nodes,n=this.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var i={},o={};e.forEach((function(e,n){Object(r.h)(e.x)||(e.x=Math.random()*t.width),Object(r.h)(e.y)||(e.y=Math.random()*t.height),i[e.id]=e,o[e.id]=n})),this.nodeMap=i,this.nodeIdxMap=o,this.run()}},e.prototype.executeWithWorker=function(t,e){var n=this,i=this.nodes,o=this.center;if(i&&0!==i.length){if(1===i.length)return i[0].x=o[0],void(i[0].y=o[1]);var a={},u={};i.forEach((function(t,e){Object(r.h)(t.x)||(t.x=Math.random()*n.width),Object(r.h)(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),this.nodeMap=a,this.nodeIdxMap=u,this.run(t,e)}},e.prototype.run=function(t,e){var n=this,r=this.nodes,o=this.edges,a=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);var u,s,c,f,l,h,d=this.center,p=this.height*this.width,v=Math.sqrt(p)/10,m=p/(r.length+1),g=Math.sqrt(m),y=this.speed,b=this.clustering,x=(u=[this.clusterField],s=r,c=[],f=u.length,l={},s.forEach((function(t){u.forEach((function(e,n){if(void 0===l[t[e]]&&(l[t[e]]=Object.keys(l).length),c.push(l[t[e]]),n===f-1)for(;c.length%4!=0;)c.push(0)}))})),{array:new Float32Array(c),count:Object.keys(l).length}),_=x.array,w=x.count,E=r.length,S=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var u=e[o];r[i[u.source]].push(i[u.target]),r[i[u.target]].push(i[u.source])}var s=0;for(o=0;o<t.length;o++){var c=n.length,f=r[o],l=f.length;n[4*o+2]=c,n[4*o+3]=f.length,s=Math.max(s,f.length);for(var h=0;h<l;++h){var d=f[h];n.push(+d)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:s}}(r,o),A=S.maxEdgePerVetex,T=S.array;h=this.workerEnabled?Ic.create({canvas:t,engineOptions:{supportCompute:!0}}):Ic.create({engineOptions:{supportCompute:!0}});for(var M=this.onLayoutEnd,k=[],I=0;I<w;I++)k.push(0,0,0,0);var O,C=h.createKernel(\'{"shaders":{"WGSL":"import \\\\"GLSL.std.450\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_K : f32;\\\\n [[offset 4]] u_K2 : f32;\\\\n [[offset 8]] u_Center : vec2<f32>;\\\\n [[offset 16]] u_Gravity : f32;\\\\n [[offset 20]] u_ClusterGravity : f32;\\\\n [[offset 24]] u_Speed : f32;\\\\n [[offset 28]] u_MaxDisplace : f32;\\\\n [[offset 32]] u_Clustering : f32;\\\\n};\\\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\\\nvar xDist : f32 = currentNode.x - nextNode.x;\\\\nvar yDist : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\\\nif (dist > 0.0) {dx = dx + param * xDist;\\\\ndy = dy + param * yDist;}}}\\\\nreturn vec2<f32>(dx, dy);}\\\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\\\nvar cvx : f32 = currentNode.x - center.x;\\\\nvar cvy : f32 = currentNode.y - center.y;\\\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\\\ndx = dx + parma * cvx;\\\\ndy = dy + parma * cvy;}\\\\nreturn vec2<f32>(dx, dy);}\\\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\\\nvar node_buffer : vec4<f32>;\\\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\\\nvar arr_idx : i32 = arr_offset + i32(p);\\\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\\\nvar xDist : f32 = currentNode.x - nextNode.x;\\\\nvar yDist : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\\\ndy = dy - yDist * attractiveF;}}\\\\nreturn vec2<f32>(dx, dy);}\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\\\nvar dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\\\ndx = dx + repulsive.x;\\\\ndy = dy + repulsive.y;\\\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\\\ndx = dx + attractive.x;\\\\ndy = dy + attractive.y;\\\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\\\ndx = dx - gravity.x;\\\\ndy = dy - gravity.y;\\\\ndx = dx * gWebGPUUniformParams.u_Speed;\\\\ndy = dy * gWebGPUUniformParams.u_Speed;\\\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\"main\\\\" = main;\\\\n","GLSL450":"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_K;\\\\n float u_K2;\\\\n vec2 u_Center;\\\\n float u_Gravity;\\\\n float u_ClusterGravity;\\\\n float u_Speed;\\\\n float u_MaxDisplace;\\\\n float u_Clustering;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_AttributeArray[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\\\n vec4 u_ClusterCenters[];\\\\n} gWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\\\nif (dist > 0.0) {dx += param * xDist;\\\\ndy += param * yDist;}}}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\\\nfloat cvx = currentNode.x - center.x;\\\\nfloat cvy = currentNode.y - center.y;\\\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\\\ndx += parma * cvx;\\\\ndy += parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nint arr_offset = int(floor(currentNode.z + 0.5));\\\\nint length = int(floor(currentNode.w + 0.5));\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + int(p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\\\ndy -= yDist * attractiveF;}}\\\\nreturn vec2(dx, dy);}\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\ndx += repulsive.x;\\\\ndy += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode);\\\\ndx += attractive.x;\\\\ndy += attractive.y;\\\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\\\ndx -= gravity.x;\\\\ndy -= gravity.y;\\\\ndx *= gWebGPUUniformParams.u_Speed;\\\\ndy *= gWebGPUUniformParams.u_Speed;\\\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\\\n","GLSL100":"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_K;\\\\nuniform float u_K2;\\\\nuniform vec2 u_Center;\\\\nuniform float u_Gravity;\\\\nuniform float u_ClusterGravity;\\\\nuniform float u_Speed;\\\\nuniform float u_MaxDisplace;\\\\nuniform float u_Clustering;\\\\nuniform sampler2D u_AttributeArray;\\\\nuniform vec2 u_AttributeArraySize;\\\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AttributeArray(float address1D) {\\\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\\\n}\\\\nvec4 getDatau_AttributeArray(int address1D) {\\\\n return getDatau_AttributeArray(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat param = u_K2 / dist;\\\\nif (dist > 0.0) {dx += param * xDist;\\\\ndy += param * yDist;}}}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfloat vx = currentNode.x - u_Center.x;\\\\nfloat vy = currentNode.y - u_Center.y;\\\\nfloat gf = (0.01 * u_K) * u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\\\nfloat cvx = currentNode.x - center.x;\\\\nfloat cvy = currentNode.y - center.y;\\\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.001;\\\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\\\ndx += parma * cvx;\\\\ndy += parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcAttractive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nint arr_offset = int(floor(currentNode.z + 0.5));\\\\nint length = int(floor(currentNode.w + 0.5));\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + int(p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat attractiveF = dist / u_K;\\\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\\\ndy -= yDist * attractiveF;}}\\\\nreturn vec2(dx, dy);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\ndx += repulsive.x;\\\\ndy += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode);\\\\ndx += attractive.x;\\\\ndy += attractive.y;\\\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\\\ndx -= gravity.x;\\\\ndy -= gravity.y;\\\\ndx *= u_Speed;\\\\ndy *= u_Speed;\\\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}\').setDispatch([E,1,1]).setBinding({u_Data:T,u_K:g,u_K2:m,u_Gravity:this.gravity,u_ClusterGravity:this.clusterGravity,u_Speed:y,u_MaxDisplace:v,u_Clustering:b?1:0,u_Center:d,u_AttributeArray:_,u_ClusterCenters:k,MAX_EDGE_PER_VERTEX:A,VERTEX_COUNT:E});b&&(O=h.createKernel(\'{"shaders":{"WGSL":"import \\\\"GLSL.std.450\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\\\n\\\\n\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\\\nvar sumx : f32 = 0.0;\\\\nvar sumy : f32 = 0.0;\\\\nvar count : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\\\nvar clusterIdx : i32 = i32(attributes.x);\\\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\\\nsumy = sumy + vertex.y;\\\\ncount = count + 1.0;}}\\\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\"main\\\\" = main;\\\\n","GLSL450":"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\n\\\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_NodeAttributes[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\\\n vec4 u_ClusterCenters[];\\\\n} gWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\\\nfloat sumx = 0.0;\\\\nfloat sumy = 0.0;\\\\nfloat count = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\\\nint clusterIdx = int(attributes.x);\\\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\\\nif (clusterIdx == i) {sumx += vertex.x;\\\\nsumy += vertex.y;\\\\ncount += 1.0;}}\\\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\\\n","GLSL100":"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributes;\\\\nuniform vec2 u_NodeAttributesSize;\\\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributes(float address1D) {\\\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\\\n}\\\\nvec4 getDatau_NodeAttributes(int address1D) {\\\\n return getDatau_NodeAttributes(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 center = getDatau_ClusterCenters(i);\\\\nfloat sumx = 0.0;\\\\nfloat sumy = 0.0;\\\\nfloat count = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\\\nint clusterIdx = int(attributes.x);\\\\nvec4 vertex = getDatau_Data(j);\\\\nif (clusterIdx == i) {sumx += vertex.x;\\\\nsumy += vertex.y;\\\\ncount += 1.0;}}\\\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}\').setDispatch([w,1,1]).setBinding({u_Data:T,u_NodeAttributes:_,u_ClusterCenters:k,VERTEX_COUNT:E,CLUSTER_COUNT:w}));Object(i.b)(n,void 0,void 0,(function(){var n,o;return Object(i.d)(this,(function(i){switch(i.label){case 0:n=0,i.label=1;case 1:return n<a?[4,C.execute()]:[3,6];case 2:return i.sent(),b?(O.setBinding({u_Data:C}),[4,O.execute()]):[3,4];case 3:i.sent(),C.setBinding({u_ClusterCenters:O}),i.label=4;case 4:C.setBinding({u_MaxDisplace:v*=.99}),i.label=5;case 5:return n++,[3,1];case 6:return[4,C.getOutput()];case 7:return o=i.sent(),t?e.postMessage({type:bt,vertexEdgeData:o}):r.forEach((function(t,e){var n=o[4*e],r=o[4*e+1];t.x=n,t.y=r})),M&&M(),[2]}}))}))},e}(o),Rc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.edgeStrength=200,e.nodeStrength=1e3,e.coulombDisScale=.005,e.damping=.9,e.maxSpeed=1e3,e.minMovement=1,e.interval=.02,e.factor=1,e.linkDistance=1,e.gravity=10,e.workerEnabled=!1,e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,center:[0,0],gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var i={},o={};e.forEach((function(e,n){Object(r.h)(e.x)||(e.x=Math.random()*t.width),Object(r.h)(e.y)||(e.y=Math.random()*t.height),i[e.id]=e,o[e.id]=n})),t.nodeMap=i,t.nodeIdxMap=o,t.nodeStrength=Oc(t.nodeStrength,1),t.edgeStrength=Oc(t.edgeStrength,1),t.run()}},e.prototype.executeWithWorker=function(t,e){var n=this,i=n.nodes,o=n.center;if(i&&0!==i.length){if(1===i.length)return i[0].x=o[0],void(i[0].y=o[1]);var a={},u={};i.forEach((function(t,e){Object(r.h)(t.x)||(t.x=Math.random()*n.width),Object(r.h)(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,n.nodeStrength=Oc(n.nodeStrength,1),n.edgeStrength=Oc(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){var n=this,o=this,a=o.nodes,u=o.edges,s=o.maxIteration;o.width||"undefined"==typeof window||(o.width=window.innerWidth),o.height||"undefined"==typeof window||(o.height=window.innerHeight);var c=a.length;o.linkDistance=Oc(o.linkDistance),o.edgeStrength=Oc(o.edgeStrength);var f=function(t,e,n,r){var i=[],o=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,i.push(s.x),i.push(s.y),i.push(0),i.push(0),o.push([])}for(u=0;u<e.length;u++){var c=e[u];o[a[c.source]].push(a[c.target]),o[a[c.source]].push(n(c)),o[a[c.source]].push(r(c)),o[a[c.source]].push(0),o[a[c.target]].push(a[c.source]),o[a[c.target]].push(n(c)),o[a[c.target]].push(r(c)),o[a[c.target]].push(0)}var f=0;for(u=0;u<t.length;u++){var l=i.length,h=o[u],d=h.length;i[4*u+2]=l+1048576*d/4,i[4*u+3]=0,f=Math.max(f,d/4);for(var p=0;p<d;++p){var v=h[p];i.push(+v)}}for(;i.length%4!=0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:f}}(a,u,o.linkDistance,o.edgeStrength),l=f.maxEdgePerVetex,d=f.array;o.degrees=h(a.length,o.nodeIdxMap,u);var p=[],v=[],m=[],g=[],y=[];o.getMass||(o.getMass=function(t){return o.degrees[o.nodeIdxMap[t.id]]||1});var b=o.gravity,x=o.center;a.forEach((function(t,e){p.push(o.getMass(t)),v.push(o.nodeStrength(t)),o.degrees[e]||(o.degrees[e]=0);var n=[x[0],x[1],b];if(o.getCenter){var i=o.getCenter(t,o.degrees[e]);i&&Object(r.h)(i[0])&&Object(r.h)(i[1])&&Object(r.h)(i[2])&&(n=i)}m.push(n[0]),g.push(n[1]),y.push(n[2])}));var _,w=Cc([p,o.degrees,v]),E=Cc([m,g,y]);_=o.workerEnabled?Ic.create({canvas:t,engineOptions:{supportCompute:!0}}):Ic.create({engineOptions:{supportCompute:!0}});var S=o.onLayoutEnd,A=[];d.forEach((function(t){A.push(t)}));for(var T=0;T<4;T++)A.push(0);var M=_.createKernel(\'{"shaders":{"WGSL":"import \\\\"GLSL.std.450\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_damping : f32;\\\\n [[offset 4]] u_maxSpeed : f32;\\\\n [[offset 8]] u_minMovement : f32;\\\\n \\\\n [[offset 12]] u_coulombDisScale : f32;\\\\n [[offset 16]] u_factor : f32;\\\\n \\\\n \\\\n [[offset 20]] u_interval : f32;\\\\n};\\\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\\\ntype GWebGPUBuffer3 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\\\nvar v0 : i32 = packedIntValue / 1048576;\\\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\\\nvar vx : f32 = currentNode.x - nextNode.x;\\\\nvar vy : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nvar n_dist : f32 = dist * gWebGPUUniformParams.u_coulombDisScale;\\\\nvar direx : f32 = vx / dist;\\\\nvar direy : f32 = vy / dist;\\\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\\\nvar massi : f32 = attributesi.x;\\\\nvar nodeStrengthi : f32 = attributesi.z;\\\\nvar nodeStrengthj : f32 = attributesj.z;\\\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nvar param : f32 = (1000.0 * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\\\nax = ax + direx * param;\\\\nay = ay + direy * param;}}\\\\nreturn vec2<f32>(ax, ay);}\\\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\\\nvar vy : f32 = currentNode.y - attributes2.y;\\\\nvar ax : f32 = vx * attributes2.w;\\\\nvar ay : f32 = vy * attributes2.w;\\\\nreturn vec2<f32>(ax, ay);}\\\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\\\nvar ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\\\nvar length : i32 = compressed.x;\\\\nvar arr_offset : i32 = compressed.y;\\\\nvar node_buffer : vec4<f32>;\\\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\\\nvar arr_idx : i32 = arr_offset + (4 * p);\\\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\\\nvar float_j : f32 = node_buffer.x;\\\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\\\nvar vx : f32 = nextNode.x - currentNode.x;\\\\nvar vy : f32 = nextNode.y - currentNode.y;\\\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nvar direx : f32 = vx / dist;\\\\nvar direy : f32 = vy / dist;\\\\nvar edgeLength : f32 = node_buffer.y;\\\\nvar edgeStrength : f32 = node_buffer.z;\\\\nvar diff : f32 = edgeLength - dist;\\\\nvar param : f32 = (diff * edgeStrength) / mass;\\\\nax = ax - direx * param;\\\\nay = ay - direy * param;}\\\\nreturn vec2<f32>(ax, ay);}\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\\\nvar ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\\\nax = ax + repulsive.x;\\\\nay = ay + repulsive.y;\\\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax = ax + attractive.x;\\\\nay = ay + attractive.y;\\\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\\\nax = ax - gravity.x;\\\\nay = ay - gravity.y;\\\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\\\nvar vx : f32 = ax * param;\\\\nvar vy : f32 = ay * param;\\\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\"main\\\\" = main;\\\\n","GLSL450":"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_damping;\\\\n float u_maxSpeed;\\\\n float u_minMovement;\\\\n \\\\n float u_coulombDisScale;\\\\n float u_factor;\\\\n \\\\n \\\\n float u_interval;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_AveMovement[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\\\n vec4 u_NodeAttributeArray1[];\\\\n} gWebGPUBuffer2;\\\\n\\\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\\\n vec4 u_NodeAttributeArray2[];\\\\n} gWebGPUBuffer3;\\\\n\\\\n\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define SHIFT_20 1048576.0\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\\\nint v0 = packedIntValue / int(SHIFT_20);\\\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\\\nfloat ay = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\\\nfloat vx = currentNode.x - nextNode.x;\\\\nfloat vy = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat n_dist = dist * gWebGPUUniformParams.u_coulombDisScale;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\\\nfloat massi = attributesi.x;\\\\nfloat nodeStrengthi = attributesi.z;\\\\nfloat nodeStrengthj = attributesj.z;\\\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nfloat param = (1000.0 * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\\\nax += direx * param;\\\\nay += direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\\\nfloat vy = currentNode.y - attributes2.y;\\\\nfloat ax = vx * attributes2.w;\\\\nfloat ay = vy * attributes2.w;\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nivec2 compressed = unpack_float(currentNode.z);\\\\nint length = compressed.x;\\\\nint arr_offset = compressed.y;\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + (4 * p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\\\nfloat float_j = node_buffer.x;\\\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\\\nfloat vx = nextNode.x - currentNode.x;\\\\nfloat vy = nextNode.y - currentNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nfloat edgeLength = node_buffer.y;\\\\nfloat edgeStrength = node_buffer.z;\\\\nfloat diff = edgeLength - dist;\\\\nfloat param = (diff * edgeStrength) / mass;\\\\nax -= direx * param;\\\\nay -= direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\nax += repulsive.x;\\\\nay += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax += attractive.x;\\\\nay += attractive.y;\\\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\\\nax -= gravity.x;\\\\nay -= gravity.y;\\\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\\\nfloat vx = ax * param;\\\\nfloat vy = ay * param;\\\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\\\n","GLSL100":"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define SHIFT_20 1048576.0\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_damping;\\\\nuniform float u_maxSpeed;\\\\nuniform float u_minMovement;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nuniform float u_coulombDisScale;\\\\nuniform float u_factor;\\\\nuniform sampler2D u_NodeAttributeArray1;\\\\nuniform vec2 u_NodeAttributeArray1Size;\\\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\\\n return getDatau_NodeAttributeArray1(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributeArray2;\\\\nuniform vec2 u_NodeAttributeArray2Size;\\\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\\\n return getDatau_NodeAttributeArray2(float(address1D));\\\\n}\\\\nuniform float u_interval;\\\\nivec2 unpack_float(float packedValue) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint packedIntValue = int(packedValue);\\\\nint v0 = packedIntValue / int(SHIFT_20);\\\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat vx = currentNode.x - nextNode.x;\\\\nfloat vy = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat n_dist = dist * u_coulombDisScale;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\\\nfloat massi = attributesi.x;\\\\nfloat nodeStrengthi = attributesi.z;\\\\nfloat nodeStrengthj = attributesj.z;\\\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nfloat param = (1000.0 * u_factor) / (n_dist * n_dist);\\\\nax += direx * param;\\\\nay += direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat vx = currentNode.x - attributes2.x;\\\\nfloat vy = currentNode.y - attributes2.y;\\\\nfloat ax = vx * attributes2.w;\\\\nfloat ay = vy * attributes2.w;\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat mass = attributes1.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nivec2 compressed = unpack_float(currentNode.z);\\\\nint length = compressed.x;\\\\nint arr_offset = compressed.y;\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + (4 * p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = node_buffer.x;\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat vx = nextNode.x - currentNode.x;\\\\nfloat vy = nextNode.y - currentNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nfloat edgeLength = node_buffer.y;\\\\nfloat edgeStrength = node_buffer.z;\\\\nfloat diff = edgeLength - dist;\\\\nfloat param = (diff * edgeStrength) / mass;\\\\nax -= direx * param;\\\\nay -= direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nvec4 movement = getDatau_AveMovement(0.0);\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\nax += repulsive.x;\\\\nay += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax += attractive.x;\\\\nay += attractive.y;\\\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\\\nax -= gravity.x;\\\\nay -= gravity.y;\\\\nfloat param = u_interval * u_damping;\\\\nfloat vx = ax * param;\\\\nfloat vy = ay * param;\\\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nfloat distx = vx * u_interval;\\\\nfloat disty = vy * u_interval;\\\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}\').setDispatch([c,1,1]).setBinding({u_Data:d,u_damping:o.damping,u_maxSpeed:o.maxSpeed,u_minMovement:o.minMovement,u_coulombDisScale:o.coulombDisScale,u_factor:o.factor,u_NodeAttributeArray1:w,u_NodeAttributeArray2:E,MAX_EDGE_PER_VERTEX:l,VERTEX_COUNT:c,u_AveMovement:A,u_interval:o.interval}),k=_.createKernel(\'{"shaders":{"WGSL":"import \\\\"GLSL.std.450\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_iter : f32;\\\\n};\\\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\\\n};\\\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn main() -> void {var movement : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\\\nmovement = movement + vertex.w;}\\\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\"main\\\\" = main;\\\\n","GLSL450":"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_iter;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\\\n vec4 u_AveMovement[];\\\\n} gWebGPUBuffer1;\\\\n\\\\n\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\nvoid main() {float movement = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\\\nmovement += vertex.w;}\\\\nmovement = movement / float(VERTEX_COUNT);\\\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\\\n","GLSL100":"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_iter;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat movement = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\\\nmovement += vertex.w;}\\\\nmovement = movement / float(VERTEX_COUNT);\\\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}\').setDispatch([1,1,1]).setBinding({u_Data:d,VERTEX_COUNT:c,u_AveMovement:[0,0,0,0]});Object(i.b)(n,void 0,void 0,(function(){var n,r,u;return Object(i.d)(this,(function(i){switch(i.label){case 0:n=0,i.label=1;case 1:return n<s?[4,M.execute()]:[3,5];case 2:return i.sent(),k.setBinding({u_Data:M}),[4,k.execute()];case 3:i.sent(),r=Math.max(.02,o.interval-.002*n),M.setBinding({u_interval:r,u_AveMovement:k}),i.label=4;case 4:return n++,[3,1];case 5:return[4,M.getOutput()];case 6:return u=i.sent(),t?e.postMessage({type:bt,vertexEdgeData:u}):a.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},e}(o),Nc={circular:p,concentric:v,dagre:y,force:xt,g6force:wt,comboForce:en,fruchterman:Et,grid:At,mds:ke,radial:De,random:Re,gForce:function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.center=[0,0],e.maxIteration=1e3,e.edgeStrength=200,e.nodeStrength=1e3,e.coulombDisScale=.005,e.damping=.9,e.maxSpeed=1e3,e.minMovement=.5,e.interval=.02,e.factor=1,e.linkDistance=1,e.gravity=10,e.preventOverlap=!0,e.tick=function(){},e.nodes=[],e.edges=[],e.width=300,e.height=300,e.nodeMap={},e.nodeIdxMap={},e}return Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,center:[0,0],gravity:10,enableTick:!0}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(void 0!==t.timeInterval&&"undefined"!=typeof window&&window.clearInterval(t.timeInterval),e&&0!==e.length){if(1===e.length)return e[0].x=n[0],void(e[0].y=n[1]);var i={},o={};e.forEach((function(e,n){Object(r.h)(e.x)||(e.x=Math.random()*t.width),Object(r.h)(e.y)||(e.y=Math.random()*t.height),i[e.id]=e,o[e.id]=n})),t.nodeMap=i,t.nodeIdxMap=o,t.linkDistance=Oc(t.linkDistance,1),t.nodeStrength=Oc(t.nodeStrength,1),t.edgeStrength=Oc(t.edgeStrength,1);var a,u=t.nodeSize;if(t.preventOverlap){var s,c=t.nodeSpacing;s=Object(r.h)(c)?function(){return c}:Object(r.f)(c)?c:function(){return 0},a=u?Object(r.d)(u)?function(t){return(u[0]>u[1]?u[0]:u[1])+s(t)}:function(t){return u+s(t)}:function(t){return t.size?Object(r.d)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+s(t):t.size+s(t):10+s(t)}}t.nodeSize=a;var f=t.edges;t.degrees=h(e.length,t.nodeIdxMap,f),t.getMass||(t.getMass=function(e){return t.degrees[t.nodeIdxMap[e.id]]}),t.run()}},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;if(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),"undefined"!=typeof window){var i=0;this.timeInterval=window.setInterval((function(){var o=[],a=[];e.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),t.calRepulsive(o,e),t.calAttractive(o,n),t.calGravity(o,e);var u=Math.max(.02,t.interval-.002*i);t.updateVelocity(o,a,u,e);var s=[];e.forEach((function(t){s.push({x:t.x,y:t.y})})),t.updatePosition(a,u,e),t.tick&&t.tick();var c=0;e.forEach((function(t,e){var n=t.x-s[e].x,r=t.y-s[e].y;c+=Math.sqrt(n*n+r*r)})),(c/=e.length)<t.minMovement&&window.clearInterval(t.timeInterval),++i>r&&window.clearInterval(t.timeInterval)}),0),t.onLayoutEnd&&t.onLayoutEnd()}},e.prototype.calRepulsive=function(t,e){var n=this.getMass,r=this.nodeStrength,i=this.factor,o=this.coulombDisScale,a=this.preventOverlap,u=this.nodeSize;e.forEach((function(s,c){var f=n(s)||1;e.forEach((function(e,l){if(!(c>=l)){var h=s.x-e.x,d=s.y-e.y,p=Math.sqrt(h*h+d*d)+.01,v=(p+.1)*o,m=h/p,g=d/p,y=(r(s)+r(e))/2*i/(v*v),b=n(e)||1;if(t[2*c]+=m*y/f,t[2*c+1]+=g*y/f,t[2*l]-=m*y/b,t[2*l+1]-=g*y/b,a&&p<(u(s)+u(e))/2){var x=(r(s)+r(e))/2/(p*p);t[2*c]+=m*x/f,t[2*c+1]+=g*x/f,t[2*l]-=m*x/b,t[2*l+1]-=g*x/b}}}))}))},e.prototype.calAttractive=function(t,e){var n=this.nodeMap,r=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,a=this.getMass;e.forEach((function(e,u){var s=n[e.source],c=n[e.target],f=c.x-s.x,l=c.y-s.y,h=Math.sqrt(f*f+l*l)+.01,d=f/h,p=l/h,v=((i(e)||1)-h)*o(e),m=r[e.source],g=r[e.target],y=a(s)||1,b=a(c)||1;t[2*m]-=d*v/y,t[2*m+1]-=p*v/y,t[2*g]+=d*v/b,t[2*g+1]+=p*v/b}))},e.prototype.calGravity=function(t,e){for(var n=this.center,i=this.gravity,o=this.degrees,a=e.length,u=0;u<a;u++){var s=e[u],c=s.x-n[0],f=s.y-n[1],l=i;if(this.getCenter){var h=this.getCenter(s,o[u]);h&&Object(r.h)(h[0])&&Object(r.h)(h[1])&&Object(r.h)(h[2])&&(c=s.x-h[0],f=s.y-h[1],l=h[2])}l&&(t[2*u]-=l*c,t[2*u+1]-=l*f)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,u=t[2*r+1]*o||.01,s=Math.sqrt(a*a+u*u);if(s>i.maxSpeed){var c=i.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e}(o),"fruchterman-gpu":Dc,"gForce-gpu":Rc};Object(r.c)(Nc,(function(t,e){u.registerLayout(e,{},t)}));var Pc=u,jc=self;jc.onmessage=function(t){(function(t){var e=t.data.type;return e===pt||e===yt})(t)&&function(t){switch(t.data.type){case pt:var e=t.data,n=e.nodes,r=e.edges,i=e.layoutCfg,o=(f=void 0===i?{}:i).type;if(!(a=Pc[o])){jc.postMessage({type:mt,message:"layout "+o+" not found"});break}(u=new a(f)).init({nodes:n,edges:r}),u.execute(),jc.postMessage({type:vt,nodes:n}),u.destroy();break;case yt:var a,u,s=t.data,c=(n=s.nodes,r=s.edges,s.layoutCfg),f=void 0===c?{}:c,l=s.canvas;o=f.type;if(!(a=Pc[o])){jc.postMessage({type:mt,message:"layout "+o+" not found"});break}if("gpu"!==o.split("-")[1]){jc.postMessage({type:mt,message:"layout "+o+" does not support GPU"});break}(u=new a(f)).init({nodes:n,edges:r}),u.executeWithWorker(l,jc)}}(t)};e.default=null}]);\n//# sourceMappingURL=g6Layout.worker.js.map',"Worker",void 0,n.p+"g6Layout.worker.js")},bh=function(t){return setTimeout(t,16)},xh=function(t){return clearTimeout(t)},wh=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||bh)(t)},_h=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||xh)(t)},Eh=["fruchterman","gForce"],Sh=function(){function t(t){this.graph=t,this.layoutCfg=t.get("layout")||{},this.layoutType=this.layoutCfg.type,this.worker=null,this.workerData={},this.initLayout()}return t.prototype.initLayout=function(){},t.prototype.getWorker=function(){return this.worker||("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=new yh),this.worker},t.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(_h(t.requestId),t.requestId=null),t.requestId2&&(_h(t.requestId2),t.requestId2=null))},t.prototype.getLayoutType=function(){return this.layoutCfg.type},t.prototype.layout=function(t){var e=this,n=this.graph;this.data=this.setDataFromGraph();var r=this.data.nodes;if(!r)return!1;var i=n.get("width"),o=n.get("height"),a={};Object.assign(a,{width:i,height:o,center:[i/2,o/2]},this.layoutCfg),this.layoutCfg=a;var s=!!this.layoutType,u=this.layoutMethod;u&&u.destroy(),n.emit("beforelayout");var c=this.initPositions(a.center,r),f=this.layoutType,l=!1;if(f&&"gpu"===f.split("-")[1]&&(f=f.split("-")[0],a.gpuEnabled=!0),f&&a.gpuEnabled){var h=!0;_().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),h=!1),this.hasGPUVersion(f)||(console.warn("The '"+f+"' layout does not support GPU calculation for now, it will run in CPU."),h=!1),h&&(f+="-gpu",l=!0)}if(this.isGPU=l,this.stopWorker(),a.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;if("force"===f||"g6force"===f||"gForce"===f){var d=a.onTick,p=function(){d&&d(),n.refreshPositions()};a.tick=p;var g=a.onLayoutEnd;a.onLayoutEnd=function(){g&&g(),n.emit("afterlayout")}}else if("comboForce"===this.layoutType)a.comboTrees=n.get("comboTrees");else if(l){var v=a.onLayoutEnd;a.onLayoutEnd=function(){e.refreshLayout(),v&&v(),n.emit("afterlayout")}}var m=!1;if(void 0!==f){try{u=new gh[f](a)}catch(t){return console.warn("The layout method: '"+f+"' does not exist! Please specify it first."),!1}if(m=u.enableTick){var y=a.onTick,b=a.onLayoutEnd;p=function(){y&&y(),n.refreshPositions()};u.tick=p;u.onLayoutEnd=function(){b&&b(),n.emit("afterlayout")}}u.init(this.data),s&&(n.emit("beginlayout"),u.execute()),this.layoutMethod=u}return!s&&c||"force"===this.layoutType||m||l||(n.emit("afterlayout"),this.refreshLayout()),!1},t.prototype.layoutWithWorker=function(t,e){var n=this,r=t.nodes,i=t.edges,o=this.layoutCfg,a=this.graph,s=this.isGPU,u=this.getWorker(),c=this.workerData;if(!u)return!1;c.requestId=null,c.requestId2=null,c.currentTick=null,c.currentTickData=null,a.emit("beforelayout");var f=document.createElement("canvas"),l=s&&"undefined"!=typeof window&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in f,h=function(t,e){var n={};if(t&&"object"==typeof t)return Object.keys(t).forEach((function(r){t.hasOwnProperty(r)&&e(t[r])&&(n[r]=t[r])})),n;return t}(o,(function(t){return"function"!=typeof t}));if(l){var d=f.transferControlToOffscreen();h.type=h.type+"-gpu",u.postMessage({type:xr,nodes:r,edges:i,layoutCfg:h,canvas:d},[d])}else u.postMessage({type:vr,nodes:r,edges:i,layoutCfg:h});return u.onmessage=function(r){n.handleWorkerMessage(r,t,e)},!0},t.prototype.handleWorkerMessage=function(t,e,n){var r=this.graph,i=this.workerData,o=this.layoutCfg,a=t.data,s=a.type,u=function(){o.onTick&&o.onTick()},c=function(){o.onLayoutEnd&&o.onLayoutEnd(),r.emit("afterlayout")};switch(s){case br:i.currentTick=a.currentTick,i.currentTickData=a,i.requestId||(i.requestId=wh((function(){Mh(e,a),r.refreshPositions(),u(),1===a.currentTick&&n&&n(),a.currentTick===a.totalTicks?c():i.currentTick===a.totalTicks&&(i.requestId2=wh((function(){Mh(e,i.currentTickData),r.refreshPositions(),i.requestId2=null,u(),c()}))),i.requestId=null})));break;case mr:null==i.currentTick&&(Mh(e,a),this.refreshLayout(),n&&n(),r.emit("afterlayout"));break;case wr:null==i.currentTick&&(!function(t,e){for(var n=t.nodes,r=e.vertexEdgeData,i=n.length,o=0;o<i;o++){var a=n[o],s=r[4*o],u=r[4*o+1];a.x=s,a.y=u}}(e,a),this.refreshLayout(),n&&n(),r.emit("afterlayout"));break;case yr:console.warn("Web-Worker layout error!",a.message)}},t.prototype.refreshLayout=function(){var t=this.graph;t.get("animate")?t.positionsAnimate():t.refreshPositions()},t.prototype.updateLayoutCfg=function(t){var e=this.graph,n=this.layoutMethod,r=(this.layoutType,this.layoutCfg);if(this.layoutType=t.type,!n||n.destroyed)return this.layoutCfg=Object(l.z)({},r,t),void this.layout();this.data=this.setDataFromGraph(),this.stopWorker(),t.workerEnabled&&this.layoutWithWorker(this.data,null)||(n.init(this.data),n.updateCfg(t),e.emit("beforelayout"),n.execute(),"force"===this.layoutType||n.enableTick||e.emit("afterlayout"),this.refreshLayout())},t.prototype.changeLayout=function(t){var e=this.graph,n=this.layoutMethod;this.layoutType=t,this.layoutCfg=e.get("layout")||{},this.layoutCfg.type=t,n&&n.destroy(),this.layout()},t.prototype.changeData=function(){var t=this.layoutMethod;t&&t.destroy(),this.layout()},t.prototype.destroyLayout=function(){var t=this.layoutMethod,e=this.graph;t&&t.destroy(),e.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethod=void 0},t.prototype.setDataFromGraph=function(){for(var t=[],e=[],n=[],r=this.graph.getNodes(),i=this.graph.getEdges(),o=this.graph.getCombos(),a=r.length,s=0;s<a;s++){var u=r[s];if(u.isVisible()){var c=u.getModel();t.push(c)}}var f=i.length;for(s=0;s<f;s++){var l=i[s];if(!l.destroyed&&l.isVisible())(c=l.getModel()).isComboEdge||e.push(c)}var h=o.length;for(s=0;s<h;s++){var d=o[s];if(!d.destroyed&&d.isVisible()){c=d.getModel();n.push(c)}}return{nodes:t,edges:e,combos:n}},t.prototype.relayout=function(t){var e=this.graph,n=this.layoutMethod,r=this.layoutCfg;if(t){this.data=this.setDataFromGraph();var i=this.data.nodes;if(!i)return!1;this.initPositions(r.center,i),n.init(this.data)}"force"===this.layoutType&&(n.ticking=!1,n.forceSimulation.stop()),e.emit("beforelayout"),n.execute(t),"force"===this.layoutType||n.enableTick||e.emit("afterlayout"),this.refreshLayout()},t.prototype.layoutAnimate=function(){},t.prototype.moveToZero=function(){var t=this.graph.get("data").nodes;if(void 0!==t[0].x&&null!==t[0].x&&!b(t[0].x)){for(var e=[0,0],n=t.length,r=0;r<n;r++){var i=t[r];e[0]+=i.x,e[1]+=i.y}e[0]/=t.length,e[1]/=t.length;for(r=0;r<n;r++){(i=t[r]).x-=e[0],i.y-=e[1]}}},t.prototype.initPositions=function(t,e){var n=this.graph;if(!e)return!1;var r=!0,i=.85*n.get("width"),o=.85*n.get("height"),a=e.length,s=Math.ceil(Math.sqrt(a)*(i/o)),u=i/(s-1),c=o/(Math.ceil(a/s)-1);isFinite(u)&&u||(u=0),isFinite(c)&&u||(c=0);for(var f=t[0]-i/2,l=t[1]-o/2,h=e.length,d=0;d<h;d++){var p=e[d];b(p.x)&&(r=!1,p.x=d%s*u+f),b(p.y)&&(r=!1,p.y=Math.floor(d/s)*c+l)}return r},t.prototype.hasGPUVersion=function(t){for(var e=Eh.length,n=0;n<e;n++)if(Eh[n]===t)return!0;return!1},t.prototype.destroy=function(){var t=this.layoutMethod;this.graph=null,t&&(t.destroy(),t.destroyed=!0);var e=this.worker;e&&(e.terminate(),this.worker=null),this.destroyed=!0},t}();function Mh(t,e){for(var n=t.nodes,r=e.nodes,i=n.length,o=0;o<i;o++){var a=n[o];a.x=r[o].x,a.y=r[o].y}}var Oh=null,Ah=function(){function t(t){this.graph=t,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return t.checkCache=function(t,e,n){if(n[e]){var r=n[e].indexOf(t);r>=0&&n[e].splice(r,1)}},t.cacheState=function(t,e,n){n[e]||(n[e]=[]),n[e].push(t)},t.prototype.updateState=function(e,n,r){var i=this,o=t.checkCache,a=t.cacheState;if(!e.destroyed){var s=this.cachedStates,u=s.enabled,c=s.disabled;r?(o(e,n,c),a(e,n,u)):(o(e,n,u),a(e,n,c)),Oh&&clearTimeout(Oh),Oh=setTimeout((function(){Oh=null,i.updateGraphStates()}),16)}},t.prototype.updateStates=function(t,e,n){var r=this;Object(l.w)(e)?this.updateState(t,e,n):e.forEach((function(e){r.updateState(t,e,n)}))},t.prototype.updateGraphStates=function(){var t=this.graph.get("states"),e=this.cachedStates;Object(l.f)(e.disabled,(function(e,n){t[n]&&(t[n]=t[n].filter((function(t){return e.indexOf(t)<0&&!e.destroyed})))})),Object(l.f)(e.enabled,(function(e,n){if(t[n]){var r={};t[n].forEach((function(t){t.destroyed||(r[t.get("id")]=!0)})),e.forEach((function(e){if(!e.destroyed){var i=e.get("id");r[i]||(r[i]=!0,t[n].push(e))}}))}else t[n]=e})),this.graph.emit("graphstatechange",{states:t}),this.cachedStates={enabled:{},disabled:{}}},t.prototype.destroy=function(){this.graph=null,this.cachedStates=null,Oh&&clearTimeout(Oh),Oh=null,this.destroyed=!0},t}(),kh=function(t){var e={};return t.getNodes().forEach((function(t){e[t.getID()]={degree:0,inDegree:0,outDegree:0}})),t.getEdges().forEach((function(t){e[t.getSource().getID()].degree++,e[t.getSource().getID()].outDegree++,e[t.getTarget().getID()].degree++,e[t.getTarget().getID()].inDegree++})),e},Th=function(){function t(e){this.compare=e||t.defaultCompareFunction}return t.defaultCompareFunction=function(t,e){return t===e?0:t<e?-1:1},t.prototype.equal=function(t,e){return 0===this.compare(t,e)},t.prototype.lessThan=function(t,e){return this.compare(t,e)<0},t.prototype.greaterThan=function(t,e){return this.compare(t,e)>0},t.prototype.lessThanOrEqual=function(t,e){return this.lessThan(t,e)||this.equal(t,e)},t.prototype.greaterThanOrEqual=function(t,e){return this.greaterThan(t,e)||this.equal(t,e)},t.prototype.reverse=function(){var t=this.compare;this.compare=function(e,n){return t(n,e)}},t}(),Ih=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):""+this.value},t}(),Ch=function(){function t(t){void 0===t&&(t=null),this.head=null,this.tail=null,this.compare=new Th(t)}return t.prototype.prepend=function(t){var e=new Ih(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new Ih(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare.equal(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare.equal(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare.equal(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare.equal(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),Ph=function(){function t(t){void 0===t&&(t=10),this.linkedList=new Ch,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),Dh=function(t,e){var n=t.getNodes(),r=t.getEdges(),i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.getID()]=e;i.push([])})),r&&r.forEach((function(t){var n=t.getModel(),r=n.source,a=n.target,s=o[r],u=o[a];i[s][u]=1,e||(i[u][s]=1)})),i},Nh=function(t,e){var n=t.get("adjMatrix");n||(n=Dh(t,e));for(var r=[],i=n.length,o=0;o<i;o+=1){r[o]=[];for(var a=0;a<i;a+=1)o===a?r[o][a]=0:0!==n[o][a]&&n[o][a]?r[o][a]=n[o][a]:r[o][a]=1/0}for(var s=0;s<i;s+=1)for(o=0;o<i;o+=1)for(a=0;a<i;a+=1)r[o][a]>r[o][s]+r[s][a]&&(r[o][a]=r[o][s]+r[s][a]);return r},Rh=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},jh=function(t){var e=t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}}));e.sort((function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x}));for(var n=[],r=0;r<e.length;r++){for(;n.length>=2&&Rh(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&Rh(i[i.length-2],i[i.length-1],e[r])<=0;)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)},Bh={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function Lh(t,e,n){var r=!1,i=function(t,n){return e.cells[t+n*e.width]},o=function(t,e){var r=0;return i(t-1,e-1)>=n&&(r+=1),i(t,e-1)>n&&(r+=2),i(t-1,e)>n&&(r+=4),i(t,e)>n&&(r+=8),r},a=function(n,r){for(var i,a,s=n,u=r,c=0;c<e.width*e.height;c++){if(i=s,a=u,t.findIndex((function(t){return t.x===s&&t.y===u}))>-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var f=o(s,u);switch(f){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: "+f),!0}}};this.march=function(){for(var t=0;t<e.width&&!r;t+=1)for(var s=0;s<e.height&&!r;s+=1)i(t,s)>n&&15!==o(t,s)&&(r=a(t,s));return r}}var Gh=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=Yt(t,e);i>=0&&i<n&&(r=t,n=i)})),r};function Fh(t,e,n,r,i){var o=function(t,e,n){var r=null,i=Number.POSITIVE_INFINITY;return e.forEach((function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=qt(o,a),u=new zt(o.x,o.y,a.x,a.y),c=n.reduce((function(t,e){return Yt(e,u)>0?t+1:t}),0);s*Math.pow(c+1,2)<i&&(r=e,i=s*Math.pow(c+1,2))})),r}(t,n,e);if(null===o)return[];return function(t){for(var n=[];t.length>0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new zt(r.x1,r.y1,i.x2,i.y2);Gh(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(function(t,e,n,r){var i=[],o=[];o.push(t);for(var a=!0,s=0,u=function(t,e){var n=!1;return e.forEach((function(e){n||(Zt(t,{x:e.x1,y:e.y1})||Zt(t,{x:e.x2,y:e.y2}))&&(n=!0)})),n},c=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n].getBBox(),o=[[i.x,i.y],[i.x+i.width,i.y],[i.x,i.y+i.height],[i.x+i.width,i.y+i.height]];if(Gt(o,t.x,t.y))return!0}return!1};a&&s<n;){a=!1;for(var f=function(){var t=o.pop(),n=Gh(e,t);if(n){var f=Xt(n,t),l=f[0];if(2===f[1]){var h=function(s){for(var f=r,h=Wh(n,f,l,s),d=u(h,o)||u(h,i),p=c(h,e);!d&&p&&f>=1;)h=Wh(n,f/=1.5,l,s),d=u(h,o)||u(h,i),p=c(h,e);!h||d||s&&p||(o.push(new zt(t.x1,t.y1,h.x,h.y)),o.push(new zt(h.x,h.y,t.x2,t.y2)),a=!0)};h(!0),a||h(!1)}}a||i.push(t),s+=1};!a&&o.length;)f()}for(;o.length;)i.push(o.pop());return i}(new zt(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i))}var Uh=function(t,e,n){var r=Object.assign(Bh,n),i=Ht(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return qt({x:t.getModel().x,y:t.getModel().y},i)-qt({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){Fh(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,f,l,h=function(t,e,n){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach((function(t){i.push(t.getBBox())})),e.forEach((function(t){i.push(t.getBBox())}));for(var o=0,a=i;o<a.length;o++){var s=a[o];r.minX=(s.minX<r.minX?s.minX:r.minX)-n,r.minY=(s.minY<r.minY?s.minY:r.minY)-n,r.maxX=(s.maxX>r.maxX?s.maxX:r.maxX)+n,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+n}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}(t,a,r.nodeR0),d=(s=h.width,u=h.height,c=r.pixelGroupSize,f=Math.ceil(s/c),l=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,f*l)).fill(0),width:f,height:l}),p=[],g=[],v=0;v<r.maxMarchingIterations;v++)if(zh(t,e,a,h,d,r),g=[],new Lh(p=[],d,r.threshold).march()){var m=p.map((function(t){return{x:Math.round(t.x*r.pixelGroupSize+h.minX),y:Math.round(t.y*r.pixelGroupSize+h.minY)}}));if(m){var y=m.length;if(r.skip>1)for(y=Math.floor(m.length/r.skip);y<3&&r.skip>1;)r.skip-=1,y=Math.floor(m.length/r.skip);for(var b=0,x=0;x<y;x+=1,b+=r.skip)g.push({x:m[b].x,y:m[b].y})}if(g&&function(){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=g.map((function(t){return[t.x,t.y]}));if(!Gt(i,r.getBBox().centerX,r.getBBox().centerY))return!1}return!0}())return g;if(r.threshold*=.9,v<=.5*r.maxMarchingIterations)r.memberInfluenceFactor*=1.2,r.edgeInfluenceFactor*=1.2;else{if(!(0!==r.nonMemberInfluenceFactor&&e.length>0))break;r.nonMemberInfluenceFactor*=.8}}return g};function zh(t,e,n,r,i,o){function a(t,e){var n=Math.floor((t-e)/o.pixelGroupSize);return n<0?0:n}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),c=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),f=function(t,e){return[Math.min(a(t.minX,e+r.minX),i.width),Math.min(a(t.minY,e+r.minY),i.height),Math.min(a(t.maxX,-e+r.minX),i.width),Math.min(a(t.maxY,-e+r.minY),i.height)]},l=function(t,e){for(var n=t.getBBox(),a=f(n,o.nodeR1),u=a[0],c=a[1],l=a[2],h=a[3],d=c;d<h;d+=1)for(var p=u;p<l;p+=1)if(!(e<0&&i[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),m=Kt({x:g,y:v},{x:n.minX,y:n.minY,width:n.width,height:n.height});if(m<Math.pow(o.nodeR1,2)){var y=Math.sqrt(m)-o.nodeR1;i.cells[p+d*i.width]+=e*y*y}}};o.nodeInfluenceFactor&&t.forEach((function(t){l(t,o.nodeInfluenceFactor/u)})),o.edgeInfluenceFactor&&n.forEach((function(t){!function(t,e){for(var n=t.getBBox(),a=f(n,o.edgeR1),u=a[0],c=a[1],l=a[2],h=a[3],d=c;d<h;d+=1)for(var p=u;p<l;p+=1)if(!(e<0&&i.cells[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),m=Qt({x:g,y:v},t);if(m<Math.pow(o.edgeR1,2)){var y=Math.sqrt(m)-o.edgeR1;i.cells[p+d*i.width]+=e*y*y}}}(t,o.edgeInfluenceFactor/c)})),o.negativeNodeInfluenceFactor&&e.forEach((function(t){l(t,o.negativeNodeInfluenceFactor/u)}))}function Wh(t,e,n,r){var i=t.getBBox(),o=n[0],a=n[1],s=n[2],u=n[3],c={topLeft:{x:i.minX-e,y:i.minY-e},topRight:{x:i.maxX+e,y:i.minY-e},bottomLeft:{x:i.minX-e,y:i.maxY+e},bottomRight:{x:i.maxX+e,y:i.maxY+e}},f=i.height*i.width;function l(t,e){return i.width*(.5*(t.y-i.minY+(e.y-i.minY)))}if(a)return o?r?c.topLeft:c.bottomRight:s?r?c.bottomLeft:c.topRight:l(a,u)<.5*f?a.y>u.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.y<u.y?r?c.bottomLeft:c.topRight:r?c.bottomRight:c.topLeft;if(u){if(o)return r?c.topRight:c.bottomLeft;if(s)return r?c.bottomRight:c.topLeft}return l(o,s)<.5*f?o.x>s.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x<s.x?r?c.topRight:c.bottomLeft:r?c.bottomRight:c.topLeft}var Vh=function(){function t(t,e){this.cfg=Object(l.e)(this.getDefaultCfg(),e),this.graph=t,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map((function(e){return Object(l.w)(e)?t.findById(e):e})),this.nonMembers=this.cfg.nonMembers.map((function(e){return Object(l.w)(e)?t.findById(e):e})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return t.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},t.prototype.setPadding=function(){var t=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var n,r,i;switch(this.type){case"round-convex":r=ie(i=pe((n=jh(t)).map((function(t){return[t.x,t.y]})),this.padding));break;case"smooth-convex":i=ge((n=jh(t)).map((function(t){return[t.x,t.y]})),this.padding),r=n.length>=2&&fe(i);break;case"bubble":r=(n=Uh(t,e,this.cfg.bubbleCfg)).length>=2&&fe(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:Object(p.a)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id}),this.group.toBack()},t.prototype.addMember=function(t){if(t){Object(l.w)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){Object(l.w)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){Object(l.w)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){Object(l.w)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var n=this;this.group.findById(this.id).remove(),t&&(this.members=t.map((function(t){return Object(l.w)(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return Object(l.w)(t)?n.graph.findById(t):t}))),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr(Object(p.a)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=Object(l.e)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return Object(l.w)(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return Object(l.w)(t)?e.graph.findById(t):t}))),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,n,r=this,i=(e=Object(l.w)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=ce(i.attr("path"));else{var o=i.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map((function(t){var e=r.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]})),Ut(n,ce(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),Xh=function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object(l.e)(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new Ph(n.cfg.maxStep),n.redoStack=new Ph(n.cfg.maxStep)),n}return Object(p.c)(e,t),e.prototype.init=function(){this.initCanvas();var t=new Ae(this),e=new Oe(this),n=new Me(this),r=new ln(this),i=new Sh(this),o=new Ah(this);this.set({eventController:t,viewController:e,modeController:n,itemController:r,layoutController:i,stateController:o}),this.initPlugin()},e.prototype.initCanvas=function(){var t=this.get("container");if("string"==typeof t&&(t=document.getElementById(t),this.set("container",t)),!t)throw new Error("invalid container");var e,n=this.get("width"),r=this.get("height");if("svg"===this.get("renderer"))e=new Se.Canvas({container:t,width:n,height:r});else{var i={container:t,width:n,height:r},o=this.get("pixelRatio");o&&(i.pixelRatio=o),e=new Ee.Canvas(i)}this.set("canvas",e),this.initGroups()},e.prototype.initPlugin=function(){var t=this;Object(l.f)(t.get("plugins"),(function(e){!e.destroyed&&e.initPlugin&&e.initPlugin(t)}))},e.prototype.initGroups=function(){var t=this.get("canvas"),e=this.get("canvas").get("el").id,n=t.addGroup({id:e+"-root",className:z.rootContainerClassName});if(this.get("groupByTypes")){var r=n.addGroup({id:e+"-edge",className:z.edgeContainerClassName}),i=n.addGroup({id:e+"-node",className:z.nodeContainerClassName}),o=n.addGroup({id:e+"-combo",className:z.comboContainerClassName});o.toBack(),this.set({nodeGroup:i,edgeGroup:r,comboGroup:o})}var a=n.addGroup({id:e+"-delegate",className:z.delegateContainerClassName});this.set({delegateGroup:a}),this.set("group",n)},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[]}},e.prototype.set=function(t,e){return Object(l.v)(t)?this.cfg=Object(p.a)(Object(p.a)({},this.cfg),t):this.cfg[t]=e,this},e.prototype.get=function(t){return this.cfg[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){Object(l.w)(t)&&(t=this.findById(t));var n=this.get("itemController");e||(e=t.get("states")),n.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var n,r=this.get(t+"s");return Object(l.f)(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return Object(l.f)(this.get(t+"s"),(function(t,r){e(t,r)&&n.push(t)})),n},e.prototype.findAllByState=function(t,e){return this.findAll(t,(function(t){return t.hasState(e)}))},e.prototype.translate=function(t,e){var n=this.get("group"),r=Object(l.c)(n.getMatrix());r||(r=[1,0,0,0,1,0,0,0,1]),$.translate(r,r,[t,e]),n.setMatrix(r),this.emit("viewportchange",{action:"translate",matrix:n.getMatrix()}),this.autoPaint()},e.prototype.moveTo=function(t,e){var n=this.get("group");Nt(n,{x:t,y:e}),this.emit("viewportchange",{action:"move",matrix:n.getMatrix()})},e.prototype.fitView=function(t){t&&this.set("fitViewPadding",t),this.get("viewController").fitView(),this.autoPaint()},e.prototype.fitCenter=function(){this.get("viewController").fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.zoom=function(t,e){var n=this.get("group"),r=Object(l.c)(n.getMatrix()),i=this.get("minZoom"),o=this.get("maxZoom");r||(r=[1,0,0,0,1,0,0,0,1]),e?($.translate(r,r,[-e.x,-e.y]),$.scale(r,r,[t,t]),$.translate(r,r,[e.x,e.y])):$.scale(r,r,[t,t]),i&&r[0]<i||o&&r[0]>o||(n.setMatrix(r),this.emit("viewportchange",{action:"zoom",matrix:r}),this.autoPaint())},e.prototype.zoomTo=function(t,e){var n=t/this.getZoom();this.zoom(n,e)},e.prototype.focusItem=function(t,e,n){var r=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};n?o=n:void 0===n&&(o=this.get("animateCfg")),r.focus(t,i,o),this.autoPaint()},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!1}],o.nodes=[{id:r,visible:!0}];break;case"edge":i.nodes=[{id:r,visible:!1}],o.edges=[{id:r,visible:!0}];break;case"combo":i.nodes=[{id:r,visible:!1}],o.combos=[{id:r,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!0}],o.nodes=[{id:r,visible:!1}];break;case"edge":i.nodes=[{id:r,visible:!0}],o.edges=[{id:r,visible:!1}];break;case"combo":i.nodes=[{id:r,visible:!0}],o.combos=[{id:r,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var n=t;if(Object(l.w)(t)&&(n=this.findById(t)),!n&&Object(l.w)(t))console.warn("The item to be removed does not exist!");else if(n){var r="";if(n.getType&&(r=n.getType()),e&&this.get("enabledStack")){var i=Object(p.a)(Object(p.a)({},n.getModel()),{itemType:r}),o={};switch(r){case"node":o.nodes=[i],o.edges=[];for(var a=n.getEdges(),s=a.length-1;s>=0;s--)o.edges.push(Object(p.a)(Object(p.a)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if(this.get("itemController").removeItem(t),"combo"===r){var u=Xe(this.get("comboTrees"));this.set("comboTrees",u)}}},e.prototype.addItem=function(t,e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!r);var o=this.get("itemController");if(!e.id||!this.findById(e.id)){var a,s=this.get("comboTrees");if(s||(s=[]),"combo"===t){var u=this.get("itemMap"),c=!1;if(s.forEach((function(n){c||Fe(n,(function(n){if(e.parentId===n.id){c=!0;var r=Object(p.a)({id:e.id,depth:n.depth+2},e);n.children?n.children.push(r):n.children=[r],e.depth=r.depth,a=o.addItem(t,e)}var i=u[n.id];return c&&i&&i.getType&&"combo"===i.getType()&&o.updateCombo(i,n.children),!0}))})),!c){var f=Object(p.a)({id:e.id,depth:0},e);e.depth=f.depth,s.push(f),a=o.addItem(t,e)}this.set("comboTrees",s)}else if("node"===t&&Object(l.w)(e.comboId)&&s){var h;if((h=this.findById(e.comboId))&&h.getType&&"combo"!==h.getType())return void console.warn("'"+e.comboId+"' is a not id of a combo in the graph, the node will be added without combo.");a=o.addItem(t,e);var d=this.get("itemMap"),g=!1,v=!1;(s||[]).forEach((function(t){v||g||Fe(t,(function(t){if(t.id===e.id)return v=!0,!1;if(e.comboId===t.id&&!v){g=!0;var n=Object(l.c)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],e.depth=t.depth+1}return g&&d[t.id].getType&&"combo"===d[t.id].getType()&&o.updateCombo(d[t.id],t.children),!0}))}))}else a=o.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(h=this.findById(e.comboId||e.parentId))&&h.addChild(a);var m=this.get("combos");if(m&&m.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var y=Object(p.a)(Object(p.a)({},a.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[y];break;case"edge":b.edges=[y];break;case"combo":b.combos=[y]}this.pushStack("add",{before:{},after:b})}return a}console.warn("This item exists already. Be sure the id %c"+e.id+"%c is unique.","font-size: 20px; color: red;","")},e.prototype.add=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),this.addItem(t,e,n,r)},e.prototype.updateItem=function(t,e,n){var r=this;void 0===n&&(n=!0);var i,o=this.get("itemController");i=Object(l.w)(t)?this.findById(t):t;var a=Object(l.c)(i.getModel()),s="";i.getType&&(s=i.getType());var u=Object(p.f)(i.getStates());if("combo"===s&&Object(l.f)(u,(function(t){return r.setItemState(i,t,!1)})),o.updateItem(i,e),"combo"===s&&Object(l.f)(u,(function(t){return r.setItemState(i,t,!0)})),n&&this.get("enabledStack")){var c={nodes:[],edges:[],combos:[]},f={nodes:[],edges:[],combos:[]},h=Object(p.a)({id:a.id},e);switch(s){case"node":c.nodes.push(a),f.nodes.push(h);break;case"edge":c.edges.push(a),f.edges.push(h);break;case"combo":c.combos.push(a),f.combos.push(h)}"node"===s&&c.nodes.push(a),this.pushStack("update",{before:c,after:f})}},e.prototype.update=function(t,e,n){void 0===n&&(n=!0),this.updateItem(t,e,n)},e.prototype.setItemState=function(t,e,n){Object(l.w)(t)&&(t=this.findById(t)),this.get("itemController").setItemState(t,e,n);var r=this.get("stateController");Object(l.w)(n)?r.updateState(t,e+":"+n,!0):r.updateState(t,e,n)},e.prototype.priorityState=function(t,e){this.get("itemController").priorityState(t,e)},e.prototype.data=function(t){this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var e=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!e)throw new Error("data must be defined first");var n=e.nodes,r=void 0===n?[]:n,i=e.edges,o=void 0===i?[]:i,a=e.combos,s=void 0===a?[]:a;if(this.clear(),this.emit("beforerender"),Object(l.f)(r,(function(e){t.add("node",e,!1,!1)})),s&&0!==s.length){var u=Ve(s,r);this.set("comboTrees",u),t.addCombos(s)}Object(l.f)(o,(function(e){t.add("edge",e,!1,!1)}));var c=t.get("animate");function f(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter(),t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",c)}((t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1),t.get("layoutController").layout(f)||f(),this.get("groupByTypes"))||(s&&0!==s.length?this.sortCombos():e.nodes&&e.edges&&e.nodes.length<e.edges.length?this.getNodes().forEach((function(t){t.toFront()})):this.getEdges().forEach((function(t){t.toBack()})));this.get("enabledStack")&&this.pushStack("render")},e.prototype.read=function(t){this.data(t),this.render()},e.prototype.diffItems=function(t,e,n){var r,i=this,o=this.get("itemMap");Object(l.f)(n,(function(n){if(r=o[n.id]){if(i.get("animate")&&"node"===t){var a=r.getContainer().getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]),r.set("originAttrs",{x:a[6],y:a[7]})}i.updateItem(r,n,!1)}else r=i.addItem(t,n,!1);e[t+"s"].push(r)}))},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var n=this;if(!t)return this;e&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.save(),after:t}),this.set("comboSorted",!1),this.getNodes().map((function(t){return n.clearItemStates(t)})),this.getEdges().map((function(t){return n.clearItemStates(t)}));var r=this.get("canvas"),i=r.get("localRefresh");r.set("localRefresh",!1),n.get("data")||(n.data(t),n.render());var o=this.get("itemMap"),a={nodes:[],edges:[]},s=t.combos;if(s){var u=Ve(s,t.nodes);this.set("comboTrees",u)}this.diffItems("node",a,t.nodes),Object(l.f)(o,(function(t,e){o[e].getModel().depth=0,t.getType&&"edge"===t.getType()||(t.getType&&"combo"===t.getType()?(delete o[e],t.destroy()):a.nodes.indexOf(t)<0&&(delete o[e],n.remove(t,!1)))}));for(var c=this.getCombos(),f=c.length-1;f>=0;f--)c[f].destroyed&&c.splice(f,1);s&&(n.addCombos(s),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",a,t.edges),Object(l.f)(o,(function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&a.edges.indexOf(t)<0&&(delete o[e],n.remove(t,!1))})),this.set({nodes:a.nodes,edges:a.edges});var h=this.get("layoutController");return h.changeData(),n.get("animate")&&!h.getLayoutType()?n.positionsAnimate():n.autoPaint(),setTimeout((function(){r.set("localRefresh",i)}),16),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e){var n=this;this.set("comboSorted",!1);var r,i="";if(t){if(Object(l.w)(t))i=t,r={id:t};else{if(!(i=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");r=t}var o=e.map((function(t){var e=n.findById(t),r="";e.getType&&(r=e.getType());var o={id:e.getID(),itemType:r};return"combo"===r?o.parentId=i:"node"===r&&(o.comboId=i),o}));r.children=o,this.addItem("combo",r,!1),this.set("comboSorted",!1);var a=this.get("comboTrees");(a||[]).forEach((function(t){Fe(t,(function(t){return t.id!==i||(t.itemType="combo",t.children=o,!1)}))})),a&&this.sortCombos()}},e.prototype.uncombo=function(t){var e,n=this,r=t;if(Object(l.w)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item is not a combo!");else{var i=r.getModel().parentId,o=this.get("comboTrees");o||(o=[]);var a,s=this.get("itemMap"),u=r.get("id"),c=[],f=this.get("combos"),h=this.findById(i);if(o.forEach((function(e){a||Fe(e,(function(e){var o;if(e.id===u){a=e,r.getEdges().forEach((function(t){n.removeItem(t,!1)}));var l=f.indexOf(t);f.splice(l,1),delete s[u],r.destroy()}return!i||!a||e.id!==i||(h.removeCombo(r),-1!==(l=(c=e.children).indexOf(a))&&c.splice(l,1),null===(o=a.children)||void 0===o||o.forEach((function(t){var e=n.findById(t.id),r=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=i,delete t.comboId,r.parentId=i,delete r.comboId):e.getType&&"node"===e.getType()&&(t.comboId=i,r.comboId=i),h.addChild(e),c.push(t)})),!1)}))})),!i&&a){var d=o.indexOf(a);o.splice(d,1),null===(e=a.children)||void 0===e||e.forEach((function(t){t.parentId=void 0,n.findById(t.id).getModel().parentId=void 0,"node"!==t.itemType&&o.push(t)}))}}},e.prototype.updateCombos=function(){var t=this,e=this.get("comboTrees"),n=this.get("itemController"),r=this.get("itemMap");(e||[]).forEach((function(e){Fe(e,(function(e){if(!e)return!0;var i=r[e.id];if(i&&i.getType&&"combo"===i.getType()){var o=Object(p.f)(i.getStates());Object(l.f)(o,(function(e){return t.setItemState(i,e,!1)})),n.updateCombo(i,e.children),Object(l.f)(o,(function(e){return t.setItemState(i,e,!0)}))}return!0}))})),this.sortCombos()},e.prototype.updateCombo=function(t){var e,n=this,r=t;if(Object(l.w)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item to be updated is not a combo!");else{e=r.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach((function(t){Fe(t,(function(t){if(!t)return!0;var r=a[t.id];if(e===t.id&&r&&r.getType&&"combo"===r.getType()){var i=Object(p.f)(r.getStates());Object(l.f)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),Object(l.f)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!0)})),e&&(e=t.parentId)}return!0}))}))}},e.prototype.updateComboTree=function(t,e,n){void 0===n&&(n=!0);var r;this.set("comboSorted",!1);var i,o=(r=Object(l.w)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var u,c=this.get("comboTrees"),f=!0;if((c||[]).forEach((function(t){u||Ge(t,(function(t){if(!u)return t.id===r.getID()&&(u=t),!0}))})),Ge(u,(function(t){return t.id!==e||(f=!1,!1)})),!f)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(n&&this.get("enabledStack")){var h={},d={};"combo"===s?(h.combos=[{id:o.id,parentId:o.parentId}],d.combos=[{id:o.id,parentId:e}]):"node"===s&&(h.nodes=[{id:o.id,parentId:o.comboId}],d.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:h,after:d})}if(o.parentId||o.comboId){var p=this.findById(o.parentId||o.comboId);p&&p.removeChild(r)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(r));a&&((i=this.findById(a))&&i.removeChild(r));var g=Xe(this.get("comboTrees"),o.id,e);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return Object(l.f)(this.get("nodes"),(function(e){t.push(e.getModel())})),Object(l.f)(this.get("edges"),(function(t){e.push(t.getModel())})),Object(l.f)(this.get("combos"),(function(t){n.push(t.getModel())})),{nodes:t,edges:e,combos:n}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),n=this.get("edges");Object(l.f)(t,(function(t){t.refresh()})),Object(l.f)(e,(function(t){t.refresh()})),Object(l.f)(n,(function(t){t.refresh()}))}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(Object(l.w)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var e=t.get("animateCfg"),n=e.onFrame,r=t.getNodes(),i=r.map((function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}}));t.isAnimating()&&t.stopAnimate(),t.get("canvas").animate((function(e){Object(l.f)(i,(function(r){var i=t.findById(r.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model");if(!o){var s=i.getContainer().getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),o={x:s[6],y:s[7]},i.set("originAttrs",o)}if(n){var u=n(i,e,r,o);i.set("model",Object.assign(a,u))}else a.x=o.x+(r.x-o.x)*e,a.y=o.y+(r.y-o.y)*e}})),t.refreshPositions()}),{duration:e.duration,easing:e.easing,callback:function(){Object(l.f)(r,(function(t){t.set("originAttrs",null)})),e.callback&&e.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){this.emit("beforegraphrefreshposition");var t,e=this.get("nodes"),n=this.get("edges"),r=this.get("vedges"),i=this.get("combos"),o={};Object(l.f)(e,(function(e){t=e.getModel();var n=e.get("originAttrs");n&&t.x===n.x&&t.y===n.y||(e.updatePosition({x:t.x,y:t.y}),o[t.id]=!0,t.comboId&&(o[t.comboId]=!0))})),i&&0!==i.length&&this.updateCombos(),Object(l.f)(n,(function(t){var e=t.getSource().getModel(),n=t.getTarget().getModel();(o[e.id]||o[n.id]||t.getModel().isComboEdge)&&t.refresh()})),Object(l.f)(r,(function(t){t.refresh()})),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(){return this.get("canvas").clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),this.emit("afterrender"),this},e.prototype.toDataURL=function(t,e){var n=this.get("canvas"),r=n.getRenderer(),i=n.get("el");t||(t="image/png");var o="";if("svg"===r){var a=i.cloneNode(!0),s=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),u=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",s);u.replaceChild(a,u.documentElement);var c=(new XMLSerializer).serializeToString(u);o="data:image/svg+xml;charset=utf8,"+encodeURIComponent(c)}else{var f=void 0,l=i.getContext("2d"),h=this.get("width"),d=this.get("height"),p=void 0;if(e){var g="undefined"!=typeof window?window.devicePixelRatio:1;f=l.getImageData(0,0,h*g,d*g),p=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=e,l.fillRect(0,0,h,d)}o=i.toDataURL(t),e&&(l.clearRect(0,0,h,d),l.putImageData(f,0,0),l.globalCompositeOperation=p)}return o},e.prototype.toFullDataURL=function(t,e,n){var r=this.get("group").getCanvasBBox(),i=r.height,o=r.width,a=this.get("renderer"),s=ct('<id="virtual-image"></div>'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?Object(l.t)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var f=i+c[0]+c[2],h=o+c[1]+c[3],d={container:s,height:f,width:h,quickHit:!0},p="svg"===a?new Se.Canvas(d):new Ee.Canvas(d),g=this.get("group").clone(),v=Object(l.c)(g.getMatrix());v||(v=[1,0,0,0,1,0,0,0,1]);var m=(r.maxX+r.minX)/2,y=(r.maxY+r.minY)/2;$.translate(v,v,[-m,-y]),$.translate(v,v,[o/2+c[3],i/2+c[0]]),g.resetMatrix(),g.setMatrix(v),p.add(g);var b=p.get("el"),x="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=b.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);x="data:image/svg+xml;charset=utf8,"+encodeURIComponent(o)}else{var s=void 0,c=b.getContext("2d"),l=void 0;if(u){var d="undefined"!=typeof window?window.devicePixelRatio:1;s=c.getImageData(0,0,h*d,f*d),l=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,h,f)}x=b.toDataURL(e),u&&(c.clearRect(0,0,h,f),c.putImageData(s,0,0),c.globalCompositeOperation=l)}null==t||t(x)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=ct('<id="virtual-image"></div>'),c=n?n.backgroundColor:void 0,f=n?n.padding:void 0;f?Object(l.t)(f)&&(f=[f,f,f,f]):f=[0,0,0,0];var h=o+f[0]+f[2],d=a+f[1]+f[3],p={container:u,height:h,width:d},g="svg"===s?new Se.Canvas(p):new Ee.Canvas(p),v=this.get("group").clone(),m=Object(l.c)(v.getMatrix());m||(m=[1,0,0,0,1,0,0,0,1]);var y=(i.maxX+i.minX)/2,b=(i.maxY+i.minY)/2;$.translate(m,m,[-y,-b]),$.translate(m,m,[a/2+f[3],o/2+f[0]]),v.resetMatrix(),v.setMatrix(m),g.add(v);var x=g.get("el");e||(e="image/png"),setTimeout((function(){var n="";if("svg"===s){var i=x.cloneNode(!0),o=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),a=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",o);a.replaceChild(i,a.documentElement);var u=(new XMLSerializer).serializeToString(a);n="data:image/svg+xml;charset=utf8,"+encodeURIComponent(u)}else{var f=void 0,l=x.getContext("2d"),p=void 0;if(c){var g="undefined"!=typeof window?window.devicePixelRatio:1;f=l.getImageData(0,0,d*g,h*g),p=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=c,l.fillRect(0,0,d,h)}n=x.toDataURL(e),c&&(l.clearRect(0,0,d,h),l.putImageData(f,0,0),l.globalCompositeOperation=p)}var v=document.createElement("a"),m=(t||"graph")+("svg"===s?".svg":"."+e.split("/")[1]);r.dataURLToImage(n,s,v,m);var y=document.createEvent("MouseEvents");y.initEvent("click",!1,!1),v.dispatchEvent(y)}),16)},e.prototype.downloadImage=function(t,e,n){var r=this,i=this;i.isAnimating()&&i.stopAnimate();var o=i.get("canvas").getRenderer();e||(e="image/png");var a=(t||"graph")+("svg"===o?".svg":e.split("/")[1]),s=document.createElement("a");setTimeout((function(){var t=i.toDataURL(e,n);r.dataURLToImage(t,o,s,a);var u=document.createEvent("MouseEvents");u.initEvent("click",!1,!1),s.dispatchEvent(u)}),16)},e.prototype.dataURLToImage=function(t,e,n,r){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var f=new Blob([c],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(f,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(f)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))},e.prototype.updateLayout=function(t){var e,n=this.get("layoutController");Object(l.w)(t)?t={type:e=t}:e=t.type;var r=this.get("layout"),i=r?r.type:void 0;if(e&&i!==e||void 0!==t.gpuEnabled&&t.gpuEnabled!==r.gpuEnabled)e||(e=i),this.set("layout",t),n.changeLayout(e);else{var o={};Object.assign(o,r,t),o.type=i||"random",this.set("layout",o),n.updateLayoutCfg(o)}},e.prototype.destroyLayout=function(){this.get("layoutController").destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),e=this.get("layout");e&&(e.workerEnabled?t.layout():t.layoutMethod?t.relayout(!0):t.layout())},e.prototype.collapseCombo=function(t){var e=this;if(Object(l.w)(t)&&(t=this.findById(t)),t){var n=t.getModel();this.get("itemController").collapseCombo(t),n.collapsed=!0;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1,u={};(a||[]).forEach((function(t){u[t.id]=t})),(a||[]).forEach((function(t){s||Ge(t,(function(t){if(s&&u[t.id])return!1;if(n.parentId===t.id?(u={},t.children.forEach((function(t){u[t.id]=t}))):n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},f=[];r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget();if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||r.getModel().id===n.id){if((h=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var s=a.getModel();!a.isVisible();){if(!(a=e.findById(s.parentId||s.comboId))||!s.parentId&&!s.comboId)return;s=a.getModel()}var u=s.id;if(c[n.id+"-"+u])return void(c[n.id+"-"+u]+=h.size||1);var l=e.addItem("vedge",{source:n.id,target:u,isVEdge:!0},!1);c[n.id+"-"+u]=h.size||1,f.push(l)}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||a.getModel().id===n.id){var h;if((h=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var d=r.getModel();!r.isVisible();){if(!(r=e.findById(d.parentId||d.comboId))||!d.parentId&&!d.comboId)return;d=r.getModel()}var p=d.id;if(c[p+"-"+n.id])return void(c[p+"-"+n.id]+=h.size||1);l=e.addItem("vedge",{target:n.id,source:p,isVEdge:!0},!1);c[p+"-"+n.id]=h.size||1,f.push(l)}}})),f.forEach((function(t){var n=t.getModel();e.updateItem(t,{size:c[n.source+"-"+n.target]},!1)}))}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t){var e=this;if(Object(l.w)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{var n=t.getModel();this.get("itemController").expandCombo(t),n.collapsed=!1;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1,u={};(a||[]).forEach((function(t){u[t.id]=t})),(a||[]).forEach((function(t){s||Ge(t,(function(t){if(s&&u[t.id])return!1;if(n.parentId===t.id?(u={},t.children.forEach((function(t){u[t.id]=t}))):n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},f={};r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget(),s=r.get("id"),u=a.get("id");if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||s===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(var l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;l=a.getModel()}u=l.id;for(var h=r.getModel();!r.isVisible();){if(!(r=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;if(h.comboId===n.id||h.parentId===n.id)break;h=r.getModel()}if(s=h.id,u){if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(f[p],{size:c[p]},!1);var d=e.addItem("vedge",{source:s,target:u,isVEdge:!0},!1);c[p]=t.getModel().size||1,f[p]=d}}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||u===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(h=r.getModel();!r.isVisible();){if(!(r=e.findById(h.comboId||h.parentId))||!h.parentId&&!h.comboId)return;h=r.getModel()}s=h.id;for(l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;if(l.comboId===n.id||l.parentId===n.id)break;l=a.getModel()}if(u=l.id,s){var p;if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(f[p],{size:c[p]},!1);d=e.addItem("vedge",{target:u,source:s,isVEdge:!0},!1);c[p]=t.getModel().size||1,f[p]=d}}else(i.includes(r)||o.includes(r))&&(i.includes(a)||o.includes(a))&&r.isVisible()&&a.isVisible()&&t.show()}}))}},e.prototype.collapseExpandCombo=function(t){if(Object(l.w)(t)&&(t=this.findById(t)),!t.getType||"combo"===t.getType()){for(var e=t.getModel(),n=this.findById(e.parentId);n;){var r=n.getModel();if(r.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(r.parentId)}e.collapsed?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.sortCombos=function(){var t=this;if(!this.get("comboSorted")){this.set("comboSorted",!0);var e=[],n={};(this.get("comboTrees")||[]).forEach((function(t){Ge(t,(function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0}))})),(this.getEdges().concat(this.get("vedges"))||[]).forEach((function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]})),e.forEach((function(e){if(e&&e.length)for(var n=e.length-1;n>=0;n--){var r=t.findById(e[n]);null==r||r.toFront()}}))}},e.prototype.getNeighbors=function(t,e){var n=t;return Object(l.w)(t)&&(n=this.findById(t)),n.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e){void 0===e&&(e=void 0);var n=t;Object(l.w)(t)&&(n=this.findById(t));var r=this.get("degrees");r||(r=kh(this)),this.set("degees",r);var i,o=r[n.getID()];switch(e){case"in":i=o.inDegree;break;case"out":i=o.outDegree;break;case"all":i=o;break;default:i=o.degree}return i},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear())},e.prototype.pushStack=function(t,e,n){if(void 0===t&&(t="update"),void 0===n&&(n="undo"),this.get("enabledStack")){var r=e?Object(l.c)(e):{before:{},after:Object(l.c)(this.save())};"redo"===n?this.redoStack.push({action:t,data:r}):this.undoStack.push({action:t,data:r}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix");return n&&t||(n=Dh(this,e),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix"),r=this.get("shortestPathMatrix");return n&&t||(n=Dh(this,e),this.set("adjMatrix",n)),r&&t||(r=Nh(this,e),this.set("shortestPathMatrix",r)),r},e.prototype.on=function(e,n,r){return t.prototype.on.call(this,e,n,r)},e.prototype.destroy=function(){this.clear(),this.clearStack(),Object(l.f)(this.get("plugins"),(function(t){t.destroyPlugin()}));var t=this.get("tooltips");if(t)for(var e=0;e<t.length;e++){var n=t[e];if(n){var r=n.parentElement;r&&r.removeChild(n)}}this.get("eventController").destroy(),this.get("itemController").destroy(),this.get("modeController").destroy(),this.get("viewController").destroy(),this.get("stateController").destroy(),this.get("layoutController").destroy(),this.get("canvas").destroy(),this.get("graphWaterMarker")&&this.get("graphWaterMarker").destroy(),document.querySelector(".g6-graph-watermarker")&&document.querySelector(".g6-graph-watermarker").remove(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){var e=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),e||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),n[t.id])return console.warn("Existed hull id."),n[t.id];var r=e.addGroup({id:t.id+"-container"}),i=new Vh(this,Object(p.a)(Object(p.a)({},t),{group:r}));return n[i.id]=i,i},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e;e=Object(l.w)(t)?this.getHullById(t):t,delete this.get("hullMap")[e.id],e.destroy()},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=z.waterMarkerImage);var n=this.get("container");Object(l.w)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(l.e)({},z.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!r){var c={container:n,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f),r=new Ee.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var h=r.get("context"),d=u.rotate,p=u.x,g=u.y;h.rotate(-d*Math.PI/180);var v=new Image;v.crossOrigin="anonymous",v.src=t,v.onload=function(){if(h.drawImage(v,p,g,u.width,u.height),h.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",r.destroyed||(t.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;",n.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");Object(l.w)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(l.e)({},z.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!r){var c={container:n,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f),r=new Ee.Canvas(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var h=r.get("context"),d=u.rotate,p=u.fill,g=u.fontFamily,v=u.fontSize,m=u.baseline,y=u.x,b=u.y,x=u.lineHeight;h.rotate(-d*Math.PI/180),h.font=v+"px "+g,h.fillStyle=p,h.textBaseline=m;for(var w=t.length-1;w>=0;w--)h.fillText(t[w],y,b+w*x);if(h.rotate(d*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var _=document.querySelector(".g6-graph-watermarker");_||((_=document.createElement("div")).className="g6-graph-watermarker"),_.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;",n.appendChild(_)}},e}(_e.a),Yh=n(168),Hh=n.n(Yh),qh=function(t){function e(e){var n=t.call(this,e)||this;return n.layoutAnimating=!1,n.set("removeList",[]),n.set("layoutMethod",n.getLayout()),n}return Object(p.c)(e,t),e.prototype.getLayout=function(){var t=this.get("layout");return t?"function"==typeof t?t:(t.type||(t.type="dendrogram"),t.direction||(t.direction="TB"),t.radial?function(e){var n=Hh.a[t.type](e,t);return Ue(n),n}:function(e){return Hh.a[t.type](e,t)}):null},e.indexOfChild=function(t,e){var n=-1;return Object(l.f)(t,(function(t,r){if(e===t.id)return n=r,!1})),n},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.animate=!0,e},e.prototype.innerAddChild=function(t,e,n){var r=this,i=t.data;i&&(i.x=t.x,i.y=t.y,i.depth=t.depth);var o=r.addItem("node",i,!1);if(e){if(o.set("parent",e),n){var a=e.get("originAttrs");if(a)o.set("originAttrs",a);else{var s=e.getModel();o.set("originAttrs",{x:s.x,y:s.y})}}var u=e.get("children");u?u.push(o):e.set("children",[o]),r.addItem("edge",{source:e,target:o,id:e.get("id")+":"+o.get("id")},!1)}return Object(l.f)(t.children||[],(function(t){r.innerAddChild(t,o,n)})),r.emit("afteraddchild",{item:o,parent:e}),o},e.prototype.innerUpdateChild=function(t,n,r){var i=this,o=i.findById(t.id);if(o){Object(l.f)(t.children||[],(function(t){i.innerUpdateChild(t,o,r)}));var a,s,u=o.get("children");if(u)if(u.length>0)for(var c=u.length-1;c>=0;c--){var f=u[c].getModel();-1===e.indexOfChild(t.children||[],f.id)&&(i.innerRemoveChild(f.id,{x:t.x,y:t.y},r),u.splice(c,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var h=o.getModel();r&&o.set("originAttrs",{x:h.x,y:h.y}),o.set("model",t.data),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,n,r)},e.prototype.innerRemoveChild=function(t,e,n){var r=this,i=r.findById(t);if(i)if(Object(l.f)(i.get("children"),(function(t){r.innerRemoveChild(t.getModel().id,e,n)})),n){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),r.get("removeList").push(i)}else r.removeItem(i)},e.prototype.changeData=function(t){var e=this;this.getNodes().map((function(t){return e.clearItemStates(t)})),this.getEdges().map((function(t){return e.clearItemStates(t)})),t?(e.data(t),e.render()):e.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t){t?(this.set("layout",t),this.set("layoutMethod",this.getLayout()),this.layout()):console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this.get("data"),n=this.get("layoutMethod")(e,this.get("layout")),r=this.get("animate");(this.emit("beforerefreshlayout",{data:e,layoutData:n}),this.emit("beforelayout"),this.innerUpdateChild(n,void 0,r),t)&&this.get("viewController").fitView();r?this.layoutAnimate(n):(this.refresh(),this.paint()),this.emit("afterrefreshlayout",{data:e,layoutData:n}),this.emit("afterlayout")},e.prototype.addChild=function(t,e){this.emit("beforeaddchild",{model:t,parent:e}),Object(l.w)(e)||(e=e.get("id"));var n=this.findDataById(e);n&&(n.children||(n.children=[]),n.children.push(t),this.changeData())},e.prototype.updateChildren=function(t,e){e&&this.findById(e)?(this.findDataById(e).children=t,this.changeData()):console.warn("Update children failed! There is no node with id '"+e+"'")},e.prototype.updateChild=function(t,n){if(n&&this.findById(n)){var r=this.findDataById(n),i=this.findById(t.id);if(r.children||(r.children=[]),i){var o=e.indexOfChild(r.children,t.id);r.children[o]=t}else r.children.push(t);this.changeData()}else this.changeData(t)},e.prototype.removeChild=function(t){var n=this.findById(t);if(n){var r=n.get("parent");if(r&&!r.destroyed){var i=this.findDataById(r.get("id")),o=i&&i.children||[],a=n.getModel(),s=e.indexOfChild(o,a.id);o.splice(s,1)}this.changeData()}},e.prototype.findDataById=function(t,e){var n=this;if(e||(e=n.get("data")),t===e.id)return e;var r=null;return Object(l.f)(e.children||[],(function(e){return e.id===t?(r=e,!1):!(r=n.findDataById(t,e))&&void 0})),r},e.prototype.layoutAnimate=function(t,e){var n=this,r=this.get("animateCfg");n.emit("beforeanimate",{data:t}),n.getEdges().forEach((function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))})),this.get("canvas").animate((function(r){Ge(t,(function(i){var o=n.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,r,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*r,s.y=a.y+(i.y-a.y)*r}return!0})),Object(l.f)(n.get("removeList"),(function(t){var e=t.getModel(),n=t.get("originAttrs"),i=t.get("to");e.x=n.x+(i.x-n.x)*r,e.y=n.y+(i.y-n.y)*r})),n.refreshPositions()}),{duration:r.duration,easing:r.ease,callback:function(){Object(l.f)(n.getNodes(),(function(t){t.set("originAttrs",null)})),Object(l.f)(n.get("removeList"),(function(t){n.removeItem(t)})),n.set("removeList",[]),r.callback&&r.callback(),n.emit("afteranimate",{data:t})},delay:r.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(){if(!this.get("data"))throw new Error("data must be defined first");this.clear(),this.emit("beforerender"),this.layout(this.get("fitView")),this.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e}(Xh),Qh=["startArrow","endArrow"],Zh={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Kh={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:Zh,combo:Zh},$h={options:{},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t){return Object(l.e)({labelCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}},descriptionCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}}},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){var n=this.drawShape(t,e);(n.set("className",this.itemType+"-shape"),t.label)&&this.drawLabel(t,e).set("className",this.itemType+"-label");return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=this.getOptions(t).labelCfg||{},r=this.getLabelStyle(t,n,e),i=r.rotate;delete r.rotate;var o=e.addShape("text",{attrs:r,draggable:!0,className:"text-shape",name:"text-shape"});if(i){var a=o.getBBox(),s=o.getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),r.rotateCenter)switch(r.rotateCenter){case"center":s=at(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=at(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=at(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);break;default:s=at(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=at(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);o.setMatrix(s)}if(r.background){var u=this.drawLabelBg(t,e,o),c=this.itemType+"-label-bg";u.set("classname",c),o.toFront()}return o},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(l.z)({},r,t.labelCfg),o=this.getLabelBgStyleByPosition(n,t,i,e);return e.addShape("rect",{name:"text-bg-shape",attrs:o})},getLabelStyleByPosition:function(t,e,n){return{text:t.label}},getLabelBgStyleByPosition:function(t,e,n,r){return{}},getLabelStyle:function(t,e,n){var r=this.getLabelStyleByPosition(t,e,n),i=this.itemType+"Label",o=z[i]?z[i].style:null;return Object(p.a)(Object(p.a)(Object(p.a)({},o),r),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e){this.updateShapeStyle(t,e),this.updateLabel(t,e)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=e.getKeyShape(),i=Object(l.z)({},r.attr(),t.style),o=function(t){var e,o=i[t];if(Object(l.v)(o)){var a=n.find((function(e){return e.get("name")===t}));a&&a.attr(o)}else r.attr(((e={})[t]=o,e))};for(var a in i)o(a)},updateLabel:function(t,e){var n=e.getContainer(),r=this.getOptions({}).labelCfg,i=this.itemType+"-label",o=n.find((function(t){return t.get("className")===i})),a=this.itemType+"-label-bg",s=n.find((function(t){return t.get("classname")===a}));if(t.label||""===t.label)if(o){var u={};e.getModel&&(u=e.getModel().labelCfg);var c=Object(l.e)({},r,u,t.labelCfg),f=this.getLabelStyleByPosition(t,c,n),h=t.labelCfg?t.labelCfg.style:void 0,d=c.style&&c.style.background,g=Object(p.a)(Object(p.a)(Object(p.a)({},o.attr()),f),h),v=g.rotate;if(delete g.rotate,v){var m=[1,0,0,0,1,0,0,0,1];m=at(m,[["t",-g.x,-g.y],["r",v],["t",g.x,g.y]]),o.resetMatrix(),o.attr(Object(p.a)(Object(p.a)({},g),{matrix:m}))}else o.resetMatrix(),o.attr(g);if(s)if(g.background){var y=this.getLabelBgStyleByPosition(o,t,c,n),b=Object(p.a)(Object(p.a)({},y),d);s.resetMatrix(),v&&s.rotateAtStart(v),s.attr(b)}else n.removeChild(s);else g.background&&((s=this.drawLabelBg(t,n,o)).set("classname",a),o.toFront())}else{this.drawLabel(t,n).set("className",i)}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o=n.get("keyShape");if(o){var a=n.getType(),s=Object(l.n)(e)?t:t+":"+e,u=this.getStateStyle(s,n),c=n.getStateStyle(s);if(c||u){var f=Object(l.z)({},c||u),h=n.getContainer(),d={x:1,y:1,cx:1,cy:1};if(e){var p=function(t){var e,n=f[t];if(Object(l.v)(n)&&!Qh.includes(t)){var r=h.find((function(e){return e.get("name")===t}));r&&r.attr(n)}else o.attr(((e={})[t]=n,e))};for(var g in f)p(g)}else{var v=Object(l.c)(n.getCurrentStatesStyle()),m=n.getModel(),y=(n.getOriginStyle(),Object(l.z)({},m.style,Object(l.c)(n.getOriginStyle()))),b=o.get("name"),x=Object(l.c)(o.attr()),w={},_=function(t){var e=f[t];if(Object(l.v)(e)&&!Qh.includes(t)){var n=h.find((function(e){return e.get("name")===t}));if(n){var r=Object(l.c)(n.attr());Object(l.f)(e,(function(e,i){if(t===b&&x[i]&&!d[i]){delete x[i];var s=y[t][i]||Kh[a][i];o.attr(i,s)}else if(r[i]||0===r[i]){delete r[i];var u=y[t][i]||Kh[a][i];n.attr(i,u)}})),w[t]=r}}else if(x[t]&&!d[t]){delete x[t];var i=y[t]||(y[b]?y[b][t]:void 0)||Kh[a][t];o.attr(t,i)}};for(var E in f)_(E);for(var g in b?w[b]=x:Object(l.z)(w,x),v)if(!d[g]){var S=v[g];Object(l.v)(S)&&!Qh.includes(g)||(b?(Object(l.z)(y[b],((i={})[g]=S,i)),delete y[g]):Object(l.z)(y,((r={})[g]=S,r)),delete v[g])}var M={};Object(l.e)(M,y,w,v);var O=!1,A=function(t){var e,n,r=M[t];if(Object(l.v)(r)&&!Qh.includes(t)){var i=h.find((function(e){return e.get("name")===t}));i&&(i.attr(r),t===b&&(O=!0))}else if(!O){var s=r||Kh[a][t];"combo"===a?b||o.attr(((e={})[t]=s,e)):o.attr(((n={})[t]=s,n))}};for(var k in M)A(k)}}}},getStateStyle:function(t,e){var n=e.getModel(),r=e.getType(),i=this.getOptions(n),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,u=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?Object(l.c)(u):Object(l.z)({},s,u)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){return this.getOptions(t).anchorPoints}},Jh={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:z.nodeLabel.offset,getSize:function(t){var e=t.size||this.getOptions({}).size||z.defaultNode.size;return Object(l.m)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(l.m)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition;if("center"===n)return{x:0,y:0,text:t.label};var r=e.offset;Object(l.s)(r)&&(r=this.offset);var i,o=this.getSize(t),a=o[0],s=o[1];switch(n){case"top":i={x:0,y:0-s/2-r,textBaseline:"bottom"};break;case"bottom":i={x:0,y:s/2+r,textBaseline:"top"};break;case"left":i={x:0-a/2-r,y:0,textAlign:"right"};break;default:i={x:a/2+r,y:0,textAlign:"left"}}return i.text=t.label,i},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=v(o.padding),u=i.width+s[1]+s[3],c=i.height+s[0]+s[2],f=n.offset;return Object(l.s)(f)&&(f=this.offset),a={x:i.minX-s[3],y:i.minY-s[0]},a=Object(p.a)(Object(p.a)(Object(p.a)({},a),o),{width:u,height:c})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"})},updateLinkPoints:function(t,e){var n,r=this.getOptions(t).linkPoints,i=e.find((function(t){return"link-point-left"===t.get("className")})),o=e.find((function(t){return"link-point-right"===t.get("className")})),a=e.find((function(t){return"link-point-top"===t.get("className")})),s=e.find((function(t){return"link-point-bottom"===t.get("className")}));i&&(n=i.attr()),o&&!n&&(n=o.attr()),a&&!n&&(n=a.attr()),s&&!n&&(n=s.attr()),n||(n=r);var u=Object(l.z)({},n,t.linkPoints),c=u.fill,f=u.stroke,h=u.lineWidth,d=u.size/2;d||(d=u.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=g.left,m=g.right,y=g.top,b=g.bottom,x=this.getSize(t),w=x[0],_=x[1],E={r:d,fill:c,stroke:f,lineWidth:h};i?v||void 0===v?i.attr(Object(p.a)(Object(p.a)({},E),{x:-w/2,y:0})):i.remove():v&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},E),{x:-w/2,y:0}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),o?(m||void 0===m||o.remove(),o.attr(Object(p.a)(Object(p.a)({},E),{x:w/2,y:0}))):m&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},E),{x:w/2,y:0}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a?(y||void 0===y||a.remove(),a.attr(Object(p.a)(Object(p.a)({},E),{x:0,y:-_/2}))):y&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},E),{x:0,y:-_/2}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s?b||void 0===b?s.attr(Object(p.a)(Object(p.a)({},E),{x:0,y:_/2})):s.remove():b&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},E),{x:0,y:_/2}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},updateShape:function(t,e,n,r){e.get("keyShape").attr(Object(p.a)({},n)),this.updateLabel(t,e),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=this.getOptions(t).icon,o=(t.icon?t.icon:{show:void 0}).show,a=r.find((function(t){return t.get("className")===n.type+"-icon"}));if(a)if(o||void 0===o){var s=Object(l.z)({},a.attr(),i),u=s.width,c=s.height;a.attr(Object(p.a)(Object(p.a)({},s),{x:-u/2,y:-c/2}))}else a.remove();else if(o){u=i.width,c=i.height;r.addShape("image",{attrs:Object(p.a)(Object(p.a)({},i),{x:-u/2,y:-c/2}),className:this.type+"-icon",name:this.type+"-icon"});var f=r.find((function(t){return"node-label"===t.get("className")}));f&&f.toFront()}}},td=Object(p.a)(Object(p.a)({},$h),Jh);nn.registerNode("single-node",td);var ed={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:z.defaultEdge.size,style:{x:0,y:0,stroke:z.defaultEdge.style.stroke,lineAppendWidth:z.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:z.edgeLabel.style.fill,fontSize:z.edgeLabel.style.fontSize}},stateStyles:Object(p.a)({},z.edgeStateStyles)},getPath:function(t){var e=[];return Object(l.f)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(l.z)({},e,n,t.style),i=t.size||z.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),u=[o];s&&(u=u.concat(s)),u.push(a);var c=this.getPath(u);return Object(l.z)({},z.defaultEdge.style,{stroke:z.defaultEdge.color,lineWidth:i,path:c},r)},updateShapeStyle:function(t,e){var n=e.getContainer(),r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[a];u&&(c=c.concat(u)),c.push(s);var f=i.attr(),h=Object(l.z)({},r,f,t.style),d=t.sourceNode,p=t.targetNode,g={radius:h.radius};u||(g={source:d,target:p,offset:h.offset,radius:h.radius}),f.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),f.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""});var v=this.getPath(c,g),m=Object(l.z)(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(m)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=n&&n.find((function(t){return"edge-shape"===t.get("className")}));r="start"===i?0:"end"===i?1:.5;var s=e.refX||this.refX,u=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+s,o.y=t.startPoint.y+u,o.text=t.label,o;var c=Object(l.s)(e.autoRotate)?this.labelAutoRotate:e.autoRotate,f=je(a,r,s,u,c);return o.x=f.x,o.y=f.y,o.rotate=f.rotate,o.textAlign=this._getTextAlign(i,f.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=o.padding,u=i.width+s[1]+s[3],c=i.height+s[0]+s[2],f=n.position||this.labelPosition,h=Object(p.a)(Object(p.a)({},o),{width:u,height:c,x:i.minX-s[2],y:i.minY-s[0],rotate:0}),d=Object(l.s)(n.autoRotate)?this.labelAutoRotate:n.autoRotate,g=r&&r.find((function(t){return"edge-shape"===t.get("className")}));a="start"===f?0:"end"===f?1:.5;var v=n.refX||this.refX,m=n.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return h.x=e.startPoint.x+v,h.y=e.startPoint.y+m,h;var y=je(g,a,v-u/2,m+c/2,d),b=y.angle;return b>.5*Math.PI&&b<1.5*Math.PI&&(y=je(g,a,v+u/2,m+c/2,d)),d&&(h.x=y.x,h.y=y.y),h.rotate=y.rotate,h},_getTextAlign:function(t,e){var n="center";return e?(e%=2*Math.PI,"center"!==t&&(n=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),n):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},drawLabel:function(t,e){var n=this.options.labelCfg,r=Object(l.e)({fontFamily:"undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},n,t.labelCfg),i=this.getLabelStyle(t,r,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape"});if(o&&a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a),u=this.itemType+"-label-bg";s.set("classname",u),a.toFront()}return a},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(l.e)({},r,t.labelCfg),o=this.getLabelStyle(t,i,e).rotate,a=this.getLabelBgStyleByPosition(n,t,i,e);delete a.rotate;var s=e.addShape("rect",{name:"text-bg-shape",attrs:a});return o&&s.rotateAtStart(o),s}},nd=Object(p.a)(Object(p.a)({},$h),ed);nn.registerEdge("single-edge",nd),nn.registerEdge("line",{getControlPoints:function(){}},"single-edge"),nn.registerEdge("spline",{getPath:function(t){return ae(t)}},"single-edge"),nn.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,n,r=t.startPoint,i=t.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2;if(void 0!==t.controlPoints){if(n=t.controlPoints[0],e=kt(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.y<i.y?this.clockwise=e.x>n.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y<n.y?0:1:this.clockwise=e.y<n.y?1:0,(n.x-r.x)/(n.y-r.y)==(i.x-r.x)/(i.y-r.y))return[]}else{void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),Object(l.m)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),t.curveOffset<0?this.clockwise=0:this.clockwise=1;var s={x:i.x-r.x,y:i.y-r.y},u=Math.atan2(s.y,s.x);n={x:t.curveOffset*Math.cos(-Math.PI/2+u)+o,y:t.curveOffset*Math.sin(-Math.PI/2+u)+a},e=kt(r,n,i)}var c=Tt(r,e);return[{x:c,y:c}]},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),2===t.length?e.push(["L",t[1].x,t[1].y]):e.push(["A",t[1].x,t[1].y,0,0,this.clockwise,t[2].x,t[2].y]),e}},"single-edge"),nn.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(t){var e=t.controlPoints;if(!e||!e.length){var n=t.startPoint,r=t.endPoint;void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(l.m)(this.curveOffset)&&(t.curveOffset=t.curveOffset[0]),Object(l.m)(this.curvePosition)&&(t.curvePosition=t.curveOffset[0]),e=[se(n,r,t.curvePosition,t.curveOffset)]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["Q",t[1].x,t[1].y,t[2].x,t[2].y]),e}},"single-edge"),nn.registerEdge("cubic",{curvePosition:[.5,.5],curveOffset:[-20,20],getControlPoints:function(t){var e=t.controlPoints;if(void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(l.t)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(l.t)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]),!e||!e.length||e.length<2){var n=t.startPoint,r=t.endPoint;e=[se(n,r,t.curvePosition[0],t.curveOffset[0]),se(n,r,t.curvePosition[1],t.curveOffset[1])]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y]),e}},"single-edge"),nn.registerEdge("cubic-vertical",{curvePosition:[.5,.5],getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;return void 0!==t.curvePosition&&(this.curvePosition=t.curvePosition),Object(l.t)(this.curvePosition)&&(this.curvePosition=[this.curvePosition,1-this.curvePosition]),[{x:e.x,y:(n.y-e.y)*this.curvePosition[0]+e.y},{x:n.x,y:(n.y-e.y)*this.curvePosition[1]+e.y}]}},"cubic"),nn.registerEdge("cubic-horizontal",{curvePosition:[.5,.5],getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;return void 0!==t.curvePosition&&(this.curvePosition=t.curvePosition),Object(l.t)(this.curvePosition)&&(this.curvePosition=[this.curvePosition,1-this.curvePosition]),[{x:(n.x-e.x)*this.curvePosition[0]+e.x,y:e.y},{x:(n.x-e.x)*this.curvePosition[1]+e.x,y:n.y}]}},"cubic"),nn.registerEdge("loop",{getPathPoints:function(t){return Re(t)},getControlPoints:function(t){return t.controlPoints},afterDraw:function(t){t.controlPoints=void 0},afterUpdate:function(t){t.controlPoints=void 0}},"cubic");var rd={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:z.comboLabel.refX,refY:z.comboLabel.refY,options:{style:{stroke:z.defaultCombo.style.stroke,fill:z.defaultCombo.style.fill,lineWidth:z.defaultCombo.style.lineWidth},labelCfg:{style:{fill:z.comboLabel.style.fill,fontSize:z.comboLabel.style.fontSize}},stateStyles:Object(p.a)({},z.comboStateStyles)},getSize:function(t){var e=Object(l.c)(t.size||this.options.size||z.defaultCombo.size);return Object(l.m)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(l.m)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(l.m)(i)&&(i=i[0]);var o=e.refX,a=e.refY;Object(l.s)(o)&&(o=this.refX),Object(l.s)(a)&&(a=this.refY);var s,u=this.getSize(t),c=(Math.max(r.r,u[0]/2)||u[0]/2)+i;switch(n){case"top":s={x:0,y:-c-a,textBaseline:"bottom",textAlign:"center"};break;case"bottom":s={x:0,y:c+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:-c+o,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:c+o,y:0,textAlign:"right"}}return s.text=t.label,s},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"combo-shape"})},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(p.a)({},n)),this.updateLabel(t,e)}},id=Object(p.a)(Object(p.a)({},$h),rd);nn.registerCombo("single-combo",id),nn.registerCombo("circle",{options:{size:[z.defaultCombo.size[0],z.defaultCombo.size[0]],padding:z.defaultCombo.padding[0],animate:!0,style:{stroke:z.defaultCombo.style.stroke,fill:z.defaultCombo.style.fill,lineWidth:z.defaultCombo.style.lineWidth},labelCfg:{style:{fill:z.comboLabel.style.fill,fontSize:z.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:Object(p.a)({},z.comboStateStyles)},shapeType:"circle",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return delete n.height,delete n.width,e.addShape("circle",{attrs:n,className:"circle-combo",name:"circle-combo",draggable:!0})},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(l.m)(n)&&(n=n[0]);var r,i={stroke:t.color},o=Object(l.z)({},e,i,t.style),a=this.getSize(t);r=!Object(l.t)(o.r)||isNaN(o.r)?a[0]/2||z.defaultCombo.style.r:Math.max(o.r,a[0]/2)||a[0]/2,o.r=r+n;var s=Object(p.a)({x:0,y:0},o);return t.style?t.style.r=r:t.style={r:r},s},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(l.m)(r)&&(r=r[0]);var i=Object(l.c)(t.style),o=Math.max(i.r,n[0]/2)||n[0]/2;i.r=o+r;var a=e.get("sizeCache");a&&(a.r=i.r);var s={stroke:t.color},u=e.get("keyShape"),c=Object(l.z)({},u.attr(),s,i);t.style?t.style.r=o:t.style={r:o},this.updateShape(t,e,c,!0)}},"single-combo"),nn.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:z.defaultCombo.style.stroke,fill:z.defaultCombo.style.fill,lineWidth:z.defaultCombo.style.lineWidth},labelCfg:{style:{fill:z.comboLabel.style.fill,fontSize:z.comboLabel.style.fontSize}},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(p.a)({},z.comboStateStyles)},shapeType:"rect",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("rect",{attrs:n,className:"rect-combo",name:"rect-combo",draggable:!0})},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(l.t)(i)&&(i=[i,i,i,i]);var o=e.refX,a=e.refY;Object(l.s)(o)&&(o=this.refX),Object(l.s)(a)&&(a=this.refY);var s,u=r.width/2+i[3],c=r.height/2+i[0];switch(n){case"top":s={x:0-u+o,y:0-c+a,textBaseline:"top",textAlign:"left"};break;case"bottom":s={x:0,y:c+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:0-u+a,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:u+o,y:0,textAlign:"right"}}return s.text=t.label,s},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(l.t)(n)&&(n=[n,n,n,n]);var r,i,o={stroke:t.color},a=Object(l.z)({},e,o,t.style),s=this.getSize(t);r=!Object(l.t)(a.width)||isNaN(a.width)?s[0]||z.defaultCombo.style.width:Math.max(a.width,s[0])||s[0],i=!Object(l.t)(a.height)||isNaN(a.height)?s[1]||z.defaultCombo.style.height:Math.max(a.height,s[1])||s[1];var u=-r/2-n[3],c=-i/2-n[0];a.width=r+n[1]+n[3],a.height=i+n[0]+n[2];var f=Object(p.a)({x:u,y:c},a);return t.style?(t.style.width=r,t.style.height=i):t.style={width:r,height:i},f},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(l.t)(r)&&(r=[r,r,r,r]);var i=Object(l.c)(t.style),o=Math.max(i.width,n[0])||n[0],a=Math.max(i.height,n[1])||n[1];i.width=o+r[1]+r[3],i.height=a+r[0]+r[2];var s=e.get("sizeCache");s&&(s.width=i.width,s.height=i.height),i.x=-o/2-r[3],i.y=-a/2-r[0];var u={stroke:t.color},c=e.get("keyShape"),f=Object(l.z)({},c.attr(),u,i);t.style?(t.style.width=o,t.style.height=a):t.style={width:o,height:a},this.updateShape(t,e,f,!1)},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(p.a)({},n)),this.updateLabel(t,e)}},"single-combo"),nn.registerNode("circle",{options:{size:z.defaultNode.size,style:{x:0,y:0,stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=Object(l.e)({},r,t.icon),a=e.addShape("circle",{attrs:i,className:this.type+"-keyShape",draggable:!0}),s=o.width,u=o.height;return o.show&&e.addShape("image",{attrs:Object(p.a)({x:-s/2,y:-u/2},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}),this.drawLinkPoints(t,e),a},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,f=Object(p.e)(r,["top","left","right","bottom","size","r"]),l=this.getSize(t)[0]/2;o&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:-l,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:l,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:-l,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:l,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.e)({},e,n),i=this.getSize(t)[0]/2;return Object(p.a)({x:0,y:0,r:i},r)},update:function(t,e){var n=e.getContainer(),r=this.getSize(t),i={stroke:t.color,r:r[0]/2},o=e.get("keyShape"),a=Object(l.e)({},o.attr(),i,t.style);this.updateShape(t,e,a,!0),this.updateLinkPoints(t,n)}},"single-node"),nn.registerNode("rect",{options:{size:[100,30],style:{radius:0,stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("rect",{attrs:n,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return this.drawLinkPoints(t,e),r},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,f=Object(p.e)(r,["top","left","right","bottom","size","r"]),l=this.getSize(t),h=l[0],d=l[1];o&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:d/2,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(p.a)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||r.width,i[1]=o.attr("height")||r.height);var a={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},s=Object(l.z)({},r,o.attr(),a);s=Object(l.z)(s,t.style),this.updateShape(t,e,s,!1),this.updateLinkPoints(t,n)}},"single-node"),nn.registerNode("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0}),a=r.width,s=r.height;if(r.show)e.addShape("image",{attrs:Object(p.a)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0});return this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,f=Object(p.e)(r,["top","left","right","bottom","size","r"]),l=this.getSize(t),h=l[0]/2,d=l[1]/2;o&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:-h,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:h,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:-d,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:d,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return Object(p.a)({x:0,y:0,rx:o,ry:a},r)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getSize(t),o={stroke:t.color,rx:i[0]/2,ry:i[1]/2},a=e.get("keyShape"),s=Object(l.z)({},r,a.attr(),o);s=Object(l.z)(s,t.style),this.updateShape(t,e,s,!0),this.updateLinkPoints(t,n)}},"single-node"),nn.registerNode("diamond",{options:{size:[80,80],style:{stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),a=r.width,s=r.height;if(r.show)e.addShape("image",{attrs:Object(p.a)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0});return this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,f=Object(p.e)(r,["top","left","right","bottom","size","r"]),l=this.getSize(t),h=l[0],d=l[1];o&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:d/2,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getPath:function(t){var e=this.getSize(t),n=e[0],r=e[1];return[["M",0,-r/2],["L",n/2,0],["L",0,r/2],["L",-n/2,0],["Z"]]},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getPath(t);return Object(p.a)({path:i},r)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=e.get("keyShape"),s=Object(l.z)({},r,a.attr(),o);s=Object(l.z)(s,t.style),this.updateShape(t,e,s,!0),this.updateLinkPoints(t,n)}},"single-node"),nn.registerNode("triangle",{options:{size:40,direction:"up",style:{stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.getOptions(t),r=n.icon,i=void 0===r?{}:r,o=n.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),c=i.width,f=i.height,l=i.show,h=i.offset;if(l){var d=-c/2,g=-f/2;"up"!==s&&"down"!==s||(g+=h),"left"!==s&&"right"!==s||(d+=h),e.addShape("image",{attrs:Object(p.a)({x:d,y:g},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=this.getOptions(t),r=n.linkPoints,i=void 0===r?{}:r,o=n.direction,a=t.direction||o,s=i.top,u=i.left,c=i.right,f=i.bottom,l=i.size,h=i.r,d=Object(p.e)(i,["top","left","right","bottom","size","r"]),g=this.getSize(t)[0];if(u){var v=null,m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?v=[-y,m]:"down"===a?v=[-y,-m]:"left"===a&&(v=[-y,y-m]),v&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},d),{x:v[0],y:v[1],r:l/2||h||5}),className:"link-point-left",name:"link-point-left"})}if(c){var b=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?b=[y,m]:"down"===a?b=[y,-m]:"right"===a&&(b=[y,y-m]),b&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},d),{x:b[0],y:b[1],r:l/2||h||5}),className:"link-point-right",name:"link-point-right"})}if(s){var x=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"up"===a?x=[y-m,-m]:"left"===a?x=[y,-m]:"right"===a&&(x=[-y,-m]),x&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},d),{x:x[0],y:x[1],r:l/2||h||5}),className:"link-point-top",name:"link-point-top"})}if(f){var w=null;m=g*Math.sin(1/3*Math.PI),y=g*Math.sin(1/3*Math.PI);"down"===a?w=[-y+m,m]:"left"===a?w=[y,m]:"right"===a&&(w=[-y,m]),w&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},d),{x:w[0],y:w[1],r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"})}},getPath:function(t){var e=this.getOptions(t).direction,n=t.direction||e,r=this.getSize(t)[0],i=r*Math.sin(1/3*Math.PI),o=r*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===n?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===n?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===n&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getPath(t);return Object(p.a)({path:i},r)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=e.get("keyShape"),s=Object(l.z)({},r,a.attr(),o);s=Object(l.z)(s,t.style),this.updateShape(t,e,s,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}),r=n.linkPoints,i=n.direction,o=t.direction||i,a=e.find((function(t){return"link-point-left"===t.get("className")})),s=e.find((function(t){return"link-point-right"===t.get("className")})),u=e.find((function(t){return"link-point-top"===t.get("className")})),c=e.find((function(t){return"link-point-bottom"===t.get("className")})),f=r,h=a||s||u||c;h&&(f=h.attr());var d=Object(l.z)({},f,t.linkPoints),g=d.fill,v=d.stroke,m=d.lineWidth,y=d.size/2;y||(y=d.r);var b=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},x=b.left,w=b.right,_=b.top,E=b.bottom,S=this.getSize(t)[0],M={r:y,fill:g,stroke:v,lineWidth:m},O=null,A=S*Math.sin(1/3*Math.PI),k=S*Math.sin(1/3*Math.PI);"up"===o?O=[-k,A]:"down"===o?O=[-k,-A]:"left"===o&&(O=[-k,k-A]),O&&(a?x||void 0===x?a.attr(Object(p.a)(Object(p.a)({},M),{x:O[0],y:O[1]})):a.remove():x&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},M),{x:O[0],y:O[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}));var T=null;"up"===o?T=[k,A]:"down"===o?T=[k,-A]:"right"===o&&(T=[k,k-A]),T&&(s?w||void 0===w?s.attr(Object(p.a)(Object(p.a)({},M),{x:T[0],y:T[1]})):s.remove():w&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},M),{x:T[0],y:T[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}));var I=null;"up"===o?I=[k-A,-A]:"left"===o?I=[k,-A]:"right"===o&&(I=[-k,-A]),I&&(u?_||void 0===_?u.attr(Object(p.a)(Object(p.a)({},M),{x:I[0],y:I[1]})):u.remove():_&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},M),{x:I[0],y:I[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}));var C=null;"down"===o?C=[-k+A,A]:"left"===o?C=[k,A]:"right"===o&&(C=[-k,A]),C&&(c?E||void 0===E?c.attr(Object(p.a)(Object(p.a)({},M),{x:C[0],y:C[1]})):c.remove():E&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},M),{x:C[0],y:C[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))}},"single-node"),nn.registerNode("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:z.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf"},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var n=this.getOptions(t).preRect,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),c=r.show,f=Object(p.e)(r,["show"]);return c&&e.addShape("rect",{attrs:Object(p.a)({x:-a/2,y:-s/2,height:s},f),className:"pre-rect",name:"pre-rect",draggable:!0}),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var n=this.getOptions(t).logoIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,c=r.offset,f=Object(p.e)(r,["width","height","x","y","offset"]);e.addShape("image",{attrs:Object(p.a)(Object(p.a)({},f),{x:s||-i/2+o+c,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=this.getOptions(t).stateIcon,r=void 0===n?{}:n,i=this.getSize(t)[0];if(r.show){var o=r.width,a=r.height,s=r.x,u=r.y,c=r.offset,f=Object(p.e)(r,["width","height","x","y","offset"]);e.addShape("image",{attrs:Object(p.a)(Object(p.a)({},f),{x:s||i/2-o+c,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.bottom,u=r.size,c=r.r,f=Object(p.e)(r,["top","left","right","bottom","size","r"]),l=this.getSize(t),h=l[0],d=l[1];o&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:-h/2,y:0,r:u/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:h/2,y:0,r:u/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),i&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:-d/2,r:u/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},f),{x:0,y:d/2,r:u/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},drawLabel:function(t,e){var n=this.getOptions(t),r=n.labelCfg,i=void 0===r?{}:r,o=n.logoIcon,a=void 0===o?{}:o,s=n.descriptionCfg,u=void 0===s?{}:s,c=this.getSize(t)[0],f=null,h=a.show,d=a.width,g=-c/2+i.offset;h&&(g=-c/2+d+i.offset);var v=i.style,m=u.style,y=u.paddingTop;return Object(l.w)(t.description)?(f=e.addShape("text",{attrs:Object(p.a)(Object(p.a)({},v),{x:g,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),e.addShape("text",{attrs:Object(p.a)(Object(p.a)({},m),{x:g,y:17+(y||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})):f=e.addShape("text",{attrs:Object(p.a)(Object(p.a)({},v),{x:g,y:7,text:t.label}),draggable:!0}),f},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(p.a)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e){var n=this.getOptions(t),r=n.style,i=void 0===r?{}:r,o=n.labelCfg,a=void 0===o?{}:o,s=n.descriptionCfg,u=void 0===s?{}:s,c=this.getSize(t),f=c[0],h=c[1];e.get("keyShape").attr(Object(p.a)(Object(p.a)({},i),{x:-f/2,y:-h/2,width:f,height:h}));var d=e.getContainer(),g=d.find((function(t){return"rect-logo-icon"===t.get("className")})),v=g?g.attr():{},m=Object(l.z)({},v,t.logoIcon),y=m.width;void 0===y&&(y=this.options.logoIcon.width);var b=t.logoIcon?t.logoIcon.show:void 0,x=a.offset,w=-f/2+y+x;b||void 0===b||(w=-f/2+x);var _=d.find((function(t){return"node-label"===t.get("className")})),E=d.find((function(t){return"rect-description"===t.get("className")}));if(t.label)if(_){var S=t.labelCfg?t.labelCfg.style:{},M=Object(l.z)({},_.attr(),S);t.label&&(M.text=t.label),M.x=w,Object(l.w)(t.description)&&(M.y=-5),E&&(E.resetMatrix(),E.attr({x:w})),_.resetMatrix(),_.attr(M)}else d.addShape("text",{attrs:Object(p.a)(Object(p.a)({},a.style),{x:w,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0});if(Object(l.w)(t.description)){var O=u.paddingTop;if(E){S=t.descriptionCfg?t.descriptionCfg.style:{};var A=Object(l.z)({},E.attr(),S);Object(l.w)(t.description)&&(A.text=t.description),A.x=w,E.resetMatrix(),E.attr(Object(p.a)(Object(p.a)({},A),{y:17+(O||0)}))}else d.addShape("text",{attrs:Object(p.a)(Object(p.a)({},u.style),{x:w,y:17+(O||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})}var k=d.find((function(t){return"pre-rect"===t.get("className")}));if(k){var T=Object(l.z)({},k.attr(),t.preRect);k.attr(Object(p.a)(Object(p.a)({},T),{x:-f/2,y:-h/2,height:h}))}if(g)if(b||void 0===b){var I=m.width,C=m.height,P=m.x,D=m.y,N=m.offset,R=Object(p.e)(m,["width","height","x","y","offset"]);g.attr(Object(p.a)(Object(p.a)({},R),{x:P||-f/2+I+N,y:D||-C/2,width:I,height:C}))}else g.remove();else b&&this.drawLogoIcon(t,d);var j=d.find((function(t){return"rect-state-icon"===t.get("className")})),B=j?j.attr():{},L=Object(l.z)({},B,t.stateIcon);if(j){L.show||void 0===L.show||j.remove();var G=L.width,F=(C=L.height,P=L.x,D=L.y,L.offset),U=Object(p.e)(L,["width","height","x","y","offset"]);j.attr(Object(p.a)(Object(p.a)({},U),{x:P||f/2-G+F,y:D||-C/2,width:G,height:C}))}else L.show&&this.drawStateIcon(t,d);this.updateLinkPoints(t,d)}},"single-node"),nn.registerNode("star",{options:{size:60,style:{stroke:z.defaultNode.style.stroke,fill:z.defaultNode.style.fill,lineWidth:z.defaultNode.style.lineWidth},labelCfg:{style:{fill:z.nodeLabel.style.fill,fontSize:z.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:z.defaultNode.linkPoints.size,lineWidth:z.defaultNode.linkPoints.lineWidth,fill:z.defaultNode.linkPoints.fill,stroke:z.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:Object(p.a)({},z.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,r=void 0===n?{}:n,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),a=r.width,s=r.height;if(r.show)e.addShape("image",{attrs:Object(p.a)({x:-a/2,y:-s/2},r),className:this.type+"-icon",name:this.type+"-icon",draggable:!0});return this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,r=void 0===n?{}:n,i=r.top,o=r.left,a=r.right,s=r.leftBottom,u=r.rightBottom,c=r.size,f=r.r,l=Object(p.e)(r,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t)[0];if(a){var d=Math.cos(.1*Math.PI)*h,g=Math.sin(.1*Math.PI)*h;e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},l),{x:d,y:-g,r:c/2||f||5}),className:"link-point-right",name:"link-point-right"})}if(i){d=Math.cos(.5*Math.PI)*h,g=Math.sin(.5*Math.PI)*h;e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},l),{x:d,y:-g,r:c/2||f||5}),className:"link-point-top",name:"link-point-top"})}if(o){d=Math.cos(.9*Math.PI)*h,g=Math.sin(.9*Math.PI)*h;e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},l),{x:d,y:-g,r:c/2||f||5}),className:"link-point-left",name:"link-point-left"})}if(s){d=Math.cos(1.3*Math.PI)*h,g=Math.sin(1.3*Math.PI)*h;e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},l),{x:d,y:-g,r:c/2||f||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){d=Math.cos(1.7*Math.PI)*h,g=Math.sin(1.7*Math.PI)*h;e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},l),{x:d,y:-g,r:c/2||f||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){for(var e=this.getSize(t)[0],n=3*e/8,r=t.innerR||n,i=[],o=0;o<5;o++){var a=Math.cos((18+72*o)/180*Math.PI)*e,s=Math.sin((18+72*o)/180*Math.PI)*e,u=Math.cos((54+72*o)/180*Math.PI)*r,c=Math.sin((54+72*o)/180*Math.PI)*r;0===o?i.push(["M",a,-s]):i.push(["L",a,-s]),i.push(["L",u,-c])}return i.push(["Z"]),i},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(l.z)({},e,n),i=this.getPath(t);return Object(p.a)({path:i},r)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},a=e.get("keyShape"),s=Object(l.z)({},r,a.attr(),o);s=Object(l.z)(s,t.style),this.updateShape(t,e,s,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,r=e.find((function(t){return"link-point-left"===t.get("className")})),i=e.find((function(t){return"link-point-right"===t.get("className")})),o=e.find((function(t){return"link-point-top"===t.get("className")})),a=e.find((function(t){return"link-point-left-bottom"===t.get("className")})),s=e.find((function(t){return"link-point-right-bottom"===t.get("className")})),u=n,c=r||i||o||a||s;c&&(u=c.attr());var f=Object(l.z)({},u,t.linkPoints),h=f.fill,d=f.stroke,g=f.lineWidth,v=f.size/2;v||(v=f.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=m.left,b=m.right,x=m.top,w=m.leftBottom,_=m.rightBottom,E=this.getSize(t)[0],S={r:v,fill:h,stroke:d,lineWidth:g},M=Math.cos(.1*Math.PI)*E,O=Math.sin(.1*Math.PI)*E;i?b||void 0===b?i.attr(Object(p.a)(Object(p.a)({},S),{x:M,y:-O})):i.remove():b&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},S),{x:M,y:-O}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),M=Math.cos(.5*Math.PI)*E,O=Math.sin(.5*Math.PI)*E,o?x||void 0===x?o.attr(Object(p.a)(Object(p.a)({},S),{x:M,y:-O})):o.remove():x&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},S),{x:M,y:-O}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),M=Math.cos(.9*Math.PI)*E,O=Math.sin(.9*Math.PI)*E,r?y||void 0===y?r.attr(Object(p.a)(Object(p.a)({},S),{x:M,y:-O})):r.remove():y&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},S),{x:M,y:-O}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),M=Math.cos(1.3*Math.PI)*E,O=Math.sin(1.3*Math.PI)*E,a?w||void 0===w?a.attr(Object(p.a)(Object(p.a)({},S),{x:M,y:-O})):a.remove():w&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},S),{x:M,y:-O}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0}),M=Math.cos(1.7*Math.PI)*E,O=Math.sin(1.7*Math.PI)*E,s?_||void 0===_?s.attr(Object(p.a)(Object(p.a)({},S),{x:M,y:-O})):a.remove():_&&e.addShape("circle",{attrs:Object(p.a)(Object(p.a)({},S),{x:M,y:-O}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0})}},"single-node"),nn.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);delete r.fill;var i=e.addShape(n,{attrs:r,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return this.drawClip(t,i),i},drawClip:function(t,e){var n=this.getOptions(t).clipCfg;if(n.show){var r=n.type,i=n.x,o=n.y,a=n.style;if("circle"===r){var s=n.r;e.setClip({type:"circle",attrs:Object(p.a)({r:s,x:i,y:o},a)})}else if("rect"===r){var u=n.width,c=n.height,f=i-u/2,l=o-c/2;e.setClip({type:"rect",attrs:Object(p.a)({x:f,y:l,width:u,height:c},a)})}else if("ellipse"===r){var h=n.rx,d=n.ry;e.setClip({type:"ellipse",attrs:Object(p.a)({x:i,y:o,rx:h,ry:d},a)})}else if("polygon"===r){var g=n.points;e.setClip({type:"polygon",attrs:Object(p.a)({points:g},a)})}else if("path"===r){var v=n.path;e.setClip({type:"path",attrs:Object(p.a)({path:v},a)})}}},getShapeStyle:function(t){var e=this.getOptions(t).style,n=this.getSize(t),r=this.getOptions(t).img,i=n[0],o=n[1];return e&&(i=e.width||n[0],o=e.height||n[1]),Object(p.a)({x:-i/2,y:-o/2,width:i,height:o,img:r},e)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=this.itemType+"-shape",i=n.find((function(t){return t.get("className")===r}))||e.getKeyShape(),o=this.getShapeStyle(t);i&&i.attr(o)}},"single-node");var od=function(t){var e=t.x,n=t.y;return{x:e,y:n,centerX:e,centerY:n,minX:e,minY:n,maxX:e,maxY:n,height:0,width:0}},ad=function(t,e){return 2*Math.abs(t.centerX-e.centerX)<t.width+e.width&&2*Math.abs(t.centerY-e.centerY)<t.height+e.height},sd=function(t){var e=[],n={};return t.forEach((function(t){var e=t.x+"-"+t.y;t.id=e,n[e]=t})),Object(l.f)(n,(function(t){e.push(t)})),e},ud=function(t){return t=sd(t)},cd=function(t,e){return[t,{x:t.x,y:e.y},e]},fd=function(t,e){return 0===t.width&&0===t.height?t:{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},ld=function(t,e){return function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height}(e,t)?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},hd=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},dd=function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:i},{x:e,y:i}]},pd=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},gd=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},vd=function(t,e,n,r,i){return gd(t,e)+gd(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},md=function(t,e,n,r,i){void 0===i&&(i=0),t.unshift(e[r]),n[r]&&n[r]!==r&&i<=100&&md(t,e,n,n[r],i+1)},yd=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-o*(t.x-n.x)+i*(t.y-n.y))/(-a*o+i*s),c=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*o+i*s);return u>=0&&u<=1&&c>=0&&c<=1},bd=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=dd(n),i=r[0],o=r[1],a=r[2],s=r[3];return yd(t,e,i,o)||yd(t,e,i,s)||yd(t,e,o,a)||yd(t,e,a,s)},xd=function(t,e,n,r,i,o,a){var s=[],u=[e],c={},f={},l={};f[e.id]=0,l[e.id]=vd(e,n,e);var h={};t.forEach((function(t){h[t.id]=t}));for(var d=function(){var d,p,g,v,m=1/0;if(u.forEach((function(t){l[t.id]<m&&(m=l[t.id],d=t)})),d===n){var y=[];return md(y,h,c,n.id),{value:y}}g=d,(v=(p=u).indexOf(g))>-1&&p.splice(v,1),s.push(d),function(t,e,n,r){var i=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||bd(t,e,n)||bd(t,e,r)||i.push(t))})),sd(i)}(t,d,r,i).forEach((function(t){if(-1===s.indexOf(t)){-1===u.indexOf(t)&&u.push(t);var r=l[d.id]+gd(d,t);f[t.id]&&r>=f[t.id]||(c[t.id]=d.id,f[t.id]=r,l[t.id]=f[t.id]+vd(t,n,e,o,a))}}))};u.length;){var p=d();if("object"==typeof p)return p.value}return[e,n]},wd=function(t,e){var n=[],r=t[0];return n.push("M"+r.x+" "+r.y),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=gd(t,e),o=gd(n,e);return i<r&&(r=i),o<r&&(r=o),[{x:e.x-r/i*(e.x-t.x),y:e.y-r/i*(e.y-t.y)},{x:e.x-r/o*(e.x-n.x),y:e.y-r/o*(e.y-n.y)}]}(r,o,a,e),u=s[0],c=s[1];n.push("L"+u.x+" "+u.y),n.push("Q"+o.x+" "+o.y+" "+c.x+" "+c.y),n.push("L"+c.x+" "+c.y)}else n.push("L"+o.x+" "+o.y);else o&&n.push("L"+o.x+" "+o.y)})),n.join("")},_d=function(t,e,n,r,i){var o,a;if(n&&n.getType())if("combo"===n.getType()){(o=n.getKeyShape().getCanvasBBox()||od(t)).centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=n.getBBox();else o=od(t);if(r&&r.getType())if("combo"===r.getType()){(a=r.getKeyShape().getCanvasBBox()||od(e)).centerX=(a.minX+a.maxX)/2,a.centerY=(a.minY+a.maxY)/2}else a=r&&r.getBBox();else a=od(e);if(ad(o,a))return ud(cd(t,e));var s=fd(o,i),u=fd(a,i);if(ad(s,u))return ud(cd(t,e));var c=ld(s,t),f=ld(u,e),l=function(t){void 0===t&&(t=[]);var e=[],n=[];t.forEach((function(t){e.push(t.x),n.push(t.y)}));var r=Math.min.apply(Math,e),i=Math.max.apply(Math,e),o=Math.min.apply(Math,n),a=Math.max.apply(Math,n);return{centerX:(r+i)/2,centerY:(o+a)/2,maxX:i,maxY:a,minX:r,minY:o,height:a-o,width:i-r}}([c,f]),h=(hd(s,u),hd(s,l)),d=hd(u,l),p=[];p=(p=p.concat(dd(h))).concat(dd(d));var g={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[l,h,d].forEach((function(t){p=p.concat(function(t,e){return function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,g).filter((function(t){return pd(t,s)&&pd(t,u)})))})),[{x:c.x,y:f.y},{x:f.x,y:c.y}].forEach((function(t){pd(t,s)&&pd(t,u)&&p.push(t)})),p.unshift(c),p.push(f),p=sd(p);var v=xd(p,c,f,o,a,t,e);return v.unshift(t),v.push(e),ud(v)},Ed={offset:20,maxAllowedDirectionChange:90,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return ud(_d(t,e,n,r,i.offset))}},Sd=function(t,e){var n=Math.floor(t/e);return n<0?0:n},Md=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?(360+180*Math.atan2(r,n)/Math.PI)%360:0},Od=function(t,e){var n=Math.abs(t-e);return n>180?360-n:n},Ad=function(t,e,n){for(var r=1/0,i=0,o=e.length;i<o;i++){var a=n(t,e[i]);a<r&&(r=a)}return r},kd=function(t,e,n){var r=[];if(!e)return r;var i=n.directions,o=n.offset,a=e.getBBox(),s=fd(e.getBBox(),o);for(var u in s)s[u]=Sd(s[u],n.gridSize);if(t.x>Sd(a.minX,n.gridSize)&&t.x<Sd(a.maxX,n.gridSize)&&t.y>Sd(a.minY,n.gridSize)&&t.y<Sd(a.maxY,n.gridSize))for(var c=0,f=i;c<f.length;c++){var l=f[c],h=[[{x:s.minX,y:s.minY},{x:s.maxX,y:s.minY}],[{x:s.minX,y:s.minY},{x:s.minX,y:s.maxY}],[{x:s.maxX,y:s.minY},{x:s.maxX,y:s.maxY}],[{x:s.minX,y:s.maxY},{x:s.maxX,y:s.maxY}]];for(u=0;u<4;u++){var d,p=h[u];(d=_t(t,{x:t.x+l.stepX*s.width,y:t.y+l.stepY*s.height},p[0],p[1]))&&!bd(t,d,e.getBBox())&&(d.id=d.x+"-"+d.y,r.push(d))}}else(d=ld(s,t)).id=d.x+"-"+d.y,r.push(d);return r},Td=function(t,e,n,r,i){var o=Object(l.e)(Ed,i);o.obstacles=o.obstacles||[];var a=function(t,e,n){var r={};return t.forEach((function(t){if(t)for(var i=fd(t.getBBox(),n),o=Sd(i.minX,e);o<=Sd(i.maxX,e);o+=1)for(var a=Sd(i.minY,e);a<=Sd(i.maxY,e);a+=1){r[o+"-"+a]=!0}})),r}(o.obstacles.concat([n,r]),o.gridSize,o.offset),s={x:Sd(t.x,o.gridSize),y:Sd(t.y,o.gridSize)},u={x:Sd(e.x,o.gridSize),y:Sd(e.y,o.gridSize)};t.id=s.x+"-"+s.y,e.id=u.x+"-"+u.y;var c=kd(s,n,o),f=kd(u,r,o);c.forEach((function(t){delete a[t.id]})),f.forEach((function(t){delete a[t.id]}));for(var h={},d={},p={},g={},v={},m=0;m<c.length;m++){var y=c[m];h[y.id]=y,g[y.id]=0,v[y.id]=Ad(y,f,o.distFunc)}for(var b=function(t,e){var n,r=Md(t,e);if(p[t.id]){var i=Md({x:parseFloat(p[t.id].split("-")[0]),y:parseFloat(p[t.id].split("-")[1])},t);n=Od(i,r)}else{var o=Md(s,t);n=Od(o,r)}return n},x=o.maximumLoops,w=function(){var n,r=1/0;for(var i in h)v[i]<=r&&(r=v[i],n=h[i]);if(!n)return"break";if(f.findIndex((function(t){return t.x===n.x&&t.y===n.y}))>-1)return{value:function(n){var r=[e],i={x:parseFloat(n.split("-")[0]),y:parseFloat(n.split("-")[1]),id:n};for(b(i,u)&&r.unshift({x:i.x===u.x?e.x:i.x*o.gridSize,y:i.y===u.y?e.y:i.y*o.gridSize});p[n]&&p[n]!==n;){var a={x:parseFloat(n.split("-")[0]),y:parseFloat(n.split("-")[1]),id:n},c=p[n],f={x:parseFloat(c.split("-")[0]),y:parseFloat(c.split("-")[1]),id:c};b(f,a)&&r.unshift({x:f.x===a.x?r[0].x:f.x*o.gridSize,y:f.y===a.y?r[0].y:f.y*o.gridSize}),n=c}var l=parseFloat(n.split("-")[0]),h=parseFloat(n.split("-")[1]);return r[0].x=l===s.x?t.x:r[0].x,r[0].y=h===s.y?t.y:r[0].y,r.unshift(t),r}(n.id)};delete h[n.id],d[n.id]=!0;for(var c=0;c<o.directions.length;c++){var l=o.directions[c],m={x:n.x+l.stepX,y:n.y+l.stepY,id:n.x+l.stepX+"-"+(n.y+l.stepY)};if(!d[m.id]){var y=b(n,m);if(!(y>o.maxAllowedDirectionChange||a[m.id])){h[m.id]||(h[m.id]=m);var w=o.distFunc(n,m)+(isNaN(o.penalties[y])?o.gridSize:o.penalties[y]),_=g[n.id]+w;g[m.id]&&_>=g[m.id]||(p[m.id]=n.id,g[m.id]=_,v[m.id]=_+Ad(m,f,o.distFunc))}}}x-=1};Object.keys(h).length>0&&x>0;){var _=w();if("object"==typeof _)return _.value;if("break"===_)break}return o.fallbackRoute(t,e,n,r,o)};nn.registerEdge("polyline",{options:{color:z.defaultEdge.color,size:z.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:z.defaultEdge.style.stroke,lineAppendWidth:z.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:z.edgeLabel.style.fill,fontSize:z.edgeLabel.style.fontSize}},routeCfg:{obstacles:[],maxAllowedDirectionChange:90,maximumLoops:1e3,gridSize:10},stateStyles:Object(p.a)({},z.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return 0===n.radius&&delete n.radius,e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(l.z)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,c=t.targetNode,f=r.radius,h=this.options.routeCfg;h.offset=r.offset;var d=this.getPath(s,u,c,f,h);return(Object(l.m)(d)&&d.length<=1||Object(l.w)(d)&&-1===d.indexOf("L"))&&(d="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(d="M0 0, L0 0"),Object(l.z)({},z.defaultEdge.style,r,{lineWidth:t.size,path:d})},updateShapeStyle:function(t,e){var n=e.getContainer(),r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[a];u&&(c=c.concat(u)),c.push(s);var f=i.attr(),h=Object(l.z)({},r,f,t.style),d=t.sourceNode,p=t.targetNode,g=h.radius,v=this.options.routeCfg;v.offset=h.offset;var m=this.getPath(c,d,p,g,v);(Object(l.m)(m)&&m.length<=1||Object(l.w)(m)&&-1===m.indexOf("L"))&&(m="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(m="M0 0, L0 0"),f.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),f.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""});var y=Object(l.z)(r,i.attr(),{lineWidth:o,path:m},t.style);i&&i.attr(y)},getPath:function(t,e,n,r,i){var o;if(!i.offset||t.length>2){if(r)return wd(t,r);var a=[];return Object(l.f)(t,(function(t,e){0===e?a.push(["M",t.x,t.y]):a.push(["L",t.x,t.y])})),a}return r?(o=Td(t[0],t[t.length-1],e,n,i),wd(o,r)):(o=Td(t[0],t[t.length-1],e,n,i),ue(o))}},"single-edge");var Id={collapse:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t+n-4,e]]},expand:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t-n+2*n-4,e],["M",t-n+n,e-n+4],["L",t,e+n-4]]},upTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e+i],["L",t+r,e+i],["L",t,e-n],["Z"]]},downTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e-i],["L",t+r,e-i],["L",t,e+n],["Z"]]}},Cd=nn,Pd={mat3:$,mix:l.z,deepMix:l.e,transform:at,isArray:l.m,isNumber:l.t,uniqueId:l.F},Dd=Object(p.a)(Object(p.a)(Object(p.a)(Object(p.a)(Object(p.a)(Object(p.a)({},Pd),r),s),a),o),i),Nd=function(){function t(t){this._cfgs=Object(l.e)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var n=e.getEvents(),r={};Object(l.f)(n,(function(n,i){var o=Object(l.H)(e,n);r[i]=o,t.on(i,o)})),this._events=r,this.init()},t.prototype.init=function(){},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){return this._cfgs[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;Object(l.f)(e,(function(e,n){t.off(n,e)})),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),Rd="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",jd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{img:Rd}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("minZoom"),n=t.get("container"),r=t.get("canvas").get("el"),i=t.get("width"),o=t.get("height"),a=this.get("img")||Rd,s=ct("<div class='g6-grid-container' style=\"position: absolute; left:0;top:0;right:0;bottom:0;overflow: hidden;z-index: -1;\"></div>"),u=ct("<div \n class='g6-grid' \n style='position:absolute;\n transform-origin: 0% 0% 0px;\n background-image: "+a+";\n user-select: none\n '></div>");s.appendChild(u),ft(s,{width:i+"px",height:o+"px",left:n.offsetLeft+"px",top:n.offsetTop+"px"}),ft(u,{width:i/e+"px",height:o/e+"px",left:"0px",top:"0px"}),n.insertBefore(s,r),this.set("container",s),this.set("gridContainer",u)},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),n=t.matrix;n||(n=[1,0,0,0,1,0,0,0,1]),ft(e,{transform:"matrix("+n[0]+", "+n[1]+", "+n[3]+", "+n[4]+", 0, 0)"})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(Nd),Bd=n(77),Ld=n.n(Bd);Ld()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var Gd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n <ul class='g6-contextmenu-ul'>\n <li>菜单项1</li>\n <li>菜单项2</li>\n </ul>\n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"]}},e.prototype.getEvents=function(){return{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=ct("<div class="+(this.get("className")||"g6-component-contextmenu")+"></div>");ft(t,{top:"0px",position:"absolute",visibility:"hidden"});var e=this.get("container");e||(e=this.get("graph").get("container")),Object(l.w)(e)&&(e=document.getElementById(e)),e.appendChild(t),this.set("menu",t)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault(),t.stopPropagation();var n=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===n.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===n.indexOf("canvas"))return;if(this.get("shouldBegin")(t)){var r=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);Object(l.w)(a)?r.innerHTML=a:r.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),r.addEventListener("click",u)}var c=o.get("width"),f=o.get("height"),h=r.getBoundingClientRect(),d=this.get("offsetX")||0,p=this.get("offsetY")||0,g=o.getContainer().offsetTop,v=o.getContainer().offsetLeft,m=t.canvasX+v+d,y=t.canvasY+g+p;m+h.width>c&&(m=t.canvasX-h.width-d+v),y+h.height>f&&(y=t.canvasY-h.height-p+g),ft(r,{top:y+"px",left:m+"px",visibility:"visible"});var b=function(t){e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&ft(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(l.w)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Nd),Fd=Math.max,Ud=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handleUpdateCanvas=Object(l.d)((function(t){var n=e;n.destroyed||n.updateCanvas()}),100,!1),e}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.size,r=e.graph;if(!this.destroyed){var i=this.get("canvas").get("container"),o=ct("\n <div\n class="+e.viewportClassName+"\n style='position:absolute;\n left:0;\n top:0;\n box-sizing:border-box;\n border: 2px solid #1980ff'\n draggable=true>\n </div>"),a=0,s=0,u=!1,c=0,f=0,h=0,d=0,p=0,g=0;o.addEventListener("dragstart",(function(i){if(i.dataTransfer){var l=new Image;l.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",i.dataTransfer.setDragImage(l,0,0),i.dataTransfer.setData("text","view-port-minimap")}if(e.refresh=!1,i.target===o){var v=o.style;c=parseInt(v.left,10),f=parseInt(v.top,10),h=parseInt(v.width,10),d=parseInt(v.height,10),h>n[0]||d>n[1]||(g=r.getZoom(),p=t.get("ratio"),u=!0,a=i.clientX,s=i.clientY)}}),!1),o.addEventListener("drag",(function(t){if(u&&!Object(l.s)(t.clientX)&&!Object(l.s)(t.clientY)){var e=a-t.clientX,i=s-t.clientY;(c-e<0||c-e+h>=n[0])&&(e=0),(f-i<0||f-i+d>=n[1])&&(i=0),ft(o,{left:(c-=e)+"px",top:(f-=i)+"px"}),r.translate(e*g/p,i*g/p),a=t.clientX,s=t.clientY}}),!1),o.addEventListener("dragend",(function(){u=!1,e.refresh=!0}),!1),this.set("viewport",o),i.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=(this.get("dx"),this.get("dy"),this.get("totaldx")),n=this.get("totaldy"),r=this.get("graph"),i=this.get("size"),o=r.get("width"),a=r.get("height"),s=r.getPointByCanvas(0,0),u=r.getPointByCanvas(o,a),c=this.get("viewport");c||this.initViewport();r.getZoom();var f=(u.x-s.x)*t,l=(u.y-s.y)*t,h=s.x*t+e,d=s.y*t+n,p=h+f,g=d+l;h<0&&(f+=h,h=0),p>i[0]&&(f-=p-i[0]),d<0&&(l+=d,d=0),g>i[1]&&(l-=g-i[1]),this.set("ratio",t),ft(c,{left:h+"px",top:d+"px",width:f+"px",height:l+"px"})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,e=this.get("canvas"),n=t.get("group");if(!n.destroyed){var r=n.clone();r.resetMatrix(),e.clear(),e.add(r),"svg"===t.get("renderer")&&this.updateVisible(r)}},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var n=t.get("children");if(!n||!n.length)return;n.forEach((function(t){t.get("visible")||t.hide(),e.updateVisible(t)}))}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph;Object(l.f)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e)})),Object(l.f)(e.getNodes(),(function(e){t.updateOneNodeKeyShape(e)})),this.clearDestroyedShapes()},e.prototype.updateOneNodeKeyShape=function(t){var e=this.get("canvas"),n=e.get("children")[0]||e.addGroup(),r=this.get("itemMap")||{},i=r[t.get("id")],o=t.getBBox(),a=t.get("keyShape").clone(),s=a.attr(),u={x:o.centerX,y:o.centerY};i?u=Object.assign(s,u):(i=a,n.add(i));var c=i.get("type");"rect"!==c&&"image"!==c||(u.x=o.minX,u.y=o.minY),i.attr(u),t.isVisible()||i.hide(),i.exist=!0,r[t.get("id")]=i,this.set("itemMap",r)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph;Object(l.f)(e.getEdges(),(function(e){t.updateOneEdgeKeyShape(e)})),Object(l.f)(e.getNodes(),(function(e){t.updateOneNodeDelegateShape(e)})),this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var n=e.length-1;n>=0;n--){var r=t[e[n]],i=r.exist;r.exist=!1,i||(r.remove(),delete t[e[n]])}},e.prototype.updateOneEdgeKeyShape=function(t){var e=this.get("canvas"),n=e.get("children")[0]||e.addGroup(),r=this.get("itemMap")||{},i=r[t.get("id")];if(i){var o=t.get("keyShape").attr("path");i.attr("path",o)}else i=t.get("keyShape").clone(),n.add(i),i.toBack();t.isVisible()||i.hide(),i.exist=!0,r[t.get("id")]=i,this.set("itemMap",r)},e.prototype.updateOneNodeDelegateShape=function(t){var e=this.get("canvas"),n=e.get("children")[0]||e.addGroup(),r=this.get("delegateStyle"),i=this.get("itemMap")||{},o=i[t.get("id")],a=t.getBBox();if(o){var s={x:a.minX,y:a.minY,width:a.width,height:a.height};o.attr(s)}else o=n.addShape("rect",{attrs:Object(p.a)({x:a.minX,y:a.minY,width:a.width,height:a.height},r),name:"minimap-node-shape"});t.isVisible()||o.hide(),o.exist=!0,i[t.get("id")]=o,this.set("itemMap",i)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this.get("graph"),e=this.get("size"),n=this.get("className"),r=this.get("container"),i=ct("<div class='"+n+"' style='width: "+e[0]+"px; height: "+e[1]+"px; overflow: hidden'></div>");Object(l.w)(r)&&(r=document.getElementById(r)),r?r.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=ct('<div class="g6-minimap-container" style="position: relative;"></div>');i.appendChild(a),o="svg"===t.get("renderer")?new Se.Canvas({container:a,width:e[0],height:e[1]}):new Ee.Canvas({container:a,width:e[0],height:e[1]}),this.set("canvas",o),this.updateCanvas()},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),n=this.get("canvas"),r=this.get("type"),i=this.get("padding");if(!n.destroyed){switch(r){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=n.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getBBox(),u=s.width,c=s.height;Number.isFinite(a.width)&&(u=Fd(a.width,u),c=Fd(a.height,c)),u+=2*i,c+=2*i;var f=Math.min(e[0]/u,e[1]/c),l=[1,0,0,0,1,0,0,0,1],h=0,d=0;Number.isFinite(a.minX)&&(h=-a.minX),Number.isFinite(a.minY)&&(d=-a.minY);var p=(e[0]-(u-2*i)*f)/2,g=(e[1]-(c-2*i)*f)/2;l=at(l,[["t",h,d],["s",f,f],["t",p,g]]),o.setMatrix(l),this.set("ratio",f),this.set("totaldx",p+h*f),this.set("totaldy",g+d*f),this.set("dx",p),this.set("dy",g),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){this.get("canvas").destroy();var t=this.get("container");t.parentNode.removeChild(t)},e}(Nd);function zd(t,e,n){var r=t.x-e.x,i=t.y-e.y;return!n||Math.abs(r)>n||Math.abs(i)>n?Math.sqrt(r*r+i*i):n}function Wd(t,e){var n=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(n*n*e.source.x+n*(t.y-e.source.y)+t.x)/(n*n+1);return{x:r,y:n*(r-e.source.x)+e.source.y}}var Vd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",(function(){e&&e(),t.refreshPositions()}))},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var n=t.edges||[],r=t.nodes||[],i={},o=!1;if(r.forEach((function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(o=!0),i[t.id]=t})),o)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",i);var a=e.get("divisions"),s=e.get("divRate"),u=e.divideEdges(a);e.set("edgePoints",u);var c=e.getEdgeBundles();e.set("edgeBundles",c);for(var f=e.get("cycles"),l=e.get("iterations"),h=e.get("iterRate"),d=e.get("lambda"),p=0;p<f;p++){for(var g=function(t){var r=[];n.forEach((function(t,n){if(t.source!==t.target){var o=i[t.source],s=i[t.target];r[n]=e.getEdgeForces({source:o,target:s},n,a,d);for(var c=0;c<a+1;c++)u[n][c].x+=r[n][c].x,u[n][c].y+=r[n][c].y}}))},v=0;v<l;v++)g();d/=2,a*=s,l*=h,u=e.divideEdges(a),e.set("edgePoints",u)}n.forEach((function(t,e){t.source!==t.target&&(t.type="polyline",t.controlPoints=u[e].slice(1,u[e].length-1))})),e.get("graph").refresh()}},e.prototype.updateBundling=function(t){var e=this,n=t.data;if(n&&e.set("data",n),e.get("ticking")&&e.set("ticking",!1),Object.keys(t).forEach((function(n){e.set(n,t[n])})),t.onTick){var r=this.get("graph");e.set("tick",(function(){t.onTick(),r.refresh()}))}e.bundling(n)},e.prototype.divideEdges=function(t){var e=this,n=e.get("data").edges,r=e.get("nodeIdMap"),i=e.get("edgePoints");return i&&void 0!==i||(i=[]),n.forEach((function(n,o){i[o]&&void 0!==i[o]||(i[o]=[]);var a=r[n.source],s=r[n.target];if(1===t)i[o].push({x:a.x,y:a.y}),i[o].push({x:.5*(a.x+s.x),y:.5*(a.y+s.y)}),i[o].push({x:s.x,y:s.y});else{var u=(i[o]&&i[o]!==[]?e.getEdgeLength(i[o]):zd({x:a.x,y:a.y},{x:s.x,y:s.y}))/(t+1),c=u,f=[{x:a.x,y:a.y}];i[o].forEach((function(t,e){if(0!==e){for(var n=zd(t,i[o][e-1]);n>c;){var r=c/n,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=r*(t.x-i[o][e-1].x),a.y+=r*(t.y-i[o][e-1].y),f.push(a),n-=c,c=u}c-=n}})),f.push({x:s.x,y:s.y}),i[o]=f}})),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach((function(n,r){0!==r&&(e+=zd(n,t[r-1]))})),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],n=t.get("bundleThreshold"),r=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach((function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])})),e.forEach((function(o,a){var s=r[o.source],u=r[o.target];e.forEach((function(e,o){if(!(o<=a)){var c=r[e.source],f=r[e.target];t.getBundleScore({source:s,target:u},{source:c,target:f})>=n&&(i[a].push(o),i[o].push(a))}}))})),i},e.prototype.getBundleScore=function(t,e){return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=zd({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=zd({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),this.getAngleScore(t,e)*this.getScaleScore(t,e)*this.getPositionScore(t,e)*this.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy})/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},e.prototype.getPositionScore=function(t,e){var n=(t.length+e.length)/2;return n/(n+zd({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var n=this.getEdgeVisibility(t,e),r=this.getEdgeVisibility(e,t);return n<r?n:r},e.prototype.getEdgeVisibility=function(t,e){var n=Wd(e.source,t),r=Wd(e.target,t),i={x:(n.x+r.x)/2,y:(n.y+r.y)/2},o={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2};return Math.max(0,1-2*zd(i,o)/zd(n,r))},e.prototype.getEdgeForces=function(t,e,n,r){for(var i=this.get("edgePoints"),o=this.get("K")/(zd(t.source,t.target)*(n+1)),a=[{x:0,y:0}],s=1;s<n;s++){var u={x:0,y:0},c=this.getSpringForce({pre:i[e][s-1],cur:i[e][s],next:i[e][s+1]},o),f=this.getElectrostaticForce(s,e);u.x=r*(c.x+f.x),u.y=r*(c.y+f.y),a.push(u)}return a.push({x:0,y:0}),a},e.prototype.getSpringForce=function(t,e){var n=t.pre.x+t.next.x-2*t.cur.x,r=t.pre.y+t.next.y-2*t.cur.y;return{x:n*=e,y:r*=e}},e.prototype.getElectrostaticForce=function(t,e){var n=this.get("eps"),r=this.get("edgeBundles"),i=this.get("edgePoints"),o=r[e],a={x:0,y:0};return o.forEach((function(r){var o={x:i[r][t].x-i[e][t].x,y:i[r][t].y-i[e][t].y};if(Math.abs(o.x)>n||Math.abs(o.y)>n){var s=1/zd(i[r][t],i[e][t]);a.x+=o.x*s,a.y+=o.y*s}})),a},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(Nd),Xd={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},Yd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:Object(l.c)(Xd),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"magnify"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"magnify"}}return t},e.prototype.init=function(){var t=this.get("r");this.set("cachedMagnifiedModels",[]),this.set("cachedOriginPositions",{}),this.set("r2",t*t);var e=this.get("d");this.set("molecularParam",(e+1)*t)},e.prototype.createDelegate=function(t){var e=this,n=this,r=n.get("delegate");r&&!r.destroyed||(n.magnify(t),(r=n.get("delegate")).on("dragstart",(function(t){n.set("delegateCenterDiff",{x:r.attr("x")-t.x,y:r.attr("y")-t.y})})),r.on("drag",(function(t){n.magnify(t)})),"wheel"===this.get("scaleDBy")&&r.on("mousewheel",(function(t){e.scaleDByWheel(t)})),"wheel"===this.get("scaleRBy")&&r.on("mousewheel",(function(t){n.scaleRByWheel(t)})))},e.prototype.scaleRByWheel=function(t){if(t&&t.originalEvent){t.preventDefault&&t.preventDefault();var e,n=this.get("graph"),r=this.get("delegate"),i=(r?{x:r.attr("x"),y:r.attr("y")}:void 0)||n.getPointByClient(t.clientX,t.clientY);e=t.originalEvent.wheelDelta<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||n.get("height"))&&e>1||s<(a||.05*n.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.set("delegateCenterDiff",void 0),this.magnify(t,i)}},e.prototype.scaleRByDrag=function(t){if(t){var e,n=this.get("dragPrePos"),r=this.get("graph"),i=r.getPointByClient(t.clientX,t.clientY);e=t.x-n.x<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||r.get("height"))&&e>1||s<(a||.05*r.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.magnify(t,i),this.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var e=0;e=t.originalEvent.wheelDelta<0?-.1:.1;var n=this.get("d")+e,r=this.get("maxD"),i=this.get("minD");if(n<r&&n>i){this.set("d",n);var o=this.get("r");this.set("molecularParam",(n+1)*o);var a=this.get("delegate"),s=a?{x:a.attr("x"),y:a.attr("y")}:void 0;this.set("delegateCenterDiff",void 0),this.magnify(t,s)}}},e.prototype.scaleDByDrag=function(t){var e=this.get("dragPrePos"),n=t.x-e.x>0?.1:-.1,r=this.get("d")+n,i=this.get("maxD"),o=this.get("minD");if(r<i&&r>o){this.set("d",r);var a=this.get("r");this.set("molecularParam",(r+1)*a),this.magnify(t)}this.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){this.restoreCache();var n=this.get("graph"),r=this.get("cachedMagnifiedModels"),i=this.get("cachedOriginPositions"),o=this.get("showLabel"),a=this.get("r"),s=this.get("r2"),u=this.get("d"),c=this.get("molecularParam"),f=n.getNodes(),l=f.length,h=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(h=this.get("cacheCenter"));var d=this.get("delegateCenterDiff");d&&(h.x+=d.x,h.y+=d.y),this.updateDelegate(h,a);for(var p=0;p<l;p++){var g=f[p].getModel(),v=g.x,m=g.y;if(!isNaN(v)&&!isNaN(m)){var y=(v-h.x)*(v-h.x)+(m-h.y)*(m-h.y);if(!isNaN(y)&&y<s&&0!==y){var b=Math.sqrt(y),x=c*b/(u*b+a),w=(v-h.x)/b,_=(m-h.y)/b;if(g.x=w*x+h.x,g.y=_*x+h.y,i[g.id]||(i[g.id]={x:v,y:m,texts:[]}),r.push(g),o&&2*b<a)for(var E=f[p].getContainer().getChildren(),S=E.length,M=0;M<S;M++){var O=E[M];"text"===O.get("type")&&(i[g.id].texts.push({visible:O.get("visible"),shape:O}),O.set("visible",!0))}}}}n.refreshPositions()},e.prototype.restoreCache=function(){for(var t=this.get("cachedMagnifiedModels"),e=this.get("cachedOriginPositions"),n=t.length,r=0;r<n;r++){var i=t[r],o=e[i.id];i.x=o.x,i.y=o.y;for(var a=o.texts.length,s=0;s<a;s++){var u=o.texts[s];u.shape.set("visible",u.visible)}}this.set("cachedMagnifiedModels",[]),this.set("cachedOriginPositions",{})},e.prototype.updateParams=function(t){var e=t.r,n=t.d,r=t.trigger,i=t.minD,o=t.maxD,a=t.minR,s=t.maxR,u=t.scaleDBy,c=t.scaleRBy;isNaN(t.r)||(this.set("r",e),this.set("r2",e*e)),isNaN(n)||this.set("d",n),isNaN(o)||this.set("maxD",o),isNaN(i)||this.set("minD",i),isNaN(s)||this.set("maxR",s),isNaN(a)||this.set("minR",a);var f,l=this.get("d"),h=this.get("r");(this.set("molecularParam",(l+1)*h),"mousemove"!==r&&"click"!==r&&"drag"!==r||this.set("trigger",r),"drag"===u||"wheel"===u||"unset"===u)&&(this.set("scaleDBy",u),this.get("delegate").remove(),this.get("delegate").destroy(),(f=this.get("dPercentText"))&&(f.remove(),f.destroy()));"drag"!==c&&"wheel"!==c&&"unset"!==c||(this.set("scaleRBy",c),this.get("delegate").remove(),this.get("delegate").destroy(),(f=this.get("dPercentText"))&&(f.remove(),f.destroy()))},e.prototype.updateDelegate=function(t,e){var n=this,r=this,i=r.get("graph"),o=r.get("delegate");if(!o||o.destroyed){var a=i.get("group"),s=r.get("delegateStyle")||Xd;o=a.addShape("circle",{attrs:Object(p.a)({r:e/1.5,x:t.x,y:t.y},s),name:"lens-shape",draggable:!0}),"drag"!==this.get("trigger")&&("wheel"===this.get("scaleRBy")?o.on("mousewheel",(function(t){r.scaleRByWheel(t)})):"drag"===this.get("scaleRBy")&&(o.on("dragstart",(function(t){r.set("dragging",!0),r.set("cacheCenter",{x:t.x,y:t.y}),r.set("dragPrePos",{x:t.x,y:t.y})})),o.on("drag",(function(t){r.scaleRByDrag(t)})),o.on("dragend",(function(t){r.set("dragging",!1)}))),"wheel"===this.get("scaleDBy")?o.on("mousewheel",(function(t){n.scaleDByWheel(t)})):"drag"===this.get("scaleDBy")&&(o.on("dragstart",(function(t){r.set("dragging",!0),r.set("cacheCenter",{x:t.x,y:t.y}),r.set("dragPrePos",{x:t.x,y:t.y})})),o.on("drag",(function(t){n.scaleDByDrag(t)})),o.on("dragend",(function(t){r.set("dragging",!1)}))))}else o.attr({x:t.x,y:t.y,r:e/1.5});if(r.get("showDPercent")){var u=Math.round((r.get("d")-r.get("minD"))/(r.get("maxD")-r.get("minD"))*100),c=r.get("dPercentText"),f=t.y+e/1.5+16;if(!c||c.destroyed)c=(a=i.get("group")).addShape("text",{attrs:{text:u+"%",x:t.x,y:f,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),r.set("dPercentText",c);else c.attr({text:u+"%",x:t.x,y:f})}r.set("delegate",o)},e.prototype.clear=function(){var t=this.get("graph");this.restoreCache(),t.refreshPositions();var e=this.get("delegate");e&&!e.destroyed&&(e.remove(),e.destroy());var n=this.get("dPercentText");n&&!n.destroyed&&(n.remove(),n.destroy())},e.prototype.destroy=function(){this.clear()},e}(Nd);Ld()("\n .g6-component-toolbar {\n position: absolute;\n list-style-type: none;\n padding: 6px;\n left: 0px;\n top: 0px;\n background-color: rgba(255, 255, 255, 0.9);\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n margin: 0;\n }\n .g6-component-toolbar li {\n float: left;\n text-align: center;\n width: 35px;\n height: 24px;\n cursor: pointer;\n\t\tlist-style-type:none;\n list-style: none;\n margin-left: 0px;\n }\n .g6-component-toolbar li .icon {\n opacity: 0.7;\n }\n .g6-component-toolbar li .icon:hover {\n opacity: 1;\n }\n");var Hd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(t){return'\n <ul class=\'g6-component-toolbar\'>\n <li code=\'redo\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>\n </svg>\n </li>\n <li code=\'undo\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>\n </svg>\n </li>\n <li code=\'zoomOut\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>\n </svg>\n </li>\n <li code=\'zoomIn\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">\n <path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>\n </svg>\n </li>\n <li code=\'realZoom\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">\n <path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>\n </svg>\n </li>\n <li code=\'autoZoom\'>\n <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">\n <path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>\n </svg>\n </li>\n </ul>\n '}}},e.prototype.init=function(){var t=this,e=this.get("graph"),n=this.get("getContent")(e),r=n;Object(l.w)(n)&&(r=ct(n));var i=this.get("className");r.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),Object(l.w)(o)&&(o=document.getElementById(o)),o.appendChild(r),this.set("toolBar",r);var a=this.get("handleClick");r.addEventListener("click",(function(n){var r=n.path.filter((function(t){return"LI"===t.nodeName}));if(0!==r.length){var i=r[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i,e))}}));var s=this.get("position");s&&ft(r,{top:s.y+"px",left:s.x+"px"}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),r=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&n&&r&&i&&t.on("stackchange",(function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;1===s?(e.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),n.removeAttribute("style")),0===u?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action;t.pushStack(r,Object(l.c)(n.data),"redo");var i=n.data.before;if("add"===r&&(i=n.data.after),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateItem(e.id,e,!1)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.removeItem(e.id,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}))}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var n=e.pop();if(n){var r=n.action,i=n.data.after;if(t.pushStack(r,Object(l.c)(n.data)),"delete"===r&&(i=n.data.before),!i)return;switch(r){case"visible":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=t.findById(e.id);e.visible?t.showItem(n,!1):t.hideItem(n,!1)}))}));break;case"render":case"update":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateItem(e.id,e,!1)}))}));break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach((function(e){t.removeItem(e.id,!1)})),i.nodes&&i.nodes.forEach((function(e){t.removeItem(e.id,!1)})),i.combos&&i.combos.forEach((function(e){t.removeItem(e.id,!1)}));break;case"add":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){var n=e.itemType;delete e.itemType,t.addItem(n,e,!1)}))}));break;case"updateComboTree":Object.keys(i).forEach((function(e){var n=i[e];n&&n.forEach((function(e){t.updateComboTree(e.id,e.parentId,!1)}))}))}}}},e.prototype.handleDefaultOperator=function(t,e){var n=e.getZoom();switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":if(1.25*n>5)return;e.zoomTo(1.1*n);break;case"zoomIn":if(.75*n<.3)return;e.zoomTo(.9*n);break;case"realZoom":e.zoomTo(1);break;case"autoZoom":e.fitView([20,20])}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(l.w)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var n=this.get("handleClick");n&&t.removeEventListener("click",n)},e}(Nd);Ld()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var qd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n <h4 class='tooltip-type'>类型:"+t.item.getType()+"</h4>\n <span class='tooltip-id'>ID:"+t.item.getID()+"</span>\n "},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"]}},e.prototype.getEvents=function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=ct("<div class="+(this.get("className")||"g6-component-tooltip")+"></div>"),e=this.get("container");e||(e=this.get("graph").get("container")),Object(l.w)(e)&&(e=document.getElementById(e)),ft(t,{position:"absolute",visibility:"hidden"}),e.appendChild(t),this.set("tooltip",t)},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=t.item,r=this.get("graph");this.currentTarget=n,this.showTooltip(t),r.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var n=this.get("tooltip"),r=this.get("getContent")(t);Object(l.w)(r)?n.innerHTML=r:n.innerHTML=r.outerHTML,this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&ft(t,{visibility:"hidden"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),n=this.get("tooltip");if(e(t)){var r=this.get("graph"),i=r.get("width"),o=r.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=r.getPointByClient(t.clientX,t.clientY),c=r.getCanvasByPoint(u.x,u.y),f=c.x,l=c.y;f+=a,l+=s;var h=n.getBoundingClientRect();f+h.width>i&&(f=f-h.width-a),l+h.height>o&&(l=l-h.height-s),ft(n,{left:f+"px",top:l+"px",visibility:"visible"})}else ft(n,{visibility:"hidden"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),Object(l.w)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(Nd),Qd={};function Zd(t,e){Qd[t]=e}var Kd=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){Object(l.a)(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return Object(l.y)(this.ticks,(function(e,n){return Object(l.u)(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,r=n?n(t,e):t;return Object(l.s)(r)||!Object(l.r)(r.toString)?"":r.toString()},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){Object(l.a)(this,this.__cfg__),this.setDomain(),Object(l.p)(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(Object(l.w)(t)){var n=Qd[t];if(!n)throw new Error("There is no method to to calculate ticks!");e=n(this)}else Object(l.r)(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return Object(l.k)(this.range)},t.prototype.rangeMax=function(){return Object(l.x)(this.range)},t.prototype.calcPercent=function(t,e,n){return Object(l.t)(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),$d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return Object(p.c)(e,t),e.prototype.translate=function(t){var e=Object(l.l)(this.values,t);return-1===e?Object(l.t)(t)?t:NaN:e},e.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),r=Math.round(e*n)+this.min;return r<this.min||r>this.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=e;return Object(l.t)(e)&&!this.values.includes(e)&&(i=this.values[i]),t.prototype.getText.apply(this,Object(p.f)([i],n))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(Object(l.s)(this.getConfig("min"))&&(this.min=0),Object(l.s)(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}},e}(Kd),Jd=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,tp="[^\\s]+",ep=/\[([^]*?)\]/gm;function np(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}var rp=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})).indexOf(e.toLowerCase());return r>-1?r:null}};function ip(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var op=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ap=["January","February","March","April","May","June","July","August","September","October","November","December"],sp=np(ap,3),up={dayNamesShort:np(op,3),dayNames:op,monthNamesShort:sp,monthNames:ap,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}},cp=ip({},up),fp=function(t){return cp=ip(cp,t)},lp=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},hp=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},dp={D:function(t){return String(t.getDate())},DD:function(t){return hp(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return hp(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return hp(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return hp(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return hp(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return hp(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return hp(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return hp(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return hp(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return hp(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return hp(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+hp(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+hp(Math.floor(Math.abs(e)/60),2)+":"+hp(Math.abs(e)%60,2)}},pp=function(t){return+t-1},gp=[null,"[1-9]\\d?"],vp=[null,tp],mp=["isPm",tp,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],yp=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],bp={D:["day","[1-9]\\d?"],DD:["day","\\d\\d"],Do:["day","[1-9]\\d?"+tp,function(t){return parseInt(t,10)}],M:["month","[1-9]\\d?",pp],MM:["month","\\d\\d",pp],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","[1-9]\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","[1-9]\\d?"],HH:["hour","\\d\\d"],m:["minute","[1-9]\\d?"],mm:["minute","\\d\\d"],s:["second","[1-9]\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:gp,dd:gp,ddd:vp,dddd:vp,MMM:["month",tp,rp("monthNamesShort")],MMMM:["month",tp,rp("monthNames")],a:mp,A:mp,ZZ:yp,Z:yp},xp={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},wp=function(t){return ip(xp,t)},_p=function(t,e,n){if(void 0===e&&(e=xp.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=xp[e]||e).replace(ep,(function(t,e){return r.push(e),"@@@"}));var i=ip(ip({},cp),n);return(e=e.replace(Jd,(function(e){return dp[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};function Ep(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=xp[e]||e,t.length>1e3)return null;var r={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(ep,(function(t,e){return o.push(lp(e)),"@@@"})),s={},u={};a=lp(a).replace(Jd,(function(t){var e=bp[t],n=e[0],r=e[1],o=e[3];if(s[n])throw new Error("Invalid format. "+n+" specified twice in format");return s[n]=!0,o&&(u[o]=!0),i.push(e),"("+r+")"})),Object.keys(u).forEach((function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")})),a=a.replace(/@@@/g,(function(){return o.shift()}));var c=t.match(new RegExp(a,"i"));if(!c)return null;for(var f=ip(ip({},cp),n),l=1;l<c.length;l++){var h=i[l-1],d=h[0],p=h[2],g=p?p(c[l],f):+c[l];if(null==g)return null;r[d]=g}1===r.isPm&&null!=r.hour&&12!=+r.hour?r.hour=+r.hour+12:0===r.isPm&&12==+r.hour&&(r.hour=0);for(var v=new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond),m=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],y=(l=0,m.length);l<y;l++)if(s[m[l][0]]&&r[m[l][0]]!==v[m[l][1]]())return null;return null==r.timezoneOffset?v:new Date(Date.UTC(r.year,r.month,r.day,r.hour,r.minute-r.timezoneOffset,r.second,r.millisecond))}var Sp={format:_p,parse:Ep,defaultI18n:up,setGlobalDateI18n:fp,setGlobalDateMasks:wp};function Mp(t,e){return(u.format||Sp.format)(t,e)}function Op(t){return Object(l.w)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Object(l.o)(t)&&(t=t.getTime()),t}var Ap=36e5,kp=24*Ap,Tp=31*kp,Ip=[["HH:mm:ss",1e3],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",6e4],["HH:mm",6e5],["HH:mm",18e5],["HH",Ap],["HH",6*Ap],["HH",12*Ap],["YYYY-MM-DD",kp],["YYYY-MM-DD",4*kp],["YYYY-WW",7*kp],["YYYY-MM",Tp],["YYYY-MM",4*Tp],["YYYY-MM",6*Tp],["YYYY",380*kp]];function Cp(t,e,n){var r,i=(r=function(t){return t[1]},function(t,e,n,i){for(var o=Object(l.s)(n)?0:n,a=Object(l.s)(i)?t.length:i;o<a;){var s=o+a>>>1;r(t[s])>e?a=s:o=s+1}return o})(Ip,(e-t)/n)-1,o=Ip[i];return i<0?o=Ip[0]:i>=Ip.length&&(o=Object(l.x)(Ip)),o}var Pp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return Object(p.c)(e,t),e.prototype.translate=function(t){t=Op(t);var e=this.values.indexOf(t);return-1===e&&(e=Object(l.t)(t)&&t<this.values.length?t:NaN),e},e.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):Mp(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;Object(l.f)(e,(function(t,n){e[n]=Op(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}($d),Dp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return Object(p.c)(e,t),e.prototype.scale=function(t){if(Object(l.s)(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=Object(l.k)(e),r=Object(l.x)(e);n<this.min&&(this.min=n),r>this.max&&(this.max=r),Object(l.s)(this.minLimit)||(this.min=n),Object(l.s)(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=Object(l.j)(this.values),e=t.min,n=t.max;Object(l.s)(this.min)&&(this.min=e),Object(l.s)(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=Object(l.g)(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(Kd),Np=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return Object(p.c)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(Dp);function Rp(t,e){var n=Math.E;return e>=0?Math.pow(n,Math.log(e)/t):-1*Math.pow(n,Math.log(-e)/t)}function jp(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function Bp(t,e,n){Object(l.s)(n)&&(n=Math.max.apply(null,t));var r=n;return Object(l.f)(t,(function(t){t>0&&t<r&&(r=t)})),r===n&&(r=n/e),r>1&&(r=1),r}var Lp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return Object(p.c)(e,t),e.prototype.invert=function(t){var e,n=this.base,r=jp(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=jp(n,a/n)))*o;if(t<s)return t/s*a}else e=jp(n,this.min);var u=(t-i)/o*(r-e)+e;return Math.pow(n,u)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(e<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=Bp(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(t<=0)return 0;var r=this.base,i=this.positiveMin;return i&&(n=1*i/r),t<i?t/i/(jp(r,e)-jp(r,n)):(jp(r,t)-jp(r,n))/(jp(r,e)-jp(r,n))},e}(Dp),Gp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return Object(p.c)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,r=Rp(n,this.max),i=Rp(n,this.min),o=e*(r-i)+i,a=o>=0?1:-1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(Rp(r,t)-Rp(r,n))/(Rp(r,e)-Rp(r,n))},e}(Dp),Fp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return Object(p.c)(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):Mp(n,this.mask)},e.prototype.scale=function(e){var n=e;return(Object(l.w)(n)||Object(l.o)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return Op(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(Object(l.s)(e)&&Object(l.t)(e)||(this.min=this.translate(this.min)),Object(l.s)(n)&&Object(l.t)(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;Object(l.f)(t,(function(t){var e=Op(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a<e&&(a=e),r.push(e)})),t.length>1&&(this.minTickInterval=o-i),Object(l.s)(e)&&(this.min=i),Object(l.s)(n)&&(this.max=a)}},e}(Np),Up=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return Object(p.c)(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return Object(l.x)(e);if(i<0)return Object(l.k)(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(Object(l.x)(e)!==this.max&&e.push(this.max),Object(l.k)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<Object(l.k)(e))return 0;if(t>Object(l.x)(e))return 1;var n=0;return Object(l.f)(e,(function(e,r){if(!(t>=e))return!1;n=r})),n/(e.length-1)},e}(Dp),zp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return Object(p.c)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Up),Wp={};function Vp(t,e){if(function(t){return Wp[t]}(t))throw new Error("type '"+t+"' existed.");Wp[t]=e}var Xp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return Object(p.c)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&Object(l.t)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return t<e[0]||t>e[1]?NaN:this.values[0]},e}(Kd),Yp=[1,5,2,2.5,4,3],Hp=100*Number.EPSILON;function qp(t,e,n,r,i,o){var a=Object(l.C)(e),s=Object(l.l)(e,t),u=0,c=function(t,e){return(t%e+e)%e}(r,o);return(c<Hp||o-c<Hp)&&r<=0&&i>=0&&(u=1),1-s/(a-1)-n+u}function Qp(t,e,n){var r=Object(l.C)(e);return 1-Object(l.l)(e,t)/(r-1)-n+1}function Zp(t,e,n,r,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Kp(t,e){return t>=e?2-(t-1)/(e-1):1}function $p(t,e,n,r){var i=e-t;return 1-.5*(Math.pow(e-r,2)+Math.pow(t-n,2))/Math.pow(.1*i,2)}function Jp(t,e,n){var r=e-t;if(n>r){var i=(n-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function tg(t,e,n,r,i,o){if(void 0===n&&(n=5),void 0===r&&(r=!0),void 0===i&&(i=Yp),void 0===o&&(o=[.25,.2,.5,.05]),"number"!=typeof t||"number"!=typeof e)return{min:0,max:0,ticks:[]};if(t===e||1===n)return{min:t,max:e,ticks:[t]};for(var a={score:-2,lmin:0,lmax:0,lstep:0},s=1;s<1/0;){for(var u=0,c=i;u<c.length;u++){var f=c[u],h=Qp(f,i,s);if(Number.isNaN(h))throw new Error("NaN");if(o[0]*h+o[1]+o[2]+o[3]<a.score){s=1/0;break}for(var d=2;d<1/0;){var p=Kp(d,n);if(o[0]*h+o[1]+o[2]*p+o[3]<a.score)break;for(var g=(e-t)/(d+1)/s/f,v=Math.ceil(Math.log10(g));v<1/0;){var m=s*f*Math.pow(10,v),y=Jp(t,e,m*(d-1));if(o[0]*h+o[1]*y+o[2]*p+o[3]<a.score)break;var b=Math.floor(e/m)*s-(d-1)*s,x=Math.ceil(t/m)*s;if(b>x)v+=1;else{for(var w=b;w<=x;w+=1){var _=w*(m/s),E=_+m*(d-1),S=m,M=qp(f,i,s,_,E,S),O=$p(t,e,_,E),A=Zp(d,n,t,e,_,E),k=o[0]*M+o[1]*O+o[2]*A+1*o[3];k>a.score&&(!r||_<=t&&E>=e)&&(a.lmin=_,a.lmax=E,a.lstep=S,a.score=k)}v+=1}}d+=1}}s+=1}for(var T=Number.isInteger(a.lstep)?0:Math.ceil(Math.abs(Math.log10(a.lstep))),I=[],C=a.lmin;C<=a.lmax;C+=a.lstep)I.push(C);var P=T?Object(l.y)(I,(function(t){return Number.parseFloat(t.toFixed(T))})):I;return{min:Math.min(t,Object(l.k)(P)),max:Math.max(e,Object(l.x)(P)),ticks:P}}function eg(t){var e=t.values,n=t.tickInterval,r=t.tickCount,i=e;if(Object(l.t)(n))return Object(l.g)(i,(function(t,e){return e%n==0}));var o=t.min,a=t.max;if(Object(l.s)(o)&&(o=0),Object(l.s)(a)&&(a=e.length-1),Object(l.t)(r)&&r<a-o){var s=tg(o,a,r,!1,[1,2,5,3,4,7,6,8,9]).ticks;return Object(l.g)(s,(function(t){return t>=o&&t<=a})).map((function(t){return e[t]}))}return e.slice(o,a+1)}var ng=Math.sqrt(50),rg=Math.sqrt(10),ig=Math.sqrt(2),og=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var r,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u<s&&(s=(e=[u,s])[0],u=e[1],o=(n=[a,o])[0],a=n[1]),(r=ag(s,u,t))>0?r=ag(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,t):r<0&&(r=ag(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,t)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,this.domain(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(r=e<t)&&(i=t,t=e,e=i);if(0===(a=ag(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;r&&o.reverse();return o}(this._domain[0],this._domain[this._domain.length-1],t||5)},t}();function ag(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=ng?10:o>=rg?5:o>=ig?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ng?10:o>=rg?5:o>=ig?2:1)}function sg(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function ug(t,e,n){var r=sg(t,n,"floor"),i=sg(e,n,"ceil");r=Object(l.h)(r,n),i=Object(l.h)(i,n);for(var o=[],a=r;a<=i;a+=n){var s=Object(l.h)(a,n);o.push(s)}return{min:r,max:i,ticks:o}}function cg(t,e,n){var r,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,c=void 0===u?5:u,f=Object(l.s)(i)?Object(l.s)(e)?a:e:i,h=Object(l.s)(o)?Object(l.s)(n)?s:n:o;if(f>h&&(h=(r=[f,h])[0],f=r[1]),c<=2)return[f,h];for(var d=(h-f)/(c-1),p=[],g=0;g<c;g++)p.push(f+d*g);return p}function fg(t,e,n){void 0===n&&(n=5);var r={max:0,min:0,ticks:[]};if(t===e)return{max:e,min:t,ticks:[t]};var i=(e-t)/n,o=Math.pow(10,Math.floor(Math.log10(i))),a=o<1?Math.ceil(Math.abs(Math.log10(o))):0,s=o;2*o-i<1.5*(i-s)&&5*o-i<2.75*(i-(s=2*o))&&10*o-i<1.5*(i-(s=5*o))&&(s=10*o);var u=Math.ceil(e/s),c=Math.floor(t/s);r.max=Math.max(u*s,e),r.min=Math.min(c*s,t);for(var f=Number.parseFloat((c*s).toFixed(a));f<e;)r.ticks.push(f),f+=s,a&&(f=Number.parseFloat(f.toFixed(a)));return r.ticks.push(f),r}function lg(t,e){var n=t.length*e;return 1===e?t[t.length-1]:0===e?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function hg(t){return new Date(t).getFullYear()}function dg(t){return new Date(t,0,1).getTime()}function pg(t){return new Date(t).getMonth()}function gg(t,e){return new Date(t,e,1).getTime()}function vg(t){return function(t){return Object(l.y)(t,(function(t,e){return[0===e?"M":"L",t[0],t[1]]}))}(t)}function mg(t,e,n,r){void 0===r&&(r=!0);var i=new Np({values:t}),o=new $d({values:Object(l.y)(t,(function(t,e){return e}))}),a=Object(l.y)(t,(function(t,r){return[o.scale(r)*e,n-i.scale(t)*n]}));return r?function(t){if(t.length<=2)return vg(t);var e=[];Object(l.f)(t,(function(t){Object(l.q)(t,e.slice(e.length-2))||e.push(t[0],t[1])}));var n=te(e,!1),r=Object(l.k)(t),i=r[0],o=r[1];return n.unshift(["M",i,o]),n}(a):vg(a)}function yg(t,e,n){for(var r=new Np({values:t}),i=new $d({values:Object(l.y)(t,(function(t,e){return e}))}),o=Object(l.y)(t,(function(t,o){return[i.scale(o)*e,n-r.scale(t)*n]})),a=[],s=0;s<o.length;s++){var u=o[s],c=xg({x:u[0],y:u[1],y0:n,size:5});a.push.apply(a,c)}return function(t,e){void 0===e&&(e=!0);var n=[],r=t[0];n.push(["M",r.x,r.y]);for(var i=1,o=t.length;i<o;i++)n.push(["L",t[i].x,t[i].y]);e&&(n.push(["L",r.x,r.y]),n.push(["z"]));return n}(a)}function bg(t,e,n,r){var i=Object(p.f)(t),o=function(t,e){var n=new Np({values:t}),r=Math.max(0,n.min);return e-n.scale(r)*e}(r,n);return i.push(["L",e,o]),i.push(["L",0,o]),i.push(["Z"]),i}function xg(t){var e,n,r,i,o=t.x,a=t.y,s=t.y0,u=t.size;Object(l.m)(a)?(e=a[0],n=a[1]):(e=s,n=a),Object(l.m)(o)?(r=o[0],i=o[1]):(r=o-u/2,i=o+u/2);var c=[{x:r,y:e},{x:r,y:n}];return c.push({x:i,y:n},{x:i,y:e}),c}Zd("cat",eg),Zd("time-cat",(function(t){var e=eg(t),n=Object(l.x)(t.values);return n!==Object(l.x)(e)&&e.push(n),e})),Zd("wilkinson-extended",(function(t){var e=t.min,n=t.max,r=t.tickCount,i=t.nice,o=t.tickInterval,a=t.minLimit,s=t.maxLimit,u=tg(e,n,r,i).ticks;return Object(l.s)(a)&&Object(l.s)(s)?o?ug(e,n,o).ticks:u:cg(t,Object(l.k)(u),Object(l.x)(u))})),Zd("r-pretty",(function(t){var e=t.min,n=t.max,r=t.tickCount,i=t.tickInterval,o=t.minLimit,a=t.maxLimit,s=fg(e,n,r).ticks;return Object(l.s)(o)&&Object(l.s)(a)?i?ug(e,n,i).ticks:s:cg(t,Object(l.k)(s),Object(l.x)(s))})),Zd("time",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickInterval,o=t.tickCount;if(i)o=Math.ceil((n-e)/i);else{var a=(n-e)/(i=Cp(e,n,o)[1])/o;a>1&&(i*=Math.ceil(a)),r&&i<r&&(i=r)}for(var s=[],u=e;u<n+i;u+=i)s.push(u);return s})),Zd("time-pretty",(function(t){var e=t.min,n=t.max,r=t.minTickInterval,i=t.tickCount,o=t.tickInterval,a=[];o||(o=(n-e)/i,r&&o<r&&(o=r));var s=hg(e);if(o>31536e6)for(var u=hg(n),c=Math.ceil(o/31536e6),f=s;f<=u+c;f+=c)a.push(dg(f));else if(o>Tp){var l=Math.ceil(o/Tp),h=pg(e),d=function(t,e){var n=hg(t),r=hg(e),i=pg(t);return 12*(r-n)+(pg(e)-i)%12}(e,n);for(f=0;f<=d+l;f+=l)a.push(gg(s,f+h))}else if(o>kp){var p=(b=new Date(e)).getFullYear(),g=b.getMonth(),v=b.getDate(),m=Math.ceil(o/kp),y=function(t,e){return Math.ceil((e-t)/kp)}(e,n);for(f=0;f<y+m;f+=m)a.push(new Date(p,g,v+f).getTime())}else if(o>Ap){p=(b=new Date(e)).getFullYear(),g=b.getMonth(),m=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/Ap),_=function(t,e){return Math.ceil((e-t)/Ap)}(e,n);for(f=0;f<=_+w;f+=w)a.push(new Date(p,g,m,x+f).getTime())}else if(o>6e4){var E=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),S=Math.ceil(o/6e4);for(f=0;f<=E+S;f+=S)a.push(e+6e4*f)}else{var M=o;M<1e3&&(M=1e3);var O=1e3*Math.floor(e/1e3),A=Math.ceil((n-e)/1e3),k=Math.ceil(M/1e3);for(f=0;f<A+k;f+=k)a.push(O+1e3*f)}return a.length>=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a})),Zd("log",(function(t){var e,n=t.base,r=t.tickCount,i=t.min,o=t.max,a=t.values,s=jp(n,o);if(i>0)e=Math.floor(jp(n,i));else{var u=Bp(a,n,o);e=Math.floor(jp(n,u))}for(var c=s-e,f=Math.ceil(c/r),l=[],h=e;h<s+f;h+=f)l.push(Math.pow(n,h));return i<=0&&l.unshift(0),l})),Zd("pow",(function(t){var e=t.exponent,n=t.tickCount,r=Math.ceil(Rp(e,t.max));return fg(Math.floor(Rp(e,t.min)),r,n).ticks.map((function(t){var n=t>=0?1:-1;return Math.pow(t,e)*n}))})),Zd("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var r=n.slice().sort((function(t,e){return t-e})),i=[],o=0;o<e;o++){var a=o/(e-1);i.push(lg(r,a))}return i})),Zd("d3-linear",(function(t){var e=t.min,n=t.max,r=t.tickInterval,i=t.minLimit,o=t.maxLimit,a=function(t){var e=t.min,n=t.max,r=t.nice,i=t.tickCount,o=new og;return o.domain([e,n]),r&&o.nice(i),o.ticks(i)}(t);return Object(l.s)(i)&&Object(l.s)(o)?r?ug(e,n,r).ticks:a:cg(t,Object(l.k)(a),Object(l.x)(a))})),Vp("cat",$d),Vp("category",$d),Vp("identity",Xp),Vp("linear",Np),Vp("log",Lp),Vp("pow",Gp),Vp("time",Fp),Vp("timeCat",Pp),Vp("quantize",Up),Vp("quantile",zp);var wg={stroke:"#C5C5C5",strokeOpacity:.85},_g={fill:"#CACED4",opacity:.85},Eg=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=void 0===o?200:o,s=t.height,u=void 0===s?26:s,c=t.smooth,f=void 0===c||c,l=t.isArea,h=void 0!==l&&l,d=t.data,p=void 0===d?[]:d,g=t.lineStyle,v=t.areaStyle,m=t.group,y=t.interval,b=void 0===y?null:y;this.group=m,this.x=n,this.y=i,this.width=a,this.height=u,this.data=p,this.smooth=f,this.isArea=h,this.lineStyle=Object.assign({},wg,g),this.areaStyle=Object.assign({},_g,v),this.intervalConfig=b,this.renderLine()}return t.prototype.renderLine=function(){var t=this,e=t.x,n=t.y,r=t.width,i=t.height,o=t.data,a=t.smooth,s=t.isArea,u=(t.backgroundStyle,t.lineStyle),c=t.areaStyle,f=this.group.addGroup({name:"trend-group"});if(o){var l=mg(o,r,i,a);if(f.addShape("path",{attrs:Object(p.a)({path:l},u)}),s){var h=bg(l,r,i,o);f.addShape("path",{attrs:Object(p.a)({path:h},c)})}}this.intervalConfig&&f.addShape("path",{attrs:Object(p.a)({path:yg(this.intervalConfig.data,r,i)},this.intervalConfig.style)}),f.move(e,n)},t.prototype.destory=function(){this.group.destroy()},t}(),Sg={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},Mg={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize"},Og=function(){function t(t){var e=t.group,n=t.name,r=t.type,i=t.x,o=void 0===i?0:i,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?2:u,f=t.height,l=void 0===f?24:f,h=t.style,d=void 0===h?{}:h;this.group=e,this.name=n,this.handleType=r,this.x=o,this.y=s,this.width=c,this.height=l,"trend"===r?this.style=Object(p.a)(Object(p.a)({},Sg),d):"simple"===r&&(this.style=Object(p.a)(Object(p.a)({},Mg),d)),this.renderHandle()}return t.prototype.setX=function(t){this.setXY(t,void 0)},t.prototype.setY=function(t){this.setXY(void 0,t)},t.prototype.setXY=function(t,e){Object(l.t)(t)&&(this.x=t),Object(l.t)(e)&&(this.y=e),this.updateXY()},t.prototype.renderHandle=function(){var t=this.width,e=this.height,n=this.style,r=this.name,i=n.fill,o=n.stroke,a=n.radius,s=n.opacity,u=n.cursor;this.handleGroup=this.group.addGroup(),"trend"===this.handleType?(this.background=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:t,height:e,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"}),this.handleGroup.addShape("circle",{attrs:{x:t/2,y:0,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"}),this.handleGroup.addShape("circle",{attrs:{x:t/2,y:e,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"})):"simple"===this.handleType&&(this.handleGroup.addShape("circle",{attrs:{x:t/2,y:e/2,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"}),this.handleGroup.addShape("circle",{attrs:{x:t/2,y:e/2,r:2*t,fill:i,stroke:o,radius:a,opacity:s,cursor:u},name:r+"-handler"})),this.updateXY(),"trend"===this.handleType&&this.bindEvents()},t.prototype.bindEvents=function(){var t=this,e=this.name;this.handleGroup.on(e+"-handler:mouseenter",(function(){var e=t.style.highLightFill;t.background.attr("fill",e)})),this.handleGroup.on(e+"-handler:mouseleave",(function(){var e=t.style.fill;t.background.attr("fill",e)}))},t.prototype.show=function(){this.handleGroup.show()},t.prototype.hide=function(){this.handleGroup.hide()},t.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},t}(),Ag=function(){function t(t){this.config=Object(l.e)({},t),this.init()}return t.prototype.update=function(t){this.config=Object(l.e)({},this.config,t),this.updateElement(),this.renderMarker()},t.prototype.init=function(){this.initElement(),this.renderMarker()},t.prototype.initElement=function(){var t=this.config,e=t.group,n=t.style;this.circle=e.addShape("circle",{attrs:Object(p.a)({x:this.config.x,y:this.config.y,r:this.config.r},n)}),this.startMarker=e.addShape("path",{attrs:{path:this.getStartMarkerPath(),fill:"#ccc"},name:"playPauseBtn"}),this.pauseGroupMarker=e.addGroup();var r=1/4*this.config.r,i=.5*this.config.r*Math.sqrt(3);this.pauseGroupMarker.addShape("rect",{attrs:{x:this.config.x-.375*this.config.r,y:this.config.y-i/2,width:2.5*r,height:i,fill:"#fff"},name:"playPauseBtn"}),this.pauseLeftMarker=this.pauseGroupMarker.addShape("rect",{attrs:{x:this.config.x-.375*this.config.r,y:this.config.y-i/2,width:r,height:i,fill:"#ccc"},name:"playPauseBtn"}),this.pauseRightMarker=this.pauseGroupMarker.addShape("rect",{attrs:{x:this.config.x+1/8*this.config.r,y:this.config.y-i/2,width:r,height:i,fill:"#ccc"},name:"playPauseBtn"})},t.prototype.updateElement=function(){this.circle.attr("x",this.config.x),this.circle.attr("y",this.config.y),this.circle.attr("r",this.config.r),this.startMarker.attr("path",this.getStartMarkerPath());var t=1/4*this.config.r,e=.5*this.config.r*Math.sqrt(3);this.pauseLeftMarker.attr("x",this.config.x-.375*this.config.r),this.pauseLeftMarker.attr("y",this.config.y-e/2),this.pauseLeftMarker.attr("width",t),this.pauseLeftMarker.attr("height",e),this.pauseRightMarker.attr("x",this.config.x+1/8*this.config.r),this.pauseRightMarker.attr("y",this.config.y-e/2),this.pauseRightMarker.attr("width",t),this.pauseRightMarker.attr("height",e)},t.prototype.renderMarker=function(){this.config.isPlay?(this.startMarker.hide(),this.pauseGroupMarker.show()):(this.startMarker.show(),this.pauseGroupMarker.hide())},t.prototype.getStartMarkerPath=function(){var t=.5*this.config.r*Math.sqrt(3);return[["M",this.config.x-t/Math.sqrt(3)/2,this.config.y-t/2],["L",this.config.x+t/Math.sqrt(3),this.config.y],["L",this.config.x-t/Math.sqrt(3)/2,this.config.y+t/2]]},t}(),kg={fill:"#607889",stroke:"#607889"},Tg={fill:"#fff"},Ig={fill:"green"},Cg={speed:2,loop:!1,fill:"#fff",stroke:"#fff",hiddleToggle:!1,preBtnStyle:{fill:"#ccc",stroke:"#ccc"},nextBtnStyle:{fill:"#ccc",stroke:"#ccc"},playBtnStyle:{fill:"#fff",stroke:"#ccc"}},Pg=function(){function t(t){this.controllerCfg=Object(l.e)({},Cg,t),this.group=t.group,this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType="range",this.init()}return t.prototype.init=function(){this.renderPlayButton()},t.prototype.getNextMarkerPath=function(t,e,n){return[["M",t,e-n],["L",t+n,e],["L",t,e+n]]},t.prototype.getPreMarkerPath=function(t,e,n){return[["M",t,e-n],["L",t-n,e],["L",t,e+n]]},t.prototype.renderPlayButton=function(){var t=this.controllerCfg,e=t.width,n=t.height,r=t.x,i=t.y,o=t.hiddleToggle,a=t.fill,s=void 0===a?"#ccc":a,u=t.stroke,c=void 0===u?"green":u,f=t.playBtnStyle,l=void 0===f?kg:f,h=t.preBtnStyle,d=void 0===h?Tg:h,g=t.nextBtnStyle,v=void 0===g?Ig:g,m=n/2-5,y=i+10,b=this.group.addShape("rect",{attrs:{x:r,y:y,width:e,height:n,stroke:c,fill:s},name:"container-rect"});this.playButton?this.playButton.update({x:e/2,y:y,r:m}):this.playButton=new Ag({group:this.group,x:e/2,y:y+m+5,r:m,isPlay:this.isPlay,style:l}),this.group.addShape("path",{attrs:Object(p.a)({path:this.getPreMarkerPath(e/2-5*m,y+m+5,.5*m)},d),name:"preStepBtn"}),this.group.addShape("path",{attrs:Object(p.a)({path:this.getPreMarkerPath(e/2-4.5*m,y+m+5,.5*m)},d),name:"preStepBtn"}),this.group.addShape("path",{attrs:Object(p.a)({path:this.getNextMarkerPath(e/2+5*m,y+m+5,.5*m)},v),name:"nextStepBtn"}),this.group.addShape("path",{attrs:Object(p.a)({path:this.getNextMarkerPath(e/2+4.5*m,y+m+5,.5*m)},v),name:"nextStepBtn"}),b.toBack(),this.renderSpeedBtn(),o||this.renderToggleTime(),this.bindEvent()},t.prototype.renderSpeedBtn=function(){var t=this.controllerCfg,e=t.y,n=t.width,r=t.hiddleToggle,i=this.group.addGroup({name:"speed-group"});this.speedGroup=i;for(var o=1,a=[],s=9,u=0;u<5;u++){var c=e+15+u*(u+1)+o;i.addShape("rect",{attrs:{x:n-(r?50:110),y:c,width:15,height:2,fill:"#ccc"},speed:s,name:"speed-rect"}),this.speedAxisY.push(c),a.push(s),s-=2,o++}for(u=0;u<4;u++)i.addShape("rect",{attrs:{x:n-(r?50:110),y:this.speedAxisY[u]+2,width:15,height:2*u+1,fill:"#fff",opacity:.3},speed:a[u]-1,name:"speed-rect"});this.speedText=i.addShape("text",{attrs:{x:n-(r?50:110)+20,y:this.speedAxisY[1]+15,text:"1.0X",fill:"#ccc"}}),this.speedPoint=i.addShape("path",{attrs:{path:this.getPath(n-(r?50:110),this.speedAxisY[4]),fill:"#ccc"}})},t.prototype.getPath=function(t,e){return[["M",t,e],["L",t-12,e-6],["L",t-12,e+6],["Z"]]},t.prototype.renderToggleTime=function(){var t=this.controllerCfg.width;this.toggleGroup=this.group.addGroup({name:"toggle-group"}),this.toggleGroup.addShape("rect",{attrs:{width:14,height:14,x:t-50,y:this.speedAxisY[1],fill:"#fff",stroke:"#ccc",lineWidth:2,radius:3},isChecked:!1,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:{path:[["M",t-50+3,this.speedAxisY[1]+6],["L",t-50+7,this.speedAxisY[1]+10],["L",t-50+12,this.speedAxisY[1]+4]],stroke:"green",lineWidth:3},capture:!1}),this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:{text:"单一时间",x:t-50+20,y:this.speedAxisY[1]+15,fill:"#ccc"}})},t.prototype.bindEvent=function(){var t=this,e=this.controllerCfg,n=e.width,r=e.hiddleToggle;this.speedGroup.on("speed-rect:click",(function(e){t.speedPoint.attr("path",t.getPath(n-(r?50:110),e.y)),t.currentSpeed=e.target.get("speed"),t.speedText.attr("text",t.currentSpeed+".0X"),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})})),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",(function(e){var n=e.target.get("isChecked");n?(t.checkedIcon.hide(),t.checkedText.attr("text","单一时间"),t.currentType="range"):(t.checkedIcon.show(),t.checkedText.attr("text","时间范围"),t.currentType="single"),e.target.set("isChecked",!n),t.group.emit("timebarConfigChanged",{type:t.currentType,speed:t.currentSpeed})}))},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),Dg={fill:"#416180",opacity:.05},Ng={fill:"#416180",opacity:.15,radius:5},Rg={fill:"#5B8FF9",opacity:.3,cursor:"move"},jg={width:2,height:24},Bg={textBaseline:"middle",fill:"#000",opacity:.45},Lg=function(){function t(t){var e=this;this.prevX=0,this.onMouseDown=function(t){return function(n){e.currentHandler=t;var r=n.originalEvent;r.stopPropagation(),r.preventDefault(),e.prevX=Object(l.i)(r,"touches.0.pageX",r.pageX);var i=e.canvas.get("container");i.addEventListener("mousemove",e.onMouseMove),i.addEventListener("mouseup",e.onMouseUp),i.addEventListener("mouseleave",e.onMouseUp),i.addEventListener("touchmove",e.onMouseMove),i.addEventListener("touchend",e.onMouseUp),i.addEventListener("touchcancel",e.onMouseUp)}},this.onMouseMove=function(t){t.stopPropagation(),t.preventDefault();var n=Object(l.i)(t,"touches.0.pageX",t.pageX),r=n-e.prevX,i=e.adjustOffsetRange(r/e.width);e.updateStartEnd(i),e.updateUI(),e.prevX=n},this.onMouseUp=function(){e.currentHandler&&(e.currentHandler=void 0);var t=e.canvas.get("container");t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))};var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?100:a,u=t.height,c=t.padding,f=void 0===c?10:c,h=t.trendCfg,d=t.controllerCfg,g=void 0===d?{speed:1}:d,v=t.backgroundStyle,m=void 0===v?{}:v,y=t.foregroundStyle,b=void 0===y?{}:y,x=t.handlerStyle,w=void 0===x?{}:x,_=t.textStyle,E=void 0===_?{}:_,S=t.start,M=void 0===S?0:S,O=t.end,A=void 0===O?1:O,k=t.minText,T=void 0===k?"":k,I=t.maxText,C=void 0===I?"":I,P=t.group,D=t.graph,N=t.canvas,R=t.ticks,j=t.type;this.graph=D,this.canvas=N,this.group=P,this.timeBarType=j,this.x=r,this.y=o,this.width=s,this.height=u,this.padding=f,this.ticks=R,this.trendCfg=h,this.controllerCfg=g,this.currentSpeed=g.speed,"trend"===j?this.backgroundStyle=Object(p.a)(Object(p.a)({},Dg),m):"simple"===j&&(this.backgroundStyle=Object(p.a)(Object(p.a)({},Ng),m)),this.foregroundStyle=Object(p.a)(Object(p.a)({},Rg),b),this.handlerStyle=Object(p.a)(Object(p.a)({},jg),w),this.textStyle=Object(p.a)(Object(p.a)({},Bg),E),this.currentMode="range",this.start=M,this.end=A,this.minText=T,this.maxText=C,this.renderSlider()}return t.prototype.update=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.minText,a=t.maxText,s=t.start,u=t.end;this.start=Math.min(1,Math.max(s,0)),this.end=Math.min(1,Math.max(u,0)),Object(l.a)(this,{x:e,y:n,width:r,height:i,minText:o,maxText:a}),this.updateUI()},t.prototype.setText=function(t,e){this.minTextShape.attr("text",t),this.maxTextShape.attr("text",e)},t.prototype.renderSlider=function(){var t=this,e=this.width,n=this.height,r=this.timeBarType;if("trend"===r&&Object(l.C)(Object(l.i)(this.trendCfg,"data"))){var i=new Eg(Object(p.a)(Object(p.a)({x:this.x,y:this.y,width:e,height:n},this.trendCfg),{group:this.group}));this.trendComponent=i}var o=this.group.addGroup({name:"slider-group"});o.addShape("rect",{attrs:Object(p.a)({x:0,y:0,width:e,height:n},this.backgroundStyle)});var a=this.group.addGroup();"trend"===r?(this.minTextShape=a.addShape("text",{attrs:Object(p.a)({x:0,y:n/2+this.y,textAlign:"right",text:this.minText,silent:!1},this.textStyle),capture:!1}),this.maxTextShape=a.addShape("text",{attrs:Object(p.a)({y:n/2+this.y,textAlign:"left",text:this.maxText,silent:!1},this.textStyle),capture:!1})):(this.minTextShape=a.addShape("text",{attrs:Object(p.a)({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1},this.textStyle),capture:!1}),this.maxTextShape=a.addShape("text",{attrs:Object(p.a)({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1},this.textStyle),capture:!1})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:Object(p.a)({x:0,y:this.y,height:n},this.foregroundStyle)});var s=Object(l.i)(this.handlerStyle,"width",2),u=Object(l.i)(this.handlerStyle,"height",24),c=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new Og(Object(p.a)({name:"minHandlerShape",group:c,type:r,x:this.x,y:this.y,width:s,height:u,cursor:"ew-resize"},this.handlerStyle));var f=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new Og(Object(p.a)({name:"maxHandlerShape",group:f,type:r,x:this.x,y:this.y,width:s,height:u,cursor:"ew-resize"},this.handlerStyle));var h=this.ticks,d=e/(h.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach((function(t){t.destroy()}));var g=-1/0;this.textList=h.map((function(e,r){t.tickPosList.push(t.x+r*d);var i=t.group.addShape("text",{attrs:{x:t.x+r*d,y:t.y+n+5,text:e,textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35}}),o=t.group.addShape("line",{attrs:{x1:t.x+r*d,y1:t.y+n+2,x2:t.x+r*d,y2:t.y+n+6,lineWidth:1,stroke:"#ccc"}}),a=i.getBBox();return a.minX>g?(i.show(),o.show(),g=a.minX+a.width+10):(i.hide(),o.hide()),i})),this.controllerBtnGroup=new Pg({group:this.group,x:this.x,y:this.y+n+25,width:e,height:40}),this.updateUI(),o.move(this.x,this.y),this.bindEvents()},t.prototype.bindEvents=function(){var t=this,e=this.group.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var n=this.group.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),n.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("playPauseBtn:click",(function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()})),this.group.on("nextStepBtn:click",(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()})),this.group.on("preStepBtn:click",(function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()})),this.group.on("timebarConfigChanged",(function(e){var n=e.type,r=e.speed;t.currentSpeed=r,t.currentMode=n,"single"===n?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):"range"===n&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())}))},t.prototype.adjustTickIndex=function(t){for(var e=0;e<this.tickPosList.length-1;e++)if(this.tickPosList[e]<=t&&t<=this.tickPosList[e+1])return Math.abs(this.tickPosList[e]-t)<Math.abs(t-this.tickPosList[e+1])?e:e+1},t.prototype.adjustOffsetRange=function(t){switch(this.currentHandler){case this.minHandlerShape:var e=0-this.start,n=1-this.start;return Math.min(n,Math.max(e,t));case this.maxHandlerShape:e=0-this.end,n=1-this.end;return Math.min(n,Math.max(e,t));case this.foregroundShape:e=0-this.start,n=1-this.end;return Math.min(n,Math.max(e,t));default:return 0}},t.prototype.updateStartEnd=function(t){switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=t,this.minText=this.ticks[this.adjustTickIndex(this.start*this.width)];break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=t,this.maxText=this.ticks[this.adjustTickIndex(this.end*this.width)];break;case this.foregroundShape:this.start+=t,this.end+=t,this.minText=this.ticks[this.adjustTickIndex(this.start*this.width)],this.maxText=this.ticks[this.adjustTickIndex(this.end*this.width)]}},t.prototype.updateUI=function(){var t=this;this.start<0&&(this.start=0),this.end>1&&(this.end=1);var e=this.start*this.width,n=this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",n-e);var r=Object(l.i)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,n]),o=i[0],a=i[1];this.minHandlerShape.setX(e-r/2),Object(l.f)(o,(function(e,n){return t.minTextShape.attr(n,e)})),this.maxHandlerShape.setX(n-r/2),Object(l.f)(a,(function(e,n){return t.maxTextShape.attr(n,e)})),"range"===this.currentMode?this.graph.emit("valueChange",{value:[this.start,this.end].sort()}):"single"===this.currentMode&&this.graph.emit("valueChange",{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,n,r=Object(l.i)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(n=[o,i])[0],o=n[1],u=!0);var c=i.getBBox(),f=o.getBBox(),h=null,d=null;return"trend"===this.timeBarType?(h=c.width>a-2?{x:a+r/2+2,textAlign:"left"}:{x:a-r/2-2,textAlign:"right"},d=f.width>this.width-s-2?{x:s-r/2-2,textAlign:"right"}:{x:s+r/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(h=c.width>a-2?{x:a+r/2+2,textAlign:"center"}:{x:a-r/2-2,textAlign:"center"},d=f.width>this.width-s-2?{x:s-r/2-2,textAlign:"center"}:{x:s+r/2+2,textAlign:"center"}),u?[d,h]:[h,d]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t,n=e.ticks,r=e.width,i=t.currentSpeed,o=r/n.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timelinestart",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timelineend",null))},t.prototype.destory=function(){this.graph.off("valueChange");var t=this.group,e=t.find((function(t){return"minHandlerShape"===t.get("name")}));e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var n=t.find((function(t){return"maxHandlerShape"===t.get("name")}));n&&(n.off("maxHandlerShape-handler:mousedown"),n.off("maxHandlerShape-handler:touchstart"),n.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("playPauseBtn:click"),t.off("nextStepBtn:click"),t.off("preStepBtn:click"),t.off("timebarConfigChanged"),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),Gg=function(){function t(t){var e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,c=t.className,f=void 0===c?"g6-component-timebar-tooltip":c,l=t.backgroundColor,h=void 0===l?"#000":l,d=t.textColor,p=void 0===d?"#fff":d,g=t.opacity,v=void 0===g?.8:g,m=t.fontSize,y=void 0===m?12:m;this.container=o,this.className=f,this.backgroundColor=h,this.textColor=p,this.x=n,this.y=i,this.text=a,this.padding=u,this.opacity=v,this.fontSize=y,this.render()}return t.prototype.render=function(){var t=this.className,e=(this.x,this.y,this.backgroundColor),n=this.textColor,r=this.text,i=this.padding,o=this.opacity,a=this.fontSize,s=this.container,u=ct("<div class='"+t+"' style=\"position: absolute; width: fit-content; height: fit-content; opacity: "+o+'"></div>');Object(l.w)(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,ft(u,{visibility:"hidden",top:0,left:0});var c=ct("\n <div style='position: absolute; white-space:nowrap; background-color: "+e+"; font-size: "+a+"px; border-radius: 4px; width: fit-content; height: fit-content; color: "+n+"; padding: "+i[0]+"px "+i[1]+"px "+i[2]+"px "+i[3]+"px'></div>");c.innerHTML=r,u.appendChild(c),this.backgroundDOM=c;var f=ct("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid "+e+"'></div>");u.appendChild(f),this.arrowDOM=f,this.container=u},t.prototype.show=function(t){var e=t.text,n=t.x;t.y,t.clientX,t.clientY;this.backgroundDOM.innerHTML=e;var r=this.backgroundDOM.offsetWidth,i=this.backgroundDOM.offsetHeight,o=this.arrowDOM.offsetWidth,a=this.arrowDOM.offsetHeight;ft(this.container,{top:-i-a+"px",left:n+"px",visibility:"visible"}),ft(this.backgroundDOM,{marginLeft:-r/2+"px"}),ft(this.arrowDOM,{marginLeft:-o/2+"px",top:i+"px"});var s=n-r/2,u=n+r/2;s<0?ft(this.backgroundDOM,{marginLeft:-r/2-s+"px"}):u>this.parentWidth&&ft(this.backgroundDOM,{marginLeft:-r/2-u+this.parentWidth+12+"px"})},t.prototype.hide=function(){ft(this.container,{top:0,left:0,visibility:"hidden"})},t}(),Fg={fill:"#5B8FF9"},Ug={fill:"#e6e8e9"},zg=function(){function t(t){this.frameCount=0;var e=t.graph,n=t.canvas,r=t.group,i=t.width,o=t.height,a=t.padding,s=t.data,u=t.start,c=t.end,f=t.x,l=void 0===f?0:f,h=t.y,d=void 0===h?0:h,p=t.tickLabelFormatter,g=t.selectedTickStyle,v=void 0===g?Fg:g,m=t.unselectedTickStyle,y=void 0===m?Ug:m,b=t.tooltipBackgroundColor,x=t.tooltipFomatter;this.graph=e,this.group=r,this.sliceGroup=r.addGroup({name:"slice-group"}),this.canvas=n,this.width=i,this.height=o,this.padding=a,this.data=s,this.start=u,this.end=c,this.tickLabelFormatter=p,this.selectedTickStyle=v,this.unselectedTickStyle=y,this.x=l,this.y=d,this.tooltipBackgroundColor=b,this.tooltipFomatter=x,this.renderSlices(),this.initEvent()}return t.prototype.renderSlices=function(){var t=this,e=t.width,n=t.height,r=t.padding,i=t.data,o=t.start,a=t.end,s=t.tickLabelFormatter,u=t.selectedTickStyle,c=t.unselectedTickStyle,f=e-2*r,h=n-(3*r+4+10)-2*r,d=i.length,g=(f-2*(d-1))/d;this.tickWidth=g;var v=this.sliceGroup,m=[],y=[],b=Math.round(d*o),x=Math.round(d*a);this.startTickRectId=b,this.endTickRectId=x,i.forEach((function(t,n){var i=n>=b&&n<=x?u:c,o=v.addShape("rect",{attrs:Object(p.a)({x:r+n*(g+2),y:r,width:g,height:h},i),draggable:!0,name:"tick-rect-"+n}),a=v.addShape("rect",{attrs:{x:r+n*g+2*(2*n-1)/2,y:r,width:0===n||n===d-1?g+1:g+2,height:h,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-"+n});a.toFront();var f,w=o.getBBox(),_=(w.minX+w.maxX)/2;if(m.push({rect:o,pickRect:a,value:t.date,x:_,y:w.minY}),s?(f=s(t),!Object(l.w)(f)&&f&&(f=t.date)):n%Math.round(d/10)==0&&(f=t.date),f){y.push(f);var E=w.maxY+2*r;v.addShape("line",{attrs:{stroke:"#BFBFBF",x1:_,y1:E,x2:_,y2:E+4}});var S=E+4+r,M=v.addShape("text",{attrs:{fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:_,y:S,textAlign:"center",text:f,textBaseline:"top",fontSize:10},capture:!1}),O=M.getBBox();O.maxX>e?M.attr("textAlign","right"):O.minX<0&&M.attr("textAlign","left")}})),this.tickRects=m;var w=this.group;this.currentSpeed=1,this.controllerBtnGroup=new Pg({group:w,x:this.x,y:this.y+n+5,width:e,height:40,hiddleToggle:!0,speed:this.currentSpeed})},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",(function(e){var n=e.target;if("rect"===n.get("type")&&n.get("name")){var r=parseInt(n.get("name").split("-")[2],10);if(!isNaN(r)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach((function(t){t.rect.attr(o)}));var a=t.selectedTickStyle;i[r].rect.attr(a),t.startTickRectId=r,t.endTickRectId=r;var s=r/i.length;t.graph.emit("valueChange",{value:[s,s]})}}})),e.on("dragstart",(function(e){var n=t.tickRects,r=t.unselectedTickStyle;n.forEach((function(t){t.rect.attr(r)}));var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;n[o].rect.attr(a),t.startTickRectId=o;var s=o/n.length;t.graph.emit("valueChange",{value:[s,s]}),t.dragging=!0})),e.on("dragover",(function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var n=parseInt(e.target.get("name").split("-")[2],10),r=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s<i.length;s++){var u=s>=r&&s<=n?o:a;i[s].rect.attr(u)}var c=i.length;t.endTickRectId=n;var f=r/c,l=n/c;t.graph.emit("valueChange",{value:[f,l]})}})),e.on("drop",(function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var n=t.startTickRectId,r=parseInt(e.target.get("name").split("-")[2],10);if(!(r<n)){var i=t.selectedTickStyle,o=t.tickRects;o[r].rect.attr(i),t.endTickRectId=r;var a=o.length,s=n/a,u=r/a;t.graph.emit("valueChange",{value:[s,u]})}}}));var n=this.tooltipBackgroundColor,r=this.tooltipFomatter,i=this.canvas,o=new Gg({container:i.get("container"),backgroundColor:n}),a=this.tickRects;a.forEach((function(t){var e=t.pickRect;e.on("mouseenter",(function(t){var e=t.target;if("rect"===e.get("type")){var n=parseInt(e.get("name").split("-")[2],10),s=i.getClientByPoint(a[n].x,a[n].y);o.show({x:a[n].x,y:a[n].y,clientX:s.x,clientY:s.y,text:r?r(a[n].value):a[n].value})}})),e.on("mouseleave",(function(t){o.hide()}))}));var s=this.group;s.on("playPauseBtn:click",(function(){t.isPlay=!t.isPlay,t.changePlayStatus()})),s.on("nextStepBtn:click",(function(){t.updateStartEnd(1)})),s.on("preStepBtn:click",(function(){t.updateStartEnd(-1)})),s.on("timebarConfigChanged",(function(e){e.type;var n=e.speed;t.currentSpeed=n}))},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timelinestart",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timelineend",null))},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame((function(){var e=t.currentSpeed;t.frameCount%(60/e)==0&&(t.frameCount=0,t.updateStartEnd(1)),t.frameCount++,t.isPlay&&(t.playHandler=t.startPlay())})):void 0},t.prototype.updateStartEnd=function(t){var e=this.tickRects,n=e.length,r=this.unselectedTickStyle,i=this.selectedTickStyle,o=this.endTickRectId;if(t>0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(r),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectId<this.startTickRectId&&(this.startTickRectId=this.endTickRectId);else{for(var a=this.startTickRectId;a<=this.endTickRectId-1;a++)e[a].rect.attr(r);this.startTickRectId=this.endTickRectId}if(e[this.endTickRectId]){e[this.endTickRectId].rect.attr(i);var s=this.startTickRectId/n,u=this.endTickRectId/n;this.graph.emit("valueChange",{value:[s,u]})}},t.prototype.destory=function(){this.graph.off("valueChange");var t=this.sliceGroup;t.off("click"),t.off("dragstart"),t.off("dragover"),t.off("drop"),this.tickRects.forEach((function(t){var e=t.pickRect;e.off("mouseenter"),e.off("mouseleave")})),this.tickRects.length=0,t.off("playPauseBtn:click"),t.off("nextStepBtn:click"),t.off("preStepBtn:click"),t.off("timebarConfigChanged"),this.sliceGroup.destroy()},t}(),Wg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:2,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]}}},e.prototype.initContainer=function(){var t,e,n=this.get("graph"),r=this._cfgs,i=r.width,o=r.height,a=this.get("className")||"g6-component-timebar",s=this.get("container"),u=this.get("graph").get("container");s?(Object(l.w)(s)&&(s=document.getElementById(s)),t=s):ft(t=ct("<div class='"+a+"'></div>"),{position:"relative"}),u.appendChild(t),this.set("timeBarContainer",t),e="SVG"===n.get("renderer")?new Se.Canvas({container:t,width:i,height:o}):new Ee.Canvas({container:t,width:i,height:o}),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent()},e.prototype.renderTrend=function(){var t=this._cfgs,e=t.width,n=t.x,r=t.y,i=t.padding,o=t.type,a=t.trend,s=t.slider,u=t.controllerCfg,c=a.data,f=Object(p.e)(a,["data"]),l=e-2*i,h="trend"===o?26:8,d=this.get("graph"),g=this.get("timeBarGroup"),v=this.get("canvas"),m=null;if("trend"===o||"simple"===o)m=new Lg(Object(p.a)(Object(p.a)({graph:d,canvas:v,group:g,type:o,x:n+i,y:"trend"===o?r+i:r+i+15,width:l,height:h,padding:i,trendCfg:Object(p.a)(Object(p.a)({},f),{data:c.map((function(t){return t.value}))})},s),{ticks:c.map((function(t){return t.date})),handlerStyle:Object(p.a)(Object(p.a)({},s.handlerStyle),{height:s.height||h}),controllerCfg:u}));else if("tick"===o){var y=this._cfgs.tick;m=new zg(Object(p.a)({graph:d,canvas:v,group:g,x:n+i,y:r+i},y))}this.set("timebar",m)},e.prototype.filterData=function(t){var e=t.value,n=null,r=this._cfgs.type;if("trend"===r||"simple"===r?n=this._cfgs.trend.data:"tick"===r&&(n=this._cfgs.tick.data),n&&0!==n.length){var i=this.get("rangeChange"),o=this.get("graph"),a=Math.round(n.length*e[0]),s=Math.round(n.length*e[1]);s=s>=n.length?n.length-1:s;var u=n[a].date,c=n[s].date;if("tick"!==r)this.get("timebar").setText(u,c);if(i)i(o,u,c);else{var f=o.save();(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=f);var l=this.cacheGraphData.nodes.filter((function(t){return t.date>=u&&t.date<=c})),h=l.map((function(t){return t.id})),d=this.cacheGraphData.edges.filter((function(t){return h.includes(t.source)&&h.includes(t.target)}));o.changeData({nodes:l,edges:d})}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this,e=0,n=0,r=this._cfgs.type;r&&"trend"!==r&&"simple"!==r?"tick"===r&&(e=this._cfgs.tick.start,n=this._cfgs.tick.end):(e=this._cfgs.slider.start,n=this._cfgs.slider.end);var i=this.get("graph");i.on("afterrender",(function(){t.filterData({value:[e,n]})})),i.on("valueChange",(function(e){t.filterData(e)}))},e.prototype.destroy=function(){var e=this.get("timebar");e&&e.destory&&e.destory(),t.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var r=this.get("container");r||(r=this.get("graph").get("container")),Object(l.w)(r)&&(r=document.getElementById(r)),r.removeChild(n)}},e}(Nd);var Vg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,n=e.graph;if(!this.destroyed){var r=this.get("container");Object(l.w)(r)&&(r=document.getElementById(r));var i=ct("<div class="+e.viewportClassName+"\n style='position:absolute;\n left:0;\n top:0;\n box-sizing:border-box;\n border: 2px solid #1980ff'>\n </div>"),o=0,a=0,s=!1,u=0,c=0,f=0,h=0,d=0,p=0;r.addEventListener("mousedown",(function(r){if(e.refresh=!1,r.target===i){var u=i.style;f=parseInt(u.width,10),h=parseInt(u.height,10);var c=t.get("width"),l=t.get("height");f>c||h>l||(p=n.getZoom(),d=t.get("ratio"),s=!0,o=r.clientX,a=r.clientY)}}),!1),r.addEventListener("mousemove",(function(e){if(s&&!Object(l.s)(e.clientX)&&!Object(l.s)(e.clientY)){var r=t.get("width"),g=t.get("height"),v=i.style;u=parseInt(v.left,10),c=parseInt(v.top,10),f=parseInt(v.width,10),h=parseInt(v.height,10);var m=o-e.clientX,y=a-e.clientY;u-m<0?m=u:u-m+f>=r&&(m=0),c-y<0?y=c:c-y+h>=g&&(y=0),ft(i,{left:(u-=m)+"px",top:(c-=y)+"px"}),n.translate(m*p/d,y*p/d),o=e.clientX,a=e.clientY}}),!1),r.addEventListener("mouseleave",(function(){s=!1,e.refresh=!0}),!1),r.addEventListener("mouseup",(function(){s=!1,e.refresh=!0}),!1),this.set("viewport",i),r.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),n=this.get("height"),r=this.get("graph"),i=r.get("width"),o=i/r.get("height"),a=r.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],c=[s.maxX-s.minX,s.maxY-s.minY],f={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(f.width=c[0],f.height=f.width/o):(f.height=c[1],f.width=f.height*o),f.minX=u[0]-f.width/2,f.minY=u[1]-f.height/2;var l=a.getMatrix();l||(l=[1,0,0,0,1,0,0,0,1]);var h=$.invert([],l),d=Ot({x:f.minX,y:f.minY},h),p=r.getCanvasByPoint(d.x,d.y),g=this.get("viewport");g||this.initViewport();var v=i/f.width,m=v*e,y=v*n,b=e*-p.x/f.width,x=n*-p.y/f.height,w=b+m,_=x+y;b<0&&(m+=b,b=0),w>e&&(m-=w-e),x<0&&(y+=x,x=0),_>n&&(y-=_-n),this.set("ratio",t),ft(g,{left:b+"px",top:x+"px",width:m+"px",height:y+"px"})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this.get("graph"),e=t.get("width"),n=t.get("height")/e,r=this.get("className"),i=this.get("container"),o=this.get("width"),a=this.get("height");o||a||(o=200),o?(a=n*o,this.set("height",a)):(o=1/n*a,this.set("width",o));var s=ct("<div class='"+r+"' style='width: "+o+"px; height: "+a+"px; overflow: hidden; position: relative;'></div>");Object(l.w)(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=ct('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');s.appendChild(u);var c=ct('<span style="display: table-cell; vertical-align: middle; "></span>');u.appendChild(c),this.set("containerDOM",u),this.set("containerSpan",c);var f=ct('<img alt="" src="'+this.get("graphImg")+'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>');this.set("imgDOM",f),this.updateImgSize(),c.appendChild(f),this.updateCanvas()},e.prototype.updateImgSize=function(){var t=this.get("imgDOM"),e=this.get("width"),n=this.get("height");t.onload=function(){var r=function(t,e){var n,r;if(t.naturalWidth)n=t.naturalWidth,r=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){null==e||e(i.width,i.height)}}return[n,r]}(t);r[0]>r[1]?t.width=e:t.height=n}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){this.get("imgDOM").remove(),this.set("graphImg",t);var e=ct('<img alt="" src="'+t+'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>');this.set("imgDOM",e),e.src=t,this.updateImgSize(),this.get("containerSpan").appendChild(e),this.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(Nd),Xg={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},Yg={Menu:Gd,Grid:jd,Minimap:Ud,Bundling:Vd,ToolBar:Hd,Tooltip:qd,Fisheye:Yd,TimeBar:Wg,ImageMinimap:Vg,EdgeFilterLens:function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(p.c)(e,t),e.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:Object(l.c)(Xg),showLabel:"edge",scaleRBy:"wheel"}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"filter"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"filter"}}return t},e.prototype.init=function(){var t=this.get("showLabel"),e="node"===t||"both"===t,n="edge"===t||"both"===t;this.set("showNodeLabel",e),this.set("showEdgeLabel",n),this.get("shouldShow")||this.set("shouldShow",(function(){return!0}))},e.prototype.createDelegate=function(t){var e=this,n=e.get("delegate");n&&!n.destroyed||(e.filter(t),(n=e.get("delegate")).on("dragstart",(function(t){})),n.on("drag",(function(t){e.filter(t)})),"wheel"===this.get("scaleRBy")&&n.on("mousewheel",(function(t){e.scaleRByWheel(t)})))},e.prototype.scaleRByWheel=function(t){if(t&&t.originalEvent){t.preventDefault&&t.preventDefault();var e,n=this.get("graph"),r=this.get("delegate");(r?{x:r.attr("x"),y:r.attr("y")}:void 0)||n.getPointByClient(t.clientX,t.clientY);e=t.originalEvent.wheelDelta<0?.95:1/.95;var i=this.get("maxR"),o=this.get("minR"),a=this.get("r");(a>(i||n.get("height"))&&e>1||a<(o||.05*n.get("height"))&&e<1)&&(e=1),a*=e,this.set("r",a),this.filter(t)}},e.prototype.filter=function(t){var e=this.get("graph"),n=e.getNodes(),r={},i=this.get("r"),o=this.get("type"),a={x:t.x,y:t.y};this.updateDelegate(a,i);var s=this.get("shouldShow"),u=this.get("vShapes");u&&u.forEach((function(t){t.remove(),t.destroy()})),u=[],n.forEach((function(t){var e=t.getModel(),n=e.x,o=e.y;Tt({x:n,y:o},a)<i&&(r[e.id]=t)}));var c=e.getEdges(),f=[];c.forEach((function(t){var e=t.getModel(),n=e.source,i=e.target;s(e)&&("only-source"===o||"one"===o?r[n]&&!r[i]&&f.push(t):"only-target"===o||"one"===o?r[i]&&!r[n]&&f.push(t):"both"===o&&r[n]&&r[i]&&f.push(t))}));var l=this.get("showNodeLabel"),h=this.get("showEdgelabel"),d=e.get("group");f.forEach((function(t){t.get("group").get("children").forEach((function(t){var e=t.get("type"),n=d.addShape(e,{attrs:t.attr()});u.push(n),l&&"text"===e&&n.set("visible",!0)}))})),Object.keys(r).forEach((function(t){var e=r[t].get("group").clone();if(d.add(e),u.push(e),h)for(var n=e.get("children"),i=0;i<n.length;i++){var o=n[i];"text"===o.get("type")&&o.set("visible",!0)}})),this.set("vShapes",u)},e.prototype.updateParams=function(t){var e=t.r,n=t.trigger,r=t.minR,i=t.maxR,o=t.scaleRBy,a=t.showLabel,s=t.shouldShow;if(isNaN(t.r)||this.set("r",e),isNaN(i)||this.set("maxR",i),isNaN(r)||this.set("minR",r),"mousemove"!==n&&"click"!==n||this.set("trigger",n),"wheel"===o||"unset"===o){this.set("scaleRBy",o),this.get("delegate").remove(),this.get("delegate").destroy();var u=this.get("dPercentText");u&&(u.remove(),u.destroy())}"node"!==a&&"both"!==a||this.set("showNodeLabel",!0),"edge"!==a&&"both"!==a||this.set("showEdgeLabel",!0),s&&this.set("shouldShow",s)},e.prototype.updateDelegate=function(t,e){var n=this,r=n.get("graph"),i=n.get("delegate");if(!i||i.destroyed){var o=r.get("group"),a=n.get("delegateStyle")||Xg;i=o.addShape("circle",{attrs:Object(p.a)({r:e,x:t.x,y:t.y},a),name:"lens-shape",draggable:!0}),"drag"!==this.get("trigger")&&"wheel"===this.get("scaleRBy")&&i.on("mousewheel",(function(t){n.scaleRByWheel(t)}))}else i.attr({x:t.x,y:t.y,r:e});n.set("delegate",i)},e.prototype.clear=function(){var t=this.get("vShapes");t&&t.forEach((function(t){t.remove(),t.destroy()})),t=[],this.set("vShapes",t);var e=this.get("delegate");e&&!e.destroyed&&(e.remove(),e.destroy())},e.prototype.destroy=function(){this.clear()},e}(Nd)};function Hg(t,e,n){var r=t.findById(e);!function t(e,n,r,i){i.enter({current:n,previous:r}),e.getNeighbors(n,"target").forEach((function(o){i.allowTraversal({previous:r,current:n,next:o})&&t(e,o,n,i)})),i.leave({current:n,previous:r})}(t,r,null,function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n.get("id")]&&(e[n.get("id")]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n))}var qg=function(){function t(){this.linkedList=new Ch}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();var Qg=function(t,e,n){var r=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next.get("id");return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),i=new qg,o=t.findById(e);i.enqueue(o);for(var a=null,s=function(){var e=i.dequeue();r.enter({current:e,previous:a}),t.getNeighbors(e,"target").forEach((function(t){r.allowTraversal({previous:a,current:e,next:t})&&i.enqueue(t)})),r.leave({current:e,previous:a}),a=e};!i.isEmpty();)s()};function Zg(t){for(var e=[],n={},r={},i={},o=[],a=0,s=function(u){r[u.get("id")]=a,i[u.get("id")]=a,a+=1,e.push(u),n[u.get("id")]=!0;for(var c=u.getNeighbors("target").filter((function(e){return t.indexOf(e)>-1})),f=0;f<c.length;f++){var l=c[f];r[l.get("id")]||0===r[l.get("id")]?n[l.get("id")]&&(i[u.get("id")]=Math.min(i[u.get("id")],r[l.get("id")])):(s(l),i[u.get("id")]=Math.min(i[u.get("id")],i[l.get("id")]))}if(i[u.get("id")]===r[u.get("id")]){for(var h=[];e.length>0;){var d=e.pop();if(n[d.get("id")]=!1,h.push(d),d===u)break}h.length>0&&o.push(h)}},u=0,c=t;u<c.length;u++){var f=c[u];r[f.get("id")]||0===r[f.get("id")]||s(f)}return o}function Kg(t,e){var n=void 0===e?t.get("directed"):e,r=t.getNodes();return n?Zg(r):function(t){for(var e=[],n={},r=[],i=function(t){r.push(t),n[t.get("id")]=!0;for(var e=t.getNeighbors(),o=0;o<e.length;++o){var a=e[o];n[a.get("id")]||i(a)}},o=0;o<t.length;o++){var a=t[o];if(!n[a.get("id")]){i(a);for(var s=[];r.length>0;)s.push(r.pop());e.push(s)}}return e}(r)}var $g=function(t,e,n){var r,i,o;void 0===n&&(n=!0);for(var a=[],s=0,u=Kg(t,!1);s<u.length;s++){var c=u[s];if(c.length)for(var f=c[0],l=f.get("id"),h=[f],d=((r={})[l]=f,r),p=((i={})[l]=new Set,i);h.length>0;)for(var g=h.pop(),v=g.get("id"),m=g.getNeighbors(),y=0;y<m.length;y+=1){var b=m[y],x=b.get("id");if(x===v)a.push(((o={})[b.getID()]=g,o));else if(x in p){if(!p[v].has(b)){for(var w=!0,_=[b,g],E=d[v];p[x].size&&!p[x].has(E)&&(_.push(E),E!==d[E.getID()]);)E=d[E.getID()];if(_.push(E),e&&n?(w=!1,_.findIndex((function(t){return e.indexOf(t.get("id"))>-1}))>-1&&(w=!0)):e&&!n&&_.findIndex((function(t){return e.indexOf(t.get("id"))>-1}))>-1&&(w=!1),w){for(var S={},M=1;M<_.length;M+=1)S[_[M-1].getID()]=_[M];_.length&&(S[_[_.length-1].getID()]=_[0]),a.push(S)}p[x].add(g)}}else d[x]=g,h.push(b),p[x]=new Set([g])}}return a},Jg=function(t,e,n){void 0===n&&(n=!0);for(var r=[],i=new Set,o=[],a=[],s={},u={},c=function(t,u,f){var l=!1;if(e&&!1===n&&e.indexOf(t.get("id"))>-1)return l;r.push(t),i.add(t);for(var h=f[t.getID()],d=0;d<h.length;d+=1){if((v=s[h[d]])===u){for(var p={},g=1;g<r.length;g+=1)p[r[g-1].getID()]=r[g];r.length&&(p[r[r.length-1].getID()]=r[0]),a.push(p),l=!0}else i.has(v)||c(v,u,f)&&(l=!0)}if(l)!function(t){for(var e=[t];e.length>0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.get("id")].forEach((function(t){e.push(t)})),o[n.get("id")].clear())}}(t);else for(d=0;d<h.length;d+=1){var v=s[h[d]];o[v.get("id")].has(t)||o[v.get("id")].add(t)}return r.pop(),l},f=t.getNodes(),l=0;l<f.length;l+=1){var h=f[l],d=h.getID();u[d]=l,s[l]=h}if(e&&n)for(l=0;l<e.length;l++){d=e[l];u[f[l].getID()]=u[d],u[d]=0,s[0]=t.findById(d),s[u[f[l].getID()]]=f[l]}for(var p=function(t){for(var r,i,o=1/0,s=0;s<t.length;s+=1)for(var c=t[s],f=0;f<c.length;f++){var l=u[c[f].getID()];l<o&&(o=l,i=s)}var h=t[i],d=[];for(s=0;s<h.length;s+=1){var p=h[s];d[p.getID()]=[];for(var g=0,v=p.getNeighbors("target").filter((function(t){return h.indexOf(t)>-1}));g<v.length;g++){var m=v[g];m!==p||!1===n&&e.indexOf(p.getId())>-1?d[p.getID()].push(u[m.getID()]):a.push(((r={})[p.getID()]=p,r))}}return{component:h,adjList:d,minIdx:o}},g=0;g<f.length;){var v=Zg(f.filter((function(t){return u[t.getID()]>=g}))).filter((function(t){return t.length>1}));if(0===v.length)break;var m=p(v),y=m.minIdx,b=m.adjList,x=m.component;if(!(x.length>1))break;x.forEach((function(t){o[t.get("id")]=new Set}));var w=s[y];if(e&&n&&-1===e.indexOf(w.get("id")))return a;c(w,w,b),g=y+1}return a},tv=function(t,e,n,r){return void 0===r&&(r=!0),void 0===e&&(e=t.get("directed")),e?Jg(t,n,r):$g(t,n,r)},ev=function(t){var e=null,n={},r={},i={},o={};t.getNodes().forEach((function(t){r[t.getID()]=t}));for(var a={enter:function(t){var o=t.current,a=t.previous;if(i[o.getID()]){e={};for(var s=o,u=a;u.getID()!==o.getID();)e[s.getID()]=u,s=u,u=n[u.getID()];e[s.getID()]=u}else i[o.getID()]=o,delete r[o.getID()],n[o.getID()]=a},leave:function(t){var e=t.current;o[e.getID()]=e,delete i[e.getID()]},allowTraversal:function(t){var n=t.next;return!e&&!o[n.getID()]}};Object.keys(r).length;){Hg(t,Object.keys(r)[0],a)}return e};var nv=function(t,e,n,r){var i=t.getNodes(),o=[],a={},s={},u={};i.forEach((function(t,n){var r=t.getID();o.push(r),s[r]=1/0,r===e&&(s[r]=0)}));for(var c=i.length,f=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;o<e.length;o++){var a=e[o].get("id");!n[a]&&t[a]<=i&&(i=t[a],r=e[o])}return r}(s,i,a),o=e.get("id");if(a[o]=!0,s[o]===1/0)return"continue";(n?e.getOutEdges():e.getEdges()).forEach((function(t){var n=t.getTarget().getID(),i=t.getSource().getID(),a=n===o?i:n,c=r&&t.getModel()[r]?t.getModel()[r]:1;s[a]>s[e.get("id")]+c&&(s[a]=s[e.get("id")]+c,u[a]=e.get("id"))}))},l=0;l<c;l++)f();var h={};for(var d in s){h[d]=[d];for(var p=u[d];void 0!==p;)h[d].unshift(p),p=u[p]}return{length:s,path:h}},rv=function(t,e,n,r,i){Object(l.w)(e)&&(e=t.findById(e)),Object(l.w)(n)&&(n=t.findById(n));var o=nv(t,e.get("id"),r,i),a=o.length,s=o.path;return{length:a[n.get("id")],path:s[n.get("id")]}},iv=function(t,e,n,r){var i;if(Object(l.w)(e)&&(e=t.findById(e)),Object(l.w)(n)&&(n=t.findById(n)),void 0===r&&(r=t.get("directed")),e===n)return[[e.get("id")]];var o=[e],a=((i={})[e.get("id")]=!0,i),s=[],u=[],c=r?e.getNeighbors("target"):e.getNeighbors();for(s.push(c);o.length>0&&s.length>0;){var f=s[s.length-1];if(f.length){var h=f.shift();if(h&&(o.push(h),a[h.get("id")]=!0,c=r?h.getNeighbors("target"):h.getNeighbors(),s.push(c.filter((function(t){return!a[t.get("id")]})))),o[o.length-1]===n){var d=o.map((function(t){return t.get("id")}));u.push(d);p=o.pop();a[p.get("id")]=!1,s.pop()}}else{var p=o.pop();a[p.get("id")]=!1,s.pop()}}return u},ov=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var r=n[e];this.parent[r]=r}}return t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),r=this.find(e);n!==r&&(n<r?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)},t}(),av=function(t,e){return t-e},sv=function(){function t(t){void 0===t&&(t=av),this.compareFn=t,this.list=[]}return t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r<o&&this.compareFn(this.list[n],this.list[r])>0?n=r:null!==i&&i<o&&this.compareFn(this.list[n],this.list[i])>0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}(),uv=function(t,e){var n=[],r=t.getNodes();if(0===r.length)return n;var i=r[0],o=new Set;o.add(i);var a=new sv((function(t,n){return e?t.getModel()[e]-n.getModel()[e]:0}));for(i.getEdges().forEach((function(t){a.insert(t)}));!a.isEmpty();){var s=a.delMin(),u=s.getSource(),c=s.getTarget();o.has(u)&&o.has(c)||(n.push(s),o.has(u)||(o.add(u),u.getEdges().forEach((function(t){a.insert(t)}))),o.has(c)||(o.add(c),c.getEdges().forEach((function(t){a.insert(t)}))))}return n},cv=function(t,e){var n=[];if(0===t.getNodes().length)return n;var r=t.getEdges().map((function(t){return t}));e&&r.sort((function(t,n){return t.getModel()[e]-n.getModel()[e]}));for(var i=new ov(t.getNodes().map((function(t){return t.get("id")})));r.length>0;){var o=r.shift(),a=o.getSource().get("id"),s=o.getTarget().get("id");i.connected(a,s)||(n.push(o),i.union(a,s))}return n};function fv(t,e,n){return n?{prim:uv,kruskal:cv}[n](t,e):cv(t,e)}var lv=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.getNodes(),u=s.length,c={},f={},l=0;l<u;++l){c[h=(m=s[l]).get("id")]=1/u,f[h]=1/u}for(;a>0&&i>e;){o=0;for(l=0;l<u;++l){var h=(m=s[l]).get("id");if(r=0,0===t.getNodeDegree(m,"in"))c[h]=0;else{for(var d=m.getNeighbors("source"),p=0;p<d.length;++p){var g=d[p],v=t.getNodeDegree(g,"out");v>0&&(r+=f[g.get("id")]/v)}c[h]=n*r,o+=c[h]}}o=(1-o)/u,i=0;for(l=0;l<u;++l){var m;r=c[h=(m=s[l]).get("id")]+o,i+=Math.abs(r-f[h]),f[h]=r}a-=1}return f},hv=function(t,e,n,r){for(var i=e.length,o=2*r,a=0,s=0;s<i;s++)for(var u=t[s].clusterId,c=0;c<i;c++){if(u===t[c].clusterId)a+=(e[s][c]||0)-(n[s]||0)*(n[c]||0)/o}return a*=1/o},dv=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e-4);var i=t.nodes,o=t.edges,a={},s={};i.forEach((function(t,e){var n=Object(l.F)();t.clusterId=n,a[n]={id:n,nodes:[t]},s[t.id]={node:t,idx:e}}));var u=Pt(t,e),c=[],f={},h=0;u.forEach((function(t,e){var n=0,r=i[e].id;f[r]={},t.forEach((function(t,e){if(t){n+=t;var o=i[e].id;f[r][o]=t,h+=t}})),c.push(n)})),h/=2;for(var d=1/0,p=1/0,g=0;d=hv(i,u,c,h),!(Math.abs(d-p)<r||g>100);)p=d,g++,Object.keys(a).forEach((function(t){var e=0;o.forEach((function(r){var i=r.source,o=r.target,a=s[i].node.clusterId,u=s[o].node.clusterId;(a===t&&u!==t||u===t&&a!==t)&&(e+=r[n]||1)})),a[t].sumTot=e})),i.forEach((function(t,e){var r,i=a[t.clusterId],l=0,d=c[e]/(2*h),p=0;i.nodes.forEach((function(t){var n=s[t.id].idx;p+=u[e][n]||0}));var g=p-i.sumTot*d,v=f[t.id];if(Object.keys(v).forEach((function(n){var i=s[n].node.clusterId;if(i!==t.clusterId){var o=a[i],c=o.nodes;if(c&&c.length){var f=0;c.forEach((function(t){var n=s[t.id].idx;f+=u[e][n]||0}));var h=f-o.sumTot*d-g;h>l&&(l=h,r=o)}}})),l>0){r.nodes.push(t);var m=t.clusterId;t.clusterId=r.id;var y=i.nodes.indexOf(t);i.nodes.splice(y,1);var b=0,x=0;o.forEach((function(t){var e=t.source,i=t.target,o=s[e].node.clusterId,a=s[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===m&&a!==m||a===m&&o!==m)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));Object.keys(a).forEach((function(t){var e=a[t];e.nodes&&e.nodes.length||delete a[t]}));var v=[],m={};o.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=s[e].node.clusterId,a=s[r].node.clusterId,u=o+"---"+a;if(m[u])m[u].weight+=i,m[u].count++;else{var c={source:o,target:a,weight:i,count:1};m[u]=c,v.push(c)}}));var y=[];return Object.keys(a).forEach((function(t){y.push(a[t])})),{clusters:y,clusterEdges:v}},pv=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var i=t.nodes,o=t.edges,a={},s={};i.forEach((function(t,e){var n=Object(l.F)();t.clusterId=n,a[n]={id:n,nodes:[t]},s[t.id]={node:t,idx:e}}));var u=Pt(t,e),c=[],f={};u.forEach((function(t,e){var n=0,r=i[e].id;f[r]={},t.forEach((function(t,e){if(t){n+=t;var o=i[e].id;f[r][o]=t}})),c.push(n)}));for(var h=0,d=function(){var t=!1;if(i.forEach((function(e){var n={};Object.keys(f[e.id]).forEach((function(t){var r=f[e.id][t],i=s[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r<n[t]?(r=n[t],i=[t]):r===n[t]&&i.push(t)})),1!==i.length||i[0]!==e.clusterId){var o=i.indexOf(e.clusterId);if(o>=0&&i.splice(o,1),i&&i.length){t=!0;var u=a[e.clusterId],c=u.nodes.indexOf(e);u.nodes.splice(c,1);var l=Math.floor(Math.random()*i.length),h=a[i[l]];h.nodes.push(e),e.clusterId=h.id}}})),!t)return"break";h++};h<r;){if("break"===d())break}Object.keys(a).forEach((function(t){var e=a[t];e.nodes&&e.nodes.length||delete a[t]}));var p=[],g={};o.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=s[e].node.clusterId,a=s[r].node.clusterId,u=o+"---"+a;if(g[u])g[u].weight+=i,g[u].count++;else{var c={source:o,target:a,weight:i,count:1};g[u]=c,p.push(c)}}));var v=[];return Object.keys(a).forEach((function(t){v.push(a[t])})),{clusters:v,clusterEdges:p}},gv=Cd.registerNode,vv=Cd.registerEdge,mv=Cd.registerCombo,yv=we.registerBehavior,bv=gh.registerLayout,xv=Yg.Minimap,wv=Yg.Grid,_v=Yg.Bundling,Ev=Yg.Menu,Sv=Yg.Fisheye,Mv=Yg.ToolBar,Ov=Yg.Tooltip,Av=Yg.TimeBar,kv=Yg.ImageMinimap,Tv=Yg.EdgeFilterLens;e.default={version:z.version,Graph:Xh,TreeGraph:qh,Util:Dd,registerNode:Cd.registerNode,registerEdge:Cd.registerEdge,registerCombo:Cd.registerCombo,registerBehavior:we.registerBehavior,registerLayout:gh.registerLayout,Layout:gh,Global:z,Minimap:Yg.Minimap,Grid:Yg.Grid,Bundling:Yg.Bundling,Menu:Yg.Menu,ToolBar:Yg.ToolBar,Tooltip:Yg.Tooltip,TimeBar:Av,Fisheye:Sv,ImageMinimap:kv,EdgeFilterLens:Tv,Algorithm:c,Arrow:{triangle:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+" L "+(r+e)+","+t/2+" Z"},vee:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=20),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+"\n L "+(r+2*e/3)+",0 L "+(r+e)+","+t/2+" Z"},circle:function(t,e){return void 0===t&&(t=5),void 0===e&&(e=0),"M "+2*e+", 0\n a "+t+","+t+" 0 1,0 "+2*t+",0\n a "+t+","+t+" 0 1,0 "+2*-t+",0"},rect:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=10),void 0===n&&(n=0);var r=2*n;return"M "+r+","+-t/2+" \n L "+(r+e)+","+-t/2+" \n L "+(r+e)+","+t/2+" \n L "+r+","+t/2+" Z"},diamond:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 \n L "+(r+e/2)+","+-t/2+" \n L "+(r+e)+",0 \n L "+(r+e/2)+","+t/2+" Z"},triangleRect:function(t,e,n,r,i,o){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=15),void 0===r&&(r=3),void 0===i&&(i=5),void 0===o&&(o=0);var a=2*o,s=a+e+i;return"M "+a+",0 L "+(a+e)+",-"+t/2+" L "+(a+e)+","+t/2+" Z\n M "+s+", -"+n/2+"\n L "+(s+r)+" -"+n/2+"\n L "+(s+r)+" "+n/2+"\n L "+s+" "+n/2+"\n Z"}},Marker:Id}}]).default}));
|
||
//# sourceMappingURL=g6.min.js.map |