@nocobase/app 2.3.0-alpha.1 → 3.0.0-alpha.2
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/__tests__/browserChecker.test.ts +129 -0
- package/__tests__/settingsDevProxy.test.ts +96 -0
- package/__tests__/settingsPluginImports.test.ts +106 -0
- package/client/rsbuild.config.ts +37 -15
- package/client-settings/generatePluginImports.ts +36 -0
- package/client-settings/index.html +11 -0
- package/client-settings/rsbuild.config.ts +270 -0
- package/client-settings/src/.plugins/index.ts +4 -0
- package/client-settings/src/SettingsPresetPlugin.ts +56 -0
- package/client-settings/src/__tests__/runtimePublicPath.test.ts +23 -0
- package/client-settings/src/__tests__/runtimeScope.test.ts +29 -0
- package/client-settings/src/env.d.ts +22 -0
- package/client-settings/src/main.tsx +78 -0
- package/client-settings/src/runtimePublicPath.ts +21 -0
- package/client-settings/src/runtimeScope.ts +49 -0
- package/client-settings/tsconfig.json +19 -0
- package/client-v2/public/browser-checker.js +76 -1
- package/client-v2/rsbuild.config.ts +31 -9
- package/dist/client/assets/{index-800d06ee.js → index-c94119b4.js} +369 -355
- package/dist/client/assets/{vendor-antd-f421fb70.js → vendor-antd-b77deb8f.js} +4 -4
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/settings/assets/1052-2ed99808.js +1 -0
- package/dist/client/settings/assets/108-76a3fdea.js +82 -0
- package/dist/client/settings/assets/108-76a3fdea.js.LICENSE.txt +17 -0
- package/dist/client/settings/assets/1101-53bb815a.js +1 -0
- package/dist/client/settings/assets/1179-1ec4826c.js +1 -0
- package/dist/client/settings/assets/1310-c0031389.js +59 -0
- package/dist/client/settings/assets/1329-0e47aabd.js +1 -0
- package/dist/client/settings/assets/1425-69534606.js +42 -0
- package/dist/client/settings/assets/1434-d603f255.js +1 -0
- package/dist/client/settings/assets/1463-11b9abe3.js +1 -0
- package/dist/client/settings/assets/1469-477cfa59.js +1 -0
- package/dist/client/settings/assets/1481-59e4188c.js +1 -0
- package/dist/client/settings/assets/1507-9a211af0.js +7 -0
- package/dist/client/settings/assets/158-5273dfbb.js +23 -0
- package/dist/client/settings/assets/1586-73831f88.js +1 -0
- package/dist/client/settings/assets/1667-88ad86eb.js +1 -0
- package/dist/client/settings/assets/1675-3cbafc50.js +1 -0
- package/dist/client/settings/assets/1676-5db7433e.js +9 -0
- package/dist/client/settings/assets/1725-d9ce2582.js +83 -0
- package/dist/client/settings/assets/1786-e6c321bb.js +16 -0
- package/dist/client/settings/assets/183-963396ee.js +1 -0
- package/dist/client/settings/assets/1846-0deb6fc0.js +1 -0
- package/dist/client/settings/assets/1848-0ef98f01.js +1 -0
- package/dist/client/settings/assets/1863-9160dd98.js +1 -0
- package/dist/client/settings/assets/1887-bf619cb3.js +1 -0
- package/dist/client/settings/assets/192-c347bb96.js +1 -0
- package/dist/client/settings/assets/1951-84be8ebc.js +55 -0
- package/dist/client/settings/assets/1979-a893b852.js +1 -0
- package/dist/client/settings/assets/1986-01c03982.js +1 -0
- package/dist/client/settings/assets/2017-29a9879a.js +26 -0
- package/dist/client/settings/assets/2110-961b6f8e.js +1 -0
- package/dist/client/settings/assets/212-0f8a26a2.js +18 -0
- package/dist/client/settings/assets/2203-9aa79271.js +4 -0
- package/dist/client/settings/assets/2258-f667d700.js +1 -0
- package/dist/client/settings/assets/2270-ff70d8cb.js +1 -0
- package/dist/client/settings/assets/2301-2db05359.js +1 -0
- package/dist/client/settings/assets/2322-b9f077c3.js +1 -0
- package/dist/client/settings/assets/2335-669f21bd.js +22 -0
- package/dist/client/settings/assets/242-c3e15c94.js +1 -0
- package/dist/client/settings/assets/2446-ac5fccd3.js +1 -0
- package/dist/client/settings/assets/2512-5343dabb.js +1185 -0
- package/dist/client/settings/assets/2512-5343dabb.js.LICENSE.txt +9 -0
- package/dist/client/settings/assets/2555-4ca49e21.js +31 -0
- package/dist/client/settings/assets/2565-ad63e92f.js +1 -0
- package/dist/client/settings/assets/2606-c4dcd1e1.js +1 -0
- package/dist/client/settings/assets/2613-98648bd2.js +1 -0
- package/dist/client/settings/assets/2622-3389992f.js +1 -0
- package/dist/client/settings/assets/2702-5ce93acd.js +5 -0
- package/dist/client/settings/assets/2710-e7286996.js +36 -0
- package/dist/client/settings/assets/2726-4d19faa1.js +23 -0
- package/dist/client/settings/assets/2861-48106fd8.js +3 -0
- package/dist/client/settings/assets/2898-7656f7f9.js +17 -0
- package/dist/client/settings/assets/2913-6b4e6c17.js +1 -0
- package/dist/client/settings/assets/2958-93de29a6.js +27 -0
- package/dist/client/settings/assets/300-ca09229f.js +1 -0
- package/dist/client/settings/assets/3005-1449fc4e.js +56 -0
- package/dist/client/settings/assets/3018-fc630932.js +3 -0
- package/dist/client/settings/assets/3028-efe6f61f.js +1 -0
- package/dist/client/settings/assets/3039-7f273921.js +1 -0
- package/dist/client/settings/assets/3102-b985963e.js +1 -0
- package/dist/client/settings/assets/3117-cc936eae.js +33 -0
- package/dist/client/settings/assets/32-88d3c82f.js +2 -0
- package/dist/client/settings/assets/3260-3b3c7cd3.js +1 -0
- package/dist/client/settings/assets/3279-8d73fd19.js +1 -0
- package/dist/client/settings/assets/3283-654f42f7.js +1 -0
- package/dist/client/settings/assets/3309-172e3f79.js +1 -0
- package/dist/client/settings/assets/335-da9c4d81.js +1 -0
- package/dist/client/settings/assets/338-2f192edd.js +3 -0
- package/dist/client/settings/assets/3396-4422ee26.js +1 -0
- package/dist/client/settings/assets/3458-2958f051.js +1 -0
- package/dist/client/settings/assets/3475-be655098.js +1 -0
- package/dist/client/settings/assets/3523-5313a211.js +1 -0
- package/dist/client/settings/assets/3526-17f4e8e7.js +1 -0
- package/dist/client/settings/assets/3641-c2439c22.js +1 -0
- package/dist/client/settings/assets/3646-aa6a2478.js +1 -0
- package/dist/client/settings/assets/3660-280439df.js +6 -0
- package/dist/client/settings/assets/3662-8dff1ffe.js +28 -0
- package/dist/client/settings/assets/3690-4a8bdf43.js +12 -0
- package/dist/client/settings/assets/3727-1cfef422.js +44 -0
- package/dist/client/settings/assets/3859-fa4f6d5d.js +1 -0
- package/dist/client/settings/assets/3898-6236af03.js +1 -0
- package/dist/client/settings/assets/3916-3b34f216.js +6 -0
- package/dist/client/settings/assets/3937-af967d62.js +3 -0
- package/dist/client/settings/assets/3977-3feadc2c.js +1 -0
- package/dist/client/settings/assets/3978-29c2602c.js +1 -0
- package/dist/client/settings/assets/3989-c8fcfd6c.js +27 -0
- package/dist/client/settings/assets/406-497829bb.js +1 -0
- package/dist/client/settings/assets/4076-f68c25bd.js +1 -0
- package/dist/client/settings/assets/4096-0050f491.js +1 -0
- package/dist/client/settings/assets/4171-0710965d.js +2 -0
- package/dist/client/settings/assets/4171-0710965d.js.LICENSE.txt +6 -0
- package/dist/client/settings/assets/4195-2a00794d.js +1 -0
- package/dist/client/settings/assets/4222-29a8147d.js +5 -0
- package/dist/client/settings/assets/4223-3821a30e.js +1 -0
- package/dist/client/settings/assets/4313-ab774fd9.js +28 -0
- package/dist/client/settings/assets/4358-0a504478.js +1 -0
- package/dist/client/settings/assets/4419-3ab9c709.js +1 -0
- package/dist/client/settings/assets/4456-49679669.js +1 -0
- package/dist/client/settings/assets/448-57d6a00d.js +1 -0
- package/dist/client/settings/assets/4594-4e72041f.js +1 -0
- package/dist/client/settings/assets/4672-573e9a61.js +1 -0
- package/dist/client/settings/assets/4686-afbf676f.js +1 -0
- package/dist/client/settings/assets/474-ce4285d1.js +1 -0
- package/dist/client/settings/assets/4767-8f9d30dc.js +1 -0
- package/dist/client/settings/assets/4784-c69aaa68.js +1 -0
- package/dist/client/settings/assets/4801-06781ed7.js +1 -0
- package/dist/client/settings/assets/492-937af2ba.js +1 -0
- package/dist/client/settings/assets/4930-41adc6b7.js +1 -0
- package/dist/client/settings/assets/5064-93d8e29e.js +10 -0
- package/dist/client/settings/assets/5087-c505a60e.js +1 -0
- package/dist/client/settings/assets/5108-a028f8af.js +1 -0
- package/dist/client/settings/assets/5122-649463de.js +1 -0
- package/dist/client/settings/assets/5123-0bd0a6f2.js +1 -0
- package/dist/client/settings/assets/5139-3039fde4.js +1 -0
- package/dist/client/settings/assets/5459-c1f208e3.js +1 -0
- package/dist/client/settings/assets/5501-387a31be.js +17 -0
- package/dist/client/settings/assets/5506-a1f27be3.js +1 -0
- package/dist/client/settings/assets/553-1c3126df.js +1 -0
- package/dist/client/settings/assets/557-950114e1.js +1 -0
- package/dist/client/settings/assets/5640-f846c2a0.js +1 -0
- package/dist/client/settings/assets/5642-5c0bab20.js +1 -0
- package/dist/client/settings/assets/5674-e33e384f.js +1 -0
- package/dist/client/settings/assets/5701-8fe417d1.js +1 -0
- package/dist/client/settings/assets/5721-af25e047.js +18 -0
- package/dist/client/settings/assets/5757-81a89522.js +1 -0
- package/dist/client/settings/assets/5759-2b3bdcc6.js +47 -0
- package/dist/client/settings/assets/5761-857b6bbb.js +28 -0
- package/dist/client/settings/assets/5791-7c59ba08.js +1 -0
- package/dist/client/settings/assets/58-77bfd6c9.js +1 -0
- package/dist/client/settings/assets/5815-04fc432a.js +1 -0
- package/dist/client/settings/assets/5819-225de680.js +1 -0
- package/dist/client/settings/assets/5861-ac056534.js +1 -0
- package/dist/client/settings/assets/5870-0c3ecc40.js +1 -0
- package/dist/client/settings/assets/5881-b4c942f1.js +1 -0
- package/dist/client/settings/assets/5905-a5c3fce6.js +1 -0
- package/dist/client/settings/assets/5933-fbe50cd6.js +1 -0
- package/dist/client/settings/assets/6062-0e469079.js +1 -0
- package/dist/client/settings/assets/6093-641fcafc.js +1 -0
- package/dist/client/settings/assets/6157-8e763248.js +1 -0
- package/dist/client/settings/assets/6241-55a319df.js +1 -0
- package/dist/client/settings/assets/6269-a8a1ea3f.js +1 -0
- package/dist/client/settings/assets/630-110e12f4.js +1 -0
- package/dist/client/settings/assets/6345-187e76cf.js +1 -0
- package/dist/client/settings/assets/6346-94bdf034.js +1 -0
- package/dist/client/settings/assets/6373-9d047c6b.js +13 -0
- package/dist/client/settings/assets/6437-3865fd7e.js +12 -0
- package/dist/client/settings/assets/6581-51c928bf.js +21 -0
- package/dist/client/settings/assets/6660-54e08a8d.js +1 -0
- package/dist/client/settings/assets/6738-c6598897.js +20 -0
- package/dist/client/settings/assets/6870-6a6dba63.js +1 -0
- package/dist/client/settings/assets/6914-00d913e7.js +1 -0
- package/dist/client/settings/assets/70-f4dc53ad.js +1 -0
- package/dist/client/settings/assets/700-e75b7faa.js +15 -0
- package/dist/client/settings/assets/7021-4975d54d.js +45 -0
- package/dist/client/settings/assets/7095-4f425b85.js +1 -0
- package/dist/client/settings/assets/7141-b8e2a787.js +1 -0
- package/dist/client/settings/assets/7201-5b49ce84.js +14 -0
- package/dist/client/settings/assets/7211-b8c71ed2.js +9 -0
- package/dist/client/settings/assets/7245-1058e96e.js +474 -0
- package/dist/client/settings/assets/7245-1058e96e.js.LICENSE.txt +2567 -0
- package/dist/client/settings/assets/7245-db3cd5c2.css +1 -0
- package/dist/client/settings/assets/7318-6e1c7877.js +1 -0
- package/dist/client/settings/assets/7386-2f5752d4.js +1 -0
- package/dist/client/settings/assets/7413-241d463c.js +1 -0
- package/dist/client/settings/assets/7492-5c593f52.js +5 -0
- package/dist/client/settings/assets/7507-a015d8cf.js +1 -0
- package/dist/client/settings/assets/754-41b763b9.js +17 -0
- package/dist/client/settings/assets/7555-f42cdb72.js +1 -0
- package/dist/client/settings/assets/7608-2b3f2db0.js +1 -0
- package/dist/client/settings/assets/7669-8bd94b73.js +1 -0
- package/dist/client/settings/assets/7761-637067c6.js +123 -0
- package/dist/client/settings/assets/7876-673cbc3c.js +6 -0
- package/dist/client/settings/assets/791-9cfa98c8.js +1 -0
- package/dist/client/settings/assets/7946-e07199df.js +13 -0
- package/dist/client/settings/assets/7959-f7ef21c6.js +40 -0
- package/dist/client/settings/assets/8053-fa93540e.js +1 -0
- package/dist/client/settings/assets/8087-90829087.js +1 -0
- package/dist/client/settings/assets/8138-e90c290e.js +24 -0
- package/dist/client/settings/assets/8217-de1369d7.js +1 -0
- package/dist/client/settings/assets/8242-3f880357.js +108 -0
- package/dist/client/settings/assets/8252-1153ffdd.js +1 -0
- package/dist/client/settings/assets/8262-7a324b59.js +9 -0
- package/dist/client/settings/assets/8269-52ea88cd.js +1 -0
- package/dist/client/settings/assets/8276-b3dfc452.js +1 -0
- package/dist/client/settings/assets/828-55028e33.js +1 -0
- package/dist/client/settings/assets/8294-9c81768d.js +1 -0
- package/dist/client/settings/assets/8295-447d3bb3.js +1 -0
- package/dist/client/settings/assets/8349-82eb3ecd.js +1 -0
- package/dist/client/settings/assets/8434-9140d106.js +25 -0
- package/dist/client/settings/assets/8438-d2ff6bc1.js +37 -0
- package/dist/client/settings/assets/8473-b1118703.js +1 -0
- package/dist/client/settings/assets/8480-c16f7ee4.js +1 -0
- package/dist/client/settings/assets/8562-ffa35312.js +17 -0
- package/dist/client/settings/assets/8624-847569d9.js +1 -0
- package/dist/client/settings/assets/8631-b2fd9aac.js +1 -0
- package/dist/client/settings/assets/8635-27980c94.js +1 -0
- package/dist/client/settings/assets/8676-987fe455.js +1 -0
- package/dist/client/settings/assets/8729-9adea5fe.js +1 -0
- package/dist/client/settings/assets/8759-4d7f7a69.js +1 -0
- package/dist/client/settings/assets/896-d07bab4d.js +1 -0
- package/dist/client/settings/assets/9021-ec1b8442.js +1 -0
- package/dist/client/settings/assets/9065-5df7b63d.js +1 -0
- package/dist/client/settings/assets/9170-efbfcc1e.js +1 -0
- package/dist/client/settings/assets/9204-6cb7a01b.js +1 -0
- package/dist/client/settings/assets/9217-f27c2dcb.js +1 -0
- package/dist/client/settings/assets/9248-ff8e06d0.js +1 -0
- package/dist/client/settings/assets/9274-83aa1da2.js +1 -0
- package/dist/client/settings/assets/929-a37c623d.js +1 -0
- package/dist/client/settings/assets/93-dc732e8a.js +1 -0
- package/dist/client/settings/assets/9518-4c8b8805.js +1 -0
- package/dist/client/settings/assets/9550-2daf603c.js +1 -0
- package/dist/client/settings/assets/9565-2158d75f.js +1 -0
- package/dist/client/settings/assets/9578-f64d8970.js +1 -0
- package/dist/client/settings/assets/9584-969e1d2b.js +1 -0
- package/dist/client/settings/assets/9592-523a3fa6.js +1 -0
- package/dist/client/settings/assets/9827-d1f02095.js +9 -0
- package/dist/client/settings/assets/9836-fcbb81f6.js +22 -0
- package/dist/client/settings/assets/9847-bc9f1ba4.js +1 -0
- package/dist/client/settings/assets/9953-407a1cde.js +1 -0
- package/dist/client/settings/assets/index-3da8ef5b.js +1946 -0
- package/dist/client/settings/assets/index-3da8ef5b.js.LICENSE.txt +1 -0
- package/dist/client/settings/assets/runtime-6b2f3ebe.js +1 -0
- package/dist/client/settings/browser-checker.js +282 -0
- package/dist/client/settings/favicon/favicon.ico +0 -0
- package/dist/client/settings/file-placeholder/ai-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/audio-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/docx-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/eps-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/gif-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/jpeg-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/pdf-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/png-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/pptx-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/psd-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/svg-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/unknown-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/video-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/xlsx-200-200.png +0 -0
- package/dist/client/settings/file-placeholder/zip-200-200.png +0 -0
- package/dist/client/settings/global.css +63 -0
- package/dist/client/settings/index.html +22 -0
- package/dist/client/settings/nocobase.png +0 -0
- package/dist/client/settings/robots.txt +2 -0
- package/dist/client/v/assets/{index-2f7426fe.js → index-41529ca7.js} +167 -153
- package/dist/client/v/assets/index-41529ca7.js.LICENSE.txt +1 -0
- package/dist/client/v/browser-checker.js +76 -1
- package/dist/client/v/index.html +1 -1
- package/package.json +7 -7
- package/settingsDevProxy.ts +52 -0
- /package/dist/client/assets/{index-800d06ee.js.LICENSE.txt → index-c94119b4.js.LICENSE.txt} +0 -0
- /package/dist/client/{v/assets/index-2f7426fe.js.LICENSE.txt → settings/assets/32-88d3c82f.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*! For license information please see 108-76a3fdea.js.LICENSE.txt */
|
|
2
|
+
export const __rspack_esm_id="108";export const __rspack_esm_ids=["108"];export const __webpack_modules__={87799(e,t,n){e.exports=function(e){var t=[function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},function(e,t,n){"use strict";var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i<r.length;i++)null==(n=r[i]).getChild()?(n.moveBy(e,t),n.displacementX+=e,n.displacementY+=t):n.propogateDisplacementToChildren(e,t)},a.prototype.setPred1=function(e){this.pred1=e},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(e){this.next=e},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(e){this.processed=e},a.prototype.isProcessed=function(){return processed},e.exports=a},function(e,t,n){"use strict";var r=n(0).FDLayout,i=n(4),a=n(3),o=n(5),s=n(2),l=n(1),u=n(0).FDLayoutConstants,h=n(0).LayoutConstants,c=n(0).Point,d=n(0).PointD,p=n(0).Layout,g=n(0).Integer,f=n(0).IGeometry,v=n(0).LGraph,y=n(0).Transform;function b(){r.call(this),this.toBeTiled={}}for(var x in b.prototype=Object.create(r.prototype),r)b[x]=r[x];b.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},b.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},b.prototype.newNode=function(e){return new o(this.graphManager,e)},b.prototype.newEdge=function(e){return new s(null,null,e)},b.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=u.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=u.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=u.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},b.prototype.layout=function(){return h.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},b.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},b.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},b.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},b.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},b.prototype.calculateNodesToApplyGravitationTo=function(){var e,t,n=[],r=this.graphManager.getGraphs(),i=r.length;for(t=0;t<i;t++)(e=r[t]).updateConnected(),e.isConnected||(n=n.concat(e.getNodes()));return n},b.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t=new Set;for(a=0;a<e.length;a++){var n=e[a];if(!t.has(n)){var r=n.getSource(),i=n.getTarget();if(r==i)n.getBendpoints().push(new d),n.getBendpoints().push(new d),this.createDummyNodesForBendpoints(n),t.add(n);else{var a,o,s=[];if(s=(s=s.concat(r.getEdgeListToNode(i))).concat(i.getEdgeListToNode(r)),!t.has(s[0])){if(s.length>1)for(o=0;o<s.length;o++){var l=s[o];l.getBendpoints().push(new d),this.createDummyNodesForBendpoints(l)}s.forEach(function(e){t.add(e)})}}}if(t.size==e.length)break}},b.prototype.positionNodesRadially=function(e){for(var t=new c(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new d(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,0!=s&&(i+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var u=e[s],g=p.findCenterOfTree(u);t.x=a,t.y=i,(o=b.radialLayout(u,g,t)).y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(h.WORLD_CENTER_X-o.x/2,h.WORLD_CENTER_Y-o.y/2))},b.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);b.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++)e[o].transform(a);var s=new d(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(s)},b.branchRadialLayout=function(e,t,n,r,i,a){var o,s=(r-n+1)/2;s<0&&(s+=180);var l=(s+n)%360*f.TWO_PI/360,u=i*Math.cos(l),h=i*Math.sin(l);e.setCenter(u,h);var c=[],d=(c=c.concat(e.getEdges())).length;null!=t&&d--;for(var p=0,g=c.length,v=e.getEdgesBetween(t);v.length>1;){var y=v[0];v.splice(0,1);var x=c.indexOf(y);x>=0&&c.splice(x,1),g--,d--}o=null!=t?(c.indexOf(v[0])+1)%g:0;for(var w=Math.abs(r-n)/d,E=o;p!=d;E=++E%g){var _=c[E].getOtherEnd(e);if(_!=t){var T=(n+p*w)%360,D=(T+w)%360;b.branchRadialLayout(_,e,T,D,i+a,a),p++}}},b.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},b.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},b.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=r[i],s=a.getParent();0!==this.getNodeDegreeWithChildren(a)||void 0!=s.id&&this.getToBeTiled(s)||n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],l=a.getParent().id;void 0===t[l]&&(t[l]=[]),t[l]=t[l].concat(a)}Object.keys(t).forEach(function(n){if(t[n].length>1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var u=0;u<t[n].length;u++){var h=t[n][u];l.remove(h),s.add(h)}}})},b.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},b.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height})},b.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},b.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},b.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(null==a.getChild()){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},b.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;r<t.length;r++){var i=t[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},b.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(null==e.getChild())return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},b.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},b.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},b.prototype.adjustLocations=function(e,t,n,r,i){t+=r,n+=i;for(var a=t,o=0;o<e.rows.length;o++){var s=e.rows[o];t=a;for(var l=0,u=0;u<s.length;u++){var h=s[u];h.rect.x=t,h.rect.y=n,t+=h.rect.width+e.horizontalPadding,h.rect.height>l&&(l=h.rect.height)}n+=l+e.verticalPadding}},b.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},b.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height<t.rect.width*t.rect.height)});for(var r=0;r<e.length;r++){var i=e[r];0==n.rows.length?this.insertNodeToRow(n,i,0,t):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),t):this.insertNodeToRow(n,i,n.rows.length,t),this.shiftToLastRow(n)}return n},b.prototype.insertNodeToRow=function(e,t,n,r){n==e.rows.length&&(e.rows.push([]),e.rowWidth.push(r),e.rowHeight.push(0));var i=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(i+=e.horizontalPadding),e.rowWidth[n]=i,e.width<i&&(e.width=i);var a=t.rect.height;n>0&&(a+=e.verticalPadding);var o=0;a>e.rowHeight[n]&&(o=e.rowHeight[n],e.rowHeight[n]=a,o=e.rowHeight[n]-o),e.height+=o,e.rows[n].push(t)},b.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},b.prototype.getLongestRowIndex=function(e){for(var t=-1,n=5e-324,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},b.prototype.canAddHorizontal=function(e,t,n){var r,i,a=this.getShortestRowIndex(e);if(a<0)return!0;var o=e.rowWidth[a];if(o+e.horizontalPadding+t<=e.width)return!0;var s=0;return e.rowHeight[a]<n&&a>0&&(s=n+e.verticalPadding-e.rowHeight[a]),r=e.width-o>=t+e.horizontalPadding?(e.height+s)/(o+t+e.horizontalPadding):(e.height+s)/e.width,s=n+e.verticalPadding,(i=e.width<t?(e.height+s)/t:(e.height+s)/e.width)<1&&(i=1/i),r<1&&(r=1/r),r<i},b.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=5e-324,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var u=e.rowHeight[t]+e.rowHeight[n];e.height+=u-l,this.shiftToLastRow(e)}},b.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},b.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},b.prototype.reduceTrees=function(){for(var e,t=[],n=!0;n;){var r=this.graphManager.getAllNodes(),i=[];n=!1;for(var a=0;a<r.length;a++)1!=(e=r[a]).getEdges().length||e.getEdges()[0].isInterGraph||null!=e.getChild()||(i.push([e,e.getEdges()[0],e.getOwner()]),n=!0);if(!0==n){for(var o=[],s=0;s<i.length;s++)1==i[s][0].getEdges().length&&(o.push(i[s]),i[s][0].getOwner().remove(i[s][0]));t.push(o),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=t},b.prototype.growTree=function(e){for(var t,n=e.length,r=e[n-1],i=0;i<r.length;i++)t=r[i],this.findPlaceforPrunedNode(t),t[2].add(t[0]),t[2].add(t[1],t[1].source,t[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},b.prototype.findPlaceforPrunedNode=function(e){var t,n,r,i,a=e[0],o=(n=a==e[1].source?e[1].target:e[1].source).startX,s=n.finishX,l=n.startY,h=n.finishY,c=[0,0,0,0];if(l>0)for(var d=o;d<=s;d++)c[0]+=this.grid[d][l-1].length+this.grid[d][l].length-1;if(s<this.grid.length-1)for(var d=l;d<=h;d++)c[1]+=this.grid[s+1][d].length+this.grid[s][d].length-1;if(h<this.grid[0].length-1)for(var d=o;d<=s;d++)c[2]+=this.grid[d][h+1].length+this.grid[d][h].length-1;if(o>0)for(var d=l;d<=h;d++)c[3]+=this.grid[o-1][d].length+this.grid[o][d].length-1;for(var p=g.MAX_VALUE,f=0;f<c.length;f++)c[f]<p?(p=c[f],r=1,i=f):c[f]==p&&r++;if(3==r&&0==p)0==c[0]&&0==c[1]&&0==c[2]?t=1:0==c[0]&&0==c[1]&&0==c[3]?t=0:0==c[0]&&0==c[2]&&0==c[3]?t=3:0==c[1]&&0==c[2]&&0==c[3]&&(t=2);else if(2==r&&0==p){var v=Math.floor(2*Math.random());t=0==c[0]&&0==c[1]?+(0!=v):0==c[0]&&0==c[2]?2*(0!=v):0==c[0]&&0==c[3]?3*(0!=v):0==c[1]&&0==c[2]?0==v?1:2:0==c[1]&&0==c[3]?0==v?1:3:0==v?2:3}else if(4==r&&0==p){var v=Math.floor(4*Math.random());t=v}else t=i;0==t?a.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-a.getHeight()/2):1==t?a.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+a.getWidth()/2,n.getCenterY()):2==t?a.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+a.getHeight()/2):a.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-a.getWidth()/2,n.getCenterY())},e.exports=b},function(e,t,n){"use strict";var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),e.exports=r}],n={};function r(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=n,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}(n(23143))},43457(e,t,n){e.exports=function(e){var t=[function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,l=n(0).layoutBase.PointD,u=n(0).layoutBase.DimensionD,h={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(e){this.options=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}(h,e),d(this.options)}var d=function(e){null!=e.nodeRepulsion&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),null!=e.idealEdgeLength&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),null!=e.edgeElasticity&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),null!=e.nestingFactor&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),"draft"==e.quality?r.QUALITY=0:"proof"==e.quality?r.QUALITY=2:r.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};c.prototype.run=function(){var e,t,n=this.options;this.idToLNode={};var r=this.layout=new o,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),l=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var u=0;u<l.length;u++){var h=l[u],c=this.idToLNode[h.data("source")],d=this.idToLNode[h.data("target")];c!==d&&0==c.getEdgesBetween(d).length&&(a.add(r.newEdge(),c,d).id=h.id())}var p=function(e,t){"number"==typeof e&&(e=t);var n=e.data("id"),r=i.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},g=function a(){for(var o,s=function(){n.fit&&n.cy.fit(n.eles,n.padding),e||(e=!0,i.cy.one("layoutready",n.ready),i.cy.trigger({type:"layoutready",layout:i}))},l=i.options.refresh,u=0;u<l&&!o;u++)o=i.stopped||i.layout.tick();if(o){r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,i.options.eles.nodes().positions(p),s(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),t&&cancelAnimationFrame(t),e=!1;return}var h=i.layout.getPositionsData();n.eles.nodes().positions(function(e,t){if("number"==typeof e&&(e=t),!e.isParent()){for(var n=e.id(),r=h[n],i=e;null==r&&(r=h[i.data("parent")]||h["DummyCompound_"+i.data("parent")],h[n]=r,void 0!=(i=i.parent()[0])););return null!=r?{x:r.x,y:r.y}:{x:e.position("x"),y:e.position("y")}}}),s(),t=requestAnimationFrame(a)};return r.addListener("layoutstarted",function(){"during"===i.options.animate&&(t=requestAnimationFrame(g))}),r.runLayout(),"during"!==this.options.animate&&(i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,p),e=!1),this},c.prototype.getTopMostNodes=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;return e.filter(function(e,n){"number"==typeof e&&(e=n);for(var r=e.parent()[0];null!=r;){if(t[r.id()])return!1;r=r.parent()[0]}return!0})},c.prototype.processChildrenList=function(e,t,n){for(var r=t.length,i=0;i<r;i++){var a,o,h=t[i],c=h.children(),d=h.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((a=null!=h.outerWidth()&&null!=h.outerHeight()?e.add(new s(n.graphManager,new l(h.position("x")-d.w/2,h.position("y")-d.h/2),new u(parseFloat(d.w),parseFloat(d.h)))):e.add(new s(this.graphManager))).id=h.data("id"),a.paddingLeft=parseInt(h.css("padding")),a.paddingTop=parseInt(h.css("padding")),a.paddingRight=parseInt(h.css("padding")),a.paddingBottom=parseInt(h.css("padding")),this.options.nodeDimensionsIncludeLabels&&h.isParent()){var p=h.boundingBox({includeLabels:!0,includeNodes:!1}).w,g=h.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=h.css("text-halign");a.labelWidth=p,a.labelHeight=g,a.labelPos=f}this.idToLNode[h.data("id")]=a,isNaN(a.rect.x)&&(a.rect.x=0),isNaN(a.rect.y)&&(a.rect.y=0),null!=c&&c.length>0&&(o=n.getGraphManager().add(n.newGraph(),a),this.processChildrenList(o,c,n))}},c.prototype.stop=function(){return this.stopped=!0,this};var p=function(e){e("layout","cose-bilkent",c)};"u">typeof cytoscape&&p(cytoscape),e.exports=p}],n={};function r(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=n,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}(n(87799))},93409(e,t,n){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var l,u,h,c,d,p,g,f,v,y,b,x,w,E,_,T,D,C,N,A,L="u"<typeof window?null:window,S=L?L.navigator:null;L&&L.document;var k=e(""),I=e({}),O=e(function(){}),M="u"<typeof HTMLElement?"undefined":e(HTMLElement),P=function(e){return e&&e.instanceString&&B(e.instanceString)?e.instanceString():null},R=function(t){return null!=t&&e(t)==k},B=function(t){return null!=t&&e(t)===O},F=function(e){return!X(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},z=function(t){return null!=t&&e(t)===I&&!F(t)&&t.constructor===Object},G=function(t){return null!=t&&e(t)===e(1)&&!isNaN(t)},Y=function(e){if("undefined"!==M)return null!=e&&e instanceof HTMLElement},X=function(e){return V(e)||U(e)},V=function(e){return"collection"===P(e)&&e._private.single},U=function(e){return"collection"===P(e)&&!e._private.single},j=function(e){return"core"===P(e)},q=function(e){return"stylesheet"===P(e)},H=function(e){return null==e||!!(""===e||e.match(/^\s+$/))},W=function(t){return null!=t&&e(t)===I&&B(t.then)},$=function(e,t){t||(t=function(){if(1==arguments.length)return arguments[0];if(0==arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=arguments,a=t.apply(this,i),o=n.cache;return(r=o[a])||(r=o[a]=e.apply(this,i)),r};return n.cache={},n},K=$(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Z=$(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Q=$(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),J=function(e){return H(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ee="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",et="rgb[a]?\\(("+ee+"[%]?)\\s*,\\s*("+ee+"[%]?)\\s*,\\s*("+ee+"[%]?)(?:\\s*,\\s*("+ee+"))?\\)",en="rgb[a]?\\((?:"+ee+"[%]?)\\s*,\\s*(?:"+ee+"[%]?)\\s*,\\s*(?:"+ee+"[%]?)(?:\\s*,\\s*(?:"+ee+"))?\\)",er="hsl[a]?\\(("+ee+")\\s*,\\s*("+ee+"[%])\\s*,\\s*("+ee+"[%])(?:\\s*,\\s*("+ee+"))?\\)",ei="hsl[a]?\\((?:"+ee+")\\s*,\\s*(?:"+ee+"[%])\\s*,\\s*(?:"+ee+"[%])(?:\\s*,\\s*(?:"+ee+"))?\\)",ea=function(e,t){return e<t?-1:+(e>t)},eo=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e},es=function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r;return 4===e.length?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(t=parseInt(e[1]+e[2],16),n=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),[t,n,r]}},el=function(e){function t(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,i,a,o,s,l,u,h=RegExp("^"+er+"$").exec(e);if(h){if((r=parseInt(h[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(i=parseFloat(h[2]))<0||i>100||(i/=100,(a=parseFloat(h[3]))<0||a>100)||(a/=100,void 0!==(o=h[4])&&((o=parseFloat(o))<0||o>1)))return;if(0===i)s=l=u=Math.round(255*a);else{var c=a<.5?a*(1+i):a+i-a*i,d=2*a-c;s=Math.round(255*t(d,c,r+1/3)),l=Math.round(255*t(d,c,r)),u=Math.round(255*t(d,c,r-1/3))}n=[s,l,u,o]}return n},eu=function(e){var t,n=RegExp("^"+et+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t},eh={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ec=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(z(a))throw Error("Tried to set map with object key");i<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},ed=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(z(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))break}return t},ep=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},eg="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{},ef="object"==typeof eg&&eg&&eg.Object===Object&&eg,ev="object"==typeof self&&self&&self.Object===Object&&self,ey=ef||ev||Function("return this")(),em=function(){return ey.Date.now()},eb=/\s/,ex=function(e){for(var t=e.length;t--&&eb.test(e.charAt(t)););return t},ew=/^\s+/,eE=ey.Symbol,e_=Object.prototype,eT=e_.hasOwnProperty,eD=e_.toString,eC=eE?eE.toStringTag:void 0,eN=function(e){var t=eT.call(e,eC),n=e[eC];try{e[eC]=void 0;var r=!0}catch(e){}var i=eD.call(e);return r&&(t?e[eC]=n:delete e[eC]),i},eA=Object.prototype.toString,eL=eE?eE.toStringTag:void 0,eS=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":eL&&eL in Object(e)?eN(e):eA.call(e)},ek=function(e){return"symbol"==typeof e||null!=e&&"object"==typeof e&&"[object Symbol]"==eS(e)},eI=0/0,eO=/^[-+]0x[0-9a-f]+$/i,eM=/^0b[01]+$/i,eP=/^0o[0-7]+$/i,eR=parseInt,eB=function(e){if("number"==typeof e)return e;if(ek(e))return eI;if(ep(e)){var t,n="function"==typeof e.valueOf?e.valueOf():e;e=ep(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,ex(t)+1).replace(ew,""):t;var r=eM.test(e);return r||eP.test(e)?eR(e.slice(2),r?2:8):eO.test(e)?eI:+e},eF=Math.max,ez=Math.min,eG=function(e,t,n){var r,i,a,o,s,l,u=0,h=!1,c=!1,d=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function g(e){var n=e-l,r=e-u;return void 0===l||n>=t||n<0||c&&r>=a}function f(){var e,n,r,i=em();if(g(i))return v(i);s=setTimeout(f,(e=i-l,n=i-u,r=t-e,c?ez(r,a-n):r))}function v(e){return(s=void 0,d&&r)?p(e):(r=i=void 0,o)}function y(){var e,n=em(),a=g(n);if(r=arguments,i=this,l=n,a){if(void 0===s)return u=e=l,s=setTimeout(f,t),h?p(e):o;if(c)return clearTimeout(s),s=setTimeout(f,t),p(l)}return void 0===s&&(s=setTimeout(f,t)),o}return t=eB(t)||0,ep(n)&&(h=!!n.leading,a=(c="maxWait"in n)?eF(eB(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?o:v(em())},y},eY=L?L.performance:null,eX=eY&&eY.now?function(){return eY.now()}:function(){return Date.now()},eV=function(){if(L){if(L.requestAnimationFrame)return function(e){L.requestAnimationFrame(e)};else if(L.mozRequestAnimationFrame)return function(e){L.mozRequestAnimationFrame(e)};else if(L.webkitRequestAnimationFrame)return function(e){L.webkitRequestAnimationFrame(e)};else if(L.msRequestAnimationFrame)return function(e){L.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(eX())},1e3/60)}}(),eU=function(e){return eV(e)},ej=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(t=e.next()).done;)r=65599*r+t.value|0;return r},eq=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return 65599*t+e|0},eH=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(t<<5)+t+e|0},eW=function(e){return 2097152*e[0]+e[1]},e$=function(e,t){return[eq(e[0],t[0]),eH(e[1],t[1])]},eK=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return ej({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},eZ=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return ej({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},eQ=function(){return eJ(arguments)},eJ=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?eZ(r):eZ(r,t)}return t},e0=!0,e1=null!=console.warn,e2=null!=console.trace,e5=Number.MAX_SAFE_INTEGER||0x1fffffffffffff,e3=function(){return!0},e4=function(){return!1},e9=function(){return 0},e6=function(){},e8=function(e){throw Error(e)},e7=function(e){if(void 0===e)return e0;e0=!!e},te=function(e){e7()&&(e1?console.warn(e):(console.log(e),e2&&console.trace()))},tt=function(e){return null==e?e:F(e)?e.slice():z(e)?eo({},e):e},tn=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},tr={},ti=function(){return tr},ta=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=null==n?void 0:n[a];r[a]=void 0===o?e[a]:o}return r}},to=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},ts=function(e){e.splice(0,e.length)},tl=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},tu=function(e,t,n){return n&&(t=Q(n,t)),e[t]},th=function(e,t,n,r){n&&(t=Q(n,t)),e[t]=r},tc=function(){function e(){t(this,e),this._obj={}}return i(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),td="u">typeof Map?Map:tc,tp=function(){function e(n){if(t(this,e),this._obj=Object.create(null),this.size=0,null!=n){var r;r=null!=n.instanceString&&n.instanceString()===this.instanceString()?n.toArray():n;for(var i=0;i<r.length;i++)this.add(r[i])}}return i(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),tg=("u"<typeof Set?"undefined":e(Set))!=="undefined"?Set:tp,tf=function(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0===e||void 0===t||!j(e))return void e8("An element must have a core reference and parameters set");var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"!==r&&"edges"!==r)return void e8("An element must be of type `nodes` or `edges`; you specified `"+r+"`");this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new tg,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];F(t.classes)?l=t.classes:R(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,h=l.length;u<h;u++){var c=l[u];c&&""!==c&&i.classes.add(c)}this.createEmitter();var d=t.style||t.css;d&&(te("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(void 0===n||n)&&this.restore()},tv=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){z(t)&&!X(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!=arguments.length||B(n)?r:n,n=B(n)?n:function(){};for(var i,a,o=this._private.cy,s=t=R(t)?this.filter(t):t,l=[],u=[],h={},c={},d={},p=0,g=this.byGroup(),f=g.nodes,v=g.edges,y=0;y<s.length;y++){var b=s[y],x=b.id();b.isNode()&&(l.unshift(b),e.bfs&&(d[x]=!0,u.push(b)),c[x]=0)}for(;0!==l.length;){var w=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return"continue";d[i]=!0,u.push(t)}var o=c[i],s=h[i],g=null!=s?s.source():null,y=null!=s?s.target():null,b=null==s?void 0:t.same(g)?y[0]:g[0],x=void 0;if(!0===(x=n(t,s,b,p++,o)))return a=t,"break";if(!1===x)return"break";for(var w=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&v.has(e)}),E=0;E<w.length;E++){var _=w[E],T=_.connectedNodes().filter(function(e){return!e.same(t)&&f.has(e)}),D=T.id();0===T.length||d[D]||(T=T[0],l.push(T),e.bfs&&(d[D]=!0,u.push(T)),h[D]=_,c[D]=c[i]+1)}}();if("continue"!==w&&"break"===w)break}for(var E=o.collection(),_=0;_<u.length;_++){var T=u[_],D=h[T.id()];null!=D&&E.push(D),E.push(T)}return{path:o.collection(E),found:o.collection(a)}}},ty={breadthFirstSearch:tv({bfs:!0}),depthFirstSearch:tv({dfs:!0})};ty.bfs=ty.breadthFirstSearch,ty.dfs=ty.depthFirstSearch;var tm=(l=h={exports:{}},u=h.exports,(function(){var e,t,n,r,i,a,o,s,u,h,c,d,p,g;t=Math.floor,u=Math.min,e=function(e,t){return e<t?-1:+(e>t)},s=function(n,r,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=e),i<0)throw Error("lo must be non-negative");for(null==a&&(a=n.length);i<a;)0>o(r,n[s=t((i+a)/2)])?a=s:i=s+1;return[].splice.apply(n,[i,i-i].concat(r)),r},i=function(t,n,r){return null==r&&(r=e),t.push(n),p(t,0,t.length-1,r)},r=function(t,n){var r,i;return null==n&&(n=e),r=t.pop(),t.length?(i=t[0],t[0]=r,g(t,0,n)):i=r,i},o=function(t,n,r){var i;return null==r&&(r=e),i=t[0],t[0]=n,g(t,0,r),i},a=function(t,n,r){var i;return null==r&&(r=e),t.length&&0>r(t[0],n)&&(n=(i=[t[0],n])[0],t[0]=i[1],g(t,0,r)),n},n=function(n,r){var i,a,o,s,l,u;for(null==r&&(r=e),s=(function(){u=[];for(var e=0,r=t(n.length/2);0<=r?e<r:e>r;0<=r?e++:e--)u.push(e);return u}).apply(this).reverse(),l=[],a=0,o=s.length;a<o;a++)i=s[a],l.push(g(n,i,r));return l},d=function(t,n,r){var i;if(null==r&&(r=e),-1!==(i=t.indexOf(n)))return p(t,0,i,r),g(t,i,r)},h=function(t,r,i){var o,s,l,u;if(null==i&&(i=e),!(o=t.slice(0,r)).length)return o;for(n(o,i),s=0,l=(u=t.slice(r)).length;s<l;s++)a(o,u[s],i);return o.sort(i).reverse()},c=function(t,i,a){var o,l,h,c,d,p,g,f,v;if(null==a&&(a=e),10*i<=t.length){if(!(h=t.slice(0,i).sort(a)).length)return h;for(c=0,l=h[h.length-1],p=(g=t.slice(i)).length;c<p;c++)0>a(o=g[c],l)&&(s(h,o,0,null,a),h.pop(),l=h[h.length-1]);return h}for(n(t,a),v=[],d=0,f=u(i,t.length);0<=f?d<f:d>f;0<=f?++d:--d)v.push(r(t,a));return v},p=function(t,n,r,i){var a,o,s;for(null==i&&(i=e),a=t[r];r>n;){if(0>i(a,o=t[s=r-1>>1])){t[r]=o,r=s;continue}break}return t[r]=a},g=function(t,n,r){var i,a,o,s,l;for(null==r&&(r=e),a=t.length,l=n,o=t[n],i=2*n+1;i<a;)(s=i+1)<a&&!(0>r(t[i],t[s]))&&(i=s),t[n]=t[i],i=2*(n=i)+1;return t[n]=o,p(t,l,n,r)},l.exports=function(){function t(t){this.cmp=null!=t?t:e,this.nodes=[]}return t.push=i,t.pop=r,t.replace=o,t.pushpop=a,t.heapify=n,t.updateItem=d,t.nlargest=h,t.nsmallest=c,t.prototype.push=function(e){return i(this.nodes,e,this.cmp)},t.prototype.pop=function(){return r(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(e){return -1!==this.nodes.indexOf(e)},t.prototype.replace=function(e){return o(this.nodes,e,this.cmp)},t.prototype.pushpop=function(e){return a(this.nodes,e,this.cmp)},t.prototype.heapify=function(){return n(this.nodes,this.cmp)},t.prototype.updateItem=function(e){return d(this.nodes,e,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return(e=new t).nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}()}).call(eg),h.exports),tb=ta({root:null,weight:function(e){return 1},directed:!1}),tx=ta({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),tw=ta({weight:function(e){return 1},directed:!1}),tE=ta({weight:function(e){return 1},directed:!1,root:null}),t_=Math.sqrt(2),tT=function(e,t,n){0===n.length&&e8("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n.length-1;l>=0;l--){var u=n[l],h=u[1],c=u[2];(t[h]===o&&t[c]===s||t[h]===s&&t[c]===o)&&n.splice(l,1)}for(var d=0;d<n.length;d++){var p=n[d];p[1]===s?(n[d]=p.slice(),n[d][1]=o):p[2]===s&&(n[d]=p.slice(),n[d][2]=o)}for(var g=0;g<t.length;g++)t[g]===s&&(t[g]=o);return n},tD=function(e,t,n,r){for(;n>r;)t=tT(Math.floor(Math.random()*t.length),e,t),n--;return t},tC=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},tN=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},tA=function(e){return{x:e[0],y:e[1]}},tL=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r},tS=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r},tk=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i},tI=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=!(arguments.length>5)||void 0===arguments[5]||arguments[5];r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var l=e[s];a?!isFinite(l)&&(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort(function(e,t){return e-t});var u=e.length,h=Math.floor(u/2);return u%2!=0?e[h+1+o]:(e[h-1+o]+e[h+o])/2},tO=function(e,t){return Math.atan2(t,e)-Math.PI/2},tM=Math.log2||function(e){return Math.log(e)/Math.log(2)},tP=function(e){return e>0?1:e<0?-1:0},tR=function(e,t){return Math.sqrt(tB(e,t))},tB=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},tF=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},tz=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},tG=function(e,t,n,r){return{x:tz(e.x,t.x,n.x,r),y:tz(e.y,t.y,n.y,r)}},tY=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=tR(e,t),o={x:i.x/a,y:i.y/a};return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+o.x*r,y:e.y+o.y*r}},tX=function(e,t,n){return Math.max(e,Math.min(n,t))},tV=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};else if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},tU=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},tj=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},tq=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tH=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tW=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var s=o(a,4);t=s[0],n=s[1],r=s[2],i=s[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},t$=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},tK=function(e,t){return!(e.x1>t.x2)&&!(t.x1>e.x2)&&!(e.x2<t.x1)&&!(t.x2<e.x1)&&!(e.y2<t.y1)&&!(t.y2<e.y1)&&!(e.y1>t.y2)&&!(t.y1>e.y2)&&!0},tZ=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},tQ=function(e,t){return tZ(e,t.x1,t.y1)&&tZ(e,t.x2,t.y2)},tJ=function(e,t,n,r,i,a,o){var s,l,u=nd(i,a),h=i/2,c=a/2,d=n-h+u-o,p=r-c-o,g=n+h-u+o;if((s=na(e,t,n,r,d,p,g,p,!1)).length>0)return s;var f=n+h+o,v=r-c+u-o,y=r+c-u+o;if((s=na(e,t,n,r,f,v,f,y,!1)).length>0)return s;var b=n-h+u-o,x=r+c+o,w=n+h-u+o;if((s=na(e,t,n,r,b,x,w,x,!1)).length>0)return s;var E=n-h-o,_=r-c+u-o,T=r+c-u+o;if((s=na(e,t,n,r,E,_,E,T,!1)).length>0)return s;var D=n-h+u,C=r-c+u;if((l=nr(e,t,n,r,D,C,u+o)).length>0&&l[0]<=D&&l[1]<=C)return[l[0],l[1]];var N=n+h-u,A=r-c+u;if((l=nr(e,t,n,r,N,A,u+o)).length>0&&l[0]>=N&&l[1]<=A)return[l[0],l[1]];var L=n+h-u,S=r+c-u;if((l=nr(e,t,n,r,L,S,u+o)).length>0&&l[0]>=L&&l[1]>=S)return[l[0],l[1]];var k=n-h+u,I=r+c-u;return(l=nr(e,t,n,r,k,I,u+o)).length>0&&l[0]<=k&&l[1]>=I?[l[0],l[1]]:[]},t0=function(e,t,n,r,i,a,o){var s=Math.min(n,i),l=Math.max(n,i),u=Math.min(r,a),h=Math.max(r,a);return s-o<=e&&e<=l+o&&u-o<=t&&t<=h+o},t1=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(e<u.x1)&&!(e>u.x2)&&!(t<u.y1)&&!(t>u.y2)},t2=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},t5=function(e,t,n,r,i){var a,o,s,l,u,h,c,d;if(0===e&&(e=1e-5),t/=e,n/=e,r/=e,a=(o=(3*n-t*t)/9)*o*o+(s=(-(27*r)+t*(9*n-t*t*2))/54)*s,i[1]=0,c=t/3,a>0){u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),h=(h=s-Math.sqrt(a))<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-c+u+h,c+=(u+h)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-h+u)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,0===a){d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}l=Math.acos(s/Math.sqrt(l=(o=-o)*o*o)),d=2*Math.sqrt(o),i[0]=-c+d*Math.cos(l/3),i[2]=-c+d*Math.cos((l+2*Math.PI)/3),i[4]=-c+d*Math.cos((l+4*Math.PI)/3)},t3=function(e,t,n,r,i,a,o,s){var l,u=[];t5(n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,u);for(var h=[],c=0;c<6;c+=2)1e-7>Math.abs(u[c+1])&&u[c]>=0&&u[c]<=1&&h.push(u[c]);h.push(1),h.push(0);for(var d=-1,p=0;p<h.length;p++)l=Math.pow(Math.pow(1-h[p],2)*n+2*(1-h[p])*h[p]*i+h[p]*h[p]*o-e,2)+Math.pow(Math.pow(1-h[p],2)*r+2*(1-h[p])*h[p]*a+h[p]*h[p]*s-t,2),d>=0?l<d&&(d=l):d=l;return d},t4=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],h=o[0]*s[0]+o[1]*s[1],c=h*h/l;return h<0?u:c>l?(e-i)*(e-i)+(t-a)*(t-a):u-c},t9=function(e,t,n){for(var r,i,a,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(a=n[(l+1)*2],o=n[(l+1)*2+1]):(a=n[(l+1-n.length/2)*2],o=n[(l+1-n.length/2)*2+1]),r==e&&a==e);else{if((!(r>=e)||!(e>=a))&&(!(r<=e)||!(e<=a)))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},t6=function(e,t,n,r,i,a,o,s,l){var u,h=Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var c=Math.cos(-u),d=Math.sin(-u),p=0;p<h.length/2;p++)h[2*p]=a/2*(n[2*p]*c-n[2*p+1]*d),h[2*p+1]=o/2*(n[2*p+1]*c+n[2*p]*d),h[2*p]+=r,h[2*p+1]+=i;return t9(e,t,l>0?t7(ne(h,-l)):h)},t8=function(e,t,n,r,i,a,o){for(var s=Array(n.length),l=a/2,u=o/2,h=np(a,o),c=h*h,d=0;d<n.length/4;d++){var p=void 0,g=void 0;p=0===d?n.length-2:4*d-2,g=4*d+2;var f=r+l*n[4*d],v=i+u*n[4*d+1],y=h/Math.tan(Math.acos(-n[p]*n[g]-n[p+1]*n[g+1])/2),b=f-y*n[p],x=v-y*n[p+1],w=f+y*n[g],E=v+y*n[g+1];s[4*d]=b,s[4*d+1]=x,s[4*d+2]=w,s[4*d+3]=E;var _=n[p+1],T=-n[p];if(_*n[g]+T*n[g+1]<0&&(_*=-1,T*=-1),Math.pow(b+_*h-e,2)+Math.pow(x+T*h-t,2)<=c)return!0}return t9(e,t,s)},t7=function(e){for(var t,n,r,i,a,o,s,l,u=Array(e.length/2),h=0;h<e.length/4;h++){t=e[4*h],n=e[4*h+1],r=e[4*h+2],i=e[4*h+3],h<e.length/4-1?(a=e[(h+1)*4],o=e[(h+1)*4+1],s=e[(h+1)*4+2],l=e[(h+1)*4+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var c=na(t,n,r,i,a,o,s,l,!0);u[2*h]=c[0],u[2*h+1]=c[1]}return u},ne=function(e,t){for(var n,r,i,a,o=Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[(s+1)*2],a=e[(s+1)*2+1]):(i=e[0],a=e[1]);var l=a-r,u=-(i-n),h=Math.sqrt(l*l+u*u),c=l/h,d=u/h;o[4*s]=n+c*t,o[4*s+1]=r+d*t,o[4*s+2]=i+c*t,o[4*s+3]=a+d*t}return o},nt=function(e,t,n,r,i,a){var o=n-e,s=r-t,l=Math.sqrt((o/=i)*o+(s/=a)*s),u=l-1;if(u<0)return[];var h=u/l;return[(n-e)*h+e,(r-t)*h+t]},nn=function(e,t,n,r,i,a,o){return e-=i,t-=a,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},nr=function(e,t,n,r,i,a,o){var s=[n-e,r-t],l=[e-i,t-a],u=s[0]*s[0]+s[1]*s[1],h=2*(l[0]*s[0]+l[1]*s[1]),c=h*h-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(c<0)return[];var d=(-h+Math.sqrt(c))/(2*u),p=(-h-Math.sqrt(c))/(2*u),g=Math.min(d,p),f=Math.max(d,p),v=[];if(g>=0&&g<=1&&v.push(g),f>=0&&f<=1&&v.push(f),0===v.length)return[];var y=v[0]*s[0]+e,b=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,b]:[y,b,v[1]*s[0]+e,v[1]*s[1]+t]:[y,b]},ni=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},na=function(e,t,n,r,i,a,o,s,l){var u=e-i,h=n-e,c=o-i,d=t-a,p=r-t,g=s-a,f=c*d-g*u,v=h*d-p*u,y=g*h-c*p;if(0!==y){var b=f/y,x=v/y;return -.001<=b&&b<=1.001&&-.001<=x&&x<=1.001||l?[e+b*h,t+b*p]:[]}return 0!==f&&0!==v?[]:ni(e,n,o)===o?[o,s]:ni(e,n,i)===i?[i,a]:ni(i,o,n)===n?[n,r]:[]},no=function(e,t,n,r,i,a,o,s){var l,u,h,c,d,p,g=[],f=Array(n.length),v=!0;if(null==a&&(v=!1),v){for(var y=0;y<f.length/2;y++)f[2*y]=n[2*y]*a+r,f[2*y+1]=n[2*y+1]*o+i;u=s>0?t7(ne(f,-s)):f}else u=n;for(var b=0;b<u.length/2;b++)h=u[2*b],c=u[2*b+1],b<u.length/2-1?(d=u[(b+1)*2],p=u[(b+1)*2+1]):(d=u[0],p=u[1]),0!==(l=na(e,t,r,i,h,c,d,p)).length&&g.push(l[0],l[1]);return g},ns=function(e,t,n,r,i,a,o,s){for(var l,u=[],h=Array(n.length),c=a/2,d=o/2,p=np(a,o),g=0;g<n.length/4;g++){var f=void 0,v=void 0;f=0===g?n.length-2:4*g-2,v=4*g+2;var y=r+c*n[4*g],b=i+d*n[4*g+1],x=p/Math.tan(Math.acos(-n[f]*n[v]-n[f+1]*n[v+1])/2),w=y-x*n[f],E=b-x*n[f+1],_=y+x*n[v],T=b+x*n[v+1];0===g?(h[n.length-2]=w,h[n.length-1]=E):(h[4*g-2]=w,h[4*g-1]=E),h[4*g]=_,h[4*g+1]=T;var D=n[f+1],C=-n[f];D*n[v]+C*n[v+1]<0&&(D*=-1,C*=-1),0!==(l=nr(e,t,r,i,w+D*p,E+C*p,p)).length&&u.push(l[0],l[1])}for(var N=0;N<h.length/4;N++)0!==(l=na(e,t,r,i,h[4*N],h[4*N+1],h[4*N+2],h[4*N+3],!1)).length&&u.push(l[0],l[1]);if(u.length>2){for(var A=[u[0],u[1]],L=Math.pow(A[0]-e,2)+Math.pow(A[1]-t,2),S=1;S<u.length/2;S++){var k=Math.pow(u[2*S]-e,2)+Math.pow(u[2*S+1]-t,2);k<=L&&(A[0]=u[2*S],A[1]=u[2*S+1],L=k)}return A}return u},nl=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},nu=function(e,t){var n=nc(e,t);return nh(n)},nh=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var u=2/(o-i),h=2/(s-a),c=0;c<r;c++)t=e[2*c]=e[2*c]*u,n=e[2*c+1]=e[2*c+1]*h,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-a);return e},nc=function(e,t){var n,r=1/e*2*Math.PI,i=e%2==0?Math.PI/2+r/2:Math.PI/2;i+=t;for(var a=Array(2*e),o=0;o<e;o++)n=o*r+i,a[2*o]=Math.cos(n),a[2*o+1]=Math.sin(-n);return a},nd=function(e,t){return Math.min(e/4,t/4,8)},np=function(e,t){return Math.min(e/10,t/10,8)},ng=function(){return 8},nf=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},nv=ta({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),ny=ta({root:null,weight:function(e){return 1},directed:!1,alpha:0}),nm={degreeCentralityNormalized:function(e){e=ny(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,l=0;l<r;l++){var u=n[l],h=u.id();e.root=u;var c=this.degreeCentrality(e);o<c.indegree&&(o=c.indegree),s<c.outdegree&&(s=c.outdegree),i[h]=c.indegree,a[h]=c.outdegree}return{indegree:function(e){return 0==o?0:(R(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return 0===s?0:(R(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var d={},p=0,g=0;g<r;g++){var f=n[g];e.root=f;var v=this.degreeCentrality(e);p<v.degree&&(p=v.degree),d[f.id()]=v.degree}return{degree:function(e){return 0===p?0:(R(e)&&(e=t.filter(e)),d[e.id()]/p)}}},degreeCentrality:function(e){e=ny(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var l=i.connectedEdges(),u=l.filter(function(e){return e.target().same(i)&&n.has(e)}),h=l.filter(function(e){return e.source().same(i)&&n.has(e)}),c=u.length,d=h.length,p=0,g=0,f=0;f<u.length;f++)p+=a(u[f]);for(var v=0;v<h.length;v++)g+=a(h[v]);return{indegree:Math.pow(c,1-s)*Math.pow(p,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),b=y.length,x=0,w=0;w<y.length;w++)x+=a(y[w]);return{degree:Math.pow(b,1-s)*Math.pow(x,s)}}};nm.dc=nm.degreeCentrality,nm.dcn=nm.degreeCentralityNormalised=nm.degreeCentralityNormalized;var nb=ta({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),nx={closenessCentralityNormalized:function(e){for(var t=nb(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),h=0;h<l.length;h++){for(var c=0,d=l[h],p=0;p<l.length;p++)if(h!==p){var g=u.distance(d,l[p]);n?c+=1/g:c+=g}n||(c=1/c),s<c&&(s=c),o[d.id()]=c}return{closeness:function(e){return 0==s?0:o[e=R(e)?a.filter(e)[0].id():e.id()]/s}}},closenessCentrality:function(e){var t=nb(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var h=l[u];if(!h.same(n)){var c=o.distanceTo(h);a?s+=1/c:s+=c}}return a?s:1/s}};nx.cc=nx.closenessCentrality,nx.ccn=nx.closenessCentralityNormalised=nx.closenessCentralityNormalized;var nw=ta({weight:null,directed:!1}),nE={betweennessCentrality:function(e){for(var t=nw(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),o=this.nodes(),s={},l={},u=0,h=function(e,t){l[e]=t,t>u&&(u=t)},c=function(e){return l[e]},d=0;d<o.length;d++){var p=o[d],g=p.id();n?s[g]=p.outgoers().nodes():s[g]=p.openNeighborhood().nodes(),h(g,0)}for(var f=0;f<o.length;f++)!function(e){for(var t=o[e].id(),n=[],l={},u={},d={},p=new tm(function(e,t){return d[e]-d[t]}),g=0;g<o.length;g++){var f=o[g].id();l[f]=[],u[f]=0,d[f]=1/0}for(u[t]=1,d[t]=0,p.push(t);!p.empty();){var v=p.pop();if(n.push(v),i)for(var y=0;y<s[v].length;y++){var b=s[v][y],x=a.getElementById(v),w=r(x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0]);d[b=b.id()]>d[v]+w&&(d[b]=d[v]+w,0>p.nodes.indexOf(b)?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),d[b]==d[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E<s[v].length;E++){var _=s[v][E].id();d[_]==1/0&&(p.push(_),d[_]=d[v]+1),d[_]==d[v]+1&&(u[_]=u[_]+u[v],l[_].push(v))}}for(var T={},D=0;D<o.length;D++)T[o[D].id()]=0;for(;n.length>0;){for(var C=n.pop(),N=0;N<l[C].length;N++){var A=l[C][N];T[A]=T[A]+u[A]/u[C]*(1+T[C])}C!=o[e].id()&&h(C,c(C)+T[C])}}(f);var v={betweenness:function(e){return c(a.collection(e).id())},betweennessNormalized:function(e){return 0==u?0:c(a.collection(e).id())/u}};return v.betweennessNormalised=v.betweennessNormalized,v}};nE.bc=nE.betweennessCentrality;var n_=ta({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),nT=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},nD=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},nC=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},nN=function(e,t,n){for(var r=Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},nA=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=nN(e,r,t);return e},nL=function(e,t,n){for(var r=Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return nC(r,t),r},nS=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!=Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1;return!0},nk=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[a*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i},nI=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},nO=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&nI(e[t],e[n])&&e.splice(n,1);return e},nM=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=n_(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s,l=t.length,u=l*l,h=Array(u),c=0;c<u;c++)h[c]=0;for(var d=0;d<n.length;d++){var p=n[d],g=a[p.source().id()],f=a[p.target().id()],v=nT(p,i.attributes);h[g*l+f]+=v,h[f*l+g]+=v}nD(h,l,i.multFactor),nC(h,l);for(var y=!0,b=0;y&&b<i.maxIterations;)y=!1,nS(h=nL(s=nA(h,l,i.expandFactor),l,i.inflateFactor),s,u,4)||(y=!0),b++;var x=nk(h,l,t,r);return nO(x)},nP=function(e){return e},nR=function(e,t){return Math.abs(t-e)},nB=function(e,t,n){return e+nR(t,n)},nF=function(e,t,n){return e+Math.pow(n-t,2)},nz=function(e){return Math.sqrt(e)},nG=function(e,t,n){return Math.max(e,nR(t,n))},nY=function(e,t,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:nP,o=r,s=0;s<e;s++)o=i(o,t(s),n(s));return a(o)},nX={euclidean:function(e,t,n){return e>=2?nY(e,t,n,0,nF,nz):nY(e,t,n,0,nB)},squaredEuclidean:function(e,t,n){return nY(e,t,n,0,nF)},manhattan:function(e,t,n){return nY(e,t,n,0,nB)},max:function(e,t,n){return nY(e,t,n,-1/0,nG)}};function nV(e,t,n,r,i,a){var o;return(o=B(e)?e:nX[e]||nX.euclidean,0===t&&B(e))?o(i,a):o(t,n,r,i,a)}nX["squared-euclidean"]=nX.squaredEuclidean,nX.squaredeuclidean=nX.squaredEuclidean;var nU=ta({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nj=function(e){return nU(e)},nq=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)};return nV(e,r.length,a,function(e){return r[e](t)},n,t)},nH=function(e,t,n){for(var r=n.length,i=Array(r),a=Array(r),o=Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,a[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var h=0;h<r;h++)s[h]=Math.random()*(a[h]-i[h])+i[h];o[u]=s}return o},nW=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var l=nq(n,e,t[s],r,i);l<a&&(a=l,o=s)}return o},n$=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)n[(i=t[a]).id()]===e&&r.push(i);return r},nK=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},nZ=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},nQ=function(e,t){var n=Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];nZ(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},nJ=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=nq("manhattan",t[i],e,n,"kMedoids");return r},n0=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var u=0;u<e.length;u++)for(var h=0;h<i.attributes.length;h++){a=0,o=0;for(var c=0;c<t.length;c++)a+=r[c][u]*i.attributes[h](t[c]),o+=r[c][u];e[u][h]=a/o}},n1=function(e,t,n,r,i){for(var a,o=0;o<e.length;o++)t[o]=e[o].slice();for(var s=2/(i.m-1),l=0;l<n.length;l++)for(var u=0;u<r.length;u++){a=0;for(var h=0;h<n.length;h++)a+=Math.pow(nq(i.distance,r[u],n[l],i.attributes,"cmeans")/nq(i.distance,r[u],n[h],i.attributes,"cmeans"),s);e[u][l]=1/a}},n2=function(e,t,n,r){for(var i,a,o=Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){i=-1/0,a=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],a=u);o[a].push(e[l])}for(var h=0;h<o.length;h++)o[h]=r.collection(o[h]);return o},n5=function(e){var t,n,r,i,a=this.cy(),o=this.nodes(),s=nj(e);r=Array(o.length);for(var l=0;l<o.length;l++)r[l]=Array(s.k);n=Array(o.length);for(var u=0;u<o.length;u++)n[u]=Array(s.k);for(var h=0;h<o.length;h++){for(var c=0,d=0;d<s.k;d++)n[h][d]=Math.random(),c+=n[h][d];for(var p=0;p<s.k;p++)n[h][p]=n[h][p]/c}t=Array(s.k);for(var g=0;g<s.k;g++)t[g]=Array(s.attributes.length);i=Array(o.length);for(var f=0;f<o.length;f++)i[f]=Array(s.k);for(var v=!0,y=0;v&&y<s.maxIterations;)v=!1,n0(t,o,n,i,s),n1(n,r,t,o,s),nK(n,r,s.sensitivityThreshold)||(v=!0),y++;return{clusters:n2(o,n,s,a),degreeOfMembership:n}},n3=ta({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),n4={single:"min",complete:"max"},n9=function(e){var t=n3(e),n=n4[t.linkage];return null!=n&&(t.linkage=n),t},n6=function(e,t,n,r,i){for(var a,o,s=0,l=1/0,u=i.attributes,h=function(e,t){return nV(i.distance,u.length,function(t){return u[t](e)},function(e){return u[e](t)},e,t)},c=0;c<e.length;c++){var d=e[c].key,p=n[d][r[d]];p<l&&(s=d,l=p)}if("threshold"===i.mode&&l>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var g=t[s],f=t[r[s]];o="dendrogram"===i.mode?{left:g,right:f,key:g.key}:{value:g.value.concat(f.value),key:g.key},e[g.index]=o,e.splice(f.index,1),t[g.key]=o;for(var v=0;v<e.length;v++){var y=e[v];g.key===y.key?a=1/0:"min"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]>n[f.key][y.key]&&(a=n[f.key][y.key])):"max"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]<n[f.key][y.key]&&(a=n[f.key][y.key])):a="mean"===i.linkage?(n[g.key][y.key]*g.size+n[f.key][y.key]*f.size)/(g.size+f.size):"dendrogram"===i.mode?h(y.value,g.value):h(y.value[0],g.value[0]),n[g.key][y.key]=n[y.key][g.key]=a}for(var b=0;b<e.length;b++){var x=e[b].key;if(r[x]===g.key||r[x]===f.key){for(var w=x,E=0;E<e.length;E++){var _=e[E].key;n[x][_]<n[x][w]&&(w=_)}r[x]=w}e[b].index=b}return g.key=f.key=g.index=f.index=null,!0},n8=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},n7=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),a=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:a.id()}}),n.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}if(t.value)return t.value.id()},re=function e(t,n,r){if(!t)return[];var i=[],a=[],o=[];if(0===n)return t.left&&n8(t.left,i),t.right&&n8(t.right,a),o=i.concat(a),[r.collection(o)];if(1===n)if(t.value)return[r.collection(t.value)];else return t.left&&n8(t.left,i),t.right&&n8(t.right,a),[r.collection(i),r.collection(a)];return t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(a=e(t.right,n-1,r)),i.concat(a))},rt=function(e){for(var t,n=this.cy(),r=this.nodes(),i=n9(e),a=i.attributes,o=function(e,t){return nV(i.distance,a.length,function(t){return a[t](e)},function(e){return a[e](t)},e,t)},s=[],l=[],u=[],h=[],c=0;c<r.length;c++){var d={value:"dendrogram"===i.mode?r[c]:[r[c]],key:c,index:c};s[c]=d,h[c]=d,l[c]=[],u[c]=0}for(var p=0;p<s.length;p++)for(var g=0;g<=p;g++){var f=void 0;f="dendrogram"===i.mode?p===g?1/0:o(s[p].value,s[g].value):p===g?1/0:o(s[p].value[0],s[g].value[0]),l[p][g]=f,l[g][p]=f,f<l[p][u[p]]&&(u[p]=g)}for(var v=n6(s,h,l,u,i);v;)v=n6(s,h,l,u,i);return"dendrogram"===i.mode?(t=re(s[0],i.dendrogramDepth,n),i.addDendrogram&&n7(s[0],n)):(t=Array(s.length),s.forEach(function(e,r){e.key=e.index=null,t[r]=n.collection(e.value)})),t},rn=ta({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),rr=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||e8("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some(function(e){return e===n})||G(n)||e8("Preference must be one of [".concat(r.map(function(e){return"'".concat(e,"'")}).join(", "),"] or a number. Got: ").concat(n)),rn(e)},ri=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-nV(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},ra=function(e,t){return"median"===t?tI(e):"mean"===t?tk(e):"min"===t?tL(e):"max"===t?tS(e):t},ro=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r},rs=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>o&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},rl=function(e,t,n){for(var r=rs(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,l=-1/0,u=0;u<a.length;u++){for(var h=0,c=0;c<a.length;c++)h+=t[a[c]*e+a[u]];h>l&&(s=u,l=h)}n[i]=a[s]}return rs(e,t,n)},ru=function(e){for(var t,n,r,i,a,o,s,l=this.cy(),u=this.nodes(),h=rr(e),c={},d=0;d<u.length;d++)c[u[d].id()]=d;r=Array(n=(t=u.length)*t);for(var p=0;p<n;p++)r[p]=-1/0;for(var g=0;g<t;g++)for(var f=0;f<t;f++)g!==f&&(r[g*t+f]=ri(h.distance,u[g],u[f],h.attributes));i=ra(r,h.preference);for(var v=0;v<t;v++)r[v*t+v]=i;a=Array(n);for(var y=0;y<n;y++)a[y]=0;o=Array(n);for(var b=0;b<n;b++)o[b]=0;for(var x=Array(t),w=Array(t),E=Array(t),_=0;_<t;_++)x[_]=0,w[_]=0,E[_]=0;for(var T=Array(t*h.minIterations),D=0;D<T.length;D++)T[D]=0;for(s=0;s<h.maxIterations;s++){for(var C=0;C<t;C++){for(var N=-1/0,A=-1/0,L=-1,S=0,k=0;k<t;k++)x[k]=a[C*t+k],(S=o[C*t+k]+r[C*t+k])>=N?(A=N,N=S,L=k):S>A&&(A=S);for(var I=0;I<t;I++)a[C*t+I]=(1-h.damping)*(r[C*t+I]-N)+h.damping*x[I];a[C*t+L]=(1-h.damping)*(r[C*t+L]-A)+h.damping*x[L]}for(var O=0;O<t;O++){for(var M=0,P=0;P<t;P++)x[P]=o[P*t+O],w[P]=Math.max(0,a[P*t+O]),M+=w[P];M-=w[O],w[O]=a[O*t+O],M+=w[O];for(var R=0;R<t;R++)o[R*t+O]=(1-h.damping)*Math.min(0,M-w[R])+h.damping*x[R];o[O*t+O]=(1-h.damping)*(M-w[O])+h.damping*x[O]}for(var B=0,F=0;F<t;F++){var z=+(o[F*t+F]+a[F*t+F]>0);T[s%h.minIterations*t+F]=z,B+=z}if(B>0&&(s>=h.minIterations-1||s==h.maxIterations-1)){for(var G=0,Y=0;Y<t;Y++){E[Y]=0;for(var X=0;X<h.minIterations;X++)E[Y]+=T[X*t+Y];(0===E[Y]||E[Y]===h.minIterations)&&G++}if(G===t)break}}for(var V=ro(t,a,o),U=rl(t,r,V),j={},q=0;q<V.length;q++)j[V[q]]=[];for(var H=0;H<u.length;H++){var W=U[c[u[H].id()]];null!=W&&j[W].push(u[H])}for(var $=Array(V.length),K=0;K<V.length;K++)$[K]=l.collection(j[V[K]]);return $},rh=ta({root:void 0,directed:!1}),rc=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)},l=function l(u,h,c){u===c&&(r+=1),t[h]={id:n,low:n++,cutVertex:!1};var d,p,g,f,v=e.getElementById(h).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(h))):v.forEach(function(e){d=e.source().id(),p=e.target().id(),(g=d===h?p:d)!==c&&(o[f=e.id()]||(o[f]=!0,a.push({x:h,y:g,edge:e})),g in t?t[h].low=Math.min(t[h].low,t[g].id):(l(u,g,h),t[h].low=Math.min(t[h].low,t[g].low),t[h].id<=t[g].low&&(t[h].cutVertex=!0,s(h,g))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,l(n,n),t[n].cutVertex=r>1)}});var u=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(u),components:i}},rd=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function o(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var h=l.edgesWith(l),c=l.merge(h);r.push(c),a=a.difference(c)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},rp={};[ty,{dijkstra:function(e){if(!z(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=tb(e),r=n.root,i=n.weight,a=n.directed,o=this,s=R(r)?this.filter(r)[0]:r[0],l={},u={},h={},c=this.byGroup(),d=c.nodes,p=c.edges;p.unmergeBy(function(e){return e.isLoop()});for(var g=function(e){return l[e.id()]},f=new tm(function(e,t){return g(e)-g(t)}),v=0;v<d.length;v++){var y=d[v];l[y.id()]=y.same(s)?0:1/0,f.push(y)}for(;f.size()>0;){var b=f.pop(),x=g(b);if(h[b.id()]=x,x!==1/0)for(var w=b.neighborhood().intersect(d),E=0;E<w.length;E++){var _=w[E],T=_.id(),D=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(p),o=1/0,s=0;s<r.length;s++){var l=r[s],u=i(l);(u<o||!n)&&(o=u,n=l)}return{edge:n,dist:o}}(b,_),C=x+D.dist;C<g(_)&&(l[_.id()]=C,f.updateItem(_),u[T]={node:b,edge:D.edge})}}return{distanceTo:function(e){return h[(R(e)?d.filter(e)[0]:e[0]).id()]},pathTo:function(e){var t=R(e)?d.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},{kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=Array(i),o=function(e){for(var t=0;t<a.length;t++)if(a[t].has(e))return t},s=0;s<i;s++)a[s]=this.spawn(n[s]);for(var l=r.sort(function(t,n){return e(t)-e(n)}),u=0;u<l.length;u++){var h=l[u],c=h.source()[0],d=h.target()[0],p=o(c),g=o(d),f=a[p],v=a[g];p!==g&&(n.merge(h),f.merge(v),a.splice(g,1))}return n}},{aStar:function(e){var t,n,r=this.cy(),i=tx(e),a=i.root,o=i.goal,s=i.heuristic,l=i.directed,u=i.weight;a=r.collection(a)[0],o=r.collection(o)[0];var h=a.id(),c=o.id(),d={},p={},g={},f=new tm(function(e,t){return p[e.id()]-p[t.id()]}),v=new tg,y={},b={},x=function(e,t){f.push(e),v.add(t)};x(a,h),d[h]=0,p[h]=s(a);for(var w=0;f.size()>0;){if(n=(t=f.pop()).id(),v.delete(n),w++,n===c){for(var E=[],_=o,T=c,D=b[T];E.unshift(_),null!=D&&E.unshift(D),null!=(_=y[T]);)D=b[T=_.id()];return{found:!0,distance:d[n],path:this.spawn(E),steps:w}}g[n]=!0;for(var C=t._private.edges,N=0;N<C.length;N++){var A=C[N];if(this.hasElementWithId(A.id())&&(!l||A.data("source")===n)){var L=A.source(),S=A.target(),k=L.id()!==n?L:S,I=k.id();if(this.hasElementWithId(I)&&!g[I]){var O=d[n]+u(A);if(!v.has(I)){d[I]=O,p[I]=O+s(k),x(k,I),y[I]=t,b[I]=A;continue}O<d[I]&&(d[I]=O,p[I]=O+s(k),y[I]=t,b[I]=A)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},{floydWarshall:function(e){for(var t=this.cy(),n=tw(e),r=n.weight,i=n.directed,a=this.byGroup(),o=a.nodes,s=a.edges,l=o.length,u=l*l,h=function(e){return o.indexOf(e)},c=function(e){return o[e]},d=Array(u),p=0;p<u;p++){var g=p%l;(p-g)/l===g?d[p]=0:d[p]=1/0}for(var f=Array(u),v=Array(u),y=0;y<s.length;y++){var b=s[y],x=b.source()[0],w=b.target()[0];if(x!==w){var E=h(x),_=h(w),T=E*l+_,D=r(b);if(d[T]>D&&(d[T]=D,f[T]=_,v[T]=b),!i){var C=_*l+E;!i&&d[C]>D&&(d[C]=D,f[C]=E,v[C]=b)}}}for(var N=0;N<l;N++)for(var A=0;A<l;A++)for(var L=A*l+N,S=0;S<l;S++){var k=A*l+S,I=N*l+S;d[L]+d[I]<d[k]&&(d[k]=d[L]+d[I],f[k]=f[L])}var O=function(e){return h((R(e)?t.filter(e):e)[0])};return{distance:function(e,t){return d[O(e)*l+O(t)]},path:function(e,n){var r,i=O(e),a=O(n),o=c(i);if(i===a)return o.collection();if(null==f[i*l+a])return t.collection();var s=t.collection(),u=i;for(s.merge(o);i!==a;)u=i,i=f[i*l+a],r=v[u*l+i],s.merge(r),s.merge(c(i));return s}}}},{bellmanFord:function(e){var t=this,n=tE(e),r=n.weight,i=n.directed,a=n.root,o=this,s=this.cy(),l=this.byGroup(),u=l.edges,h=l.nodes,c=h.length,d=new td,p=!1,g=[];a=s.collection(a)[0],u.unmergeBy(function(e){return e.isLoop()});for(var f=u.length,v=function(e){var t=d.get(e.id());return t||(t={},d.set(e.id(),t)),t},y=function(e){return(R(e)?s.$(e):e)[0]},b=0;b<c;b++){var x=h[b],w=v(x);x.same(a)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,_=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,E=!0)},T=1;T<c;T++){E=!1;for(var D=0;D<f;D++){var C=u[D],N=C.source(),A=C.target(),L=r(C),S=v(N),k=v(A);_(N,A,C,S,k,L),i||_(A,N,C,k,S,L)}if(!E)break}if(E)for(var I=[],O=0;O<f;O++){var M=u[O],P=M.source(),B=M.target(),F=r(M),z=v(P).dist,G=v(B).dist;if(z+F<G||!i&&G+F<z)if(p||(te("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1!==e.findNegativeWeightCycles){var Y=[];z+F<G&&Y.push(P),!i&&G+F<z&&Y.push(B);for(var X=Y.length,V=0;V<X;V++){var U=Y[V],j=[U];j.push(v(U).edge);for(var q=v(U).pred;-1===j.indexOf(q);)j.push(q),j.push(v(q).edge),q=v(q).pred;for(var H=(j=j.slice(j.indexOf(q)))[0].id(),W=0,$=2;$<j.length;$+=2)j[$].id()<H&&(H=j[$].id(),W=$);(j=j.slice(W).concat(j.slice(0,W))).push(j[0]);var K=j.map(function(e){return e.id()}).join(",");-1===I.indexOf(K)&&(g.push(o.spawn(j)),I.push(K))}}else break}return{distanceTo:function(e){return v(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=y(e),i=[],s=r;;){if(null==s)return t.spawn();var l=v(s),u=l.edge,h=l.pred;if(i.unshift(s[0]),s.same(n)&&i.length>0)break;null!=u&&i.unshift(u),s=h}return o.spawn(i)},hasNegativeWeightCycle:p,negativeWeightCycles:g}}},{kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/t_);if(i<2)return void e8("At least 2 nodes are required for Karger-Stein algorithm");for(var l=[],u=0;u<a;u++){var h=r[u];l.push([u,n.indexOf(h.source()),n.indexOf(h.target())])}for(var c=1/0,d=[],p=Array(i),g=Array(i),f=Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=o;y++){for(var b=0;b<i;b++)g[b]=b;var x=tD(g,l.slice(),i,s),w=x.slice();v(g,f);var E=tD(g,x,s,2),_=tD(f,w,s,2);E.length<=_.length&&E.length<c?(c=E.length,d=E,v(g,p)):_.length<=E.length&&_.length<c&&(c=_.length,d=_,v(f,p))}for(var T=this.spawn(d.map(function(e){return r[e[0]]})),D=this.spawn(),C=this.spawn(),N=p[0],A=0;A<p.length;A++){var L=p[A],S=n[A];L===N?D.merge(S):C.merge(S)}var k=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!T.contains(t)&&n.merge(t)})}),n};return{cut:T,components:[k(D),k(C)],partition1:D,partition2:C}}},{pageRank:function(e){for(var t,n=nv(e),r=n.dampingFactor,i=n.precision,a=n.iterations,o=n.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,h=l.edges,c=u.length,d=c*c,p=h.length,g=Array(d),f=Array(c),v=(1-r)/c,y=0;y<c;y++){for(var b=0;b<c;b++)g[y*c+b]=0;f[y]=0}for(var x=0;x<p;x++){var w=h[x],E=w.data("source"),_=w.data("target");if(E!==_){var T=u.indexOfId(E),D=u.indexOfId(_),C=o(w),N=D*c+T;g[N]+=C,f[T]+=C}}for(var A=1/c+v,L=0;L<c;L++)if(0===f[L])for(var S=0;S<c;S++)g[S*c+L]=A;else for(var k=0;k<c;k++){var I=k*c+L;g[I]=g[I]/f[L]+v}for(var O=Array(c),M=Array(c),P=0;P<c;P++)O[P]=1;for(var R=0;R<a;R++){for(var B=0;B<c;B++)M[B]=0;for(var F=0;F<c;F++)for(var z=0;z<c;z++){var G=F*c+z;M[F]+=g[G]*O[z]}tF(M),t=O,O=M,M=t;for(var Y=0,X=0;X<c;X++){var V=t[X]-O[X];Y+=V*V}if(Y<i)break}return{rank:function(e){return e=s.collection(e)[0],O[u.indexOf(e)]}}}},nm,nx,nE,{markovClustering:nM,mcl:nM},{kMeans:function(t){var n,r=this.cy(),i=this.nodes(),a=null,o=nj(t),s=Array(o.k),l={};o.testMode?"number"==typeof o.testCentroids?(o.testCentroids,n=nH(i,o.k,o.attributes)):n="object"===e(o.testCentroids)?o.testCentroids:nH(i,o.k,o.attributes):n=nH(i,o.k,o.attributes);for(var u=!0,h=0;u&&h<o.maxIterations;){for(var c=0;c<i.length;c++)l[(a=i[c]).id()]=nW(a,n,o.distance,o.attributes,"kMeans");u=!1;for(var d=0;d<o.k;d++){var p=n$(d,i,l);if(0!==p.length){for(var g=o.attributes.length,f=n[d],v=Array(g),y=Array(g),b=0;b<g;b++){y[b]=0;for(var x,w=0;w<p.length;w++)a=p[w],y[b]+=o.attributes[b](a);v[b]=y[b]/p.length,x=v[b],Math.abs(f[b]-x)<=o.sensitivityThreshold||(u=!0)}n[d]=v,s[d]=r.collection(p)}}h++}return s},kMedoids:function(t){var n,r,i=this.cy(),a=this.nodes(),o=null,s=nj(t),l=Array(s.k),u={},h=Array(s.k);s.testMode?"number"==typeof s.testCentroids||(n="object"===e(s.testCentroids)?s.testCentroids:nQ(a,s.k)):n=nQ(a,s.k);for(var c=!0,d=0;c&&d<s.maxIterations;){for(var p=0;p<a.length;p++)u[(o=a[p]).id()]=nW(o,n,s.distance,s.attributes,"kMedoids");c=!1;for(var g=0;g<n.length;g++){var f=n$(g,a,u);if(0!==f.length){h[g]=nJ(n[g],f,s.attributes);for(var v=0;v<f.length;v++)(r=nJ(f[v],f,s.attributes))<h[g]&&(h[g]=r,n[g]=f[v],c=!0);l[g]=i.collection(f)}}d++}return l},fuzzyCMeans:n5,fcm:n5},{hierarchicalClustering:rt,hca:rt},{affinityPropagation:ru,ap:ru},{hierholzer:function(e){if(!z(e)){var t,n,r,i=arguments;e={root:i[0],directed:i[1]}}var a=rh(e),o=a.root,s=a.directed,l=!1;o&&(r=R(o)?this.filter(o)[0].id():o[0].id());var u={},h={};s?this.forEach(function(e){var r=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?t?l=!0:t=r:1==s?n?l=!0:n=r:(s>1||o>1)&&(l=!0),u[r]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[r].push(e.id())})}else h[r]=[void 0,e.target().id()]}):this.forEach(function(e){var r=e.id();e.isNode()?(e.degree(!0)%2&&(t?n?l=!0:n=r:t=r),u[r]=[],e.connectedEdges().forEach(function(e){return u[r].push(e.id())})):h[r]=[e.source().id(),e.target().id()]});var c={found:!1,trail:void 0};if(l)return c;if(n&&t)if(s){if(r&&n!=r)return c;r=n}else{if(r&&n!=r&&t!=r)return c;r||(r=n)}else r||(r=this[0].id());var d=function(e){for(var t,n,r,i=e,a=[e];u[i].length;)n=h[t=u[i].shift()][0],i!=(r=h[t][1])?(u[r]=u[r].filter(function(e){return e!=t}),i=r):s||i==n||(u[n]=u[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},p=[],g=[];for(g=d(r);1!=g.length;)0==u[g[0]].length?(p.unshift(this.getElementById(g.shift())),p.unshift(this.getElementById(g.shift()))):g=d(g.shift()).concat(g);for(var f in p.unshift(this.getElementById(g.shift())),u)if(u[f].length)return c;return c.found=!0,c.trail=this.spawn(p,!0),c}},{hopcroftTarjanBiconnected:rc,htbc:rc,htb:rc,hopcroftTarjanBiconnectedComponents:rc},{tarjanStronglyConnected:rd,tsc:rd,tscc:rd,tarjanStronglyConnectedComponents:rd}].forEach(function(e){eo(rp,e)});var rg=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};rg.prototype={fulfill:function(e){return rf(this,1,"fulfillValue",e)},reject:function(e){return rf(this,2,"rejectReason",e)},then:function(e,t){var n=new rg;return this.onFulfilled.push(rm(e,n,"fulfill")),this.onRejected.push(rm(t,n,"reject")),rv(this),n.proxy}};var rf=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,rv(e)),e},rv=function(e){1===e.state?ry(e,"onFulfilled",e.fulfillValue):2===e.state&&ry(e,"onRejected",e.rejectReason)},ry=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},rm=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(e){t.reject(e);return}rb(t,i)}}},rb=function t(n,r){if(n===r||n.proxy===r)return void n.reject(TypeError("cannot resolve promise with itself"));if("object"===e(r)&&null!==r||"function"==typeof r)try{i=r.then}catch(e){n.reject(e);return}if("function"==typeof i){var i,a=!1;try{i.call(r,function(e){a||(a=!0,e===r?n.reject(TypeError("circular thenable chain")):t(n,e))},function(e){a||(a=!0,n.reject(e))})}catch(e){a||n.reject(e)}return}n.fulfill(r)};rg.all=function(e){return new rg(function(t,n){for(var r=Array(e.length),i=0,a=function(n,a){r[n]=a,++i===e.length&&t(r)},o=0;o<e.length;o++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then(function(e){a(t,e)},function(e){n(e)}):a(t,r)}(o)})},rg.resolve=function(e){return new rg(function(t,n){t(e)})},rg.reject=function(e){return new rg(function(t,n){n(e)})};var rx="u">typeof Promise?Promise:rg,rw=function(e,t,n){var r=j(e),i=this._private=eo({duration:1e3},t,n);if(i.target=e,i.style=i.style||i.css,i.started=!1,i.playing=!1,i.hooked=!1,i.applying=!1,i.progress=0,i.completes=[],i.frames=[],i.complete&&B(i.complete)&&i.completes.push(i.complete),!r){var a=e.position();i.startPosition=i.startPosition||{x:a.x,y:a.y},i.startStyle=i.startStyle||e.cy().style().getAnimationStartStyle(e,i.style)}if(r){var o=e.pan();i.startPan={x:o.x,y:o.y},i.startZoom=e.zoom()}this.length=1,this[0]=this},rE=rw.prototype;eo(rE,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),X(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t,n=this._private;return t="frame"===e?n.frames:n.completes,new rx(function(e,n){t.push(function(){e()})})}}),rE.complete=rE.completed,rE.run=rE.play,rE.running=rE.playing;var r_=Array.isArray,rT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rD=/^\w*$/,rC=function(e,t){if(r_(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||ek(e))||rD.test(e)||!rT.test(e)||null!=t&&e in Object(t)},rN=function(e){if(!ep(e))return!1;var t=eS(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},rA=ey["__core-js_shared__"],rL=(c=/[^.]+$/.exec(rA&&rA.keys&&rA.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",rS=Function.prototype.toString,rk=function(e){if(null!=e){try{return rS.call(e)}catch(e){}try{return e+""}catch(e){}}return""},rI=/^\[object .+?Constructor\]$/,rO=Object.prototype,rM=Function.prototype.toString,rP=rO.hasOwnProperty,rR=RegExp("^"+rM.call(rP).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rB=function(e){return!!ep(e)&&(!rL||!(rL in e))&&(rN(e)?rR:rI).test(rk(e))},rF=function(e,t){var n=null==e?void 0:e[t];return rB(n)?n:void 0},rz=rF(Object,"create"),rG=Object.prototype.hasOwnProperty,rY=Object.prototype.hasOwnProperty;function rX(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rX.prototype.clear=function(){this.__data__=rz?rz(null):{},this.size=0},rX.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},rX.prototype.get=function(e){var t=this.__data__;if(rz){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rG.call(t,e)?t[e]:void 0},rX.prototype.has=function(e){var t=this.__data__;return rz?void 0!==t[e]:rY.call(t,e)},rX.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=rz&&void 0===t?"__lodash_hash_undefined__":t,this};var rV=function(e,t){return e===t||e!=e&&t!=t},rU=function(e,t){for(var n=e.length;n--;)if(rV(e[n][0],t))return n;return -1},rj=Array.prototype.splice;function rq(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rq.prototype.clear=function(){this.__data__=[],this.size=0},rq.prototype.delete=function(e){var t=this.__data__,n=rU(t,e);return!(n<0)&&(n==t.length-1?t.pop():rj.call(t,n,1),--this.size,!0)},rq.prototype.get=function(e){var t=this.__data__,n=rU(t,e);return n<0?void 0:t[n][1]},rq.prototype.has=function(e){return rU(this.__data__,e)>-1},rq.prototype.set=function(e,t){var n=this.__data__,r=rU(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var rH=rF(ey,"Map"),rW=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},r$=function(e,t){var n=e.__data__;return rW(t)?n["string"==typeof t?"string":"hash"]:n.map};function rK(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function rZ(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(rZ.Cache||rK),n}rK.prototype.clear=function(){this.size=0,this.__data__={hash:new rX,map:new(rH||rq),string:new rX}},rK.prototype.delete=function(e){var t=r$(this,e).delete(e);return this.size-=!!t,t},rK.prototype.get=function(e){return r$(this,e).get(e)},rK.prototype.has=function(e){return r$(this,e).has(e)},rK.prototype.set=function(e,t){var n=r$(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},rZ.Cache=rK;var rQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rJ=/\\(\\)?/g,r0=(p=(d=rZ(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rQ,function(e,n,r,i){t.push(r?i.replace(rJ,"$1"):n||e)}),t},function(e){return 500===p.size&&p.clear(),e})).cache,d),r1=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},r2=1/0,r5=eE?eE.prototype:void 0,r3=r5?r5.toString:void 0,r4=function e(t){if("string"==typeof t)return t;if(r_(t))return r1(t,e)+"";if(ek(t))return r3?r3.call(t):"";var n=t+"";return"0"==n&&1/t==-r2?"-0":n},r9=function(e){return null==e?"":r4(e)},r6=function(e,t){return r_(e)?e:rC(e,t)?[e]:r0(r9(e))},r8=1/0,r7=function(e){if("string"==typeof e||ek(e))return e;var t=e+"";return"0"==t&&1/e==-r8?"-0":t},ie=function(e,t){t=r6(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[r7(t[n++])];return n&&n==r?e:void 0},it=function(e,t,n){var r=null==e?void 0:ie(e,t);return void 0===r?n:r},ir=function(){try{var e=rF(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ii=function(e,t,n){"__proto__"==t&&ir?ir(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ia=Object.prototype.hasOwnProperty,io=function(e,t,n){var r=e[t];ia.call(e,t)&&rV(r,n)&&(void 0!==n||t in e)||ii(e,t,n)},is=/^(?:0|[1-9]\d*)$/,il=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&is.test(e))&&e>-1&&e%1==0&&e<t},iu=function(e,t,n,r){if(!ep(e))return e;t=r6(t,e);for(var i=-1,a=t.length,o=a-1,s=e;null!=s&&++i<a;){var l=r7(t[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(i!=o){var h=s[l];void 0===(u=r?r(h,l,s):void 0)&&(u=ep(h)?h:il(t[i+1])?[]:{})}io(s,l,u),s=s[l]}return e},ih=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},ic={};[{animated:function(){return function(){var e=void 0!==this.length;if(!(this._private.cy||this).styleEnabled())return!1;var t=(e?this:[this])[0];if(t)return t._private.animation.current.length>0}},clearQueue:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;for(var t=0;t<e.length;t++)e[t]._private.animation.queue=[];return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=void 0!==this.length,r=n?this:[this],i=this._private.cy||this,a=!n,o=!a;if(!i.styleEnabled())return this;var s=i.style();if(0===Object.keys(e=eo({},e,t)).length)return new rw(r[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(o&&(e.style=s.getPropsList(e.style||e.css),e.css=void 0),o&&null!=e.renderedPosition){var l=e.renderedPosition,u=i.pan(),h=i.zoom();e.position=tN(l,h,u)}if(a&&null!=e.panBy){var c=e.panBy,d=i.pan();e.pan={x:d.x+c.x,y:d.y+c.y}}var p=e.center||e.centre;if(a&&null!=p){var g=i.getCenterPan(p.eles,e.zoom);null!=g&&(e.pan=g)}if(a&&null!=e.fit){var f=e.fit,v=i.getFitViewport(f.eles||f.boundingBox,f.padding);null!=v&&(e.pan=v.pan,e.zoom=v.zoom)}if(a&&z(e.zoom)){var y=i.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new rw(r[0],e)}},animate:function(){return function(e,t){var n=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=eo({},e,t));for(var r=0;r<n.length;r++){var i=n[r],a=i.animated()&&(void 0===e.queue||e.queue);i.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=void 0!==this.length?this:[this],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var i=0;i<n.length;i++){for(var a=n[i]._private,o=a.animation.current,s=0;s<o.length;s++){var l=o[s]._private;t&&(l.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return r.notify("draw"),this}}},{data:function(e){return e=eo({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r,i=e,o=void 0!==this.length,s=o?this:[this],l=o?this[0]:this;if(R(t)){var u=-1!==t.indexOf(".")&&(r_(t)?r1(t,r7):ek(t)?[t]:ih(r0(r9(t))));if(i.allowGetting&&void 0===n)return l&&(i.beforeGet(l),p=u&&void 0===l._private[i.field][t]?it(l._private[i.field],u):l._private[i.field][t]),p;if(i.allowSetting&&void 0!==n&&!i.immutableKeys[t]){var h=a({},t,n);i.beforeSet(this,h);for(var c=0,d=s.length;c<d;c++){var p,g,f=s[c];i.canSet(f)&&(u&&void 0===l._private[i.field][t]?(g=f._private[i.field],null==g||iu(g,u,n)):f._private[i.field][t]=n)}i.updateStyle&&this.updateStyle(),i.onSet(this),i.settingTriggersEvent&&this[i.triggerFnName](i.settingEvent)}}else if(i.allowSetting&&z(t)){var v,y,b=Object.keys(t);i.beforeSet(this,t);for(var x=0;x<b.length;x++)if(y=t[v=b[x]],!i.immutableKeys[v])for(var w=0;w<s.length;w++){var E=s[w];i.canSet(E)&&(E._private[i.field][v]=y)}i.updateStyle&&this.updateStyle(),i.onSet(this),i.settingTriggersEvent&&this[i.triggerFnName](i.settingEvent)}else if(i.allowBinding&&B(t))this.on(i.bindingEvent,t);else if(i.allowGetting&&void 0===t)return l&&(i.beforeGet(l),r=l._private[i.field]),r;return this}},removeData:function(e){return e=eo({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=void 0!==this.length?this:[this];if(R(t)){for(var i=t.split(/\s+/),a=i.length,o=0;o<a;o++){var s=i[o];if(!H(s)&&!n.immutableKeys[s])for(var l=0,u=r.length;l<u;l++)r[l]._private[n.field][s]=void 0}n.triggerEvent&&this[n.triggerFnName](n.event)}else if(void 0===t){for(var h=0,c=r.length;h<c;h++)for(var d=r[h]._private[n.field],p=Object.keys(d),g=0;g<p.length;g++){var f=p[g];n.immutableKeys[f]||(d[f]=void 0)}n.triggerEvent&&this[n.triggerFnName](n.event)}return this}}},{eventAliasesOn:function(e){e.addListener=e.listen=e.bind=e.on,e.unlisten=e.unbind=e.off=e.removeListener,e.trigger=e.emit,e.pon=e.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new rx(function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)})}}}].forEach(function(e){eo(ic,e)});var id={animate:ic.animate(),animation:ic.animation(),animated:ic.animated(),clearQueue:ic.clearQueue(),delay:ic.delay(),delayAnimation:ic.delayAnimation(),stop:ic.stop()},ip={classes:function(e){if(void 0===e){var t=[];return this[0]._private.classes.forEach(function(e){return t.push(e)}),t}F(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],r=new tg(e),i=0;i<this.length;i++){for(var a=this[i],o=a._private,s=o.classes,l=!1,u=0;u<e.length;u++){var h=e[u];if(!s.has(h)){l=!0;break}}l||(l=s.size!==e.length),l&&(o.classes=r,n.push(a))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),this},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){F(e)||(e=e.match(/\S+/g)||[]);for(var n=void 0===t,r=[],i=0,a=this.length;i<a;i++)for(var o=this[i],s=o._private.classes,l=!1,u=0;u<e.length;u++){var h=e[u],c=s.has(h),d=!1;t||n&&!c?(s.add(h),d=!0):(!t||n&&c)&&(s.delete(h),d=!0),!l&&d&&(r.push(o),l=!0)}return r.length>0&&this.spawn(r).updateStyle().emit("class"),this},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};ip.className=ip.classNames=ip.classes;var ig={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:ee,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};for(v=0,ig.variable="(?:[\\w-.]|(?:\\\\"+ig.metaChar+"))+",ig.className="(?:[\\w-]|(?:\\\\"+ig.metaChar+"))+",ig.value=ig.string+"|"+ig.number,ig.id=ig.variable,g=ig.comparatorOp.split("|");v<g.length;v++)f=g[v],ig.comparatorOp+="|@"+f;for(v=0,g=ig.comparatorOp.split("|");v<g.length;v++)(f=g[v]).indexOf("!")>=0||"="!==f&&(ig.comparatorOp+="|\\!"+f);var iv=function(){return{checks:[]}},iy=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return -1*ea(e.selector,t.selector)}),im=function(){for(var e,t={},n=0;n<iy.length;n++)t[(e=iy[n]).selector]=e.matches;return t}(),ib="("+iy.map(function(e){return e.selector}).join("|")+")",ix=function(e){return e.replace(RegExp("\\\\("+ig.metaChar+")","g"),function(e,t){return t})},iw=function(e,t,n){e[e.length-1]=n},iE=[{name:"group",query:!0,regex:"("+ig.group+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:0,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:ib,populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:7,value:r})}},{name:"id",query:!0,regex:"\\#("+ig.id+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:8,value:ix(r)})}},{name:"className",query:!0,regex:"\\.("+ig.className+")",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:9,value:ix(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+ig.variable+")\\s*\\]",populate:function(e,t,n){var r=o(n,1)[0];t.checks.push({type:4,field:ix(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+ig.variable+")\\s*("+ig.comparatorOp+")\\s*("+ig.value+")\\s*\\]",populate:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],s=r[2];s=null!=RegExp("^"+ig.string+"$").exec(s)?s.substring(1,s.length-1):parseFloat(s),t.checks.push({type:3,field:ix(i),operator:a,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+ig.boolOp+")\\s*("+ig.variable+")\\s*\\]",populate:function(e,t,n){var r=o(n,2),i=r[0],a=r[1];t.checks.push({type:5,field:ix(a),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+ig.meta+")\\s*("+ig.comparatorOp+")\\s*("+ig.number+")\\s*\\]\\]",populate:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],s=r[2];t.checks.push({type:6,field:ix(i),operator:a,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:ig.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return null!=n&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=iv()}},{name:"directedEdge",separator:!0,regex:ig.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n=iv(),r=iv();return n.checks.push({type:11,source:t,target:r}),iw(e,t,n),e.edgeCount++,r}var i=iv(),a=iv();return i.checks.push({type:12,source:t,target:a}),iw(e,t,i),e.edgeCount++,a}},{name:"undirectedEdge",separator:!0,regex:ig.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n=iv(),r=iv();return n.checks.push({type:10,nodes:[t,r]}),iw(e,t,n),e.edgeCount++,r}var i=iv(),a=iv();return i.checks.push({type:14,node:t,neighbor:a}),iw(e,t,i),a}},{name:"child",separator:!0,regex:ig.child,populate:function(e,t){if(null==e.currentSubject){var n=iv(),r=iv(),i=e[e.length-1];return n.checks.push({type:15,parent:i,child:r}),iw(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=iv(),o=e[e.length-1],s=iv(),l=iv(),u=iv(),h=iv();return a.checks.push({type:19,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:20}],h.checks.push({type:20}),s.checks.push({type:17,parent:h,child:u}),iw(e,o,a),e.currentSubject=l,e.compoundCount++,u}var c=iv(),d=iv(),p=[{type:17,parent:c,child:d}];return c.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"descendant",separator:!0,regex:ig.descendant,populate:function(e,t){if(null==e.currentSubject){var n=iv(),r=iv(),i=e[e.length-1];return n.checks.push({type:16,ancestor:i,descendant:r}),iw(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=iv(),o=e[e.length-1],s=iv(),l=iv(),u=iv(),h=iv();return a.checks.push({type:19,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:20}],h.checks.push({type:20}),s.checks.push({type:18,ancestor:h,descendant:u}),iw(e,o,a),e.currentSubject=l,e.compoundCount++,u}var c=iv(),d=iv(),p=[{type:18,ancestor:c,descendant:d}];return c.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"subject",modifier:!0,regex:ig.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return te("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;11===r?n.type=13:10===r&&(n.type=14,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];iE.forEach(function(e){return e.regexObj=RegExp("^"+e.regex)});var i_=function(e){for(var t,n,r,i=0;i<iE.length;i++){var a=iE[i],o=a.name,s=e.match(a.regexObj);if(null!=s){n=s,t=a,r=o;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},iT=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},iD=function(e,t,n){var r,i,a,o=R(e),s=G(e),l=R(n),u=!1,h=!1,c=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),h=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(o||l||u)&&(i=o||s?""+e:"",a=""+n),u&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":c=!0,r=e>n;break;case">=":c=!0,r=e>=n;break;case"<":c=!0,r=e<n;break;case"<=":c=!0,r=e<=n;break;default:r=!1}return h&&(null!=e||!c)&&(r=!r),r},iC=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}},iN=function(e,t){return e.data(t)},iA=[],iL=function(e,t){return e.checks.every(function(e){return iA[e.type](e,t)})};iA[0]=function(e,t){var n=e.value;return"*"===n||n===t.group()},iA[7]=function(e,t){var n;return n=e.value,im[n](t)},iA[8]=function(e,t){var n=e.value;return t.id()===n},iA[9]=function(e,t){var n=e.value;return t.hasClass(n)},iA[6]=function(e,t){var n=e.field,r=e.operator,i=e.value;return iD(t[n](),r,i)},iA[3]=function(e,t){var n=e.field,r=e.operator,i=e.value;return iD(iN(t,n),r,i)},iA[5]=function(e,t){var n=e.field,r=e.operator;return iC(iN(t,n),r)},iA[4]=function(e,t){var n=e.field;return e.operator,void 0!==iN(t,n)},iA[10]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return iL(n,i)&&iL(r,a)||iL(r,i)&&iL(n,a)},iA[14]=function(e,t){return iL(e.node,t)&&t.neighborhood().some(function(t){return t.isNode()&&iL(e.neighbor,t)})},iA[11]=function(e,t){return iL(e.source,t.source())&&iL(e.target,t.target())},iA[12]=function(e,t){return iL(e.source,t)&&t.outgoers().some(function(t){return t.isNode()&&iL(e.target,t)})},iA[13]=function(e,t){return iL(e.target,t)&&t.incomers().some(function(t){return t.isNode()&&iL(e.source,t)})},iA[15]=function(e,t){return iL(e.child,t)&&iL(e.parent,t.parent())},iA[17]=function(e,t){return iL(e.parent,t)&&t.children().some(function(t){return iL(e.child,t)})},iA[16]=function(e,t){return iL(e.descendant,t)&&t.ancestors().some(function(t){return iL(e.ancestor,t)})},iA[18]=function(e,t){return iL(e.ancestor,t)&&t.descendants().some(function(t){return iL(e.descendant,t)})},iA[19]=function(e,t){return iL(e.subject,t)&&iL(e.left,t)&&iL(e.right,t)},iA[20]=function(){return!0},iA[1]=function(e,t){return e.value.has(t)},iA[2]=function(e,t){return(0,e.value)(t)};var iS=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||R(e)&&e.match(/^\s*$/)||(X(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):B(e)?this.addQuery({checks:[{type:2,value:e}]}):R(e)?this.parse(e)||(this.invalid=!0):e8("A selector must be created from a string; found "))},ik=iS.prototype;[{parse:function(e){var t=this.inputText=e,n=this[0]=iv();for(this.length=1,t=iT(t);;){var r=i_(t);if(null==r.expr)return te("The selector `"+e+"`is invalid"),!1;var i=r.match.slice(1),a=r.expr.populate(this,n,i);if(!1===a)return!1;if(null!=a&&(n=a),(t=r.remaining).match(/^\s*$/))break}var o=this[this.length-1];null!=this.currentSubject&&(o.subject=this.currentSubject),o.edgeCount=this.edgeCount,o.compoundCount=this.compoundCount;for(var s=0;s<this.length;s++){var l=this[s];if(l.compoundCount>0&&l.edgeCount>0)return te("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return te("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===l.edgeCount&&te("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return R(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:return"["+r.field+n(e(r.operator))+t(s)+"]";case 5:var u=r.operator,h=r.field;return"["+e(u)+h+"]";case 4:return"["+r.field+"]";case 6:var c=r.operator;return"[["+r.field+n(e(c))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return i(r.parent,a)+n(">")+i(r.child,a);case 18:case 16:return i(r.ancestor,a)+" "+i(r.descendant,a);case 19:var d=i(r.left,a),p=i(r.subject,a),g=i(r.right,a);return d+(d.length>0?" ":"")+p+g;case 20:return""}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)},"")},a="",o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=", ")}return this.toStringCache=a,a}},{matches:function(e){for(var t=0;t<this.length;t++)if(iL(this[t],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++)if(iL(t[n],e))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}}].forEach(function(e){return eo(ik,e)}),ik.text=function(){return this.inputText},ik.size=function(){return this.length},ik.eq=function(e){return this[e]},ik.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},ik.addQuery=function(e){this[this.length++]=e},ik.selector=ik.toString;var iI={allAre:function(e){var t=new iS(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new iS(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every(function(t){return e.hasElementWithId(t.id())}))},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(e){return t.hasElementWithId(e.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(e){return t.hasElementWithId(e.id())})}};iI.allAreNeighbours=iI.allAreNeighbors,iI.has=iI.contains,iI.equal=iI.equals=iI.same;var iO=function(e,t){return function(n,r,i,a){if(null==n?o="":X(n)&&1===n.length&&(o=n.id()),1!==this.length||!o)return e.call(this,n,r,i,a);var o,s=this[0]._private,l=s.traversalCache=s.traversalCache||{},u=l[t]=l[t]||[],h=eZ(o),c=u[h];return c||(u[h]=e.call(this,n,r,i,a))}},iM={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isChild()}).filter(e)},children:iO(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return!function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function iP(e,t,n,r){for(var i=[],a=new tg,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):o&&r(i,a,l)}for(;i.length>0;){var u=i.shift();t(u),a.add(u.id()),o&&r(i,a,u)}return e}function iR(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}function iB(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function iF(e,t,n){iB(e,t,n),iR(e,t,n)}iM.forEachDown=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return iP(this,e,t,iR)},iM.forEachUp=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return iP(this,e,t,iB)},iM.forEachUpAndDown=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return iP(this,e,t,iF)},iM.ancestors=iM.parents,(y=b={data:ic.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:ic.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ic.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ic.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ic.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ic.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=y.data,y.removeAttr=y.removeData;var iz={};function iG(e){return function(t){if(void 0===t&&(t=!0),0!==this.length)if(!this.isNode()||this.removed())return;else{for(var n=0,r=this[0],i=r._private.edges,a=0;a<i.length;a++){var o=i[a];!t&&o.isLoop()||(n+=e(r,o))}return n}}}function iY(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);void 0!==o&&(void 0===r||t(o,r))&&(r=o)}return r}}eo(iz,{degree:iG(function(e,t){return t.source().same(t.target())?2:1}),indegree:iG(function(e,t){return+!!t.target().same(e)}),outdegree:iG(function(e,t){return+!!t.source().same(e)})}),eo(iz,{minDegree:iY("degree",function(e,t){return e<t}),maxDegree:iY("degree",function(e,t){return e>t}),minIndegree:iY("indegree",function(e,t){return e<t}),maxIndegree:iY("indegree",function(e,t){return e>t}),minOutdegree:iY("outdegree",function(e,t){return e<t}),maxOutdegree:iY("outdegree",function(e,t){return e>t})}),eo(iz,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var iX=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:null!=t.x?t.x-a.x:0,y:null!=t.y?t.y-a.y:0};i.isParent()&&(0!==o.x||0!==o.y)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},iV={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){iX(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};(x=w={position:ic.data(iV),silentPosition:ic.data(eo({},iV,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){iX(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(z(e))t?this.silentPosition(e):this.position(e);else if(B(e)){var n=this.cy();n.startBatch();for(var r=0;r<this.length;r++){var i=this[r],a=void 0;(a=e(i,r))&&(t?i.silentPosition(a):i.position(a))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(z(e)?(r={x:G(e.x)?e.x:0,y:G(e.y)?e.y:0},n=t):R(e)&&G(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var s=o.position(),l={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(l):o.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return z(e)?this.shift(e,!0):R(e)&&G(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=z(e)?e:void 0,s=void 0!==o||void 0!==t&&R(e);if(n&&n.isNode())if(!s)return(o=tC(n.position(),i,a),void 0===e)?o:o[e];else for(var l=0;l<this.length;l++){var u=this[l];void 0!==t?u.position(e,(t-a[e])/i):void 0!==o&&u.position(tN(o,i,a))}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=z(e)?e:void 0,a=void 0!==i||void 0!==t&&R(e),o=r.hasCompoundNodes();if(n&&n.isNode())if(a)for(var s=0;s<this.length;s++){var l=this[s],u=o?l.parent():null,h=u&&u.length>0;h&&(u=u[0]);var c=h?u.position():{x:0,y:0};void 0!==t?l.position(e,t+c[e]):void 0!==i&&l.position({x:i.x+c.x,y:i.y+c.y})}else{var d=n.position(),p=o?n.parent():null,g=p&&p.length>0;g&&(p=p[0]);var f=g?p.position():{x:0,y:0};return(i={x:d.x-f.x,y:d.y-f.y},void 0===e)?i:i[e]}else if(!a)return;return this}}).modelPosition=x.point=x.position,x.modelPositions=x.points=x.positions,x.renderedPoint=x.renderedPosition,x.relativePoint=x.relativePosition,E=_={},_.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},_.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()&&this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}}),this},_.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()||!e&&t.batching())return this;for(var n=0;n<this.length;n++){var r=this[n],i=r._private;(!i.compoundBoundsClean||e)&&(!function(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;(0===a.w||0===a.h)&&((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var h=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(h=100*h/i.height.val);var c=y(i.width.val-a.w,s,l),d=c.biasDiff,p=c.biasComplementDiff,g=y(i.height.val-a.h,u,h),f=g.biasDiff,v=g.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"===n.units)switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}return"px"===n.units?n.pfValue:0}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-d+a.x1+a.x2+p)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-f+a.y1+a.y2+v)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}(r),t.batching()||(i.compoundBoundsClean=!0))}return this};var iU=function(e){return e===1/0||e===-1/0?0:e},ij=function(e,t,n,r,i){r-t==0||i-n==0||null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},iq=function(e,t){return null==t?e:ij(e,t.x1,t.y1,t.x2,t.y2)},iH=function(e,t,n){return tu(e,t,n)},iW=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var l=a.arrowBounds=a.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,tH(u,1),ij(e,u.x1,u.y1,u.x2,u.y2)}}},i$=function(e,t,n){if(!t.cy().headless()){a=n?n+"-":"";var r=t._private,i=r.rstyle;if(t.pstyle(a+"label").strValue){var a,o,s,l,u,h=t.pstyle("text-halign"),c=t.pstyle("text-valign"),d=iH(i,"labelWidth",n),p=iH(i,"labelHeight",n),g=iH(i,"labelX",n),f=iH(i,"labelY",n),v=t.pstyle(a+"text-margin-x").pfValue,y=t.pstyle(a+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,E=t.pstyle("text-border-width").pfValue/2,_=t.pstyle("text-background-padding").pfValue,T=d/2,D=p/2;if(b)o=g-T,s=g+T,l=f-D,u=f+D;else{switch(h.value){case"left":o=g-d,s=g;break;case"center":o=g-T,s=g+T;break;case"right":o=g,s=g+d}switch(c.value){case"top":l=f-p,u=f;break;case"center":l=f-D,u=f+D;break;case"bottom":l=f,u=f+p}}o+=v-Math.max(w,E)-_-2,s+=v+Math.max(w,E)+_+2,l+=y-Math.max(w,E)-_-2,u+=y+Math.max(w,E)+_+2;var C=n||"main",N=r.labelBounds,A=N[C]=N[C]||{};A.x1=o,A.y1=l,A.x2=s,A.y2=u,A.w=s-o,A.h=u-l;var L=b&&"autorotate"===x.strValue,S=null!=x.pfValue&&0!==x.pfValue;if(L||S){var k=L?iH(r.rstyle,"labelAngle",n):x.pfValue,I=Math.cos(k),O=Math.sin(k),M=(o+s)/2,P=(l+u)/2;if(!b){switch(h.value){case"left":M=s;break;case"right":M=o}switch(c.value){case"top":P=u;break;case"bottom":P=l}}var R=function(e,t){return{x:(e-=M)*I-(t-=P)*O+M,y:e*O+t*I+P}},B=R(o,l),F=R(o,u),z=R(s,l),G=R(s,u);o=Math.min(B.x,F.x,z.x,G.x),s=Math.max(B.x,F.x,z.x,G.x),l=Math.min(B.y,F.y,z.y,G.y),u=Math.max(B.y,F.y,z.y,G.y)}var Y=C+"Rot",X=N[Y]=N[Y]||{};X.x1=o,X.y1=l,X.x2=s,X.y2=u,X.w=s-o,X.h=u-l,ij(e,o,l,s,u),ij(r.labelBounds.all,o,l,s,u)}return e}},iK=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,r=t.pstyle("outline-width").value;if(n>0&&r>0){var i=t.pstyle("outline-offset").value,a=t.pstyle("shape").value,o=r+i,s=(e.w+2*o)/e.w,l=(e.h+2*o)/e.h,u=0;["diamond","pentagon","round-triangle"].includes(a)?(s=(e.w+2.4*o)/e.w,u=-o/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(a)?s=(e.w+2.4*o)/e.w:"star"===a?(s=(e.w+2.8*o)/e.w,l=(e.h+2.6*o)/e.h,u=-o/3.8):"triangle"===a?(s=(e.w+2.8*o)/e.w,l=(e.h+2.4*o)/e.h,u=-o/1.4):"vee"===a&&(s=(e.w+4.4*o)/e.w,l=(e.h+3.8*o)/e.h,u=-(.5*o));var h=e.h*l-e.h,c=e.w*s-e.w;if(tW(e,[Math.ceil(h/2),Math.ceil(c/2)]),0!==u){var d,p=(d=u,{x1:e.x1+0,x2:e.x2+0,y1:e.y1+d,y2:e.y2+d,w:e.w,h:e.h});tj(e,p)}}}},iZ=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=tV(),o=e._private,s=e.isNode(),l=e.isEdge(),u=o.rstyle,h=s&&r?e.pstyle("bounds-expansion").pfValue:[0],c=function(e){return"none"!==e.pstyle("display").value},d=!r||c(e)&&(!l||c(e.source())&&c(e.target()));if(d){var p=0;r&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(p=e.pstyle("overlay-padding").value);var g=0;r&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(g=e.pstyle("underlay-padding").value);var f=Math.max(p,g),v=0;if(r&&(v=e.pstyle("width").pfValue/2),s&&t.includeNodes){var y=e.position();D=y.x,C=y.y;var b=e.outerWidth()/2,x=e.outerHeight()/2;w=D-b,E=D+b,ij(a,w,_=C-x,E,T=C+x),r&&t.includeOutlines&&iK(a,e)}else if(l&&t.includeEdges)if(r&&!i){var w,E,_,T,D,C,N,A=e.pstyle("curve-style").strValue;if(w=Math.min(u.srcX,u.midX,u.tgtX),E=Math.max(u.srcX,u.midX,u.tgtX),_=Math.min(u.srcY,u.midY,u.tgtY),T=Math.max(u.srcY,u.midY,u.tgtY),w-=v,E+=v,ij(a,w,_-=v,E,T+=v),"haystack"===A){var L=u.haystackPts;if(L&&2===L.length){if(w=L[0].x,_=L[0].y,E=L[1].x,T=L[1].y,w>E){var S=w;w=E,E=S}if(_>T){var k=_;_=T,T=k}ij(a,w-v,_-v,E+v,T+v)}}else if("bezier"===A||"unbundled-bezier"===A||"segments"===A||"taxi"===A){switch(A){case"bezier":case"unbundled-bezier":N=u.bezierPts;break;case"segments":case"taxi":N=u.linePts}if(null!=N)for(var I=0;I<N.length;I++){var O=N[I];w=O.x-v,E=O.x+v,ij(a,w,_=O.y-v,E,T=O.y+v)}}}else{var M=e.source().position(),P=e.target().position();if(w=M.x,E=P.x,_=M.y,T=P.y,w>E){var R=w;w=E,E=R}if(_>T){var B=_;_=T,T=B}w-=v,E+=v,ij(a,w,_-=v,E,T+=v)}if(r&&t.includeEdges&&l&&(iW(a,e,"mid-source"),iW(a,e,"mid-target"),iW(a,e,"source"),iW(a,e,"target")),r&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;ij(a,a.x1+F,a.y1+z,a.x2+F,a.y2+z)}var G=o.bodyBounds=o.bodyBounds||{};t$(G,a),tW(G,h),tH(G,1),r&&(w=a.x1,E=a.x2,_=a.y1,T=a.y2,ij(a,w-f,_-f,E+f,T+f));var Y=o.overlayBounds=o.overlayBounds||{};t$(Y,a),tW(Y,h),tH(Y,1);var X=o.labelBounds=o.labelBounds||{};null!=X.all?tU(X.all):X.all=tV(),r&&t.includeLabels&&(t.includeMainLabels&&i$(a,e,null),l&&(t.includeSourceLabels&&i$(a,e,"source"),t.includeTargetLabels&&i$(a,e,"target")))}return a.x1=iU(a.x1),a.y1=iU(a.y1),a.x2=iU(a.x2),a.y2=iU(a.y2),a.w=iU(a.x2-a.x1),a.h=iU(a.y2-a.y1),a.w>0&&a.h>0&&d&&(tW(a,h),tH(a,1)),a},iQ=function(e){var t=0,n=function(e){return!!e<<t++};return 0+n(e.incudeNodes)+n(e.includeEdges)+n(e.includeLabels)+n(e.includeMainLabels)+n(e.includeSourceLabels)+n(e.includeTargetLabels)+n(e.includeOverlays)+n(e.includeOutlines)},iJ=function(e){if(!e.isEdge())return 0;var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return eK([r(t.x),r(t.y),r(n.x),r(n.y)])},i0=function(e,t){var n,r=e._private,i=e.isEdge(),a=null==t?i2:iQ(t),o=iJ(e),s=r.bbCachePosKey===o,l=t.useCache&&s,u=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!l||u(e)||i&&u(e.source())||u(e.target())?(s||e.recalculateRenderedStyle(l),r.bbCache=n=iZ(e,i1),r.bbCachePosKey=o):n=r.bbCache,a!==i2){var h=e.isNode();n=tV(),(t.includeNodes&&h||t.includeEdges&&!h)&&(t.includeOverlays?iq(n,r.overlayBounds):iq(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?iq(n,r.labelBounds.all):(t.includeMainLabels&&iq(n,r.labelBounds.mainRot),t.includeSourceLabels&&iq(n,r.labelBounds.sourceRot),t.includeTargetLabels&&iq(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},i1={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},i2=iQ(i1),i5=ta(i1);_.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=tV();var n=i5(e=e||i1);if(this.cy().styleEnabled())for(var r=0;r<this.length;r++){var i=this[r],a=i._private,o=iJ(i),s=a.bbCachePosKey===o,l=n.useCache&&s&&!a.styleDirty;i.recalculateRenderedStyle(l)}this.updateCompoundBounds(!e.useCache);for(var u=0;u<this.length;u++)iq(t,i0(this[u],n))}else e=void 0===e?i1:i5(e),t=i0(this[0],e);return t.x1=iU(t.x1),t.y1=iU(t.y1),t.x2=iU(t.x2),t.y2=iU(t.y2),t.w=iU(t.x2-t.x1),t.h=iU(t.y2-t.y1),t},_.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},_.boundingBoxAt=function(e){var t,n=this.nodes(),r=this.cy(),i=r.hasCompoundNodes(),a=r.collection();if(i&&(a=n.filter(function(e){return e.isParent()}),n=n.not(a)),z(e)){var o=e;e=function(){return o}}r.startBatch(),n.forEach(function(t,n){return t._private.bbAtOldPos=e(t,n)}).silentPositions(e),i&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var s={x1:(t=this.boundingBox({useCache:!1})).x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h};return n.silentPositions(function(e){return e._private.bbAtOldPos}),i&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),s},E.boundingbox=E.bb=E.boundingBox,E.renderedBoundingbox=E.renderedBoundingBox,T=D={};var i3=function(e){e.uppercaseName=J(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=J(e.outerName),T[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t)if(!r)return 1;else{if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);return"label"===i.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):i.pfValue}},T["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)if(n)return t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding();else return 1},T["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},T["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};i3({name:"width"}),i3({name:"height"}),D.padding=function(){var e=this[0],t=e._private;return e.isParent()&&(e.updateCompoundBounds(),void 0!==t.autoPadding)?t.autoPadding:e.pstyle("padding").pfValue},D.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},D.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var i4=function(e,t){if(e.isEdge())return t(e)},i9=function(e,t){if(e.isEdge()){var n=e.cy();return tC(t(e),n.zoom(),n.pan())}},i6=function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map(function(e){return tC(e,i,r)})}},i8={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},i7=eo({},w,_,D,Object.keys(i8).reduce(function(e,t){var n=i8[t],r="rendered"+t[0].toUpperCase()+t.substr(1);return e[t]=function(){return i4(this,n.get)},n.mult?e[r]=function(){return i6(this,n.get)}:e[r]=function(){return i9(this,n.get)},e},{})),ae=function(e,t){this.recycle(e,t)};function at(){return!1}function an(){return!0}ae.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=at,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?an:at):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=an;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=an;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=an,this.stopPropagation()},isDefaultPrevented:at,isPropagationStopped:at,isImmediatePropagationStopped:at};var ar=/^([^.]+)(\.(?:[^.]+))?$/,ai={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},aa=Object.keys(ai),ao={};function as(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ao,t=arguments.length>1?arguments[1]:void 0,n=0;n<aa.length;n++){var r=aa[n];this[r]=e[r]||ai[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var al=as.prototype,au=function(e,t,n,r,i,a,o){B(r)&&(i=r,r=null),o&&(a=null==a?o:eo({},a,o));for(var s=F(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!H(u)){var h=u.match(ar);if(h&&!1===t(e,u,h[1],h[2]?h[2]:null,r,i,a))break}}},ah=function(e,t){return e.addEventFields(e.context,t),new ae(t.type,t)},ac=function(e,t,n){if("event"===P(n))return void t(e,n);if(z(n))return void t(e,ah(e,n));for(var r=F(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!H(a)){var o=a.match(ar);if(o){var s=ah(e,{type:o[1],namespace:o[2]?o[2]:null,target:e.context});t(e,s)}}}};al.on=al.addListener=function(e,t,n,r,i){return au(this,function(e,t,n,r,i,a,o){B(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})},e,t,n,r,i),this},al.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},al.removeListener=al.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var a=this.listeners,o=function(o){var s=a[o];au(i,function(t,n,r,i,l,u){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!u||s.callback===u))return a.splice(o,1),!1},e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},al.removeAllListeners=function(){return this.removeListener("*")},al.emit=al.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,F(t)||(t=[t]),ac(this,function(e,a){null!=n&&(i=(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}]).length);for(var o=0;o<i;o++)!function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,a)){var o=[a];null!=t&&tl(o,t),e.beforeEmit(e.context,i,a),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter(function(e){return e!==i}));var s=e.callbackContext(e.context,i,a),l=i.callback.apply(s,o);e.afterEmit(e.context,i,a),!1===l&&(a.stopPropagation(),a.preventDefault())}}(o);e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)},e),this.emitting--,this};var ad={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&V(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ap=function(e){return R(e)?new iS(e):e},ag={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new as(ad,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=ap(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=ap(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=ap(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=ap(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};ic.eventAliasesOn(ag);var af={nodes:function(e){return this.filter(function(e){return e.isNode()}).filter(e)},edges:function(e){return this.filter(function(e){return e.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(R(e)||X(e))return new iS(e).filter(this);if(B(e)){for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r];(t?e.apply(t,[i,r,this]):e(i,r,this))&&n.push(i)}return n}return this.spawn()},not:function(e){if(!e)return this;R(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(R(e))return this.filter(e);for(var t=this.spawn(),n=this.length<e.length,r=n?this:e,i=n?e:this,a=0;a<r.length;a++){var o=r[a];i.has(o)&&t.push(o)}return t},xor:function(e){var t=this._private.cy;R(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;R(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=e,o=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return o(this,a,n),o(a,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(R(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i];this.has(a)||r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&R(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=o,i.set(s,{ele:o,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&R(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=0;r<this.length;r++){var i=this[r],a=t?e.apply(t,[i,r,this]):e(i,r,this);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=0;r<this.length;r++)n=e(n,this[r],r,this);return n},max:function(e,t){for(var n,r=-1/0,i=0;i<this.length;i++){var a=this[i],o=t?e.apply(t,[a,i,this]):e(a,i,this);o>r&&(r=o,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i<this.length;i++){var a=this[i],o=t?e.apply(t,[a,i,this]):e(a,i,this);o<r&&(r=o,n=a)}return{value:r,ele:n}}};af.u=af["|"]=af["+"]=af.union=af.or=af.add,af["\\"]=af["!"]=af["-"]=af.difference=af.relativeComplement=af.subtract=af.not,af.n=af["&"]=af["."]=af.and=af.intersection=af.intersect,af["^"]=af["(+)"]=af["(-)"]=af.symmetricDifference=af.symdiff=af.xor,af.fnFilter=af.filterFn=af.stdFilter=af.filter,af.complement=af.abscomp=af.absoluteComplement;var av=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?e5:0}var i=r(e)-r(t);if(0!==i)return i;function a(e){return"auto"===e.pstyle("z-index-compare").value?+!!e.isNode():0}var o=a(e)-a(t);if(0!==o)return o;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},ay={forEach:function(e,t){if(B(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!B(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(av)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:e5-1}var r=t.source,i=t.target;return Math.max(r.zDepth(),i.zDepth(),0)}}};ay.each=ay.forEach,("u"<typeof Symbol?"undefined":e(Symbol))!="undefined"&&"undefined"!=e(Symbol.iterator)&&(ay[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return a({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})});var am=ta({nodeDimensionsIncludeLabels:!1}),ab={layoutDimensions:function(e){if(e=am(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var t,n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return(0===t.w||0===t.h)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter(function(e){return!e.isParent()}),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=$(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(e,t,n){var r={x:t.x1+t.w/2,y:t.y1+t.h/2},i={x:(n.x-r.x)*e,y:(n.y-r.y)*e};return{x:r.x+i.x,y:r.y+i.y}},u=t.spacingFactor&&1!==t.spacingFactor,h=function(){if(!u)return null;for(var e=tV(),t=0;t<r.length;t++){var n=s(r[t],t);tq(e,n.x,n.y)}return e}(),c=$(function(e,n){var r=s(e,n);return u&&(r=l(Math.abs(t.spacingFactor),h,r)),null!=t.transform&&(r=t.transform(e,r)),r},o);if(t.animate){for(var d=0;d<r.length;d++){var p=r[d],g=c(p,d);if(null==t.animateFilter||t.animateFilter(p,d)){var f=p.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(f)}else p.position(g)}if(t.fit){var v=i.animation({fit:{boundingBox:a.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var y=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}e.animations.forEach(function(e){return e.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),rx.all(e.animations.map(function(e){return e.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else r.positions(c),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(eo({},e,{eles:this}))}};function ax(e,t,n){var r,i=n._private,a=i.styleCache=i.styleCache||[];return null!=(r=a[e])?r:r=a[e]=t(n)}function aw(e,t){return e=eZ(e),function(n){return ax(e,t,n)}}function aE(e,t){e=eZ(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return ax(e,n,t)}}ab.createLayout=ab.makeLayout=ab.layout;var a_={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};return t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach(function(e){n(e),e.connectedEdges().forEach(n)}),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=t.hasCompoundNodes(),r=this;e=!!e||void 0===e,n&&(r=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=r;return e?i.emitAndNotify("style"):i.emit("style"),r.forEach(function(e){return e._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(z(e))r.applyBypass(this,e,!1),this.emitAndNotify("style");else if(R(e))if(void 0===t){var i=this[0];return i?r.getStylePropertyValue(i,e):void 0}else r.applyBypass(this,e,t,!1),this.emitAndNotify("style");else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style();if(void 0===e)for(var r=0;r<this.length;r++){var i=this[r];n.removeAllBypasses(i,!1)}else{e=e.split(/\s+/);for(var a=0;a<this.length;a++){var o=this[a];n.removeBypasses(o,e,!1)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++)i*=a[o].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();if(e)if(!t)return 0===e.pstyle("opacity").value;else return 0===e.effectiveOpacity()},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function aT(e,t){var n=e._private.data.parent?e.parents():null;if(n){for(var r=0;r<n.length;r++)if(!t(n[r]))return!1}return!0}function aD(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||aT(i,r);var s=o.source,l=o.target;return n(s)&&(!a||aT(s,n))&&(s===l||n(l)&&(!a||aT(l,n)))}}}var aC=aw("eleTakesUpSpace",function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())});a_.takesUpSpace=aE("takesUpSpace",aD({ok:aC})),a_.interactive=aE("interactive",aD({ok:aw("eleInteractive",function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&aC(e)}),parentOk:aw("parentInteractive",function(e){return"visible"===e.pstyle("visibility").value&&aC(e)}),edgeOkViaNode:aC})),a_.noninteractive=function(){var e=this[0];if(e)return!e.interactive()},a_.visible=aE("visible",aD({ok:aw("eleVisible",function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&aC(e)}),edgeOkViaNode:aC})),a_.hidden=function(){var e=this[0];if(e)return!e.visible()},a_.isBundledBezier=aE("isBundledBezier",function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()}),a_.bypass=a_.css=a_.style,a_.renderedCss=a_.renderedStyle,a_.removeBypass=a_.removeCss=a_.removeStyle,a_.pstyle=a_.parsedStyle;var aN={};function aA(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&B(t[0])){var a=t[0];this.on(e.event,a)}else if(0===t.length||1===t.length&&F(t[0])){for(var o=1===t.length?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],h=l._private[e.field]!=e.value;if(e.overrideAble){var c=e.overrideAble(l);if(void 0!==c&&(u=c,!c))return this}u&&(l._private[e.field]=e.value,h&&n.push(l))}var d=this.spawn(n);d.updateStyle(),d.emit(e.event),o&&d.emit(o)}return this}}function aL(e){aN[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},aN[e.on]=aA({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),aN[e.off]=aA({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}aL({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),aL({field:"grabbable",overrideField:function(e){return!(e.cy().autoungrabify()||e.pannable())&&void 0},on:"grabify",off:"ungrabify"}),aL({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),aL({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),aN.deselect=aN.unselect,aN.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},aL({field:"active",on:"activate",off:"unactivate"}),aL({field:"pannable",on:"panify",off:"unpanify"}),aN.inactive=function(){var e=this[0];if(e)return!e._private.active};var aS={},ak=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var a=!1,o=i.connectedEdges(),s=0;s<o.length;s++){var l=o[s],u=l.source(),h=l.target();if(e.noIncomingEdges&&h===i&&u!==i||e.noOutgoingEdges&&u===i&&h!==i){a=!0;break}}a||n.push(i)}}return this.spawn(n,!0).filter(t)}},aI=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],l=s.source(),u=s.target();e.outgoing&&l===i?(n.push(s),n.push(u)):e.incoming&&u===i&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},aO=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();i[u]||(i[u]=!0,r.push(l),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}};function aM(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function aP(e){return function(t){var n=[],r=this._private.cy,i=e||{};R(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var l=o[s],u=l._private.data,h=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),c=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);if(h||c){if((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!h||i.thisIsTgt&&!c))continue;n.push(l)}}return this.spawn(n,!0)}}function aR(e){return e=eo({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,l=s._private.data.id,u=o.data.target,h=s._private.edges,c=0;c<h.length;c++){var d=h[c],p=d._private.data,g=p.target,f=p.source,v=g===u&&f===l,y=l===g&&u===f;(i.codirected&&v||!i.codirected&&(v||y))&&n.push(d)}return this.spawn(n,!0).filter(t)}}aS.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},eo(aS,{roots:ak({noIncomingEdges:!0}),leaves:ak({noOutgoingEdges:!0}),outgoers:iO(aI({outgoing:!0}),"outgoers"),successors:aO({outgoing:!0}),incomers:iO(aI({incoming:!0}),"incomers"),predecessors:aO({incoming:!0})}),eo(aS,{neighborhood:iO(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],l=s.source(),u=s.target(),h=i===l?u:l;h.length>0&&t.push(h[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),aS.neighbourhood=aS.neighborhood,aS.closedNeighbourhood=aS.closedNeighborhood,aS.openNeighbourhood=aS.openNeighborhood,eo(aS,{source:iO(function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t},"source"),target:iO(function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t},"target"),sources:aM({attr:"source"}),targets:aM({attr:"target"})}),eo(aS,{edgesWith:iO(aP(),"edgesWith"),edgesTo:iO(aP({thisIsSrc:!0}),"edgesTo")}),eo(aS,{connectedEdges:iO(function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,a=0;a<i.length;a++){var o=i[a];t.push(o)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:iO(function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:iO(aR(),"parallelEdges"),codirectedEdges:iO(aR({codirected:!0}),"codirectedEdges")}),eo(aS,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),a=[];null!=e&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();do!function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach(function(n){n.connectedEdges().forEach(function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)})})}();while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),aS.componentsOf=aS.components;var aB=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0===e)return void e8("A collection must have a reference to the core");var i=new td,a=!1;if(t){if(t.length>0&&z(t[0])&&!V(t[0])){a=!0;for(var o=[],s=new tg,l=0,u=t.length;l<u;l++){var h=t[l];null==h.data&&(h.data={});var c=h.data;if(null==c.id)c.id=tn();else if(e.hasElementWithId(c.id)||s.has(c.id))continue;var d=new tf(e,h,!1);o.push(d),s.add(c.id)}t=o}}else t=[];this.length=0;for(var p=0,g=t.length;p<g;p++){var f=t[p][0];if(null!=f){var v=f._private.data.id;(!n||!i.has(v))&&(n&&i.set(v,{index:this.length,ele:f}),this[this.length]=f,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(m){this.lazyMap=m},rebuildMap:function(){for(var e=this.lazyMap=new td,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),a&&!r&&this.restore()},aF=tf.prototype=aB.prototype=Object.create(Array.prototype);aF.instanceString=function(){return"collection"},aF.spawn=function(e,t){return new aB(this.cy(),e,t)},aF.spawnSelf=function(){return this.spawn(this)},aF.cy=function(){return this._private.cy},aF.renderer=function(){return this._private.cy.renderer()},aF.element=function(){return this[0]},aF.collection=function(){return U(this)?this:new aB(this._private.cy,[this])},aF.unique=function(){return new aB(this._private.cy,this,!0)},aF.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},aF.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new aB(t)},aF.$id=aF.getElementById,aF.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},aF.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},aF.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},aF.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(z(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,l=e.data.target;null!=s&&s!=i.source&&(o.source=""+s,a=!0),null!=l&&l!=i.target&&(o.target=""+l,a=!0),a&&(t=t.move(o))}else{var u="parent"in e.data,h=e.data.parent;u&&(null!=h||null!=i.parent)&&h!=i.parent&&(void 0===h&&(h=null),null!=h&&(h=""+h),t=t.move({parent:h}))}}e.position&&t.position(e.position);var c=function(n,i,a){var o=e[n];null!=o&&o!==r[n]&&(o?t[i]():t[a]())};return c("removed","remove","restore"),c("selected","select","unselect"),c("selectable","selectify","unselectify"),c("locked","lock","unlock"),c("grabbable","grabify","ungrabify"),c("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var d={data:tt(r.data),position:tt(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};d.classes="";var p=0;return r.classes.forEach(function(e){return d.classes+=0==p++?e:" "+e}),d}}},aF.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},aF.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=new tf(e,this[n].json(),!1);t.push(r)}return new aB(e,t)},aF.copy=aF.clone,aF.restore=function(){for(var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.cy(),r=n._private,i=[],a=[],o=0,s=this.length;o<s;o++){var l=this[o];(!t||l.removed())&&(l.isNode()?i.push(l):a.push(l))}k=i.concat(a);var u=function(){k.splice(I,1),I--};for(I=0;I<k.length;I++){var h=k[I],c=h._private,d=c.data;if(h.clearTraversalCache(),t||c.removed){if(void 0===d.id)d.id=tn();else if(G(d.id))d.id=""+d.id;else if(H(d.id)||!R(d.id)){e8("Can not create element with invalid string ID `"+d.id+"`"),u();continue}else if(n.hasElementWithId(d.id)){e8("Can not create second element with ID `"+d.id+"`"),u();continue}}var p=d.id;if(h.isNode()){var g=c.position;null==g.x&&(g.x=0),null==g.y&&(g.y=0)}if(h.isEdge()){for(var f=["source","target"],v=f.length,y=!1,b=0;b<v;b++){var x=f[b],w=d[x];G(w)&&(w=d[x]=""+d[x]),null==w||""===w?(e8("Can not create edge `"+p+"` with unspecified "+x),y=!0):n.hasElementWithId(w)||(e8("Can not create edge `"+p+"` with nonexistant "+x+" `"+w+"`"),y=!0)}if(y){u();continue}var E=n.getElementById(d.source),_=n.getElementById(d.target);E.same(_)?E._private.edges.push(h):(E._private.edges.push(h),_._private.edges.push(h)),h._private.source=E,h._private.target=_}c.map=new td,c.map.set(p,{ele:h,index:0}),c.removed=!1,t&&n.addToPool(h)}for(var T=0;T<i.length;T++){var D=i[T],C=D._private.data;G(C.parent)&&(C.parent=""+C.parent);var N=C.parent;if(null!=N||D._private.parent){var A=D._private.parent?n.collection().merge(D._private.parent):n.getElementById(N);if(A.empty())C.parent=void 0;else if(A[0].removed())te("Node added with missing parent, reference to parent removed"),C.parent=void 0,D._private.parent=null;else{for(var L=!1,S=A;!S.empty();){if(D.same(S)){L=!0,C.parent=void 0;break}S=S.parent()}L||(A[0]._private.children.push(D),D._private.parent=A[0],r.hasCompoundNodes=!0)}}}if(k.length>0){for(var k,I,O,M=k.length===this.length?this:new aB(n,k),P=0;P<M.length;P++){var B=M[P];B.isNode()||(B.parallelEdges().clearTraversalCache(),B.source().clearTraversalCache(),B.target().clearTraversalCache())}(r.hasCompoundNodes?n.collection().merge(M).merge(M.connectedNodes()).merge(M.parent()):M).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?M.emitAndNotify("add"):t&&M.emit("add")}return this},aF.removed=function(){var e=this[0];return e&&e._private.removed},aF.inside=function(){var e=this[0];return e&&!e._private.removed},aF.remove=function(){for(var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=[],r={},i=this._private.cy,a=0,o=this.length;a<o;a++)!function e(i){var a=r[i.id()];if(!(t&&i.removed())&&!a)if(r[i.id()]=!0,i.isNode()){n.push(i);for(var o=i._private.edges,s=0;s<o.length;s++)e(o[s]);for(var l=i._private.children,u=0;u<l.length;u++)e(l[u])}else n.unshift(i)}(this[a]);function s(e,t){to(e._private.edges,t),e.clearTraversalCache()}var l=[];l.ids={},this.dirtyCompoundBoundsCache(),t&&i.removeFromPool(n);for(var u=0;u<n.length;u++){var h=n[u];if(h.isEdge()){var c=h.source()[0],d=h.target()[0];s(c,h),s(d,h);for(var p=h.parallelEdges(),g=0;g<p.length;g++){var f=p[g];f.clearTraversalCache(),f.isBundledBezier()&&f.dirtyBoundingBoxCache()}}else{var v=h.parent();0!==v.length&&function(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();to(n,t),t._private.parent=null,l.ids[r]||(l.ids[r]=!0,l.push(e))}(v,h)}t&&(h._private.removed=!0)}var y=i._private.elements;i._private.hasCompoundNodes=!1;for(var b=0;b<y.length;b++)if(y[b].isParent()){i._private.hasCompoundNodes=!0;break}var x=new aB(this.cy(),n);x.size()>0&&(e?x.emitAndNotify("remove"):t&&x.emit("remove"));for(var w=0;w<l.length;w++){var E=l[w];t&&E.removed()||E.updateStyle()}return x},aF.move=function(e){var t=this._private.cy,n=this,r=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var i=r(e.source),a=r(e.target),o=null!=i&&t.hasElementWithId(i),s=null!=a&&t.hasElementWithId(a);(o||s)&&(t.batch(function(){n.remove(!1,!1),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],r=t._private.data;t.isEdge()&&(o&&(r.source=i),s&&(r.target=a))}n.restore(!1,!1)}),n.emitAndNotify("move"))}else if(void 0!==e.parent){var l=r(e.parent);if(null===l||t.hasElementWithId(l)){var u=null===l?void 0:l;t.batch(function(){var e=n.remove(!1,!1);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var r=n[t],i=r._private.data;r.isNode()&&(i.parent=u)}e.restore(!1,!1)}),n.emitAndNotify("move")}}return this},[rp,id,ip,iI,iM,b,iz,i7,ag,af,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},ay,ab,a_,aN,aS].forEach(function(e){eo(aF,e)});var az=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}return function n(r,i,a){var o,s,l,u,h,c,d,p,g,f,v,y={x:-1,v:0,tension:null,friction:null},b=[0],x=0;for(r=parseFloat(r)||500,i=parseFloat(i)||20,a=a||null,y.tension=r,y.friction=i,f=(g=null!==a)?(x=n(r,i))/a*.016:.016;o=v||y,s=f,l={dx:o.v,dv:e(o)},u=t(o,.5*s,l),h=t(o,.5*s,u),c=t(o,s,h),d=1/6*(l.dx+2*(u.dx+h.dx)+c.dx),p=1/6*(l.dv+2*(u.dv+h.dv)+c.dv),o.x=o.x+d*s,o.v=o.v+p*s,v=o,b.push(1+v.x),x+=16,Math.abs(v.x)>1e-4&&Math.abs(v.v)>1e-4;);return g?function(e){return b[e*(b.length-1)|0]}:x}}(),aG=function(e,t,n,r){var i=function(e,t,n,r){var i="u">typeof Float32Array;if(4!=arguments.length)return!1;for(var a=0;a<4;++a)if("number"!=typeof arguments[a]||isNaN(arguments[a])||!isFinite(arguments[a]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var o=i?new Float32Array(11):Array(11);function s(e,t,n){return(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e}function l(e,t,n){return 3*(1-3*n+3*t)*e*e+2*(3*n-6*t)*e+3*t}var u=!1,h=function(i){return(u||(u=!0,(e!==t||n!==r)&&function(){for(var t=0;t<11;++t)o[t]=s(.1*t,e,n)}()),e===t&&n===r)?i:0===i?0:1===i?1:s(function(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=.1;var a=r+(t-o[--i])/(o[i+1]-o[i])*.1,u=l(a,e,n);if(u>=.001){for(var h=a,c=0;c<4;++c){var d=l(h,e,n);if(0===d)break;var p=s(h,e,n)-t;h-=p/d}return h}return 0===u?a:function(t,r,i){var a,o,l=0;do(a=s(o=r+(i-r)/2,e,n)-t)>0?i=o:r=o;while(Math.abs(a)>1e-7&&++l<10);return o}(t,r,r+.1)}(i),t,r)};h.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var c="generateBezier("+[e,t,n,r]+")";return h.toString=function(){return c},h}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},aY={linear:function(e,t,n){return e+(t-e)*n},ease:aG(.25,.1,.25,1),"ease-in":aG(.42,0,1,1),"ease-out":aG(0,0,.58,1),"ease-in-out":aG(.42,0,.58,1),"ease-in-sine":aG(.47,0,.745,.715),"ease-out-sine":aG(.39,.575,.565,1),"ease-in-out-sine":aG(.445,.05,.55,.95),"ease-in-quad":aG(.55,.085,.68,.53),"ease-out-quad":aG(.25,.46,.45,.94),"ease-in-out-quad":aG(.455,.03,.515,.955),"ease-in-cubic":aG(.55,.055,.675,.19),"ease-out-cubic":aG(.215,.61,.355,1),"ease-in-out-cubic":aG(.645,.045,.355,1),"ease-in-quart":aG(.895,.03,.685,.22),"ease-out-quart":aG(.165,.84,.44,1),"ease-in-out-quart":aG(.77,0,.175,1),"ease-in-quint":aG(.755,.05,.855,.06),"ease-out-quint":aG(.23,1,.32,1),"ease-in-out-quint":aG(.86,0,.07,1),"ease-in-expo":aG(.95,.05,.795,.035),"ease-out-expo":aG(.19,1,.22,1),"ease-in-out-expo":aG(1,0,0,1),"ease-in-circ":aG(.6,.04,.98,.335),"ease-out-circ":aG(.075,.82,.165,1),"ease-in-out-circ":aG(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return aY.linear;var r=az(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":aG};function aX(e,t,n,r,i){if(1===r||t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function aV(e,t){return null==e.pfValue&&null==e.value?e:null!=e.pfValue&&(null==t||"%"!==t.type.units)?e.pfValue:e.value}function aU(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=aV(e,i),s=aV(t,i);if(G(o)&&G(s))return aX(a,o,s,n,r);if(F(o)&&F(s)){for(var l=[],u=0;u<s.length;u++){var h=o[u],c=s[u];if(null!=h&&null!=c){var d=aX(a,h,c,n,r);l.push(d)}else l.push(c)}return l}}function aj(e,t){return null!=e&&null!=t&&(!!(G(e)&&G(t))||!!e&&!!t)}function aq(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(0===a.length){var l=o.shift();l&&a.push(l)}for(var u=function(e){for(var t=e.length-1;t>=0;t--)(0,e[t])();e.splice(0,e.length)},h=a.length-1;h>=0;h--){var c=a[h],d=c._private;if(d.stopped){a.splice(h,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.frames);continue}(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||function(e,t){var n=e._private;n.started=!0,n.startTime=t-n.progress*n.duration}(c,e),function(e,t,n,r){var i,a,o,s,l=!r,u=e._private,h=t._private,c=h.easing,d=h.startTime,p=(r?e:e.cy()).style();h.easingImpl||(null==c?h.easingImpl=aY.linear:(i=R(c)?p.parse("transition-timing-function",c).value:c,R(i)?(a=i,o=[]):(a=i[1],o=i.slice(2).map(function(e){return+e})),o.length>0?("spring"===a&&o.push(h.duration),h.easingImpl=aY[a].apply(null,o)):h.easingImpl=aY[a]));var g=h.easingImpl;if(s=0===h.duration?1:(n-d)/h.duration,h.applying&&(s=h.progress),s<0?s=0:s>1&&(s=1),null==h.delay){var f=h.startPosition,v=h.position;if(v&&l&&!e.locked()){var y={};aj(f.x,v.x)&&(y.x=aU(f.x,v.x,s,g)),aj(f.y,v.y)&&(y.y=aU(f.y,v.y,s,g)),e.position(y)}var b=h.startPan,x=h.pan,w=u.pan,E=null!=x&&r;E&&(aj(b.x,x.x)&&(w.x=aU(b.x,x.x,s,g)),aj(b.y,x.y)&&(w.y=aU(b.y,x.y,s,g)),e.emit("pan"));var _=h.startZoom,T=h.zoom,D=null!=T&&r;D&&(aj(_,T)&&(u.zoom=tX(u.minZoom,aU(_,T,s,g),u.maxZoom)),e.emit("zoom")),(E||D)&&e.emit("viewport");var C=h.style;if(C&&C.length>0&&l){for(var N=0;N<C.length;N++){var A=C[N],L=A.name,S=h.startStyle[L],k=p.properties[S.name],I=aU(S,A,s,g,k);p.overrideBypass(e,L,I)}e.emit("style")}}h.progress=s}(t,c,e,n),d.applying&&(d.applying=!1),u(d.frames),null!=d.step&&d.step(e),c.completed()&&(a.splice(h,1),d.hooked=!1,d.playing=!1,d.started=!1,u(d.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=i(n[o]);a=a||s}var l=i(t,!0);(a||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var aH={animate:ic.animate(),animation:ic.animation(),animated:ic.animated(),clearQueue:ic.clearQueue(),delay:ic.delay(),delayAnimation:ic.delayAnimation(),stop:ic.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender(function(t,n){aq(n,e)},t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&eU(function(n){aq(n,e),t()})}()}}},aW={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&V(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},a$=function(e){return R(e)?new iS(e):e},aK={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new as(aW,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,a$(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,a$(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,a$(t),n),this},once:function(e,t,n){return this.emitter().one(e,a$(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};ic.eventAliasesOn(aK);var aZ={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};aZ.jpeg=aZ.jpg;var aQ={layout:function(e){if(null==e)return void e8("Layout options must be specified to make a layout");if(null==e.name)return void e8("A `name` must be specified to make a layout");var t,n=e.name,r=this.extension("layout",n);return null==r?void e8("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?"):(t=R(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$(),new r(eo({},e,{cy:this,eles:t})))}};aQ.createLayout=aQ.makeLayout=aQ.layout;var aJ=ta({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),a0={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this.extension("renderer",e.name);if(null==t)return void e8("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));void 0!==e.wheelSensitivity&&te("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=aJ(e);n.cy=this,this._private.renderer=new t(n),this.notify("init")},destroyRenderer:function(){this.notify("destroy");var e=this.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)e.removeChild(e.childNodes[0]);this._private.renderer=null,this.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};a0.invalidateDimensions=a0.resize;var a1={collection:function(e,t){return R(e)?this.$(e):X(e)?e.collection():F(e)?(t||(t={}),new aB(this,e,t.unique,t.removed)):new aB(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};a1.elements=a1.filter=a1.$;var a2={};a2.apply=function(e){for(var t=this._private.cy.collection(),n=0;n<e.length;n++){var r=e[n],i=this.getContextMeta(r);if(!i.empty){var a=this.getContextStyle(i),o=this.applyContextStyle(i,a,r);r._private.appliedInitStyle?this.updateTransitions(r,o.diffProps):r._private.appliedInitStyle=!0,this.updateStyleHints(r)&&t.push(r)}}return t},a2.getPropertiesDiff=function(e,t){var n=this._private.propDiffs=this._private.propDiffs||{},r=e+"-"+t,i=n[r];if(i)return i;for(var a=[],o={},s=0;s<this.length;s++){var l=this[s],u="t"===e[s],h="t"===t[s],c=u!==h,d=l.mappedProperties.length>0;if(c||h&&d){var p=void 0;c&&d||c?p=l.properties:d&&(p=l.mappedProperties);for(var g=0;g<p.length;g++){for(var f=p[g],v=f.name,y=!1,b=s+1;b<this.length;b++){var x=this[b];if("t"===t[b]&&(y=null!=x.properties[f.name]))break}o[v]||y||(o[v]=!0,a.push(v))}}}return n[r]=a,a},a2.getContextMeta=function(e){for(var t,n="",r=e._private.styleCxtKey||"",i=0;i<this.length;i++){var a=this[i];a.selector&&a.selector.matches(e)?n+="t":n+="f"}return t=this.getPropertiesDiff(r,n),e._private.styleCxtKey=n,{key:n,diffPropNames:t,empty:0===t.length}},a2.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var a=this[i];if("t"===t[i])for(var o=0;o<a.properties.length;o++){var s=a.properties[o];r[s.name]=s}}return n[t]=r,r},a2.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},a=this.types,o=0;o<r.length;o++){var s=r[o],l=t[s],u=n.pstyle(s);if(!l)if(!u)continue;else l=u.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0};if(u!==l){if(l.mapped===a.fn&&null!=u&&null!=u.mapping&&u.mapping.value===l.value){var h=u.mapping;if((h.fnValue=l.value(n))===h.prevFnValue)continue}var c=i[s]={prev:u};this.applyParsedProperty(n,l),c.next=n.pstyle(s),c.next&&c.next.bypass&&(c.next=c.next.bypassed)}}return{diffProps:i}},a2.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,l=e._private.style;r=Object.keys(l);for(var u=0;u<i.length;u++){var h=i[u];t.styleKeys[h]=[9261,5381]}for(var c=function(e,n){return t.styleKeys[n][0]=eq(e,t.styleKeys[n][0])},d=function(e,n){return t.styleKeys[n][1]=eH(e,t.styleKeys[n][1])},p=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);c(r,t),d(r,t)}},g=0;g<r.length;g++){var f=r[g],v=l[f];if(null!=v){var y,b,x=this.properties[f],w=x.type,E=x.groupKey,_=void 0;null!=x.hashOverride?_=x.hashOverride(e,v):null!=v.pfValue&&(_=v.pfValue);var T=null==x.enums?v.value:null,D=null!=_,C=null!=T,N=D||C,A=v.units;w.number&&N&&!w.multiple?(c(b=-128<(y=D?_:T)&&y<128&&Math.floor(y)!==y?2e9-(1024*y|0):y,E),d(b,E),D||null==A||p(A,E)):p(v.strValue,E)}}for(var L=[9261,5381],S=0;S<i.length;S++){var k=i[S],I=t.styleKeys[k];L[0]=eq(I[0],L[0]),L[1]=eH(I[1],L[1])}t.styleKey=2097152*L[0]+L[1];var O=t.styleKeys;t.labelDimsKey=eW(O.labelDimensions);var M=a(e,["label"],O.labelDimensions);if(t.labelKey=eW(M),t.labelStyleKey=eW(e$(O.commonLabel,M)),!s){var P=a(e,["source-label"],O.labelDimensions);t.sourceLabelKey=eW(P),t.sourceLabelStyleKey=eW(e$(O.commonLabel,P));var R=a(e,["target-label"],O.labelDimensions);t.targetLabelKey=eW(R),t.targetLabelStyleKey=eW(e$(O.commonLabel,R))}if(s){var B=t.styleKeys,F=B.nodeBody,z=B.nodeBorder,G=B.nodeOutline,Y=B.backgroundImage,X=B.compound,V=B.pie;t.nodeKey=eW([F,z,G,Y,X,V].filter(function(e){return null!=e}).reduce(e$,[9261,5381])),t.hasPie=null!=V&&9261!==V[0]&&5381!==V[1]}return o!==t.styleKey},a2.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},a2.applyParsedProperty=function(e,t){var n=this,r=t,i=e._private.style,a=n.types,o=n.properties[r.name].type,s=r.bypass,l=i[r.name],u=l&&l.bypass,h=e._private,c="mapping",d=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=d(l),i=d(r);n.checkTriggers(e,r.name,t,i)};if("curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,"bezier",s)),r.delete)return i[r.name]=void 0,p(),!0;if(r.deleteBypassed)if(!l)return p(),!0;else if(l.bypass)return l.bypassed=void 0,p(),!0;else return!1;if(r.deleteBypass)if(!l)return p(),!0;else if(l.bypass)return i[r.name]=l.bypassed,p(),!0;else return!1;var g=function(){te("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case a.mapData:for(var f,v,y=r.field.split("."),b=h.data,x=0;x<y.length&&b;x++)b=b[y[x]];if(null==b)return g(),!1;if(!G(b))return te("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+b+"` for `"+e.id()+"` is non-numeric)"),!1;var w=r.fieldMax-r.fieldMin;if((v=0===w?0:(b-r.fieldMin)/w)<0?v=0:v>1&&(v=1),o.color){var E=r.valueMin[0],_=r.valueMax[0],T=r.valueMin[1],D=r.valueMax[1],C=r.valueMin[2],N=r.valueMax[2],A=null==r.valueMin[3]?1:r.valueMin[3],L=[Math.round(E+(_-E)*v),Math.round(T+(D-T)*v),Math.round(C+(N-C)*v),Math.round(A+((null==r.valueMax[3]?1:r.valueMax[3])-A)*v)];f={bypass:r.bypass,name:r.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else{if(!o.number)return!1;var S=r.valueMin+(r.valueMax-r.valueMin)*v;f=this.parse(r.name,S,r.bypass,c)}if(!f)return g(),!1;f.mapping=r,r=f;break;case a.data:for(var k=r.field.split("."),I=h.data,O=0;O<k.length&&I;O++)I=I[k[O]];if(null!=I&&(f=this.parse(r.name,I,r.bypass,c)),!f)return g(),!1;f.mapping=r,r=f;break;case a.fn:var M=r.value,P=null!=r.fnValue?r.fnValue:M(e);if(r.prevFnValue=P,null==P)return te("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(f=this.parse(r.name,P,r.bypass,c)))return te("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;f.mapping=tt(r),r=f;break;case void 0:break;default:return!1}return s?(u?r.bypassed=l.bypassed:r.bypassed=l,i[r.name]=r):u?l.bypassed=r:i[r.name]=r,p(),!0},a2.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else r._private.style={}}},a2.update=function(){this._private.cy.mutableElements().updateStyle()},a2.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,a=e.pstyle("transition-duration").pfValue,o=e.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var s={},l=!1,u=0;u<i.length;u++){var h=i[u],c=e.pstyle(h),d=t[h];if(d){var p=d.prev,g=null!=d.next?d.next:c,f=!1,v=void 0;p&&(G(p.pfValue)&&G(g.pfValue)?(f=g.pfValue-p.pfValue,v=p.pfValue+1e-6*f):G(p.value)&&G(g.value)?(f=g.value-p.value,v=p.value+1e-6*f):F(p.value)&&F(g.value)&&(f=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],v=p.strValue),f&&(s[h]=g.strValue,this.applyBypass(e,h,v),l=!0))}}if(!l)return;r.transitioning=!0,new rx(function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},a2.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);null!=s&&s(n,r)&&a(o)},a2.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify("zorder",e)})},a2.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),i.triggersBoundsOfParallelBeziers&&"curve-style"===t&&("bezier"===n||"bezier"===r)&&e.parallelEdges().forEach(function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}),i.triggersBoundsOfConnectedEdges&&"display"===t&&("none"===n||"none"===r)&&e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},a2.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var a5={};a5.applyBypass=function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;a<this.properties.length;a++){var o=this.properties[a].name,s=this.parse(o,n,!0);s&&i.push(s)}}else if(R(t)){var l=this.parse(t,n,!0);l&&i.push(l)}else{if(!z(t))return!1;r=n;for(var u=Object.keys(t),h=0;h<u.length;h++){var c=u[h],d=t[c];if(void 0===d&&(d=t[Z(c)]),void 0!==d){var p=this.parse(c,d,!0);p&&i.push(p)}}}if(0===i.length)return!1;for(var g=!1,f=0;f<e.length;f++){for(var v=e[f],y={},b=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var E=v.pstyle(w.name);b=y[w.name]={prev:E}}g=this.applyParsedProperty(v,tt(w))||g,r&&(b.next=v.pstyle(w.name))}g&&this.updateStyleHints(v),r&&this.updateTransitions(v,y,!0)}return g},a5.overrideBypass=function(e,t,n){t=K(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,l=o.mutiple,u=a?null!=a.pfValue?a.pfValue:a.value:null;a&&a.bypass?(a.value=n,null!=a.pfValue&&(a.pfValue=n),s?a.strValue="rgb("+n.join(",")+")":l?a.strValue=n.join(" "):a.strValue=""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,u,n)}},a5.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},a5.removeBypasses=function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],a={},o=0;o<t.length;o++){var s=t[o],l=this.properties[s],u=i.pstyle(l.name);if(u&&u.bypass){var h=this.parse(s,"",!0),c=a[l.name]={prev:u};this.applyParsedProperty(i,h),c.next=i.pstyle(l.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,a,!0)}};var a3={};a3.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},a3.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var a4={};a4.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},a4.getRawStyle=function(e,t){if(e=e[0]){for(var n={},r=0;r<this.properties.length;r++){var i=this.properties[r],a=this.getStylePropertyValue(e,i.name,t);null!=a&&(n[i.name]=a,n[Z(i.name)]=a)}return n}},a4.getIndexedStyle=function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},a4.getStylePropertyValue=function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,a=e.pstyle(r.name);if(a){var o=a.value,s=a.units,l=a.strValue;if(n&&i.number&&null!=o&&G(o)){var u=e.cy().zoom(),h=function(e){return e*u},c=function(e,t){return h(e)+t},d=F(o);if(d?s.every(function(e){return null!=e}):null!=s)if(d)return o.map(function(e,t){return c(e,s[t])}).join(" ");else return c(o,s);return d?o.map(function(e){return R(e)?e:""+h(e)}).join(" "):""+h(o)}if(null!=l)return l}return null}},a4.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);void 0!==a&&(a=z(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},a4.getPropsList=function(e){var t=[],n=this.properties;if(e)for(var r=Object.keys(e),i=0;i<r.length;i++){var a=r[i],o=e[a],s=n[a]||n[K(a)],l=this.parse(s.name,o);l&&t.push(l)}return t},a4.getNonDefaultPropertiesHash=function(e,t,n){var r,i,a,o,s,l,u=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)u[0]=eq(o,u[0]),u[1]=eH(o,u[1]);else for(l=0,a=i.strValue;l<a.length;l++)o=a.charCodeAt(l),u[0]=eq(o,u[0]),u[1]=eH(o,u[1]);return u},a4.getPropertiesHash=a4.getNonDefaultPropertiesHash;var a9={};a9.appendFromJson=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.selector,i=n.style||n.css,a=Object.keys(i);this.selector(r);for(var o=0;o<a.length;o++){var s=a[o],l=i[s];this.css(s,l)}}return this},a9.fromJson=function(e){return this.resetToDefault(),this.appendFromJson(e),this},a9.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:a})}return e};var a6={};a6.appendFromString=function(e){var t,n,r,i=""+e;function a(){i=i.length>t.length?i.substr(t.length):""}function o(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");!i.match(/^\s*$/);){var s=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!s){te("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}t=s[0];var l=s[1];if("core"!==l&&new iS(l).invalid){te("Skipping parsing of block: Invalid selector found in string stylesheet: "+l),a();continue}var u=s[2],h=!1;n=u;for(var c=[];!n.match(/^\s*$/);){var d=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!d){te("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),h=!0;break}r=d[0];var p=d[1],g=d[2];if(!this.properties[p]){te("Skipping property: Invalid property name in: "+r),o();continue}if(!this.parse(p,g)){te("Skipping property: Invalid property definition in: "+r),o();continue}c.push({name:p,val:g}),o()}if(h){a();break}this.selector(l);for(var f=0;f<c.length;f++){var v=c[f];this.css(v.name,v.val)}a()}return this},a6.fromString=function(e){return this.resetToDefault(),this.appendFromString(e),this};var a8={};!function(){var e=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},t=function(e){var t=ee+"|\\w+|"+en+"|"+ei+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+ee+")\\s*\\,\\s*("+ee+")\\s*,\\s*("+t+")\\s*\\,\\s*("+t+")\\)$"},n=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];a8.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:e("data")},layoutData:{mapping:!0,regex:e("layoutData")},scratch:{mapping:!0,regex:e("scratch")},mapData:{mapping:!0,regex:t("mapData")},mapLayoutData:{mapping:!0,regex:t("mapLayoutData")},mapScratch:{mapping:!0,regex:t("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:n,singleRegexMatchValue:!0},urls:{regexes:n,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return R(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+ee+")\\s*,\\s*("+ee+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+ee+")\\s*,\\s*("+ee+")\\s*,\\s*("+ee+")\\s*,\\s*("+ee+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var r=function(e,t){return(null==e||null==t)&&e!==t||0==e&&0!=t||0!=e&&0==t},i=function(e,t){return e!=t},a=a8.types,o=[{name:"label",type:a.text,triggersBounds:i,triggersZOrder:function(e,t){var n=H(e),r=H(t);return n&&!r||!n&&r}},{name:"text-rotation",type:a.textRotation,triggersBounds:i},{name:"text-margin-x",type:a.bidirectionalSize,triggersBounds:i},{name:"text-margin-y",type:a.bidirectionalSize,triggersBounds:i}],s=[{name:"source-label",type:a.text,triggersBounds:i},{name:"source-text-rotation",type:a.textRotation,triggersBounds:i},{name:"source-text-margin-x",type:a.bidirectionalSize,triggersBounds:i},{name:"source-text-margin-y",type:a.bidirectionalSize,triggersBounds:i},{name:"source-text-offset",type:a.size,triggersBounds:i}],l=[{name:"target-label",type:a.text,triggersBounds:i},{name:"target-text-rotation",type:a.textRotation,triggersBounds:i},{name:"target-text-margin-x",type:a.bidirectionalSize,triggersBounds:i},{name:"target-text-margin-y",type:a.bidirectionalSize,triggersBounds:i},{name:"target-text-offset",type:a.size,triggersBounds:i}],u=[{name:"font-family",type:a.fontFamily,triggersBounds:i},{name:"font-style",type:a.fontStyle,triggersBounds:i},{name:"font-weight",type:a.fontWeight,triggersBounds:i},{name:"font-size",type:a.size,triggersBounds:i},{name:"text-transform",type:a.textTransform,triggersBounds:i},{name:"text-wrap",type:a.textWrap,triggersBounds:i},{name:"text-overflow-wrap",type:a.textOverflowWrap,triggersBounds:i},{name:"text-max-width",type:a.size,triggersBounds:i},{name:"text-outline-width",type:a.size,triggersBounds:i},{name:"line-height",type:a.positiveNumber,triggersBounds:i}],h=[{name:"text-valign",type:a.valign,triggersBounds:i},{name:"text-halign",type:a.halign,triggersBounds:i},{name:"color",type:a.color},{name:"text-outline-color",type:a.color},{name:"text-outline-opacity",type:a.zeroOneNumber},{name:"text-background-color",type:a.color},{name:"text-background-opacity",type:a.zeroOneNumber},{name:"text-background-padding",type:a.size,triggersBounds:i},{name:"text-border-opacity",type:a.zeroOneNumber},{name:"text-border-color",type:a.color},{name:"text-border-width",type:a.size,triggersBounds:i},{name:"text-border-style",type:a.borderStyle,triggersBounds:i},{name:"text-background-shape",type:a.textBackgroundShape,triggersBounds:i},{name:"text-justification",type:a.justification}],c=[{name:"events",type:a.bool,triggersZOrder:i},{name:"text-events",type:a.bool,triggersZOrder:i}],d=[{name:"display",type:a.display,triggersZOrder:i,triggersBounds:i,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:a.visibility,triggersZOrder:i},{name:"opacity",type:a.zeroOneNumber,triggersZOrder:r},{name:"text-opacity",type:a.zeroOneNumber},{name:"min-zoomed-font-size",type:a.size},{name:"z-compound-depth",type:a.zCompoundDepth,triggersZOrder:i},{name:"z-index-compare",type:a.zIndexCompare,triggersZOrder:i},{name:"z-index",type:a.number,triggersZOrder:i}],p=[{name:"overlay-padding",type:a.size,triggersBounds:i},{name:"overlay-color",type:a.color},{name:"overlay-opacity",type:a.zeroOneNumber,triggersBounds:r},{name:"overlay-shape",type:a.overlayShape,triggersBounds:i}],g=[{name:"underlay-padding",type:a.size,triggersBounds:i},{name:"underlay-color",type:a.color},{name:"underlay-opacity",type:a.zeroOneNumber,triggersBounds:r},{name:"underlay-shape",type:a.overlayShape,triggersBounds:i}],f=[{name:"transition-property",type:a.propList},{name:"transition-duration",type:a.time},{name:"transition-delay",type:a.time},{name:"transition-timing-function",type:a.easing}],v=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},y=[{name:"height",type:a.nodeSize,triggersBounds:i,hashOverride:v},{name:"width",type:a.nodeSize,triggersBounds:i,hashOverride:v},{name:"shape",type:a.nodeShape,triggersBounds:i},{name:"shape-polygon-points",type:a.polygonPointList,triggersBounds:i},{name:"background-color",type:a.color},{name:"background-fill",type:a.fill},{name:"background-opacity",type:a.zeroOneNumber},{name:"background-blacken",type:a.nOneOneNumber},{name:"background-gradient-stop-colors",type:a.colors},{name:"background-gradient-stop-positions",type:a.percentages},{name:"background-gradient-direction",type:a.gradientDirection},{name:"padding",type:a.sizeMaybePercent,triggersBounds:i},{name:"padding-relative-to",type:a.paddingRelativeTo,triggersBounds:i},{name:"bounds-expansion",type:a.boundsExpansion,triggersBounds:i}],b=[{name:"border-color",type:a.color},{name:"border-opacity",type:a.zeroOneNumber},{name:"border-width",type:a.size,triggersBounds:i},{name:"border-style",type:a.borderStyle}],x=[{name:"outline-color",type:a.color},{name:"outline-opacity",type:a.zeroOneNumber},{name:"outline-width",type:a.size,triggersBounds:i},{name:"outline-style",type:a.borderStyle},{name:"outline-offset",type:a.size,triggersBounds:i}],w=[{name:"background-image",type:a.urls},{name:"background-image-crossorigin",type:a.bgCrossOrigin},{name:"background-image-opacity",type:a.zeroOneNumbers},{name:"background-image-containment",type:a.bgContainment},{name:"background-image-smoothing",type:a.bools},{name:"background-position-x",type:a.bgPos},{name:"background-position-y",type:a.bgPos},{name:"background-width-relative-to",type:a.bgRelativeTo},{name:"background-height-relative-to",type:a.bgRelativeTo},{name:"background-repeat",type:a.bgRepeat},{name:"background-fit",type:a.bgFit},{name:"background-clip",type:a.bgClip},{name:"background-width",type:a.bgWH},{name:"background-height",type:a.bgWH},{name:"background-offset-x",type:a.bgPos},{name:"background-offset-y",type:a.bgPos}],E=[{name:"position",type:a.position,triggersBounds:i},{name:"compound-sizing-wrt-labels",type:a.compoundIncludeLabels,triggersBounds:i},{name:"min-width",type:a.size,triggersBounds:i},{name:"min-width-bias-left",type:a.sizeMaybePercent,triggersBounds:i},{name:"min-width-bias-right",type:a.sizeMaybePercent,triggersBounds:i},{name:"min-height",type:a.size,triggersBounds:i},{name:"min-height-bias-top",type:a.sizeMaybePercent,triggersBounds:i},{name:"min-height-bias-bottom",type:a.sizeMaybePercent,triggersBounds:i}],_=[{name:"line-style",type:a.lineStyle},{name:"line-color",type:a.color},{name:"line-fill",type:a.fill},{name:"line-cap",type:a.lineCap},{name:"line-opacity",type:a.zeroOneNumber},{name:"line-dash-pattern",type:a.numbers},{name:"line-dash-offset",type:a.number},{name:"line-gradient-stop-colors",type:a.colors},{name:"line-gradient-stop-positions",type:a.percentages},{name:"curve-style",type:a.curveStyle,triggersBounds:i,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:a.zeroOneNumber,triggersBounds:i},{name:"source-endpoint",type:a.edgeEndpoint,triggersBounds:i},{name:"target-endpoint",type:a.edgeEndpoint,triggersBounds:i},{name:"control-point-step-size",type:a.size,triggersBounds:i},{name:"control-point-distances",type:a.bidirectionalSizes,triggersBounds:i},{name:"control-point-weights",type:a.numbers,triggersBounds:i},{name:"segment-distances",type:a.bidirectionalSizes,triggersBounds:i},{name:"segment-weights",type:a.numbers,triggersBounds:i},{name:"taxi-turn",type:a.bidirectionalSizeMaybePercent,triggersBounds:i},{name:"taxi-turn-min-distance",type:a.size,triggersBounds:i},{name:"taxi-direction",type:a.axisDirection,triggersBounds:i},{name:"edge-distances",type:a.edgeDistances,triggersBounds:i},{name:"arrow-scale",type:a.positiveNumber,triggersBounds:i},{name:"loop-direction",type:a.angle,triggersBounds:i},{name:"loop-sweep",type:a.angle,triggersBounds:i},{name:"source-distance-from-node",type:a.size,triggersBounds:i},{name:"target-distance-from-node",type:a.size,triggersBounds:i}],T=[{name:"ghost",type:a.bool,triggersBounds:i},{name:"ghost-offset-x",type:a.bidirectionalSize,triggersBounds:i},{name:"ghost-offset-y",type:a.bidirectionalSize,triggersBounds:i},{name:"ghost-opacity",type:a.zeroOneNumber}],D=[{name:"selection-box-color",type:a.color},{name:"selection-box-opacity",type:a.zeroOneNumber},{name:"selection-box-border-color",type:a.color},{name:"selection-box-border-width",type:a.size},{name:"active-bg-color",type:a.color},{name:"active-bg-opacity",type:a.zeroOneNumber},{name:"active-bg-size",type:a.size},{name:"outside-texture-bg-color",type:a.color},{name:"outside-texture-bg-opacity",type:a.zeroOneNumber}],C=[];a8.pieBackgroundN=16,C.push({name:"pie-size",type:a.sizeMaybePercent});for(var N=1;N<=a8.pieBackgroundN;N++)C.push({name:"pie-"+N+"-background-color",type:a.color}),C.push({name:"pie-"+N+"-background-size",type:a.percent}),C.push({name:"pie-"+N+"-background-opacity",type:a.zeroOneNumber});var A=[],L=a8.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:a.arrowShape,triggersBounds:i},{name:"arrow-color",type:a.color},{name:"arrow-fill",type:a.arrowFill},{name:"arrow-width",type:a.arrowWidth}].forEach(function(e){L.forEach(function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;A.push({name:n,type:r,triggersBounds:i})})},{});var S=a8.properties=[].concat(c,f,d,p,g,T,h,u,o,s,l,y,b,x,w,C,E,_,A,D),k=a8.propertyGroups={behavior:c,transition:f,visibility:d,overlay:p,underlay:g,ghost:T,commonLabel:h,labelDimensions:u,mainLabel:o,sourceLabel:s,targetLabel:l,nodeBody:y,nodeBorder:b,nodeOutline:x,backgroundImage:w,pie:C,compound:E,edgeLine:_,edgeArrow:A,core:D},I=a8.propertyGroupNames={};(a8.propertyGroupKeys=Object.keys(k)).forEach(function(e){I[e]=k[e].map(function(e){return e.name}),k[e].forEach(function(t){return t.groupKey=e})});var O=a8.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];a8.propertyNames=S.map(function(e){return e.name});for(var M=0;M<S.length;M++){var P=S[M];S[P.name]=P}for(var B=0;B<O.length;B++){var F=O[B],z=S[F.pointsTo],G={name:F.name,alias:!0,pointsTo:z};S.push(G),S[F.name]=G}}(),a8.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},a8.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=eo({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(e,t){for(var n=1;n<=a8.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}return e},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(e,t){return a8.arrowPrefixes.forEach(function(n){var r=n+"-"+t.name,i=t.value;e[r]=i}),e},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a],s=this.parse(a,o);n[a]=s}}return e.defaultProperties=n,e.defaultProperties},a8.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var a7={};a7.parse=function(e,t,n,r){if(B(t))return this.parseImplWarn(e,t,n,r);var i,a=eQ(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),o=this.propCache=this.propCache||[];return(i=o[a])||(i=o[a]=this.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(i=tt(i))&&(i.value=tt(i.value)),i},a7.parseImplWarn=function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||te("The style property `".concat(e,": ").concat(t,"` is invalid")),i&&("width"===i.name||"height"===i.name)&&"label"===t&&te("The style value of `label` is deprecated for `"+i.name+"`"),i},a7.parseImpl=function(e,t,n,r){e=K(e);var i=this.properties[e],a=t,o=this.types;if(!i||void 0===t)return null;i.alias&&(e=(i=i.pointsTo).name);var s=R(t);s&&(t=t.trim());var l=i.type;if(!l)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(B(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};if(!s||r||t.length<7||"a"!==t[1]);else if(t.length>=7&&"d"===t[0]&&(f=new RegExp(o.data.regex).exec(t))){if(n)return!1;var u=o.data;return{name:e,value:f,strValue:""+t,mapped:u,field:f[1],bypass:n}}else if(t.length>=10&&"m"===t[0]&&(v=new RegExp(o.mapData.regex).exec(t))){if(n||l.multiple)return!1;var h=o.mapData;if(!(l.color||l.number))return!1;var c=this.parse(e,v[4]);if(!c||c.mapped)return!1;var d=this.parse(e,v[5]);if(!d||d.mapped)return!1;if(c.pfValue===d.pfValue||c.strValue===d.strValue)return te("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+c.strValue+"`"),this.parse(e,c.strValue);if(l.color){var p=c.value,g=d.value;if(p[0]===g[0]&&p[1]===g[1]&&p[2]===g[2]&&(p[3]===g[3]||(null==p[3]||1===p[3])&&(null==g[3]||1===g[3])))return!1}return{name:e,value:v,strValue:""+t,mapped:h,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:c.value,valueMax:d.value,bypass:n}}if(l.multiple&&"multiple"!==r){if(y=s?t.split(/\s+/):F(t)?t:[t],l.evenMultiple&&y.length%2!=0)return null;for(var f,v,y,b=[],x=[],w=[],E="",_=!1,T=0;T<y.length;T++){var D=this.parse(e,y[T],n,"multiple");_=_||R(D.value),b.push(D.value),w.push(null!=D.pfValue?D.pfValue:D.value),x.push(D.units),E+=(T>0?" ":"")+D.strValue}if(l.validate&&!l.validate(b,x))return null;if(l.singleEnum&&_)if(1===b.length&&R(b[0]))return{name:e,value:b[0],strValue:b[0],bypass:n};else return null;return{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var C=function(){for(var r=0;r<l.enums.length;r++)if(l.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n};return null};if(l.number){var N,A,L="px";if(l.units&&(A=l.units),l.implicitUnits&&(L=l.implicitUnits),!l.unitless)if(s){var S="px|em"+(l.allowPercent?"|\\%":"");A&&(S=A);var k=t.match("^("+ee+")("+S+")?$");k&&(t=k[1],A=k[2]||L)}else(!A||l.implicitUnits)&&(A=L);if(isNaN(t=parseFloat(t))&&void 0===l.enums)return null;if(isNaN(t)&&void 0!==l.enums)return t=a,C();if(l.integer&&!(G(N=t)&&Math.floor(N)===N)||void 0!==l.min&&(t<l.min||l.strictMin&&t===l.min)||void 0!==l.max&&(t>l.max||l.strictMax&&t===l.max))return null;var I={name:e,value:t,strValue:""+t+(A||""),units:A,bypass:n};return l.unitless||"px"!==A&&"em"!==A?I.pfValue=t:I.pfValue="px"!==A&&A?this.getEmSizeInPixels()*t:t,("ms"===A||"s"===A)&&(I.pfValue="ms"===A?t:1e3*t),("deg"===A||"rad"===A)&&(I.pfValue="rad"===A?t:Math.PI*t/180),"%"===A&&(I.pfValue=t/100),I}if(l.propList){var O=[],M=""+t;if("none"===M);else{for(var P=M.split(/\s*,\s*|\s+/),z=0;z<P.length;z++){var Y=P[z].trim();this.properties[Y]?O.push(Y):te("`"+Y+"` is not a valid property name")}if(0===O.length)return null}return{name:e,value:O,strValue:0===O.length?"none":O.join(" "),bypass:n}}if(l.color){var X,V=(F(X=t)?X:null)||eh[X.toLowerCase()]||es(X)||eu(X)||el(X);return V?{name:e,value:V,pfValue:V,strValue:"rgb("+V[0]+","+V[1]+","+V[2]+")",bypass:n}:null}if(l.regex||l.regexes){if(l.enums){var U=C();if(U)return U}for(var j=l.regexes?l.regexes:[l.regex],q=0;q<j.length;q++){var H=new RegExp(j[q]).exec(t);if(H)return{name:e,value:l.singleRegexMatchValue?H[1]:H,strValue:""+t,bypass:n}}return null}if(l.string)return{name:e,value:""+t,strValue:""+t,bypass:n};else if(l.enums)return C();else return null};var oe=function e(t){return this instanceof e?j(t)?void(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):void e8("A style must have a core reference"):new e(t)},ot=oe.prototype;ot.instanceString=function(){return"style"},ot.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach(function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1}),this},ot.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ot.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},ot.selector=function(e){var t="core"===e?null:new iS(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},ot.css=function(){var e=arguments;if(1===e.length)for(var t=e[0],n=0;n<this.properties.length;n++){var r=this.properties[n],i=t[r.name];void 0===i&&(i=t[Z(r.name)]),void 0!==i&&this.cssRule(r.name,i)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},ot.style=ot.css,ot.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),this[r].selector||(this._private.coreStyle[n.name]=n)}return this},ot.append=function(e){return q(e)?e.appendToStyle(this):F(e)?this.appendFromJson(e):R(e)&&this.appendFromString(e),this},oe.fromJson=function(e,t){var n=new oe(e);return n.fromJson(t),n},oe.fromString=function(e,t){return new oe(e).fromString(t)},[a2,a5,a3,a4,a9,a6,a8,a7].forEach(function(e){eo(ot,e)}),oe.types=ot.types,oe.properties=ot.properties,oe.propertyGroups=ot.propertyGroups,oe.propertyGroupNames=ot.propertyGroupNames,oe.propertyGroupKeys=ot.propertyGroupKeys;var on={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return(null==t.selectionType&&(t.selectionType="single"),void 0===e)?t.selectionType:(("additive"===e||"single"===e)&&(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,a=arguments,o=this._private.pan;switch(a.length){case 0:return o;case 1:if(R(a[0]))return o[e=a[0]];if(z(a[0])){if(!this._private.panningEnabled)return this;r=(n=a[0]).x,i=n.y,G(r)&&(o.x=r),G(i)&&(o.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=a[0],t=a[1],("x"===e||"y"===e)&&G(t)&&(o[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,a=arguments,o=this._private.pan;if(!this._private.panningEnabled)return this;switch(a.length){case 1:z(e)&&(r=(n=a[0]).x,i=n.y,G(r)&&(o.x+=r),G(i)&&(o.y+=i),this.emit("pan viewport"));break;case 2:("x"===e||"y"===e)&&G(t)&&(o[e]+=t),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(G(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){if(R(e)){var n,r,i,a=e;e=this.$(a)}else if(z(n=e)&&G(n.x1)&&G(n.x2)&&G(n.y1)&&G(n.y2)){var o=e;(r={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=r.x2-r.x1,r.h=r.y2-r.y1}else X(e)||(e=this.mutableElements());if(!(X(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),l=this.height();if(t=G(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){i=(i=(i=Math.min((s-2*t)/r.w,(l-2*t)/r.h))>this._private.maxZoom?this._private.maxZoom:i)<this._private.minZoom?this._private.minZoom:i;var u={x:(s-i*(r.x1+r.x2))/2,y:(l-i*(r.y1+r.y2))/2};return{zoom:i,pan:u}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return G(e)&&G(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):G(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:G(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),G(e)?n=e:z(e)&&(n=e.level,null!=e.position?t=tC(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,o||!G(n)||n===a||null!=t&&(!G(t.x)||!G(t.y)))return null;if(null==t)return{zoomed:!0,panned:!1,zoom:n,pan:i};var s=n,l={x:-s/a*(t.x-i.x)+t.x,y:-s/a*(t.y-i.y)+t.y};return{zoomed:!0,panned:!0,zoom:s,pan:l}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed&&(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport")),this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e||(G(e.zoom)||(n=!1),z(e.pan)||(r=!1),!n&&!r))return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;G(l.x)&&(t.pan.x=l.x,o=!1),G(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(R(e)){var n=e;e=this.mutableElements().filter(n)}else X(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled&&this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};on.centre=on.center,on.autolockNodes=on.autolock,on.autoungrabifyNodes=on.autoungrabify;var or={data:ic.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ic.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ic.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ic.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};or.attr=or.data,or.removeAttr=or.removeData;var oi=function(e){var t=this,n=(e=eo({},e)).container;n&&!Y(n)&&Y(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{}).cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==L&&void 0!==n&&!e.headless,o=e;o.layout=eo({name:a?"grid":"null"},o.layout),o.renderer=eo({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:o,elements:new aB(this),listeners:[],aniEles:new aB(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:G(o.zoom)?o.zoom:1,pan:{x:z(o.pan)&&G(o.pan.x)?o.pan.x:0,y:z(o.pan)&&G(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=eo({},o,o.renderer);t.initRenderer(u);var h=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(z(e)||F(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var a=eo({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};!function(e,t){if(e.some(W))return rx.all(e).then(t);t(e)}([o.style,o.elements],function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),h(a,function(){t.startAnimationLoop(),l.ready=!0,B(o.ready)&&t.on("ready",o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")},o.done)})},oa=oi.prototype;eo(oa,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){if(!this.destroyed())return this.stopAnimationLoop(),this.destroyRenderer(),this.emit("destroy"),this._private.destroyed=!0,this},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(null==this._private.container)return L;var e=this._private.container.ownerDocument;return void 0===e||null==e?L:e.defaultView||L},mount:function(e){if(null!=e){var t=this._private,n=t.options;return!Y(e)&&Y(e[0])&&(e=e[0]),this.stopAnimationLoop(),this.destroyRenderer(),t.container=e,t.styleEnabled=!0,this.invalidateSize(),this.initRenderer(eo({},n,n.renderer,{name:"null"===n.renderer.name?"canvas":n.renderer.name})),this.startAnimationLoop(),this.style(n.style),this.emit("mount"),this}},unmount:function(){return this.stopAnimationLoop(),this.destroyRenderer(),this.initRenderer({name:"null"}),this.emit("unmount"),this},options:function(){return tt(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(z(e)){if(t.startBatch(),e.elements){var i={},a=function(e,n){for(var r=[],a=[],o=0;o<e.length;o++){var s=e[o];if(!s.data.id){te("cy.json() cannot handle elements without an ID attribute");continue}var l=""+s.data.id,u=t.getElementById(l);i[l]=!0,0!==u.length?a.push({ele:u,json:s}):(n&&(s.group=n),r.push(s))}t.add(r);for(var h=0;h<a.length;h++){var c=a[h],d=c.ele,p=c.json;d.json(p)}};if(F(e.elements))a(e.elements);else for(var o=["nodes","edges"],s=0;s<o.length;s++){var l=o[s],u=e.elements[l];F(u)&&a(u,l)}var h=t.collection();r.filter(function(e){return!i[e.id()]}).forEach(function(e){e.isParent()?h.merge(e):e.remove()}),h.forEach(function(e){return e.children().move({parent:null})}),h.forEach(function(e){return t.getElementById(e.id()).remove()})}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var c=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<c.length;d++){var p=c[d];null!=e[p]&&t[p](e[p])}return t.endBatch(),this}var g={};e?g.elements=this.elements().map(function(e){return e.json()}):(g.elements={},r.forEach(function(e){var t=e.group();g.elements[t]||(g.elements[t]=[]),g.elements[t].push(e.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=tt(t.data());var f=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=tt(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=tt(f.renderer),g.hideEdgesOnViewport=f.hideEdgesOnViewport,g.textureOnViewport=f.textureOnViewport,g.wheelSensitivity=f.wheelSensitivity,g.motionBlur=f.motionBlur,g.multiClickDebounceTime=f.multiClickDebounceTime,g}}),oa.$id=oa.getElementById,[{add:function(e){var t;if(X(e))if(e._private.cy===this)t=e.restore();else{for(var n=[],r=0;r<e.length;r++){var i=e[r];n.push(i.json())}t=new aB(this,n)}else if(F(e))t=new aB(this,e);else if(z(e)&&(F(e.nodes)||F(e.edges))){for(var a=[],o=["nodes","edges"],s=0,l=o.length;s<l;s++){var u=o[s],h=e[u];if(F(h))for(var c=0,d=h.length;c<d;c++){var p=eo({group:u},h[c]);a.push(p)}}t=new aB(this,a)}else t=new tf(this,e).collection();return t},remove:function(e){if(X(e));else if(R(e)){var t=e;e=this.$(t)}return e.remove()}},aH,aK,aZ,aQ,{notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}})}},a0,a1,{style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return q(e)?t.style=e.generateStyle(this):F(e)?t.style=oe.fromJson(this,e):R(e)?t.style=oe.fromString(this,e):t.style=oe(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},on,or].forEach(function(e){eo(oa,e)});var oo={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},os={maximal:!1,acyclic:!1},ol=function(e){return e.scratch("breadthfirst")},ou=function(e,t){return e.scratch("breadthfirst",t)};function oh(e){this.options=eo({},oo,os,e)}oh.prototype.run=function(){var e,t=this.options,n=t.cy,r=t.eles,i=r.nodes().filter(function(e){return!e.isParent()}),a=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,s=tV(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(X(t.roots))e=t.roots;else if(F(t.roots)){for(var l=[],u=0;u<t.roots.length;u++){var h=t.roots[u],c=n.getElementById(h);l.push(c)}e=n.collection(l)}else if(R(t.roots))e=n.$(t.roots);else if(a)e=i.roots();else{var d=r.components();e=n.collection();for(var p=0;p<d.length;p++)!function(t){var n=d[t],r=n.maxDegree(!1),i=n.filter(function(e){return e.degree(!1)===r});e=e.add(i)}(p)}var g=[],f={},v=function(e,t){null==g[t]&&(g[t]=[]);var n=g[t].length;g[t].push(e),ou(e,{index:n,depth:t})},y=function(e,t){var n=ol(e),r=n.depth,i=n.index;g[r][i]=null,v(e,t)};r.bfs({roots:e,directed:t.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();v(a,i),f[o]=!0}});for(var b=[],x=0;x<i.length;x++){var w=i[x];f[w.id()]||b.push(w)}var E=function(e){for(var t=g[e],n=0;n<t.length;n++){var r=t[n];if(null==r){t.splice(n,1),n--;continue}ou(r,{depth:e,index:n})}},_=function(){for(var e=0;e<g.length;e++)E(e)};if(a&&o){var T=[],D={},C=function(e){return T.push(e)};for(i.forEach(function(e){return T.push(e)});T.length>0;){var N=T.shift(),A=function(e,n){for(var i=ol(e),a=e.incomers().filter(function(e){return e.isNode()&&r.has(e)}),o=-1,s=e.id(),l=0;l<a.length;l++)o=Math.max(o,ol(a[l]).depth);if(i.depth<=o){if(!t.acyclic&&n[s])return null;var u=o+1;return y(e,u),n[s]=u,!0}return!1}(N,D);if(A)N.outgoers().filter(function(e){return e.isNode()&&r.has(e)}).forEach(C);else if(null===A){te("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}_();var L=0;if(t.avoidOverlap)for(var S=0;S<i.length;S++){var k=i[S].layoutDimensions(t),I=k.w,O=k.h;L=Math.max(L,I,O)}var M={},P=function(e){if(M[e.id()])return M[e.id()];for(var t=ol(e).depth,n=e.neighborhood(),r=0,a=0,o=0;o<n.length;o++){var s=n[o];if(!(s.isEdge()||s.isParent())&&i.has(s)){var l=ol(s);if(null!=l){var u=l.index,h=l.depth;if(null!=u&&null!=h){var c=g[h].length;h<t&&(r+=u/c,a++)}}}}return r/=a=Math.max(1,a),0===a&&(r=0),M[e.id()]=r,r},B=function(e,t){var n=P(e)-P(t);return 0===n?ea(e.id(),t.id()):n};void 0!==t.depthSort&&(B=t.depthSort);for(var z=0;z<g.length;z++)g[z].sort(B),E(z);for(var G=[],Y=0;Y<b.length;Y++)G.push(b[Y]);g.unshift(G),_();for(var V=0,U=0;U<g.length;U++)V=Math.max(g[U].length,V);var j={x:s.x1+s.w/2,y:s.x1+s.h/2},q=g.reduce(function(e,t){return Math.max(e,t.length)},0);return r.nodes().layoutPositions(this,t,function(e){var n=ol(e),r=n.depth,i=n.index,a=g[r].length,o=Math.max(s.w/((t.grid?q:a)+1),L),l=Math.max(s.h/(g.length+1),L),u=Math.min(s.w/2/g.length,s.h/2/g.length);if(u=Math.max(u,L),!t.circle)return{x:j.x+(i+1-(a+1)/2)*o,y:(r+1)*l};var h=u*r+u-(g.length>0&&g[0].length<=3?u/2:0),c=2*Math.PI/g[r].length*i;return 0===r&&1===g[0].length&&(h=1),{x:j.x+h*Math.cos(c),y:j.y+h*Math.sin(c)}}),this};var oc={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function od(e){this.options=eo({},oc,e)}od.prototype.run=function(){var e,t=this.options,n=t.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o=tV(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),u=0,h=0;h<a.length;h++){var c=a[h].layoutDimensions(t);u=Math.max(u,c.w,c.h)}if(e=G(t.radius)?t.radius:a.length<=1?0:Math.min(o.h,o.w)/2-u,a.length>1&&t.avoidOverlap){var d=Math.cos(l)-1,p=Math.sin(l)-0;e=Math.max(Math.sqrt((u*=1.75)*u/(d*d+p*p)),e)}return r.nodes().layoutPositions(this,t,function(n,r){var a=t.startAngle+r*l*(i?1:-1),o=e*Math.cos(a),u=e*Math.sin(a);return{x:s.x+o,y:s.y+u}}),this};var op={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function og(e){this.options=eo({},op,e)}og.prototype.run=function(){for(var e=this.options,t=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=e.cy,r=e.eles,i=r.nodes().not(":parent"),a=tV(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},s=[],l=0,u=0;u<i.length;u++){var h=i[u],c=void 0;c=e.concentric(h),s.push({value:c,node:h}),h._private.scratch.concentric=c}i.updateStyle();for(var d=0;d<i.length;d++){var p=i[d].layoutDimensions(e);l=Math.max(l,p.w,p.h)}s.sort(function(e,t){return t.value-e.value});for(var g=e.levelWidth(i),f=[[]],v=f[0],y=0;y<s.length;y++){var b=s[y];v.length>0&&Math.abs(v[0].value-b.value)>=g&&(v=[],f.push(v)),v.push(b)}var x=l+e.minNodeSpacing;if(!e.avoidOverlap){var w=f.length>0&&f[0].length>1,E=(Math.min(a.w,a.h)/2-x)/(f.length+w?1:0);x=Math.min(x,E)}for(var _=0,T=0;T<f.length;T++){var D=f[T],C=void 0===e.sweep?2*Math.PI-2*Math.PI/D.length:e.sweep,N=D.dTheta=C/Math.max(1,D.length-1);if(D.length>1&&e.avoidOverlap){var A=Math.cos(N)-1,L=Math.sin(N)-0;_=Math.max(Math.sqrt(x*x/(A*A+L*L)),_)}D.r=_,_+=x}if(e.equidistant){for(var S=0,k=0,I=0;I<f.length;I++)S=Math.max(S,f[I].r-k);k=0;for(var O=0;O<f.length;O++){var M=f[O];0===O&&(k=M.r),M.r=k,k+=S}}for(var P={},R=0;R<f.length;R++)for(var B=f[R],F=B.dTheta,z=B.r,G=0;G<B.length;G++){var Y=B[G],X=e.startAngle+(t?1:-1)*F*G,V={x:o.x+z*Math.cos(X),y:o.y+z*Math.sin(X)};P[Y.node.id()]=V}return r.nodes().layoutPositions(this,e,function(e){return P[e.id()]}),this};var of={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function ov(e){this.options=eo({},of,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(e){var n=e.source().data("id"),r=e.target().data("id"),i=t.some(function(e){return e.data("id")===n}),a=t.some(function(e){return e.data("id")===r});return!i||!a});this.options.eles=this.options.eles.not(n)}ov.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(!0===e.animate||!1===e.animate)&&n.emit({type:"layoutstart",layout:n}),C=!0===e.debug;var r=oy(t,n,e);C&&N(r),e.randomize&&ox(r);var i=eX(),a=function(){oE(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!n.stopped&&!(t>=e.numIter)&&(o_(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)a(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=ow(r,e,t);t.layoutPositions(n,e,i)}},l=0,u=!0;if(!0===e.animate)!function t(){for(var n=0;u&&n<e.refresh;)u=o(l),l++,n++;u?(eX()-i>=e.animationThreshold&&a(),eU(t)):(oP(r,e),s())}();else{for(;u;)u=o(l),l++;oP(r,e),s()}return this},ov.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ov.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var oy=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=tV(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},u=0;u<s.length;u++)for(var h=s[u],c=0;c<h.length;c++){var d=h[c];l[d.id()]=u}for(var u=0;u<o.nodeSize;u++){var p=i[u],g=p.layoutDimensions(n),f={};f.isLocked=p.locked(),f.id=p.data("id"),f.parentId=p.data("parent"),f.cmptId=l[p.id()],f.children=[],f.positionX=p.position("x"),f.positionY=p.position("y"),f.offsetX=0,f.offsetY=0,f.height=g.w,f.width=g.h,f.maxX=f.positionX+f.width/2,f.minX=f.positionX-f.width/2,f.maxY=f.positionY+f.height/2,f.minY=f.positionY-f.height/2,f.padLeft=parseFloat(p.style("padding")),f.padRight=parseFloat(p.style("padding")),f.padTop=parseFloat(p.style("padding")),f.padBottom=parseFloat(p.style("padding")),f.nodeRepulsion=B(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,o.layoutNodes.push(f),o.idToIndex[f.id]=u}for(var v=[],y=0,b=-1,x=[],u=0;u<o.nodeSize;u++){var p=o.layoutNodes[u],w=p.parentId;null!=w?o.layoutNodes[o.idToIndex[w]].children.push(p.id):(v[++b]=p.id,x.push(p.id))}for(o.graphSet.push(x);y<=b;){var E=v[y++],_=o.idToIndex[E],d=o.layoutNodes[_],T=d.children;if(T.length>0){o.graphSet.push(T);for(var u=0;u<T.length;u++)v[++b]=T[u]}}for(var u=0;u<o.graphSet.length;u++)for(var D=o.graphSet[u],c=0;c<D.length;c++){var C=o.idToIndex[D[c]];o.indexToGraph[C]=u}for(var u=0;u<o.edgeSize;u++){var N=r[u],A={};A.id=N.data("id"),A.sourceId=N.data("source"),A.targetId=N.data("target");var L=B(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,S=B(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,k=o.idToIndex[A.sourceId],I=o.idToIndex[A.targetId];if(o.indexToGraph[k]!=o.indexToGraph[I]){for(var O=om(A.sourceId,A.targetId,o),M=o.graphSet[O],P=0,f=o.layoutNodes[k];-1===M.indexOf(f.id);)f=o.layoutNodes[o.idToIndex[f.parentId]],P++;for(f=o.layoutNodes[I];-1===M.indexOf(f.id);)f=o.layoutNodes[o.idToIndex[f.parentId]],P++;L*=P*n.nestingFactor}A.idealLength=L,A.elasticity=S,o.layoutEdges.push(A)}return o},om=function(e,t,n){var r=ob(e,t,0,n);return 2>r.count?0:r.graph},ob=function e(t,n,r,i){var a=i.graphSet[r];if(-1<a.indexOf(t)&&-1<a.indexOf(n))return{count:2,graph:r};for(var o=0,s=0;s<a.length;s++){var l=a[s],u=i.idToIndex[l],h=i.layoutNodes[u].children;if(0!==h.length){var c=e(t,n,i.indexToGraph[i.idToIndex[h[0]]],i);if(0===c.count)continue;if(1!==c.count)return c;if(2==++o)break}}return{count:o,graph:r}},ox=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];0!==a.children.length||a.isLocked||(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},ow=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data("id")]];if(!t.boundingBox)return{x:o.positionX,y:o.positionY};var s=(o.positionX-i.x1)/i.w,l=(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}},oE=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=ow(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},o_=function(e,t,n){oT(e,t),oL(e),oS(e,t),ok(e),oI(e)},oT=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++)oC(o,e.layoutNodes[e.idToIndex[r[s]]],e,t)},oD=function(e){return-e+2*e*Math.random()},oC=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,a=t.positionY-e.positionY;0===i&&0===a&&(i=oD(1),a=oD(1));var o=oN(e,t,i,a);if(o>0)var s=r.nodeOverlap*o,l=Math.sqrt(i*i+a*a),u=s*i/l,h=s*a/l;else var c=oA(e,i,a),d=oA(t,-1*i,-1*a),p=d.x-c.x,g=d.y-c.y,f=p*p+g*g,l=Math.sqrt(f),s=(e.nodeRepulsion+t.nodeRepulsion)/f,u=s*p/l,h=s*g/l;e.isLocked||(e.offsetX-=u,e.offsetY-=h),t.isLocked||(t.offsetX+=u,t.offsetY+=h)}},oN=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},oA=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return 0===t&&0<n||0===t&&0>n?(u.x=r,u.y=i+a/2):0<t&&-1*l<=s&&s<=l?(u.x=r+o/2,u.y=i+o*n/2/t):0>t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t):0<n&&(s<=-1*l||s>=l)?(u.x=r+a*t/2/n,u.y=i+a/2):0>n&&(s<=-1*l||s>=l)&&(u.x=r-a*t/2/n,u.y=i-a/2),u},oL=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],l=s.positionX-a.positionX,u=s.positionY-a.positionY;if(0!==l||0!==u){var h=oA(a,l,u),c=oA(s,-1*l,-1*u),d=c.x-h.x,p=c.y-h.y,g=Math.sqrt(d*d+p*p),f=Math.pow(r.idealLength-g,2)/r.elasticity;if(0!==g)var v=f*d/g,y=f*p/g;else var v=0,y=0;a.isLocked||(a.offsetX+=v,a.offsetY+=y),s.isLocked||(s.offsetX-=v,s.offsetY-=y)}}},oS=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var a=e.clientHeight/2,o=e.clientWidth/2;else var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]],a=l.positionX,o=l.positionY;for(var u=0;u<i;u++){var h=e.layoutNodes[e.idToIndex[r[u]]];if(!h.isLocked){var c=a-h.positionX,d=o-h.positionY,p=Math.sqrt(c*c+d*d);if(p>1){var g=t.gravity*c/p,f=t.gravity*d/p;h.offsetX+=g,h.offsetY+=f}}}}},ok=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,h=s.offsetY,c=0;c<l.length;c++){var d=e.layoutNodes[e.idToIndex[l[c]]];d.offsetX+=u,d.offsetY+=h,n[++i]=l[c]}s.offsetX=0,s.offsetY=0}}},oI=function(e,t){for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&(r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];if(!(0<r.children.length)&&!r.isLocked){var i=oO(r.offsetX,r.offsetY,e.temperature);r.positionX+=i.x,r.positionY+=i.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,oM(r,e)}}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&!r.isLocked&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY)}},oO=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},oM=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;if((null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,a=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,a=!0),a)return e(i,n)}},oP=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}for(var s=0,i=0;i<r.length;i++){var l=r[i];if(l){l.x1=1/0,l.x2=-1/0,l.y1=1/0,l.y2=-1/0;for(var u=0;u<l.length;u++){var h=l[u];l.x1=Math.min(l.x1,h.positionX-h.width/2),l.x2=Math.max(l.x2,h.positionX+h.width/2),l.y1=Math.min(l.y1,h.positionY-h.height/2),l.y2=Math.max(l.y2,h.positionY+h.height/2)}l.w=l.x2-l.x1,l.h=l.y2-l.y1,s+=l.w*l.h}}r.sort(function(e,t){return t.w*t.h-e.w*e.h});for(var c=0,d=0,p=0,g=0,f=Math.sqrt(s)*e.clientWidth/e.clientHeight,i=0;i<r.length;i++){var l=r[i];if(l){for(var u=0;u<l.length;u++){var h=l[u];h.isLocked||(h.positionX+=c-l.x1,h.positionY+=d-l.y1)}c+=l.w+t.componentSpacing,p+=l.w+t.componentSpacing,g=Math.max(g,l.h),p>f&&(d+=g+t.componentSpacing,c=0,p=0,g=0)}}},oR={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oB(e){this.options=eo({},oR,e)}oB.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().not(":parent");e.sort&&(r=r.sort(e.sort));var i=tV(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(0===i.h||0===i.w)n.nodes().layoutPositions(this,e,function(e){return{x:i.x1,y:i.y1}});else{var a=r.size(),o=Math.sqrt(a*i.h/i.w),s=Math.round(o),l=Math.round(i.w/i.h*o),u=function(e){if(null==e)return Math.min(s,l);Math.min(s,l)==s?s=e:l=e},h=function(e){if(null==e)return Math.max(s,l);Math.max(s,l)==s?s=e:l=e},c=e.rows,d=null!=e.cols?e.cols:e.columns;if(null!=c&&null!=d)s=c,l=d;else if(null!=c&&null==d)l=Math.ceil(a/(s=c));else if(null==c&&null!=d)s=Math.ceil(a/(l=d));else if(l*s>a){var p=u(),g=h();(p-1)*g>=a?u(p-1):(g-1)*p>=a&&h(g-1)}else for(;l*s<a;){var f=u(),v=h();(v+1)*f>=a?h(v+1):u(f+1)}var y=i.w/l,b=i.h/s;if(e.condense&&(y=0,b=0),e.avoidOverlap)for(var x=0;x<r.length;x++){var w=r[x],E=w._private.position;(null==E.x||null==E.y)&&(E.x=0,E.y=0);var _=w.layoutDimensions(e),T=e.avoidOverlapPadding,D=_.w+T,C=_.h+T;y=Math.max(y,D),b=Math.max(b,C)}for(var N={},A=function(e,t){return!!N["c-"+e+"-"+t]},L=function(e,t){N["c-"+e+"-"+t]=!0},S=0,k=0,I=function(){++k>=l&&(k=0,S++)},O={},M=0;M<r.length;M++){var P=r[M],R=e.position(P);if(R&&(void 0!==R.row||void 0!==R.col)){var B={row:R.row,col:R.col};if(void 0===B.col)for(B.col=0;A(B.row,B.col);)B.col++;else if(void 0===B.row)for(B.row=0;A(B.row,B.col);)B.row++;O[P.id()]=B,L(B.row,B.col)}}r.layoutPositions(this,e,function(e,t){if(e.locked()||e.isParent())return!1;var n,r,a=O[e.id()];if(a)n=a.col*y+y/2+i.x1,r=a.row*b+b/2+i.y1;else{for(;A(S,k);)I();n=k*y+y/2+i.x1,r=S*b+b/2+i.y1,L(S,k),I()}return{x:n,y:r}})}return this};var oF={ready:function(){},stop:function(){}};function oz(e){this.options=eo({},oF,e)}oz.prototype.run=function(){var e=this.options,t=e.eles;return e.cy,this.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),this.one("layoutready",e.ready),this.emit("layoutready"),this.one("layoutstop",e.stop),this.emit("layoutstop"),this},oz.prototype.stop=function(){return this};var oG={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oY(e){this.options=eo({},oG,e)}oY.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=B(e.positions);return t.layoutPositions(this,e,function(t,r){var i=function(t){if(null==e.positions){var r;return{x:(r=t.position()).x,y:r.y}}if(n)return e.positions(t);var i=e.positions[t._private.data.id];return null==i?null:i}(t);return!t.locked()&&null!=i&&i}),this};var oX={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function oV(e){this.options=eo({},oX,e)}oV.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=tV(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),this};var oU=[{name:"breadthfirst",impl:oh},{name:"circle",impl:od},{name:"concentric",impl:og},{name:"cose",impl:ov},{name:"grid",impl:oB},{name:"null",impl:oz},{name:"preset",impl:oY},{name:"random",impl:oV}];function oj(e){this.options=e,this.notifications=0}var oq=function(){},oH=function(){throw Error("A headless instance can not render images")};oj.prototype={recalculateRenderedStyle:oq,notify:function(){this.notifications++},init:oq,isHeadless:function(){return!0},png:oH,jpg:oH};var oW={};oW.arrowShapeWidth=.3,oW.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,l=i.x+n/2+o,u=i.y-n/2-o,h=i.y+n/2+o;return s<=e&&e<=l&&u<=t&&t<=h},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r);return{x:a*n+i.x,y:o*n+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],l=e[o+1];a.push(r(s,l,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){R(s)&&(s=e[s]),e[r]=eo({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){return t9(e,t,a(i(this.points,n+2*s,r,o)))},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl("polygon")(e,o)},spacing:function(e){return 0},gap:o},s)};s("none",{collide:e4,roughCollide:e4,draw:e6,spacing:e9,gap:e9}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var l=i(this.points,n,a,o),u=this.controlPoint,h=r(u[0],u[1],n,a,o);t.arrowShapeImpl(this.name)(e,l,h)},gap:function(e){return .8*o(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),h=a(i(this.pointsTee,n+2*l,r,o));return t9(e,t,u)||t9(e,t,h)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,l){var u=Math.pow(o.x-e,2)+Math.pow(o.y-t,2)<=Math.pow((n+2*l)*this.radius,2);return t9(e,t,a(i(this.points,n+2*l,r,o)))||u},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),h=a(i(this.crossLinePts(n,s),n+2*l,r,o));return t9(e,t,u)||t9(e,t,h)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return .525*o(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,a,o){return Math.pow(i.x-e,2)+Math.pow(i.y-t,2)<=Math.pow((n+2*o)*this.radius,2)},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return .95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})};var o$={};o$.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),l=n.zoom();return[((e-i)/o-s.x)/l,((t-a)/o-s.y)/l]},o$.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},a={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},o=e.clientWidth,s=e.clientHeight,l=i.left+i.right,u=i.top+i.bottom,h=a.left+a.right,c=t.width/(o+h),d=t.left+i.left+a.left,p=t.top+i.top+a.top;return this.containerBB=[d,p,o-l,s-u,c]},o$.invalidateContainerClientCoordsCache=function(){this.containerBB=null},o$.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},o$.findNearestElements=function(e,t,n,r){var i,a,o=this,s=this,l=s.getCachedZSortedEles(),u=[],h=s.cy.zoom(),c=s.cy.hasCompoundNodes(),d=(r?24:8)/h,p=(r?8:2)/h,g=(r?8:2)/h,f=1/0;function v(e,t){if(e.isNode())if(a)return;else a=e,u.push(e);if(e.isEdge()&&(null==t||t<f))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value){for(var n=0;n<u.length;n++)if(u[n].isEdge()){u[n]=e,i=e,f=null!=t?t:f;break}}}else u.push(e),i=e,f=null!=t?t:f}function y(n){var r=n.outerWidth()+2*p,i=n.outerHeight()+2*p,a=r/2,l=i/2,u=n.position();if(u.x-a<=e&&e<=u.x+a&&u.y-l<=t&&t<=u.y+l&&s.nodeShapes[o.getNodeShape(n)].checkPoint(e,t,0,r,i,u.x,u.y))return v(n,0),!0}n&&(l=l.interactive);function b(n,r){var i,a=n._private;i=r?r+"-":"",n.boundingBox();var o=a.labelBounds[r||"main"],s=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&s){var l=tu(a.rscratch,"labelX",r),u=tu(a.rscratch,"labelY",r),h=tu(a.rscratch,"labelAngle",r),c=n.pstyle(i+"text-margin-x").pfValue,d=n.pstyle(i+"text-margin-y").pfValue,p=o.x1-g-c,f=o.x2+g-c,y=o.y1-g-d,b=o.y2+g-d;if(h){var x=Math.cos(h),w=Math.sin(h),E=function(e,t){return{x:(e-=l)*x-(t-=u)*w+l,y:e*w+t*x+u}},_=E(p,y),T=E(p,b),D=E(f,y),C=E(f,b);if(t9(e,t,[_.x+c,_.y+d,D.x+c,D.y+d,C.x+c,C.y+d,T.x+c,T.y+d]))return v(n),!0}else if(tZ(o,e,t))return v(n),!0}}for(var x=l.length-1;x>=0;x--){var w=l[x];w.isNode()?y(w)||b(w):function(n){var r,i=n._private,a=i.rscratch,l=n.pstyle("width").pfValue,h=n.pstyle("arrow-scale").value,p=l/2+d,g=p*p,f=2*p,b=i.source,x=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var w=a.allpts,E=0;E+3<w.length;E+=2)if(t0(e,t,w[E],w[E+1],w[E+2],w[E+3],f)&&g>(r=t4(e,t,w[E],w[E+1],w[E+2],w[E+3])))return v(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType){for(var w=a.allpts,E=0;E+5<a.allpts.length;E+=4)if(t1(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5],f)&&g>(r=t3(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5])))return v(n,r),!0}for(var b=b||i.source,x=x||i.target,_=o.getArrowWidth(l,h),T=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}],E=0;E<T.length;E++){var D=T[E],C=s.arrowShapes[n.pstyle(D.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(C.roughCollide(e,t,_,D.angle,{x:D.x,y:D.y},N,d)&&C.collide(e,t,_,D.angle,{x:D.x,y:D.y},N,d))return v(n),!0}c&&u.length>0&&(y(b),y(x))}(w)||b(w)||b(w,"source")||b(w,"target")}return u},o$.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=[],o=Math.min(e,n),s=Math.max(e,n),l=Math.min(t,r),u=Math.max(t,r);e=o,n=s;for(var h=tV({x1:e,y1:t=l,x2:n,y2:r=u}),c=0;c<i.length;c++){var d=i[c];if(d.isNode()){var p=d.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});tK(h,p)&&!tQ(p,h)&&a.push(d)}else{var g=d._private,f=g.rscratch;if(null!=f.startX&&null!=f.startY&&!tZ(h,f.startX,f.startY)||null!=f.endX&&null!=f.endY&&!tZ(h,f.endX,f.endY))continue;if("bezier"===f.edgeType||"multibezier"===f.edgeType||"self"===f.edgeType||"compound"===f.edgeType||"segments"===f.edgeType||"haystack"===f.edgeType){for(var v,y=g.rstyle.bezierPts||g.rstyle.linePts||g.rstyle.haystackPts,b=!0,x=0;x<y.length;x++)if(!tZ(h,(v=y[x]).x,v.y)){b=!1;break}b&&a.push(d)}else("haystack"===f.edgeType||"straight"===f.edgeType)&&a.push(d)}}return a};var oK={};oK.calculateArrowAngles=function(e){var t=e._private.rscratch,n="haystack"===t.edgeType,r="bezier"===t.edgeType,i="multibezier"===t.edgeType,a="segments"===t.edgeType,o="compound"===t.edgeType,s="self"===t.edgeType;if(n?(b=t.haystackPts[0],x=t.haystackPts[1],w=t.haystackPts[2],E=t.haystackPts[3]):(b=t.arrowStartX,x=t.arrowStartY,w=t.arrowEndX,E=t.arrowEndY),c=t.midX,d=t.midY,a)v=b-t.segpts[0],y=x-t.segpts[1];else if(i||o||s||r){var l=t.allpts,u=tz(l[0],l[2],l[4],.1),h=tz(l[1],l[3],l[5],.1);v=b-u,y=x-h}else v=b-c,y=x-d;t.srcArrowAngle=tO(v,y);var c=t.midX,d=t.midY;if(n&&(c=(b+w)/2,d=(x+E)/2),v=w-b,y=E-x,a){var l=t.allpts;if(l.length/2%2==0){var p=l.length/2,g=p-2;v=l[p]-l[g],y=l[p+1]-l[g+1]}else{var p=l.length/2-1,g=p-2,f=p+2;v=l[p]-l[g],y=l[p+1]-l[g+1]}}else if(i||o||s){var v,y,b,x,w,E,c,d,_,T,D,C,l=t.allpts;if(t.ctrlpts.length/2%2==0){var N=l.length/2-1,A=N+2,L=A+2;_=tz(l[N],l[A],l[L],0),T=tz(l[N+1],l[A+1],l[L+1],0),D=tz(l[N],l[A],l[L],1e-4),C=tz(l[N+1],l[A+1],l[L+1],1e-4)}else{var A=l.length/2-1,N=A-2,L=A+2;_=tz(l[N],l[A],l[L],.4999),T=tz(l[N+1],l[A+1],l[L+1],.4999),D=tz(l[N],l[A],l[L],.5),C=tz(l[N+1],l[A+1],l[L+1],.5)}v=D-_,y=C-T}if(t.midtgtArrowAngle=tO(v,y),t.midDispX=v,t.midDispY=y,v*=-1,y*=-1,a){var l=t.allpts;if(l.length/2%2==0);else{var p=l.length/2-1,f=p+2;v=-(l[f]-l[p]),y=-(l[f+1]-l[p+1])}}if(t.midsrcArrowAngle=tO(v,y),a)v=w-t.segpts[t.segpts.length-2],y=E-t.segpts[t.segpts.length-1];else if(i||o||s||r){var l=t.allpts,S=l.length,u=tz(l[S-6],l[S-4],l[S-2],.9),h=tz(l[S-5],l[S-3],l[S-1],.9);v=w-u,y=E-h}else v=w-c,y=E-d;t.tgtArrowAngle=tO(v,y)},oK.getArrowWidth=oK.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r),r};var oZ={};function oQ(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}oZ.findMidptPtsEtc=function(e,t){var n,r=t.posPts,i=t.intersectionPts,a=t.vectorNormInverse,s=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),u=null!=s.units&&null!=l.units;switch(e.pstyle("edge-distances").value){case"node-position":n=r;break;case"intersection":n=i;break;case"endpoints":if(u){var h,c,d,p=o(this.manualEndptToPx(e.source()[0],s),2),g=p[0],f=p[1],v=o(this.manualEndptToPx(e.target()[0],l),2),y=v[0],b=v[1];h=b-f,d=Math.sqrt((c=y-g)*c+h*h),a={x:-h/d,y:c/d},n={x1:g,y1:f,x2:y,y2:b}}else te("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),n=i}return{midptPts:n,vectorNormInverse:a}},oZ.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=2*Math.random()*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},i.target={x:Math.cos(a=2*Math.random()*Math.PI),y:Math.sin(a)}}var o=r.source,s=r.target,l=o.position(),u=s.position(),h=o.width(),c=s.width(),d=o.height(),p=s.height(),g=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*h*g+l.x,i.source.y*d*g+l.y,i.target.x*c*g+u.x,i.target.y*p*g+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},oZ.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),i=e.pstyle("segment-distances"),a=Math.min(r.pfValue.length,i.pfValue.length);n.edgeType="segments",n.segpts=[];for(var o=0;o<a;o++){var s=r.pfValue[o],l=i.pfValue[o],u=1-s,h=this.findMidptPtsEtc(e,t),c=h.midptPts,d=h.vectorNormInverse,p={x:c.x1*u+c.x2*s,y:c.y1*u+c.y2*s};n.segpts.push(p.x+d.x*l,p.y+d.y*l)}},oZ.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,h=e.pstyle("loop-sweep").pfValue,c=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var d=n,p=c;r&&(d=0,p=l);var g=u-Math.PI/2,f=g-h/2,v=g+h/2,y=String(u+"_"+h);d=void 0===a[y]?a[y]=0:++a[y],i.ctrlpts=[o.x+1.4*Math.cos(f)*p*(d/3+1),o.y+1.4*Math.sin(f)*p*(d/3+1),o.x+1.4*Math.cos(v)*p*(d/3+1),o.y+1.4*Math.sin(v)*p*(d/3+1)]},oZ.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var a=t.srcPos,o=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,h=t.tgtH,c=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),p=d?d.pfValue[0]:void 0,g=n,f=c;r&&(g=0,f=p);var v={x:a.x-s/2,y:a.y-l/2},y={x:o.x-u/2,y:o.y-h/2},b={x:Math.min(v.x,y.x),y:Math.min(v.y,y.y)},x=Math.max(.5,Math.log(.01*s)),w=Math.max(.5,Math.log(.01*u));i.ctrlpts=[b.x,b.y-1.7995514309304248*f*(g/3+1)*x,b.x-1.7995514309304248*f*(g/3+1)*w,b.y]},oZ.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},oZ.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=e.pstyle("control-point-step-size").pfValue,s=e.pstyle("control-point-distances"),l=e.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,h=s?s.pfValue[0]:void 0,c=l.value[0];a.edgeType=r?"multibezier":"bezier",a.ctrlpts=[];for(var d=0;d<u;d++){var p=(.5-t.eles.length/2+n)*o*(i?-1:1),g=void 0,f=tP(p);r&&(h=s?s.pfValue[d]:o,c=l.value[d]);var v=void 0!==(g=r?h:void 0!==h?f*h:void 0)?g:p,y=1-c,b=c,x=this.findMidptPtsEtc(e,t),w=x.midptPts,E=x.vectorNormInverse,_={x:w.x1*y+w.x2*b,y:w.y1*y+w.y2*b};a.ctrlpts.push(_.x+E.x*v,_.y+E.y*v)}},oZ.findTaxiPoints=function(e,t){var n,r=e._private.rscratch;r.edgeType="segments";var i="vertical",a="horizontal",o="leftward",s="rightward",l="downward",u="upward",h=t.posPts,c=t.srcW,d=t.srcH,p=t.tgtW,g=t.tgtH,f="node-position"!==e.pstyle("edge-distances").value,v=e.pstyle("taxi-direction").value,y=v,b=e.pstyle("taxi-turn"),x="%"===b.units,w=b.pfValue,E=e.pstyle("taxi-turn-min-distance").pfValue,_=h.x2-h.x1,T=h.y2-h.y1,D=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},C=D(_,f?(c+p)/2:0),N=D(T,f?(d+g)/2:0),A=!1;"auto"===y?v=Math.abs(C)>Math.abs(N)?a:i:y===u||y===l?(v=i,A=!0):(y===o||y===s)&&(v=a,A=!0);var L=v===i,S=L?N:C,k=L?T:_,I=tP(k),O=!1;!(A&&(x||w<0))&&(y===l&&k<0||y===u&&k>0||y===o&&k>0||y===s&&k<0)&&(I*=-1,S=I*Math.abs(S),O=!0);var M=function(e){return Math.abs(e)<E||Math.abs(e)>=Math.abs(S)},P=M(n=x?(w<0?1+w:w)*S:(w<0?S:0)+w*I),R=M(Math.abs(S)-Math.abs(n));if((P||R)&&!O)if(L){var B=Math.abs(_)<=p/2;if(Math.abs(k)<=d/2){var F=(h.x1+h.x2)/2;r.segpts=[F,h.y1,F,h.y2]}else if(B){var z=(h.y1+h.y2)/2;r.segpts=[h.x1,z,h.x2,z]}else r.segpts=[h.x1,h.y2]}else{var G=Math.abs(T)<=g/2;if(Math.abs(k)<=c/2){var Y=(h.y1+h.y2)/2;r.segpts=[h.x1,Y,h.x2,Y]}else if(G){var X=(h.x1+h.x2)/2;r.segpts=[X,h.y1,X,h.y2]}else r.segpts=[h.x2,h.y1]}else if(L){var V=h.y1+n+(f?d/2*I:0);r.segpts=[h.x1,V,h.x2,V]}else{var U=h.x1+n+(f?c/2*I:0);r.segpts=[U,h.y1,U,h.y2]}},oZ.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,h=t.tgtShape,c=!G(n.startX)||!G(n.startY),d=!G(n.arrowStartX)||!G(n.arrowStartY),p=!G(n.endX)||!G(n.endY),g=!G(n.arrowEndX)||!G(n.arrowEndY),f=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),v=tR({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=v<f,b=tR({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),x=b<f,w=!1;if(c||d||y){w=!0;var E={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(E.x*E.x+E.y*E.y),T={x:E.x/_,y:E.y/_},D=Math.max(a,o),C={x:n.ctrlpts[0]+2*T.x*D,y:n.ctrlpts[1]+2*T.y*D},N=u.intersectLine(r.x,r.y,a,o,C.x,C.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(f-v),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(f-v)):(n.ctrlpts[0]=N[0]+T.x*f,n.ctrlpts[1]=N[1]+T.y*f)}if(p||g||x){w=!0;var A={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},L=Math.sqrt(A.x*A.x+A.y*A.y),S={x:A.x/L,y:A.y/L},k=Math.max(a,o),I={x:n.ctrlpts[0]+2*S.x*k,y:n.ctrlpts[1]+2*S.y*k},O=h.intersectLine(i.x,i.y,s,l,I.x,I.y,0);x?(n.ctrlpts[0]=n.ctrlpts[0]+S.x*(f-b),n.ctrlpts[1]=n.ctrlpts[1]+S.y*(f-b)):(n.ctrlpts[0]=O[0]+S.x*f,n.ctrlpts[1]=O[1]+S.y*f)}w&&this.findEndpoints(e)}},oZ.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n,r=0;r+1<t.ctrlpts.length;r+=2)t.allpts.push(t.ctrlpts[r],t.ctrlpts[r+1]),r+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[r]+t.ctrlpts[r+2])/2,(t.ctrlpts[r+1]+t.ctrlpts[r+3])/2);(t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0)?(n=t.allpts.length/2-1,t.midX=t.allpts[n],t.midY=t.allpts[n+1]):(n=t.allpts.length/2-3,t.midX=tz(t.allpts[n],t.allpts[n+2],t.allpts[n+4],.5),t.midY=tz(t.allpts[n+1],t.allpts[n+3],t.allpts[n+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,a=i-2;t.midX=(t.segpts[a]+t.segpts[i])/2,t.midY=(t.segpts[a+1]+t.segpts[i+1])/2}else{var o=t.segpts.length/2-1;t.midX=t.segpts[o],t.midY=t.segpts[o+1]}},oZ.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||G(t.startX)&&G(t.startY)&&G(t.endX)&&G(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,te("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},oZ.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new td,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new td,this.map.set(e[0],n)),n.set(e[1],t)}},a=[],o=[],s=0;s<e.length;s++){var l=e[s],u=l._private,h=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace()){if("haystack"===h){o.push(l);continue}var c="unbundled-bezier"===h||"segments"===h||"straight"===h||"straight-triangle"===h||"taxi"===h,d="unbundled-bezier"===h||"bezier"===h,p=u.source,g=u.target,f=[p.poolIndex(),g.poolIndex()].sort(),v=i.get(f);null==v&&(v={eles:[]},i.set(f,v),a.push(f)),v.eles.push(l),c&&(v.hasUnbundled=!0),d&&(v.hasBezier=!0)}}for(var y=0;y<a.length;y++)!function(e){var o=a[e],s=i.get(o),l=void 0;if(!s.hasUnbundled){var u=s.eles[0].parallelEdges().filter(function(e){return e.isBundledBezier()});ts(s.eles),u.forEach(function(e){return s.eles.push(e)}),s.eles.sort(function(e,t){return e.poolIndex()-t.poolIndex()})}var h=s.eles[0],c=h.source(),d=h.target();if(c.poolIndex()>d.poolIndex()){var p=c;c=d,d=p}var g=s.srcPos=c.position(),f=s.tgtPos=d.position(),v=s.srcW=c.outerWidth(),y=s.srcH=c.outerHeight(),b=s.tgtW=d.outerWidth(),x=s.tgtH=d.outerHeight(),w=s.srcShape=n.nodeShapes[t.getNodeShape(c)],E=s.tgtShape=n.nodeShapes[t.getNodeShape(d)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_<s.eles.length;_++){var T=s.eles[_],D=T[0]._private.rscratch,C=T.pstyle("curve-style").value,N="unbundled-bezier"===C||"segments"===C||"taxi"===C,A=!c.same(T.source());if(!s.calculatedIntersection&&c!==d&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var L=w.intersectLine(g.x,g.y,v,y,f.x,f.y,0),S=s.srcIntn=L,k=E.intersectLine(f.x,f.y,b,x,g.x,g.y,0),I=s.tgtIntn=k,O=s.intersectionPts={x1:L[0],x2:k[0],y1:L[1],y2:k[1]},M=s.posPts={x1:g.x,x2:f.x,y1:g.y,y2:f.y},P=k[1]-L[1],R=k[0]-L[0],B=Math.sqrt(R*R+P*P),F=s.vector={x:R,y:P},z=s.vectorNorm={x:F.x/B,y:F.y/B},Y={x:-z.y,y:z.x};s.nodesOverlap=!G(B)||E.checkPoint(L[0],L[1],0,b,x,f.x,f.y)||w.checkPoint(k[0],k[1],0,v,y,g.x,g.y),s.vectorNormInverse=Y,l={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:f,tgtPos:g,srcW:b,srcH:x,tgtW:v,tgtH:y,srcIntn:I,tgtIntn:S,srcShape:E,tgtShape:w,posPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},intersectionPts:{x1:O.x2,y1:O.y2,x2:O.x1,y2:O.y1},vector:{x:-F.x,y:-F.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-Y.x,y:-Y.y}}}var X=A?l:s;D.nodesOverlap=X.nodesOverlap,D.srcIntn=X.srcIntn,D.tgtIntn=X.tgtIntn,r&&(c.isParent()||c.isChild()||d.isParent()||d.isChild())&&(c.parents().anySame(d)||d.parents().anySame(c)||c.same(d)&&c.isParent())?t.findCompoundLoopPoints(T,X,_,N):c===d?t.findLoopPoints(T,X,_,N):"segments"===C?t.findSegmentsPoints(T,X):"taxi"===C?t.findTaxiPoints(T,X):"straight"!==C&&(N||s.eles.length%2!=1||_!==Math.floor(s.eles.length/2))?t.findBezierPoints(T,X,_,N,A):t.findStraightEdgePoints(T),t.findEndpoints(T),t.tryToCorrectInvalidPoints(T,X),t.checkForInvalidEdgeWarning(T),t.storeAllpts(T),t.storeEdgeProjections(T),t.calculateArrowAngles(T),t.recalculateEdgeLabelProjections(T),t.calculateLabelAngles(T)}}(y);this.findHaystackPoints(o)}},oZ.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),oQ(t.segpts)},oZ.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),oQ(t.ctrlpts)},oZ.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var oJ={};oJ.manualEndptToPx=function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var a=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(a[0]=a[0]*r),"%"===t.units[1]&&(a[1]=a[1]*i),a[0]+=n.x,a[1]+=n.y,a}var o=t.pfValue[0];o=-Math.PI/2+o;var s=2*Math.max(r,i),l=[n.x+Math.cos(o)*s,n.y+Math.sin(o)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,l[0],l[1],0)},oJ.findEndpoints=function(e){var t,n,r,i,a,o=e.source()[0],s=e.target()[0],l=o.position(),u=s.position(),h=e.pstyle("target-arrow-shape").value,c=e.pstyle("source-arrow-shape").value,d=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,g=e.pstyle("curve-style").value,f=e._private.rscratch,v=f.edgeType,y="self"===v||"compound"===v,b="bezier"===v||"multibezier"===v||y,x="bezier"!==v,w="straight"===v||"segments"===v,E="segments"===v,_=y||"taxi"===g,T=e.pstyle("source-endpoint"),D=_?"outside-to-node":T.value,C=e.pstyle("target-endpoint"),N=_?"outside-to-node":C.value;if(f.srcManEndpt=T,f.tgtManEndpt=C,b){var A=[f.ctrlpts[0],f.ctrlpts[1]];n=x?[f.ctrlpts[f.ctrlpts.length-2],f.ctrlpts[f.ctrlpts.length-1]]:A,r=A}else if(w){var L=E?f.segpts.slice(0,2):[u.x,u.y];n=E?f.segpts.slice(f.segpts.length-2):[l.x,l.y],r=L}if("inside-to-node"===N)t=[u.x,u.y];else if(C.units)t=this.manualEndptToPx(s,C);else if("outside-to-line"===N)t=f.tgtIntn;else if("outside-to-node"===N||"outside-to-node-or-label"===N?i=n:("outside-to-line"===N||"outside-to-line-or-label"===N)&&(i=[l.x,l.y]),t=this.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===N||"outside-to-line-or-label"===N){var S=s._private.rscratch,k=S.labelWidth,I=S.labelHeight,O=S.labelX,M=S.labelY,P=k/2,R=I/2,B=s.pstyle("text-valign").value;"top"===B?M-=R:"bottom"===B&&(M+=R);var F=s.pstyle("text-halign").value;"left"===F?O-=P:"right"===F&&(O+=P);var z=no(i[0],i[1],[O-P,M-R,O+P,M-R,O+P,M+R,O-P,M+R],u.x,u.y);if(z.length>0){var Y=tB(l,tA(t)),X=tB(l,tA(z)),V=Y;X<Y&&(t=z,V=X),z.length>2&&tB(l,{x:z[2],y:z[3]})<V&&(t=[z[2],z[3]])}}var U=nl(t,n,this.arrowShapes[h].spacing(e)+d),j=nl(t,n,this.arrowShapes[h].gap(e)+d);if(f.endX=j[0],f.endY=j[1],f.arrowEndX=U[0],f.arrowEndY=U[1],"inside-to-node"===D)t=[l.x,l.y];else if(T.units)t=this.manualEndptToPx(o,T);else if("outside-to-line"===D)t=f.srcIntn;else if("outside-to-node"===D||"outside-to-node-or-label"===D?a=r:("outside-to-line"===D||"outside-to-line-or-label"===D)&&(a=[u.x,u.y]),t=this.nodeShapes[this.getNodeShape(o)].intersectLine(l.x,l.y,o.outerWidth(),o.outerHeight(),a[0],a[1],0),"outside-to-node-or-label"===D||"outside-to-line-or-label"===D){var q=o._private.rscratch,H=q.labelWidth,W=q.labelHeight,$=q.labelX,K=q.labelY,Z=H/2,Q=W/2,J=o.pstyle("text-valign").value;"top"===J?K-=Q:"bottom"===J&&(K+=Q);var ee=o.pstyle("text-halign").value;"left"===ee?$-=Z:"right"===ee&&($+=Z);var et=no(a[0],a[1],[$-Z,K-Q,$+Z,K-Q,$+Z,K+Q,$-Z,K+Q],l.x,l.y);if(et.length>0){var en=tB(u,tA(t)),er=tB(u,tA(et)),ei=en;er<en&&(t=[et[0],et[1]],ei=er),et.length>2&&tB(u,{x:et[2],y:et[3]})<ei&&(t=[et[2],et[3]])}}var ea=nl(t,r,this.arrowShapes[c].spacing(e)+p),eo=nl(t,r,this.arrowShapes[c].gap(e)+p);f.startX=eo[0],f.startY=eo[1],f.arrowStartX=ea[0],f.arrowStartY=ea[1],(b||x||w)&&(G(f.startX)&&G(f.startY)&&G(f.endX)&&G(f.endY)?f.badLine=!1:f.badLine=!0)},oJ.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;return(this.recalculateRenderedStyle(e),"haystack"===t.edgeType)?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},oJ.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;return(this.recalculateRenderedStyle(e),"haystack"===t.edgeType)?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}};var o0={};o0.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)!function(e,t,n){for(var r=function(e,t,n,r){return tz(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}(this,e,n.allpts.slice(i,i+6))}else if("segments"===r)for(var a=t.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]});else if("haystack"===r){var o=n.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},o0.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var o1={};o1.recalculateNodeLabelProjection=function(e){var t,n;if(!H(e.pstyle("label").strValue)){var r=e._private,i=e.width(),a=e.height(),o=e.padding(),s=e.position(),l=e.pstyle("text-halign").strValue,u=e.pstyle("text-valign").strValue,h=r.rscratch,c=r.rstyle;switch(l){case"left":t=s.x-i/2-o;break;case"right":t=s.x+i/2+o;break;default:t=s.x}switch(u){case"top":n=s.y-a/2-o;break;case"bottom":n=s.y+a/2+o;break;default:n=s.y}h.labelX=t,h.labelY=n,c.labelX=t,c.labelY=n,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var o2=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},o5=function(e,t){return o2(t.x-e.x,t.y-e.y)},o3=function(e,t,n,r){var i=tX(0,r-.001,1),a=tX(0,r+.001,1);return o5(tG(e,t,n,i),tG(e,t,n,a))};o1.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){th(n.rscratch,e,t,r),th(n.rstyle,e,t,r)};o("labelX",null,t.x),o("labelY",null,t.y),o("labelAutoAngle",null,o2(r.midDispX,r.midDispY));var s=function e(){if(e.cache)return e.cache;for(var t=[],a=0;a+5<r.allpts.length;a+=4){var o={x:r.allpts[a],y:r.allpts[a+1]},s={x:r.allpts[a+2],y:r.allpts[a+3]},l={x:r.allpts[a+4],y:r.allpts[a+5]};t.push({p0:o,p1:s,p2:l,startDist:0,length:0,segments:[]})}var u=n.rstyle.bezierPts,h=i.bezierProjPcts.length;function c(e,t,n,r,i){var a=tR(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var d=0;d<t.length;d++){var p=t[d],g=t[d-1];g&&(p.startDist=g.startDist+g.length),c(p,p.p0,u[d*h],0,i.bezierProjPcts[0]);for(var f=0;f<h-1;f++)c(p,u[d*h+f],u[d*h+f+1],i.bezierProjPcts[f],i.bezierProjPcts[f+1]);c(p,u[d*h+h-1],p.p2,i.bezierProjPcts[h-1],1)}return e.cache=t},l=function(n){var i="source"===n;if(a[n]){var l=e.pstyle(n+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var u,h,c=s(),d=0,p=0,g=0;g<c.length;g++){for(var f=c[i?g:c.length-1-g],v=0;v<f.segments.length;v++){var y=f.segments[i?v:f.segments.length-1-v],b=g===c.length-1&&v===f.segments.length-1;if(d=p,(p+=y.length)>=l||b){h={cp:f,segment:y};break}}if(h)break}var x=h.cp,w=h.segment,E=(l-d)/w.length,_=w.t1-w.t0,T=i?w.t0+_*E:w.t1-_*E;T=tX(0,T,1),t=tG(x.p0,x.p1,x.p2,T),u=o3(x.p0,x.p1,x.p2,T);break;case"straight":case"segments":case"haystack":for(var D,C,N,A,L=0,S=r.allpts.length,k=0;k+3<S&&(i?(D={x:r.allpts[k],y:r.allpts[k+1]},C={x:r.allpts[k+2],y:r.allpts[k+3]}):(D={x:r.allpts[S-2-k],y:r.allpts[S-1-k]},C={x:r.allpts[S-4-k],y:r.allpts[S-3-k]}),N=tR(D,C),A=L,!((L+=N)>=l));k+=2);var I=(l-A)/N;t=tY(D,C,I=tX(0,I,1)),u=o5(D,C)}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,u)}};l("source"),l("target"),this.applyLabelDimensions(e)}},o1.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},o1.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),a=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,s=tu(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==o?1:Math.max(s.length,1),u=i.height/l,h=i.width,c=i.height+(l-1)*(a-1)*u;th(n.rstyle,"labelWidth",t,h),th(n.rscratch,"labelWidth",t,h),th(n.rstyle,"labelHeight",t,c),th(n.rscratch,"labelHeight",t,c),th(n.rscratch,"labelLineHeight",t,u*a)},o1.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(th(n.rscratch,e,t,r),r):tu(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=o("labelKey");if(null!=l&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u=i.split("\n"),h=e.pstyle("text-max-width").pfValue,c="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],p=/[\s\u200b]+/,g=c?"":" ",f=0;f<u.length;f++){var v=u[f],y=this.calculateLabelDimensions(e,v).width;if(c&&(v=v.split("").join("")),y>h){for(var b=v.split(p),x="",w=0;w<b.length;w++){var E=b[w],_=0===x.length?E:x+g+E;this.calculateLabelDimensions(e,_).width<=h?x+=E+g:(x&&d.push(x),x=E+g)}x.match(/^[\s\u200b]+$/)||d.push(x)}else d.push(v)}o("labelWrapCachedLines",d),i=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",l)}else if("ellipsis"===s){var T=e.pstyle("text-max-width").pfValue,D="",C=!1;if(this.calculateLabelDimensions(e,i).width<T)return i;for(var N=0;N<i.length&&!(this.calculateLabelDimensions(e,D+i[N]+"…").width>T);N++)D+=i[N],N===i.length-1&&(C=!0);return C||(D+="…"),D}return i},o1.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},o1.calculateLabelDimensions=function(e,t){var n=eZ(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var a=e.pstyle("font-style").strValue,o=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,l=e.pstyle("font-weight").strValue,u=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=document.createElement("canvas"),h=this.labelCalcCanvasContext=u.getContext("2d");var c=u.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}h.font="".concat(a," ").concat(l," ").concat(o,"px ").concat(s);for(var d=0,p=0,g=t.split("\n"),f=0;f<g.length;f++){var v=g[f];d=Math.max(Math.ceil(h.measureText(v).width),d),p+=o}return d+=0,p+=0,r[n]={width:d,height:p}},o1.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=e.pstyle((t?t+"-":"")+"text-rotation"),a=i.strValue;return"none"===a?0:r&&"autorotate"===a?n.labelAutoAngle:"autorotate"===a?0:i.pfValue},o1.calculateLabelAngles=function(e){var t=e.isEdge(),n=e._private.rscratch;n.labelAngle=this.calculateLabelAngle(e),t&&(n.sourceLabelAngle=this.calculateLabelAngle(e,"source"),n.targetLabelAngle=this.calculateLabelAngle(e,"target"))};var o4={},o9=!1;o4.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(28>e.width()||28>e.height()))return o9||(te("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),o9=!0),"rectangle";if(e.isParent())if("rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t)return t;else return"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var o6={};o6.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r]._private.rstyle;i.clean=!1,i.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(e){r(e.target)}).on("style.* background.*",function(e){r(e.target,!1)});var i=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var o=0;o<t.length;o++){var s=t[o],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(a)for(var u=0;u<a.length;u++)(0,a[u])(i,t);n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},o6.onUpdateEleCalcs=function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},o6.recalculateRenderedStyle=function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var a=0;a<e.length;a++){var o=e[a],s=o._private,l=s.rstyle;!o.isEdge()||n(o.source())&&n(o.target())||(l.clean=!1),t&&l.clean||o.removed()||"none"!==o.pstyle("display").value&&("nodes"===s.group?i.push(o):r.push(o),l.clean=!0)}for(var u=0;u<i.length;u++){var h=i[u],c=h._private.rstyle,d=h.position();this.recalculateNodeLabelProjection(h),c.nodeX=d.x,c.nodeY=d.y,c.nodeW=h.pstyle("width").pfValue,c.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var g=r[p]._private,f=g.rstyle,v=g.rscratch;f.srcX=v.arrowStartX,f.srcY=v.arrowStartY,f.tgtX=v.arrowEndX,f.tgtY=v.arrowEndY,f.midX=v.midX,f.midY=v.midY,f.labelAngle=v.labelAngle,f.sourceLabelAngle=v.sourceLabelAngle,f.targetLabelAngle=v.targetLabelAngle}}};var o8={};o8.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],i=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):i.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},o8.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},o8.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(av),t.interactive=t.filter(function(e){return e.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var o7={};[o$,oK,oZ,oJ,o0,o1,o4,o6,o8].forEach(function(e){eo(o7,e)});var se={};se.getCachedImage=function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var a=(i=r[e]=r[e]||{}).image=new Image;a.addEventListener("load",n),a.addEventListener("error",function(){a.error=!0});var o="data:";return e.substring(0,o.length).toLowerCase()!==o&&(a.crossOrigin=t="null"===t?null:t),a.src=e,a};var st={};st.registerBinding=function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),a=this.binder(e);return a.on.apply(a,i)},st.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||!("u"<typeof HTMLElement)&&e instanceof HTMLElement;if(null==t.supportsPassiveEvents){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener("test",null,a)}catch(e){}t.supportsPassiveEvents=i}var o=function(n,i,a){var o=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(o[2]={capture:null!=a&&a,passive:!1,once:!1}),t.bindings.push({target:e,args:o}),(e.addEventListener||e.on).apply(e,o),this};return{on:o,addEventListener:o,addListener:o,bind:o}},st.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},st.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},st.load=function(){var e,t,n,r,i,a,o,s,l,u,h,c,d,p,g,f,v,y,b,x,w,E,_,T,D=this,C=D.cy.window(),N=function(e){return e.selected()},A=function(e,t,n,r){null==e&&(e=D.cy);for(var i=0;i<t.length;i++){var a=t[i];e.emit({originalEvent:n,type:a,position:r})}},L=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},S=function(e,t){var n=!0;if(D.cy.hasCompoundNodes()&&e&&e.pannable())for(var r=0;t&&r<t.length;r++){var e=t[r];if(e.isNode()&&e.isParent()&&!e.pannable()){n=!1;break}}else n=!0;return n},k=function(e){e[0]._private.grabbed=!0},I=function(e){e[0]._private.grabbed=!1},O=function(e){e[0]._private.rscratch.inDragLayer=!0},M=function(e){e[0]._private.rscratch.inDragLayer=!1},P=function(e){e[0]._private.rscratch.isGrabTarget=!0},R=function(e){e[0]._private.rscratch.isGrabTarget=!1},B=function(e,t){var n=t.addToList;!n.has(e)&&e.grabbable()&&!e.locked()&&(n.merge(e),k(e))},F=function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(O),n.connectedEdges().forEach(O)),t.addToList&&B(n,t)}},z=function(e,t){t=t||{};var n=e.cy().hasCompoundNodes();t.inDragLayer&&(e.forEach(O),e.neighborhood().stdFilter(function(e){return!n||e.isEdge()}).forEach(O)),t.addToList&&e.forEach(function(e){B(e,t)}),F(e,t),X(e,{inDragLayer:t.inDragLayer}),D.updateCachedGrabbedEles()},Y=function(e){e&&(D.getCachedZSortedEles().forEach(function(e){I(e),M(e),R(e)}),D.updateCachedGrabbedEles())},X=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(O),r.forEach(O)),t.addToList&&r.forEach(function(e){B(e,t)})}}},V=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},U="u">typeof MutationObserver,j="u">typeof ResizeObserver;U?(D.removeObserver=new MutationObserver(function(e){for(var t=0;t<e.length;t++){var n=e[t].removedNodes;if(n){for(var r=0;r<n.length;r++)if(n[r]===D.container){D.destroy();break}}}}),D.container.parentNode&&D.removeObserver.observe(D.container.parentNode,{childList:!0})):D.registerBinding(D.container,"DOMNodeRemoved",function(e){D.destroy()});var q=eG(function(){D.cy.resize()},100);U&&(D.styleObserver=new MutationObserver(q),D.styleObserver.observe(D.container,{attributes:!0})),D.registerBinding(C,"resize",q),j&&(D.resizeObserver=new ResizeObserver(q),D.resizeObserver.observe(D.container));for(var H=function(){D.invalidateContainerClientCoordsCache()},W=D.container;null!=W;){e=W,D.registerBinding(e,"transitionend",H),D.registerBinding(e,"animationend",H),D.registerBinding(e,"scroll",H),W=W.parentNode}D.registerBinding(D.container,"contextmenu",function(e){e.preventDefault()});var $=function(e){for(var t=D.findContainerClientCoords(),n=t[0],r=t[1],i=t[2],a=t[3],o=e.touches?e.touches:[e],s=!1,l=0;l<o.length;l++){var u=o[l];if(n<=u.clientX&&u.clientX<=n+i&&r<=u.clientY&&u.clientY<=r+a){s=!0;break}}if(!s)return!1;for(var h=D.container,c=e.target.parentNode,d=!1;c;){if(c===h){d=!0;break}c=c.parentNode}return!!d};D.registerBinding(D.container,"mousedown",function(e){if($(e)){e.preventDefault(),V(),D.hoverData.capture=!0,D.hoverData.which=e.which;var t=D.cy,n=[e.clientX,e.clientY],r=D.projectIntoViewport(n[0],n[1]),i=D.selection,a=D.findNearestElements(r[0],r[1],!0,!1),o=a[0],s=D.dragData.possibleDragElements;if(D.hoverData.mdownPos=r,D.hoverData.mdownGPos=n,3==e.which){D.hoverData.cxtStarted=!0;var l={originalEvent:e,type:"cxttapstart",position:{x:r[0],y:r[1]}};o?(o.activate(),o.emit(l),D.hoverData.down=o):t.emit(l),D.hoverData.downTime=new Date().getTime(),D.hoverData.cxtDragged=!1}else if(1==e.which){if(o&&o.activate(),null!=o&&D.nodeIsGrabbable(o)){var u=function(t){return{originalEvent:e,type:t,position:{x:r[0],y:r[1]}}};if(P(o),o.selected()){s=D.dragData.possibleDragElements=t.collection();var h=t.$(function(e){return e.isNode()&&e.selected()&&D.nodeIsGrabbable(e)});z(h,{addToList:s}),o.emit(u("grabon")),h.forEach(function(e){e.emit(u("grab"))})}else z(o,{addToList:s=D.dragData.possibleDragElements=t.collection()}),o.emit(u("grabon")).emit(u("grab"));D.redrawHint("eles",!0),D.redrawHint("drag",!0)}D.hoverData.down=o,D.hoverData.downs=a,D.hoverData.downTime=new Date().getTime(),A(o,["mousedown","tapstart","vmousedown"],e,{x:r[0],y:r[1]}),null==o?(i[4]=1,D.data.bgActivePosistion={x:r[0],y:r[1]},D.redrawHint("select",!0),D.redraw()):o.pannable()&&(i[4]=1),D.hoverData.tapholdCancelled=!1,clearTimeout(D.hoverData.tapholdTimeout),D.hoverData.tapholdTimeout=setTimeout(function(){if(!D.hoverData.tapholdCancelled){var n=D.hoverData.down;n?n.emit({originalEvent:e,type:"taphold",position:{x:r[0],y:r[1]}}):t.emit({originalEvent:e,type:"taphold",position:{x:r[0],y:r[1]}})}},D.tapholdDuration)}i[0]=i[2]=r[0],i[1]=i[3]=r[1]}},!1),D.registerBinding(C,"mousemove",function(e){var t,n;if(D.hoverData.capture||$(e)){var r=!1,i=D.cy,a=i.zoom(),o=[e.clientX,e.clientY],s=D.projectIntoViewport(o[0],o[1]),l=D.hoverData.mdownPos,u=D.hoverData.mdownGPos,h=D.selection,c=null;D.hoverData.draggingEles||D.hoverData.dragging||D.hoverData.selecting||(c=D.findNearestElement(s[0],s[1],!0,!1));var d=D.hoverData.last,p=D.hoverData.down,g=[s[0]-h[2],s[1]-h[3]],f=D.dragData.possibleDragElements;if(u){var v=o[0]-u[0],y=o[1]-u[1];D.hoverData.isOverThresholdDrag=t=v*v+y*y>=D.desktopTapThreshold2}var b=L(e);t&&(D.hoverData.tapholdCancelled=!0),r=!0,A(c,["mousemove","vmousemove","tapdrag"],e,{x:s[0],y:s[1]});var x=function(){D.data.bgActivePosistion=void 0,D.hoverData.selecting||i.emit({originalEvent:e,type:"boxstart",position:{x:s[0],y:s[1]}}),h[4]=1,D.hoverData.selecting=!0,D.redrawHint("select",!0),D.redraw()};if(3===D.hoverData.which){if(t){var w={originalEvent:e,type:"cxtdrag",position:{x:s[0],y:s[1]}};p?p.emit(w):i.emit(w),D.hoverData.cxtDragged=!0,(!D.hoverData.cxtOver||c!==D.hoverData.cxtOver)&&(D.hoverData.cxtOver&&D.hoverData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:s[0],y:s[1]}}),D.hoverData.cxtOver=c,c&&c.emit({originalEvent:e,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}}else if(D.hoverData.dragging){if(r=!0,i.panningEnabled()&&i.userPanningEnabled()){if(D.hoverData.justStartedPan){var E=D.hoverData.mdownPos;n={x:(s[0]-E[0])*a,y:(s[1]-E[1])*a},D.hoverData.justStartedPan=!1}else n={x:g[0]*a,y:g[1]*a};i.panBy(n),i.emit("dragpan"),D.hoverData.dragged=!0}s=D.projectIntoViewport(e.clientX,e.clientY)}else if(1==h[4]&&(null==p||p.pannable()))t&&(!D.hoverData.dragging&&i.boxSelectionEnabled()&&(b||!i.panningEnabled()||!i.userPanningEnabled())?x():!D.hoverData.selecting&&i.panningEnabled()&&i.userPanningEnabled()&&S(p,D.hoverData.downs)&&(D.hoverData.dragging=!0,D.hoverData.justStartedPan=!0,h[4]=0,D.data.bgActivePosistion=tA(l),D.redrawHint("select",!0),D.redraw()),p&&p.pannable()&&p.active()&&p.unactivate());else{if(p&&p.pannable()&&p.active()&&p.unactivate(),p&&p.grabbed()||c==d||(d&&A(d,["mouseout","tapdragout"],e,{x:s[0],y:s[1]}),c&&A(c,["mouseover","tapdragover"],e,{x:s[0],y:s[1]}),D.hoverData.last=c),p)if(t){if(i.boxSelectionEnabled()&&b)p&&p.grabbed()&&(Y(f),p.emit("freeon"),f.emit("free"),D.dragData.didDrag&&(p.emit("dragfreeon"),f.emit("dragfree"))),x();else if(p&&p.grabbed()&&D.nodeIsDraggable(p)){var _,T=!D.dragData.didDrag;T&&D.redrawHint("eles",!0),D.dragData.didDrag=!0,D.hoverData.draggingEles||z(f,{inDragLayer:!0});var C={x:0,y:0};if(G(g[0])&&G(g[1])&&(C.x+=g[0],C.y+=g[1],T)){var N=D.hoverData.dragDelta;N&&G(N[0])&&G(N[1])&&(C.x+=N[0],C.y+=N[1])}D.hoverData.draggingEles=!0,f.silentShift(C).emit("position drag"),D.redrawHint("drag",!0),D.redraw()}}else 0===(_=D.hoverData.dragDelta=D.hoverData.dragDelta||[]).length?(_.push(g[0]),_.push(g[1])):(_[0]+=g[0],_[1]+=g[1]);r=!0}if(h[2]=s[0],h[3]=s[1],r)return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}},!1),D.registerBinding(C,"mouseup",function(e){if(D.hoverData.capture){D.hoverData.capture=!1;var i=D.cy,a=D.projectIntoViewport(e.clientX,e.clientY),o=D.selection,s=D.findNearestElement(a[0],a[1],!0,!1),l=D.dragData.possibleDragElements,u=D.hoverData.down,h=L(e);if(D.data.bgActivePosistion&&(D.redrawHint("select",!0),D.redraw()),D.hoverData.tapholdCancelled=!0,D.data.bgActivePosistion=void 0,u&&u.unactivate(),3===D.hoverData.which){var c={originalEvent:e,type:"cxttapend",position:{x:a[0],y:a[1]}};if(u?u.emit(c):i.emit(c),!D.hoverData.cxtDragged){var d={originalEvent:e,type:"cxttap",position:{x:a[0],y:a[1]}};u?u.emit(d):i.emit(d)}D.hoverData.cxtDragged=!1,D.hoverData.which=null}else if(1===D.hoverData.which){if(A(s,["mouseup","tapend","vmouseup"],e,{x:a[0],y:a[1]}),D.dragData.didDrag||D.hoverData.dragged||D.hoverData.selecting||D.hoverData.isOverThresholdDrag||(A(u,["click","tap","vclick"],e,{x:a[0],y:a[1]}),n=!1,e.timeStamp-r<=i.multiClickDebounceTime()?(t&&clearTimeout(t),n=!0,r=null,A(u,["dblclick","dbltap","vdblclick"],e,{x:a[0],y:a[1]})):(t=setTimeout(function(){n||A(u,["oneclick","onetap","voneclick"],e,{x:a[0],y:a[1]})},i.multiClickDebounceTime()),r=e.timeStamp)),null!=u||D.dragData.didDrag||D.hoverData.selecting||D.hoverData.dragged||L(e)||(i.$(N).unselect(["tapunselect"]),l.length>0&&D.redrawHint("eles",!0),D.dragData.possibleDragElements=l=i.collection()),s!=u||D.dragData.didDrag||D.hoverData.selecting||null==s||!s._private.selectable||(D.hoverData.dragging||("additive"===i.selectionType()||h?s.selected()?s.unselect(["tapunselect"]):s.select(["tapselect"]):h||(i.$(N).unmerge(s).unselect(["tapunselect"]),s.select(["tapselect"]))),D.redrawHint("eles",!0)),D.hoverData.selecting){var p=i.collection(D.getAllInBox(o[0],o[1],o[2],o[3]));D.redrawHint("select",!0),p.length>0&&D.redrawHint("eles",!0),i.emit({type:"boxend",originalEvent:e,position:{x:a[0],y:a[1]}});"additive"===i.selectionType()||h||i.$(N).unmerge(p).unselect(),p.emit("box").stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit("boxselect"),D.redraw()}if(D.hoverData.dragging&&(D.hoverData.dragging=!1,D.redrawHint("select",!0),D.redrawHint("eles",!0),D.redraw()),!o[4]){D.redrawHint("drag",!0),D.redrawHint("eles",!0);var g=u&&u.grabbed();Y(l),g&&(u.emit("freeon"),l.emit("free"),D.dragData.didDrag&&(u.emit("dragfreeon"),l.emit("dragfree")))}}o[4]=0,D.hoverData.down=null,D.hoverData.cxtStarted=!1,D.hoverData.draggingEles=!1,D.hoverData.selecting=!1,D.hoverData.isOverThresholdDrag=!1,D.dragData.didDrag=!1,D.hoverData.dragged=!1,D.hoverData.dragDelta=[],D.hoverData.mdownPos=null,D.hoverData.mdownGPos=null}},!1);var K=function(e){if(!D.scrollingPage){var t=D.cy,n=t.zoom(),r=t.pan(),i=D.projectIntoViewport(e.clientX,e.clientY),a=[i[0]*n+r.x,i[1]*n+r.y];if(D.hoverData.draggingEles||D.hoverData.dragging||D.hoverData.cxtStarted||0!==D.selection[4])return void e.preventDefault();if(t.panningEnabled()&&t.userPanningEnabled()&&t.zoomingEnabled()&&t.userZoomingEnabled()){e.preventDefault(),D.data.wheelZooming=!0,clearTimeout(D.data.wheelTimeout),D.data.wheelTimeout=setTimeout(function(){D.data.wheelZooming=!1,D.redrawHint("eles",!0),D.redraw()},150);var o=(null!=e.deltaY?-(e.deltaY/250):null!=e.wheelDeltaY?e.wheelDeltaY/1e3:e.wheelDelta/1e3)*D.wheelSensitivity;1===e.deltaMode&&(o*=33);var s=t.zoom()*Math.pow(10,o);"gesturechange"===e.type&&(s=D.gestureStartZoom*e.scale),t.zoom({level:s,renderedPosition:{x:a[0],y:a[1]}}),t.emit("gesturechange"===e.type?"pinchzoom":"scrollzoom")}}};D.registerBinding(D.container,"wheel",K,!0),D.registerBinding(C,"scroll",function(e){D.scrollingPage=!0,clearTimeout(D.scrollingPageTimeout),D.scrollingPageTimeout=setTimeout(function(){D.scrollingPage=!1},250)},!0),D.registerBinding(D.container,"gesturestart",function(e){D.gestureStartZoom=D.cy.zoom(),D.hasTouchStarted||e.preventDefault()},!0),D.registerBinding(D.container,"gesturechange",function(e){D.hasTouchStarted||K(e)},!0),D.registerBinding(D.container,"mouseout",function(e){var t=D.projectIntoViewport(e.clientX,e.clientY);D.cy.emit({originalEvent:e,type:"mouseout",position:{x:t[0],y:t[1]}})},!1),D.registerBinding(D.container,"mouseover",function(e){var t=D.projectIntoViewport(e.clientX,e.clientY);D.cy.emit({originalEvent:e,type:"mouseover",position:{x:t[0],y:t[1]}})},!1);var Z=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},Q=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(D.registerBinding(D.container,"touchstart",y=function(e){if(D.hasTouchStarted=!0,$(e)){V(),D.touchData.capture=!0,D.data.bgActivePosistion=void 0;var t=D.cy,n=D.touchData.now,r=D.touchData.earlier;if(e.touches[0]){var y=D.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);n[0]=y[0],n[1]=y[1]}if(e.touches[1]){var y=D.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);n[2]=y[0],n[3]=y[1]}if(e.touches[2]){var y=D.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);n[4]=y[0],n[5]=y[1]}if(e.touches[1]){D.touchData.singleTouchMoved=!0,Y(D.dragData.touchDragEles);var b=D.findContainerClientCoords();d=b[0],p=b[1],g=b[2],f=b[3],i=e.touches[0].clientX-d,a=e.touches[0].clientY-p,o=e.touches[1].clientX-d,s=e.touches[1].clientY-p,v=0<=i&&i<=g&&0<=o&&o<=g&&0<=a&&a<=f&&0<=s&&s<=f;var x=t.pan(),w=t.zoom();if(l=Z(i,a,o,s),u=Q(i,a,o,s),c=[((h=[(i+o)/2,(a+s)/2])[0]-x.x)/w,(h[1]-x.y)/w],u<4e4&&!e.touches[2]){var E=D.findNearestElement(n[0],n[1],!0,!0),_=D.findNearestElement(n[2],n[3],!0,!0);E&&E.isNode()?(E.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),D.touchData.start=E):_&&_.isNode()?(_.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),D.touchData.start=_):t.emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),D.touchData.start&&(D.touchData.start._private.grabbed=!1),D.touchData.cxt=!0,D.touchData.cxtDragged=!1,D.data.bgActivePosistion=void 0,D.redraw();return}}if(e.touches[2])t.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var T=D.findNearestElements(n[0],n[1],!0,!0),C=T[0];if(null!=C&&(C.activate(),D.touchData.start=C,D.touchData.starts=T,D.nodeIsGrabbable(C))){var N=D.dragData.touchDragEles=t.collection(),L=null;D.redrawHint("eles",!0),D.redrawHint("drag",!0),C.selected()?z(L=t.$(function(e){return e.selected()&&D.nodeIsGrabbable(e)}),{addToList:N}):z(C,{addToList:N}),P(C);var S=function(t){return{originalEvent:e,type:t,position:{x:n[0],y:n[1]}}};C.emit(S("grabon")),L?L.forEach(function(e){e.emit(S("grab"))}):C.emit(S("grab"))}A(C,["touchstart","tapstart","vmousedown"],e,{x:n[0],y:n[1]}),null==C&&(D.data.bgActivePosistion={x:y[0],y:y[1]},D.redrawHint("select",!0),D.redraw()),D.touchData.singleTouchMoved=!1,D.touchData.singleTouchStartTime=+new Date,clearTimeout(D.touchData.tapholdTimeout),D.touchData.tapholdTimeout=setTimeout(function(){!1!==D.touchData.singleTouchMoved||D.pinching||D.touchData.selecting||A(D.touchData.start,["taphold"],e,{x:n[0],y:n[1]})},D.tapholdDuration)}if(e.touches.length>=1){for(var k=D.touchData.startPosition=[null,null,null,null,null,null],I=0;I<n.length;I++)k[I]=r[I]=n[I];var O=e.touches[0];D.touchData.startGPosition=[O.clientX,O.clientY]}}},!1),D.registerBinding(window,"touchmove",b=function(e){var t=D.touchData.capture;if(t||$(e)){var n=D.selection,r=D.cy,h=D.touchData.now,g=D.touchData.earlier,f=r.zoom();if(e.touches[0]){var y=D.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=y[0],h[1]=y[1]}if(e.touches[1]){var y=D.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);h[2]=y[0],h[3]=y[1]}if(e.touches[2]){var y=D.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);h[4]=y[0],h[5]=y[1]}var b=D.touchData.startGPosition;if(t&&e.touches[0]&&b){for(var x=[],w=0;w<h.length;w++)x[w]=h[w]-g[w];var E=e.touches[0].clientX-b[0],_=E*E,T=e.touches[0].clientY-b[1];er=_+T*T>=D.touchTapThreshold2}if(t&&D.touchData.cxt){e.preventDefault();var C=e.touches[0].clientX-d,N=e.touches[0].clientY-p,L=e.touches[1].clientX-d,k=e.touches[1].clientY-p,I=Q(C,N,L,k);if(I/u>=2.25||I>=22500){D.touchData.cxt=!1,D.data.bgActivePosistion=void 0,D.redrawHint("select",!0);var O={originalEvent:e,type:"cxttapend",position:{x:h[0],y:h[1]}};D.touchData.start?(D.touchData.start.unactivate().emit(O),D.touchData.start=null):r.emit(O)}}if(t&&D.touchData.cxt){var O={originalEvent:e,type:"cxtdrag",position:{x:h[0],y:h[1]}};D.data.bgActivePosistion=void 0,D.redrawHint("select",!0),D.touchData.start?D.touchData.start.emit(O):r.emit(O),D.touchData.start&&(D.touchData.start._private.grabbed=!1),D.touchData.cxtDragged=!0;var M=D.findNearestElement(h[0],h[1],!0,!0);(!D.touchData.cxtOver||M!==D.touchData.cxtOver)&&(D.touchData.cxtOver&&D.touchData.cxtOver.emit({originalEvent:e,type:"cxtdragout",position:{x:h[0],y:h[1]}}),D.touchData.cxtOver=M,M&&M.emit({originalEvent:e,type:"cxtdragover",position:{x:h[0],y:h[1]}}))}else if(t&&e.touches[2]&&r.boxSelectionEnabled())e.preventDefault(),D.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,D.touchData.selecting||r.emit({originalEvent:e,type:"boxstart",position:{x:h[0],y:h[1]}}),D.touchData.selecting=!0,D.touchData.didSelect=!0,n[4]=1,n&&0!==n.length&&void 0!==n[0]?(n[2]=(h[0]+h[2]+h[4])/3,n[3]=(h[1]+h[3]+h[5])/3):(n[0]=(h[0]+h[2]+h[4])/3,n[1]=(h[1]+h[3]+h[5])/3,n[2]=(h[0]+h[2]+h[4])/3+1,n[3]=(h[1]+h[3]+h[5])/3+1),D.redrawHint("select",!0),D.redraw();else if(t&&e.touches[1]&&!D.touchData.didSelect&&r.zoomingEnabled()&&r.panningEnabled()&&r.userZoomingEnabled()&&r.userPanningEnabled()){e.preventDefault(),D.data.bgActivePosistion=void 0,D.redrawHint("select",!0);var P=D.dragData.touchDragEles;if(P){D.redrawHint("drag",!0);for(var R=0;R<P.length;R++){var B=P[R]._private;B.grabbed=!1,B.rscratch.inDragLayer=!1}}var F=D.touchData.start,C=e.touches[0].clientX-d,N=e.touches[0].clientY-p,L=e.touches[1].clientX-d,k=e.touches[1].clientY-p,X=Z(C,N,L,k),V=X/l;if(v){var U=C-i,j=N-a,q=L-o,H=k-s,W=r.zoom(),K=W*V,J=r.pan(),ee=c[0]*W+J.x,et=c[1]*W+J.y,en={x:-K/W*(ee-J.x-(U+q)/2)+ee,y:-K/W*(et-J.y-(j+H)/2)+et};if(F&&F.active()){var P=D.dragData.touchDragEles;Y(P),D.redrawHint("drag",!0),D.redrawHint("eles",!0),F.unactivate().emit("freeon"),P.emit("free"),D.dragData.didDrag&&(F.emit("dragfreeon"),P.emit("dragfree"))}r.viewport({zoom:K,pan:en,cancelOnFailedZoom:!0}),r.emit("pinchzoom"),l=X,i=C,a=N,o=L,s=k,D.pinching=!0}if(e.touches[0]){var y=D.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=y[0],h[1]=y[1]}if(e.touches[1]){var y=D.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);h[2]=y[0],h[3]=y[1]}if(e.touches[2]){var y=D.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);h[4]=y[0],h[5]=y[1]}}else if(e.touches[0]&&!D.touchData.didSelect){var er,M,ei=D.touchData.start,ea=D.touchData.last;if(D.hoverData.draggingEles||D.swipePanning||(M=D.findNearestElement(h[0],h[1],!0,!0)),t&&null!=ei&&e.preventDefault(),t&&null!=ei&&D.nodeIsDraggable(ei))if(er){var P=D.dragData.touchDragEles,eo=!D.dragData.didDrag;eo&&z(P,{inDragLayer:!0}),D.dragData.didDrag=!0;var es={x:0,y:0};if(G(x[0])&&G(x[1])&&(es.x+=x[0],es.y+=x[1],eo)){D.redrawHint("eles",!0);var el=D.touchData.dragDelta;el&&G(el[0])&&G(el[1])&&(es.x+=el[0],es.y+=el[1])}D.hoverData.draggingEles=!0,P.silentShift(es).emit("position drag"),D.redrawHint("drag",!0),D.touchData.startPosition[0]==g[0]&&D.touchData.startPosition[1]==g[1]&&D.redrawHint("eles",!0),D.redraw()}else{var el=D.touchData.dragDelta=D.touchData.dragDelta||[];0===el.length?(el.push(x[0]),el.push(x[1])):(el[0]+=x[0],el[1]+=x[1])}if(A(ei||M,["touchmove","tapdrag","vmousemove"],e,{x:h[0],y:h[1]}),ei&&ei.grabbed()||M==ea||(ea&&ea.emit({originalEvent:e,type:"tapdragout",position:{x:h[0],y:h[1]}}),M&&M.emit({originalEvent:e,type:"tapdragover",position:{x:h[0],y:h[1]}})),D.touchData.last=M,t)for(var R=0;R<h.length;R++)h[R]&&D.touchData.startPosition[R]&&er&&(D.touchData.singleTouchMoved=!0);if(t&&(null==ei||ei.pannable())&&r.panningEnabled()&&r.userPanningEnabled()){S(ei,D.touchData.starts)&&(e.preventDefault(),D.data.bgActivePosistion||(D.data.bgActivePosistion=tA(D.touchData.startPosition)),D.swipePanning?(r.panBy({x:x[0]*f,y:x[1]*f}),r.emit("dragpan")):er&&(D.swipePanning=!0,r.panBy({x:E*f,y:T*f}),r.emit("dragpan"),ei&&(ei.unactivate(),D.redrawHint("select",!0),D.touchData.start=null)));var y=D.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);h[0]=y[0],h[1]=y[1]}}for(var w=0;w<h.length;w++)g[w]=h[w];t&&e.touches.length>0&&!D.hoverData.draggingEles&&!D.swipePanning&&null!=D.data.bgActivePosistion&&(D.data.bgActivePosistion=void 0,D.redrawHint("select",!0),D.redraw())}},!1),D.registerBinding(C,"touchcancel",x=function(e){var t=D.touchData.start;D.touchData.capture=!1,t&&t.unactivate()}),D.registerBinding(C,"touchend",w=function(e){var t,n=D.touchData.start;if(D.touchData.capture){0===e.touches.length&&(D.touchData.capture=!1),e.preventDefault();var r=D.selection;D.swipePanning=!1,D.hoverData.draggingEles=!1;var i=D.cy,a=i.zoom(),o=D.touchData.now,s=D.touchData.earlier;if(e.touches[0]){var l=D.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=l[0],o[1]=l[1]}if(e.touches[1]){var l=D.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=l[0],o[3]=l[1]}if(e.touches[2]){var l=D.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=l[0],o[5]=l[1]}if(n&&n.unactivate(),D.touchData.cxt){if(t={originalEvent:e,type:"cxttapend",position:{x:o[0],y:o[1]}},n?n.emit(t):i.emit(t),!D.touchData.cxtDragged){var u={originalEvent:e,type:"cxttap",position:{x:o[0],y:o[1]}};n?n.emit(u):i.emit(u)}D.touchData.start&&(D.touchData.start._private.grabbed=!1),D.touchData.cxt=!1,D.touchData.start=null,D.redraw();return}if(!e.touches[2]&&i.boxSelectionEnabled()&&D.touchData.selecting){D.touchData.selecting=!1;var h=i.collection(D.getAllInBox(r[0],r[1],r[2],r[3]));r[0]=void 0,r[1]=void 0,r[2]=void 0,r[3]=void 0,r[4]=0,D.redrawHint("select",!0),i.emit({type:"boxend",originalEvent:e,position:{x:o[0],y:o[1]}}),h.emit("box").stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit("boxselect"),h.nonempty()&&D.redrawHint("eles",!0),D.redraw()}if(null!=n&&n.unactivate(),e.touches[2])D.data.bgActivePosistion=void 0,D.redrawHint("select",!0);else if(e.touches[1]);else if(e.touches[0]);else if(!e.touches[0]){D.data.bgActivePosistion=void 0,D.redrawHint("select",!0);var c=D.dragData.touchDragEles;if(null!=n){var d=n._private.grabbed;Y(c),D.redrawHint("drag",!0),D.redrawHint("eles",!0),d&&(n.emit("freeon"),c.emit("free"),D.dragData.didDrag&&(n.emit("dragfreeon"),c.emit("dragfree"))),A(n,["touchend","tapend","vmouseup","tapdragout"],e,{x:o[0],y:o[1]}),n.unactivate(),D.touchData.start=null}else A(D.findNearestElement(o[0],o[1],!0,!0),["touchend","tapend","vmouseup","tapdragout"],e,{x:o[0],y:o[1]});var p=D.touchData.startPosition[0]-o[0],g=D.touchData.startPosition[1]-o[1];D.touchData.singleTouchMoved||(n||i.$(":selected").unselect(["tapunselect"]),A(n,["tap","vclick"],e,{x:o[0],y:o[1]}),E=!1,e.timeStamp-T<=i.multiClickDebounceTime()?(_&&clearTimeout(_),E=!0,T=null,A(n,["dbltap","vdblclick"],e,{x:o[0],y:o[1]})):(_=setTimeout(function(){E||A(n,["onetap","voneclick"],e,{x:o[0],y:o[1]})},i.multiClickDebounceTime()),T=e.timeStamp)),null!=n&&!D.dragData.didDrag&&n._private.selectable&&(p*p+g*g)*a*a<D.touchTapThreshold2&&!D.pinching&&("single"===i.selectionType()?(i.$(N).unmerge(n).unselect(["tapunselect"]),n.select(["tapselect"])):n.selected()?n.unselect(["tapunselect"]):n.select(["tapselect"]),D.redrawHint("eles",!0)),D.touchData.singleTouchMoved=!0}for(var f=0;f<o.length;f++)s[f]=o[f];D.dragData.didDrag=!1,0===e.touches.length&&(D.touchData.dragDelta=[],D.touchData.startPosition=[null,null,null,null,null,null],D.touchData.startGPosition=null,D.touchData.didSelect=!1),e.touches.length<2&&(1===e.touches.length&&(D.touchData.startGPosition=[e.touches[0].clientX,e.touches[0].clientY]),D.pinching=!1,D.redrawHint("eles",!0),D.redraw())}},!1),"u"<typeof TouchEvent){var J=[],ee=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},et=function(e){J.push({event:e,touch:ee(e)})},en=function(e){for(var t=0;t<J.length;t++)if(J[t].event.pointerId===e.pointerId)return void J.splice(t,1)},er=function(e){var t=J.filter(function(t){return t.event.pointerId===e.pointerId})[0];t.event=e,t.touch=ee(e)},ei=function(e){e.touches=J.map(function(e){return e.touch})},ea=function(e){return"mouse"===e.pointerType||4===e.pointerType};D.registerBinding(D.container,"pointerdown",function(e){ea(e)||(e.preventDefault(),et(e),ei(e),y(e))}),D.registerBinding(D.container,"pointerup",function(e){ea(e)||(en(e),ei(e),w(e))}),D.registerBinding(D.container,"pointercancel",function(e){ea(e)||(en(e),ei(e),x(e))}),D.registerBinding(D.container,"pointermove",function(e){ea(e)||(e.preventDefault(),er(e),ei(e),b(e))})}};var sn={};sn.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return no(i,a,this.points,e,t,n/2,r/2,o)},checkPoint:function(e,t,n,r,i,a,o){return t6(e,t,this.points,a,o,r,i,[0,-1],n)}}},sn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return nt(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o){return nn(e,t,r,i,a,o,n)}}},sn.generateRoundPolygon=function(e,t){for(var n=Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,a=void 0;a=r<t.length/2-1?(r+1)*2:0,n[4*r]=t[i],n[4*r+1]=t[i+1];var o=t[a]-t[i],s=t[a+1]-t[i+1],l=Math.sqrt(o*o+s*s);n[4*r+2]=o/l,n[4*r+3]=s/l}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return ns(i,a,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,a,o){return t8(e,t,this.points,a,o,r,i)}}},sn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:nu(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return tJ(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=nd(r,i),l=2*s;return!!(t6(e,t,this.points,a,o,r,i-l,[0,-1],n)||t6(e,t,this.points,a,o,r-l,i,[0,-1],n)||nn(e,t,l,l,a-r/2+s,o-i/2+s,n)||nn(e,t,l,l,a+r/2-s,o-i/2+s,n)||nn(e,t,l,l,a+r/2-s,o+i/2-s,n)||nn(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},sn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ng(),points:nu(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,a=t/2,o=e/2,s=n-o,l=n+o,u=r-a,h=r+a;return{topLeft:[s,u+i,s+i,u,s+i,u+i],topRight:[l-i,u,l,u+i,l-i,u+i],bottomRight:[l,h-i,l-i,h,l-i,h-i],bottomLeft:[s+i,h,s,h-i,s+i,h-i]}},intersectLine:function(e,t,n,r,i,a,o){var s=this.generateCutTrianglePts(n+2*o,r+2*o,e,t);return no(i,a,[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]),e,t)},checkPoint:function(e,t,n,r,i,a,o){if(t6(e,t,this.points,a,o,r,i-2*this.cornerLength,[0,-1],n)||t6(e,t,this.points,a,o,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,a,o);return t9(e,t,s.topLeft)||t9(e,t,s.topRight)||t9(e,t,s.bottomRight)||t9(e,t,s.bottomLeft)}}},sn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:nu(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=this.generateBarrelBezierPts(n+2*o,r+2*o,e,t),l=function(e){var t=tG({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=tG({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=tG({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]};return no(i,a,[].concat(l(s.topLeft),l(s.topRight),l(s.bottomRight),l(s.bottomLeft)),e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,a=e/2,o=n-a,s=n+a,l=r-i,u=r+i,h=nf(e,t),c=h.heightOffset,d=h.widthOffset,p=h.ctrlPtOffsetPct*e,g={topLeft:[o,l+c,o+p,l,o+d,l],topRight:[s-d,l,s-p,l,s,l+c],bottomRight:[s,u-c,s-p,u,s-d,u],bottomLeft:[o+d,u,o+p,u,o,u-c]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,t,n,r,i,a,o){var s=nf(r,i),l=s.heightOffset,u=s.widthOffset;if(t6(e,t,this.points,a,o,r,i-2*l,[0,-1],n)||t6(e,t,this.points,a,o,r-2*u,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(r,i,a,o),c=Object.keys(h),d=0;d<c.length;d++){var p=h[c[d]],g=function(e,t,n){var r=n[4],i=n[2],a=n[0],o=n[5],s=n[1],l=Math.min(r,a),u=Math.max(r,a),h=Math.min(o,s),c=Math.max(o,s);if(l<=e&&e<=u&&h<=t&&t<=c){var d=[r-2*i+a,2*(i-r),r],p=t2(d[0],d[1],d[2],e).filter(function(e){return 0<=e&&e<=1});if(p.length>0)return p[0]}return null}(e,t,p);if(null!=g){var f=tz(p[5],p[3],p[1],g);if(p.isTop&&f<=t||p.isBottom&&t<=f)return!0}}return!1}}},sn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:nu(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=e-(n/2+o),l=t-(r/2+o),u=e+(n/2+o),h=na(i,a,e,t,s,l,u,l,!1);return h.length>0?h:tJ(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=nd(r,i),l=2*s;if(t6(e,t,this.points,a,o,r,i-l,[0,-1],n)||t6(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,h=i/2+2*n;return!!(t9(e,t,[a-u,o-h,a-u,o,a+u,o,a+u,o-h])||nn(e,t,l,l,a+r/2-s,o+i/2-s,n)||nn(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},sn.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",nu(3,0)),this.generateRoundPolygon("round-triangle",nu(3,0)),this.generatePolygon("rectangle",nu(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",nu(5,0)),this.generateRoundPolygon("round-pentagon",nu(5,0)),this.generatePolygon("hexagon",nu(6,0)),this.generateRoundPolygon("round-hexagon",nu(6,0)),this.generatePolygon("heptagon",nu(7,0)),this.generateRoundPolygon("round-heptagon",nu(7,0)),this.generatePolygon("octagon",nu(8,0)),this.generateRoundPolygon("round-octagon",nu(8,0));var r=Array(20),i=nc(5,0),a=nc(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<a.length/2;s++)a[2*s]*=o,a[2*s+1]*=o;for(var s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=a[2*s],r[4*s+3]=a[2*s+1];r=nh(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var sr={};sr.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},sr.redraw=function(e){e=e||ti(),void 0===this.averageRedrawTime&&(this.averageRedrawTime=0),void 0===this.lastRedrawTime&&(this.lastRedrawTime=0),void 0===this.lastDrawTime&&(this.lastDrawTime=0),this.requestedFrame=!0,this.renderOptions=e},sr.beforeRender=function(e,t){if(!this.destroyed){null==t&&e8("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(e,t){return t.priority-e.priority})}};var si=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};sr.startRenderLoop=function(){var e=this,t=e.cy;e.renderLoopStarted||(e.renderLoopStarted=!0,eU(function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){si(e,!0,r);var i=eX();e.render(e.renderOptions);var a=e.lastDrawTime=eX();void 0===e.averageRedrawTime&&(e.averageRedrawTime=a-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var o=a-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else si(e,!1,r);e.skipFrame=!1,eU(n)}}))};var sa=function(e){this.init(e)},so=sa.prototype;so.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],so.init=function(e){this.options=e,this.cy=e.cy;var t=this.container=e.cy.container(),n=this.cy.window();if(n){var r=n.document,i=r.head,a="__________cytoscape_stylesheet",o="__________cytoscape_container",s=null!=r.getElementById(a);if(0>t.className.indexOf(o)&&(t.className=(t.className||"")+" "+o),!s){var l=r.createElement("style");l.id=a,l.textContent="."+o+" { position: relative; }",i.insertBefore(l,i.children[0])}"static"===n.getComputedStyle(t).getPropertyValue("position")&&te("A Cytoscape container has style position:static and so can not use UI extensions properly")}this.selection=[void 0,void 0,void 0,void 0,0],this.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},this.dragData={possibleDragElements:[]},this.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},this.redraws=0,this.showFps=e.showFps,this.debug=e.debug,this.hideEdgesOnViewport=e.hideEdgesOnViewport,this.textureOnViewport=e.textureOnViewport,this.wheelSensitivity=e.wheelSensitivity,this.motionBlurEnabled=e.motionBlur,this.forcedPixelRatio=G(e.pixelRatio)?e.pixelRatio:null,this.motionBlur=e.motionBlur,this.motionBlurOpacity=e.motionBlurOpacity,this.motionBlurTransparency=1-this.motionBlurOpacity,this.motionBlurPxRatio=1,this.mbPxRBlurry=1,this.minMbLowQualFrames=4,this.fullQualityMb=!1,this.clearedForMotionBlur=[],this.desktopTapThreshold=e.desktopTapThreshold,this.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,this.touchTapThreshold=e.touchTapThreshold,this.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,this.tapholdDuration=500,this.bindings=[],this.beforeRenderCallbacks=[],this.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},this.registerNodeShapes(),this.registerArrowShapes(),this.registerCalculationListeners()},so.notify=function(e,t){var n=this.cy;if(!this.destroyed){if("init"===e)return void this.load();if("destroy"===e)return void this.destroy();("add"===e||"remove"===e||"move"===e&&n.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&this.invalidateCachedZSortedEles(),"viewport"===e&&this.redrawHint("select",!0),("load"===e||"resize"===e||"mount"===e)&&(this.invalidateContainerClientCoordsCache(),this.matchCanvasSize(this.container)),this.redrawHint("eles",!0),this.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},so.destroy=function(){this.destroyed=!0,this.cy.stopAnimationLoop();for(var e=0;e<this.bindings.length;e++){var t=this.bindings[e],n=t.target;(n.off||n.removeEventListener).apply(n,t.args)}if(this.bindings=[],this.beforeRenderCallbacks=[],this.onUpdateEleCalcsFns=[],this.removeObserver&&this.removeObserver.disconnect(),this.styleObserver&&this.styleObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.labelCalcDiv)try{document.body.removeChild(this.labelCalcDiv)}catch(e){}},so.isHeadless=function(){return!1},[oW,o7,se,st,sn,sr].forEach(function(e){eo(so,e)});var ss=1e3/60,sl=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=eG(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),i=e.priority||e6;n.beforeRender(function(i,a){var o=eX(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],h=n.cy.extent(),c=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var d=eX(),p=d-o,g=d-a;if(l<ss){var f=ss-(i?s:0);if(g>=e.deqFastCost*f)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(g>=e.deqNoDrawCost*ss)break;var v=e.deq(t,c,h);if(v.length>0)for(var y=0;y<v.length;y++)u.push(v[y]);else break}u.length>0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,c,h)&&r())},i(t))}}},su=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e4;t(this,e),this.idsByKey=new td,this.keyForId=new td,this.cachesByLvl=new td,this.lvls=[],this.getKey=n,this.doesEleInvalidateKey=r}return i(e,[{key:"getIdsFor",value:function(e){null==e&&e8("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new tg,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new td,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),sh={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},sc=ta({getKey:null,doesEleInvalidateKey:e4,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:e3,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),sd=function(e,t){this.renderer=e,this.onDequeues=[];var n=sc(t);eo(this,n),this.lookup=new su(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},sp=sd.prototype;sp.reasons=sh,sp.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},sp.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},sp.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new tm(function(e,t){return t.reqs-e.reqs})},sp.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},sp.getElement=function(e,t,n,r,i){var a,o,s,l=this,u=this.renderer,h=u.cy.zoom(),c=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!l.allowEdgeTxrCaching&&e.isEdge()||!l.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(tM(h*n))),r<-4)r=-4;else if(h>=7.99||r>3)return null;var d=Math.pow(2,r),p=t.h*d,g=t.w*d,f=u.eleTextBiggerThanMin(e,d);if(!this.isVisible(e,f))return null;var v=c.get(e,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;if(a=p<=25?25:p<=50?50:50*Math.ceil(p/50),p>1024||g>1024)return null;var y=l.getTextureQueue(a),b=y[y.length-2],x=function(){return l.recycleTexture(a,g)||l.addTexture(a,g)};b||(b=y[y.length-1]),b||(b=x()),b.width-b.usedWidth<g&&(b=x());for(var w=function(e){return e&&e.scaledLabelShown===f},E=i&&i===sh.dequeue,_=i&&i===sh.highQuality,T=i&&i===sh.downscale,D=r+1;D<=3;D++){var C=c.get(e,D);if(C){o=C;break}}var N=o&&o.level===r+1?o:null,A=function(){b.context.drawImage(N.texture.canvas,N.x,0,N.width,N.height,b.usedWidth,0,g,p)};if(b.context.setTransform(1,0,0,1,0,0),b.context.clearRect(b.usedWidth,0,g,a),w(N))A();else if(w(o))if(!_)return l.queueElement(e,o.level-1),o;else{for(var L=o.level;L>r;L--)N=l.getElement(e,t,n,L,sh.downscale);A()}else{if(!E&&!_&&!T)for(var S=r-1;S>=-4;S--){var k=c.get(e,S);if(k){s=k;break}}if(w(s))return l.queueElement(e,r),s;b.context.translate(b.usedWidth,0),b.context.scale(d,d),this.drawElement(b.context,e,t,f,!1),b.context.scale(1/d,1/d),b.context.translate(-b.usedWidth,0)}return v={x:b.usedWidth,texture:b,level:r,scale:d,width:g,height:p,scaledLabelShown:f},b.usedWidth+=Math.ceil(g+8),b.eleCaches.push(v),c.set(e,r,v),l.checkTextureFullness(b),v},sp.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},sp.invalidateElement=function(e){var t=this.lookup,n=[];if(t.isInvalid(e)){for(var r=-4;r<=3;r++){var i=t.getForCachedKey(e,r);i&&n.push(i)}if(t.invalidate(e))for(var a=0;a<n.length;a++){var o=n[a],s=o.texture;s.invalidatedWidth+=o.width,o.invalidated=!0,this.checkTextureUtility(s)}this.removeFromQueue(e)}},sp.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},sp.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?to(t,e):e.fullnessChecks++},sp.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;to(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a<i.length;a++){var o=i[a];r.deleteCache(o.key,o.level)}ts(i),this.getRetiredTextureQueue(t).push(e)},sp.addTexture=function(e,t){var n=this.getTextureQueue(e),r={};return n.push(r),r.eleCaches=[],r.height=e,r.width=Math.max(1024,t),r.usedWidth=0,r.invalidatedWidth=0,r.fullnessChecks=0,r.canvas=this.renderer.makeOffscreenCanvas(r.width,r.height),r.context=r.canvas.getContext("2d"),r},sp.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var a=r[i];if(a.width>=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,ts(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),to(r,a),n.push(a),a}},sp.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},sp.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,a=0;a<1;a++)if(t.size()>0){var o=t.pop(),s=o.key,l=o.eles[0],u=i.hasCache(l,o.level);if(n[s]=null,u)continue;r.push(o);var h=this.getBoundingBox(l);this.getElement(l,h,e,o.level,sh.dequeue)}else break;return r},sp.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=e5,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},sp.onDequeue=function(e){this.onDequeues.push(e)},sp.offDequeue=function(e){to(this.onDequeues,e)},sp.setupDequeueing=sl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var a=t[i].eles,o=0;o<a.length;o++)if(tK(a[o].boundingBox(),r))return!0;return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var sg=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=eX()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=eG(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},50),n.beforeRender(function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new tm(function(e,t){return t.reqs-e.reqs}),t.setupDequeueing()},sf=sg.prototype,sv=0;sf.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),a=this.renderer.makeOffscreenCanvas(r,i),o={id:sv=++sv%0x1fffffffffffff,bb:e,level:t,width:r,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(n,n),s.translate(l,u),o},sf.getLayers=function(e,t,n){var r,i,a=this,o=a.renderer.cy.zoom(),s=a.firstGet;if(a.firstGet=!1,null==n){if((n=Math.ceil(tM(o*t)))<-4)n=-4;else if(o>=3.99||n>2)return null}a.validateLayersElesOrdering(n,e);var l=a.layersByLevel,u=Math.pow(2,n),h=l[n]=l[n]||[];if(a.levelIsComplete(n,e))return h;var c=function(t){if(a.validateLayersElesOrdering(t,e),a.levelIsComplete(t,e))return i=l[t],!0},d=function(e){if(!i)for(var t=n+e;-4<=t&&t<=2&&!c(t);t+=e);};d(1),d(-1);for(var p=h.length-1;p>=0;p--){var g=h[p];g.invalid&&to(h,g)}var f=function(){if(!r){r=tV();for(var t=0;t<e.length;t++)tj(r,e[t].boundingBox())}return r};if(a.skipping&&!s)return null;for(var v=null,y=e.length/1,b=!s,x=0;x<e.length;x++){var w=e[x],E=w._private.rscratch,_=E.imgLayerCaches=E.imgLayerCaches||{},T=_[n];if(T){v=T;continue}if((!v||v.eles.length>=y||!tQ(v.bb,w.boundingBox()))&&!(v=function(e){var t=(e=e||{}).after;if(f(),r.w*u*(r.h*u)>16e6)return null;var i=a.makeLayer(r,n);if(null!=t){var o=h.indexOf(t)+1;h.splice(o,0,i)}else(void 0===e.insert||e.insert)&&h.unshift(i);return i}({insert:!0,after:v})))return null;i||b?a.queueLayer(v,w):a.drawEleInLayer(v,w,n,t),v.eles.push(w),_[n]=v}return i||(b?null:h)},sf.getEleLevelForLayerLevel=function(e,t){return e},sf.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,!0),i.setImgSmoothing(a,!0))},sf.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0||a.invalid)return!1;r+=a.eles.length}return r===t.length},sf.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,o=0;o<t.length;o++)if(i.eles[0]===t[o]){a=o;break}if(a<0){this.invalidateLayer(i);continue}for(var s=a,o=0;o<i.eles.length;o++)if(i.eles[o]!==t[s+o]){this.invalidateLayer(i);break}}},sf.updateElementsInLayers=function(e,t){for(var n=V(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],a=n?e[r]:e[r].ele,o=a._private.rscratch,s=o.imgLayerCaches=o.imgLayerCaches||{},l=-4;l<=2;l++){var u=s[l];u&&(i&&this.getEleLevelForLayerLevel(u.level)!==i.level||t(u,a,i))}},sf.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},sf.invalidateElements=function(e){var t=this;0===e.length||(t.lastInvalidationTime=eX(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},sf.invalidateLayer=function(e){if(this.lastInvalidationTime=eX(),!e.invalid){var t=e.level,n=e.eles;to(this.layersByLevel[t],e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var r=0;r<n.length;r++){var i=n[r]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},sf.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])})},sf.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},sf.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},sf.dequeue=function(e){for(var t=this.layersQueue,n=[],r=0;r<1&&0!==t.size();){var i=t.peek();if(i.replacement||i.replaces&&i!==i.replaces.replacement||i.invalid){t.pop();continue}var a=i.elesQueue.shift();a&&(this.drawEleInLayer(i,a,i.level,e),r++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&this.applyLayerReplacement(i),this.requestRedraw())}return n},sf.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0)&&!n.invalid){t[r]=e;for(var i=0;i<e.eles.length;i++){var a=e.eles[i]._private,o=a.imgLayerCaches=a.imgLayerCaches||{};o&&(o[e.level]=e)}this.requestRedraw()}},sf.requestRedraw=eG(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),sf.setupDequeueing=sl({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:e6,shouldRedraw:e3,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var sy={};function sm(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function sb(e,t,n){for(var r,i=0;i<t.length;i++){var a=t[i];0===i&&(r=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function sx(e,t,n){e.beginPath&&e.beginPath();for(var r=0;r<t.length;r++){var i=t[r];e.lineTo(i.x,i.y)}var a=n[0];e.moveTo(a.x,a.y);for(var r=1;r<n.length;r++){var i=n[r];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function sw(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var a=t[0];e.moveTo(a.x,a.y);for(var o=0;o<t.length;o++){var s=t[o];e.lineTo(s.x,s.y)}e.closePath&&e.closePath()}function sE(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}sy.arrowShapeImpl=function(e){return(A||(A={polygon:sm,"triangle-backcurve":sb,"triangle-tee":sx,"circle-triangle":sw,"triangle-cross":sx,circle:sE}))[e]};var s_={};s_.drawElement=function(e,t,n,r,i,a){t.isNode()?this.drawNode(e,t,n,r,i,a):this.drawEdge(e,t,n,r,i,a)},s_.drawElementOverlay=function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},s_.drawElementUnderlay=function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},s_.drawCachedElementPortion=function(e,t,n,r,i,a,o,s){var l=n.getBoundingBox(t);if(0!==l.w&&0!==l.h){var u=n.getElement(t,l,r,i,a);if(null!=u){var h,c,d,p,g,f,v=s(this,t);if(0===v)return;var y=o(this,t),b=l.x1,x=l.y1,w=l.w,E=l.h;if(0!==y){var _=n.getRotationPoint(t);d=_.x,p=_.y,e.translate(d,p),e.rotate(y),(g=this.getImgSmoothing(e))||this.setImgSmoothing(e,!0);var T=n.getRotationOffset(t);h=T.x,c=T.y}else h=b,c=x;1!==v&&(f=e.globalAlpha,e.globalAlpha=f*v),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,h,c,w,E),1!==v&&(e.globalAlpha=f),0!==y&&(e.rotate(-y),e.translate(-d,-p),g||this.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var sT=function(){return 0},sD=function(e,t){return e.getTextAngle(t,null)},sC=function(e,t){return e.getTextAngle(t,"source")},sN=function(e,t){return e.getTextAngle(t,"target")},sA=function(e,t){return t.effectiveOpacity()},sL=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};s_.drawCachedElement=function(e,t,n,r,i,a){var o=this.data,s=o.eleTxrCache,l=o.lblTxrCache,u=o.slbTxrCache,h=o.tlbTxrCache,c=t.boundingBox(),d=!0===a?s.reasons.highQuality:null;if(0!==c.w&&0!==c.h&&t.visible()&&(!r||tK(c,r))){var p=t.isEdge(),g=t.element()._private.rscratch.badLine;this.drawElementUnderlay(e,t),this.drawCachedElementPortion(e,t,s,n,i,d,sT,sA),p&&g||this.drawCachedElementPortion(e,t,l,n,i,d,sD,sL),p&&!g&&(this.drawCachedElementPortion(e,t,u,n,i,d,sC,sL),this.drawCachedElementPortion(e,t,h,n,i,d,sN,sL)),this.drawElementOverlay(e,t)}},s_.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},s_.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i];this.drawCachedElement(e,a,n,r)}},s_.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i];a.isNode()&&this.drawCachedElement(e,a,n,r)}},s_.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var a=0;a<i.length;a++){var o=i[a],s=o.bb;0!==s.w&&0!==s.h&&e.drawImage(o.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var sS={};sS.drawEdge=function(e,t,n){var r,i=!(arguments.length>3)||void 0===arguments[3]||arguments[3],a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=!(arguments.length>5)||void 0===arguments[5]||arguments[5],s=this,l=t._private.rscratch;if((!o||t.visible())&&!(l.badLine||null==l.allpts||isNaN(l.allpts[0]))){n&&(r=n,e.translate(-r.x1,-r.y1));var u=o?t.pstyle("opacity").value:1,h=o?t.pstyle("line-opacity").value:1,c=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,g=t.pstyle("line-cap").value,f=u*h,v=u*h,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;"straight-triangle"===c?(s.eleStrokeStyle(e,t,n),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=p,e.lineCap=g,s.eleStrokeStyle(e,t,n),s.drawEdgePath(t,e,l.allpts,d),e.lineCap="butt")},b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;s.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var x=t.pstyle("ghost-offset-x").pfValue,w=t.pstyle("ghost-offset-y").pfValue,E=f*t.pstyle("ghost-opacity").value;e.translate(x,w),y(E),b(E),e.translate(-x,-w)}a&&s.drawEdgeUnderlay(e,t),y(),b(),a&&s.drawEdgeOverlay(e,t),s.drawElementText(e,t,null,i),n&&e.translate(r.x1,r.y1)}};var sk=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this.usePaths(),a=n._private.rscratch,o=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-color")).value;t.lineWidth=2*o,"self"!==a.edgeType||i?t.lineCap="round":t.lineCap="butt",this.colorStrokeStyle(t,s[0],s[1],s[2],r),this.drawEdgePath(n,t,a.allpts,"solid")}}}};sS.drawEdgeOverlay=sk("overlay"),sS.drawEdgeUnderlay=sk("underlay"),sS.drawEdgePath=function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,h=e.pstyle("line-dash-offset").pfValue;if(l){var c=n.join("$");a.pathCacheKey&&a.pathCacheKey===c?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=c,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(u),o.lineDashOffset=h;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<n.length;d+=4)t.quadraticCurveTo(n[d],n[d+1],n[d+2],n[d+3]);break;case"straight":case"segments":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1])}t=o,l?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},sS.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=[a[1]/o,-a[0]/o],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},sS.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},sS.drawArrowhead=function(e,t,n,r,i,a,o){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a))&&null!=a){var s=t.pstyle(n+"-arrow-shape").value;if("none"!==s){var l="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",u=t.pstyle(n+"-arrow-fill").value,h=t.pstyle("width").pfValue,c=t.pstyle(n+"-arrow-width"),d="match-line"===c.value?h:c.pfValue;"%"===c.units&&(d*=h);var p=t.pstyle("opacity").value;void 0===o&&(o=p);var g=e.globalCompositeOperation;(1!==o||"hollow"===u)&&(e.globalCompositeOperation="destination-out",this.colorFillStyle(e,255,255,255,1),this.colorStrokeStyle(e,255,255,255,1),this.drawArrowShape(t,e,l,h,s,d,r,i,a),e.globalCompositeOperation=g);var f=t.pstyle(n+"-arrow-color").value;this.colorFillStyle(e,f[0],f[1],f[2],o),this.colorStrokeStyle(e,f[0],f[1],f[2],o),this.drawArrowShape(t,e,u,h,s,d,r,i,a)}}},sS.drawArrowShape=function(e,t,n,r,i,a,o,s,l){var u,h=this.usePaths()&&"triangle-cross"!==i,c=!1,d=t,p=e.pstyle("arrow-scale").value,g=this.getArrowWidth(r,p),f=this.arrowShapes[i];if(h){var v=this.arrowPathCache=this.arrowPathCache||[],y=eZ(i),b=v[y];null!=b?(u=t=b,c=!0):(u=t=new Path2D,v[y]=u)}!c&&(t.beginPath&&t.beginPath(),h?f.draw(t,1,0,{x:0,y:0},1):f.draw(t,g,l,{x:o,y:s},r),t.closePath&&t.closePath()),t=d,h&&(t.translate(o,s),t.rotate(l),t.scale(g,g)),("filled"===n||"both"===n)&&(h?t.fill(u):t.fill()),("hollow"===n||"both"===n)&&(t.lineWidth=a/(h?g:1),t.lineJoin="miter",h?t.stroke(u):t.stroke()),h&&(t.scale(1/g,1/g),t.rotate(-l),t.translate(-o,-s))};var sI={};sI.safeDrawImage=function(e,t,n,r,i,a,o,s,l,u){if(!(i<=0)&&!(a<=0)&&!(l<=0)&&!(u<=0))try{e.drawImage(t,n,r,i,a,o,s,l,u)}catch(e){te(e)}},sI.drawInscribedImage=function(e,t,n,r,i){var a=n.position(),o=a.x,s=a.y,l=n.cy().style(),u=l.getIndexedStyle.bind(l),h=u(n,"background-fit","value",r),c=u(n,"background-repeat","value",r),d=n.width(),p=n.height(),g=2*n.padding(),f=d+("inner"===u(n,"background-width-relative-to","value",r)?0:g),v=p+("inner"===u(n,"background-height-relative-to","value",r)?0:g),y=n._private.rscratch,b="node"===u(n,"background-clip","value",r),x=u(n,"background-image-opacity","value",r)*i,w=u(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,_=t.height||t.cachedH;(null==E||null==_)&&(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var T=E,D=_;if("auto"!==u(n,"background-width","value",r)&&(T="%"===u(n,"background-width","units",r)?u(n,"background-width","pfValue",r)*f:u(n,"background-width","pfValue",r)),"auto"!==u(n,"background-height","value",r)&&(D="%"===u(n,"background-height","units",r)?u(n,"background-height","pfValue",r)*v:u(n,"background-height","pfValue",r)),0!==T&&0!==D){if("contain"===h){var C=Math.min(f/T,v/D);T*=C,D*=C}else if("cover"===h){var C=Math.max(f/T,v/D);T*=C,D*=C}var N=o-f/2,A=u(n,"background-position-x","units",r),L=u(n,"background-position-x","pfValue",r);"%"===A?N+=(f-T)*L:N+=L;var S=u(n,"background-offset-x","units",r),k=u(n,"background-offset-x","pfValue",r);"%"===S?N+=(f-T)*k:N+=k;var I=s-v/2,O=u(n,"background-position-y","units",r),M=u(n,"background-position-y","pfValue",r);"%"===O?I+=(v-D)*M:I+=M;var P=u(n,"background-offset-y","units",r),R=u(n,"background-offset-y","pfValue",r);"%"===P?I+=(v-D)*R:I+=R,y.pathCache&&(N-=o,I-=s,o=0,s=0);var B=e.globalAlpha;e.globalAlpha=x;var F=this.getImgSmoothing(e),z=!1;if("no"===w&&F?(this.setImgSmoothing(e,!1),z=!0):"yes"!==w||F||(this.setImgSmoothing(e,!0),z=!0),"no-repeat"===c)b&&(e.save(),y.pathCache?e.clip(y.pathCache):(this.nodeShapes[this.getNodeShape(n)].draw(e,o,s,f,v),e.clip())),this.safeDrawImage(e,t,0,0,E,_,N,I,T,D),b&&e.restore();else{var G=e.createPattern(t,c);e.fillStyle=G,this.nodeShapes[this.getNodeShape(n)].draw(e,o,s,f,v),e.translate(N,I),e.fill(),e.translate(-N,-I)}e.globalAlpha=B,z&&this.setImgSmoothing(e,F)}};var sO={};sO.eleTextBiggerThanMin=function(e,t){return t||(t=Math.pow(2,Math.ceil(tM(e.cy().zoom()*this.getPixelRatio())))),!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},sO.drawElementText=function(e,t,n,r,i){var a,o=!(arguments.length>5)||void 0===arguments[5]||arguments[5];if(null==r){if(o&&!this.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;e.textAlign=this.getLabelJustification(t),e.textBaseline="bottom"}else{var l=t.element()._private.rscratch.badLine,u=t.pstyle("label"),h=t.pstyle("source-label"),c=t.pstyle("target-label");if(l||(!u||!u.value)&&(!h||!h.value)&&(!c||!c.value))return;e.textAlign="center",e.textBaseline="bottom"}var d=!n;n&&(a=n,e.translate(-a.x1,-a.y1)),null==i?(this.drawText(e,t,null,d,o),t.isEdge()&&(this.drawText(e,t,"source",d,o),this.drawText(e,t,"target",d,o))):this.drawText(e,t,i,d,o),n&&e.translate(a.x1,a.y1)},sO.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},sO.setupTextStyle=function(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,h=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,h[0],h[1],h[2],l)},sO.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),a=tu(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},sO.drawText=function(e,t,n){var r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||0!==o&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s=tu(a,"labelX",n),l=tu(a,"labelY",n),u=this.getLabelText(t,n);if(null!=u&&""!==u&&!isNaN(s)&&!isNaN(l)){this.setupTextStyle(e,t,i);var h,c,d,p=n?n+"-":"",g=tu(a,"labelWidth",n),f=tu(a,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),s+=v,l+=y,0!==(d=r?this.getTextAngle(t,n):0)&&(h=s,c=l,e.translate(h,c),e.rotate(d),s=0,l=0),w){case"top":break;case"center":l+=f/2;break;case"bottom":l+=f}var E=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,T=t.pstyle("text-border-width").pfValue,D=t.pstyle("text-background-padding").pfValue;if(E>0||T>0&&_>0){var C=s-D;switch(x){case"left":C-=g;break;case"center":C-=g/2}var N=l-f-D,A=g+2*D,L=f+2*D;if(E>0){var S=e.fillStyle,k=t.pstyle("text-background-color").value;e.fillStyle="rgba("+k[0]+","+k[1]+","+k[2]+","+E*o+")",0===t.pstyle("text-background-shape").strValue.indexOf("round")?function(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill()}(e,C,N,A,L,2):e.fillRect(C,N,A,L),e.fillStyle=S}if(T>0&&_>0){var I=e.strokeStyle,O=e.lineWidth,M=t.pstyle("text-border-color").value,P=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+M[0]+","+M[1]+","+M[2]+","+_*o+")",e.lineWidth=T,e.setLineDash)switch(P){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=T/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(C,N,A,L),"double"===P){var R=T/2;e.strokeRect(C+R,N+R,A-2*R,L-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=O,e.strokeStyle=I}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=tu(a,"labelWrapCachedLines",n),z=tu(a,"labelLineHeight",n),G=g/2,Y=this.getLabelJustification(t);switch("auto"===Y||("left"===x?"left"===Y?s+=-g:"center"===Y&&(s+=-G):"center"===x?"left"===Y?s+=-G:"right"===Y&&(s+=G):"right"===x&&("center"===Y?s+=G:"right"===Y&&(s+=g))),w){case"top":case"center":case"bottom":l-=(F.length-1)*z}for(var X=0;X<F.length;X++)B>0&&e.strokeText(F[X],s,l),e.fillText(F[X],s,l),l+=z}else B>0&&e.strokeText(u,s,l),e.fillText(u,s,l);0!==d&&(e.rotate(-d),e.translate(-h,-c))}}};var sM={};sM.drawNode=function(e,t,n){var r,i,a,o,s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],l=!(arguments.length>4)||void 0===arguments[4]||arguments[4],u=!(arguments.length>5)||void 0===arguments[5]||arguments[5],h=this,c=t._private,d=c.rscratch,p=t.position();if(G(p.x)&&G(p.y)&&(!u||t.visible())){var g=u?t.effectiveOpacity():1,f=h.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(o=n,e.translate(-o.x1,-o.y1));for(var b=t.pstyle("background-image").value,x=Array(b.length),w=Array(b.length),E=0,_=0;_<b.length;_++){var T=b[_];if(x[_]=null!=T&&"none"!==T){var D=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);E++,w[_]=h.getCachedImage(T,D,function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var C=t.pstyle("background-blacken").value,N=t.pstyle("border-width").pfValue,A=t.pstyle("background-opacity").value*g,L=t.pstyle("border-color").value,S=t.pstyle("border-style").value,k=t.pstyle("border-opacity").value*g,I=t.pstyle("outline-width").pfValue,O=t.pstyle("outline-color").value,M=t.pstyle("outline-style").value,P=t.pstyle("outline-opacity").value*g,R=t.pstyle("outline-offset").value;e.lineJoin="miter";var B=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;h.eleFillStyle(e,t,n)},F=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k;h.colorStrokeStyle(e,L[0],L[1],L[2],t)},z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;h.colorStrokeStyle(e,O[0],O[1],O[2],t)},Y=function(e,t,n,r){var i,a=h.nodePathCache=h.nodePathCache||[],o=eQ("polygon"===n?n+","+r.join(","):n,""+t,""+e),s=a[o],l=!1;return null!=s?(l=!0,d.pathCache=i=s):(i=new Path2D,a[o]=d.pathCache=i),{path:i,cacheHit:l}},X=t.pstyle("shape").strValue,V=t.pstyle("shape-polygon-points").pfValue;if(f){e.translate(p.x,p.y);var U=Y(r,i,X,V);a=U.path,v=U.cacheHit}var j=function(){if(!v){var n=p;f&&(n={x:0,y:0}),h.nodeShapes[h.getNodeShape(t)].draw(a||e,n.x,n.y,r,i)}f?e.fill(a):e.fill()},q=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=c.backgrounding,a=0,o=0;o<w.length;o++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",o);if(r&&"over"===s||!r&&"inside"===s){a++;continue}x[o]&&w[o].complete&&!w[o].error&&(a++,h.drawInscribedImage(e,w[o],t,o,n))}c.backgrounding=a!==E,i!==c.backgrounding&&t.updateStyle(!1)},H=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;h.hasPie(t)&&(h.drawPie(e,t,a),n&&!f&&h.nodeShapes[h.getNodeShape(t)].draw(e,p.x,p.y,r,i))},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,n=C>0?0:255;0!==C&&(h.colorFillStyle(e,n,n,n,(C>0?C:-C)*t),f?e.fill(a):e.fill())},$=function(){if(N>0){if(e.lineWidth=N,e.lineCap="butt",e.setLineDash)switch(S){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(f?e.stroke(a):e.stroke(),"double"===S){e.lineWidth=N/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",f?e.stroke(a):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},K=function(){if(I>0){if(e.lineWidth=I,e.lineCap="butt",e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n,a=p;f&&(a={x:0,y:0});var o=h.getNodeShape(t),s=(r+N+(I+R))/r,l=(i+N+(I+R))/i,u=r*s,c=i*l,d=h.nodeShapes[o].points;if(f&&(n=Y(u,c,o,d).path),"ellipse"===o)h.drawEllipsePath(n||e,a.x,a.y,u,c);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var g=0,v=0,y=0;"round-diamond"===o?g=(N+R+I)*1.4:"round-heptagon"===o?(g=(N+R+I)*1.075,y=-(N/2+R+I)/35):"round-hexagon"===o?g=(N+R+I)*1.12:"round-pentagon"===o?(g=(N+R+I)*1.13,y=-(N/2+R+I)/15):"round-tag"===o?(g=(N+R+I)*1.12,v=(N/2+I+R)*.07):"round-triangle"===o&&(g=Math.PI/2*(N+R+I),y=-(N+R/2+I)/Math.PI),0!==g&&(s=(r+g)/r,l=(i+g)/i),h.drawRoundPolygonPath(n||e,a.x+v,a.y+y,r*s,i*l,d)}else["roundrectangle","round-rectangle"].includes(o)?h.drawRoundRectanglePath(n||e,a.x,a.y,u,c):["cutrectangle","cut-rectangle"].includes(o)?h.drawCutRectanglePath(n||e,a.x,a.y,u,c):["bottomroundrectangle","bottom-round-rectangle"].includes(o)?h.drawBottomRoundRectanglePath(n||e,a.x,a.y,u,c):"barrel"===o?h.drawBarrelPath(n||e,a.x,a.y,u,c):(d=o.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(o)?t7(ne(d,(N+I+R)/r)):t7(ne(d,-((N+I+R)/r))),h.drawPolygonPath(n||e,a.x,a.y,r,i,d));if(f?e.stroke(n):e.stroke(),"double"===M){e.lineWidth=N/3;var b=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",f?e.stroke(n):e.stroke(),e.globalCompositeOperation=b}e.setLineDash&&e.setLineDash([])}};if("yes"===t.pstyle("ghost").value){var Z=t.pstyle("ghost-offset-x").pfValue,Q=t.pstyle("ghost-offset-y").pfValue,J=t.pstyle("ghost-opacity").value,ee=J*g;e.translate(Z,Q),z(),K(),B(J*A),j(),q(ee,!0),F(J*k),$(),H(0!==C||0!==N),q(ee,!1),W(ee),e.translate(-Z,-Q)}f&&e.translate(-p.x,-p.y),l&&h.drawNodeUnderlay(e,t,p,r,i),f&&e.translate(p.x,p.y),z(),K(),B(),j(),q(g,!0),F(),$(),H(0!==C||0!==N),q(g,!1),W(),f&&e.translate(-p.x,-p.y),h.drawElementText(e,t,null,s),l&&h.drawNodeOverlay(e,t,p,r,i),n&&e.translate(o.x1,o.y1)}};var sP=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(t,n,r,i,a){if(n.visible()){var o=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==a){var h=n.padding();i=n.width()+2*h,a=n.height()+2*h}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*o,a+2*o),t.fill()}}}};sM.drawNodeOverlay=sP("overlay"),sM.drawNodeUnderlay=sP("underlay"),sM.hasPie=function(e){return(e=e[0])._private.hasPie},sM.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,l=Math.min(t.width(),t.height())/2,u=0;this.usePaths()&&(o=0,s=0),"%"===a.units?l*=a.pfValue:void 0!==a.pfValue&&(l=a.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var c=t.pstyle("pie-"+h+"-background-size").value,d=t.pstyle("pie-"+h+"-background-color").value,p=t.pstyle("pie-"+h+"-background-opacity").value*n,g=c/100;g+u>1&&(g=1-u);var f=1.5*Math.PI+2*Math.PI*u,v=f+2*Math.PI*g;0===c||u>=1||u+g>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,l,f,v),e.closePath(),this.colorFillStyle(e,d[0],d[1],d[2],p),e.fill(),u+=g)}};var sR={};sR.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},sR.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},sR.createGradientStyleFor=function(e,t,n,r,i){var a,o=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var u=n.sourceEndpoint(),h=n.targetEndpoint(),c=n.midpoint(),d=tR(u,c),p=tR(h,c);a=e.createRadialGradient(c.x,c.y,0,c.x,c.y,Math.max(d,p))}else{var g=o?{x:0,y:0}:n.position(),f=n.paddedWidth(),v=n.paddedHeight();a=e.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(f,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),b=n.targetEndpoint();a=e.createLinearGradient(y.x,y.y,b.x,b.y)}else{var x=o?{x:0,y:0}:n.position(),w=n.paddedWidth(),E=n.paddedHeight(),_=w/2,T=E/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":a=e.createLinearGradient(x.x,x.y-T,x.x,x.y+T);break;case"to-top":a=e.createLinearGradient(x.x,x.y+T,x.x,x.y-T);break;case"to-left":a=e.createLinearGradient(x.x+_,x.y,x.x-_,x.y);break;case"to-right":a=e.createLinearGradient(x.x-_,x.y,x.x+_,x.y);break;case"to-bottom-right":case"to-right-bottom":a=e.createLinearGradient(x.x-_,x.y-T,x.x+_,x.y+T);break;case"to-top-right":case"to-right-top":a=e.createLinearGradient(x.x-_,x.y+T,x.x+_,x.y-T);break;case"to-bottom-left":case"to-left-bottom":a=e.createLinearGradient(x.x+_,x.y-T,x.x-_,x.y+T);break;case"to-top-left":case"to-left-top":a=e.createLinearGradient(x.x+_,x.y+T,x.x-_,x.y-T)}}if(!a)return null;for(var D=l.length===s.length,C=s.length,N=0;N<C;N++)a.addColorStop(D?l[N]:N/(C-1),"rgba("+s[N][0]+","+s[N][1]+","+s[N][2]+","+i+")");return a},sR.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},sR.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},sR.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},sR.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},sR.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},sR.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},sR.matchCanvasSize=function(e){var t,n=this.data,r=this.findContainerClientCoords(),i=r[2],a=r[3],o=this.getPixelRatio(),s=this.motionBlurPxRatio;(e===this.data.bufferCanvases[this.MOTIONBLUR_BUFFER_NODE]||e===this.data.bufferCanvases[this.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=i*o,u=a*o;if(l!==this.canvasWidth||u!==this.canvasHeight){this.fontCaches=null;var h=n.canvasContainer;h.style.width=i+"px",h.style.height=a+"px";for(var c=0;c<this.CANVAS_LAYERS;c++)(t=n.canvases[c]).width=l,t.height=u,t.style.width=i+"px",t.style.height=a+"px";for(var c=0;c<this.BUFFER_COUNT;c++)(t=n.bufferCanvases[c]).width=l,t.height=u,t.style.width=i+"px",t.style.height=a+"px";this.textureMult=1,o<=1&&(t=n.bufferCanvases[this.TEXTURE_BUFFER],this.textureMult=2,t.width=l*this.textureMult,t.height=u*this.textureMult),this.canvasWidth=l,this.canvasHeight=u}},sR.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},sR.render=function(e){var t=(e=e||ti()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,a=e.forcedPan,o=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,l=o.cy,u=o.data,h=u.canvasNeedsRedraw,c=o.textureOnViewport&&!t&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),d=void 0!==e.motionBlur?e.motionBlur:o.motionBlur,p=o.motionBlurPxRatio,g=l.hasCompoundNodes(),f=o.hoverData.draggingEles,v=!!o.hoverData.selecting||!!o.touchData.selecting,y=d=d&&!t&&o.motionBlurEnabled&&!v;t||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!t&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),d&&(null==o.mbFrames&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(y=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!c&&(h[o.NODE]=!0,h[o.SELECT_BOX]=!0);var b=l.style(),x=l.zoom(),w=void 0!==i?i:x,E=l.pan(),_={x:E.x,y:E.y},T={zoom:x,pan:{x:E.x,y:E.y}},D=o.prevViewport;void 0===D||T.zoom!==D.zoom||T.pan.x!==D.pan.x||T.pan.y!==D.pan.y||f&&!g||(o.motionBlurPxRatio=1),a&&(_=a),w*=s,_.x*=s,_.y*=s;var C=o.getCachedZSortedEles();function N(e,t,n,r,i){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,o.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=a}function A(e,r){var s,l,h,c;o.clearingMotionBlur||e!==u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=_,l=w,h=o.canvasWidth,c=o.canvasHeight):(s={x:E.x*p,y:E.y*p},l=x*p,h=o.canvasWidth*p,c=o.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,h,c):!t&&(void 0===r||r)&&e.clearRect(0,0,h,c),n||(e.translate(s.x,s.y),e.scale(l,l)),a&&e.translate(a.x,a.y),i&&e.scale(i,i)}if(c||(o.textureDrawLastFrame=!1),c){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=l.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var L=o.data.bufferContexts[o.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult});var T=o.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:o.canvasWidth,height:o.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}h[o.DRAG]=!1,h[o.NODE]=!1;var S=u.contexts[o.NODE],k=o.textureCache.texture,T=o.textureCache.viewport;S.setTransform(1,0,0,1,0,0),d?N(S,0,0,T.width,T.height):S.clearRect(0,0,T.width,T.height);var I=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(S,I[0],I[1],I[2],O),S.fillRect(0,0,T.width,T.height);var x=l.zoom();A(S,!1),S.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/s,T.height/T.zoom/s),S.drawImage(k,T.mpan.x,T.mpan.y,T.width/T.zoom/s,T.height/T.zoom/s)}else o.textureOnViewport&&!t&&(o.textureCache=null);var M=l.extent(),P=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),R=o.hideEdgesOnViewport&&P,B=[];if(B[o.NODE]=!h[o.NODE]&&d&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,B[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),B[o.DRAG]=!h[o.DRAG]&&d&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,B[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),h[o.NODE]||n||r||B[o.NODE]){var F=d&&!B[o.NODE]&&1!==p,S=t||(F?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]);A(S,d&&!F?"motionBlur":void 0),R?o.drawCachedNodes(S,C.nondrag,s,M):o.drawLayeredElements(S,C.nondrag,s,M),o.debug&&o.drawDebugPoints(S,C.nondrag),n||d||(h[o.NODE]=!1)}if(!r&&(h[o.DRAG]||n||B[o.DRAG])){var F=d&&!B[o.DRAG]&&1!==p,S=t||(F?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);A(S,d&&!F?"motionBlur":void 0),R?o.drawCachedNodes(S,C.drag,s,M):o.drawCachedElements(S,C.drag,s,M),o.debug&&o.drawDebugPoints(S,C.drag),n||d||(h[o.DRAG]=!1)}if(o.showFps||!r&&h[o.SELECT_BOX]&&!n){var S=t||u.contexts[o.SELECT_BOX];if(A(S),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){var x=o.cy.zoom(),z=b.core("selection-box-border-width").value/x;S.lineWidth=z,S.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",S.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),z>0&&(S.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",S.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var x=o.cy.zoom(),G=u.bgActivePosistion;S.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",S.beginPath(),S.arc(G.x,G.y,b.core("active-bg-size").pfValue/x,0,2*Math.PI),S.fill()}var Y=o.lastRedrawTime;if(o.showFps&&Y){var X=Math.round(1e3/(Y=Math.round(Y)));S.setTransform(1,0,0,1,0,0),S.fillStyle="rgba(255, 0, 0, 0.75)",S.strokeStyle="rgba(255, 0, 0, 0.75)",S.lineWidth=1,S.fillText("1 frame = "+Y+" ms = "+X+" fps",0,20),S.strokeRect(0,30,250,20),S.fillRect(0,30,250*Math.min(X/60,1),20)}n||(h[o.SELECT_BOX]=!1)}if(d&&1!==p){var V=u.contexts[o.NODE],U=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],j=u.contexts[o.DRAG],q=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,o.canvasWidth,o.canvasHeight):N(e,0,0,o.canvasWidth,o.canvasHeight),e.drawImage(t,0,0,o.canvasWidth*p,o.canvasHeight*p,0,0,o.canvasWidth,o.canvasHeight)};(h[o.NODE]||B[o.NODE])&&(H(V,U,B[o.NODE]),h[o.NODE]=!1),(h[o.DRAG]||B[o.DRAG])&&(H(j,q,B[o.DRAG]),h[o.DRAG]=!1)}o.prevViewport=T,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),d&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!c,o.mbFrames=0,h[o.NODE]=!0,h[o.DRAG]=!0,o.redraw()},100)),t||l.emit("render")};var sB={};sB.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[2*l],n+s*a[2*l+1]);e.closePath()},sB.drawRoundPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2,l=np(r,i);e.beginPath&&e.beginPath();for(var u=0;u<a.length/4;u++){var h=void 0,c=void 0;h=0===u?a.length-2:4*u-2,c=4*u+2;var d=t+o*a[4*u],p=n+s*a[4*u+1],g=l/Math.tan(Math.acos(-a[h]*a[c]-a[h+1]*a[c+1])/2),f=d-g*a[h],v=p-g*a[h+1],y=d+g*a[c],b=p+g*a[c+1];0===u?e.moveTo(f,v):e.lineTo(f,v),e.arcTo(d,p,y,b,l)}e.closePath()},sB.drawRoundRectanglePath=function(e,t,n,r,i){var a=r/2,o=i/2,s=nd(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+a,n-o,t+a,n,s),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.arcTo(t-a,n-o,t,n-o,s),e.lineTo(t,n-o),e.closePath()},sB.drawBottomRoundRectanglePath=function(e,t,n,r,i){var a=r/2,o=i/2,s=nd(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+a,n-o),e.lineTo(t+a,n),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.lineTo(t-a,n-o),e.lineTo(t,n-o),e.closePath()},sB.drawCutRectanglePath=function(e,t,n,r,i){var a=r/2,o=i/2,s=ng();e.beginPath&&e.beginPath(),e.moveTo(t-a+s,n-o),e.lineTo(t+a-s,n-o),e.lineTo(t+a,n-o+s),e.lineTo(t+a,n+o-s),e.lineTo(t+a-s,n+o),e.lineTo(t-a+s,n+o),e.lineTo(t-a,n+o-s),e.lineTo(t-a,n-o+s),e.closePath()},sB.drawBarrelPath=function(e,t,n,r,i){var a=r/2,o=i/2,s=t-a,l=t+a,u=n-o,h=n+o,c=nf(r,i),d=c.widthOffset,p=c.heightOffset,g=c.ctrlPtOffsetPct*d;e.beginPath&&e.beginPath(),e.moveTo(s,u+p),e.lineTo(s,h-p),e.quadraticCurveTo(s+g,h,s+d,h),e.lineTo(l-d,h),e.quadraticCurveTo(l-g,h,l,h-p),e.lineTo(l,u+p),e.quadraticCurveTo(l-g,u,l-d,u),e.lineTo(s+d,u),e.quadraticCurveTo(s+g,u,s,u+p),e.closePath()};for(var sF={},sz={},sG=Math.PI/40,sY=0*Math.PI;sY<2*Math.PI;sY+=sG)sF[sY]=Math.sin(sY),sz[sY]=Math.cos(sY);sB.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,s=r/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=sG)a=t-s*sF[u]*0+s*sz[u]*1,o=n+l*sz[u]*0+l*sF[u]*1,0===u?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var sX={};function sV(e){var t=e.indexOf(",");return e.substr(t+1)}function sU(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new rx(function(r,i){try{t.toBlob(function(e){null!=e?r(e):i(Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(e){i(e)}});case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}(sV(r()),n);case"base64":return sV(r());default:return r()}}sX.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},sX.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=G(e.maxWidth)||G(e.maxHeight),s=this.getPixelRatio(),l=1;if(void 0!==e.scale)i*=e.scale,a*=e.scale,l=e.scale;else if(o){var u=1/0,h=1/0;G(e.maxWidth)&&(u=l*e.maxWidth/i),G(e.maxHeight)&&(h=l*e.maxHeight/a),i*=l=Math.min(u,h),a*=l}o||(i*=s,a*=s,l*=s);var c=document.createElement("canvas");c.width=i,c.height=a,c.style.width=i+"px",c.style.height=a+"px";var d=c.getContext("2d");if(i>0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*l,-n.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(n.x1*l,n.y1*l);else{var g=t.pan(),f={x:g.x*l,y:g.y*l};l*=t.zoom(),d.translate(f.x,f.y),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(-f.x,-f.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,a),d.fill())}return c},sX.png=function(e){return sU(e,this.bufferCanvasImage(e),"image/png")},sX.jpg=function(e){return sU(e,this.bufferCanvasImage(e),"image/jpeg")};var sj={};sj.nodeShapeImpl=function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}};var sq=sH.prototype;function sH(e){var t=this;t.data={canvases:Array(sq.CANVAS_LAYERS),contexts:Array(sq.CANVAS_LAYERS),canvasNeedsRedraw:Array(sq.CANVAS_LAYERS),bufferCanvases:Array(sq.BUFFER_COUNT),bufferContexts:Array(sq.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",r="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var i=t.data.canvasContainer.style;t.data.canvasContainer.style[n]=r,i.position="relative",i.zIndex="0",i.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[n]=r;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};S&&S.userAgent.match(/msie|trident|edge/i)&&(o["-ms-touch-action"]="none",o["touch-action"]="none");for(var s=0;s<sq.CANVAS_LAYERS;s++){var l=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=l.getContext("2d"),Object.keys(o).forEach(function(e){l.style[e]=o[e]}),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(sq.CANVAS_LAYERS-s),t.data.canvasContainer.appendChild(l),t.data.canvasNeedsRedraw[s]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[sq.NODE].setAttribute("data-id","layer"+sq.NODE+"-node"),t.data.canvases[sq.SELECT_BOX].setAttribute("data-id","layer"+sq.SELECT_BOX+"-selectbox"),t.data.canvases[sq.DRAG].setAttribute("data-id","layer"+sq.DRAG+"-drag");for(var s=0;s<sq.BUFFER_COUNT;s++)t.data.bufferCanvases[s]=document.createElement("canvas"),t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d"),t.data.bufferCanvases[s].style.position="absolute",t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),t.data.bufferCanvases[s].style.zIndex=String(-s-1),t.data.bufferCanvases[s].style.visibility="hidden";t.pathsEnabled=!0;var u=tV(),h=function(e){return{x:-e.w/2,y:-e.h/2}},c=function(e){return e.boundingBox(),e[0]._private.bodyBounds},d=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||u},p=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||u},g=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||u},f=function(e,t){return t},v=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},y=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},b=t.data.eleTxrCache=new sd(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return t.oldBackgroundTimestamp!==t.backgroundTimestamp},drawElement:function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},getBoundingBox:c,getRotationPoint:function(e){var t;return{x:((t=c(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2}},getRotationOffset:function(e){return h(c(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),x=t.data.lblTxrCache=new sd(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"main",a)},getBoundingBox:d,getRotationPoint:function(e){return v("",y(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=d(e),n=h(d(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:f}),w=t.data.slbTxrCache=new sd(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"source",a)},getBoundingBox:p,getRotationPoint:function(e){return v("source",y(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return h(p(e))},isVisible:f}),E=t.data.tlbTxrCache=new sd(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"target",a)},getBoundingBox:g,getRotationPoint:function(e){return v("target",y(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return h(g(e))},isVisible:f}),_=t.data.lyrTxrCache=new sg(t);t.onUpdateEleCalcs(function(e,t){b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t),E.invalidateElements(t),_.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}});var T=function(e){for(var t=0;t<e.length;t++)_.enqueueElementRefinement(e[t].ele)};b.onDequeue(T),x.onDequeue(T),w.onDequeue(T),E.onDequeue(T)}sq.CANVAS_LAYERS=3,sq.SELECT_BOX=0,sq.DRAG=1,sq.NODE=2,sq.BUFFER_COUNT=3,sq.TEXTURE_BUFFER=0,sq.MOTIONBLUR_BUFFER_NODE=1,sq.MOTIONBLUR_BUFFER_DRAG=2,sq.redrawHint=function(e,t){switch(e){case"eles":this.data.canvasNeedsRedraw[sq.NODE]=t;break;case"drag":this.data.canvasNeedsRedraw[sq.DRAG]=t;break;case"select":this.data.canvasNeedsRedraw[sq.SELECT_BOX]=t}};var sW="u">typeof Path2D;sq.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},sq.usePaths=function(){return sW&&this.pathsEnabled},sq.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},sq.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},sq.makeOffscreenCanvas=function(t,n){var r;return("u"<typeof OffscreenCanvas?"undefined":e(OffscreenCanvas))!=="undefined"?r=new OffscreenCanvas(t,n):((r=document.createElement("canvas")).width=t,r.height=n),r},[sy,s_,sS,sI,sO,sM,sR,sB,sX,sj].forEach(function(e){eo(sq,e)});var s$=[{name:"null",impl:oj},{name:"base",impl:sa},{name:"canvas",impl:sH}],sK={},sZ={};function sQ(e,t,n){var r=n,i=function(n){te("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e)if(oi.prototype[t])return i(t);else oi.prototype[t]=n;else if("collection"===e)if(aB.prototype[t])return i(t);else aB.prototype[t]=n;else if("layout"===e){for(var a=function(e){this.options=e,n.call(this,e),z(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var h=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return h?h.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var c=function(e){return e._private.cy},d={addEventFields:function(e,t){t.layout=e,t.cy=c(e),t.target=e},bubble:function(){return!0},parent:function(e){return c(e)}};eo(o,{createEmitter:function(){return this._private.emitter=new as(d,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),ic.eventAliasesOn(o),r=a}else if("renderer"===e&&"null"!==t&&"base"!==t){var p=sJ("renderer","base"),g=p.prototype,f=n.prototype,v=function(){p.apply(this,arguments),n.apply(this,arguments)},y=v.prototype;for(var b in g){var x=g[b];if(null!=f[b])return i(b);y[b]=x}for(var w in f)y[w]=f[w];g.clientFunctions.forEach(function(e){y[e]=y[e]||function(){e8("Renderer does not implement `renderer."+e+"()` on its prototype")}}),r=v}else if("__proto__"===e||"constructor"===e||"prototype"===e)return e8(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return ec({map:sK,keys:[e,t],value:r})}function sJ(e,t){return ed({map:sK,keys:[e,t]})}function s0(e,t,n,r,i){return ec({map:sZ,keys:[e,t,n,r],value:i})}function s1(e,t,n,r){return ed({map:sZ,keys:[e,t,n,r]})}var s2=function(){return 2==arguments.length?sJ.apply(null,arguments):3==arguments.length?sQ.apply(null,arguments):4==arguments.length?s1.apply(null,arguments):5==arguments.length?s0.apply(null,arguments):void e8("Invalid extension access syntax")};oi.prototype.extension=s2,[{type:"layout",extensions:oU},{type:"renderer",extensions:s$}].forEach(function(e){e.extensions.forEach(function(t){sQ(e.type,t.name,t.impl)})});var s5=function e(){if(!(this instanceof e))return new e;this.length=0},s3=s5.prototype;s3.instanceString=function(){return"stylesheet"},s3.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},s3.css=function(e,t){var n=this.length-1;if(R(e))this[n].properties.push({name:e,value:t});else if(z(e))for(var r=Object.keys(e),i=0;i<r.length;i++){var a=r[i],o=e[a];if(null!=o){var s=oe.properties[a]||oe.properties[Z(a)];if(null!=s){var l=s.name;this[n].properties.push({name:l,value:o})}}}return this},s3.style=s3.css,s3.generateStyle=function(e){var t=new oe(e);return this.appendToStyle(t)},s3.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var s4=function(e){return(void 0===e&&(e={}),z(e))?new oi(e):R(e)?s2.apply(s2,arguments):void 0};return s4.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(s4),e.apply(null,t),this},s4.warnings=function(e){return e7(e)},s4.version="3.28.0",s4.stylesheet=s4.Stylesheet=s5,s4}()},23143(e){e.exports=function(){var e=[function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],1>Math.abs(this.lengthX)&&(this.lengthX=a.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),1>Math.abs(this.lengthX)&&(this.lengthX=a.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(4);function u(e,t,n,o){null==n&&null==o&&(o=t),r.call(this,o),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,null!=n&&null!=t?this.rect=new a(t.x,t.y,n.width,n.height):this.rect=new a}for(var h in u.prototype=Object.create(r.prototype),r)u[h]=r[h];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}}),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";(r.target==e||r.source==e)&&t.push(r)}),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}}),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;n<t.length;n++)t[n].withChildren().forEach(function(t){e.add(t)});return e},u.prototype.getNoOfChildren=function(){var e=0;if(null==this.child)e=1;else for(var t=this.child.getNodes(),n=0;n<t.length;n++)e+=t[n].getNoOfChildren();return 0==e&&(e=1),e},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},u.prototype.scatter=function(){var e,t,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_X+s.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_Y+s.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth>t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-n)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),u=n(13),h=n(12),c=n(11);function d(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof o?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in d.prototype=Object.create(r.prototype),r)d[p]=r[p];d.prototype.getNodes=function(){return this.nodes},d.prototype.getEdges=function(){return this.edges},d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getParent=function(){return this.parent},d.prototype.getLeft=function(){return this.left},d.prototype.getRight=function(){return this.right},d.prototype.getTop=function(){return this.top},d.prototype.getBottom=function(){return this.bottom},d.prototype.isConnected=function(){return this.isConnected},d.prototype.add=function(e,t,n){if(null==t&&null==n){if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(e)>-1)throw"Node already in graph!";return e.owner=this,this.getNodes().push(e),e}if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(e.source=t,e.target=n,e.isInterGraph=!1,this.getEdges().push(e),t.edges.push(e),n!=t&&n.edges.push(e),e)},d.prototype.remove=function(e){if(e instanceof s){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var t,n=e.edges.slice(),r=n.length,i=0;i<r;i++)(t=n[i]).isInterGraph?this.graphManager.remove(t):t.source.owner.remove(t);var a=this.nodes.indexOf(e);if(-1==a)throw"Node not in owner node list!";this.nodes.splice(a,1)}else if(e instanceof l){var t=e;if(null==t)throw"Edge is null!";if(null==t.source||null==t.target)throw"Source and/or target is null!";if(null==t.source.owner||null==t.target.owner||t.source.owner!=this||t.target.owner!=this)throw"Source and/or target owner is invalid!";var o=t.source.edges.indexOf(t),u=t.target.edges.indexOf(t);if(!(o>-1&&u>-1))throw"Source and/or target doesn't know this edge!";t.source.edges.splice(o,1),t.target!=t.source&&t.target.edges.splice(u,1);var a=t.source.owner.getEdges().indexOf(t);if(-1==a)throw"Not in owner's edge list!";t.source.owner.getEdges().splice(a,1)}},d.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,a=i.MAX_VALUE,o=this.getNodes(),s=o.length,l=0;l<s;l++){var u=o[l];e=u.getTop(),t=u.getLeft(),r>e&&(r=e),a>t&&(a=t)}return r==i.MAX_VALUE?null:(n=void 0!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=a-n,this.top=r-n,new h(this.left,this.top))},d.prototype.updateBounds=function(e){for(var t,n,r,a,o,s=i.MAX_VALUE,l=-i.MAX_VALUE,h=i.MAX_VALUE,c=-i.MAX_VALUE,d=this.nodes,p=d.length,g=0;g<p;g++){var f=d[g];e&&null!=f.child&&f.updateBounds(),t=f.getLeft(),n=f.getRight(),r=f.getTop(),a=f.getBottom(),s>t&&(s=t),l<n&&(l=n),h>r&&(h=r),c<a&&(c=a)}var v=new u(s,h,l-s,c-h);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=void 0!=d[0].getParent().paddingLeft?d[0].getParent().paddingLeft:this.margin,this.left=v.x-o,this.right=v.x+v.width+o,this.top=v.y-o,this.bottom=v.y+v.height+o},d.calculateBounds=function(e){for(var t,n,r,a,o=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,h=-i.MAX_VALUE,c=e.length,d=0;d<c;d++){var p=e[d];t=p.getLeft(),n=p.getRight(),r=p.getTop(),a=p.getBottom(),o>t&&(o=t),s<n&&(s=n),l>r&&(l=r),h<a&&(h=a)}return new u(o,l,s-o,h-l)},d.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r<n;r++)e+=t[r].calcEstimatedSize();return 0==e?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=e/Math.sqrt(this.nodes.length),this.estimatedSize},d.prototype.updateConnected=function(){var e,t,n=this;if(0==this.nodes.length){this.isConnected=!0;return}var r=new c,i=new Set,a=this.nodes[0];for(a.withChildren().forEach(function(e){r.push(e),i.add(e)});0!==r.length;)for(var o=(e=(a=r.shift()).getEdges()).length,s=0;s<o;s++)null==(t=e[s].getOtherEndInGraph(a,this))||i.has(t)||t.withChildren().forEach(function(e){r.push(e),i.add(e)});if(this.isConnected=!1,i.size>=this.nodes.length){var l=0;i.forEach(function(e){e.owner==n&&l++}),l==this.nodes.length&&(this.isConnected=!0)}},e.exports=d},function(e,t,n){"use strict";var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(null==a||a.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var t,n,a=[],o=(a=a.concat(e.getEdges())).length,s=0;s<o;s++)t=a[s],e.remove(t);var l=[];o=(l=l.concat(e.getNodes())).length;for(var s=0;s<o;s++)n=l[s],e.remove(n);e==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(e);this.graphs.splice(u,1),e.parent=null}else if(e instanceof i){if(null==(t=e))throw"Edge is null!";if(!t.isInterGraph)throw"Not an inter-graph edge!";if(null==t.source||null==t.target)throw"Source and/or target is null!";if(-1==t.source.edges.indexOf(t)||-1==t.target.edges.indexOf(t))throw"Source and/or target doesn't know this edge!";var u=t.source.edges.indexOf(t);if(t.source.edges.splice(u,1),u=t.target.edges.indexOf(t),t.target.edges.splice(u,1),null==t.source.owner||null==t.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==t.source.owner.getGraphManager().edges.indexOf(t))throw"Not in owner graph manager's edge list!";var u=t.source.owner.getGraphManager().edges.indexOf(t);t.source.owner.getGraphManager().edges.splice(u,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<n;r++)e=e.concat(t[r].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){var e=[],t=this.getGraphs();t.length;for(var n=0;n<t.length;n++)e=e.concat(t[n].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,null==e.parent&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,t){if(null==e||null==t)throw"assert failed";if(e==t)return!0;for(var n,r=e.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}for(r=t.getOwner();null!=(n=r.getParent());){if(n==e)return!0;if(null==(r=n.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,t,n,r,i,a=this.getAllEdges(),o=a.length,s=0;s<o;s++){if(t=(e=a[s]).source,n=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=n,t==n){e.lca=t.getOwner();continue}for(r=t.getOwner();null==e.lca;){for(e.targetInLca=n,i=n.getOwner();null==e.lca;){if(i==r){e.lca=i;break}if(i==this.rootGraph)break;if(null!=e.lca)throw"assert failed";e.targetInLca=i.getParent(),i=e.targetInLca.getOwner()}if(r==this.rootGraph)break;null==e.lca&&(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(null==e.lca)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();for(var n=e.getOwner();null!=n;){for(var r=t.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},a.prototype.calcInclusionTreeDepths=function(e,t){null==e&&null==t&&(e=this.rootGraph,t=1);for(var n,r=e.getNodes(),i=r.length,a=0;a<i;a++)(n=r[a]).inclusionTreeDepth=t,null!=n.child&&this.calcInclusionTreeDepths(n.child,t+1)},a.prototype.includesInvalidEdge=function(){for(var e,t=this.edges.length,n=0;n<t;n++)if(e=this.edges[n],this.isOneAncestorOfOther(e.source,e.target))return!0;return!1},e.exports=a},function(e,t,n){"use strict";var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";var r=n(12);function i(){}i.calcSeparationAmount=function(e,t,n,r){if(!e.intersects(t))throw"assert failed";var i=[,,];this.decideDirectionsForOverlappingNodes(e,t,i),n[0]=Math.min(e.getRight(),t.getRight())-Math.max(e.x,t.x),n[1]=Math.min(e.getBottom(),t.getBottom())-Math.max(e.y,t.y),e.getX()<=t.getX()&&e.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]<s?s=n[0]:o=n[1],n[0]=-1*i[0]*(s/2+r),n[1]=-1*i[1]*(o/2+r)},i.decideDirectionsForOverlappingNodes=function(e,t,n){e.getCenterX()<t.getCenterX()?n[0]=-1:n[0]=1,e.getCenterY()<t.getCenterY()?n[1]=-1:n[1]=1},i.getIntersection2=function(e,t,n){var r=e.getCenterX(),i=e.getCenterY(),a=t.getCenterX(),o=t.getCenterY();if(e.intersects(t))return n[0]=r,n[1]=i,n[2]=a,n[3]=o,!0;var s=e.getX(),l=e.getY(),u=e.getRight(),h=e.getX(),c=e.getBottom(),d=e.getRight(),p=e.getWidthHalf(),g=e.getHeightHalf(),f=t.getX(),v=t.getY(),y=t.getRight(),b=t.getX(),x=t.getBottom(),w=t.getRight(),E=t.getWidthHalf(),_=t.getHeightHalf(),T=!1,D=!1;if(r===a)i>o?(n[0]=r,n[1]=l,n[2]=a,n[3]=x):i<o&&(n[0]=r,n[1]=c,n[2]=a,n[3]=v);else if(i===o)r>a?(n[0]=s,n[1]=i,n[2]=y,n[3]=o):r<a&&(n[0]=u,n[1]=i,n[2]=f,n[3]=o);else{var C=e.height/e.width,N=t.height/t.width,A=(o-i)/(a-r),L=void 0,S=void 0,k=void 0,I=void 0,O=void 0,M=void 0;if(-C===A?(r>a?(n[0]=h,n[1]=c):(n[0]=u,n[1]=l),T=!0):C===A&&(r>a?(n[0]=s,n[1]=l):(n[0]=d,n[1]=c),T=!0),-N===A?(a>r?(n[2]=b,n[3]=x):(n[2]=y,n[3]=v),D=!0):N===A&&(a>r?(n[2]=f,n[3]=v):(n[2]=w,n[3]=x),D=!0),T&&D)return!1;if(r>a?i>o?(L=this.getCardinalDirection(C,A,4),S=this.getCardinalDirection(N,A,2)):(L=this.getCardinalDirection(-C,A,3),S=this.getCardinalDirection(-N,A,1)):i>o?(L=this.getCardinalDirection(-C,A,1),S=this.getCardinalDirection(-N,A,3)):(L=this.getCardinalDirection(C,A,2),S=this.getCardinalDirection(N,A,4)),!T)switch(L){case 1:I=l,k=r+-g/A,n[0]=k,n[1]=I;break;case 2:k=d,I=i+p*A,n[0]=k,n[1]=I;break;case 3:I=c,k=r+g/A,n[0]=k,n[1]=I;break;case 4:k=h,I=i+-p*A,n[0]=k,n[1]=I}if(!D)switch(S){case 1:M=v,O=a+-_/A,n[2]=O,n[3]=M;break;case 2:O=w,M=o+E*A,n[2]=O,n[3]=M;break;case 3:M=x,O=a+_/A,n[2]=O,n[3]=M;break;case 4:O=b,M=o+-E*A,n[2]=O,n[3]=M}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,l=t.y,u=n.x,h=n.y,c=i.x,d=i.y,p=void 0,g=void 0,f=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return(p=l-o,f=a-s,y=s*o-a*l,g=d-h,v=u-c,b=c*h-u*d,0==(x=p*v-g*f))?null:new r((f*b-v*y)/x,(g*y-p*b)/x)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n<e?i+=Math.PI:r<t&&(i+=this.TWO_PI)):i=r<t?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(e,t,n,r){var i=e.x,a=e.y,o=t.x,s=t.y,l=n.x,u=n.y,h=r.x,c=r.y,d=(o-i)*(c-u)-(h-l)*(s-a);if(0===d)return!1;var p=((c-u)*(h-i)+(l-h)*(c-a))/d,g=((a-s)*(h-i)+(o-i)*(c-a))/d;return 0<p&&p<1&&0<g&&g<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=0x7fffffff,r.MIN_VALUE=-0x80000000,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){return{value:e,next:null,prev:null}},a=function(e,t,n,r){return null!==e?e.next=t:r.head=t,null!==n?n.prev=t:r.tail=t,t.prev=e,t.next=n,r.length++,t},o=function(e,t){var n=e.prev,r=e.next;return null!==n?n.next=r:t.head=r,null!==r?r.prev=n:t.tail=n,e.prev=e.next=null,t.length--,e};e.exports=function(){function e(t){var n=this;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.length=0,this.head=null,this.tail=null,null!=t&&t.forEach(function(e){return n.push(e)})}return r(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(e,t){return a(t.prev,i(e),t,this)}},{key:"insertAfter",value:function(e,t){return a(t,i(e),t.next,this)}},{key:"insertNodeBefore",value:function(e,t){return a(t.prev,e,t,this)}},{key:"insertNodeAfter",value:function(e,t){return a(t,e,t.next,this)}},{key:"push",value:function(e){return a(this.tail,i(e),null,this)}},{key:"unshift",value:function(e){return a(null,i(e),this.head,this)}},{key:"remove",value:function(e){return o(e,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}}},{key:"set_object_at",value:function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}}}]),e}()},function(e,t,n){"use strict";function r(e,t,n){this.x=null,this.y=null,null==e&&null==t&&null==n?(this.x=0,this.y=0):"number"==typeof e&&"number"==typeof t&&null==n?(this.x=e,this.y=t):"Point"==e.constructor.name&&null==t&&null==n&&(n=e,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(e,t,n){"Point"==e.constructor.name&&null==t&&null==n?(n=e,this.setLocation(n.x,n.y)):"number"==typeof e&&"number"==typeof t&&null==n&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},r.prototype.move=function(e,t){this.x=e,this.y=t},r.prototype.translate=function(e,t){this.x+=e,this.y+=t},r.prototype.equals=function(e){return"Point"==e.constructor.name?this.x==e.x&&this.y==e.y:this==e},r.prototype.toString=function(){return new r().constructor.name+"[x="+this.x+",y="+this.y+"]"},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=e&&null!=t&&null!=n&&null!=r&&(this.x=e,this.y=t,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(e){this.x=e},r.prototype.getY=function(){return this.y},r.prototype.setY=function(e){this.y=e},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(){}i.lastID=0,i.createID=function(e){return i.isPrimitive(e)?e:(null!=e.uniqueID||(e.uniqueID=i.getString(),i.lastID++),e.uniqueID)},i.getString=function(e){return null==e&&(e=i.lastID),"Object#"+e},i.isPrimitive=function(e){var t=void 0===e?"undefined":r(e);return null==e||"object"!=t&&"function"!=t},e.exports=i},function(e,t,n){"use strict";function r(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}var i=n(0),a=n(6),o=n(3),s=n(1),l=n(5),u=n(4),h=n(17),c=n(27);function d(e){c.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=e&&(this.isRemoteUse=e)}d.RANDOM_SEED=1,d.prototype=Object.create(c.prototype),d.prototype.getGraphManager=function(){return this.graphManager},d.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},d.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},d.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},d.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},d.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},d.prototype.newNode=function(e){return new o(this.graphManager,e)},d.prototype.newEdge=function(e){return new s(null,null,e)},d.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},d.prototype.runLayout=function(){var e;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),e=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(e&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},d.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},d.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var e=this.graphManager.getAllEdges(),t=0;t<e.length;t++)e[t];for(var n=this.graphManager.getRoot().getNodes(),t=0;t<n.length;t++)n[t];this.update(this.graphManager.getRoot())}},d.prototype.update=function(e){if(null==e)this.update2();else if(e instanceof o){if(null!=e.getChild())for(var t=e.getChild().getNodes(),n=0;n<t.length;n++)update(t[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else e instanceof s?null!=e.vGraphObject&&e.vGraphObject.update(e):e instanceof l&&null!=e.vGraphObject&&e.vGraphObject.update(e)},d.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},d.prototype.transform=function(e){if(void 0==e)this.transform(new u(0,0));else{var t=new h,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){t.setWorldOrgX(e.x),t.setWorldOrgY(e.y),t.setDeviceOrgX(n.x),t.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i=0;i<r.length;i++)r[i].transform(t)}}},d.prototype.positionNodesRandomly=function(e){if(void 0==e)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var t,n,r=e.getNodes(),i=0;i<r.length;i++)null==(n=(t=r[i]).getChild())||0==n.getNodes().length?t.scatter():(this.positionNodesRandomly(n),t.updateBounds())},d.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)null!=n[a].getChild()&&(i=!1);if(!i)return e;var o=new Set,s=[],l=new Map,u=[];for(u=u.concat(n);u.length>0&&t;){for(s.push(u[0]);s.length>0&&t;){var h=s[0];s.splice(0,1),o.add(h);for(var c=h.getEdges(),a=0;a<c.length;a++){var d=c[a].getOtherEnd(h);if(l.get(h)!=d)if(o.has(d)){t=!1;break}else s.push(d),l.set(d,h)}}if(t){var p=[].concat(r(o));e.push(p);for(var a=0;a<p.length;a++){var g=p[a],f=u.indexOf(g);f>-1&&u.splice(f,1)}o=new Set,l=new Map}else e=[]}return e},d.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i<e.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var o=this.newEdge(null);this.graphManager.add(o,n,a),t.add(a),n=a}var o=this.newEdge(null);return this.graphManager.add(o,n,e.target),this.edgeToDummyNodes.set(e,t),e.isInterGraph()?this.graphManager.remove(e):r.remove(e),t},d.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(r(this.edgeToDummyNodes.keys())).concat(e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var o=i[a],s=new u(o.getCenterX(),o.getCenterY()),l=n.bendpoints.get(a);l.x=s.x,l.y=s.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},d.transform=function(e,t,n,r){if(void 0==n||void 0==r)return e<=50?(i=9*t/500,a=t/10):(i=9*t/50,a=-8*t),i*e+a;var i,a,o=t;return e<=50?o-=(t-t/n)/50*(50-e):o+=(t*r-t)/50*(e-50),o},d.findCenterOfTree=function(e){var t=[];t=t.concat(e);var n=[],r=new Map,i=!1,a=null;(1==t.length||2==t.length)&&(i=!0,a=t[0]);for(var o=0;o<t.length;o++){var s=t[o],l=s.getNeighborsList().size;r.set(s,s.getNeighborsList().size),1==l&&n.push(s)}var u=[];for(u=u.concat(n);!i;){var h=[];h=h.concat(u),u=[];for(var o=0;o<t.length;o++){var s=t[o],c=t.indexOf(s);c>=0&&t.splice(c,1),s.getNeighborsList().forEach(function(e){if(0>n.indexOf(e)){var t=r.get(e)-1;1==t&&u.push(e),r.set(e,t)}})}n=n.concat(u),(1==t.length||2==t.length)&&(i=!0,a=t[0])}return a},d.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=d},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(7),a=n(0),o=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,o,s,l=this.getGraphManager().getAllEdges(),u=0;u<l.length;u++)(e=l[u]).idealLength=this.idealEdgeLength,e.isInterGraph&&(n=e.getSource(),r=e.getTarget(),o=e.getSourceInLca().getEstimatedSize(),s=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=o+s-2*a.SIMPLE_NODE_SIZE),t=e.getLca().getInclusionTreeDepth(),e.idealLength+=i.DEFAULT_EDGE_LENGTH*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*t))},l.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n<t.length;n++)e=t[n],this.calcSpringForce(e,e.idealLength)},l.prototype.calcRepulsionForces=function(){var e,t,n,r,a,o=!(arguments.length>0)||void 0===arguments[0]||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),a=new Set,e=0;e<l.length;e++)n=l[e],this.calculateRepulsionForceOfANode(n,a,o,s),a.add(n);else for(e=0;e<l.length;e++)for(n=l[e],t=e+1;t<l.length;t++)r=l[t],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},l.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},l.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t=0;t<e.length;t++)e[t].move()},l.prototype.calcSpringForce=function(e,t){var n,r,i,a,o=e.getSource(),s=e.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==s.getChild())e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;0!=(n=e.getLength())&&(i=(r=this.springConstant*(n-t))*(e.lengthX/n),a=r*(e.lengthY/n),o.springForceX+=i,o.springForceY+=a,s.springForceX-=i,s.springForceY-=a)},l.prototype.calcRepulsionForce=function(e,t){var n,r,a,l,u,h,c,d=e.getRect(),p=t.getRect(),g=[,,],f=[,,,,];if(d.intersects(p)){o.calcSeparationAmount(d,p,g,i.DEFAULT_EDGE_LENGTH/2),h=2*g[0],c=2*g[1];var v=e.noOfChildren*t.noOfChildren/(e.noOfChildren+t.noOfChildren);e.repulsionForceX-=v*h,e.repulsionForceY-=v*c,t.repulsionForceX+=v*h,t.repulsionForceY+=v*c}else this.uniformLeafNodeSizes&&null==e.getChild()&&null==t.getChild()?(n=p.getCenterX()-d.getCenterX(),r=p.getCenterY()-d.getCenterY()):(o.getIntersection(d,p,f),n=f[2]-f[0],r=f[3]-f[1]),Math.abs(n)<i.MIN_REPULSION_DIST&&(n=s.sign(n)*i.MIN_REPULSION_DIST),Math.abs(r)<i.MIN_REPULSION_DIST&&(r=s.sign(r)*i.MIN_REPULSION_DIST),l=Math.sqrt(a=n*n+r*r),h=(u=this.repulsionConstant*e.noOfChildren*t.noOfChildren/a)*n/l,c=u*r/l,e.repulsionForceX-=h,e.repulsionForceY-=c,t.repulsionForceX+=h,t.repulsionForceY+=c},l.prototype.calcGravitationalForce=function(e){var t,n,r,i,a,o,s,l;n=((t=e.getOwner()).getRight()+t.getLeft())/2,r=(t.getTop()+t.getBottom())/2,i=e.getCenterX()-n,a=e.getCenterY()-r,o=Math.abs(i)+e.getWidth()/2,s=Math.abs(a)+e.getHeight()/2,e.getOwner()==this.graphManager.getRoot()?(o>(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a):(o>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=2>Math.abs(this.totalDisplacement-this.oldTotalDisplacement)),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||t},l.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},l.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)(e=t[n]).noOfChildren=e.getNoOfChildren()},l.prototype.calcGrid=function(e){var t=0,n=0;t=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var r=Array(t),i=0;i<t;i++)r[i]=Array(n);for(var i=0;i<t;i++)for(var a=0;a<n;a++)r[i][a]=[];return r},l.prototype.addNodeToGrid=function(e,t,n){var r=0,i=0,a=0,o=0;r=parseInt(Math.floor((e.getRect().x-t)/this.repulsionRange)),i=parseInt(Math.floor((e.getRect().width+e.getRect().x-t)/this.repulsionRange)),a=parseInt(Math.floor((e.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().height+e.getRect().y-n)/this.repulsionRange));for(var s=r;s<=i;s++)for(var l=a;l<=o;l++)this.grid[s][l].push(e),e.setGridCoordinates(r,i,a,o)},l.prototype.updateGrid=function(){var e,t,n=this.getAllNodes();for(e=0,this.grid=this.calcGrid(this.graphManager.getRoot());e<n.length;e++)t=n[e],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},l.prototype.calculateRepulsionForceOfANode=function(e,t,n,r){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var a,o=new Set;e.surrounding=[];for(var s=this.grid,l=e.startX-1;l<e.finishX+2;l++)for(var u=e.startY-1;u<e.finishY+2;u++)if(!(l<0||u<0||l>=s.length||u>=s[0].length)){for(var h=0;h<s[l][u].length;h++)if(a=s[l][u][h],e.getOwner()==a.getOwner()&&e!=a&&!t.has(a)&&!o.has(a)){var c=Math.abs(e.getCenterX()-a.getCenterX())-(e.getWidth()/2+a.getWidth()/2),d=Math.abs(e.getCenterY()-a.getCenterY())-(e.getHeight()/2+a.getHeight()/2);c<=this.repulsionRange&&d<=this.repulsionRange&&o.add(a)}}e.surrounding=[].concat(function(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}(o))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},l.prototype.calcRepulsionRange=function(){return 0},e.exports=l},function(e,t,n){"use strict";var r=n(1),i=n(7);function a(e,t,n){r.call(this,e,t,n),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];e.exports=a},function(e,t,n){"use strict";var r=n(3);function i(e,t,n,i){r.call(this,e,t,n,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];i.prototype.setGridCoordinates=function(e,t,n,r){this.startX=e,this.finishX=t,this.startY=n,this.finishY=r},e.exports=i},function(e,t,n){"use strict";function r(e,t){this.width=0,this.height=0,null!==e&&null!==t&&(this.height=t,this.width=e)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},e.exports=r},function(e,t,n){"use strict";var r=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(e,t){var n=r.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},i.prototype.contains=function(e){return r.createID(e),null!=this.map[e]},i.prototype.get=function(e){var t=r.createID(e);return this.map[t]},i.prototype.keySet=function(){return this.keys},e.exports=i},function(e,t,n){"use strict";var r=n(14);function i(){this.set={}}i.prototype.add=function(e){var t=r.createID(e);this.contains(t)||(this.set[t]=e)},i.prototype.remove=function(e){delete this.set[r.createID(e)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(e){return this.set[r.createID(e)]==e},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(e){for(var t=Object.keys(this.set),n=t.length,r=0;r<n;r++)e.push(this.set[t[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=i},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(11);e.exports=function(){function e(t,n){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");(null!==n||void 0!==n)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof i?t.size():t.length,this._quicksort(t,0,r-1)}return r(e,[{key:"_quicksort",value:function(e,t,n){if(t<n){var r=this._partition(e,t,n);this._quicksort(e,t,r),this._quicksort(e,r+1,n)}}},{key:"_partition",value:function(e,t,n){for(var r=this._get(e,t),i=t,a=n;;){for(;this.compareFunction(r,this._get(e,a));)a--;for(;this.compareFunction(this._get(e,i),r);)i++;if(!(i<a))return a;this._swap(e,i,a),i++,a--}}},{key:"_get",value:function(e,t){return e instanceof i?e.get_object_at(t):e[t]}},{key:"_set",value:function(e,t,n){e instanceof i?e.set_object_at(t,n):e[t]=n}},{key:"_swap",value:function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)}},{key:"_defaultCompareFunction",value:function(e,t){return t>e}}]),e}()},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();e.exports=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=a,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=Array(this.jMax);for(var s=0;s<this.jMax;s++)this.grid[o][s]=0}this.tracebackGrid=Array(this.iMax);for(var l=0;l<this.iMax;l++){this.tracebackGrid[l]=Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[l][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[n][r]=i[a[0]],this.tracebackGrid[n][r]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var t=e[0],n=this.tracebackGrid[t.pos[0]][t.pos[1]];n[0]&&e.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),n[1]&&e.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),n[2]&&e.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),0===t.pos[0]&&0===t.pos[1]&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),e.shift()}return this.alignments}},{key:"getAllIndexes",value:function(e,t){for(var n=[],r=-1;-1!==(r=e.indexOf(t,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),e}()},function(e,t,n){"use strict";var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(7),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(4),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(24),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(5),r.LEdge=n(1),r.LGraphManager=n(6),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(25),e.exports=r},function(e,t,n){"use strict";function r(){this.listeners=[]}var i=r.prototype;i.addListener=function(e,t){this.listeners.push({event:e,callback:t})},i.removeListener=function(e,t){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];e===r.event&&r.callback(t)}},e.exports=r}],t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}()},98055(e,t,n){let r;n.d(t,{diagram:()=>P});var i=n(57274),a=n(59804),o=n(93409),s=n.n(o),l=n(43457),u=n.n(l),h=n(54682),c=n(78041),d=n(75263);n(74353),n(16750),n(38777),n(43222),n(697),n(80676),n(76916),n(68313),n(90445),n(97375);var p=function(){var e=function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],h=[1,24],c=[1,25],d=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],f=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:function(){},yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace("Icon: ",a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace("SPACELIST");break;case 19:r.getLogger().trace("Node: ",a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace("node found ..",a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace("node found ..",a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:n,9:22,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:u,7:h,10:23,11:c},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:s}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:c},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(p,[2,14],{7:g,11:f}),e(v,[2,8]),e(v,[2,9]),e(v,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(p,[2,13],{7:g,11:f}),e(v,[2,11]),e(v,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},parse:function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",l=0,u=0,h=a.slice.call(arguments,1),c=Object.create(this.lexer),d={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d[p]=this.yy[p]);c.setInput(e,d),d.lexer=c,d.parser=this,void 0===c.yylloc&&(c.yylloc={});var g=c.yylloc;a.push(g);var f=c.options&&c.options.ranges;"function"==typeof d.parseError?this.parseError=d.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,y,b,x,w,E,_,T,D={};;){if(y=n[n.length-1],this.defaultActions[y]?b=this.defaultActions[y]:(null==v&&(v=function(){var e;return"number"!=typeof(e=r.pop()||c.lex()||1)&&(e instanceof Array&&(e=(r=e).pop()),e=t.symbols_[e]||e),e}()),b=o[y]&&o[y][v]),void 0===b||!b.length||!b[0]){var C="";for(w in T=[],o[y])this.terminals_[w]&&w>2&&T.push("'"+this.terminals_[w]+"'");C=c.showPosition?"Parse error on line "+(l+1)+":\n"+c.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(C,{text:c.match,token:this.terminals_[v]||v,line:c.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw Error("Parse Error: multiple actions possible at state: "+y+", token: "+v);switch(b[0]){case 1:n.push(v),i.push(c.yytext),a.push(c.yylloc),n.push(b[1]),v=null,u=c.yyleng,s=c.yytext,l=c.yylineno,g=c.yylloc;break;case 2:if(E=this.productions_[b[1]][1],D.$=i[i.length-E],D._$={first_line:a[a.length-(E||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(E||1)].first_column,last_column:a[a.length-1].last_column},f&&(D._$.range=[a[a.length-(E||1)].range[0],a[a.length-1].range[1]]),void 0!==(x=this.performAction.apply(D,[s,u,l,d,b[1],i,a].concat(h))))return x;E&&(n=n.slice(0,-1*E*2),i=i.slice(0,-1*E),a=a.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),i.push(D.$),a.push(D._$),_=o[n[n.length-2]][n[n.length-1]],n.push(_);break;case 3:return!0}}return!0}};function b(){this.yy={}}return y.lexer={EOF:1,parseError:function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack)for(var a in i)this[a]=i[a];return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,n,r,i=this._currentRules(),a=0;a<i.length;a++)if((n=this._input.match(this.rules[i[a]]))&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,i[a])))return e;if(!this._backtrack)return!1;t=!1;continue}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[r]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,n,r){switch(n){case 0:e.getLogger().trace("Found comment",t.yytext);break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:this.popState();break;case 5:e.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return e.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace("end icon"),this.popState();break;case 10:return e.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return e.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return e.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return e.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16:case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:e.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 22:return e.getLogger().trace("description:",t.yytext),"NODE_DESCR";case 24:return this.popState(),e.getLogger().trace("node end ))"),"NODE_DEND";case 25:return this.popState(),e.getLogger().trace("node end )"),"NODE_DEND";case 26:return this.popState(),e.getLogger().trace("node end ...",t.yytext),"NODE_DEND";case 27:case 30:case 31:return this.popState(),e.getLogger().trace("node end (("),"NODE_DEND";case 28:case 29:return this.popState(),e.getLogger().trace("node end (-"),"NODE_DEND";case 32:case 33:return e.getLogger().trace("Long description:",t.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\-\)\{\}]+)/i,/^(?:$)/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR:{rules:[22,23],inclusive:!1},NODE:{rules:[21,24,25,26,27,28,29,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}},b.prototype=y,y.Parser=b,new b}();p.parser=p;let g=e=>(0,i.n)(e,(0,i.g)()),f=[],v=0,y={},b=function(e){for(let t=f.length-1;t>=0;t--)if(f[t].level<e)return f[t];return null},x={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w=(e,t)=>{y[e]=t},E=e=>{switch(e){case x.DEFAULT:return"no-border";case x.RECT:return"rect";case x.ROUNDED_RECT:return"rounded-rect";case x.CIRCLE:return"circle";case x.CLOUD:return"cloud";case x.BANG:return"bang";case x.HEXAGON:return"hexgon";default:return"no-border"}},_=e=>y[e],T=Object.freeze(Object.defineProperty({__proto__:null,addNode:(e,t,n,r)=>{i.l.info("addNode",e,t,n,r);let a=(0,i.g)(),o={id:v++,nodeId:g(t),level:e,descr:g(n),type:r,children:[],width:(0,i.g)().mindmap.maxNodeWidth};switch(o.type){case x.ROUNDED_RECT:case x.RECT:case x.HEXAGON:o.padding=2*a.mindmap.padding;break;default:o.padding=a.mindmap.padding}let s=b(e);if(s)s.children.push(o),f.push(o);else if(0===f.length)f.push(o);else{let e=Error('There can be only one root. No parent could be found for ("'+o.descr+'")');throw e.hash={text:"branch "+name,token:"branch "+name,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+name+'"']},e}},clear:()=>{f=[],v=0,y={}},decorateNode:e=>{let t=f[f.length-1];e&&e.icon&&(t.icon=g(e.icon)),e&&e.class&&(t.class=g(e.class))},getElementById:_,getLogger:()=>i.l,getMindmap:()=>f.length>0?f[0]:null,getNodeById:e=>f[e],getType:(e,t)=>{switch(i.l.debug("In get type",e,t),e){case"[":return x.RECT;case"(":return")"===t?x.ROUNDED_RECT:x.CLOUD;case"((":return x.CIRCLE;case")":return x.CLOUD;case"))":return x.BANG;case"{{":return x.HEXAGON;default:return x.DEFAULT}},nodeType:x,get parseError(){return r},sanitizeText:g,setElementForId:w,setErrorHandler:e=>{r=e},type2Str:E},Symbol.toStringTag,{value:"Module"}));function D(e,t){e.each(function(){var e,n=(0,a.Ltv)(this),r=n.text().split(/(\s+|<br>)/).reverse(),i=[],o=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em");for(let a=0;a<r.length;a++)e=r[r.length-1-a],i.push(e),l.text(i.join(" ").trim()),(l.node().getComputedTextLength()>t||"<br>"===e)&&(i.pop(),l.text(i.join(" ").trim()),i="<br>"===e?[""]:[e],l=n.append("tspan").attr("x",0).attr("y",o).attr("dy","1.1em").text(e))})}let C=function(e,t,n){e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},N=function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("height",t.height).attr("width",t.width)},A=function(e,t){let n=t.width,r=t.height,i=.15*n,a=.25*n,o=.35*n,s=.2*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${.25*n},${-1*n*.1}
|
|
3
|
+
a${o},${o} 1 0,1 ${.4*n},${-1*n*.1}
|
|
4
|
+
a${a},${a} 1 0,1 ${.35*n},${.2*n}
|
|
5
|
+
|
|
6
|
+
a${i},${i} 1 0,1 ${.15*n},${.35*r}
|
|
7
|
+
a${s},${s} 1 0,1 ${-1*n*.15},${.65*r}
|
|
8
|
+
|
|
9
|
+
a${a},${i} 1 0,1 ${-1*n*.25},${.15*n}
|
|
10
|
+
a${o},${o} 1 0,1 ${-1*n*.5},0
|
|
11
|
+
a${i},${i} 1 0,1 ${-1*n*.25},${-1*n*.15}
|
|
12
|
+
|
|
13
|
+
a${i},${i} 1 0,1 ${-1*n*.1},${-1*r*.35}
|
|
14
|
+
a${s},${s} 1 0,1 ${.1*n},${-1*r*.65}
|
|
15
|
+
|
|
16
|
+
H0 V0 Z`)},L=function(e,t){let n=t.width,r=t.height,i=.15*n;e.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${.25*n},${-1*r*.1}
|
|
17
|
+
a${i},${i} 1 0,0 ${.25*n},0
|
|
18
|
+
a${i},${i} 1 0,0 ${.25*n},0
|
|
19
|
+
a${i},${i} 1 0,0 ${.25*n},${.1*r}
|
|
20
|
+
|
|
21
|
+
a${i},${i} 1 0,0 ${.15*n},${.33*r}
|
|
22
|
+
a${.8*i},${.8*i} 1 0,0 0,${.34*r}
|
|
23
|
+
a${i},${i} 1 0,0 ${-1*n*.15},${.33*r}
|
|
24
|
+
|
|
25
|
+
a${i},${i} 1 0,0 ${-1*n*.25},${.15*r}
|
|
26
|
+
a${i},${i} 1 0,0 ${-1*n*.25},0
|
|
27
|
+
a${i},${i} 1 0,0 ${-1*n*.25},0
|
|
28
|
+
a${i},${i} 1 0,0 ${-1*n*.25},${-1*r*.15}
|
|
29
|
+
|
|
30
|
+
a${i},${i} 1 0,0 ${-1*n*.1},${-1*r*.33}
|
|
31
|
+
a${.8*i},${.8*i} 1 0,0 0,${-1*r*.34}
|
|
32
|
+
a${i},${i} 1 0,0 ${.1*n},${-1*r*.33}
|
|
33
|
+
|
|
34
|
+
H0 V0 Z`)},S=function(e,t){e.append("circle").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("r",t.width/2)},k=function(e,t){let n=t.height,r=n/4,i=t.width-t.padding+2*r;e.insert("polygon",":first-child").attr("points",[{x:r,y:0},{x:i-r,y:0},{x:i,y:-n/2},{x:i-r,y:-n},{x:r,y:-n},{x:0,y:-n/2}].map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+(t.width-i)/2+", "+n+")")},I=function(e,t){e.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+E(t.type)).attr("height",t.height).attr("rx",t.padding).attr("ry",t.padding).attr("width",t.width)},O=function(e,t,n,r){let i=n%11,a=e.append("g");t.section=i;let o="section-"+i;i<0&&(o+=" section-root"),a.attr("class",(t.class?t.class+" ":"")+"mindmap-node "+o);let s=a.append("g"),l=a.append("g"),u=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(D,t.width).node().getBBox(),h=r.fontSize.replace?r.fontSize.replace("px",""):r.fontSize;if(t.height=u.height+1.1*h*.5+t.padding,t.width=u.width+2*t.padding,t.icon)if(t.type===x.CIRCLE)t.height+=50,t.width+=50,a.append("foreignObject").attr("height","50px").attr("width",t.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+t.width/2+", "+(t.height/2-1.5*t.padding)+")");else{t.width+=50;let e=t.height;t.height=Math.max(e,60);let n=Math.abs(t.height-e);a.append("foreignObject").attr("width","60px").attr("height",t.height).attr("style","text-align: center;margin-top:"+n/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+t.icon),l.attr("transform","translate("+(25+t.width/2)+", "+(n/2+t.padding/2)+")")}else l.attr("transform","translate("+t.width/2+", "+t.padding/2+")");switch(t.type){case x.DEFAULT:C(s,t,i);break;case x.ROUNDED_RECT:I(s,t);break;case x.RECT:N(s,t);break;case x.CIRCLE:s.attr("transform","translate("+t.width/2+", "+t.height/2+")"),S(s,t);break;case x.CLOUD:A(s,t);break;case x.BANG:L(s,t);break;case x.HEXAGON:k(s,t)}return w(t.id,a),t.height},M=function(e){let t=_(e.id),n=e.x||0,r=e.y||0;t.attr("transform","translate("+n+","+r+")")};s().use(u());let P={db:T,renderer:{draw:async(e,t,n,r)=>{let o,l=(0,i.g)();r.db.clear(),r.parser.parse(e),i.l.debug("Renering info diagram\n"+e);let u=(0,i.g)().securityLevel;"sandbox"===u&&(o=(0,a.Ltv)("#i"+t));let h=("sandbox"===u?(0,a.Ltv)(o.nodes()[0].contentDocument.body):(0,a.Ltv)("body")).select("#"+t);h.append("g");let c=r.db.getMindmap(),d=h.append("g");d.attr("class","mindmap-edges");let p=h.append("g");p.attr("class","mindmap-nodes"),function e(t,n,r,i){O(t,n,r,i),n.children&&n.children.forEach((n,a)=>{e(t,n,r<0?a:r,i)})}(p,c,-1,l);let g=await new Promise(e=>{let t=(0,a.Ltv)("body").append("div").attr("id","cy").attr("style","display:none"),n=s()({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});t.remove(),function e(t,n,r,i){n.add({group:"nodes",data:{id:t.id,labelText:t.descr,height:t.height,width:t.width,level:i,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach(a=>{e(a,n,r,i+1),n.add({group:"edges",data:{id:`${t.id}_${a.id}`,source:t.id,target:a.id,depth:i,section:a.section}})})}(c,n,l,0),n.nodes().forEach(function(e){e.layoutDimensions=()=>{let t=e.data();return{w:t.width,h:t.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(t=>{i.l.info("Ready",t),e(n)})});g.edges().map((e,t)=>{let n=e.data();if(e[0]._private.bodyBounds){let r=e[0]._private.rscratch;i.l.trace("Edge: ",t,n),d.insert("path").attr("d",`M ${r.startX},${r.startY} L ${r.midX},${r.midY} L${r.endX},${r.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}}),g.nodes().map((e,t)=>{let n=e.data();n.x=e.position().x,n.y=e.position().y,M(n);let r=_(n.nodeId);i.l.info("Id:",t,"Position: (",e.position().x,", ",e.position().y,")",n),r.attr("transform",`translate(${e.position().x-n.width/2}, ${e.position().y-n.height/2})`),r.attr("attr",`apa-${t})`)}),(0,i.s)(void 0,h,l.mindmap.padding,l.mindmap.useMaxWidth)}},parser:p,styles:e=>`
|
|
35
|
+
.edge {
|
|
36
|
+
stroke-width: 3;
|
|
37
|
+
}
|
|
38
|
+
${(e=>{let t="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],(0,h.A)(e["lineColor"+t])?e["lineColor"+t]=(0,c.A)(e["lineColor"+t],20):e["lineColor"+t]=(0,d.A)(e["lineColor"+t],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let r=""+(17-3*n);t+=`
|
|
39
|
+
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
|
|
40
|
+
fill: ${e["cScale"+n]};
|
|
41
|
+
}
|
|
42
|
+
.section-${n-1} text {
|
|
43
|
+
fill: ${e["cScaleLabel"+n]};
|
|
44
|
+
}
|
|
45
|
+
.node-icon-${n-1} {
|
|
46
|
+
font-size: 40px;
|
|
47
|
+
color: ${e["cScaleLabel"+n]};
|
|
48
|
+
}
|
|
49
|
+
.section-edge-${n-1}{
|
|
50
|
+
stroke: ${e["cScale"+n]};
|
|
51
|
+
}
|
|
52
|
+
.edge-depth-${n-1}{
|
|
53
|
+
stroke-width: ${r};
|
|
54
|
+
}
|
|
55
|
+
.section-${n-1} line {
|
|
56
|
+
stroke: ${e["cScaleInv"+n]} ;
|
|
57
|
+
stroke-width: 3;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.disabled, .disabled circle, .disabled text {
|
|
61
|
+
fill: lightgray;
|
|
62
|
+
}
|
|
63
|
+
.disabled text {
|
|
64
|
+
fill: #efefef;
|
|
65
|
+
}
|
|
66
|
+
`}return t})(e)}
|
|
67
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
68
|
+
fill: ${e.git0};
|
|
69
|
+
}
|
|
70
|
+
.section-root text {
|
|
71
|
+
fill: ${e.gitBranchLabel0};
|
|
72
|
+
}
|
|
73
|
+
.icon-container {
|
|
74
|
+
height:100%;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
79
|
+
.edge {
|
|
80
|
+
fill: none;
|
|
81
|
+
}
|
|
82
|
+
`}},54682(e,t,n){n.d(t,{A:()=>a});var r=n(91553),i=n(16408);let a=e=>!((e=>{let{r:t,g:n,b:a}=i.A.parse(e),o=.2126*r.A.channel.toLinear(t)+.7152*r.A.channel.toLinear(n)+.0722*r.A.channel.toLinear(a);return r.A.lang.round(o)})(e)>=.5)}};
|