@gkd-kit/inspect 0.0.1719554981776 → 0.0.1719771844368
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-osiRFbW-.js → ActionCard.vue_vue_type_script_setup_true_lang-BQ_8fdAM.js} +2 -2
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-osiRFbW-.js.map → ActionCard.vue_vue_type_script_setup_true_lang-BQ_8fdAM.js.map} +1 -1
- package/dist/assets/DevicePage-DVADu81G.js +49 -0
- package/dist/assets/DevicePage-DVADu81G.js.map +1 -0
- package/dist/assets/{HomePage-e_VAOXhM.js → HomePage-CaxY_1lw.js} +2 -2
- package/dist/assets/{HomePage-e_VAOXhM.js.map → HomePage-CaxY_1lw.js.map} +1 -1
- package/dist/assets/ImportPage-NLsJri71.js +2 -0
- package/dist/assets/{ImportPage-CHjeYLZq.js.map → ImportPage-NLsJri71.js.map} +1 -1
- package/dist/assets/PreviewSharePage-CQKWL6mm.js +2 -0
- package/dist/assets/{PreviewSharePage-BhIamd8L.js.map → PreviewSharePage-CQKWL6mm.js.map} +1 -1
- package/dist/assets/SnapshotPage-CaEVhDB3.js +276 -0
- package/dist/assets/SnapshotPage-CaEVhDB3.js.map +1 -0
- package/dist/assets/{TrackGraph-CEp76OOj.js → TrackGraph-LNwgG7Zu.js} +2 -2
- package/dist/assets/{TrackGraph-CEp76OOj.js.map → TrackGraph-LNwgG7Zu.js.map} +1 -1
- package/dist/assets/{_404Page-CZ0CByXf.js → _404Page-FYDSyMId.js} +2 -2
- package/dist/assets/{_404Page-CZ0CByXf.js.map → _404Page-FYDSyMId.js.map} +1 -1
- package/dist/assets/{dayjs.min-uKVeuXWf.js → dayjs.min-Dk3SwgwA.js} +2 -2
- package/dist/assets/{dayjs.min-uKVeuXWf.js.map → dayjs.min-Dk3SwgwA.js.map} +1 -1
- package/dist/assets/error-cRQAxhsF.js +2 -0
- package/dist/assets/error-cRQAxhsF.js.map +1 -0
- package/dist/assets/{export-C0OLZkuw.js → export-BbCEpSmy.js} +2 -2
- package/dist/assets/{export-C0OLZkuw.js.map → export-BbCEpSmy.js.map} +1 -1
- package/dist/assets/{fetch-CpTiefX8.js → fetch-H6IWSOXO.js} +27 -27
- package/dist/assets/{fetch-CpTiefX8.js.map → fetch-H6IWSOXO.js.map} +1 -1
- package/dist/assets/{import-DideFhmR.js → import-CtVhDhqQ.js} +2 -2
- package/dist/assets/{import-DideFhmR.js.map → import-CtVhDhqQ.js.map} +1 -1
- package/dist/assets/{index-Xf3Ut-IQ.js → index-B3yJ_cuJ.js} +2 -2
- package/dist/assets/{index-Xf3Ut-IQ.js.map → index-B3yJ_cuJ.js.map} +1 -1
- package/dist/assets/{index-DEdjUr5q.js → index-DUNQCHBS.js} +5 -5
- package/dist/assets/{index-DEdjUr5q.js.map → index-DUNQCHBS.js.map} +1 -1
- package/dist/assets/{index-BK1Q2G8Y.js → index-DgVERJQU.js} +2 -2
- package/dist/assets/{index-BK1Q2G8Y.js.map → index-DgVERJQU.js.map} +1 -1
- package/dist/assets/{polyfills-Bzj3sCUp.js → polyfills-C-WU4AZr.js} +1 -1
- package/dist/assets/{table-CA4K56iX.js → table-Nqs-aN9a.js} +2 -2
- package/dist/assets/{table-CA4K56iX.js.map → table-Nqs-aN9a.js.map} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/DevicePage-Cv3SCQIP.js +0 -49
- package/dist/assets/DevicePage-Cv3SCQIP.js.map +0 -1
- package/dist/assets/ImportPage-CHjeYLZq.js +0 -2
- package/dist/assets/PreviewSharePage-BhIamd8L.js +0 -2
- package/dist/assets/SnapshotPage-CO6Z0AlC.js +0 -272
- package/dist/assets/SnapshotPage-CO6Z0AlC.js.map +0 -1
- package/dist/assets/selector-BAtGYIJN.js +0 -6
- package/dist/assets/selector-BAtGYIJN.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cx as fd,cy as ma,aQ as ba,aO as xe,h as t3,m as r3,A as n3,B as i3,au as yE,I as a3,C as o3}from"./index-DEdjUr5q.js";import{R as mE}from"./dayjs.min-uKVeuXWf.js";import"./index-Xf3Ut-IQ.js";import"./fetch-CpTiefX8.js";function s3(r,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const um=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Gi},get Circle(){return _W},get Ellipse(){return SW},get Image(){return MW},get Line(){return CW},get Marker(){return TW},get Path(){return o1},get Polygon(){return NW},get Polyline(){return RW},get Rect(){return GW},get Text(){return zW}},Symbol.toStringTag,{value:"Module"})),fm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ei},get Circle(){return WW},get Dom(){return XW},get Ellipse(){return YW},get Image(){return VW},get Line(){return HW},get Marker(){return KW},get Path(){return qW},get Polygon(){return ZW},get Polyline(){return QW},get Rect(){return e7},get Text(){return i7}},Symbol.toStringTag,{value:"Module"}));function S0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function u3(r,t){if(r){if(typeof r=="string")return S0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return S0(r,t)}}function Ri(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function f3(r,t){if(fd(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(fd(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function ZM(r){var t=f3(r,"string");return fd(t)==="symbol"?t:String(t)}function bE(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,ZM(n.key),n)}}function Bi(r,t,e){return t&&bE(r.prototype,t),e&&bE(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function et(r,t,e){return t=ZM(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var QM={exports:{}};(function(r){function t(e){"@babel/helpers - typeof";return r.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r.exports.__esModule=!0,r.exports.default=r.exports,t(e)}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(QM);var l3=QM.exports,M0=function(r,t){return M0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},M0(r,t)};function Ot(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");M0(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function sn(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function JM(r,t,e,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function eC(r,t){return function(e,n){t(e,n,r)}}function c3(r,t,e,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",f=!t&&r?n.static?r:r.prototype:null,l=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),c,h=!1,d=e.length-1;d>=0;d--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,e[d])(s==="accessor"?{get:l.get,set:l.set}:l[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(l.get=c),(c=o(g.set))&&(l.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),h=!0}function h3(r,t,e){for(var n=arguments.length>2,i=0;i<t.length;i++)e=n?t[i].call(r,e):t[i].call(r);return n?e:void 0}function d3(r){return typeof r=="symbol"?r:"".concat(r)}function v3(r,t,e){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:e?"".concat(e," ",t):t})}function tC(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Hn(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{f(n.next(l))}catch(c){o(c)}}function u(l){try{f(n.throw(l))}catch(c){o(c)}}function f(l){l.done?a(l.value):i(l.value).then(s,u)}f((n=n.apply(r,t||[])).next())})}function Kn(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(f){return function(l){return u([f,l])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(e=0)),e;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){e.label=f[1];break}if(f[0]===6&&e.label<a[1]){e.label=a[1],a=f;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(f);break}a[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(r,e)}catch(l){f=[6,l],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var nv=Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]};function rC(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&nv(t,r,e)}function ld(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lm(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a}function nC(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(lm(arguments[t]));return r}function iv(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function ri(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))}function Du(r){return this instanceof Du?(this.v=r,this):new Du(r)}function iC(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){n[h]&&(i[h]=function(d){return new Promise(function(v,p){a.push([h,d,v,p])>1||s(h,d)})})}function s(h,d){try{u(n[h](d))}catch(v){c(a[0][3],v)}}function u(h){h.value instanceof Du?Promise.resolve(h.value.v).then(f,l):c(a[0][2],h)}function f(h){s("next",h)}function l(h){s("throw",h)}function c(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function aC(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=r[i]?function(o){return(e=!e)?{value:Du(r[i](o)),done:!1}:a?a(o):o}:a}}function oC(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof ld=="function"?ld(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(a){e[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(f){a({value:f,done:s})},o)}}function sC(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var p3=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function uC(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&nv(t,r,e);return p3(t,r),t}function fC(r){return r&&r.__esModule?r:{default:r}}function lC(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)}function cC(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e}function hC(r,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?t===r:r.has(t)}function dC(r,t,e){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");r.stack.push({value:t,dispose:n,async:e})}else e&&r.stack.push({async:!0});return t}var g3=typeof SuppressedError=="function"?SuppressedError:function(r,t,e){var n=new Error(e);return n.name="SuppressedError",n.error=r,n.suppressed=t,n};function vC(r){function t(n){r.error=r.hasError?new g3(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function e(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(e,function(a){return t(a),e()})}catch(a){t(a)}}if(r.hasError)throw r.error}return e()}const y3={__extends:Ot,__assign:F,__rest:sn,__decorate:JM,__param:eC,__metadata:tC,__awaiter:Hn,__generator:Kn,__createBinding:nv,__exportStar:rC,__values:ld,__read:lm,__spread:nC,__spreadArrays:iv,__spreadArray:ri,__await:Du,__asyncGenerator:iC,__asyncDelegator:aC,__asyncValues:oC,__makeTemplateObject:sC,__importStar:uC,__importDefault:fC,__classPrivateFieldGet:lC,__classPrivateFieldSet:cC,__classPrivateFieldIn:hC,__addDisposableResource:dC,__disposeResources:vC},m3=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:dC,get __assign(){return F},__asyncDelegator:aC,__asyncGenerator:iC,__asyncValues:oC,__await:Du,__awaiter:Hn,__classPrivateFieldGet:lC,__classPrivateFieldIn:hC,__classPrivateFieldSet:cC,__createBinding:nv,__decorate:JM,__disposeResources:vC,__esDecorate:c3,__exportStar:rC,__extends:Ot,__generator:Kn,__importDefault:fC,__importStar:uC,__makeTemplateObject:sC,__metadata:tC,__param:eC,__propKey:d3,__read:lm,__rest:sn,__runInitializers:h3,__setFunctionName:v3,__spread:nC,__spreadArray:ri,__spreadArrays:iv,__values:ld,default:y3},Symbol.toStringTag,{value:"Module"}));var Fn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},cd=function(r,t){return Fn(r)?r.indexOf(t)>-1:!1},av=function(r,t){if(!Fn(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},b3=function(r,t){return t===void 0&&(t=[]),av(r,function(e){return!cd(t,e)})},x3={}.toString,Fi=function(r,t){return x3.call(r)==="[object "+t+"]"};const Cr=function(r){return Fi(r,"Function")};var ct=function(r){return r==null};const gt=function(r){return Array.isArray?Array.isArray(r):Fi(r,"Array")},bn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function me(r,t){if(r){var e;if(gt(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(bn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var pC=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return me(r,function(e,n){Cr(r)&&n==="prototype"||t.push(n)}),t};function gC(r,t){var e=pC(t),n=e.length;if(ct(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var hd=function(r){return typeof r=="object"&&r!==null},yn=function(r){if(!hd(r)||!Fi(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t};function E3(r,t){if(!gt(r))return null;var e;if(Cr(t)&&(e=t),yn(t)&&(e=function(i){return gC(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function w3(r,t,e){e===void 0&&(e=0);for(var n=e;n<r.length;n++)if(t(r[n],n))return n;return-1}var _3=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!ct(a)){gt(a)?e=a[0]:e=a;break}}return e},S3=function(r){if(!gt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},yC=function(r,t){if(t===void 0&&(t=[]),!gt(r))t.push(r);else for(var e=0;e<r.length;e+=1)yC(r[e],t);return t};const pa=function(r){if(gt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},ga=function(r){if(gt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var mC=function(r){var t=r.filter(function(o){return!isNaN(o)});if(!t.length)return{min:0,max:0};if(gt(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=pa(t),a=ga(t);return{min:a,max:i}},bC=Array.prototype,M3=bC.splice,C3=bC.indexOf,A3=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=C3.call(r,i))>-1;)M3.call(r,a,1);return r},T3=Array.prototype.splice,xC=function(t,e){if(!Fn(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,o=e[n];(n===i||o!==a)&&(a=o,T3.call(t,o,1))}return t},EC=function(r,t,e){if(!gt(r)&&!yn(r))return r;var n=e;return me(r,function(i,a){n=t(n,i,a)}),n},I3=function(r,t){var e=[];if(!Fn(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];t(o,n,r)&&(e.push(o),i.push(n))}return xC(r,i),e};const Ne=function(r){return Fi(r,"String")};function O3(r,t){var e;if(Cr(t))e=function(i,a){return t(i)-t(a)};else{var n=[];Ne(t)?n.push(t):gt(t)&&(n=t),e=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(e),r}function fl(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var L3=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return fl([].concat.apply([],r))};const D3=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[t];if(!ct(o)){gt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(e.push(u),n[u]=!0)}}}return e};function ha(r){if(Fn(r))return r[0]}function yi(r){if(Fn(r)){var t=r;return t[t.length-1]}}function k3(r,t){return gt(r)||Ne(r)?r[0]===t:!1}function P3(r,t){return gt(r)||Ne(r)?r[r.length-1]===t:!1}var N3=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},R3=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},B3=Object.prototype.hasOwnProperty;function dd(r,t){if(!t||!gt(r))return{};for(var e={},n=Cr(t)?t:function(s){return s[t]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),B3.call(e,i)?e[i].push(o):e[i]=[o]}return e}function wC(r,t){if(!t)return{0:r};if(!Cr(t)){var e=gt(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,o=e.length;a<o;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return dd(r,t)}const F3=function(r,t){if(!t)return[r];var e=wC(r,t),n=[];for(var i in e)n.push(e[i]);return n};function G3(r,t){return r["_wrap_"+t]}function vs(r,t){if(r["_wrap_"+t])return r["_wrap_"+t];var e=function(n){r[t](n)};return r["_wrap_"+t]=e,e}var xE={};function z3(r){var t=xE[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,xE[r]=t}return t}function j3(r){var t=0,e=0,n=0,i=0;return gt(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var U3=function(r,t,e){return r<t?t:r>e?e:r},Fh=function(r,t){var e=t.toString(),n=e.indexOf(".");if(n===-1)return Math.round(r);var i=e.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},ht=function(r){return Fi(r,"Number")},$3=function(r){return ht(r)&&r%1!==0},W3=function(r){return ht(r)&&r%2===0},X3=Number.isInteger?Number.isInteger:function(r){return ht(r)&&r%1===0},Y3=function(r){return ht(r)&&r<0},V3=1e-5;function _C(r,t,e){return e===void 0&&(e=V3),Math.abs(r-t)<e}var H3=function(r){return ht(r)&&r%2!==0},K3=function(r){return ht(r)&&r>0};const q3=function(r,t){if(gt(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Cr(t)?t(a):a[t];o>n&&(e=a,n=o)}return e}},Z3=function(r,t){if(gt(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Cr(t)?t(a):a[t];o<n&&(e=a,n=o)}return e}};var ov=function(r,t){return(r%t+t)%t},Q3=180/Math.PI,J3=function(r){return Q3*r};const e5=parseInt;var t5=Math.PI/180,sv=function(r){return t5*r};const EE=function(r,t){return r.hasOwnProperty(t)};var cm=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return me(r,function(e,n){Cr(r)&&n==="prototype"||t.push(e)}),t};const r5=function(r,t){return cd(cm(r),t)},qu=function(r){return ct(r)?"":r.toString()};var n5=function(r){return qu(r).toLowerCase()},i5=function(r){var t=qu(r);return t.charAt(0).toLowerCase()+t.substring(1)};function a5(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var o5=function(r){return qu(r).toUpperCase()},ku=function(r){var t=qu(r);return t.charAt(0).toUpperCase()+t.substring(1)},s5={}.toString,SC=function(r){return s5.call(r).replace(/^\[object /,"").replace(/]$/,"")},u5=function(r){return Fi(r,"Arguments")},Pl=function(r){return Fi(r,"Boolean")},hm=function(r){return Fi(r,"Date")},f5=function(r){return Fi(r,"Error")};function l5(r){return ht(r)&&isFinite(r)}var c5=function(r){return r===null},h5=Object.prototype,MC=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||h5;return r===e},d5=function(r){return Fi(r,"RegExp")},v5=function(r){return r===void 0},p5=function(r){return r instanceof Element||r instanceof HTMLDocument};function CC(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function AC(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function cg(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function yt(r,t,e,n){return t&&cg(r,t),e&&cg(r,e),n&&cg(r,n),r}var g5=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];Cr(i)&&(i=i.prototype),yt(e.prototype,i)}},Vt=function(r){if(typeof r!="object"||r===null)return r;var t;if(gt(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Vt(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Vt(r[i]):t[i]=r[i]}return t};function Nl(r,t,e){var n;return function(){var i=this,a=arguments,o=function(){n=null,e||r.apply(i,a)},s=e&&!n;clearTimeout(n),n=setTimeout(o,t),s&&r.apply(i,a)}}const TC=function(r,t){if(!Cr(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],o=e.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return e.cache=new Map,e};var y5=5;function IC(r,t,e,n){e=e||0,n=n||y5;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&yn(a)?(yn(r[i])||(r[i]={}),e<n?IC(r[i],a,e+1,n):r[i]=t[i]):gt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var mr=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)IC(r,t[n]);return r},m5=function(r,t,e,n){Cr(t)||(e=t,t=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var f=new u;return f.constructor=s,f},a=i(t.prototype,r);return r.prototype=yt(a,r.prototype),r.superclass=i(t.prototype,t),yt(a,e),yt(r,n),r},dm=function(r,t){if(!Fn(r))return-1;var e=Array.prototype.indexOf;if(e)return e.call(r,t);for(var n=-1,i=0;i<r.length;i++)if(r[i]===t){n=i;break}return n},b5=Object.prototype.hasOwnProperty;function OC(r){if(ct(r))return!0;if(Fn(r))return!r.length;var t=SC(r);if(t==="Map"||t==="Set")return!r.size;if(MC(r))return!Object.keys(r).length;for(var e in r)if(b5.call(r,e))return!1;return!0}var Oo=function(r,t){if(r===t)return!0;if(!r||!t||Ne(r)||Ne(t))return!1;if(Fn(r)||Fn(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Oo(r[n],t[n]),!!e);n++);return e}if(hd(r)||hd(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Oo(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const x5=function(r,t,e){return Cr(e)?!!e(r,t):Oo(r,t)};var Ss=function(r,t){if(!Fn(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];e.push(t(i,n))}return e},E5=function(r){return r};const w5=function(r,t){t===void 0&&(t=E5);var e={};return bn(r)&&!ct(r)&&Object.keys(r).forEach(function(n){e[n]=t(r[n],n)}),e},za=function(r,t,e){for(var n=0,i=Ne(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},_5=function(r,t,e){var n=r,i=Ne(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(bn(n[a])||(n[a]=ht(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var S5=Object.prototype.hasOwnProperty;const M5=function(r,t){if(r===null||!yn(r))return{};var e={};return me(t,function(n){S5.call(r,n)&&(e[n]=r[n])}),e},C5=function(r,t){return EC(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},ll=function(r,t,e){var n,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},f=function(){var l=Date.now();!s&&e.leading===!1&&(s=l);var c=t-(l-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=l,o=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(u,c)),o};return f.cancel=function(){clearTimeout(n),s=0,n=i=a=null},f},LC=function(r){return Fn(r)?Array.prototype.slice.call(r):[]};var jc={};const ya=function(r){return r=r||"g",jc[r]?jc[r]+=1:jc[r]=1,r+jc[r]},Ff=function(){},A5=function(r){return r};function uv(r){return ct(r)?0:Fn(r)?r.length:Object.keys(r).length}var Uc;const Gf=TC(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,o=t.fontVariant;return Uc||(Uc=document.createElement("canvas").getContext("2d")),Uc.font=[a,o,i,e+"px",n].join(" "),Uc.measureText(Ne(r)?r:"").width},function(r,t){return t===void 0&&(t={}),iv([r],cm(t)).join("")}),T5=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=Gf(n,e),o=Ne(r)?r:qu(r),s=t,u=[],f,l;if(Gf(r,e)<=t)return r;for(;f=o.substr(0,i),l=Gf(f,e),!(l+a>s&&l>s);)if(u.push(f),s-=l,o=o.substr(i),!o)return u.join("");for(;f=o.substr(0,1),l=Gf(f,e),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var I5=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const O5=Object.freeze(Object.defineProperty({__proto__:null,Cache:I5,assign:yt,augment:g5,clamp:U3,clearAnimationFrame:AC,clone:Vt,contains:cd,debounce:Nl,deepMix:mr,difference:b3,each:me,endsWith:P3,every:N3,extend:m5,filter:av,find:E3,findIndex:w3,firstValue:_3,fixedBase:Fh,flatten:S3,flattenDeep:yC,forIn:me,get:za,getEllipsisText:T5,getRange:mC,getType:SC,getWrapBehavior:G3,group:F3,groupBy:dd,groupToMap:wC,has:EE,hasKey:EE,hasValue:r5,head:ha,identity:A5,includes:cd,indexOf:dm,isArguments:u5,isArray:gt,isArrayLike:Fn,isBoolean:Pl,isDate:hm,isDecimal:$3,isElement:p5,isEmpty:OC,isEqual:Oo,isEqualWith:x5,isError:f5,isEven:W3,isFinite:l5,isFunction:Cr,isInteger:X3,isMatch:gC,isNegative:Y3,isNil:ct,isNull:c5,isNumber:ht,isNumberEqual:_C,isObject:bn,isObjectLike:hd,isOdd:H3,isPlainObject:yn,isPositive:K3,isPrototype:MC,isRegExp:d5,isString:Ne,isType:Fi,isUndefined:v5,keys:pC,last:yi,lowerCase:n5,lowerFirst:i5,map:Ss,mapValues:w5,max:pa,maxBy:q3,measureTextWidth:Gf,memoize:TC,min:ga,minBy:Z3,mix:yt,mod:ov,noop:Ff,number2color:z3,omit:C5,parseRadius:j3,pick:M5,pull:A3,pullAt:xC,reduce:EC,remove:I3,requestAnimationFrame:CC,set:_5,size:uv,some:R3,sortBy:O3,startsWith:k3,substitute:a5,throttle:ll,toArray:LC,toDegree:J3,toInteger:e5,toRadian:sv,toString:qu,union:L3,uniq:fl,uniqueId:ya,upperCase:o5,upperFirst:ku,values:cm,valuesOfKey:D3,wrapBehavior:vs},Symbol.toStringTag,{value:"Module"})),L5={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),me(n,function(i,a){t.on(a,i)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,n=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),me(e,function(i,a){t.off(a,i)}),t.get("canvas").set("draggable",n)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}};var vm=function(){function r(){}return r.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var n=Vt(L5);Object.assign(n,e);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var f={};u&&(me(u,function(l,c){f[c]=vs(s,l)}),this.events=f)};i.prototype=n,r.types[t]=i},r.hasBehavior=function(t){return!!r.types[t]},r.getBehavior=function(t){return r.types[t]},r.types={},r}(),D5="*",DC=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],o=this._events[D5]||[],s=function(u){for(var f=u.length,l=0;l<f;l++)if(u[l]){var c=u[l],h=c.callback,d=c.once;d&&(u.splice(l,1),u.length===0&&delete e._events[t],f--,l--),h.apply(e,n)}};s(a),s(o)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),_t=1e-6,Qt=typeof Float32Array<"u"?Float32Array:Array,Di=Math.random;function k5(r){Qt=r}var P5=Math.PI/180;function N5(r){return r*P5}function R5(r,t){return Math.abs(r-t)<=_t*Math.max(1,Math.abs(r),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});const B5=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return Qt},EPSILON:_t,RANDOM:Di,equals:R5,setMatrixArrayType:k5,toRadian:N5},Symbol.toStringTag,{value:"Module"}));function F5(){var r=new Qt(4);return Qt!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function G5(r){var t=new Qt(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function z5(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function j5(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function U5(r,t,e,n){var i=new Qt(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function $5(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function W5(r,t){if(r===t){var e=t[1];r[1]=t[2],r[2]=e}else r[0]=t[0],r[1]=t[2],r[2]=t[1],r[3]=t[3];return r}function X5(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=e*o,r):null}function Y5(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function V5(r){return r[0]*r[3]-r[2]*r[1]}function kC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*f+a*l,r[3]=i*f+o*l,r}function H5(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function K5(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function q5(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r}function Z5(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function Q5(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function J5(r){return Math.hypot(r[0],r[1],r[2],r[3])}function eB(r,t,e,n){return r[2]=n[2]/n[0],e[0]=n[0],e[1]=n[1],e[3]=n[3]-r[2]*e[1],[r,t,e]}function tB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function PC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function rB(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function nB(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],f=t[3];return Math.abs(e-o)<=_t*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=_t*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=_t*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=_t*Math.max(1,Math.abs(a),Math.abs(f))}function iB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function aB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}var oB=kC,sB=PC;const uB=Object.freeze(Object.defineProperty({__proto__:null,LDU:eB,add:tB,adjoint:Y5,clone:G5,copy:z5,create:F5,determinant:V5,equals:nB,exactEquals:rB,frob:J5,fromRotation:q5,fromScaling:Z5,fromValues:U5,identity:j5,invert:X5,mul:oB,multiply:kC,multiplyScalar:iB,multiplyScalarAndAdd:aB,rotate:H5,scale:K5,set:$5,str:Q5,sub:sB,subtract:PC,transpose:W5},Symbol.toStringTag,{value:"Module"}));function fB(){var r=new Qt(6);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function lB(r){var t=new Qt(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t}function cB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function hB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function dB(r,t,e,n,i,a){var o=new Qt(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=a,o}function vB(r,t,e,n,i,a,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function pB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=e*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-e*s)*u,r):null}function gB(r){return r[0]*r[3]-r[1]*r[2]}function NC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1],c=e[2],h=e[3],d=e[4],v=e[5];return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*c+a*h,r[3]=i*c+o*h,r[4]=n*d+a*v+s,r[5]=i*d+o*v+u,r}function yB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=Math.sin(e),l=Math.cos(e);return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*-f+a*l,r[3]=i*-f+o*l,r[4]=s,r[5]=u,r}function mB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1];return r[0]=n*f,r[1]=i*f,r[2]=a*l,r[3]=o*l,r[4]=s,r[5]=u,r}function bB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*f+a*l+s,r[5]=i*f+o*l+u,r}function xB(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r}function EB(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r}function wB(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r}function _B(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function SB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function MB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r}function RC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r}function CB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r}function AB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r}function TB(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]}function IB(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=t[0],f=t[1],l=t[2],c=t[3],h=t[4],d=t[5];return Math.abs(e-u)<=_t*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-f)<=_t*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=_t*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=_t*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=_t*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=_t*Math.max(1,Math.abs(s),Math.abs(d))}var OB=NC,LB=RC;const DB=Object.freeze(Object.defineProperty({__proto__:null,add:MB,clone:lB,copy:cB,create:fB,determinant:gB,equals:IB,exactEquals:TB,frob:SB,fromRotation:xB,fromScaling:EB,fromTranslation:wB,fromValues:dB,identity:hB,invert:pB,mul:OB,multiply:NC,multiplyScalar:CB,multiplyScalarAndAdd:AB,rotate:yB,scale:mB,set:vB,str:_B,sub:LB,subtract:RC,translate:bB},Symbol.toStringTag,{value:"Module"}));function BC(){var r=new Qt(9);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function kB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function PB(r){var t=new Qt(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function NB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function RB(r,t,e,n,i,a,o,s,u){var f=new Qt(9);return f[0]=r,f[1]=t,f[2]=e,f[3]=n,f[4]=i,f[5]=a,f[6]=o,f[7]=s,f[8]=u,f}function BB(r,t,e,n,i,a,o,s,u,f){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r}function FB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function GB(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function pm(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=e*c+n*h+i*d;return v?(v=1/v,r[0]=c*v,r[1]=(-l*n+i*f)*v,r[2]=(s*n-i*o)*v,r[3]=h*v,r[4]=(l*e-i*u)*v,r[5]=(-s*e+i*a)*v,r[6]=d*v,r[7]=(-f*e+n*u)*v,r[8]=(o*e-n*a)*v,r):null}function zB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8];return r[0]=o*l-s*f,r[1]=i*f-n*l,r[2]=n*s-i*o,r[3]=s*u-a*l,r[4]=e*l-i*u,r[5]=i*a-e*s,r[6]=a*f-o*u,r[7]=n*u-e*f,r[8]=e*o-n*a,r}function jB(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8];return t*(f*a-o*u)+e*(-f*i+o*s)+n*(u*i-a*s)}function xa(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1],v=e[2],p=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return r[0]=h*n+d*o+v*f,r[1]=h*i+d*s+v*l,r[2]=h*a+d*u+v*c,r[3]=p*n+g*o+y*f,r[4]=p*i+g*s+y*l,r[5]=p*a+g*u+y*c,r[6]=m*n+b*o+x*f,r[7]=m*i+b*s+x*l,r[8]=m*a+b*u+x*c,r}function UB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+d*o+f,r[7]=h*i+d*s+l,r[8]=h*a+d*u+c,r}function $B(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=Math.sin(e),d=Math.cos(e);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*u,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*u-h*a,r[6]=f,r[7]=l,r[8]=c,r}function WB(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function gm(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function ym(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function mm(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function XB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function YB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,f=e*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=l-y,r[6]=h+g,r[1]=l+y,r[4]=1-f-v,r[7]=d-p,r[2]=h-g,r[5]=d+p,r[8]=1-f-c,r}function VB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*f-a*o,E=n*u-i*s,w=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,D=m*I-b*T+x*A+E*S-w*C+_*M;return D?(D=1/D,r[0]=(s*I-u*T+f*A)*D,r[1]=(u*S-o*I-f*C)*D,r[2]=(o*T-s*S+f*M)*D,r[3]=(i*T-n*I-a*A)*D,r[4]=(e*I-i*S+a*C)*D,r[5]=(n*S-e*T-a*M)*D,r[6]=(p*_-g*w+y*E)*D,r[7]=(g*x-v*_-y*b)*D,r[8]=(v*w-p*x+y*m)*D,r):null}function HB(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function KB(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function qB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function ZB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function FC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function QB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function JB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function eF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function tF(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=t[0],h=t[1],d=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8];return Math.abs(e-c)<=_t*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-h)<=_t*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=_t*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=_t*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=_t*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=_t*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=_t*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=_t*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-b)<=_t*Math.max(1,Math.abs(l),Math.abs(b))}var rF=xa,nF=FC;const GC=Object.freeze(Object.defineProperty({__proto__:null,add:ZB,adjoint:zB,clone:PB,copy:NB,create:BC,determinant:jB,equals:tF,exactEquals:eF,frob:qB,fromMat2d:XB,fromMat4:kB,fromQuat:YB,fromRotation:ym,fromScaling:mm,fromTranslation:gm,fromValues:RB,identity:FB,invert:pm,mul:rF,multiply:xa,multiplyScalar:QB,multiplyScalarAndAdd:JB,normalFromMat4:VB,projection:HB,rotate:$B,scale:WB,set:BB,str:KB,sub:nF,subtract:FC,translate:UB,transpose:GB},Symbol.toStringTag,{value:"Module"}));function iF(){var r=new Qt(16);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function aF(r){var t=new Qt(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function oF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function sF(r,t,e,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new Qt(16);return g[0]=r,g[1]=t,g[2]=e,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=f,g[10]=l,g[11]=c,g[12]=h,g[13]=d,g[14]=v,g[15]=p,g}function uF(r,t,e,n,i,a,o,s,u,f,l,c,h,d,v,p,g){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r[9]=l,r[10]=c,r[11]=h,r[12]=d,r[13]=v,r[14]=p,r[15]=g,r}function zC(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function fF(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function lF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*f-a*o,E=n*u-i*s,w=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,D=m*I-b*T+x*A+E*S-w*C+_*M;return D?(D=1/D,r[0]=(s*I-u*T+f*A)*D,r[1]=(i*T-n*I-a*A)*D,r[2]=(p*_-g*w+y*E)*D,r[3]=(h*w-c*_-d*E)*D,r[4]=(u*S-o*I-f*C)*D,r[5]=(e*I-i*S+a*C)*D,r[6]=(g*x-v*_-y*b)*D,r[7]=(l*_-h*x+d*b)*D,r[8]=(o*T-s*S+f*M)*D,r[9]=(n*S-e*T-a*M)*D,r[10]=(v*w-p*x+y*m)*D,r[11]=(c*x-l*w-d*m)*D,r[12]=(s*C-o*A-u*M)*D,r[13]=(e*A-n*C+i*M)*D,r[14]=(p*b-v*E-g*m)*D,r[15]=(l*E-c*b+h*m)*D,r):null}function cF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15];return r[0]=s*(h*y-d*g)-c*(u*y-f*g)+p*(u*d-f*h),r[1]=-(n*(h*y-d*g)-c*(i*y-a*g)+p*(i*d-a*h)),r[2]=n*(u*y-f*g)-s*(i*y-a*g)+p*(i*f-a*u),r[3]=-(n*(u*d-f*h)-s*(i*d-a*h)+c*(i*f-a*u)),r[4]=-(o*(h*y-d*g)-l*(u*y-f*g)+v*(u*d-f*h)),r[5]=e*(h*y-d*g)-l*(i*y-a*g)+v*(i*d-a*h),r[6]=-(e*(u*y-f*g)-o*(i*y-a*g)+v*(i*f-a*u)),r[7]=e*(u*d-f*h)-o*(i*d-a*h)+l*(i*f-a*u),r[8]=o*(c*y-d*p)-l*(s*y-f*p)+v*(s*d-f*c),r[9]=-(e*(c*y-d*p)-l*(n*y-a*p)+v*(n*d-a*c)),r[10]=e*(s*y-f*p)-o*(n*y-a*p)+v*(n*f-a*s),r[11]=-(e*(s*d-f*c)-o*(n*d-a*c)+l*(n*f-a*s)),r[12]=-(o*(c*g-h*p)-l*(s*g-u*p)+v*(s*h-u*c)),r[13]=e*(c*g-h*p)-l*(n*g-i*p)+v*(n*h-i*c),r[14]=-(e*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=e*(s*h-u*c)-o*(n*h-i*c)+l*(n*u-i*s),r}function hF(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],c=r[10],h=r[11],d=r[12],v=r[13],p=r[14],g=r[15],y=t*o-e*a,m=t*s-n*a,b=t*u-i*a,x=e*s-n*o,E=e*u-i*o,w=n*u-i*s,_=f*v-l*d,M=f*p-c*d,C=f*g-h*d,S=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+b*S+x*C-E*M+w*_}function jC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=t[9],d=t[10],v=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=e[0],x=e[1],E=e[2],w=e[3];return r[0]=b*n+x*s+E*c+w*p,r[1]=b*i+x*u+E*h+w*g,r[2]=b*a+x*f+E*d+w*y,r[3]=b*o+x*l+E*v+w*m,b=e[4],x=e[5],E=e[6],w=e[7],r[4]=b*n+x*s+E*c+w*p,r[5]=b*i+x*u+E*h+w*g,r[6]=b*a+x*f+E*d+w*y,r[7]=b*o+x*l+E*v+w*m,b=e[8],x=e[9],E=e[10],w=e[11],r[8]=b*n+x*s+E*c+w*p,r[9]=b*i+x*u+E*h+w*g,r[10]=b*a+x*f+E*d+w*y,r[11]=b*o+x*l+E*v+w*m,b=e[12],x=e[13],E=e[14],w=e[15],r[12]=b*n+x*s+E*c+w*p,r[13]=b*i+x*u+E*h+w*g,r[14]=b*a+x*f+E*d+w*y,r[15]=b*o+x*l+E*v+w*m,r}function dF(r,t,e){var n=e[0],i=e[1],a=e[2],o,s,u,f,l,c,h,d,v,p,g,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],f=t[3],l=t[4],c=t[5],h=t[6],d=t[7],v=t[8],p=t[9],g=t[10],y=t[11],r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=l,r[5]=c,r[6]=h,r[7]=d,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+l*i+v*a+t[12],r[13]=s*n+c*i+p*a+t[13],r[14]=u*n+h*i+g*a+t[14],r[15]=f*n+d*i+y*a+t[15]),r}function vF(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function pF(r,t,e,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,c,h,d,v,p,g,y,m,b,x,E,w,_,M,C,S,A,T,I,D,N;return s<_t?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),f=Math.cos(e),l=1-f,c=t[0],h=t[1],d=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8],x=t[9],E=t[10],w=t[11],_=i*i*l+f,M=a*i*l+o*u,C=o*i*l-a*u,S=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,I=i*o*l+a*u,D=a*o*l-i*u,N=o*o*l+f,r[0]=c*_+p*M+b*C,r[1]=h*_+g*M+x*C,r[2]=d*_+y*M+E*C,r[3]=v*_+m*M+w*C,r[4]=c*S+p*A+b*T,r[5]=h*S+g*A+x*T,r[6]=d*S+y*A+E*T,r[7]=v*S+m*A+w*T,r[8]=c*I+p*D+b*N,r[9]=h*I+g*D+x*N,r[10]=d*I+y*D+E*N,r[11]=v*I+m*D+w*N,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function gF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],o=t[5],s=t[6],u=t[7],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+f*n,r[5]=o*i+l*n,r[6]=s*i+c*n,r[7]=u*i+h*n,r[8]=f*i-a*n,r[9]=l*i-o*n,r[10]=c*i-s*n,r[11]=h*i-u*n,r}function yF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-f*n,r[1]=o*i-l*n,r[2]=s*i-c*n,r[3]=u*i-h*n,r[8]=a*n+f*i,r[9]=o*n+l*i,r[10]=s*n+c*i,r[11]=u*n+h*i,r}function mF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],f=t[4],l=t[5],c=t[6],h=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+f*n,r[1]=o*i+l*n,r[2]=s*i+c*n,r[3]=u*i+h*n,r[4]=f*i-a*n,r[5]=l*i-o*n,r[6]=c*i-s*n,r[7]=h*i-u*n,r}function bF(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function xF(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function EF(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,f;return o<_t?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(t),u=Math.cos(t),f=1-u,r[0]=n*n*f+u,r[1]=i*n*f+a*s,r[2]=a*n*f-i*s,r[3]=0,r[4]=n*i*f-a*s,r[5]=i*i*f+u,r[6]=a*i*f+n*s,r[7]=0,r[8]=n*a*f+i*s,r[9]=i*a*f-n*s,r[10]=a*a*f+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function wF(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function _F(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function SF(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function UC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,f=a+a,l=n*s,c=n*u,h=n*f,d=i*u,v=i*f,p=a*f,g=o*s,y=o*u,m=o*f;return r[0]=1-(d+p),r[1]=c+m,r[2]=h-y,r[3]=0,r[4]=c-m,r[5]=1-(l+p),r[6]=v+g,r[7]=0,r[8]=h+y,r[9]=v-g,r[10]=1-(l+d),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function MF(r,t){var e=new Qt(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=n*n+i*i+a*a+o*o;return c>0?(e[0]=(s*o+l*n+u*a-f*i)*2/c,e[1]=(u*o+l*i+f*n-s*a)*2/c,e[2]=(f*o+l*a+s*i-u*n)*2/c):(e[0]=(s*o+l*n+u*a-f*i)*2,e[1]=(u*o+l*i+f*n-s*a)*2,e[2]=(f*o+l*a+s*i-u*n)*2),UC(r,t,e),r}function $C(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function WC(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],f=t[9],l=t[10];return r[0]=Math.hypot(e,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,f,l),r}function XC(r,t){var e=new Qt(3);WC(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,f=t[4]*n,l=t[5]*i,c=t[6]*a,h=t[8]*n,d=t[9]*i,v=t[10]*a,p=o+l+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-d)/g,r[1]=(h-u)/g,r[2]=(s-f)/g):o>l&&o>v?(g=Math.sqrt(1+o-l-v)*2,r[3]=(c-d)/g,r[0]=.25*g,r[1]=(s+f)/g,r[2]=(h+u)/g):l>v?(g=Math.sqrt(1+l-o-v)*2,r[3]=(h-u)/g,r[0]=(s+f)/g,r[1]=.25*g,r[2]=(c+d)/g):(g=Math.sqrt(1+v-o-l)*2,r[3]=(s-f)/g,r[0]=(h+u)/g,r[1]=(c+d)/g,r[2]=.25*g),r}function CF(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,f=a+a,l=o+o,c=i*u,h=i*f,d=i*l,v=a*f,p=a*l,g=o*l,y=s*u,m=s*f,b=s*l,x=n[0],E=n[1],w=n[2];return r[0]=(1-(v+g))*x,r[1]=(h+b)*x,r[2]=(d-m)*x,r[3]=0,r[4]=(h-b)*E,r[5]=(1-(c+g))*E,r[6]=(p+y)*E,r[7]=0,r[8]=(d+m)*w,r[9]=(p-y)*w,r[10]=(1-(c+v))*w,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function AF(r,t,e,n,i){var a=t[0],o=t[1],s=t[2],u=t[3],f=a+a,l=o+o,c=s+s,h=a*f,d=a*l,v=a*c,p=o*l,g=o*c,y=s*c,m=u*f,b=u*l,x=u*c,E=n[0],w=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*E,T=(d+x)*E,I=(v-b)*E,D=(d-x)*w,N=(1-(h+y))*w,P=(g+m)*w,G=(v+b)*_,W=(g-m)*_,k=(1-(h+p))*_;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=D,r[5]=N,r[6]=P,r[7]=0,r[8]=G,r[9]=W,r[10]=k,r[11]=0,r[12]=e[0]+M-(A*M+D*C+G*S),r[13]=e[1]+C-(T*M+N*C+W*S),r[14]=e[2]+S-(I*M+P*C+k*S),r[15]=1,r}function TF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,f=e*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=l+y,r[2]=h-g,r[3]=0,r[4]=l-y,r[5]=1-f-v,r[6]=d+p,r[7]=0,r[8]=h+g,r[9]=d-p,r[10]=1-f-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function IF(r,t,e,n,i,a,o){var s=1/(e-t),u=1/(i-n),f=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(e+t)*s,r[9]=(i+n)*u,r[10]=(o+a)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*f,r[15]=0,r}function YC(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var OF=YC;function LF(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function DF(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),f=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=f,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*f*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function VC(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*f,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=(o+a)*f,r[15]=1,r}var kF=VC;function PF(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=f,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=a*f,r[15]=1,r}function NF(r,t,e,n){var i,a,o,s,u,f,l,c,h,d,v=t[0],p=t[1],g=t[2],y=n[0],m=n[1],b=n[2],x=e[0],E=e[1],w=e[2];return Math.abs(v-x)<_t&&Math.abs(p-E)<_t&&Math.abs(g-w)<_t?zC(r):(l=v-x,c=p-E,h=g-w,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-b*c,a=b*l-y*h,o=y*c-m*l,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-h*a,u=h*i-l*o,f=l*a-c*i,d=Math.hypot(s,u,f),d?(d=1/d,s*=d,u*=d,f*=d):(s=0,u=0,f=0),r[0]=i,r[1]=s,r[2]=l,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+f*g),r[14]=-(l*v+c*p+h*g),r[15]=1,r)}function RF(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],f=n[2],l=i-e[0],c=a-e[1],h=o-e[2],d=l*l+c*c+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,c*=d,h*=d);var v=u*h-f*c,p=f*l-s*h,g=s*c-u*l;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-h*p,r[5]=h*v-l*g,r[6]=l*p-c*v,r[7]=0,r[8]=l,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function BF(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function FF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function GF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function HC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function zF(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function jF(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function UF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function $F(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=r[9],h=r[10],d=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=t[0],b=t[1],x=t[2],E=t[3],w=t[4],_=t[5],M=t[6],C=t[7],S=t[8],A=t[9],T=t[10],I=t[11],D=t[12],N=t[13],P=t[14],G=t[15];return Math.abs(e-m)<=_t*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=_t*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=_t*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-E)<=_t*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-w)<=_t*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-_)<=_t*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=_t*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-C)<=_t*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-S)<=_t*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-A)<=_t*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=_t*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-I)<=_t*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-D)<=_t*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(p-N)<=_t*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(g-P)<=_t*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-G)<=_t*Math.max(1,Math.abs(y),Math.abs(G))}var WF=jC,XF=HC;const YF=Object.freeze(Object.defineProperty({__proto__:null,add:GF,adjoint:cF,clone:aF,copy:oF,create:iF,determinant:hF,equals:$F,exactEquals:UF,frob:FF,fromQuat:TF,fromQuat2:MF,fromRotation:EF,fromRotationTranslation:UC,fromRotationTranslationScale:CF,fromRotationTranslationScaleOrigin:AF,fromScaling:xF,fromTranslation:bF,fromValues:sF,fromXRotation:wF,fromYRotation:_F,fromZRotation:SF,frustum:IF,getRotation:XC,getScaling:WC,getTranslation:$C,identity:zC,invert:lF,lookAt:NF,mul:WF,multiply:jC,multiplyScalar:zF,multiplyScalarAndAdd:jF,ortho:kF,orthoNO:VC,orthoZO:PF,perspective:OF,perspectiveFromFieldOfView:DF,perspectiveNO:YC,perspectiveZO:LF,rotate:pF,rotateX:gF,rotateY:yF,rotateZ:mF,scale:vF,set:uF,str:BF,sub:XF,subtract:HC,targetTo:RF,translate:dF,transpose:fF},Symbol.toStringTag,{value:"Module"}));function bm(){var r=new Qt(3);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function VF(r){var t=new Qt(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function KC(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function C0(r,t,e){var n=new Qt(3);return n[0]=r,n[1]=t,n[2]=e,n}function HF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function KF(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function qF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function qC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function ZC(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function QC(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function ZF(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function QF(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function JF(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function e4(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function t4(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function r4(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function n4(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function JC(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.hypot(e,n,i)}function eA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function tA(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function i4(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function a4(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function rA(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function xm(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Gh(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function o4(r,t,e,n){var i=t[0],a=t[1],o=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r}function s4(r,t,e,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,f=o*(a-1),l=o*(3-2*a);return r[0]=t[0]*s+e[0]*u+n[0]*f+i[0]*l,r[1]=t[1]*s+e[1]*u+n[1]*f+i[1]*l,r[2]=t[2]*s+e[2]*u+n[2]*f+i[2]*l,r}function u4(r,t,e,n,i,a){var o=1-a,s=o*o,u=a*a,f=s*o,l=3*a*s,c=3*u*o,h=u*a;return r[0]=t[0]*f+e[0]*l+n[0]*c+i[0]*h,r[1]=t[1]*f+e[1]*l+n[1]*c+i[1]*h,r[2]=t[2]*f+e[2]*l+n[2]*c+i[2]*h,r}function f4(r,t){t=t||1;var e=Di()*2*Math.PI,n=Di()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function l4(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[3]*n+e[7]*i+e[11]*a+e[15];return o=o||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/o,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/o,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/o,r}function fv(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function c4(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=i*f-a*u,c=a*s-n*f,h=n*u-i*s,d=i*h-a*c,v=a*l-n*h,p=n*c-i*l,g=o*2;return l*=g,c*=g,h*=g,d*=2,v*=2,p*=2,r[0]=s+l+d,r[1]=u+c+v,r[2]=f+h+p,r}function h4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function d4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function v4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function p4(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt(e*e+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,c=l&&xm(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function g4(r){return r[0]=0,r[1]=0,r[2]=0,r}function y4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function m4(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function b4(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2];return Math.abs(e-a)<=_t*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=_t*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=_t*Math.max(1,Math.abs(i),Math.abs(s))}var x4=qC,E4=ZC,w4=QC,_4=JC,S4=eA,nA=KC,M4=tA,C4=function(){var r=bm();return function(t,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2];return t}}();const A4=Object.freeze(Object.defineProperty({__proto__:null,add:qF,angle:p4,bezier:u4,ceil:ZF,clone:VF,copy:HF,create:bm,cross:Gh,dist:_4,distance:JC,div:w4,divide:QC,dot:xm,equals:b4,exactEquals:m4,floor:QF,forEach:C4,fromValues:C0,hermite:s4,inverse:a4,len:nA,length:KC,lerp:o4,max:e4,min:JF,mul:E4,multiply:ZC,negate:i4,normalize:rA,random:f4,rotateX:h4,rotateY:d4,rotateZ:v4,round:t4,scale:r4,scaleAndAdd:n4,set:KF,sqrDist:S4,sqrLen:M4,squaredDistance:eA,squaredLength:tA,str:y4,sub:x4,subtract:qC,transformMat3:fv,transformMat4:l4,transformQuat:c4,zero:g4},Symbol.toStringTag,{value:"Module"}));function iA(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function aA(r){var t=new Qt(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function oA(r,t,e,n){var i=new Qt(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function sA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function uA(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function fA(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function lA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function cA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function hA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function T4(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function I4(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function O4(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function L4(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function D4(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r}function dA(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function k4(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function vA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.hypot(e,n,i,a)}function pA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function Em(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function wm(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function P4(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function N4(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function gA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function yA(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function R4(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],o=e[0]*n[3]-e[3]*n[0],s=e[1]*n[2]-e[2]*n[1],u=e[1]*n[3]-e[3]*n[1],f=e[2]*n[3]-e[3]*n[2],l=t[0],c=t[1],h=t[2],d=t[3];return r[0]=c*f-h*u+d*s,r[1]=-(l*f)+h*o-d*a,r[2]=l*u-c*o+d*i,r[3]=-(l*s)+c*a-h*i,r}function mA(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r[3]=s+n*(e[3]-s),r}function B4(r,t){t=t||1;var e,n,i,a,o,s;do e=Di()*2-1,n=Di()*2-1,o=e*e+n*n;while(o>=1);do i=Di()*2-1,a=Di()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=t*e,r[1]=t*n,r[2]=t*i*u,r[3]=t*a*u,r}function F4(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,r}function G4(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2],f=e[3],l=f*n+s*a-u*i,c=f*i+u*n-o*a,h=f*a+o*i-s*n,d=-o*n-s*i-u*a;return r[0]=l*f+d*-o+c*-u-h*-s,r[1]=c*f+d*-s+h*-o-l*-u,r[2]=h*f+d*-u+l*-s-c*-o,r[3]=t[3],r}function z4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function j4(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function bA(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function xA(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],f=t[3];return Math.abs(e-o)<=_t*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=_t*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=_t*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=_t*Math.max(1,Math.abs(a),Math.abs(f))}var U4=lA,$4=cA,W4=hA,X4=vA,Y4=pA,V4=Em,H4=wm,K4=function(){var r=iA();return function(t,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r[3]=t[s+3],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2],t[s+3]=r[3];return t}}();const q4=Object.freeze(Object.defineProperty({__proto__:null,add:fA,ceil:T4,clone:aA,copy:sA,create:iA,cross:R4,dist:X4,distance:vA,div:W4,divide:hA,dot:yA,equals:xA,exactEquals:bA,floor:I4,forEach:K4,fromValues:oA,inverse:N4,len:V4,length:Em,lerp:mA,max:L4,min:O4,mul:$4,multiply:cA,negate:P4,normalize:gA,random:B4,round:D4,scale:dA,scaleAndAdd:k4,set:uA,sqrDist:Y4,sqrLen:H4,squaredDistance:pA,squaredLength:wm,str:j4,sub:U4,subtract:lA,transformMat4:F4,transformQuat:G4,zero:z4},Symbol.toStringTag,{value:"Module"}));function vd(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Z4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function EA(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function Q4(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>_t?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function J4(r,t){var e=Sm(r,t);return Math.acos(2*e*e-1)}function wA(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,r}function _A(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function SA(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function MA(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function e6(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function CA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=e*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function AA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function t6(r,t,e){return AA(r,t),IA(r,r,e),CA(r,r),r}function zh(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=e[0],f=e[1],l=e[2],c=e[3],h,d,v,p,g;return d=i*u+a*f+o*l+s*c,d<0&&(d=-d,u=-u,f=-f,l=-l,c=-c),1-d>_t?(h=Math.acos(d),v=Math.sin(h),p=Math.sin((1-n)*h)/v,g=Math.sin(n*h)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*f,r[2]=p*o+g*l,r[3]=p*s+g*c,r}function r6(r){var t=Di(),e=Di(),n=Di(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function n6(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-e*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function i6(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function TA(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+o]-t[o*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[o]=(t[o*3+i]+t[i*3+o])*n}return r}function a6(r,t,e,n){var i=.5*Math.PI/180;t*=i,e*=i,n*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),f=Math.sin(n),l=Math.cos(n);return r[0]=a*u*l-o*s*f,r[1]=o*s*l+a*u*f,r[2]=o*u*f-a*s*l,r[3]=o*u*l+a*s*f,r}function o6(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var s6=aA,u6=oA,_m=sA,f6=uA,l6=fA,c6=wA,IA=dA,Sm=yA,h6=mA,Mm=Em,d6=Mm,Cm=wm,v6=Cm,Am=gA,p6=bA,g6=xA,y6=function(){var r=bm(),t=C0(1,0,0),e=C0(0,1,0);return function(n,i,a){var o=xm(i,a);return o<-.999999?(Gh(r,t,i),nA(r)<1e-6&&Gh(r,e,i),rA(r,r),EA(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Gh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Am(n,n))}}(),m6=function(){var r=vd(),t=vd();return function(e,n,i,a,o,s){return zh(r,n,o,s),zh(t,i,a,s),zh(e,r,t,2*s*(1-s)),e}}(),b6=function(){var r=BC();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],Am(t,TA(t,r))}}();const x6=Object.freeze(Object.defineProperty({__proto__:null,add:l6,calculateW:e6,clone:s6,conjugate:i6,copy:_m,create:vd,dot:Sm,equals:g6,exactEquals:p6,exp:CA,fromEuler:a6,fromMat3:TA,fromValues:u6,getAngle:J4,getAxisAngle:Q4,identity:Z4,invert:n6,len:d6,length:Mm,lerp:h6,ln:AA,mul:c6,multiply:wA,normalize:Am,pow:t6,random:r6,rotateX:_A,rotateY:SA,rotateZ:MA,rotationTo:y6,scale:IA,set:f6,setAxes:b6,setAxisAngle:EA,slerp:zh,sqlerp:m6,sqrLen:v6,squaredLength:Cm,str:o6},Symbol.toStringTag,{value:"Module"}));function E6(){var r=new Qt(8);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function w6(r){var t=new Qt(8);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t}function _6(r,t,e,n,i,a,o,s){var u=new Qt(8);return u[0]=r,u[1]=t,u[2]=e,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function S6(r,t,e,n,i,a,o){var s=new Qt(8);s[0]=r,s[1]=t,s[2]=e,s[3]=n;var u=i*.5,f=a*.5,l=o*.5;return s[4]=u*n+f*e-l*t,s[5]=f*n+l*r-u*e,s[6]=l*n+u*t-f*r,s[7]=-u*r-f*t-l*e,s}function OA(r,t,e){var n=e[0]*.5,i=e[1]*.5,a=e[2]*.5,o=t[0],s=t[1],u=t[2],f=t[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=n*f+i*u-a*s,r[5]=i*f+a*o-n*u,r[6]=a*f+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function M6(r,t){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0]*.5,r[5]=t[1]*.5,r[6]=t[2]*.5,r[7]=0,r}function C6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function A6(r,t){var e=vd();XC(e,t);var n=new Qt(3);return $C(n,t),OA(r,e,n),r}function LA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r}function T6(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function I6(r,t,e,n,i,a,o,s,u){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var O6=_m;function L6(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var D6=_m;function k6(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function P6(r,t){var e=t[4],n=t[5],i=t[6],a=t[7],o=-t[0],s=-t[1],u=-t[2],f=t[3];return r[0]=(e*f+a*o+n*u-i*s)*2,r[1]=(n*f+a*s+i*o-e*u)*2,r[2]=(i*f+a*u+e*s-n*o)*2,r}function N6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0]*.5,u=e[1]*.5,f=e[2]*.5,l=t[4],c=t[5],h=t[6],d=t[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*f-a*u+l,r[5]=o*u+a*s-n*f+c,r[6]=o*f+n*u-i*s+h,r[7]=-n*s-i*u-a*f+d,r}function R6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return _A(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function B6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return SA(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function F6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return MA(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function G6(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=s*o+l*n+u*a-f*i,r[1]=u*o+l*i+f*n-s*a,r[2]=f*o+l*a+s*i-u*n,r[3]=l*o-s*n-u*i-f*a,s=t[4],u=t[5],f=t[6],l=t[7],r[4]=s*o+l*n+u*a-f*i,r[5]=u*o+l*i+f*n-s*a,r[6]=f*o+l*a+s*i-u*n,r[7]=l*o-s*n-u*i-f*a,r}function z6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,s=e[4],u=e[5],f=e[6],l=e[7],r[4]=n*l+o*s+i*f-a*u,r[5]=i*l+o*u+a*s-n*f,r[6]=a*l+o*f+n*u-i*s,r[7]=o*l-n*s-i*u-a*f,r}function j6(r,t,e,n){if(Math.abs(n)<_t)return LA(r,t);var i=Math.hypot(e[0],e[1],e[2]);n=n*.5;var a=Math.sin(n),o=a*e[0]/i,s=a*e[1]/i,u=a*e[2]/i,f=Math.cos(n),l=t[0],c=t[1],h=t[2],d=t[3];r[0]=l*f+d*o+c*u-h*s,r[1]=c*f+d*s+h*o-l*u,r[2]=h*f+d*u+l*s-c*o,r[3]=d*f-l*o-c*s-h*u;var v=t[4],p=t[5],g=t[6],y=t[7];return r[4]=v*f+y*o+p*u-g*s,r[5]=p*f+y*s+g*o-v*u,r[6]=g*f+y*u+v*s-p*o,r[7]=y*f-v*o-p*s-g*u,r}function U6(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r}function DA(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[4],u=e[5],f=e[6],l=e[7],c=t[4],h=t[5],d=t[6],v=t[7],p=e[0],g=e[1],y=e[2],m=e[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*l+o*s+i*f-a*u+c*m+v*p+h*y-d*g,r[5]=i*l+o*u+a*s-n*f+h*m+v*g+d*p-c*y,r[6]=a*l+o*f+n*u-i*s+d*m+v*y+c*g-h*p,r[7]=o*l-n*s-i*u-a*f+v*m-c*p-h*g-d*y,r}var $6=DA;function W6(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r}var kA=Sm;function X6(r,t,e,n){var i=1-n;return kA(t,e)<0&&(n=-n),r[0]=t[0]*i+e[0]*n,r[1]=t[1]*i+e[1]*n,r[2]=t[2]*i+e[2]*n,r[3]=t[3]*i+e[3]*n,r[4]=t[4]*i+e[4]*n,r[5]=t[5]*i+e[5]*n,r[6]=t[6]*i+e[6]*n,r[7]=t[7]*i+e[7]*n,r}function Y6(r,t){var e=lv(t);return r[0]=-t[0]/e,r[1]=-t[1]/e,r[2]=-t[2]/e,r[3]=t[3]/e,r[4]=-t[4]/e,r[5]=-t[5]/e,r[6]=-t[6]/e,r[7]=t[7]/e,r}function V6(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=t[7],r}var PA=Mm,H6=PA,lv=Cm,K6=lv;function q6(r,t){var e=lv(t);if(e>0){e=Math.sqrt(e);var n=t[0]/e,i=t[1]/e,a=t[2]/e,o=t[3]/e,s=t[4],u=t[5],f=t[6],l=t[7],c=n*s+i*u+a*f+o*l;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/e,r[5]=(u-i*c)/e,r[6]=(f-a*c)/e,r[7]=(l-o*c)/e}return r}function Z6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function Q6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]}function J6(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=t[0],c=t[1],h=t[2],d=t[3],v=t[4],p=t[5],g=t[6],y=t[7];return Math.abs(e-l)<=_t*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(n-c)<=_t*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=_t*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=_t*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=_t*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=_t*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=_t*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=_t*Math.max(1,Math.abs(f),Math.abs(y))}const eG=Object.freeze(Object.defineProperty({__proto__:null,add:U6,clone:w6,conjugate:V6,copy:LA,create:E6,dot:kA,equals:J6,exactEquals:Q6,fromMat4:A6,fromRotation:C6,fromRotationTranslation:OA,fromRotationTranslationValues:S6,fromTranslation:M6,fromValues:_6,getDual:L6,getReal:O6,getTranslation:P6,identity:T6,invert:Y6,len:H6,length:PA,lerp:X6,mul:$6,multiply:DA,normalize:q6,rotateAroundAxis:j6,rotateByQuatAppend:G6,rotateByQuatPrepend:z6,rotateX:R6,rotateY:B6,rotateZ:F6,scale:W6,set:I6,setDual:k6,setReal:D6,sqrLen:K6,squaredLength:lv,str:Z6,translate:N6},Symbol.toStringTag,{value:"Module"}));function NA(){var r=new Qt(2);return Qt!=Float32Array&&(r[0]=0,r[1]=0),r}function tG(r){var t=new Qt(2);return t[0]=r[0],t[1]=r[1],t}function rG(r,t){var e=new Qt(2);return e[0]=r,e[1]=t,e}function nG(r,t){return r[0]=t[0],r[1]=t[1],r}function iG(r,t,e){return r[0]=t,r[1]=e,r}function gn(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function RA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function BA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function FA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function aG(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function oG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function go(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function yo(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function sG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function An(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function uG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function pd(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.hypot(e,n)}function GA(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function zA(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function jA(r){var t=r[0],e=r[1];return t*t+e*e}function fG(r,t){return r[0]=-t[0],r[1]=-t[1],r}function lG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function To(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function Tm(r,t){return r[0]*t[0]+r[1]*t[1]}function cG(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function hG(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function dG(r,t){t=t||1;var e=Di()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function vG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function pG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function gG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function yG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function mG(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+e[0],r[1]=i*o+a*s+e[1],r}function UA(r,t){var e=r[0],n=r[1],i=t[0],a=t[1],o=Math.sqrt(e*e+n*n)*Math.sqrt(i*i+a*a),s=o&&(e*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function bG(r){return r[0]=0,r[1]=0,r}function xG(r){return"vec2("+r[0]+", "+r[1]+")"}function Im(r,t){return r[0]===t[0]&&r[1]===t[1]}function EG(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=_t*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=_t*Math.max(1,Math.abs(n),Math.abs(a))}var wG=zA,jh=RA,_G=BA,SG=FA,MG=pd,CG=GA,AG=jA,TG=function(){var r=NA();return function(t,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],a(r,r,o),t[s]=r[0],t[s+1]=r[1];return t}}();const IG=Object.freeze(Object.defineProperty({__proto__:null,add:gn,angle:UA,ceil:aG,clone:tG,copy:nG,create:NA,cross:cG,dist:MG,distance:pd,div:SG,divide:FA,dot:Tm,equals:EG,exactEquals:Im,floor:oG,forEach:TG,fromValues:rG,inverse:lG,len:wG,length:zA,lerp:hG,max:yo,min:go,mul:_G,multiply:BA,negate:fG,normalize:To,random:dG,rotate:mG,round:sG,scale:An,scaleAndAdd:uG,set:iG,sqrDist:CG,sqrLen:AG,squaredDistance:GA,squaredLength:jA,str:xG,sub:jh,subtract:RA,transformMat2:vG,transformMat2d:pG,transformMat3:gG,transformMat4:yG,zero:bG},Symbol.toStringTag,{value:"Module"})),OG=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:B5,mat2:uB,mat2d:DB,mat3:GC,mat4:YF,quat:x6,quat2:eG,vec2:IG,vec3:A4,vec4:q4},Symbol.toStringTag,{value:"Module"}));function LG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return gm(n,e),xa(r,n,t)}function DG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return ym(n,e),xa(r,n,t)}function kG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return mm(n,e),xa(r,n,t)}function PG(r,t,e){return xa(r,e,t)}function xi(r,t){for(var e=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=t.length;n<i;n++){var a=t[n];switch(a[0]){case"t":LG(e,e,[a[1],a[2]]);break;case"s":kG(e,e,[a[1],a[2]]);break;case"r":DG(e,e,a[1]);break;case"m":PG(e,e,a[1]);break}}return e}var Ms=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];!l&&l!==0||!c&&c!==0||(a[l][c]=1,e||(a[c][l]=1))}),a},NG=function(t,e){return t===e},wE=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),$A=function(){function r(t){t===void 0&&(t=NG),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new wE(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new wE(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.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},r.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},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.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},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),RG=function(){function r(){this.linkedList=new $A}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),Jn=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(u){return u.source===t||u.target===t});if(n==="target"){var a=function(f){return f.source===t};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(f){return f.target===t};return i.filter(o).map(function(u){return u.source})}var s=function(f){return f.source===t?f.target:f.source};return i.map(s)},BG=function(t,e){return e.filter(function(n){return n.source===t})},Uh=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},WA=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function FG(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var XA=function(t,e,n,i){i===void 0&&(i=!0);var a=FG(n),o=new RG,s=t.edges,u=s===void 0?[]:s;o.enqueue(e);for(var f="",l=function(){var h=o.dequeue();a.enter({current:h,previous:f}),Jn(h,u,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:f,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:f}),f=h};!o.isEmpty();)l()},GG=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u=[],f=function d(v){u.push(v),s[v.id]=!0;for(var p=Jn(v.id,a),g=function(b){var x=p[b];if(!s[x]){var E=n.filter(function(w){return w.id===x});E.length>0&&d(E[0])}},y=0;y<p.length;++y)g(y)},l=0;l<n.length;l++){var c=n[l];if(!s[c.id]){f(c);for(var h=[];u.length>0;)h.push(u.pop());o.push(h)}}return o},YA=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u={},f={},l=[],c=0,h=function g(y){u[y.id]=c,f[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Jn(y.id,a,"target").filter(function(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},x=0;x<m.length;x++)b(x);if(f[y.id]===u[y.id]){for(var E=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,E.push(w),w===y)break}E.length>0&&l.push(E)}},d=0,v=n;d<v.length;d++){var p=v[d];!u[p.id]&&u[p.id]!==0&&h(p)}return l};function Om(r,t){return t?YA(r):GG(r)}var Ka=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,o=a===void 0?[]:a;return i.forEach(function(s){e[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){e[s.source].degree++,e[s.source].outDegree++,e[s.target].degree++,e[s.target].inDegree++}),e},VA=function(t,e){var n=Ka(t);return n[e]?Ka(t)[e].inDegree:0},HA=function(t,e){var n=Ka(t);return n[e]?Ka(t)[e].outDegree:0};function zG(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function KA(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,o=a===void 0?[]:a;Jn(t,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:e,current:t,next:s})&&KA(r,s,t,n,i)}),n.leave({current:t,previous:e})}function Lm(r,t,e,n){n===void 0&&(n=!0),KA(r,t,"",zG(e),n)}var Dm=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var f={enter:function(h){var d=h.current,v=h.previous;if(s[d]){e={};for(var p=d,g=v;g!==d;)e[p]=g,p=g,g=a[g];e[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(h){var d=h.current;u[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return e?!1:!u[d]}};Object.keys(o).length;){var l=Object.keys(o)[0];Lm(t,l,f)}return e},km=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Om(t,!1),u=0,f=s;u<f.length;u++){var l=f[u];if(l.length)for(var c=l[0],h=c.id,d=[c],v=(i={},i[h]=c,i),p=(a={},a[h]=new Set,a);d.length>0;)for(var g=d.pop(),y=g.id,m=Jn(y,t.edges),b=function(w){var _,M=m[w],C=t.nodes.find(function(N){return N.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,d.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),e&&n?(S=!1,A.findIndex(function(N){return e.indexOf(N.id)>-1})>-1&&(S=!0)):e&&!n&&A.findIndex(function(N){return e.indexOf(N.id)>-1})>-1&&(S=!1),S){for(var I={},D=1;D<A.length;D+=1)I[A[D-1].id]=A[D];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},Pm=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var I=[T];I.length>0;){var D=I.pop();a.has(D)&&(a.delete(D),o[D.id].forEach(function(N){I.push(N)}),o[D.id].clear())}},c=function A(T,I,D){var N=!1;if(e&&n===!1&&e.indexOf(T.id)>-1)return N;i.push(T),a.add(T);for(var P=D[T.id],G=0;G<P.length;G+=1){var W=u[P[G]];if(W===I){for(var k={},R=1;R<i.length;R+=1)k[i[R-1].id]=i[R];i.length&&(k[i[i.length-1].id]=i[0]),s.push(k),N=!0}else a.has(W)||A(W,I,D)&&(N=!0)}if(N)l(T);else for(var G=0;G<P.length;G+=1){var W=u[P[G]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),N},h=t.nodes,d=h===void 0?[]:h,v=0;v<d.length;v+=1){var p=d[v],g=p.id;f[g]=v,u[v]=p}if(e&&n)for(var y=function(T){var I=e[T];f[d[T].id]=f[I],f[I]=0,u[0]=d.find(function(D){return D.id===I}),u[f[d[T].id]]=d[T]},v=0;v<e.length;v++)y(v);for(var m=function(T){for(var I,D,N=1/0,P=0;P<T.length;P+=1)for(var G=T[P],W=0;W<G.length;W++){var k=f[G[W].id];k<N&&(N=k,D=P)}for(var R=T[D],Y=[],P=0;P<R.length;P+=1){var J=R[P];Y[J.id]=[];for(var te=0,H=Jn(J.id,t.edges,"target").filter(function(Le){return R.map(function(qe){return qe.id}).indexOf(Le)>-1});te<H.length;te++){var pe=H[te];pe===J.id&&!(n===!1&&e.indexOf(J.id)>-1)?s.push((I={},I[J.id]=J,I)):Y[J.id].push(f[pe])}}return{component:R,adjList:Y,minIdx:N}},b=0;b<d.length;){var x=d.filter(function(A){return f[A.id]>=b}),E=YA({nodes:x,edges:t.edges}).filter(function(A){return A.length>1});if(E.length===0)break;var w=m(E),_=w.minIdx,M=w.adjList,C=w.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(e&&n&&e.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},qA=function(t,e,n,i){return i===void 0&&(i=!0),e?Pm(t,n,i):km(t,n,i)},jG=function(t,e,n){for(var i=1/0,a,o=0;o<e.length;o++){var s=e[o].id;!n[s]&&t[s]<=i&&(i=t[s],a=e[o])}return a},cl=function(t,e,n,i){var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,f={},l={},c={};o.forEach(function(m,b){var x=m.id;l[x]=1/0,x===e&&(l[x]=0)});for(var h=o.length,d=function(b){var x=jG(l,o,f),E=x.id;if(f[E]=!0,l[E]===1/0)return"continue";var w=[];n?w=BG(E,u):w=Uh(E,u),w.forEach(function(_){var M=_.target,C=_.source,S=M===E?C:M,A=i&&_[i]?_[i]:1;l[S]>l[x.id]+A?(l[S]=l[x.id]+A,c[S]=[x.id]):l[S]===l[x.id]+A&&c[S].push(x.id)})},v=0;v<h;v++)d();c[e]=[e];var p={};for(var g in l)l[g]!==1/0&&ZA(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function ZA(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,o=e[t];a<o.length;a++){var s=o[a],u=ZA(r,s,e,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];gt(c)?i.push(ri(ri([],c,!0),[t],!1)):i.push([c,t])}}return n[t]=i,n[t]}var QA=function(t,e,n,i,a){var o=cl(t,e,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},JA=function(t,e,n,i){var a;if(e===n)return[[e]];var o=t.edges,s=o===void 0?[]:o,u=[e],f=(a={},a[e]=!0,a),l=[],c=[],h=i?Jn(e,s,"target"):Jn(e,s);for(l.push(h);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var v=d.shift();v&&(u.push(v),f[v]=!0,h=i?Jn(v,s,"target"):Jn(v,s),l.push(h.filter(function(y){return!f[y]})))}else{var p=u.pop();f[p]=!1,l.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();f[p]=!1,l.pop()}}return c},hl=function(t,e){for(var n=Ms(t,e),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},eT=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,f={},l={};o.forEach(function(b,x){var E=WA();b.clusterId=E,f[E]={id:E,nodes:[b]},l[b.id]={node:b,idx:x}});var c=Ms(t,e),h={};c.forEach(function(b,x){var E=o[x].id;h[E]={},b.forEach(function(w,_){if(w){var M=o[_].id;h[E][M]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(E){var w={};Object.keys(h[E.id]).forEach(function(D){var N=h[E.id][D],P=l[D].node,G=P.clusterId;w[G]||(w[G]=0),w[G]+=N});var _=-1/0,M=[];if(Object.keys(w).forEach(function(D){_<w[D]?(_=w[D],M=[D]):_===w[D]&&M.push(D)}),!(M.length===1&&M[0]===E.clusterId)){var C=M.indexOf(E.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=f[E.clusterId],A=S.nodes.indexOf(E);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),I=f[M[T]];I.nodes.push(E),E.clusterId=I.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(b){var x=f[b];(!x.nodes||!x.nodes.length)&&delete f[b]});var g=[],y={};u.forEach(function(b){var x=b.source,E=b.target,w=b[n]||1,_=l[x].node.clusterId,M=l[E].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=w,y[C].count++;else{var S={source:_,target:M,weight:w,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(f).forEach(function(b){m.push(f[b])}),{clusters:m,clusterEdges:g}},gi=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=Vt(this.arr);e.sort(function(o,s){return o-s});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Nm=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},Li;(function(r){r.EuclideanDistance="euclideanDistance"})(Li||(Li={}));var UG=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(o){i=i.concat(Object.keys(o))}),i=fl(i));var a={};return i.forEach(function(o){var s=[];t.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=fl(s))}),a},Rm=function(t,e,n){var i=UG(t,e,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(f){return typeof f=="number"})});return t.forEach(function(u,f){var l=[];Object.keys(i).forEach(function(c){var h=u[c],d=i[c],v=d.findIndex(function(y){return h===y}),p=[];if(s)p.push(h);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);l=l.concat(p)}),a[f]=l}),a},_E=function(t,e,n,i){n===void 0&&(n=Li.EuclideanDistance);var a=0;switch(n){case Li.EuclideanDistance:a=new gi(t).euclideanDistance(new gi(e));break}return a},SE=function(t,e,n,i){for(var a=e.length,o=2*i,s=0,u=0;u<a;u++)for(var f=t[u].clusterId,l=0;l<a;l++){var c=t[l].clusterId;if(f===c){var h=e[u][l]||0,d=n[u]||0,v=n[l]||0;s+=h-d*v/o}}return s*=1/o,s},hg=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new gi([]),a=0;a<n;a++)i=i.add(new gi(e[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new gi(e[a]),f=u.squareEuclideanDistance(o);s+=f}var l=[];t.forEach(function(){l.push([])});for(var a=0;a<n;a++){var u=new gi(e[a]);t[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new gi(e[c]);l[a][c]=u.squareEuclideanDistance(h),t[a].clusterInertial+=l[a][c]}}for(var d=0,v=2*n*s,a=0;a<n;a++)for(var p=t[a].clusterId,c=0;c<n;c++){var g=t[c].clusterId;if(!(a===c||p!==g)){var y=t[a].clusterInertial*t[c].clusterInertial/Math.pow(v,2)-l[a][c]/v;d+=y}}return Number(d.toFixed(4))},Bm=function(t,e,n,i,a,o,s,u,f){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),f===void 0&&(f=1);var l=t.nodes,c=l===void 0?[]:l,h=t.edges,d=h===void 0?[]:h,v=[];if(a){c.forEach(function(k,R){k.properties=k.properties||{},k.originIndex=R});var p=[];c.every(function(k){return k.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(k){return k.nodeType}))),c.forEach(function(k){k.properties.nodeType=p.findIndex(function(R){return R===k.nodeType})}));var g=Nm(c,o);v=Rm(g,s,u)}var y=1,m={},b={};c.forEach(function(k,R){var Y=String(y++);k.clusterId=Y,m[Y]={id:Y,nodes:[k]},b[k.id]={node:k,idx:R}});var x=Ms(t,e),E=[],w={},_=0;x.forEach(function(k,R){var Y=0,J=c[R].id;w[J]={},k.forEach(function(te,H){if(te){Y+=te;var pe=c[H].id;w[J][pe]=te,_+=te}}),E.push(Y)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(k){return k.hasOwnProperty("properties")})?M=SE(c,x,E,_)+hg(c,v)*f:M=SE(c,x,E,_),S===0&&(C=M,A=c,T=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(k){return{node:k,clusterId:k.clusterId}}),T=Vt(m),C=M),I||S>100)break;S++,Object.keys(m).forEach(function(k){var R=0;d.forEach(function(Y){var J=Y.source,te=Y.target,H=b[J].node.clusterId,pe=b[te].node.clusterId;(H===k&&pe!==k||pe===k&&H!==k)&&(R=R+(Y[n]||1))}),m[k].sumTot=R}),c.forEach(function(k,R){var Y=m[k.clusterId],J=0,te,H=E[R]/(2*_),pe=0,Ae=Y.nodes;Ae.forEach(function(Ut){var dr=b[Ut.id].idx;pe+=x[R][dr]||0});var Le=pe-Y.sumTot*H,qe=Ae.filter(function(Ut){return Ut.id!==k.id});qe.forEach(function(Ut,dr){v[Ut.originIndex]});var at=hg(qe,v)*f,rt=w[k.id];if(Object.keys(rt).forEach(function(Ut){var dr=b[Ut].node,fr=dr.clusterId;if(fr!==k.clusterId){var Gt=m[fr],Jt=Gt.nodes;if(!(!Jt||!Jt.length)){var Rr=0;Jt.forEach(function(Be){var ye=b[Be.id].idx;Rr+=x[R][ye]||0});var tt=Rr-Gt.sumTot*H,ie=Jt.concat([k]);ie.forEach(function(Be,ye){v[Be.originIndex]});var L=hg(ie,v)*f,_e=tt-Le;a&&(_e=tt+L-(Le+at)),_e>J&&(J=_e,te=Gt)}}}),J>0){te.nodes.push(k);var xt=k.clusterId;k.clusterId=te.id;var Et=Y.nodes.indexOf(k);Y.nodes.splice(Et,1);var ur=0,Bt=0;d.forEach(function(Ut){var dr=Ut.source,fr=Ut.target,Gt=b[dr].node.clusterId,Jt=b[fr].node.clusterId;(Gt===te.id&&Jt!==te.id||Jt===te.id&&Gt!==te.id)&&(ur=ur+(Ut[n]||1)),(Gt===xt&&Jt!==xt||Jt===xt&&Gt!==xt)&&(Bt=Bt+(Ut[n]||1))}),te.sumTot=ur,Y.sumTot=Bt}})}var D={},N=0;Object.keys(T).forEach(function(k){var R=T[k];if(!R.nodes||!R.nodes.length){delete T[k];return}var Y=String(N+1);Y!==k&&(R.id=Y,R.nodes=R.nodes.map(function(J){return{id:J.id,clusterId:Y}}),T[Y]=R,D[k]=Y,delete T[k],N++)}),A.forEach(function(k){var R=k.node,Y=k.clusterId;R&&(R.clusterId=Y,R.clusterId&&D[R.clusterId]&&(R.clusterId=D[R.clusterId]))});var P=[],G={};d.forEach(function(k){var R=k.source,Y=k.target,J=k[n]||1,te=b[R].node.clusterId,H=b[Y].node.clusterId;if(!(!te||!H)){var pe="".concat(te,"---").concat(H);if(G[pe])G[pe].weight+=J,G[pe].count++;else{var Ae={source:te,target:H,weight:J,count:1};G[pe]=Ae,P.push(Ae)}}});var W=[];return Object.keys(T).forEach(function(k){W.push(T[k])}),{clusters:W,clusterEdges:P}},tT=function(t,e,n,i,a,o,s,u){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),Bm(t,e,n,i,!0,a,o,s,u)},rT=function(t,e){var n;e===void 0&&(e=1);for(var i=Vt(t),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=Ka({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,b;return((m=h[g])===null||m===void 0?void 0:m.degree)-((b=h[y])===null||b===void 0?void 0:b.degree)});var v=d[0];if(!o.length||((n=h[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var l=f();if(l==="break")break}return{nodes:o,edges:u}},ME=function(t,e,n){var i=[];switch(t){case Li.EuclideanDistance:i=e[n];break;default:i=[];break}return i},nT=function(t,e,n,i,a,o){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=Li.EuclideanDistance);var s=t.nodes,u=s===void 0?[]:s,f=t.edges,l=f===void 0?[]:f,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===Li.EuclideanDistance&&!u.every(function(Y){return Y.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Li.EuclideanDistance&&(h=Nm(u,n),d=Rm(h,i,a)),!d.length)return c;for(var v=fl(d.map(function(Y){return Y.join("")})),p=Math.min(e,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case Li.EuclideanDistance:y[g]=d[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var E=-1/0,w=0,_=function(te){if(!m.includes(te)){for(var H=0,pe=0;pe<y.length;pe++){var Ae=0;switch(o){case Li.EuclideanDistance:Ae=_E(d[u[te].originIndex],y[pe],o);break}H+=Ae}var Le=H/y.length;Le>E&&!y.find(function(qe){return Oo(qe,ME(o,d,u[te].originIndex))})&&(E=Le,w=te)}},M=0;M<u.length;M++)_(M);y[g]=ME(o,d,w),m.push(w),b[g]=[u[w]],u[w].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case Li.EuclideanDistance:I=_E(d[g],y[T],o);break}I<A&&(A=I,S=T)}if(u[g].clusterId!==void 0)for(var D=b[Number(u[g].clusterId)].length-1;D>=0;D--)b[Number(u[g].clusterId)][D].id===u[g].id&&b[Number(u[g].clusterId)].splice(D,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var N=!1,g=0;g<b.length;g++){for(var P=b[g],G=new gi([]),T=0;T<P.length;T++)G=G.add(new gi(d[P[T].originIndex]));var W=G.avg(P.length);W.equal(new gi(y[g]))||(N=!0,y[g]=W.getArr())}if(C++,u.every(function(Y){return Y.clusterId!==void 0})&&N||C>=1e3)break}var k=[],R={};return l.forEach(function(Y){var J,te,H=Y.source,pe=Y.target,Ae=(J=u.find(function(rt){return rt.id===H}))===null||J===void 0?void 0:J.clusterId,Le=(te=u.find(function(rt){return rt.id===pe}))===null||te===void 0?void 0:te.clusterId,qe="".concat(Ae,"---").concat(Le);if(R[qe])R[qe].count++;else{var at={source:Ae,target:Le,count:1};R[qe]=at,k.push(at)}}),{clusters:b,clusterEdges:k}},Fm=function(t,e){var n=new gi(e),i=n.norm2(),a=new gi(t),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},iT=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Vt(t.filter(function(h){return h.id!==e.id})),s=t.findIndex(function(h){return h.id===e.id}),u=Nm(t,n),f=Rm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==e.id){var v=f[d],p=Fm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},$G=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(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]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),WG=function(t,e){return t-e},XG=function(){function r(t){t===void 0&&(t=WG),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.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)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),YG=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],f=new Set;f.add(u);var l=function(g,y){return e?g.weight-y.weight:0},c=new XG(l);for(Uh(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var h=c.delMin(),d=h.source,v=h.target;f.has(d)&&f.has(v)||(n.push(h),f.has(d)||(f.add(d),Uh(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),Uh(v,s).forEach(function(p){c.insert(p)})))}return n},CE=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(d){return d});e&&u.sort(function(d,v){return d.weight-v.weight});for(var f=new $G(a.map(function(d){return d.id}));u.length>0;){var l=u.shift(),c=l.source,h=l.target;f.connected(c,h)||(n.push(l),f.union(c,h))}return n},aT=function(t,e,n){var i={prim:YG,kruskal:CE};return n?i[n](t,e):CE(t,e)},oT=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=t.nodes,u=s===void 0?[]:s,f=t.edges,l=f===void 0?[]:f,c=u.length,h,d={},v={},p=0;p<c;++p){var g=u[p],y=g.id;d[y]=1/c,v[y]=1/c}for(var m=Ka(t);o>0&&i>e;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(h=0,m[g.id].inDegree===0)d[y]=0;else{for(var b=Jn(y,l,"source"),x=0;x<b.length;++x){var E=b[x],w=m[E].outDegree;w>0&&(h+=v[E]/w)}d[y]=n*h,a+=d[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;h=d[y]+a,i+=Math.abs(h-v[y]),v[y]=h}o-=1}return v},VG=-1,gd=-1,sT="-1",aa="-1",uT=-1,AE=function(){function r(t,e,n,i){t===void 0&&(t=VG),e===void 0&&(e=gd),n===void 0&&(n=gd),i===void 0&&(i=sT),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),HG=function(){function r(t,e){t===void 0&&(t=gd),e===void 0&&(e=aa),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),fT=function(){function r(t,e,n){t===void 0&&(t=gd),e===void 0&&(e=!0),n===void 0&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new HG(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new AE(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new AE(t,n,e,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),fs=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||aa,edgeLabel:i||sT,nodeLabel2:a||aa}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),TE=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new fs(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=uT),e===void 0&&(e=!1);var n=new fT(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,f=s.edgeLabel,l=s.nodeLabel2;u!==aa&&n.addNode(a,u),l!==aa&&n.addNode(o,l),u!==aa&&l!==u&&n.addEdge(void 0,a,o,f)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(t===void 0||o===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},r}(),$c=function(){function r(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),KG=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,o=a===void 0?1:a,s=t.maxNodeNum,u=s===void 0?4:s,f=t.top,l=f===void 0?10:f,c=t.directed,h=c===void 0?!1:c,d=t.verbose,v=d===void 0?!1:d;this.graphs=e,this.dfsCode=new TE,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=l,this.directed=h,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(o){(n.directed||e.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,o=a[n.to],s=o.edges,u=s.length,f=0;f<u;f++){var l=s[f];if(!(i.hasEdge(l)||l.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=l.label)return l}else if(e.label<l.label||e.label===l.label&&a[e.to].label<=a[n.to].label)return l}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],o=e.to,s=t.nodeMap[o].edges,u=s.length,f=0;f<u;f++){var l=s[f],c=t.nodeMap[l.to];n<=c.label&&!i.hasNode(c)&&a.push(l)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],o=t.nodeMap,s=o[e.to].label,u=o[e.from],f=u.edges,l=f.length,c=0;c<l;c++){var h=f[c],d=o[h.to].label;e.to===h.to||n>d||i.hasNode(o[h.to])||(e.label<h.label||e.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<e.nodeLabel1||a===e.nodeLabel1&&o<e.edgeLabel||a===e.nodeLabel1&&o===e.edgeLabel&&s<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(uT,n),a=i.nodeMap,o=new TE,s={};i.nodes.forEach(function(c){var h=t.findForwardRootEdges(i,c);h.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new fs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var f=function c(h){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},y=!1,m=0,b=n?-1:0,x=function(G){if(y)return"break";h.forEach(function(W){var k=new $c(W),R=t.findBackwardEdge(i,k.edges[d[G]],k.edges[d[0]],k);R&&(g[R.label]||(g[R.label]={projected:[],edgeLabel:R.label}),g[R.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[d[G]].fromNode,y=!0)})},E=d.length-1;E>b;E--){var w=x(E);if(w==="break")break}if(y){var _=t.findMinLabel(g);o.dfsEdgeList.push(new fs(p,m,aa,_.edgeLabel,aa));var M=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;h.forEach(function(P){var G=new $c(P),W=t.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(y=!0,S=p,W.forEach(function(k){var R="".concat(k.label,"-").concat(a[k.to].label);C[R]||(C[R]={projected:[],edgeLabel:k.label,nodeLabel2:a[k.to].label}),C[R].projected.push({graphId:i.id,edge:k,preNode:P})}))});for(var A=d.length,T=function(G){if(y)return"break";var W=d[G];h.forEach(function(k){var R=new $c(k),Y=t.findForwardRmpathEdges(i,R.edges[W],v,R);Y.length>0&&(y=!0,S=o.dfsEdgeList[W].fromNode,Y.forEach(function(J){var te="".concat(J.label,"-").concat(a[J.to].label);C[te]||(C[te]={projected:[],edgeLabel:J.label,nodeLabel2:a[J.to].label}),C[te].projected.push({graphId:i.id,edge:J,preNode:k})}))})},E=0;E<A;E++){var I=T(E);if(I==="break")break}if(!y)return!0;var D=t.findMinLabel(C);o.dfsEdgeList.push(new fs(S,p+1,aa,D.edgeLabel,D.nodeLabel2));var N=o.dfsEdgeList.length-1;return e.dfsEdgeList[N]!==o.dfsEdgeList[N]?!1:c(C["".concat(D.edgeLabel,"-").concat(D.nodeLabel2)].projected)},l="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return f(s[l].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Vt(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},f={};t.forEach(function(l){for(var c=e.graphs[l.graphId],h=c.nodeMap,d=new $c(l),v=a.length-1;v>=0;v--){var p=e.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);f[g]||(f[g]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),f[g].projected.push({graphId:l.graphId,edge:p,preNode:l})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(c,d.edges[a[0]],s,d);y.forEach(function(b){var x="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),u[x].projected.push({graphId:l.graphId,edge:b,preNode:l})});for(var m=function(x){var E=e.findForwardRmpathEdges(c,d.edges[a[x]],s,d);E.forEach(function(w){var _="".concat(e.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);u[_]||(u[_]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),u[_].projected.push({graphId:l.graphId,edge:w,preNode:l})})},v=0;v<a.length;v++)m(v)}}),Object.keys(f).forEach(function(l){var c=f[l],h=c.toNodeId,d=c.edgeLabel;e.dfsCode.dfsEdgeList.push(new fs(o,h,"-1",d,"-1")),e.subGraphMining(f[l].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(l){var c=u[l],h=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;e.dfsCode.dfsEdgeList.push(new fs(h,o+1,aa,d,v)),e.subGraphMining(u[l].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(t).forEach(function(u){var f=t[u],l=f.nodeMap;f.nodes.forEach(function(c,h){var d=c.label,v="".concat(u,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:u,label:d},c.edges.forEach(function(g){var y=d,m=l[g.to].label;if(!e&&y>m){var b=m;m=y,y=b}var x=g.label,E="".concat(y,"-").concat(x,"-").concat(m);if(!o[E]){var w=o[E]||0;w++,o[E]=w}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var l={nodes:[],edges:[]};l.nodes.push({id:"0",label:u}),i.push(l)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs;this.directed;var n={};Object.keys(e).forEach(function(i){var a=e[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=t.findForwardRootEdges(a,s);u.forEach(function(f){var l=o[f.to],c="".concat(s.label,"-").concat(f.label,"-").concat(l.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:f.label,nodeLabel2:l.label});var h={graphId:i,edge:f,preNode:null};n[c].projected.push(h)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,f=a.nodeLabel2;t.dfsCode.dfsEdgeList.push(new fs(0,1,s,u,f)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),qG=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],f=new fT(s,!0,e),l={};u.nodes.forEach(function(c,h){f.addNode(h,c[n]),l[c.id]=h}),u.edges.forEach(function(c,h){var d=l[c.source],v=l[c.target];f.addEdge(-1,d,v,c[i])}),f&&f.getNodeNum()&&(a[f.id]=f)}),a},ZG=function(t,e,n){var i=[];return t.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[e]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},IE="cluster",QG=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,o=a===void 0?IE:a,s=t.edgeLabelProp,u=s===void 0?IE:s,f=qG(e,i,o,u),l=t.minSupport,c=t.maxNodeNum,h=t.minNodeNum,d=t.verbose,v=t.top,p={graphs:f,minSupport:l,maxNodeNum:c,minNodeNum:h,top:v,verbose:d,directed:i},g=new KG(p);g.run();var y=ZG(g.frequentSubgraphs,o,u);return y},OE=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=t.nodes;return e.forEach(function(s,u){a.push(lT(o,s,u,n,i))}),a},lT=function(t,e,n,i,a){var o=[n],s=[],u={};return e.forEach(function(f,l){if(f<=a&&n!==l){o.push(l),s.push(t[l]);var c=t[l][i];u[c]?(u[c].count++,u[c].dists.push(f)):u[c]={count:1,dists:[f]}}}),Object.keys(u).forEach(function(f){u[f].dists=u[f].dists.sort(function(l,c){return l-c})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},JG=function(t,e,n,i,a){var o=Math.ceil(n/e),s={},u=0;return i.forEach(function(f,l){for(var c=0,h=0,d=f.nodeIdxs,v=f.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(l,"-").concat(p)]||s["".concat(p,"-").concat(l)])&&(p=Math.floor(Math.random()*e),g++,!(g>2*e)););if(g<2*e&&(s["".concat(l,"-").concat(p)]={start:l,end:p,distance:a[l][p]},c++,u++,u>=n))return s;if(h++,h>2*e)break}if(c<o){var y=o-c;o=(o+y)/(e-l-1)}}),s},$h=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var f=t[o],l=(s=e[f.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=e[f.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!l||!c)){var h=new Set(c),d=l.filter(function(m){return h.has(m)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var y=a[d[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},Wh=function(t,e,n,i){var a,o,s={};t.nodes.forEach(function(f){s[f.id]=f});var u=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((o=e==null?void 0:e.nodes)===null||o===void 0?void 0:o.length)<2?0:(t.edges.forEach(function(f){var l=s[f.source][n],c=s[f.target][n],h=e==null?void 0:e.nodes[0][n],d=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];f[i]===v&&(l===h&&c===d||l===d&&c===h)&&u++}),u)},ez=function(t,e,n){for(var i=1/0,a=0,o=function(f){var l=t[f],c=Object.keys(l).sort(function(m,b){return l[m]-l[b]}),h=10,d=[];c.forEach(function(m,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(m),d[b%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,E=m.length;m.graphs.forEach(function(w,_){var M=l[w];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-l[C]))})}),x/=E*(E-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,E){b!==E&&(g+=Math.abs(m-x))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=f)},s=0;s<e;s++)o(s);return{structure:n[a],structureCountMap:t[a]}},LE=function(t,e){var n={},i={};return t.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[e];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},DE=function(t,e,n){var i={},a={};return t.forEach(function(o,s){i["".concat(WA)]={idx:s,edge:o};var u=o[e];a[u]||(a[u]=[]),a[u].push(o);var f=n[o.source];f&&(f.degree++,f.outDegree++);var l=n[o.target];l&&(l.degree++,l.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},kE=function(t,e,n){var i=e.length,a={};return e.forEach(function(o,s){for(var u=n?0:s+1,f=t[s].id,l=u;l<i;l++)if(s!==l){var c=t[l].id,h=o[l];a["".concat(f,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(f)]=h)}}),a},tz=function(t,e,n,i,a,o,s,u,f,l,c){var h,d="".concat(e.id,"-").concat(n.id);if(l&&l[d])return l[d];var v=c?c[d]:void 0;if(!v){var p=(h={},h[d]={start:i[e.id].idx,end:i[n.id].idx,distance:a},h);c=$h(p,o,t,c),v=c[d]}return Wh(v,s,u,f)},PE=function(t,e,n,i){var a,o,s,u=(a=t[e])===null||a===void 0?void 0:a.degree,f=(o=t[e])===null||o===void 0?void 0:o.inDegree,l=(s=t[e])===null||s===void 0?void 0:s.outDegree;return t[e]===void 0&&(u=1/0,f=1/0,l=1/0,i[e].forEach(function(c){var h=n[c.id].degree;u>h&&(u=h);var d=n[c.id].inDegree;f>d&&(f=d);var v=n[c.id].outDegree;l>v&&(l=v)}),t[e]={degree:u,inDegree:f,outDegree:l}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:f,minPatternNodeLabelOutDegree:l}},cT=function(t,e,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!t||!t.nodes)){var f=t.nodes.length;if(f){var l=hl(t,n),c=hl(e,n),h=kE(t.nodes,l,n),d=kE(e.nodes,c,n),v=LE(t.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=LE(e.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;DE(t.edges,s,p);var x=DE(e.edges,s,m).edgeLabelMap,E=[];c==null||c.forEach(function(tt){E=E.concat(tt)}),a||(a=Math.max.apply(Math,ri(ri([],E,!1),[2],!1))),i||(i=a);var w=OE(t,l,o,i),_=OE(e,c,o,i),M=Math.min(100,f*(f-1)/2),C=JG(i,f,M,w,l),S=$h(C,w,t),A=10,T=1,I=1,D=4,N={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:D,directed:n},P=QG(N).slice(0,A),G=P.length,W=[];P.forEach(function(tt,ie){W[ie]={},Object.keys(S).forEach(function(L){var _e=S[L],Be=Wh(_e,tt,o,s);W[ie][L]=Be})});var k=ez(W,G,P),R=k.structure,Y=k.structureCountMap,J=e.nodes[0],te=[],H=(u=e.nodes[0])===null||u===void 0?void 0:u[o],pe=-1/0;e.nodes.forEach(function(tt){var ie=tt[o],L=g[ie];(L==null?void 0:L.length)>pe&&(pe=L.length,te=L,H=ie,J=tt)});var Ae={},Le={},qe={},at={},rt={},xt={};Object.keys(b).forEach(function(tt,ie){rt[tt]=[],n&&(xt[tt]=[]);var L=b[tt],_e={};L.forEach(function(Ke){var Qe=d["".concat(J.id,"-").concat(Ke.id)];if(Qe&&rt[tt].push(Qe),_e["".concat(J.id,"-").concat(Ke.id)]={start:0,end:m[Ke.id].idx,distance:Qe},n){var vt=d["".concat(Ke.id,"-").concat(J.id)];vt&&xt[tt].push(vt)}}),rt[tt]=rt[tt].sort(function(Ke,Qe){return Ke-Qe}),n&&(xt[tt]=xt[tt].sort(function(Ke,Qe){return Ke-Qe})),Le=$h(_e,_,e,Le);var Be=[];if(Object.keys(_e).forEach(function(Ke){if(qe[Ke]){Be.push(qe[Ke]);return}var Qe=Le[Ke];qe[Ke]=Wh(Qe,R,o,s),Be.push(qe[Ke])}),Be=Be.sort(function(Ke,Qe){return Qe-Ke}),at["".concat(J.id,"-").concat(tt)]=Be,tt!==H)for(var ye=(te==null?void 0:te.length)||0,$e=function(Qe){var vt=te[Qe],Dt=w[p[vt.id].idx],lr=Dt.nodeLabelCountMap[tt],kt=b[tt].length;if(!lr||lr.count<kt)return te.splice(Qe,1),"continue";for(var hr=!1,or=0;or<kt;or++)if(lr.dists[or]>rt[tt][or]){hr=!0;break}if(hr)return te.splice(Qe,1),"continue";var gr={};Dt.neighbors.forEach(function(er){var Or=h["".concat(vt.id,"-").concat(er.id)];gr["".concat(vt.id,"-").concat(er.id)]={start:p[vt.id].idx,end:p[er.id].idx,distance:Or}}),S=$h(gr,w,t,S);var vr=[];Object.keys(gr).forEach(function(er){if(Y[er]){vr.push(Y[er]);return}var Or=S[er];Y[er]=Wh(Or,R,o,s),vr.push(Y[er])}),vr=vr.sort(function(er,Or){return Or-er});for(var en=!1,or=0;or<kt;or++)if(vr[or]<Be[or]){en=!0;break}if(en)return te.splice(Qe,1),"continue"},We=ye-1;We>=0;We--)$e(We)});var Et=[];te==null||te.forEach(function(tt){for(var ie=p[tt.id].idx,L=lT(t.nodes,l[ie],ie,o,a),_e=L.neighbors,Be=_e.length,ye=!1,$e=Be-1;$e>=0;$e--){if(_e.length+1<e.nodes.length){ye=!0;return}var We=_e[$e],Ke=We[o];if(!b[Ke]||!b[Ke].length){_e.splice($e,1);continue}if(!rt[Ke]||!rt[Ke].length){_e.splice($e,1);continue}var Qe="".concat(tt.id,"-").concat(We.id),vt=h[Qe],Dt=rt[Ke].length-1,lr=rt[Ke][Dt];if(vt>lr){_e.splice($e,1);continue}if(n){var kt="".concat(We.id,"-").concat(tt.id),hr=h[kt];Dt=xt[Ke].length-1;var or=xt[Ke][Dt];if(hr>or){_e.splice($e,1);continue}}var gr=Y[Qe]?Y[Qe]:tz(t,tt,We,p,vt,w,R,o,s,Y,S),vr="".concat(J.id,"-").concat(Ke),en=at[vr][at[vr].length-1];if(gr<en){_e.splice($e,1);continue}var er=PE(Ae,Ke,m,b),Or=er.minPatternNodeLabelDegree;if(er.minPatternNodeLabelInDegree,er.minPatternNodeLabelOutDegree,p[We.id].degree<Or){_e.splice($e,1);continue}}ye||Et.push({nodes:[tt].concat(_e)})});var ur=cl(e,J.id,!1).length,Bt={};n?(Object.keys(ur).forEach(function(tt){var ie=m[tt].node[o];Bt[ie]?Bt[ie].push(ur[tt]):Bt[ie]=[ur[tt]]}),Object.keys(Bt).forEach(function(tt){Bt[tt].sort(function(ie,L){return ie-L})})):Bt=rt;for(var Ut=Et.length,dr=function(ie){var L=Et[ie],_e=L.nodes[0],Be={},ye={};L.nodes.forEach(function(At,pr){ye[At.id]={idx:pr,node:At,degree:0,inDegree:0,outDegree:0};var mt=At[o];Be[mt]?Be[mt]++:Be[mt]=1});var $e=[],We={};t.edges.forEach(function(At){ye[At.source]&&ye[At.target]&&($e.push(At),We[At[s]]?We[At[s]]++:We[At[s]]=1,ye[At.source].degree++,ye[At.target].degree++,ye[At.source].outDegree++,ye[At.target].inDegree++)});for(var Ke=Object.keys(x).length,Qe=!1,vt=0;vt<Ke;vt++){var Dt=Object.keys(x)[vt];if(!We[Dt]||We[Dt]<x[Dt].length){Qe=!0;break}}if(Qe)return Et.splice(ie,1),"continue";var lr=$e.length;if(lr<e.edges.length)return Et.splice(ie,1),"break";for(var kt=!1,hr=function(pr){var mt=$e[pr],_r=mt[s],tn=x[_r];if(!tn||!tn.length)return We[_r]--,tn&&We[_r]<tn.length?(kt=!0,"break"):($e.splice(pr,1),ye[mt.source].degree--,ye[mt.target].degree--,ye[mt.source].outDegree--,ye[mt.target].inDegree--,"continue");var Aa=ye[mt.source].node[o],Ta=ye[mt.target].node[o],_i=!1;if(tn.forEach(function($i){var Ia=m[$i.source].node,Oa=m[$i.target].node;Ia[o]===Aa&&Oa[o]===Ta&&(_i=!0),!n&&Ia[o]===Ta&&Oa[o]===Aa&&(_i=!0)}),!_i)return We[_r]--,tn&&We[_r]<tn.length?(kt=!0,"break"):($e.splice(pr,1),ye[mt.source].degree--,ye[mt.target].degree--,ye[mt.source].outDegree--,ye[mt.target].inDegree--,"continue")},vt=lr-1;vt>=0;vt--){var or=hr(vt);if(or==="break")break}if(kt)return Et.splice(ie,1),"continue";L.edges=$e;var gr=cl(L,L.nodes[0].id,!1).length;if(Object.keys(gr).reverse().forEach(function(At){if(!(At===L.nodes[0].id||kt)){if(gr[At]===1/0){var pr=ye[At].node[o];if(Be[pr]--,Be[pr]<b[pr].length){kt=!0;return}var mt=L.nodes.indexOf(ye[At].node);L.nodes.splice(mt,1),ye[At]=void 0;return}var _r=p[At].node[o];if(!Bt[_r]||!Bt[_r].length||gr[At]>Bt[_r][Bt[_r].length-1]){var pr=ye[At].node[o];if(Be[pr]--,Be[pr]<b[pr].length){kt=!0;return}var mt=L.nodes.indexOf(ye[At].node);L.nodes.splice(mt,1),ye[At]=void 0}}}),kt)return Et.splice(ie,1),"continue";for(var vr=!0,en=0;vr&&!kt;){vr=!1;var er=n?ye[_e.id].degree<m[J.id].degree||ye[_e.id].inDegree<m[J.id].inDegree||ye[_e.id].outDegree<m[J.id].outDegree:ye[_e.id].degree<m[J.id].degree;if(er){kt=!0;break}if(Be[_e[o]]<b[_e[o]].length){kt=!0;break}for(var Or=L.nodes.length,Un=Or-1;Un>=0;Un--){var Br=L.nodes[Un],Ui=ye[Br.id].degree,Uo=ye[Br.id].inDegree,$o=ye[Br.id].outDegree,qr=Br[o],wi=PE(Ae,qr,m,b),Ca=wi.minPatternNodeLabelDegree,Wo=wi.minPatternNodeLabelInDegree,Xo=wi.minPatternNodeLabelOutDegree,Yo=n?Ui<Ca||Uo<Wo||$o<Xo:Ui<Ca;if(Yo){if(Be[Br[o]]--,Be[Br[o]]<b[Br[o]].length){kt=!0;break}L.nodes.splice(Un,1),ye[Br.id]=void 0,vr=!0}}if(kt||!vr&&en!==0)break;lr=$e.length;for(var $n=lr-1;$n>=0;$n--){var Lr=$e[$n];if(!ye[Lr.source]||!ye[Lr.target]){$e.splice($n,1);var Wn=Lr[s];if(We[Wn]--,ye[Lr.source]&&(ye[Lr.source].degree--,ye[Lr.source].outDegree--),ye[Lr.target]&&(ye[Lr.target].degree--,ye[Lr.target].inDegree--),x[Wn]&&We[Wn]<x[Wn].length){kt=!0;break}vr=!0}}en++}if(kt||kt||L.nodes.length<e.nodes.length||$e.length<e.edges.length)return Et.splice(ie,1),"continue"},fr=Ut-1;fr>=0;fr--){var Gt=dr(fr);if(Gt==="break")break}for(var Jt=Et.length,Rr=function(ie){var L=Et[ie],_e={};L.edges.forEach(function($e){var We="".concat($e.source,"-").concat($e.target,"-").concat($e.label);_e[We]?_e[We]++:_e[We]=1});for(var Be=function(We){var Ke=Et[We],Qe={};Ke.edges.forEach(function(Dt){var lr="".concat(Dt.source,"-").concat(Dt.target,"-").concat(Dt.label);Qe[lr]?Qe[lr]++:Qe[lr]=1});var vt=!0;Object.keys(Qe).length!==Object.keys(_e).length?vt=!1:Object.keys(_e).forEach(function(Dt){Qe[Dt]!==_e[Dt]&&(vt=!1)}),vt&&Et.splice(We,1)},ye=Jt-1;ye>ie;ye--)Be(ye);Jt=Et.length},fr=0;fr<=Jt-1;fr++)Rr(fr);return Et}}},Eu=function(){function r(t){t===void 0&&(t=10),this.linkedList=new $A,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),hT=Dm;const rz={getAdjMatrix:Ms,breadthFirstSearch:XA,connectedComponent:Om,getDegree:Ka,getInDegree:VA,getOutDegree:HA,detectCycle:Dm,detectDirectedCycle:hT,detectAllCycles:qA,detectAllDirectedCycle:Pm,detectAllUndirectedCycle:km,depthFirstSearch:Lm,dijkstra:cl,findAllPath:JA,findShortestPath:QA,floydWarshall:hl,labelPropagation:eT,louvain:Bm,iLouvain:tT,kCore:rT,kMeans:nT,cosineSimilarity:Fm,nodesCosineSimilarity:iT,minimumSpanningTree:aT,pageRank:oT,getNeighbors:Jn,Stack:Eu,GADDI:cT},nz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:cT,Stack:Eu,breadthFirstSearch:XA,connectedComponent:Om,cosineSimilarity:Fm,default:rz,depthFirstSearch:Lm,detectAllCycles:qA,detectAllDirectedCycle:Pm,detectAllUndirectedCycle:km,detectCycle:Dm,detectDirectedCycle:hT,dijkstra:cl,findAllPath:JA,findShortestPath:QA,floydWarshall:hl,getAdjMatrix:Ms,getDegree:Ka,getInDegree:VA,getNeighbors:Jn,getOutDegree:HA,iLouvain:tT,kCore:rT,kMeans:nT,labelPropagation:eT,louvain:Bm,minimumSpanningTree:aT,nodesCosineSimilarity:iT,pageRank:oT},Symbol.toStringTag,{value:"Module"}));var yd=xi,iz=function(t){return function(e,n){return e[t]-n[t]}},NE=function(t,e,n){return t>=e&&t<=n},cv=function(t,e,n,i){var a=1e-4,o={x:n.x-t.x,y:n.y-t.y},s={x:e.x-t.x,y:e.y-t.y},u={x:i.x-n.x,y:i.y-n.y},f=s.x*u.y-s.y*u.x,l=f*f,c=1/f,h=s.x*s.x+s.y*s.y,d=u.x*u.x+u.y*u.y;if(l>a*h*d){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!NE(v,0,1)||!NE(p,0,1)?null:{x:t.x+v*s.x,y:t.y+v*s.y}}return null},dT=function(t,e){var n=t.x,i=t.y,a=t.width,o=t.height,s=n+a/2,u=i+o/2,f=[],l={x:s,y:u};f.push({x:n,y:i}),f.push({x:n+a,y:i}),f.push({x:n+a,y:i+o}),f.push({x:n,y:i+o}),f.push({x:n,y:i});for(var c=null,h=1;h<f.length&&(c=cv(f[h-1],f[h],l,e),!c);h++);return c},vT=function(t,e){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,u=o-n,f=s-i;if(u*u+f*f<a*a)return null;var l=Math.atan(f/u);return{x:n+Math.abs(a*Math.cos(l))*Math.sign(u),y:i+Math.abs(a*Math.sin(l))*Math.sign(f)}},pT=function(t,e){var n=t.rx,i=t.ry,a=t.x,o=t.y,s=e.x-a,u=e.y-o,f=Math.atan2(u/i,s/n);return f<0&&(f+=2*Math.PI),{x:a+n*Math.cos(f),y:o+i*Math.sin(f)}},Mu=function(t,e,n){n===void 0&&(n=1);var i=[t.x,t.y,n];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),fv(i,i,e),{x:i[0],y:i[1]}},gT=function(t,e,n){n===void 0&&(n=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var i=pm([1,0,0,0,1,0,0,0,1],e);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,n];return fv(a,a,i),{x:a[0],y:a[1]}},A0=function(t,e,n){var i=t.x-e.x,a=t.y-e.y,o=t.x-n.x,s=t.y-n.y,u=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,f=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,l=a*o-i*s;return{x:-(s*u-a*f)/l,y:-(i*f-o*u)/l}},md=function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},az=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},oz=function(t){for(var e=[],n=t.length,i=0;i<n;i+=1){e[i]=[];for(var a=0;a<n;a+=1)i===a?e[i][a]=0:t[i][a]===0||!t[i][a]?e[i][a]=1/0:e[i][a]=t[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)e[i][a]>e[i][o]+e[o][a]&&(e[i][a]=e[i][o]+e[o][a]);return e},sz=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];a[l][c]=1,e||(a[c][l]=1)}),a},yT=function(t,e){t.translate(e.x,e.y)},T0=function(t,e,n,i){i===void 0&&(i={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),s=e.x-o.minX,u=e.y-o.minY;if(n){var f=s*a[0],l=u*a[4],c=0,h=0,d=0,v=0;t.animate(function(g){return d=f*g,v=l*g,a=yd(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=yd(a,[["t",s,u]]);t.setMatrix(p)}},uz=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=e;gt(e)||(i=[e,e]),gt(e)&&e.length===1&&(i=[e[0],e[0]]),n=yd(n,[["s",i[0],i[1]]]),t.setMatrix(n)},fz=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=yd(n,[["r",e]]),t.setMatrix(n)},lz=function(t,e,n){for(var i=[],a=0;a<t;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[e[o.source]]+=1),o.target&&(i[e[o.target]]+=1)}),i};function cz(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}var dl=function(t,e,n){var i=!1,a=t.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var f=t[u],l=t[(u+1)%a];if(cz(f,l,[e,n]))return!0;s(f[1]-n)>0!=s(l[1]-n)>0&&s(e-(n-f[1])*(f[0]-l[0])/(f[1]-l[1])-f[0])<0&&(i=!i)}return i},mT=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},hz=function(t,e){var n=!1;return me(t,function(i){if(cv(i.from,i.to,e.from,e.to))return n=!0,!1}),n},bT=function(t,e){var n=function(h){var d=h.map(function(p){return p[0]}),v=h.map(function(p){return p[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(h){for(var d=[],v=h.length,p=0;p<v-1;p++){var g=h[p],y=h[p+1];d.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(d.length>1){var m=h[0],b=h[v-1];d.push({from:{x:b[0],y:b[1]},to:{x:m[0],y:m[1]}})}return d};if(t.length<2||e.length<2)return!1;var a=n(t),o=n(e);if(!mT(a,o))return!1;var s=!1;if(me(e,function(c){if(dl(t,c[0],c[1]))return s=!0,!1}),s||(me(t,function(c){if(dl(e,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(t),f=i(e),l=!1;return me(f,function(c){if(hz(u,c))return l=!0,!1}),l},Cs=function(){function r(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}return r.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),i=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:n,maxY:i,width:n-t,height:i-e};return a},r}(),Gm=function(t,e){var n={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]};return n[e]},dz=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},xT=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=Gm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=cv({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:f,y:l},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},zm=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=Gm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=dz(e,new Cs(f,l,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},ET=function(t){var e=0,n=0;if(t.length>0){for(var i=0,a=t;i<a.length;i++){var o=a[i];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},bd=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},wT=function(t,e){var n=e.x1,i=e.y1,a=e.x2-n,o=e.y2-i,s=t.x-n,u=t.y-i,f=s*a+u*o,l;f<=0?l=0:(s=a-s,u=o-u,f=s*a+u*o,f<=0?l=0:l=f*f/(a*a+o*o));var c=s*s+u*u-l;return c<0&&(c=0),c},I0=function(t,e,n){return n===void 0&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},_T=function(t,e){var n=t.x<e.x,i=t.x>e.x+e.width,a=t.y>e.y+e.height,o=t.y<e.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!i)return Math.pow(t.y-e.y,2);if(n&&!a&&!o)return Math.pow(e.x-t.x,2);if(i&&!a&&!o)return Math.pow(e.x+e.width-t.x,2);var u=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),f=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return u*u+f*f},vz=function(t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e.x,u=e.y,f=[a-n,o-i];if(Im(f,[0,0]))return NaN;var l=[-f[1],f[0]];To(l,l);var c=[s-n,u-i];return Math.abs(Tm(c,l))},jm=function(t,e,n){return t+(e-t)*n},O0=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=jm(t[o],e[o],n);return a};const pz=Object.freeze(Object.defineProperty({__proto__:null,Line:Cs,applyMatrix:Mu,compare:iz,distance:md,floydWarshall:oz,fractionToLine:zm,getAdjMatrix:sz,getBBoxBoundLine:Gm,getCircleCenterByPoints:A0,getCircleIntersectByPoint:vT,getDegree:lz,getEllipseIntersectByPoint:pT,getLineIntersect:cv,getPointsCenter:ET,getRectIntersectByPoint:dT,intersectBBox:mT,invertMatrix:gT,isPointInPolygon:dl,isPointsOverlap:I0,isPolygonsIntersect:bT,itemIntersectByLine:xT,lerp:jm,lerpArray:O0,move:T0,pointLineDistance:vz,pointLineSquareDist:wT,pointRectSquareDist:_T,rotate:fz,scale:uz,scaleMatrix:az,squareDist:bd,translate:yT},Symbol.toStringTag,{value:"Module"}));var fo="rgb(95, 149, 255)",gz="rgb(255, 255, 255)",RE="rgb(0, 0, 0)",dg="rgb(247, 250, 255)",ST="rgb(239, 244, 255)",Wc="rgb(253, 253, 253)",BE="rgb(250, 250, 250)",Xc="rgb(224, 224, 224)",FE="rgb(234, 234, 234)",yz="rgb(245, 245, 245)",mz="rgb(191, 213, 255)",GE="#4572d9",bz="rgb(223, 234, 255)",ir={mainStroke:fo,mainFill:ST,activeStroke:fo,activeFill:dg,inactiveStroke:mz,inactiveFill:dg,selectedStroke:fo,selectedFill:gz,highlightStroke:GE,highlightFill:bz,disableStroke:Xc,disableFill:BE,edgeMainStroke:Xc,edgeActiveStroke:fo,edgeInactiveStroke:FE,edgeSelectedStroke:fo,edgeHighlightStroke:fo,edgeDisableStroke:yz,comboMainStroke:Xc,comboMainFill:Wc,comboActiveStroke:fo,comboActiveFill:dg,comboInactiveStroke:Xc,comboInactiveFill:Wc,comboSelectedStroke:fo,comboSelectedFill:Wc,comboHighlightStroke:GE,comboHighlightFill:Wc,comboDisableStroke:FE,comboDisableFill:BE};const lt={version:"0.8.23",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:ir.mainStroke,fill:ST},size:20,color:ir.mainStroke,linkPoints:{size:8,lineWidth:1,fill:ir.activeFill,stroke:ir.activeStroke}},nodeStateStyles:{active:{fill:ir.activeFill,stroke:ir.activeStroke,lineWidth:2,shadowColor:ir.mainStroke,shadowBlur:10},selected:{fill:ir.selectedFill,stroke:ir.selectedStroke,lineWidth:4,shadowColor:ir.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:ir.highlightFill,stroke:ir.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:ir.inactiveFill,stroke:ir.inactiveStroke,lineWidth:1},disable:{fill:ir.disableFill,stroke:ir.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:RE,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:ir.edgeMainStroke,lineAppendWidth:2},color:ir.edgeMainStroke},edgeStateStyles:{active:{stroke:ir.edgeActiveStroke,lineWidth:1},selected:{stroke:ir.edgeSelectedStroke,lineWidth:2,shadowColor:ir.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ir.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:ir.edgeInactiveStroke,lineWidth:1},disable:{stroke:ir.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:RE,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:ir.comboMainFill,lineWidth:1,stroke:ir.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:ir.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:ir.comboActiveStroke,lineWidth:1,fill:ir.comboActiveFill},selected:{stroke:ir.comboSelectedStroke,lineWidth:2,fill:ir.comboSelectedFill,shadowColor:ir.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ir.comboHighlightStroke,lineWidth:2,fill:ir.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:ir.comboInactiveStroke,fill:ir.comboInactiveFill,lineWidth:1},disable:{stroke:ir.comboDisableStroke,fill:ir.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},xz={" ":.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};var Ji=Math.PI,L0=Math.sin,D0=Math.cos,vn=L0(Ji/8),pn=D0(Ji/8),xd=function(t,e){var n=t.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=Mu(i,o),a=Mu(a,o)}var s=i.x,u=i.y,f=a.x,l=a.y;return{x:s,y:u,minX:s,minY:u,maxX:f,maxY:l,width:f-s,height:l-u}},MT=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),o=a.getBBox(),s=t.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,f=s.position||lt.defaultLoopPosition,l=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[t.startPoint.x,t.startPoint.y],h=[t.endPoint.x,t.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,y=p*vn,m=p*pn,b=g*vn,x=g*pn,E=a.get("type"),w=Math.min(d/2,v/2),_=Math.min(d,v),M=s!=null&&s.pointPadding?Math.min(_,s==null?void 0:s.pointPadding):w;if(c[0]===h[0]&&c[1]===h[1]){switch(f){case"top":E==="circle"?(c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]):(c=[l[0]-M,l[1]-d],h=[l[0]+M,l[1]-d]);break;case"top-right":p=d,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]+v-M,l[1]-d],h=[l[0]+v,l[1]-d+M]);break;case"right":p=v,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+m,l[1]-y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]-M],h=[l[0]+v,l[1]+M]);break;case"bottom-right":p=v,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+m,l[1]+y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]+d-M],h=[l[0]+v-M,l[1]+d]);break;case"bottom":p=d,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-M,l[1]+d],h=[l[0]+M,l[1]+d]);break;case"bottom-left":p=d,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-v,l[1]+d-M],h=[l[0]-v+M,l[1]+d]);break;case"left":p=v,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-m,l[1]+y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v,l[1]-M],h=[l[0]-v,l[1]+M]);break;case"top-left":p=v,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-m,l[1]-y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v+M,l[1]-d],h=[l[0]-v,l[1]-d+M]);break;default:p=v,g=v,y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var S=[c[0]-l[0],c[1]-l[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=An([0,0],S,A),D=[l[0]+I[0],l[1]+I[1]],N=[h[0]-l[0],h[1]-l[1]],P=An([0,0],N,T),G=[l[0]+P[0],l[1]+P[1]];return t.startPoint={x:c[0],y:c[1]},t.endPoint={x:h[0],y:h[1]},t.controlPoints=[{x:D[0],y:D[1]},{x:G[0],y:G[1]}],t},CT=function(t,e,n,i,a){var o=1e-4,s=[],u=t==null?void 0:t.getPoint(e);if(!u)return{x:0,y:0,angle:0};if(e<o)s=t.getStartTangent().reverse();else if(e>1-o)s=t.getEndTangent();else{var f=t==null?void 0:t.getPoint(e+o);s.push([u.x,u.y]),s.push([f.x,f.y])}var l=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(l<0&&(l+=Ji*2),n&&(u.x+=D0(l)*n,u.y+=L0(l)*n),i){var c=l-Ji/2;l>1/2*Ji&&l<3*1/2*Ji&&(c-=Ji),u.x+=D0(c)*i,u.y+=L0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*Ji&&l<1.5*Ji&&(l-=Ji),F({rotate:l},h)):h},Ez=function r(t,e,n,i){if(i(t,e,n)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return!1}return!0},wz=function r(t,e,n,i){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return}return i(t,e,n)!==!1},Cn=function(t,e){typeof e=="function"&&Ez(t,null,-1,e)},ea=function(t,e){typeof e=="function"&&wz(t,null,-1,e)},AT=function(t,e){return e*(xz[t]||1)},TT=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=AT(a,e)}),[n,e]},IT=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},k0=function(t,e){var n=[],i={},a={};t.forEach(function(u){a[u.id]=u}),t.forEach(function(u,f){var l=Vt(u);l.itemType="combo",l.children=void 0,l.parentId===l.id?(console.warn("The parentId for combo ".concat(l.id," can not be the same as the combo's id")),delete l.parentId):l.parentId&&!a[l.parentId]&&(console.warn("The parent combo for combo ".concat(l.id," does not exist!")),delete l.parentId);var c=i[l.id];if(c){if(l.children=c.children,i[l.id]=l,c=l,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(l):h.children=[l];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[l.id]=l}return}if(Ne(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(l):v.children=[l],i[l.id]=l;else{var p={id:u.parentId,children:[l]};i[p.id]=p,i[l.id]=l}}else n.push(l),i[l.id]=l});var o={};(e||[]).forEach(function(u){o[u.id]=u;var f=i[u.comboId];if(f){var l={id:u.id,comboId:u.comboId};f.children?f.children.push(l):f.children=[l],l.itemType="node",i[u.id]=l}});var s=0;return n.forEach(function(u){u.depth=s+10,Cn(u,function(f){var l,c=i[f.id].itemType;c==="node"?l=i[f.comboId]:l=i[f.parentId],l&&c==="node"?f.depth=s+1:f.depth=s+10,s<f.depth&&(s=f.depth);var h=o[f.id];return h&&(h.depth=f.depth),!0})}),n},P0=function(t,e,n){var i,a=t,o,s={root:{children:t}},u=!1,f="root";(t||[]).forEach(function(v){if(!u){if(v.id===e){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}Cn(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||e===p.id)&&a?(f=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[f])===null||i===void 0?void 0:i.children;var l=a?a.indexOf(o):-1;if(l>-1&&a.splice(l,1),u||(o={id:e,itemType:"node",comboId:n},s[e]={children:void 0}),e){var c=!1;if(n){var h=0;(t||[]).forEach(function(v){c||Cn(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],h=p.depth,o.itemType==="node"?o.depth=h+2:o.depth=h+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&t.push(o);var d=o.depth;Cn(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return t},Xh=function(t,e,n){var i={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};if(!t||t.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,f=o.fixSize,l=o.collapsed,c=o.fixCollapseSize,h=l?c:f,d=gt(h)?h:[h,h],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return t.forEach(function(y){var m=e.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},_z=function(t){var e=ht(t.x)||ht(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||ht(t.style.r)||ht(t.style.width)||ht(t.style.height)||ht(t.style.rx)||ht(t.style.ry)),e},Yh=function(t){var e={};return Object.keys(t).forEach(function(n){var i=t[n];if(!(n==="img"&&!Ne(i)))if(bn(i)&&!gt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Ne(s)||(a[o]=Vt(s))}),e[n]=a}else e[n]=Vt(i)}),e},vl=function(t){var e=t.animateCfg,n=t.callback,i;if(!e)i={duration:500,callback:n};else if(i=Vt(e),e.callback){var a=e.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Sz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Yh,getAnimateCfgWithCallback:vl,getBBox:xd,getComboBBox:Xh,getLabelPosition:CT,getLetterWidth:AT,getLoopCfgs:MT,getTextSize:TT,plainCombosToTrees:k0,reconstructTree:P0,shouldRefreshEdge:_z,traverseTree:Cn,traverseTreeUp:ea,truncateLabelByLength:IT},Symbol.toStringTag,{value:"Module"}));var zE=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,n=t.edges,i=t.combos,a=i===void 0?[]:i;if(!e&&!n){var o=!0;return Cn(t,function(h){return Ne(h.id)?!0:(o=!1,!1)}),o}var s=(e||[]).find(function(h){return!Ne(h.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(e||[]).map(function(h){return h.id}),f=a==null?void 0:a.map(function(h){return h.id}),l=ri(ri([],u,!0),f,!0),c=(n||[]).find(function(h){return!l.includes(h.source)||!l.includes(h.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Mz=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!Ne(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},Cz=function(){function r(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 r.prototype.formatModes=function(){var t=this.modes;me(t,function(e){me(e,function(n,i){Ne(n)&&(e[i]={type:n})})})},r.prototype.setBehaviors=function(t){var e=this.graph,n=this.modes[t],i=[],a;me(n||[],function(o){var s=vm.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(e),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(t,e){return me(e,function(n){t.indexOf(n)<0&&(Ne(n)&&(n={type:n}),t.push(n))}),t},r.filterBehaviors=function(t,e){var n=[];return t.forEach(function(i){var a="";Ne(i)?a=i:a=i.type,e.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(t){var e=this,n=e.modes,i=e.graph,a=t,o=n[a];o&&(i.emit("beforemodechange",{mode:t}),me(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:t}),this.mode=t)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(t,e,n){var i=this,a;if(gt(t)?a=t:a=[t],gt(e))return me(e,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=e;return e||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(t,e,n){Ne(t)&&(t={type:t});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===t.type)return s.updateCfg(e),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),Kf=`
|
|
1
|
+
import{cx as fd,cy as ma,aR as ba,aP as xe,h as t3,m as r3,A as n3,B as i3,au as yE,I as a3,C as o3}from"./index-DUNQCHBS.js";import{R as mE}from"./dayjs.min-Dk3SwgwA.js";import"./index-B3yJ_cuJ.js";import"./fetch-H6IWSOXO.js";function s3(r,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const um=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Gi},get Circle(){return _W},get Ellipse(){return SW},get Image(){return MW},get Line(){return CW},get Marker(){return TW},get Path(){return o1},get Polygon(){return NW},get Polyline(){return RW},get Rect(){return GW},get Text(){return zW}},Symbol.toStringTag,{value:"Module"})),fm=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ei},get Circle(){return WW},get Dom(){return XW},get Ellipse(){return YW},get Image(){return VW},get Line(){return HW},get Marker(){return KW},get Path(){return qW},get Polygon(){return ZW},get Polyline(){return QW},get Rect(){return e7},get Text(){return i7}},Symbol.toStringTag,{value:"Module"}));function S0(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function u3(r,t){if(r){if(typeof r=="string")return S0(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return S0(r,t)}}function Ri(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function f3(r,t){if(fd(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(fd(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function ZM(r){var t=f3(r,"string");return fd(t)==="symbol"?t:String(t)}function bE(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,ZM(n.key),n)}}function Bi(r,t,e){return t&&bE(r.prototype,t),e&&bE(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function et(r,t,e){return t=ZM(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var QM={exports:{}};(function(r){function t(e){"@babel/helpers - typeof";return r.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r.exports.__esModule=!0,r.exports.default=r.exports,t(e)}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(QM);var l3=QM.exports,M0=function(r,t){return M0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},M0(r,t)};function Ot(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");M0(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function sn(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function JM(r,t,e,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function eC(r,t){return function(e,n){t(e,n,r)}}function c3(r,t,e,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",f=!t&&r?n.static?r:r.prototype:null,l=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),c,h=!1,d=e.length-1;d>=0;d--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,e[d])(s==="accessor"?{get:l.get,set:l.set}:l[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(l.get=c),(c=o(g.set))&&(l.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),h=!0}function h3(r,t,e){for(var n=arguments.length>2,i=0;i<t.length;i++)e=n?t[i].call(r,e):t[i].call(r);return n?e:void 0}function d3(r){return typeof r=="symbol"?r:"".concat(r)}function v3(r,t,e){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:e?"".concat(e," ",t):t})}function tC(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Hn(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(l){try{f(n.next(l))}catch(c){o(c)}}function u(l){try{f(n.throw(l))}catch(c){o(c)}}function f(l){l.done?a(l.value):i(l.value).then(s,u)}f((n=n.apply(r,t||[])).next())})}function Kn(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(f){return function(l){return u([f,l])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(e=0)),e;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){e.label=f[1];break}if(f[0]===6&&e.label<a[1]){e.label=a[1],a=f;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(f);break}a[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(r,e)}catch(l){f=[6,l],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var nv=Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]};function rC(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&nv(t,r,e)}function ld(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lm(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a}function nC(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(lm(arguments[t]));return r}function iv(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function ri(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))}function Du(r){return this instanceof Du?(this.v=r,this):new Du(r)}function iC(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){n[h]&&(i[h]=function(d){return new Promise(function(v,p){a.push([h,d,v,p])>1||s(h,d)})})}function s(h,d){try{u(n[h](d))}catch(v){c(a[0][3],v)}}function u(h){h.value instanceof Du?Promise.resolve(h.value.v).then(f,l):c(a[0][2],h)}function f(h){s("next",h)}function l(h){s("throw",h)}function c(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function aC(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=r[i]?function(o){return(e=!e)?{value:Du(r[i](o)),done:!1}:a?a(o):o}:a}}function oC(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof ld=="function"?ld(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(a){e[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(f){a({value:f,done:s})},o)}}function sC(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var p3=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function uC(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&nv(t,r,e);return p3(t,r),t}function fC(r){return r&&r.__esModule?r:{default:r}}function lC(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)}function cC(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e}function hC(r,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?t===r:r.has(t)}function dC(r,t,e){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");r.stack.push({value:t,dispose:n,async:e})}else e&&r.stack.push({async:!0});return t}var g3=typeof SuppressedError=="function"?SuppressedError:function(r,t,e){var n=new Error(e);return n.name="SuppressedError",n.error=r,n.suppressed=t,n};function vC(r){function t(n){r.error=r.hasError?new g3(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function e(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(e,function(a){return t(a),e()})}catch(a){t(a)}}if(r.hasError)throw r.error}return e()}const y3={__extends:Ot,__assign:F,__rest:sn,__decorate:JM,__param:eC,__metadata:tC,__awaiter:Hn,__generator:Kn,__createBinding:nv,__exportStar:rC,__values:ld,__read:lm,__spread:nC,__spreadArrays:iv,__spreadArray:ri,__await:Du,__asyncGenerator:iC,__asyncDelegator:aC,__asyncValues:oC,__makeTemplateObject:sC,__importStar:uC,__importDefault:fC,__classPrivateFieldGet:lC,__classPrivateFieldSet:cC,__classPrivateFieldIn:hC,__addDisposableResource:dC,__disposeResources:vC},m3=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:dC,get __assign(){return F},__asyncDelegator:aC,__asyncGenerator:iC,__asyncValues:oC,__await:Du,__awaiter:Hn,__classPrivateFieldGet:lC,__classPrivateFieldIn:hC,__classPrivateFieldSet:cC,__createBinding:nv,__decorate:JM,__disposeResources:vC,__esDecorate:c3,__exportStar:rC,__extends:Ot,__generator:Kn,__importDefault:fC,__importStar:uC,__makeTemplateObject:sC,__metadata:tC,__param:eC,__propKey:d3,__read:lm,__rest:sn,__runInitializers:h3,__setFunctionName:v3,__spread:nC,__spreadArray:ri,__spreadArrays:iv,__values:ld,default:y3},Symbol.toStringTag,{value:"Module"}));var Fn=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},cd=function(r,t){return Fn(r)?r.indexOf(t)>-1:!1},av=function(r,t){if(!Fn(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},b3=function(r,t){return t===void 0&&(t=[]),av(r,function(e){return!cd(t,e)})},x3={}.toString,Fi=function(r,t){return x3.call(r)==="[object "+t+"]"};const Cr=function(r){return Fi(r,"Function")};var ct=function(r){return r==null};const gt=function(r){return Array.isArray?Array.isArray(r):Fi(r,"Array")},bn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function me(r,t){if(r){var e;if(gt(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(bn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var pC=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return me(r,function(e,n){Cr(r)&&n==="prototype"||t.push(n)}),t};function gC(r,t){var e=pC(t),n=e.length;if(ct(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var hd=function(r){return typeof r=="object"&&r!==null},yn=function(r){if(!hd(r)||!Fi(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t};function E3(r,t){if(!gt(r))return null;var e;if(Cr(t)&&(e=t),yn(t)&&(e=function(i){return gC(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function w3(r,t,e){e===void 0&&(e=0);for(var n=e;n<r.length;n++)if(t(r[n],n))return n;return-1}var _3=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!ct(a)){gt(a)?e=a[0]:e=a;break}}return e},S3=function(r){if(!gt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},yC=function(r,t){if(t===void 0&&(t=[]),!gt(r))t.push(r);else for(var e=0;e<r.length;e+=1)yC(r[e],t);return t};const pa=function(r){if(gt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},ga=function(r){if(gt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var mC=function(r){var t=r.filter(function(o){return!isNaN(o)});if(!t.length)return{min:0,max:0};if(gt(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=pa(t),a=ga(t);return{min:a,max:i}},bC=Array.prototype,M3=bC.splice,C3=bC.indexOf,A3=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=C3.call(r,i))>-1;)M3.call(r,a,1);return r},T3=Array.prototype.splice,xC=function(t,e){if(!Fn(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,o=e[n];(n===i||o!==a)&&(a=o,T3.call(t,o,1))}return t},EC=function(r,t,e){if(!gt(r)&&!yn(r))return r;var n=e;return me(r,function(i,a){n=t(n,i,a)}),n},I3=function(r,t){var e=[];if(!Fn(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];t(o,n,r)&&(e.push(o),i.push(n))}return xC(r,i),e};const Ne=function(r){return Fi(r,"String")};function O3(r,t){var e;if(Cr(t))e=function(i,a){return t(i)-t(a)};else{var n=[];Ne(t)?n.push(t):gt(t)&&(n=t),e=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(e),r}function fl(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var L3=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return fl([].concat.apply([],r))};const D3=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[t];if(!ct(o)){gt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(e.push(u),n[u]=!0)}}}return e};function ha(r){if(Fn(r))return r[0]}function yi(r){if(Fn(r)){var t=r;return t[t.length-1]}}function k3(r,t){return gt(r)||Ne(r)?r[0]===t:!1}function P3(r,t){return gt(r)||Ne(r)?r[r.length-1]===t:!1}var N3=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},R3=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},B3=Object.prototype.hasOwnProperty;function dd(r,t){if(!t||!gt(r))return{};for(var e={},n=Cr(t)?t:function(s){return s[t]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),B3.call(e,i)?e[i].push(o):e[i]=[o]}return e}function wC(r,t){if(!t)return{0:r};if(!Cr(t)){var e=gt(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,o=e.length;a<o;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return dd(r,t)}const F3=function(r,t){if(!t)return[r];var e=wC(r,t),n=[];for(var i in e)n.push(e[i]);return n};function G3(r,t){return r["_wrap_"+t]}function vs(r,t){if(r["_wrap_"+t])return r["_wrap_"+t];var e=function(n){r[t](n)};return r["_wrap_"+t]=e,e}var xE={};function z3(r){var t=xE[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,xE[r]=t}return t}function j3(r){var t=0,e=0,n=0,i=0;return gt(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var U3=function(r,t,e){return r<t?t:r>e?e:r},Fh=function(r,t){var e=t.toString(),n=e.indexOf(".");if(n===-1)return Math.round(r);var i=e.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},ht=function(r){return Fi(r,"Number")},$3=function(r){return ht(r)&&r%1!==0},W3=function(r){return ht(r)&&r%2===0},X3=Number.isInteger?Number.isInteger:function(r){return ht(r)&&r%1===0},Y3=function(r){return ht(r)&&r<0},V3=1e-5;function _C(r,t,e){return e===void 0&&(e=V3),Math.abs(r-t)<e}var H3=function(r){return ht(r)&&r%2!==0},K3=function(r){return ht(r)&&r>0};const q3=function(r,t){if(gt(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Cr(t)?t(a):a[t];o>n&&(e=a,n=o)}return e}},Z3=function(r,t){if(gt(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Cr(t)?t(a):a[t];o<n&&(e=a,n=o)}return e}};var ov=function(r,t){return(r%t+t)%t},Q3=180/Math.PI,J3=function(r){return Q3*r};const e5=parseInt;var t5=Math.PI/180,sv=function(r){return t5*r};const EE=function(r,t){return r.hasOwnProperty(t)};var cm=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return me(r,function(e,n){Cr(r)&&n==="prototype"||t.push(e)}),t};const r5=function(r,t){return cd(cm(r),t)},qu=function(r){return ct(r)?"":r.toString()};var n5=function(r){return qu(r).toLowerCase()},i5=function(r){var t=qu(r);return t.charAt(0).toLowerCase()+t.substring(1)};function a5(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var o5=function(r){return qu(r).toUpperCase()},ku=function(r){var t=qu(r);return t.charAt(0).toUpperCase()+t.substring(1)},s5={}.toString,SC=function(r){return s5.call(r).replace(/^\[object /,"").replace(/]$/,"")},u5=function(r){return Fi(r,"Arguments")},Pl=function(r){return Fi(r,"Boolean")},hm=function(r){return Fi(r,"Date")},f5=function(r){return Fi(r,"Error")};function l5(r){return ht(r)&&isFinite(r)}var c5=function(r){return r===null},h5=Object.prototype,MC=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||h5;return r===e},d5=function(r){return Fi(r,"RegExp")},v5=function(r){return r===void 0},p5=function(r){return r instanceof Element||r instanceof HTMLDocument};function CC(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function AC(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function cg(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function yt(r,t,e,n){return t&&cg(r,t),e&&cg(r,e),n&&cg(r,n),r}var g5=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];Cr(i)&&(i=i.prototype),yt(e.prototype,i)}},Vt=function(r){if(typeof r!="object"||r===null)return r;var t;if(gt(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Vt(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Vt(r[i]):t[i]=r[i]}return t};function Nl(r,t,e){var n;return function(){var i=this,a=arguments,o=function(){n=null,e||r.apply(i,a)},s=e&&!n;clearTimeout(n),n=setTimeout(o,t),s&&r.apply(i,a)}}const TC=function(r,t){if(!Cr(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],o=e.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return e.cache=new Map,e};var y5=5;function IC(r,t,e,n){e=e||0,n=n||y5;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&yn(a)?(yn(r[i])||(r[i]={}),e<n?IC(r[i],a,e+1,n):r[i]=t[i]):gt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var mr=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)IC(r,t[n]);return r},m5=function(r,t,e,n){Cr(t)||(e=t,t=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var f=new u;return f.constructor=s,f},a=i(t.prototype,r);return r.prototype=yt(a,r.prototype),r.superclass=i(t.prototype,t),yt(a,e),yt(r,n),r},dm=function(r,t){if(!Fn(r))return-1;var e=Array.prototype.indexOf;if(e)return e.call(r,t);for(var n=-1,i=0;i<r.length;i++)if(r[i]===t){n=i;break}return n},b5=Object.prototype.hasOwnProperty;function OC(r){if(ct(r))return!0;if(Fn(r))return!r.length;var t=SC(r);if(t==="Map"||t==="Set")return!r.size;if(MC(r))return!Object.keys(r).length;for(var e in r)if(b5.call(r,e))return!1;return!0}var Oo=function(r,t){if(r===t)return!0;if(!r||!t||Ne(r)||Ne(t))return!1;if(Fn(r)||Fn(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Oo(r[n],t[n]),!!e);n++);return e}if(hd(r)||hd(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Oo(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const x5=function(r,t,e){return Cr(e)?!!e(r,t):Oo(r,t)};var Ss=function(r,t){if(!Fn(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];e.push(t(i,n))}return e},E5=function(r){return r};const w5=function(r,t){t===void 0&&(t=E5);var e={};return bn(r)&&!ct(r)&&Object.keys(r).forEach(function(n){e[n]=t(r[n],n)}),e},za=function(r,t,e){for(var n=0,i=Ne(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},_5=function(r,t,e){var n=r,i=Ne(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(bn(n[a])||(n[a]=ht(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var S5=Object.prototype.hasOwnProperty;const M5=function(r,t){if(r===null||!yn(r))return{};var e={};return me(t,function(n){S5.call(r,n)&&(e[n]=r[n])}),e},C5=function(r,t){return EC(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},ll=function(r,t,e){var n,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},f=function(){var l=Date.now();!s&&e.leading===!1&&(s=l);var c=t-(l-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=l,o=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(u,c)),o};return f.cancel=function(){clearTimeout(n),s=0,n=i=a=null},f},LC=function(r){return Fn(r)?Array.prototype.slice.call(r):[]};var jc={};const ya=function(r){return r=r||"g",jc[r]?jc[r]+=1:jc[r]=1,r+jc[r]},Ff=function(){},A5=function(r){return r};function uv(r){return ct(r)?0:Fn(r)?r.length:Object.keys(r).length}var Uc;const Gf=TC(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,o=t.fontVariant;return Uc||(Uc=document.createElement("canvas").getContext("2d")),Uc.font=[a,o,i,e+"px",n].join(" "),Uc.measureText(Ne(r)?r:"").width},function(r,t){return t===void 0&&(t={}),iv([r],cm(t)).join("")}),T5=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=Gf(n,e),o=Ne(r)?r:qu(r),s=t,u=[],f,l;if(Gf(r,e)<=t)return r;for(;f=o.substr(0,i),l=Gf(f,e),!(l+a>s&&l>s);)if(u.push(f),s-=l,o=o.substr(i),!o)return u.join("");for(;f=o.substr(0,1),l=Gf(f,e),!(l+a>s);)if(u.push(f),s-=l,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var I5=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const O5=Object.freeze(Object.defineProperty({__proto__:null,Cache:I5,assign:yt,augment:g5,clamp:U3,clearAnimationFrame:AC,clone:Vt,contains:cd,debounce:Nl,deepMix:mr,difference:b3,each:me,endsWith:P3,every:N3,extend:m5,filter:av,find:E3,findIndex:w3,firstValue:_3,fixedBase:Fh,flatten:S3,flattenDeep:yC,forIn:me,get:za,getEllipsisText:T5,getRange:mC,getType:SC,getWrapBehavior:G3,group:F3,groupBy:dd,groupToMap:wC,has:EE,hasKey:EE,hasValue:r5,head:ha,identity:A5,includes:cd,indexOf:dm,isArguments:u5,isArray:gt,isArrayLike:Fn,isBoolean:Pl,isDate:hm,isDecimal:$3,isElement:p5,isEmpty:OC,isEqual:Oo,isEqualWith:x5,isError:f5,isEven:W3,isFinite:l5,isFunction:Cr,isInteger:X3,isMatch:gC,isNegative:Y3,isNil:ct,isNull:c5,isNumber:ht,isNumberEqual:_C,isObject:bn,isObjectLike:hd,isOdd:H3,isPlainObject:yn,isPositive:K3,isPrototype:MC,isRegExp:d5,isString:Ne,isType:Fi,isUndefined:v5,keys:pC,last:yi,lowerCase:n5,lowerFirst:i5,map:Ss,mapValues:w5,max:pa,maxBy:q3,measureTextWidth:Gf,memoize:TC,min:ga,minBy:Z3,mix:yt,mod:ov,noop:Ff,number2color:z3,omit:C5,parseRadius:j3,pick:M5,pull:A3,pullAt:xC,reduce:EC,remove:I3,requestAnimationFrame:CC,set:_5,size:uv,some:R3,sortBy:O3,startsWith:k3,substitute:a5,throttle:ll,toArray:LC,toDegree:J3,toInteger:e5,toRadian:sv,toString:qu,union:L3,uniq:fl,uniqueId:ya,upperCase:o5,upperFirst:ku,values:cm,valuesOfKey:D3,wrapBehavior:vs},Symbol.toStringTag,{value:"Module"})),L5={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),me(n,function(i,a){t.on(a,i)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,n=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),me(e,function(i,a){t.off(a,i)}),t.get("canvas").set("draggable",n)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}};var vm=function(){function r(){}return r.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var n=Vt(L5);Object.assign(n,e);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var f={};u&&(me(u,function(l,c){f[c]=vs(s,l)}),this.events=f)};i.prototype=n,r.types[t]=i},r.hasBehavior=function(t){return!!r.types[t]},r.getBehavior=function(t){return r.types[t]},r.types={},r}(),D5="*",DC=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],o=this._events[D5]||[],s=function(u){for(var f=u.length,l=0;l<f;l++)if(u[l]){var c=u[l],h=c.callback,d=c.once;d&&(u.splice(l,1),u.length===0&&delete e._events[t],f--,l--),h.apply(e,n)}};s(a),s(o)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),_t=1e-6,Qt=typeof Float32Array<"u"?Float32Array:Array,Di=Math.random;function k5(r){Qt=r}var P5=Math.PI/180;function N5(r){return r*P5}function R5(r,t){return Math.abs(r-t)<=_t*Math.max(1,Math.abs(r),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});const B5=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return Qt},EPSILON:_t,RANDOM:Di,equals:R5,setMatrixArrayType:k5,toRadian:N5},Symbol.toStringTag,{value:"Module"}));function F5(){var r=new Qt(4);return Qt!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function G5(r){var t=new Qt(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function z5(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function j5(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function U5(r,t,e,n){var i=new Qt(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function $5(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function W5(r,t){if(r===t){var e=t[1];r[1]=t[2],r[2]=e}else r[0]=t[0],r[1]=t[2],r[2]=t[1],r[3]=t[3];return r}function X5(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=e*o,r):null}function Y5(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function V5(r){return r[0]*r[3]-r[2]*r[1]}function kC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*f+a*l,r[3]=i*f+o*l,r}function H5(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function K5(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function q5(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r}function Z5(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function Q5(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function J5(r){return Math.hypot(r[0],r[1],r[2],r[3])}function eB(r,t,e,n){return r[2]=n[2]/n[0],e[0]=n[0],e[1]=n[1],e[3]=n[3]-r[2]*e[1],[r,t,e]}function tB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function PC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function rB(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function nB(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],f=t[3];return Math.abs(e-o)<=_t*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=_t*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=_t*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=_t*Math.max(1,Math.abs(a),Math.abs(f))}function iB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function aB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}var oB=kC,sB=PC;const uB=Object.freeze(Object.defineProperty({__proto__:null,LDU:eB,add:tB,adjoint:Y5,clone:G5,copy:z5,create:F5,determinant:V5,equals:nB,exactEquals:rB,frob:J5,fromRotation:q5,fromScaling:Z5,fromValues:U5,identity:j5,invert:X5,mul:oB,multiply:kC,multiplyScalar:iB,multiplyScalarAndAdd:aB,rotate:H5,scale:K5,set:$5,str:Q5,sub:sB,subtract:PC,transpose:W5},Symbol.toStringTag,{value:"Module"}));function fB(){var r=new Qt(6);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function lB(r){var t=new Qt(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t}function cB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function hB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function dB(r,t,e,n,i,a){var o=new Qt(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=a,o}function vB(r,t,e,n,i,a,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function pB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=e*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-e*s)*u,r):null}function gB(r){return r[0]*r[3]-r[1]*r[2]}function NC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1],c=e[2],h=e[3],d=e[4],v=e[5];return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*c+a*h,r[3]=i*c+o*h,r[4]=n*d+a*v+s,r[5]=i*d+o*v+u,r}function yB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=Math.sin(e),l=Math.cos(e);return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*-f+a*l,r[3]=i*-f+o*l,r[4]=s,r[5]=u,r}function mB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1];return r[0]=n*f,r[1]=i*f,r[2]=a*l,r[3]=o*l,r[4]=s,r[5]=u,r}function bB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=e[0],l=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*f+a*l+s,r[5]=i*f+o*l+u,r}function xB(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r}function EB(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r}function wB(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r}function _B(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function SB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function MB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r}function RC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r}function CB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r}function AB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r}function TB(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]}function IB(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=t[0],f=t[1],l=t[2],c=t[3],h=t[4],d=t[5];return Math.abs(e-u)<=_t*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-f)<=_t*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-l)<=_t*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=_t*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-h)<=_t*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(s-d)<=_t*Math.max(1,Math.abs(s),Math.abs(d))}var OB=NC,LB=RC;const DB=Object.freeze(Object.defineProperty({__proto__:null,add:MB,clone:lB,copy:cB,create:fB,determinant:gB,equals:IB,exactEquals:TB,frob:SB,fromRotation:xB,fromScaling:EB,fromTranslation:wB,fromValues:dB,identity:hB,invert:pB,mul:OB,multiply:NC,multiplyScalar:CB,multiplyScalarAndAdd:AB,rotate:yB,scale:mB,set:vB,str:_B,sub:LB,subtract:RC,translate:bB},Symbol.toStringTag,{value:"Module"}));function BC(){var r=new Qt(9);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function kB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function PB(r){var t=new Qt(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function NB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function RB(r,t,e,n,i,a,o,s,u){var f=new Qt(9);return f[0]=r,f[1]=t,f[2]=e,f[3]=n,f[4]=i,f[5]=a,f[6]=o,f[7]=s,f[8]=u,f}function BB(r,t,e,n,i,a,o,s,u,f){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r}function FB(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function GB(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function pm(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=e*c+n*h+i*d;return v?(v=1/v,r[0]=c*v,r[1]=(-l*n+i*f)*v,r[2]=(s*n-i*o)*v,r[3]=h*v,r[4]=(l*e-i*u)*v,r[5]=(-s*e+i*a)*v,r[6]=d*v,r[7]=(-f*e+n*u)*v,r[8]=(o*e-n*a)*v,r):null}function zB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8];return r[0]=o*l-s*f,r[1]=i*f-n*l,r[2]=n*s-i*o,r[3]=s*u-a*l,r[4]=e*l-i*u,r[5]=i*a-e*s,r[6]=a*f-o*u,r[7]=n*u-e*f,r[8]=e*o-n*a,r}function jB(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8];return t*(f*a-o*u)+e*(-f*i+o*s)+n*(u*i-a*s)}function xa(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1],v=e[2],p=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return r[0]=h*n+d*o+v*f,r[1]=h*i+d*s+v*l,r[2]=h*a+d*u+v*c,r[3]=p*n+g*o+y*f,r[4]=p*i+g*s+y*l,r[5]=p*a+g*u+y*c,r[6]=m*n+b*o+x*f,r[7]=m*i+b*s+x*l,r[8]=m*a+b*u+x*c,r}function UB(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=e[0],d=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+d*o+f,r[7]=h*i+d*s+l,r[8]=h*a+d*u+c,r}function $B(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=Math.sin(e),d=Math.cos(e);return r[0]=d*n+h*o,r[1]=d*i+h*s,r[2]=d*a+h*u,r[3]=d*o-h*n,r[4]=d*s-h*i,r[5]=d*u-h*a,r[6]=f,r[7]=l,r[8]=c,r}function WB(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function gm(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function ym(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function mm(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function XB(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function YB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,f=e*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=l-y,r[6]=h+g,r[1]=l+y,r[4]=1-f-v,r[7]=d-p,r[2]=h-g,r[5]=d+p,r[8]=1-f-c,r}function VB(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*f-a*o,E=n*u-i*s,w=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,D=m*I-b*T+x*A+E*S-w*C+_*M;return D?(D=1/D,r[0]=(s*I-u*T+f*A)*D,r[1]=(u*S-o*I-f*C)*D,r[2]=(o*T-s*S+f*M)*D,r[3]=(i*T-n*I-a*A)*D,r[4]=(e*I-i*S+a*C)*D,r[5]=(n*S-e*T-a*M)*D,r[6]=(p*_-g*w+y*E)*D,r[7]=(g*x-v*_-y*b)*D,r[8]=(v*w-p*x+y*m)*D,r):null}function HB(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function KB(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function qB(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function ZB(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function FC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function QB(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function JB(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function eF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function tF(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=t[0],h=t[1],d=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8];return Math.abs(e-c)<=_t*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-h)<=_t*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-d)<=_t*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=_t*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=_t*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=_t*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=_t*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(f-m)<=_t*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(l-b)<=_t*Math.max(1,Math.abs(l),Math.abs(b))}var rF=xa,nF=FC;const GC=Object.freeze(Object.defineProperty({__proto__:null,add:ZB,adjoint:zB,clone:PB,copy:NB,create:BC,determinant:jB,equals:tF,exactEquals:eF,frob:qB,fromMat2d:XB,fromMat4:kB,fromQuat:YB,fromRotation:ym,fromScaling:mm,fromTranslation:gm,fromValues:RB,identity:FB,invert:pm,mul:rF,multiply:xa,multiplyScalar:QB,multiplyScalarAndAdd:JB,normalFromMat4:VB,projection:HB,rotate:$B,scale:WB,set:BB,str:KB,sub:nF,subtract:FC,translate:UB,transpose:GB},Symbol.toStringTag,{value:"Module"}));function iF(){var r=new Qt(16);return Qt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function aF(r){var t=new Qt(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function oF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function sF(r,t,e,n,i,a,o,s,u,f,l,c,h,d,v,p){var g=new Qt(16);return g[0]=r,g[1]=t,g[2]=e,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=f,g[10]=l,g[11]=c,g[12]=h,g[13]=d,g[14]=v,g[15]=p,g}function uF(r,t,e,n,i,a,o,s,u,f,l,c,h,d,v,p,g){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=f,r[9]=l,r[10]=c,r[11]=h,r[12]=d,r[13]=v,r[14]=p,r[15]=g,r}function zC(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function fF(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function lF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*f-a*o,E=n*u-i*s,w=n*f-a*s,_=i*f-a*u,M=l*p-c*v,C=l*g-h*v,S=l*y-d*v,A=c*g-h*p,T=c*y-d*p,I=h*y-d*g,D=m*I-b*T+x*A+E*S-w*C+_*M;return D?(D=1/D,r[0]=(s*I-u*T+f*A)*D,r[1]=(i*T-n*I-a*A)*D,r[2]=(p*_-g*w+y*E)*D,r[3]=(h*w-c*_-d*E)*D,r[4]=(u*S-o*I-f*C)*D,r[5]=(e*I-i*S+a*C)*D,r[6]=(g*x-v*_-y*b)*D,r[7]=(l*_-h*x+d*b)*D,r[8]=(o*T-s*S+f*M)*D,r[9]=(n*S-e*T-a*M)*D,r[10]=(v*w-p*x+y*m)*D,r[11]=(c*x-l*w-d*m)*D,r[12]=(s*C-o*A-u*M)*D,r[13]=(e*A-n*C+i*M)*D,r[14]=(p*b-v*E-g*m)*D,r[15]=(l*E-c*b+h*m)*D,r):null}function cF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],f=t[7],l=t[8],c=t[9],h=t[10],d=t[11],v=t[12],p=t[13],g=t[14],y=t[15];return r[0]=s*(h*y-d*g)-c*(u*y-f*g)+p*(u*d-f*h),r[1]=-(n*(h*y-d*g)-c*(i*y-a*g)+p*(i*d-a*h)),r[2]=n*(u*y-f*g)-s*(i*y-a*g)+p*(i*f-a*u),r[3]=-(n*(u*d-f*h)-s*(i*d-a*h)+c*(i*f-a*u)),r[4]=-(o*(h*y-d*g)-l*(u*y-f*g)+v*(u*d-f*h)),r[5]=e*(h*y-d*g)-l*(i*y-a*g)+v*(i*d-a*h),r[6]=-(e*(u*y-f*g)-o*(i*y-a*g)+v*(i*f-a*u)),r[7]=e*(u*d-f*h)-o*(i*d-a*h)+l*(i*f-a*u),r[8]=o*(c*y-d*p)-l*(s*y-f*p)+v*(s*d-f*c),r[9]=-(e*(c*y-d*p)-l*(n*y-a*p)+v*(n*d-a*c)),r[10]=e*(s*y-f*p)-o*(n*y-a*p)+v*(n*f-a*s),r[11]=-(e*(s*d-f*c)-o*(n*d-a*c)+l*(n*f-a*s)),r[12]=-(o*(c*g-h*p)-l*(s*g-u*p)+v*(s*h-u*c)),r[13]=e*(c*g-h*p)-l*(n*g-i*p)+v*(n*h-i*c),r[14]=-(e*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=e*(s*h-u*c)-o*(n*h-i*c)+l*(n*u-i*s),r}function hF(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],f=r[8],l=r[9],c=r[10],h=r[11],d=r[12],v=r[13],p=r[14],g=r[15],y=t*o-e*a,m=t*s-n*a,b=t*u-i*a,x=e*s-n*o,E=e*u-i*o,w=n*u-i*s,_=f*v-l*d,M=f*p-c*d,C=f*g-h*d,S=l*p-c*v,A=l*g-h*v,T=c*g-h*p;return y*T-m*A+b*S+x*C-E*M+w*_}function jC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=t[8],h=t[9],d=t[10],v=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=e[0],x=e[1],E=e[2],w=e[3];return r[0]=b*n+x*s+E*c+w*p,r[1]=b*i+x*u+E*h+w*g,r[2]=b*a+x*f+E*d+w*y,r[3]=b*o+x*l+E*v+w*m,b=e[4],x=e[5],E=e[6],w=e[7],r[4]=b*n+x*s+E*c+w*p,r[5]=b*i+x*u+E*h+w*g,r[6]=b*a+x*f+E*d+w*y,r[7]=b*o+x*l+E*v+w*m,b=e[8],x=e[9],E=e[10],w=e[11],r[8]=b*n+x*s+E*c+w*p,r[9]=b*i+x*u+E*h+w*g,r[10]=b*a+x*f+E*d+w*y,r[11]=b*o+x*l+E*v+w*m,b=e[12],x=e[13],E=e[14],w=e[15],r[12]=b*n+x*s+E*c+w*p,r[13]=b*i+x*u+E*h+w*g,r[14]=b*a+x*f+E*d+w*y,r[15]=b*o+x*l+E*v+w*m,r}function dF(r,t,e){var n=e[0],i=e[1],a=e[2],o,s,u,f,l,c,h,d,v,p,g,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],f=t[3],l=t[4],c=t[5],h=t[6],d=t[7],v=t[8],p=t[9],g=t[10],y=t[11],r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=l,r[5]=c,r[6]=h,r[7]=d,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+l*i+v*a+t[12],r[13]=s*n+c*i+p*a+t[13],r[14]=u*n+h*i+g*a+t[14],r[15]=f*n+d*i+y*a+t[15]),r}function vF(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function pF(r,t,e,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,f,l,c,h,d,v,p,g,y,m,b,x,E,w,_,M,C,S,A,T,I,D,N;return s<_t?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),f=Math.cos(e),l=1-f,c=t[0],h=t[1],d=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8],x=t[9],E=t[10],w=t[11],_=i*i*l+f,M=a*i*l+o*u,C=o*i*l-a*u,S=i*a*l-o*u,A=a*a*l+f,T=o*a*l+i*u,I=i*o*l+a*u,D=a*o*l-i*u,N=o*o*l+f,r[0]=c*_+p*M+b*C,r[1]=h*_+g*M+x*C,r[2]=d*_+y*M+E*C,r[3]=v*_+m*M+w*C,r[4]=c*S+p*A+b*T,r[5]=h*S+g*A+x*T,r[6]=d*S+y*A+E*T,r[7]=v*S+m*A+w*T,r[8]=c*I+p*D+b*N,r[9]=h*I+g*D+x*N,r[10]=d*I+y*D+E*N,r[11]=v*I+m*D+w*N,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function gF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],o=t[5],s=t[6],u=t[7],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+f*n,r[5]=o*i+l*n,r[6]=s*i+c*n,r[7]=u*i+h*n,r[8]=f*i-a*n,r[9]=l*i-o*n,r[10]=c*i-s*n,r[11]=h*i-u*n,r}function yF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],f=t[8],l=t[9],c=t[10],h=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-f*n,r[1]=o*i-l*n,r[2]=s*i-c*n,r[3]=u*i-h*n,r[8]=a*n+f*i,r[9]=o*n+l*i,r[10]=s*n+c*i,r[11]=u*n+h*i,r}function mF(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],f=t[4],l=t[5],c=t[6],h=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+f*n,r[1]=o*i+l*n,r[2]=s*i+c*n,r[3]=u*i+h*n,r[4]=f*i-a*n,r[5]=l*i-o*n,r[6]=c*i-s*n,r[7]=h*i-u*n,r}function bF(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function xF(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function EF(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,f;return o<_t?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(t),u=Math.cos(t),f=1-u,r[0]=n*n*f+u,r[1]=i*n*f+a*s,r[2]=a*n*f-i*s,r[3]=0,r[4]=n*i*f-a*s,r[5]=i*i*f+u,r[6]=a*i*f+n*s,r[7]=0,r[8]=n*a*f+i*s,r[9]=i*a*f-n*s,r[10]=a*a*f+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function wF(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function _F(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function SF(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function UC(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,f=a+a,l=n*s,c=n*u,h=n*f,d=i*u,v=i*f,p=a*f,g=o*s,y=o*u,m=o*f;return r[0]=1-(d+p),r[1]=c+m,r[2]=h-y,r[3]=0,r[4]=c-m,r[5]=1-(l+p),r[6]=v+g,r[7]=0,r[8]=h+y,r[9]=v-g,r[10]=1-(l+d),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function MF(r,t){var e=new Qt(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=n*n+i*i+a*a+o*o;return c>0?(e[0]=(s*o+l*n+u*a-f*i)*2/c,e[1]=(u*o+l*i+f*n-s*a)*2/c,e[2]=(f*o+l*a+s*i-u*n)*2/c):(e[0]=(s*o+l*n+u*a-f*i)*2,e[1]=(u*o+l*i+f*n-s*a)*2,e[2]=(f*o+l*a+s*i-u*n)*2),UC(r,t,e),r}function $C(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function WC(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],f=t[9],l=t[10];return r[0]=Math.hypot(e,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,f,l),r}function XC(r,t){var e=new Qt(3);WC(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,f=t[4]*n,l=t[5]*i,c=t[6]*a,h=t[8]*n,d=t[9]*i,v=t[10]*a,p=o+l+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-d)/g,r[1]=(h-u)/g,r[2]=(s-f)/g):o>l&&o>v?(g=Math.sqrt(1+o-l-v)*2,r[3]=(c-d)/g,r[0]=.25*g,r[1]=(s+f)/g,r[2]=(h+u)/g):l>v?(g=Math.sqrt(1+l-o-v)*2,r[3]=(h-u)/g,r[0]=(s+f)/g,r[1]=.25*g,r[2]=(c+d)/g):(g=Math.sqrt(1+v-o-l)*2,r[3]=(s-f)/g,r[0]=(h+u)/g,r[1]=(c+d)/g,r[2]=.25*g),r}function CF(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,f=a+a,l=o+o,c=i*u,h=i*f,d=i*l,v=a*f,p=a*l,g=o*l,y=s*u,m=s*f,b=s*l,x=n[0],E=n[1],w=n[2];return r[0]=(1-(v+g))*x,r[1]=(h+b)*x,r[2]=(d-m)*x,r[3]=0,r[4]=(h-b)*E,r[5]=(1-(c+g))*E,r[6]=(p+y)*E,r[7]=0,r[8]=(d+m)*w,r[9]=(p-y)*w,r[10]=(1-(c+v))*w,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function AF(r,t,e,n,i){var a=t[0],o=t[1],s=t[2],u=t[3],f=a+a,l=o+o,c=s+s,h=a*f,d=a*l,v=a*c,p=o*l,g=o*c,y=s*c,m=u*f,b=u*l,x=u*c,E=n[0],w=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*E,T=(d+x)*E,I=(v-b)*E,D=(d-x)*w,N=(1-(h+y))*w,P=(g+m)*w,G=(v+b)*_,W=(g-m)*_,k=(1-(h+p))*_;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=D,r[5]=N,r[6]=P,r[7]=0,r[8]=G,r[9]=W,r[10]=k,r[11]=0,r[12]=e[0]+M-(A*M+D*C+G*S),r[13]=e[1]+C-(T*M+N*C+W*S),r[14]=e[2]+S-(I*M+P*C+k*S),r[15]=1,r}function TF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,f=e*o,l=n*o,c=n*s,h=i*o,d=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=l+y,r[2]=h-g,r[3]=0,r[4]=l-y,r[5]=1-f-v,r[6]=d+p,r[7]=0,r[8]=h+g,r[9]=d-p,r[10]=1-f-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function IF(r,t,e,n,i,a,o){var s=1/(e-t),u=1/(i-n),f=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(e+t)*s,r[9]=(i+n)*u,r[10]=(o+a)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*f,r[15]=0,r}function YC(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var OF=YC;function LF(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function DF(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),f=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=f,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*f*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function VC(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*f,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=(o+a)*f,r[15]=1,r}var kF=VC;function PF(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),f=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=f,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=a*f,r[15]=1,r}function NF(r,t,e,n){var i,a,o,s,u,f,l,c,h,d,v=t[0],p=t[1],g=t[2],y=n[0],m=n[1],b=n[2],x=e[0],E=e[1],w=e[2];return Math.abs(v-x)<_t&&Math.abs(p-E)<_t&&Math.abs(g-w)<_t?zC(r):(l=v-x,c=p-E,h=g-w,d=1/Math.hypot(l,c,h),l*=d,c*=d,h*=d,i=m*h-b*c,a=b*l-y*h,o=y*c-m*l,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-h*a,u=h*i-l*o,f=l*a-c*i,d=Math.hypot(s,u,f),d?(d=1/d,s*=d,u*=d,f*=d):(s=0,u=0,f=0),r[0]=i,r[1]=s,r[2]=l,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+f*g),r[14]=-(l*v+c*p+h*g),r[15]=1,r)}function RF(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],f=n[2],l=i-e[0],c=a-e[1],h=o-e[2],d=l*l+c*c+h*h;d>0&&(d=1/Math.sqrt(d),l*=d,c*=d,h*=d);var v=u*h-f*c,p=f*l-s*h,g=s*c-u*l;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-h*p,r[5]=h*v-l*g,r[6]=l*p-c*v,r[7]=0,r[8]=l,r[9]=c,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function BF(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function FF(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function GF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function HC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function zF(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function jF(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function UF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function $F(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=r[9],h=r[10],d=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=t[0],b=t[1],x=t[2],E=t[3],w=t[4],_=t[5],M=t[6],C=t[7],S=t[8],A=t[9],T=t[10],I=t[11],D=t[12],N=t[13],P=t[14],G=t[15];return Math.abs(e-m)<=_t*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=_t*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=_t*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-E)<=_t*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-w)<=_t*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-_)<=_t*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=_t*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-C)<=_t*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(l-S)<=_t*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-A)<=_t*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(h-T)<=_t*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-I)<=_t*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-D)<=_t*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(p-N)<=_t*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(g-P)<=_t*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-G)<=_t*Math.max(1,Math.abs(y),Math.abs(G))}var WF=jC,XF=HC;const YF=Object.freeze(Object.defineProperty({__proto__:null,add:GF,adjoint:cF,clone:aF,copy:oF,create:iF,determinant:hF,equals:$F,exactEquals:UF,frob:FF,fromQuat:TF,fromQuat2:MF,fromRotation:EF,fromRotationTranslation:UC,fromRotationTranslationScale:CF,fromRotationTranslationScaleOrigin:AF,fromScaling:xF,fromTranslation:bF,fromValues:sF,fromXRotation:wF,fromYRotation:_F,fromZRotation:SF,frustum:IF,getRotation:XC,getScaling:WC,getTranslation:$C,identity:zC,invert:lF,lookAt:NF,mul:WF,multiply:jC,multiplyScalar:zF,multiplyScalarAndAdd:jF,ortho:kF,orthoNO:VC,orthoZO:PF,perspective:OF,perspectiveFromFieldOfView:DF,perspectiveNO:YC,perspectiveZO:LF,rotate:pF,rotateX:gF,rotateY:yF,rotateZ:mF,scale:vF,set:uF,str:BF,sub:XF,subtract:HC,targetTo:RF,translate:dF,transpose:fF},Symbol.toStringTag,{value:"Module"}));function bm(){var r=new Qt(3);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function VF(r){var t=new Qt(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function KC(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function C0(r,t,e){var n=new Qt(3);return n[0]=r,n[1]=t,n[2]=e,n}function HF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function KF(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function qF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function qC(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function ZC(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function QC(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function ZF(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function QF(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function JF(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function e4(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function t4(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function r4(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function n4(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function JC(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.hypot(e,n,i)}function eA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function tA(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function i4(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function a4(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function rA(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function xm(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Gh(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function o4(r,t,e,n){var i=t[0],a=t[1],o=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r}function s4(r,t,e,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,f=o*(a-1),l=o*(3-2*a);return r[0]=t[0]*s+e[0]*u+n[0]*f+i[0]*l,r[1]=t[1]*s+e[1]*u+n[1]*f+i[1]*l,r[2]=t[2]*s+e[2]*u+n[2]*f+i[2]*l,r}function u4(r,t,e,n,i,a){var o=1-a,s=o*o,u=a*a,f=s*o,l=3*a*s,c=3*u*o,h=u*a;return r[0]=t[0]*f+e[0]*l+n[0]*c+i[0]*h,r[1]=t[1]*f+e[1]*l+n[1]*c+i[1]*h,r[2]=t[2]*f+e[2]*l+n[2]*c+i[2]*h,r}function f4(r,t){t=t||1;var e=Di()*2*Math.PI,n=Di()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function l4(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[3]*n+e[7]*i+e[11]*a+e[15];return o=o||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/o,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/o,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/o,r}function fv(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function c4(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=i*f-a*u,c=a*s-n*f,h=n*u-i*s,d=i*h-a*c,v=a*l-n*h,p=n*c-i*l,g=o*2;return l*=g,c*=g,h*=g,d*=2,v*=2,p*=2,r[0]=s+l+d,r[1]=u+c+v,r[2]=f+h+p,r}function h4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function d4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function v4(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function p4(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt(e*e+n*n+i*i),f=Math.sqrt(a*a+o*o+s*s),l=u*f,c=l&&xm(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function g4(r){return r[0]=0,r[1]=0,r[2]=0,r}function y4(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function m4(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function b4(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2];return Math.abs(e-a)<=_t*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=_t*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=_t*Math.max(1,Math.abs(i),Math.abs(s))}var x4=qC,E4=ZC,w4=QC,_4=JC,S4=eA,nA=KC,M4=tA,C4=function(){var r=bm();return function(t,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2];return t}}();const A4=Object.freeze(Object.defineProperty({__proto__:null,add:qF,angle:p4,bezier:u4,ceil:ZF,clone:VF,copy:HF,create:bm,cross:Gh,dist:_4,distance:JC,div:w4,divide:QC,dot:xm,equals:b4,exactEquals:m4,floor:QF,forEach:C4,fromValues:C0,hermite:s4,inverse:a4,len:nA,length:KC,lerp:o4,max:e4,min:JF,mul:E4,multiply:ZC,negate:i4,normalize:rA,random:f4,rotateX:h4,rotateY:d4,rotateZ:v4,round:t4,scale:r4,scaleAndAdd:n4,set:KF,sqrDist:S4,sqrLen:M4,squaredDistance:eA,squaredLength:tA,str:y4,sub:x4,subtract:qC,transformMat3:fv,transformMat4:l4,transformQuat:c4,zero:g4},Symbol.toStringTag,{value:"Module"}));function iA(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function aA(r){var t=new Qt(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function oA(r,t,e,n){var i=new Qt(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function sA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function uA(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function fA(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function lA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function cA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function hA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function T4(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function I4(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function O4(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function L4(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function D4(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r}function dA(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function k4(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function vA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.hypot(e,n,i,a)}function pA(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function Em(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function wm(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function P4(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function N4(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function gA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function yA(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function R4(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],o=e[0]*n[3]-e[3]*n[0],s=e[1]*n[2]-e[2]*n[1],u=e[1]*n[3]-e[3]*n[1],f=e[2]*n[3]-e[3]*n[2],l=t[0],c=t[1],h=t[2],d=t[3];return r[0]=c*f-h*u+d*s,r[1]=-(l*f)+h*o-d*a,r[2]=l*u-c*o+d*i,r[3]=-(l*s)+c*a-h*i,r}function mA(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r[3]=s+n*(e[3]-s),r}function B4(r,t){t=t||1;var e,n,i,a,o,s;do e=Di()*2-1,n=Di()*2-1,o=e*e+n*n;while(o>=1);do i=Di()*2-1,a=Di()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=t*e,r[1]=t*n,r[2]=t*i*u,r[3]=t*a*u,r}function F4(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,r}function G4(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2],f=e[3],l=f*n+s*a-u*i,c=f*i+u*n-o*a,h=f*a+o*i-s*n,d=-o*n-s*i-u*a;return r[0]=l*f+d*-o+c*-u-h*-s,r[1]=c*f+d*-s+h*-o-l*-u,r[2]=h*f+d*-u+l*-s-c*-o,r[3]=t[3],r}function z4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function j4(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function bA(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function xA(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],f=t[3];return Math.abs(e-o)<=_t*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=_t*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=_t*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-f)<=_t*Math.max(1,Math.abs(a),Math.abs(f))}var U4=lA,$4=cA,W4=hA,X4=vA,Y4=pA,V4=Em,H4=wm,K4=function(){var r=iA();return function(t,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r[3]=t[s+3],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2],t[s+3]=r[3];return t}}();const q4=Object.freeze(Object.defineProperty({__proto__:null,add:fA,ceil:T4,clone:aA,copy:sA,create:iA,cross:R4,dist:X4,distance:vA,div:W4,divide:hA,dot:yA,equals:xA,exactEquals:bA,floor:I4,forEach:K4,fromValues:oA,inverse:N4,len:V4,length:Em,lerp:mA,max:L4,min:O4,mul:$4,multiply:cA,negate:P4,normalize:gA,random:B4,round:D4,scale:dA,scaleAndAdd:k4,set:uA,sqrDist:Y4,sqrLen:H4,squaredDistance:pA,squaredLength:wm,str:j4,sub:U4,subtract:lA,transformMat4:F4,transformQuat:G4,zero:z4},Symbol.toStringTag,{value:"Module"}));function vd(){var r=new Qt(4);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Z4(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function EA(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function Q4(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>_t?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function J4(r,t){var e=Sm(r,t);return Math.acos(2*e*e-1)}function wA(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,r}function _A(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function SA(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function MA(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function e6(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function CA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=e*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function AA(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function t6(r,t,e){return AA(r,t),IA(r,r,e),CA(r,r),r}function zh(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=e[0],f=e[1],l=e[2],c=e[3],h,d,v,p,g;return d=i*u+a*f+o*l+s*c,d<0&&(d=-d,u=-u,f=-f,l=-l,c=-c),1-d>_t?(h=Math.acos(d),v=Math.sin(h),p=Math.sin((1-n)*h)/v,g=Math.sin(n*h)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*f,r[2]=p*o+g*l,r[3]=p*s+g*c,r}function r6(r){var t=Di(),e=Di(),n=Di(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function n6(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-e*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function i6(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function TA(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+o]-t[o*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[o]=(t[o*3+i]+t[i*3+o])*n}return r}function a6(r,t,e,n){var i=.5*Math.PI/180;t*=i,e*=i,n*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),f=Math.sin(n),l=Math.cos(n);return r[0]=a*u*l-o*s*f,r[1]=o*s*l+a*u*f,r[2]=o*u*f-a*s*l,r[3]=o*u*l+a*s*f,r}function o6(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var s6=aA,u6=oA,_m=sA,f6=uA,l6=fA,c6=wA,IA=dA,Sm=yA,h6=mA,Mm=Em,d6=Mm,Cm=wm,v6=Cm,Am=gA,p6=bA,g6=xA,y6=function(){var r=bm(),t=C0(1,0,0),e=C0(0,1,0);return function(n,i,a){var o=xm(i,a);return o<-.999999?(Gh(r,t,i),nA(r)<1e-6&&Gh(r,e,i),rA(r,r),EA(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Gh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,Am(n,n))}}(),m6=function(){var r=vd(),t=vd();return function(e,n,i,a,o,s){return zh(r,n,o,s),zh(t,i,a,s),zh(e,r,t,2*s*(1-s)),e}}(),b6=function(){var r=BC();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],Am(t,TA(t,r))}}();const x6=Object.freeze(Object.defineProperty({__proto__:null,add:l6,calculateW:e6,clone:s6,conjugate:i6,copy:_m,create:vd,dot:Sm,equals:g6,exactEquals:p6,exp:CA,fromEuler:a6,fromMat3:TA,fromValues:u6,getAngle:J4,getAxisAngle:Q4,identity:Z4,invert:n6,len:d6,length:Mm,lerp:h6,ln:AA,mul:c6,multiply:wA,normalize:Am,pow:t6,random:r6,rotateX:_A,rotateY:SA,rotateZ:MA,rotationTo:y6,scale:IA,set:f6,setAxes:b6,setAxisAngle:EA,slerp:zh,sqlerp:m6,sqrLen:v6,squaredLength:Cm,str:o6},Symbol.toStringTag,{value:"Module"}));function E6(){var r=new Qt(8);return Qt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function w6(r){var t=new Qt(8);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t}function _6(r,t,e,n,i,a,o,s){var u=new Qt(8);return u[0]=r,u[1]=t,u[2]=e,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function S6(r,t,e,n,i,a,o){var s=new Qt(8);s[0]=r,s[1]=t,s[2]=e,s[3]=n;var u=i*.5,f=a*.5,l=o*.5;return s[4]=u*n+f*e-l*t,s[5]=f*n+l*r-u*e,s[6]=l*n+u*t-f*r,s[7]=-u*r-f*t-l*e,s}function OA(r,t,e){var n=e[0]*.5,i=e[1]*.5,a=e[2]*.5,o=t[0],s=t[1],u=t[2],f=t[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=f,r[4]=n*f+i*u-a*s,r[5]=i*f+a*o-n*u,r[6]=a*f+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function M6(r,t){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0]*.5,r[5]=t[1]*.5,r[6]=t[2]*.5,r[7]=0,r}function C6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function A6(r,t){var e=vd();XC(e,t);var n=new Qt(3);return $C(n,t),OA(r,e,n),r}function LA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r}function T6(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function I6(r,t,e,n,i,a,o,s,u){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var O6=_m;function L6(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var D6=_m;function k6(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function P6(r,t){var e=t[4],n=t[5],i=t[6],a=t[7],o=-t[0],s=-t[1],u=-t[2],f=t[3];return r[0]=(e*f+a*o+n*u-i*s)*2,r[1]=(n*f+a*s+i*o-e*u)*2,r[2]=(i*f+a*u+e*s-n*o)*2,r}function N6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0]*.5,u=e[1]*.5,f=e[2]*.5,l=t[4],c=t[5],h=t[6],d=t[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*f-a*u+l,r[5]=o*u+a*s-n*f+c,r[6]=o*f+n*u-i*s+h,r[7]=-n*s-i*u-a*f+d,r}function R6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return _A(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function B6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return SA(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function F6(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],f=t[6],l=t[7],c=s*o+l*n+u*a-f*i,h=u*o+l*i+f*n-s*a,d=f*o+l*a+s*i-u*n,v=l*o-s*n-u*i-f*a;return MA(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+h*a-d*i,r[5]=h*o+v*i+d*n-c*a,r[6]=d*o+v*a+c*i-h*n,r[7]=v*o-c*n-h*i-d*a,r}function G6(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],f=t[2],l=t[3];return r[0]=s*o+l*n+u*a-f*i,r[1]=u*o+l*i+f*n-s*a,r[2]=f*o+l*a+s*i-u*n,r[3]=l*o-s*n-u*i-f*a,s=t[4],u=t[5],f=t[6],l=t[7],r[4]=s*o+l*n+u*a-f*i,r[5]=u*o+l*i+f*n-s*a,r[6]=f*o+l*a+s*i-u*n,r[7]=l*o-s*n-u*i-f*a,r}function z6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],f=e[2],l=e[3];return r[0]=n*l+o*s+i*f-a*u,r[1]=i*l+o*u+a*s-n*f,r[2]=a*l+o*f+n*u-i*s,r[3]=o*l-n*s-i*u-a*f,s=e[4],u=e[5],f=e[6],l=e[7],r[4]=n*l+o*s+i*f-a*u,r[5]=i*l+o*u+a*s-n*f,r[6]=a*l+o*f+n*u-i*s,r[7]=o*l-n*s-i*u-a*f,r}function j6(r,t,e,n){if(Math.abs(n)<_t)return LA(r,t);var i=Math.hypot(e[0],e[1],e[2]);n=n*.5;var a=Math.sin(n),o=a*e[0]/i,s=a*e[1]/i,u=a*e[2]/i,f=Math.cos(n),l=t[0],c=t[1],h=t[2],d=t[3];r[0]=l*f+d*o+c*u-h*s,r[1]=c*f+d*s+h*o-l*u,r[2]=h*f+d*u+l*s-c*o,r[3]=d*f-l*o-c*s-h*u;var v=t[4],p=t[5],g=t[6],y=t[7];return r[4]=v*f+y*o+p*u-g*s,r[5]=p*f+y*s+g*o-v*u,r[6]=g*f+y*u+v*s-p*o,r[7]=y*f-v*o-p*s-g*u,r}function U6(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r}function DA(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[4],u=e[5],f=e[6],l=e[7],c=t[4],h=t[5],d=t[6],v=t[7],p=e[0],g=e[1],y=e[2],m=e[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*l+o*s+i*f-a*u+c*m+v*p+h*y-d*g,r[5]=i*l+o*u+a*s-n*f+h*m+v*g+d*p-c*y,r[6]=a*l+o*f+n*u-i*s+d*m+v*y+c*g-h*p,r[7]=o*l-n*s-i*u-a*f+v*m-c*p-h*g-d*y,r}var $6=DA;function W6(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r}var kA=Sm;function X6(r,t,e,n){var i=1-n;return kA(t,e)<0&&(n=-n),r[0]=t[0]*i+e[0]*n,r[1]=t[1]*i+e[1]*n,r[2]=t[2]*i+e[2]*n,r[3]=t[3]*i+e[3]*n,r[4]=t[4]*i+e[4]*n,r[5]=t[5]*i+e[5]*n,r[6]=t[6]*i+e[6]*n,r[7]=t[7]*i+e[7]*n,r}function Y6(r,t){var e=lv(t);return r[0]=-t[0]/e,r[1]=-t[1]/e,r[2]=-t[2]/e,r[3]=t[3]/e,r[4]=-t[4]/e,r[5]=-t[5]/e,r[6]=-t[6]/e,r[7]=t[7]/e,r}function V6(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=t[7],r}var PA=Mm,H6=PA,lv=Cm,K6=lv;function q6(r,t){var e=lv(t);if(e>0){e=Math.sqrt(e);var n=t[0]/e,i=t[1]/e,a=t[2]/e,o=t[3]/e,s=t[4],u=t[5],f=t[6],l=t[7],c=n*s+i*u+a*f+o*l;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/e,r[5]=(u-i*c)/e,r[6]=(f-a*c)/e,r[7]=(l-o*c)/e}return r}function Z6(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function Q6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]}function J6(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=t[0],c=t[1],h=t[2],d=t[3],v=t[4],p=t[5],g=t[6],y=t[7];return Math.abs(e-l)<=_t*Math.max(1,Math.abs(e),Math.abs(l))&&Math.abs(n-c)<=_t*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=_t*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-d)<=_t*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=_t*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=_t*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=_t*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(f-y)<=_t*Math.max(1,Math.abs(f),Math.abs(y))}const eG=Object.freeze(Object.defineProperty({__proto__:null,add:U6,clone:w6,conjugate:V6,copy:LA,create:E6,dot:kA,equals:J6,exactEquals:Q6,fromMat4:A6,fromRotation:C6,fromRotationTranslation:OA,fromRotationTranslationValues:S6,fromTranslation:M6,fromValues:_6,getDual:L6,getReal:O6,getTranslation:P6,identity:T6,invert:Y6,len:H6,length:PA,lerp:X6,mul:$6,multiply:DA,normalize:q6,rotateAroundAxis:j6,rotateByQuatAppend:G6,rotateByQuatPrepend:z6,rotateX:R6,rotateY:B6,rotateZ:F6,scale:W6,set:I6,setDual:k6,setReal:D6,sqrLen:K6,squaredLength:lv,str:Z6,translate:N6},Symbol.toStringTag,{value:"Module"}));function NA(){var r=new Qt(2);return Qt!=Float32Array&&(r[0]=0,r[1]=0),r}function tG(r){var t=new Qt(2);return t[0]=r[0],t[1]=r[1],t}function rG(r,t){var e=new Qt(2);return e[0]=r,e[1]=t,e}function nG(r,t){return r[0]=t[0],r[1]=t[1],r}function iG(r,t,e){return r[0]=t,r[1]=e,r}function gn(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function RA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function BA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function FA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function aG(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function oG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function go(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function yo(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function sG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function An(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function uG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function pd(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.hypot(e,n)}function GA(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function zA(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function jA(r){var t=r[0],e=r[1];return t*t+e*e}function fG(r,t){return r[0]=-t[0],r[1]=-t[1],r}function lG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function To(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function Tm(r,t){return r[0]*t[0]+r[1]*t[1]}function cG(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function hG(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function dG(r,t){t=t||1;var e=Di()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function vG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function pG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function gG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function yG(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function mG(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+e[0],r[1]=i*o+a*s+e[1],r}function UA(r,t){var e=r[0],n=r[1],i=t[0],a=t[1],o=Math.sqrt(e*e+n*n)*Math.sqrt(i*i+a*a),s=o&&(e*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function bG(r){return r[0]=0,r[1]=0,r}function xG(r){return"vec2("+r[0]+", "+r[1]+")"}function Im(r,t){return r[0]===t[0]&&r[1]===t[1]}function EG(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=_t*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=_t*Math.max(1,Math.abs(n),Math.abs(a))}var wG=zA,jh=RA,_G=BA,SG=FA,MG=pd,CG=GA,AG=jA,TG=function(){var r=NA();return function(t,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],a(r,r,o),t[s]=r[0],t[s+1]=r[1];return t}}();const IG=Object.freeze(Object.defineProperty({__proto__:null,add:gn,angle:UA,ceil:aG,clone:tG,copy:nG,create:NA,cross:cG,dist:MG,distance:pd,div:SG,divide:FA,dot:Tm,equals:EG,exactEquals:Im,floor:oG,forEach:TG,fromValues:rG,inverse:lG,len:wG,length:zA,lerp:hG,max:yo,min:go,mul:_G,multiply:BA,negate:fG,normalize:To,random:dG,rotate:mG,round:sG,scale:An,scaleAndAdd:uG,set:iG,sqrDist:CG,sqrLen:AG,squaredDistance:GA,squaredLength:jA,str:xG,sub:jh,subtract:RA,transformMat2:vG,transformMat2d:pG,transformMat3:gG,transformMat4:yG,zero:bG},Symbol.toStringTag,{value:"Module"})),OG=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:B5,mat2:uB,mat2d:DB,mat3:GC,mat4:YF,quat:x6,quat2:eG,vec2:IG,vec3:A4,vec4:q4},Symbol.toStringTag,{value:"Module"}));function LG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return gm(n,e),xa(r,n,t)}function DG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return ym(n,e),xa(r,n,t)}function kG(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return mm(n,e),xa(r,n,t)}function PG(r,t,e){return xa(r,e,t)}function xi(r,t){for(var e=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=t.length;n<i;n++){var a=t[n];switch(a[0]){case"t":LG(e,e,[a[1],a[2]]);break;case"s":kG(e,e,[a[1],a[2]]);break;case"r":DG(e,e,a[1]);break;case"m":PG(e,e,a[1]);break}}return e}var Ms=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];!l&&l!==0||!c&&c!==0||(a[l][c]=1,e||(a[c][l]=1))}),a},NG=function(t,e){return t===e},wE=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),$A=function(){function r(t){t===void 0&&(t=NG),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new wE(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new wE(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.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},r.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},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.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},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),RG=function(){function r(){this.linkedList=new $A}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),Jn=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(u){return u.source===t||u.target===t});if(n==="target"){var a=function(f){return f.source===t};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(f){return f.target===t};return i.filter(o).map(function(u){return u.source})}var s=function(f){return f.source===t?f.target:f.source};return i.map(s)},BG=function(t,e){return e.filter(function(n){return n.source===t})},Uh=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},WA=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function FG(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var XA=function(t,e,n,i){i===void 0&&(i=!0);var a=FG(n),o=new RG,s=t.edges,u=s===void 0?[]:s;o.enqueue(e);for(var f="",l=function(){var h=o.dequeue();a.enter({current:h,previous:f}),Jn(h,u,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:f,current:h,next:d})&&o.enqueue(d)}),a.leave({current:h,previous:f}),f=h};!o.isEmpty();)l()},GG=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u=[],f=function d(v){u.push(v),s[v.id]=!0;for(var p=Jn(v.id,a),g=function(b){var x=p[b];if(!s[x]){var E=n.filter(function(w){return w.id===x});E.length>0&&d(E[0])}},y=0;y<p.length;++y)g(y)},l=0;l<n.length;l++){var c=n[l];if(!s[c.id]){f(c);for(var h=[];u.length>0;)h.push(u.pop());o.push(h)}}return o},YA=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u={},f={},l=[],c=0,h=function g(y){u[y.id]=c,f[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Jn(y.id,a,"target").filter(function(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),f[y.id]=Math.min(f[y.id],f[C])}else s[C]&&(f[y.id]=Math.min(f[y.id],u[C]))},x=0;x<m.length;x++)b(x);if(f[y.id]===u[y.id]){for(var E=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,E.push(w),w===y)break}E.length>0&&l.push(E)}},d=0,v=n;d<v.length;d++){var p=v[d];!u[p.id]&&u[p.id]!==0&&h(p)}return l};function Om(r,t){return t?YA(r):GG(r)}var Ka=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,o=a===void 0?[]:a;return i.forEach(function(s){e[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){e[s.source].degree++,e[s.source].outDegree++,e[s.target].degree++,e[s.target].inDegree++}),e},VA=function(t,e){var n=Ka(t);return n[e]?Ka(t)[e].inDegree:0},HA=function(t,e){var n=Ka(t);return n[e]?Ka(t)[e].outDegree:0};function zG(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function KA(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,o=a===void 0?[]:a;Jn(t,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:e,current:t,next:s})&&KA(r,s,t,n,i)}),n.leave({current:t,previous:e})}function Lm(r,t,e,n){n===void 0&&(n=!0),KA(r,t,"",zG(e),n)}var Dm=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var f={enter:function(h){var d=h.current,v=h.previous;if(s[d]){e={};for(var p=d,g=v;g!==d;)e[p]=g,p=g,g=a[g];e[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(h){var d=h.current;u[d]=d,delete s[d]},allowTraversal:function(h){var d=h.next;return e?!1:!u[d]}};Object.keys(o).length;){var l=Object.keys(o)[0];Lm(t,l,f)}return e},km=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=Om(t,!1),u=0,f=s;u<f.length;u++){var l=f[u];if(l.length)for(var c=l[0],h=c.id,d=[c],v=(i={},i[h]=c,i),p=(a={},a[h]=new Set,a);d.length>0;)for(var g=d.pop(),y=g.id,m=Jn(y,t.edges),b=function(w){var _,M=m[w],C=t.nodes.find(function(N){return N.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,d.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),e&&n?(S=!1,A.findIndex(function(N){return e.indexOf(N.id)>-1})>-1&&(S=!0)):e&&!n&&A.findIndex(function(N){return e.indexOf(N.id)>-1})>-1&&(S=!1),S){for(var I={},D=1;D<A.length;D+=1)I[A[D-1].id]=A[D];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},Pm=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},f={},l=function(T){for(var I=[T];I.length>0;){var D=I.pop();a.has(D)&&(a.delete(D),o[D.id].forEach(function(N){I.push(N)}),o[D.id].clear())}},c=function A(T,I,D){var N=!1;if(e&&n===!1&&e.indexOf(T.id)>-1)return N;i.push(T),a.add(T);for(var P=D[T.id],G=0;G<P.length;G+=1){var W=u[P[G]];if(W===I){for(var k={},R=1;R<i.length;R+=1)k[i[R-1].id]=i[R];i.length&&(k[i[i.length-1].id]=i[0]),s.push(k),N=!0}else a.has(W)||A(W,I,D)&&(N=!0)}if(N)l(T);else for(var G=0;G<P.length;G+=1){var W=u[P[G]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),N},h=t.nodes,d=h===void 0?[]:h,v=0;v<d.length;v+=1){var p=d[v],g=p.id;f[g]=v,u[v]=p}if(e&&n)for(var y=function(T){var I=e[T];f[d[T].id]=f[I],f[I]=0,u[0]=d.find(function(D){return D.id===I}),u[f[d[T].id]]=d[T]},v=0;v<e.length;v++)y(v);for(var m=function(T){for(var I,D,N=1/0,P=0;P<T.length;P+=1)for(var G=T[P],W=0;W<G.length;W++){var k=f[G[W].id];k<N&&(N=k,D=P)}for(var R=T[D],Y=[],P=0;P<R.length;P+=1){var J=R[P];Y[J.id]=[];for(var te=0,H=Jn(J.id,t.edges,"target").filter(function(Le){return R.map(function(qe){return qe.id}).indexOf(Le)>-1});te<H.length;te++){var pe=H[te];pe===J.id&&!(n===!1&&e.indexOf(J.id)>-1)?s.push((I={},I[J.id]=J,I)):Y[J.id].push(f[pe])}}return{component:R,adjList:Y,minIdx:N}},b=0;b<d.length;){var x=d.filter(function(A){return f[A.id]>=b}),E=YA({nodes:x,edges:t.edges}).filter(function(A){return A.length>1});if(E.length===0)break;var w=m(E),_=w.minIdx,M=w.adjList,C=w.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(e&&n&&e.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},qA=function(t,e,n,i){return i===void 0&&(i=!0),e?Pm(t,n,i):km(t,n,i)},jG=function(t,e,n){for(var i=1/0,a,o=0;o<e.length;o++){var s=e[o].id;!n[s]&&t[s]<=i&&(i=t[s],a=e[o])}return a},cl=function(t,e,n,i){var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,f={},l={},c={};o.forEach(function(m,b){var x=m.id;l[x]=1/0,x===e&&(l[x]=0)});for(var h=o.length,d=function(b){var x=jG(l,o,f),E=x.id;if(f[E]=!0,l[E]===1/0)return"continue";var w=[];n?w=BG(E,u):w=Uh(E,u),w.forEach(function(_){var M=_.target,C=_.source,S=M===E?C:M,A=i&&_[i]?_[i]:1;l[S]>l[x.id]+A?(l[S]=l[x.id]+A,c[S]=[x.id]):l[S]===l[x.id]+A&&c[S].push(x.id)})},v=0;v<h;v++)d();c[e]=[e];var p={};for(var g in l)l[g]!==1/0&&ZA(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:l,path:y,allPath:p}};function ZA(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,o=e[t];a<o.length;a++){var s=o[a],u=ZA(r,s,e,n);if(!u)return;for(var f=0,l=u;f<l.length;f++){var c=l[f];gt(c)?i.push(ri(ri([],c,!0),[t],!1)):i.push([c,t])}}return n[t]=i,n[t]}var QA=function(t,e,n,i,a){var o=cl(t,e,i,a),s=o.length,u=o.path,f=o.allPath;return{length:s[n],path:u[n],allPath:f[n]}},JA=function(t,e,n,i){var a;if(e===n)return[[e]];var o=t.edges,s=o===void 0?[]:o,u=[e],f=(a={},a[e]=!0,a),l=[],c=[],h=i?Jn(e,s,"target"):Jn(e,s);for(l.push(h);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var v=d.shift();v&&(u.push(v),f[v]=!0,h=i?Jn(v,s,"target"):Jn(v,s),l.push(h.filter(function(y){return!f[y]})))}else{var p=u.pop();f[p]=!1,l.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();f[p]=!1,l.pop()}}return c},hl=function(t,e){for(var n=Ms(t,e),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},eT=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,f={},l={};o.forEach(function(b,x){var E=WA();b.clusterId=E,f[E]={id:E,nodes:[b]},l[b.id]={node:b,idx:x}});var c=Ms(t,e),h={};c.forEach(function(b,x){var E=o[x].id;h[E]={},b.forEach(function(w,_){if(w){var M=o[_].id;h[E][M]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(E){var w={};Object.keys(h[E.id]).forEach(function(D){var N=h[E.id][D],P=l[D].node,G=P.clusterId;w[G]||(w[G]=0),w[G]+=N});var _=-1/0,M=[];if(Object.keys(w).forEach(function(D){_<w[D]?(_=w[D],M=[D]):_===w[D]&&M.push(D)}),!(M.length===1&&M[0]===E.clusterId)){var C=M.indexOf(E.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=f[E.clusterId],A=S.nodes.indexOf(E);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),I=f[M[T]];I.nodes.push(E),E.clusterId=I.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(f).forEach(function(b){var x=f[b];(!x.nodes||!x.nodes.length)&&delete f[b]});var g=[],y={};u.forEach(function(b){var x=b.source,E=b.target,w=b[n]||1,_=l[x].node.clusterId,M=l[E].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=w,y[C].count++;else{var S={source:_,target:M,weight:w,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(f).forEach(function(b){m.push(f[b])}),{clusters:m,clusterEdges:g}},gi=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=Vt(this.arr);e.sort(function(o,s){return o-s});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Nm=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},Li;(function(r){r.EuclideanDistance="euclideanDistance"})(Li||(Li={}));var UG=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(o){i=i.concat(Object.keys(o))}),i=fl(i));var a={};return i.forEach(function(o){var s=[];t.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=fl(s))}),a},Rm=function(t,e,n){var i=UG(t,e,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(f){return typeof f=="number"})});return t.forEach(function(u,f){var l=[];Object.keys(i).forEach(function(c){var h=u[c],d=i[c],v=d.findIndex(function(y){return h===y}),p=[];if(s)p.push(h);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);l=l.concat(p)}),a[f]=l}),a},_E=function(t,e,n,i){n===void 0&&(n=Li.EuclideanDistance);var a=0;switch(n){case Li.EuclideanDistance:a=new gi(t).euclideanDistance(new gi(e));break}return a},SE=function(t,e,n,i){for(var a=e.length,o=2*i,s=0,u=0;u<a;u++)for(var f=t[u].clusterId,l=0;l<a;l++){var c=t[l].clusterId;if(f===c){var h=e[u][l]||0,d=n[u]||0,v=n[l]||0;s+=h-d*v/o}}return s*=1/o,s},hg=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new gi([]),a=0;a<n;a++)i=i.add(new gi(e[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new gi(e[a]),f=u.squareEuclideanDistance(o);s+=f}var l=[];t.forEach(function(){l.push([])});for(var a=0;a<n;a++){var u=new gi(e[a]);t[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){l[a][c]=0;continue}var h=new gi(e[c]);l[a][c]=u.squareEuclideanDistance(h),t[a].clusterInertial+=l[a][c]}}for(var d=0,v=2*n*s,a=0;a<n;a++)for(var p=t[a].clusterId,c=0;c<n;c++){var g=t[c].clusterId;if(!(a===c||p!==g)){var y=t[a].clusterInertial*t[c].clusterInertial/Math.pow(v,2)-l[a][c]/v;d+=y}}return Number(d.toFixed(4))},Bm=function(t,e,n,i,a,o,s,u,f){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),f===void 0&&(f=1);var l=t.nodes,c=l===void 0?[]:l,h=t.edges,d=h===void 0?[]:h,v=[];if(a){c.forEach(function(k,R){k.properties=k.properties||{},k.originIndex=R});var p=[];c.every(function(k){return k.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(k){return k.nodeType}))),c.forEach(function(k){k.properties.nodeType=p.findIndex(function(R){return R===k.nodeType})}));var g=Nm(c,o);v=Rm(g,s,u)}var y=1,m={},b={};c.forEach(function(k,R){var Y=String(y++);k.clusterId=Y,m[Y]={id:Y,nodes:[k]},b[k.id]={node:k,idx:R}});var x=Ms(t,e),E=[],w={},_=0;x.forEach(function(k,R){var Y=0,J=c[R].id;w[J]={},k.forEach(function(te,H){if(te){Y+=te;var pe=c[H].id;w[J][pe]=te,_+=te}}),E.push(Y)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(k){return k.hasOwnProperty("properties")})?M=SE(c,x,E,_)+hg(c,v)*f:M=SE(c,x,E,_),S===0&&(C=M,A=c,T=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(k){return{node:k,clusterId:k.clusterId}}),T=Vt(m),C=M),I||S>100)break;S++,Object.keys(m).forEach(function(k){var R=0;d.forEach(function(Y){var J=Y.source,te=Y.target,H=b[J].node.clusterId,pe=b[te].node.clusterId;(H===k&&pe!==k||pe===k&&H!==k)&&(R=R+(Y[n]||1))}),m[k].sumTot=R}),c.forEach(function(k,R){var Y=m[k.clusterId],J=0,te,H=E[R]/(2*_),pe=0,Ae=Y.nodes;Ae.forEach(function(Ut){var dr=b[Ut.id].idx;pe+=x[R][dr]||0});var Le=pe-Y.sumTot*H,qe=Ae.filter(function(Ut){return Ut.id!==k.id});qe.forEach(function(Ut,dr){v[Ut.originIndex]});var at=hg(qe,v)*f,rt=w[k.id];if(Object.keys(rt).forEach(function(Ut){var dr=b[Ut].node,fr=dr.clusterId;if(fr!==k.clusterId){var Gt=m[fr],Jt=Gt.nodes;if(!(!Jt||!Jt.length)){var Rr=0;Jt.forEach(function(Be){var ye=b[Be.id].idx;Rr+=x[R][ye]||0});var tt=Rr-Gt.sumTot*H,ie=Jt.concat([k]);ie.forEach(function(Be,ye){v[Be.originIndex]});var L=hg(ie,v)*f,_e=tt-Le;a&&(_e=tt+L-(Le+at)),_e>J&&(J=_e,te=Gt)}}}),J>0){te.nodes.push(k);var xt=k.clusterId;k.clusterId=te.id;var Et=Y.nodes.indexOf(k);Y.nodes.splice(Et,1);var ur=0,Bt=0;d.forEach(function(Ut){var dr=Ut.source,fr=Ut.target,Gt=b[dr].node.clusterId,Jt=b[fr].node.clusterId;(Gt===te.id&&Jt!==te.id||Jt===te.id&&Gt!==te.id)&&(ur=ur+(Ut[n]||1)),(Gt===xt&&Jt!==xt||Jt===xt&&Gt!==xt)&&(Bt=Bt+(Ut[n]||1))}),te.sumTot=ur,Y.sumTot=Bt}})}var D={},N=0;Object.keys(T).forEach(function(k){var R=T[k];if(!R.nodes||!R.nodes.length){delete T[k];return}var Y=String(N+1);Y!==k&&(R.id=Y,R.nodes=R.nodes.map(function(J){return{id:J.id,clusterId:Y}}),T[Y]=R,D[k]=Y,delete T[k],N++)}),A.forEach(function(k){var R=k.node,Y=k.clusterId;R&&(R.clusterId=Y,R.clusterId&&D[R.clusterId]&&(R.clusterId=D[R.clusterId]))});var P=[],G={};d.forEach(function(k){var R=k.source,Y=k.target,J=k[n]||1,te=b[R].node.clusterId,H=b[Y].node.clusterId;if(!(!te||!H)){var pe="".concat(te,"---").concat(H);if(G[pe])G[pe].weight+=J,G[pe].count++;else{var Ae={source:te,target:H,weight:J,count:1};G[pe]=Ae,P.push(Ae)}}});var W=[];return Object.keys(T).forEach(function(k){W.push(T[k])}),{clusters:W,clusterEdges:P}},tT=function(t,e,n,i,a,o,s,u){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),Bm(t,e,n,i,!0,a,o,s,u)},rT=function(t,e){var n;e===void 0&&(e=1);for(var i=Vt(t),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,f=function(){var h=Ka({nodes:o,edges:u}),d=Object.keys(h);d.sort(function(g,y){var m,b;return((m=h[g])===null||m===void 0?void 0:m.degree)-((b=h[y])===null||b===void 0?void 0:b.degree)});var v=d[0];if(!o.length||((n=h[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var l=f();if(l==="break")break}return{nodes:o,edges:u}},ME=function(t,e,n){var i=[];switch(t){case Li.EuclideanDistance:i=e[n];break;default:i=[];break}return i},nT=function(t,e,n,i,a,o){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=Li.EuclideanDistance);var s=t.nodes,u=s===void 0?[]:s,f=t.edges,l=f===void 0?[]:f,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===Li.EuclideanDistance&&!u.every(function(Y){return Y.hasOwnProperty(n)}))return c;var h=[],d=[];if(o===Li.EuclideanDistance&&(h=Nm(u,n),d=Rm(h,i,a)),!d.length)return c;for(var v=fl(d.map(function(Y){return Y.join("")})),p=Math.min(e,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case Li.EuclideanDistance:y[g]=d[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var E=-1/0,w=0,_=function(te){if(!m.includes(te)){for(var H=0,pe=0;pe<y.length;pe++){var Ae=0;switch(o){case Li.EuclideanDistance:Ae=_E(d[u[te].originIndex],y[pe],o);break}H+=Ae}var Le=H/y.length;Le>E&&!y.find(function(qe){return Oo(qe,ME(o,d,u[te].originIndex))})&&(E=Le,w=te)}},M=0;M<u.length;M++)_(M);y[g]=ME(o,d,w),m.push(w),b[g]=[u[w]],u[w].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case Li.EuclideanDistance:I=_E(d[g],y[T],o);break}I<A&&(A=I,S=T)}if(u[g].clusterId!==void 0)for(var D=b[Number(u[g].clusterId)].length-1;D>=0;D--)b[Number(u[g].clusterId)][D].id===u[g].id&&b[Number(u[g].clusterId)].splice(D,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var N=!1,g=0;g<b.length;g++){for(var P=b[g],G=new gi([]),T=0;T<P.length;T++)G=G.add(new gi(d[P[T].originIndex]));var W=G.avg(P.length);W.equal(new gi(y[g]))||(N=!0,y[g]=W.getArr())}if(C++,u.every(function(Y){return Y.clusterId!==void 0})&&N||C>=1e3)break}var k=[],R={};return l.forEach(function(Y){var J,te,H=Y.source,pe=Y.target,Ae=(J=u.find(function(rt){return rt.id===H}))===null||J===void 0?void 0:J.clusterId,Le=(te=u.find(function(rt){return rt.id===pe}))===null||te===void 0?void 0:te.clusterId,qe="".concat(Ae,"---").concat(Le);if(R[qe])R[qe].count++;else{var at={source:Ae,target:Le,count:1};R[qe]=at,k.push(at)}}),{clusters:b,clusterEdges:k}},Fm=function(t,e){var n=new gi(e),i=n.norm2(),a=new gi(t),o=a.norm2(),s=n.dot(a),u=i*o,f=u?s/u:0;return f},iT=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Vt(t.filter(function(h){return h.id!==e.id})),s=t.findIndex(function(h){return h.id===e.id}),u=Nm(t,n),f=Rm(u,i,a),l=f[s],c=[];return o.forEach(function(h,d){if(h.id!==e.id){var v=f[d],p=Fm(v,l);c.push(p),h.cosineSimilarity=p}}),o.sort(function(h,d){return d.cosineSimilarity-h.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},$G=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(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]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),WG=function(t,e){return t-e},XG=function(){function r(t){t===void 0&&(t=WG),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.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)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),YG=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],f=new Set;f.add(u);var l=function(g,y){return e?g.weight-y.weight:0},c=new XG(l);for(Uh(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var h=c.delMin(),d=h.source,v=h.target;f.has(d)&&f.has(v)||(n.push(h),f.has(d)||(f.add(d),Uh(d,s).forEach(function(p){c.insert(p)})),f.has(v)||(f.add(v),Uh(v,s).forEach(function(p){c.insert(p)})))}return n},CE=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(d){return d});e&&u.sort(function(d,v){return d.weight-v.weight});for(var f=new $G(a.map(function(d){return d.id}));u.length>0;){var l=u.shift(),c=l.source,h=l.target;f.connected(c,h)||(n.push(l),f.union(c,h))}return n},aT=function(t,e,n){var i={prim:YG,kruskal:CE};return n?i[n](t,e):CE(t,e)},oT=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=t.nodes,u=s===void 0?[]:s,f=t.edges,l=f===void 0?[]:f,c=u.length,h,d={},v={},p=0;p<c;++p){var g=u[p],y=g.id;d[y]=1/c,v[y]=1/c}for(var m=Ka(t);o>0&&i>e;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(h=0,m[g.id].inDegree===0)d[y]=0;else{for(var b=Jn(y,l,"source"),x=0;x<b.length;++x){var E=b[x],w=m[E].outDegree;w>0&&(h+=v[E]/w)}d[y]=n*h,a+=d[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;h=d[y]+a,i+=Math.abs(h-v[y]),v[y]=h}o-=1}return v},VG=-1,gd=-1,sT="-1",aa="-1",uT=-1,AE=function(){function r(t,e,n,i){t===void 0&&(t=VG),e===void 0&&(e=gd),n===void 0&&(n=gd),i===void 0&&(i=sT),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),HG=function(){function r(t,e){t===void 0&&(t=gd),e===void 0&&(e=aa),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),fT=function(){function r(t,e,n){t===void 0&&(t=gd),e===void 0&&(e=!0),n===void 0&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new HG(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new AE(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new AE(t,n,e,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),fs=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||aa,edgeLabel:i||sT,nodeLabel2:a||aa}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),TE=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new fs(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=uT),e===void 0&&(e=!1);var n=new fT(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,f=s.edgeLabel,l=s.nodeLabel2;u!==aa&&n.addNode(a,u),l!==aa&&n.addNode(o,l),u!==aa&&l!==u&&n.addEdge(void 0,a,o,f)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(t===void 0||o===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},r}(),$c=function(){function r(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),KG=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,o=a===void 0?1:a,s=t.maxNodeNum,u=s===void 0?4:s,f=t.top,l=f===void 0?10:f,c=t.directed,h=c===void 0?!1:c,d=t.verbose,v=d===void 0?!1:d;this.graphs=e,this.dfsCode=new TE,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=l,this.directed=h,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(o){(n.directed||e.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,o=a[n.to],s=o.edges,u=s.length,f=0;f<u;f++){var l=s[f];if(!(i.hasEdge(l)||l.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=l.label)return l}else if(e.label<l.label||e.label===l.label&&a[e.to].label<=a[n.to].label)return l}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],o=e.to,s=t.nodeMap[o].edges,u=s.length,f=0;f<u;f++){var l=s[f],c=t.nodeMap[l.to];n<=c.label&&!i.hasNode(c)&&a.push(l)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],o=t.nodeMap,s=o[e.to].label,u=o[e.from],f=u.edges,l=f.length,c=0;c<l;c++){var h=f[c],d=o[h.to].label;e.to===h.to||n>d||i.hasNode(o[h.to])||(e.label<h.label||e.label===h.label&&s<=d)&&a.push(h)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<e.nodeLabel1||a===e.nodeLabel1&&o<e.edgeLabel||a===e.nodeLabel1&&o===e.edgeLabel&&s<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(uT,n),a=i.nodeMap,o=new TE,s={};i.nodes.forEach(function(c){var h=t.findForwardRootEdges(i,c);h.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new fs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var f=function c(h){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},y=!1,m=0,b=n?-1:0,x=function(G){if(y)return"break";h.forEach(function(W){var k=new $c(W),R=t.findBackwardEdge(i,k.edges[d[G]],k.edges[d[0]],k);R&&(g[R.label]||(g[R.label]={projected:[],edgeLabel:R.label}),g[R.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[d[G]].fromNode,y=!0)})},E=d.length-1;E>b;E--){var w=x(E);if(w==="break")break}if(y){var _=t.findMinLabel(g);o.dfsEdgeList.push(new fs(p,m,aa,_.edgeLabel,aa));var M=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;h.forEach(function(P){var G=new $c(P),W=t.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(y=!0,S=p,W.forEach(function(k){var R="".concat(k.label,"-").concat(a[k.to].label);C[R]||(C[R]={projected:[],edgeLabel:k.label,nodeLabel2:a[k.to].label}),C[R].projected.push({graphId:i.id,edge:k,preNode:P})}))});for(var A=d.length,T=function(G){if(y)return"break";var W=d[G];h.forEach(function(k){var R=new $c(k),Y=t.findForwardRmpathEdges(i,R.edges[W],v,R);Y.length>0&&(y=!0,S=o.dfsEdgeList[W].fromNode,Y.forEach(function(J){var te="".concat(J.label,"-").concat(a[J.to].label);C[te]||(C[te]={projected:[],edgeLabel:J.label,nodeLabel2:a[J.to].label}),C[te].projected.push({graphId:i.id,edge:J,preNode:k})}))})},E=0;E<A;E++){var I=T(E);if(I==="break")break}if(!y)return!0;var D=t.findMinLabel(C);o.dfsEdgeList.push(new fs(S,p+1,aa,D.edgeLabel,D.nodeLabel2));var N=o.dfsEdgeList.length-1;return e.dfsEdgeList[N]!==o.dfsEdgeList[N]?!1:c(C["".concat(D.edgeLabel,"-").concat(D.nodeLabel2)].projected)},l="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return f(s[l].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Vt(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},f={};t.forEach(function(l){for(var c=e.graphs[l.graphId],h=c.nodeMap,d=new $c(l),v=a.length-1;v>=0;v--){var p=e.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);f[g]||(f[g]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),f[g].projected.push({graphId:l.graphId,edge:p,preNode:l})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(c,d.edges[a[0]],s,d);y.forEach(function(b){var x="".concat(o,"-").concat(b.label,"-").concat(h[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:h[b.to].label}),u[x].projected.push({graphId:l.graphId,edge:b,preNode:l})});for(var m=function(x){var E=e.findForwardRmpathEdges(c,d.edges[a[x]],s,d);E.forEach(function(w){var _="".concat(e.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(h[w.to].label);u[_]||(u[_]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:h[w.to].label}),u[_].projected.push({graphId:l.graphId,edge:w,preNode:l})})},v=0;v<a.length;v++)m(v)}}),Object.keys(f).forEach(function(l){var c=f[l],h=c.toNodeId,d=c.edgeLabel;e.dfsCode.dfsEdgeList.push(new fs(o,h,"-1",d,"-1")),e.subGraphMining(f[l].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(l){var c=u[l],h=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;e.dfsCode.dfsEdgeList.push(new fs(h,o+1,aa,d,v)),e.subGraphMining(u[l].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(t).forEach(function(u){var f=t[u],l=f.nodeMap;f.nodes.forEach(function(c,h){var d=c.label,v="".concat(u,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:u,label:d},c.edges.forEach(function(g){var y=d,m=l[g.to].label;if(!e&&y>m){var b=m;m=y,y=b}var x=g.label,E="".concat(y,"-").concat(x,"-").concat(m);if(!o[E]){var w=o[E]||0;w++,o[E]=w}})})}),Object.keys(a).forEach(function(u){var f=a[u];if(!(f<n)){var l={nodes:[],edges:[]};l.nodes.push({id:"0",label:u}),i.push(l)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs;this.directed;var n={};Object.keys(e).forEach(function(i){var a=e[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=t.findForwardRootEdges(a,s);u.forEach(function(f){var l=o[f.to],c="".concat(s.label,"-").concat(f.label,"-").concat(l.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:f.label,nodeLabel2:l.label});var h={graphId:i,edge:f,preNode:null};n[c].projected.push(h)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,f=a.nodeLabel2;t.dfsCode.dfsEdgeList.push(new fs(0,1,s,u,f)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),qG=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],f=new fT(s,!0,e),l={};u.nodes.forEach(function(c,h){f.addNode(h,c[n]),l[c.id]=h}),u.edges.forEach(function(c,h){var d=l[c.source],v=l[c.target];f.addEdge(-1,d,v,c[i])}),f&&f.getNodeNum()&&(a[f.id]=f)}),a},ZG=function(t,e,n){var i=[];return t.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[e]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},IE="cluster",QG=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,o=a===void 0?IE:a,s=t.edgeLabelProp,u=s===void 0?IE:s,f=qG(e,i,o,u),l=t.minSupport,c=t.maxNodeNum,h=t.minNodeNum,d=t.verbose,v=t.top,p={graphs:f,minSupport:l,maxNodeNum:c,minNodeNum:h,top:v,verbose:d,directed:i},g=new KG(p);g.run();var y=ZG(g.frequentSubgraphs,o,u);return y},OE=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=t.nodes;return e.forEach(function(s,u){a.push(lT(o,s,u,n,i))}),a},lT=function(t,e,n,i,a){var o=[n],s=[],u={};return e.forEach(function(f,l){if(f<=a&&n!==l){o.push(l),s.push(t[l]);var c=t[l][i];u[c]?(u[c].count++,u[c].dists.push(f)):u[c]={count:1,dists:[f]}}}),Object.keys(u).forEach(function(f){u[f].dists=u[f].dists.sort(function(l,c){return l-c})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},JG=function(t,e,n,i,a){var o=Math.ceil(n/e),s={},u=0;return i.forEach(function(f,l){for(var c=0,h=0,d=f.nodeIdxs,v=f.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(l,"-").concat(p)]||s["".concat(p,"-").concat(l)])&&(p=Math.floor(Math.random()*e),g++,!(g>2*e)););if(g<2*e&&(s["".concat(l,"-").concat(p)]={start:l,end:p,distance:a[l][p]},c++,u++,u>=n))return s;if(h++,h>2*e)break}if(c<o){var y=o-c;o=(o+y)/(e-l-1)}}),s},$h=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var f=t[o],l=(s=e[f.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=e[f.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!l||!c)){var h=new Set(c),d=l.filter(function(m){return h.has(m)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var y=a[d[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},Wh=function(t,e,n,i){var a,o,s={};t.nodes.forEach(function(f){s[f.id]=f});var u=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((o=e==null?void 0:e.nodes)===null||o===void 0?void 0:o.length)<2?0:(t.edges.forEach(function(f){var l=s[f.source][n],c=s[f.target][n],h=e==null?void 0:e.nodes[0][n],d=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];f[i]===v&&(l===h&&c===d||l===d&&c===h)&&u++}),u)},ez=function(t,e,n){for(var i=1/0,a=0,o=function(f){var l=t[f],c=Object.keys(l).sort(function(m,b){return l[m]-l[b]}),h=10,d=[];c.forEach(function(m,b){d[b%h]||(d[b%h]={graphs:[],totalCount:0,aveCount:0}),d[b%h].graphs.push(m),d[b%h].totalCount+=l[m]});var v=0,p=[];d.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,E=m.length;m.graphs.forEach(function(w,_){var M=l[w];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-l[C]))})}),x/=E*(E-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,E){b!==E&&(g+=Math.abs(m-x))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=f)},s=0;s<e;s++)o(s);return{structure:n[a],structureCountMap:t[a]}},LE=function(t,e){var n={},i={};return t.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[e];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},DE=function(t,e,n){var i={},a={};return t.forEach(function(o,s){i["".concat(WA)]={idx:s,edge:o};var u=o[e];a[u]||(a[u]=[]),a[u].push(o);var f=n[o.source];f&&(f.degree++,f.outDegree++);var l=n[o.target];l&&(l.degree++,l.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},kE=function(t,e,n){var i=e.length,a={};return e.forEach(function(o,s){for(var u=n?0:s+1,f=t[s].id,l=u;l<i;l++)if(s!==l){var c=t[l].id,h=o[l];a["".concat(f,"-").concat(c)]=h,n||(a["".concat(c,"-").concat(f)]=h)}}),a},tz=function(t,e,n,i,a,o,s,u,f,l,c){var h,d="".concat(e.id,"-").concat(n.id);if(l&&l[d])return l[d];var v=c?c[d]:void 0;if(!v){var p=(h={},h[d]={start:i[e.id].idx,end:i[n.id].idx,distance:a},h);c=$h(p,o,t,c),v=c[d]}return Wh(v,s,u,f)},PE=function(t,e,n,i){var a,o,s,u=(a=t[e])===null||a===void 0?void 0:a.degree,f=(o=t[e])===null||o===void 0?void 0:o.inDegree,l=(s=t[e])===null||s===void 0?void 0:s.outDegree;return t[e]===void 0&&(u=1/0,f=1/0,l=1/0,i[e].forEach(function(c){var h=n[c.id].degree;u>h&&(u=h);var d=n[c.id].inDegree;f>d&&(f=d);var v=n[c.id].outDegree;l>v&&(l=v)}),t[e]={degree:u,inDegree:f,outDegree:l}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:f,minPatternNodeLabelOutDegree:l}},cT=function(t,e,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!t||!t.nodes)){var f=t.nodes.length;if(f){var l=hl(t,n),c=hl(e,n),h=kE(t.nodes,l,n),d=kE(e.nodes,c,n),v=LE(t.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=LE(e.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;DE(t.edges,s,p);var x=DE(e.edges,s,m).edgeLabelMap,E=[];c==null||c.forEach(function(tt){E=E.concat(tt)}),a||(a=Math.max.apply(Math,ri(ri([],E,!1),[2],!1))),i||(i=a);var w=OE(t,l,o,i),_=OE(e,c,o,i),M=Math.min(100,f*(f-1)/2),C=JG(i,f,M,w,l),S=$h(C,w,t),A=10,T=1,I=1,D=4,N={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:D,directed:n},P=QG(N).slice(0,A),G=P.length,W=[];P.forEach(function(tt,ie){W[ie]={},Object.keys(S).forEach(function(L){var _e=S[L],Be=Wh(_e,tt,o,s);W[ie][L]=Be})});var k=ez(W,G,P),R=k.structure,Y=k.structureCountMap,J=e.nodes[0],te=[],H=(u=e.nodes[0])===null||u===void 0?void 0:u[o],pe=-1/0;e.nodes.forEach(function(tt){var ie=tt[o],L=g[ie];(L==null?void 0:L.length)>pe&&(pe=L.length,te=L,H=ie,J=tt)});var Ae={},Le={},qe={},at={},rt={},xt={};Object.keys(b).forEach(function(tt,ie){rt[tt]=[],n&&(xt[tt]=[]);var L=b[tt],_e={};L.forEach(function(Ke){var Qe=d["".concat(J.id,"-").concat(Ke.id)];if(Qe&&rt[tt].push(Qe),_e["".concat(J.id,"-").concat(Ke.id)]={start:0,end:m[Ke.id].idx,distance:Qe},n){var vt=d["".concat(Ke.id,"-").concat(J.id)];vt&&xt[tt].push(vt)}}),rt[tt]=rt[tt].sort(function(Ke,Qe){return Ke-Qe}),n&&(xt[tt]=xt[tt].sort(function(Ke,Qe){return Ke-Qe})),Le=$h(_e,_,e,Le);var Be=[];if(Object.keys(_e).forEach(function(Ke){if(qe[Ke]){Be.push(qe[Ke]);return}var Qe=Le[Ke];qe[Ke]=Wh(Qe,R,o,s),Be.push(qe[Ke])}),Be=Be.sort(function(Ke,Qe){return Qe-Ke}),at["".concat(J.id,"-").concat(tt)]=Be,tt!==H)for(var ye=(te==null?void 0:te.length)||0,$e=function(Qe){var vt=te[Qe],Dt=w[p[vt.id].idx],lr=Dt.nodeLabelCountMap[tt],kt=b[tt].length;if(!lr||lr.count<kt)return te.splice(Qe,1),"continue";for(var hr=!1,or=0;or<kt;or++)if(lr.dists[or]>rt[tt][or]){hr=!0;break}if(hr)return te.splice(Qe,1),"continue";var gr={};Dt.neighbors.forEach(function(er){var Or=h["".concat(vt.id,"-").concat(er.id)];gr["".concat(vt.id,"-").concat(er.id)]={start:p[vt.id].idx,end:p[er.id].idx,distance:Or}}),S=$h(gr,w,t,S);var vr=[];Object.keys(gr).forEach(function(er){if(Y[er]){vr.push(Y[er]);return}var Or=S[er];Y[er]=Wh(Or,R,o,s),vr.push(Y[er])}),vr=vr.sort(function(er,Or){return Or-er});for(var en=!1,or=0;or<kt;or++)if(vr[or]<Be[or]){en=!0;break}if(en)return te.splice(Qe,1),"continue"},We=ye-1;We>=0;We--)$e(We)});var Et=[];te==null||te.forEach(function(tt){for(var ie=p[tt.id].idx,L=lT(t.nodes,l[ie],ie,o,a),_e=L.neighbors,Be=_e.length,ye=!1,$e=Be-1;$e>=0;$e--){if(_e.length+1<e.nodes.length){ye=!0;return}var We=_e[$e],Ke=We[o];if(!b[Ke]||!b[Ke].length){_e.splice($e,1);continue}if(!rt[Ke]||!rt[Ke].length){_e.splice($e,1);continue}var Qe="".concat(tt.id,"-").concat(We.id),vt=h[Qe],Dt=rt[Ke].length-1,lr=rt[Ke][Dt];if(vt>lr){_e.splice($e,1);continue}if(n){var kt="".concat(We.id,"-").concat(tt.id),hr=h[kt];Dt=xt[Ke].length-1;var or=xt[Ke][Dt];if(hr>or){_e.splice($e,1);continue}}var gr=Y[Qe]?Y[Qe]:tz(t,tt,We,p,vt,w,R,o,s,Y,S),vr="".concat(J.id,"-").concat(Ke),en=at[vr][at[vr].length-1];if(gr<en){_e.splice($e,1);continue}var er=PE(Ae,Ke,m,b),Or=er.minPatternNodeLabelDegree;if(er.minPatternNodeLabelInDegree,er.minPatternNodeLabelOutDegree,p[We.id].degree<Or){_e.splice($e,1);continue}}ye||Et.push({nodes:[tt].concat(_e)})});var ur=cl(e,J.id,!1).length,Bt={};n?(Object.keys(ur).forEach(function(tt){var ie=m[tt].node[o];Bt[ie]?Bt[ie].push(ur[tt]):Bt[ie]=[ur[tt]]}),Object.keys(Bt).forEach(function(tt){Bt[tt].sort(function(ie,L){return ie-L})})):Bt=rt;for(var Ut=Et.length,dr=function(ie){var L=Et[ie],_e=L.nodes[0],Be={},ye={};L.nodes.forEach(function(At,pr){ye[At.id]={idx:pr,node:At,degree:0,inDegree:0,outDegree:0};var mt=At[o];Be[mt]?Be[mt]++:Be[mt]=1});var $e=[],We={};t.edges.forEach(function(At){ye[At.source]&&ye[At.target]&&($e.push(At),We[At[s]]?We[At[s]]++:We[At[s]]=1,ye[At.source].degree++,ye[At.target].degree++,ye[At.source].outDegree++,ye[At.target].inDegree++)});for(var Ke=Object.keys(x).length,Qe=!1,vt=0;vt<Ke;vt++){var Dt=Object.keys(x)[vt];if(!We[Dt]||We[Dt]<x[Dt].length){Qe=!0;break}}if(Qe)return Et.splice(ie,1),"continue";var lr=$e.length;if(lr<e.edges.length)return Et.splice(ie,1),"break";for(var kt=!1,hr=function(pr){var mt=$e[pr],_r=mt[s],tn=x[_r];if(!tn||!tn.length)return We[_r]--,tn&&We[_r]<tn.length?(kt=!0,"break"):($e.splice(pr,1),ye[mt.source].degree--,ye[mt.target].degree--,ye[mt.source].outDegree--,ye[mt.target].inDegree--,"continue");var Aa=ye[mt.source].node[o],Ta=ye[mt.target].node[o],_i=!1;if(tn.forEach(function($i){var Ia=m[$i.source].node,Oa=m[$i.target].node;Ia[o]===Aa&&Oa[o]===Ta&&(_i=!0),!n&&Ia[o]===Ta&&Oa[o]===Aa&&(_i=!0)}),!_i)return We[_r]--,tn&&We[_r]<tn.length?(kt=!0,"break"):($e.splice(pr,1),ye[mt.source].degree--,ye[mt.target].degree--,ye[mt.source].outDegree--,ye[mt.target].inDegree--,"continue")},vt=lr-1;vt>=0;vt--){var or=hr(vt);if(or==="break")break}if(kt)return Et.splice(ie,1),"continue";L.edges=$e;var gr=cl(L,L.nodes[0].id,!1).length;if(Object.keys(gr).reverse().forEach(function(At){if(!(At===L.nodes[0].id||kt)){if(gr[At]===1/0){var pr=ye[At].node[o];if(Be[pr]--,Be[pr]<b[pr].length){kt=!0;return}var mt=L.nodes.indexOf(ye[At].node);L.nodes.splice(mt,1),ye[At]=void 0;return}var _r=p[At].node[o];if(!Bt[_r]||!Bt[_r].length||gr[At]>Bt[_r][Bt[_r].length-1]){var pr=ye[At].node[o];if(Be[pr]--,Be[pr]<b[pr].length){kt=!0;return}var mt=L.nodes.indexOf(ye[At].node);L.nodes.splice(mt,1),ye[At]=void 0}}}),kt)return Et.splice(ie,1),"continue";for(var vr=!0,en=0;vr&&!kt;){vr=!1;var er=n?ye[_e.id].degree<m[J.id].degree||ye[_e.id].inDegree<m[J.id].inDegree||ye[_e.id].outDegree<m[J.id].outDegree:ye[_e.id].degree<m[J.id].degree;if(er){kt=!0;break}if(Be[_e[o]]<b[_e[o]].length){kt=!0;break}for(var Or=L.nodes.length,Un=Or-1;Un>=0;Un--){var Br=L.nodes[Un],Ui=ye[Br.id].degree,Uo=ye[Br.id].inDegree,$o=ye[Br.id].outDegree,qr=Br[o],wi=PE(Ae,qr,m,b),Ca=wi.minPatternNodeLabelDegree,Wo=wi.minPatternNodeLabelInDegree,Xo=wi.minPatternNodeLabelOutDegree,Yo=n?Ui<Ca||Uo<Wo||$o<Xo:Ui<Ca;if(Yo){if(Be[Br[o]]--,Be[Br[o]]<b[Br[o]].length){kt=!0;break}L.nodes.splice(Un,1),ye[Br.id]=void 0,vr=!0}}if(kt||!vr&&en!==0)break;lr=$e.length;for(var $n=lr-1;$n>=0;$n--){var Lr=$e[$n];if(!ye[Lr.source]||!ye[Lr.target]){$e.splice($n,1);var Wn=Lr[s];if(We[Wn]--,ye[Lr.source]&&(ye[Lr.source].degree--,ye[Lr.source].outDegree--),ye[Lr.target]&&(ye[Lr.target].degree--,ye[Lr.target].inDegree--),x[Wn]&&We[Wn]<x[Wn].length){kt=!0;break}vr=!0}}en++}if(kt||kt||L.nodes.length<e.nodes.length||$e.length<e.edges.length)return Et.splice(ie,1),"continue"},fr=Ut-1;fr>=0;fr--){var Gt=dr(fr);if(Gt==="break")break}for(var Jt=Et.length,Rr=function(ie){var L=Et[ie],_e={};L.edges.forEach(function($e){var We="".concat($e.source,"-").concat($e.target,"-").concat($e.label);_e[We]?_e[We]++:_e[We]=1});for(var Be=function(We){var Ke=Et[We],Qe={};Ke.edges.forEach(function(Dt){var lr="".concat(Dt.source,"-").concat(Dt.target,"-").concat(Dt.label);Qe[lr]?Qe[lr]++:Qe[lr]=1});var vt=!0;Object.keys(Qe).length!==Object.keys(_e).length?vt=!1:Object.keys(_e).forEach(function(Dt){Qe[Dt]!==_e[Dt]&&(vt=!1)}),vt&&Et.splice(We,1)},ye=Jt-1;ye>ie;ye--)Be(ye);Jt=Et.length},fr=0;fr<=Jt-1;fr++)Rr(fr);return Et}}},Eu=function(){function r(t){t===void 0&&(t=10),this.linkedList=new $A,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),hT=Dm;const rz={getAdjMatrix:Ms,breadthFirstSearch:XA,connectedComponent:Om,getDegree:Ka,getInDegree:VA,getOutDegree:HA,detectCycle:Dm,detectDirectedCycle:hT,detectAllCycles:qA,detectAllDirectedCycle:Pm,detectAllUndirectedCycle:km,depthFirstSearch:Lm,dijkstra:cl,findAllPath:JA,findShortestPath:QA,floydWarshall:hl,labelPropagation:eT,louvain:Bm,iLouvain:tT,kCore:rT,kMeans:nT,cosineSimilarity:Fm,nodesCosineSimilarity:iT,minimumSpanningTree:aT,pageRank:oT,getNeighbors:Jn,Stack:Eu,GADDI:cT},nz=Object.freeze(Object.defineProperty({__proto__:null,GADDI:cT,Stack:Eu,breadthFirstSearch:XA,connectedComponent:Om,cosineSimilarity:Fm,default:rz,depthFirstSearch:Lm,detectAllCycles:qA,detectAllDirectedCycle:Pm,detectAllUndirectedCycle:km,detectCycle:Dm,detectDirectedCycle:hT,dijkstra:cl,findAllPath:JA,findShortestPath:QA,floydWarshall:hl,getAdjMatrix:Ms,getDegree:Ka,getInDegree:VA,getNeighbors:Jn,getOutDegree:HA,iLouvain:tT,kCore:rT,kMeans:nT,labelPropagation:eT,louvain:Bm,minimumSpanningTree:aT,nodesCosineSimilarity:iT,pageRank:oT},Symbol.toStringTag,{value:"Module"}));var yd=xi,iz=function(t){return function(e,n){return e[t]-n[t]}},NE=function(t,e,n){return t>=e&&t<=n},cv=function(t,e,n,i){var a=1e-4,o={x:n.x-t.x,y:n.y-t.y},s={x:e.x-t.x,y:e.y-t.y},u={x:i.x-n.x,y:i.y-n.y},f=s.x*u.y-s.y*u.x,l=f*f,c=1/f,h=s.x*s.x+s.y*s.y,d=u.x*u.x+u.y*u.y;if(l>a*h*d){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!NE(v,0,1)||!NE(p,0,1)?null:{x:t.x+v*s.x,y:t.y+v*s.y}}return null},dT=function(t,e){var n=t.x,i=t.y,a=t.width,o=t.height,s=n+a/2,u=i+o/2,f=[],l={x:s,y:u};f.push({x:n,y:i}),f.push({x:n+a,y:i}),f.push({x:n+a,y:i+o}),f.push({x:n,y:i+o}),f.push({x:n,y:i});for(var c=null,h=1;h<f.length&&(c=cv(f[h-1],f[h],l,e),!c);h++);return c},vT=function(t,e){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,u=o-n,f=s-i;if(u*u+f*f<a*a)return null;var l=Math.atan(f/u);return{x:n+Math.abs(a*Math.cos(l))*Math.sign(u),y:i+Math.abs(a*Math.sin(l))*Math.sign(f)}},pT=function(t,e){var n=t.rx,i=t.ry,a=t.x,o=t.y,s=e.x-a,u=e.y-o,f=Math.atan2(u/i,s/n);return f<0&&(f+=2*Math.PI),{x:a+n*Math.cos(f),y:o+i*Math.sin(f)}},Mu=function(t,e,n){n===void 0&&(n=1);var i=[t.x,t.y,n];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),fv(i,i,e),{x:i[0],y:i[1]}},gT=function(t,e,n){n===void 0&&(n=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var i=pm([1,0,0,0,1,0,0,0,1],e);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,n];return fv(a,a,i),{x:a[0],y:a[1]}},A0=function(t,e,n){var i=t.x-e.x,a=t.y-e.y,o=t.x-n.x,s=t.y-n.y,u=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,f=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,l=a*o-i*s;return{x:-(s*u-a*f)/l,y:-(i*f-o*u)/l}},md=function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},az=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},oz=function(t){for(var e=[],n=t.length,i=0;i<n;i+=1){e[i]=[];for(var a=0;a<n;a+=1)i===a?e[i][a]=0:t[i][a]===0||!t[i][a]?e[i][a]=1/0:e[i][a]=t[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)e[i][a]>e[i][o]+e[o][a]&&(e[i][a]=e[i][o]+e[o][a]);return e},sz=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),i&&i.forEach(function(s){var u=s.source,f=s.target,l=o[u],c=o[f];a[l][c]=1,e||(a[c][l]=1)}),a},yT=function(t,e){t.translate(e.x,e.y)},T0=function(t,e,n,i){i===void 0&&(i={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),s=e.x-o.minX,u=e.y-o.minY;if(n){var f=s*a[0],l=u*a[4],c=0,h=0,d=0,v=0;t.animate(function(g){return d=f*g,v=l*g,a=yd(a,[["t",d-c,v-h]]),c=d,h=v,{matrix:a}},i)}else{var p=yd(a,[["t",s,u]]);t.setMatrix(p)}},uz=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=e;gt(e)||(i=[e,e]),gt(e)&&e.length===1&&(i=[e[0],e[0]]),n=yd(n,[["s",i[0],i[1]]]),t.setMatrix(n)},fz=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=yd(n,[["r",e]]),t.setMatrix(n)},lz=function(t,e,n){for(var i=[],a=0;a<t;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[e[o.source]]+=1),o.target&&(i[e[o.target]]+=1)}),i};function cz(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}var dl=function(t,e,n){var i=!1,a=t.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var f=t[u],l=t[(u+1)%a];if(cz(f,l,[e,n]))return!0;s(f[1]-n)>0!=s(l[1]-n)>0&&s(e-(n-f[1])*(f[0]-l[0])/(f[1]-l[1])-f[0])<0&&(i=!i)}return i},mT=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},hz=function(t,e){var n=!1;return me(t,function(i){if(cv(i.from,i.to,e.from,e.to))return n=!0,!1}),n},bT=function(t,e){var n=function(h){var d=h.map(function(p){return p[0]}),v=h.map(function(p){return p[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(h){for(var d=[],v=h.length,p=0;p<v-1;p++){var g=h[p],y=h[p+1];d.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(d.length>1){var m=h[0],b=h[v-1];d.push({from:{x:b[0],y:b[1]},to:{x:m[0],y:m[1]}})}return d};if(t.length<2||e.length<2)return!1;var a=n(t),o=n(e);if(!mT(a,o))return!1;var s=!1;if(me(e,function(c){if(dl(t,c[0],c[1]))return s=!0,!1}),s||(me(t,function(c){if(dl(e,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(t),f=i(e),l=!1;return me(f,function(c){if(hz(u,c))return l=!0,!1}),l},Cs=function(){function r(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}return r.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),i=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:n,maxY:i,width:n-t,height:i-e};return a},r}(),Gm=function(t,e){var n={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]};return n[e]},dz=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},xT=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=Gm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3];o[s]=cv({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:f,y:l},{x:c,y:h}),o[s]&&(a+=1)}return[o,a]},zm=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=Gm(i,n[s]),f=u[0],l=u[1],c=u[2],h=u[3],d=dz(e,new Cs(f,l,c,h));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},ET=function(t){var e=0,n=0;if(t.length>0){for(var i=0,a=t;i<a.length;i++){var o=a[i];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},bd=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},wT=function(t,e){var n=e.x1,i=e.y1,a=e.x2-n,o=e.y2-i,s=t.x-n,u=t.y-i,f=s*a+u*o,l;f<=0?l=0:(s=a-s,u=o-u,f=s*a+u*o,f<=0?l=0:l=f*f/(a*a+o*o));var c=s*s+u*u-l;return c<0&&(c=0),c},I0=function(t,e,n){return n===void 0&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},_T=function(t,e){var n=t.x<e.x,i=t.x>e.x+e.width,a=t.y>e.y+e.height,o=t.y<e.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!i)return Math.pow(t.y-e.y,2);if(n&&!a&&!o)return Math.pow(e.x-t.x,2);if(i&&!a&&!o)return Math.pow(e.x+e.width-t.x,2);var u=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),f=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return u*u+f*f},vz=function(t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e.x,u=e.y,f=[a-n,o-i];if(Im(f,[0,0]))return NaN;var l=[-f[1],f[0]];To(l,l);var c=[s-n,u-i];return Math.abs(Tm(c,l))},jm=function(t,e,n){return t+(e-t)*n},O0=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=jm(t[o],e[o],n);return a};const pz=Object.freeze(Object.defineProperty({__proto__:null,Line:Cs,applyMatrix:Mu,compare:iz,distance:md,floydWarshall:oz,fractionToLine:zm,getAdjMatrix:sz,getBBoxBoundLine:Gm,getCircleCenterByPoints:A0,getCircleIntersectByPoint:vT,getDegree:lz,getEllipseIntersectByPoint:pT,getLineIntersect:cv,getPointsCenter:ET,getRectIntersectByPoint:dT,intersectBBox:mT,invertMatrix:gT,isPointInPolygon:dl,isPointsOverlap:I0,isPolygonsIntersect:bT,itemIntersectByLine:xT,lerp:jm,lerpArray:O0,move:T0,pointLineDistance:vz,pointLineSquareDist:wT,pointRectSquareDist:_T,rotate:fz,scale:uz,scaleMatrix:az,squareDist:bd,translate:yT},Symbol.toStringTag,{value:"Module"}));var fo="rgb(95, 149, 255)",gz="rgb(255, 255, 255)",RE="rgb(0, 0, 0)",dg="rgb(247, 250, 255)",ST="rgb(239, 244, 255)",Wc="rgb(253, 253, 253)",BE="rgb(250, 250, 250)",Xc="rgb(224, 224, 224)",FE="rgb(234, 234, 234)",yz="rgb(245, 245, 245)",mz="rgb(191, 213, 255)",GE="#4572d9",bz="rgb(223, 234, 255)",ir={mainStroke:fo,mainFill:ST,activeStroke:fo,activeFill:dg,inactiveStroke:mz,inactiveFill:dg,selectedStroke:fo,selectedFill:gz,highlightStroke:GE,highlightFill:bz,disableStroke:Xc,disableFill:BE,edgeMainStroke:Xc,edgeActiveStroke:fo,edgeInactiveStroke:FE,edgeSelectedStroke:fo,edgeHighlightStroke:fo,edgeDisableStroke:yz,comboMainStroke:Xc,comboMainFill:Wc,comboActiveStroke:fo,comboActiveFill:dg,comboInactiveStroke:Xc,comboInactiveFill:Wc,comboSelectedStroke:fo,comboSelectedFill:Wc,comboHighlightStroke:GE,comboHighlightFill:Wc,comboDisableStroke:FE,comboDisableFill:BE};const lt={version:"0.8.23",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:ir.mainStroke,fill:ST},size:20,color:ir.mainStroke,linkPoints:{size:8,lineWidth:1,fill:ir.activeFill,stroke:ir.activeStroke}},nodeStateStyles:{active:{fill:ir.activeFill,stroke:ir.activeStroke,lineWidth:2,shadowColor:ir.mainStroke,shadowBlur:10},selected:{fill:ir.selectedFill,stroke:ir.selectedStroke,lineWidth:4,shadowColor:ir.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:ir.highlightFill,stroke:ir.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:ir.inactiveFill,stroke:ir.inactiveStroke,lineWidth:1},disable:{fill:ir.disableFill,stroke:ir.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:RE,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:ir.edgeMainStroke,lineAppendWidth:2},color:ir.edgeMainStroke},edgeStateStyles:{active:{stroke:ir.edgeActiveStroke,lineWidth:1},selected:{stroke:ir.edgeSelectedStroke,lineWidth:2,shadowColor:ir.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ir.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:ir.edgeInactiveStroke,lineWidth:1},disable:{stroke:ir.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:RE,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:ir.comboMainFill,lineWidth:1,stroke:ir.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:ir.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:ir.comboActiveStroke,lineWidth:1,fill:ir.comboActiveFill},selected:{stroke:ir.comboSelectedStroke,lineWidth:2,fill:ir.comboSelectedFill,shadowColor:ir.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ir.comboHighlightStroke,lineWidth:2,fill:ir.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:ir.comboInactiveStroke,fill:ir.comboInactiveFill,lineWidth:1},disable:{stroke:ir.comboDisableStroke,fill:ir.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},xz={" ":.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};var Ji=Math.PI,L0=Math.sin,D0=Math.cos,vn=L0(Ji/8),pn=D0(Ji/8),xd=function(t,e){var n=t.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=Mu(i,o),a=Mu(a,o)}var s=i.x,u=i.y,f=a.x,l=a.y;return{x:s,y:u,minX:s,minY:u,maxX:f,maxY:l,width:f-s,height:l-u}},MT=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),o=a.getBBox(),s=t.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,f=s.position||lt.defaultLoopPosition,l=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[t.startPoint.x,t.startPoint.y],h=[t.endPoint.x,t.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,y=p*vn,m=p*pn,b=g*vn,x=g*pn,E=a.get("type"),w=Math.min(d/2,v/2),_=Math.min(d,v),M=s!=null&&s.pointPadding?Math.min(_,s==null?void 0:s.pointPadding):w;if(c[0]===h[0]&&c[1]===h[1]){switch(f){case"top":E==="circle"?(c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]):(c=[l[0]-M,l[1]-d],h=[l[0]+M,l[1]-d]);break;case"top-right":p=d,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+y,l[1]-m],h=[l[0]+x,l[1]-b]):(c=[l[0]+v-M,l[1]-d],h=[l[0]+v,l[1]-d+M]);break;case"right":p=v,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+m,l[1]-y],h=[l[0]+x,l[1]+b]):(c=[l[0]+v,l[1]-M],h=[l[0]+v,l[1]+M]);break;case"bottom-right":p=v,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+m,l[1]+y],h=[l[0]+b,l[1]+x]):(c=[l[0]+v,l[1]+d-M],h=[l[0]+v-M,l[1]+d]);break;case"bottom":p=d,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]+y,l[1]+m],h=[l[0]-b,l[1]+x]):(c=[l[0]-M,l[1]+d],h=[l[0]+M,l[1]+d]);break;case"bottom-left":p=d,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-y,l[1]+m],h=[l[0]-x,l[1]+b]):(c=[l[0]-v,l[1]+d-M],h=[l[0]-v+M,l[1]+d]);break;case"left":p=v,g=v,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-m,l[1]+y],h=[l[0]-x,l[1]-b]):(c=[l[0]-v,l[1]-M],h=[l[0]-v,l[1]+M]);break;case"top-left":p=v,g=d,E==="circle"?(y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-m,l[1]-y],h=[l[0]-b,l[1]-x]):(c=[l[0]-v+M,l[1]-d],h=[l[0]-v,l[1]-d+M]);break;default:p=v,g=v,y=p*vn,m=p*pn,b=g*vn,x=g*pn,c=[l[0]-y,l[1]-m],h=[l[0]+b,l[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[h[0],h[1]],h=[C[0],C[1]]}}var S=[c[0]-l[0],c[1]-l[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=An([0,0],S,A),D=[l[0]+I[0],l[1]+I[1]],N=[h[0]-l[0],h[1]-l[1]],P=An([0,0],N,T),G=[l[0]+P[0],l[1]+P[1]];return t.startPoint={x:c[0],y:c[1]},t.endPoint={x:h[0],y:h[1]},t.controlPoints=[{x:D[0],y:D[1]},{x:G[0],y:G[1]}],t},CT=function(t,e,n,i,a){var o=1e-4,s=[],u=t==null?void 0:t.getPoint(e);if(!u)return{x:0,y:0,angle:0};if(e<o)s=t.getStartTangent().reverse();else if(e>1-o)s=t.getEndTangent();else{var f=t==null?void 0:t.getPoint(e+o);s.push([u.x,u.y]),s.push([f.x,f.y])}var l=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(l<0&&(l+=Ji*2),n&&(u.x+=D0(l)*n,u.y+=L0(l)*n),i){var c=l-Ji/2;l>1/2*Ji&&l<3*1/2*Ji&&(c-=Ji),u.x+=D0(c)*i,u.y+=L0(c)*i}var h={x:u.x,y:u.y,angle:l};return a?(l>.5*Ji&&l<1.5*Ji&&(l-=Ji),F({rotate:l},h)):h},Ez=function r(t,e,n,i){if(i(t,e,n)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return!1}return!0},wz=function r(t,e,n,i){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return}return i(t,e,n)!==!1},Cn=function(t,e){typeof e=="function"&&Ez(t,null,-1,e)},ea=function(t,e){typeof e=="function"&&wz(t,null,-1,e)},AT=function(t,e){return e*(xz[t]||1)},TT=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=AT(a,e)}),[n,e]},IT=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},k0=function(t,e){var n=[],i={},a={};t.forEach(function(u){a[u.id]=u}),t.forEach(function(u,f){var l=Vt(u);l.itemType="combo",l.children=void 0,l.parentId===l.id?(console.warn("The parentId for combo ".concat(l.id," can not be the same as the combo's id")),delete l.parentId):l.parentId&&!a[l.parentId]&&(console.warn("The parent combo for combo ".concat(l.id," does not exist!")),delete l.parentId);var c=i[l.id];if(c){if(l.children=c.children,i[l.id]=l,c=l,!c.parentId){n.push(c);return}var h=i[c.parentId];if(h)h.children?h.children.push(l):h.children=[l];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[l.id]=l}return}if(Ne(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(l):v.children=[l],i[l.id]=l;else{var p={id:u.parentId,children:[l]};i[p.id]=p,i[l.id]=l}}else n.push(l),i[l.id]=l});var o={};(e||[]).forEach(function(u){o[u.id]=u;var f=i[u.comboId];if(f){var l={id:u.id,comboId:u.comboId};f.children?f.children.push(l):f.children=[l],l.itemType="node",i[u.id]=l}});var s=0;return n.forEach(function(u){u.depth=s+10,Cn(u,function(f){var l,c=i[f.id].itemType;c==="node"?l=i[f.comboId]:l=i[f.parentId],l&&c==="node"?f.depth=s+1:f.depth=s+10,s<f.depth&&(s=f.depth);var h=o[f.id];return h&&(h.depth=f.depth),!0})}),n},P0=function(t,e,n){var i,a=t,o,s={root:{children:t}},u=!1,f="root";(t||[]).forEach(function(v){if(!u){if(v.id===e){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}Cn(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||e===p.id)&&a?(f=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[f])===null||i===void 0?void 0:i.children;var l=a?a.indexOf(o):-1;if(l>-1&&a.splice(l,1),u||(o={id:e,itemType:"node",comboId:n},s[e]={children:void 0}),e){var c=!1;if(n){var h=0;(t||[]).forEach(function(v){c||Cn(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],h=p.depth,o.itemType==="node"?o.depth=h+2:o.depth=h+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&t.push(o);var d=o.depth;Cn(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return t},Xh=function(t,e,n){var i={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};if(!t||t.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,f=o.fixSize,l=o.collapsed,c=o.fixCollapseSize,h=l?c:f,d=gt(h)?h:[h,h],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return t.forEach(function(y){var m=e.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},_z=function(t){var e=ht(t.x)||ht(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||ht(t.style.r)||ht(t.style.width)||ht(t.style.height)||ht(t.style.rx)||ht(t.style.ry)),e},Yh=function(t){var e={};return Object.keys(t).forEach(function(n){var i=t[n];if(!(n==="img"&&!Ne(i)))if(bn(i)&&!gt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Ne(s)||(a[o]=Vt(s))}),e[n]=a}else e[n]=Vt(i)}),e},vl=function(t){var e=t.animateCfg,n=t.callback,i;if(!e)i={duration:500,callback:n};else if(i=Vt(e),e.callback){var a=e.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const Sz=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Yh,getAnimateCfgWithCallback:vl,getBBox:xd,getComboBBox:Xh,getLabelPosition:CT,getLetterWidth:AT,getLoopCfgs:MT,getTextSize:TT,plainCombosToTrees:k0,reconstructTree:P0,shouldRefreshEdge:_z,traverseTree:Cn,traverseTreeUp:ea,truncateLabelByLength:IT},Symbol.toStringTag,{value:"Module"}));var zE=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,n=t.edges,i=t.combos,a=i===void 0?[]:i;if(!e&&!n){var o=!0;return Cn(t,function(h){return Ne(h.id)?!0:(o=!1,!1)}),o}var s=(e||[]).find(function(h){return!Ne(h.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(e||[]).map(function(h){return h.id}),f=a==null?void 0:a.map(function(h){return h.id}),l=ri(ri([],u,!0),f,!0),c=(n||[]).find(function(h){return!l.includes(h.source)||!l.includes(h.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Mz=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!Ne(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},Cz=function(){function r(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 r.prototype.formatModes=function(){var t=this.modes;me(t,function(e){me(e,function(n,i){Ne(n)&&(e[i]={type:n})})})},r.prototype.setBehaviors=function(t){var e=this.graph,n=this.modes[t],i=[],a;me(n||[],function(o){var s=vm.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(e),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(t,e){return me(e,function(n){t.indexOf(n)<0&&(Ne(n)&&(n={type:n}),t.push(n))}),t},r.filterBehaviors=function(t,e){var n=[];return t.forEach(function(i){var a="";Ne(i)?a=i:a=i.type,e.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(t){var e=this,n=e.modes,i=e.graph,a=t,o=n[a];o&&(i.emit("beforemodechange",{mode:t}),me(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:t}),this.mode=t)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(t,e,n){var i=this,a;if(gt(t)?a=t:a=[t],gt(e))return me(e,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=e;return e||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(t,e,n){Ne(t)&&(t={type:t});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===t.type)return s.updateCfg(e),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),Kf=`
|
|
2
2
|
\v\f\r \u2028\u2029`,Az=new RegExp("([a-z])["+Kf+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Kf+"]*,?["+Kf+"]*)+)","ig"),Tz=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Kf+"]*,?["+Kf+"]*","ig"),wu=function(r){if(!r)return null;if(gt(r))return r;var t={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},e=[];return String(r).replace(Az,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(Tz,function(u,f){f&&o.push(+f)}),s==="m"&&o.length>2&&(e.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&e.push([i,o[0]]),s==="r")e.push([i].concat(o));else for(;o.length>=t[s]&&(e.push([i].concat(o.splice(0,t[s]))),!!t[s]););return r}),e},N0=function(r,t){for(var e=[],n=0,i=r.length;i-2*!t>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];t?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),e.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return e},Yc=function(r,t,e,n,i){var a=[];if(i===null&&n===null&&(n=e),r=+r,t=+t,e=+e,n=+n,i!==null){var o=Math.PI/180,s=r+e*Math.cos(-n*o),u=r+e*Math.cos(-i*o),f=t+e*Math.sin(-n*o),l=t+e*Math.sin(-i*o);a=[["M",s,f],["A",e,e,0,+(i-n>180),0,u,l]]}else a=[["M",r,t],["m",0,-n],["a",e,n,0,1,1,0,2*n],["a",e,n,0,1,1,0,-2*n],["z"]];return a},R0=function(r){if(r=wu(r),!r||!r.length)return[["M",0,0]];var t=[],e=0,n=0,i=0,a=0,o=0,s,u;r[0][0]==="M"&&(e=+r[0][1],n=+r[0][2],i=e,a=n,o++,t[0]=["M",e,n]);for(var f=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",l=void 0,c=void 0,h=o,d=r.length;h<d;h++){if(t.push(l=[]),c=r[h],s=c[0],s!==s.toUpperCase())switch(l[0]=s.toUpperCase(),l[0]){case"A":l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=+c[6]+e,l[7]=+c[7]+n;break;case"V":l[1]=+c[1]+n;break;case"H":l[1]=+c[1]+e;break;case"R":u=[e,n].concat(c.slice(1));for(var v=2,p=u.length;v<p;v++)u[v]=+u[v]+e,u[++v]=+u[v]+n;t.pop(),t=t.concat(N0(u,f));break;case"O":t.pop(),u=Yc(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);break;case"U":t.pop(),t=t.concat(Yc(e,n,c[1],c[2],c[3])),l=["U"].concat(t[t.length-1].slice(-2));break;case"M":i=+c[1]+e,a=+c[2]+n;break;default:for(var v=1,p=c.length;v<p;v++)l[v]=+c[v]+(v%2?e:n)}else if(s==="R")u=[e,n].concat(c.slice(1)),t.pop(),t=t.concat(N0(u,f)),l=["R"].concat(c.slice(-2));else if(s==="O")t.pop(),u=Yc(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);else if(s==="U")t.pop(),t=t.concat(Yc(e,n,c[1],c[2],c[3])),l=["U"].concat(t[t.length-1].slice(-2));else for(var g=0,y=c.length;g<y;g++)l[g]=c[g];if(s=s.toUpperCase(),s!=="O")switch(l[0]){case"Z":e=+i,n=+a;break;case"H":e=l[1];break;case"V":n=l[1];break;case"M":i=l[l.length-2],a=l[l.length-1];break;default:e=l[l.length-2],n=l[l.length-1]}}return t},Vc=function(r,t,e,n){return[r,t,e,n,e,n]},jE=function(r,t,e,n,i,a){var o=.3333333333333333,s=2/3;return[o*r+s*e,o*t+s*n,o*i+s*e,o*a+s*n,i,a]},OT=function(r,t,e,n,i,a,o,s,u,f){e===n&&(e+=1);var l=Math.PI*120/180,c=Math.PI/180*(+i||0),h=[],d,v,p,g,y,m=function(Le,qe,at){var rt=Le*Math.cos(at)-qe*Math.sin(at),xt=Le*Math.sin(at)+qe*Math.cos(at);return{x:rt,y:xt}};if(f)v=f[0],p=f[1],g=f[2],y=f[3];else{d=m(r,t,-c),r=d.x,t=d.y,d=m(s,u,-c),s=d.x,u=d.y,r===s&&t===u&&(s+=1,u+=1);var b=(r-s)/2,x=(t-u)/2,E=b*b/(e*e)+x*x/(n*n);E>1&&(E=Math.sqrt(E),e=E*e,n=E*n);var w=e*e,_=n*n,M=(a===o?-1:1)*Math.sqrt(Math.abs((w*_-w*x*x-_*b*b)/(w*x*x+_*b*b)));g=M*e*x/n+(r+s)/2,y=M*-n*b/e+(t+u)/2,v=Math.asin(((t-y)/n).toFixed(9)),p=Math.asin(((u-y)/n).toFixed(9)),v=r<g?Math.PI-v:v,p=s<g?Math.PI-p:p,v<0&&(v=Math.PI*2+v),p<0&&(p=Math.PI*2+p),o&&v>p&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var C=p-v;if(Math.abs(C)>l){var S=p,A=s,T=u;p=v+l*(o&&p>v?1:-1),s=g+e*Math.cos(p),u=y+n*Math.sin(p),h=OT(s,u,e,n,i,0,o,A,T,[p,S,g,y])}C=p-v;var I=Math.cos(v),D=Math.sin(v),N=Math.cos(p),P=Math.sin(p),G=Math.tan(C/4),W=4/3*e*G,k=4/3*n*G,R=[r,t],Y=[r+W*D,t-k*I],J=[s+W*P,u-k*N],te=[s,u];if(Y[0]=2*R[0]-Y[0],Y[1]=2*R[1]-Y[1],f)return[Y,J,te].concat(h);h=[Y,J,te].concat(h).join().split(",");for(var H=[],pe=0,Ae=h.length;pe<Ae;pe++)H[pe]=pe%2?m(h[pe-1],h[pe],c).y:m(h[pe],h[pe+1],c).x;return H},B0=function(r,t){var e=R0(r),n=t&&R0(t),i={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},o=[],s=[],u="",f="",l,c=function(b,x,E){var w,_;if(!b)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(b[0]in{T:1,Q:1})&&(x.qx=x.qy=null),b[0]){case"M":x.X=b[1],x.Y=b[2];break;case"A":b=["C"].concat(OT.apply(0,[x.x,x.y].concat(b.slice(1))));break;case"S":E==="C"||E==="S"?(w=x.x*2-x.bx,_=x.y*2-x.by):(w=x.x,_=x.y),b=["C",w,_].concat(b.slice(1));break;case"T":E==="Q"||E==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),b=["C"].concat(jE(x.x,x.y,x.qx,x.qy,b[1],b[2]));break;case"Q":x.qx=b[1],x.qy=b[2],b=["C"].concat(jE(x.x,x.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(Vc(x.x,x.y,b[1],b[2]));break;case"H":b=["C"].concat(Vc(x.x,x.y,b[1],x.y));break;case"V":b=["C"].concat(Vc(x.x,x.y,x.x,b[1]));break;case"Z":b=["C"].concat(Vc(x.x,x.y,x.X,x.Y));break}return b},h=function(b,x){if(b[x].length>7){b[x].shift();for(var E=b[x];E.length;)o[x]="A",n&&(s[x]="A"),b.splice(x++,0,["C"].concat(E.splice(0,6)));b.splice(x,1),l=Math.max(e.length,n&&n.length||0)}},d=function(b,x,E,w,_){b&&x&&b[_][0]==="M"&&x[_][0]!=="M"&&(x.splice(_,0,["M",w.x,w.y]),E.bx=0,E.by=0,E.x=b[_][1],E.y=b[_][2],l=Math.max(e.length,n&&n.length||0))};l=Math.max(e.length,n&&n.length||0);for(var v=0;v<l;v++){e[v]&&(u=e[v][0]),u!=="C"&&(o[v]=u,v&&(f=o[v-1])),e[v]=c(e[v],i,f),o[v]!=="A"&&u==="C"&&(o[v]="C"),h(e,v),n&&(n[v]&&(u=n[v][0]),u!=="C"&&(s[v]=u,v&&(f=s[v-1])),n[v]=c(n[v],a,f),s[v]!=="A"&&u==="C"&&(s[v]="C"),h(n,v)),d(e,n,i,a,v),d(n,e,a,i,v);var p=e[v],g=n&&n[v],y=p.length,m=n&&g.length;i.x=p[y-2],i.y=p[y-1],i.bx=parseFloat(p[y-4])||i.x,i.by=parseFloat(p[y-3])||i.y,a.bx=n&&(parseFloat(g[m-4])||a.x),a.by=n&&(parseFloat(g[m-3])||a.y),a.x=n&&g[m-2],a.y=n&&g[m-1]}return n?[e,n]:e},Iz=/,?([a-z]),?/gi,LT=function(r){return r.join(",").replace(Iz,"$1")},UE=function(r,t,e,n,i){var a=-3*t+9*e-9*n+3*i,o=r*a+6*t-12*e+6*n;return r*o-3*t+3*e},$E=function(r,t,e,n,i,a,o,s,u){u===null&&(u=1),u=u>1?1:u<0?0:u;for(var f=u/2,l=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v<l;v++){var p=f*c[v]+f,g=UE(p,r,e,i,o),y=UE(p,t,n,a,s),m=g*g+y*y;d+=h[v]*Math.sqrt(m)}return f*d},Oz=function(r,t,e,n,i,a,o,s){for(var u=[],f=[[],[]],l,c,h,d,v=0;v<2;++v){if(v===0?(c=6*r-12*e+6*i,l=-3*r+9*e-9*i+3*o,h=3*e-3*r):(c=6*t-12*n+6*a,l=-3*t+9*n-9*a+3*s,h=3*n-3*t),Math.abs(l)<1e-12){if(Math.abs(c)<1e-12)continue;d=-h/c,d>0&&d<1&&u.push(d);continue}var p=c*c-4*h*l,g=Math.sqrt(p);if(!(p<0)){var y=(-c+g)/(2*l);y>0&&y<1&&u.push(y);var m=(-c-g)/(2*l);m>0&&m<1&&u.push(m)}}for(var b=u.length,x=b,E;b--;)d=u[b],E=1-d,f[0][b]=E*E*E*r+3*E*E*d*e+3*E*d*d*i+d*d*d*o,f[1][b]=E*E*E*t+3*E*E*d*n+3*E*d*d*a+d*d*d*s;return f[0][x]=r,f[1][x]=t,f[0][x+1]=o,f[1][x+1]=s,f[0].length=f[1].length=x+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}},Lz=function(r,t,e,n,i,a,o,s){if(!(Math.max(r,e)<Math.min(i,o)||Math.min(r,e)>Math.max(i,o)||Math.max(t,n)<Math.min(a,s)||Math.min(t,n)>Math.max(a,s))){var u=(r*n-t*e)*(i-o)-(r-e)*(i*s-a*o),f=(r*n-t*e)*(a-s)-(t-n)*(i*s-a*o),l=(r-e)*(a-s)-(t-n)*(i-o);if(l){var c=u/l,h=f/l,d=+c.toFixed(2),v=+h.toFixed(2);if(!(d<+Math.min(r,e).toFixed(2)||d>+Math.max(r,e).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||v<+Math.min(t,n).toFixed(2)||v>+Math.max(t,n).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:h}}}},lo=function(r,t,e){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},DT=function(r,t,e,n,i){if(i)return[["M",+r+ +i,t],["l",e-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-e,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,t],["l",e,0],["l",0,n],["l",-e,0],["z"]];return a.parsePathArray=LT,a},F0=function(r,t,e,n){return r===null&&(r=t=e=n=0),t===null&&(t=r.y,e=r.width,n=r.height,r=r.x),{x:r,y:t,width:e,w:e,height:n,h:n,x2:r+e,y2:t+n,cx:r+e/2,cy:t+n/2,r1:Math.min(e,n)/2,r2:Math.max(e,n)/2,r0:Math.sqrt(e*e+n*n)/2,path:DT(r,t,e,n),vb:[r,t,e,n].join(" ")}},Dz=function(r,t){return r=F0(r),t=F0(t),lo(t,r.x,r.y)||lo(t,r.x2,r.y)||lo(t,r.x,r.y2)||lo(t,r.x2,r.y2)||lo(r,t.x,t.y)||lo(r,t.x2,t.y)||lo(r,t.x,t.y2)||lo(r,t.x2,t.y2)||(r.x<t.x2&&r.x>t.x||t.x<r.x2&&t.x>r.x)&&(r.y<t.y2&&r.y>t.y||t.y<r.y2&&t.y>r.y)},WE=function(r,t,e,n,i,a,o,s){gt(r)||(r=[r,t,e,n,i,a,o,s]);var u=Oz.apply(null,r);return F0(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},XE=function(r,t,e,n,i,a,o,s,u){var f=1-u,l=Math.pow(f,3),c=Math.pow(f,2),h=u*u,d=h*u,v=l*r+c*3*u*e+f*3*u*u*i+d*o,p=l*t+c*3*u*n+f*3*u*u*a+d*s,g=r+2*u*(e-r)+h*(i-2*e+r),y=t+2*u*(n-t)+h*(a-2*n+t),m=e+2*u*(i-e)+h*(o-2*i+e),b=n+2*u*(a-n)+h*(s-2*a+n),x=f*r+u*e,E=f*t+u*n,w=f*i+u*o,_=f*a+u*s,M=90-Math.atan2(g-m,y-b)*180/Math.PI;return{x:v,y:p,m:{x:g,y},n:{x:m,y:b},start:{x,y:E},end:{x:w,y:_},alpha:M}},kz=function(r,t,e){var n=WE(r),i=WE(t);if(!Dz(n,i))return e?0:[];for(var a=$E.apply(0,r),o=$E.apply(0,t),s=~~(a/8),u=~~(o/8),f=[],l=[],c={},h=e?0:[],d=0;d<s+1;d++){var v=XE.apply(0,r.concat(d/s));f.push({x:v.x,y:v.y,t:d/s})}for(var d=0;d<u+1;d++){var v=XE.apply(0,t.concat(d/u));l.push({x:v.x,y:v.y,t:d/u})}for(var d=0;d<s;d++)for(var p=0;p<u;p++){var g=f[d],y=f[d+1],m=l[p],b=l[p+1],x=Math.abs(y.x-g.x)<.001?"y":"x",E=Math.abs(b.x-m.x)<.001?"y":"x",w=Lz(g.x,g.y,y.x,y.y,m.x,m.y,b.x,b.y);if(w){if(c[w.x.toFixed(4)]===w.y.toFixed(4))continue;c[w.x.toFixed(4)]=w.y.toFixed(4);var _=g.t+Math.abs((w[x]-g[x])/(y[x]-g[x]))*(y.t-g.t),M=m.t+Math.abs((w[E]-m[E])/(b[E]-m[E]))*(b.t-m.t);_>=0&&_<=1&&M>=0&&M<=1&&(e?h+=1:h.push({x:w.x,y:w.y,t1:_,t2:M}))}}return h},Pz=function(r,t,e){r=B0(r),t=B0(t);for(var n,i,a,o,s,u,f,l,c,h,d=e?0:[],v=0,p=r.length;v<p;v++){var g=r[v];if(g[0]==="M")n=s=g[1],i=u=g[2];else{g[0]==="C"?(c=[n,i].concat(g.slice(1)),n=c[6],i=c[7]):(c=[n,i,n,i,s,u,s,u],n=s,i=u);for(var y=0,m=t.length;y<m;y++){var b=t[y];if(b[0]==="M")a=f=b[1],o=l=b[2];else{b[0]==="C"?(h=[a,o].concat(b.slice(1)),a=h[6],o=h[7]):(h=[a,o,a,o,f,l,f,l],a=f,o=l);var x=kz(c,h,e);if(e)d+=x;else{for(var E=0,w=x.length;E<w;E++)x[E].segment1=v,x[E].segment2=y,x[E].bez1=c,x[E].bez2=h;d=d.concat(x)}}}}}return d},Nz=function(r,t){return Pz(r,t)};function Rz(r,t){var e=[],n=[];function i(a,o){if(a.length===1)e.push(a[0]),n.push(a[0]);else{for(var s=[],u=0;u<a.length-1;u++)u===0&&e.push(a[0]),u===a.length-2&&n.push(a[u+1]),s[u]=[(1-o)*a[u][0]+o*a[u+1][0],(1-o)*a[u][1]+o*a[u+1][1]];i(s,o)}}return r.length&&i(r,t),{left:e,right:n.reverse()}}function Bz(r,t,e){var n=[[r[1],r[2]]];e=e||2;var i=[];t[0]==="A"?(n.push(t[6]),n.push(t[7])):t[0]==="C"?(n.push([t[1],t[2]]),n.push([t[3],t[4]]),n.push([t[5],t[6]])):t[0]==="S"||t[0]==="Q"?(n.push([t[1],t[2]]),n.push([t[3],t[4]])):n.push([t[1],t[2]]);for(var a=n,o=1/e,s=0;s<e-1;s++){var u=o/(1-o*s),f=Rz(a,u);i.push(f.left),a=f.right}i.push(a);var l=i.map(function(c){var h=[];return c.length===4&&(h.push("C"),h=h.concat(c[2])),c.length>=3&&(c.length===3&&h.push("Q"),h=h.concat(c[1])),c.length===2&&h.push("L"),h=h.concat(c[c.length-1]),h});return l}var Fz=function(r,t,e){if(e===1)return[[].concat(r)];var n=[];if(t[0]==="L"||t[0]==="C"||t[0]==="Q")n=n.concat(Bz(r,t,e));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=e-1;a++)n.push(i)}return n},Gz=function(r,t){if(r.length===1)return r;var e=r.length-1,n=t.length-1,i=e/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o<n-e;o++)r.push(r[0]);return r}for(var o=0;o<n;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var u=a.reduce(function(f,l,c){return c===e?f.concat(r[e]):f.concat(Fz(r[c],r[c+1],l))},[]);return u.unshift(r[0]),(t[n]==="Z"||t[n]==="z")&&u.push("Z"),u},zz=function(r,t){if(r.length!==t.length)return!1;var e=!0;return me(r,function(n,i){if(n!==t[i])return e=!1,!1}),e};function jz(r,t,e){var n=null,i=e;return t<i&&(i=t,n="add"),r<i&&(i=r,n="del"),{type:n,min:i}}var Uz=function(r,t){var e=r.length,n=t.length,i,a,o=0;if(e===0||n===0)return null;for(var s=[],u=0;u<=e;u++)s[u]=[],s[u][0]={min:u};for(var f=0;f<=n;f++)s[0][f]={min:f};for(var u=1;u<=e;u++){i=r[u-1];for(var f=1;f<=n;f++){a=t[f-1],zz(i,a)?o=0:o=1;var l=s[u-1][f].min+1,c=s[u][f-1].min+1,h=s[u-1][f-1].min+o;s[u][f]=jz(l,c,h)}}return s},kT=function(r,t){var e=Uz(r,t),n=r.length,i=t.length,a=[],o=1,s=1;if(e[n][i].min!==n){for(var u=1;u<=n;u++){var f=e[u][u].min;s=u;for(var l=o;l<=i;l++)e[u][l].min<f&&(f=e[u][l].min,s=l);o=s,e[u][o].type&&a.push({index:u-1,type:e[u][o].type})}for(var u=a.length-1;u>=0;u--)o=a[u].index,a[u].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n<i)for(var u=0;u<c;u++)r[n-1][0]==="z"||r[n-1][0]==="Z"?r.splice(n-2,0,r[n-2]):r.push(r[n-1]),n+=1;return r};function vg(r,t,e){for(var n=[].concat(r),i,a=1/(e+1),o=PT(t)[0],s=1;s<=e;s++)a*=s,i=Math.floor(r.length*a),i===0?n.unshift([o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]):n.splice(i,0,[o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]);return n}function PT(r){var t=[];switch(r[0]){case"M":t.push([r[1],r[2]]);break;case"L":t.push([r[1],r[2]]);break;case"A":t.push([r[6],r[7]]);break;case"Q":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"T":t.push([r[1],r[2]]);break;case"C":t.push([r[5],r[6]]),t.push([r[1],r[2]]),t.push([r[3],r[4]]);break;case"S":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"H":t.push([r[1],r[1]]);break;case"V":t.push([r[1],r[1]]);break}return t}var G0=function(r,t){if(r.length<=1)return r;for(var e,n=0;n<t.length;n++)if(r[n][0]!==t[n][0])switch(e=PT(r[n]),t[n][0]){case"M":r[n]=["M"].concat(e[0]);break;case"L":r[n]=["L"].concat(e[0]);break;case"A":r[n]=[].concat(t[n]),r[n][6]=e[0][0],r[n][7]=e[0][1];break;case"Q":if(e.length<2)if(n>0)e=vg(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["Q"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(e[0]);break;case"C":if(e.length<3)if(n>0)e=vg(e,r[n-1],2);else{r[n]=t[n];break}r[n]=["C"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(e.length<2)if(n>0)e=vg(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["S"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=t[n]}return r};const $z=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:N0,fillPath:Gz,fillPathByDiff:kT,formatPath:G0,intersection:Nz,parsePathArray:LT,parsePathString:wu,pathToAbsolute:R0,pathToCurve:B0,rectPath:DT},Symbol.toStringTag,{value:"Module"}));var NT=function(){function r(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 r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var t=this.type;return"[Event (type="+t+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function RT(r,t){var e=r.indexOf(t);e!==-1&&r.splice(e,1)}var YE=typeof window<"u"&&typeof window.document<"u";function BT(r,t){if(r.isCanvas())return!0;for(var e=t.getParent(),n=!1;e;){if(e===r){n=!0;break}e=e.getParent()}return n}function z0(r){return r.cfg.visible&&r.cfg.capture}var Wz=function(r){Ot(t,r);function t(e){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=yt(i,e),n}return t.prototype.getDefaultCfg=function(){return{}},t.prototype.get=function(e){return this.cfg[e]},t.prototype.set=function(e,n){this.cfg[e]=n},t.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},t}(DC),VE=function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))},Xz=function(){function r(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"}return r}(),Yz=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return r}(),Vz=function(){function r(t,e,n,i){this.name=t,this.version=e,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Hz=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Kz=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),qz=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Zz=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,HE=3,Qz=[["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|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["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",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",qz]],KE=[["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/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["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 FT(r){return r?qE(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Kz:typeof navigator<"u"?qE(navigator.userAgent):t8()}function Jz(r){return r!==""&&Qz.reduce(function(t,e){var n=e[0],i=e[1];if(t)return t;var a=i.exec(r);return!!a&&[n,a]},!1)}function qE(r){var t=Jz(r);if(!t)return null;var e=t[0],n=t[1];if(e==="searchbot")return new Hz;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<HE&&(i=VE(VE([],i,!0),r8(HE-i.length),!0)):i=[];var a=i.join("."),o=e8(r),s=Zz.exec(r);return s&&s[1]?new Vz(e,a,o,s[1]):new Xz(e,a,o)}function e8(r){for(var t=0,e=KE.length;t<e;t++){var n=KE[t],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function t8(){var r=typeof process<"u"&&process.version;return r?new Yz(process.version.slice(1)):null}function r8(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}function ZE(r,t){var e=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],f=r[6],l=r[7],c=r[8],h=t[0],d=t[1],v=t[2],p=t[3],g=t[4],y=t[5],m=t[6],b=t[7],x=t[8];return e[0]=h*n+d*o+v*f,e[1]=h*i+d*s+v*l,e[2]=h*a+d*u+v*c,e[3]=p*n+g*o+y*f,e[4]=p*i+g*s+y*l,e[5]=p*a+g*u+y*c,e[6]=m*n+b*o+x*f,e[7]=m*i+b*s+x*l,e[8]=m*a+b*u+x*c,e}function ps(r,t){var e=[],n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function GT(r){var t=[],e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],f=r[7],l=r[8],c=l*o-s*f,h=-l*a+s*u,d=f*a-o*u,v=e*c+n*h+i*d;return v?(v=1/v,t[0]=c*v,t[1]=(-l*n+i*f)*v,t[2]=(s*n-i*o)*v,t[3]=h*v,t[4]=(l*e-i*u)*v,t[5]=(-s*e+i*a)*v,t[6]=d*v,t[7]=(-f*e+n*u)*v,t[8]=(o*e-n*a)*v,t):null}var xf=xi,pg="matrix",n8=["zIndex","capture","visible","type"],i8=["repeat"],a8=":",o8="*";function s8(r){for(var t=[],e=0;e<r.length;e++)gt(r[e])?t.push([].concat(r[e])):t.push(r[e]);return t}function u8(r,t){var e={},n=t.attrs;for(var i in r)e[i]=n[i];return e}function f8(r,t){var e={},n=t.attr();return me(r,function(i,a){i8.indexOf(a)===-1&&!Oo(n[a],i)&&(e[a]=i)}),e}function l8(r,t){if(t.onFrame)return r;var e=t.startTime,n=t.delay,i=t.duration,a=Object.prototype.hasOwnProperty;return me(r,function(o){e+n<o.startTime+o.delay+o.duration&&i>o.delay&&me(t.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),r}var zT=function(r){Ot(t,r);function t(e){var n=r.call(this,e)||this;n.attrs={};var i=n.getDefaultAttrs();return yt(i,e.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return t.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},t.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},t.prototype.onCanvasChange=function(e){},t.prototype.initAttrs=function(e){},t.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},t.prototype.isGroup=function(){return!1},t.prototype.getParent=function(){return this.get("parent")},t.prototype.getCanvas=function(){return this.get("canvas")},t.prototype.attr=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=n[0],o=n[1];if(!a)return this.attrs;if(bn(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return n.length===2?(this.setAttr(a,o),this.afterAttrsChange((e={},e[a]=o,e)),this):this.attrs[a]},t.prototype.isClipped=function(e,n){var i=this.getClip();return i&&!i.isHit(e,n)},t.prototype.setAttr=function(e,n){var i=this.attrs[e];i!==n&&(this.attrs[e]=n,this.onAttrChange(e,n,i))},t.prototype.onAttrChange=function(e,n,i){e==="matrix"&&this.set("totalMatrix",null)},t.prototype.afterAttrsChange=function(e){if(this.cfg.isClipShape){var n=this.cfg.applyTo;n&&n.onCanvasChange("clip")}else this.onCanvasChange("attr")},t.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},t.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},t.prototype.setZIndex=function(e){this.set("zIndex",e);var n=this.getParent();return n&&n.sort(),this},t.prototype.toFront=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.push(this),this.onCanvasChange("zIndex")}},t.prototype.toBack=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.unshift(this),this.onCanvasChange("zIndex")}},t.prototype.remove=function(e){e===void 0&&(e=!0);var n=this.getParent();n?(RT(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),e&&this.destroy()},t.prototype.resetMatrix=function(){this.attr(pg,this.getDefaultMatrix()),this.onCanvasChange("matrix")},t.prototype.getMatrix=function(){return this.attr(pg)},t.prototype.setMatrix=function(e){this.attr(pg,e),this.onCanvasChange("matrix")},t.prototype.getTotalMatrix=function(){var e=this.cfg.totalMatrix;if(!e){var n=this.attr("matrix"),i=this.cfg.parentMatrix;i&&n?e=ZE(i,n):e=n||i,this.set("totalMatrix",e)}return e},t.prototype.applyMatrix=function(e){var n=this.attr("matrix"),i=null;e&&n?i=ZE(e,n):i=n||e,this.set("totalMatrix",i),this.set("parentMatrix",e)},t.prototype.getDefaultMatrix=function(){return null},t.prototype.applyToMatrix=function(e){var n=this.attr("matrix");return n?ps(n,e):e},t.prototype.invertFromMatrix=function(e){var n=this.attr("matrix");if(n){var i=GT(n);if(i)return ps(i,e)}return e},t.prototype.setClip=function(e){var n=this.getCanvas(),i=null;if(e){var a=this.getShapeBase(),o=ku(e.type),s=a[o];s&&(i=new s({type:e.type,isClipShape:!0,applyTo:this,attrs:e.attrs,canvas:n}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},t.prototype.getClip=function(){var e=this.cfg.clipShape;return e||null},t.prototype.clone=function(){var e=this,n=this.attrs,i={};me(n,function(s,u){gt(n[u])?i[u]=s8(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return me(n8,function(s){o.set(s,e.get(s))}),o},t.prototype.destroy=function(){var e=this.destroyed;e||(this.attrs={},r.prototype.destroy.call(this))},t.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},t.prototype.animate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=e[0],s=e[1],u=e[2],f=u===void 0?"easeLinear":u,l=e[3],c=l===void 0?Ff:l,h=e[4],d=h===void 0?0:h,v,p,g,y,m;Cr(o)?(v=o,o={}):bn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),bn(s)?(m=s,s=m.duration,f=m.easing||"easeLinear",d=m.delay||0,p=m.repeat||p||!1,c=m.callback||Ff,g=m.pauseCallback||Ff,y=m.resumeCallback||Ff):(ht(c)&&(d=c,c=null),Cr(f)?(c=f,f="easeLinear"):f=f||"easeLinear");var b=f8(o,this),x={fromAttrs:u8(b,this),toAttrs:b,duration:s,easing:f,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:d,startTime:i.getTime(),id:ya(),onFrame:v,pathFormatted:!1};a.length>0?a=l8(a,x):i.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},t.prototype.stopAnimate=function(e){var n=this;e===void 0&&(e=!0);var i=this.get("animations");me(i,function(a){e&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},t.prototype.pauseAnimate=function(){var e=this.get("timeline"),n=this.get("animations"),i=e.getTime();return me(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},t.prototype.resumeAnimate=function(){var e=this.get("timeline"),n=e.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return me(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},t.prototype.emitDelegation=function(e,n){var i=this,a=n.propagationPath;this.getEvents();var o;e==="mouseenter"?o=n.fromShape:e==="mouseleave"&&(o=n.toShape);for(var s=function(c){var h=a[c],d=h.get("name");if(d){if((h.isGroup()||h.isCanvas&&h.isCanvas())&&o&&BT(h,o))return"break";gt(d)?me(d,function(v){i.emitDelegateEvent(h,v,n)}):u.emitDelegateEvent(h,d,n)}},u=this,f=0;f<a.length;f++){var l=s(f);if(l==="break")break}},t.prototype.emitDelegateEvent=function(e,n,i){var a=this.getEvents(),o=n+a8+i.type;(a[o]||a[o8])&&(i.name=o,i.currentTarget=e,i.delegateTarget=this,i.delegateObject=e.get("delegateObject"),this.emit(o,i))},t.prototype.translate=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.getMatrix(),a=xf(i,[["t",e,n]]);return this.setMatrix(a),this},t.prototype.move=function(e,n){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(e-i,n-a),this},t.prototype.moveTo=function(e,n){return this.move(e,n)},t.prototype.scale=function(e,n){var i=this.getMatrix(),a=xf(i,[["s",e,n||e]]);return this.setMatrix(a),this},t.prototype.rotate=function(e){var n=this.getMatrix(),i=xf(n,[["r",e]]);return this.setMatrix(i),this},t.prototype.rotateAtStart=function(e){var n=this.attr(),i=n.x,a=n.y,o=this.getMatrix(),s=xf(o,[["t",-i,-a],["r",e],["t",i,a]]);return this.setMatrix(s),this},t.prototype.rotateAtPoint=function(e,n,i){var a=this.getMatrix(),o=xf(a,[["t",-e,-n],["r",i],["t",e,n]]);return this.setMatrix(o),this},t}(Wz),QE={},j0="_INDEX";function jT(r,t){if(r.set("canvas",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){jT(n,t)})}}function UT(r,t){if(r.set("timeline",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){UT(n,t)})}}function c8(r,t,e){e===void 0&&(e=!0),e?t.destroy():(t.set("parent",null),t.set("canvas",null)),RT(r.getChildren(),t)}function h8(r){return function(t,e){var n=r(t,e);return n===0?t[j0]-e[j0]:n}}var $T=function(r){Ot(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isCanvas=function(){return!1},t.prototype.getBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?me(o,function(u){var f=u.getBBox(),l=f.minX,c=f.maxX,h=f.minY,d=f.maxY;l<e&&(e=l),c>n&&(n=c),h<i&&(i=h),d>a&&(a=d)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getCanvasBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?me(o,function(u){var f=u.getCanvasBBox(),l=f.minX,c=f.maxX,h=f.minY,d=f.maxY;l<e&&(e=l),c>n&&(n=c),h<i&&(i=h),d>a&&(a=d)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.children=[],e},t.prototype.onAttrChange=function(e,n,i){if(r.prototype.onAttrChange.call(this,e,n,i),e==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},t.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,e);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},t.prototype._applyChildrenMarix=function(e){var n=this.getChildren();me(n,function(i){i.applyMatrix(e)})},t.prototype.addShape=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1];bn(i)?a=i:a.type=i;var o=QE[a.type];o||(o=ku(a.type),QE[a.type]=o);var s=this.getShapeBase(),u=new s[o](a);return this.add(u),u},t.prototype.addGroup=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1],o;if(Cr(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},u=this.getGroupBase();o=new u(s)}return this.add(o),o},t.prototype.getCanvas=function(){var e;return this.isCanvas()?e=this:e=this.get("canvas"),e},t.prototype.getShape=function(e,n,i){if(!z0(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,e,n,i);else{var s=[e,n,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},t.prototype._findShape=function(e,n,i,a){for(var o=null,s=e.length-1;s>=0;s--){var u=e[s];if(z0(u)&&(u.isGroup()?o=u.getShape(n,i,a):u.isHit(n,i)&&(o=u)),o)break}return o},t.prototype.add=function(e){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=e.getParent();o&&c8(o,e,!1),e.set("parent",this),n&&jT(e,n),a&&UT(e,a),i.push(e),e.onCanvasChange("add"),this._applyElementMatrix(e)},t.prototype._applyElementMatrix=function(e){var n=this.getTotalMatrix();n&&e.applyMatrix(n)},t.prototype.getChildren=function(){return this.get("children")},t.prototype.sort=function(){var e=this.getChildren();me(e,function(n,i){return n[j0]=i,n}),e.sort(h8(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},t.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var e=this.getChildren(),n=e.length-1;n>=0;n--)e[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},t.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},t.prototype.getFirst=function(){return this.getChildByIndex(0)},t.prototype.getLast=function(){var e=this.getChildren();return this.getChildByIndex(e.length-1)},t.prototype.getChildByIndex=function(e){var n=this.getChildren();return n[e]},t.prototype.getCount=function(){var e=this.getChildren();return e.length},t.prototype.contain=function(e){var n=this.getChildren();return n.indexOf(e)>-1},t.prototype.removeChild=function(e,n){n===void 0&&(n=!0),this.contain(e)&&e.remove(n)},t.prototype.findAll=function(e){var n=[],i=this.getChildren();return me(i,function(a){e(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(e)))}),n},t.prototype.find=function(e){var n=null,i=this.getChildren();return me(i,function(a){if(e(a)?n=a:a.isGroup()&&(n=a.find(e)),n)return!1}),n},t.prototype.findById=function(e){return this.find(function(n){return n.get("id")===e})},t.prototype.findByClassName=function(e){return this.find(function(n){return n.get("className")===e})},t.prototype.findAllByName=function(e){return this.findAll(function(n){return n.get("name")===e})},t}(zT),Pu=0,zf=0,Ef=0,WT=1e3,Ed,jf,wd=0,As=0,hv=0,pl=typeof performance=="object"&&performance.now?performance:Date,XT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function YT(){return As||(XT(d8),As=pl.now()+hv)}function d8(){As=0}function U0(){this._call=this._time=this._next=null}U0.prototype=VT.prototype={constructor:U0,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?YT():+e)+(t==null?0:+t),!this._next&&jf!==this&&(jf?jf._next=this:Ed=this,jf=this),this._call=r,this._time=e,$0()},stop:function(){this._call&&(this._call=null,this._time=1/0,$0())}};function VT(r,t,e){var n=new U0;return n.restart(r,t,e),n}function v8(){YT(),++Pu;for(var r=Ed,t;r;)(t=As-r._time)>=0&&r._call.call(null,t),r=r._next;--Pu}function JE(){As=(wd=pl.now())+hv,Pu=zf=0;try{v8()}finally{Pu=0,g8(),As=0}}function p8(){var r=pl.now(),t=r-wd;t>WT&&(hv-=t,wd=r)}function g8(){for(var r,t=Ed,e,n=1/0;t;)t._call?(n>t._time&&(n=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:Ed=e);jf=r,$0(n)}function $0(r){if(!Pu){zf&&(zf=clearTimeout(zf));var t=r-As;t>24?(r<1/0&&(zf=setTimeout(JE,r-pl.now()-hv)),Ef&&(Ef=clearInterval(Ef))):(Ef||(wd=pl.now(),Ef=setInterval(p8,WT)),Pu=1,XT(JE))}}function Um(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function HT(r,t){var e=Object.create(r.prototype);for(var n in t)e[n]=t[n];return e}function Rl(){}var gl=.7,_d=1/gl,Cu="\\s*([+-]?\\d+)\\s*",yl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",da="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",y8=/^#([0-9a-f]{3,8})$/,m8=new RegExp("^rgb\\("+[Cu,Cu,Cu]+"\\)$"),b8=new RegExp("^rgb\\("+[da,da,da]+"\\)$"),x8=new RegExp("^rgba\\("+[Cu,Cu,Cu,yl]+"\\)$"),E8=new RegExp("^rgba\\("+[da,da,da,yl]+"\\)$"),w8=new RegExp("^hsl\\("+[yl,da,da]+"\\)$"),_8=new RegExp("^hsla\\("+[yl,da,da,yl]+"\\)$"),ew={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};Um(Rl,ml,{copy:function(r){return Object.assign(new this.constructor,this,r)},displayable:function(){return this.rgb().displayable()},hex:tw,formatHex:tw,formatHsl:S8,formatRgb:rw,toString:rw});function tw(){return this.rgb().formatHex()}function S8(){return KT(this).formatHsl()}function rw(){return this.rgb().formatRgb()}function ml(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=y8.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?nw(t):e===3?new ei(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Hc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Hc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=m8.exec(r))?new ei(t[1],t[2],t[3],1):(t=b8.exec(r))?new ei(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x8.exec(r))?Hc(t[1],t[2],t[3],t[4]):(t=E8.exec(r))?Hc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=w8.exec(r))?ow(t[1],t[2]/100,t[3]/100,1):(t=_8.exec(r))?ow(t[1],t[2]/100,t[3]/100,t[4]):ew.hasOwnProperty(r)?nw(ew[r]):r==="transparent"?new ei(NaN,NaN,NaN,0):null}function nw(r){return new ei(r>>16&255,r>>8&255,r&255,1)}function Hc(r,t,e,n){return n<=0&&(r=t=e=NaN),new ei(r,t,e,n)}function M8(r){return r instanceof Rl||(r=ml(r)),r?(r=r.rgb(),new ei(r.r,r.g,r.b,r.opacity)):new ei}function W0(r,t,e,n){return arguments.length===1?M8(r):new ei(r,t,e,n==null?1:n)}function ei(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}Um(ei,W0,HT(Rl,{brighter:function(r){return r=r==null?_d:Math.pow(_d,r),new ei(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=r==null?gl:Math.pow(gl,r),new ei(this.r*r,this.g*r,this.b*r,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:iw,formatHex:iw,formatRgb:aw,toString:aw}));function iw(){return"#"+gg(this.r)+gg(this.g)+gg(this.b)}function aw(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"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))+(r===1?")":", "+r+")")}function gg(r){return r=Math.max(0,Math.min(255,Math.round(r)||0)),(r<16?"0":"")+r.toString(16)}function ow(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new ra(r,t,e,n)}function KT(r){if(r instanceof ra)return new ra(r.h,r.s,r.l,r.opacity);if(r instanceof Rl||(r=ml(r)),!r)return new ra;if(r instanceof ra)return r;r=r.rgb();var t=r.r/255,e=r.g/255,n=r.b/255,i=Math.min(t,e,n),a=Math.max(t,e,n),o=NaN,s=a-i,u=(a+i)/2;return s?(t===a?o=(e-n)/s+(e<n)*6:e===a?o=(n-t)/s+2:o=(t-e)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new ra(o,s,u,r.opacity)}function C8(r,t,e,n){return arguments.length===1?KT(r):new ra(r,t,e,n==null?1:n)}function ra(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}Um(ra,C8,HT(Rl,{brighter:function(r){return r=r==null?_d:Math.pow(_d,r),new ra(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?gl:Math.pow(gl,r),new ra(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,i=2*e-n;return new ei(yg(r>=240?r-240:r+120,i,n),yg(r,i,n),yg(r<120?r+240:r-120,i,n),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 r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(r===1?")":", "+r+")")}}));function yg(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const $m=r=>()=>r;function A8(r,t){return function(e){return r+e*t}}function T8(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(n){return Math.pow(r+n*t,e)}}function I8(r){return(r=+r)==1?qT:function(t,e){return e-t?T8(t,e,r):$m(isNaN(t)?e:t)}}function qT(r,t){var e=t-r;return e?A8(r,e):$m(isNaN(r)?t:r)}const sw=function r(t){var e=I8(t);function n(i,a){var o=e((i=W0(i)).r,(a=W0(a)).r),s=e(i.g,a.g),u=e(i.b,a.b),f=qT(i.opacity,a.opacity);return function(l){return i.r=o(l),i.g=s(l),i.b=u(l),i.opacity=f(l),i+""}}return n.gamma=r,n}(1);function ZT(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(a){for(i=0;i<e;++i)n[i]=r[i]*(1-a)+t[i]*a;return n}}function QT(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function O8(r,t){return(QT(t)?ZT:JT)(r,t)}function JT(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=new Array(n),a=new Array(e),o;for(o=0;o<n;++o)i[o]=Sd(r[o],t[o]);for(;o<e;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function L8(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function X0(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function D8(r,t){var e={},n={},i;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in r?e[i]=Sd(r[i],t[i]):n[i]=t[i];return function(a){for(i in e)n[i]=e[i](a);return n}}var Y0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mg=new RegExp(Y0.source,"g");function k8(r){return function(){return r}}function P8(r){return function(t){return r(t)+""}}function N8(r,t){var e=Y0.lastIndex=mg.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",t=t+"";(n=Y0.exec(r))&&(i=mg.exec(t));)(a=i.index)>e&&(a=t.slice(e,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:X0(n,i)})),e=mg.lastIndex;return e<t.length&&(a=t.slice(e),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?P8(u[0].x):k8(t):(t=u.length,function(f){for(var l=0,c;l<t;++l)s[(c=u[l]).i]=c.x(f);return s.join("")})}function Sd(r,t){var e=typeof t,n;return t==null||e==="boolean"?$m(t):(e==="number"?X0:e==="string"?(n=ml(t))?(t=n,sw):N8:t instanceof ml?sw:t instanceof Date?L8:QT(t)?ZT:Array.isArray(t)?JT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?D8:X0)(r,t)}function R8(r){return+r}function B8(r){return r*r}function F8(r){return r*(2-r)}function uw(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function G8(r){return r*r*r}function z8(r){return--r*r*r+1}function fw(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var Wm=3,j8=function r(t){t=+t;function e(n){return Math.pow(n,t)}return e.exponent=r,e}(Wm),U8=function r(t){t=+t;function e(n){return 1-Math.pow(1-n,t)}return e.exponent=r,e}(Wm),lw=function r(t){t=+t;function e(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return e.exponent=r,e}(Wm),eI=Math.PI,tI=eI/2;function $8(r){return+r==1?1:1-Math.cos(r*tI)}function W8(r){return Math.sin(r*tI)}function cw(r){return(1-Math.cos(eI*r))/2}function Lo(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function X8(r){return Lo(1-+r)}function Y8(r){return 1-Lo(r)}function hw(r){return((r*=2)<=1?Lo(1-r):2-Lo(r-1))/2}function V8(r){return 1-Math.sqrt(1-r*r)}function H8(r){return Math.sqrt(1- --r*r)}function dw(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var V0=4/11,K8=6/11,q8=8/11,Z8=3/4,Q8=9/11,J8=10/11,ej=15/16,tj=21/22,rj=63/64,Kc=1/V0/V0;function nj(r){return 1-bl(1-r)}function bl(r){return(r=+r)<V0?Kc*r*r:r<q8?Kc*(r-=K8)*r+Z8:r<J8?Kc*(r-=Q8)*r+ej:Kc*(r-=tj)*r+rj}function ij(r){return((r*=2)<=1?1-bl(1-r):bl(r-1)+1)/2}var Xm=1.70158,aj=function r(t){t=+t;function e(n){return(n=+n)*n*(t*(n-1)+n)}return e.overshoot=r,e}(Xm),oj=function r(t){t=+t;function e(n){return--n*n*((n+1)*t+n)+1}return e.overshoot=r,e}(Xm),vw=function r(t){t=+t;function e(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return e.overshoot=r,e}(Xm),Nu=2*Math.PI,Ym=1,Vm=.3,sj=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Nu);function i(a){return t*Lo(- --a)*Math.sin((n-a)/e)}return i.amplitude=function(a){return r(a,e*Nu)},i.period=function(a){return r(t,a)},i}(Ym,Vm),pw=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Nu);function i(a){return 1-t*Lo(a=+a)*Math.sin((a+n)/e)}return i.amplitude=function(a){return r(a,e*Nu)},i.period=function(a){return r(t,a)},i}(Ym,Vm),uj=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Nu);function i(a){return((a=a*2-1)<0?t*Lo(-a)*Math.sin((n-a)/e):2-t*Lo(a)*Math.sin((n+a)/e))/2}return i.amplitude=function(a){return r(a,e*Nu)},i.period=function(a){return r(t,a)},i}(Ym,Vm);const fj=Object.freeze(Object.defineProperty({__proto__:null,easeBack:vw,easeBackIn:aj,easeBackInOut:vw,easeBackOut:oj,easeBounce:bl,easeBounceIn:nj,easeBounceInOut:ij,easeBounceOut:bl,easeCircle:dw,easeCircleIn:V8,easeCircleInOut:dw,easeCircleOut:H8,easeCubic:fw,easeCubicIn:G8,easeCubicInOut:fw,easeCubicOut:z8,easeElastic:pw,easeElasticIn:sj,easeElasticInOut:uj,easeElasticOut:pw,easeExp:hw,easeExpIn:X8,easeExpInOut:hw,easeExpOut:Y8,easeLinear:R8,easePoly:lw,easePolyIn:j8,easePolyInOut:lw,easePolyOut:U8,easeQuad:uw,easeQuadIn:B8,easeQuadInOut:uw,easeQuadOut:F8,easeSin:cw,easeSinIn:$8,easeSinInOut:cw,easeSinOut:W8},Symbol.toStringTag,{value:"Module"}));var lj={};function cj(r){return lj[r.toLowerCase()]||fj[r]}var hj=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},dj=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},gw=[1,0,0,0,1,0,0,0,1];function vj(r,t,e){var n={},i=t.fromAttrs,a=t.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!Oo(i[s],a[s]))if(s==="path"){var u=a[s],f=i[s];u.length>f.length?(u=wu(a[s]),f=wu(i[s]),f=kT(f,u),f=G0(f,u),t.fromAttrs.path=f,t.toAttrs.path=u):t.pathFormatted||(u=wu(a[s]),f=wu(i[s]),f=G0(f,u),t.fromAttrs.path=f,t.toAttrs.path=u,t.pathFormatted=!0),n[s]=[];for(var l=0;l<u.length;l++){for(var c=u[l],h=f[l],d=[],v=0;v<c.length;v++)ht(c[v])&&h&&ht(h[v])?(o=Sd(h[v],c[v]),d.push(o(e))):d.push(c[v]);n[s].push(d)}}else if(s==="matrix"){var p=O8(i[s]||gw,a[s]||gw),g=p(e);n[s]=g}else hj(s)&&dj(a[s])?n[s]=a[s]:Cr(a[s])||(o=Sd(i[s],a[s]),n[s]=o(e));r.attr(n)}}function pj(r,t,e){var n=t.startTime,i=t.delay;if(e<n+i||t._paused)return!1;var a,o=t.duration,s=t.easing,u=cj(s);if(e=e-n-t.delay,t.repeat)a=e%o/o,a=u(a);else if(a=e/o,a<1)a=u(a);else return t.onFrame?r.attr(t.onFrame(1)):r.attr(t.toAttrs),!0;if(t.onFrame){var f=t.onFrame(a);r.attr(f)}else vj(r,t,a);return!1}var gj=function(){function r(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return r.prototype.initTimer=function(){var t=this,e=!1,n,i,a;this.timer=VT(function(o){if(t.current=o,t.animators.length>0){for(var s=t.animators.length-1;s>=0;s--){if(n=t.animators[s],n.destroyed){t.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var u=i.length-1;u>=0;u--)a=i[u],e=pj(n,a,o),e&&(i.splice(u,1),e=!1,a.callback&&a.callback())}i.length===0&&t.removeAnimator(s)}var f=t.canvas.get("autoDraw");f||t.canvas.draw()}})},r.prototype.addAnimator=function(t){this.animators.push(t)},r.prototype.removeAnimator=function(t){this.animators.splice(t,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(t){t===void 0&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),yj=40,yw=0,mw=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function bw(r,t,e){e.name=t,e.target=r,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}function mj(r,t,e){if(e.bubbles){var n=void 0,i=!1;if(t==="mouseenter"?(n=e.fromShape,i=!0):t==="mouseleave"&&(i=!0,n=e.toShape),r.isCanvas()&&i)return;if(n&&BT(r,n)){e.bubbles=!1;return}e.name=t,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}}var bj=function(){function r(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;e._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&(e.dragging||e.currentShape)){var o=e._getPointInfo(n);e.dragging&&e._emitEvent("drag",n,o,e.draggingShape)}},this._onDocumentMouseUp=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&e.dragging){var o=e._getPointInfo(n);e.draggingShape&&e._emitEvent("drop",n,o,null),e._emitEvent("dragend",n,o,e.draggingShape),e._afterDrag(e.draggingShape,o,n)}},this.canvas=t.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");me(mw,function(n){e.addEventListener(n,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");me(mw,function(n){e.removeEventListener(n,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(t,e,n,i,a,o){var s=new NT(t,e);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},r.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),i=e.getPointByEvent(t);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),i=this._getShape(n,e),a=this["_on"+t],o=!1;if(a)a.call(this,n,i,e);else{var s=this.currentShape;t==="mouseenter"||t==="dragenter"||t==="mouseover"?(this._emitEvent(t,e,n,null,null,i),i&&this._emitEvent(t,e,n,i,null,i),t==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):t==="mouseleave"||t==="dragleave"||t==="mouseout"?(o=!0,s&&this._emitEvent(t,e,n,s,s,null),this._emitEvent(t,e,n,null,s,null),t==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var u=this.canvas,f=u.get("el");f.style.cursor=i.attr("cursor")||u.get("cursor")}},r.prototype._onmousedown=function(t,e,n){n.button===yw&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},r.prototype._emitMouseoverEvents=function(t,e,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",t,e,n,n,i),this._emitEvent("mouseleave",t,e,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",t,e,i,n,i),this._emitEvent("mouseenter",t,e,i,n,i)))},r.prototype._emitDragoverEvents=function(t,e,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,i),this._emitEvent("dragenter",t,e,i,n,i)),a||this._emitEvent("dragover",t,e,i)):n&&this._emitEvent("dragleave",t,e,n,n,i),a&&this._emitEvent("dragover",t,e,i)},r.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(e,n);i!==t&&this._emitMouseoverEvents(n,e,t,i),this.currentShape=i},r.prototype._onmouseup=function(t,e,n){if(n.button===yw){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,i),this._afterDrag(i,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(t,e,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,t,i,e,!0)},r.prototype._onmousemove=function(t,e,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,a,e,!1),this._emitEvent("drag",n,t,o);else{var s=this.mousedownPoint;if(s){var u=this.mousedownShape,f=n.timeStamp,l=f-this.mousedownTimeStamp,c=s.clientX-t.clientX,h=s.clientY-t.clientY,d=c*c+h*h;l>120||d>yj?u&&u.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)}},r.prototype._emitEvent=function(t,e,n,i,a,o){var s=this._getEventObj(t,e,n,i,a,o);if(i){s.shape=i,bw(i,t,s);for(var u=i.getParent();u;)u.emitDelegation(t,s),s.propagationStopped||mj(u,t,s),s.propagationPath.push(u),u=u.getParent()}else{var f=this.canvas;bw(f,t,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),xw="px",Ew=FT(),xj=Ew&&Ew.name==="firefox",rI=function(r){Ot(t,r);function t(e){var n=r.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},t.prototype.initContainer=function(){var e=this.get("container");Ne(e)&&(e=document.getElementById(e),this.set("container",e))},t.prototype.initDom=function(){var e=this.createDom();this.set("el",e);var n=this.get("container");n.appendChild(e),this.setDOMSize(this.get("width"),this.get("height"))},t.prototype.initEvents=function(){var e=new bj({canvas:this});e.init(),this.set("eventController",e)},t.prototype.initTimeline=function(){var e=new gj(this);this.set("timeline",e)},t.prototype.setDOMSize=function(e,n){var i=this.get("el");YE&&(i.style.width=e+xw,i.style.height=n+xw)},t.prototype.changeSize=function(e,n){this.setDOMSize(e,n),this.set("width",e),this.set("height",n),this.onCanvasChange("changeSize")},t.prototype.getRenderer=function(){return this.get("renderer")},t.prototype.getCursor=function(){return this.get("cursor")},t.prototype.setCursor=function(e){this.set("cursor",e);var n=this.get("el");YE&&n&&(n.style.cursor=e)},t.prototype.getPointByEvent=function(e){var n=this.get("supportCSSTransform");if(n){if(xj&&!ct(e.layerX)&&e.layerX!==e.offsetX)return{x:e.layerX,y:e.layerY};if(!ct(e.offsetX))return{x:e.offsetX,y:e.offsetY}}var i=this.getClientByEvent(e),a=i.x,o=i.y;return this.getPointByClient(a,o)},t.prototype.getClientByEvent=function(e){var n=e;return e.touches&&(e.type==="touchend"?n=e.changedTouches[0]:n=e.touches[0]),{x:n.clientX,y:n.clientY}},t.prototype.getPointByClient=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e-a.left,y:n-a.top}},t.prototype.getClientByPoint=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e+a.left,y:n+a.top}},t.prototype.draw=function(){},t.prototype.removeDom=function(){var e=this.get("el");e.parentNode.removeChild(e)},t.prototype.clearEvents=function(){var e=this.get("eventController");e.destroy()},t.prototype.isCanvas=function(){return!0},t.prototype.getParent=function(){return null},t.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},t}($T),nI=function(r){Ot(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isGroup=function(){return!0},t.prototype.isEntityGroup=function(){return!1},t.prototype.clone=function(){for(var e=r.prototype.clone.call(this),n=this.getChildren(),i=0;i<n.length;i++){var a=n[i];e.add(a.clone())}return e},t}($T),iI=function(r){Ot(t,r);function t(e){return r.call(this,e)||this}return t.prototype._isInBBox=function(e,n){var i=this.getBBox();return i.minX<=e&&i.maxX>=e&&i.minY<=n&&i.maxY>=n},t.prototype.afterAttrsChange=function(e){r.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},t.prototype.getBBox=function(){var e=this.cfg.bbox;return e||(e=this.calculateBBox(),this.set("bbox",e)),e},t.prototype.getCanvasBBox=function(){var e=this.cfg.canvasBBox;return e||(e=this.calculateCanvasBBox(),this.set("canvasBBox",e)),e},t.prototype.applyMatrix=function(e){r.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},t.prototype.calculateCanvasBBox=function(){var e=this.getBBox(),n=this.getTotalMatrix(),i=e.minX,a=e.minY,o=e.maxX,s=e.maxY;if(n){var u=ps(n,[e.minX,e.minY]),f=ps(n,[e.maxX,e.minY]),l=ps(n,[e.minX,e.maxY]),c=ps(n,[e.maxX,e.maxY]);i=Math.min(u[0],f[0],l[0],c[0]),o=Math.max(u[0],f[0],l[0],c[0]),a=Math.min(u[1],f[1],l[1],c[1]),s=Math.max(u[1],f[1],l[1],c[1])}var h=this.attrs;if(h.shadowColor){var d=h.shadowBlur,v=d===void 0?0:d,p=h.shadowOffsetX,g=p===void 0?0:p,y=h.shadowOffsetY,m=y===void 0?0:y,b=i-v+g,x=o+v+g,E=a-v+m,w=s+v+m;i=Math.min(i,b),o=Math.max(o,x),a=Math.min(a,E),s=Math.max(s,w)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},t.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},t.prototype.isClipShape=function(){return this.get("isClipShape")},t.prototype.isInShape=function(e,n){return!1},t.prototype.isOnlyHitBox=function(){return!1},t.prototype.isHit=function(e,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[e,n,1];o=this.invertFromMatrix(o);var s=o[0],u=o[1],f=this._isInBBox(s,u);return this.isOnlyHitBox()?f:!!(f&&!this.isClipped(s,u)&&(this.isInShape(s,u)||i&&i.isHit(s,u)||a&&a.isHit(s,u)))},t}(zT),aI=new Map;function Ea(r,t){aI.set(r,t)}function oI(r){return aI.get(r)}function sI(r){var t=r.attr(),e=t.x,n=t.y,i=t.width,a=t.height;return{x:e,y:n,width:i,height:a}}function uI(r){var t=r.attr(),e=t.x,n=t.y,i=t.r;return{x:e-i,y:n-i,width:i*2,height:i*2}}function Tn(r,t,e,n){var i=r-e,a=t-n;return Math.sqrt(i*i+a*a)}function Vh(r,t){return Math.abs(r-t)<.001}function Zu(r,t){var e=ga(r),n=ga(t),i=pa(r),a=pa(t);return{x:e,y:n,width:i-e,height:a-n}}function dv(r){return(r+Math.PI*2)%(Math.PI*2)}const mn={box:function(r,t,e,n){return Zu([r,e],[t,n])},length:function(r,t,e,n){return Tn(r,t,e,n)},pointAt:function(r,t,e,n,i){return{x:(1-i)*r+i*e,y:(1-i)*t+i*n}},pointDistance:function(r,t,e,n,i,a){var o=(e-r)*(i-r)+(n-t)*(a-t);if(o<0)return Tn(r,t,i,a);var s=(e-r)*(e-r)+(n-t)*(n-t);return o>s?Tn(e,n,i,a):this.pointToLine(r,t,e,n,i,a)},pointToLine:function(r,t,e,n,i,a){var o=[e-r,n-t];if(Im(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var s=[-o[1],o[0]];To(s,s);var u=[i-r,a-t];return Math.abs(Tm(u,s))},tangentAngle:function(r,t,e,n){return Math.atan2(n-t,e-r)}};var Ej=1e-4;function fI(r,t,e,n,i,a){var o,s=1/0,u=[e,n],f=20;a&&a>200&&(f=a/10);for(var l=1/f,c=l/10,h=0;h<=f;h++){var d=h*l,v=[i.apply(null,r.concat([d])),i.apply(null,t.concat([d]))],p=Tn(u[0],u[1],v[0],v[1]);p<s&&(o=d,s=p)}if(o===0)return{x:r[0],y:t[0]};if(o===1){var g=r.length;return{x:r[g-1],y:t[g-1]}}s=1/0;for(var h=0;h<32&&!(c<Ej);h++){var y=o-c,m=o+c,v=[i.apply(null,r.concat([y])),i.apply(null,t.concat([y]))],p=Tn(u[0],u[1],v[0],v[1]);if(y>=0&&p<s)o=y,s=p;else{var b=[i.apply(null,r.concat([m])),i.apply(null,t.concat([m]))],x=Tn(u[0],u[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,t.concat([o]))}}function wj(r,t){for(var e=0,n=r.length,i=0;i<n;i++){var a=r[i],o=t[i],s=r[(i+1)%n],u=t[(i+1)%n];e+=Tn(a,o,s,u)}return e/2}function bo(r,t,e,n){var i=1-n;return i*i*r+2*n*i*t+n*n*e}function ww(r,t,e){var n=r+e-2*t;if(Vh(n,0))return[.5];var i=(r-t)/n;return i<=1&&i>=0?[i]:[]}function _w(r,t,e,n){return 2*(1-n)*(t-r)+2*n*(e-t)}function lI(r,t,e,n,i,a,o){var s=bo(r,e,i,o),u=bo(t,n,a,o),f=mn.pointAt(r,t,e,n,o),l=mn.pointAt(e,n,i,a,o);return[[r,t,f.x,f.y,s,u],[s,u,l.x,l.y,i,a]]}function H0(r,t,e,n,i,a,o){if(o===0)return(Tn(r,t,e,n)+Tn(e,n,i,a)+Tn(r,t,i,a))/2;var s=lI(r,t,e,n,i,a,.5),u=s[0],f=s[1];return u.push(o-1),f.push(o-1),H0.apply(null,u)+H0.apply(null,f)}const cI={box:function(r,t,e,n,i,a){var o=ww(r,e,i)[0],s=ww(t,n,a)[0],u=[r,i],f=[t,a];return o!==void 0&&u.push(bo(r,e,i,o)),s!==void 0&&f.push(bo(t,n,a,s)),Zu(u,f)},length:function(r,t,e,n,i,a){return H0(r,t,e,n,i,a,3)},nearestPoint:function(r,t,e,n,i,a,o,s){return fI([r,e,i],[t,n,a],o,s,bo)},pointDistance:function(r,t,e,n,i,a,o,s){var u=this.nearestPoint(r,t,e,n,i,a,o,s);return Tn(u.x,u.y,o,s)},interpolationAt:bo,pointAt:function(r,t,e,n,i,a,o){return{x:bo(r,e,i,o),y:bo(t,n,a,o)}},divide:function(r,t,e,n,i,a,o){return lI(r,t,e,n,i,a,o)},tangentAngle:function(r,t,e,n,i,a,o){var s=_w(r,e,i,o),u=_w(t,n,a,o),f=Math.atan2(u,s);return dv(f)}};function xo(r,t,e,n,i){var a=1-i;return a*a*a*r+3*t*i*a*a+3*e*i*i*a+n*i*i*i}function Sw(r,t,e,n,i){var a=1-i;return 3*(a*a*(t-r)+2*a*i*(e-t)+i*i*(n-e))}function bg(r,t,e,n){var i=-3*r+9*t-9*e+3*n,a=6*r-12*t+6*e,o=3*t-3*r,s=[],u,f,l;if(Vh(i,0))Vh(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var c=a*a-4*i*o;Vh(c,0)?s.push(-a/(2*i)):c>0&&(l=Math.sqrt(c),u=(-a+l)/(2*i),f=(-a-l)/(2*i),u>=0&&u<=1&&s.push(u),f>=0&&f<=1&&s.push(f))}return s}function hI(r,t,e,n,i,a,o,s,u){var f=xo(r,e,i,o,u),l=xo(t,n,a,s,u),c=mn.pointAt(r,t,e,n,u),h=mn.pointAt(e,n,i,a,u),d=mn.pointAt(i,a,o,s,u),v=mn.pointAt(c.x,c.y,h.x,h.y,u),p=mn.pointAt(h.x,h.y,d.x,d.y,u);return[[r,t,c.x,c.y,v.x,v.y,f,l],[f,l,p.x,p.y,d.x,d.y,o,s]]}function K0(r,t,e,n,i,a,o,s,u){if(u===0)return wj([r,e,i,o],[t,n,a,s]);var f=hI(r,t,e,n,i,a,o,s,.5),l=f[0],c=f[1];return l.push(u-1),c.push(u-1),K0.apply(null,l)+K0.apply(null,c)}const qf={extrema:bg,box:function(r,t,e,n,i,a,o,s){for(var u=[r,o],f=[t,s],l=bg(r,e,i,o),c=bg(t,n,a,s),h=0;h<l.length;h++)u.push(xo(r,e,i,o,l[h]));for(var h=0;h<c.length;h++)f.push(xo(t,n,a,s,c[h]));return Zu(u,f)},length:function(r,t,e,n,i,a,o,s){return K0(r,t,e,n,i,a,o,s,3)},nearestPoint:function(r,t,e,n,i,a,o,s,u,f,l){return fI([r,e,i,o],[t,n,a,s],u,f,xo,l)},pointDistance:function(r,t,e,n,i,a,o,s,u,f,l){var c=this.nearestPoint(r,t,e,n,i,a,o,s,u,f,l);return Tn(c.x,c.y,u,f)},interpolationAt:xo,pointAt:function(r,t,e,n,i,a,o,s,u){return{x:xo(r,e,i,o,u),y:xo(t,n,a,s,u)}},divide:function(r,t,e,n,i,a,o,s,u){return hI(r,t,e,n,i,a,o,s,u)},tangentAngle:function(r,t,e,n,i,a,o,s,u){var f=Sw(r,e,i,o,u),l=Sw(t,n,a,s,u);return dv(Math.atan2(l,f))}};function Mw(r,t){var e=Math.abs(r);return t>0?e:e*-1}const _j={box:function(r,t,e,n){return{x:r-e,y:t-n,width:e*2,height:n*2}},length:function(r,t,e,n){return Math.PI*(3*(e+n)-Math.sqrt((3*e+n)*(e+3*n)))},nearestPoint:function(r,t,e,n,i,a){var o=e,s=n;if(o===0||s===0)return{x:r,y:t};for(var u=i-r,f=a-t,l=Math.abs(u),c=Math.abs(f),h=o*o,d=s*s,v=Math.PI/4,p,g,y=0;y<4;y++){p=o*Math.cos(v),g=s*Math.sin(v);var m=(h-d)*Math.pow(Math.cos(v),3)/o,b=(d-h)*Math.pow(Math.sin(v),3)/s,x=p-m,E=g-b,w=l-m,_=c-b,M=Math.hypot(E,x),C=Math.hypot(_,w),S=M*Math.asin((x*_-E*w)/(M*C)),A=S/Math.sqrt(h+d-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+Mw(p,u),y:t+Mw(g,f)}},pointDistance:function(r,t,e,n,i,a){var o=this.nearestPoint(r,t,e,n,i,a);return Tn(o.x,o.y,i,a)},pointAt:function(r,t,e,n,i){var a=2*Math.PI*i;return{x:r+e*Math.cos(a),y:t+n*Math.sin(a)}},tangentAngle:function(r,t,e,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-e*Math.sin(a));return dv(o)}};function Sj(r,t,e,n,i,a,o,s){return-1*e*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function Mj(r,t,e,n,i,a,o,s){return-1*e*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function Cj(r,t,e){return Math.atan(-t/r*Math.tan(e))}function Aj(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function Cw(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function Aw(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function Tj(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function Tw(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function Iw(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}const Ij={box:function(r,t,e,n,i,a,o){for(var s=Cj(e,n,i),u=1/0,f=-1/0,l=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var h=s+c;a<o?a<h&&h<o&&l.push(h):o<h&&h<a&&l.push(h)}for(var c=0;c<l.length;c++){var d=Cw(r,t,e,n,i,l[c]);d<u&&(u=d),d>f&&(f=d)}for(var v=Aj(e,n,i),p=1/0,g=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var m=v+c;a<o?a<m&&m<o&&y.push(m):o<m&&m<a&&y.push(m)}for(var c=0;c<y.length;c++){var b=Aw(r,t,e,n,i,y[c]);b<p&&(p=b),b>g&&(g=b)}return{x:u,y:p,width:f-u,height:g-p}},length:function(r,t,e,n,i,a,o){},nearestPoint:function(r,t,e,n,i,a,o,s,u){var f=Iw(s-r,u-t,-i),l=f[0],c=f[1],h=_j.nearestPoint(0,0,e,n,l,c),d=Tj(e,n,h.x,h.y);d<a?h=Tw(e,n,a):d>o&&(h=Tw(e,n,o));var v=Iw(h.x,h.y,i);return{x:v[0]+r,y:v[1]+t}},pointDistance:function(r,t,e,n,i,a,o,s,u){var f=this.nearestPoint(r,t,e,n,s,u);return Tn(f.x,f.y,s,u)},pointAt:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a;return{x:Cw(r,t,e,n,i,u),y:Aw(r,t,e,n,i,u)}},tangentAngle:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a,f=Sj(r,t,e,n,i,a,o,u),l=Mj(r,t,e,n,i,a,o,u);return dv(Math.atan2(l,f))}};function dI(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=Tn(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};e.push(s),t+=o}return{segments:e,totalLength:t}}function Oj(r){if(r.length<2)return 0;for(var t=0,e=0;e<r.length-1;e++){var n=r[e],i=r[e+1];t+=Tn(n[0],n[1],i[0],i[1])}return t}function Lj(r,t){if(t>1||t<0||r.length<2)return null;var e=dI(r),n=e.segments,i=e.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s<n.length;s++){var u=n[s],f=u.from,l=u.to,c=u.length/i;if(t>=a&&t<=a+c){var h=(t-a)/c;o=mn.pointAt(f[0],f[1],l[0],l[1],h);break}a+=c}return o}function Dj(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=dI(r),n=e.segments,i=e.totalLength,a=0,o=0,s=0;s<n.length;s++){var u=n[s],f=u.from,l=u.to,c=u.length/i;if(t>=a&&t<=a+c){o=Math.atan2(l[1]-f[1],l[0]-f[0]);break}a+=c}return o}function kj(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=mn.pointDistance(a[0],a[1],o[0],o[1],t,e);s<n&&(n=s)}return n}const vI={box:function(r){for(var t=[],e=[],n=0;n<r.length;n++){var i=r[n];t.push(i[0]),e.push(i[1])}return Zu(t,e)},length:function(r){return Oj(r)},pointAt:function(r,t){return Lj(r,t)},pointDistance:function(r,t,e){return kj(r,t,e)},tangentAngle:function(r,t){return Dj(r,t)}};function Ow(r,t){return!r||!t?r||t:{minX:Math.min(r.minX,t.minX),minY:Math.min(r.minY,t.minY),maxX:Math.max(r.maxX,t.maxX),maxY:Math.max(r.maxY,t.maxY)}}function Hm(r,t){var e=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return e&&(i=e.getCanvasBBox(),t=Ow(t,i)),n&&(a=n.getCanvasBBox(),t=Ow(t,a)),t}function Pj(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}var s=Zu(n,i),u=s.x,f=s.y,l=s.width,c=s.height,h={minX:u,minY:f,maxX:u+l,maxY:f+c};return h=Hm(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function Nj(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}return Zu(n,i)}var xg=null;function pI(){if(!xg){var r=document.createElement("canvas");r.width=1,r.height=1,xg=r.getContext("2d")}return xg}function gI(r,t,e){var n=1;if(Ne(r)&&(n=r.split(`
|
|
3
3
|
`).length),n>1){var i=Rj(t,e);return t*n+i*(n-1)}return t}function Rj(r,t){return t?t-r:r*.14}function Bj(r,t){var e=pI(),n=0;if(ct(r)||r==="")return n;if(e.save(),e.font=t,Ne(r)&&r.includes(`
|
|
4
4
|
`)){var i=r.split(`
|
|
@@ -667,4 +667,4 @@ class CalcAveMovement {
|
|
|
667
667
|
</div>
|
|
668
668
|
`).concat(h,`
|
|
669
669
|
</div>`)}},t.prototype.init=function(){var e=this;if(!e.destroyed){var n=e.get("graph"),i=n.getContainer(),a=e.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),i.appendChild(a)):a=i,this.set("container",a);var s=i.getBoundingClientRect(),u=new $a({container:i,width:s.right-s.left,height:s.bottom-s.top});Xt(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",Nl(function(){return e.resizeCanvas(e)},100));var f=u.addGroup({id:"annotation-link-group"});e.set("linkGroup",f),e.set("canvas",u),e.get("getTitle")||e.set("getTitle",function(c){var h,d=((h=c==null?void 0:c.getModel)===null||h===void 0?void 0:h.call(c))||{},v=d.label,p=d.id;return v||p||"-"}),e.get("getContent")||e.set("getContent",function(c){var h,d;if(!c)return"-";var v=((h=c.getModel)===null||h===void 0?void 0:h.call(c))||{},p=v.label,g=v.id,y=(d=c.getType)===null||d===void 0?void 0:d.call(c),m=y?"".concat(y,": "):"";return"".concat(m).concat(p||g||"")});var l=e.get("defaultData");l&&this.readData(l)}},t.prototype.createContainer=function(){var e=this;if(!this.destroyed){var n=this.get("containerCfg"),i=this.get("graph"),a=i.getContainer(),o=a.getBoundingClientRect(),s=o.left,u=o.right,f=o.top,l=o.bottom,c=l-f,h=u-s,d=n.position,v=d===void 0?"top":d,p=n.offsetX,g=p===void 0?0:p,y=n.offsetY,m=y===void 0?0:y,b=IM(n,["position","offsetX","offsetY"]),x=n.height,E=x===void 0?"fit-content":x,w=n.width,_=w===void 0?i.getWidth():w;E==="100%"&&(E=c),_==="100%"&&(_=h);var M="unset",C="unset",S={};switch(v){case"right":M="".concat(c,"px"),S={top:0,right:0},S.right+=s+g,S.top+=f+m;break;case"bottom":C="".concat(h,"px"),S={bottom:0,left:0},S.left+=s+g,S.bottom+=f+m;break;case"top":C="".concat(h,"px");case"left":M="".concat(c,"px");default:S={top:0,left:0},S.left+=s+g,S.top+=f+m;break}Object.keys(S).forEach(function(T){S[T]="".concat(S[T],"px")});var A=wr("<div class='".concat(n.className," g6-annotation-container'></div>"));return Xt(A,hi(hi({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:ht(_)?"".concat(_,"px"):_,height:ht(E)?"".concat(E,"px"):E,maxHeight:M,maxWidth:C,overflow:"scroll"},S),b)),a.appendChild(A),A.addEventListener("scroll",function(T){e.updateLinks()}),A}},t.prototype.resizeCanvas=function(e){clearTimeout(e.resizeTimer),e.resizeTimer=setTimeout(function(){if(!(!e||e.destroyed)){var n=e.get("container").getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top;e.get("canvas").changeSize(i,a),e.updateOutsideCards(e)}},250)},t.prototype.updateOutsideCards=function(e){var n=e||this,i=n.get("cardInfoMap")||{},a=n.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),u=a.getClientByPoint(o.x,o.y),f=u.x,l=u.y,c=a.getClientByPoint(s.x,s.y),h=c.x,d=c.y;Object.values(i).forEach(function(v){var p=v.card;if(p){var g=p.style,y=us(g.left),m=us(g.top),b=p.getBoundingClientRect(),x=b.width,E=b.height,w=y,_=m;y+x>h-f&&(w=h-f-x),y<0&&(w=0),m+E>d-l&&(_=d-l-E),m<0&&(_=0),Xt(p,{left:"".concat(w,"px"),top:"".concat(_,"px")})}}),n.updateLinks()},t.prototype.showAnnotation=function(e){if(!this.destroyed){var n=e.item;this.toggleAnnotation(n)}},t.prototype.hideCards=function(){var e=this;if(!e.destroyed){var n=e.get("cardInfoMap")||{};Object.keys(n).forEach(function(i){e.hideCard(i)})}},t.prototype.toggleAnnotation=function(e,n){var i,a;n===void 0&&(n={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},u=o.get("graph"),f=o.get("container"),l=o.get("containerCfg"),c=Object.assign({},o.get("cardCfg")||{},n),h=c.minHeight,d=c.minWidth,v=c.width,p=c.height,g=c.collapsed,y=g===void 0?!1:g,m=c.x,b=c.y,x=c.title,E=c.content,w=c.maxTitleLength,_=c.defaultBegin,M=IM(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),C=o.get("linkGroup"),S=this.get("rows")||[[]],A=(i=e.isCanvas)===null||i===void 0?void 0:i.call(e),T=A?OM:e.getID(),I=s[T]||{},D=I.card,N=I.link,P=I.x,G=I.y,W=I.title,k=I.content,R=this.get("getTitle"),Y=this.get("getContent"),J=this.get("getContentPlaceholder")||function(){return""},te=this.get("getTitlePlaceHolder")||function(){return""},H=J(e),pe=te(e),Ae=wr(this.getDOMContent(hi({itemId:T,collapsed:y,title:((a=W||x||(R==null?void 0:R(e)))===null||a===void 0?void 0:a.substr(0,w))||pe,content:k||E||(Y==null?void 0:Y(e))||H},M))),Le=ht(h)?"".concat(h,"px"):h;Xt(Ae,{minHeight:y?"unset":Le,minWidth:ht(d)?"".concat(d,"px"):d,height:p,width:v});var qe=!!D;qe?(N==null||N.remove(!0),f.replaceChild(Ae,D)):f.appendChild(Ae);var at;if(!l){if(at=f.getBoundingClientRect()||{},m!==void 0&&b!==void 0)P=m,G=b;else if(!qe&&!A){var rt=at.top,xt=_||{},Et=xt.left,ur=xt.right,Bt=ur===void 0?16:ur,Ut=xt.top,dr=Ut===void 0?8:Ut,fr=xt.bottom,Gt=Bt,Jt=dr;isNaN(Et)||(Gt=f.scrollWidth-Et),isNaN(fr)||(Jt=f.scrollHeight-fr);var Rr=ht(d)?d:100;P=f.scrollWidth-Ae.scrollWidth-(S.length-1)*Rr-Gt;var tt=S[S.length-1],ie=(tt[tt.length-1]||{}).bbox;G=(ie==null?void 0:ie.bottom)-rt||Jt}Xt(Ae,{position:"absolute",left:"".concat(P,"px"),top:"".concat(G,"px"),cusor:l?"unset":"move"})}this.bindListener(Ae,T);var L=Ae.getBoundingClientRect();if(!A){var _e=w0(e,L,u,this.get("canvas")),Be=this.get("linkStyle");N=C.addShape("path",{attrs:hi({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:_e},Be)})}if(s[T]=hi(hi({},s[T]||{}),{id:T,collapsed:y,card:Ae,link:N,x:P,y:G,cardBBox:L,content:k||E,title:W||x,contentPlaceholder:H,titlePlaceholder:pe,isCanvas:A}),o.set("cardInfoMap",s),l)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ye=!isNaN(m)&&!isNaN(b);if(!qe&&!A&&!ye){var $e=at.bottom,We=$e===void 0?0:$e,rt=at.top;S[S.length-1].push({id:T,bbox:L}),L.top>We-rt-L.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(T);var Ke=this.get("onAnnotationChange");Ke==null||Ke(s[T],qe?"update":"create")}},t.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=this.get("container"),i=this.get("containerCfg").position,a=n.getBoundingClientRect().width,o=getComputedStyle(n),s=us(o.paddingLeft)+us(o.paddingRight);a-=s,Object.values(e).forEach(function(u){var f=u.card,l=f.getBoundingClientRect().width;switch(i){case"right":Xt(f,{marginLeft:a?"".concat(a-l,"px"):"0px"});break;case"top":case"bottom":Xt(f,{marginLeft:"8px"})}})}}},t.prototype.handleExpandCollapseCard=function(e){if(!this.destroyed){var n=this.get("graph"),i=this.get("cardInfoMap");if(i){var a=i[e].collapsed,o=n.findById(e);if(o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(e):this.toggleAnnotation(o,{collapsed:!a}),i[e]=hi(hi({},i[e]),{collapsed:!a})}}}},t.prototype.hideCard=function(e){if(!this.destroyed){var n=this.get("cardInfoMap");if(!(!n||!n[e])){var i=n[e],a=i.card,o=i.link;Xt(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(n[e],"hide")}}},t.prototype.removeCard=function(e){if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=n[e],a=i.card,o=i.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete n[e];var u=this.get("onAnnotationChange");u(i,"remove")}}},t.prototype.bindListener=function(e,n){var i=this;if(!this.destroyed){e.addEventListener("mousemove",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var l=i.get("cardCfg").onMouseEnterIcon,c=l===void 0?function(){}:l;c(u,n,f)}}),e.addEventListener("mouseout",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var l=i.get("cardCfg").onMouseLeaveIcon,c=l===void 0?function(){}:l;c(u,n,f)}}),e.addEventListener("mouseenter",function(u){var f=i.get("cardInfoMap");if(f){var l=i.get("graph"),c=l.findById(n);if(c){var h=i.get("itemHighlightState");l.setItemState(c,h,!0)}var d=f[n].link;if(d){var v=i.get("linkHighlightStyle")||{};d.attr(v)}}}),e.addEventListener("mouseleave",function(u){var f=i.get("cardInfoMap");if(f){var l=i.get("graph"),c=l.findById(n);if(c){var h=i.get("itemHighlightState");l.setItemState(c,h,!1)}var d=f[n].link;if(d){var v=i.get("linkHighlightStyle")||{};Object.keys(v).forEach(function(g){d.attr(g,void 0),d.attr(g,void 0)});var p=i.get("linkStyle");d.attr(p)}}}),e.addEventListener("click",function(u){var f=(i.get("cardCfg")||{}).onClickIcon;if(u.target.className==="g6-annotation-collapse"||u.target.className==="g6-annotation-expand"){var l=i.get("cardCfg").collapseType;l==="hide"?i.hideCard(n):i.handleExpandCollapseCard(n),f==null||f(u,n,u.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(u.target.className==="g6-annotation-close"){var c=i.get("cardCfg").closeType;c==="remove"?i.removeCard(n):i.hideCard(n),f==null||f(u,n,"close")}});var a=this.get("editable");a&&e.addEventListener("dblclick",function(u){var f=i.get("cardInfoMap"),l=(i.get("cardCfg")||{}).maxTitleLength,c=l===void 0?20:l;if(f){var h=u.target,d=h.className;if(!(d!=="g6-annotation-title"&&d!=="g6-annotation-content")){var v=d==="g6-annotation-title"?h.getBoundingClientRect():h.parentNode.getBoundingClientRect(),p=v.width,g=v.height,y=getComputedStyle(h),m=d==="g6-annotation-title"?"input":"textarea",b=wr("<".concat(m,' class="').concat(d,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),x=wr('<div class="'.concat(d,'-input-wrapper" style="width: ').concat(p,"px; height: ").concat(g,"px; min-width: 16px; margin-right: ").concat(y.marginRight,'" />'));x.appendChild(b),h.parentNode.replaceChild(x,h);var E=f[n],w=E.contentPlaceholder,_=E.titlePlaceholder,M=E.content,C=E.title,S=M;d==="g6-annotation-title"?(b.name="title",b.maxLength=c,S=C):b.name="content",S?(b.innerHTML=h.innerHTML,b.value=h.innerHTML):b.placeholder=d==="g6-annotation-title"?_:w,b.focus(),b.addEventListener("blur",function(A){b.value&&(h.innerHTML=b.value,E[b.name||"title"]=b.value),x.parentNode.replaceChild(h,x),i.updateCardSize(n);var T=i.get("onAnnotationChange");T==null||T(E,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];e.draggable=!0,e.addEventListener("dragstart",function(u){var f=u.target.className;if(!o.includes(f)){var l=e.style;i.set("dragging",{card:e,x:u.clientX,y:u.clientY,left:us(l.left),top:us(l.top)})}}),e.addEventListener("drag",function(u){u.preventDefault();var f=i.get("cardInfoMap");if(f){var l=u.clientX,c=u.clientY,h=i.get("dragging");if(!(isNaN(l)||isNaN(c)||!h)){var d=h.x,v=h.y,p=h.left,g=h.top,y=h.card,m=l-d,b=c-v;p+=m,g+=b;var x=i.get("graph"),E=x.getPointByCanvas(0,0),w=x.getPointByCanvas(x.getWidth(),x.getHeight()),_=x.getClientByPoint(E.x,E.y),M=_.x,C=_.y,S=x.getClientByPoint(w.x,w.y),A=S.x,T=S.y,I=y.getBoundingClientRect(),D=I.right-I.left,N=I.bottom-I.top;(p>A-M-D&&m>0||p<0&&m<0)&&(p-=m),(g>T-C-N&&b>0||g<0&&b<0)&&(g-=b),Xt(y,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),d=l,v=c;var P=(f[n]||{}).link;if(P){var G=x.findById(n);P.attr("path",w0(G,I,x,i.get("canvas")))}i.set("dragging",{x:d,y:v,left:p,top:g,card:y})}}});var s=function(f){var l=i.get("cardInfoMap");if(l){var c=i.get("dragging");if(c){var h=c.left,d=c.top,v=c.card;l[n].x=h,l[n].y=d,Xt(v,{visibility:"visible"}),i.set("dragging",!1);var p=i.get("rows");p==null||p.forEach(function(y){for(var m=y.length-1;m>=0;m--)y[m].id===n&&y.splice(m,1)});var g=i.get("onAnnotationChange");g==null||g(l[n],"update")}}};e.addEventListener("dragend",s)}},t.prototype.updateCardSize=function(e){var n=this.get("cardInfoMap");if(n){var i=n[e].card,a=i.getBoundingClientRect().width,o=i.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),u=us(s.marginLeft),f=o.getBoundingClientRect().width;Xt(o,{marginRight:"".concat(a-u-24-16-f,"px")})}}},t.prototype.updateLink=function(e){var n=e.item;if(n){var i=this.get("cardInfoMap");if(i){var a=this.get("canvas"),o=this.get("graph"),s=n.getID(),u=i[s]||{},f=u.link,l=u.card;if(f){var c=w0(n,l.getBoundingClientRect(),o,a);f.attr("path",c)}}}},t.prototype.updateLinks=function(){var e=this;if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=i.findById(o);e.updateLink({item:s})})}}},t.prototype.onGraphDataChange=function(){var e=this,n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=a.card,u=a.isCanvas;if(!(!s||u||s.style.display==="none")){var f=i.findById(o);f&&f.isVisible()?e.toggleAnnotation(f):e.hideCard(o)}})}},t.prototype.onGraphItemVisibilityChange=function(e){var n=e.item,i=e.visible;if(!(!n||n.destroyed)){var a=this.get("cardInfoMap");if(a){var o=n.getID();a[o]&&(i||this.hideCard(o))}}},t.prototype.saveData=function(e){e===void 0&&(e=!1);var n=this.get("cardInfoMap");if(n){var i=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(n).forEach(function(u){var f=u.title,l=u.content,c=u.x,h=u.y,d=u.id,v=u.collapsed,p=u.card;if(!(p&&p.style.display==="none"&&!e)){var g=i.findById(d)||i.get("canvas");s.push({id:d,x:c,y:h,collapsed:v,title:f||(a==null?void 0:a(g)),content:l||(o==null?void 0:o(g)),visible:p&&p.style.display!=="none"})}}),s}},t.prototype.readData=function(e){var n=this,i=this.get("graph");e.forEach(function(a){var o=a.id,s=a.x,u=a.y,f=a.title,l=a.content,c=a.collapsed,h=a.visible,d=i.findById(o);if(!d&&o===OM&&(d=i.get("canvas")),!d){var v=n.get("cardInfoMap")||{};v[o]=a,n.set("cardInfoMap",v);return}n.toggleAnnotation(d,{x:s,y:u,title:f,content:l,collapsed:c}),h||n.hideCard(o)})},t.prototype.clear=function(){var e=this.get("cardInfoMap");if(e){var n=this.get("container");Object.values(e).forEach(function(i){var a=i.card,o=i.link;n.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},t.prototype.destroy=function(){var e;this.clear(),(e=this.get("canvas"))===null||e===void 0||e.destroy();var n=this.get("graph");!n||n.destroyed||(this.get("containerCfg")&&n.getContainer().removeChild(this.get("container")),this.destroyed=!0)},t}(jn);const khe=Dhe;var Phe=function(t,e){var n,i,a=1/0;Object.keys(t).forEach(function(u){var f=t[u];Object.keys(e).forEach(function(l){var c=e[l],h=f.x-c.x,d=f.y-c.y,v=h*h+d*d;a>v&&(a=v,n=f,i=c)})});var o=20,s=_n.getControlPoint(n,i,.5,o);return[["M",n.x,n.y],["Q",s.x,s.y,i.x,i.y]]},w0=function(t,e,n,i){var a,o,s=t.getType();if(s==="edge")o=[t.getKeyShape().getPoint(.5)];else{var u=(a=t.getKeyShape)===null||a===void 0?void 0:a.call(t).getBBox(),f=u.minX,l=u.minY,c=u.maxX,h=u.maxY,d=t.getModel(),v=d.x,p=d.y;f+=v,l+=p,c+=v,h+=p,o={left:{x:f,y:(l+h)/2},right:{x:c,y:(l+h)/2},top:{x:(f+c)/2,y:l},bottom:{x:(f+c)/2,y:h}}}Object.keys(o).forEach(function(C){var S=o[C],A=S.x,T=S.y,I=n.getClientByPoint(A,T);o[C]=i.getPointByClient(I.x,I.y)});var g=e.top,y=g===void 0?0:g,m=e.left,b=m===void 0?0:m,x=e.right,E=x===void 0?0:x,w=e.bottom,_=w===void 0?0:w,M={left:i.getPointByClient(b,(y+_)/2),right:i.getPointByClient(E,(y+_)/2),top:i.getPointByClient((b+E)/2,y),bottom:i.getPointByClient((b+E)/2,_)};return Phe(o,M)},us=function(t){return Number(t.replace(/\s+|px/gi,""))||0},qn={PluginBase:jn,Menu:ile,Grid:Qfe,Minimap:cle,Bundling:ple,ToolBar:wle,Tooltip:Mle,Fisheye:mle,TimeBar:hhe,ImageMinimap:yhe,EdgeFilterLens:Ehe,SnapLine:Che,Legend:Ohe,Annotation:khe};Za("circle",{options:{size:Je.defaultNode.size,style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=mr({},i,t.icon),s="".concat(this.type,"-keyShape"),u=e.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});e.shapeMap[s]=u;var f=o.width,l=o.height,c=o.show,h=o.text;if(c){var d="".concat(this.type,"-icon");h?e.shapeMap[d]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):e.shapeMap[d]=e.addShape("image",{attrs:F({x:-f/2,y:-l/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints;if(n){var i=n||{},a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=sn(i,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0]/2;if(o){var v="link-point-left";e.shapeMap[v]=e.addShape("circle",{attrs:F(F({},c),{x:-d,y:0,r:f/2||l||5}),className:v,name:v,isAnchorPoint:!0})}if(s){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:F(F({},c),{x:d,y:0,r:f/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(a){var g="link-point-top";e.shapeMap[g]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-d,r:f/2||l||5}),className:g,name:g,isAnchorPoint:!0})}if(u){var y="link-point-bottom";e.shapeMap[y]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:d,r:f/2||l||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=mr({},e,n),a=this.getSize(t),o=a[0]/2,s=F({x:0,y:0,r:o},i);return s},update:function(t,e,n){var i=e.getContainer(),a=this.getSize(t),o=F({},t.style);t.style.stroke===void 0&&t.color&&(o.stroke=t.color),t.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(t,e,o,!0,n),this.updateLinkPoints(t,i)}},"single-node");Za("rect",{options:{size:[100,30],style:{radius:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),i=e.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=sn(i,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],v=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getSize(t),o=i.width||a[0],s=i.height||a[1],u=F({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getSize(t),s=e.get("keyShape");t.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var u={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},f=yt({},a,s.attr(),u);f=yt(f,t.style),this.updateShape(t,e,f,!1,n),this.updateLinkPoints(t,i)}},"single-node");Za("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=sn(i,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0]/2,v=h[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-d,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:d,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getSize(t),o=a[0]/2,s=a[1]/2,u=F({x:0,y:0,rx:o,ry:s},i);return u},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getSize(t),s={stroke:t.color,rx:o[0]/2,ry:o[1]/2},u=e.get("keyShape"),f=yt({},a,u.attr(),s);f=yt(f,t.style),this.updateShape(t,e,f,!0,n),this.updateLinkPoints(t,i)}},"single-node");Za("diamond",{options:{size:[80,80],style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=sn(i,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],v=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),n=e[0],i=e[1],a=[["M",0,-i/2],["L",n/2,0],["L",0,i/2],["L",-n/2,0],["Z"]];return a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),f=yt({},a,u.attr(),s);f=yt(f,t.style),this.updateShape(t,e,f,!0,n),this.updateLinkPoints(t,i)}},"single-node");Za("triangle",{options:{size:40,direction:"up",style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.icon,a=i===void 0?{}:i,o=n.direction,s=this.getShapeStyle(t),u=t.direction||o,f=e.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=f;var l=a.width,c=a.height,h=a.show,d=a.offset,v=a.text;if(h)if(v)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-l/2,g=-c/2;(u==="up"||u==="down")&&(g+=d),(u==="left"||u==="right")&&(p+=d),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:p,y:g},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),f},drawLinkPoints:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.linkPoints,a=i===void 0?{}:i,o=n.direction,s=t.direction||o,u=a.top,f=a.left,l=a.right,c=a.bottom,h=a.size,d=a.r,v=sn(a,["top","left","right","bottom","size","r"]),p=this.getSize(t),g=p[0];if(f){var y=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?y=[-b,m]:s==="down"?y=[-b,-m]:s==="left"&&(y=[-b,b-m]),y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},v),{x:y[0],y:y[1],r:h/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var x=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?x=[b,m]:s==="down"?x=[b,-m]:s==="right"&&(x=[b,b-m]),x&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},v),{x:x[0],y:x[1],r:h/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var E=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?E=[b-m,-m]:s==="left"?E=[b,-m]:s==="right"&&(E=[-b,-m]),E&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},v),{x:E[0],y:E[1],r:h/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="down"?w=[-b+m,m]:s==="left"?w=[b,m]:s==="right"&&(w=[-b,m]),w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},v),{x:w[0],y:w[1],r:h/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,n=t.direction||e,i=this.getSize(t),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),u=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return n==="down"?u=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:n==="left"?u=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:n==="right"&&(u=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),u},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),f=yt({},a,u.attr(),s);f=yt(f,t.style),this.updateShape(t,e,f,!0,n),this.updateLinkPoints(t,i)},updateLinkPoints:function(t,e){var n=this.getOptions({}),i=n.linkPoints,a=n.direction,o=t.direction||a,s=e.shapeMap["link-point-left"]||e.find(function(P){return P.get("className")==="link-point-left"}),u=e.shapeMap["link-point-right"]||e.find(function(P){return P.get("className")==="link-point-right"}),f=e.shapeMap["link-point-top"]||e.find(function(P){return P.get("className")==="link-point-top"}),l=e.shapeMap["link-point-bottom"]||e.find(function(P){return P.get("className")==="link-point-bottom"}),c=i,h=s||u||f||l;h&&(c=h.attr());var d=yt({},c,t.linkPoints),v=d.fill,p=d.stroke,g=d.lineWidth,y=d.size/2;y||(y=d.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},b=m.left,x=m.right,E=m.top,w=m.bottom,_=this.getSize(t),M=_[0],C={r:y,fill:v,stroke:p,lineWidth:g},S=null,A=M*Math.sin(1/3*Math.PI),T=M*Math.sin(1/3*Math.PI);o==="up"?S=[-T,A]:o==="down"?S=[-T,-A]:o==="left"&&(S=[-T,T-A]),S&&(s?!b&&b!==void 0?(s.remove(),delete e.shapeMap["link-point-left"]):s.attr(F(F({},C),{x:S[0],y:S[1]})):b&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},C),{x:S[0],y:S[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var I=null;o==="up"?I=[T,A]:o==="down"?I=[T,-A]:o==="right"&&(I=[T,T-A]),I&&(u?!x&&x!==void 0?(u.remove(),delete e.shapeMap["link-point-right"]):u.attr(F(F({},C),{x:I[0],y:I[1]})):x&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},C),{x:I[0],y:I[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var D=null;o==="up"?D=[T-A,-A]:o==="left"?D=[T,-A]:o==="right"&&(D=[-T,-A]),D&&(f?!E&&E!==void 0?(f.remove(),delete e.shapeMap["link-point-top"]):f.attr(F(F({},C),{x:D[0],y:D[1]})):E&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},C),{x:D[0],y:D[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var N=null;o==="down"?N=[-T+A,A]:o==="left"?N=[T,A]:o==="right"&&(N=[-T,A]),N&&(l?!w&&w!==void 0?(l.remove(),delete e.shapeMap["link-point-bottom"]):l.attr(F(F({},C),{x:N[0],y:N[1]})):w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},C),{x:N[0],y:N[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");Za("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Je.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Je.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Je.windowFontFamily},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.mergeStyle||this.getOptions(t)).preRect,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=this.getSize(t),s=o[0],u=o[1],f=e.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=f;var l=i.show,c=sn(i,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:F({x:-s/2,y:-u/2,height:u},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),f},drawLogoIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).logoIcon,i=n===void 0?{}:n,a=this.getSize(t),o=a[0];if(i.show){var s=i.width,u=i.height,f=i.x,l=i.y,c=i.offset,h=i.text,d=sn(i,["width","height","x","y","offset","text"]);h?e.shapeMap["rect-logo-icon"]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.shapeMap["rect-logo-icon"]=e.addShape("image",{attrs:F(F({},d),{x:f||-o/2+s+c,y:l||-u/2,width:s,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).stateIcon,i=n===void 0?{}:n,a=this.getSize(t),o=a[0];if(i.show){var s=i.width,u=i.height,f=i.x,l=i.y,c=i.offset,h=i.text,d=sn(i,["width","height","x","y","offset","text"]);h?e.shapeMap["rect-state-icon"]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.shapeMap["rect-state-icon"]=e.addShape("image",{attrs:F(F({},d),{x:f||o/2-s+c,y:l||-u/2,width:s,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,f=i.size,l=i.r,c=sn(i,["top","left","right","bottom","size","r"]),h=this.getSize(t),d=h[0],v=h[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-d/2,y:0,r:f/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:d/2,y:0,r:f/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:f/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:f/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var n=this.getOptions(t),i=n.labelCfg,a=i===void 0?{}:i,o=n.logoIcon,s=o===void 0?{}:o,u=n.descriptionCfg,f=u===void 0?{}:u,l=this.getSize(t),c=l[0],h=null,d=s.show,v=s.width,p=-c/2+a.offset;d&&(p=-c/2+v+a.offset);var g=a.style,y=f.style,m=f.paddingTop;return Ne(t.description)?(h=e.addShape("text",{attrs:F(F({},g),{x:p,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=h,e.shapeMap["rect-description"]=e.addShape("text",{attrs:F(F({},y),{x:p,y:17+(m||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(h=e.addShape("text",{attrs:F(F({},g),{x:p,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=h),h},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getSize(t),o=i.width||a[0],s=i.height||a[1],u=F({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.style,a=i===void 0?{}:i,o=n.labelCfg,s=o===void 0?{}:o,u=n.descriptionCfg,f=u===void 0?{}:u,l=this.getSize(t),c=l[0],h=l[1],d=e.get("keyShape");d.attr(F(F({},a),{x:-c/2,y:-h/2,width:c,height:h}));var v=e.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(Ae){return Ae.get("className")==="rect-logo-icon"}),g=p?p.attr():{},y=yt({},g,t.logoIcon),m=y.width;m===void 0&&(m=this.options.logoIcon.width);var b=t.logoIcon?t.logoIcon.show:void 0,x=s.offset,E=-c/2+m+x;!b&&b!==void 0&&(E=-c/2+x);var w=v.shapeMap["node-label"]||v.find(function(Ae){return Ae.get("className")==="node-label"}),_=v.shapeMap["rect-description"]||v.find(function(Ae){return Ae.get("className")==="rect-description"});if(t.label)if(!w)v.shapeMap["node-label"]=v.addShape("text",{attrs:F(F({},s.style),{x:E,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var M=t.labelCfg?t.labelCfg.style:{},C=yt({},w.attr(),M);t.label&&(C.text=t.label),C.x=E,Ne(t.description)&&(C.y=-5),_&&(_.resetMatrix(),_.attr({x:E})),w.resetMatrix(),w.attr(C)}if(Ne(t.description)){var S=f.paddingTop;if(!_)v.shapeMap["rect-description"]=v.addShape("text",{attrs:F(F({},f.style),{x:E,y:17+(S||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var M=t.descriptionCfg?t.descriptionCfg.style:{},A=yt({},_.attr(),M);Ne(t.description)&&(A.text=t.description),A.x=E,_.resetMatrix(),_.attr(F(F({},A),{y:17+(S||0)}))}}var T=v.shapeMap["pre-rect"]||v.find(function(Ae){return Ae.get("className")==="pre-rect"});if(T&&!T.destroyed){var I=yt({},T.attr(),t.preRect);T.attr(F(F({},I),{x:-c/2,y:-h/2,height:h}))}if(p&&!p.destroyed)if(!b&&b!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var D=y.width,N=y.height,P=y.x,G=y.y,W=y.offset,k=sn(y,["width","height","x","y","offset"]);p.attr(F(F({},k),{x:P||-c/2+D+W,y:G||-N/2,width:D,height:N}))}else b&&this.drawLogoIcon(t,v);var R=v.shapeMap["rect-state-icon"]||v.find(function(Ae){return Ae.get("className")==="rect-state-icon"}),Y=R?R.attr():{},J=yt({},Y,t.stateIcon);if(R){!J.show&&J.show!==void 0&&(R.remove(),delete v.shapeMap["rect-state-icon"]);var te=J.width,N=J.height,P=J.x,G=J.y,H=J.offset,pe=sn(J,["width","height","x","y","offset"]);R.attr(F(F({},pe),{x:P||c/2-te+H,y:G||-N/2,width:te,height:N}))}else J.show&&this.drawStateIcon(t,v);this.updateLinkPoints(t,v)},getOptions:function(t,e){return e==="move"?t:mr({},this.options,this.getCustomConfig(t)||{},t)}},"single-node");Za("star",{options:{size:60,style:{stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,f=i.show,l=i.text;return f&&(l?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.leftBottom,f=i.rightBottom,l=i.size,c=i.r,h=sn(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(t),v=d[0];if(s){var p=Math.cos(.1*Math.PI)*v,g=Math.sin((18+72*0)/180*Math.PI)*v;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var p=Math.cos(.5*Math.PI)*v,g=Math.sin((18+72*1)/180*Math.PI)*v;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var p=Math.cos(.9*Math.PI)*v,g=Math.sin((18+72*2)/180*Math.PI)*v;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(u){var p=Math.cos(1.3*Math.PI)*v,g=Math.sin((18+72*3)/180*Math.PI)*v;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(f){var p=Math.cos(1.7*Math.PI)*v,g=Math.sin((18+72*4)/180*Math.PI)*v;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:F(F({},h),{x:p,y:-g,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t),n=e[0],i=n*3/8,a=t.innerR||i;return _n.getStarPath(n,a)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=yt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),f=yt({},a,u.attr(),s);f=yt(f,t.style),this.updateShape(t,e,f,!0,n),this.updateLinkPoints(t,i)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,i=e.shapeMap["link-point-left"]||e.find(function(A){return A.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(A){return A.get("className")==="link-point-right"}),o=e.shapeMap["link-point-top"]||e.find(function(A){return A.get("className")==="link-point-top"}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(A){return A.get("className")==="link-point-left-bottom"}),u=e.shapeMap["link-point-left-bottom"]||e.find(function(A){return A.get("className")==="link-point-right-bottom"}),f=n,l=i||a||o||s||u;l&&(f=l.attr());var c=yt({},f,t.linkPoints),h=c.fill,d=c.stroke,v=c.lineWidth,p=c.size/2;p||(p=c.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=g.left,m=g.right,b=g.top,x=g.leftBottom,E=g.rightBottom,w=this.getSize(t),_=w[0],M={r:p,fill:h,stroke:d,lineWidth:v},C=Math.cos((18+72*0)/180*Math.PI)*_,S=Math.sin((18+72*0)/180*Math.PI)*_;a?!m&&m!==void 0?(a.remove(),delete e.shapeMap["link-point-right"]):a.attr(F(F({},M),{x:C,y:-S})):m&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),C=Math.cos((18+72*1)/180*Math.PI)*_,S=Math.sin((18+72*1)/180*Math.PI)*_,o?!b&&b!==void 0?(o.remove(),delete e.shapeMap["link-point-top"]):o.attr(F(F({},M),{x:C,y:-S})):b&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),C=Math.cos((18+72*2)/180*Math.PI)*_,S=Math.sin((18+72*2)/180*Math.PI)*_,i?!y&&y!==void 0?(i.remove(),delete e.shapeMap["link-point-left"]):i.attr(F(F({},M),{x:C,y:-S})):y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),C=Math.cos((18+72*3)/180*Math.PI)*_,S=Math.sin((18+72*3)/180*Math.PI)*_,s?!x&&x!==void 0?(s.remove(),delete e.shapeMap["link-point-left-bottom"]):s.attr(F(F({},M),{x:C,y:-S})):x&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),C=Math.cos((18+72*4)/180*Math.PI)*_,S=Math.sin((18+72*4)/180*Math.PI)*_,u?!E&&E!==void 0?(u.remove(),delete e.shapeMap["link-point-right-bottom"]):u.attr(F(F({},M),{x:C,y:-S})):E&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var LM=_n.defaultSubjectColors,ul="fan-shape-";Za("donut",{options:{size:Je.defaultNode.size,style:{x:0,y:0,stroke:Je.defaultNode.style.stroke,fill:Je.defaultNode.style.fill,lineWidth:Je.defaultNode.style.lineWidth},labelCfg:{style:{fill:Je.nodeLabel.style.fill,fontSize:Je.nodeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Je.defaultNode.linkPoints.size,lineWidth:Je.defaultNode.linkPoints.lineWidth,fill:Je.defaultNode.linkPoints.fill,stroke:Je.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:F({},Je.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=mr({},i,t.icon),s=e.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=s;var u=o.width,f=o.height,l=o.show,c=o.text;return l&&(c?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-u/2,y:-f/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Nhe(t,e,s),this.drawLinkPoints(t,e),s},updateShape:function(t,e,n,i,a){var o=e.get("keyShape");o.attr(F({},n)),Rhe(t,e,o),this.updateLabel(t,e,a),i&&this.updateIcon(t,e)}},"circle");var Nhe=function(t,e,n){var i=t.donutAttrs,a=i===void 0?{}:i,o=t.donutColorMap,s=o===void 0?{}:o,u=Object.keys(a).length;if(a&&u>1){var f=EP(a,s),l=f.configs,c=f.totalValue;if(c){var h=wP(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0;if(u===1){nm(e,{arcR:v,arcBegin:p,beginAngle:g,config:l[0],fanIndex:0,lineWidth:d,totalValue:c,drawWhole:!0});return}for(var y=0;y<l.length;y++){var m=nm(e,{arcR:v,arcBegin:p,beginAngle:g,config:l[y],fanIndex:y,lineWidth:d,totalValue:c});if(m.shouldEnd)return;p=m.arcBegin,g=m.beginAngle}}}},nm=function(t,e){var n=e.arcR,i=e.arcBegin,a=e.beginAngle,o=e.config,s=e.fanIndex,u=e.lineWidth,f=e.totalValue,l=e.drawWhole,c=l===void 0?!1:l,h=e.updateShape,d=h===void 0?void 0:h,v=o.value/f;if(v<.001)return{beginAngle:a,arcBegin:i,shape:void 0,shouldEnd:!1};var p,g,y;if(c||v>.999)p=[n,1e-4],y=1;else{var m=v*Math.PI*2;g=a+m,p=[n*Math.cos(g),-n*Math.sin(g)],y=m>Math.PI?1:0}var b={path:[["M",i[0],i[1]],["A",n,n,0,y,0,p[0],p[1]]],stroke:o.color||(d==null?void 0:d.attr("stroke"))||LM[s%LM.length],lineWidth:u};return d?d.attr(b):t.shapeMap["".concat(ul).concat(s)]=t.addShape("path",{attrs:b,name:"".concat(ul).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:t.shapeMap["".concat(ul).concat(s)],shouldEnd:c||v>.999}},Rhe=function(t,e,n){var i=t.donutAttrs,a=t.donutColorMap,o=a===void 0?{}:a,s={},u=e.getContainer();if(i){var f=EP(i,o),l=f.configs,c=f.totalValue;if(c)for(var h=wP(n),d=h.lineWidth,v=h.arcR,p=[v,0],g=0,y=0;y<l.length;y++){var m="".concat(ul).concat(y),b=nm(u,{arcR:v,arcBegin:p,beginAngle:g,config:l[y],fanIndex:y,lineWidth:d,totalValue:c,drawWhole:l.length===1,updateShape:u.shapeMap[m]});if(b.shape&&(s[m]=!0),b.shouldEnd)break;p=b.arcBegin,g=b.beginAngle}}var x=Object.keys(u.shapeMap).filter(function(E){return E.includes(ul)});x.forEach(function(E){s[E]||(u.shapeMap[E].remove(!0),delete u.shapeMap[E])})},EP=function(t,e){var n=0,i=[];return Object.keys(t).forEach(function(a){var o=+t[a];isNaN(o)||(i.push({key:a,value:o,color:e[a]}),n+=o)}),{totalValue:n,configs:i}},wP=function(t){var e=t.attr("r"),n=.6*e,i=(e+n)/2,a=e-n;return{lineWidth:a,arcR:i}},Dh=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}},Bhe=function(t){t===void 0&&(t=[]);var e=[],n=[];t.forEach(function(u){e.push(u.x),n.push(u.y)});var i=Math.min.apply(Math,e),a=Math.max.apply(Math,e),o=Math.min.apply(Math,n),s=Math.max.apply(Math,n);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}},Cb=function(t){for(var e=[],n={},i=t.length,a=i-1;a>=0;a--){var o=t[a];o.id="".concat(o.x,"|||").concat(o.y),n[o.id]||(n[o.id]=o,e.push(o))}return e},_P=function(t){return Cb(t)},rv=function(t,e){return t.width||t.height?{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}:t},Fhe=function(t,e){var n=Math.abs(t.x-e.centerX),i=Math.abs(t.y-e.centerY);return n===0&&i===0?0:n/e.width>i/e.height},im=function(t,e,n){var i=Fhe(e,t);if(i===0){var a=t.centerX,o=t.centerY;return n.y<e.y?o=t.minY:n.x>e.x?a=t.maxX:n.x<e.x?a=t.minX:n.x===e.x&&(o=t.maxY),{x:a,y:o}}return i?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},DM=function(t,e){var n=Math.min(t.minX,e.minX),i=Math.min(t.minY,e.minY),a=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+a)/2,centerY:(i+o)/2,minX:n,minY:i,maxX:a,maxY:o,height:o-i,width:a-n}},am=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},kh=function(t,e){var n=t.x,i=t.y;return n<e.minX||n>e.maxX||i<e.minY||i>e.maxY},Ghe=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},zhe=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},jhe=function(t,e){return Ghe(t,e.x).concat(zhe(t,e.y))},kl=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Uhe=function(t,e){var n=-2,i=0;return e.forEach(function(a){a&&(t.x===a.x&&(i+=n),t.y===a.y&&(i+=n))}),i},kM=function(t,e,n,i,a){return kl(t,e)+kl(t,n)+Uhe(t,[e,n,i,a])},$he=function r(t,e,n,i,a){a===void 0&&(a=0),t.unshift(e[i]),n[i]&&n[i]!==i&&a<=100&&r(t,e,n,n[i],a+1)},Ph=function(t,e,n,i){var a=n.x-t.x,o=n.y-t.y,s=i.x-t.x,u=i.y-t.y,f=n.x-e.x,l=n.y-e.y,c=i.x-e.x,h=i.y-e.y,d=a*u-o*s,v=f*h-l*c,p=a*l-o*f,g=s*h-u*c;return d*v<=0&&p*g<=0},om=function(t,e,n){if(n.width||n.height){var i=am(n),a=i[0],o=i[1],s=i[2],u=i[3];return Ph(t,e,a,o)||Ph(t,e,a,u)||Ph(t,e,o,s)||Ph(t,e,s,u)}return!1},Whe=function(t,e,n,i){var a=[];return t.forEach(function(o){if(o!==e&&(o.x===e.x||o.y===e.y)){if(om(o,e,n)||om(o,e,i))return;a.push(o)}}),Cb(a)},Xhe=function(t,e,n,i,a,o,s){var u,f=[],l=(u={},u[e.id]=e,u),c={},h={},d={};h[e.id]=0,d[e.id]=kM(e,n,e);var v=new MP;v.add({id:e.id,value:d[e.id]});var p={};t.forEach(function(E){p[E.id]=E});for(var g;Object.keys(l).length;){var y=v.minId(!1);if(y)g=l[y];else break;if(g===n){var m=[];return $he(m,p,c,n.id),m}delete l[g.id],v.remove(g.id),f.push(g);var b=Whe(t,g,i,a),x=function(w){w.forEach(function(_){if(f.indexOf(_)===-1){var M=_.id;l[M]||(l[M]=_);var C=d[g.id]+kl(g,_);if(h[M]&&C>=h[M]){v.add({id:M,value:d[M]});return}c[M]=g.id,h[M]=C,d[M]=h[M]+kM(_,n,e,o,s),v.add({id:M,value:d[M]})}})};x(b)}return[e,n]},Yhe=function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)},Vhe=function(t,e,n,i){var a=kl(t,e),o=kl(n,e);a<i&&(i=a),o<i&&(i=o);var s={x:e.x-i/a*(e.x-t.x),y:e.y-i/a*(e.y-t.y)},u={x:e.x-i/o*(e.x-n.x),y:e.y-i/o*(e.y-n.y)};return[s,u]},PM=function(t,e){var n=[],i=t[0];return n.push("M".concat(i.x," ").concat(i.y)),t.forEach(function(a,o){var s=t[o+1],u=t[o+2];if(s&&u)if(Yhe(a,s,u)){var f=Vhe(a,s,u,e),l=f[0],c=f[1];n.push("L".concat(l.x," ").concat(l.y)),n.push("Q".concat(s.x," ").concat(s.y," ").concat(c.x," ").concat(c.y)),n.push("L".concat(c.x," ").concat(c.y))}else n.push("L".concat(s.x," ").concat(s.y));else s&&n.push("L".concat(s.x," ").concat(s.y))}),n.join("")},SP=function(t,e,n,i,a){var o,s;if(!n||!n.getType())o=Dh(t);else if(n.getType()==="combo"){var u=n.getKeyShape().getBBox();if(u){var f=n.getModel(),l=f.x,c=f.y;o={x:l,y:c,width:u.width,height:u.height,minX:u.minX+l,maxX:u.maxX+l,minY:u.minY+c,maxY:u.maxY+c},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=Dh(t)}else o=n&&n.getBBox();if(!i||!i.getType())s=Dh(e);else if(i.getType()==="combo"){var h=i.getKeyShape().getBBox();if(h){var d=i.getModel(),v=d.x,p=d.y;s={x:v,y:p,width:h.width,height:h.height,minX:h.minX+v,maxX:h.maxX+v,minY:h.minY+p,maxY:h.maxY+p},s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2}else s=Dh(e)}else s=i&&i.getBBox();var g=rv(o,a),y=rv(s,a),m=im(g,t,e),b=im(y,e,t),x=Bhe([m,b]),E=DM(g,x),w=DM(y,x),_=[];_=_.concat(am(E)).concat(am(w));var M={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[x,E,w].forEach(function(S){_=_.concat(jhe(S,M).filter(function(A){return kh(A,g)&&kh(A,y)}))}),[{x:m.x,y:b.y},{x:b.x,y:m.y}].forEach(function(S){kh(S,g)&&kh(S,y)&&_.push(S)}),_.unshift(m),_.push(b),_=Cb(_);var C=Xhe(_,m,b,o,s,t,e);return C.unshift(t),C.push(e),_P(C)},Hhe=function(t){if(!(t!=null&&t.length))return t;for(var e=t[t.length-1],n={x:e.x,y:e.y},i=[e],a=[e],o=t.length-2;o>=0;o--){var s=t[o];if(s.x===n.x?i.push(s):(i=[s],n.x=s.x),s.y===n.y?a.push(s):(a=[s],n.y=s.y),i.length>2){var u=t.indexOf(i[1]);u>-1&&t.splice(u,1);continue}if(a.length>2){var u=t.indexOf(a[1]);u>-1&&t.splice(u,1)}}return t},MP=function(){function r(){this.arr=[],this.map={},this.arr=[],this.map={}}return r.prototype._innerAdd=function(t,e){for(var n=[0,e-1];n[1]-n[0]>1;){var i=Math.floor((n[0]+n[1])/2);if(this.arr[i].value>t.value)n[1]=i;else if(this.arr[i].value<t.value)n[0]=i;else{this.arr.splice(i,0,t),this.map[t.id]=!0;return}}this.arr.splice(n[1],0,t),this.map[t.id]=!0},r.prototype.add=function(t){delete this.map[t.id];var e=this.arr.length;if(!e){this.arr.push(t),this.map[t.id]=!0;return}if(this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)},r.prototype.remove=function(t){this.map[t]&&delete this.map[t]},r.prototype._clearAndGetMinId=function(){for(var t,e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},r.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},r.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},r}(),Khe=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},qhe=function(t,e,n,i,a){return _P(SP(t,e,n,i,a.offset))},Zhe={offset:20,maxAllowedDirectionChange:Math.PI/2,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:Khe,fallbackRoute:qhe},Ya=function(t,e){var n=Math.round(Math.abs(t/e)),i=t<0?-1:1;return n<0?0:i*n},Qhe=function(t,e,n){var i={};return t.forEach(function(a){if(a)for(var o=rv(a.getBBox(),n),s=Ya(o.minX,e);s<=Ya(o.maxX,e);s+=1)for(var u=Ya(o.minY,e);u<=Ya(o.maxY,e);u+=1)i["".concat(s,"|||").concat(u)]=!0}),i},_0=function(t,e){var n=e.x-t.x,i=e.y-t.y;return n||i?Math.atan2(i,n):0},NM=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},RM=function(t,e,n){for(var i=1/0,a=0,o=e.length;a<o;a++){var s=n(t,e[a]);s<i&&(i=s)}return i},BM=function(t,e,n,i,a){var o=[];if(!n)return[t];var s=a.directions,u=a.offset,f=n.getBBox(),l=e.x>f.minX&&e.x<f.maxX&&e.y>f.minY&&e.y<f.maxY,c=rv(f,u);for(var h in c)c[h]=Ya(c[h],a.gridSize);if(l){for(var d=0,v=s;d<v.length;d++)for(var p=v[d],g=[[{x:c.minX,y:c.minY},{x:c.maxX,y:c.minY}],[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY}],[{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}],[{x:c.minX,y:c.maxY},{x:c.maxX,y:c.maxY}]],h=0;h<4;h++){var y=g[h],m=_n.getLineIntersect(t,{x:t.x+p.stepX*c.width,y:t.y+p.stepY*c.height},y[0],y[1]);m&&!om(t,m,f)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var b=im(c,t,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},sm=function(t,e,n,i){var a=_0(t,e),o=n[t.id];if(!o){var s=_0(i,t);return NM(s,a)}var u=_0({x:o.x,y:o.y},t);return NM(u,a)},Jhe=function(t,e,n,i,a,o,s){var u=[i],f=i,l=t.id,c=t.x,h=t.y,d={x:c,y:h,id:l};sm(d,o,e,n)&&(f={x:o.x===i.x?i.x:d.x*s,y:o.y===i.y?i.y:d.y*s},u.unshift(f));for(var v=e[l];v&&v.id!==l;){var p={x:c,y:h,id:l},g={x:v.x,y:v.y,id:v.id},y=sm(g,p,e,n);y&&(f={x:g.x===p.x?f.x:g.x*s,y:g.y===p.y?f.y:g.y*s},u.unshift(f)),l=g.id,c=g.x,h=g.y,v=e[l]}return u[0].x=c===n.x?a.x:f.x,u[0].y=h===n.y?a.y:f.y,u.unshift(a),u},ede=function(t,e,n,i,a){if(isNaN(t.x)||isNaN(e.x))return[];var o=mr(Zhe,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,f=Qhe(o.obstacles.concat([n,i]),u,o.offset),l={x:Ya(t.x,u),y:Ya(t.y,u)},c={x:Ya(e.x,u),y:Ya(e.y,u)};t.id="".concat(l.x,"|||").concat(l.y),e.id="".concat(c.x,"|||").concat(c.y);var h=BM(l,t,n,c,o),d=BM(c,e,i,l,o);h.forEach(function(k){delete f[k.id]}),d.forEach(function(k){delete f[k.id]});for(var v={},p={},g={},y={},m={},b=new MP,x=0;x<h.length;x++){var E=h[x];v[E.id]=E,y[E.id]=0,m[E.id]=RM(E,d,o.distFunc),b.add({id:E.id,value:m[E.id]})}var w=o.maximumLoops,_,M,C,S,A,T,I=1/0,D={};for(d.forEach(function(k){D["".concat(k.x,"|||").concat(k.y)]=!0}),Object.keys(v).forEach(function(k){var R=v[k].id;m[R]<=I&&(I=m[R],_=v[R])});Object.keys(v).length>0&&w>0;){var N=b.minId((w+1)%30===0);if(N)_=v[N];else break;if(D["".concat(_.x,"|||").concat(_.y)])return Jhe(_,g,l,e,t,c,u);delete v[_.id],b.remove(_.id),p[_.id]=!0;for(var x=0;x<o.directions.length;x++){M=o.directions[x];var P="".concat(Math.round(_.x)+M.stepX,"|||").concat(Math.round(_.y)+M.stepY);if(C={x:_.x+M.stepX,y:_.y+M.stepY,id:P},!p[P]&&(T=sm(_,C,g,l),!(T>o.maxAllowedDirectionChange)&&!f[P])){v[P]||(v[P]=C);var G=s[T];S=o.distFunc(_,C)+(isNaN(G)?u:G),A=y[_.id]+S;var W=y[P];W&&A>=W||(g[P]=_,y[P]=A,m[P]=A+RM(C,d,o.distFunc),b.add({id:P,value:m[P]}))}}w-=1}return o.fallbackRoute(t,e,n,i,o)};UI("polyline",{options:{color:Je.defaultEdge.color,size:Je.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Je.defaultEdge.style.stroke,lineAppendWidth:Je.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Je.edgeLabel.style.fill,fontSize:Je.edgeLabel.style.fontSize,fontFamily:Je.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:F({},Je.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);n.radius===0&&delete n.radius;var i=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=i,i},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},i=yt({},e,n,t.style);t=this.getPathPoints(t),this.radius=i.radius,this.offset=i.offset;var a=t.startPoint,o=t.endPoint,s=this.getControlPoints(t),u=[a];s&&(u=u.concat(s)),u.push(o);var f=t.sourceNode,l=t.targetNode,c=i.radius,h=this.options.routeCfg,d=yt({},h,t.routeCfg);d.offset=i.offset;var v=this.getPath(u,f,l,c,d,!s);(gt(v)&&v.length<=1||Ne(v)&&v.indexOf("L")===-1)&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(v="M0 0, L0 0");var p=yt({},Je.defaultEdge.style,i,{lineWidth:t.size,path:v});return p},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var i={stroke:t.color},a=n.shapeMap["edge-shape"]||n.find(function(x){return x.get("className")==="edge-shape"})||e.getKeyShape(),o=t.size;t=this.getPathPoints(t);var s=t.startPoint,u=t.endPoint,f=this.getControlPoints(t),l=[s];f&&(l=l.concat(f)),l.push(u);var c=a.attr(),h=yt({},i,c,t.style),d=t.sourceNode,v=t.targetNode,p=h.radius,g=this.options.routeCfg,y=yt({},g,t.routeCfg);y.offset=h.offset;var m=this.getPath(l,d,v,p,y,!f);(gt(m)&&m.length<=1||Ne(m)&&m.indexOf("L")===-1)&&(m="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(m="M0 0, L0 0"),c.endArrow&&h.endArrow===!1&&(t.style.endArrow={path:""}),c.startArrow&&h.startArrow===!1&&(t.style.startArrow={path:""});var b=yt(i,a.attr(),{lineWidth:o,path:m},t.style);a&&a.attr(b)}},getPath:function(t,e,n,i,a,o){var s=a.offset,u=a.obstacles,f=a.simple;if(!s||t.length>2||o===!1){if(i)return PM(t,i);var l=[];return me(t,function(v,p){p===0?l.push(["M",v.x,v.y]):l.push(["L",v.x,v.y])}),l}f!==!1&&!(u!=null&&u.length)&&(f=!0);var c=f?SP(t[t.length-1],t[0],n,e,s):ede(t[0],t[t.length-1],e,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var h=PM(c,i);return h}c=Hhe(c);var d=_n.pointsToPolygon(c);return d}},"single-edge");var FM=no.cloneEvent,GM=no.isNaN,zM=Math.abs,tde=10,rde=["shift","ctrl","alt","control"];const nde={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,i=+t.clientY;if(!(GM(n)||GM(i))){var a=n-e.x,o=i-e.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:n,y:i};var s=this.graph.get("width"),u=this.graph.get("height"),f=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l=s*l,c=u*c),(f.minX<=s+l&&f.minX+a>s+l||f.maxX+l>=0&&f.maxX+l+a<0)&&(a=0),(f.minY<=u+c&&f.minY+o>u+c||f.maxY+c>=0&&f.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(t){var e=this,n=t.originalEvent.touches,i=n[0],a=n[1];i&&a||(t.preventDefault(),this.mousedown=!0,e.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,n=t.originalEvent;if(!(n&&t.name!=="touchstart"&&n.button!==0)&&!(t.name!=="touchstart"&&typeof window<"u"&&window.event&&!window.event.buttons&&!window.event.button)&&this.shouldBegin(t,this)&&!e.keydown&&this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var i=this.graph,a=i.getEdges(),o=0,s=a.length;o<s;o++){var u=a[o].get("group").get("children");u&&u.forEach(function(b){b.set("ori-visibility",b.get("ori-visibility")||b.get("visible")),b.hide()})}for(var f=i.getNodes(),l=0,c=f.length;l<c;l++)for(var h=f[l].getContainer(),d=h.get("children"),v=0,p=d;v<p.length;v++){var g=p[v],y=g.get("isKeyShape");y||(g.set("ori-visibility",g.get("ori-visibility")||g.get("visible")),g.hide())}}if(typeof window<"u"){var m=this;this.handleDOMContextMenu=function(b){return m.onMouseUp(b)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(t){var e=this,n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a){this.onMouseUp(t);return}t.preventDefault(),e.onDrag(t)},onDrag:function(t){if(this.mousedown){var e=this.graph;if(!this.keydown&&this.allowDrag(t)&&(t=FM(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(zM(this.origin.x-t.clientX)+zM(this.origin.y-t.clientY)<tde)return;this.shouldBegin(t,this)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.originPosition={x:t.clientX,y:t.clientY},this.dragging=!0)}this.shouldUpdate(t,this)&&this.updateViewport(t)}}},onMouseUp:function(t){var e,n;this.mousedown=!1,this.dragstart=!1;var i=this.graph;if(!this.keydown){var a=i.getZoom(),o=i.get("modeController"),s=(n=(e=o==null?void 0:o.modes[o.mode])===null||e===void 0?void 0:e.filter(function(_){return _.type==="zoom-canvas"}))===null||n===void 0?void 0:n[0],u=s?s.optimizeZoom||.1:0;if(this.enableOptimize){for(var f=i.getEdges(),l=0,c=f.length;l<c;l++){var h=f[l].get("group").get("children");h&&h.forEach(function(_){var M=_.get("ori-visibility");_.set("ori-visibility",void 0),M&&_.show()})}if(a>u)for(var d=i.getNodes(),v=0,p=d.length;v<p;v++)for(var g=d[v].getContainer(),y=g.get("children"),m=0,b=y;m<b.length;m++){var x=b[m],E=x.get("isKeyShape");if(!E){var w=x.get("ori-visibility");x.set("ori-visibility",void 0),w&&x.show()}}}if(!this.dragging){this.origin=null;return}t=FM(t),this.shouldEnd(t,this)&&this.updateViewport(t),t.type="dragend",t.dx=t.clientX-this.originPosition.x,t.dy=t.clientY-this.originPosition.y,i.emit("canvas:dragend",t),this.endDrag(),typeof window<"u"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(t){var e=this,n=t.key;n&&(rde.indexOf(n.toLowerCase())>-1?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,n,i=t.target,a=i&&i.isCanvas&&i.isCanvas();if(Pl(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(bn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,f=o.combo,l=(n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e);if(!s&&l==="node"||!u&&l==="edge"||!f&&l==="combo")return!1}return!0}},ide={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){if(!this.origin||!t||t.destroyed)return!1;var e=t.getType();return e==="combo"},onTouchStart:function(t){if(t.item){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,e.onDragStart(t)}},onTouchMove:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a){e.onDragEnd(t);return}t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},typeof window<"u"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,n;if(((n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e))!=="node"){this.onDragEnd();return}this.mousedown&&(this.dragstart?this.onDrag(F(F({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(F(F({},t),this.mousedown),this)){var n=this.mousedown,i=n.item,a=n.target;if(!(!i||i.destroyed||i.hasLocked())){var o=i.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(i),a){var s=a.get("isAnchorPoint");if(s)return}var u=this.graph;this.targets=[],this.targetCombo=null;var f=u.findAllByState("node",this.selectedState),l=i.get("id"),c=f.filter(function(d){var v=d.get("id");return l===v});if(c.length===0?this.targets.push(i):f.length>1?f.forEach(function(d){var v=d.hasLocked();v||e.targets.push(d)}):this.targets.push(i),this.graph.get("enabledStack")&&this.enableStack){var h=[];this.targets.forEach(function(d){var v=d.getModel(),p=v.x,g=v.y,y=v.id;h.push({x:p,y:g,id:y})}),this.set("beforeDragNodes",h)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(d){var v=d.getEdges();v.forEach(function(p){p.isVisible()&&(e.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(!(!this.mousedown||!this.origin)&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var n={};this.targets.map(function(i){e.update(i,t);var a=i.getModel().comboId;a&&(n[a]=e.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e=this,n;if(this.mousedown=!1,this.dragstart=!1,typeof window<"u"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(n=this.cachedCaptureItems)===null||n===void 0||n.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(u){e.hidenEdge[u.getID()]&&u.show(),u.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),u=s.x,f=s.y,l=s.id;a.after.nodes.push({x:u,y:f,id:l})}),i.pushStack("update",Vt(a))}i.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.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(e))){var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var i=e.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&n.updateComboTree(a,i.id)}),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(n){var i=n.getModel();i.comboId&&e.updateComboTree(n)}))},onDropNode:function(t){if(!(!this.targets||this.targets.length===0)){var e=this,n=t.item,i=e.graph,a=n.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=i.findById(a);e.comboActiveState&&i.setItemState(s,e.comboActiveState,!1),this.targets.map(function(u){var f=u.getModel();a!==f.comboId&&i.updateComboTree(u,a)}),i.updateCombo(s)}else this.targets.map(function(u){var f=u.getModel();f.comboId&&i.updateComboTree(u)});i.emit("dragnodeend",{items:this.targets,targetItem:n})}}},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,e){var n=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(i){return n.update(i,t)}):this.targets.map(function(i){return n.update(i,t,e)}))},update:function(t,e,n){var i=this.origin,a=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=e.x-i.x+this.point[o].x,u=e.y-i.y+this.point[o].y;n&&(s+=i.x-e.x,u+=i.y-e.y);var f={x:s,y:u};this.get("updateEdge")?this.graph.updateItem(t,f,!1):t.updatePosition(f)},debounceUpdate:Nl(function(r){var t=r.targets,e=r.graph,n=r.point,i=r.origin,a=r.evt,o=r.updateEdge,s=r.onlyChangeComboSize,u=r.updateParentCombos;t.map(function(f){var l=f.get("model"),c=f.get("id");n[c]||(n[c]={x:l.x||0,y:l.y||0});var h=a.x-i.x+n[c].x,d=a.y-i.y+n[c].y,v={x:h,y:d};o?e.updateItem(f,v,!1):f.updatePosition(v)}),s&&u(e,t)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var h=t.x-this.origin.x+this.originPoint.minX,d=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:h,y:d})}else{var n=e.get("group"),i=mr({},xs.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),o=a.x,s=a.y,u=a.width,f=a.height,l=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:u,height:f,minX:l,minY:c},this.delegateRect=n.addShape("rect",{attrs:F({width:u,height:f,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;e.length===0&&e.push(t.item);for(var n=1/0,i=-1/0,a=1/0,o=-1/0,s=0;s<e.length;s++){var u=e[s],f=u.getBBox(),l=f.minX,c=f.minY,h=f.maxX,d=f.maxY;l<n&&(n=l),c<a&&(a=c),h>i&&(i=h),d>o&&(o=d)}var v=Math.floor(n),p=Math.floor(a),g=Math.ceil(i)-Math.floor(n),y=Math.ceil(o)-Math.floor(a);return{x:v,y:p,width:g,height:y,minX:n,minY:a}},updateParentCombos:function(t,e){var n=t||this.graph,i=e||this.targets,a={};i==null||i.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=n.findById(s))}),Object.values(a).forEach(function(o){o&&n.updateCombo(o)})}};var Nh=null;const ade={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.setAllItemStates(t)},clearOnTouchStart:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this,n=this.shouldClearStatusOnSecond;n&&(Nh=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:ll(function(r,t){var e=r.item,n=t.graph;if(!(!n||n.destroyed)&&(t.item=e,!!t.shouldUpdate(r.item,{event:r,action:"activate"},t))){var i=t.shouldClearStatusOnSecond,a=e.getModel().id;if(Nh===a&&i){t.throttleClearActiveState(r,t),Nh=null;return}for(var o=t.activeState,s=t.inactiveState,u=n.getNodes(),f=n.getCombos(),l=n.getEdges(),c=n.get("vedges"),h=u.length,d=f.length,v=l.length,p=c.length,g=t.inactiveItems||{},y=t.activeItems||{},m=0;m<h;m++){var b=u[m],x=b.getID(),E=b.hasState("selected");t.resetSelected&&E&&n.setItemState(b,"selected",!1),y[x]&&(n.setItemState(b,o,!1),delete y[x]),s&&!g[x]&&(n.setItemState(b,s,!0),g[x]=b)}for(var m=0;m<d;m++){var w=f[m],_=w.getID(),E=w.hasState("selected");t.resetSelected&&E&&n.setItemState(w,"selected",!1),y[_]&&(n.setItemState(w,o,!1),delete y[_]),s&&!g[_]&&(n.setItemState(w,s,!0),g[_]=w)}for(var m=0;m<v;m++){var M=l[m],C=M.getID();y[C]&&(n.setItemState(M,o,!1),delete y[C]),s&&!g[C]&&(n.setItemState(M,s,!0),g[C]=M)}for(var m=0;m<p;m++){var S=c[m],A=S.getID();y[A]&&(n.setItemState(S,o,!1),delete y[A]),s&&!g[A]&&(n.setItemState(S,s,!0),g[A]=S)}if(e&&!e.destroyed){s&&(n.setItemState(e,s,!1),delete g[e.getID()]),y[e.getID()]||(n.setItemState(e,o,!0),y[e.getID()]=e);for(var T=e.getEdges(),I=T.length,m=0;m<I;m++){var M=T[m],C=M.getID(),D=void 0;M.getSource()===e?D=M.getTarget():D=M.getSource();var N=D.getID();s&&g[N]&&(n.setItemState(D,s,!1),delete g[N]),y[N]||(n.setItemState(D,o,!0),y[N]=D),g[C]&&(n.setItemState(M,s,!1),delete g[C]),y[C]||(n.setItemState(M,o,!0),y[C]=M),M.toFront()}}t.activeItems=y,t.inactiveItems=g,i&&(Nh=e.getModel().id),n.emit("afteractivaterelations",{item:r.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:ll(function(r,t){var e=t.get("graph");if(!(!e||e.destroyed)&&t.shouldUpdate(r.item,{event:r,action:"deactivate"},t)){var n=t.activeState,i=t.inactiveState,a=t.activeItems||{},o=t.inactiveItems||{};Object.values(a).filter(function(s){return!s.destroyed}).forEach(function(s){e.clearItemStates(s,n)}),Object.values(o).filter(function(s){return!s.destroyed}).forEach(function(s){e.clearItemStates(s,i)}),t.activeItems={},t.inactiveItems={},e.emit("afteractivaterelations",{item:r.item||t.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})};var Rh=Math.min,jM=Math.max,UM=Math.abs,$M="shift",ode=["drag","shift","ctrl","alt","control"];const sde={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:$M,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return ode.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=$M,console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{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,i=this.selectOnCombo,a=(e==null?void 0:e.getType())==="combo";a&&!i||!a&&e||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&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&&(this.trigger!=="drag"&&!this.keydown||this.updateBrush(t))},onMouseUp:function(t){this.graph,!(!this.brush&&!this.dragging)&&(this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1))},clearStates:function(){var t=this,e=t.graph,n=t.selectedState,i=e.findAllByState("node",n),a=e.findAllByState("edge",n),o=e.findAllByState("combo",n);i.forEach(function(s){return e.setItemState(s,n,!1)}),a.forEach(function(s){return e.setItemState(s,n,!1)}),o.forEach(function(s){return e.setItemState(s,n,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,n,i,a){var o=t.getBBox();return o.centerX>=e&&o.centerX<=n&&o.centerY>=i&&o.centerY<=a},getSelectedNodes:function(t){var e=this,n=this,i=n.graph,a=n.originPoint,o=n.shouldUpdate,s=n.isBBoxCenterInRect,u=this.selectedState,f={x:t.x,y:t.y},l=i.getPointByCanvas(a.x,a.y),c=Rh(f.x,l.x),h=jM(f.x,l.x),d=Rh(f.y,l.y),v=jM(f.y,l.y),p=[],g=[];i.getNodes().forEach(function(b){if(b.isVisible()&&s(b,c,h,d,v)&&o(b,"select",e)){p.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,u,!0)}});var y=[];this.includeEdges&&p.forEach(function(b){var x=b.getOutEdges();x.forEach(function(E){if(E.isVisible()){var w=E.getModel(),_=w.source,M=w.target;g.includes(_)&&g.includes(M)&&o(E,"select",e)&&(y.push(E),i.setItemState(E,e.selectedState,!0))}})});var m=[];this.includeCombos&&i.getCombos().forEach(function(b){if(b.isVisible()&&s(b,c,h,d,v)&&o(b,"select",e)){m.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,u,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=m,this.onSelect&&this.onSelect(p,y,m),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:m},select:!0})},createBrush:function(){var t=this,e=t.graph.get("canvas").addShape("rect",{attrs:t.brushStyle,capture:!1,name:"brush-shape"});return this.brush=e,this.delegate=e,e},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:UM(t.canvasX-e.x),height:UM(t.canvasY-e.y),x:Rh(t.canvasX,e.x),y:Rh(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),i=e.toLowerCase();i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var WM="shift",ude=["shift","ctrl","alt","control"];const fde={getDefaultCfg:function(){return{multiple:!0,trigger:WM,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return ude.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=WM,console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(!(!n||n.destroyed)){var i=n.getType(),a=e.graph,o=e.keydown,s=e.multiple,u=e.shouldUpdate,f=e.shouldBegin;if(f(t,e)){if(!o||!s){var l=a.findAllByState("node",e.selectedState).concat(a.findAllByState("edge",e.selectedState)).concat(a.findAllByState("combo",e.selectedState));me(l,function(p){p!==n&&a.setItemState(p,e.selectedState,!1)})}var c=function(){switch(i){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}();if(!c){var h=a.findAllByState("node",e.selectedState),d=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:h,edges:d,combos:v},select:!1});return}if(n.hasState(e.selectedState)){u(t,e)&&a.setItemState(n,e.selectedState,!1);var h=a.findAllByState("node",e.selectedState),d=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:h,edges:d,combos:v},select:!1})}else{u(t,e)&&a.setItemState(n,e.selectedState,!0);var h=a.findAllByState("node",e.selectedState),d=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:h,edges:d,combos:v},select:!0})}}}},onCanvasClick:function(t){var e=this,n=this,i=n.graph,a=n.shouldBegin;if(a(t,this)){var o=i.findAllByState("node",this.selectedState);me(o,function(f){i.setItemState(f,e.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);me(s,function(f){i.setItemState(f,e.selectedState,!1)});var u=i.findAllByState("combo",this.selectedState);me(u,function(f){i.setItemState(f,e.selectedState,!1)}),i.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===this.trigger.toLowerCase()||n.toLowerCase()==="control"?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.keydown=!1}};var lde=xi,Bh=.05;const cde={getDefaultCfg:function(){return this.isFireFox=Vk()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},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],i=e[1];t.preventDefault(),i&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],i=e[1];if(i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(p,g){return Math.hypot(g.x-p.x,g.y-p.y)},o=a({x:n.pageX,y:n.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var u=this.get("minZoom")||this.graph.get("minZoom"),f=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>f||s<u)){var l=this.get("animate"),c=this.get("animateCfg"),h=this.graph.get("canvas"),d=h.getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(s,{x:d.x,y:d.y},l,c),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,n=this,i=n.graph,a=n.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(t,this))&&this.shouldUpdate(t,this)){t.preventDefault();var o=i.get("canvas"),s=o.getPointByClient(t.clientX,t.clientY),u=this.get("sensitivity"),f=i.getZoom(),l=f,c=f;this.isFireFox?t.deltaY>0||t.wheelDelta<0?l=1-Bh*u:l=1/(1-Bh*u):t.wheelDelta<0?l=1-Bh*u:l=1/(1-Bh*u),c=f*l;var h=this.get("minZoom")||i.get("minZoom"),d=this.get("maxZoom")||i.get("maxZoom");c>d?c=d:c<h&&(c=h);var v=this.get("enableOptimize");if(v){var p=this.get("optimizeZoom"),g=this.get("optimized"),y=i.getNodes(),m=i.getEdges(),b=y.length,x=m.length;if(!g){for(var E=0;E<b;E++){var w=y[E];if(!w.destroyed)for(var _=w.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];!S.destoryed&&!S.get("isKeyShape")&&(S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide())}}for(var A=0;A<x;A++)for(var T=m[A],_=T.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var I=setTimeout(function(){var tt=i.getZoom(),ie=e.get("optimized");if(ie){e.set("optimized",!1);for(var L=0;L<b;L++){var _e=y[L],Be=_e.get("group").get("children"),ye=Be.length;if(tt<p){var $e=_e.getKeyShape(),We=$e.get("ori-visibility");$e.set("ori-visibility",void 0),We&&$e.show()}else for(var Ke=0;Ke<ye;Ke++){var Qe=Be[Ke],We=Qe.get("ori-visibility");Qe.set("ori-visibility",void 0),!Qe.get("visible")&&We&&We&&Qe.show()}}for(var vt=0;vt<x;vt++){var Dt=m[vt],Be=Dt.get("group").get("children"),ye=Be.length;if(tt<p){var $e=Dt.getKeyShape(),We=$e.get("ori-visibility");$e.set("ori-visibility",void 0),We&&$e.show()}else for(var Ke=0;Ke<ye;Ke++){var Qe=Be[Ke];if(!Qe.get("visible")){var We=Qe.get("ori-visibility");Qe.set("ori-visibility",void 0),We&&Qe.show()}}}}},100);this.set("timeout",I)}if(f<=1){var D=void 0,N=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){D=i.findAllByState("node",a.fixState),N=i.findAllByState("edge",a.fixState);for(var P=f/c,G=D.length,W=0;W<G;W++){var w=D[W],k=w.getContainer(),R=w.getModel(),Y=w.getOriginStyle(),J=w.getStateStyle(a.fixState),te=w.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,w)[a.fixState];if(a.fixAll){if(c<=1){var H=Vt(k.getMatrix());H||(H=[1,0,0,0,1,0,0,0,1]);var pe=w.getModel(),Ae=pe.x,Le=pe.y;H=lde(H,[["t",-Ae,-Le],["s",P,P],["t",Ae,Le]]),k.setMatrix(H)}}else for(var _=k.get("children"),M=_.length,C=0;C<M;C++){var S=_[C],qe=void 0,at=void 0;if(a.fixLabel){var rt=S.get("type");if(rt==="text"){qe=S.attr("fontSize")||12;var xt=J[S.get("name")],Et=te[S.get("name")],ur=xt?xt.fontSize:12,Bt=Et?Et.fontSize:12,Ut=ur||Bt||12;if(c<=1&&S.attr("fontSize",Ut/c),at)break}}if(a.fixLineWidth&&S.get("isKeyShape")){at=S.attr("lineWidth")||0;var dr=J.lineWidth||te.lineWidth||Y.lineWidth||0;if(c<=1&&S.attr("lineWidth",dr/c),qe)break}}}for(var fr=N.length,Gt=0;Gt<fr;Gt++)for(var T=N[Gt],k=T.getContainer(),_=k.get("children"),R=T.getModel(),J=T.getStateStyle(a.fixState),te=T.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,T)[a.fixState],M=_.length,C=0;C<M;C++){var S=_[C],qe=void 0,at=void 0;if(a.fixLabel||a.fixAll){var rt=S.get("type");if(rt==="text"){qe=S.attr("fontSize")||12;var xt=J[S.get("name")],Et=te[S.get("name")],ur=xt?xt.fontSize:12,Bt=Et?Et.fontSize:12,Ut=ur||Bt||12;if(c<=1&&S.attr("fontSize",Ut/c),at)break}}if((a.fixLineWidth||a.fixAll)&&S.get("isKeyShape")){at=S.attr("lineWidth")||0;var dr=J.lineWidth||te.lineWidth||1;if(c<=1&&S.attr("lineWidth",dr/c),qe)break}}}}var Jt=this.get("animate"),Rr=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},Jt,Rr),i.emit("wheelzoom",t)}}},CP={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){if(!this.shouldUpdate(t,this)){this.hideTooltip();return}!this.currentTarget||t.item!==this.currentTarget||this.updatePosition(t)},onMouseLeave:function(t){this.shouldEnd(t,this)&&(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,Xt(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){Xt(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),n=this,i=n.width,a=n.height,o=n.container,s=n.graph;if(!e(t,this)){Xt(o,{visibility:"hidden"});return}var u=s.getPointByClient(t.clientX,t.clientY),f=s.getCanvasByPoint(u.x,u.y),l=f.x,c=f.y,h=o.getBoundingClientRect();l>i/2?l-=h.width:l+=this.offset,c>a/2?c-=h.height:c+=this.offset;var d="".concat(l,"px"),v="".concat(c,"px");Xt(this.container,{left:d,top:v,visibility:"visible"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=wr('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return e.parentNode.appendChild(n),Xt(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}},hde=F({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(e){return e.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},CP),dde=F({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(e){return"source: ".concat(e.source," target: ").concat(e.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},CP);var XM="click",vde=["click","dblclick"];const pde={getDefaultCfg:function(){return{trigger:XM,onChange:function(){}}},getEvents:function(){var t,e;return vde.includes(this.trigger)?e=this.trigger:(e=XM,console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),t={},t["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var n=this.graph.findDataById(e.get("id"));if(n){var i=n.children;if(!(!i||i.length===0)){var a=!n.collapsed;this.shouldBegin(t,a,this)&&(n.collapsed=a,e.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:t.item,collapsed:a}),this.shouldUpdate(t,a,this)&&(this.onChange(e,a,this),this.graph.layout()))}}}}};var gde=no.calculationItemsBBox,yde=function r(t,e){if(e(t)!==!1&&t){var n=t.get("combos");if(n.length===0)return!1;me(n,function(i){r(i,e)})}};const mde={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","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;if(!e||e.destroyed||!this.shouldUpdate(t,this))return!1;var n=e.getType();return n==="combo"},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,n=this.graph,i=t.item;if(this.currentShouldEnd=!0,!!this.validationCombo(t)){this.targets=[];var a=n.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(f){var l=f.get("id");return o===l});s.length===0?this.targets.push(i):this.targets=a;var u=[];this.targets.forEach(function(f){var l=f.getModel(),c=l.x,h=l.y,d=l.id;u.push({x:c,y:h,id:d})}),this.set("beforeDragItems",u),this.activeState&&this.targets.map(function(f){var l=f.getModel();if(l.parentId){var c=n.findById(l.parentId);c&&n.setItemState(c,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],yde(i,function(f){if(f.destroyed)return!1;var l=f.getModel();return e.currentItemChildCombos.push(l.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,i=t.item,a=i.getModel(),o=n.getCombos(),s=i.getBBox(),u=s.centerX,f=s.centerY,l=s.width,c=o.filter(function(h){var d=h.getModel();return a.parentId,d.id!==a.id&&!e.currentItemChildCombos.includes(d.id)});c.map(function(h){var d=h.getBBox(),v=d.centerX,p=d.centerY,g=d.width,y=u-v,m=f-p,b=2*Math.sqrt(y*y+m*m);l+g-b>.8*l?n.setItemState(h,e.activeState,!0):n.setItemState(h,e.activeState,!1)})}me(this.targets,function(h){e.updateCombo(h,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&me(this.targets,function(i){n.updateCombo(i,t,e)})},onDrop:function(t){var e=this,n=t.item;if(this.currentShouldEnd=this.shouldEnd(t,n,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!n||!this.targets||n.destroyed)){var i=this.graph,a=n.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(e.activeState&&i.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id,!1)):i.updateCombo(n)}),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(!(!this.targets||this.targets.length===0)){var n=this.graph,i=t.item,a=i.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var u=n.findById(a);n.setItemState(u,this.activeState,!1)}this.targets.map(function(f){e.onlyChangeComboSize?n.updateCombo(f):a!==f.getID()&&(s=n.findById(a),a!==f.getModel().parentId&&n.updateComboTree(f,a,!1))})}else this.targets.map(function(f){if(e.onlyChangeComboSize)n.updateCombo(f);else{var l=f.getModel();l.comboId&&n.updateComboTree(f,void 0,!1)}});this.endComparison=!0,this.end(s,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||this.targets.length===0)){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),i=this.graph;n&&this.activeState&&i.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}if(t&&this.activeState&&i.setItemState(t,this.activeState,!1),!t){var o=i.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(u){if(!n.onlyChangeComboSize)i.updateComboTree(u,void 0,o);else{i.updateCombo(u);var f=u.getModel(),l=f.x,c=f.y,h=f.id;s.after.combos.push({x:l,y:c,id:h}),i.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,n){var i=this;if(n===void 0&&(n={}),e(t,n)!==!1&&t){var a=t.get("combos");me(a,function(s){i.traverse(s,e,n)});var o=t.get("nodes");me(o,function(s){i.traverse(s,e,n)})}},updateCombo:function(t,e,n){this.updateSingleItem(t,e,n);var i={};this.traverse(t,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},i),Object.values(i).forEach(function(a){return a.refresh()})},updateSingleItem:function(t,e,n){var i=this.origin,a=this.graph,o=t.getModel(),s=t.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var u=e.x-i.x+this.point[s].x,f=e.y-i.y+this.point[s].y;n&&(u+=i.x-e.x,f+=i.y-e.y),a.updateItem(t,{x:u,y:f},!1)},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 h=t.x-this.origin.x+this.originPoint.minX,d=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:h,y:d})}else{var n=e.get("delegateGroup"),i=null;this.targets.length>1?i=gde(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,u=i.height,f=i.minX,l=i.minY;this.originPoint={x:a,y:o,width:s,height:u,minX:f,minY:l};var c=F(F({},xs.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:F({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this,e=t.graph,n=t.targets,i={};n==null||n.forEach(function(a){var o=a.getModel().parentId;o&&(i[o]=e.findById(o))}),Object.values(i).forEach(function(a){a&&e.updateCombo(a)})}};var YM="dblclick",bde=["click","dblclick"];const xde={getDefaultCfg:function(){return{trigger:YM,relayout:!0}},getEvents:function(){var t,e;return bde.includes(this.trigger)?e=this.trigger:(e=YM,console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),t={},t["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this,i=n.graph,a=n.relayout;if(!(!e||e.destroyed||e.getType()!=="combo")){var o=e.getModel(),s=o.id;s&&(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var Ede=no.isPolygonsIntersect,wde=no.pathToPoints,VM="shift",_de=["drag","shift","ctrl","alt","control"],Sde=function(t,e){var n,i=t.getKeyShape();if(t.get("type")==="path")n=wde(i.attr("path"));else{var a=i.getCanvasBBox();n=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return Ede(e,n)};const Mde={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:VM,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return _de.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=VM,console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{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,n=t.item;n||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),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&&(this.trigger!=="drag"&&!this.keydown||(this.points.push({x:t.x,y:t.y}),this.updateLasso(t)))},onDragEnd:function(t){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!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(n,i){i===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){t===void 0&&(t="canvas:click");var e=this,n=e.graph,i=e.selectedState,a=e.shouldDeselect,o=n.findAllByState("node",i),s=n.findAllByState("edge",i);(!a||a({action:t,nodes:o,edges:s}))&&(o.forEach(function(u){return n.setItemState(u,i,!1)}),s.forEach(function(u){return n.setItemState(u,i,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this,n=e.graph,i=e.shouldUpdate,a=this.points.map(function(l){return[n.getCanvasByPoint(l.x,l.y).x,n.getCanvasByPoint(l.x,l.y).y]}),o=this.selectedState,s=[],u=[];n.getNodes().forEach(function(l){if(l.isVisible()&&Sde(l,a)&&i(l,"select",t)){s.push(l);var c=l.getModel();u.push(c.id),n.setItemState(l,o,!0)}});var f=[];this.includeEdges&&s.forEach(function(l){var c=l.getOutEdges();c.forEach(function(h){if(h.isVisible()){var d=h.getModel(),v=d.source,p=d.target;u.includes(v)&&u.includes(p)&&i(h,"select",t)&&(f.push(h),n.setItemState(h,t.selectedState,!0))}})}),this.selectedEdges=f,this.selectedNodes=s,this.onSelect&&this.onSelect(s,f),n.emit("nodeselectchange",{selectedItems:{nodes:s,edges:f},select:!0})},createLasso:function(){var t=this,e=t.graph.get("delegateGroup").addShape("path",{attrs:F({path:[]},t.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=e,this.delegate=e,this.points=[],e},updateLasso:function(t){var e=this;this.lasso.attr({path:e.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}};var HM="click",Cde=["click","drag"],KM=void 0,Ade=["shift","ctrl","control","alt","meta",void 0];const Tde={getDefaultCfg:function(){return{trigger:HM,key:KM,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;Cde.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=HM,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),t.key&&Ade.indexOf(t.key.toLowerCase())===-1&&(t.trigger=KM,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined"));var e;return t.trigger==="drag"?e={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:t.trigger==="click"&&(e={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),t.key&&(e.keydown="onKeyDown",e.keyup="onKeyUp"),e},onDragEnd:function(t){var e=this;if(!(e.key&&!e.keydown)){var n=t.item;(!n||n.getID()===e.source||n.getType()!=="node")&&e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!(e.key&&!e.keydown)){var n=t.item,i=e.graph,a=n.getModel(),o=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var s=void 0;o&&Cr(o)?s=o({source:e.source,target:a.id},e):s=e.edgeConfig;var u=F({target:a.id},s);if(e.source===a.id&&(u.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(e.edge,u,!1),i.get("enabledStack")){var f=F(F({},e.edge.getModel()),{itemType:"edge"}),l={};l.edges=[f],i.pushStack("add",{before:{},after:l})}i.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;var s=void 0;o&&Cr(o)?s=o({source:a.id,target:a.id},e):s=e.edgeConfig,e.edge=i.addItem("edge",F({source:a.id,target:a.id},s),!1),e.source=a.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!(e.key&&!e.keydown)){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var n={x:t.x,y:t.y};if(!e.graph.findById(e.source)){e.addingEdge=!1;return}e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:n},!1)}},cancelCreating:function(t){var e,n,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=t.item;if(i.addingEdge&&(i.edge===o||!((n=(e=t.target)===null||e===void 0?void 0:e.isCanvas)===null||n===void 0)&&n.call(e))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}};var qM="ctrl",Ide=["shift","ctrl","alt","control"],Ode="1";const Lde={getDefaultCfg:function(){return{trigger:qM,combinedKey:Ode,functionName:"fitView",functionParams:[]}},getEvents:function(){return Ide.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=qM,console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(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(),i=e.toLowerCase();this.triggerKeydown||(i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var Dde=["shift","ctrl","alt","control","meta"];const kde={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||Dde.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var n=this.graph,i=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];i.includes("control")&&i.push("ctrl");var a=i.some(function(R){return t["".concat(R,"Key")]});if(a){var o=n.get("canvas"),s=o.getPointByClient(t.clientX,t.clientY),u=n.getZoom();t.wheelDelta>0?u=u+u*.05:u=u-u*.05,n.zoomTo(u,{x:s.x,y:s.y})}else{var f=t.deltaX||t.movementX,l=t.deltaY||t.movementY;!l&&navigator.userAgent.indexOf("Firefox")>-1&&(l=-t.wheelDelta*125/3);var c=this.graph.get("width"),h=this.graph.get("height"),d=this.graph.get("canvas").getCanvasBBox(),v=this.scalableRange,p=this.scalableRange;v<1&&v>-1&&(v=c*v,p=h*p);var g=d.minX,y=d.maxX,m=d.minY,b=d.maxY;f>0?y<-v?f=0:y-f<-v&&(f=y+v):f<0&&(g>c+v?f=0:g-f>c+v&&(f=g-(c+v))),l>0?b<-p?l=0:b-l<-p&&(l=b+p):l<0&&(m>h+p?l=0:m-l>h+p&&(l=m-(h+p))),this.get("direction")==="x"?l=0:this.get("direction")==="y"&&(f=0),n.translate(-f,-l)}t.preventDefault();var x=this.get("enableOptimize");if(x){var E=this.get("optimizeZoom"),w=this.get("optimized"),_=n.getNodes(),M=n.getEdges(),C=_.length,S=M.length;if(!w){for(var A=0;A<C;A++){var T=_[A];if(!T.destroyed)for(var I=T.get("group").get("children"),D=I.length,N=0;N<D;N++){var P=I[N];!P.destoryed&&!P.get("isKeyShape")&&(P.set("ori-visibility",P.get("ori-visibility")||P.get("visible")),P.hide())}}for(var G=0;G<S;G++)for(var W=M[G],I=W.get("group").get("children"),D=I.length,N=0;N<D;N++){var P=I[N];P.set("ori-visibility",P.get("ori-visibility")||P.get("visible")),P.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var k=setTimeout(function(){var R=n.getZoom(),Y=e.get("optimized");if(Y){e.set("optimized",!1);for(var J=0;J<C;J++){var te=_[J],H=te.get("group").get("children"),pe=H.length;if(R<E){var Ae=te.getKeyShape(),Le=Ae.get("ori-visibility");Le&&Ae.show()}else for(var qe=0;qe<pe;qe++){var at=H[qe],Le=at.get("ori-visibility");!at.get("visible")&&Le&&Le&&at.show()}}for(var rt=0;rt<S;rt++){var xt=M[rt],H=xt.get("group").get("children"),pe=H.length;if(R<E){var Ae=xt.getKeyShape(),Le=Ae.get("ori-visibility");Le&&Ae.show()}else for(var qe=0;qe<pe;qe++){var at=H[qe];if(!at.get("visible")){var Le=at.get("ori-visibility");Le&&at.show()}}}}},100);this.set("timeout",k)}}},allowDrag:function(t){var e,n,i=t.target,a=i&&i.isCanvas&&i.isCanvas();if(Pl(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(bn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,f=o.combo,l=(n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e);if(!s&&l==="node"||!u&&l==="edge"||!f&&l==="combo")return!1}return!0}};var Pde={"drag-canvas":nde,"zoom-canvas":cde,"drag-node":ide,"activate-relations":ade,"brush-select":sde,"click-select":fde,"lasso-select":Mde,tooltip:hde,"edge-tooltip":dde,"collapse-expand":pde,"drag-combo":mde,"collapse-expand-combo":xde,"create-edge":Tde,"shortcuts-call":Lde,"scroll-canvas":kde};me(Pde,function(r,t){$I(t,r)});var Nde=F(F({},nz),sW),Rde=qn.Fisheye,Bde=qn.TimeBar,Fde=qn.ImageMinimap,Gde=qn.EdgeFilterLens,zde=qn.SnapLine,jde=qn.Annotation;const np={version:xs.version,Graph:Kk,TreeGraph:Hfe,Util:no,Layout:Ht.Layouts,TreeLayout:Nfe,registerLayout:Rfe,Global:xs,registerBehavior:$I,registerCombo:$U,registerEdge:UI,registerNode:Za,Minimap:qn.Minimap,Grid:qn.Grid,Bundling:qn.Bundling,Menu:qn.Menu,ToolBar:qn.ToolBar,Tooltip:qn.Tooltip,Legend:qn.Legend,TimeBar:Bde,SnapLine:zde,Fisheye:Rde,ImageMinimap:Fde,EdgeFilterLens:Gde,Annotation:jde,Algorithm:Nde,Arrow:BI,Marker:FI,Shape:br};np.version="4.8.23";np.registerNode("file-node",{draw(r,t){const e=t.addShape("rect",{name:"rect-shape",attrs:{x:0,y:0,fill:"#fff",stroke:null}});return r.children.length==0||t.addShape("marker",{name:"marker-shape",attrs:{symbol:"triangle-down",x:0,y:0,r:4,fill:"#767c82"}}),t.addShape("text",{name:"text-shape",attrs:{x:6,y:8,fontSize:16,text:r.label,fill:r.tracked?"#00f":"#333639",textAlign:"left",fontFamily:window.getComputedStyle(document.body,null).getPropertyValue("font-family")}}),e}});np.registerEdge("step-line",{getControlPoints(r){const t=r.startPoint,e=r.endPoint;return[t,{x:t==null?void 0:t.x,y:e==null?void 0:e.y},e]}},"polyline");const Yde=t3({__name:"TrackGraph",props:{track:{}},setup(r){const t=r,e=r3(()=>{var c;const o=t.track.nodes,s=(c=t.track.nodes[t.track.selector.trackIndex])==null?void 0:c.id,u=(()=>{const h=o.reduce((d,v)=>v.id<d.id?v:d,o[0]);return h.parent&&o.some(d=>d!==h&&d.pid==h.pid)?h.parent:h})(),f=new Set;f.add(u),o.forEach(h=>{f.add(h);let d=h;for(;d&&d!==u;)f.add(d),d=d.parent});const l=Array.from(f).map(h=>({_node:h,children:[],id:h.id.toString(),label:mE(h),tracked:s===h.id}));return l.sort((h,d)=>h._node.id-d._node.id),l.forEach(h=>{const d=l.find(v=>v.id===h._node.pid.toString());d&&d.children.push(h)}),l.forEach(h=>{if(h.children.length<h._node.children.length){const d=[],v=()=>{for(;d.length>0;)d.pop()},p=()=>{if(d.length==0)return;const g=d[0].parent.children,y=d[0];if(g.length>1&&g.indexOf(y)==1&&g.indexOf(d.at(-1))==g.length-1){v();return}h.children.push({_node:y,children:[],id:y.id.toString(),label:d.length==1?mE(y):`[${g.indexOf(y)} ... ${g.indexOf(d.at(-1))}]`,tracked:s===y.id}),v()};h._node.children.forEach(g=>{h.children.find(y=>y.id===g.id.toString())?p():d.push(g)}),d.length>0&&p(),h.children.sort((g,y)=>h._node.children.indexOf(g._node)-h._node.children.indexOf(y._node))}}),l}),n=n3();let i;i3(()=>{if(!n.value)return;i==null||i.destroy();const o=n.value.scrollWidth,s=n.value.scrollHeight||o;i=new np.TreeGraph({container:n.value,width:o,height:s,modes:{default:["drag-canvas","zoom-canvas"]},layout:{type:"indented",indent:25,getHeight(){return 10}}}),i.node(c=>({type:"file-node"})),i.edge(c=>{if(c.id&&c.id.startsWith("-")){const h=Number.parseInt(c.source)>Number.parseInt(c.target)?-1:1,d=String(c.connect),v=Number(c.count);let p=40;if(d.startsWith("<<")){let y=t.track.nodes.find(b=>b.id.toString()==c.source).parent,m=1;for(;y&&y.id.toString()!=c.target;)y=y.parent,m++;m>1&&(p+=m*20)}return v>1&&(p+=(v-1)*20),p*=h,{type:"quadratic",color:"#ff00ff80",curveOffset:p,style:{startArrow:!0},label:d,labelCfg:{style:{fill:"#f00",fontSize:12,background:{fill:"#ffffff",stroke:"#f0f",lineWidth:1,padding:[2,1,0,1],radius:2}}}}}return{type:"step-line"}}),i.data({...e.value[0]}),i.render();const u=Array.from(t.track.nodes).reverse(),f=t.track.selector.connectKeys,l={};u.forEach((c,h)=>{const d=u[h+1];if(d&&i){const v=d.id>c.id?`-${c.id}:${d.id}`:`-${d.id}:${c.id}`;l[v]=(l[v]||0)+1;const p=`${v}/${l[v]}`,g=f[f.length-h-1],y={"+":()=>d.parent.children.slice(0,d.parent.children.indexOf(d)).reverse().indexOf(c),"-":()=>d.parent.children.slice(d.parent.children.indexOf(d)+1).indexOf(c),">":()=>{let m=0,b=d.parent;for(;b;){if(b===c)return m;b=b.parent,m++}return m},"<":()=>d.children.indexOf(c),"<<":()=>{let m=0;const b=Array.from(d.children).reverse();for(;b.length>0;){const x=b.pop();if(x===c)return m;b.push(...Array.from(x.children).reverse()),m++}return m}}[g]()+1;i.addItem("edge",{source:c.id.toString(),target:d.id.toString(),id:p,connect:y>1?g+y:g,count:l[v]},!1)}}),i.fitView(30)}),yE(()=>{i==null||i.destroy()});const a=()=>{!i||i.get("destroyed")||!n.value||!n.value||!n.value.scrollWidth||!n.value.scrollHeight||i.changeSize(n.value.scrollWidth,n.value.scrollHeight)};return window.addEventListener("resize",a),yE(()=>{window.removeEventListener("resize",a)}),(o,s)=>(a3(),o3("div",{ref_key:"container",ref:n},null,512))}});export{Yde as default};
|
|
670
|
-
//# sourceMappingURL=TrackGraph-
|
|
670
|
+
//# sourceMappingURL=TrackGraph-LNwgG7Zu.js.map
|