@qy_better_lib/hooks 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@qy_better_lib/hooks.min.js +2 -263
- package/lib/index.js +41 -0
- package/lib/use-chart/default.js +11 -0
- package/lib/use-emit/extend.js +21 -0
- package/lib/use-emit/index.js +21 -0
- package/lib/use-file/index.js +26 -0
- package/lib/use-image/canvastoDataURL.js +7 -0
- package/lib/use-image/canvastoFile.js +9 -0
- package/lib/use-image/dataURLtoFile.js +16 -0
- package/lib/use-image/dataURLtoImage.js +9 -0
- package/lib/use-image/downloadFile.js +9 -0
- package/lib/use-image/filetoDataURL.js +9 -0
- package/lib/use-image/imagetoCanvas.js +41 -0
- package/lib/use-image/index.js +72 -0
- package/lib/use-image/type.js +8 -0
- package/lib/use-image/urltoBlob.js +6 -0
- package/lib/use-image/urltoImage.js +13 -0
- package/lib/use-layout-flow/index.js +120 -0
- package/lib/use-print/index.js +67 -0
- package/lib/use-utils/use-fullscreen.js +24 -0
- package/lib/use-waterMark/index.js +29 -0
- package/lib/use-websocket/index.js +54 -0
- package/package.json +2 -10
- package/lib/_virtual/_cloneBuffer.js +0 -4
- package/lib/_virtual/_commonjs-dynamic-modules.js +0 -6
- package/lib/_virtual/_commonjsHelpers.js +0 -8
- package/lib/_virtual/_nodeUtil.js +0 -4
- package/lib/_virtual/index.js +0 -7
- package/lib/_virtual/isBuffer.js +0 -4
- package/lib/packages/hooks/node_modules/@antv/x6/es/config/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/background.js +0 -134
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/base.js +0 -37
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/coord.js +0 -108
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/css.js +0 -41
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/defs.js +0 -115
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/graph.js +0 -628
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/grid.js +0 -143
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/highlight.js +0 -111
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/mousewheel.js +0 -80
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/options.js +0 -150
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/panning.js +0 -120
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/size.js +0 -62
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/transform.js +0 -255
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/view.js +0 -404
- package/lib/packages/hooks/node_modules/@antv/x6/es/graph/virtual-render.js +0 -60
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/animation.js +0 -81
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/cell.js +0 -764
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/collection.js +0 -163
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/edge.js +0 -511
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/model.js +0 -640
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/node.js +0 -490
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/port.js +0 -151
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/registry.js +0 -19
- package/lib/packages/hooks/node_modules/@antv/x6/es/model/store.js +0 -159
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/align.js +0 -49
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/connection.js +0 -56
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/fill.js +0 -28
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/filter.js +0 -28
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/html.js +0 -8
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/index.js +0 -37
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/main.js +0 -66
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/marker.js +0 -82
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/port.js +0 -8
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/raw.js +0 -20
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/ref.js +0 -167
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/stroke.js +0 -33
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/style.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/text.js +0 -105
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/attr/title.js +0 -41
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/flip-x.js +0 -9
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/flip-xy.js +0 -9
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/flip-y.js +0 -9
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/index.js +0 -14
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/main.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/background/watermark.js +0 -21
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/anchor.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/bbox.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/boundary.js +0 -66
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/main.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/rect.js +0 -33
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-point/util.js +0 -50
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-strategy/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-strategy/main.js +0 -7
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-strategy/noop.js +0 -4
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connection-strategy/pin.js +0 -54
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/jumpover.js +0 -117
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/loop.js +0 -25
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/main.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/normal.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/rounded.js +0 -25
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/connector/smooth.js +0 -26
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/closest.js +0 -18
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/length.js +0 -7
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/main.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/orth.js +0 -41
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/edge-anchor/ratio.js +0 -7
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/blur.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/brightness.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/contrast.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/drop-shadow.js +0 -22
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/gray-scale.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/highlight.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/hue-rotate.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/invert.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/main.js +0 -24
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/outline.js +0 -20
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/saturate.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/sepia.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/filter/util.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/dot.js +0 -37
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/double-mesh.js +0 -53
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/fixed-dot.js +0 -37
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/index.js +0 -51
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/main.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/grid/mesh.js +0 -36
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/highlighter/class.js +0 -33
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/highlighter/index.js +0 -20
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/highlighter/main.js +0 -8
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/highlighter/opacity.js +0 -31
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/highlighter/stroke.js +0 -102
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/async.js +0 -32
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/circle.js +0 -36
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/classic.js +0 -63
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/cross.js +0 -26
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/diamond.js +0 -26
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/ellipse.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/index.js +0 -15
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/main.js +0 -18
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/path.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/marker/util.js +0 -22
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/bbox.js +0 -39
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/main.js +0 -18
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/middle-side.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/node-center.js +0 -7
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/orth.js +0 -25
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/node-anchor/util.js +0 -54
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/inout.js +0 -46
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/main.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/radial.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/side.js +0 -21
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-label-layout/util.js +0 -36
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/absolute.js +0 -5
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/ellipse.js +0 -28
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/line.js +0 -37
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/main.js +0 -13
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/port-layout/util.js +0 -38
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/registry.js +0 -80
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/er.js +0 -33
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/index.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/loop.js +0 -63
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/main.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/index.js +0 -27
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/obstacle-map.js +0 -74
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/options.js +0 -106
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/router.js +0 -115
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/sorted-set.js +0 -46
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/manhattan/util.js +0 -127
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/metro.js +0 -65
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/normal.js +0 -6
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/oneside.js +0 -42
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/orth.js +0 -134
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/router/util.js +0 -60
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/anchor.js +0 -207
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/arrowhead.js +0 -138
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/boundary.js +0 -81
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/button.js +0 -124
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/editor.js +0 -218
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/index.js +0 -70
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/segments.js +0 -241
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/util.js +0 -30
- package/lib/packages/hooks/node_modules/@antv/x6/es/registry/tool/vertices.js +0 -248
- package/lib/packages/hooks/node_modules/@antv/x6/es/renderer/queueJob.js +0 -69
- package/lib/packages/hooks/node_modules/@antv/x6/es/renderer/renderer.js +0 -96
- package/lib/packages/hooks/node_modules/@antv/x6/es/renderer/scheduler.js +0 -287
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/base.js +0 -74
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/circle.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/edge.js +0 -43
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/ellipse.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/html.js +0 -128
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/image.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/path.js +0 -63
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/poly.js +0 -72
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/polygon.js +0 -3
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/polyline.js +0 -3
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/rect.js +0 -9
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/text-block.js +0 -122
- package/lib/packages/hooks/node_modules/@antv/x6/es/shape/util.js +0 -72
- package/lib/packages/hooks/node_modules/@antv/x6/es/style/raw.js +0 -163
- package/lib/packages/hooks/node_modules/@antv/x6/es/util/index.js +0 -231
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/attr.js +0 -209
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/cache.js +0 -56
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/cell.js +0 -434
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/edge.js +0 -1074
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/flag.js +0 -45
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/markup.js +0 -231
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/node.js +0 -609
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/tool.js +0 -239
- package/lib/packages/hooks/node_modules/@antv/x6/es/view/view.js +0 -261
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/algorithm/dijkstra.js +0 -26
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/algorithm/priorityqueue.js +0 -85
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/animation/interp.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/animation/timing.js +0 -206
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/color/index.js +0 -342
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/common/basecoat.js +0 -24
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/common/disposable.js +0 -92
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/css-loader/loader.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/datauri/index.js +0 -98
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dictionary/dictionary.js +0 -35
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/attr.js +0 -94
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/class.js +0 -55
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/css.js +0 -49
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/data.js +0 -34
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/elem.js +0 -140
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/core.js +0 -148
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/hook.js +0 -19
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/main.js +0 -60
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/object.js +0 -90
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/special.js +0 -33
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/store.js +0 -19
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/event/util.js +0 -111
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/matrix.js +0 -145
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/mousewheel.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/path.js +0 -219
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/prefix.js +0 -24
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/style.js +0 -8
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/text.js +0 -209
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/dom/transform.js +0 -82
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/event/events.js +0 -48
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/event/util.js +0 -13
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/function/async.js +0 -21
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/function/function.js +0 -29
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/modifier/index.js +0 -31
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/number/number.js +0 -27
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/object/inherit.js +0 -28
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/object/mixins.js +0 -10
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/object/object.js +0 -42
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/platform/index.js +0 -52
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/polyfill/index.js +0 -17
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/size-sensor/index.js +0 -22
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/size-sensor/sensors/index.js +0 -6
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/size-sensor/sensors/object.js +0 -32
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/size-sensor/sensors/observer.js +0 -28
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/size-sensor/sensors/util.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/string/format.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/string/hashcode.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/string/suggestion.js +0 -58
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/string/uuid.js +0 -12
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/text/annotate.js +0 -21
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/text/sanitize.js +0 -6
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/unit/index.js +0 -43
- package/lib/packages/hooks/node_modules/@antv/x6-common/es/vector/index.js +0 -260
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/angle.js +0 -16
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/curve.js +0 -341
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/ellipse.js +0 -135
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/geometry.js +0 -11
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/line.js +0 -286
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/close.js +0 -101
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/curveto.js +0 -118
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/lineto.js +0 -105
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/moveto.js +0 -124
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/normalize.js +0 -191
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/path.js +0 -570
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/segment.js +0 -44
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/path/util.js +0 -80
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/point.js +0 -319
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/polyline.js +0 -273
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/rectangle.js +0 -361
- package/lib/packages/hooks/node_modules/@antv/x6-geometry/es/util.js +0 -36
- package/lib/packages/hooks/node_modules/dagre/index.js +0 -21
- package/lib/packages/hooks/node_modules/dagre/lib/acyclic.js +0 -47
- package/lib/packages/hooks/node_modules/dagre/lib/add-border-segments.js +0 -28
- package/lib/packages/hooks/node_modules/dagre/lib/coordinate-system.js +0 -57
- package/lib/packages/hooks/node_modules/dagre/lib/data/list.js +0 -32
- package/lib/packages/hooks/node_modules/dagre/lib/debug.js +0 -29
- package/lib/packages/hooks/node_modules/dagre/lib/graphlib.js +0 -17
- package/lib/packages/hooks/node_modules/dagre/lib/greedy-fas.js +0 -67
- package/lib/packages/hooks/node_modules/dagre/lib/layout.js +0 -267
- package/lib/packages/hooks/node_modules/dagre/lib/lodash.js +0 -69
- package/lib/packages/hooks/node_modules/dagre/lib/nesting-graph.js +0 -71
- package/lib/packages/hooks/node_modules/dagre/lib/normalize.js +0 -44
- package/lib/packages/hooks/node_modules/dagre/lib/order/add-subgraph-constraints.js +0 -24
- package/lib/packages/hooks/node_modules/dagre/lib/order/barycenter.js +0 -32
- package/lib/packages/hooks/node_modules/dagre/lib/order/build-layer-graph.js +0 -32
- package/lib/packages/hooks/node_modules/dagre/lib/order/cross-count.js +0 -41
- package/lib/packages/hooks/node_modules/dagre/lib/order/index.js +0 -50
- package/lib/packages/hooks/node_modules/dagre/lib/order/init-order.js +0 -32
- package/lib/packages/hooks/node_modules/dagre/lib/order/resolve-conflicts.js +0 -61
- package/lib/packages/hooks/node_modules/dagre/lib/order/sort-subgraph.js +0 -46
- package/lib/packages/hooks/node_modules/dagre/lib/order/sort.js +0 -35
- package/lib/packages/hooks/node_modules/dagre/lib/parent-dummy-chains.js +0 -48
- package/lib/packages/hooks/node_modules/dagre/lib/position/bk.js +0 -225
- package/lib/packages/hooks/node_modules/dagre/lib/position/index.js +0 -30
- package/lib/packages/hooks/node_modules/dagre/lib/rank/feasible-tree.js +0 -41
- package/lib/packages/hooks/node_modules/dagre/lib/rank/index.js +0 -36
- package/lib/packages/hooks/node_modules/dagre/lib/rank/network-simplex.js +0 -91
- package/lib/packages/hooks/node_modules/dagre/lib/rank/util.js +0 -34
- package/lib/packages/hooks/node_modules/dagre/lib/util.js +0 -144
- package/lib/packages/hooks/node_modules/dagre/lib/version.js +0 -7
- package/lib/packages/hooks/node_modules/graphlib/index.js +0 -18
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/components.js +0 -21
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/dfs.js +0 -26
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/dijkstra-all.js +0 -18
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/dijkstra.js +0 -38
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/find-cycles.js +0 -18
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/floyd-warshall.js +0 -42
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/index.js +0 -30
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/is-acyclic.js +0 -22
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/postorder.js +0 -15
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/preorder.js +0 -15
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/prim.js +0 -40
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/tarjan.js +0 -34
- package/lib/packages/hooks/node_modules/graphlib/lib/alg/topsort.js +0 -25
- package/lib/packages/hooks/node_modules/graphlib/lib/data/priority-queue.js +0 -56
- package/lib/packages/hooks/node_modules/graphlib/lib/graph.js +0 -210
- package/lib/packages/hooks/node_modules/graphlib/lib/index.js +0 -12
- package/lib/packages/hooks/node_modules/graphlib/lib/json.js +0 -48
- package/lib/packages/hooks/node_modules/graphlib/lib/lodash.js +0 -49
- package/lib/packages/hooks/node_modules/graphlib/lib/version.js +0 -7
- package/lib/packages/hooks/node_modules/lodash/_DataView.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_Hash.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_ListCache.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_Map.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_MapCache.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_Promise.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_Set.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_SetCache.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_Stack.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_Symbol.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_Uint8Array.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_WeakMap.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_apply.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_arrayEach.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_arrayFilter.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_arrayIncludes.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_arrayIncludesWith.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_arrayLikeKeys.js +0 -26
- package/lib/packages/hooks/node_modules/lodash/_arrayMap.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_arrayPush.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_arrayReduce.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_arraySome.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_asciiSize.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_assignMergeValue.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_assignValue.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_assocIndexOf.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_baseAssign.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseAssignIn.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseAssignValue.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_baseClone.js +0 -70
- package/lib/packages/hooks/node_modules/lodash/_baseCreate.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/_baseEach.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_baseExtremum.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_baseFilter.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_baseFindIndex.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseFlatten.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_baseFor.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_baseForOwn.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseGet.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_baseGetAllKeys.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseGetTag.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseGt.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_baseHas.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_baseHasIn.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_baseIndexOf.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseIsArguments.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseIsEqual.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseIsEqualDeep.js +0 -38
- package/lib/packages/hooks/node_modules/lodash/_baseIsMap.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseIsMatch.js +0 -37
- package/lib/packages/hooks/node_modules/lodash/_baseIsNaN.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_baseIsNative.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_baseIsSet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseIsTypedArray.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_baseIteratee.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_baseKeys.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_baseKeysIn.js +0 -21
- package/lib/packages/hooks/node_modules/lodash/_baseLt.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_baseMap.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_baseMatches.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_baseMatchesProperty.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/_baseMerge.js +0 -27
- package/lib/packages/hooks/node_modules/lodash/_baseMergeDeep.js +0 -38
- package/lib/packages/hooks/node_modules/lodash/_baseOrderBy.js +0 -37
- package/lib/packages/hooks/node_modules/lodash/_basePick.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_basePickBy.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_baseProperty.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_basePropertyDeep.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseRange.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseReduce.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_baseRest.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseSet.js +0 -31
- package/lib/packages/hooks/node_modules/lodash/_baseSetToString.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_baseSortBy.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_baseTimes.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_baseToString.js +0 -24
- package/lib/packages/hooks/node_modules/lodash/_baseTrim.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_baseUnary.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_baseUniq.js +0 -39
- package/lib/packages/hooks/node_modules/lodash/_baseValues.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_baseZipObject.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_cacheHas.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_castFunction.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_castPath.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_cloneArrayBuffer.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_cloneBuffer.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_cloneDataView.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_cloneRegExp.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_cloneSymbol.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_cloneTypedArray.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_compareAscending.js +0 -21
- package/lib/packages/hooks/node_modules/lodash/_compareMultiple.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/_copyArray.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_copyObject.js +0 -21
- package/lib/packages/hooks/node_modules/lodash/_copySymbols.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_copySymbolsIn.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_coreJsData.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_createAssigner.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_createBaseEach.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_createBaseFor.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_createFind.js +0 -26
- package/lib/packages/hooks/node_modules/lodash/_createRange.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_createSet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_defineProperty.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_equalArrays.js +0 -46
- package/lib/packages/hooks/node_modules/lodash/_equalByTag.js +0 -51
- package/lib/packages/hooks/node_modules/lodash/_equalObjects.js +0 -42
- package/lib/packages/hooks/node_modules/lodash/_flatRest.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_freeGlobal.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_getAllKeys.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_getAllKeysIn.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_getMapData.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_getMatchData.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_getNative.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_getPrototype.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_getRawTag.js +0 -21
- package/lib/packages/hooks/node_modules/lodash/_getSymbols.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_getSymbolsIn.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_getTag.js +0 -33
- package/lib/packages/hooks/node_modules/lodash/_getValue.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_hasPath.js +0 -26
- package/lib/packages/hooks/node_modules/lodash/_hasUnicode.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_hashClear.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_hashDelete.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_hashGet.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_hashHas.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_hashSet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_initCloneArray.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_initCloneByTag.js +0 -48
- package/lib/packages/hooks/node_modules/lodash/_initCloneObject.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_isFlattenable.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_isIndex.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_isIterateeCall.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_isKey.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_isKeyable.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_isMasked.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_isPrototype.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_isStrictComparable.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_listCacheClear.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_listCacheDelete.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/_listCacheGet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_listCacheHas.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_listCacheSet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_mapCacheClear.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/_mapCacheDelete.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_mapCacheGet.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_mapCacheHas.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_mapCacheSet.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_mapToArray.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_matchesStrictComparable.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_memoizeCapped.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_nativeCreate.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_nativeKeys.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_nativeKeysIn.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_nodeUtil.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/_objectToString.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_overArg.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_overRest.js +0 -21
- package/lib/packages/hooks/node_modules/lodash/_root.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/_safeGet.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_setCacheAdd.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_setCacheHas.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_setToArray.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_setToString.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_shortOut.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/_stackClear.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/_stackDelete.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/_stackGet.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_stackHas.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/_stackSet.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/_strictIndexOf.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_stringSize.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_stringToPath.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/_toKey.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/_toSource.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/_trimmedEndIndex.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/_unicodeSize.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/clone.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/cloneDeep.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/constant.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/defaults.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/each.js +0 -8
- package/lib/packages/hooks/node_modules/lodash/eq.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/filter.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/find.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/findIndex.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/flatten.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/forEach.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/forIn.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/get.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/has.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/hasIn.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/identity.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/isArguments.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/isArray.js +0 -10
- package/lib/packages/hooks/node_modules/lodash/isArrayLike.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/isArrayLikeObject.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/isBuffer.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/isEmpty.js +0 -33
- package/lib/packages/hooks/node_modules/lodash/isFunction.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/isLength.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/isMap.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/isObject.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/isObjectLike.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/isPlainObject.js +0 -22
- package/lib/packages/hooks/node_modules/lodash/isSet.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/isString.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/isSymbol.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/isTypedArray.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/isUndefined.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/keys.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/keysIn.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/last.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/map.js +0 -18
- package/lib/packages/hooks/node_modules/lodash/mapValues.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/max.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/memoize.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/merge.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/min.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/minBy.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/noop.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/now.js +0 -13
- package/lib/packages/hooks/node_modules/lodash/pick.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/property.js +0 -17
- package/lib/packages/hooks/node_modules/lodash/range.js +0 -11
- package/lib/packages/hooks/node_modules/lodash/reduce.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/size.js +0 -23
- package/lib/packages/hooks/node_modules/lodash/sortBy.js +0 -19
- package/lib/packages/hooks/node_modules/lodash/stubArray.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/stubFalse.js +0 -12
- package/lib/packages/hooks/node_modules/lodash/toFinite.js +0 -20
- package/lib/packages/hooks/node_modules/lodash/toInteger.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/toNumber.js +0 -28
- package/lib/packages/hooks/node_modules/lodash/toPlainObject.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/toString.js +0 -14
- package/lib/packages/hooks/node_modules/lodash/transform.js +0 -30
- package/lib/packages/hooks/node_modules/lodash/union.js +0 -16
- package/lib/packages/hooks/node_modules/lodash/uniqueId.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/values.js +0 -15
- package/lib/packages/hooks/node_modules/lodash/zipObject.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_DataView.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_Hash.js +0 -20
- package/lib/packages/hooks/node_modules/lodash-es/_ListCache.js +0 -20
- package/lib/packages/hooks/node_modules/lodash-es/_Map.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_MapCache.js +0 -20
- package/lib/packages/hooks/node_modules/lodash-es/_Promise.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_Set.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_SetCache.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_Stack.js +0 -18
- package/lib/packages/hooks/node_modules/lodash-es/_Symbol.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_WeakMap.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_apply.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/_arrayAggregator.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_arrayEach.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_arrayIncludes.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
- package/lib/packages/hooks/node_modules/lodash-es/_arrayMap.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_arrayPush.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_arrayReduce.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_arraySome.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_asciiToArray.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_asciiWords.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_assignMergeValue.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_assignValue.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_assocIndexOf.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_baseAggregator.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseAssign.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_baseClamp.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_baseClone.js +0 -65
- package/lib/packages/hooks/node_modules/lodash-es/_baseCreate.js +0 -17
- package/lib/packages/hooks/node_modules/lodash-es/_baseDifference.js +0 -24
- package/lib/packages/hooks/node_modules/lodash-es/_baseEach.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_baseExtremum.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_baseFindIndex.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_baseFor.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseGet.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_baseGt.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_baseHas.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_baseIndexOf.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsNaN.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsNative.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_baseKeys.js +0 -14
- package/lib/packages/hooks/node_modules/lodash-es/_baseKeysIn.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_baseMap.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_baseMatches.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/lib/packages/hooks/node_modules/lodash-es/_baseMerge.js +0 -20
- package/lib/packages/hooks/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/lib/packages/hooks/node_modules/lodash-es/_baseOrderBy.js +0 -30
- package/lib/packages/hooks/node_modules/lodash-es/_baseProperty.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_basePropertyOf.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseRest.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/lib/packages/hooks/node_modules/lodash-es/_baseSlice.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_baseSortBy.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_baseSortedIndex.js +0 -18
- package/lib/packages/hooks/node_modules/lodash-es/_baseSortedIndexBy.js +0 -19
- package/lib/packages/hooks/node_modules/lodash-es/_baseTimes.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseToString.js +0 -18
- package/lib/packages/hooks/node_modules/lodash-es/_baseTrim.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseUnary.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_baseUniq.js +0 -30
- package/lib/packages/hooks/node_modules/lodash-es/_cacheHas.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_castPath.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_castSlice.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_cloneBuffer.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_compareAscending.js +0 -14
- package/lib/packages/hooks/node_modules/lodash-es/_compareMultiple.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/_copyArray.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_copyObject.js +0 -14
- package/lib/packages/hooks/node_modules/lodash-es/_copySymbols.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_coreJsData.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_createAggregator.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_createAssigner.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_createCaseFirst.js +0 -14
- package/lib/packages/hooks/node_modules/lodash-es/_createCompounder.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_createSet.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_customDefaultsMerge.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_deburrLetter.js +0 -198
- package/lib/packages/hooks/node_modules/lodash-es/_defineProperty.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_equalArrays.js +0 -40
- package/lib/packages/hooks/node_modules/lodash-es/_equalByTag.js +0 -45
- package/lib/packages/hooks/node_modules/lodash-es/_equalObjects.js +0 -36
- package/lib/packages/hooks/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/lib/packages/hooks/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_getMapData.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_getMatchData.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_getNative.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_getPrototype.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_getRawTag.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_getSymbols.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_getSymbolsIn.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_getTag.js +0 -28
- package/lib/packages/hooks/node_modules/lodash-es/_getValue.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_hasPath.js +0 -19
- package/lib/packages/hooks/node_modules/lodash-es/_hasUnicode.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_hasUnicodeWord.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_hashClear.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_hashDelete.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_hashGet.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_hashHas.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_hashSet.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_initCloneByTag.js +0 -42
- package/lib/packages/hooks/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_isIndex.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_isKey.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_isKeyable.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_isMasked.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_isPrototype.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_mapToArray.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_nativeKeysIn.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/lib/packages/hooks/node_modules/lodash-es/_objectToString.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_overArg.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/_overRest.js +0 -15
- package/lib/packages/hooks/node_modules/lodash-es/_root.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/_safeGet.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_setToArray.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_setToString.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_shortOut.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/_stackClear.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_stackDelete.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_stackGet.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_stackHas.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/_stackSet.js +0 -17
- package/lib/packages/hooks/node_modules/lodash-es/_strictIndexOf.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_stringToArray.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_stringToPath.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_toKey.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/_toSource.js +0 -17
- package/lib/packages/hooks/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/_unicodeToArray.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/_unicodeWords.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/camelCase.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/capitalize.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/clamp.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/clone.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/cloneDeep.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/constant.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/debounce.js +0 -54
- package/lib/packages/hooks/node_modules/lodash-es/deburr.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/defaults.js +0 -17
- package/lib/packages/hooks/node_modules/lodash-es/defaultsDeep.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/difference.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/eq.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/get.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/groupBy.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/has.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/hasIn.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/identity.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/isArguments.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/isArray.js +0 -4
- package/lib/packages/hooks/node_modules/lodash-es/isArrayLike.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/isBuffer.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/isEmpty.js +0 -27
- package/lib/packages/hooks/node_modules/lodash-es/isEqual.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/isFunction.js +0 -12
- package/lib/packages/hooks/node_modules/lodash-es/isLength.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/isMap.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/isNumber.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/isObject.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/isObjectLike.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/isPlainObject.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/isSet.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/isSymbol.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/isTypedArray.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/keys.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/keysIn.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/lowerFirst.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/max.js +0 -9
- package/lib/packages/hooks/node_modules/lodash-es/memoize.js +0 -18
- package/lib/packages/hooks/node_modules/lodash-es/merge.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/mergeWith.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/noop.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/now.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/property.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/sortBy.js +0 -13
- package/lib/packages/hooks/node_modules/lodash-es/sortedIndex.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/sortedIndexBy.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/startCase.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/stubArray.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/stubFalse.js +0 -6
- package/lib/packages/hooks/node_modules/lodash-es/throttle.js +0 -16
- package/lib/packages/hooks/node_modules/lodash-es/toNumber.js +0 -22
- package/lib/packages/hooks/node_modules/lodash-es/toPlainObject.js +0 -8
- package/lib/packages/hooks/node_modules/lodash-es/toString.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/union.js +0 -10
- package/lib/packages/hooks/node_modules/lodash-es/uniq.js +0 -7
- package/lib/packages/hooks/node_modules/lodash-es/upperFirst.js +0 -5
- package/lib/packages/hooks/node_modules/lodash-es/words.js +0 -10
- package/lib/packages/hooks/node_modules/mitt/dist/mitt.js +0 -19
- package/lib/packages/hooks/node_modules/mqtt/dist/mqtt.esm.js +0 -10402
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("vue"),require("mitt"),require("@antv/x6"),require("dagre"),require("mqtt")):typeof define=="function"&&define.amd?define(["exports","vue","mitt","@antv/x6","dagre","mqtt"],E):(d=typeof globalThis<"u"?globalThis:d||self,E(d["@qy_better_lib/hooks"]={},d.vue,d.mitt,d["@antv/x6"],d.dagre))})(this,(function(d,E,H,C,D){"use strict";function J(){const t=H();return t.emitAsync=async function(e,...o){const n=this.all?.get(e);if(!n||n.length===0)return[];const r=n.map(a=>{try{const u=a(...o);return u instanceof Promise?u:Promise.resolve(u)}catch(u){return Promise.reject(u)}});return Promise.all(r)},t}const R=J();function V(t){return E.onMounted(()=>{if(t&&t.length>0)for(let e=0;e<t.length;e++){debugger;R.on(t[e].key,t[e].value)}}),E.onUnmounted(()=>{if(t&&t.length>0)for(let e=0;e<t.length;e++)R.off(t[e].key,t[e].value),R.all.delete(t[e].key)}),{emitter:R}}function Q(){function t(n,r){const a=document.createElement("a");a.href=n,a.target="_blank",r&&a.setAttribute("download",r),document.body.appendChild(a),a.click(),document.body.removeChild(a)}function e(n){n.forEach(r=>{t(r.url,r.name)})}async function o(n){if(!n)return;const r=new FileReader;return r.readAsDataURL(n),new Promise((a,u)=>{r.onload=c=>a(c.target?.result),r.onerror=c=>u(void 0)})}return{downLoadFile:t,downLoadFiles:e,toBase64:o}}function $(){function t(c){let i=e(),m=n(c);document.body.appendChild(i),document.body.appendChild(m),r(m).then(()=>{window.print(),document.body.removeChild(i),document.body.removeChild(m)})}function e(c){let i=`#print-container {
|
|
2
2
|
display: none;
|
|
3
3
|
}
|
|
4
4
|
@media print {
|
|
@@ -12,265 +12,4 @@
|
|
|
12
12
|
#print-container {
|
|
13
13
|
display: block;
|
|
14
14
|
}
|
|
15
|
-
}`,u=document.createElement("style");return u.innerHTML=l,u}function t(){let a=document.getElementById("print-container");a&&document?.querySelector("body")?.removeChild(a)}function r(a){t();let l=document.createElement("div");return l.setAttribute("id","print-container"),l.innerHTML=a,l}function i(a){let l=a.querySelectorAll("img");const u=[].slice.call(l);if(u.length===0)return Promise.resolve();let c=0;return new Promise(h=>{function f(){c++,c===u.length&&h()}u.forEach(d=>{d.addEventListener("load",f),d.addEventListener("error",f)})})}function s(a){const l=document.querySelector(a);l&&n(l.innerHTML)}function o(a){let l="";for(let u=0;u<a.length;u++)l+=a[u].outerHTML;l&&n(l)}return{printHtml:s,printHtmlElement:o}}function YO(){const n="A77B030B-E33D-C656-7642-56D6FEA46059";function e(i=null,s,o,a){let l=r(i,s,o,a);document.getElementById(l)===null&&(l=r(i,s,o))}function t(){document.getElementById(n)?.remove()}function r(i=null,s,o,a="#999"){const l=i!=null?document.querySelector(i):document.body,u=document.getElementById(n);u!==null&&l?.removeChild(u);let c=document.createElement("canvas");c.width=250,c.height=150;let h=c.getContext("2d");h&&(h.font="16px Avenir,Helvetica,Arial,sans-serif",h.fillStyle=a.replace(/\,\s(1|(0.\d+)\))/,", 0.1"),h.textAlign="left",h.textBaseline="middle",h.rotate(-15*Math.PI/180),h?.fillText(s,0,c.height),o&&h?.fillText(o,h.measureText(s).width+16,c.height));let f=document.createElement("div");f.id=n,f.style.pointerEvents="none",f.style.top="0px",f.style.left="0px",f.style.position="fixed",f.style.zIndex="100000";const{clientWidth:d,clientHeight:p}=document.documentElement;return f.style.width=d+"px",f.style.height=p+"px",f.style.background="url("+c.toDataURL("image/png")+") left top repeat",l?.appendChild(f),n}return{createWaterMark:e,removeWatermark:t}}function JO(n){let e=0,t=!1,r,i;const{server:s,receive:o}=n;window.onbeforeunload=()=>{r?.close()};function a(){try{r=new WebSocket(s),u()}catch(f){console.log("连接建立异常",f)}}function l(){if(e>=5){r?.close();return}if(t)return!1;t=!0,i=setTimeout(function(){a(),t=!1,e++,i&&clearTimeout(i)},5e3)}function u(){r&&(r.onerror=f=>{console.log("连接错误",f),l()},r.onclose=()=>{console.log("连接关闭 - "+new Date().toLocaleTimeString()),l()},r.onopen=()=>{e=0,console.log("连接成功")},r.onmessage=f=>{try{o(f)}catch{console.log("message:"+f.data)}})}function c(f){r?.readyState===WebSocket.OPEN&&r?.send(f)}function h(){r?.close()}return{ws:r,create:a,socketClose:h,sendMessage:c}}var kn=(n=>(n.PNG="image/png",n.JPEG="image/jpeg",n.GIF="image/gif",n))(kn||{});function Os(n){return["image/png","image/jpeg","image/gif"].some(e=>e===n)}async function Ea(n,e=.92,t=kn.JPEG){return Os(t)||(t=kn.JPEG),n.toDataURL(t,e)}function XO(n,e=.92,t=kn.JPEG){return new Promise(r=>n.toBlob(i=>r(i),t,e))}async function Sa(n,e){const t=n.split(",");let r=t[0].match(/:(.*?);/)?.[1];const i=atob(t[1]);let s=i.length;const o=new Uint8Array(s);for(;s--;)o[s]=i.charCodeAt(s);return Os(e)&&(r=e),new Blob([o],{type:r})}function Aa(n){return new Promise((e,t)=>{const r=new Image;r.onload=()=>e(r),r.onerror=()=>t(new Error("dataURLtoImage(): dataURL is illegal")),r.src=n})}function QO(n,e){const t=document.createElement("a");t.href=window.URL.createObjectURL(n),t.download=e||Date.now().toString(36),document.body.appendChild(t);const r=document.createEvent("MouseEvents");r.initEvent("click",!1,!1),t.dispatchEvent(r),document.body.removeChild(t)}function Pa(n){return new Promise(e=>{const t=new FileReader;t.onloadend=r=>e(r.target?.result),t.readAsDataURL(n)})}async function Oa(n,e={}){const t={...e},r=document.createElement("canvas"),i=r.getContext("2d");let s,o;for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(t[a]=Number(t[a]));if(!t.scale)o=t.width||(t.height||0)*n.width/n.height||n.width,s=t.height||(t.width||0)*n.height/n.width||n.height;else{const a=t.scale>0&&t.scale<10?t.scale:1;o=n.width*a,s=n.height*a}switch([5,6,7,8].some(a=>a===t.orientation)?(r.height=o,r.width=s):(r.height=s,r.width=o),t.orientation){case 3:i.rotate(180*Math.PI/180),i.drawImage(n,-r.width,-r.height,r.width,r.height);break;case 6:i.rotate(90*Math.PI/180),i.drawImage(n,0,-r.width,r.height,r.width);break;case 8:i.rotate(270*Math.PI/180),i.drawImage(n,-r.height,0,r.height,r.width);break;case 2:i.translate(r.width,0),i.scale(-1,1),i.drawImage(n,0,0,r.width,r.height);break;case 4:i.translate(r.width,0),i.scale(-1,1),i.rotate(180*Math.PI/180),i.drawImage(n,-r.width,-r.height,r.width,r.height);break;case 5:i.translate(r.width,0),i.scale(-1,1),i.rotate(90*Math.PI/180),i.drawImage(n,0,-r.width,r.height,r.width);break;case 7:i.translate(r.width,0),i.scale(-1,1),i.rotate(270*Math.PI/180),i.drawImage(n,-r.height,0,r.height,r.width);break;default:i.drawImage(n,0,0,r.width,r.height)}return r}function ZO(n){return fetch(n).then(e=>e.blob())}function eC(n){return new Promise((e,t)=>{const r=new Image;r.onload=()=>e(r),r.onerror=()=>t(new Error("urltoImage(): Image failed to load, please check the image URL")),r.src=n})}async function tC(n,e={}){if(!(n instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if(typeof e!="object"&&(e=Object.assign({quality:e})),e.quality=Number(e.quality),Number.isNaN(e.quality))return n;const t=await Pa(n);let r=t.split(",")[0].match(/:(.*?);/)?.[1],i=kn.JPEG;Os(e.type)&&(i=e.type,r=e.type);const s=await Aa(t),o=await Oa(s,Object.assign({},e)),a=await Ea(o,e.quality,i),l=await Sa(a,r);return l.size>n.size?n:l}async function rC(n,e={}){if(!(n instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if(typeof e!="object"&&(e=Object.assign({size:e})),e.size=Number(e.size),Number.isNaN(e.size)||e.size*1024>n.size)return n;e.accuracy=Number(e.accuracy),(!e.accuracy||e.accuracy<.8||e.accuracy>.99)&&(e.accuracy=.95);const t={max:e.size*(2-e.accuracy)*1024,accurate:e.size*1024,min:e.size*e.accuracy*1024},r=await Pa(n);let i=r.split(",")[0].match(/:(.*?);/)?.[1],s=kn.JPEG;Os(e.type)&&(s=e.type,i=e.type);const o=await Aa(r),a=await Oa(o,Object.assign({},e)),l=.75;let u=1,c;const h=new Array(2);for(let d=1;d<=7;d++){c=await Ea(a,u,s);const p=c.length*l;if(d===7){(t.max<p||t.min>p)&&(c=[c,...h].filter(g=>g).sort((g,m)=>Math.abs(g.length*l-t.accurate)-Math.abs(m.length*l-t.accurate))[0]);break}if(t.max<p)h[1]=c,u-=.5**(d+1);else if(t.min>p)h[0]=c,u+=.5**(d+1);else break}const f=await Sa(c,i);return f.size>n.size?n:f}function Ca(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"}const nC=typeof window<"u";function Dm(...n){let e=n.length,t=n[0];Ca(t)||(t={});for(let r=1;r<e;r++){let i=n[r];if(Ca(i))for(let s in i)s==="__proto__"||t===i[s]||(Ca(i[s])?t[s]=Dm(t[s],i[s]):t[s]=i[s])}return t}const iC=new Map;let Bm;nC&&(document.addEventListener("mousedown",n=>Bm=n),document.addEventListener("mouseup",n=>{for(const e of iC.values())for(const{documentHandler:t}of e)t(n,Bm)})),mr(12),mr(14),mr(12),mr(8),mr(16),mr(12),mr(12),mr(12),mr(12);function mr(n,e=1920){if(!n)return;let t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(!t)return n;let r=t/e;return Number((n*r).toFixed(3))}typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&(function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const r=document.createDocumentFragment();t.forEach(i=>{const s=i instanceof Node;r.appendChild(s?i:document.createTextNode(String(i)))}),this.appendChild(r)}})})})([Element.prototype,Document.prototype,DocumentFragment.prototype]);class yr{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,r,i)=>{const s=i.value,o=t.__proto__;i.value=function(...a){this.disposed||(s.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(yr||(yr={}));class qm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const r=new n;return t.forEach(i=>{r.add(i)}),r}n.from=e})(qm||(qm={}));var Fm=typeof global=="object"&&global&&global.Object===Object&&global,sC=typeof self=="object"&&self&&self.Object===Object&&self,zt=Fm||sC||Function("return this")(),Nt=zt.Symbol,$m=Object.prototype,oC=$m.hasOwnProperty,aC=$m.toString,Oi=Nt?Nt.toStringTag:void 0;function lC(n){var e=oC.call(n,Oi),t=n[Oi];try{n[Oi]=void 0;var r=!0}catch{}var i=aC.call(n);return r&&(e?n[Oi]=t:delete n[Oi]),i}var uC=Object.prototype,cC=uC.toString;function hC(n){return cC.call(n)}var fC="[object Null]",dC="[object Undefined]",Um=Nt?Nt.toStringTag:void 0;function qr(n){return n==null?n===void 0?dC:fC:Um&&Um in Object(n)?lC(n):hC(n)}function Vt(n){return n!=null&&typeof n=="object"}var pC="[object Symbol]";function rr(n){return typeof n=="symbol"||Vt(n)&&qr(n)==pC}function Cs(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var _t=Array.isArray,zm=Nt?Nt.prototype:void 0,Vm=zm?zm.toString:void 0;function Wm(n){if(typeof n=="string")return n;if(_t(n))return Cs(n,Wm)+"";if(rr(n))return Vm?Vm.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}var gC=/\s/;function mC(n){for(var e=n.length;e--&&gC.test(n.charAt(e)););return e}var yC=/^\s+/;function bC(n){return n&&n.slice(0,mC(n)+1).replace(yC,"")}function st(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Gm=NaN,vC=/^[-+]0x[0-9a-f]+$/i,wC=/^0b[01]+$/i,_C=/^0o[0-7]+$/i,xC=parseInt;function Ci(n){if(typeof n=="number")return n;if(rr(n))return Gm;if(st(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=st(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=bC(n);var t=wC.test(n);return t||_C.test(n)?xC(n.slice(2),t?2:8):vC.test(n)?Gm:+n}function Nn(n){return n}var EC="[object AsyncFunction]",SC="[object Function]",AC="[object GeneratorFunction]",PC="[object Proxy]";function Ta(n){if(!st(n))return!1;var e=qr(n);return e==SC||e==AC||e==EC||e==PC}var Ma=zt["__core-js_shared__"],Hm=(function(){var n=/[^.]+$/.exec(Ma&&Ma.keys&&Ma.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function OC(n){return!!Hm&&Hm in n}var CC=Function.prototype,TC=CC.toString;function ln(n){if(n!=null){try{return TC.call(n)}catch{}try{return n+""}catch{}}return""}var MC=/[\\^$.*+?()[\]{}|]/g,IC=/^\[object .+?Constructor\]$/,RC=Function.prototype,kC=Object.prototype,NC=RC.toString,jC=kC.hasOwnProperty,LC=RegExp("^"+NC.call(jC).replace(MC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function DC(n){if(!st(n)||OC(n))return!1;var e=Ta(n)?LC:IC;return e.test(ln(n))}function BC(n,e){return n?.[e]}function un(n,e){var t=BC(n,e);return DC(t)?t:void 0}var Ia=un(zt,"WeakMap"),Km=Object.create,qC=(function(){function n(){}return function(e){if(!st(e))return{};if(Km)return Km(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function Ym(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function FC(){}function Jm(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var $C=800,UC=16,zC=Date.now;function VC(n){var e=0,t=0;return function(){var r=zC(),i=UC-(r-t);if(t=r,i>0){if(++e>=$C)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function WC(n){return function(){return n}}var Ts=(function(){try{var n=un(Object,"defineProperty");return n({},"",{}),n}catch{}})(),GC=Ts?function(n,e){return Ts(n,"toString",{configurable:!0,enumerable:!1,value:WC(e),writable:!0})}:Nn,HC=VC(GC);function KC(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function YC(n,e,t,r){for(var i=n.length,s=t+-1;++s<i;)if(e(n[s],s,n))return s;return-1}function JC(n){return n!==n}function XC(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function QC(n,e,t){return e===e?XC(n,e,t):YC(n,JC,t)}function Xm(n,e){var t=n==null?0:n.length;return!!t&&QC(n,e,0)>-1}var ZC=9007199254740991,eT=/^(?:0|[1-9]\d*)$/;function Ra(n,e){var t=typeof n;return e=e??ZC,!!e&&(t=="number"||t!="symbol"&&eT.test(n))&&n>-1&&n%1==0&&n<e}function Ms(n,e,t){e=="__proto__"&&Ts?Ts(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function jn(n,e){return n===e||n!==n&&e!==e}var tT=Object.prototype,rT=tT.hasOwnProperty;function Qm(n,e,t){var r=n[e];(!(rT.call(n,e)&&jn(r,t))||t===void 0&&!(e in n))&&Ms(n,e,t)}function Ti(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=n[a]),i?Ms(t,a,l):Qm(t,a,l)}return t}var Zm=Math.max;function nT(n,e,t){return e=Zm(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=Zm(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),Ym(n,this,a)}}function Ln(n,e){return HC(nT(n,e,Nn),n+"")}var iT=9007199254740991;function ka(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=iT}function cn(n){return n!=null&&ka(n.length)&&!Ta(n)}function Is(n,e,t){if(!st(t))return!1;var r=typeof e;return(r=="number"?cn(t)&&Ra(e,t.length):r=="string"&&e in t)?jn(t[e],n):!1}function ey(n){return Ln(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&Is(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var sT=Object.prototype;function Rs(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||sT;return n===t}function oT(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var aT="[object Arguments]";function ty(n){return Vt(n)&&qr(n)==aT}var ry=Object.prototype,lT=ry.hasOwnProperty,uT=ry.propertyIsEnumerable,Dn=ty((function(){return arguments})())?ty:function(n){return Vt(n)&&lT.call(n,"callee")&&!uT.call(n,"callee")};function cT(){return!1}var ny=typeof Be=="object"&&Be&&!Be.nodeType&&Be,iy=ny&&typeof module=="object"&&module&&!module.nodeType&&module,hT=iy&&iy.exports===ny,sy=hT?zt.Buffer:void 0,fT=sy?sy.isBuffer:void 0,Bn=fT||cT,dT="[object Arguments]",pT="[object Array]",gT="[object Boolean]",mT="[object Date]",yT="[object Error]",bT="[object Function]",vT="[object Map]",wT="[object Number]",_T="[object Object]",xT="[object RegExp]",ET="[object Set]",ST="[object String]",AT="[object WeakMap]",PT="[object ArrayBuffer]",OT="[object DataView]",CT="[object Float32Array]",TT="[object Float64Array]",MT="[object Int8Array]",IT="[object Int16Array]",RT="[object Int32Array]",kT="[object Uint8Array]",NT="[object Uint8ClampedArray]",jT="[object Uint16Array]",LT="[object Uint32Array]",He={};He[CT]=He[TT]=He[MT]=He[IT]=He[RT]=He[kT]=He[NT]=He[jT]=He[LT]=!0,He[dT]=He[pT]=He[PT]=He[gT]=He[OT]=He[mT]=He[yT]=He[bT]=He[vT]=He[wT]=He[_T]=He[xT]=He[ET]=He[ST]=He[AT]=!1;function DT(n){return Vt(n)&&ka(n.length)&&!!He[qr(n)]}function ks(n){return function(e){return n(e)}}var oy=typeof Be=="object"&&Be&&!Be.nodeType&&Be,Mi=oy&&typeof module=="object"&&module&&!module.nodeType&&module,BT=Mi&&Mi.exports===oy,Na=BT&&Fm.process,qn=(function(){try{var n=Mi&&Mi.require&&Mi.require("util").types;return n||Na&&Na.binding&&Na.binding("util")}catch{}})(),ay=qn&&qn.isTypedArray,Ns=ay?ks(ay):DT,qT=Object.prototype,FT=qT.hasOwnProperty;function ly(n,e){var t=_t(n),r=!t&&Dn(n),i=!t&&!r&&Bn(n),s=!t&&!r&&!i&&Ns(n),o=t||r||i||s,a=o?oT(n.length,String):[],l=a.length;for(var u in n)(e||FT.call(n,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ra(u,l)))&&a.push(u);return a}function uy(n,e){return function(t){return n(e(t))}}var $T=uy(Object.keys,Object),UT=Object.prototype,zT=UT.hasOwnProperty;function cy(n){if(!Rs(n))return $T(n);var e=[];for(var t in Object(n))zT.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ii(n){return cn(n)?ly(n):cy(n)}function VT(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var WT=Object.prototype,GT=WT.hasOwnProperty;function HT(n){if(!st(n))return VT(n);var e=Rs(n),t=[];for(var r in n)r=="constructor"&&(e||!GT.call(n,r))||t.push(r);return t}function Fn(n){return cn(n)?ly(n,!0):HT(n)}var KT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YT=/^\w*$/;function ja(n,e){if(_t(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||rr(n)?!0:YT.test(n)||!KT.test(n)||e!=null&&n in Object(e)}var Ri=un(Object,"create");function JT(){this.__data__=Ri?Ri(null):{},this.size=0}function XT(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var QT="__lodash_hash_undefined__",ZT=Object.prototype,eM=ZT.hasOwnProperty;function tM(n){var e=this.__data__;if(Ri){var t=e[n];return t===QT?void 0:t}return eM.call(e,n)?e[n]:void 0}var rM=Object.prototype,nM=rM.hasOwnProperty;function iM(n){var e=this.__data__;return Ri?e[n]!==void 0:nM.call(e,n)}var sM="__lodash_hash_undefined__";function oM(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ri&&e===void 0?sM:e,this}function hn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}hn.prototype.clear=JT,hn.prototype.delete=XT,hn.prototype.get=tM,hn.prototype.has=iM,hn.prototype.set=oM;function aM(){this.__data__=[],this.size=0}function js(n,e){for(var t=n.length;t--;)if(jn(n[t][0],e))return t;return-1}var lM=Array.prototype,uM=lM.splice;function cM(n){var e=this.__data__,t=js(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():uM.call(e,t,1),--this.size,!0}function hM(n){var e=this.__data__,t=js(e,n);return t<0?void 0:e[t][1]}function fM(n){return js(this.__data__,n)>-1}function dM(n,e){var t=this.__data__,r=js(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function br(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}br.prototype.clear=aM,br.prototype.delete=cM,br.prototype.get=hM,br.prototype.has=fM,br.prototype.set=dM;var ki=un(zt,"Map");function pM(){this.size=0,this.__data__={hash:new hn,map:new(ki||br),string:new hn}}function gM(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ls(n,e){var t=n.__data__;return gM(e)?t[typeof e=="string"?"string":"hash"]:t.map}function mM(n){var e=Ls(this,n).delete(n);return this.size-=e?1:0,e}function yM(n){return Ls(this,n).get(n)}function bM(n){return Ls(this,n).has(n)}function vM(n,e){var t=Ls(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function vr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}vr.prototype.clear=pM,vr.prototype.delete=mM,vr.prototype.get=yM,vr.prototype.has=bM,vr.prototype.set=vM;var wM="Expected a function";function La(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(wM);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=t.cache;if(s.has(i))return s.get(i);var o=n.apply(this,r);return t.cache=s.set(i,o)||s,o};return t.cache=new(La.Cache||vr),t}La.Cache=vr;var _M=500;function xM(n){var e=La(n,function(r){return t.size===_M&&t.clear(),r}),t=e.cache;return e}var EM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,SM=/\\(\\)?/g,AM=xM(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(EM,function(t,r,i,s){e.push(i?s.replace(SM,"$1"):r||t)}),e});function Ni(n){return n==null?"":Wm(n)}function hy(n,e){return _t(n)?n:ja(n,e)?[n]:AM(Ni(n))}function Ds(n){if(typeof n=="string"||rr(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Da(n,e){e=hy(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Ds(e[t++])];return t&&t==r?n:void 0}function PM(n,e,t){var r=n==null?void 0:Da(n,e);return r===void 0?t:r}function Ba(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var fy=Nt?Nt.isConcatSpreadable:void 0;function OM(n){return _t(n)||Dn(n)||!!(fy&&n&&n[fy])}function qa(n,e,t,r,i){var s=-1,o=n.length;for(t||(t=OM),i||(i=[]);++s<o;){var a=n[s];t(a)?Ba(i,a):r||(i[i.length]=a)}return i}var Fa=uy(Object.getPrototypeOf,Object),CM="[object Object]",TM=Function.prototype,MM=Object.prototype,dy=TM.toString,IM=MM.hasOwnProperty,RM=dy.call(Object);function nr(n){if(!Vt(n)||qr(n)!=CM)return!1;var e=Fa(n);if(e===null)return!0;var t=IM.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&dy.call(t)==RM}function kM(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function NM(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:kM(n,e,t)}var jM="\\ud800-\\udfff",LM="\\u0300-\\u036f",DM="\\ufe20-\\ufe2f",BM="\\u20d0-\\u20ff",qM=LM+DM+BM,FM="\\ufe0e\\ufe0f",$M="\\u200d",UM=RegExp("["+$M+jM+qM+FM+"]");function py(n){return UM.test(n)}function zM(n){return n.split("")}var gy="\\ud800-\\udfff",VM="\\u0300-\\u036f",WM="\\ufe20-\\ufe2f",GM="\\u20d0-\\u20ff",HM=VM+WM+GM,KM="\\ufe0e\\ufe0f",YM="["+gy+"]",$a="["+HM+"]",Ua="\\ud83c[\\udffb-\\udfff]",JM="(?:"+$a+"|"+Ua+")",my="[^"+gy+"]",yy="(?:\\ud83c[\\udde6-\\uddff]){2}",by="[\\ud800-\\udbff][\\udc00-\\udfff]",XM="\\u200d",vy=JM+"?",wy="["+KM+"]?",QM="(?:"+XM+"(?:"+[my,yy,by].join("|")+")"+wy+vy+")*",ZM=wy+vy+QM,eI="(?:"+[my+$a+"?",$a,yy,by,YM].join("|")+")",tI=RegExp(Ua+"(?="+Ua+")|"+eI+ZM,"g");function rI(n){return n.match(tI)||[]}function nI(n){return py(n)?rI(n):zM(n)}function _y(n){return function(e){e=Ni(e);var t=py(e)?nI(e):void 0,r=t?t[0]:e.charAt(0),i=t?NM(t,1).join(""):e.slice(1);return r[n]()+i}}var Bs=_y("toUpperCase");function iI(n){return Bs(Ni(n).toLowerCase())}function sI(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;)t=e(t,n[i],i,n);return t}function oI(n){return function(e){return n?.[e]}}var aI={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lI=oI(aI),uI=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cI="\\u0300-\\u036f",hI="\\ufe20-\\ufe2f",fI="\\u20d0-\\u20ff",dI=cI+hI+fI,pI="["+dI+"]",gI=RegExp(pI,"g");function mI(n){return n=Ni(n),n&&n.replace(uI,lI).replace(gI,"")}var yI=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function bI(n){return n.match(yI)||[]}var vI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function wI(n){return vI.test(n)}var xy="\\ud800-\\udfff",_I="\\u0300-\\u036f",xI="\\ufe20-\\ufe2f",EI="\\u20d0-\\u20ff",SI=_I+xI+EI,Ey="\\u2700-\\u27bf",Sy="a-z\\xdf-\\xf6\\xf8-\\xff",AI="\\xac\\xb1\\xd7\\xf7",PI="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",OI="\\u2000-\\u206f",CI=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ay="A-Z\\xc0-\\xd6\\xd8-\\xde",TI="\\ufe0e\\ufe0f",Py=AI+PI+OI+CI,Oy="['’]",Cy="["+Py+"]",MI="["+SI+"]",Ty="\\d+",II="["+Ey+"]",My="["+Sy+"]",Iy="[^"+xy+Py+Ty+Ey+Sy+Ay+"]",RI="\\ud83c[\\udffb-\\udfff]",kI="(?:"+MI+"|"+RI+")",NI="[^"+xy+"]",Ry="(?:\\ud83c[\\udde6-\\uddff]){2}",ky="[\\ud800-\\udbff][\\udc00-\\udfff]",$n="["+Ay+"]",jI="\\u200d",Ny="(?:"+My+"|"+Iy+")",LI="(?:"+$n+"|"+Iy+")",jy="(?:"+Oy+"(?:d|ll|m|re|s|t|ve))?",Ly="(?:"+Oy+"(?:D|LL|M|RE|S|T|VE))?",Dy=kI+"?",By="["+TI+"]?",DI="(?:"+jI+"(?:"+[NI,Ry,ky].join("|")+")"+By+Dy+")*",BI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",FI=By+Dy+DI,$I="(?:"+[II,Ry,ky].join("|")+")"+FI,UI=RegExp([$n+"?"+My+"+"+jy+"(?="+[Cy,$n,"$"].join("|")+")",LI+"+"+Ly+"(?="+[Cy,$n+Ny,"$"].join("|")+")",$n+"?"+Ny+"+"+jy,$n+"+"+Ly,qI,BI,Ty,$I].join("|"),"g");function zI(n){return n.match(UI)||[]}function VI(n,e,t){return n=Ni(n),e=e,e===void 0?wI(n)?zI(n):bI(n):n.match(e)||[]}var WI="['’]",GI=RegExp(WI,"g");function qy(n){return function(e){return sI(VI(mI(e).replace(GI,"")),n,"")}}var qs=qy(function(n,e,t){return e=e.toLowerCase(),n+(t?iI(e):e)});function HI(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function jt(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Ci(t),t=t===t?t:0),e!==void 0&&(e=Ci(e),e=e===e?e:0),HI(Ci(n),e,t)}function KI(){this.__data__=new br,this.size=0}function YI(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function JI(n){return this.__data__.get(n)}function XI(n){return this.__data__.has(n)}var QI=200;function ZI(n,e){var t=this.__data__;if(t instanceof br){var r=t.__data__;if(!ki||r.length<QI-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new vr(r)}return t.set(n,e),this.size=t.size,this}function Wt(n){var e=this.__data__=new br(n);this.size=e.size}Wt.prototype.clear=KI,Wt.prototype.delete=YI,Wt.prototype.get=JI,Wt.prototype.has=XI,Wt.prototype.set=ZI;function eR(n,e){return n&&Ti(e,Ii(e),n)}function tR(n,e){return n&&Ti(e,Fn(e),n)}var Fy=typeof Be=="object"&&Be&&!Be.nodeType&&Be,$y=Fy&&typeof module=="object"&&module&&!module.nodeType&&module,rR=$y&&$y.exports===Fy,Uy=rR?zt.Buffer:void 0,zy=Uy?Uy.allocUnsafe:void 0;function Vy(n,e){if(e)return n.slice();var t=n.length,r=zy?zy(t):new n.constructor(t);return n.copy(r),r}function nR(n,e){for(var t=-1,r=n==null?0:n.length,i=0,s=[];++t<r;){var o=n[t];e(o,t,n)&&(s[i++]=o)}return s}function Wy(){return[]}var iR=Object.prototype,sR=iR.propertyIsEnumerable,Gy=Object.getOwnPropertySymbols,za=Gy?function(n){return n==null?[]:(n=Object(n),nR(Gy(n),function(e){return sR.call(n,e)}))}:Wy;function oR(n,e){return Ti(n,za(n),e)}var aR=Object.getOwnPropertySymbols,Hy=aR?function(n){for(var e=[];n;)Ba(e,za(n)),n=Fa(n);return e}:Wy;function lR(n,e){return Ti(n,Hy(n),e)}function Ky(n,e,t){var r=e(n);return _t(n)?r:Ba(r,t(n))}function Va(n){return Ky(n,Ii,za)}function uR(n){return Ky(n,Fn,Hy)}var Wa=un(zt,"DataView"),Ga=un(zt,"Promise"),Un=un(zt,"Set"),Yy="[object Map]",cR="[object Object]",Jy="[object Promise]",Xy="[object Set]",Qy="[object WeakMap]",Zy="[object DataView]",hR=ln(Wa),fR=ln(ki),dR=ln(Ga),pR=ln(Un),gR=ln(Ia),Lt=qr;(Wa&&Lt(new Wa(new ArrayBuffer(1)))!=Zy||ki&&Lt(new ki)!=Yy||Ga&&Lt(Ga.resolve())!=Jy||Un&&Lt(new Un)!=Xy||Ia&&Lt(new Ia)!=Qy)&&(Lt=function(n){var e=qr(n),t=e==cR?n.constructor:void 0,r=t?ln(t):"";if(r)switch(r){case hR:return Zy;case fR:return Yy;case dR:return Jy;case pR:return Xy;case gR:return Qy}return e});var mR=Object.prototype,yR=mR.hasOwnProperty;function bR(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&yR.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Fs=zt.Uint8Array;function Ha(n){var e=new n.constructor(n.byteLength);return new Fs(e).set(new Fs(n)),e}function vR(n,e){var t=e?Ha(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var wR=/\w*$/;function _R(n){var e=new n.constructor(n.source,wR.exec(n));return e.lastIndex=n.lastIndex,e}var eb=Nt?Nt.prototype:void 0,tb=eb?eb.valueOf:void 0;function xR(n){return tb?Object(tb.call(n)):{}}function rb(n,e){var t=e?Ha(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var ER="[object Boolean]",SR="[object Date]",AR="[object Map]",PR="[object Number]",OR="[object RegExp]",CR="[object Set]",TR="[object String]",MR="[object Symbol]",IR="[object ArrayBuffer]",RR="[object DataView]",kR="[object Float32Array]",NR="[object Float64Array]",jR="[object Int8Array]",LR="[object Int16Array]",DR="[object Int32Array]",BR="[object Uint8Array]",qR="[object Uint8ClampedArray]",FR="[object Uint16Array]",$R="[object Uint32Array]";function UR(n,e,t){var r=n.constructor;switch(e){case IR:return Ha(n);case ER:case SR:return new r(+n);case RR:return vR(n,t);case kR:case NR:case jR:case LR:case DR:case BR:case qR:case FR:case $R:return rb(n,t);case AR:return new r;case PR:case TR:return new r(n);case OR:return _R(n);case CR:return new r;case MR:return xR(n)}}function nb(n){return typeof n.constructor=="function"&&!Rs(n)?qC(Fa(n)):{}}var zR="[object Map]";function VR(n){return Vt(n)&&Lt(n)==zR}var ib=qn&&qn.isMap,WR=ib?ks(ib):VR,GR="[object Set]";function HR(n){return Vt(n)&&Lt(n)==GR}var sb=qn&&qn.isSet,KR=sb?ks(sb):HR,YR=1,JR=2,XR=4,ob="[object Arguments]",QR="[object Array]",ZR="[object Boolean]",e2="[object Date]",t2="[object Error]",ab="[object Function]",r2="[object GeneratorFunction]",n2="[object Map]",i2="[object Number]",lb="[object Object]",s2="[object RegExp]",o2="[object Set]",a2="[object String]",l2="[object Symbol]",u2="[object WeakMap]",c2="[object ArrayBuffer]",h2="[object DataView]",f2="[object Float32Array]",d2="[object Float64Array]",p2="[object Int8Array]",g2="[object Int16Array]",m2="[object Int32Array]",y2="[object Uint8Array]",b2="[object Uint8ClampedArray]",v2="[object Uint16Array]",w2="[object Uint32Array]",We={};We[ob]=We[QR]=We[c2]=We[h2]=We[ZR]=We[e2]=We[f2]=We[d2]=We[p2]=We[g2]=We[m2]=We[n2]=We[i2]=We[lb]=We[s2]=We[o2]=We[a2]=We[l2]=We[y2]=We[b2]=We[v2]=We[w2]=!0,We[t2]=We[ab]=We[u2]=!1;function ji(n,e,t,r,i,s){var o,a=e&YR,l=e&JR,u=e&XR;if(o!==void 0)return o;if(!st(n))return n;var c=_t(n);if(c){if(o=bR(n),!a)return Jm(n,o)}else{var h=Lt(n),f=h==ab||h==r2;if(Bn(n))return Vy(n,a);if(h==lb||h==ob||f&&!i){if(o=l||f?{}:nb(n),!a)return l?lR(n,tR(o,n)):oR(n,eR(o,n))}else{if(!We[h])return i?n:{};o=UR(n,h,a)}}s||(s=new Wt);var d=s.get(n);if(d)return d;s.set(n,o),KR(n)?n.forEach(function(m){o.add(ji(m,e,t,m,n,s))}):WR(n)&&n.forEach(function(m,v){o.set(v,ji(m,e,t,v,n,s))});var p=u?l?uR:Va:l?Fn:Ii,g=c?void 0:p(n);return KC(g||n,function(m,v){g&&(v=m,m=n[v]),Qm(o,v,ji(m,e,t,v,n,s))}),o}var _2=4;function Ka(n){return ji(n,_2)}var x2=1,E2=4;function Ze(n){return ji(n,x2|E2)}var S2="__lodash_hash_undefined__";function A2(n){return this.__data__.set(n,S2),this}function P2(n){return this.__data__.has(n)}function zn(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new vr;++e<t;)this.add(n[e])}zn.prototype.add=zn.prototype.push=A2,zn.prototype.has=P2;function O2(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Ya(n,e){return n.has(e)}var C2=1,T2=2;function ub(n,e,t,r,i,s){var o=t&C2,a=n.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(n),c=s.get(e);if(u&&c)return u==e&&c==n;var h=-1,f=!0,d=t&T2?new zn:void 0;for(s.set(n,e),s.set(e,n);++h<a;){var p=n[h],g=e[h];if(r)var m=o?r(g,p,h,e,n,s):r(p,g,h,n,e,s);if(m!==void 0){if(m)continue;f=!1;break}if(d){if(!O2(e,function(v,y){if(!Ya(d,y)&&(p===v||i(p,v,t,r,s)))return d.push(y)})){f=!1;break}}else if(!(p===g||i(p,g,t,r,s))){f=!1;break}}return s.delete(n),s.delete(e),f}function M2(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Ja(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var I2=1,R2=2,k2="[object Boolean]",N2="[object Date]",j2="[object Error]",L2="[object Map]",D2="[object Number]",B2="[object RegExp]",q2="[object Set]",F2="[object String]",$2="[object Symbol]",U2="[object ArrayBuffer]",z2="[object DataView]",cb=Nt?Nt.prototype:void 0,Xa=cb?cb.valueOf:void 0;function V2(n,e,t,r,i,s,o){switch(t){case z2:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case U2:return!(n.byteLength!=e.byteLength||!s(new Fs(n),new Fs(e)));case k2:case N2:case D2:return jn(+n,+e);case j2:return n.name==e.name&&n.message==e.message;case B2:case F2:return n==e+"";case L2:var a=M2;case q2:var l=r&I2;if(a||(a=Ja),n.size!=e.size&&!l)return!1;var u=o.get(n);if(u)return u==e;r|=R2,o.set(n,e);var c=ub(a(n),a(e),r,i,s,o);return o.delete(n),c;case $2:if(Xa)return Xa.call(n)==Xa.call(e)}return!1}var W2=1,G2=Object.prototype,H2=G2.hasOwnProperty;function K2(n,e,t,r,i,s){var o=t&W2,a=Va(n),l=a.length,u=Va(e),c=u.length;if(l!=c&&!o)return!1;for(var h=l;h--;){var f=a[h];if(!(o?f in e:H2.call(e,f)))return!1}var d=s.get(n),p=s.get(e);if(d&&p)return d==e&&p==n;var g=!0;s.set(n,e),s.set(e,n);for(var m=o;++h<l;){f=a[h];var v=n[f],y=e[f];if(r)var b=o?r(y,v,f,e,n,s):r(v,y,f,n,e,s);if(!(b===void 0?v===y||i(v,y,t,r,s):b)){g=!1;break}m||(m=f=="constructor")}if(g&&!m){var _=n.constructor,w=e.constructor;_!=w&&"constructor"in n&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof w=="function"&&w instanceof w)&&(g=!1)}return s.delete(n),s.delete(e),g}var Y2=1,hb="[object Arguments]",fb="[object Array]",$s="[object Object]",J2=Object.prototype,db=J2.hasOwnProperty;function X2(n,e,t,r,i,s){var o=_t(n),a=_t(e),l=o?fb:Lt(n),u=a?fb:Lt(e);l=l==hb?$s:l,u=u==hb?$s:u;var c=l==$s,h=u==$s,f=l==u;if(f&&Bn(n)){if(!Bn(e))return!1;o=!0,c=!1}if(f&&!c)return s||(s=new Wt),o||Ns(n)?ub(n,e,t,r,i,s):V2(n,e,l,t,r,i,s);if(!(t&Y2)){var d=c&&db.call(n,"__wrapped__"),p=h&&db.call(e,"__wrapped__");if(d||p){var g=d?n.value():n,m=p?e.value():e;return s||(s=new Wt),i(g,m,t,r,s)}}return f?(s||(s=new Wt),K2(n,e,t,r,i,s)):!1}function Us(n,e,t,r,i){return n===e?!0:n==null||e==null||!Vt(n)&&!Vt(e)?n!==n&&e!==e:X2(n,e,t,r,Us,i)}var Q2=1,Z2=2;function ek(n,e,t,r){var i=t.length,s=i;if(n==null)return!s;for(n=Object(n);i--;){var o=t[i];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++i<s;){o=t[i];var a=o[0],l=n[a],u=o[1];if(o[2]){if(l===void 0&&!(a in n))return!1}else{var c=new Wt,h;if(!(h===void 0?Us(u,l,Q2|Z2,r,c):h))return!1}}return!0}function pb(n){return n===n&&!st(n)}function tk(n){for(var e=Ii(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,pb(i)]}return e}function gb(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function rk(n){var e=tk(n);return e.length==1&&e[0][2]?gb(e[0][0],e[0][1]):function(t){return t===n||ek(t,n,e)}}function nk(n,e){return n!=null&&e in Object(n)}function mb(n,e,t){e=hy(e,n);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ds(e[r]);if(!(s=n!=null&&t(n,o)))break;n=n[o]}return s||++r!=i?s:(i=n==null?0:n.length,!!i&&ka(i)&&Ra(o,i)&&(_t(n)||Dn(n)))}function ik(n,e){return n!=null&&mb(n,e,nk)}var sk=1,ok=2;function ak(n,e){return ja(n)&&pb(e)?gb(Ds(n),e):function(t){var r=PM(t,n);return r===void 0&&r===e?ik(t,n):Us(e,r,sk|ok)}}function lk(n){return function(e){return e?.[n]}}function uk(n){return function(e){return Da(e,n)}}function ck(n){return ja(n)?lk(Ds(n)):uk(n)}function Qa(n){return typeof n=="function"?n:n==null?Nn:typeof n=="object"?_t(n)?ak(n[0],n[1]):rk(n):ck(n)}function hk(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var o=n[i];e(r,o,t(o),n)}return r}function fk(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(t(s[l],l,s)===!1)break}return e}}var yb=fk();function dk(n,e){return n&&yb(n,e,Ii)}function pk(n,e){return function(t,r){if(t==null)return t;if(!cn(t))return n(t,r);for(var i=t.length,s=-1,o=Object(t);++s<i&&r(o[s],s,o)!==!1;);return t}}var bb=pk(dk);function gk(n,e,t,r){return bb(n,function(i,s,o){e(r,i,t(i),o)}),r}function mk(n,e){return function(t,r){var i=_t(t)?hk:gk,s=e?e():{};return i(t,n,Qa(r),s)}}var Za=function(){return zt.Date.now()},yk="Expected a function",bk=Math.max,vk=Math.min;function wk(n,e,t){var r,i,s,o,a,l,u=0,c=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(yk);e=Ci(e)||0,st(t)&&(c=!!t.leading,h="maxWait"in t,s=h?bk(Ci(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function d(x){var E=r,A=i;return r=i=void 0,u=x,o=n.apply(A,E),o}function p(x){return u=x,a=setTimeout(v,e),c?d(x):o}function g(x){var E=x-l,A=x-u,O=e-E;return h?vk(O,s-A):O}function m(x){var E=x-l,A=x-u;return l===void 0||E>=e||E<0||h&&A>=s}function v(){var x=Za();if(m(x))return y(x);a=setTimeout(v,g(x))}function y(x){return a=void 0,f&&r?d(x):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function _(){return a===void 0?o:y(Za())}function w(){var x=Za(),E=m(x);if(r=arguments,i=this,l=x,E){if(a===void 0)return p(l);if(h)return clearTimeout(a),a=setTimeout(v,e),d(l)}return a===void 0&&(a=setTimeout(v,e)),o}return w.cancel=b,w.flush=_,w}var vb=Object.prototype,_k=vb.hasOwnProperty,xk=Ln(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Is(e[0],e[1],i)&&(r=1);++t<r;)for(var s=e[t],o=Fn(s),a=-1,l=o.length;++a<l;){var u=o[a],c=n[u];(c===void 0||jn(c,vb[u])&&!_k.call(n,u))&&(n[u]=s[u])}return n});function el(n,e,t){(t!==void 0&&!jn(n[e],t)||t===void 0&&!(e in n))&&Ms(n,e,t)}function zs(n){return Vt(n)&&cn(n)}function tl(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Ek(n){return Ti(n,Fn(n))}function Sk(n,e,t,r,i,s,o){var a=tl(n,t),l=tl(e,t),u=o.get(l);if(u){el(n,t,u);return}var c=s?s(a,l,t+"",n,e,o):void 0,h=c===void 0;if(h){var f=_t(l),d=!f&&Bn(l),p=!f&&!d&&Ns(l);c=l,f||d||p?_t(a)?c=a:zs(a)?c=Jm(a):d?(h=!1,c=Vy(l,!0)):p?(h=!1,c=rb(l,!0)):c=[]:nr(l)||Dn(l)?(c=a,Dn(a)?c=Ek(a):(!st(a)||Ta(a))&&(c=nb(l))):h=!1}h&&(o.set(l,c),i(c,l,r,s,o),o.delete(l)),el(n,t,c)}function Vs(n,e,t,r,i){n!==e&&yb(e,function(s,o){if(i||(i=new Wt),st(s))Sk(n,e,o,t,Vs,r,i);else{var a=r?r(tl(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),el(n,o,a)}},Fn)}function wb(n,e,t,r,i,s){return st(n)&&st(e)&&(s.set(e,n),Vs(n,e,void 0,wb,s),s.delete(e)),n}var Ak=ey(function(n,e,t,r){Vs(n,e,t,r)}),_b=Ln(function(n){return n.push(void 0,wb),Ym(Ak,void 0,n)}),Pk=200;function Ok(n,e,t,r){var i=-1,s=Xm,o=!0,a=n.length,l=[],u=e.length;if(!a)return l;e.length>=Pk&&(s=Ya,o=!1,e=new zn(e));e:for(;++i<a;){var c=n[i],h=c;if(c=c!==0?c:0,o&&h===h){for(var f=u;f--;)if(e[f]===h)continue e;l.push(c)}else s(e,h,r)||l.push(c)}return l}var Ck=Ln(function(n,e){return zs(n)?Ok(n,qa(e,1,zs,!0)):[]});function Tk(n,e){var t=-1,r=cn(n)?Array(n.length):[];return bb(n,function(i,s,o){r[++t]=e(i,s,o)}),r}var Mk=Object.prototype,Ik=Mk.hasOwnProperty,xb=mk(function(n,e,t){Ik.call(n,t)?n[t].push(e):Ms(n,t,[e])});function Rk(n,e){return n>e}var kk=Object.prototype,Nk=kk.hasOwnProperty;function jk(n,e){return n!=null&&Nk.call(n,e)}function Ws(n,e){return n!=null&&mb(n,e,jk)}var Lk="[object Map]",Dk="[object Set]",Bk=Object.prototype,qk=Bk.hasOwnProperty;function Eb(n){if(n==null)return!0;if(cn(n)&&(_t(n)||typeof n=="string"||typeof n.splice=="function"||Bn(n)||Ns(n)||Dn(n)))return!n.length;var e=Lt(n);if(e==Lk||e==Dk)return!n.size;if(Rs(n))return!cy(n).length;for(var t in n)if(qk.call(n,t))return!1;return!0}function wr(n,e){return Us(n,e)}var Fk="[object Number]";function Sb(n){return typeof n=="number"||Vt(n)&&qr(n)==Fk}var $k=_y("toLowerCase");function Uk(n,e,t){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!rr(o):t(o,a)))var a=o,l=s}return l}function zk(n){return n&&n.length?Uk(n,Nn,Rk):void 0}var ot=ey(function(n,e,t){Vs(n,e,t)});function Vk(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function Wk(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,s=rr(n),o=e!==void 0,a=e===null,l=e===e,u=rr(e);if(!a&&!u&&!s&&n>e||s&&o&&l&&!a&&!u||r&&o&&l||!t&&l||!i)return 1;if(!r&&!s&&!u&&n<e||u&&t&&i&&!r&&!s||a&&t&&i||!o&&i||!l)return-1}return 0}function Gk(n,e,t){for(var r=-1,i=n.criteria,s=e.criteria,o=i.length,a=t.length;++r<o;){var l=Wk(i[r],s[r]);if(l){if(r>=a)return l;var u=t[r];return l*(u=="desc"?-1:1)}}return n.index-e.index}function Hk(n,e,t){e.length?e=Cs(e,function(s){return _t(s)?function(o){return Da(o,s.length===1?s[0]:s)}:s}):e=[Nn];var r=-1;e=Cs(e,ks(Qa));var i=Tk(n,function(s,o,a){var l=Cs(e,function(u){return u(s)});return{criteria:l,index:++r,value:s}});return Vk(i,function(s,o){return Gk(s,o,t)})}var Kk=Ln(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Is(n,e[0],e[1])?e=[]:t>2&&Is(e[0],e[1],e[2])&&(e=[e[0]]),Hk(n,qa(e),[])}),Yk=4294967295,Jk=Yk-1,Xk=Math.floor,Qk=Math.min;function Ab(n,e,t,r){var i=0,s=n==null?0:n.length;if(s===0)return 0;e=t(e);for(var o=e!==e,a=e===null,l=rr(e),u=e===void 0;i<s;){var c=Xk((i+s)/2),h=t(n[c]),f=h!==void 0,d=h===null,p=h===h,g=rr(h);if(o)var m=p;else u?m=p&&f:a?m=p&&f&&!d:l?m=p&&f&&!d&&!g:d||g?m=!1:m=h<e;m?i=c+1:s=c}return Qk(s,Jk)}var Zk=4294967295,eN=Zk>>>1;function tN(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=eN){for(;r<i;){var s=r+i>>>1,o=n[s];o!==null&&!rr(o)&&o<e?r=s+1:i=s}return i}return Ab(n,e,Nn)}function rN(n,e){return tN(n,e)}function nN(n,e,t){return Ab(n,e,Qa(t))}var iN=qy(function(n,e,t){return n+(t?" ":"")+Bs(e)}),sN="Expected a function";function oN(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(sN);return st(t)&&(r="leading"in t?!0:r,i="trailing"in t?!!t.trailing:i),wk(n,e,{leading:r,maxWait:e,trailing:i})}var aN=1/0,lN=Un&&1/Ja(new Un([,-0]))[1]==aN?function(n){return new Un(n)}:FC,uN=200;function Pb(n,e,t){var r=-1,i=Xm,s=n.length,o=!0,a=[],l=a;if(s>=uN){var u=lN(n);if(u)return Ja(u);o=!1,i=Ya,l=new zn}else l=a;e:for(;++r<s;){var c=n[r],h=c;if(c=c!==0?c:0,o&&h===h){for(var f=l.length;f--;)if(l[f]===h)continue e;a.push(c)}else i(l,h,t)||(l!==a&&l.push(h),a.push(c))}return a}var Ob=Ln(function(n){return Pb(qa(n,1,zs,!0))});function Cb(n){return n&&n.length?Pb(n):[]}function Tb(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function ke(n,e,...t){return Tb(n,e,t)}function cN(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Mb(n){return n!=null&&(n instanceof Promise||cN(n))}function Ib(...n){const e=[];if(n.forEach(r=>{Array.isArray(r)?e.push(...r):e.push(r)}),e.some(r=>Mb(r))){const r=e.map(i=>Mb(i)?i:Promise.resolve(i!==!1));return Promise.all(r).then(i=>i.reduce((s,o)=>o!==!1&&s,!0))}return e.every(r=>r!==!1)}function rl(n,e){const t=[];for(let r=0;r<n.length;r+=2){const i=n[r],s=n[r+1],o=Array.isArray(e)?e:[e],a=Tb(i,s,o);t.push(a)}return Ib(t)}class hN{constructor(){this.listeners={}}on(e,t,r){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,r),this)}once(e,t,r){const i=(...s)=>(this.off(e,i),rl([t,r],s));return this.on(e,i,this)}off(e,t,r){if(!(e||t||r))return this.listeners={},this;const i=this.listeners;return(e?[e]:Object.keys(i)).forEach(o=>{const a=i[o];if(a){if(!(t||r)){delete i[o];return}for(let l=a.length-2;l>=0;l-=2)t&&a[l]!==t||r&&a[l+1]!==r||a.splice(l,2)}}),this}trigger(e,...t){let r=!0;if(e!=="*"){const s=this.listeners[e];s!=null&&(r=rl([...s],t))}const i=this.listeners["*"];return i!=null?Ib([r,rl([...i],[e,...t])]):r}emit(e,...t){return this.trigger(e,...t)}}function fN(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r))})})}const dN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function pN(n,e){dN(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}let gN=class{};const mN=/^\s*class\s+/.test(`${gN}`)||/^\s*class\s*\{/.test(`${class{}}`);function nl(n,e){let t;return mN?t=class extends e{}:(t=function(){return e.apply(this,arguments)},pN(t,e)),Object.defineProperty(t,"name",{value:n}),t}function Rb(n){return n==="__proto__"}function il(n,e,t="/"){let r;const i=Array.isArray(e)?e:e.split(t);if(i.length)for(r=n;i.length;){const s=i.shift();if(Object(r)===r&&s&&s in r)r=r[s];else return}return r}function Vn(n,e,t,r="/"){const i=Array.isArray(e)?e:e.split(r),s=i.pop();if(s&&!Rb(s)){let o=n;i.forEach(a=>{Rb(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[s]=t}return n}function kb(n,e,t="/"){const r=Array.isArray(e)?e.slice():e.split(t),i=r.pop();if(i)if(r.length>0){const s=il(n,r);s&&delete s[i]}else delete n[i];return n}var yN=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Rt extends hN{dispose(){this.off()}}yN([yr.dispose()],Rt.prototype,"dispose",null),(function(n){n.dispose=yr.dispose})(Rt||(Rt={})),fN(Rt,yr);const Nb=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},jb=Nb(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),sl=Nb(n=>iN(qs(n)).replace(/ /g,""));function ol(n){let e=2166136261,t=!1,r=n;for(let i=0,s=r.length;i<s;i+=1){let o=r.charCodeAt(i);o>127&&!t&&(r=unescape(encodeURIComponent(r)),o=r.charCodeAt(i),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Gs(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=Math.random()*16|0,o=i==="x"?s:i==="y"?s&3|8:i;n+=o.toString(16)}return n}function bN(n,e,t){const r=Math.min(2,Math.floor(n.length*.34));let i=Math.floor(n.length*.4)+1,s,o=!1;const a=n.toLowerCase();for(const l of e){const u=t(l);if(u!==void 0&&Math.abs(u.length-a.length)<=r){const c=u.toLowerCase();if(c===a){if(u===n)continue;return l}if(o||u.length<3)continue;const h=vN(a,c,i-1);if(h===void 0)continue;h<3?(o=!0,s=l):(i=h,s=l)}}return s}function vN(n,e,t){let r=new Array(e.length+1),i=new Array(e.length+1);const s=t+1;for(let a=0;a<=e.length;a+=1)r[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),u=a>t?a-t:1,c=e.length>t+a?t+a:e.length;i[0]=a;let h=a;for(let d=1;d<u;d+=1)i[d]=s;for(let d=u;d<=c;d+=1){const p=l===e.charCodeAt(d-1)?r[d-1]:Math.min(r[d]+1,i[d-1]+1,r[d-1]+2);i[d]=p,h=Math.min(h,p)}for(let d=c+1;d<=e.length;d+=1)i[d]=s;if(h>t)return;const f=r;r=i,i=f}const o=r[e.length];return o>t?void 0:o}function _r(n){return typeof n=="string"&&n.slice(-1)==="%"}function Gt(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),_r(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function fn(n){if(typeof n=="object"){let t=0,r=0,i=0,s=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(r=s=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(i=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=n.left),n.top!=null&&Number.isFinite(n.top)&&(r=n.top),n.right!=null&&Number.isFinite(n.right)&&(i=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(s=n.bottom),{top:r,right:i,bottom:s,left:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let al=!1,Lb=!1,Db=!1,Bb=!1,qb=!1,Fb=!1,$b=!1,Ub=!1,zb=!1,Vb=!1,Wb=!1,Gb=!1,Hb=!1,Kb=!1,Yb=!1,Jb=!1;if(typeof navigator=="object"){const n=navigator.userAgent;al=n.indexOf("Macintosh")>=0,Lb=!!n.match(/(iPad|iPhone|iPod)/g),Db=n.indexOf("Windows")>=0,Bb=n.indexOf("MSIE")>=0,qb=!!n.match(/Trident\/7\./),Fb=!!n.match(/Edge\//),$b=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,zb=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,Vb=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,Wb=n.indexOf("Firefox/")>=0,Gb=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(Jb=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Ub=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,Kb=window.PointerEvent!=null&&!al),typeof document=="object"){Hb="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){Yb=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var Fr;(function(n){n.IS_MAC=al,n.IS_IOS=Lb,n.IS_WINDOWS=Db,n.IS_IE=Bb,n.IS_IE11=qb,n.IS_EDGE=Fb,n.IS_NETSCAPE=$b,n.IS_CHROME_APP=Ub,n.IS_CHROME=zb,n.IS_OPERA=Vb,n.IS_FIREFOX=Wb,n.IS_SAFARI=Gb,n.SUPPORT_TOUCH=Hb,n.SUPPORT_POINTER=Kb,n.SUPPORT_PASSIVE=Yb,n.NO_FOREIGNOBJECT=Jb,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(Fr||(Fr={})),(function(n){function e(){const s=window.module;return s!=null&&s.hot!=null&&s.hot.status!=null?s.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;const r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function i(s){const o=document.createElement(r[s]||"div"),a=`on${s}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=i})(Fr||(Fr={}));const ll=/[\t\r\n\f]/g,ul=/\S+/g,Wn=n=>` ${n} `;function Gn(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Li(n,e){if(n==null||e==null)return!1;const t=Wn(Gn(n)),r=Wn(e);return n.nodeType===1?t.replace(ll," ").includes(r):!1}function qe(n,e){if(!(n==null||e==null)){if(typeof e=="function")return qe(n,e(Gn(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(ul)||[],r=Wn(Gn(n)).replace(ll," ");let i=t.reduce((s,o)=>s.indexOf(Wn(o))<0?`${s}${o} `:s,r);i=i.trim(),r!==i&&n.setAttribute("class",i)}}}function Dt(n,e){if(n!=null){if(typeof e=="function")return Dt(n,e(Gn(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(ul)||[],r=Wn(Gn(n)).replace(ll," ");let i=t.reduce((s,o)=>{const a=Wn(o);return s.indexOf(a)>-1?s.replace(a," "):s},r);i=e?i.trim():"",r!==i&&n.setAttribute("class",i)}}}function Xb(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?qe(n,e):Dt(n,e);return}if(typeof e=="function")return Xb(n,e(Gn(n),t),t);typeof e=="string"&&(e.match(ul)||[]).forEach(i=>{Li(n,i)?Dt(n,i):qe(n,i)})}}let Qb=0;function wN(){return Qb+=1,`v${Qb}`}function cl(n){return(n.id==null||n.id==="")&&(n.id=wN()),n.id}function $r(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const ft={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},Zb="1.1";function ev(n,e=document){return e.createElement(n)}function hl(n,e=ft.xhtml,t=document){return t.createElementNS(e,n)}function Ht(n,e=document){return hl(n,ft.svg,e)}function Hs(n){if(n){const t=`<svg xmlns="${ft.svg}" xmlns:xlink="${ft.xlink}" version="${Zb}">${n}</svg>`,{documentElement:r}=_N(t,{async:!1});return r}const e=document.createElementNS(ft.svg,"svg");return e.setAttributeNS(ft.xmlns,"xmlns:xlink",ft.xlink),e.setAttribute("version",Zb),e}function _N(n,e={}){let t;try{const r=new DOMParser;if(e.async!=null){const i=r;i.async=e.async}t=r.parseFromString(n,e.mimeType||"text/xml")}catch{t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function xN(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function fl(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function EN(n,e){return n.querySelectorAll(e)}function SN(n,e){return n.querySelector(e)}function tv(n,e,t){const r=n.ownerSVGElement;let i=n.parentNode;for(;i&&i!==t&&i!==r;){if(Li(i,e))return i;i=i.parentNode}return null}function rv(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Hn(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function Di(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Bi(n,e){(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&n.appendChild(r)})}function AN(n,e){const t=n.firstChild;return t?dl(t,e):Bi(n,e)}function dl(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(i=>{i!=null&&t.insertBefore(i,n)})}function PN(n,e){e?.appendChild(n)}function nv(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}const iv=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function ON(n,e){return n.getAttribute(e)}function sv(n,e){const t=av(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function pl(n,e,t){if(t==null)return sv(n,e);const r=av(e);r.ns&&typeof t=="string"?n.setAttributeNS(r.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function ov(n,e){Object.keys(e).forEach(t=>{pl(n,t,e[t])})}function Ue(n,e,t){if(e==null){const r=n.attributes,i={};for(let s=0;s<r.length;s+=1)i[r[s].name]=r[s].value;return i}if(typeof e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?ov(n,e):pl(n,e,t)}function av(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:ft[e[0]],local:e[1]}}return{ns:null,local:n}}function qi(n){const e={};return Object.keys(n).forEach(t=>{const r=iv.includes(t)?t:jb(t);e[r]=n[t]}),e}function Ks(n){const e={};return n.split(";").forEach(r=>{const i=r.trim();if(i){const s=i.split("=");s.length&&(e[s[0].trim()]=s[1]?s[1].trim():"")}}),e}function gl(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const r=typeof n[t]=="object",i=typeof e[t]=="object";let s,o;r&&i?(s=n[t],o=e[t]):r?(s=n[t],o=Ks(e[t])):i?(s=Ks(n[t]),o=e[t]):(s=Ks(n[t]),o=Ks(e[t])),n[t]=gl(s,o)}else n[t]=e[t]}),n}function CN(n,e,t={}){const r=t.offset||0,i=[],s=[];let o,a,l=null;for(let u=0;u<n.length;u+=1){o=s[u]=n[u];for(let c=0,h=e.length;c<h;c+=1){const f=e[c],d=f.start+r,p=f.end+r;u>=d&&u<p&&(typeof o=="string"?o=s[u]={t:n[u],attrs:f.attrs}:o.attrs=gl(gl({},o.attrs),f.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(c)))}a=s[u-1],a?st(o)&&st(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(i.push(l),l=o)):st(o)||st(a)?(l=l,i.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&i.push(l),i}function TN(n){return n.replace(/ /g," ")}var lv;(function(n){function e(u){const c="data:";return u.substr(0,c.length)===c}n.isDataUrl=e;function t(u,c){if(!u||e(u)){setTimeout(()=>c(null,u));return}const h=()=>{c(new Error(`Failed to load image: ${u}`))},f=window.FileReader?p=>{if(p.status===200){const g=new FileReader;g.onload=m=>{const v=m.target.result;c(null,v)},g.onerror=h,g.readAsDataURL(p.response)}else h()}:p=>{const g=m=>{const y=[];for(let b=0;b<m.length;b+=32768)y.push(String.fromCharCode.apply(null,m.subarray(b,b+32768)));return y.join("")};if(p.status===200){let m=u.split(".").pop()||"png";m==="svg"&&(m="svg+xml");const v=`data:image/${m};base64,`,y=new Uint8Array(p.response),b=v+btoa(g(y));c(null,b)}else h()},d=new XMLHttpRequest;d.responseType=window.FileReader?"blob":"arraybuffer",d.open("GET",u,!0),d.addEventListener("error",h),d.addEventListener("load",()=>f(d)),d.send()}n.imageToDataUri=t;function r(u){let c=u.replace(/\s/g,"");c=decodeURIComponent(c);const h=c.indexOf(","),f=c.slice(0,h),d=f.split(":")[1].split(";")[0],p=c.slice(h+1);let g;f.indexOf("base64")>=0?g=atob(p):g=unescape(encodeURIComponent(p));const m=new Uint8Array(g.length);for(let v=0;v<g.length;v+=1)m[v]=g.charCodeAt(v);return new Blob([m],{type:d})}n.dataUriToBlob=r;function i(u,c){const h=window.navigator.msSaveBlob;if(h)h(u,c);else{const f=window.URL.createObjectURL(u),d=document.createElement("a");d.href=f,d.download=c,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(f)}}n.downloadBlob=i;function s(u,c){const h=r(u);i(h,c)}n.downloadDataUri=s;function o(u){const c=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return c&&c[2]?c[2].replace(/\s+/," ").split(" "):null}function a(u){const c=parseFloat(u);return Number.isNaN(c)?null:c}function l(u,c={}){let h=null;const f=b=>(h==null&&(h=o(u)),h!=null?a(h[b]):null),d=b=>{const _=u.match(b);return _&&_[2]?a(_[2]):null};let p=c.width;if(p==null&&(p=d(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=f(2)),p==null)throw new Error("Can not parse width from svg string");let g=c.height;if(g==null&&(g=d(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=f(3)),g==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(lv||(lv={}));let dn;const MN={px(n){return n},mm(n){return dn*n},cm(n){return dn*n*10},in(n){return dn*n*25.4},pt(n){return dn*(25.4*n/72)},pc(n){return dn*(25.4*n/6)}};var uv;(function(n){function e(r,i,s){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=r+(s||"px"),a.height=i+(s||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),u={width:l.width||0,height:l.height||0};return document.body.removeChild(o),u}n.measure=e;function t(r,i){dn==null&&(dn=e("1","1","mm").width);const s=i?MN[i]:null;return s?s(r):r}n.toPx=t})(uv||(uv={}));const IN=/-(.)/g;function RN(n){return n.replace(IN,(e,t)=>t.toUpperCase())}const ml={},cv=["webkit","ms","moz","o"],hv=typeof document<"u"?document.createElement("div").style:{};function kN(n){for(let e=0;e<cv.length;e+=1){const t=cv[e]+n;if(t in hv)return t}return null}function NN(n){const e=RN(n);if(ml[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);ml[e]=e in hv?e:kN(t)}return ml[e]}function fv(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const jN={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function LN(n){return/^--/.test(n)}function DN(n,e,t){const r=window.getComputedStyle(n,null);return t?r.getPropertyValue(e)||void 0:r[e]||n.style[e]}function BN(n,e){return!jN[n]&&typeof e=="number"?`${e}px`:e}function Fi(n,e,t){if(typeof e=="string"){const r=LN(e);if(r||(e=NN(e)),t===void 0)return DN(n,e,r);r||(t=BN(e,t));const i=n.style;r?i.setProperty(e,t):i[e]=t;return}for(const r in e)Fi(n,r,e[r])}const Ys=new WeakMap;function dv(n,e){const t=qs(e),r=Ys.get(n);if(r)return r[t]}function qN(n,e,t){const r=qs(e),i=Ys.get(n);i?i[r]=t:Ys.set(n,{[r]:t})}function pn(n,e,t){if(!e){const r={};return Object.keys(Ys).forEach(i=>{r[i]=dv(n,i)}),r}if(typeof e=="string"){if(t===void 0)return dv(n,e);qN(n,e,t);return}for(const r in e)pn(n,r,e[r])}class Ie{get[Symbol.toStringTag](){return Ie.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,r){if(!e)throw new TypeError("Invalid element to create vector");let i;if(Ie.isVector(e))i=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")i=Hs();else if(e[0]==="<"){const s=Hs(e);i=document.importNode(s.firstChild,!0)}else i=document.createElementNS(ft.svg,e);else i=e;this.node=i,t&&this.setAttributes(t),r&&this.append(r)}transform(e,t){return e==null?Yn(this.node):(Yn(this.node,e,t),this)}translate(e,t=0,r={}){return e==null?xv(this.node):(xv(this.node,e,t,r),this)}rotate(e,t,r,i={}){return e==null?vl(this.node):(vl(this.node,e,t,r,i),this)}scale(e,t){return e==null?wl(this.node):(wl(this.node,e,t),this)}getTransformToElement(e){const t=Ie.toNode(e);return Vi(this.node,t)}removeAttribute(e){return sv(this.node,e),this}getAttribute(e){return ON(this.node,e)}setAttribute(e,t){return pl(this.node,e,t),this}setAttributes(e){return ov(this.node,e),this}attr(e,t){return e==null?Ue(this.node):typeof e=="string"&&t===void 0?Ue(this.node,e):(typeof e=="object"?Ue(this.node,e):Ue(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:Ie.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?Ie.create(t):Ie.create("defs").appendTo(e)}text(e,t={}){return gv(this.node,e,t),this}tagName(){return xN(this.node)}clone(){return Ie.create(this.node.cloneNode(!0))}remove(){return Hn(this.node),this}empty(){return Di(this.node),this}append(e){return Bi(this.node,Ie.toNodes(e)),this}appendTo(e){return PN(this.node,Ie.isVector(e)?e.node:e),this}prepend(e){return AN(this.node,Ie.toNodes(e)),this}before(e){return dl(this.node,Ie.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(Ie.toNode(e),this.node),Ie.create(e)}first(){return this.node.firstChild?Ie.create(this.node.firstChild):null}last(){return this.node.lastChild?Ie.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?Ie.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(Ie.toNode(e))}find(e){const t=[],r=EN(this.node,e);if(r)for(let i=0,s=r.length;i<s;i+=1)t.push(Ie.create(r[i]));return t}findOne(e){const t=SN(this.node,e);return t?Ie.create(t):null}findParentByClass(e,t){const r=tv(this.node,e,t);return r?Ie.create(r):null}matches(e){const t=this.node;this.node.matches;const r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return r&&r.call(t,e)}contains(e){return rv(this.node,Ie.isVector(e)?e.node:e)}wrap(e){const t=Ie.create(e),r=this.node.parentNode;return r?.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=Ie.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=Ie.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let r=0;r<e.length;r+=1)e[r].nodeType===1&&t.push(Ie.create(e[r]));return t}eachChild(e,t){const r=this.children();for(let i=0,s=r.length;i<s;i+=1)e.call(r[i],r[i],i,r),t&&r[i].eachChild(e,t);return this}index(){return fl(this.node)}hasClass(e){return Li(this.node,e)}addClass(e){return qe(this.node,e),this}removeClass(e){return Dt(this.node,e),this}toggleClass(e,t){return Xb(this.node,e,t),this}toLocalPoint(e,t){return sj(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?zN(this.node,e):[]}toPath(){return Ie.create(JN(this.node))}toPathData(){return wv(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=e;function t(o,a,l){return new n(o,a,l)}n.create=t;function r(o){if(o[0]==="<"){const a=Hs(o),l=[];for(let u=0,c=a.childNodes.length;u<c;u+=1){const h=a.childNodes[u];l.push(t(document.importNode(h,!0)))}return l}return[t(o)]}n.createVectors=r;function i(o){return e(o)?o.node:o}n.toNode=i;function s(o){return Array.isArray(o)?o.map(a=>i(a)):[i(o)]}n.toNodes=s})(Ie||(Ie={}));function FN(n,e){const t=Ie.create(e),r=Ie.create("textPath"),i=n.d;if(i&&n["xlink:href"]===void 0){const s=Ie.create("path").attr("d",i).appendTo(t.defs());r.attr("xlink:href",`#${s.id}`)}return typeof n=="object"&&r.attr(n),r.node}function $N(n,e,t){const r=t.eol,i=t.baseSize,s=t.lineHeight;let o=0,a;const l={},u=e.length-1;for(let c=0;c<=u;c+=1){let h=e[c],f=null;if(typeof h=="object"){const d=h.attrs,p=Ie.create("tspan",d);a=p.node;let g=h.t;r&&c===u&&(g+=r),a.textContent=g;const m=d.class;m&&p.addClass(m),t.includeAnnotationIndices&&p.attr("annotations",h.annotations.join(",")),f=parseFloat(d["font-size"]),f===void 0&&(f=i),f&&f>o&&(o=f)}else r&&c===u&&(h+=r),a=document.createTextNode(h||" "),i&&i>o&&(o=i);n.appendChild(a)}return o&&(l.maxFontSize=o),s?l.lineHeight=s:o&&(l.lineHeight=o*1.2),l}const pv=/em$/;function Js(n,e){const t=parseFloat(n);return pv.test(n)?t*e:t}function UN(n,e,t,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let s=e[0];const o=Js(s.maxFontSize,t)||t;let a=0;const l=Js(r,t);for(let h=1;h<i;h+=1){s=e[h];const f=Js(s.lineHeight,t)||l;a+=f}const u=Js(s.maxFontSize,t)||t;let c;switch(n){case"middle":c=o/2-.15*u-a/2;break;case"bottom":c=-(.25*u)-a;break;case"top":default:c=.8*o;break}return c}function gv(n,e,t={}){e=TN(e);const r=t.eol;let i=t.textPath;const s=t.textVerticalAnchor,o=s==="middle"||s==="bottom"||s==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const l=t.includeAnnotationIndices;let u=t.annotations;u&&!Array.isArray(u)&&(u=[u]);const c=t.lineHeight,h=c==="auto",f=h?"1.5em":c||"1em";let d=!0;const p=n.childNodes;if(p.length===1){const O=p[0];O&&O.tagName.toUpperCase()==="TITLE"&&(d=!1)}d&&Di(n),Ue(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const g=Ue(n,"font-size");let m=parseFloat(g);m||(m=16,(o||u)&&!g&&Ue(n,"font-size",`${m}`));let v;i?(typeof i=="string"&&(i={d:i}),v=FN(i,n)):v=document.createDocumentFragment();let y,b=0,_;const w=e.split(`
|
|
16
|
-
`),x=[],E=w.length-1;for(let O=0;O<=E;O+=1){y=f;let T="v-line";const M=Ht("tspan");let C,k=w[O];if(k)if(u){const N=CN(k,u,{offset:-b,includeAnnotationIndices:l});C=$N(M,N,{eol:O!==E&&r,baseSize:m,lineHeight:h?null:f,includeAnnotationIndices:l});const R=C.lineHeight;R&&h&&O!==0&&(y=R),O===0&&(_=C.maxFontSize*.8)}else r&&O!==E&&(k+=r),M.textContent=k;else{M.textContent="-",T+=" v-empty-line";const N=M.style;N.fillOpacity=0,N.strokeOpacity=0,u&&(C={})}C&&x.push(C),O>0&&M.setAttribute("dy",y),(O>0||i)&&M.setAttribute("x",a),M.className.baseVal=T,v.appendChild(M),b+=k.length+1}if(o)if(u)y=UN(s,x,m,f);else if(s==="top")y="0.8em";else{let O;switch(E>0?(O=parseFloat(f)||1,O*=E,pv.test(f)||(O/=m)):O=0,s){case"middle":y=`${.3-O/2}em`;break;case"bottom":y=`${-O-.3}em`;break}}else s===0?y="0em":s?y=s:(y=0,n.getAttribute("y")==null&&n.setAttribute("y",`${_||"0.8em"}`));v.firstChild.setAttribute("dy",y),n.appendChild(v)}function $i(n,e={}){const t=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const r=[],i=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return r.push(e["font-style"]||"normal"),r.push(e["font-variant"]||"normal"),r.push(e["font-weight"]||400),r.push(i),r.push(e["font-family"]||"sans-serif"),t.font=r.join(" "),t.measureText(n)}function mv(n,e,t,r={}){if(e>=t)return[n,""];const i=n.length,s={};let o=Math.round(e/t*i-1);for(o<0&&(o=0);o>=0&&o<i;){const a=n.slice(0,o),l=s[a]||$i(a,r).width,u=n.slice(0,o+1),c=s[u]||$i(u,r).width;if(s[a]=l,s[u]=c,l>e)o-=1;else if(c<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function yv(n,e,t={},r={}){const i=e.width,s=e.height,o=r.eol||`
|
|
17
|
-
`,a=t.fontSize||14,l=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),u=Math.floor(s/l);if(n.indexOf(o)>-1){const m=Gs(),v=[];return n.split(o).map(y=>{const b=yv(y,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},r),{eol:m}));b&&v.push(...b.split(m))}),v.slice(0,u).join(o)}const{width:c}=$i(n,t);if(c<i)return n;const h=[];let f=n,d=c,p=r.ellipsis,g=0;p&&(typeof p!="string"&&(p="…"),g=$i(p,t).width);for(let m=0;m<u;m+=1)if(d>i)if(m===u-1){const[y]=mv(f,i-g,d,t);h.push(p?`${y}${p}`:y)}else{const[y,b]=mv(f,i,d,t);h.push(y),f=b,d=$i(f,t).width}else{h.push(f);break}return h.join(o)}const yl=.551784;function bt(n,e,t=NaN){const r=n.getAttribute(e);if(r==null)return t;const i=parseFloat(r);return Number.isNaN(i)?t:i}function zN(n,e=1){const t=n.getTotalLength(),r=[];let i=0,s;for(;i<t;)s=n.getPointAtLength(i),r.push({distance:i,x:s.x,y:s.y}),i+=e;return r}function VN(n){return["M",bt(n,"x1"),bt(n,"y1"),"L",bt(n,"x2"),bt(n,"y2")].join(" ")}function WN(n){const e=Xs(n);return e.length===0?null:`${bv(e)} Z`}function GN(n){const e=Xs(n);return e.length===0?null:bv(e)}function bv(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function Xs(n){const e=[],t=n.points;if(t)for(let r=0,i=t.numberOfItems;r<i;r+=1)e.push(t.getItem(r));return e}function HN(n){const e=bt(n,"cx",0),t=bt(n,"cy",0),r=bt(n,"r"),i=r*yl;return["M",e,t-r,"C",e+i,t-r,e+r,t-i,e+r,t,"C",e+r,t+i,e+i,t+r,e,t+r,"C",e-i,t+r,e-r,t+i,e-r,t,"C",e-r,t-i,e-i,t-r,e,t-r,"Z"].join(" ")}function KN(n){const e=bt(n,"cx",0),t=bt(n,"cy",0),r=bt(n,"rx"),i=bt(n,"ry")||r,s=r*yl,o=i*yl;return["M",e,t-i,"C",e+s,t-i,e+r,t-o,e+r,t,"C",e+r,t+o,e+s,t+i,e,t+i,"C",e-s,t+i,e-r,t+o,e-r,t,"C",e-r,t-o,e-s,t-i,e,t-i,"Z"].join(" ")}function YN(n){return vv({x:bt(n,"x",0),y:bt(n,"y",0),width:bt(n,"width",0),height:bt(n,"height",0),rx:bt(n,"rx",0),ry:bt(n,"ry",0)})}function vv(n){let e;const t=n.x,r=n.y,i=n.width,s=n.height,o=Math.min(n.rx||n["top-rx"]||0,i/2),a=Math.min(n.rx||n["bottom-rx"]||0,i/2),l=Math.min(n.ry||n["top-ry"]||0,s/2),u=Math.min(n.ry||n["bottom-ry"]||0,s/2);return o||a||l||u?e=["M",t,r+l,"v",s-l-u,"a",a,u,0,0,0,a,u,"h",i-2*a,"a",a,u,0,0,0,a,-u,"v",-(s-u-l),"a",o,l,0,0,0,-o,-l,"h",-(i-2*o),"a",o,l,0,0,0,-o,l,"Z"]:e=["M",t,r,"H",t+i,"V",r+s,"H",t,"V",r,"Z"],e.join(" ")}function JN(n){const e=Ht("path");Ue(e,Ue(n));const t=wv(n);return t&&e.setAttribute("d",t),e}function wv(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return VN(n);case"polygon":return WN(n);case"polyline":return GN(n);case"ellipse":return KN(n);case"circle":return HN(n);case"rect":return YN(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const XN=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,_v=/[ ,]+/,QN=/^(\w+)\((.*)\)/;function ZN(n,e){const r=Ht("svg").createSVGPoint();return r.x=n,r.y=e,r}function dt(n){const t=Ht("svg").createSVGMatrix();if(n!=null){const r=n,i=t;for(const s in r)i[s]=r[s]}return t}function Ui(n){const e=Ht("svg");return n!=null?(n instanceof DOMMatrix||(n=dt(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function zi(n){let e=dt();const t=n!=null&&n.match(XN);if(!t)return e;for(let r=0,i=t.length;r<i;r+=1){const o=t[r].match(QN);if(o){let a,l,u,c,h,f=dt();const d=o[2].split(_v);switch(o[1].toLowerCase()){case"scale":a=parseFloat(d[0]),l=d[1]===void 0?a:parseFloat(d[1]),f=f.scaleNonUniform(a,l);break;case"translate":u=parseFloat(d[0]),c=parseFloat(d[1]),f=f.translate(u,c);break;case"rotate":h=parseFloat(d[0]),u=parseFloat(d[1])||0,c=parseFloat(d[2])||0,u!==0||c!==0?f=f.translate(u,c).rotate(h).translate(-u,-c):f=f.rotate(h);break;case"skewx":h=parseFloat(d[0]),f=f.skewX(h);break;case"skewy":h=parseFloat(d[0]),f=f.skewY(h);break;case"matrix":f.a=parseFloat(d[0]),f.b=parseFloat(d[1]),f.c=parseFloat(d[2]),f.d=parseFloat(d[3]),f.e=parseFloat(d[4]),f.f=parseFloat(d[5]);break;default:continue}e=e.multiply(f)}}return e}function Kn(n){const e=n||{},t=e.a!=null?e.a:1,r=e.b!=null?e.b:0,i=e.c!=null?e.c:0,s=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${r},${i},${s},${o},${a})`}function Qs(n){let e,t,r;if(n){const s=_v;if(n.trim().indexOf("matrix")>=0){const o=zi(n),a=ej(o);e=[a.translateX,a.translateY],t=[a.rotation],r=[a.scaleX,a.scaleY];const l=[];(e[0]!==0||e[1]!==0)&&l.push(`translate(${e.join(",")})`),(r[0]!==1||r[1]!==1)&&l.push(`scale(${r.join(",")})`),t[0]!==0&&l.push(`rotate(${t[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(s));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(s));const l=n.match(/scale\((.*?)\)/);l&&(r=l[1].split(s))}}const i=r&&r[0]?parseFloat(r[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function bl(n,e){const t=e.x*n.a+e.y*n.c+0,r=e.x*n.b+e.y*n.d+0;return{x:t,y:r}}function ej(n){const e=bl(n,{x:0,y:1}),t=bl(n,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(t.y,t.x);return{skewX:r,skewY:i,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:r}}function tj(n){let e,t,r,i;return n?(e=n.a==null?1:n.a,i=n.d==null?1:n.d,t=n.b,r=n.c):e=i=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:r?Math.sqrt(r*r+i*i):i}}function rj(n){let e={x:0,y:1};n&&(e=bl(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function nj(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Yn(n,e,t={}){if(e==null)return zi(Ue(n,"transform"));if(t.absolute){n.setAttribute("transform",Kn(e));return}const r=n.transform,i=Ui(e);r.baseVal.appendItem(i)}function xv(n,e,t=0,r={}){let i=Ue(n,"transform");const s=Qs(i);if(e==null)return s.translation;i=s.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const o=r.absolute?e:s.translation.tx+e,a=r.absolute?t:s.translation.ty+t,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${i}`.trim())}function vl(n,e,t,r,i={}){let s=Ue(n,"transform");const o=Qs(s);if(e==null)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=i.absolute?e:o.rotation.angle+e,l=t!=null&&r!=null?`,${t},${r}`:"",u=`rotate(${a}${l})`;n.setAttribute("transform",`${s} ${u}`.trim())}function wl(n,e,t){let r=Ue(n,"transform");const i=Qs(r);if(e==null)return i.scale;t=t??e,r=i.raw,r=r.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${t})`;n.setAttribute("transform",`${r} ${s}`.trim())}function Vi(n,e){if($r(e)&&$r(n)){const t=e.getScreenCTM(),r=n.getScreenCTM();if(t&&r)return t.inverse().multiply(r)}return dt()}function ij(n,e){let t=dt();if($r(e)&&$r(n)){let r=n;const i=[];for(;r&&r!==e;){const s=r.getAttribute("transform")||null,o=zi(s);i.push(o),r=r.parentNode}i.reverse().forEach(s=>{t=t.multiply(s)})}return t}function sj(n,e,t){const r=n instanceof SVGSVGElement?n:n.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=t;try{const s=r.getScreenCTM(),o=i.matrixTransform(s.inverse()),a=Vi(n,r).inverse();return o.matrixTransform(a)}catch{return i}}var Bt;(function(n){const e={};function t(s){return e[s]||{}}n.get=t;function r(s,o){e[s]=o}n.register=r;function i(s){delete e[s]}n.unregister=i})(Bt||(Bt={}));var gn;(function(n){const e=new WeakMap;function t(s){return e.has(s)||e.set(s,{events:Object.create(null)}),e.get(s)}n.ensure=t;function r(s){return e.get(s)}n.get=r;function i(s){return e.delete(s)}n.remove=i})(gn||(gn={}));var Ne;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(i){i.stopPropagation()}n.stopPropagationCallback=e;function t(i,s,o){i.addEventListener!=null&&i.addEventListener(s,o)}n.addEventListener=t;function r(i,s,o){i.removeEventListener!=null&&i.removeEventListener(s,o)}n.removeEventListener=r})(Ne||(Ne={})),(function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function r(a){return(a||"").match(e)||[""]}n.splitType=r;function i(a){const l=t.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(u=>u.trim()).sort():[]}}n.normalizeType=i;function s(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=s;function o(a,l){if(l){const u=a;return u.querySelector!=null&&u.querySelector(l)!=null}return!0}n.isValidSelector=o})(Ne||(Ne={})),(function(n){let e=0;const t=new WeakMap;function r(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=r;function i(a){return t.get(a)}n.getHandlerId=i;function s(a){return t.delete(a)}n.removeHandlerId=s;function o(a,l){return t.set(a,l)}n.setHandlerId=o})(Ne||(Ne={})),(function(n){function e(t,r){const i=[],s=gn.get(t),o=s&&s.events&&s.events[r.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(r.type==="click"&&typeof r.button=="number"&&r.button>=1)){for(let u=r.target;u!==t;u=u.parentNode||t)if(u.nodeType===1&&!(r.type==="click"&&u.disabled===!0)){const c=[],h={};for(let f=0;f<l;f+=1){const d=a[f],p=d.selector;if(p!=null&&h[p]==null){const g=t,m=[];g.querySelectorAll(p).forEach(v=>{m.push(v)}),h[p]=m.includes(u)}h[p]&&c.push(d)}c.length&&i.push({elem:u,handlers:c})}}return l<a.length&&i.push({elem:t,handlers:a.slice(l)}),i}n.getHandlerQueue=e})(Ne||(Ne={})),(function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e})(Ne||(Ne={})),(function(n){function e(t,r){const i=t.nodeType===9?t.documentElement:t,s=r&&r.parentNode;return t===s||!!(s&&s.nodeType===1&&(i.contains?i.contains(s):t.compareDocumentPosition&&t.compareDocumentPosition(s)&16))}n.contains=e})(Ne||(Ne={}));class ir{constructor(e,t){this.isDefaultPrevented=Ne.returnFalse,this.isPropagationStopped=Ne.returnFalse,this.isImmediatePropagationStopped=Ne.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const r=this.originalEvent;this.isDefaultPrevented=Ne.returnTrue,r&&!this.isSimulated&&r.preventDefault()},this.stopPropagation=()=>{const r=this.originalEvent;this.isPropagationStopped=Ne.returnTrue,r&&!this.isSimulated&&r.stopPropagation()},this.stopImmediatePropagation=()=>{const r=this.originalEvent;this.isImmediatePropagationStopped=Ne.returnTrue,r&&!this.isSimulated&&r.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ne.returnTrue:Ne.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(ir||(ir={})),(function(n){function e(t,r){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof r=="function"?function(){if(this.originalEvent)return r(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(i){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:i})}})}n.addProperty=e})(ir||(ir={})),(function(n){const e={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(e).forEach(t=>n.addProperty(t,e[t]))})(ir||(ir={})),(function(n){Bt.register("load",{noBubble:!0})})(),(function(n){Bt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})})(),(function(n){Bt.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!Ne.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseover"),r}}),Bt.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let r;const i=t.relatedTarget,s=t.handleObj;return(!i||i!==e&&!Ne.contains(e,i))&&(t.type=s.originType,r=s.handler.call(e,t),t.type="mouseout"),r}})})();var oj=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Wi;(function(n){let e;function t(o,a,l,u,c){if(!Ne.isValidTarget(o))return;let h;if(typeof l!="function"){const{handler:g,selector:m}=l,v=oj(l,["handler","selector"]);l=g,c=m,h=v}const f=gn.ensure(o);let d=f.handler;d==null&&(d=f.handler=function(g,...m){return e!==g.type?i(o,g,...m):void 0});const p=Ne.ensureHandlerId(l);Ne.splitType(a).forEach(g=>{const{originType:m,namespaces:v}=Ne.normalizeType(g);if(!m)return;let y=m,b=Bt.get(y);y=(c?b.delegateType:b.bindType)||y,b=Bt.get(y);const _=Object.assign({type:y,originType:m,data:u,selector:c,guid:p,handler:l,namespace:v.join(".")},h),w=f.events;let x=w[y];x||(x=w[y]={handlers:[],delegateCount:0},(!b.setup||b.setup(o,u,v,d)===!1)&&Ne.addEventListener(o,y,d)),b.add&&(Ne.removeHandlerId(_.handler),b.add(o,_),Ne.setHandlerId(_.handler,p)),c?(x.handlers.splice(x.delegateCount,0,_),x.delegateCount+=1):x.handlers.push(_)})}n.on=t;function r(o,a,l,u,c){const h=gn.get(o);if(!h)return;const f=h.events;f&&(Ne.splitType(a).forEach(d=>{const{originType:p,namespaces:g}=Ne.normalizeType(d);if(!p){Object.keys(f).forEach(w=>{r(o,w+d,l,u,!0)});return}let m=p;const v=Bt.get(m);m=(u?v.delegateType:v.bindType)||m;const y=f[m];if(!y)return;const b=g.length>0?new RegExp(`(^|\\.)${g.join("\\.(?:.*\\.|)")}(\\.|$)`):null,_=y.handlers.length;for(let w=y.handlers.length-1;w>=0;w-=1){const x=y.handlers[w];(c||p===x.originType)&&(!l||Ne.getHandlerId(l)===x.guid)&&(b==null||x.namespace&&b.test(x.namespace))&&(u==null||u===x.selector||u==="**"&&x.selector)&&(y.handlers.splice(w,1),x.selector&&(y.delegateCount-=1),v.remove&&v.remove(o,x))}_&&y.handlers.length===0&&((!v.teardown||v.teardown(o,g,h.handler)===!1)&&Ne.removeEventListener(o,m,h.handler),delete f[m])}),Object.keys(f).length===0&&gn.remove(o))}n.off=r;function i(o,a,...l){const u=ir.create(a);u.delegateTarget=o;const c=Bt.get(u.type);if(c.preDispatch&&c.preDispatch(o,u)===!1)return;const h=Ne.getHandlerQueue(o,u);for(let f=0,d=h.length;f<d&&!u.isPropagationStopped();f+=1){const p=h[f];u.currentTarget=p.elem;for(let g=0,m=p.handlers.length;g<m&&!u.isImmediatePropagationStopped();g+=1){const v=p.handlers[g];if(u.rnamespace==null||v.namespace&&u.rnamespace.test(v.namespace)){u.handleObj=v,u.data=v.data;const y=Bt.get(v.originType).handle,b=y?y(p.elem,u,...l):v.handler.call(p.elem,u,...l);b!==void 0&&(u.result=b,b===!1&&(u.preventDefault(),u.stopPropagation()))}}}return c.postDispatch&&c.postDispatch(o,u),u.result}n.dispatch=i;function s(o,a,l,u){let c=o,h=typeof o=="string"?o:o.type,f=typeof o=="string"||c.namespace==null?[]:c.namespace.split(".");const d=l;if(d.nodeType===3||d.nodeType===8)return;h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort());const p=h.indexOf(":")<0&&`on${h}`;c=o instanceof ir?o:new ir(h,typeof o=="object"?o:null),c.namespace=f.join("."),c.rnamespace=c.namespace?new RegExp(`(^|\\.)${f.join("\\.(?:.*\\.|)")}(\\.|$)`):null,c.result=void 0,c.target||(c.target=d);const g=[c];Array.isArray(a)?g.push(...a):g.push(a);const m=Bt.get(h);if(!u&&m.trigger&&m.trigger(d,c,a)===!1)return;let v;const y=[d];if(!u&&!m.noBubble&&!Ne.isWindow(d)){v=m.delegateType||h;let _=d,w=d.parentNode;for(;w!=null;)y.push(w),_=w,w=w.parentNode;const x=d.ownerDocument||document;if(_===x){const E=_.defaultView||_.parentWindow||window;y.push(E)}}let b=d;for(let _=0,w=y.length;_<w&&!c.isPropagationStopped();_+=1){const x=y[_];b=x,c.type=_>1?v:m.bindType||h;const E=gn.get(x);E&&E.events[c.type]&&E.handler&&E.handler.call(x,...g);const A=p&&x[p]||null;A&&Ne.isValidTarget(x)&&(c.result=A.call(x,...g),c.result===!1&&c.preventDefault())}if(c.type=h,!u&&!c.isDefaultPrevented()){const _=m.preventDefault;if((_==null||_(y.pop(),c,a)===!1)&&Ne.isValidTarget(d)&&p&&typeof d[h]=="function"&&!Ne.isWindow(d)){const w=d[p];w&&(d[p]=null),e=h,c.isPropagationStopped()&&b.addEventListener(h,Ne.stopPropagationCallback),d[h](),c.isPropagationStopped()&&b.removeEventListener(h,Ne.stopPropagationCallback),e=void 0,w&&(d[p]=w)}}return c.result}n.trigger=s})(Wi||(Wi={}));var vt;(function(n){function e(s,o,a,l,u){return Gi.on(s,o,a,l,u),s}n.on=e;function t(s,o,a,l,u){return Gi.on(s,o,a,l,u,!0),s}n.once=t;function r(s,o,a,l){return Gi.off(s,o,a,l),s}n.off=r;function i(s,o,a,l){return Wi.trigger(o,a,s,l),s}n.trigger=i})(vt||(vt={}));var Gi;(function(n){function e(r,i,s,o,a,l){if(typeof i=="object"){typeof s!="string"&&(o=o||s,s=void 0),Object.keys(i).forEach(u=>e(r,u,s,o,i[u],l));return}if(o==null&&a==null?(a=s,o=s=void 0):a==null&&(typeof s=="string"?(a=o,o=void 0):(a=o,o=s,s=void 0)),a===!1)a=Ne.returnFalse;else if(!a)return;if(l){const u=a;a=function(c,...h){return n.off(r,c),u.call(this,c,...h)},Ne.setHandlerId(a,Ne.ensureHandlerId(u))}Wi.on(r,i,a,o,s)}n.on=e;function t(r,i,s,o){const a=i;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;t(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof i=="object"){const l=i;Object.keys(l).forEach(u=>t(r,u,s,l[u]));return}(s===!1||typeof s=="function")&&(o=s,s=void 0),o===!1&&(o=Ne.returnFalse),Wi.off(r,i,o,s)}n.off=t})(Gi||(Gi={}));class Ev{constructor(e,t,r){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=Fr.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,this.onWheelGuard=r,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Sv(n,e=60){let t=null;return(...r)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,r)},e)}}function aj(n){let e=null,t=[];const r=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",i),i()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},i=Sv(()=>{t.forEach(l=>l(n))}),s=l=>{e||(e=r()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:s,destroy:o,unbind:l=>{const u=t.indexOf(l);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}function lj(n){let e=null,t=[];const r=Sv(()=>{t.forEach(l=>{l(n)})}),i=()=>{const l=new ResizeObserver(r);return l.observe(n),r(),l},s=l=>{e||(e=i()),t.indexOf(l)===-1&&t.push(l)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:s,destroy:o,unbind:l=>{const u=t.indexOf(l);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}const uj=typeof ResizeObserver<"u"?lj:aj;var Zs;(function(n){const e=new WeakMap;function t(i){let s=e.get(i);return s||(s=uj(i),e.set(i,s),s)}function r(i){i.destroy(),e.delete(i.element)}n.bind=(i,s)=>{const o=t(i);return o.bind(s),()=>o.unbind(s)},n.clear=i=>{const s=t(i);r(s)}})(Zs||(Zs={}));class Hi{constructor(e={}){this.comparator=e.comparator||Hi.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,r){const i={priority:e,value:t},s=this.data.length;return r&&(i.id=r,this.index[r]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(e,t){const r=this.index[e];if(typeof r>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const i=this.data,s=i[r].priority,o=this.comparator(t,s);o<0?(i[r].priority=t,this.bubbleUp(r)):o>0&&(i[r].priority=t,this.bubbleDown(r))}remove(){const e=this.data,t=e[0],r=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=r,r.id&&(this.index[r.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let r,i,s=e;for(;s>0&&(i=s-1>>>1,this.comparator(t[s].priority,t[i].priority)<0);){r=t[i],t[i]=t[s];let o=t[s].id;o!=null&&(this.index[o]=i),t[s]=r,o=t[s].id,o!=null&&(this.index[o]=s),s=i}}bubbleDown(e){const t=this.data,r=t.length-1;let i=e;for(;;){const s=(i<<1)+1,o=s+1;let a=i;if(s<=r&&this.comparator(t[s].priority,t[a].priority)<0&&(a=s),o<=r&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==i){const l=t[a];t[a]=t[i];let u=t[i].id;u!=null&&(this.index[u]=a),t[i]=l,u=t[i].id,u!=null&&(this.index[u]=i),i=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(Hi||(Hi={}));var _l;(function(n){function e(t,r,i=(s,o)=>1){const s={},o={},a={},l=new Hi;for(s[r]=0,Object.keys(t).forEach(u=>{u!==r&&(s[u]=1/0),l.insert(s[u],u,u)});!l.isEmpty();){const u=l.remove();a[u]=!0;const c=t[u]||[];for(let h=0;h<c.length;h+=1){const f=c[h];if(!a[f]){const d=s[u]+i(u,f);d<s[f]&&(s[f]=d,o[f]=u,l.updatePriority(f,d))}}}return o}n.run=e})(_l||(_l={}));class xr{constructor(e,t,r,i){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,r,i);if(typeof e=="string")return xr.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,r){this.set(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}lighten(e){const t=xr.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,r,i){const s=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:r,l=Array.isArray(e)?e[3]:i;return this.r=Math.round(jt(s,0,255)),this.g=Math.round(jt(o,0,255)),this.b=Math.round(jt(a,0,255)),this.a=l==null?1:jt(l,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const r=this[t].toString(16);return r.length<2?`0${r}`:r}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return xr.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return xr.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function e(b){return new n(b)}n.fromArray=e;function t(b){return new n([...p(b),1])}n.fromHex=t;function r(b){const _=b.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(_){const w=_[1].split(/\s*,\s*/).map(x=>parseInt(x,10));return new n(w)}return null}n.fromRGBA=r;function i(b,_,w){w<0&&++w,w>1&&--w;const x=6*w;return x<1?b+(_-b)*x:2*w<1?_:3*w<2?b+(_-b)*(2/3-w)*6:b}function s(b){const _=b.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(_){const w=_[2].split(/\s*,\s*/),x=(parseFloat(w[0])%360+360)%360/360,E=parseFloat(w[1])/100,A=parseFloat(w[2])/100,O=w[3]==null?1:parseInt(w[3],10);return new n(u(x,E,A,O))}return null}n.fromHSLA=s;function o(b){if(b.startsWith("#"))return t(b);if(b.startsWith("rgb"))return r(b);const _=n.named[b];return _?t(_):s(b)}n.fromString=o;function a(b,_){return n.fromArray([b,b,b,_])}n.makeGrey=a;function l(b,_,w,x){const E=Array.isArray(b)?b[0]:b,A=Array.isArray(b)?b[1]:_,O=Array.isArray(b)?b[2]:w,T=Array.isArray(b)?b[3]:x,M=Math.max(E,A,O),C=Math.min(E,A,O),k=(M+C)/2;let N=0,R=0;if(C!==M){const $=M-C;switch(R=k>.5?$/(2-M-C):$/(M+C),M){case E:N=(A-O)/$+(A<O?6:0);break;case A:N=(O-E)/$+2;break;case O:N=(E-A)/$+4;break}N/=6}return[N,R,k,T??1]}n.rgba2hsla=l;function u(b,_,w,x){const E=Array.isArray(b)?b[0]:b,A=Array.isArray(b)?b[1]:_,O=Array.isArray(b)?b[2]:w,T=Array.isArray(b)?b[3]:x,M=O<=.5?O*(A+1):O+A-O*A,C=2*O-M;return[i(C,M,E+1/3)*256,i(C,M,E)*256,i(C,M,E-1/3)*256,T??1]}n.hsla2rgba=u;function c(b){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),b?void 0:parseFloat(Math.random().toFixed(2)))}n.random=c;function h(){const b="0123456789ABCDEF";let _="#";for(let w=0;w<6;w+=1)_+=b[Math.floor(Math.random()*16)];return _}n.randomHex=h;function f(b){return c(b).toString()}n.randomRGBA=f;function d(b,_){if(typeof b=="string"){const O=b[0]==="#",[T,M,C]=p(b);return _?T*.299+M*.587+C*.114>186?"#000000":"#ffffff":`${O?"#":""}${g(255-T,255-M,255-C)}`}const w=b[0],x=b[1],E=b[2],A=b[3];return _?w*.299+x*.587+E*.114>186?[0,0,0,A]:[255,255,255,A]:[255-w,255-x,255-E,A]}n.invert=d;function p(b){const _=b.indexOf("#")===0?b:`#${b}`;let w=+`0x${_.substr(1)}`;if(!(_.length===4||_.length===7)||Number.isNaN(w))throw new Error("Invalid hex color.");const x=_.length===4?4:8,E=(1<<x)-1,A=["b","g","r"].map(()=>{const O=w&E;return w>>=x,x===4?17*O:O});return[A[2],A[1],A[0]]}function g(b,_,w){const x=E=>E.length<2?`0${E}`:E;return`${x(b.toString(16))}${x(_.toString(16))}${x(w.toString(16))}`}function m(b,_){return y(b,_)}n.lighten=m;function v(b,_){return y(b,-_)}n.darken=v;function y(b,_){if(typeof b=="string"){const E=b[0]==="#",A=parseInt(E?b.substr(1):b,16),O=jt((A>>16)+_,0,255),T=jt((A>>8&255)+_,0,255),M=jt((A&255)+_,0,255);return`${E?"#":""}${(M|T<<8|O<<16).toString(16)}`}const w=g(b[0],b[1],b[2]),x=p(y(w,_));return[x[0],x[1],x[2],b[3]]}})(xr||(xr={})),(function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}})(xr||(xr={}));class xl{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const r=this.map.get(e);return this.map.delete(e),r}each(e){this.arr.forEach(t=>{const r=this.map.get(t);e(r,t)})}dispose(){this.clear()}}var Jn;(function(n){function e(i){const s=[],o=[];return Array.isArray(i)?s.push(...i):i.split("|").forEach(a=>{a.indexOf("&")===-1?s.push(a):o.push(...a.split("&"))}),{or:s,and:o}}n.parse=e;function t(i,s){if(i!=null&&s!=null){const o=e(i),a=e(s),l=o.or.sort(),u=a.or.sort(),c=o.and.sort(),h=a.and.sort(),f=(d,p)=>d.length===p.length&&(d.length===0||d.every((g,m)=>g===p[m]));return f(l,u)&&f(c,h)}return i==null&&s==null}n.equals=t;function r(i,s,o){if(s==null||Array.isArray(s)&&s.length===0)return o?i.altKey!==!0&&i.ctrlKey!==!0&&i.metaKey!==!0&&i.shiftKey!==!0:!0;const{or:a,and:l}=e(s),u=c=>{const h=`${c.toLowerCase()}Key`;return i[h]===!0};return a.some(c=>u(c))&&l.every(c=>u(c))}n.isMatch=r})(Jn||(Jn={}));var mn;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=(e=>{for(let t=0,r=1;;t+=r,r/=2)if(e>=(7-4*t)/11){const i=(11-6*t-11*e)/4;return-i*i+r*r}})})(mn||(mn={})),(function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,r=1){return i=>{const s=e(i);return s<t?t:s>r?r:s}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}})(mn||(mn={})),(function(n){function e(R){return-1*Math.cos(R*(Math.PI/2))+1}n.easeInSine=e;function t(R){return Math.sin(R*(Math.PI/2))}n.easeOutSine=t;function r(R){return-.5*(Math.cos(Math.PI*R)-1)}n.easeInOutSine=r;function i(R){return R*R}n.easeInQuad=i;function s(R){return R*(2-R)}n.easeOutQuad=s;function o(R){return R<.5?2*R*R:-1+(4-2*R)*R}n.easeInOutQuad=o;function a(R){return R*R*R}n.easeInCubic=a;function l(R){const $=R-1;return $*$*$+1}n.easeOutCubic=l;function u(R){return R<.5?4*R*R*R:(R-1)*(2*R-2)*(2*R-2)+1}n.easeInOutCubic=u;function c(R){return R*R*R*R}n.easeInQuart=c;function h(R){const $=R-1;return 1-$*$*$*$}n.easeOutQuart=h;function f(R){const $=R-1;return R<.5?8*R*R*R*R:1-8*$*$*$*$}n.easeInOutQuart=f;function d(R){return R*R*R*R*R}n.easeInQuint=d;function p(R){const $=R-1;return 1+$*$*$*$*$}n.easeOutQuint=p;function g(R){const $=R-1;return R<.5?16*R*R*R*R*R:1+16*$*$*$*$*$}n.easeInOutQuint=g;function m(R){return R===0?0:Math.pow(2,10*(R-1))}n.easeInExpo=m;function v(R){return R===1?1:-Math.pow(2,-10*R)+1}n.easeOutExpo=v;function y(R){if(R===0||R===1)return R;const $=R*2,G=$-1;return $<1?.5*Math.pow(2,10*G):.5*(-Math.pow(2,-10*G)+2)}n.easeInOutExpo=y;function b(R){const $=R/1;return-1*(Math.sqrt(1-$*R)-1)}n.easeInCirc=b;function _(R){const $=R-1;return Math.sqrt(1-$*$)}n.easeOutCirc=_;function w(R){const $=R*2,G=$-2;return $<1?-.5*(Math.sqrt(1-$*$)-1):.5*(Math.sqrt(1-G*G)+1)}n.easeInOutCirc=w;function x(R,$=1.70158){return R*R*(($+1)*R-$)}n.easeInBack=x;function E(R,$=1.70158){const G=R/1-1;return G*G*(($+1)*G+$)+1}n.easeOutBack=E;function A(R,$=1.70158){const G=R*2,H=G-2,se=$*1.525;return G<1?.5*G*G*((se+1)*G-se):.5*(H*H*((se+1)*H+se)+2)}n.easeInOutBack=A;function O(R,$=.7){if(R===0||R===1)return R;const H=R/1-1,se=1-$,V=se/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*H)*Math.sin((H-V)*(2*Math.PI)/se))}n.easeInElastic=O;function T(R,$=.7){const G=1-$,H=R*2;if(R===0||R===1)return R;const se=G/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*H)*Math.sin((H-se)*(2*Math.PI)/G)+1}n.easeOutElastic=T;function M(R,$=.65){const G=1-$;if(R===0||R===1)return R;const H=R*2,se=H-1,V=G/(2*Math.PI)*Math.asin(1);return H<1?-.5*(Math.pow(2,10*se)*Math.sin((se-V)*(2*Math.PI)/G)):Math.pow(2,-10*se)*Math.sin((se-V)*(2*Math.PI)/G)*.5+1}n.easeInOutElastic=M;function C(R){const $=R/1;if($<1/2.75)return 7.5625*$*$;if($<2/2.75){const G=$-.5454545454545454;return 7.5625*G*G+.75}if($<2.5/2.75){const G=$-.8181818181818182;return 7.5625*G*G+.9375}{const G=$-.9545454545454546;return 7.5625*G*G+.984375}}n.easeOutBounce=C;function k(R){return 1-C(1-R)}n.easeInBounce=k;function N(R){return R<.5?k(R*2)*.5:C(R*2-1)*.5+.5}n.easeInOutBounce=N})(mn||(mn={}));var yn;(function(n){n.number=(e,t)=>{const r=t-e;return i=>e+r*i},n.object=(e,t)=>{const r=Object.keys(e);return i=>{const s={};for(let o=r.length-1;o!==-1;o-=1){const a=r[o];s[a]=e[a]+(t[a]-e[a])*i}return s}},n.unit=(e,t)=>{const r=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=r.exec(e),s=r.exec(t),o=s?s[1]:"",a=i?+i[1]:0,l=s?+s[1]:0,u=o.indexOf("."),c=u>0?o[1].length-u-1:0,h=l-a,f=i?i[2]:"";return d=>(a+h*d).toFixed(c)+f},n.color=(e,t)=>{const r=parseInt(e.slice(1),16),i=parseInt(t.slice(1),16),s=r&255,o=(i&255)-s,a=r&65280,l=(i&65280)-a,u=r&16711680,c=(i&16711680)-u;return h=>{const f=s+o*h&255,d=a+l*h&65280,p=u+c*h&16711680;return`#${(1<<24|f|d|p).toString(16).slice(1)}`}}})(yn||(yn={}));const Ki=[];function cj(n,e){const t=Ki.find(r=>r.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!Fr.isApplyingHMR()){const r=document.createElement("style");r.setAttribute("type","text/css"),r.textContent=e;const i=document.querySelector("head");i&&i.insertBefore(r,i.firstChild),Ki.push({name:n,loadTimes:1,styleElement:r})}}function hj(n){const e=Ki.findIndex(t=>t.name===n);if(e>-1){const t=Ki[e];if(t.loadTimes-=1,t.loadTimes>0)return;let r=t.styleElement;r&&r.parentNode&&r.parentNode.removeChild(r),r=null,Ki.splice(e,1)}}var ze;(function(n){function e(r){return 180*r/Math.PI%360}n.toDeg=e,n.toRad=function(r,i=!1){return(i?r:r%360)*Math.PI/180};function t(r){return r%360+(r<0?360:0)}n.normalize=t})(ze||(ze={}));var Ve;(function(n){function e(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=e;function t(a,l){let u,c;if(l==null?(c=a??1,u=0):(c=l,u=a??0),c<u){const h=u;u=c,c=h}return Math.floor(Math.random()*(c-u+1)+u)}n.random=t;function r(a,l,u){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(u)?0:l<u?a<l?l:a>u?u:a:a<u?u:a>l?l:a}n.clamp=r;function i(a,l){return l*Math.round(a/l)}n.snapToGrid=i;function s(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=s;function o(a,l){const u=a.x-l.x,c=a.y-l.y;return u*u+c*c}n.squaredLength=o})(Ve||(Ve={}));class Ur{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class W extends Ur{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=Ve.round(this.x,e),this.y=Ve.round(this.y,e),this}add(e,t){const r=W.create(e,t);return this.x+=r.x,this.y+=r.y,this}update(e,t){const r=W.create(e,t);return this.x=r.x,this.y=r.y,this}translate(e,t){const r=W.create(e,t);return this.x+=r.x,this.y+=r.y,this}rotate(e,t){const r=W.rotate(this,e,t);return this.x=r.x,this.y=r.y,this}scale(e,t,r=new W){const i=W.create(r);return this.x=i.x+e*(this.x-i.x),this.y=i.y+t*(this.y-i.y),this}closest(e){if(e.length===1)return W.create(e[0]);let t=null,r=1/0;return e.forEach(i=>{const s=this.squaredDistance(i);s<r&&(t=i,r=s)}),t?W.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=W.create(e),r=this.x-t.x,i=this.y-t.y;return r*r+i*i}manhattanDistance(e){const t=W.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new W){const t=W.create(e),r=-(t.y-this.y),i=t.x-this.x;let s=Math.atan2(r,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let r=this.theta(t)-this.theta(e);return r<0&&(r+=360),r}vectorAngle(e){return new W(0,0).angleBetween(this,e)}toPolar(e){return this.update(W.toPolar(this,e)),this}changeInAngle(e,t,r=new W){return this.clone().translate(-e,-t).theta(r)-this.theta(r)}adhereToRect(e){return Ve.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=W.create(e),r=ze.toRad(this.y),i=ze.toRad(t.y),s=this.x,o=t.x,a=ze.toRad(o-s),l=Math.sin(a)*Math.cos(i),u=Math.cos(r)*Math.sin(i)-Math.sin(r)*Math.cos(i)*Math.cos(a),c=ze.toDeg(Math.atan2(l,u)),h=["NE","E","SE","S","SW","W","NW","N"];let f=c-22.5;return f<0&&(f+=360),f=parseInt(f/45,10),h[f]}cross(e,t){if(e!=null&&t!=null){const r=W.create(e),i=W.create(t);return(i.x-this.x)*(r.y-this.y)-(i.y-this.y)*(r.x-this.x)}return NaN}dot(e){const t=W.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new W(this.x-e,this.y-t);const r=W.create(e);return new W(this.x-r.x,this.y-r.y)}lerp(e,t){const r=W.create(e);return new W((1-t)*this.x+t*r.x,(1-t)*this.y+t*r.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const r=W.create(e),i=ze.toRad(r.theta(this));return this.translate(Math.cos(i)*t,-Math.sin(i)*t)}reflection(e){return W.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Ve.snapToGrid(this.x,e),this.y=Ve.snapToGrid(this.y,t??e),this}equals(e){const t=W.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return W.clone(this)}toJSON(){return W.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(W||(W={})),(function(n){function e(r){return r!=null&&typeof r=="object"&&typeof r.x=="number"&&typeof r.y=="number"}n.isPointLike=e;function t(r){return r!=null&&Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}n.isPointData=t})(W||(W={})),(function(n){function e(h,f){return h==null||typeof h=="number"?new n(h,f):t(h)}n.create=e;function t(h){return n.isPoint(h)?new n(h.x,h.y):Array.isArray(h)?new n(h[0],h[1]):new n(h.x,h.y)}n.clone=t;function r(h){return n.isPoint(h)?{x:h.x,y:h.y}:Array.isArray(h)?{x:h[0],y:h[1]}:{x:h.x,y:h.y}}n.toJSON=r;function i(h,f,d=new n){let p=Math.abs(h*Math.cos(f)),g=Math.abs(h*Math.sin(f));const m=t(d),v=ze.normalize(ze.toDeg(f));return v<90?g=-g:v<180?(p=-p,g=-g):v<270&&(p=-p),new n(m.x+p,m.y+g)}n.fromPolar=i;function s(h,f=new n){const d=t(h),p=t(f),g=d.x-p.x,m=d.y-p.y;return new n(Math.sqrt(g*g+m*m),ze.toRad(p.theta(d)))}n.toPolar=s;function o(h,f){return h===f?!0:h!=null&&f!=null?h.x===f.x&&h.y===f.y:!1}n.equals=o;function a(h,f){if(h==null&&f!=null||h!=null&&f==null||h!=null&&f!=null&&h.length!==f.length)return!1;if(h!=null&&f!=null){for(let d=0,p=h.length;d<p;d+=1)if(!o(h[d],f[d]))return!1}return!0}n.equalPoints=a;function l(h,f,d,p){return new n(Ve.random(h,f),Ve.random(d,p))}n.random=l;function u(h,f,d){const p=ze.toRad(ze.normalize(-f)),g=Math.sin(p),m=Math.cos(p);return c(h,m,g,d)}n.rotate=u;function c(h,f,d,p=new n){const g=t(h),m=t(p),v=g.x-m.x,y=g.y-m.y,b=v*f-y*d,_=y*f+v*d;return new n(b+m.x,_+m.y)}n.rotateEx=c})(W||(W={}));class Se extends Ur{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new W(this.x,this.y)}get topLeft(){return new W(this.x,this.y)}get topCenter(){return new W(this.x+this.width/2,this.y)}get topRight(){return new W(this.x+this.width,this.y)}get center(){return new W(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new W(this.x,this.y+this.height)}get bottomCenter(){return new W(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new W(this.x+this.width,this.y+this.height)}get corner(){return new W(this.x+this.width,this.y+this.height)}get rightMiddle(){return new W(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new W(this.x,this.y+this.height/2)}get topLine(){return new Pe(this.topLeft,this.topRight)}get rightLine(){return new Pe(this.topRight,this.bottomRight)}get bottomLine(){return new Pe(this.bottomLeft,this.bottomRight)}get leftLine(){return new Pe(this.topLeft,this.bottomLeft)}constructor(e,t,r,i){super(),this.x=e??0,this.y=t??0,this.width=r??0,this.height=i??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(e){if(!e)return this.clone();const t=ze.toRad(e),r=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t)),s=this.width*i+this.height*r,o=this.width*r+this.height*i;return new Se(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(e=0){return this.x=Ve.round(this.x,e),this.y=Ve.round(this.y,e),this.width=Ve.round(this.width,e),this.height=Ve.round(this.height,e),this}add(e,t,r,i){const s=Se.create(e,t,r,i),o=Math.min(this.x,s.x),a=Math.min(this.y,s.y),l=Math.max(this.x+this.width,s.x+s.width),u=Math.max(this.y+this.height,s.y+s.height);return this.x=o,this.y=a,this.width=l-o,this.height=u-a,this}update(e,t,r,i){const s=Se.create(e,t,r,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(e,t){const r=e,i=t??e;return this.x-=r,this.y-=i,this.width+=2*r,this.height+=2*i,this}snapToGrid(e,t){const r=this.origin.snapToGrid(e,t),i=this.corner.snapToGrid(e,t);return this.x=r.x,this.y=r.y,this.width=i.x-r.x,this.height=i.y-r.y,this}translate(e,t){const r=W.create(e,t);return this.x+=r.x,this.y+=r.y,this}scale(e,t,r=new W){const i=this.origin.scale(e,t,r);return this.x=i.x,this.y=i.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const r=ze.toRad(e),i=Math.cos(r),s=Math.sin(r);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();o=W.rotateEx(o,i,s,t),a=W.rotateEx(a,i,s,t),l=W.rotateEx(l,i,s,t),u=W.rotateEx(u,i,s,t);const c=new Se(o.x,o.y,0,0);c.add(a.x,a.y,0,0),c.add(l.x,l.y,0,0),c.add(u.x,u.y,0,0),this.update(c)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=Se.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const r=Se.clone(e),i=t.x,s=t.y;let o=1/0,a=1/0,l=1/0,u=1/0,c=1/0,h=1/0,f=1/0,d=1/0;const p=r.topLeft;p.x<i&&(o=(this.x-i)/(p.x-i)),p.y<s&&(c=(this.y-s)/(p.y-s));const g=r.bottomRight;g.x>i&&(a=(this.x+this.width-i)/(g.x-i)),g.y>s&&(h=(this.y+this.height-s)/(g.y-s));const m=r.topRight;m.x>i&&(l=(this.x+this.width-i)/(m.x-i)),m.y<s&&(f=(this.y-s)/(m.y-s));const v=r.bottomLeft;return v.x<i&&(u=(this.x-i)/(v.x-i)),v.y>s&&(d=(this.y+this.height-s)/(v.y-s)),{sx:Math.min(o,a,l,u),sy:Math.min(c,h,f,d)}}getMaxUniformScaleToFit(e,t=this.center){const r=this.getMaxScaleToFit(e,t);return Math.min(r.sx,r.sy)}containsPoint(e,t){return Ve.containsPoint(this,W.create(e,t))}containsRect(e,t,r,i){const s=Se.create(e,t,r,i),o=this.x,a=this.y,l=this.width,u=this.height,c=s.x,h=s.y,f=s.width,d=s.height;return l===0||u===0||f===0||d===0?!1:c>=o&&h>=a&&c+f<=o+l&&h+d<=a+u}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],r=[],i=[];return t.forEach(s=>{const o=e.intersectsWithLine(s);o!==null&&i.indexOf(o.toString())<0&&(r.push(o),i.push(o.toString()))}),r.length>0?r:null}intersectsWithLineFromCenterToPoint(e,t){const r=W.clone(e),i=this.center;let s=null;t!=null&&t!==0&&r.rotate(t,i);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new Pe(i,r);for(let l=o.length-1;l>=0;l-=1){const u=o[l].intersectsWithLine(a);if(u!==null){s=u;break}}return s&&t!=null&&t!==0&&s.rotate(-t,i),s}intersectsWithRect(e,t,r,i){const s=Se.create(e,t,r,i);if(!this.isIntersectWithRect(s))return null;const o=this.origin,a=this.corner,l=s.origin,u=s.corner,c=Math.max(o.x,l.x),h=Math.max(o.y,l.y);return new Se(c,h,Math.min(a.x,u.x)-c,Math.min(a.y,u.y)-h)}isIntersectWithRect(e,t,r,i){const s=Se.create(e,t,r,i),o=this.origin,a=this.corner,l=s.origin,u=s.corner;return!(u.x<=o.x||u.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let e=this.x,t=this.y,r=this.width,i=this.height;return this.width<0&&(e=this.x+this.width,r=-this.width),this.height<0&&(t=this.y+this.height,i=-this.height),this.x=e,this.y=t,this.width=r,this.height=i,this}union(e){const t=Se.clone(e),r=this.origin,i=this.corner,s=t.origin,o=t.corner,a=Math.min(r.x,s.x),l=Math.min(r.y,s.y),u=Math.max(i.x,o.x),c=Math.max(i.y,o.y);return new Se(a,l,u-a,c-l)}getNearestSideToPoint(e){const t=W.clone(e),r=t.x-this.x,i=this.x+this.width-t.x,s=t.y-this.y,o=this.y+this.height-t.y;let a=r,l="left";return i<a&&(a=i,l="right"),s<a&&(a=s,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(e){const t=W.clone(e);if(this.containsPoint(t)){const r=this.getNearestSideToPoint(t);if(r==="left")return new W(this.x,t.y);if(r==="top")return new W(t.x,this.y);if(r==="right")return new W(this.x+this.width,t.y);if(r==="bottom")return new W(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new Se(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isRectangle=e})(Se||(Se={})),(function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e})(Se||(Se={})),(function(n){function e(o,a,l,u){return o==null||typeof o=="number"?new n(o,a,l,u):t(o)}n.create=e;function t(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=t;function r(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=r;function i(o){return new n(0,0,o.width,o.height)}n.fromSize=i;function s(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=s})(Se||(Se={}));class Pe extends Ur{get center(){return new W((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,r,i){super(),typeof e=="number"&&typeof t=="number"?(this.start=new W(e,t),this.end=new W(r,i)):(this.start=W.create(e),this.end=W.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,r){return this.start.scale(e,t,r),this.end.scale(e,t,r),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const r=e/t;return this.scale(r,r,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:r,end:i}=t,s=r.clone().rotate(270,i),o=i.clone().rotate(90,r);return r.move(o,e),i.move(s,e),t}vector(){return new W(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new W(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=Math.min(this.start.y,this.end.y),r=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new Se(e,t,r-e,i-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new Pe(this.start,e).vector()),r=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(r)?0:r}pointAt(e){const t=this.start,r=this.end;return e<=0?t.clone():e>=1?r.clone():t.lerp(r,e)}pointAtLength(e){const t=this.start,r=this.end;let i=!0;e<0&&(i=!1,e=-e);const s=this.length();if(e>=s)return i?r.clone():t.clone();const o=(i?e:s-e)/s;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new Pe(this.start,t),new Pe(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new Pe(this.start,t),new Pe(t,this.end)]}containsPoint(e){const t=this.start,r=this.end;if(t.cross(e,r)!==0)return!1;const i=this.length();return!(new Pe(t,e).length()>i||new Pe(e,r).length()>i)}intersect(e,t){const r=e.intersectsWithLine(this,t);return r?Array.isArray(r)?r:[r]:null}intersectsWithLine(e){const t=new W(this.end.x-this.start.x,this.end.y-this.start.y),r=new W(e.end.x-e.start.x,e.end.y-e.start.y),i=t.x*r.y-t.y*r.x,s=new W(e.start.x-this.start.x,e.start.y-this.start.y),o=s.x*r.y-s.y*r.x,a=s.x*t.y-s.y*t.x;if(i===0||o*i<0||a*i<0)return null;if(i>0){if(o>i||a>i)return null}else if(o<i||a<i)return null;return new W(this.start.x+o*t.x/i,this.start.y+o*t.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=W.clone(e),r=this.start,i=this.end;return((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))/this.length()}pointSquaredDistance(e,t){const r=W.create(e,t);return this.closestPoint(r).squaredDistance(r)}pointDistance(e,t){const r=W.create(e,t);return this.closestPoint(r).distance(r)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAt(e),s=new Pe(t,r);return s.translate(i.x-t.x,i.y-t.y),s}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,r=this.end,i=this.pointAtLength(e),s=new Pe(t,r);return s.translate(i.x-t.x,i.y-t.y),s}relativeCcw(e,t){const r=W.create(e,t);let i=r.x-this.start.x,s=r.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=i*a-s*o;return l===0&&(l=i*o+s*a,l>0&&(i-=o,s-=a,l=i*o+s*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new Pe(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isLine=e})(Pe||(Pe={}));class Kt extends Ur{get center(){return new W(this.x,this.y)}constructor(e,t,r,i){super(),this.x=e??0,this.y=t??0,this.a=r??0,this.b=i??0}bbox(){return Se.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const r=e,i=t??e;return this.a+=2*r,this.b+=2*i,this}normalizedDistance(e,t){const r=W.create(e,t),i=r.x-this.x,s=r.y-this.y,o=this.a,a=this.b;return i*i/(o*o)+s*s/(a*a)}containsPoint(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],r=this.a,i=this.b,s=e.start,o=e.end,a=e.vector(),l=s.diff(new W(this.x,this.y)),u=new W(a.x/(r*r),a.y/(i*i)),c=new W(l.x/(r*r),l.y/(i*i)),h=a.dot(u),f=a.dot(c),d=l.dot(c)-1,p=f*f-h*d;if(p<0)return null;if(p>0){const g=Math.sqrt(p),m=(-f-g)/h,v=(-f+g)/h;if((m<0||m>1)&&(v<0||v>1))return null;m>=0&&m<=1&&t.push(s.lerp(o,m)),v>=0&&v<=1&&t.push(s.lerp(o,v))}else{const g=-f/h;if(g>=0&&g<=1)t.push(s.lerp(o,g));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const r=W.clone(e);t&&r.rotate(t,this.getCenter());const i=r.x-this.x,s=r.y-this.y;let o;if(i===0)return o=this.bbox().getNearestPointToPoint(r),t?o.rotate(-t,this.getCenter()):o;const a=s/i,l=a*a,u=this.a*this.a,c=this.b*this.b;let h=Math.sqrt(1/(1/u+l/c));h=i<0?-h:h;const f=a*h;return o=new W(this.x+h,this.y+f),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=W.clone(e),r=t.x,i=t.y,s=this.a,o=this.b,a=this.bbox().center,l=a.x,u=a.y,c=30,h=r>a.x+s/2,f=r<a.x-s/2;let d,p;return h||f?(p=r>a.x?i-c:i+c,d=s*s/(r-l)-s*s*(i-u)*(p-u)/(o*o*(r-l))+l):(d=i>a.y?r+c:r-c,p=o*o/(i-u)-o*o*(r-l)*(d-l)/(s*s*(i-u))+u),new W(d,p).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const r=Se.fromEllipse(this);r.rotate(e,t);const i=Kt.fromRect(r);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(e,t){const r=W.create(e,t);return this.x+=r.x,this.y+=r.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new Kt(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isEllipse=e})(Kt||(Kt={})),(function(n){function e(i,s,o,a){return i==null||typeof i=="number"?new n(i,s,o,a):t(i)}n.create=e;function t(i){return n.isEllipse(i)?i.clone():Array.isArray(i)?new n(i[0],i[1],i[2],i[3]):new n(i.x,i.y,i.a,i.b)}n.parse=t;function r(i){const s=i.center;return new n(s.x,s.y,i.width/2,i.height/2)}n.fromRect=r})(Kt||(Kt={}));const fj=new RegExp("^[\\s\\dLMCZz,.]*$");function dj(n){return typeof n!="string"?!1:fj.test(n)}function El(n,e){return(n%e+e)%e}function pj(n,e,t,r,i){const s=[],o=n[n.length-1],a=e!=null&&e>0,l=e||0;if(r&&a){n=n.slice();const h=n[0],f=new W(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2);n.splice(0,0,f)}let u=n[0],c=1;for(t?s.push("M",u.x,u.y):s.push("L",u.x,u.y);c<(r?n.length:n.length-1);){let h=n[El(c,n.length)],f=u.x-h.x,d=u.y-h.y;if(a&&(f!==0||d!==0)&&(i==null||i.indexOf(c-1)<0)){let p=Math.sqrt(f*f+d*d);const g=f*Math.min(l,p/2)/p,m=d*Math.min(l,p/2)/p,v=h.x+g,y=h.y+m;s.push("L",v,y);let b=n[El(c+1,n.length)];for(;c<n.length-2&&Math.round(b.x-h.x)===0&&Math.round(b.y-h.y)===0;)b=n[El(c+2,n.length)],c+=1;f=b.x-h.x,d=b.y-h.y,p=Math.max(1,Math.sqrt(f*f+d*d));const _=f*Math.min(l,p/2)/p,w=d*Math.min(l,p/2)/p,x=h.x+_,E=h.y+w;s.push("Q",h.x,h.y,x,E),h=new W(x,E)}else s.push("L",h.x,h.y);u=h,c+=1}return r?s.push("Z"):s.push("L",o.x,o.y),s.map(h=>typeof h=="string"?h:+h.toFixed(3)).join(" ")}function Av(n,e={}){const t=[];return n&&n.length&&n.forEach(r=>{Array.isArray(r)?t.push({x:r[0],y:r[1]}):t.push({x:r.x,y:r.y})}),pj(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function eo(n,e,t,r,i=0,s=0,o=0,a,l){if(t===0||r===0)return[];a-=n,l-=e,t=Math.abs(t),r=Math.abs(r);const u=-a/2,c=-l/2,h=Math.cos(i*Math.PI/180),f=Math.sin(i*Math.PI/180),d=h*u+f*c,p=-1*f*u+h*c,g=d*d,m=p*p,v=t*t,y=r*r,b=g/v+m/y;let _;if(b>1)t=Math.sqrt(b)*t,r=Math.sqrt(b)*r,_=0;else{let F=1;s===o&&(F=-1),_=F*Math.sqrt((v*y-v*m-y*g)/(v*m+y*g))}const w=_*t*p/r,x=-1*_*r*d/t,E=h*w-f*x+a/2,A=f*w+h*x+l/2;let O=Math.atan2((p-x)/r,(d-w)/t)-Math.atan2(0,1),T=O>=0?O:2*Math.PI+O;O=Math.atan2((-p-x)/r,(-d-w)/t)-Math.atan2((p-x)/r,(d-w)/t);let M=O>=0?O:2*Math.PI+O;o===0&&M>0?M-=2*Math.PI:o!==0&&M<0&&(M+=2*Math.PI);const C=M*2/Math.PI,k=Math.ceil(C<0?-1*C:C),N=M/k,R=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),$=h*t,G=h*r,H=f*t,se=f*r;let V=Math.cos(T),te=Math.sin(T),B=-R*($*te+se*V),ne=-R*(H*te-G*V),U=0,q=0;const re=[];for(let F=0;F<k;F+=1){T+=N,V=Math.cos(T),te=Math.sin(T),U=$*V-se*te+E,q=H*V+G*te+A;const D=-R*($*te+se*V),ae=-R*(H*te-G*V),Y=F*6;re[Y]=Number(B+n),re[Y+1]=Number(ne+e),re[Y+2]=Number(U-D+n),re[Y+3]=Number(q-ae+e),re[Y+4]=Number(U+n),re[Y+5]=Number(q+e),B=U+D,ne=q+ae}return re.map(F=>+F.toFixed(2))}function gj(n,e,t,r,i=0,s=0,o=0,a,l){const u=[],c=eo(n,e,t,r,i,s,o,a,l);if(c!=null)for(let h=0,f=c.length;h<f;h+=6)u.push("C",c[h],c[h+1],c[h+2],c[h+3],c[h+4],c[h+5]);return u.join(" ")}class rt extends Ur{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return rt.parse(e);this.points=e.map(t=>W.create(t))}else this.points=[]}scale(e,t,r=new W){return this.points.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.points.forEach(r=>r.rotate(e,t)),this}translate(e,t){const r=W.create(e,t);return this.points.forEach(i=>i.translate(r.x,r.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new Se;let e=1/0,t=-1/0,r=1/0,i=-1/0;const s=this.points;for(let o=0,a=s.length;o<a;o+=1){const l=s[o],u=l.x,c=l.y;u<e&&(e=u),u>t&&(t=u),c<r&&(r=c),c>i&&(i=c)}return new Se(e,r,t-e,i-r)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,r=t.length;if(r===0||r===1)return 0;let i=0,s=0,o=1/0;for(let a=0,l=r-1;a<l;a+=1){const u=new Pe(t[a],t[a+1]),c=u.length(),h=u.closestPointNormalizedLength(e),d=u.pointAt(h).squaredDistance(e);d<o&&(o=d,s=i+h*c),i+=c}return s}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=W.clone(e),r=t.x,i=t.y,s=this.points,o=s.length;let a=o-1,l=0;for(let u=0;u<o;u+=1){const c=s[a],h=s[u];if(t.equals(c))return!0;const f=new Pe(c,h);if(f.containsPoint(e))return!0;if(i<=c.y&&i>h.y||i>c.y&&i<=h.y){const d=c.x-r>h.x-r?c.x-r:h.x-r;if(d>=0){const p=new W(r+d,i),g=new Pe(e,p);f.intersectsWithLine(g)&&(l+=1)}}a=u}return l%2===1}intersectsWithLine(e){const t=[];for(let r=0,i=this.points.length-1;r<i;r+=1){const s=this.points[r],o=this.points[r+1],a=e.intersectsWithLine(new Pe(s,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const r=this.points[e],i=this.points[e+1];if(new Pe(r,i).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,r=this.points.length-1;t<r;t+=1){const i=this.points[t],s=this.points[t+1];e+=i.distance(s)}return e}pointAt(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1||e<=0)return t[0].clone();if(e>=1)return t[r-1].clone();const s=this.length()*e;return this.pointAtLength(s)}pointAtLength(e){const t=this.points,r=t.length;if(r===0)return null;if(r===1)return t[0].clone();let i=!0;e<0&&(i=!1,e=-e);let s=0;for(let a=0,l=r-1;a<l;a+=1){const u=i?a:l-1-a,c=t[u],h=t[u+1],f=new Pe(c,h),d=c.distance(h);if(e<=s+d)return f.pointAtLength((i?1:-1)*(e-s));s+=d}return(i?t[r-1]:t[0]).clone()}tangentAt(e){const r=this.points.length;if(r===0||r===1)return null;e<0&&(e=0),e>1&&(e=1);const s=this.length()*e;return this.tangentAtLength(s)}tangentAtLength(e){const t=this.points,r=t.length;if(r===0||r===1)return null;let i=!0;e<0&&(i=!1,e=-e);let s,o=0;for(let a=0,l=r-1;a<l;a+=1){const u=i?a:l-1-a,c=t[u],h=t[u+1],f=new Pe(c,h),d=c.distance(h);if(f.isDifferentiable()){if(e<=o+d)return f.tangentAtLength((i?1:-1)*(e-o));s=f}o+=d}if(s){const a=i?1:0;return s.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const r=e.threshold||0;let i=0;for(;t[i+2];){const s=i,o=i+1,a=i+2,l=t[s],u=t[o],c=t[a];new Pe(l,c).closestPoint(u).distance(u)<=r?t.splice(o,1):i+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new rt;let r=e[0];for(let f=1;f<t;f+=1)(e[f].y<r.y||e[f].y===r.y&&e[f].x>r.x)&&(r=e[f]);const i=[];for(let f=0;f<t;f+=1){let d=r.theta(e[f]);d===0&&(d=360),i.push([e[f],f,d])}if(i.sort((f,d)=>{let p=f[2]-d[2];return p===0&&(p=d[1]-f[1]),p}),i.length>2){const f=i[i.length-1];i.unshift(f)}const s={},o=[],a=f=>`${f[0].toString()}@${f[1]}`;for(;i.length!==0;){const f=i.pop(),d=f[0];if(s[a(f)])continue;let p=!1;for(;!p;)if(o.length<2)o.push(f),p=!0;else{const g=o.pop(),m=g[0],v=o.pop(),y=v[0],b=y.cross(m,d);if(b<0)o.push(v),o.push(g),o.push(f),p=!0;else if(b===0){const w=m.angleBetween(y,d);Math.abs(w-180)<1e-10||m.equals(d)||y.equals(m)?(s[a(g)]=m,o.push(v)):Math.abs((w+1)%360-1)<1e-10&&(o.push(v),i.push(g))}else s[a(g)]=m,o.push(v)}}o.length>2&&o.pop();let l,u=-1;for(let f=0,d=o.length;f<d;f+=1){const p=o[f][1];(l===void 0||p<l)&&(l=p,u=f)}let c=[];if(u>0){const f=o.slice(u),d=o.slice(0,u);c=f.concat(d)}else c=o;const h=[];for(let f=0,d=c.length;f<d;f+=1)h.push(c[f][0]);return new rt(h)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,r)=>t.equals(this.points[r]))}clone(){return new rt(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(rt||(rt={})),(function(n){function e(t){const r=t.trim();if(r==="")return new n;const i=[],s=r.split(/\s*,\s*|\s+/);for(let o=0,a=s.length;o<a;o+=2)i.push({x:+s[o],y:+s[o+1]});return new n(i)}n.parse=e})(rt||(rt={}));class et extends Ur{constructor(e,t,r,i){super(),this.PRECISION=3,this.start=W.create(e),this.controlPoint1=W.create(t),this.controlPoint2=W.create(r),this.end=W.create(i)}bbox(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end,s=e.x,o=e.y,a=t.x,l=t.y,u=r.x,c=r.y,h=i.x,f=i.y,d=[],p=[[],[]];let g,m,v,y,b,_,w,x;for(let $=0;$<2;$+=1){if($===0?(m=6*s-12*a+6*u,g=-3*s+9*a-9*u+3*h,v=3*a-3*s):(m=6*o-12*l+6*c,g=-3*o+9*l-9*c+3*f,v=3*l-3*o),Math.abs(g)<1e-12){if(Math.abs(m)<1e-12)continue;y=-v/m,y>0&&y<1&&d.push(y);continue}w=m*m-4*v*g,x=Math.sqrt(w),!(w<0)&&(b=(-m+x)/(2*g),b>0&&b<1&&d.push(b),_=(-m-x)/(2*g),_>0&&_<1&&d.push(_))}let E,A,O,T=d.length;const M=T;for(;T;)T-=1,y=d[T],O=1-y,E=O*O*O*s+3*O*O*y*a+3*O*y*y*u+y*y*y*h,p[0][T]=E,A=O*O*O*o+3*O*O*y*l+3*O*y*y*c+y*y*y*f,p[1][T]=A;d[M]=0,d[M+1]=1,p[0][M]=s,p[1][M]=o,p[0][M+1]=h,p[1][M+1]=f,d.length=M+2,p[0].length=M+2,p[1].length=M+2;const C=Math.min.apply(null,p[0]),k=Math.min.apply(null,p[1]),N=Math.max.apply(null,p[0]),R=Math.max.apply(null,p[1]);return new Se(C,k,N-C,R-k)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const r=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,r),r)}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(!i)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){const r=this.getPrecision(t),i=this.getDivisions(t),s=Math.pow(10,-r);let o=null,a=0,l=0,u=0,c=0,h=0,f=null;const d=i.length;let p=d>0?1/d:0;for(i.forEach((g,m)=>{const v=g.start.distance(e),y=g.end.distance(e),b=v+y;(f==null||b<f)&&(o=g,a=m*p,l=(m+1)*p,u=v,c=y,f=b,h=g.endpointDistance())});;){const g=u?Math.abs(u-c)/u:0,m=c!=null?Math.abs(u-c)/c:0,v=g<s||m<s,y=u?u<h*s:!0,b=c?c<h*s:!0;if(v||(y||b))return u<=c?a:l;const w=o.divide(.5);p/=2;const x=w[0].start.distance(e),E=w[0].end.distance(e),A=x+E,O=w[1].start.distance(e),T=w[1].end.distance(e),M=O+T;A<=M?(o=w[0],l-=p,u=x,c=E):(o=w[1],a+=p,u=O,c=T)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const r=this.tAt(e,t);return this.divideAtT(r)}divideAtLength(e,t={}){const r=this.tAtLength(e,t);return this.divideAtT(r)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return[new et(t,t,t,t),new et(t,r,i,s)];if(e>=1)return[new et(t,r,i,s),new et(s,s,s,s)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,l=o.startControlPoint2,u=o.divider,c=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new et(t,a,l,u),new et(u,c,h,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,r=this.controlPoint1,i=this.controlPoint2,s=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:i.clone()};if(e>=1)return{startControlPoint1:r.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const o=new Pe(t,r).pointAt(e),a=new Pe(r,i).pointAt(e),l=new Pe(i,s).pointAt(e),u=new Pe(o,a).pointAt(e),c=new Pe(a,l).pointAt(e),h=new Pe(u,c).pointAt(e);return{startControlPoint1:o,startControlPoint2:u,divider:h,dividerControlPoint1:c,dividerControlPoint2:l}}getSubdivisions(e={}){const t=this.getPrecision(e);let r=[new et(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return r;let i=this.endpointDistance();const s=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];r.forEach(c=>{const h=c.divide(.5);a.push(h[0],h[1])});const l=a.reduce((c,h)=>c+h.endpointDistance(),0),u=l!==0?(l-i)/l:0;if(o>1&&u<s)return a;r=a,i=l}}length(e={}){return this.getDivisions(e).reduce((r,i)=>r+i.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const r=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:r})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.tAt(e,t);return this.pointAtT(r)}pointAtLength(e,t={}){const r=this.tAtLength(e,t);return this.pointAtT(r)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const r=this.tAt(e,t);return this.tangentAtT(r)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const r=this.tAtLength(e,t);return this.tangentAtT(r)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),r=t.startControlPoint2,i=t.dividerControlPoint1,s=t.divider,o=new Pe(r,i);return o.translate(s.x-r.x,s.y-r.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),r=this.getDivisions(e);return{precision:t,subdivisions:r}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const r=this.getOptions(t),s=this.length(r)*e;return this.tAtLength(s,r)}tAtLength(e,t={}){let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getDivisions(t),o={precision:i,subdivisions:s};let a=null,l,u,c=0,h=0,f=0;const d=s.length;let p=d>0?1/d:0;for(let v=0;v<d;v+=1){const y=r?v:d-1-v,b=s[v],_=b.endpointDistance();if(e<=f+_){a=b,l=y*p,u=(y+1)*p,c=r?e-f:_+f-e,h=r?_+f-e:e-f;break}f+=_}if(a==null)return r?1:0;const g=this.length(o),m=Math.pow(10,-i);for(;;){let v;if(v=g!==0?c/g:0,v<m)return l;if(v=g!==0?h/g:0,v<m)return u;let y,b;const _=a.divide(.5);p/=2;const w=_[0].endpointDistance(),x=_[1].endpointDistance();c<=w?(a=_[0],u-=p,y=c,b=w-y):(a=_[1],l+=p,y=c-w,b=x-y),c=y,h=b}}toPoints(e={}){const t=this.getDivisions(e),r=[t[0].start.clone()];return t.forEach(i=>r.push(i.end.clone())),r}toPolyline(e={}){return new rt(this.toPoints(e))}scale(e,t,r){return this.start.scale(e,t,r),this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new et(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isCurve=e})(et||(et={})),(function(n){function e(i){const s=i.length,o=[],a=[];let l=2;o[0]=i[0]/l;for(let u=1;u<s;u+=1)a[u]=1/l,l=(u<s-1?4:3.5)-a[u],o[u]=(i[u]-o[u-1])/l;for(let u=1;u<s;u+=1)o[s-u-1]-=a[s-u]*o[s-u];return o}function t(i){const s=i.map(f=>W.clone(f)),o=[],a=[],l=s.length-1;if(l===1)return o[0]=new W((2*s[0].x+s[1].x)/3,(2*s[0].y+s[1].y)/3),a[0]=new W(2*o[0].x-s[0].x,2*o[0].y-s[0].y),[o,a];const u=[];for(let f=1;f<l-1;f+=1)u[f]=4*s[f].x+2*s[f+1].x;u[0]=s[0].x+2*s[1].x,u[l-1]=(8*s[l-1].x+s[l].x)/2;const c=e(u);for(let f=1;f<l-1;f+=1)u[f]=4*s[f].y+2*s[f+1].y;u[0]=s[0].y+2*s[1].y,u[l-1]=(8*s[l-1].y+s[l].y)/2;const h=e(u);for(let f=0;f<l;f+=1)o.push(new W(c[f],h[f])),f<l-1?a.push(new W(2*s[f+1].x-c[f+1],2*s[f+1].y-h[f+1])):a.push(new W((s[l].x+c[l-1])/2,(s[l].y+h[l-1])/2));return[o,a]}function r(i){if(i==null||Array.isArray(i)&&i.length<2)throw new Error("At least 2 points are required");const s=t(i),o=[];for(let a=0,l=s[0].length;a<l;a+=1){const u=new W(s[0][a].x,s[0][a].y),c=new W(s[1][a].x,s[1][a].y);o.push(new n(i[a],u,c,i[a+1]))}return o}n.throughPoints=r})(et||(et={}));class to extends Ur{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const r=this.length();return e>=1?r:r*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class xt extends to{constructor(e,t){super(),Pe.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=W.create(e,t).round(2)}get type(){return"L"}get line(){return new Pe(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new xt(t[0]),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new xt(t[0]),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new xt(this.end)}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(Pe.isLine(i))return new n(i);if(W.isPointLike(i))return r===1?new n(i):t.map(o=>new n(o));if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];s.push(new n(a,l))}return s}n.create=e})(xt||(xt={}));class Xn extends to{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new Pe(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new xt(t[0]):this.clone(),new xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new Xn}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(Xn||(Xn={}));class Qn extends to{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,Pe.isLine(e)||et.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=W.create(e,t).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(e,t,r){return this.end.scale(e,t,r),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new Qn(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const r=t.length,i=t[0];if(Pe.isLine(i))return new n(i);if(et.isCurve(i))return new n(i);if(W.isPointLike(i)){if(r===1)return new n(i);const o=[];for(let a=0;a<r;a+=1)a===0?o.push(new n(t[a])):o.push(new xt(t[a]));return o}if(r===2)return new n(+t[0],+t[1]);const s=[];for(let o=0;o<r;o+=2){const a=+t[o],l=+t[o+1];o===0?s.push(new n(a,l)):s.push(new xt(a,l))}return s}n.create=e})(Qn||(Qn={}));class qt extends to{constructor(e,t,r,i,s,o){super(),et.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new W(e,t).round(2),this.controlPoint2=new W(r,i).round(2),this.endPoint=new W(s,o).round(2)):(this.controlPoint1=W.create(e).round(2),this.controlPoint2=W.create(t).round(2),this.endPoint=W.create(r).round(2))}get type(){return"C"}get curve(){return new et(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const r=this.curve.divideAt(e,t);return[new qt(r[0]),new qt(r[1])]}divideAtLength(e,t={}){const r=this.curve.divideAtLength(e,t);return[new qt(r[0]),new qt(r[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new qt(t[0]),new qt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,r=this.controlPoint2,i=this.end;return!(e.equals(t)&&t.equals(r)&&r.equals(i))}scale(e,t,r){return this.controlPoint1.scale(e,t,r),this.controlPoint2.scale(e,t,r),this.end.scale(e,t,r),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new qt(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.controlPoint1,t=this.controlPoint2,r=this.end;return[this.type,e.x,e.y,t.x,t.y,r.x,r.y].join(" ")}}(function(n){function e(...t){const r=t.length,i=t[0];if(et.isCurve(i))return new n(i);if(W.isPointLike(i)){if(r===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<r;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(r===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const s=[];for(let o=0;o<r;o+=6)s.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return s}n.create=e})(qt||(qt={}));function ro(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Pv(n,e,t,r,i,s){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*r,o*i+a*t,o*s+a*r,i,s]}function Ov(n,e,t,r,i,s,o,a,l,u){const c=Math.PI*120/180,h=Math.PI/180*(+i||0);let f=[],d,p,g,m,v;if(u)p=u[0],g=u[1],m=u[2],v=u[3];else{d=ro(n,e,-h),n=d.x,e=d.y,d=ro(a,l,-h),a=d.x,l=d.y;const N=(n-a)/2,R=(e-l)/2;let $=N*N/(t*t)+R*R/(r*r);$>1&&($=Math.sqrt($),t=$*t,r=$*r);const G=t*t,H=r*r,se=(s===o?-1:1)*Math.sqrt(Math.abs((G*H-G*R*R-H*N*N)/(G*R*R+H*N*N)));m=se*t*R/r+(n+a)/2,v=se*-r*N/t+(e+l)/2,p=Math.asin((e-v)/r),g=Math.asin((l-v)/r),p=n<m?Math.PI-p:p,g=a<m?Math.PI-g:g,p<0&&(p=Math.PI*2+p),g<0&&(g=Math.PI*2+g),o&&p>g&&(p-=Math.PI*2),!o&&g>p&&(g-=Math.PI*2)}let y=g-p;if(Math.abs(y)>c){const N=g,R=a,$=l;g=p+c*(o&&g>p?1:-1),a=m+t*Math.cos(g),l=v+r*Math.sin(g),f=Ov(a,l,t,r,i,0,o,R,$,[g,N,m,v])}y=g-p;const b=Math.cos(p),_=Math.sin(p),w=Math.cos(g),x=Math.sin(g),E=Math.tan(y/4),A=4/3*(t*E),O=4/3*(r*E),T=[n,e],M=[n+A*_,e-O*b],C=[a+A*x,l-O*w],k=[a,l];if(M[0]=2*T[0]-M[0],M[1]=2*T[1]-M[1],u)return[M,C,k].concat(f);{f=[M,C,k].concat(f).join().split(",");const N=[],R=f.length;for(let $=0;$<R;$+=1)N[$]=$%2?ro(+f[$-1],+f[$],h).y:ro(+f[$],+f[$+1],h).x;return N}}function mj(n){if(!n)return null;const e=`
|
|
18
|
-
\v\f\r \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),r=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return n.replace(t,(o,a,l)=>{const u=[];let c=a.toLowerCase();l.replace(r,(f,d)=>(d&&u.push(+d),f)),c==="m"&&u.length>2&&(s.push([a,...u.splice(0,2)]),c="l",a=a==="m"?"l":"L");const h=i[c];for(;u.length>=h&&(s.push([a,...u.splice(0,h)]),!!h););return o}),s}function yj(n){const e=mj(n);if(!e||!e.length)return[["M",0,0]];let t=0,r=0,i=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const u=[];o.push(u);const c=e[a],h=c[0];if(h!==h.toUpperCase())switch(u[0]=h.toUpperCase(),u[0]){case"A":u[1]=c[1],u[2]=c[2],u[3]=c[3],u[4]=c[4],u[5]=c[5],u[6]=+c[6]+t,u[7]=+c[7]+r;break;case"V":u[1]=+c[1]+r;break;case"H":u[1]=+c[1]+t;break;case"M":i=+c[1]+t,s=+c[2]+r;for(let f=1,d=c.length;f<d;f+=1)u[f]=+c[f]+(f%2?t:r);break;default:for(let f=1,d=c.length;f<d;f+=1)u[f]=+c[f]+(f%2?t:r);break}else for(let f=0,d=c.length;f<d;f+=1)u[f]=c[f];switch(u[0]){case"Z":t=+i,r=+s;break;case"H":t=u[1];break;case"V":r=u[1];break;case"M":i=u[u.length-2],s=u[u.length-1],t=u[u.length-2],r=u[u.length-1];break;default:t=u[u.length-2],r=u[u.length-1];break}}return o}function bj(n){const e=yj(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(l,u,c){let h,f;if(!l)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(l[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),l[0]){case"M":u.X=l[1],u.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Ov.apply(0,[u.x,u.y].concat(l.slice(1))));case"S":return c==="C"||c==="S"?(h=u.x*2-u.bx,f=u.y*2-u.by):(h=u.x,f=u.y),["C",h,f].concat(l.slice(1));case"T":return c==="Q"||c==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(Pv(u.x,u.y,u.qx,u.qy,l[1],l[2]));case"Q":return u.qx=l[1],u.qy=l[2],["C"].concat(Pv(u.x,u.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],u.y);case"V":return["L"].concat(u.x,l[1])}return l}function i(l,u){if(l[u].length>7){l[u].shift();const c=l[u];for(;c.length;)s[u]="A",u+=1,l.splice(u,0,["C"].concat(c.splice(0,6)));l.splice(u,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let u="";e[l]&&(u=e[l][0]),u!=="C"&&(s[l]=u,l>0&&(o=s[l-1])),e[l]=r(e[l],t,o),s[l]!=="A"&&u==="C"&&(s[l]="C"),i(e,l);const c=e[l],h=c.length;t.x=c[h-2],t.y=c[h-1],t.bx=parseFloat(c[h-4])||t.x,t.by=parseFloat(c[h-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function vj(n){return bj(n).map(e=>e.map(t=>typeof t=="string"?t:Ve.round(t,2))).join(",").split(",").join(" ")}class Te extends Ur{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(Pe.isLine(e[0])||et.isCurve(e[0])){let t=null;e.forEach((i,s)=>{s===0&&this.appendSegment(Te.createSegment("M",i.start)),t!=null&&!t.end.equals(i.start)&&this.appendSegment(Te.createSegment("M",i.start)),Pe.isLine(i)?this.appendSegment(Te.createSegment("L",i.end)):et.isCurve(i)&&this.appendSegment(Te.createSegment("C",i.controlPoint1,i.controlPoint2,i.end)),t=i})}else e.forEach(r=>{r.isSegment&&this.appendSegment(r)});else e!=null&&(Pe.isLine(e)?(this.appendSegment(Te.createSegment("M",e.start)),this.appendSegment(Te.createSegment("L",e.end))):et.isCurve(e)?(this.appendSegment(Te.createSegment("M",e.start)),this.appendSegment(Te.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):rt.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,r)=>{const i=r===0?Te.createSegment("M",t):Te.createSegment("L",t);this.appendSegment(i)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=0;r<t;r+=1){const i=e[r];if(i.isVisible)return i.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let r=t-1;r>=0;r-=1){const i=e[r];if(i.isVisible)return i.end}return e[t-1].end}moveTo(...e){return this.appendSegment(Qn.create.call(null,...e))}lineTo(...e){return this.appendSegment(xt.create.call(null,...e))}curveTo(...e){return this.appendSegment(qt.create.call(null,...e))}arcTo(e,t,r,i,s,o,a){const l=this.end||new W,u=typeof o=="number"?eo(l.x,l.y,e,t,r,i,s,o,a):eo(l.x,l.y,e,t,r,i,s,o.x,o.y);if(u!=null)for(let c=0,h=u.length;c<h;c+=6)this.curveTo(u[c],u[c+1],u[c+2],u[c+3],u[c+4],u[c+5]);return this}quadTo(e,t,r,i){const s=this.end||new W,o=["M",s.x,s.y];if(typeof e=="number")o.push("Q",e,t,r,i);else{const l=t;o.push("Q",e.x,e.y,l.x,l.y)}const a=Te.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Xn.create())}drawPoints(e,t={}){const r=Av(e,t),i=Te.parse(r);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let r;for(let s=0;s<t;s+=1){const o=e[s];if(o.isVisible){const a=o.bbox();a!=null&&(r=r?r.union(a):a)}}if(r!=null)return r;const i=e[t-1];return new Se(i.end.x,i.end.y,0,0)}appendSegment(e){const t=this.segments.length;let r=t!==0?this.segments[t-1]:null,i;const s=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const l=e[o];i=this.prepareSegment(l,r,s),this.segments.push(i),r=i}else e!=null&&e.isSegment&&(i=this.prepareSegment(e,r,s),this.segments.push(i));return this}insertSegment(e,t){const r=this.segments.length;if(e<0&&(e=r+e+1),e>r||e<0)throw new Error("Index out of range.");let i,s=null,o=null;if(r!==0&&(e>=1?(s=this.segments[e-1],o=s.nextSegment):(s=null,o=this.segments[0])),!Array.isArray(t))i=this.prepareSegment(t,s,o),this.segments.splice(e,0,i);else for(let a=0,l=t.length;a<l;a+=1){const u=t[a];i=this.prepareSegment(u,s,o),this.segments.splice(e+a,0,i),s=i}return this}removeSegment(e){const t=this.fixIndex(e),r=this.segments.splice(t,1)[0],i=r.previousSegment,s=r.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),r.isSubpathStart&&s&&this.updateSubpathStartSegment(s),r}replaceSegment(e,t){const r=this.fixIndex(e);let i;const s=this.segments[r];let o=s.previousSegment;const a=s.nextSegment;let l=s.isSubpathStart;if(!Array.isArray(t))i=this.prepareSegment(t,o,a),this.segments.splice(r,1,i),l&&i.isSubpathStart&&(l=!1);else{this.segments.splice(e,1);for(let u=0,c=t.length;u<c;u+=1){const h=t[u];i=this.prepareSegment(h,o,a),this.segments.splice(e+u,0,i),o=i,l&&i.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let r=e;for(;r<0;)r=t+r;if(r>=t||r<0)throw new Error("Index out of range.");return r}segmentAt(e,t={}){const r=this.segmentIndexAt(e,t);return r?this.getSegment(r):null}segmentAtLength(e,t={}){const r=this.segmentIndexAtLength(e,t);return r?this.getSegment(r):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const r=Ve.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.segmentIndexAtLength(o,i)}segmentIndexAtLength(e,t={}){const r=this.segments.length;if(r===0)return null;let i=!0;e<0&&(i=!1,e=-e);const s=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,l=null;for(let u=0;u<r;u+=1){const c=i?u:r-1-u,h=this.segments[c],f=o[c],d=h.length({precision:s,subdivisions:f});if(h.isVisible){if(e<=a+d)return c;l=c}a+=d}return l}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),r=[];for(let i=0,s=this.segments.length;i<s;i+=1){const a=this.segments[i].getSubdivisions({precision:t});r.push(a)}return r}updateSubpathStartSegment(e){let t=e.previousSegment,r=e;for(;r&&!r.isSubpathStart;)t!=null?r.subpathStartSegment=t.subpathStartSegment:r.subpathStartSegment=null,t=r,r=r.nextSegment}prepareSegment(e,t,r){e.previousSegment=t,e.nextSegment=r,t!=null&&(t.nextSegment=e),r!=null&&(r.previousSegment=e);let i=e;return e.isSubpathStart&&(e.subpathStartSegment=e,i=r),i!=null&&this.updateSubpathStartSegment(i),e}closestPoint(e,t={}){const r=this.closestPointT(e,t);return r?this.pointAtT(r):null}closestPointLength(e,t={}){const r=this.getOptions(t),i=this.closestPointT(e,r);return i?this.lengthAtT(i,r):0}closestPointNormalizedLength(e,t={}){const r=this.getOptions(t),i=this.closestPointLength(e,r);if(i===0)return 0;const s=this.length(r);return s===0?0:i/s}closestPointT(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],c=i[a];if(u.isVisible){const h=u.closestPointT(e,{precision:r,subdivisions:c}),f=u.pointAtT(h),d=Ve.squaredLength(f,e);d<o&&(s={segmentIndex:a,value:h},o=d)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const r=this.getPrecision(t),i=this.getSubdivisions(t);let s,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],c=i[a];if(u.isDifferentiable()){const h=u.closestPointT(e,{precision:r,subdivisions:c}),f=u.pointAtT(h),d=Ve.squaredLength(f,e);d<o&&(s=u.tangentAtT(h),o=d)}}return s||null}containsPoint(e,t={}){const r=this.toPolylines(t);if(!r)return!1;let i=0;for(let s=0,o=r.length;s<o;s+=1)r[s].containsPoint(e)&&(i+=1);return i%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const r=this.getOptions(t),s=this.length(r)*e;return this.pointAtLength(s,r)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let u=0,c=this.segments.length;u<c;u+=1){const h=r?u:c-1-u,f=this.segments[h],d=s[h],p=f.length({precision:i,subdivisions:d});if(f.isVisible){if(e<=a+p)return f.pointAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:d});o=f}a+=p}return o?r?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,r=t.length;if(r===0)return null;const i=e.segmentIndex;if(i<0)return t[0].pointAtT(0);if(i>=r)return t[r-1].pointAtT(1);const s=Ve.clamp(e.value,0,1);return t[i].pointAtT(s)}divideAt(e,t={}){if(this.segments.length===0)return null;const r=Ve.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.divideAtLength(o,i)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o=0,a,l,u,c,h;for(let w=0,x=this.segments.length;w<x;w+=1){const E=r?w:x-1-w,A=this.getSegment(E),O=s[E],T={precision:i,subdivisions:O},M=A.length(T);if(A.isDifferentiable()&&(u=A,c=E,e<=o+M)){l=E,a=A.divideAtLength((r?1:-1)*(e-o),T);break}o+=M}if(!u)return null;a||(l=c,h=r?1:0,a=u.divideAtT(h));const f=this.clone(),d=l;f.replaceSegment(d,a);const p=d;let g=d+1,m=d+2;a[0].isDifferentiable()||(f.removeSegment(p),g-=1,m-=1);const v=f.getSegment(g).start;f.insertSegment(g,Te.createSegment("M",v)),m+=1,a[1].isDifferentiable()||(f.removeSegment(m-1),m-=1);const y=m-p-1;for(let w=m,x=f.segments.length;w<x;w+=1){const E=this.getSegment(w-y),A=f.getSegment(w);if(A.type==="Z"&&!E.subpathStartSegment.end.equals(A.subpathStartSegment.end)){const O=Te.createSegment("L",E.end);f.replaceSegment(w,O)}}const b=new Te(f.segments.slice(0,g)),_=new Te(f.segments.slice(g));return[b,_]}intersectsWithLine(e,t={}){const r=this.toPolylines(t);if(r==null)return null;let i=null;for(let s=0,o=r.length;s<o;s+=1){const a=r[s],l=e.intersect(a);l&&(i==null&&(i=[]),Array.isArray(l)?i.push(...l):i.push(l))}return i}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let r=0;for(let i=0,s=this.segments.length;i<s;i+=1){const o=this.segments[i],a=t[i];r+=o.length({subdivisions:a})}return r}lengthAtT(e,t={}){const r=this.segments.length;if(r===0)return 0;let i=e.segmentIndex;if(i<0)return 0;let s=Ve.clamp(e.value,0,1);i>=r&&(i=r-1,s=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let l=0;for(let h=0;h<i;h+=1){const f=this.segments[h],d=a[h];l+=f.length({precision:o,subdivisions:d})}const u=this.segments[i],c=a[i];return l+=u.lengthAtT(s,{precision:o,subdivisions:c}),l}tangentAt(e,t={}){if(this.segments.length===0)return null;const r=Ve.clamp(e,0,1),i=this.getOptions(t),o=this.length(i)*r;return this.tangentAtLength(o,i)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),s=this.getSubdivisions(t);let o,a=0;for(let l=0,u=this.segments.length;l<u;l+=1){const c=r?l:u-1-l,h=this.segments[c],f=s[c],d=h.length({precision:i,subdivisions:f});if(h.isDifferentiable()){if(e<=a+d)return h.tangentAtLength((r?1:-1)*(e-a),{precision:i,subdivisions:f});o=h}a+=d}if(o){const l=r?1:0;return o.tangentAtT(l)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const r=e.segmentIndex;if(r<0)return this.segments[0].tangentAtT(0);if(r>=t)return this.segments[t-1].tangentAtT(1);const i=Ve.clamp(e.value,0,1);return this.segments[r].tangentAtT(i)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),r=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:r}}toPoints(e={}){const t=this.segments,r=t.length;if(r===0)return null;const i=this.getSubdivisions(e),s=[];let o=[];for(let a=0;a<r;a+=1){const l=t[a];if(l.isVisible){const u=i[a];u.length>0?u.forEach(c=>o.push(c.start)):o.push(l.start)}else o.length>0&&(o.push(t[a-1].end),s.push(o),o=[])}return o.length>0&&(o.push(this.end),s.push(o)),s}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(r=>new rt(r)):null}scale(e,t,r){return this.segments.forEach(i=>i.scale(e,t,r)),this}rotate(e,t){return this.segments.forEach(r=>r.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(r=>r.translate(e,t)):this.segments.forEach(r=>r.translate(e)),this}clone(){const e=new Te;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,r=e.segments,i=t.length;if(r.length!==i)return!1;for(let s=0;s<i;s+=1){const o=t[s],a=r[s];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(Te||(Te={})),(function(n){function e(r){if(!r)return new n;const i=new n,s=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(r).match(s);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const u=o[a],c=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,h=u.match(c);if(h!=null){const f=h[0],d=h.slice(1).map(g=>+g),p=t.call(null,f,...d);i.appendSegment(p)}}return i}n.parse=e;function t(r,...i){if(r==="M")return Qn.create.call(null,...i);if(r==="L")return xt.create.call(null,...i);if(r==="C")return qt.create.call(null,...i);if(r==="z"||r==="Z")return Xn.create();throw new Error(`Invalid path segment type "${r}"`)}n.createSegment=t})(Te||(Te={})),(function(n){n.normalize=vj,n.isValid=dj,n.drawArc=gj,n.drawPoints=Av,n.arcToCurves=eo})(Te||(Te={}));class nt{constructor(e){this.options=Object.assign({},e),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(e,t,r=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!r&&!Fr.isApplyingHMR()&&this.onDuplicated(e);const i=this.options.process,s=i?ke(i,this,e,t):t;return this.data[e]=s,s}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&ke(this.options.onConflict,this,e),new Error(`${Bs(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const r=this.getSpellingSuggestionForName(e),i=t?`${t} ${$k(this.options.type)}`:this.options.type;return`${Bs(i)} with name '${e}' does not exist.${r?` Did you mean '${r}'?`:""}`}getSpellingSuggestionForName(e){return bN(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(nt||(nt={}));const wj=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,r=e.thickness*e.sy;Ue(n,{width:t,height:r,rx:t,ry:r,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",Ue(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const r=e.factor||1,i=e.width*r,s=e.height*r,o=e.thickness;i-o>=0&&s-o>=0?t=["M",i,0,"H0 M0 0 V0",s].join(" "):t="M 0 0 0 0",e.width=i,e.height=s,Ue(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;Ue(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const r=e.width,i=e.height,s=e.thickness;r-s>=0&&i-s>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",Ue(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class zr{constructor(){this.patterns={},this.root=Ie.create(Hs(),{width:"100%",height:"100%"},[Ht("defs")]).node}add(e,t){const r=this.root.childNodes[0];r&&r.appendChild(t),this.patterns[e]=t,Ie.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=wj,n.registry=nt.create({type:"grid"}),n.registry.register(n.presets,!0)})(zr||(zr={}));const Cv=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t*2,e.height=r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(2*t,0),i.scale(-1,1),i.drawImage(n,0,0,t,r),e},Tv=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=t,e.height=r*2;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(n,0,0,t,r),e},Mv=function(n){const e=document.createElement("canvas"),t=n.width,r=n.height;e.width=2*t,e.height=2*r;const i=e.getContext("2d");return i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(n,0,0,t,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(n,0,0,t,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(n,0,0,t,r),e},_j=Object.freeze(Object.defineProperty({__proto__:null,flipX:Cv,flipXY:Mv,flipY:Tv,watermark:function(n,e){const t=n.width,r=n.height,i=document.createElement("canvas");i.width=t*3,i.height=r*3;const s=i.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ze.toRad(o),l=i.width/4,u=i.height/4;for(let c=0;c<4;c+=1)for(let h=0;h<4;h+=1)(c+h)%2>0&&(s.setTransform(1,0,0,1,(2*c-1)*l,(2*h-1)*u),s.rotate(a),s.drawImage(n,-t/2,-r/2,t,r));return i}},Symbol.toStringTag,{value:"Module"}));var Yi;(function(n){n.presets=Object.assign({},_j),n.presets["flip-x"]=Cv,n.presets["flip-y"]=Tv,n.presets["flip-xy"]=Mv,n.registry=nt.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(Yi||(Yi={}));function Sl(n,e){return n??e}function pt(n,e){return n!=null&&Number.isFinite(n)?n:e}function xj(n={}){const e=Sl(n.color,"blue"),t=pt(n.width,1),r=pt(n.margin,2),i=pt(n.opacity,1),s=r,o=r+t;return`
|
|
19
|
-
<filter>
|
|
20
|
-
<feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
|
|
21
|
-
<feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
|
|
22
|
-
<feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${s}" />
|
|
23
|
-
<feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>
|
|
24
|
-
<feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>
|
|
25
|
-
<feMerge>
|
|
26
|
-
<feMergeNode in="outline"/>
|
|
27
|
-
<feMergeNode in="SourceGraphic"/>
|
|
28
|
-
</feMerge>
|
|
29
|
-
</filter>
|
|
30
|
-
`.trim()}function Ej(n={}){const e=Sl(n.color,"red"),t=pt(n.blur,0),r=pt(n.width,1),i=pt(n.opacity,1);return`
|
|
31
|
-
<filter>
|
|
32
|
-
<feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>
|
|
33
|
-
<feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${r}"/>
|
|
34
|
-
<feComposite result="composed" in="colored" in2="morphed" operator="in"/>
|
|
35
|
-
<feGaussianBlur result="blured" in="composed" stdDeviation="${t}"/>
|
|
36
|
-
<feBlend in="SourceGraphic" in2="blured" mode="normal"/>
|
|
37
|
-
</filter>
|
|
38
|
-
`.trim()}function Sj(n={}){const e=pt(n.x,2);return`
|
|
39
|
-
<filter>
|
|
40
|
-
<feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[e,n.y]:e}"/>
|
|
41
|
-
</filter>
|
|
42
|
-
`.trim()}function Aj(n={}){const e=pt(n.dx,0),t=pt(n.dy,0),r=Sl(n.color,"black"),i=pt(n.blur,4),s=pt(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
|
|
43
|
-
<feDropShadow stdDeviation="${i}" dx="${e}" dy="${t}" flood-color="${r}" flood-opacity="${s}" />
|
|
44
|
-
</filter>`.trim():`<filter>
|
|
45
|
-
<feGaussianBlur in="SourceAlpha" stdDeviation="${i}" />
|
|
46
|
-
<feOffset dx="${e}" dy="${t}" result="offsetblur" />
|
|
47
|
-
<feFlood flood-color="${r}" />
|
|
48
|
-
<feComposite in2="offsetblur" operator="in" />
|
|
49
|
-
<feComponentTransfer>
|
|
50
|
-
<feFuncA type="linear" slope="${s}" />
|
|
51
|
-
</feComponentTransfer>
|
|
52
|
-
<feMerge>
|
|
53
|
-
<feMergeNode/>
|
|
54
|
-
<feMergeNode in="SourceGraphic"/>
|
|
55
|
-
</feMerge>
|
|
56
|
-
</filter>`.trim()}function Pj(n={}){const e=pt(n.amount,1),t=.2126+.7874*(1-e),r=.7152-.7152*(1-e),i=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),u=.0722+.9278*(1-e);return`
|
|
57
|
-
<filter>
|
|
58
|
-
<feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${r} ${u} 0 0 0 0 0 1 0"/>
|
|
59
|
-
</filter>
|
|
60
|
-
`.trim()}function Oj(n={}){const e=pt(n.amount,1),t=.393+.607*(1-e),r=.769-.769*(1-e),i=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),u=.534-.534*(1-e),c=.131+.869*(1-e);return`
|
|
61
|
-
<filter>
|
|
62
|
-
<feColorMatrix type="matrix" values="${t} ${r} ${i} 0 0 ${s} ${o} ${a} 0 0 ${l} ${u} ${c} 0 0 0 0 0 1 0"/>
|
|
63
|
-
</filter>
|
|
64
|
-
`.trim()}function Cj(n={}){return`
|
|
65
|
-
<filter>
|
|
66
|
-
<feColorMatrix type="saturate" values="${1-pt(n.amount,1)}"/>
|
|
67
|
-
</filter>
|
|
68
|
-
`.trim()}function Tj(n={}){return`
|
|
69
|
-
<filter>
|
|
70
|
-
<feColorMatrix type="hueRotate" values="${pt(n.angle,0)}"/>
|
|
71
|
-
</filter>
|
|
72
|
-
`.trim()}function Mj(n={}){const e=pt(n.amount,1),t=1-e;return`
|
|
73
|
-
<filter>
|
|
74
|
-
<feComponentTransfer>
|
|
75
|
-
<feFuncR type="table" tableValues="${e} ${t}"/>
|
|
76
|
-
<feFuncG type="table" tableValues="${e} ${t}"/>
|
|
77
|
-
<feFuncB type="table" tableValues="${e} ${t}"/>
|
|
78
|
-
</feComponentTransfer>
|
|
79
|
-
</filter>
|
|
80
|
-
`.trim()}function Ij(n={}){const e=pt(n.amount,1);return`
|
|
81
|
-
<filter>
|
|
82
|
-
<feComponentTransfer>
|
|
83
|
-
<feFuncR type="linear" slope="${e}"/>
|
|
84
|
-
<feFuncG type="linear" slope="${e}"/>
|
|
85
|
-
<feFuncB type="linear" slope="${e}"/>
|
|
86
|
-
</feComponentTransfer>
|
|
87
|
-
</filter>
|
|
88
|
-
`.trim()}function Rj(n={}){const e=pt(n.amount,1),t=.5-e/2;return`
|
|
89
|
-
<filter>
|
|
90
|
-
<feComponentTransfer>
|
|
91
|
-
<feFuncR type="linear" slope="${e}" intercept="${t}"/>
|
|
92
|
-
<feFuncG type="linear" slope="${e}" intercept="${t}"/>
|
|
93
|
-
<feFuncB type="linear" slope="${e}" intercept="${t}"/>
|
|
94
|
-
</feComponentTransfer>
|
|
95
|
-
</filter>
|
|
96
|
-
`.trim()}const kj=Object.freeze(Object.defineProperty({__proto__:null,blur:Sj,brightness:Ij,contrast:Rj,dropShadow:Aj,grayScale:Pj,highlight:Ej,hueRotate:Tj,invert:Mj,outline:xj,saturate:Cj,sepia:Oj},Symbol.toStringTag,{value:"Module"}));var Zn;(function(n){n.presets=kj,n.registry=nt.create({type:"filter"}),n.registry.register(n.presets,!0)})(Zn||(Zn={}));const Nj={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},jj={},Iv={position:no("x","width","origin")},Rv={position:no("y","height","origin")},Lj={position:no("x","width","corner")},Dj={position:no("y","height","corner")},kv={set:Vr("width","width")},Nv={set:Vr("height","height")},Bj={set:Vr("rx","width")},qj={set:Vr("ry","height")},jv={set:(n=>{const e=Vr(n,"width"),t=Vr(n,"height");return function(r,i){const s=i.refBBox,o=s.height>s.width?e:t;return ke(o,this,r,i)}})("r")},Fj={set(n,{refBBox:e}){let t=parseFloat(n);const r=_r(n);r&&(t/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(t)&&(r||t>=0&&t<=1?s=t*i:s=Math.max(t+i,0)),{r:s}}},$j={set:Vr("cx","width")},Uj={set:Vr("cy","height")},Lv={set:qv({resetOffset:!0})},zj={set:qv({resetOffset:!1})},Dv={set:Fv({resetOffset:!0})},Vj={set:Fv({resetOffset:!1})},Wj=jv,Gj=Lv,Hj=Dv,Kj=Iv,Yj=Rv,Jj=kv,Xj=Nv;function no(n,e,t){return(r,{refBBox:i})=>{if(r==null)return null;let s=parseFloat(r);const o=_r(r);o&&(s/=100);let a;if(Number.isFinite(s)){const u=i[t];o||s>0&&s<1?a=u[n]+i[e]*s:a=u[n]+s}const l=new W;return l[n]=a||0,l}}function Vr(n,e){return function(t,{refBBox:r}){let i=parseFloat(t);const s=_r(t);s&&(i/=100);const o={};if(Number.isFinite(i)){const a=s||i>=0&&i<=1?i*r[e]:Math.max(i+r[e],0);o[n]=a}return o}}function Bv(n,e){const t="x6-shape",r=e&&e.resetOffset;return function(i,{elem:s,refBBox:o}){let a=pn(s,t);if(!a||a.value!==i){const g=n(i);a={value:i,shape:g,shapeBBox:g.bbox()},pn(s,t,a)}const l=a.shape.clone(),u=a.shapeBBox.clone(),c=u.getOrigin(),h=o.getOrigin();u.x=h.x,u.y=h.y;const f=o.getMaxScaleToFit(u,h),d=u.width===0||o.width===0?1:f.sx,p=u.height===0||o.height===0?1:f.sy;return l.scale(d,p,c),r&&l.translate(-c.x,-c.y),l}}function qv(n){function e(r){return Te.parse(r)}const t=Bv(e,n);return(r,i)=>({d:t(r,i).serialize()})}function Fv(n){const e=Bv(t=>new rt(t),n);return(t,r)=>({points:e(t,r).serialize()})}const Qj={qualify:nr,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},Zj={qualify:nr,set(n,{view:e}){const t=e.cell,r=Object.assign({},n);if(t.isEdge()&&r.type==="linearGradient"){const i=e,s=i.sourcePoint,o=i.targetPoint;r.id=`gradient-${r.type}-${t.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:s.x,y1:s.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(r.id)}return`url(#${e.graph.defineGradient(r)})`}},$v={qualify(n,{attrs:e}){return e.textWrap==null||!nr(e.textWrap)},set(n,{view:e,elem:t,attrs:r}){const i="x6-text",s=pn(t,i),o=c=>{try{return JSON.parse(c)}catch{return c}},a={x:r.x,eol:r.eol,annotations:o(r.annotations),textPath:o(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:(r["display-empty"]||r.displayEmpty)==="true",lineHeight:r["line-height"]||r.lineHeight},l=r["font-size"]||r.fontSize,u=JSON.stringify([n,a]);if(l&&t.setAttribute("font-size",l),s==null||s!==u){const c=a.textPath;if(c!=null&&typeof c=="object"){const h=c.selector;if(typeof h=="string"){const f=e.find(h)[0];f instanceof SVGPathElement&&(cl(f),a.textPath=Object.assign({"xlink:href":`#${f.id}`},c))}}gv(t,`${n}`,a),pn(t,i,u)}}},eL={qualify:nr,set(n,{view:e,elem:t,attrs:r,refBBox:i}){const s=n,o=s.width||0;_r(o)?i.width*=parseFloat(o)/100:o<=0?i.width+=o:i.width=o;const a=s.height||0;_r(a)?i.height*=parseFloat(a)/100:a<=0?i.height+=a:i.height=a;let l,u=s.text;u==null&&(u=r.text||t?.textContent),u!=null?l=yv(`${u}`,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{ellipsis:s.ellipsis}):l="",ke($v.set,this,l,{view:e,elem:t,attrs:r,refBBox:i,cell:e.cell})}},ei=(n,{attrs:e})=>e.text!==void 0,tL={qualify:ei},rL={qualify:ei},nL={qualify:ei},iL={qualify:ei},sL={qualify:ei},oL={qualify:ei},aL={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",r=`${n}`,i=pn(e,t);if(i==null||i!==r){pn(e,t,r);const s=e.firstChild;if(s&&s.tagName.toUpperCase()==="TITLE"){const o=s;o.textContent=r}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=r,e.insertBefore(o,s)}}}},lL={offset:Uv("x","width","right")},uL={offset:Uv("y","height","bottom")},cL={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Uv(n,e,t){return(r,{refBBox:i})=>{const s=new W;let o;return r==="middle"?o=i[e]/2:r===t?o=i[e]:typeof r=="number"&&Number.isFinite(r)?o=r>-1&&r<1?-i[e]*r:-r:_r(r)?o=i[e]*parseFloat(r)/100:o=0,s[n]=-(i[n]+o),s}}const hL={qualify:nr,set(n,{elem:e}){Fi(e,n)}},fL={set(n,{elem:e}){e.innerHTML=`${n}`}},dL={qualify:nr,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},pL={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Wr(n,e,t){let r,i;typeof e=="object"?(r=e.x,i=e.y):(r=e,i=t);const s=Te.parse(n),o=s.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof r=="number"&&(l-=r),typeof i=="number"&&(a-=i),s.translate(l,a)}return s.serialize()}var zv=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const gL=n=>{var{size:e,width:t,height:r,offset:i,open:s}=n,o=zv(n,["size","width","height","offset","open"]);return Vv({size:e,width:t,height:r,offset:i},s===!0,!0,void 0,o)},mL=n=>{var{size:e,width:t,height:r,offset:i,factor:s}=n,o=zv(n,["size","width","height","offset","factor"]);return Vv({size:e,width:t,height:r,offset:i},!1,!1,s,o)};function Vv(n,e,t,r=3/4,i={}){const s=n.size||10,o=n.width||s,a=n.height||s,l=new Te,u={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!t){const c=jt(r,0,1);l.lineTo(o*c,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},u),i),{tagName:"path",d:Wr(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var yL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const bL=n=>{var{size:e,width:t,height:r,offset:i}=n,s=yL(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,u=new Te;return u.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:Wr(u.serialize(),i??-a/2)})};var vL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const wL=n=>{var{d:e,offsetX:t,offsetY:r}=n,i=vL(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:Wr(e,t,r)})};var _L=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const xL=n=>{var{size:e,width:t,height:r,offset:i}=n,s=_L(n,["size","width","height","offset"]);const o=e||10,a=t||o,l=r||o,u=new Te;return u.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Wr(u.serialize(),i||-a/2)})};var EL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const SL=n=>{var{width:e,height:t,offset:r,open:i,flip:s}=n,o=EL(n,["width","height","offset","open","flip"]);let a=t||6;const l=e||10,u=i===!0,c=s===!0,h=Object.assign(Object.assign({},o),{tagName:"path"});c&&(a=-a);const f=new Te;return f.moveTo(0,a).lineTo(l,0),u?h.fill="none":(f.lineTo(l,a),f.close()),h.d=Wr(f.serialize(),{x:r||-l/2,y:a/2}),h};var Wv=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const Gv=n=>{var{r:e}=n,t=Wv(n,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},t),{tagName:"circle",r})},AL=n=>{var{r:e}=n,t=Wv(n,["r"]);const r=e||5,i=new Te;return i.moveTo(r,0).lineTo(r,r*2),i.moveTo(0,r).lineTo(r*2,r),{children:[Object.assign(Object.assign({},Gv({r})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Wr(i.serialize(),-r)})]}};var PL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const OL=Object.freeze(Object.defineProperty({__proto__:null,async:SL,block:gL,circle:Gv,circlePlus:AL,classic:mL,cross:xL,diamond:bL,ellipse:n=>{var{rx:e,ry:t}=n,r=PL(n,["rx","ry"]);const i=e||5,s=t||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:s})},path:wL},Symbol.toStringTag,{value:"Module"}));var Gr;(function(n){n.presets=OL,n.registry=nt.create({type:"marker"}),n.registry.register(n.presets,!0)})(Gr||(Gr={})),(function(n){n.normalize=Wr})(Gr||(Gr={}));var CL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function Al(n){return typeof n=="string"||nr(n)}const TL={qualify:Al,set(n,{view:e,attrs:t}){return Pl("marker-start",n,e,t)}},ML={qualify:Al,set(n,{view:e,attrs:t}){return Pl("marker-end",n,e,t,{transform:"rotate(180)"})}},IL={qualify:Al,set(n,{view:e,attrs:t}){return Pl("marker-mid",n,e,t)}};function Pl(n,e,t,r,i={}){const s=typeof e=="string"?{name:e}:e,{name:o,args:a}=s,l=CL(s,["name","args"]);let u=l;if(o&&typeof o=="string"){const h=Gr.registry.get(o);if(h)u=h(Object.assign(Object.assign({},l),a));else return Gr.registry.onNotFound(o)}const c=Object.assign(Object.assign(Object.assign({},RL(r,n)),i),u);return{[n]:`url(#${t.graph.defineMarker(c)})`}}function RL(n,e){const t={},r=n.stroke;typeof r=="string"&&(t.stroke=r,t.fill=r);let i=n.strokeOpacity;if(i==null&&(i=n["stroke-opacity"]),i==null&&(i=n.opacity),i!=null&&(t["stroke-opacity"]=i,t["fill-opacity"]=i),e!=="marker-mid"){const s=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(s)&&s>1){const o=Math.ceil(s/2);t.refX=e==="marker-start"?o:-o}}return t}const Ji=(n,{view:e})=>e.cell.isEdge(),kL={qualify:Ji,set(n,e){var t,r,i,s;const o=e.view,a=n.reverse||!1,l=n.stubs||0;let u;if(Number.isFinite(l)&&l!==0)if(a){let c,h;const f=o.getConnectionLength()||0;l<0?(c=(f+l)/2,h=-l):(c=l,h=f-l*2);const d=o.getConnection();u=(s=(i=(r=(t=d?.divideAtLength(c))===null||t===void 0?void 0:t[1])===null||r===void 0?void 0:r.divideAtLength(h))===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.serialize()}else{let c;l<0?c=((o.getConnectionLength()||0)+l)/2:c=l;const h=o.getConnection();if(h){const f=h.divideAtLength(c),d=h.divideAtLength(-c);f&&d&&(u=`${f[0].serialize()} ${d[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},Hv={qualify:Ji,set:io("getTangentAtLength",{rotate:!0})},NL={qualify:Ji,set:io("getTangentAtLength",{rotate:!1})},Kv={qualify:Ji,set:io("getTangentAtRatio",{rotate:!0})},jL={qualify:Ji,set:io("getTangentAtRatio",{rotate:!1})},LL=Hv,DL=Kv;function io(n,e){const t={x:1,y:0};return(r,i)=>{let s,o;const a=i.view,l=a[n](Number(r));return l?(o=e.rotate?l.vector().vectorAngle(t):0,s=l.start):(s=a.path.start,o=0),o===0?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}const BL=Object.freeze(Object.defineProperty({__proto__:null,annotations:iL,atConnectionLength:LL,atConnectionLengthIgnoreGradient:NL,atConnectionLengthKeepGradient:Hv,atConnectionRatio:DL,atConnectionRatioIgnoreGradient:jL,atConnectionRatioKeepGradient:Kv,connection:kL,displayEmpty:oL,eol:sL,fill:Qj,filter:dL,html:fL,lineHeight:tL,port:pL,ref:jj,refCx:$j,refCy:Uj,refD:Gj,refDKeepOffset:zj,refDResetOffset:Lv,refDx:Lj,refDy:Dj,refHeight:Nv,refHeight2:Xj,refPoints:Hj,refPointsKeepOffset:Vj,refPointsResetOffset:Dv,refR:Wj,refRCircumscribed:Fj,refRInscribed:jv,refRx:Bj,refRy:qj,refWidth:kv,refWidth2:Jj,refX:Iv,refX2:Kj,refY:Rv,refY2:Yj,resetOffset:cL,sourceMarker:TL,stroke:Zj,style:hL,targetMarker:ML,text:$v,textPath:nL,textVerticalAnchor:rL,textWrap:eL,title:aL,vertexMarker:IL,xAlign:lL,yAlign:uL},Symbol.toStringTag,{value:"Module"}));var sr;(function(n){function e(t,r,i){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||ke(t.qualify,this,r,i)))}n.isValidDefinition=e})(sr||(sr={})),(function(n){n.presets=Object.assign(Object.assign({},Nj),BL),n.registry=nt.create({type:"attribute definition"}),n.registry.register(n.presets,!0)})(sr||(sr={}));const Yt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Yt.prefixCls}-${n}`}},Yv=Yt.prefix("highlighted"),qL={highlight(n,e,t){const r=t&&t.className||Yv;qe(e,r)},unhighlight(n,e,t){const r=t&&t.className||Yv;Dt(e,r)}},Jv=Yt.prefix("highlight-opacity"),FL={highlight(n,e){qe(e,Jv)},unhighlight(n,e){Dt(e,Jv)}};var Fe;(function(n){n.normalizeMarker=Wr;function e(f,d){const p=ZN(f.x,f.y).matrixTransform(d);return new W(p.x,p.y)}n.transformPoint=e;function t(f,d){return new Pe(e(f.start,d),e(f.end,d))}n.transformLine=t;function r(f,d){let p=f instanceof rt?f.points:f;return Array.isArray(p)||(p=[]),new rt(p.map(g=>e(g,d)))}n.transformPolyline=r;function i(f,d){const g=Ht("svg").createSVGPoint();g.x=f.x,g.y=f.y;const m=g.matrixTransform(d);g.x=f.x+f.width,g.y=f.y;const v=g.matrixTransform(d);g.x=f.x+f.width,g.y=f.y+f.height;const y=g.matrixTransform(d);g.x=f.x,g.y=f.y+f.height;const b=g.matrixTransform(d),_=Math.min(m.x,v.x,y.x,b.x),w=Math.max(m.x,v.x,y.x,b.x),x=Math.min(m.y,v.y,y.y,b.y),E=Math.max(m.y,v.y,y.y,b.y);return new Se(_,x,w-_,E-x)}n.transformRectangle=i;function s(f,d,p){let g;const m=f.ownerSVGElement;if(!m)return new Se(0,0,0,0);try{g=f.getBBox()}catch{g={x:f.clientLeft,y:f.clientTop,width:f.clientWidth,height:f.clientHeight}}if(d)return Se.create(g);const v=Vi(f,p||m);return i(g,v)}n.bbox=s;function o(f,d={}){let p;if(!f.ownerSVGElement||!$r(f)){if(nv(f)){const{left:y,top:b,width:_,height:w}=a(f);return new Se(y,b,_,w)}return new Se(0,0,0,0)}let m=d.target;if(!d.recursive){try{p=f.getBBox()}catch{p={x:f.clientLeft,y:f.clientTop,width:f.clientWidth,height:f.clientHeight}}if(!m)return Se.create(p);const y=Vi(f,m);return i(p,y)}{const y=f.childNodes,b=y.length;if(b===0)return o(f,{target:m});m||(m=f);for(let _=0;_<b;_+=1){const w=y[_];let x;w.childNodes.length===0?x=o(w,{target:m}):x=o(w,{target:m,recursive:!0}),p?p=p.union(x):p=x}return p}}n.getBBox=o;function a(f){let d=0,p=0,g=0,m=0;if(f){let v=f;for(;v;)d+=v.offsetLeft,p+=v.offsetTop,v=v.offsetParent,v&&(d+=parseInt(fv(v,"borderLeft"),10),p+=parseInt(fv(v,"borderTop"),10));g=f.offsetWidth,m=f.offsetHeight}return{left:d,top:p,width:g,height:m}}n.getBoundingOffsetRect=a;function l(f){const d=p=>{const g=f.getAttribute(p),m=g?parseFloat(g):0;return Number.isNaN(m)?0:m};switch(f instanceof SVGElement&&f.nodeName.toLowerCase()){case"rect":return new Se(d("x"),d("y"),d("width"),d("height"));case"circle":return new Kt(d("cx"),d("cy"),d("r"),d("r"));case"ellipse":return new Kt(d("cx"),d("cy"),d("rx"),d("ry"));case"polyline":{const p=Xs(f);return new rt(p)}case"polygon":{const p=Xs(f);return p.length>1&&p.push(p[0]),new rt(p)}case"path":{let p=f.getAttribute("d");return Te.isValid(p)||(p=Te.normalize(p)),Te.parse(p)}case"line":return new Pe(d("x1"),d("y1"),d("x2"),d("y2"))}return o(f)}n.toGeometryShape=l;function u(f,d,p,g){const m=W.create(d),v=W.create(p);g||(g=f instanceof SVGSVGElement?f:f.ownerSVGElement);const y=wl(f);f.setAttribute("transform","");const b=o(f,{target:g}).scale(y.sx,y.sy),_=Ui();_.setTranslate(-b.x-b.width/2,-b.y-b.height/2);const w=Ui(),x=m.angleBetween(v,m.clone().translate(1,0));x&&w.setRotate(x,0,0);const E=Ui(),A=m.clone().move(v,b.width/2);E.setTranslate(2*m.x-A.x,2*m.y-A.y);const O=Vi(f,g),T=Ui();T.setMatrix(E.matrix.multiply(w.matrix.multiply(_.matrix.multiply(O.scale(y.sx,y.sy))))),f.setAttribute("transform",Kn(T.matrix))}n.translateAndAutoOrient=u;function c(f){if(f==null)return null;let d=f;do{let p=d.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),Li(d,"x6-port"))d=d.nextElementSibling;else if(p==="G")d=d.firstElementChild;else if(p==="TITLE")d=d.nextElementSibling;else break}while(d);return d}n.findShapeNode=c;function h(f){const d=c(f);if(!$r(d)){if(nv(f)){const{left:m,top:v,width:y,height:b}=a(f);return new Se(m,v,y,b)}return new Se(0,0,0,0)}return l(d).bbox()||Se.create()}n.getBBoxV2=h})(Fe||(Fe={}));const $L={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},UL={highlight(n,e,t){const r=Hr.getHighlighterId(e,t);if(Hr.hasCache(r))return;t=_b({},t,$L);const i=Ie.create(e);let s,o;try{s=i.toPathData()}catch{o=Fe.bbox(i.node,!0),s=vv(Object.assign(Object.assign({},t),o))}const a=Ht("path");if(Ue(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?qi(t.attrs):null)),n.isEdgeElement(e))Ue(a,"d",n.getConnectionPathData());else{let c=i.getTransformToElement(n.container);const h=t.padding;if(h){o==null&&(o=Fe.bbox(i.node,!0));const f=o.x+o.width/2,d=o.y+o.height/2;o=Fe.transformRectangle(o,c);const p=Math.max(o.width,1),g=Math.max(o.height,1),m=(p+h)/p,v=(g+h)/g,y=dt({a:m,b:0,c:0,d:v,e:f-m*f,f:d-v*d});c=c.multiply(y)}Yn(a,c)}qe(a,Yt.prefix("highlight-stroke"));const l=n.cell,u=()=>Hr.removeHighlighter(r);l.on("removed",u),l.model&&l.model.on("reseted",u),n.container.appendChild(a),Hr.setCache(r,a)},unhighlight(n,e,t){Hr.removeHighlighter(Hr.getHighlighterId(e,t))}};var Hr;(function(n){function e(o,a){return cl(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function r(o,a){t[o]=a}n.setCache=r;function i(o){return t[o]!=null}n.hasCache=i;function s(o){const a=t[o];a&&(Hn(a),delete t[o])}n.removeHighlighter=s})(Hr||(Hr={}));const zL=Object.freeze(Object.defineProperty({__proto__:null,className:qL,opacity:FL,stroke:UL},Symbol.toStringTag,{value:"Module"}));var Er;(function(n){function e(t,r){if(typeof r.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof r.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(Er||(Er={})),(function(n){n.presets=zL,n.registry=nt.create({type:"highlighter"}),n.registry.register(n.presets,!0)})(Er||(Er={}));function Ol(n,e={}){return new W(Gt(e.x,n.width),Gt(e.y,n.height))}function Cl(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const VL=(n,e)=>n.map(({x:t,y:r,angle:i})=>Cl(Ol(e,{x:t,y:r}),i||0)),WL=(n,e,t)=>{const r=t.start||0,i=t.step||20;return Xv(n,e,r,(s,o)=>(s+.5-o/2)*i)},GL=(n,e,t)=>{const r=t.start||0,i=t.step||360/n.length;return Xv(n,e,r,s=>s*i)};function Xv(n,e,t,r){const i=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=Kt.fromRect(e),l=n.length;return n.map((u,c)=>{const h=t+r(c,l),f=s.clone().rotate(-h,i).scale(o,1,i),d=u.compensateRotate?-a.tangentTheta(f):0;return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),u.dr&&f.move(i,u.dr),Cl(f.round(),d,u)})}var HL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};const KL=(n,e,t)=>{const r=Ol(e,t.start||e.getOrigin()),i=Ol(e,t.end||e.getCorner());return Xi(n,r,i,t)},YL=(n,e,t)=>Xi(n,e.getTopLeft(),e.getBottomLeft(),t),JL=(n,e,t)=>Xi(n,e.getTopRight(),e.getBottomRight(),t),XL=(n,e,t)=>Xi(n,e.getTopLeft(),e.getTopRight(),t),QL=(n,e,t)=>Xi(n,e.getBottomLeft(),e.getBottomRight(),t);function Xi(n,e,t,r){const i=new Pe(e,t),s=n.length;return n.map((o,a)=>{var{strict:l}=o,u=HL(o,["strict"]);const c=l||r.strict?(a+1)/(s+1):(a+.5)/s,h=i.pointAt(c);return(u.dx||u.dy)&&h.translate(u.dx||0,u.dy||0),Cl(h.round(),0,u)})}const ZL=Object.freeze(Object.defineProperty({__proto__:null,absolute:VL,bottom:QL,ellipse:WL,ellipseSpread:GL,left:YL,line:KL,right:JL,top:XL},Symbol.toStringTag,{value:"Module"}));var bn;(function(n){n.presets=ZL,n.registry=nt.create({type:"port layout"}),n.registry.register(n.presets,!0)})(bn||(bn={}));const eD={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Kr(n,e){const{x:t,y:r,angle:i,attrs:s}=e||{};return _b({},{angle:i,attrs:s,position:{x:t,y:r}},n,eD)}const tD=(n,e,t)=>Kr({position:e.getTopLeft()},t),rD=(n,e,t)=>Kr({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),nD=(n,e,t)=>Kr({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),iD=(n,e,t)=>Kr({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),sD=(n,e,t)=>Kr({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),oD=(n,e,t)=>Qv(n,e,!1,t),aD=(n,e,t)=>Qv(n,e,!0,t),lD=(n,e,t)=>Zv(n,e,!1,t),uD=(n,e,t)=>Zv(n,e,!0,t);function Qv(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=e0(e);let a,l,u,c,h=0;return s<o[1]||s>o[2]?(a=".3em",l=i,u=0,c="start"):s<o[0]?(a="0",l=0,u=-i,t?(h=-90,c="start"):c="middle"):s<o[3]?(a=".3em",l=-i,u=0,c="end"):(a=".6em",l=0,u=i,t?(h=90,c="start"):c="middle"),Kr({position:{x:Math.round(l),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":c}}},r)}function Zv(n,e,t,r){const i=r.offset!=null?r.offset:15,s=e.getCenter().theta(n),o=e0(e);let a,l,u,c,h=0;return s<o[1]||s>o[2]?(a=".3em",l=-i,u=0,c="end"):s<o[0]?(a=".6em",l=0,u=i,t?(h=90,c="start"):c="middle"):s<o[3]?(a=".3em",l=i,u=0,c="start"):(a="0em",l=0,u=-i,t?(h=-90,c="start"):c="middle"),Kr({position:{x:Math.round(l),y:Math.round(u)},angle:h,attrs:{".":{y:a,"text-anchor":c}}},r)}function e0(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),r=e.theta(n.getBottomLeft()),i=e.theta(n.getBottomRight()),s=e.theta(n.getTopRight());return[t,s,i,r]}const cD=(n,e,t)=>t0(n.diff(e.getCenter()),!1,t),hD=(n,e,t)=>t0(n.diff(e.getCenter()),!0,t);function t0(n,e,t){const r=t.offset!=null?t.offset:20,i=new W(0,0),s=-n.theta(i),o=n.clone().move(i,r).diff(n).round();let a=".3em",l,u=s;return(s+90)%180===0?(l=e?"end":"middle",!e&&s===-270&&(a="0em")):s>-270&&s<-90?(l="start",u=s-180):l="end",Kr({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":l}}},t)}const fD=Object.freeze(Object.defineProperty({__proto__:null,bottom:sD,inside:lD,insideOriented:uD,left:rD,manual:tD,outside:oD,outsideOriented:aD,radial:cD,radialOriented:hD,right:nD,top:iD},Symbol.toStringTag,{value:"Module"}));var ti;(function(n){n.presets=fD,n.registry=nt.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(ti||(ti={}));var dD=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Ke extends Rt{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=Tl.uniqueId(),Ke.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return Di(e),this}unmount(e=this.container){return Hn(e),this}remove(e=this.container){return e===this.container?(this.removeEventListeners(document),this.onRemove(),delete Ke.views[this.cid],this.disposeContainer&&this.unmount(e)):this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return qe(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return Dt(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Fi(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&Ue(t,e),this}findAttr(e,t=this.container){let r=t;for(;r&&r.nodeType===1;){const i=r.getAttribute(e);if(i!=null)return i;if(r===this.container)return null;r=r.parentNode}return null}find(e,t=this.container,r=this.selectors){return Ke.find(e,t,r).elems}findOne(e,t=this.container,r=this.selectors){const i=this.find(e,t,r);return i.length>0?i[0]:null}findByAttr(e,t=this.container){let r=t;for(;r&&r.getAttribute;){const i=r.getAttribute(e);if((i!=null||r===this.container)&&i!=="false")return r;r=r.parentNode}return null}getSelector(e,t){let r;if(e===this.container)return typeof t=="string"&&(r=`> ${t}`),r;if(e){const i=fl(e)+1;r=`${e.tagName.toLowerCase()}:nth-child(${i})`,t&&(r+=` > ${t}`),r=this.getSelector(e.parentNode,r)}return r}prefixClassName(e){return Yt.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const r=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(i=>{const s=i.match(r);if(s==null)return;const o=this.getEventHandler(e[i]);typeof o=="function"&&this.delegateEvent(s[1],s[2],o)}),this}undelegateEvents(){return vt.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,r){return vt.on(this.container,e+this.getEventNamespace(),t,r),this}undelegateEvent(e,t,r){const i=e+this.getEventNamespace();return t==null?vt.off(this.container,i):typeof t=="string"?vt.off(this.container,i,t,r):vt.off(this.container,i,t),this}addEventListeners(e,t,r){if(t==null)return this;const i=this.getEventNamespace();return Object.keys(t).forEach(s=>{const o=this.getEventHandler(t[s]);typeof o=="function"&&vt.on(e,s+i,r,o)}),this}removeEventListeners(e){return e!=null&&vt.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Yt.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const r=this[e];typeof r=="function"&&(t=(...i)=>r.call(this,...i))}else t=(...r)=>e.call(this,...r);return t}getEventTarget(e,t={}){const{target:r,type:i,clientX:s=0,clientY:o=0}=e;return t.fromPoint||i==="touchmove"||i==="touchend"?document.elementFromPoint(s,o):r}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let r=e.data;const i=`__${this.cid}__`;return t==null?r==null?{}:r[i]||{}:(r==null&&(r=e.data={}),r[i]==null?r[i]=Object.assign({},t):r[i]=Object.assign(Object.assign({},r[i]),t),r[i])}normalizeEvent(e){return Ke.normalizeEvent(e)}dispose(){this.remove()}}dD([Ke.dispose()],Ke.prototype,"dispose",null),(function(n){function e(i,s){return s?Ht(i||"g"):hl(i||"div")}n.createElement=e;function t(i,s,o){if(!i||i===".")return{elems:[s]};if(o){const a=o[i];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=i.includes(">")?`:scope ${i}`:i;return{isCSSSelector:!0,elems:Array.prototype.slice.call(s.querySelectorAll(a))}}}n.find=t;function r(i){let s=i;const o=i.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in i)a[l]===void 0&&(a[l]=i[l]);s=a}return s}n.normalizeEvent=r})(Ke||(Ke={})),(function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e})(Ke||(Ke={}));var Tl;(function(n){let e=0;function t(){const r=`v${e}`;return e+=1,r}n.uniqueId=t})(Tl||(Tl={}));class pD{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new xl,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const r=this.view.container;t.matrix=ij(e,r)}return dt(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Fe.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Fe.getBBoxV2(e)),t.boundingRect.clone()}}var Ye;(function(n){function e(u){return u!=null&&!t(u)}n.isJSONMarkup=e;function t(u){return u!=null&&typeof u=="string"}n.isStringMarkup=t;function r(u){return u==null||t(u)?u:Ze(u)}n.clone=r;function i(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=i;function s(u,c={ns:ft.svg}){const h=document.createDocumentFragment(),f={},d={},p=[{markup:Array.isArray(u)?u:[u],parent:h,ns:c.ns}];for(;p.length>0;){const g=p.pop();let m=g.ns||ft.svg;const v=g.markup,y=g.parent;v.forEach(b=>{const _=b.tagName;if(!_)throw new TypeError("Invalid tagName");b.ns&&(m=b.ns);const w=m?hl(_,m):ev(_),x=b.attrs;x&&Ue(w,qi(x));const E=b.style;E&&Fi(w,E);const A=b.className;A!=null&&w.setAttribute("class",Array.isArray(A)?A.join(" "):A),b.textContent&&(w.textContent=b.textContent);const O=b.selector;if(O!=null){if(d[O])throw new TypeError("Selector must be unique");d[O]=w}if(b.groupSelector){let M=b.groupSelector;Array.isArray(M)||(M=[M]),M.forEach(C=>{f[C]||(f[C]=[]),f[C].push(w)})}y.appendChild(w);const T=b.children;Array.isArray(T)&&p.push({ns:m,markup:T,parent:w})})}return Object.keys(f).forEach(g=>{if(d[g])throw new Error("Ambiguous group selector");d[g]=f[g]}),{fragment:h,selectors:d,groups:f}}n.parseJSONMarkup=s;function o(u){return u instanceof SVGElement?Ht("g"):ev("div")}function a(u){if(t(u)){const d=Ie.createVectors(u),p=d.length;if(p===1)return{elem:d[0].node};if(p>1){const g=o(d[0].node);return d.forEach(m=>{g.appendChild(m.node)}),{elem:g}}return{}}const c=s(u),h=c.fragment;let f=null;return h.childNodes.length>1?(f=o(h.firstChild),f.appendChild(h)):f=h.firstChild,{elem:f,selectors:c.selectors}}n.renderMarkup=a;function l(u){const c=Ie.createVectors(u),h=document.createDocumentFragment();for(let f=0,d=c.length;f<d;f+=1){const p=c[f].node;h.appendChild(p)}return{fragment:h,selectors:{}}}n.parseLabelStringMarkup=l})(Ye||(Ye={})),(function(n){function e(t,r,i){if(t!=null){let s;const o=t.tagName.toLowerCase();if(t===r)return typeof i=="string"?s=`> ${o} > ${i}`:s=`> ${o}`,s;const a=t.parentNode;if(a&&a.childNodes.length>1){const l=fl(t)+1;s=`${o}:nth-child(${l})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,r,s)}return i}n.getSelector=e})(Ye||(Ye={})),(function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function r(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=r})(Ye||(Ye={})),(function(n){function e(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=e})(Ye||(Ye={})),(function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ft.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ft.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e})(Ye||(Ye={}));class r0{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let r,i,s,o;const a=[];return Object.keys(t).forEach(l=>{const u=t[l],c=this.getDefinition(l),h=ke(sr.isValidDefinition,this.view,c,u,{elem:e,attrs:t,cell:this.cell,view:this.view});if(c&&h)typeof c=="string"?(r==null&&(r={}),r[c]=u):u!==null&&a.push({name:l,definition:c});else{r==null&&(r={});const f=iv.includes(l)?l:jb(l);r[f]=u}}),a.forEach(({name:l,definition:u})=>{const c=t[l];typeof u.set=="function"&&(i==null&&(i={}),i[l]=c),typeof u.offset=="function"&&(s==null&&(s={}),s[l]=c),typeof u.position=="function"&&(o==null&&(o={}),o[l]=c)}),{raw:t,normal:r,set:i,offset:s,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const r=e.normal&&e.normal.transform;r!=null&&t.normal&&(t.normal.transform=r),e.normal=t.normal}findAttrs(e,t,r,i){const s=[],o=new xl;return Object.keys(e).forEach(a=>{const l=e[a];if(!nr(l))return;const{isCSSSelector:u,elems:c}=Ke.find(a,t,i);r[a]=c;for(let h=0,f=c.length;h<f;h+=1){const d=c[h],p=i&&i[a]===d,g=o.get(d);if(g){g.array||(s.push(d),g.array=!0,g.attrs=[g.attrs],g.priority=[g.priority]);const m=g.attrs,v=g.priority;if(p)m.unshift(l),v.unshift(-1);else{const y=rN(v,u?-1:f);m.splice(y,0,l),v.splice(y,0,f)}}else o.set(d,{elem:d,attrs:l,priority:p?-1:f,array:!1})}}),s.forEach(a=>{const l=o.get(a),u=l.attrs;l.attrs=u.reduceRight((c,h)=>ot(c,h),{})}),o}updateRelativeAttrs(e,t,r){const i=t.raw||{};let s=t.normal||{};const o=t.set,a=t.position,l=t.offset,u=()=>({elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:r.clone()});if(o!=null&&Object.keys(o).forEach(m=>{const v=o[m],y=this.getDefinition(m);if(y!=null){const b=ke(y.set,this.view,v,u());typeof b=="object"?s=Object.assign(Object.assign({},s),b):b!=null&&(s[m]=b)}}),e instanceof HTMLElement){this.view.setAttrs(s,e);return}const c=s.transform,h=c?`${c}`:null,f=zi(h),d=new W(f.e,f.f);c&&(delete s.transform,f.e=0,f.f=0);let p=!1;a!=null&&Object.keys(a).forEach(m=>{const v=a[m],y=this.getDefinition(m);if(y!=null){const b=ke(y.position,this.view,v,u());b!=null&&(p=!0,d.translate(W.create(b)))}}),this.view.setAttrs(s,e);let g=!1;if(l!=null){const m=this.view.getBoundingRectOfElement(e);if(m.width>0&&m.height>0){const v=Fe.transformRectangle(m,f);Object.keys(l).forEach(y=>{const b=l[y],_=this.getDefinition(y);if(_!=null){const w=ke(_.offset,this.view,b,{elem:e,cell:this.cell,view:this.view,attrs:i,refBBox:v});w!=null&&(g=!0,d.translate(W.create(w)))}})}}(c!=null||p||g)&&(d.round(1),f.e=d.x,f.f=d.y,e.setAttribute("transform",Kn(f)))}update(e,t,r){const i={},s=this.findAttrs(r.attrs||t,e,i,r.selectors),o=r.attrs?this.findAttrs(t,e,i,r.selectors):s,a=[];s.each(c=>{const h=c.elem,f=c.attrs,d=this.processAttrs(h,f);if(d.set==null&&d.position==null&&d.offset==null)this.view.setAttrs(d.normal,h);else{const p=o.get(h),g=p?p.attrs:null,m=g&&f.ref==null?g.ref:f.ref;let v;if(m){if(v=(i[m]||this.view.find(m,e,r.selectors))[0],!v)throw new Error(`"${m}" reference does not exist.`)}else v=null;const y={node:h,refNode:v,attributes:g,processedAttributes:d},b=a.findIndex(_=>_.refNode===h);b>-1?a.splice(b,0,y):a.push(y)}});const l=new xl;let u;a.forEach(c=>{const h=c.node,f=c.refNode;let d;const p=f!=null&&r.rotatableNode!=null&&rv(r.rotatableNode,f);if(f&&(d=l.get(f)),!d){const v=p?r.rotatableNode:e;d=f?Fe.getBBox(f,{target:v}):r.rootBBox,f&&l.set(f,d)}let g;r.attrs&&c.attributes?(g=this.processAttrs(h,c.attributes),this.mergeProcessedAttrs(g,c.processedAttributes)):g=c.processedAttributes;let m=d;p&&r.rotatableNode!=null&&!r.rotatableNode.contains(h)&&(u||(u=zi(Ue(r.rotatableNode,"transform"))),m=Fe.transformRectangle(d,u)),this.updateRelativeAttrs(h,g,m)})}}class n0{get cell(){return this.view.cell}constructor(e,t,r=[]){this.view=e;const i={},s={};let o=0;Object.keys(t).forEach(l=>{let u=t[l];Array.isArray(u)||(u=[u]),u.forEach(c=>{let h=i[c];h||(o+=1,h=i[c]=1<<o),s[l]|=h})});let a=r;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{i[l]||(o+=1,i[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,this.bootstrap=r}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((r,i)=>r|t[i],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var gD=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},mD=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class it extends Ke{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,c)=>c!=null?Cb([...Array.isArray(u)?u:[u],...Array.isArray(c)?c:[c]]):Array.isArray(u)?[...u]:[u],r=Ze(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:a}=e,l=mD(e,["bootstrap","actions","events","documentEvents"]);return i&&(r.bootstrap=t(r.bootstrap,i)),s&&Object.entries(s).forEach(([u,c])=>{const h=r.actions[u];c&&h?r.actions[u]=t(h,c):c&&(r.actions[u]=t(c))}),o&&(r.events=Object.assign(Object.assign({},r.events),o)),e.documentEvents&&(r.documentEvents=Object.assign(Object.assign({},r.documentEvents),a)),ot(r,l)}get[Symbol.toStringTag](){return it.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new r0(this),this.flag=new n0(this,this.options.actions,this.options.bootstrap),this.cache=new pD(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(e){return this.getConstructor().getOptions(e)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return Ke.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const r=this.getContainerStyle();r!=null&&this.setStyle(r,e);const i=this.getContainerClassName();i!=null&&this.addClass(i,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,r,i){if(this.hasAction(e,t)){r();const s=[t];return i&&(typeof i=="string"?s.push(i):s.push(...i)),this.removeAction(e,s)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const r=Ye.parseJSONMarkup(e),i=r.selectors,s=this.rootSelector;if(t&&s){if(i[s])throw new Error("Invalid root selector");i[s]=t}return r}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=ke(t,this.graph,this)),typeof t=="object"){let r=t[e];return typeof r=="function"&&(r=ke(r,this.graph,this)),r!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootRotatedMatrix(),s=this.getRootTranslatedMatrix();return Fe.transformRectangle(t,s.multiply(i).multiply(r))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),r=this.getMatrixOfElement(e),i=this.getRootTranslatedMatrix();return Fe.transformRectangle(t,i.multiply(r))}getBBox(e={}){let t;if(e.useCellGeometry){const r=this.cell,i=r.isNode()?r.getAngle():0;t=r.getBBox().bbox(i)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return dt().translate(t.x,t.y)}getRootRotatedMatrix(){let e=dt();const t=this.cell,r=t.isNode()?t.getAngle():0;if(r){const i=t.getBBox(),s=i.width/2,o=i.height/2;e=e.translate(s,o).rotate(r).translate(-s,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,r={}){r.rootBBox==null&&(r.rootBBox=new Se),r.selectors==null&&(r.selectors=this.selectors),this.attr.update(e,t,r)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const r=e||this.container;return t.partial=r===this.container,r}highlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const r=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:r,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:r,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:r,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,r,i,s){const o=this.cell,a=this.findAttr("port",e),l=e.getAttribute("data-selector"),u={cell:o.id};return l!=null&&(u.magnet=l),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(u.selector=this.getSelector(e))):l==null&&this.container!==e&&(u.selector=this.getSelector(e)),u}getMagnetFromEdgeTerminal(e){const t=this.cell,r=this.container,i=e.port;let s=e.magnet,o;return i!=null&&t.isNode()&&t.hasPort(i)?o=this.findPortElem(i,s)||r:(s||(s=e.selector),!s&&i!=null&&(s=`[port="${i}"]`),o=this.findOne(s,r,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=at.isToolsView(e)?e:new at(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,r){const i=this,s=i.cell;return t==null||r==null?{e,view:i,cell:s}:{e,x:t,y:r,view:i,cell:s}}onClick(e,t,r){this.notify("cell:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){this.notify("cell:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){this.notify("cell:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,r))}onMouseUp(e,t,r){this.notify("cell:mouseup",this.getEventArgs(e,t,r)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,r){this.notify("cell:mousemove",this.getEventArgs(e,t,r))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),this.notify(t,Object.assign({},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){}onMagnetDblClick(e,t,r,i){}onMagnetContextMenu(e,t,r,i){}onLabelMouseDown(e,t,r){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),r=this.graph.findViewByElem(t);r!==this&&(this.onMouseLeave(e),r&&r.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}it.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},gD([it.dispose()],it.prototype,"dispose",null),(function(n){n.Flag=n0,n.Attr=r0})(it||(it={})),(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"}n.isCellView=e})(it||(it={})),(function(n){function e(r){return function(i){i.config({priority:r})}}n.priority=e;function t(r){return function(i){i.config({bootstrap:r})}}n.bootstrap=t})(it||(it={})),(function(n){n.registry=nt.create({type:"view"})})(it||(it={}));class at extends Ke{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return at.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const r=e?Ke.createElement("g",!0):Ke.createElement("div",!1);return qe(r,this.prefixClassName("cell-tools")),t.className&&qe(r,t.className),r}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!it.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(qe(this.svgContainer,this.prefixClassName("edge-tools")),qe(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(qe(this.svgContainer,this.prefixClassName("node-tools")),qe(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const r=[];t.forEach(i=>{at.ToolItem.isToolItem(i)?i.name==="vertices"?r.unshift(i):r.push(i):(typeof i=="object"?i.name:i)==="vertices"?r.unshift(i):r.push(i)});for(let i=0;i<r.length;i+=1){const s=r[i];let o;if(at.ToolItem.isToolItem(s))o=s;else{const a=typeof s=="object"?s.name:s,l=typeof s=="object"?s.args||{}:{};if(a){if(this.cell.isNode()){const u=ni.registry.get(a);if(u)o=new u(l);else return ni.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=ii.registry.get(a);if(u)o=new u(l);else return ii.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(e={}){const t=this.tools;return t&&t.forEach(r=>{e.toolId!==r.cid&&r.isVisible()&&r.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(r=>{e===r?r.show():r.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(r=>{r!==e&&!r.isVisible()&&(r.show(),r.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),Hn(this.svgContainer),Hn(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const r=e.some(s=>s.options.isSVGElement!==!1),i=e.some(s=>s.options.isSVGElement===!1);r&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),i&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&i.graph!=null&&i.cell!=null&&typeof i.config=="function"&&typeof i.update=="function"&&typeof i.focus=="function"&&typeof i.blur=="function"&&typeof i.show=="function"&&typeof i.hide=="function"}n.isToolsView=e})(at||(at={})),(function(n){class e extends Ke{static getDefaults(){return this.defaults}static config(r){this.defaults=this.getOptions(r)}static getOptions(r){return ot(Ze(this.getDefaults()),r)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}constructor(r={}){super(),this.visible=!0,this.options=this.getOptions(r),this.container=Ke.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),qe(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&qe(this.container,this.options.className),this.init()}init(){}getOptions(r){return this.constructor.getOptions(r)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(r,i){return this.cellView=r,this.parent=i,this.stamp(this.container),this.cell.isEdge()?qe(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&qe(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const r=this.options.markup;if(r){const i=Ye.parseJSONMarkup(r);this.container.appendChild(i.fragment),this.childNodes=i.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(r){r&&r.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const r=this.options.focusOpacity;return r!=null&&Number.isFinite(r)&&(this.container.style.opacity=`${r}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(r){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(r,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,(function(t){let r=0;function i(o){return o?sl(o):(r+=1,`CustomTool${r}`)}function s(o){const a=nl(i(o.name),this);return a.config(o),a}t.define=s})(e=n.ToolItem||(n.ToolItem={})),(function(t){t.toStringTag=`X6.${t.name}`;function r(i){if(i==null)return!1;if(i instanceof t)return!0;const s=i[Symbol.toStringTag],o=i;return(s==null||s===t.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}t.isToolItem=r})(e=n.ToolItem||(n.ToolItem={}))})(at||(at={}));const yD=n=>n;function i0(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function s0(n){return(t,r,i,s)=>r.isEdgeElement(i)?vD(n,t,r,i,s):bD(n,t,r,i,s)}function bD(n,e,t,r,i){const s=t.cell,o=s.getAngle(),a=t.getUnrotatedBBoxOfElement(r),l=s.getBBox().getCenter(),u=W.create(i).rotate(o,l);let c=u.x-a.x,h=u.y-a.y;return n&&(c=i0(c,a.width),h=i0(h,a.height)),e.anchor={name:"topLeft",args:{dx:c,dy:h,rotate:!0}},e}function vD(n,e,t,r,i){const s=t.getConnection();if(!s)return e;const o=s.closestPointLength(i);if(n){const a=s.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const wD=s0(!0),_D=s0(!1),xD=Object.freeze(Object.defineProperty({__proto__:null,noop:yD,pinAbsolute:_D,pinRelative:wD},Symbol.toStringTag,{value:"Module"}));var Ml;(function(n){n.presets=xD,n.registry=nt.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(Ml||(Ml={}));function o0(n,e,t,r){return ke(Ml.presets.pinRelative,this.graph,{},e,t,n,this.cell,r,{}).anchor}function a0(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Yr extends at.ToolItem{onRender(){qe(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Yn(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:r=0,y:i=0}=t;const{offset:s,useCellGeometry:o,rotate:a}=t;let l=a0(e,o);const u=e.cell.getAngle();a||(l=l.bbox(u));let c=0,h=0;typeof s=="number"?(c=s,h=s):typeof s=="object"&&(c=s.x,h=s.y),r=Gt(r,l.width),i=Gt(i,l.height);let f=dt().translate(l.x+l.width/2,l.y+l.height/2);return a&&(f=f.rotate(u)),f=f.translate(r+c-l.width/2,i+h-l.height/2),f}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:r=0,distance:i=0,rotate:s}=t;let o,a,l;const u=Gt(i,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,l=o.vector().vectorAngle(new W(1,0))||0):(a=e.getConnection().start,l=0);let c=dt().translate(a.x,a.y).rotate(l);return typeof r=="object"?c=c.translate(r.x||0,r.y||0):c=c.translate(0,r),s||(c=c.rotate(-l)),c}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&ke(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Yr||(Yr={})),(function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})})(Yr||(Yr={}));var ED=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class so extends at.ToolItem{onRender(){if(qe(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,r=ED(e,["class"]);Ue(this.container,qi(r)),t&&qe(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:r,rotate:i}=t,s=fn(t.padding);let o=a0(e,r).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const a=e.cell;if(a.isNode()){const l=a.getAngle();if(l)if(i){const u=a.getBBox().getCenter();vl(this.container,l,u.x,u.y,{absolute:!0})}else o=o.bbox(l)}return Ue(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(so||(so={}));class Qi extends at.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.options.createHandle,o=this.options.processHandle,a=s({index:t,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(i.x,i.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const e=this.vertices;for(let t=0,r=e.length;t<r;t+=1){const i=e[t],s=this.handles[t];s&&s.updatePosition(i.x,i.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,r=this.vertices,i=e>0?r[e-1]:t.sourceAnchor,s=e<r.length-1?r[e+1]:t.targetAnchor;return{prev:W.create(i),next:W.create(s)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:r,y:i}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:r,y:i}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:r,x:i,y:s}=this.getMouseEventArgs(e);this.eventData(r,{start:{x:i,y:s}}),t.notifyMouseDown(r,i,s)}}onHandleChanging({handle:e,e:t}){const r=this.cellView,i=e.options.index,{e:s,x:o,y:a}=this.getMouseEventArgs(t),l={x:o,y:a};this.snapVertex(l,i),r.cell.setVertexAt(i,l,{ui:!0,toolId:this.cid}),e.updatePosition(l.x,l.y),this.options.stopPropagation||r.notifyMouseMove(s,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,r=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}r.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:s,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){r.notifyMouseUp(s,o,a);const{start:l}=this.eventData(s);if(l){const{x:u,y:c}=l;u===o&&c===a&&r.onClick(s,o,a)}}r.checkMouseleave(s),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}snapVertex(e,t){const r=this.options.snapRadius||0;if(r>0){const i=this.getNeighborPoints(t),s=i.prev,o=i.next;Math.abs(e.x-s.x)<r?e.x=s.x:Math.abs(e.x-o.x)<r&&(e.x=o.x),Math.abs(e.y-s.y)<r?e.y=i.prev.y:Math.abs(e.y-o.y)<r&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const r=e.options.index,i=this.cellView;i.cell.removeVertexAt(r,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),r=this.options.addable&&this.cellView.can("vertexAddable"),i=this.options.modifiers?Jn.isMatch(e,this.options.modifiers):!0;return!t&&r&&i}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const s=t.getVertexIndex(i.x,i.y);this.snapVertex(i,s),t.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[s];this.eventData(r,{vertexAdded:!0}),o.onMouseDown(r)}onRemove(){this.resetHandles()}}(function(n){class e extends Ke{get graph(){return this.options.graph}constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=Ke.createElement("circle",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(r,i){this.setAttrs({cx:r,cy:i})}onMouseDown(r){this.options.guard(r)||(r.stopPropagation(),r.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data),this.emit("change",{e:r,handle:this}))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(r){this.emit("remove",{e:r,handle:this})}}n.Handle=e})(Qi||(Qi={})),(function(n){const e=Yt.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})})(Qi||(Qi={}));class Zi extends at.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){qe(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let r=0,i=t.length;r<i-1;r+=1){const s=t[r],o=t[r+1],a=this.renderHandle(s,o,r);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,r){const i=this.options.createHandle({index:r,graph:this.graph,guard:s=>this.guard(s),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.updateHandle(i,e,t),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let r=0,i=t.length;r<i;r+=1)t[r].options.index+=e}resetAnchor(e,t){const r=this.cellView.cell,i={ui:!0,toolId:this.cid};t?r.prop([e,"anchor"],t,i):r.removeProp([e,"anchor"],i)}snapHandle(e,t,r){const i=e.options.axis,s=e.options.index,l=this.cellView.cell.getVertices(),u=l[s-2]||r.sourceAnchor,c=l[s+1]||r.targetAnchor,h=this.options.snapRadius;return Math.abs(t[i]-u[i])<h?t[i]=u[i]:Math.abs(t[i]-c[i])<h&&(t[i]=c[i]),t}onHandleChanging({handle:e,e:t}){const r=this.graph,i=this.options,s=this.cellView,o=i.anchor,a=e.options.axis,l=e.options.index-1,u=this.getEventData(t),c=this.normalizeEvent(t),h=r.snapToGrid(c.clientX,c.clientY),f=this.snapHandle(e,h.clone(),u),d=Ze(this.vertices);let p=d[l],g=d[l+1];const m=s.sourceView,v=s.sourceBBox;let y=!1,b=!1;if(p?l===0?v.containsPoint(p)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(p[a]=f[a],b=!0):p[a]=f[a]:(p=s.sourceAnchor.toJSON(),p[a]=f[a],v.containsPoint(p)?y=!0:(d.unshift(p),this.shiftHandleIndexes(1),b=!0)),typeof o=="function"&&m){if(y){const A=u.sourceAnchor.clone();A[a]=f[a];const O=ke(o,s,A,m,s.sourceMagnet||m.container,"source",s,this);this.resetAnchor("source",O)}b&&this.resetAnchor("source",u.sourceAnchorDef)}const _=s.targetView,w=s.targetBBox;let x=!1,E=!1;if(g?l===d.length-2?w.containsPoint(g)?(d.pop(),x=!0):(g[a]=f[a],E=!0):g[a]=f[a]:(g=s.targetAnchor.toJSON(),g[a]=f[a],w.containsPoint(g)?x=!0:(d.push(g),E=!0)),typeof o=="function"&&_){if(x){const A=u.targetAnchor.clone();A[a]=f[a];const O=ke(o,s,A,_,s.targetMagnet||_.container,"target",s,this);this.resetAnchor("target",O)}E&&this.resetAnchor("target",u.targetAnchorDef)}W.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(e,p,g,0),i.stopPropagation||s.notifyMouseMove(c,h.x,h.y)}onHandleChange({handle:e,e:t}){const r=this.options,i=this.handles,s=this.cellView,o=e.options.index;if(Array.isArray(i)){for(let a=0,l=i.length;a<l;a+=1)a!==o&&i[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:Ze(this.cell.prop(["source","anchor"])),targetAnchorDef:Ze(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!r.stopPropagation){const a=this.normalizeEvent(t),l=this.graph.snapToGrid(a.clientX,a.clientY);s.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e}){const t=this.options,r=this.cellView;t.removeRedundancies&&r.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(e),s=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||r.notifyMouseUp(i,s.x,s.y),r.checkMouseleave(i),t.onChanged&&t.onChanged({edge:r.cell,edgeView:r})}updateHandle(e,t,r,i=0){const s=this.options.precision||0,o=Math.abs(t.x-r.x)<s,a=Math.abs(t.y-r.y)<s;if(o||a){const l=new Pe(t,r);if(l.length()<this.options.threshold)e.hide();else{const c=l.getCenter(),h=o?"x":"y";c[h]+=i||0;const f=l.vector().vectorAngle(new W(1,0));e.updatePosition(c.x,c.y,f,this.cellView),e.show(),e.options.axis=h}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends Ke{constructor(r){super(),this.options=r,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Ke.createElement("rect",!0);const r=this.options.attrs;if(typeof r=="function"){const i=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},i.attrs),r(this)))}else this.setAttrs(r);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(r,i,s,o){const a=o.getClosestPoint(new W(r,i))||new W(r,i);let l=dt().translate(a.x,a.y);if(a.equals({x:r,y:i}))l=l.rotate(s);else{let c=new Pe(r,i,a.x,a.y).vector().vectorAngle(new W(1,0));c!==0&&(c+=90),l=l.rotate(c)}this.setAttrs({transform:Kn(l),cursor:s%180===0?"row-resize":"col-resize"})}onMouseDown(r){this.options.guard(r)||(this.trigger("change",{e:r,handle:this}),r.stopPropagation(),r.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},r.data))}onMouseMove(r){this.emit("changing",{e:r,handle:this})}onMouseUp(r){this.emit("changed",{e:r,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=e})(Zi||(Zi={})),(function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new n.Handle(e),anchor:o0})})(Zi||(Zi={}));class oo extends at.ToolItem{get type(){return this.options.type}onRender(){qe(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const r=this.type,i=this.cellView,s=this.options,o=i.getTerminalAnchor(r),a=i.cell.prop([r,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?s.customAnchorAttrs:s.defaultAnchorAttrs;l&&Object.keys(l).forEach(u=>{t.setAttribute(u,l[u])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const r=this.type,i=this.cellView,s=i.getTerminalView(r);if(s){const o=s.cell,a=i.getTerminalMagnet(r);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let u,c,h;s.isEdgeElement(a)?(u=s.getBBox(),c=0,h=u.getCenter()):(u=s.getUnrotatedBBoxOfElement(a),c=o.getAngle(),h=u.getCenter(),c&&h.rotate(-c,o.getBBox().getCenter())),u.inflate(l),Ue(t,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${h.x}, ${h.y}) rotate(${c})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(e){const t=this.type,r=this.cell;e?r.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):r.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,r=this.cellView,i=r.getTerminalView(t);if(i==null)return;const s=this.normalizeEvent(e),o=i.cell,a=r.getTerminalMagnet(t);let l=this.graph.coord.clientToLocalPoint(s.clientX,s.clientY);const u=this.options.snap;if(typeof u=="function"){const f=ke(u,r,l,i,a,t,r,this);l=W.create(f)}if(this.options.restrictArea)if(i.isEdgeElement(a)){const f=i.getClosestPoint(l);f&&(l=f)}else{const f=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),p=o.getBBox().getCenter(),g=l.clone().rotate(d,p);f.containsPoint(g)||(l=f.getNearestPointToPoint(g).rotate(-d,p))}let c;const h=this.options.anchor;typeof h=="function"&&(c=ke(h,r,l,i,a,t,r,this)),this.resetAnchor(c),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:o0,snap(e,t,r,i,s,o){const a=o.options.snapRadius||0,l=i==="source",u=l?0:-1,c=this.cell.getVertexAt(u)||this.getTerminalAnchor(l?"target":"source");return c&&(Math.abs(c.x-e.x)<a&&(e.x=c.x),Math.abs(c.y-e.y)<a&&(e.y=c.y)),e}})})(oo||(oo={}));const SD=oo.define({name:"source-anchor",type:"source"}),AD=oo.define({name:"target-anchor",type:"target"});var PD=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class ao extends at.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,r=PD(e,["class"]);this.setAttrs(r,this.container),t&&qe(this.container,t)}}onRender(){qe(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,r=t.getTangentAtRatio(e),i=r?r.start:t.getPointAtRatio(e),s=r&&r.vector().vectorAngle(new W(1,0))||0;if(!i)return this;const o=dt().translate(i.x,i.y).rotate(s);return Yn(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const r=this.graph.snapToGrid(e.clientX,e.clientY),i=t.prepareArrowheadDragging(this.type,{x:r.x,y:r.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,i),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,r.x,r.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.cellView,i=this.graph.snapToGrid(t.clientX,t.clientY);r.onMouseUp(t,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",r.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(ao||(ao={}));const OD=ao.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),CD=ao.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class ri extends at.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=at.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:e,editor:t}=this;if(!t)return;const{style:r}=t;e.isNode()?this.updateNodeEditorTransform():e.isEdge()&&this.updateEdgeEditorTransform();const{attrs:i}=this.options;r.fontSize=`${i.fontSize}px`,r.fontFamily=i.fontFamily,r.color=i.color,r.backgroundColor=i.backgroundColor;const s=this.getCellText()||"";return t.innerText=s,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:r}=this;if(!r)return;let i=W.create(),s=20,o="",{x:a,y:l}=this.options;const{width:u,height:c}=this.options;if(typeof a<"u"&&typeof l<"u"){const d=t.getBBox();a=Gt(a,d.width),l=Gt(l,d.height),i=d.topLeft.translate(a,l),s=d.width-a*2}else{const d=t.getBBox();i=d.center,s=d.width-4,o="translate(-50%, -50%)"}const h=e.scale(),{style:f}=r;i=e.localToGraph(i),f.left=`${i.x}px`,f.top=`${i.y}px`,f.transform=`scale(${h.sx}, ${h.sy}) ${o}`,f.minWidth=`${s}px`,typeof u=="number"&&(f.width=`${u}px`),typeof c=="number"&&(f.height=`${c}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let r=W.create(),i=20;const{style:s}=t,o=this.event.target,a=o.parentElement;if(a&&Li(a,this.prefixClassName("edge-label"))){const c=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(c,10);const h=a.getAttribute("transform"),{translation:f}=Qs(h);r=new W(f.tx,f.ty),i=Fe.getBBox(o).width}else{if(!this.options.labelAddable)return this;r=e.clientToLocal(W.create(this.event.clientX,this.event.clientY));const h=this.cellView.path.closestPointLength(r);this.distance=h,this.labelIndex=-1}r=e.localToGraph(r);const u=e.scale();s.left=`${r.x}px`,s.top=`${r.y}px`,s.minWidth=`${i}px`,s.transform=`scale(${u.sx}, ${u.sy}) translate(-50%, -50%)`}onDocumentMouseUp(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return ke(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){ke(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const r=this.cell;if(this.labelIndex===-1){if(e){const i={position:{distance:this.distance},attrs:{}};Vn(i,`attrs/${t}`,e),r.appendLabel(i)}}else e!==null?r.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&r.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(ri||(ri={})),(function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})})(ri||(ri={}));var l0=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},ni;(function(n){n.presets={boundary:so,button:Yr,"button-remove":Yr.Remove,"node-editor":ri.NodeEditor},n.registry=nt.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let r=at.ToolItem;const{inherit:i}=t,s=l0(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(ni||(ni={}));var ii;(function(n){n.presets={boundary:so,vertices:Qi,segments:Zi,button:Yr,"button-remove":Yr.Remove,"source-anchor":SD,"target-anchor":AD,"source-arrowhead":OD,"target-arrowhead":CD,"edge-editor":ri.EdgeEditor},n.registry=nt.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let r=at.ToolItem;const{inherit:i}=t,s=l0(t,["inherit"]);if(i){const o=this.get(i);o==null?this.onNotFound(i,"inherited"):r=o}return s.name==null&&(s.name=e),r.define.call(r,s)}}),n.registry.register(n.presets,!0)})(ii||(ii={}));const TD=Sr("center"),MD=Sr("topCenter"),ID=Sr("bottomCenter"),RD=Sr("leftMiddle"),kD=Sr("rightMiddle"),ND=Sr("topLeft"),jD=Sr("topRight"),LD=Sr("bottomLeft"),DD=Sr("bottomRight");function Sr(n){return function(e,t,r,i={}){const s=i.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=s[n];o.x+=Gt(i.dx,s.width),o.y+=Gt(i.dy,s.height);const a=e.cell;return i.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function lo(n){return function(e,t,r,i){if(r instanceof Element){const s=this.graph.findViewByElem(r);let o;if(s)if(s.isEdgeElement(r)){const a=i.fixedAt!=null?i.fixedAt:"50%";o=u0(s,a)}else o=s.getBBoxOfElement(r).getCenter();else o=new W;return n.call(this,e,t,o,i)}return n.apply(this,arguments)}}function u0(n,e){const t=_r(e),r=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(r/100):n.getPointAtLength(r)}const BD=lo(function(n,e,t,r){const i=ze.normalize(n.cell.getAngle()),s=n.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let u=r.padding;if(Number.isFinite(u)||(u=0),a.y+u<=t.y&&t.y<=l.y-u){const c=t.y-o.y;o.x+=i===0||i===180?0:c*1/Math.tan(ze.toRad(i)),o.y+=c}else if(a.x+u<=t.x&&t.x<=l.x-u){const c=t.x-o.x;o.y+=i===90||i===270?0:c*Math.tan(ze.toRad(i)),o.x+=c}return o}),qD=function(n,e,t,r,i){const s=n.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&s.translate(r.dx||0,r.dy||0),s},FD=lo(function(n,e,t,r){let i,s=0,o;const a=n.cell;r.rotate?(i=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),s=a.getAngle()):i=n.getBBoxOfElement(e);const l=r.padding;l!=null&&Number.isFinite(l)&&i.inflate(l),r.rotate&&t.rotate(s,o);const u=i.getNearestSideToPoint(t);let c;switch(u){case"left":c=i.getLeftMiddle();break;case"right":c=i.getRightMiddle();break;case"top":c=i.getTopCenter();break;case"bottom":c=i.getBottomCenter();break}const h=r.direction;return h==="H"?(u==="top"||u==="bottom")&&(t.x<=i.x+i.width?c=i.getLeftMiddle():c=i.getRightMiddle()):h==="V"&&(t.y<=i.y+i.height?c=i.getTopCenter():c=i.getBottomCenter()),r.rotate?c.rotate(-s,o):c}),$D=Object.freeze(Object.defineProperty({__proto__:null,bottom:ID,bottomLeft:LD,bottomRight:DD,center:TD,left:RD,midSide:FD,nodeCenter:qD,orth:BD,right:kD,top:MD,topLeft:ND,topRight:jD},Symbol.toStringTag,{value:"Module"}));var si;(function(n){n.presets=$D,n.registry=nt.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(si||(si={}));const UD=function(n,e,t,r){let i=r.ratio!=null?r.ratio:.5;return i>1&&(i/=100),n.getPointAtRatio(i)},zD=function(n,e,t,r){const i=r.length!=null?r.length:20;return n.getPointAtLength(i)},c0=function(n,e,t,r){const i=n.getClosestPoint(t);return i??new W},VD=lo(c0),WD=lo(function(n,e,t,r){const s=n.getConnection(),o=n.getConnectionSubdivisions(),a=new Pe(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),l=new Pe(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),u=a.intersect(s,{segmentSubdivisions:o}),c=l.intersect(s,{segmentSubdivisions:o}),h=[];return u&&h.push(...u),c&&h.push(...c),h.length>0?t.closest(h):r.fallbackAt!=null?u0(n,r.fallbackAt):ke(c0,this,n,e,t,r)}),GD=Object.freeze(Object.defineProperty({__proto__:null,closest:VD,length:zD,orth:WD,ratio:UD},Symbol.toStringTag,{value:"Module"}));var oi;(function(n){n.presets=GD,n.registry=nt.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(oi||(oi={}));function uo(n,e,t){let r;if(typeof t=="object"){if(Number.isFinite(t.y)){const s=new Pe(e,n),{start:o,end:a}=s.parallel(t.y);e=o,n=a}r=t.x}else r=t;if(r==null||!Number.isFinite(r))return n;const i=n.distance(e);return r===0&&i>0?n:n.move(e,-Math.min(r,i-1))}function co(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function HD(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const h0=function(n,e,t,r){const i=e.getBBoxOfElement(t);r.stroked&&i.inflate(co(t)/2);const s=n.intersect(i),o=s&&s.length?n.start.closest(s):n.end;return uo(o,n.start,r.offset)},KD=function(n,e,t,r,i){const s=e.cell,o=s.isNode()?s.getAngle():0;if(o===0)return ke(h0,this,n,e,t,r,i);const a=e.getUnrotatedBBoxOfElement(t);r.stroked&&a.inflate(co(t)/2);const l=a.getCenter(),u=n.clone().rotate(o,l),c=u.setLength(1e6).intersect(a),h=c&&c.length?u.start.closest(c).rotate(-o,l):n.end;return uo(h,n.start,r.offset)},YD=function(n,e,t,r){let i,s;const o=n.end,a=r.selector;if(typeof a=="string"?i=e.findOne(a):Array.isArray(a)?i=il(t,a):i=HD(t),!$r(i)){if(i===t||!$r(t))return o;i=t}const l=e.getShapeOfElement(i),u=e.getMatrixOfElement(i),c=e.getRootTranslatedMatrix(),h=e.getRootRotatedMatrix(),f=c.multiply(h).multiply(u),d=f.inverse(),p=Fe.transformLine(n,d),g=p.start.clone(),m=e.getDataOfElement(i);if(r.insideout===!1){m.shapeBBox==null&&(m.shapeBBox=l.bbox());const _=m.shapeBBox;if(_!=null&&_.containsPoint(g))return o}r.extrapolate===!0&&p.setLength(1e6);let v;if(Te.isPath(l)){const _=r.precision||2;m.segmentSubdivisions==null&&(m.segmentSubdivisions=l.getSegmentSubdivisions({precision:_})),v={precision:_,segmentSubdivisions:m.segmentSubdivisions},s=p.intersect(l,v)}else s=p.intersect(l);s?Array.isArray(s)&&(s=g.closest(s)):r.sticky===!0&&(Se.isRectangle(l)?s=l.getNearestPointToPoint(g):Kt.isEllipse(l)?s=l.intersectsWithLineFromCenterToPoint(g):s=l.closestPoint(g,v));const y=s?Fe.transformPoint(s,f):o;let b=r.offset||0;return r.stroked!==!1&&(typeof b=="object"?(b=Object.assign({},b),b.x==null&&(b.x=0),b.x+=co(i)/2):b+=co(i)/2),uo(y,n.start,b)};function JD(n,e,t=0){const{start:r,end:i}=n;let s,o,a,l;switch(e){case"left":l="x",s=i,o=r,a=-1;break;case"right":l="x",s=r,o=i,a=1;break;case"top":l="y",s=i,o=r,a=-1;break;case"bottom":l="y",s=r,o=i,a=1;break;default:return}r[l]<i[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(t)&&(s[l]+=a*t,o[l]+=a*t)}const XD=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,r){const{alignOffset:i,align:s}=r;return s&&JD(n,s,i),uo(n.end,n.start,r.offset)},bbox:h0,boundary:YD,rect:KD},Symbol.toStringTag,{value:"Module"}));var ai;(function(n){n.presets=XD,n.registry=nt.create({type:"connection point"}),n.registry.register(n.presets,!0)})(ai||(ai={}));const QD=function(n){return[...n]},ZD=function(n,e,t){const r=e.side||"bottom",i=fn(e.padding||40),s=t.sourceBBox,o=t.targetBBox,a=s.getCenter(),l=o.getCenter();let u,c,h;switch(r){case"top":h=-1,u="y",c="height";break;case"left":h=-1,u="x",c="width";break;case"right":h=1,u="x",c="width";break;case"bottom":default:h=1,u="y",c="height";break}return a[u]+=h*(s[c]/2+i[r]),l[u]+=h*(o[c]/2+i[r]),h*(a[u]-l[u])>0?l[u]=a[u]:a[u]=l[u],[a.toJSON(),...n,l.toJSON()]};function ho(n){return new Se(n.x,n.y,0,0)}function fo(n={}){const e=fn(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function f0(n,e={}){return n.sourceBBox.clone().moveAndExpand(fo(e))}function d0(n,e={}){return n.targetBBox.clone().moveAndExpand(fo(e))}function eB(n,e={}){return n.sourceAnchor?n.sourceAnchor:f0(n,e).getCenter()}function tB(n,e={}){return n.targetAnchor?n.targetAnchor:d0(n,e).getCenter()}const p0=function(n,e,t){let r=f0(t,e),i=d0(t,e);const s=eB(t,e),o=tB(t,e);r=r.union(ho(s)),i=i.union(ho(o));const a=n.map(c=>W.create(c));a.unshift(s),a.push(o);let l=null;const u=[];for(let c=0,h=a.length-1;c<h;c+=1){let f=null;const d=a[c],p=a[c+1],g=Ft.getBearing(d,p)!=null;if(c===0)c+1===h?r.intersectsWithRect(i.clone().inflate(1))?f=Ft.insideNode(d,p,r,i):g||(f=Ft.nodeToNode(d,p,r,i)):r.containsPoint(p)?f=Ft.insideNode(d,p,r,ho(p).moveAndExpand(fo(e))):g||(f=Ft.nodeToVertex(d,p,r));else if(c+1===h){const m=g&&Ft.getBearing(p,d)===l;i.containsPoint(d)||m?f=Ft.insideNode(d,p,ho(d).moveAndExpand(fo(e)),i,l):g||(f=Ft.vertexToNode(d,p,i,l))}else g||(f=Ft.vertexToVertex(d,p,l));f?(u.push(...f.points),l=f.direction):l=Ft.getBearing(d,p),c+1<h&&u.push(p)}return u};var Ft;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(h,f,d){let p=new W(h.x,f.y);return d.containsPoint(p)&&(p=new W(f.x,h.y)),p}function i(h,f){return h[f==="W"||f==="E"?"width":"height"]}n.getBBoxSize=i;function s(h,f){return h.x===f.x?h.y>f.y?"N":"S":h.y===f.y?h.x>f.x?"W":"E":null}n.getBearing=s;function o(h,f,d){const p=new W(h.x,f.y),g=new W(f.x,h.y),m=s(h,p),v=s(h,g),y=d?e[d]:null,b=m===d||m!==y&&(v===y||v!==d)?p:g;return{points:[b],direction:s(b,f)}}n.vertexToVertex=o;function a(h,f,d){const p=r(h,f,d);return{points:[p],direction:s(p,f)}}n.nodeToVertex=a;function l(h,f,d,p){const g=[new W(h.x,f.y),new W(f.x,h.y)],m=g.filter(b=>!d.containsPoint(b)),v=m.filter(b=>s(b,h)!==p);let y;if(v.length>0)return y=v.filter(b=>s(h,b)===p).pop(),y=y||v[0],{points:[y],direction:s(y,f)};{y=Ck(g,m)[0];const b=W.create(f).move(y,-i(d,p)/2);return{points:[r(b,h,d),b],direction:s(b,f)}}}n.vertexToNode=l;function u(h,f,d,p){let g=a(f,h,p);const m=g.points[0];if(d.containsPoint(m)){g=a(h,f,d);const v=g.points[0];if(p.containsPoint(v)){const y=W.create(h).move(v,-i(d,s(h,v))/2),b=W.create(f).move(m,-i(p,s(f,m))/2),_=new Pe(y,b).getCenter(),w=a(h,_,d),x=o(_,f,w.direction);g.points=[w.points[0],x.points[0]],g.direction=x.direction}}return g}n.nodeToNode=u;function c(h,f,d,p,g){const m=d.union(p).inflate(1),v=m.getCenter(),y=v.distance(f)>v.distance(h),b=y?f:h,_=y?h:f;let w,x,E;g?(w=W.fromPolar(m.width+m.height,t[g],b),w=m.getNearestPointToPoint(w).move(w,-1)):w=m.getNearestPointToPoint(b).move(b,1),x=r(w,_,m);let A;w.round().equals(x.round())?(x=W.fromPolar(m.width+m.height,ze.toRad(w.theta(b))+Math.PI/2,_),x=m.getNearestPointToPoint(x).move(_,1).round(),E=r(w,x,m),A=y?[x,E,w]:[w,E,x]):A=y?[x,w]:[w,x];const O=s(y?w:x,f);return{points:A,direction:O}}n.insideNode=c})(Ft||(Ft={}));const rB={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Jr(this.step,this)},directions(){const n=Jr(this.step,this),e=Jr(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=Jr(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Jr(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:p0,draggingRouter:null,snapToGrid:!0};function Jr(n,e){return typeof n=="function"?n.call(e):n}function nB(n){const e=Object.keys(n).reduce((t,r)=>{const i=t;return r==="fallbackRouter"||r==="draggingRouter"||r==="fallbackRoute"?i[r]=n[r]:i[r]=Jr(n[r],n),t},{});if(e.padding){const t=fn(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const r=new W(0,0),i=new W(t.offsetX,t.offsetY);t.angle=ze.normalize(r.theta(i))}),e}const g0=1,m0=2;class iB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=g0,this.values[e]=t;const r=nN(this.items,e,i=>this.values[i]);this.items.splice(r,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=m0),e}isOpen(e){return this.hash[e]===g0}isClose(e){return this.hash[e]===m0}isEmpty(){return this.items.length===0}}class sB{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const r=this.options,i=r.excludeTerminals.reduce((u,c)=>{const h=t[c];if(h){const f=e.getCell(h.cell);f&&u.push(f)}return u},[]);let s=[];const o=e.getCell(t.getSourceCellId());o&&(s=Ob(s,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(s=Ob(s,a.getAncestors().map(u=>u.id)));const l=this.mapGridSize;return e.getNodes().reduce((u,c)=>{const h=i.some(m=>m.id===c.id),f=c.shape?r.excludeShapes.includes(c.shape):!1,d=r.excludeNodes.some(m=>typeof m=="string"?c.id===m:m===c),p=s.includes(c.id),g=f||h||d||p;if(c.isVisible()&&!g){const m=c.getBBox().moveAndExpand(r.paddingBox),v=m.getOrigin().snapToGrid(l),y=m.getCorner().snapToGrid(l);for(let b=v.x;b<=y.x;b+=l)for(let _=v.y;_<=y.y;_+=l){const w=new W(b,_).toString();u[w]==null&&(u[w]=[]),u[w].push(m)}}return u},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),r=this.map[t];return r?r.every(i=>!i.containsPoint(e)):!0}}function y0(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function b0(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function v0(n,e){return n.sourceAnchor?n.sourceAnchor:y0(n,e).getCenter()}function oB(n,e){return n.targetAnchor?n.targetAnchor:b0(n,e).getCenter()}function Il(n,e,t,r,i){const s=360/t,o=n.theta(aB(n,e,r,i)),a=ze.normalize(o+s/2);return s*Math.floor(a/s)}function aB(n,e,t,r){const i=r.step,s=e.x-n.x,o=e.y-n.y,a=s/t.x,l=o/t.y,u=a*i,c=l*i;return new W(n.x+u,n.y+c)}function w0(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function lB(n,e){const t=e.step;return e.directions.forEach(r=>{r.gridOffsetX=r.offsetX/t*n.x,r.gridOffsetY=r.offsetY/t*n.y}),e.directions}function uB(n,e,t){return{source:e.clone(),x:_0(t.x-e.x,n),y:_0(t.y-e.y,n)}}function _0(n,e){if(!n)return e;const t=Math.abs(n),r=Math.round(t/e);if(!r)return t;const i=r*e,o=(t-i)/r;return e+o}function cB(n,e){const t=e.source,r=Ve.snapToGrid(n.x-t.x,e.x)+t.x,i=Ve.snapToGrid(n.y-t.y,e.y)+t.y;return new W(r,i)}function es(n,e){return n.round(e)}function po(n,e,t){return es(cB(n.clone(),e),t)}function ts(n){return n.toString()}function Rl(n){return new W(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function x0(n,e){let t=1/0;for(let r=0,i=e.length;r<i;r+=1){const s=n.manhattanDistance(e[r]);s<t&&(t=s)}return t}function E0(n,e,t,r,i){const s=i.precision,o=i.directionMap,a=n.diff(e.getCenter()),l=Object.keys(o).reduce((u,c)=>{if(t.includes(c)){const h=o[c],f=new W(n.x+h.x*(Math.abs(a.x)+e.width),n.y+h.y*(Math.abs(a.y)+e.height)),p=new Pe(n,f).intersect(e)||[];let g,m=null;for(let v=0;v<p.length;v+=1){const y=p[v],b=n.squaredDistance(y);(g==null||b>g)&&(g=b,m=y)}if(m){let v=po(m,r,s);e.containsPoint(v)&&(v=po(v.translate(h.x*r.x,h.y*r.y),r,s)),u.push(v)}}return u},[]);return e.containsPoint(n)||l.push(po(n,r,s)),l}function hB(n,e,t,r,i){const s=[];let o=Rl(i.diff(t)),a=ts(t),l=n[a],u;for(;l;){u=e[a];const f=Rl(u.diff(l));f.equals(o)||(s.unshift(u),o=f),a=ts(l),l=n[a]}const c=e[a];return Rl(c.diff(r)).equals(o)||s.unshift(c),s}function fB(n,e,t,r,i){const s=i.precision;let o,a;Se.isRectangle(e)?o=es(v0(n,i).clone(),s):o=es(e.clone(),s),Se.isRectangle(t)?a=es(oB(n,i).clone(),s):a=es(t.clone(),s);const l=uB(i.step,o,a),u=o,c=a;let h,f;if(Se.isRectangle(e)?h=E0(u,e,i.startDirections,l,i):h=[u],Se.isRectangle(t)?f=E0(a,t,i.endDirections,l,i):f=[c],h=h.filter(d=>r.isAccessible(d)),f=f.filter(d=>r.isAccessible(d)),h.length>0&&f.length>0){const d=new iB,p={},g={},m={};for(let T=0,M=h.length;T<M;T+=1){const C=h[T],k=ts(C);d.add(k,x0(C,f)),p[k]=C,m[k]=0}const v=i.previousDirectionAngle,y=v===void 0;let b,_;const w=lB(l,i),x=w.length,E=f.reduce((T,M)=>{const C=ts(M);return T.push(C),T},[]),A=W.equalPoints(h,f);let O=i.maxLoopCount;for(;!d.isEmpty()&&O>0;){const T=d.pop(),M=p[T],C=g[T],k=m[T],N=M.equals(u),R=C==null;let $;if(R?y?N?$=null:$=Il(u,M,x,l,i):$=v:$=Il(C,M,x,l,i),!(R&&A)&&E.indexOf(T)>=0)return i.previousDirectionAngle=$,hB(g,p,M,u,c);for(let H=0;H<x;H+=1){b=w[H];const se=b.angle;if(_=w0($,se),!(y&&N)&&_>i.maxDirectionChange)continue;const V=po(M.clone().translate(b.gridOffsetX||0,b.gridOffsetY||0),l,s),te=ts(V);if(d.isClose(te)||!r.isAccessible(V))continue;if(E.indexOf(te)>=0&&!V.equals(c)){const re=Il(V,c,x,l,i);if(w0(se,re)>i.maxDirectionChange)continue}const B=b.cost,ne=N?0:i.penalties[_],U=k+B+ne;(!d.isOpen(te)||U<m[te])&&(p[te]=V,g[te]=M,m[te]=U,d.add(te,U+x0(V,f)))}O-=1}}return i.fallbackRoute?ke(i.fallbackRoute,this,u,c,i):null}function dB(n,e=10){if(n.length<=1)return n;for(let t=0,r=n.length;t<r-1;t+=1){const i=n[t],s=n[t+1];if(i.x===s.x){const o=e*Math.round(i.x/e);i.x!==o&&(i.x=o,s.x=o)}else if(i.y===s.y){const o=e*Math.round(i.y/e);i.y!==o&&(i.y=o,s.y=o)}}return n}const pB=function(n,e,t){const r=nB(e),i=y0(t,r),s=b0(t,r),o=v0(t,r),a=new sB(r).build(t.graph.model,t.cell),l=n.map(d=>W.create(d)),u=[];let c=o,h,f;for(let d=0,p=l.length;d<=p;d+=1){let g=null;if(h=f||i,f=l[d],f==null){f=s;const v=t.cell;if((v.getSourceCellId()==null||v.getTargetCellId()==null)&&typeof r.draggingRouter=="function"){const b=h===i?o:h,_=f.getOrigin();g=ke(r.draggingRouter,t,b,_,r)}}if(g==null&&(g=fB(t,h,f,a,r)),g===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),ke(r.fallbackRouter,this,n,r,t);const m=g[0];m&&m.equals(c)&&g.shift(),c=g[g.length-1]||c,u.push(...g)}return r.snapToGrid?dB(u,t.graph.grid.getGridSize()):u},S0=function(n,e,t){return ke(pB,this,n,Object.assign(Object.assign({},rB),e),t)},gB={maxDirectionChange:45,directions(){const n=Jr(this.step,this),e=Jr(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const r=n.theta(e),i=[];let s={x:e.x,y:n.y},o={x:n.x,y:e.y};if(r%180>90){const b=s;s=o,o=b}const a=r%90<45?s:o,l=new Pe(n,a),u=90*Math.ceil(r/90),c=W.fromPolar(l.squaredLength(),ze.toRad(u+135),a),h=new Pe(e,c),f=l.intersectsWithLine(h),d=f||e,p=f?d:n,g=360/t.directions.length,m=p.theta(e),v=ze.normalize(m+g/2),y=g*Math.floor(v/g);return t.previousDirectionAngle=y,d&&i.push(d.round()),i.push(e),i}},mB=function(n,e,t){return ke(S0,this,n,Object.assign(Object.assign({},gB),e),t)},yB=function(n,e,t){const r=e.offset||32,i=e.min==null?16:e.min;let s=0,o=e.direction;const a=t.sourceBBox,l=t.targetBBox,u=a.getCenter(),c=l.getCenter();if(typeof r=="number"&&(s=r),o==null){let v=l.left-a.right,y=l.top-a.bottom;v>=0&&y>=0?o=v>=y?"L":"T":v<=0&&y>=0?(v=a.left-l.right,v>=0?o=v>=y?"R":"T":o="T"):v>=0&&y<=0?(y=a.top-l.bottom,y>=0?o=v>=y?"L":"B":o="L"):(v=a.left-l.right,y=a.top-l.bottom,v>=0&&y>=0?o=v>=y?"R":"B":v<=0&&y>=0?o="B":v>=0&&y<=0?o="R":o=Math.abs(v)>Math.abs(y)?"R":"B")}o==="H"?o=c.x-u.x>=0?"L":"R":o==="V"&&(o=c.y-u.y>=0?"T":"B"),r==="center"&&(o==="L"?s=(l.left-a.right)/2:o==="R"?s=(a.left-l.right)/2:o==="T"?s=(l.top-a.bottom)/2:o==="B"&&(s=(a.top-l.bottom)/2));let h,f,d;const p=o==="L"||o==="R";if(p){if(c.y===u.y)return[...n];d=o==="L"?1:-1,h="x",f="width"}else{if(c.x===u.x)return[...n];d=o==="T"?1:-1,h="y",f="height"}const g=u.clone(),m=c.clone();if(g[h]+=d*(a[f]/2+s),m[h]-=d*(l[f]/2+s),p){const v=g.x,y=m.x,b=a.width/2+i,_=l.width/2+i;c.x>u.x?y<=v&&(g.x=Math.max(y,u.x+b),m.x=Math.min(v,c.x-_)):y>=v&&(g.x=Math.min(y,u.x-b),m.x=Math.max(v,c.x+_))}else{const v=g.y,y=m.y,b=a.height/2+i,_=l.height/2+i;c.y>u.y?y<=v&&(g.y=Math.max(y,u.y+b),m.y=Math.min(v,c.y-_)):y>=v&&(g.y=Math.min(y,u.y-b),m.y=Math.max(v,c.y+_))}return[g.toJSON(),...n,m.toJSON()]};function li(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const r=W.create(n[1]).move(n[2],t),i=W.create(n[1]).move(n[0],t);return[r.toJSON(),...n,i.toJSON()]}{const r=n[1];return[Object.assign({},r),...n,Object.assign({},r)]}}return n}const bB=Object.freeze(Object.defineProperty({__proto__:null,er:yB,loop:function(n,e,t){const r=e.width||50,s=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,l=t.targetAnchor,u=t.sourceBBox,c=t.targetBBox;if(a.equals(l)){const h=v=>{const y=ze.toRad(v),b=Math.sin(y),_=Math.cos(y),w=new W(a.x+_*r,a.y+b*r),x=new W(w.x-_*s,w.y-b*s),E=x.clone().rotate(-90,w),A=x.clone().rotate(90,w);return[E.toJSON(),w.toJSON(),A.toJSON()]},f=v=>{const y=a.clone().move(v,-1),b=new Pe(y,v);return!u.containsPoint(v)&&!u.intersectsWithLine(b)},d=[0,90,180,270,45,135,225,315];if(typeof o=="number")return li(h(o),e.merge);const p=u.getCenter();if(p.equals(a))return li(h(0),e.merge);const g=p.angleBetween(a,p.clone().translate(1,0));let m=h(g);if(f(m[1]))return li(m,e.merge);for(let v=1,y=d.length;v<y;v+=1)if(m=h(g+d[v]),f(m[1]))return li(m,e.merge);return li(m,e.merge)}{const h=new Pe(a,l);let f=h.parallel(-r),d=f.getCenter(),p=f.start.clone().move(f.end,s),g=f.end.clone().move(f.start,s);const m=h.parallel(-1),v=new Pe(m.start,d),y=new Pe(m.end,d);if((u.containsPoint(d)||c.containsPoint(d)||u.intersectsWithLine(v)||u.intersectsWithLine(y)||c.intersectsWithLine(v)||c.intersectsWithLine(y))&&(f=h.parallel(r),d=f.getCenter(),p=f.start.clone().move(f.end,s),g=f.end.clone().move(f.start,s)),e.merge){const b=new Pe(a,l),_=new Pe(d,b.center).setLength(Number.MAX_SAFE_INTEGER),w=u.intersectsWithLine(_),x=c.intersectsWithLine(_),E=w?Array.isArray(w)?w:[w]:[];x&&(Array.isArray(x)?E.push(...x):E.push(x));const A=b.center.closest(E);A?(t.sourceAnchor=A.clone(),t.targetAnchor=A.clone()):(t.sourceAnchor=b.center.clone(),t.targetAnchor=b.center.clone())}return li([p.toJSON(),d.toJSON(),g.toJSON()],e.merge)}},manhattan:S0,metro:mB,normal:QD,oneSide:ZD,orth:p0},Symbol.toStringTag,{value:"Module"}));var Xr;(function(n){n.presets=bB,n.registry=nt.create({type:"router"}),n.registry.register(n.presets,!0)})(Xr||(Xr={}));const vB=function(n,e,t,r={}){const i=[n,...t,e],s=new rt(i),o=new Te(s);return r.raw?o:o.serialize()},wB=function(n,e,t,r={}){const i=t.length===3?0:1,s=W.create(t[0+i]),o=W.create(t[2+i]),a=W.create(t[1+i]);if(!W.equals(n,e)){const u=new W((n.x+e.x)/2,(n.y+e.y)/2),c=u.angleBetween(W.create(n).rotate(90,u),a);c>1&&(s.rotate(180-c,u),o.rotate(180-c,u),a.rotate(180-c,u))}const l=`
|
|
97
|
-
M ${n.x} ${n.y}
|
|
98
|
-
Q ${s.x} ${s.y} ${a.x} ${a.y}
|
|
99
|
-
Q ${o.x} ${o.y} ${e.x} ${e.y}
|
|
100
|
-
`;return r.raw?Te.parse(l):l},_B=function(n,e,t,r={}){const i=new Te;i.appendSegment(Te.createSegment("M",n));const s=1/3,o=2/3,a=r.radius||10;let l,u;for(let c=0,h=t.length;c<h;c+=1){const f=W.create(t[c]),d=t[c-1]||n,p=t[c+1]||e;l=u||f.distance(d)/2,u=f.distance(p)/2;const g=-Math.min(a,l),m=-Math.min(a,u),v=f.clone().move(d,g).round(),y=f.clone().move(p,m).round(),b=new W(s*v.x+o*f.x,o*f.y+s*v.y),_=new W(s*y.x+o*f.x,o*f.y+s*y.y);i.appendSegment(Te.createSegment("L",v)),i.appendSegment(Te.createSegment("C",b,_,y))}return i.appendSegment(Te.createSegment("L",e)),r.raw?i:i.serialize()},xB=function(n,e,t,r={}){let i,s=r.direction;if(t&&t.length!==0){const o=[n,...t,e],a=et.throughPoints(o);i=new Te(a)}else if(i=new Te,i.appendSegment(Te.createSegment("M",n)),s||(s=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),s==="H"){const o=(n.x+e.x)/2;i.appendSegment(Te.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;i.appendSegment(Te.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return r.raw?i:i.serialize()},A0=1,go=1/3,mo=2/3;function EB(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let r=0;r<t.length;r+=1)t[r].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function kl(n,e,t=[]){const r=[n,...t,e],i=[];return r.forEach((s,o)=>{const a=r[o+1];a!=null&&i.push(new Pe(s,a))}),i}function SB(n,e){const t=[];return e.forEach(r=>{const i=n.intersectsWithLine(r);i&&t.push(i)}),t}function P0(n,e){return new Pe(n,e).squaredLength()}function AB(n,e,t){return e.reduce((r,i,s)=>{if(yo.includes(i))return r;const o=r.pop()||n,a=W.create(i).move(o.start,-t);let l=W.create(i).move(o.start,+t);const u=e[s+1];if(u!=null){const f=l.distance(u);f<=t&&(l=u.move(o.start,f),yo.push(u))}else if(a.distance(o.end)<t*2+A0)return r.push(o),r;if(l.distance(o.start)<t*2+A0)return r.push(o),r;const h=new Pe(a,l);return rs.push(h),r.push(new Pe(o.start,a),h,new Pe(l,o.end)),r},[])}function O0(n,e,t,r){const i=new Te;let s;return s=Te.createSegment("M",n[0].start),i.appendSegment(s),n.forEach((o,a)=>{if(rs.includes(o)){let l,u,c,h;if(t==="arc"){l=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(l+=180);const d=o.getCenter(),p=new Pe(d,o.end).rotate(l,d);let g;g=new Pe(o.start,d),c=g.pointAt(2/3).rotate(l,o.start),h=p.pointAt(1/3).rotate(-l,p.end),s=Te.createSegment("C",c,h,p.end),i.appendSegment(s),g=new Pe(d,o.end),c=p.pointAt(1/3).rotate(l,p.end),h=g.pointAt(1/3).rotate(-l,o.end),s=Te.createSegment("C",c,h,o.end),i.appendSegment(s)}else if(t==="gap")s=Te.createSegment("M",o.end),i.appendSegment(s);else if(t==="cubic"){l=o.start.theta(o.end);const f=e*.6;let d=e*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(d*=-1),c=new W(o.start.x+f,o.start.y+d).rotate(l,o.start),h=new W(o.end.x-f,o.end.y+d).rotate(l,o.end),s=Te.createSegment("C",c,h,o.end),i.appendSegment(s)}}else{const l=n[a+1];r===0||!l||rs.includes(l)?(s=Te.createSegment("L",o.end),i.appendSegment(s)):PB(r,i,o.end,o.start,l.end)}}),i}function PB(n,e,t,r,i){const s=t.distance(r)/2,o=t.distance(i)/2,a=-Math.min(n,s),l=-Math.min(n,o),u=t.clone().move(r,a).round(),c=t.clone().move(i,l).round(),h=new W(go*u.x+mo*t.x,mo*t.y+go*u.y),f=new W(go*c.x+mo*t.x,mo*t.y+go*c.y);let d;d=Te.createSegment("L",u),e.appendSegment(d),d=Te.createSegment("C",h,f,c),e.appendSegment(d)}let rs,yo;const OB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,r={}){rs=[],yo=[],EB(this);const i=r.size||5,s=r.type||"arc",o=r.radius||0,a=r.ignoreConnectors||["smooth"],l=this.graph,c=l.model.getEdges();if(c.length===1)return O0(kl(n,e,t),i,s,o);const h=this.cell,f=c.indexOf(h),d=l.options.connecting.connector||{},p=c.filter((_,w)=>{const x=_.getConnector()||d;return a.includes(x.name)?!1:w>f?x.name!=="jumpover":!0}),g=p.map(_=>l.findViewByCell(_)),m=kl(n,e,t),v=g.map(_=>_==null?[]:_===this?m:kl(_.sourcePoint,_.targetPoint,_.routePoints)),y=[];m.forEach(_=>{const w=p.reduce((x,E,A)=>{if(E!==h){const O=SB(_,v[A]);x.push(...O)}return x},[]).sort((x,E)=>P0(_.start,x)-P0(_.start,E));w.length>0?y.push(...AB(_,w,i)):y.push(_)});const b=O0(y,i,s,o);return rs=[],yo=[],r.raw?b:b.serialize()},loop:wB,normal:vB,rounded:_B,smooth:xB},Symbol.toStringTag,{value:"Module"}));var vn;(function(n){n.presets=OB,n.registry=nt.create({type:"connector"}),n.registry.register(n.presets,!0)})(vn||(vn={}));var CB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class C0 extends Rt{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Ze(e)),this.changed={}}mutate(e,t={}){const r=t.unset===!0,i=t.silent===!0,s=[],o=this.changing;this.changing=!0,o||(this.previous=Ze(this.data),this.changed={});const a=this.data,l=this.previous,u=this.changed;if(Object.keys(e).forEach(c=>{const h=c,f=e[h];wr(a[h],f)||s.push(h),wr(l[h],f)?delete u[h]:u[h]=f,r?delete a[h]:a[h]=f}),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=t,s.forEach(c=>{this.emit("change:*",{key:c,options:t,store:this,current:a[c],previous:l[c]})})),o)return this;if(!i)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const r=this.data[e];return r??t}getPrevious(e){if(this.previous){const t=this.previous[e];return t??void 0}}set(e,t,r){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},r)),this}remove(e,t){const i={};let s;if(typeof e=="string")i[e]=void 0,s=t;else if(Array.isArray(e))e.forEach(o=>i[o]=void 0),s=t;else{for(const o in this.data)i[o]=void 0;s=e}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(e){return il(this.data,e,"/")}setByPath(e,t,r={}){const s=Array.isArray(e)?[...e]:e.split("/"),o=Array.isArray(e)?e.join("/"):e,a=s[0],l=s.length;if(r.propertyPath=o,r.propertyValue=t,r.propertyPathArray=s,l===1)this.set(a,t,r);else{const u={};let c=u,h=a;for(let p=1;p<l;p+=1){const g=s[p],m=Number.isFinite(Number(g));c=c[h]=m?[]:{},h=g}Vn(u,s,t,"/");const f=Ze(this.data);r.rewrite&&kb(f,e,"/");const d=ot(f,u);this.set(a,d[a],r)}return this}removeByPath(e,t){const r=Array.isArray(e)?e:e.split("/"),i=r[0];if(r.length===1)this.remove(i,t);else{const s=r.slice(1),o=Ze(this.get(i));o&&kb(o,s),this.set(i,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?Ze(this.changed):null;const t=this.changing?this.previous:this.data,r={};let i;for(const s in e){const o=e[s];wr(t[s],o)||(r[s]=o,i=!0)}return i?Ze(r):null}toJSON(){return Ze(this.data)}clone(){const e=this.constructor;return new e(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}CB([Rt.dispose()],C0.prototype,"dispose",null);class ns{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,r={},i="/"){const s=this.cell.getPropByPath(e),o=xk(r,ns.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,s,t);let u=0;const c=Array.isArray(e)?e.join(i):e,h=Array.isArray(e)?e:e.split(i),f=()=>{const d=new Date().getTime();u===0&&(u=d);let g=(d-u)/o.duration;g<1?this.ids[c]=requestAnimationFrame(f):g=1;const m=l(a(g));this.cell.setPropByPath(h,m),r.progress&&r.progress(Object.assign({progress:g,currentValue:m},this.getArgs(c))),g===1&&(this.cell.notify("transition:complete",this.getArgs(c)),r.complete&&r.complete(this.getArgs(c)),this.cell.notify("transition:finish",this.getArgs(c)),r.finish&&r.finish(this.getArgs(c)),this.clean(c))};return setTimeout(()=>{this.stop(e,void 0,i),this.cache[c]={startValue:s,targetValue:t,options:o},this.ids[c]=requestAnimationFrame(f),this.cell.notify("transition:start",this.getArgs(c)),r.start&&r.start(this.getArgs(c))},r.delay),this.stop.bind(this,e,i,r)}stop(e,t={},r="/"){const i=Array.isArray(e)?e:e.split(r);return Object.keys(this.ids).filter(s=>wr(i,s.split(r).slice(0,i.length))).forEach(s=>{cancelAnimationFrame(this.ids[s]);const o=this.cache[s],a=this.getArgs(s),l=Object.assign(Object.assign({},o.options),t),u=l.jumpedToEnd;u&&o.targetValue!=null&&(this.cell.setPropByPath(s,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const c=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},c)),l.stop&&l.stop(Object.assign({},c)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(s)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?mn[e]:e}getInterp(e,t,r){return e?e(t,r):typeof r=="number"?yn.number(t,r):typeof r=="string"?r[0]==="#"?yn.color(t,r):yn.unit(t,r):yn.object(t,r)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(ns||(ns={}));var TB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},T0=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class De extends Rt{static config(e){const{markup:t,propHooks:r,attrHooks:i}=e,s=T0(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),r&&(this.propHooks=this.propHooks.slice(),Array.isArray(r)?this.propHooks.push(...r):typeof r=="function"?this.propHooks.push(r):Object.values(r).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=ot({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:Ze(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((r,i)=>i?ke(i,e,r):r,t)}get[Symbol.toStringTag](){return De.toStringTag}constructor(e={}){super();const r=this.constructor.getDefaults(!0),i=ot({},this.preprocess(r),this.preprocess(e));this.id=i.id||Gs(),this.store=new C0(i),this.animation=new ns(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const r=e.id,s=this.constructor.applyPropHooks(this,e);return r==null&&t!==!0&&(s.id=Gs()),s}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:r,previous:i,options:s}=e;this.notify("change:*",{key:t,options:s,current:r,previous:i,cell:this}),this.notify(`change:${t}`,{options:s,current:r,previous:i,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:r,previous:i,options:s,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const r=this.model;return r&&(r.notify(`cell:${e}`,t),this.isNode()?r.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&r.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,r){if(typeof e=="string")this.store.set(e,t,r);else{const i=this.preprocess(e,!0);this.store.set(ot({},this.getProp(),i),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,r={}){return this.model&&(e==="children"?this._children=t?t.map(i=>this.model.getCell(i)).filter(i=>i!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,r),this}removePropByPath(e,t={}){const r=Array.isArray(e)?e:e.split("/");return r[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(r,t),this}prop(e,t,r){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,r||{}):this.setPropByPath(e,t,r||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let r=t.getMaxZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this],r=r-i.length+1;const s=t.total();let o=t.indexOf(this)!==s-i.length;o||(o=i.some((a,l)=>a.getZIndex()!==r+l)),o&&this.batchUpdate("to-front",()=>{r+=i.length,i.forEach((a,l)=>{a.setZIndex(r+l,e)})})}return this}toBack(e={}){const t=this.model;if(t){let r=t.getMinZIndex(),i;e.deep?(i=this.getDescendants({deep:!0,breadthFirst:!0}),i.unshift(this)):i=[this];let s=t.indexOf(this)!==0;s||(s=i.some((o,a)=>o.getZIndex()!==r+a)),s&&this.batchUpdate("to-back",()=>{r-=i.length,i.forEach((o,a)=>{o.setZIndex(r+a,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const r=i=>this.store.set("attrs",i,t);if(t.overwrite===!0)r(e);else{const i=this.getAttrs();t.deep===!1?r(Object.assign(Object.assign({},i),e)):r(ot({},i,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const r=this.constructor.getAttrHooks()||{};let i=r[e]||sr.registry.get(e);if(!i){const s=qs(e);i=r[s]||sr.registry.get(s)}return i||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,r={}){return this.setPropByPath(this.prefixAttrPath(e),t,r),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,r){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,r||{}):this.setAttrByPath(e,t,r||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const r=typeof e=="boolean"?e:!this.isVisible(),i=typeof e=="boolean"?t:e;return r?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const r=i=>this.store.set("data",i,t);if(t.overwrite===!0)r(e);else{const i=this.getData();t.deep===!1?r(typeof e=="object"?Object.assign(Object.assign({},i),e):e):r(ot({},i,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(r=>{var i;return(i=this.model)===null||i===void 0?void 0:i.getCell(r)}).filter(r=>r!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let r=this.getParent();for(;r;)t.push(r),r=e.deep!==!1?r.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],r=this.getChildren()||[];for(;r.length>0;){const i=r.shift(),s=i.getChildren();t.push(i),s&&r.push(...s)}return t}{const t=this.getChildren()||[];return t.forEach(r=>{t.push(...r.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let r=this.getParent();for(;r;){if(r===e)return!0;r=r.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return De.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(r=>r.id),t):this.store.remove("children",t),this}unembed(e,t={}){const r=this.children;if(r!=null&&e!=null){const i=this.getChildIndex(e);i!==-1&&(r.splice(i,1),e.setParent(null,t),this.setChildren(r,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return De.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,r={}){return e.insertChild(this,t,r),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,r={}){if(e!=null&&e!==this){const i=e.getParent(),s=this!==i;let o=t;if(o==null&&(o=this.getChildCount(),s||(o-=1)),i){const l=i.getChildren();if(l){const u=l.indexOf(e);u>=0&&(e.setParent(null,r),l.splice(u,1),i.setChildren(l,r))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,r),this.setChildren(a,r),s&&this.model){const l=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);l&&l.forEach(c=>c.updateParent(r)),u&&u.forEach(c=>c.updateParent(r))}this.model&&this.model.addCell(e,r)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const r=t.getChildIndex(this);t.removeChildAt(r,e)}return this}removeChild(e,t={}){const r=this.getChildIndex(e);return this.removeChildAt(r,t)}removeChildAt(e,t={}){const r=this.getChildAt(e);return this.children!=null&&r!=null&&(this.unembed(r,t),r.remove(t)),r}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(r=>r.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,r={},i="/"){return this.animation.start(e,t,r,i)}stopTransition(e,t,r="/"){return this.animation.stop(e,t,r),this}getTransitions(){return this.animation.get()}translate(e,t,r){return this}scale(e,t,r,i){return this}addTools(e,t,r){const i=Array.isArray(e)?e:[e],s=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof r=="object"?r:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let a=Ze(this.getTools());if(a==null||s==null||a.name===s)return a==null&&(a={}),a.items||(a.items=[]),a.name=s,a.items=[...a.items,...i],this.setTools(Object.assign({},a),o)}setTools(e,t={}){return e==null?this.removeTools():this.store.set("tools",De.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(r=>typeof r=="string"?r===e:r.name===e)}removeTool(e,t={}){const r=Ze(this.getTools());if(r){let i=!1;const s=r.items.slice(),o=a=>{s.splice(a,1),i=!0};if(typeof e=="number")o(e);else for(let a=s.length-1;a>=0;a-=1){const l=s[a];(typeof l=="string"?l===e:l.name===e)&&o(a)}i&&(r.items=s,this.setTools(r,t))}return this}getBBox(e){return new Se}getConnectionPoint(e,t){return new W}toJSON(e={}){const t=Object.assign({},this.store.get()),r=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const p=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${p.name||r.call(p)}"`)}const s=this.constructor,o=e.diff===!0,a=t.attrs||{},l=s.getDefaults(!0),u=o?this.preprocess(l,!0):l,c=u.attrs||{},h={};Object.entries(t).forEach(([p,g])=>{if(g!=null&&!Array.isArray(g)&&typeof g=="object"&&!nr(g))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${r.call(g)}" type of key "${p}" on ${i} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&o){const m=u[p];wr(g,m)&&delete t[p]}}),Object.keys(a).forEach(p=>{const g=a[p],m=c[p];Object.keys(g).forEach(v=>{const y=g[v],b=m?m[v]:null;y!=null&&typeof y=="object"&&!Array.isArray(y)?Object.keys(y).forEach(_=>{const w=y[_];if(m==null||b==null||!st(b)||!wr(b[_],w)){h[p]==null&&(h[p]={}),h[p][v]==null&&(h[p][v]={});const x=h[p][v];x[_]=w}}):(m==null||!wr(b,y))&&(h[p]==null&&(h[p]={}),h[p][v]=y)})});const f=Object.assign(Object.assign({},t),{attrs:Eb(h)?void 0:h});f.attrs==null&&delete f.attrs;const d=f;return d.angle===0&&delete d.angle,Ze(d)}clone(e={}){if(!e.deep){const r=Object.assign({},this.store.get());e.keepId||delete r.id,delete r.parent,delete r.children;const i=this.constructor;return new i(r)}return De.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},r=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),r&&r.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},r=this.model){return r&&r.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,r){const i=this.model;this.startBatch(e,r,i);const s=t();return this.stopBatch(e,r,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}De.defaults={},De.attrHooks={},De.propHooks=[],TB([Rt.dispose()],De.prototype,"dispose",null),(function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e})(De||(De={})),(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"}n.isCell=e})(De||(De={})),(function(n){function e(...s){const o=s.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,u)=>l.length-u.length);return o.shift().find(l=>o.every(u=>u.includes(l)))||null}n.getCommonAncestor=e;function t(s,o={}){let a=null;for(let l=0,u=s.length;l<u;l+=1){const c=s[l];let h=c.getBBox(o);if(h){if(c.isNode()){const f=c.getAngle();f!=null&&f!==0&&(h=h.bbox(f))}a=a==null?h:a.union(h)}}return a}n.getCellsBBox=t;function r(s){const o=[s,...s.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=r;function i(s){const o=Cb(s),a=o.reduce((l,u)=>(l[u.id]=u.clone(),l),{});return o.forEach(l=>{const u=a[l.id];if(u.isEdge()){const f=u.getSourceCellId(),d=u.getTargetCellId();f&&a[f]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[f].id})),d&&a[d]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[d].id}))}const c=l.getParent();c&&a[c.id]&&u.setParent(a[c.id]);const h=l.getChildren();if(h&&h.length){const f=h.reduce((d,p)=>(a[p.id]&&d.push(a[p.id]),d),[]);f.length>0&&u.setChildren(f)}}),a}n.cloneCells=i})(De||(De={})),(function(n){n.config({propHooks(e){var{tools:t}=e,r=T0(e,["tools"]);return t&&(r.tools=n.normalizeTools(t)),r}})})(De||(De={}));var ui;(function(n){let e,t;function r(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=r;function i(o){e=o}n.setEdgeRegistry=i;function s(o){t=o}n.setNodeRegistry=s})(ui||(ui={}));class MB{constructor(e){this.ports=[],this.groups={},this.init(Ze(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const r=this.getPortsByGroup(e),i=e?this.getGroup(e):null,s=i?i.position:null,o=s?s.name:null;let a;if(o!=null){const h=bn.registry.get(o);if(h==null)return bn.registry.onNotFound(o);a=h}else a=bn.presets.left;const l=r.map(h=>h&&h.position&&h.position.args||{}),u=s&&s.args||{};return a(l,t,u).map((h,f)=>{const d=r[f];return{portLayout:h,portId:d.id,portSize:d.size,portAttrs:d.attrs,labelSize:d.label.size,labelLayout:this.getPortLabelLayout(d,W.create(h.position),t)}})}init(e){const{groups:t,items:r}=e;t!=null&&Object.keys(t).forEach(i=>{this.groups[i]=this.parseGroup(t[i])}),Array.isArray(r)&&r.forEach(i=>{this.ports.push(this.parsePort(i))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),r=this.getGroup(e.group)||{};return t.markup=t.markup||r.markup,t.attrs=ot({},r.attrs,t.attrs),t.position=this.createPosition(r,t),t.label=ot({},r.label,this.getLabel(t)),t.zIndex=this.getZIndex(r,t),t.size=Object.assign(Object.assign({},r.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return ot({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const r=e.label||{};return r.position=this.getPortLabelPosition(r.position,t),r}getPortLabelLayout(e,t,r){const i=e.label.position.name||"left",s=e.label.position.args||{},o=ti.registry.get(i)||ti.presets.left;return o?o(t,r,s):null}}var bo=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let ut=class RO extends De{get[Symbol.toStringTag](){return RO.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:r,y:i,width:s,height:o}=e,a=bo(e,["x","y","width","height"]);if(r!=null||i!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:r??(l?l.x:0),y:i??(l?l.y:0)})}if(s!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:s??(l?l.width:0),height:o??(l?l.height:0)})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,r){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,r):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,r){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,r),this}resize(e,t,r={}){this.startBatch("resize",r);const i=r.direction;if(i){const s=this.getSize();switch(i){case"left":case"right":t=s.height;break;case"top":case"bottom":e=s.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const l=ze.normalize(this.getAngle()||0);r.absolute&&(a+=Math.floor((l+45)/90),a%=4);const u=this.getBBox();let c;a===0?c=u.getBottomLeft():a===1?c=u.getCorner():a===2?c=u.getTopRight():c=u.getOrigin();const h=c.clone().rotate(-l,u.getCenter()),f=Math.sqrt(e*e+t*t)/2;let d=a*Math.PI/2;d+=Math.atan(a%2===0?t/e:e/t),d-=ze.toRad(l);const g=W.fromPolar(f,d,h).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},r),this.setPosition(g.x,g.y,r)}else this.store.set("size",{width:e,height:t},r);return this.stopBatch("resize",r),this}scale(e,t,r,i={}){const s=this.getBBox().scale(e,t,r??void 0);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.height,i),this.stopBatch("scale"),this}position(e,t,r){return typeof e=="number"?this.setPosition(e,t,r):this.getPosition(e)}getPosition(e={}){if(e.relative){const r=this.getParent();if(r!=null&&r.isNode()){const i=this.getPosition(),s=r.getPosition();return{x:i.x-s.x,y:i.y-s.y}}}const t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,r={}){let i,s,o;if(typeof e=="object"?(i=e.x,s=e.y,o=t||{}):(i=e,s=t,o=r||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();i+=l.x,s+=l.y}}if(o.deep){const a=this.getPosition();this.translate(i-a.x,s-a.y,o)}else this.store.set("position",{x:i,y:s},o);return this}translate(e=0,t=0,r={}){if(e===0&&t===0)return this;r.translateBy=r.translateBy||this.id;const i=this.getPosition();if(r.restrict!=null&&r.translateBy===this.id){const o=this.getBBox({deep:!0}),a=r.restrict,l=i.x-o.x,u=i.y-o.y,c=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,i.x+e)),h=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,i.y+t));e=c-i.x,t=h-i.y}const s={x:i.x+e,y:i.y+t};return r.tx=e,r.ty=t,r.transition?(typeof r.transition!="object"&&(r.transition={}),this.transition("position",s,Object.assign(Object.assign({},r.transition),{interp:yn.object})),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)})):(this.startBatch("translate",r),this.store.set("position",s,r),this.eachChild(o=>{var a;((a=r.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,r)}),this.stopBatch("translate",r)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const r=this.getAngle();if(t.center){const i=this.getSize(),s=this.getPosition(),o=this.getBBox().getCenter();o.rotate(r-e,t.center);const a=o.x-i.width/2-s.x,l=o.y-i.height/2-s.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(s.x+a,s.y+l,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(r+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),De.getCellsBBox(t)}return Se.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const r=this.getBBox(),i=r.getCenter(),s=e.getTerminal(t);if(s==null)return i;const o=s.port;if(!o||!this.hasPort(o))return i;const a=this.getPort(o);if(!a||!a.group)return i;const u=this.getPortsPosition(a.group)[o].position,c=W.create(u).translate(r.getOrigin()),h=this.getAngle();return h&&c.rotate(-h,i),c}fit(e={}){const r=(this.getChildren()||[]).filter(u=>u.isNode());if(r.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&r.forEach(u=>u.fit(e));let{x:i,y:s,width:o,height:a}=De.getCellsBBox(r);const l=fn(e.padding);return i-=l.left,s-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:s},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Ye.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",Ye.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Ye.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",Ye.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Ye.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",Ye.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return Ze(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return Ze(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(r=>r.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new Se(0,0,t.width,t.height)).reduce((i,s)=>{const o=s.portLayout;return i[s.portId]={position:Object.assign({},o.position),angle:o.angle||0},i},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,r,i){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),l=r;return this.setPropByPath(a,l,i)}const s=this.prefixPortPath(e),o=t;return this.setPropByPath(s,o,r)}removePortProp(e,t,r){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),r):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,r,i){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):r==null?this.removePortProp(e,t,i):this.setPortProp(e,t,r,i):this.setPortProp(e,t,r)}prefixPortPath(e,t){const r=this.getPortIndex(e);if(r===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${r}`]:Array.isArray(t)?["ports","items",`${r}`,...t]:`ports/items/${r}/${t}`}addPort(e,t){const r=[...this.ports.items];return r.push(e),this.setPropByPath("ports/items",r,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,r){const i=[...this.ports.items];return i.splice(e,0,t),this.setPropByPath("ports/items",i,r),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const r=[...this.ports.items];r.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",r,t)}return this}removePorts(e,t){let r;if(Array.isArray(e)){if(r=t||{},e.length){r.rewrite=!0;const s=[...this.ports.items].filter(o=>!e.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",s,r)}}else r=e||{},r.rewrite=!0,this.setPropByPath("ports/items",[],r);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const r={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(r[o.id]=!0)});const s=this.model;s&&!Eb(r)&&(s.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const u=l.getTargetPortId();u&&r[u]&&l.remove()}),s.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const u=l.getSourcePortId();u&&r[u]&&l.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(r=>{typeof r!="object"&&t.push(`Invalid port ${r}.`),r.id==null&&(r.id=this.generatePortId()),e[r.id]&&t.push("Duplicitied port id."),e[r.id]=!0}),t}generatePortId(){return Gs()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new MB(this.ports);const r=this.port.getPorts(),i=t?r.filter(o=>t.find(a=>a.id===o.id)?null:o):[...r],s=t?t.filter(o=>r.find(a=>a.id===o.id)?null:o):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}};ut.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.size=="function"&&typeof i.position=="function"}n.isNode=e})(ut||(ut={})),(function(n){n.config({propHooks(e){var{ports:t}=e,r=bo(e,["ports"]);return t&&(r.ports=Array.isArray(t)?{items:t}:t),r}})})(ut||(ut={})),(function(n){n.registry=nt.create({type:"node",process(e,t){if(ui.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i}=t,s=bo(t,["inherit"]);if(i)if(typeof i=="string"){const a=this.get(i);a==null?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),ui.setNodeRegistry(n.registry)})(ut||(ut={})),(function(n){let e=0;function t(s){return s?sl(s):(e+=1,`CustomNode${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=bo(s,["constructorName","overwrite"]),u=nl(t(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=r;function i(s){const o=s.shape||"rect",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i})(ut||(ut={}));var vo=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let tt=class kO extends De{get[Symbol.toStringTag](){return kO.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:r,sourceCell:i,sourcePort:s,sourcePoint:o,target:a,targetCell:l,targetPort:u,targetPoint:c}=e,f=vo(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),d=p=>typeof p=="string"||typeof p=="number";if(r!=null)if(De.isCell(r))f.source={cell:r.id};else if(d(r))f.source={cell:r};else if(W.isPoint(r))f.source=r.toJSON();else if(Array.isArray(r))f.source={x:r[0],y:r[1]};else{const p=r.cell;De.isCell(p)?f.source=Object.assign(Object.assign({},r),{cell:p.id}):f.source=r}if(i!=null||s!=null){let p=f.source;if(i!=null){const g=d(i)?i:i.id;p?p.cell=g:p=f.source={cell:g}}s!=null&&p&&(p.port=s)}else o!=null&&(f.source=W.create(o).toJSON());if(a!=null)if(De.isCell(a))f.target={cell:a.id};else if(d(a))f.target={cell:a};else if(W.isPoint(a))f.target=a.toJSON();else if(Array.isArray(a))f.target={x:a[0],y:a[1]};else{const p=a.cell;De.isCell(p)?f.target=Object.assign(Object.assign({},a),{cell:p.id}):f.target=a}if(l!=null||u!=null){let p=f.target;if(l!=null){const g=d(l)?l:l.id;p?p.cell=g:p=f.target={cell:g}}u!=null&&p&&(p.port=u)}else c!=null&&(f.target=W.create(c).toJSON());return super.preprocess(f,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,r={}){return this.setTerminal("source",e,t,r)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,r={}){return this.setTerminal("target",e,t,r)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,r,i={}){if(De.isCell(t))return this.store.set(e,ot({},r,{cell:t.id}),i),this;const s=t;return W.isPoint(t)||s.x!=null&&s.y!=null?(this.store.set(e,ot({},r,{x:s.x,y:s.y}),i),this):(this.store.set(e,Ze(t),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(W.isPointLike(t))return W.create(t);const r=this.getTerminalCell(e);return r?r.getConnectionPoint(this,e):new W}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const r={};for(;t&&t.isEdge();){if(r[t.id])return null;r[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,r){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},r),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,r){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},r),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return Ze(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,r={}){const i=this.getLabels(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,this.parseLabel(e)),this.setLabels(i,r)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getLabels();i[e]=this.parseLabel(t),this.setLabels(i,r)}return this}removeLabelAt(e,t={}){const r=this.getLabels(),i=e!=null&&Number.isFinite(e)?e:-1,s=r.splice(i,1);return this.setLabels(r,t),s.length?s[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>s===o||wr(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>s===o||wr(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("labels:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const r=Array.isArray(e)?e:[e];return this.store.set("vertices",r.map(i=>W.toJSON(i)),t),this}insertVertex(e,t,r={}){const i=this.getVertices(),s=i.length;let o=t!=null&&Number.isFinite(t)?t:s;return o<0&&(o=s+o+1),i.splice(o,0,W.toJSON(e)),this.setVertices(i,r)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,r={}){if(e!=null&&Number.isFinite(e)){const i=this.getVertices();i[e]=t,this.setVertices(i,r)}return this}removeVertexAt(e,t={}){const r=this.getVertices(),i=e!=null&&Number.isFinite(e)?e:-1;return r.splice(i,1),this.setVertices(r,t)}onVertexsChanged({previous:e,current:t}){const r=e&&t?t.filter(s=>e.find(o=>W.equals(s,o))?null:s):t?[...t]:[],i=e&&t?e.filter(s=>t.find(o=>W.equals(s,o))?null:s):e?[...e]:[];r.length>0&&this.notify("vertexs:added",{added:r,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Ye.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,r={}){return r.translateBy=r.translateBy||this.id,r.tx=e,r.ty=t,this.applyToPoints(i=>({x:(i.x||0)+e,y:(i.y||0)+t}),r)}scale(e,t,r,i={}){return this.applyToPoints(s=>W.create(s).scale(e,t,r).toJSON(),i)}applyToPoints(e,t={}){const r={},i=this.getSource(),s=this.getTarget();W.isPointLike(i)&&(r.source=e(i)),W.isPointLike(s)&&(r.target=e(s));const o=this.getVertices();return o.length>0&&(r.vertices=o.map(e)),this.store.set(r,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>W.create(t)),this.getTargetPoint()];return new rt(e)}updateParent(e){let t=null;const r=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return r&&i&&(r===i||r.isDescendantOf(i)?t=i:i.isDescendantOf(r)?t=r:t=De.getCommonAncestor(r,i)),s&&t&&t.id!==s.id&&s.unembed(this,e),t&&(!s||s.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),r=this.getTarget(),i=t.cell,s=r.cell;if(!i||!s)return!1;let o=i===s;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,e)||l.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};tt.defaults={},(function(n){function e(t,r){const i=t,s=r;return i.cell===s.cell?i.port===s.port||i.port==null&&s.port==null:!1}n.equalTerminals=e})(tt||(tt={})),(function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e})(tt||(tt={})),(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNode=="function"&&typeof i.isEdge=="function"&&typeof i.prop=="function"&&typeof i.attr=="function"&&typeof i.disconnect=="function"&&typeof i.getSource=="function"&&typeof i.getTarget=="function"}n.isEdge=e})(tt||(tt={})),(function(n){n.registry=nt.create({type:"edge",process(e,t){if(ui.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let r=n;const{inherit:i="edge"}=t,s=vo(t,["inherit"]);if(typeof i=="string"){const a=this.get(i||"edge");a==null&&i?this.onNotFound(i,"inherited"):r=a}else r=i;s.constructorName==null&&(s.constructorName=e);const o=r.define.call(r,s);return o.config({shape:e}),o}}),ui.setEdgeRegistry(n.registry)})(tt||(tt={})),(function(n){let e=0;function t(s){return s?sl(s):(e+=1,`CustomEdge${e}`)}function r(s){const{constructorName:o,overwrite:a}=s,l=vo(s,["constructorName","overwrite"]),u=nl(t(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=r;function i(s){const o=s.shape||"edge",a=n.registry.get(o);return a?new a(s):n.registry.onNotFound(o)}n.create=i})(tt||(tt={})),(function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:r,vertices:i}=t,s=vo(t,["label","vertices"]);if(r){s.labels==null&&(s.labels=[]);const o=typeof r=="string"?n.parseStringLabel(r):r;s.labels.push(o)}return i&&Array.isArray(i)&&(s.vertices=i.map(o=>W.create(o).toJSON())),s}}),n.registry.register(e,n)})(tt||(tt={}));var IB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Nl extends Rt{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,r){let i,s;typeof t=="number"?(i=t,s=Object.assign({merge:!1},r)):(i=this.length,s=Object.assign({merge:!1},t)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&s.sort!==!1,l=this.comparator||null;let u=!1;const c=[],h=[];return o.forEach(f=>{const d=this.get(f);d?s.merge&&!f.isSameStore(d)&&(d.setProp(f.getProp(),r),h.push(d),a&&!u&&(l==null||typeof l=="function"?u=d.hasChanged():typeof l=="string"?u=d.hasChanged(l):u=l.some(p=>d.hasChanged(p)))):(c.push(f),this.reference(f))}),c.length&&(a&&(u=!0),this.cells.splice(i,0,...c),this.length=this.cells.length),u&&this.sort({silent:!0}),s.silent||(c.forEach((f,d)=>{const p={cell:f,index:i+d,options:s};this.trigger("added",p),s.dryrun||f.notify("added",Object.assign({},p))}),u&&this.trigger("sorted"),(c.length||h.length)&&this.trigger("updated",{added:c,merged:h,removed:[],options:s})),this}remove(e,t={}){const r=Array.isArray(e)?e:[e],i=this.removeCells(r,t);return!t.silent&&i.length>0&&this.trigger("updated",{options:t,removed:i,added:[],merged:[]}),Array.isArray(e)?i:i[0]}removeCells(e,t){const r=[];for(let i=0;i<e.length;i+=1){const s=this.get(e[i]);if(s==null)continue;const o=this.cells.indexOf(s);this.cells.splice(o,1),this.length-=1,delete this.map[s.id],r.push(s),this.unreference(s),t.dryrun||s.remove(),t.silent||(this.trigger("removed",{cell:s,index:o,options:t}),t.dryrun||s.notify("removed",{cell:s,index:o,options:t}))}return r}reset(e,t={}){const r=this.cells.slice();if(r.forEach(i=>this.unreference(i)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const i=this.cells.slice();this.trigger("reseted",{options:t,previous:r,current:i});const s=[],o=[];i.forEach(a=>{r.some(u=>u.id===a.id)||s.push(a)}),r.forEach(a=>{i.some(u=>u.id===a.id)||o.push(a)}),this.trigger("updated",{options:t,added:s,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Kk(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const r=t.cell;this.trigger(`cell:${e}`,t),r&&(r.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:r})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}IB([Nl.dispose()],Nl.prototype,"dispose",null);var RB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Jt extends Rt{get[Symbol.toStringTag](){return Jt.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Nl(e),this.setup()}notify(e,t){this.trigger(e,t);const r=this.graph;return r&&(e==="sorted"||e==="reseted"||e==="updated"?r.trigger(`model:${e}`,t):r.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const r=t.cell;this.onCellRemoved(r,t.options),this.notify("cell:removed",t),r.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:r})):r.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:r}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const r=e.id;if(e.isEdge()){delete this.edges[r];const i=e.getSource(),s=e.getTarget();if(i&&i.cell){const o=this.outgoings[i.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[i.cell])}if(s&&s.cell){const o=this.incomings[s.cell],a=o?o.indexOf(r):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[s.cell])}}else delete this.nodes[r];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const r=t==="source"?this.outgoings:this.incomings,i=e.previous(t);if(i&&i.cell){const o=De.isCell(i.cell)?i.cell.id:i.cell,a=r[o],l=a?a.indexOf(e.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete r[o])}const s=e.getTerminal(t);if(s&&s.cell){const o=De.isCell(s.cell)?s.cell.id:s.cell,a=r[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),r[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(r=>this.prepareCell(r,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(r=>this.prepareCell(r,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const r=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const i=t.sort((s,o)=>{const a=s.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;i.length>0;){const s=i.shift();s&&s.remove(r)}},r),this}addNode(e,t={}){const r=ut.isNode(e)?e:this.createNode(e);return this.addCell(r,t),r}updateNode(e,t={}){const r=this.createNode(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}createNode(e){return ut.create(e)}addEdge(e,t={}){const r=tt.isEdge(e)?e:this.createEdge(e);return this.addCell(r,t),r}createEdge(e){return tt.create(e)}updateEdge(e,t={}){const r=this.createEdge(e),i=r.getProp();return r.dispose(),this.updateCell(i,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(r=>this.addCell(r,t)),this.addings.delete(e)),this)}addCells(e,t={}){const r=e.length;if(r===0)return this;const i=Object.assign(Object.assign({},t),{position:r-1,maxPosition:r-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:e})),e.forEach(s=>{this.addCell(s,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:e})),this}updateCell(e,t={}){const r=e.id&&this.getCell(e.id);return r?this.batchUpdate("update",()=>(Object.entries(e).forEach(([i,s])=>r.setProp(i,s,t)),!0),e):!1}removeCell(e,t={}){const r=typeof e=="string"?this.getCell(e):e;return r&&this.has(r)?this.collection.remove(r,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const r=e.clone({keepId:!0});return this.addCell(r),this.getConnectedEdges(e).forEach(s=>{const o=s.getSourceCell(),a=s.getTargetCell();o===e&&s.setSource(Object.assign(Object.assign({},s.getSource()),{cell:t})),a===e&&s.setTarget(Object.assign(Object.assign({},s.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),r}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(r=>this.removeCell(r,t))):[]}removeConnectedEdges(e,t={}){const r=this.getConnectedEdges(e);return r.forEach(i=>{i.remove(t)}),r}disconnectConnectedEdges(e,t={}){const r=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(i=>{const s=i.getSourceCellId(),o=i.getTargetCellId();s===r&&i.setSource({x:0,y:0},t),o===r&&i.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,r=this.outgoings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,r=this.incomings[t];return r?r.map(i=>this.getCell(i)).filter(i=>i&&i.isEdge()):null}getConnectedEdges(e,t={}){const r=[],i=typeof e=="string"?this.getCell(e):e;if(i==null)return r;const s={},o=t.indirect;let a=t.incoming,l=t.outgoing;a==null&&l==null&&(a=l=!0);const u=(c,h)=>{const f=h?this.getOutgoingEdges(c):this.getIncomingEdges(c);if(f?.forEach(d=>{s[d.id]||(r.push(d),s[d.id]=!0,o&&(a&&u(d,!1),l&&u(d,!0)))}),o&&c.isEdge()){const d=h?c.getTargetCell():c.getSourceCell();d&&d.isEdge()&&(s[d.id]||(r.push(d),u(d,h)))}};if(l&&u(i,!0),a&&u(i,!1),t.deep){const c=i.getDescendants({deep:!0}),h={};c.forEach(d=>{d.isNode()&&(h[d.id]=!0)});const f=(d,p)=>{const g=p?this.getOutgoingEdges(d.id):this.getIncomingEdges(d.id);g?.forEach(m=>{if(!s[m.id]){const v=m.getSourceCell(),y=m.getTargetCell();if(!t.enclosed&&v&&h[v.id]&&y&&h[y.id])return;r.push(m),s[m.id]=!0}})};c.forEach(d=>{d.isEdge()||(l&&f(d,!0),a&&f(d,!1))})}return r}isBoundary(e,t){const r=typeof e=="string"?this.getCell(e):e,i=t?this.getIncomingEdges(r):this.getOutgoingEdges(r);return i==null||i.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(r=>{if(this.isBoundary(r,e)){const i=this.getCell(r);i&&t.push(i)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let r=t.incoming,i=t.outgoing;r==null&&i==null&&(r=i=!0);const o=this.getConnectedEdges(e,t).reduce((a,l)=>{const u=l.hasLoop(t),c=l.getSourceCell(),h=l.getTargetCell();return r&&c&&c.isNode()&&!a[c.id]&&(u||c!==e&&(!t.deep||!c.isDescendantOf(e)))&&(a[c.id]=c),i&&h&&h.isNode()&&!a[h.id]&&(u||h!==e&&(!t.deep||!h.isDescendantOf(e)))&&(a[h.id]=h),a},{});if(e.isEdge()){if(r){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(i){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,r={}){let i=r.incoming,s=r.outgoing;return i==null&&s==null&&(i=s=!0),this.getConnectedEdges(e,r).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(i&&a&&a.id===t.id||s&&l&&l.id===t.id)})}getSuccessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{outgoing:!0})),r}isSuccessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{outgoing:!0})),i}getPredecessors(e,t={}){const r=[];return this.search(e,(i,s)=>{i!==e&&this.matchDistance(s,t.distance)&&r.push(i)},Object.assign(Object.assign({},t),{incoming:!0})),r}isPredecessor(e,t,r={}){let i=!1;return this.search(e,(s,o)=>{if(s===t&&s!==e&&this.matchDistance(o,r.distance))return i=!0,!1},Object.assign(Object.assign({},r),{incoming:!0})),i}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(r=>{r&&(Array.isArray(r)?t.push(...r):t.push(r))}),De.getCommonAncestor(...t)}getSubGraph(e,t={}){const r=[],i={},s=[],o=[],a=l=>{i[l.id]||(r.push(l),i[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&s.push(l))};return e.forEach(l=>{a(l),t.deep&&l.getDescendants({deep:!0}).forEach(c=>a(c))}),o.forEach(l=>{const u=l.getSourceCell(),c=l.getTargetCell();u&&!i[u.id]&&(r.push(u),i[u.id]=u,u.isNode()&&s.push(u)),c&&!i[c.id]&&(r.push(c),i[c.id]=c,c.isNode()&&s.push(c))}),s.forEach(l=>{this.getConnectedEdges(l,t).forEach(c=>{const h=c.getSourceCell(),f=c.getTargetCell();!i[c.id]&&h&&i[h.id]&&f&&i[f.id]&&(r.push(c),i[c.id]=c)})}),r}cloneSubGraph(e,t={}){const r=this.getSubGraph(e,t);return this.cloneCells(r)}cloneCells(e){return De.cloneCells(e)}getNodesFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(i=>i.getBBox().containsPoint(r))}getNodesInArea(e,t,r,i,s){const o=typeof e=="number"?new Se(e,t,r,i):Se.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getNodes().filter(u=>{const c=u.getBBox();return l?o.containsRect(c):o.isIntersectWithRect(c)})}getEdgesInArea(e,t,r,i,s){const o=typeof e=="number"?new Se(e,t,r,i):Se.create(e),a=typeof e=="number"?s:t,l=a&&a.strict;return this.getEdges().filter(u=>{const c=u.getBBox();return c.width===0?c.inflate(1,0):c.height===0&&c.inflate(0,1),l?o.containsRect(c):o.isIntersectWithRect(c)})}getNodesUnderNode(e,t={}){const r=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(r):this.getNodesFromPoint(r[t.by])).filter(s=>e.id!==s.id&&!s.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return De.getCellsBBox(e,t)}search(e,t,r={}){r.breadthFirst?this.breadthFirstSearch(e,t,r):this.depthFirstSearch(e,t,r)}breadthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.shift();if(a==null||s[a.id]||(s[a.id]=!0,ke(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,r).forEach(u=>{o[u.id]=o[a.id]+1,i.push(u)})}}depthFirstSearch(e,t,r={}){const i=[],s={},o={};for(i.push(e),o[e.id]=0;i.length>0;){const a=i.pop();if(a==null||s[a.id]||(s[a.id]=!0,ke(t,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,r),u=i.length;l.forEach(c=>{o[c.id]=o[a.id]+1,i.splice(u,0,c)})}}getShortestPath(e,t,r={}){const i={};this.getEdges().forEach(u=>{const c=u.getSourceCellId(),h=u.getTargetCellId();c&&h&&(i[c]||(i[c]=[]),i[h]||(i[h]=[]),i[c].push(h),r.directed||i[h].push(c))});const s=typeof e=="string"?e:e.id,o=_l.run(i,s,r.weight),a=[];let l=typeof t=="string"?t:t.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(e,t,r){return this.getCells().filter(i=>!i.hasParent()).forEach(i=>i.translate(e,t,r)),this}resize(e,t,r){return this.resizeCells(e,t,this.getCells(),r)}resizeCells(e,t,r,i={}){const s=this.getCellsBBox(r);if(s){const o=Math.max(e/s.width,0),a=Math.max(t/s.height,0),l=s.getOrigin();r.forEach(u=>u.scale(o,a,l,i))}return this}toJSON(e={}){return Jt.toJSON(this.getCells(),e)}parseJSON(e){return Jt.fromJSON(e)}fromJSON(e,t={}){const r=this.parseJSON(e);return this.resetCells(r,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,r={}){this.startBatch(e,r);const i=t();return this.stopBatch(e,r),i}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(r=>this.batches[r]>0)}dispose(){this.collection.dispose()}}RB([Jt.dispose()],Jt.prototype,"dispose",null),(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.addNode=="function"&&typeof i.addEdge=="function"&&i.collection!=null}n.isModel=e})(Jt||(Jt={})),(function(n){function e(r,i={}){return{cells:r.map(s=>s.toJSON(i))}}n.toJSON=e;function t(r){const i=[];return Array.isArray(r)?i.push(...r):(r.cells&&i.push(...r.cells),r.nodes&&r.nodes.forEach(s=>{s.shape==null&&(s.shape="rect"),i.push(s)}),r.edges&&r.edges.forEach(s=>{s.shape==null&&(s.shape="edge"),i.push(s)})),i.map(s=>{const o=s.shape;if(o){if(ut.registry.exist(o))return ut.create(s);if(tt.registry.exist(o))return tt.create(s)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t})(Jt||(Jt={}));var kB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};let Qr=class extends ut{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(e){const{label:t}=e,r=kB(e,["label"]);return t&&Vn(r,"attrs/text/text",t),r},visible:!0})})(Qr||(Qr={}));var NB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};function jB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function LB(n="xlink:href"){return t=>{const{imageUrl:r,imageWidth:i,imageHeight:s}=t,o=NB(t,["imageUrl","imageWidth","imageHeight"]);if(r!=null||i!=null||s!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;r!=null&&(l[n]=r),i!=null&&(l.width=i),s!=null&&(l.height=s),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ci(n,e,t={}){const r={constructorName:n,markup:jB(n,t.selector),attrs:{[n]:Object.assign({},Qr.bodyAttr)}};return(t.parent||Qr).define(ot(r,e,{shape:n}))}ci("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const DB=tt.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});ci("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var BB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class hi extends Qr{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",hi.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(r=>Array.isArray(r)?r.join(","):W.isPointLike(r)?`${r.x}, ${r.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:r}=t,i=BB(t,["points"]);if(r){const s=e(r);s&&Vn(i,"attrs/body/refPoints",s)}return i}})})(hi||(hi={})),ci("polygon",{},{parent:hi}),ci("polyline",{},{parent:hi});var qB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};Qr.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:e}=n,t=qB(n,["path"]);return e&&Vn(t,"attrs/body/refD",e),t}});var FB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};Qr.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},Fr.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ft.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},Qr.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=FB(n,["text"]);return e&&Vn(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,refBBox:r,elem:i,attrs:s}){if(i instanceof HTMLElement)i.textContent=n;else{const o=s.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),u=sr.presets.textWrap;return ke(u.set,this,a,{cell:e,view:t,elem:i,refBBox:r,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),ci("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:LB()},{selector:"image"}),ci("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class Xt extends it{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return Xt.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const r=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?Dt(t,r):qe(t,r)}else{const r=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(r):this.addClass(r)}}isNodeView(){return!0}confirmUpdate(e,t={}){let r=e;return this.hasAction(r,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","resize","translate","rotate","ports","tools"])):(r=this.handleAction(r,"resize",()=>this.resize(),"update"),r=this.handleAction(r,"update",()=>this.update(),"ports"),r=this.handleAction(r,"translate",()=>this.translate()),r=this.handleAction(r,"rotate",()=>this.rotate()),r=this.handleAction(r,"ports",()=>this.renderPorts()),r=this.handleAction(r,"tools",()=>{this.getFlag("tools")===e?this.renderTools():this.updateTools(t)})),r}update(e){this.cleanCache(),this.removePorts();const t=this.cell,r=t.getSize(),i=t.getAttrs();this.updateAttrs(this.container,i,{attrs:e===i?null:e,rootBBox:new Se(0,0,r.width,r.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const r=e?this.portsCache[e]:null;if(!r)return null;const i=r.portContentElement,s=r.portContentSelectors||{};return this.findOne(t,i,s)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{Hn(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const r=this.cell.getParsedPorts(),i=xb(r,"zIndex"),s="auto";i[s]&&i[s].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(i).forEach(o=>{if(o!==s){const a=parseInt(o,10);this.appendPorts(i[o],a,t)}}),this.updatePorts()}appendPorts(e,t,r){const i=e.map(s=>this.getPortElement(s));r[t]||t<0?dl(r[Math.max(t,0)],i):Bi(this.container,i)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=Ye.renderMarkup(this.cell.getPortContainerMarkup());const r=t.elem;if(r==null)throw new Error("Invalid port container markup.");t=Ye.renderMarkup(this.getPortMarkup(e));const i=t.elem,s=t.selectors;if(i==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},i);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),qe(r,o),qe(r,"x6-port"),qe(i,"x6-port-body"),r.appendChild(i);let a=s,l,u;if(this.existPortLabel(e)){if(t=Ye.renderMarkup(this.getPortLabelMarkup(e.label)),l=t.elem,u=t.selectors,l==null)throw new Error("Invalid port label markup.");if(s&&u){for(const h in u)if(s[h]&&h!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),u)}qe(l,"x6-port-label"),r.appendChild(l)}return this.portsCache[e.id]={portElement:r,portSelectors:a,portLabelElement:l,portLabelSelectors:u,portContentElement:i,portContentSelectors:s},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:r,selectors:a,labelContainer:l,labelSelectors:u,contentContainer:i,contentSelectors:s}),r}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(r=>this.updatePortGroup(r))}updatePortGroup(e){const t=Se.fromSize(this.cell.getSize()),r=this.cell.getPortsLayoutByGroup(e,t);for(let i=0,s=r.length;i<s;i+=1){const o=r[i],a=o.portId,l=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(l.portElement,u),o.portAttrs!=null){const h={selectors:l.portSelectors||{}};o.portSize&&(h.rootBBox=Se.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,h)}const c=o.labelLayout;if(c&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,c,-(u.angle||0)),c.attrs)){const h={selectors:l.portLabelSelectors||{}};o.labelSize&&(h.rootBBox=Se.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,c.attrs,h)}}}applyPortTransform(e,t,r=0){const i=t.angle,s=t.position,o=dt().rotate(r).translate(s.x||0,s.y||0).rotate(i||0);Yn(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,node:s,cell:o}:{e,x:t,y:r,view:i,node:s,cell:o}}getPortEventArgs(e,t,r){const i=this,s=i.cell,o=s;return r?{e,x:r.x,y:r.y,view:i,node:s,cell:o,port:t}:{e,view:i,node:s,cell:o,port:t}}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("node:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("node:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("node:mouseup",this.getEventArgs(e,t,r))}notifyPortEvent(e,t,r){const i=this.findAttr("port",t.target);if(i){const s=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,i,r)),t.type=s}}onClick(e,t,r){super.onClick(e,t,r),this.notify("node:click",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:click",e,{x:t,y:r})}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("node:dblclick",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:r})}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("node:contextmenu",this.getEventArgs(e,t,r)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:r})}onMouseDown(e,t,r){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,r),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:r}),this.startNodeDragging(e,t,r))}onMouseMove(e,t,r){const i=this.getEventData(e),s=i.action;if(s==="magnet")this.dragMagnet(e,t,r);else{if(s==="move"){const a=i.targetView||this;a.dragNode(e,t,r),a.notify("node:moving",{e,x:t,y:r,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,r),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:r})}this.setEventData(e,i)}onMouseUp(e,t,r){const i=this.getEventData(e),s=i.action;s==="magnet"?this.stopMagnetDragging(e,t,r):(this.notifyMouseUp(e,t,r),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:r}),s==="move"&&(i.targetView||this).stopNodeDragging(e,t,r));const o=i.targetMagnet;o&&this.onMagnetClick(e,o,t,r),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onMagnetClick(e,t,r,i){const s=this.graph;s.view.getMouseMovedCount(e)>s.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetDblClick(e,t,r,i){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetContextMenu(e,t,r,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,r,i)))}onMagnetMouseDown(e,t,r,i){this.startMagnetDragging(e,r,i)}onCustomEvent(e,t,r,i){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}prepareEmbedding(e){const t=this.graph,i=this.getEventData(e).cell||this.cell,s=t.findViewByCell(i),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:i,view:s,cell:i,x:o.x,y:o.y,currentParent:i.getParent()})}processEmbedding(e,t){const r=t.cell||this.cell,i=t.graph||this.graph,s=i.options.embedding,o=s.findParent;let a=typeof o=="function"?ke(o,i,{view:this,node:this.cell}).filter(f=>De.isCell(f)&&this.cell.id!==f.id&&!f.isDescendantOf(this.cell)):i.model.getNodesUnderNode(r,{by:o});if(s.frontOnly&&a.length>0){const f=xb(a,"zIndex"),d=zk(Object.keys(f).map(p=>parseInt(p,10)));d&&(a=f[d])}a=a.filter(f=>f.visible);let l=null;const u=t.candidateEmbedView,c=s.validate;for(let f=a.length-1;f>=0;f-=1){const d=a[f];if(u&&u.cell.id===d.id){l=u;break}else{const p=d.findView(i);if(c&&ke(c,i,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(t),l&&l.highlight(null,{type:"embedding"}),t.candidateEmbedView=l;const h=i.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:r,node:r,view:i.findViewByCell(r),x:h.x,y:h.y,currentParent:r.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const r=t.cell||this.cell,i=t.graph||this.graph,s=i.findViewByCell(r),o=r.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(r,void 0,{ui:!0})):o&&o.unembed(r,{ui:!0}),i.model.getConnectedEdges(r,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),s&&a){const l=i.snapToGrid(e.clientX,e.clientY);s.notify("node:embedded",{e,cell:r,x:l.x,y:l.y,node:r,view:i.findViewByCell(r),previousParent:o,currentParent:r.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,r){if(t.getAttribute("magnet")!=="passive"){const i=this.graph.options.connecting.validateMagnet;return i?ke(i,this.graph,{e:r,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,r){if(!this.can("magnetConnectable"))return;e.stopPropagation();const i=e.currentTarget,s=this.graph;this.setEventData(e,{targetMagnet:i}),this.validateMagnet(this,i,e)?(s.options.magnetThreshold<=0&&this.startConnectting(e,i,t,r),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,r),s.view.delegateDragEvents(e,this)}startConnectting(e,t,r,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(t,r,i);s.setEventData(e,s.prepareArrowheadDragging("target",{x:r,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:s}),s.notifyMouseDown(e,r,i)}getDefaultEdge(e,t){let r;const i=this.graph.options.connecting.createEdge;return i&&(r=ke(i,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),r}createEdgeFromMagnet(e,t,r){const i=this.graph,s=i.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,r,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:r})),o.addTo(s,{async:!1,ui:!0}),o.findView(i)}dragMagnet(e,t,r){const i=this.getEventData(e),s=i.edgeView;if(s)s.onMouseMove(e,t,r),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(e),u=i.targetMagnet;if(a==="onleave"){if(u===l||u.contains(l))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,u,t,r)}}stopMagnetDragging(e,t,r){const s=this.eventData(e).edgeView;s&&(s.onMouseUp(e,t,r),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,r){this.notify("node:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,r,i,s){let o=[s];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(s)&&(o=l.filter(u=>u.isNode()))}o.forEach(l=>{this.notify(e,{e:t,x:r,y:i,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,r=typeof t=="function"?ke(t,this.graph,e):t;return typeof r=="number"?this.graph.transform.getGraphArea().inflate(r):r===!0?this.graph.transform.getGraphArea():r||null}startNodeDragging(e,t,r){const i=this.getDelegatedView();if(i==null||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,r);this.setEventData(e,{targetView:i,action:"move"});const s=W.create(i.cell.getPosition());i.setEventData(e,{moving:!1,offset:s.diff(t,r),restrict:this.getRestrictArea(i)})}dragNode(e,t,r){const i=this.cell,s=this.graph,o=s.getGridSize(),a=this.getEventData(e),l=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,r,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const c=Ve.snapToGrid(t+l.x,o),h=Ve.snapToGrid(r+l.y,o);i.setPosition(c,h,{restrict:u,deep:!0,ui:!0}),s.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,r){const i=this.getEventData(e);i.embedding&&this.finalizeEmbedding(e,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,r,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(e,t){const r=this.graph.getPlugin("scroller");r&&r.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.findPortElem=="function"&&typeof i.resize=="function"&&typeof i.rotate=="function"&&typeof i.translate=="function"}n.isNodeView=e})(Xt||(Xt={})),Xt.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),Xt.registry.register("node",Xt,!0);var $B=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Ar extends it{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return Ar.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const r=this.cell.getSource();return new Se(r.x,r.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new Se(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const r=this.cell.getTarget();return new Se(r.x,r.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new Se(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let r=e;if(this.hasAction(r,"source")){if(!this.updateTerminalProperties("source"))return r;r=this.removeAction(r,"source")}if(this.hasAction(r,"target")){if(!this.updateTerminalProperties("target"))return r;r=this.removeAction(r,"target")}return this.hasAction(r,"render")?(this.render(),r=this.removeAction(r,["render","update","labels","tools"]),r):(r=this.handleAction(r,"update",()=>this.update(t)),r=this.handleAction(r,"labels",()=>this.onLabelsChange(t)),r=this.handleAction(r,"tools",()=>this.renderTools()),r)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let r=0,i=t.length;r<i;r+=1){const s=t[r],o=this.labelCache[r],a=this.labelSelectors[r],l=this.graph.options.onEdgeLabelRendered;if(l){const u=l({edge:e,label:s,container:o,selectors:a});u&&(this.labelDestroyFn[r]=u)}}}}destroyCustomizeLabels(){const e=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let t=0,r=e.length;t<r;t+=1){const i=this.labelDestroyFn[t],s=this.labelCache[t],o=this.labelSelectors[t];i&&s&&o&&i({edge:this.cell,label:e[t],container:s,selectors:o})}this.labelDestroyFn={}}renderLabels(){const e=this.cell,t=e.getLabels(),r=t.length;let i=this.labelContainer;if(this.labelCache={},this.labelSelectors={},r<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=Ht("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.labelContainer=i);for(let s=0,o=t.length;s<o;s+=1){const a=t[s],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,c;if(l)u=l.node,c=l.selectors;else{const f=e.getDefaultLabel(),d=this.normalizeLabelMarkup(this.parseLabelMarkup(f.markup));u=d.node,c=d.selectors}u.setAttribute("data-index",`${s}`),i.appendChild(u);const h=this.rootSelector;if(c[h])throw new Error("Ambiguous label root selector.");c[h]=u,this.labelCache[s]=u,this.labelSelectors[s]=c}return i.parentNode==null&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const r=e.propertyPathArray||[],i=r.length;if(i>1){const s=r[1];if(t[s]){if(i===2)return typeof e.propertyValue=="object"&&Ws(e.propertyValue,"markup");if(r[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=Ie.createVectors(e),r=document.createDocumentFragment();for(let i=0,s=t.length;i<s;i+=1){const o=t[i].node;r.appendChild(o)}return{fragment:r,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let r;const i=t.childNodes;return i.length>1||i[0].nodeName.toUpperCase()!=="G"?r=Ie.create("g").append(t):r=Ie.create(i[0]),r.addClass(this.prefixClassName("edge-label")),{node:r.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,r=this.can("edgeLabelMovable"),i=e.getDefaultLabel();for(let s=0,o=t.length;s<o;s+=1){const a=this.labelCache[s],l=this.labelSelectors[s];a.setAttribute("cursor",r?"move":"default");const u=t[s],c=ot({},i.attrs,u.attrs);this.updateAttrs(a,c,{selectors:l,rootBBox:u.size?Se.fromSize(u.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs(),{text:r}=t,i=$B(t,["text"]);return i!=null&&this.updateAttrs(this.container,i,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,r=t.getVertices(),i=[this.sourceAnchor,...r,this.targetAnchor],s=i.length,o=new rt(i);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),l=a.length;return s===l?0:(t.setVertices(a.slice(1,l-1),e),s-l)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return W.create(this.sourceAnchor);case"target":return W.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return W.create(this.sourcePoint);case"target":return W.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const r=this.sourceView;return r?this.sourceMagnet||r.container:null}case"target":{if(t.raw)return this.targetMagnet;const r=this.targetView;return r?this.targetMagnet||r.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const r=e.tx||0,i=e.ty||0;this.routePoints=new rt(this.routePoints).translate(r,i).points,this.translateConnectionPoints(r,i),this.path.translate(r,i)}else{const r=t.getVertices(),i=this.findAnchors(r);this.sourceAnchor=i.source,this.targetAnchor=i.target,this.routePoints=this.findRoutePoints(r);const s=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=s.source,this.targetPoint=s.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(e){const t=this.cell,r=t.source,i=t.target,s=e[0],o=e[e.length-1];return i.priority&&!r.priority?this.findAnchorsOrdered("target",o,"source",s):this.findAnchorsOrdered("source",s,"target",o)}findAnchorsOrdered(e,t,r,i){let s,o;const a=this.cell,l=a[e],u=a[r],c=this.getTerminalView(e),h=this.getTerminalView(r),f=this.getTerminalMagnet(e),d=this.getTerminalMagnet(r);if(c){let p;t?p=W.create(t):h?p=d:p=W.create(u),s=this.getAnchor(l.anchor,c,f,p,e)}else s=W.create(l);if(h){const p=W.create(i||s);o=this.getAnchor(u.anchor,h,d,p,r)}else o=W.isPointLike(u)?W.create(u):new W;return{[e]:s,[r]:o}}getAnchor(e,t,r,i,s){const o=t.isEdgeElement(r),a=this.graph.options.connecting;let l=typeof e=="string"?{name:e}:e;if(!l){const h=o?(s==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(s==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof h=="string"?{name:h}:h}if(!l)throw new Error("Anchor should be specified.");let u;const c=l.name;if(o){const h=oi.registry.get(c);if(typeof h!="function")return oi.registry.onNotFound(c);u=ke(h,this,t,r,i,l.args||{},s)}else{const h=si.registry.get(c);if(typeof h!="function")return si.registry.onNotFound(c);u=ke(h,this,t,r,i,l.args||{},s)}return u?u.round(this.POINT_ROUNDING):new W}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Xr.presets.normal,r=this.cell.getRouter()||t;let i;if(typeof r=="function")i=ke(r,this,e,{},this);else{const s=typeof r=="string"?r:r.name,o=typeof r=="string"?{}:r.args||{},a=s?Xr.registry.get(s):Xr.presets.normal;if(typeof a!="function")return Xr.registry.onNotFound(s);i=ke(a,this,e,o,this)}return i==null?e.map(s=>W.create(s)):i.map(s=>W.create(s))}findConnectionPoints(e,t,r){const i=this.cell,s=this.graph.options.connecting,o=i.getSource(),a=i.getTarget(),l=this.sourceView,u=this.targetView,c=e[0],h=e[e.length-1];let f;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,g=c||r,m=new Pe(g,t),v=o.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;f=this.getConnectionPoint(v,l,p,m,"source")}else f=t;let d;if(u&&!u.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||u.container,g=a.connectionPoint||s.targetConnectionPoint||s.connectionPoint,m=h||t,v=new Pe(m,r);d=this.getConnectionPoint(g,u,p,v,"target")}else d=r;return{source:f,target:d}}getConnectionPoint(e,t,r,i,s){const o=i.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,l=typeof e=="string"?{}:e.args,u=ai.registry.get(a);if(typeof u!="function")return ai.registry.onNotFound(a);const c=ke(u,this,i,t,r,l||{},s);return c?c.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,r){const i=h=>{const f=this.cell.getAttrs(),d=Object.keys(f);for(let p=0,g=d.length;p<g;p+=1){const m=f[d[p]];if(m[`${h}Marker`]||m[`${h}-marker`]){const v=m.strokeWidth||m["stroke-width"];if(v)return parseFloat(v);break}}return null},s=e[0],o=e[e.length-1];let a,l;const u=i("source");u&&(a=t.clone().move(s||r,-u));const c=i("target");return c&&(l=r.clone().move(o||t,-c)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=l||r.clone(),{source:a,target:l}}findPath(e,t,r){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let s,o,a;if(typeof i=="string"?s=i:(s=i.name,o=i.args),s){const u=vn.registry.get(s);if(typeof u!="function")return vn.registry.onNotFound(s);a=u}else a=vn.presets.normal;const l=ke(a,this,t,r,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?Te.parse(l):l}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,r=t.getLabels();if(r.length===0)return this;const i=t.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,a=r.length;o<a;o+=1){const l=r[o],u=this.labelCache[o];if(!u)continue;const c=this.normalizeLabelPosition(l.position),h=ot({},s,c),f=this.getLabelTransformationMatrix(h);u.setAttribute("transform",Kn(f))}return this}updateTerminalProperties(e){const t=this.cell,r=this.graph,i=t[e],s=i&&i.cell,o=`${e}View`;if(!s)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=r.getCellById(s);if(!a)throw new Error(`Edge's ${e} node with id "${s}" not exists`);const l=a.findView(r);return l?(this[o]=l,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,r=this.getTerminalView(e);if(r){let i=r.getMagnetFromEdgeTerminal(this.cell[e]);i===r.container&&(i=null),this[t]=i}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:ot({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return Ws(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return Ws(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return Ws(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(_r(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,r,i){const s={distance:0};let o=0,a;typeof r=="number"?(o=r,a=i):a=r,a!=null&&(s.options=a);const l=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),c=a&&a.absoluteDistance&&a.reverseDistance,h=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},d=new W(e,t),p=h.closestPointT(d,f),g=this.getConnectionLength()||0;let m=h.lengthAtT(p,f);u&&(m=g>0?m/g:0),c&&(m=-1*(g-m)||1),s.distance=m;let v;l||(v=h.tangentAtT(p));let y;if(v)y=v.pointOffset(d);else{const b=h.pointAtT(p),_=d.diff(b);y={x:_.x,y:_.y}}return s.offset=y,s.angle=o,s}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),r=t.options||{},i=t.angle||0,s=t.distance,o=s>0&&s<=1;let a=0;const l={x:0,y:0},u=t.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(l.x=u.x),u.y!=null&&(l.y=u.y)));const c=l.x!==0||l.y!==0||a===0,h=r.keepGradient,f=r.ensureLegibility,d=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},g=o?s*this.getConnectionLength():s,m=d.tangentAtLength(g,p);let v,y=i;if(m){if(c)v=m.start,v.translate(l);else{const b=m.clone();b.rotate(-90,m.start),b.setLength(a),v=b.end}h&&(y=m.angle()+i,f&&(y=ze.normalize((y+90)%180-90)))}else v=d.start,c&&v.translate(l);return dt().translate(v.x,v.y).rotate(y)}getVertexIndex(e,t){const i=this.cell.getVertices(),s=this.getClosestPointLength(new W(e,t));let o=0;if(s!=null)for(const a=i.length;o<a;o+=1){const l=i[o],u=this.getClosestPointLength(l);if(u!=null&&s<u)break}return o}getEventArgs(e,t,r){const i=this,s=i.cell,o=s;return t==null||r==null?{e,view:i,edge:s,cell:o}:{e,x:t,y:r,view:i,edge:s,cell:o}}notifyUnhandledMouseDown(e,t,r){this.notify("edge:unhandled:mousedown",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,r){super.onMouseDown(e,t,r),this.notify("edge:mousedown",this.getEventArgs(e,t,r))}notifyMouseMove(e,t,r){super.onMouseMove(e,t,r),this.notify("edge:mousemove",this.getEventArgs(e,t,r))}notifyMouseUp(e,t,r){super.onMouseUp(e,t,r),this.notify("edge:mouseup",this.getEventArgs(e,t,r))}onClick(e,t,r){super.onClick(e,t,r),this.notify("edge:click",this.getEventArgs(e,t,r))}onDblClick(e,t,r){super.onDblClick(e,t,r),this.notify("edge:dblclick",this.getEventArgs(e,t,r))}onContextMenu(e,t,r){super.onContextMenu(e,t,r),this.notify("edge:contextmenu",this.getEventArgs(e,t,r))}onMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startEdgeDragging(e,t,r)}onMouseMove(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.dragLabel(e,t,r);break}case"drag-arrowhead":{this.dragArrowhead(e,t,r);break}case"drag-edge":{this.dragEdge(e,t,r);break}}return this.notifyMouseMove(e,t,r),i}onMouseUp(e,t,r){const i=this.getEventData(e);switch(i.action){case"drag-label":{this.stopLabelDragging(e,t,r);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,r);break}case"drag-edge":{this.stopEdgeDragging(e,t,r);break}}return this.notifyMouseUp(e,t,r),this.checkMouseleave(e),i}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,r,i){super.onMouseWheel(e,t,r,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(e,t,r)))}onCustomEvent(e,t,r,i){if(tv(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i)))}this.notifyMouseDown(e,r,i)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,r,i))),super.onCustomEvent(e,t,r,i)}onLabelMouseDown(e,t,r){this.notifyMouseDown(e,t,r),this.startLabelDragging(e,t,r),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,r){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,r);return}this.setEventData(e,{x:t,y:r,moving:!1,action:"drag-edge"})}dragEdge(e,t,r){const i=this.getEventData(e);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-i.x,r-i.y,{ui:!0}),this.setEventData(e,{x:t,y:r}),this.notify("edge:moving",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,r){const i=this.getEventData(e);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:r,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(e,t){const r=this.getTerminalMagnet(e),i={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:r,initialTerminal:Ka(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let r,i=0,s=0;e==="source"?(i=2,r="target"):(s=2,r="source");const o=this.cell[r],a=o.cell;if(a){let l;const u=t[i]=this.graph.findViewByCell(a);u&&(l=u.getMagnetFromEdgeTerminal(o),l===u.container&&(l=void 0)),t[i+1]=l}return(l,u)=>(t[s]=l,t[s+1]=l.container===u?void 0:u,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,r,i,s,o,a){const l=this.graph.options.connecting,u=l.allowLoop,c=l.allowNode,h=l.allowEdge,f=l.allowPort,d=l.allowMulti,p=l.validateConnection,g=o?o.cell:null,m=s==="target"?r:e,v=s==="target"?i:t;let y=!0;const b=_=>{const w=s==="source"?a?a.port:null:g?g.getSourcePortId():null,x=s==="target"?a?a.port:null:g?g.getTargetPortId():null;return ke(_,this.graph,{edge:g,edgeView:o,sourceView:e,targetView:r,sourcePort:w,targetPort:x,sourceMagnet:t,targetMagnet:i,sourceCell:e?e.cell:null,targetCell:r?r.cell:null,type:s})};if(u!=null&&(typeof u=="boolean"?!u&&e===r&&(y=!1):y=b(u)),y&&f!=null&&(typeof f=="boolean"?!f&&v&&(y=!1):y=b(f)),y&&h!=null&&(typeof h=="boolean"?!h&&Ar.isEdgeView(m)&&(y=!1):y=b(h)),y&&c!=null&&v==null&&(typeof c=="boolean"?!c&&Xt.isNodeView(m)&&(y=!1):y=b(c)),y&&d!=null&&o){const _=o.cell,w=s==="source"?a:_.getSource(),x=s==="target"?a:_.getTarget(),E=a?this.graph.getCellById(a.cell):null;if(w&&x&&w.cell&&x.cell&&E)if(typeof d=="function")y=b(d);else{const A=this.graph.model.getConnectedEdges(E,{outgoing:s==="source",incoming:s==="target"});A.length&&(d==="withPort"?A.some(T=>{const M=T.getSource(),C=T.getTarget();return M&&C&&M.cell===w.cell&&C.cell===x.cell&&M.port!=null&&M.port===w.port&&C.port!=null&&C.port===x.port})&&(y=!1):d||A.some(T=>{const M=T.getSource(),C=T.getTarget();return M&&C&&M.cell===w.cell&&C.cell===x.cell})&&(y=!1))}}return y&&p!=null&&(y=b(p)),y}allowConnectToBlank(e){const t=this.graph,i=t.options.connecting.allowBlank;if(typeof i!="function")return!!i;const s=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),l=t.findViewByCell(o),u=t.findViewByCell(a);return ke(i,t,{edge:e,edgeView:s,sourceCell:o,targetCell:a,sourceView:l,targetView:u,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:s.sourceMagnet,targetMagnet:s.targetMagnet})}validateEdge(e,t,r){const i=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const s=i.options.connecting.validateEdge;return s?ke(s,i,{edge:e,type:t,previous:r}):!0}arrowheadDragging(e,t,r,i){i.x=t,i.y=r,i.currentTarget!==e&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.findViewByElem(e),i.currentView?(i.currentMagnet=i.currentView.findMagnet(e),i.currentMagnet&&this.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,t,r,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=e,this.cell.prop(i.terminalType,{x:t,y:r},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(e,t,r){const i=e.currentView,s=e.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const o=e.terminalType,a=i.getEdgeTerminal(s,t,r,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,r){const i=this.graph,{snap:s,allowEdge:o}=i.options.connecting,a=typeof s=="object"&&s.radius||50,l=typeof s=="object"&&s.anchor||"center",u=i.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const _=i.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(w=>w!==this);u.push(..._)}const c=r.closestView||null,h=r.closestMagnet||null;r.closestView=null,r.closestMagnet=null;let f,d=Number.MAX_SAFE_INTEGER;const p=new W(e,t);u.forEach(_=>{if(_.container.getAttribute("magnet")!=="false"){if(_.isNodeView())f=l==="center"?_.cell.getBBox().getCenter().distance(p):_.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(_.isEdgeView()){const w=_.getClosestPoint(p);w?f=w.distance(p):f=Number.MAX_SAFE_INTEGER}f<a&&f<d&&(h===_.container||this.validateConnection(...r.getValidateConnectionArgs(_,null),_.getEdgeTerminal(_.container,e,t,this.cell,r.terminalType)))&&(d=f,r.closestView=_,r.closestMagnet=_.container)}_.container.querySelectorAll("[magnet]").forEach(w=>{if(w.getAttribute("magnet")!=="false"){const x=_.getBBoxOfElement(w);f=p.distance(x.getCenter()),f<a&&f<d&&(h===w||this.validateConnection(...r.getValidateConnectionArgs(_,w),_.getEdgeTerminal(w,e,t,this.cell,r.terminalType)))&&(d=f,r.closestView=_,r.closestMagnet=w)}})});let g;const m=r.terminalType,v=r.closestView,y=r.closestMagnet,b=h!==y;if(c&&b&&c.unhighlight(h,{type:"magnetAdsorbed"}),v){if(!b)return;v.highlight(y,{type:"magnetAdsorbed"}),g=v.getEdgeTerminal(y,e,t,this.cell,m)}else g={x:e,y:t};this.cell.setTerminal(m,g,{},Object.assign(Object.assign({},r.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,r=e.closestMagnet;t&&r&&(t.unhighlight(r,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(r)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const r=e.terminalType,i=e.initialTerminal,s=this.cell[r];if(s&&!tt.equalTerminals(i,s)){const a=this.graph,l=i,u=l.cell?a.getCellById(l.cell):null,c=l.port,h=u?a.findViewByCell(u):null,f=u||e.isNewEdge?null:W.create(i).toJSON(),d=s,p=d.cell?a.getCellById(d.cell):null,g=d.port,m=p?a.findViewByCell(p):null,v=p?null:W.create(s).toJSON();this.notify("edge:connected",{e:t,previousCell:u,previousPort:c,previousView:h,previousPoint:f,currentCell:p,currentView:m,currentPort:g,currentPoint:v,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:r,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,r=t.model.getCells();e.marked={};for(let i=0,s=r.length;i<s;i+=1){const o=t.findViewByCell(r[i]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(u=>this.validateConnection(...e.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,e.x,e.y,this.cell,e.terminalType)));if(l.length>0){for(let u=0,c=l.length;u<c;u+=1)o.highlight(l[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(r=>{const i=this.graph.findViewByCell(r);i&&(t[r].forEach(o=>{i.unhighlight(o,{type:"magnetAvailable"})}),i.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,r){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,r);return}const s=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(s,{x:t,y:r});this.setEventData(e,o)}dragArrowhead(e,t,r){const i=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,r,i):this.arrowheadDragging(this.getEventTarget(e),t,r,i)}stopArrowheadDragging(e,t,r){const i=this.graph,s=this.getEventData(e);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,t,r),this.validateEdge(this.cell,s.terminalType,s.initialTerminal)?(this.finishEmbedding(s),this.notifyConnectionEvent(s,e)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(e,t,r){if(this.can("edgeLabelMovable")){const i=e.currentTarget,s=parseInt(i.getAttribute("data-index"),10),o=this.getLabelPositionAngle(s),a=this.getLabelPositionArgs(s),l=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,l);this.setEventData(e,{index:s,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,r){const i=this.getEventData(e),s=this.cell.getLabelAt(i.index),o=ot({},s,{position:this.getLabelPosition(t,r,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(e,t,r){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag],i=t;return(r==null||r===n.toStringTag)&&typeof i.isNodeView=="function"&&typeof i.isEdgeView=="function"&&typeof i.confirmUpdate=="function"&&typeof i.update=="function"&&typeof i.getConnection=="function"}n.isEdgeView=e})(Ar||(Ar={})),Ar.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Ar.registry.register("edge",Ar,!0);var UB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class or extends Ke{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:r}=Ye.parseJSONMarkup(or.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=or.snapshoot(this.container),qe(this.container,this.prefixClassName("graph")),Bi(this.container,r),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&De.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onDblClick(t,i.x,i.y):this.graph.trigger("blank:dblclick",{e:t,x:i.x,y:i.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onClick(t,i.x,i.y):this.graph.trigger("blank:click",{e:t,x:i.x,y:i.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=ke(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.isPreventDefaultContextMenu(r)&&e.preventDefault(),this.guard(t,r))return;const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onContextMenu(t,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:t,x:i.x,y:i.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const r=this.constructor;this.delegateDocumentEvents(r.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(t.clientX,t.clientY);r?r.onMouseDown(t,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:i.x,y:i.y})),this.delegateDragEvents(t,r)}onMouseMove(e){const t=this.getEventData(e),r=t.startPosition;if(r&&r.x===e.clientX&&r.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const s=this.normalizeEvent(e),o=this.graph.snapToGrid(s.clientX,s.clientY),a=t.currentView;a?a.onMouseMove(s,o.x,o.y):this.graph.trigger("blank:mousemove",{e:s,x:o.x,y:o.y}),this.setEventData(s,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),r=this.graph.snapToGrid(t.clientX,t.clientY),s=this.getEventData(e).currentView;if(s?s.onMouseUp(t,r.x,r.y):this.graph.trigger("blank:mouseup",{e:t,x:r.x,y:r.y}),!e.isPropagationStopped()){const o=new ir(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(!this.guard(t,r))if(r)r.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseEnter(t)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=this.graph.findViewByElem(t.relatedTarget);if(r){if(i===r)return;r.onMouseLeave(t)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),r=this.findView(t.target);if(this.guard(t,r))return;const i=t.originalEvent,s=this.graph.snapToGrid(i.clientX,i.clientY),o=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));r?r.onMouseWheel(t,s.x,s.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:s.x,y:s.y})}onCustomEvent(e){const t=e.currentTarget,r=t.getAttribute("event")||t.getAttribute("data-event");if(r){const i=this.findView(t);if(i){const s=this.normalizeEvent(e);if(this.guard(s,i))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);i.onCustomEvent(s,r,o.x,o.y)}}}handleMagnetEvent(e,t){const r=e.currentTarget,i=r.getAttribute("magnet");if(i&&i.toLowerCase()!=="false"){const s=this.findView(r);if(s){const o=this.normalizeEvent(e);if(this.guard(o,s))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);ke(t,this.graph,s,o,r,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetMouseDown(r,i,s,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,r,i,s,o)=>{t.onMagnetDblClick(r,i,s,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(r,i,s,o,a)=>{r.onMagnetContextMenu(i,s,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const s=this.graph.snapToGrid(i.clientX,i.clientY);r.onLabelMouseDown(i,s.x,s.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}UB([Ke.dispose()],or.prototype,"dispose",null),(function(n){const e=`${Yt.prefixCls}-graph`;n.markup=[{ns:ft.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:ft.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:ft.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ft.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(r){const i=r.cloneNode();return r.childNodes.forEach(s=>i.appendChild(s)),()=>{for(Di(r);r.attributes.length>0;)r.removeAttribute(r.attributes[0].name);for(let s=0,o=i.attributes.length;s<o;s+=1){const a=i.attributes[s];r.setAttribute(a.name,a.value)}i.childNodes.forEach(s=>r.appendChild(s))}}n.snapshoot=t})(or||(or={})),(function(n){const e=Yt.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})(or||(or={}));const zB=`.x6-graph {
|
|
101
|
-
position: relative;
|
|
102
|
-
overflow: hidden;
|
|
103
|
-
outline: none;
|
|
104
|
-
touch-action: none;
|
|
105
|
-
}
|
|
106
|
-
.x6-graph-background,
|
|
107
|
-
.x6-graph-grid,
|
|
108
|
-
.x6-graph-svg {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: 0;
|
|
111
|
-
right: 0;
|
|
112
|
-
bottom: 0;
|
|
113
|
-
left: 0;
|
|
114
|
-
}
|
|
115
|
-
.x6-graph-background-stage,
|
|
116
|
-
.x6-graph-grid-stage,
|
|
117
|
-
.x6-graph-svg-stage {
|
|
118
|
-
user-select: none;
|
|
119
|
-
}
|
|
120
|
-
.x6-graph.x6-graph-pannable {
|
|
121
|
-
cursor: grab;
|
|
122
|
-
cursor: -moz-grab;
|
|
123
|
-
cursor: -webkit-grab;
|
|
124
|
-
}
|
|
125
|
-
.x6-graph.x6-graph-panning {
|
|
126
|
-
cursor: grabbing;
|
|
127
|
-
cursor: -moz-grabbing;
|
|
128
|
-
cursor: -webkit-grabbing;
|
|
129
|
-
user-select: none;
|
|
130
|
-
}
|
|
131
|
-
.x6-node {
|
|
132
|
-
cursor: move;
|
|
133
|
-
/* stylelint-disable-next-line */
|
|
134
|
-
}
|
|
135
|
-
.x6-node.x6-node-immovable {
|
|
136
|
-
cursor: default;
|
|
137
|
-
}
|
|
138
|
-
.x6-node * {
|
|
139
|
-
-webkit-user-drag: none;
|
|
140
|
-
}
|
|
141
|
-
.x6-node .scalable * {
|
|
142
|
-
vector-effect: non-scaling-stroke;
|
|
143
|
-
}
|
|
144
|
-
.x6-node [magnet='true'] {
|
|
145
|
-
cursor: crosshair;
|
|
146
|
-
transition: opacity 0.3s;
|
|
147
|
-
}
|
|
148
|
-
.x6-node [magnet='true']:hover {
|
|
149
|
-
opacity: 0.7;
|
|
150
|
-
}
|
|
151
|
-
.x6-node foreignObject {
|
|
152
|
-
display: block;
|
|
153
|
-
overflow: visible;
|
|
154
|
-
background-color: transparent;
|
|
155
|
-
}
|
|
156
|
-
.x6-node foreignObject > body {
|
|
157
|
-
position: static;
|
|
158
|
-
width: 100%;
|
|
159
|
-
height: 100%;
|
|
160
|
-
margin: 0;
|
|
161
|
-
padding: 0;
|
|
162
|
-
overflow: visible;
|
|
163
|
-
background-color: transparent;
|
|
164
|
-
}
|
|
165
|
-
.x6-edge .source-marker,
|
|
166
|
-
.x6-edge .target-marker {
|
|
167
|
-
vector-effect: non-scaling-stroke;
|
|
168
|
-
}
|
|
169
|
-
.x6-edge .connection {
|
|
170
|
-
stroke-linejoin: round;
|
|
171
|
-
fill: none;
|
|
172
|
-
}
|
|
173
|
-
.x6-edge .connection-wrap {
|
|
174
|
-
cursor: move;
|
|
175
|
-
opacity: 0;
|
|
176
|
-
fill: none;
|
|
177
|
-
stroke: #000;
|
|
178
|
-
stroke-width: 15;
|
|
179
|
-
stroke-linecap: round;
|
|
180
|
-
stroke-linejoin: round;
|
|
181
|
-
}
|
|
182
|
-
.x6-edge .connection-wrap:hover {
|
|
183
|
-
opacity: 0.4;
|
|
184
|
-
stroke-opacity: 0.4;
|
|
185
|
-
}
|
|
186
|
-
.x6-edge .vertices {
|
|
187
|
-
cursor: move;
|
|
188
|
-
opacity: 0;
|
|
189
|
-
}
|
|
190
|
-
.x6-edge .vertices .vertex {
|
|
191
|
-
fill: #1abc9c;
|
|
192
|
-
}
|
|
193
|
-
.x6-edge .vertices .vertex :hover {
|
|
194
|
-
fill: #34495e;
|
|
195
|
-
stroke: none;
|
|
196
|
-
}
|
|
197
|
-
.x6-edge .vertices .vertex-remove {
|
|
198
|
-
cursor: pointer;
|
|
199
|
-
fill: #fff;
|
|
200
|
-
}
|
|
201
|
-
.x6-edge .vertices .vertex-remove-area {
|
|
202
|
-
cursor: pointer;
|
|
203
|
-
opacity: 0.1;
|
|
204
|
-
}
|
|
205
|
-
.x6-edge .vertices .vertex-group:hover .vertex-remove-area {
|
|
206
|
-
opacity: 1;
|
|
207
|
-
}
|
|
208
|
-
.x6-edge .arrowheads {
|
|
209
|
-
cursor: move;
|
|
210
|
-
opacity: 0;
|
|
211
|
-
}
|
|
212
|
-
.x6-edge .arrowheads .arrowhead {
|
|
213
|
-
fill: #1abc9c;
|
|
214
|
-
}
|
|
215
|
-
.x6-edge .arrowheads .arrowhead :hover {
|
|
216
|
-
fill: #f39c12;
|
|
217
|
-
stroke: none;
|
|
218
|
-
}
|
|
219
|
-
.x6-edge .tools {
|
|
220
|
-
cursor: pointer;
|
|
221
|
-
opacity: 0;
|
|
222
|
-
}
|
|
223
|
-
.x6-edge .tools .tool-options {
|
|
224
|
-
display: none;
|
|
225
|
-
}
|
|
226
|
-
.x6-edge .tools .tool-remove circle {
|
|
227
|
-
fill: #f00;
|
|
228
|
-
}
|
|
229
|
-
.x6-edge .tools .tool-remove path {
|
|
230
|
-
fill: #fff;
|
|
231
|
-
}
|
|
232
|
-
.x6-edge:hover .vertices,
|
|
233
|
-
.x6-edge:hover .arrowheads,
|
|
234
|
-
.x6-edge:hover .tools {
|
|
235
|
-
opacity: 1;
|
|
236
|
-
}
|
|
237
|
-
.x6-highlight-opacity {
|
|
238
|
-
opacity: 0.3;
|
|
239
|
-
}
|
|
240
|
-
.x6-cell-tool-editor {
|
|
241
|
-
position: relative;
|
|
242
|
-
display: inline-block;
|
|
243
|
-
min-height: 1em;
|
|
244
|
-
margin: 0;
|
|
245
|
-
padding: 0;
|
|
246
|
-
line-height: 1;
|
|
247
|
-
white-space: normal;
|
|
248
|
-
text-align: center;
|
|
249
|
-
vertical-align: top;
|
|
250
|
-
overflow-wrap: normal;
|
|
251
|
-
outline: none;
|
|
252
|
-
transform-origin: 0 0;
|
|
253
|
-
-webkit-user-drag: none;
|
|
254
|
-
}
|
|
255
|
-
.x6-edge-tool-editor {
|
|
256
|
-
border: 1px solid #275fc5;
|
|
257
|
-
border-radius: 2px;
|
|
258
|
-
}
|
|
259
|
-
`;class gt extends yr{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var VB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class jl extends gt{init(){cj("core",zB)}dispose(){hj("core")}}VB([jl.dispose()],jl.prototype,"dispose",null);var WB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},is;(function(n){function e(t){const{grid:r,panning:i,mousewheel:s,embedding:o}=t,a=WB(t,["grid","panning","mousewheel","embedding"]),l=t.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=ot({},n.defaults,a),c={size:10,visible:!1};return typeof r=="number"?u.grid={size:r,visible:!1}:typeof r=="boolean"?u.grid=Object.assign(Object.assign({},c),{visible:r}):u.grid=Object.assign(Object.assign({},c),r),["panning","mousewheel","embedding"].forEach(f=>{const d=t[f];typeof d=="boolean"?u[f].enabled=d:u[f]=Object.assign(Object.assign({},u[f]),d)}),u}n.get=e})(is||(is={})),(function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Yt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Yt.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:e,sourceView:t,targetView:r}){return(e==="target"?r:t)!=null},createEdge(){return new DB}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}})(is||(is={}));var GB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},HB=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class Ll extends gt{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const r=this.graph.matrix(),i=this.getInstance(),s=Array.isArray(e)?e:[e];this.patterns.forEach((l,u)=>{const c=`pattern_${u}`,h=r.a||1,f=r.d||1,{update:d,markup:p}=l,g=HB(l,["update","markup"]),m=Object.assign(Object.assign(Object.assign({},g),s[u]),{sx:h,sy:f,ox:r.e||0,oy:r.f||0,width:t*h,height:t*f});i.has(c)||i.add(c,Ie.create("pattern",{id:c,patternUnits:"userSpaceOnUse"},Ie.createVectors(p)).node);const v=i.get(c);typeof d=="function"&&d(v.childNodes[0],m);let y=m.ox%m.width;y<0&&(y+=m.width);let b=m.oy%m.height;b<0&&(b+=m.height),Ue(v,{x:y,y:b,width:m.width,height:m.height})});const o=new XMLSerializer().serializeToString(i.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new zr),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},zr.presets.dot),e.args)];const r=zr.registry.get(t);if(r){let i=e.args||[];return Array.isArray(i)||(i=[i]),Array.isArray(r)?r.map((s,o)=>Object.assign(Object.assign({},s),i[o])):[Object.assign(Object.assign({},r),i[0])]}return zr.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}GB([gt.dispose()],Ll.prototype,"dispose",null);class M0 extends gt{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),dt(this.viewportMatrix)}setMatrix(e){const t=dt(e),r=Kn(t);this.viewport.setAttribute("transform",r),this.viewportMatrix=t,this.viewportTransformString=r}resize(e,t){let r=e===void 0?this.options.width:e,i=t===void 0?this.options.height:t;this.options.width=r,this.options.height=i,typeof r=="number"&&(r=Math.round(r)),typeof i=="number"&&(i=Math.round(i)),this.container.style.width=r==null?"":`${r}px`,this.container.style.height=i==null?"":`${i}px`;const s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let e=this.options.width,t=this.options.height;return Sb(e)||(e=this.container.clientWidth),Sb(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return tj(this.getMatrix())}scale(e,t=e,r=0,i=0){if(e=this.clampScale(e),t=this.clampScale(t),r||i){const o=this.getTranslation(),a=o.tx-r*(e-1),l=o.ty-i*(t-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const s=this.getMatrix();return s.a=e,s.d=t,this.setMatrix(s),this.graph.trigger("scale",{sx:e,sy:t,ox:r,oy:i}),this}clampScale(e){const t=this.graph.options.scaling;return jt(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let r=e,i=e;const s=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(t.absolute||(r+=s.sx,i+=s.sy),t.scaleGrid&&(r=Math.round(r/t.scaleGrid)*t.scaleGrid,i=Math.round(i/t.scaleGrid)*t.scaleGrid),t.maxScale&&(r=Math.min(t.maxScale,r),i=Math.min(t.maxScale,i)),t.minScale&&(r=Math.max(t.minScale,r),i=Math.max(t.minScale,i)),t.center&&(a=t.center.x,l=t.center.y),r=this.clampScale(r),i=this.clampScale(i),a||l){const u=this.getTranslation(),c=a-(a-u.tx)*(r/s.sx),h=l-(l-u.ty)*(i/s.sy);(c!==u.tx||h!==u.ty)&&this.translate(c,h)}return this.scale(r,i),this}getRotation(){return rj(this.getMatrix())}rotate(e,t,r){if(t==null||r==null){const s=Fe.getBBox(this.stage);t=s.width/2,r=s.height/2}const i=this.getMatrix().translate(t,r).rotate(e).translate(-t,-r);return this.setMatrix(i),this}getTranslation(){return nj(this.getMatrix())}translate(e,t){const r=this.getMatrix();r.e=e||0,r.f=t||0,this.setMatrix(r);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,r,i){if(typeof e=="object"){const b=e;e=b.gridWidth||1,t=b.gridHeight||1,r=b.padding||0,i=b}else e=e||1,t=t||1,r=r||0,i==null&&(i={});const s=fn(r),o=i.border||0,a=i.contentArea?Se.create(i.contentArea):this.getContentArea(i);o>0&&a.inflate(o);const l=this.getScale(),u=this.getTranslation(),c=l.sx,h=l.sy;a.x*=c,a.y*=h,a.width*=c,a.height*=h;let f=Math.max(Math.ceil((a.width+a.x)/e),1)*e,d=Math.max(Math.ceil((a.height+a.y)/t),1)*t,p=0,g=0;(i.allowNewOrigin==="negative"&&a.x<0||i.allowNewOrigin==="positive"&&a.x>=0||i.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/e)*e,p+=s.left,f+=p),(i.allowNewOrigin==="negative"&&a.y<0||i.allowNewOrigin==="positive"&&a.y>=0||i.allowNewOrigin==="any")&&(g=Math.ceil(-a.y/t)*t,g+=s.top,d+=g),f+=s.right,d+=s.bottom,f=Math.max(f,i.minWidth||0),d=Math.max(d,i.minHeight||0),f=Math.min(f,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const m=this.getComputedSize(),v=f!==m.width||d!==m.height;return(p!==u.tx||g!==u.ty)&&this.translate(p,g),v&&this.resize(f,d),new Se(-p/c,-g/h,f/c,d/h)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let r,i;if(e.contentArea){const v=e.contentArea;r=this.graph.localToGraph(v),i=W.create(v)}else r=this.getContentBBox(e),i=this.graph.graphToLocal(r);if(!r.width||!r.height)return;const s=fn(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,l=e.minScaleX||o,u=e.maxScaleX||a,c=e.minScaleY||o,h=e.maxScaleY||a;let f;if(e.viewportArea)f=e.viewportArea;else{const v=this.getComputedSize(),y=this.getTranslation();f={x:y.tx,y:y.ty,width:v.width,height:v.height}}f=Se.create(f).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.bottom});const d=this.getScale();let p=f.width/r.width*d.sx,g=f.height/r.height*d.sy;e.preserveAspectRatio!==!1&&(p=g=Math.min(p,g));const m=e.scaleGrid;if(m&&(p=m*Math.floor(p/m),g=m*Math.floor(g/m)),p=jt(p,l,u),g=jt(g,c,h),this.scale(p,g),t){const v=this.options,y=f.x-i.x*p-v.x,b=f.y-i.y*g-v.y;this.translate(y,b)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new Se:Fe.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=Se.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const r=Se.create(e),i=this.graph;t.contentArea=r,t.viewportArea==null&&(t.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const s=r.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const r=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),o=r.width/2,a=r.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*i.sx,t=a-t*i.sy,(s.tx!==e||s.ty!==t)&&this.translate(e,t)}centerContent(e){const r=this.graph.getContentArea(e).getCenter();this.centerPoint(r.x,r.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,r){const i=this.getComputedSize();t=Gt(t,Math.max(0,i.width)),t<0&&(t=i.width+t),r=Gt(r,Math.max(0,i.height)),r<0&&(r=i.height+r);const s=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,l=r-e.y*o.sy;(s.tx!==a||s.ty!==l)&&this.translate(a,l)}positionRect(e,t){const r=Se.create(e);switch(t){case"center":return this.positionPoint(r.getCenter(),"50%","50%");case"top":return this.positionPoint(r.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%");case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(r.getTopLeft(),0,0);default:return this}}positionCell(e,t){const r=e.getBBox();return this.positionRect(r,t)}positionContent(e,t){const r=this.graph.getContentArea(t);return this.positionRect(r,e)}}var KB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Dl extends gt{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(e={}){let t=e.size||"auto auto",r=e.position||"center";const i=this.graph.transform.getScale(),s=this.graph.translate();if(typeof r=="object"){const o=s.tx+i.sx*(r.x||0),a=s.ty+i.sy*(r.y||0);r=`${o}px ${a}px`}typeof t=="object"&&(t=Se.fromSize(t).scale(i.sx,i.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=r}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const r=this.optionsCache;if(r&&r.image!==t.image)return;let i;const s=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const l=Yi.registry.get(a);if(typeof l=="function"){const c=t.quality||1;e.width*=c,e.height*=c;const h=l(e,t);if(!(h instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=h.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=h.width/e.width,o.height*=h.height/e.height):o===void 0&&(t.size={width:h.width/c,height:h.height/c})}else i=e.src,o===void 0&&(t.size={width:e.width,height:e.height});r!=null&&typeof t.size=="object"&&t.image===r.image&&t.repeat===r.repeat&&t.quality===r.quality&&(r.size=Ka(t.size));const u=this.elem.style;u.backgroundImage=`url(${i})`,u.backgroundRepeat=a,u.opacity=s==null||s>=1?"":`${s}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Ka(t);const r=document.createElement("img");r.onload=()=>this.drawBackgroundImage(r,e),r.setAttribute("crossorigin","anonymous"),r.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}KB([gt.dispose()],Dl.prototype,"dispose",null);var YB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Bl extends gt{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onSpaceKeyDown=this.onSpaceKeyDown.bind(this),this.onSpaceKeyUp=this.onSpaceKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),vt.on(this.graph.container,"mousedown",this.onRightMouseDown),vt.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Ev(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),vt.off(this.graph.container,"mousedown",this.onRightMouseDown),vt.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&Jn.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),vt.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),vt.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),r=t.clientX-this.clientX,i=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(r,i)}stopPanning(e){this.panning=!1,this.updateClassName(),vt.off(document.body,".panning"),vt.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),r=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(qe(e,t),Dt(e,r)):(Dt(e,t),qe(e,r)):(Dt(e,t),Dt(e,r))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),r=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!r)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t?.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,r){this.graph.translateBy(-t,-r)}onSpaceKeyDown(e){e.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(e){e.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return t?.includes("leftMouseDown")&&e.button===0||t?.includes("mouseWheelDown")&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const i=this.graph.getGraphArea();let s=0,o=0;e<=i.left+10&&(s=-10),t<=i.top+10&&(o=-10),e>=i.right-10&&(s=10),t>=i.bottom-10&&(o=10),(s!==0||o!==0)&&this.graph.translateBy(-s,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}YB([gt.dispose()],Bl.prototype,"dispose",null);var JB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class ql extends gt{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Ev(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&Jn.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&Jn.isMatch(e,this.widgetOptions.modifiers)){const r=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*r*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/r)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const s=this.currentScale;let o=this.graph.transform.clampScale(s*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=jt(o,a,l),o!==s)if(this.widgetOptions.zoomAtMousePosition){const c=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:c.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}JB([yr.dispose()],ql.prototype,"dispose",null);var XB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class I0 extends gt{init(){this.resetRenderArea=oN(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}XB([gt.dispose()],I0.prototype,"dispose",null);class QB{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&Pr.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,r=this.queue.length,i=r-1;const s=e.priority;for(;t<=i;){const o=(i-t>>1)+t;s<=this.queue[o].priority?t=o+1:(r=o,i=o-1)}return r}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Pr;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(Pr||(Pr={}));var ZB=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class ct extends yr{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new QB,this.graph=e,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(r=>r.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const r=this.views[e.id];r&&this.requestViewUpdate(r.view,ct.FLAG_INSERT,t,Pr.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,r={},i=Pr.Update,s=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=r,(e.hasAction(t,["translate","resize","rotate"])||r.async===!1)&&(i=Pr.PRIOR,s=!1),this.queue.queueJob({id:o,priority:i,cb:()=>{this.renderViewInArea(e,t,r);const c=r.queue;if(c){const h=c.indexOf(e.cell.id);h>=0&&c.splice(h,1),c.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(c=>{this.requestViewUpdate(c.view,c.flag,r,i,!1)}),s&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===ct.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((r,i)=>r.isNode()&&i.isEdge()?-1:0),e.forEach(r=>{const i=r.id,s=this.views;let o=0,a=s[i];if(a)o=ct.FLAG_INSERT;else{const l=this.createCellView(r);l&&(l.graph=this.graph,o=ct.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:t,state:ct.ViewState.CREATED},this.views[i]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,r={}){const i=e.cell,s=i.id,o=this.views[s];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,r),o.flag=a):o.state===ct.ViewState.MOUNTED?(a=this.updateView(e,t,r),o.flag=a):o.state=ct.ViewState.WAITING,a&&i.isEdge()&&(a&e.getFlag(["source","target"]))===0&&this.queue.queueJob({id:s,priority:Pr.RenderEdge,cb:()=>{this.updateView(e,t,r)}})}removeViews(e){e.forEach(t=>{const r=t.id,i=this.views[r];i&&(this.willRemoveViews[r]=i,delete this.views[r],this.queue.queueJob({id:r,priority:this.getRenderPriority(i.view),cb:()=>{this.removeView(i.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(e=>{if(e&&e.state===ct.ViewState.WAITING){const{view:t,flag:r,options:i}=e;this.requestViewUpdate(t,r,i,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,r={}){if(e==null)return 0;if(it.isCellView(e)){if(t&ct.FLAG_REMOVE)return this.removeView(e.cell),0;t&ct.FLAG_INSERT&&(this.insertView(e),t^=ct.FLAG_INSERT)}return t?e.confirmUpdate(t,r):0}insertView(e){const t=this.views[e.cell.id];if(t){const r=e.cell.getZIndex(),i=this.addZPivot(r);this.container.insertBefore(e.container,i),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=ct.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,r=this.willRemoveViews[t.id];r&&e&&(r.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const r=this.model.getConnectedEdges(e);for(let s=0,o=r.length;s<o;s+=1){const a=r[s];if(t){const l=a.getSourceCell(),u=a.getTargetCell();if(l&&!l.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const i=this.views[e.id];i&&Fi(i.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let r=t[e];if(r)return r;r=t[e]=document.createComment(`z-index:${e+1}`);let i=-1/0;for(const o in t){const a=+o;a<e&&a>i&&(i=a,e-1)}const s=this.container;if(i!==-1/0){const o=t[i];s.insertBefore(r,o.nextSibling)}else s.insertBefore(r,s.firstChild);return r}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},r=this.graph.options.createCellView;if(r){const s=ke(r,this.graph,e);if(s)return new s(e,t);if(s===null)return null}const i=e.view;if(i!=null&&typeof i=="string"){const s=it.registry.get(i);return s?new s(e,t):it.registry.onNotFound(i)}return e.isNode()?new Xt(e,t):e.isEdge()?new Ar(e,t):null}getEffectedEdges(e){const t=[],r=e.cell,i=this.model.getConnectedEdges(r);for(let s=0,o=i.length;s<o;s+=1){const a=i[s],l=this.views[a.id];if(!l)continue;const u=l.view;if(!this.isViewMounted(u))continue;const c=["update"];a.getTargetCell()===r&&c.push("target"),a.getSourceCell()===r&&c.push("source"),t.push({id:a.id,view:u,flag:u.getFlag(c)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,r=t.getSourceCell(),i=t.getTargetCell();if(this.renderArea&&r&&i)return this.renderArea.isIntersectWithRect(r.getBBox())||this.renderArea.isIntersectWithRect(i.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?Pr.RenderNode:Pr.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}ZB([yr.dispose()],ct.prototype,"dispose",null),(function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1})(ct||(ct={})),(function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))})(ct||(ct={}));var eq=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Fl extends gt{constructor(){super(...arguments),this.schedule=new ct(this.graph)}requestViewUpdate(e,t,r={}){this.schedule.requestViewUpdate(e,t,r)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,r=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[0];if(r){const i=this.graph.view.findAttr("data-cell-id",r);if(i){const s=this.schedule.views;if(s[i])return s[i].view}}return null}findViewByCell(e){if(e==null)return null;const t=De.isCell(e)?e.id:e,r=this.schedule.views;return r[t]?r[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>r!=null?Fe.getBBox(r.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(r=>this.findViewByCell(r)).filter(r=>{if(r!=null){const i=r.getClosestPoint(e);if(i)return i.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const r=Se.create(e);return this.model.getCells().map(i=>this.findViewByCell(i)).filter(i=>{if(i){if(t.nodeOnly&&!i.isNodeView())return!1;const s=Fe.getBBox(i.container,{target:this.view.stage});return s.width===0?s.inflate(1,0):s.height===0&&s.inflate(0,1),t.strict?r.containsRect(s):r.isIntersectWithRect(s)}return!1})}dispose(){this.schedule.dispose()}}eq([gt.dispose()],Fl.prototype,"dispose",null);var R0=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class k0 extends gt{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const r=e.name;if(t||(t=`filter-${r}-${this.cid}-${ol(JSON.stringify(e))}`),!this.isDefined(t)){const i=Zn.registry.get(r);if(i==null)return Zn.registry.onNotFound(r);const s=i(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});Ie.create(Ye.sanitize(s),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const r=e.type;if(t||(t=`gradient-${r}-${this.cid}-${ol(JSON.stringify(e))}`),!this.isDefined(t)){const s=e.stops.map(l=>{const u=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${u}"/>`}),o=`<${r}>${s.join("")}</${r}>`,a=Object.assign({id:t},e.attrs);Ie.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:r,refY:i,markerUnits:s,markerOrient:o,tagName:a,children:l}=e,u=R0(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let c=t;if(c||(c=`marker-${this.cid}-${ol(JSON.stringify(e))}`),!this.isDefined(c)){a!=="path"&&delete u.d;const h=Ie.create("marker",{refX:r,refY:i,id:c,overflow:"visible",orient:o??"auto",markerUnits:s||"userSpaceOnUse"},l?l.map(f=>{var{tagName:d}=f,p=R0(f,["tagName"]);return Ie.create(`${d}`||"path",qi(Object.assign(Object.assign({},u),p)))}):[Ie.create(a||"path",qi(u))]);this.defs.appendChild(h.node)}return c}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class N0 extends gt{getClientMatrix(){return dt(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new W(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const r=W.create(e,t);return Fe.transformPoint(r,this.graph.matrix())}localToClientPoint(e,t){const r=W.create(e,t);return Fe.transformPoint(r,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,r,i){const s=Se.create(e,t,r,i);return Fe.transformRectangle(s,this.graph.matrix())}localToClientRect(e,t,r,i){const s=Se.create(e,t,r,i);return Fe.transformRectangle(s,this.getClientMatrix())}localToPageRect(e,t,r,i){return(typeof e=="number"?this.localToGraphRect(e,t,r,i):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const r=W.create(e,t);return Fe.transformPoint(r,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const r=W.create(e,t);return Fe.transformPoint(r,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const r=W.create(e,t);return Fe.transformPoint(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const i=W.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(e,t,r,i){const s=Se.create(e,t,r,i);return Fe.transformRectangle(s,this.graph.matrix().inverse())}clientToLocalRect(e,t,r,i){const s=Se.create(e,t,r,i);return Fe.transformRectangle(s,this.getClientMatrix().inverse())}clientToGraphRect(e,t,r,i){const s=Se.create(e,t,r,i);return Fe.transformRectangle(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,r,i){const s=Se.create(e,t,r,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var tq=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class wo extends gt{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:e,magnet:t,options:r={}}){const i=this.resolveHighlighter(r);if(!i)return;const s=this.getHighlighterId(t,i);if(!this.highlights[s]){const o=i.highlighter;o.highlight(e,t,Object.assign({},i.args)),this.highlights[s]={cellView:e,magnet:t,highlighter:o,args:i.args}}}onCellUnhighlight({magnet:e,options:t={}}){const r=this.resolveHighlighter(t);if(!r)return;const i=this.getHighlighterId(e,r);this.unhighlight(i)}resolveHighlighter(e){const t=this.options;let r=e.highlighter;if(r==null){const a=e.type;r=a&&t.highlighting[a]||t.highlighting.default}if(r==null)return null;const i=typeof r=="string"?{name:r}:r,s=i.name,o=Er.registry.get(s);return o==null?Er.registry.onNotFound(s):(Er.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(e,t){return cl(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}tq([wo.dispose()],wo.prototype,"dispose",null);var rq=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class j0 extends gt{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&Zs.bind(t,()=>{const r=t.offsetWidth,i=t.offsetHeight;this.resize(r,i)})}}resize(e,t){const r=this.getScroller();r?r.resize(e,t):this.graph.transform.resize(e,t)}dispose(){Zs.clear(this.graph.container)}}rq([gt.dispose()],j0.prototype,"dispose",null);var nq=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class wt extends Rt{get container(){return this.options.container}get[Symbol.toStringTag](){return wt.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=is.get(e),this.css=new jl(this),this.view=new or(this),this.defs=new k0(this),this.coord=new N0(this),this.transform=new M0(this),this.highlight=new wo(this),this.grid=new Ll(this),this.background=new Dl(this),this.options.model?this.model=this.options.model:(this.model=new Jt,this.model.graph=this),this.renderer=new Fl(this),this.panning=new Bl(this),this.mousewheel=new ql(this),this.virtualRender=new I0(this),this.size=new j0(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(r=>ut.isNode(r)?r:this.createNode(r)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(r=>tt.isEdge(r)?r:this.createEdge(r)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,r={}){return this.model.isNeighbor(e,t,r)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,r={}){return this.model.isSuccessor(e,t,r)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,r={}){return this.model.isPredecessor(e,t,r)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,r,i,s){return this.model.getNodesInArea(e,t,r,i,s)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,r={}){return this.model.search(e,t,r),this}getShortestPath(e,t,r={}){return this.model.getShortestPath(e,t,r)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,r){const i=typeof e=="string"?e:"update",s=typeof e=="string"?t:e,o=typeof t=="function"?r:t;this.startBatch(i,o);const a=s();return this.stopBatch(i,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return De.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return Se.isRectangleLike(e)?this.findViewsInArea(e):W.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const r=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(r)}findViewsInArea(e,t,r,i,s){const o=typeof e=="number"?{x:e,y:t,width:r,height:i}:e,a=typeof e=="number"?s:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e>"u"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const r=this.getPlugin("scroller");return r?r.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,r=0,i=0){return typeof e>"u"?this.transform.getScale():(this.transform.scale(e,t,r,i),this)}zoom(e,t){const r=this.getPlugin("scroller");if(r){if(typeof e>"u")return r.zoom();r.zoom(e,t)}else{if(typeof e>"u")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const r=this.getPlugin("scroller");return r?r.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const r=this.getPlugin("scroller");return r?r.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,r){return typeof e>"u"?this.transform.getRotation():(this.transform.rotate(e,t,r),this)}translate(e,t){return typeof e>"u"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const r=this.translate(),i=r.tx+e,s=r.ty+t;return this.translate(i,s)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,r,i){return this.transform.fitToContent(e,t,r,i)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,r){const i=this.getPlugin("scroller");return i?i.centerPoint(e,t,r):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const r=this.getPlugin("scroller");return r?r.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,r,i={}){const s=this.getPlugin("scroller");return s?s.positionPoint(e,t,r,i):this.transform.positionPoint(e,t,r),this}positionRect(e,t,r){const i=this.getPlugin("scroller");return i?i.positionRect(e,t,r):this.transform.positionRect(e,t),this}positionCell(e,t,r){const i=this.getPlugin("scroller");return i?i.positionCell(e,t,r):this.transform.positionCell(e,t),this}positionContent(e,t){const r=this.getPlugin("scroller");return r?r.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,r,i){return Se.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.pageToLocalRect(e,t,r,i):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,r,i){return Se.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToPageRect(e,t,r,i):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,r,i){return Se.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToLocalRect(e,t,r,i):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,r,i){return Se.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToClientRect(e,t,r,i):this.coord.localToClientPoint(e,t)}localToGraph(e,t,r,i){return Se.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.localToGraphRect(e,t,r,i):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,r,i){return Se.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.graphToLocalRect(e,t,r,i):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,r,i){return Se.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof r=="number"&&typeof i=="number"?this.coord.clientToGraphRect(e,t,r,i):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const r=this.getPlugin("scroller");return r!=null&&(this.options.background==null||!t)?r.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r?.forEach(i=>{var s;(s=i?.enable)===null||s===void 0||s.call(i)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r?.forEach(i=>{var s;(s=i?.disable)===null||s===void 0||s.call(i)}),this}isPluginEnabled(e){var t;const r=this.getPlugin(e);return(t=r?.isEnabled)===null||t===void 0?void 0:t.call(r)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const r=this.getPlugins(t);return r?.forEach(i=>{i.dispose(),this.installedPlugins.delete(i)}),this}dispose(e=!0){e&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(t=>{t.dispose()})}}nq([Rt.dispose()],wt.prototype,"dispose",null),(function(n){n.View=or,n.Renderer=Fl,n.MouseWheel=ql,n.DefsManager=k0,n.GridManager=Ll,n.CoordManager=N0,n.TransformManager=M0,n.HighlightManager=wo,n.BackgroundManager=Dl,n.PanningManager=Bl})(wt||(wt={})),(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const r=t[Symbol.toStringTag];return r==null||r===n.toStringTag}n.isGraph=e})(wt||(wt={})),(function(n){function e(t,r){const i=t instanceof HTMLElement?new n({container:t}):new n(t);return r!=null&&i.fromJSON(r),i}n.render=e})(wt||(wt={})),(function(n){n.registerNode=ut.registry.register,n.registerEdge=tt.registry.register,n.registerView=it.registry.register,n.registerAttr=sr.registry.register,n.registerGrid=zr.registry.register,n.registerFilter=Zn.registry.register,n.registerNodeTool=ni.registry.register,n.registerEdgeTool=ii.registry.register,n.registerBackground=Yi.registry.register,n.registerHighlighter=Er.registry.register,n.registerPortLayout=bn.registry.register,n.registerPortLabelLayout=ti.registry.register,n.registerMarker=Gr.registry.register,n.registerRouter=Xr.registry.register,n.registerConnector=vn.registry.register,n.registerAnchor=si.registry.register,n.registerEdgeAnchor=oi.registry.register,n.registerConnectionPoint=ai.registry.register})(wt||(wt={})),(function(n){n.unregisterNode=ut.registry.unregister,n.unregisterEdge=tt.registry.unregister,n.unregisterView=it.registry.unregister,n.unregisterAttr=sr.registry.unregister,n.unregisterGrid=zr.registry.unregister,n.unregisterFilter=Zn.registry.unregister,n.unregisterNodeTool=ni.registry.unregister,n.unregisterEdgeTool=ii.registry.unregister,n.unregisterBackground=Yi.registry.unregister,n.unregisterHighlighter=Er.registry.unregister,n.unregisterPortLayout=bn.registry.unregister,n.unregisterPortLabelLayout=ti.registry.unregister,n.unregisterMarker=Gr.registry.unregister,n.unregisterRouter=Xr.registry.unregister,n.unregisterConnector=vn.registry.unregister,n.unregisterAnchor=si.registry.unregister,n.unregisterEdgeAnchor=oi.registry.unregister,n.unregisterConnectionPoint=ai.registry.unregister})(wt||(wt={}));var iq=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},sq=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};class fi extends ut{}(function(n){class e extends Xt{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:r}){const i=n.shapeMaps[this.cell.shape];if(i){const{effect:s}=i;(!s||s.includes(r))&&this.renderHTMLComponent()}}confirmUpdate(r){const i=super.confirmUpdate(r);return this.handleAction(i,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const r=this.selectors&&this.selectors.foContent;if(r){Di(r);const i=n.shapeMaps[this.cell.shape];if(!i)return;let{html:s}=i;typeof s=="function"&&(s=s(this.cell)),s&&(typeof s=="string"?r.innerHTML=s:Bi(r,s))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}iq([e.dispose()],e.prototype,"dispose",null),n.View=e,(function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),Xt.registry.register("html-view",t,!0)})(e=n.View||(n.View={}))})(fi||(fi={})),(function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Ye.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),ut.registry.register("html",n,!0)})(fi||(fi={})),(function(n){n.shapeMaps={};function e(t){const{shape:r,html:i,effect:s,inherit:o}=t,a=sq(t,["shape","html","effect","inherit"]);if(!r)throw new Error("should specify shape in config");n.shapeMaps[r]={html:i,effect:s},wt.registerNode(r,Object.assign({inherit:o||"html"},a),!0)}n.register=e})(fi||(fi={}));var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oq(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $l(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ul,L0;function aq(){if(L0)return Ul;L0=1;function n(){this.__data__=[],this.size=0}return Ul=n,Ul}var zl,D0;function di(){if(D0)return zl;D0=1;function n(e,t){return e===t||e!==e&&t!==t}return zl=n,zl}var Vl,B0;function xo(){if(B0)return Vl;B0=1;var n=di();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return Vl=e,Vl}var Wl,q0;function lq(){if(q0)return Wl;q0=1;var n=xo(),e=Array.prototype,t=e.splice;function r(i){var s=this.__data__,o=n(s,i);if(o<0)return!1;var a=s.length-1;return o==a?s.pop():t.call(s,o,1),--this.size,!0}return Wl=r,Wl}var Gl,F0;function uq(){if(F0)return Gl;F0=1;var n=xo();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return Gl=e,Gl}var Hl,$0;function cq(){if($0)return Hl;$0=1;var n=xo();function e(t){return n(this.__data__,t)>-1}return Hl=e,Hl}var Kl,U0;function hq(){if(U0)return Kl;U0=1;var n=xo();function e(t,r){var i=this.__data__,s=n(i,t);return s<0?(++this.size,i.push([t,r])):i[s][1]=r,this}return Kl=e,Kl}var Yl,z0;function Eo(){if(z0)return Yl;z0=1;var n=aq(),e=lq(),t=uq(),r=cq(),i=hq();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,Yl=s,Yl}var Jl,V0;function fq(){if(V0)return Jl;V0=1;var n=Eo();function e(){this.__data__=new n,this.size=0}return Jl=e,Jl}var Xl,W0;function dq(){if(W0)return Xl;W0=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return Xl=n,Xl}var Ql,G0;function pq(){if(G0)return Ql;G0=1;function n(e){return this.__data__.get(e)}return Ql=n,Ql}var Zl,H0;function gq(){if(H0)return Zl;H0=1;function n(e){return this.__data__.has(e)}return Zl=n,Zl}var eu,K0;function Y0(){if(K0)return eu;K0=1;var n=typeof _o=="object"&&_o&&_o.Object===Object&&_o;return eu=n,eu}var tu,J0;function Qt(){if(J0)return tu;J0=1;var n=Y0(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return tu=t,tu}var ru,X0;function pi(){if(X0)return ru;X0=1;var n=Qt(),e=n.Symbol;return ru=e,ru}var nu,Q0;function mq(){if(Q0)return nu;Q0=1;var n=pi(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function s(o){var a=t.call(o,i),l=o[i];try{o[i]=void 0;var u=!0}catch{}var c=r.call(o);return u&&(a?o[i]=l:delete o[i]),c}return nu=s,nu}var iu,Z0;function yq(){if(Z0)return iu;Z0=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return iu=t,iu}var su,ew;function wn(){if(ew)return su;ew=1;var n=pi(),e=mq(),t=yq(),r="[object Null]",i="[object Undefined]",s=n?n.toStringTag:void 0;function o(a){return a==null?a===void 0?i:r:s&&s in Object(a)?e(a):t(a)}return su=o,su}var ou,tw;function $t(){if(tw)return ou;tw=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ou=n,ou}var au,rw;function ss(){if(rw)return au;rw=1;var n=wn(),e=$t(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function o(a){if(!e(a))return!1;var l=n(a);return l==r||l==i||l==t||l==s}return au=o,au}var lu,nw;function bq(){if(nw)return lu;nw=1;var n=Qt(),e=n["__core-js_shared__"];return lu=e,lu}var uu,iw;function vq(){if(iw)return uu;iw=1;var n=bq(),e=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function t(r){return!!e&&e in r}return uu=t,uu}var cu,sw;function ow(){if(sw)return cu;sw=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return cu=t,cu}var hu,aw;function wq(){if(aw)return hu;aw=1;var n=ss(),e=vq(),t=$t(),r=ow(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,l=o.toString,u=a.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!t(f)||e(f))return!1;var d=n(f)?c:s;return d.test(r(f))}return hu=h,hu}var fu,lw;function _q(){if(lw)return fu;lw=1;function n(e,t){return e?.[t]}return fu=n,fu}var du,uw;function _n(){if(uw)return du;uw=1;var n=wq(),e=_q();function t(r,i){var s=e(r,i);return n(s)?s:void 0}return du=t,du}var pu,cw;function gu(){if(cw)return pu;cw=1;var n=_n(),e=Qt(),t=n(e,"Map");return pu=t,pu}var mu,hw;function So(){if(hw)return mu;hw=1;var n=_n(),e=n(Object,"create");return mu=e,mu}var yu,fw;function xq(){if(fw)return yu;fw=1;var n=So();function e(){this.__data__=n?n(null):{},this.size=0}return yu=e,yu}var bu,dw;function Eq(){if(dw)return bu;dw=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return bu=n,bu}var vu,pw;function Sq(){if(pw)return vu;pw=1;var n=So(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(s){var o=this.__data__;if(n){var a=o[s];return a===e?void 0:a}return r.call(o,s)?o[s]:void 0}return vu=i,vu}var wu,gw;function Aq(){if(gw)return wu;gw=1;var n=So(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var s=this.__data__;return n?s[i]!==void 0:t.call(s,i)}return wu=r,wu}var _u,mw;function Pq(){if(mw)return _u;mw=1;var n=So(),e="__lodash_hash_undefined__";function t(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=n&&i===void 0?e:i,this}return _u=t,_u}var xu,yw;function Oq(){if(yw)return xu;yw=1;var n=xq(),e=Eq(),t=Sq(),r=Aq(),i=Pq();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,xu=s,xu}var Eu,bw;function Cq(){if(bw)return Eu;bw=1;var n=Oq(),e=Eo(),t=gu();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return Eu=r,Eu}var Su,vw;function Tq(){if(vw)return Su;vw=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Su=n,Su}var Au,ww;function Ao(){if(ww)return Au;ww=1;var n=Tq();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Au=e,Au}var Pu,_w;function Mq(){if(_w)return Pu;_w=1;var n=Ao();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return Pu=e,Pu}var Ou,xw;function Iq(){if(xw)return Ou;xw=1;var n=Ao();function e(t){return n(this,t).get(t)}return Ou=e,Ou}var Cu,Ew;function Rq(){if(Ew)return Cu;Ew=1;var n=Ao();function e(t){return n(this,t).has(t)}return Cu=e,Cu}var Tu,Sw;function kq(){if(Sw)return Tu;Sw=1;var n=Ao();function e(t,r){var i=n(this,t),s=i.size;return i.set(t,r),this.size+=i.size==s?0:1,this}return Tu=e,Tu}var Mu,Aw;function Iu(){if(Aw)return Mu;Aw=1;var n=Cq(),e=Mq(),t=Iq(),r=Rq(),i=kq();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=n,s.prototype.delete=e,s.prototype.get=t,s.prototype.has=r,s.prototype.set=i,Mu=s,Mu}var Ru,Pw;function Nq(){if(Pw)return Ru;Pw=1;var n=Eo(),e=gu(),t=Iu(),r=200;function i(s,o){var a=this.__data__;if(a instanceof n){var l=a.__data__;if(!e||l.length<r-1)return l.push([s,o]),this.size=++a.size,this;a=this.__data__=new t(l)}return a.set(s,o),this.size=a.size,this}return Ru=i,Ru}var ku,Ow;function Po(){if(Ow)return ku;Ow=1;var n=Eo(),e=fq(),t=dq(),r=pq(),i=gq(),s=Nq();function o(a){var l=this.__data__=new n(a);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,ku=o,ku}var Nu,Cw;function ju(){if(Cw)return Nu;Cw=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}return Nu=n,Nu}var Lu,Tw;function Mw(){if(Tw)return Lu;Tw=1;var n=_n(),e=(function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Lu=e,Lu}var Du,Iw;function Oo(){if(Iw)return Du;Iw=1;var n=Mw();function e(t,r,i){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}return Du=e,Du}var Bu,Rw;function Co(){if(Rw)return Bu;Rw=1;var n=Oo(),e=di(),t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a){var l=s[o];(!(r.call(s,o)&&e(l,a))||a===void 0&&!(o in s))&&n(s,o,a)}return Bu=i,Bu}var qu,kw;function os(){if(kw)return qu;kw=1;var n=Co(),e=Oo();function t(r,i,s,o){var a=!s;s||(s={});for(var l=-1,u=i.length;++l<u;){var c=i[l],h=o?o(s[c],r[c],c,s,r):void 0;h===void 0&&(h=r[c]),a?e(s,c,h):n(s,c,h)}return s}return qu=t,qu}var Fu,Nw;function jq(){if(Nw)return Fu;Nw=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return Fu=n,Fu}var $u,jw;function ar(){if(jw)return $u;jw=1;function n(e){return e!=null&&typeof e=="object"}return $u=n,$u}var Uu,Lw;function Lq(){if(Lw)return Uu;Lw=1;var n=wn(),e=ar(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return Uu=r,Uu}var zu,Dw;function as(){if(Dw)return zu;Dw=1;var n=Lq(),e=ar(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,s=n((function(){return arguments})())?n:function(o){return e(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return zu=s,zu}var Vu,Bw;function lt(){if(Bw)return Vu;Bw=1;var n=Array.isArray;return Vu=n,Vu}var ls={exports:{}},Wu,qw;function Dq(){if(qw)return Wu;qw=1;function n(){return!1}return Wu=n,Wu}ls.exports;var Fw;function gi(){return Fw||(Fw=1,(function(n,e){var t=Qt(),r=Dq(),i=e&&!e.nodeType&&e,s=i&&!0&&n&&!n.nodeType&&n,o=s&&s.exports===i,a=o?t.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;n.exports=u})(ls,ls.exports)),ls.exports}var Gu,$w;function To(){if($w)return Gu;$w=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var s=typeof r;return i=i??n,!!i&&(s=="number"||s!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Gu=t,Gu}var Hu,Uw;function Ku(){if(Uw)return Hu;Uw=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return Hu=e,Hu}var Yu,zw;function Bq(){if(zw)return Yu;zw=1;var n=wn(),e=Ku(),t=ar(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",o="[object Date]",a="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",h="[object Object]",f="[object RegExp]",d="[object Set]",p="[object String]",g="[object WeakMap]",m="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",E="[object Uint8Array]",A="[object Uint8ClampedArray]",O="[object Uint16Array]",T="[object Uint32Array]",M={};M[y]=M[b]=M[_]=M[w]=M[x]=M[E]=M[A]=M[O]=M[T]=!0,M[r]=M[i]=M[m]=M[s]=M[v]=M[o]=M[a]=M[l]=M[u]=M[c]=M[h]=M[f]=M[d]=M[p]=M[g]=!1;function C(k){return t(k)&&e(k.length)&&!!M[n(k)]}return Yu=C,Yu}var Ju,Vw;function Mo(){if(Vw)return Ju;Vw=1;function n(e){return function(t){return e(t)}}return Ju=n,Ju}var us={exports:{}};us.exports;var Ww;function Xu(){return Ww||(Ww=1,(function(n,e){var t=Y0(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s&&t.process,a=(function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();n.exports=a})(us,us.exports)),us.exports}var Qu,Gw;function cs(){if(Gw)return Qu;Gw=1;var n=Bq(),e=Mo(),t=Xu(),r=t&&t.isTypedArray,i=r?e(r):n;return Qu=i,Qu}var Zu,Hw;function Kw(){if(Hw)return Zu;Hw=1;var n=jq(),e=as(),t=lt(),r=gi(),i=To(),s=cs(),o=Object.prototype,a=o.hasOwnProperty;function l(u,c){var h=t(u),f=!h&&e(u),d=!h&&!f&&r(u),p=!h&&!f&&!d&&s(u),g=h||f||d||p,m=g?n(u.length,String):[],v=m.length;for(var y in u)(c||a.call(u,y))&&!(g&&(y=="length"||d&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&m.push(y);return m}return Zu=l,Zu}var ec,Yw;function Io(){if(Yw)return ec;Yw=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return ec=e,ec}var tc,Jw;function Xw(){if(Jw)return tc;Jw=1;function n(e,t){return function(r){return e(t(r))}}return tc=n,tc}var rc,Qw;function qq(){if(Qw)return rc;Qw=1;var n=Xw(),e=n(Object.keys,Object);return rc=e,rc}var nc,Zw;function ic(){if(Zw)return nc;Zw=1;var n=Io(),e=qq(),t=Object.prototype,r=t.hasOwnProperty;function i(s){if(!n(s))return e(s);var o=[];for(var a in Object(s))r.call(s,a)&&a!="constructor"&&o.push(a);return o}return nc=i,nc}var sc,e1;function Or(){if(e1)return sc;e1=1;var n=ss(),e=Ku();function t(r){return r!=null&&e(r.length)&&!n(r)}return sc=t,sc}var oc,t1;function Zr(){if(t1)return oc;t1=1;var n=Kw(),e=ic(),t=Or();function r(i){return t(i)?n(i):e(i)}return oc=r,oc}var ac,r1;function Fq(){if(r1)return ac;r1=1;var n=os(),e=Zr();function t(r,i){return r&&n(i,e(i),r)}return ac=t,ac}var lc,n1;function $q(){if(n1)return lc;n1=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return lc=n,lc}var uc,i1;function Uq(){if(i1)return uc;i1=1;var n=$t(),e=Io(),t=$q(),r=Object.prototype,i=r.hasOwnProperty;function s(o){if(!n(o))return t(o);var a=e(o),l=[];for(var u in o)u=="constructor"&&(a||!i.call(o,u))||l.push(u);return l}return uc=s,uc}var cc,s1;function xn(){if(s1)return cc;s1=1;var n=Kw(),e=Uq(),t=Or();function r(i){return t(i)?n(i,!0):e(i)}return cc=r,cc}var hc,o1;function zq(){if(o1)return hc;o1=1;var n=os(),e=xn();function t(r,i){return r&&n(i,e(i),r)}return hc=t,hc}var hs={exports:{}};hs.exports;var a1;function l1(){return a1||(a1=1,(function(n,e){var t=Qt(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,s=i&&i.exports===r,o=s?t.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var h=u.length,f=a?a(h):new u.constructor(h);return u.copy(f),f}n.exports=l})(hs,hs.exports)),hs.exports}var fc,u1;function c1(){if(u1)return fc;u1=1;function n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}return fc=n,fc}var dc,h1;function f1(){if(h1)return dc;h1=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=0,o=[];++r<i;){var a=e[r];t(a,r,e)&&(o[s++]=a)}return o}return dc=n,dc}var pc,d1;function p1(){if(d1)return pc;d1=1;function n(){return[]}return pc=n,pc}var gc,g1;function mc(){if(g1)return gc;g1=1;var n=f1(),e=p1(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(o){return o==null?[]:(o=Object(o),n(i(o),function(a){return r.call(o,a)}))}:e;return gc=s,gc}var yc,m1;function Vq(){if(m1)return yc;m1=1;var n=os(),e=mc();function t(r,i){return n(r,e(r),i)}return yc=t,yc}var bc,y1;function vc(){if(y1)return bc;y1=1;function n(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}return bc=n,bc}var wc,b1;function Ro(){if(b1)return wc;b1=1;var n=Xw(),e=n(Object.getPrototypeOf,Object);return wc=e,wc}var _c,v1;function w1(){if(v1)return _c;v1=1;var n=vc(),e=Ro(),t=mc(),r=p1(),i=Object.getOwnPropertySymbols,s=i?function(o){for(var a=[];o;)n(a,t(o)),o=e(o);return a}:r;return _c=s,_c}var xc,_1;function Wq(){if(_1)return xc;_1=1;var n=os(),e=w1();function t(r,i){return n(r,e(r),i)}return xc=t,xc}var Ec,x1;function E1(){if(x1)return Ec;x1=1;var n=vc(),e=lt();function t(r,i,s){var o=i(r);return e(r)?o:n(o,s(r))}return Ec=t,Ec}var Sc,S1;function A1(){if(S1)return Sc;S1=1;var n=E1(),e=mc(),t=Zr();function r(i){return n(i,t,e)}return Sc=r,Sc}var Ac,P1;function Gq(){if(P1)return Ac;P1=1;var n=E1(),e=w1(),t=xn();function r(i){return n(i,t,e)}return Ac=r,Ac}var Pc,O1;function Hq(){if(O1)return Pc;O1=1;var n=_n(),e=Qt(),t=n(e,"DataView");return Pc=t,Pc}var Oc,C1;function Kq(){if(C1)return Oc;C1=1;var n=_n(),e=Qt(),t=n(e,"Promise");return Oc=t,Oc}var Cc,T1;function M1(){if(T1)return Cc;T1=1;var n=_n(),e=Qt(),t=n(e,"Set");return Cc=t,Cc}var Tc,I1;function Yq(){if(I1)return Tc;I1=1;var n=_n(),e=Qt(),t=n(e,"WeakMap");return Tc=t,Tc}var Mc,R1;function mi(){if(R1)return Mc;R1=1;var n=Hq(),e=gu(),t=Kq(),r=M1(),i=Yq(),s=wn(),o=ow(),a="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",h="[object WeakMap]",f="[object DataView]",d=o(n),p=o(e),g=o(t),m=o(r),v=o(i),y=s;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=u||r&&y(new r)!=c||i&&y(new i)!=h)&&(y=function(b){var _=s(b),w=_==l?b.constructor:void 0,x=w?o(w):"";if(x)switch(x){case d:return f;case p:return a;case g:return u;case m:return c;case v:return h}return _}),Mc=y,Mc}var Ic,k1;function Jq(){if(k1)return Ic;k1=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var i=r.length,s=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(s.index=r.index,s.input=r.input),s}return Ic=t,Ic}var Rc,N1;function j1(){if(N1)return Rc;N1=1;var n=Qt(),e=n.Uint8Array;return Rc=e,Rc}var kc,L1;function Nc(){if(L1)return kc;L1=1;var n=j1();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return kc=e,kc}var jc,D1;function Xq(){if(D1)return jc;D1=1;var n=Nc();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return jc=e,jc}var Lc,B1;function Qq(){if(B1)return Lc;B1=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return Lc=e,Lc}var Dc,q1;function Zq(){if(q1)return Dc;q1=1;var n=pi(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(i){return t?Object(t.call(i)):{}}return Dc=r,Dc}var Bc,F1;function $1(){if(F1)return Bc;F1=1;var n=Nc();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return Bc=e,Bc}var qc,U1;function eF(){if(U1)return qc;U1=1;var n=Nc(),e=Xq(),t=Qq(),r=Zq(),i=$1(),s="[object Boolean]",o="[object Date]",a="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",h="[object String]",f="[object Symbol]",d="[object ArrayBuffer]",p="[object DataView]",g="[object Float32Array]",m="[object Float64Array]",v="[object Int8Array]",y="[object Int16Array]",b="[object Int32Array]",_="[object Uint8Array]",w="[object Uint8ClampedArray]",x="[object Uint16Array]",E="[object Uint32Array]";function A(O,T,M){var C=O.constructor;switch(T){case d:return n(O);case s:case o:return new C(+O);case p:return e(O,M);case g:case m:case v:case y:case b:case _:case w:case x:case E:return i(O,M);case a:return new C;case l:case h:return new C(O);case u:return t(O);case c:return new C;case f:return r(O)}}return qc=A,qc}var Fc,z1;function V1(){if(z1)return Fc;z1=1;var n=$t(),e=Object.create,t=(function(){function r(){}return function(i){if(!n(i))return{};if(e)return e(i);r.prototype=i;var s=new r;return r.prototype=void 0,s}})();return Fc=t,Fc}var $c,W1;function G1(){if(W1)return $c;W1=1;var n=V1(),e=Ro(),t=Io();function r(i){return typeof i.constructor=="function"&&!t(i)?n(e(i)):{}}return $c=r,$c}var Uc,H1;function tF(){if(H1)return Uc;H1=1;var n=mi(),e=ar(),t="[object Map]";function r(i){return e(i)&&n(i)==t}return Uc=r,Uc}var zc,K1;function rF(){if(K1)return zc;K1=1;var n=tF(),e=Mo(),t=Xu(),r=t&&t.isMap,i=r?e(r):n;return zc=i,zc}var Vc,Y1;function nF(){if(Y1)return Vc;Y1=1;var n=mi(),e=ar(),t="[object Set]";function r(i){return e(i)&&n(i)==t}return Vc=r,Vc}var Wc,J1;function iF(){if(J1)return Wc;J1=1;var n=nF(),e=Mo(),t=Xu(),r=t&&t.isSet,i=r?e(r):n;return Wc=i,Wc}var Gc,X1;function Q1(){if(X1)return Gc;X1=1;var n=Po(),e=ju(),t=Co(),r=Fq(),i=zq(),s=l1(),o=c1(),a=Vq(),l=Wq(),u=A1(),c=Gq(),h=mi(),f=Jq(),d=eF(),p=G1(),g=lt(),m=gi(),v=rF(),y=$t(),b=iF(),_=Zr(),w=xn(),x=1,E=2,A=4,O="[object Arguments]",T="[object Array]",M="[object Boolean]",C="[object Date]",k="[object Error]",N="[object Function]",R="[object GeneratorFunction]",$="[object Map]",G="[object Number]",H="[object Object]",se="[object RegExp]",V="[object Set]",te="[object String]",B="[object Symbol]",ne="[object WeakMap]",U="[object ArrayBuffer]",q="[object DataView]",re="[object Float32Array]",F="[object Float64Array]",D="[object Int8Array]",ae="[object Int16Array]",Y="[object Int32Array]",Q="[object Uint8Array]",ie="[object Uint8ClampedArray]",ye="[object Uint16Array]",ue="[object Uint32Array]",L={};L[O]=L[T]=L[U]=L[q]=L[M]=L[C]=L[re]=L[F]=L[D]=L[ae]=L[Y]=L[$]=L[G]=L[H]=L[se]=L[V]=L[te]=L[B]=L[Q]=L[ie]=L[ye]=L[ue]=!0,L[k]=L[N]=L[ne]=!1;function J(ee,he,fe,we,X,be){var _e,ce=he&x,Re=he&E,S=he&A;if(fe&&(_e=X?fe(ee,we,X,be):fe(ee)),_e!==void 0)return _e;if(!y(ee))return ee;var P=g(ee);if(P){if(_e=f(ee),!ce)return o(ee,_e)}else{var I=h(ee),K=I==N||I==R;if(m(ee))return s(ee,ce);if(I==H||I==O||K&&!X){if(_e=Re||K?{}:p(ee),!ce)return Re?l(ee,i(_e,ee)):a(ee,r(_e,ee))}else{if(!L[I])return X?ee:{};_e=d(ee,I,ce)}}be||(be=new n);var oe=be.get(ee);if(oe)return oe;be.set(ee,_e),b(ee)?ee.forEach(function(Z){_e.add(J(Z,he,fe,Z,ee,be))}):v(ee)&&ee.forEach(function(Z,le){_e.set(le,J(Z,he,fe,le,ee,be))});var de=S?Re?c:u:Re?w:_,xe=P?void 0:de(ee);return e(xe||ee,function(Z,le){xe&&(le=Z,Z=ee[le]),t(_e,le,J(Z,he,fe,le,ee,be))}),_e}return Gc=J,Gc}var Hc,Z1;function sF(){if(Z1)return Hc;Z1=1;var n=Q1(),e=4;function t(r){return n(r,e)}return Hc=t,Hc}var Kc,e_;function Yc(){if(e_)return Kc;e_=1;function n(e){return function(){return e}}return Kc=n,Kc}var Jc,t_;function oF(){if(t_)return Jc;t_=1;function n(e){return function(t,r,i){for(var s=-1,o=Object(t),a=i(t),l=a.length;l--;){var u=a[e?l:++s];if(r(o[u],u,o)===!1)break}return t}}return Jc=n,Jc}var Xc,r_;function Qc(){if(r_)return Xc;r_=1;var n=oF(),e=n();return Xc=e,Xc}var Zc,n_;function eh(){if(n_)return Zc;n_=1;var n=Qc(),e=Zr();function t(r,i){return r&&n(r,i,e)}return Zc=t,Zc}var th,i_;function aF(){if(i_)return th;i_=1;var n=Or();function e(t,r){return function(i,s){if(i==null)return i;if(!n(i))return t(i,s);for(var o=i.length,a=r?o:-1,l=Object(i);(r?a--:++a<o)&&s(l[a],a,l)!==!1;);return i}}return th=e,th}var rh,s_;function ko(){if(s_)return rh;s_=1;var n=eh(),e=aF(),t=e(n);return rh=t,rh}var nh,o_;function En(){if(o_)return nh;o_=1;function n(e){return e}return nh=n,nh}var ih,a_;function l_(){if(a_)return ih;a_=1;var n=En();function e(t){return typeof t=="function"?t:n}return ih=e,ih}var sh,u_;function c_(){if(u_)return sh;u_=1;var n=ju(),e=ko(),t=l_(),r=lt();function i(s,o){var a=r(s)?n:e;return a(s,t(o))}return sh=i,sh}var oh,h_;function f_(){return h_||(h_=1,oh=c_()),oh}var ah,d_;function lF(){if(d_)return ah;d_=1;var n=ko();function e(t,r){var i=[];return n(t,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return ah=e,ah}var lh,p_;function uF(){if(p_)return lh;p_=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return lh=e,lh}var uh,g_;function cF(){if(g_)return uh;g_=1;function n(e){return this.__data__.has(e)}return uh=n,uh}var ch,m_;function y_(){if(m_)return ch;m_=1;var n=Iu(),e=uF(),t=cF();function r(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new n;++s<o;)this.add(i[s])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,ch=r,ch}var hh,b_;function hF(){if(b_)return hh;b_=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return hh=n,hh}var fh,v_;function w_(){if(v_)return fh;v_=1;function n(e,t){return e.has(t)}return fh=n,fh}var dh,__;function x_(){if(__)return dh;__=1;var n=y_(),e=hF(),t=w_(),r=1,i=2;function s(o,a,l,u,c,h){var f=l&r,d=o.length,p=a.length;if(d!=p&&!(f&&p>d))return!1;var g=h.get(o),m=h.get(a);if(g&&m)return g==a&&m==o;var v=-1,y=!0,b=l&i?new n:void 0;for(h.set(o,a),h.set(a,o);++v<d;){var _=o[v],w=a[v];if(u)var x=f?u(w,_,v,a,o,h):u(_,w,v,o,a,h);if(x!==void 0){if(x)continue;y=!1;break}if(b){if(!e(a,function(E,A){if(!t(b,A)&&(_===E||c(_,E,l,u,h)))return b.push(A)})){y=!1;break}}else if(!(_===w||c(_,w,l,u,h))){y=!1;break}}return h.delete(o),h.delete(a),y}return dh=s,dh}var ph,E_;function fF(){if(E_)return ph;E_=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,s){r[++t]=[s,i]}),r}return ph=n,ph}var gh,S_;function mh(){if(S_)return gh;S_=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return gh=n,gh}var yh,A_;function dF(){if(A_)return yh;A_=1;var n=pi(),e=j1(),t=di(),r=x_(),i=fF(),s=mh(),o=1,a=2,l="[object Boolean]",u="[object Date]",c="[object Error]",h="[object Map]",f="[object Number]",d="[object RegExp]",p="[object Set]",g="[object String]",m="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",b=n?n.prototype:void 0,_=b?b.valueOf:void 0;function w(x,E,A,O,T,M,C){switch(A){case y:if(x.byteLength!=E.byteLength||x.byteOffset!=E.byteOffset)return!1;x=x.buffer,E=E.buffer;case v:return!(x.byteLength!=E.byteLength||!M(new e(x),new e(E)));case l:case u:case f:return t(+x,+E);case c:return x.name==E.name&&x.message==E.message;case d:case g:return x==E+"";case h:var k=i;case p:var N=O&o;if(k||(k=s),x.size!=E.size&&!N)return!1;var R=C.get(x);if(R)return R==E;O|=a,C.set(x,E);var $=r(k(x),k(E),O,T,M,C);return C.delete(x),$;case m:if(_)return _.call(x)==_.call(E)}return!1}return yh=w,yh}var bh,P_;function pF(){if(P_)return bh;P_=1;var n=A1(),e=1,t=Object.prototype,r=t.hasOwnProperty;function i(s,o,a,l,u,c){var h=a&e,f=n(s),d=f.length,p=n(o),g=p.length;if(d!=g&&!h)return!1;for(var m=d;m--;){var v=f[m];if(!(h?v in o:r.call(o,v)))return!1}var y=c.get(s),b=c.get(o);if(y&&b)return y==o&&b==s;var _=!0;c.set(s,o),c.set(o,s);for(var w=h;++m<d;){v=f[m];var x=s[v],E=o[v];if(l)var A=h?l(E,x,v,o,s,c):l(x,E,v,s,o,c);if(!(A===void 0?x===E||u(x,E,a,l,c):A)){_=!1;break}w||(w=v=="constructor")}if(_&&!w){var O=s.constructor,T=o.constructor;O!=T&&"constructor"in s&&"constructor"in o&&!(typeof O=="function"&&O instanceof O&&typeof T=="function"&&T instanceof T)&&(_=!1)}return c.delete(s),c.delete(o),_}return bh=i,bh}var vh,O_;function gF(){if(O_)return vh;O_=1;var n=Po(),e=x_(),t=dF(),r=pF(),i=mi(),s=lt(),o=gi(),a=cs(),l=1,u="[object Arguments]",c="[object Array]",h="[object Object]",f=Object.prototype,d=f.hasOwnProperty;function p(g,m,v,y,b,_){var w=s(g),x=s(m),E=w?c:i(g),A=x?c:i(m);E=E==u?h:E,A=A==u?h:A;var O=E==h,T=A==h,M=E==A;if(M&&o(g)){if(!o(m))return!1;w=!0,O=!1}if(M&&!O)return _||(_=new n),w||a(g)?e(g,m,v,y,b,_):t(g,m,E,v,y,b,_);if(!(v&l)){var C=O&&d.call(g,"__wrapped__"),k=T&&d.call(m,"__wrapped__");if(C||k){var N=C?g.value():g,R=k?m.value():m;return _||(_=new n),b(N,R,v,y,_)}}return M?(_||(_=new n),r(g,m,v,y,b,_)):!1}return vh=p,vh}var wh,C_;function T_(){if(C_)return wh;C_=1;var n=gF(),e=ar();function t(r,i,s,o,a){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,s,o,t,a)}return wh=t,wh}var _h,M_;function mF(){if(M_)return _h;M_=1;var n=Po(),e=T_(),t=1,r=2;function i(s,o,a,l){var u=a.length,c=u,h=!l;if(s==null)return!c;for(s=Object(s);u--;){var f=a[u];if(h&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++u<c;){f=a[u];var d=f[0],p=s[d],g=f[1];if(h&&f[2]){if(p===void 0&&!(d in s))return!1}else{var m=new n;if(l)var v=l(p,g,d,s,o,m);if(!(v===void 0?e(g,p,t|r,l,m):v))return!1}}return!0}return _h=i,_h}var xh,I_;function R_(){if(I_)return xh;I_=1;var n=$t();function e(t){return t===t&&!n(t)}return xh=e,xh}var Eh,k_;function yF(){if(k_)return Eh;k_=1;var n=R_(),e=Zr();function t(r){for(var i=e(r),s=i.length;s--;){var o=i[s],a=r[o];i[s]=[o,a,n(a)]}return i}return Eh=t,Eh}var Sh,N_;function j_(){if(N_)return Sh;N_=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return Sh=n,Sh}var Ah,L_;function bF(){if(L_)return Ah;L_=1;var n=mF(),e=yF(),t=j_();function r(i){var s=e(i);return s.length==1&&s[0][2]?t(s[0][0],s[0][1]):function(o){return o===i||n(o,i,s)}}return Ah=r,Ah}var Ph,D_;function yi(){if(D_)return Ph;D_=1;var n=wn(),e=ar(),t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return Ph=r,Ph}var Oh,B_;function Ch(){if(B_)return Oh;B_=1;var n=lt(),e=yi(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){if(n(s))return!1;var a=typeof s;return a=="number"||a=="symbol"||a=="boolean"||s==null||e(s)?!0:r.test(s)||!t.test(s)||o!=null&&s in Object(o)}return Oh=i,Oh}var Th,q_;function vF(){if(q_)return Th;q_=1;var n=Iu(),e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var o=arguments,a=i?i.apply(this,o):o[0],l=s.cache;if(l.has(a))return l.get(a);var u=r.apply(this,o);return s.cache=l.set(a,u)||l,u};return s.cache=new(t.Cache||n),s}return t.Cache=n,Th=t,Th}var Mh,F_;function wF(){if(F_)return Mh;F_=1;var n=vF(),e=500;function t(r){var i=n(r,function(o){return s.size===e&&s.clear(),o}),s=i.cache;return i}return Mh=t,Mh}var Ih,$_;function _F(){if($_)return Ih;$_=1;var n=wF(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(o,a,l,u){s.push(l?u.replace(t,"$1"):a||o)}),s});return Ih=r,Ih}var Rh,U_;function No(){if(U_)return Rh;U_=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}return Rh=n,Rh}var kh,z_;function xF(){if(z_)return kh;z_=1;var n=pi(),e=No(),t=lt(),r=yi(),i=n?n.prototype:void 0,s=i?i.toString:void 0;function o(a){if(typeof a=="string")return a;if(t(a))return e(a,o)+"";if(r(a))return s?s.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return kh=o,kh}var Nh,V_;function W_(){if(V_)return Nh;V_=1;var n=xF();function e(t){return t==null?"":n(t)}return Nh=e,Nh}var jh,G_;function jo(){if(G_)return jh;G_=1;var n=lt(),e=Ch(),t=_F(),r=W_();function i(s,o){return n(s)?s:e(s,o)?[s]:t(r(s))}return jh=i,jh}var Lh,H_;function fs(){if(H_)return Lh;H_=1;var n=yi();function e(t){if(typeof t=="string"||n(t))return t;var r=t+"";return r=="0"&&1/t==-1/0?"-0":r}return Lh=e,Lh}var Dh,K_;function Lo(){if(K_)return Dh;K_=1;var n=jo(),e=fs();function t(r,i){i=n(i,r);for(var s=0,o=i.length;r!=null&&s<o;)r=r[e(i[s++])];return s&&s==o?r:void 0}return Dh=t,Dh}var Bh,Y_;function EF(){if(Y_)return Bh;Y_=1;var n=Lo();function e(t,r,i){var s=t==null?void 0:n(t,r);return s===void 0?i:s}return Bh=e,Bh}var qh,J_;function SF(){if(J_)return qh;J_=1;function n(e,t){return e!=null&&t in Object(e)}return qh=n,qh}var Fh,X_;function Q_(){if(X_)return Fh;X_=1;var n=jo(),e=as(),t=lt(),r=To(),i=Ku(),s=fs();function o(a,l,u){l=n(l,a);for(var c=-1,h=l.length,f=!1;++c<h;){var d=s(l[c]);if(!(f=a!=null&&u(a,d)))break;a=a[d]}return f||++c!=h?f:(h=a==null?0:a.length,!!h&&i(h)&&r(d,h)&&(t(a)||e(a)))}return Fh=o,Fh}var $h,Z_;function ex(){if(Z_)return $h;Z_=1;var n=SF(),e=Q_();function t(r,i){return r!=null&&e(r,i,n)}return $h=t,$h}var Uh,tx;function AF(){if(tx)return Uh;tx=1;var n=T_(),e=EF(),t=ex(),r=Ch(),i=R_(),s=j_(),o=fs(),a=1,l=2;function u(c,h){return r(c)&&i(h)?s(o(c),h):function(f){var d=e(f,c);return d===void 0&&d===h?t(f,c):n(h,d,a|l)}}return Uh=u,Uh}var zh,rx;function nx(){if(rx)return zh;rx=1;function n(e){return function(t){return t?.[e]}}return zh=n,zh}var Vh,ix;function PF(){if(ix)return Vh;ix=1;var n=Lo();function e(t){return function(r){return n(r,t)}}return Vh=e,Vh}var Wh,sx;function OF(){if(sx)return Wh;sx=1;var n=nx(),e=PF(),t=Ch(),r=fs();function i(s){return t(s)?n(r(s)):e(s)}return Wh=i,Wh}var Gh,ox;function Cr(){if(ox)return Gh;ox=1;var n=bF(),e=AF(),t=En(),r=lt(),i=OF();function s(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?r(o)?e(o[0],o[1]):n(o):i(o)}return Gh=s,Gh}var Hh,ax;function lx(){if(ax)return Hh;ax=1;var n=f1(),e=lF(),t=Cr(),r=lt();function i(s,o){var a=r(s)?n:e;return a(s,t(o,3))}return Hh=i,Hh}var Kh,ux;function CF(){if(ux)return Kh;ux=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r,i){return r!=null&&e.call(r,i)}return Kh=t,Kh}var Yh,cx;function hx(){if(cx)return Yh;cx=1;var n=CF(),e=Q_();function t(r,i){return r!=null&&e(r,i,n)}return Yh=t,Yh}var Jh,fx;function TF(){if(fx)return Jh;fx=1;var n=ic(),e=mi(),t=as(),r=lt(),i=Or(),s=gi(),o=Io(),a=cs(),l="[object Map]",u="[object Set]",c=Object.prototype,h=c.hasOwnProperty;function f(d){if(d==null)return!0;if(i(d)&&(r(d)||typeof d=="string"||typeof d.splice=="function"||s(d)||a(d)||t(d)))return!d.length;var p=e(d);if(p==l||p==u)return!d.size;if(o(d))return!n(d).length;for(var g in d)if(h.call(d,g))return!1;return!0}return Jh=f,Jh}var Xh,dx;function px(){if(dx)return Xh;dx=1;function n(e){return e===void 0}return Xh=n,Xh}var Qh,gx;function mx(){if(gx)return Qh;gx=1;var n=ko(),e=Or();function t(r,i){var s=-1,o=e(r)?Array(r.length):[];return n(r,function(a,l,u){o[++s]=i(a,l,u)}),o}return Qh=t,Qh}var Zh,yx;function bx(){if(yx)return Zh;yx=1;var n=No(),e=Cr(),t=mx(),r=lt();function i(s,o){var a=r(s)?n:t;return a(s,e(o,3))}return Zh=i,Zh}var ef,vx;function MF(){if(vx)return ef;vx=1;function n(e,t,r,i){var s=-1,o=e==null?0:e.length;for(i&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}return ef=n,ef}var tf,_x;function IF(){if(_x)return tf;_x=1;function n(e,t,r,i,s){return s(e,function(o,a,l){r=i?(i=!1,o):t(r,o,a,l)}),r}return tf=n,tf}var rf,xx;function Ex(){if(xx)return rf;xx=1;var n=MF(),e=ko(),t=Cr(),r=IF(),i=lt();function s(o,a,l){var u=i(o)?n:r,c=arguments.length<3;return u(o,t(a,4),l,c,e)}return rf=s,rf}var nf,Sx;function RF(){if(Sx)return nf;Sx=1;var n=wn(),e=lt(),t=ar(),r="[object String]";function i(s){return typeof s=="string"||!e(s)&&t(s)&&n(s)==r}return nf=i,nf}var sf,Ax;function kF(){if(Ax)return sf;Ax=1;var n=nx(),e=n("length");return sf=e,sf}var of,Px;function NF(){if(Px)return of;Px=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="\\u200d",a=RegExp("["+o+n+i+s+"]");function l(u){return a.test(u)}return of=l,of}var af,Ox;function jF(){if(Ox)return af;Ox=1;var n="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=e+t+r,s="\\ufe0e\\ufe0f",o="["+n+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+a+"|"+l+")",c="[^"+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",p=u+"?",g="["+s+"]?",m="(?:"+d+"(?:"+[c,h,f].join("|")+")"+g+p+")*",v=g+p+m,y="(?:"+[c+a+"?",a,h,f,o].join("|")+")",b=RegExp(l+"(?="+l+")|"+y+v,"g");function _(w){for(var x=b.lastIndex=0;b.test(w);)++x;return x}return af=_,af}var lf,Cx;function LF(){if(Cx)return lf;Cx=1;var n=kF(),e=NF(),t=jF();function r(i){return e(i)?t(i):n(i)}return lf=r,lf}var uf,Tx;function DF(){if(Tx)return uf;Tx=1;var n=ic(),e=mi(),t=Or(),r=RF(),i=LF(),s="[object Map]",o="[object Set]";function a(l){if(l==null)return 0;if(t(l))return r(l)?i(l):l.length;var u=e(l);return u==s||u==o?l.size:n(l).length}return uf=a,uf}var cf,Mx;function BF(){if(Mx)return cf;Mx=1;var n=ju(),e=V1(),t=eh(),r=Cr(),i=Ro(),s=lt(),o=gi(),a=ss(),l=$t(),u=cs();function c(h,f,d){var p=s(h),g=p||o(h)||u(h);if(f=r(f,4),d==null){var m=h&&h.constructor;g?d=p?new m:[]:l(h)?d=a(m)?e(i(h)):{}:d={}}return(g?n:t)(h,function(v,y,b){return f(d,v,y,b)}),d}return cf=c,cf}var hf,Ix;function qF(){if(Ix)return hf;Ix=1;var n=pi(),e=as(),t=lt(),r=n?n.isConcatSpreadable:void 0;function i(s){return t(s)||e(s)||!!(r&&s&&s[r])}return hf=i,hf}var ff,Rx;function df(){if(Rx)return ff;Rx=1;var n=vc(),e=qF();function t(r,i,s,o,a){var l=-1,u=r.length;for(s||(s=e),a||(a=[]);++l<u;){var c=r[l];i>0&&s(c)?i>1?t(c,i-1,s,o,a):n(a,c):o||(a[a.length]=c)}return a}return ff=t,ff}var pf,kx;function FF(){if(kx)return pf;kx=1;function n(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return pf=n,pf}var gf,Nx;function jx(){if(Nx)return gf;Nx=1;var n=FF(),e=Math.max;function t(r,i,s){return i=e(i===void 0?r.length-1:i,0),function(){for(var o=arguments,a=-1,l=e(o.length-i,0),u=Array(l);++a<l;)u[a]=o[i+a];a=-1;for(var c=Array(i+1);++a<i;)c[a]=o[a];return c[i]=s(u),n(r,this,c)}}return gf=t,gf}var mf,Lx;function $F(){if(Lx)return mf;Lx=1;var n=Yc(),e=Mw(),t=En(),r=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:n(s),writable:!0})}:t;return mf=r,mf}var yf,Dx;function UF(){if(Dx)return yf;Dx=1;var n=800,e=16,t=Date.now;function r(i){var s=0,o=0;return function(){var a=t(),l=e-(a-o);if(o=a,l>0){if(++s>=n)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return yf=r,yf}var bf,Bx;function qx(){if(Bx)return bf;Bx=1;var n=$F(),e=UF(),t=e(n);return bf=t,bf}var vf,Fx;function Do(){if(Fx)return vf;Fx=1;var n=En(),e=jx(),t=qx();function r(i,s){return t(e(i,s,n),i+"")}return vf=r,vf}var wf,$x;function Ux(){if($x)return wf;$x=1;function n(e,t,r,i){for(var s=e.length,o=r+(i?1:-1);i?o--:++o<s;)if(t(e[o],o,e))return o;return-1}return wf=n,wf}var _f,zx;function zF(){if(zx)return _f;zx=1;function n(e){return e!==e}return _f=n,_f}var xf,Vx;function VF(){if(Vx)return xf;Vx=1;function n(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}return xf=n,xf}var Ef,Wx;function WF(){if(Wx)return Ef;Wx=1;var n=Ux(),e=zF(),t=VF();function r(i,s,o){return s===s?t(i,s,o):n(i,e,o)}return Ef=r,Ef}var Sf,Gx;function GF(){if(Gx)return Sf;Gx=1;var n=WF();function e(t,r){var i=t==null?0:t.length;return!!i&&n(t,r,0)>-1}return Sf=e,Sf}var Af,Hx;function HF(){if(Hx)return Af;Hx=1;function n(e,t,r){for(var i=-1,s=e==null?0:e.length;++i<s;)if(r(t,e[i]))return!0;return!1}return Af=n,Af}var Pf,Kx;function KF(){if(Kx)return Pf;Kx=1;function n(){}return Pf=n,Pf}var Of,Yx;function YF(){if(Yx)return Of;Yx=1;var n=M1(),e=KF(),t=mh(),r=1/0,i=n&&1/t(new n([,-0]))[1]==r?function(s){return new n(s)}:e;return Of=i,Of}var Cf,Jx;function JF(){if(Jx)return Cf;Jx=1;var n=y_(),e=GF(),t=HF(),r=w_(),i=YF(),s=mh(),o=200;function a(l,u,c){var h=-1,f=e,d=l.length,p=!0,g=[],m=g;if(c)p=!1,f=t;else if(d>=o){var v=u?null:i(l);if(v)return s(v);p=!1,f=r,m=new n}else m=u?[]:g;e:for(;++h<d;){var y=l[h],b=u?u(y):y;if(y=c||y!==0?y:0,p&&b===b){for(var _=m.length;_--;)if(m[_]===b)continue e;u&&m.push(b),g.push(y)}else f(m,b,c)||(m!==g&&m.push(b),g.push(y))}return g}return Cf=a,Cf}var Tf,Xx;function Qx(){if(Xx)return Tf;Xx=1;var n=Or(),e=ar();function t(r){return e(r)&&n(r)}return Tf=t,Tf}var Mf,Zx;function XF(){if(Zx)return Mf;Zx=1;var n=df(),e=Do(),t=JF(),r=Qx(),i=e(function(s){return t(n(s,1,r,!0))});return Mf=i,Mf}var If,eE;function QF(){if(eE)return If;eE=1;var n=No();function e(t,r){return n(r,function(i){return t[i]})}return If=e,If}var Rf,tE;function rE(){if(tE)return Rf;tE=1;var n=QF(),e=Zr();function t(r){return r==null?[]:n(r,e(r))}return Rf=t,Rf}var kf,nE;function Ut(){if(nE)return kf;nE=1;var n;if(typeof $l=="function")try{n={clone:sF(),constant:Yc(),each:f_(),filter:lx(),has:hx(),isArray:lt(),isEmpty:TF(),isFunction:ss(),isUndefined:px(),keys:Zr(),map:bx(),reduce:Ex(),size:DF(),transform:BF(),union:XF(),values:rE()}}catch{}return n||(n=window._),kf=n,kf}var Nf,iE;function jf(){if(iE)return Nf;iE=1;var n=Ut();Nf=i;var e="\0",t="\0",r="";function i(c){this._isDirected=n.has(c,"directed")?c.directed:!0,this._isMultigraph=n.has(c,"multigraph")?c.multigraph:!1,this._isCompound=n.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(c){return this._label=c,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(c){return n.isFunction(c)||(c=n.constant(c)),this._defaultNodeLabelFn=c,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var c=this;return n.filter(this.nodes(),function(h){return n.isEmpty(c._in[h])})},i.prototype.sinks=function(){var c=this;return n.filter(this.nodes(),function(h){return n.isEmpty(c._out[h])})},i.prototype.setNodes=function(c,h){var f=arguments,d=this;return n.each(c,function(p){f.length>1?d.setNode(p,h):d.setNode(p)}),this},i.prototype.setNode=function(c,h){return n.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=h),this):(this._nodes[c]=arguments.length>1?h:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},i.prototype.node=function(c){return this._nodes[c]},i.prototype.hasNode=function(c){return n.has(this._nodes,c)},i.prototype.removeNode=function(c){var h=this;if(n.has(this._nodes,c)){var f=function(d){h.removeEdge(h._edgeObjs[d])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],n.each(this.children(c),function(d){h.setParent(d)}),delete this._children[c]),n.each(n.keys(this._in[c]),f),delete this._in[c],delete this._preds[c],n.each(n.keys(this._out[c]),f),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},i.prototype.setParent=function(c,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(h))h=t;else{h+="";for(var f=h;!n.isUndefined(f);f=this.parent(f))if(f===c)throw new Error("Setting "+h+" as parent of "+c+" would create a cycle");this.setNode(h)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=h,this._children[h][c]=!0,this},i.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},i.prototype.parent=function(c){if(this._isCompound){var h=this._parent[c];if(h!==t)return h}},i.prototype.children=function(c){if(n.isUndefined(c)&&(c=t),this._isCompound){var h=this._children[c];if(h)return n.keys(h)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},i.prototype.predecessors=function(c){var h=this._preds[c];if(h)return n.keys(h)},i.prototype.successors=function(c){var h=this._sucs[c];if(h)return n.keys(h)},i.prototype.neighbors=function(c){var h=this.predecessors(c);if(h)return n.union(h,this.successors(c))},i.prototype.isLeaf=function(c){var h;return this.isDirected()?h=this.successors(c):h=this.neighbors(c),h.length===0},i.prototype.filterNodes=function(c){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var f=this;n.each(this._nodes,function(g,m){c(m)&&h.setNode(m,g)}),n.each(this._edgeObjs,function(g){h.hasNode(g.v)&&h.hasNode(g.w)&&h.setEdge(g,f.edge(g))});var d={};function p(g){var m=f.parent(g);return m===void 0||h.hasNode(m)?(d[g]=m,m):m in d?d[m]:p(m)}return this._isCompound&&n.each(h.nodes(),function(g){h.setParent(g,p(g))}),h},i.prototype.setDefaultEdgeLabel=function(c){return n.isFunction(c)||(c=n.constant(c)),this._defaultEdgeLabelFn=c,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(c,h){var f=this,d=arguments;return n.reduce(c,function(p,g){return d.length>1?f.setEdge(p,g,h):f.setEdge(p,g),g}),this},i.prototype.setEdge=function(){var c,h,f,d,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(c=g.v,h=g.w,f=g.name,arguments.length===2&&(d=arguments[1],p=!0)):(c=g,h=arguments[1],f=arguments[3],arguments.length>2&&(d=arguments[2],p=!0)),c=""+c,h=""+h,n.isUndefined(f)||(f=""+f);var m=a(this._isDirected,c,h,f);if(n.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=d),this;if(!n.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(h),this._edgeLabels[m]=p?d:this._defaultEdgeLabelFn(c,h,f);var v=l(this._isDirected,c,h,f);return c=v.v,h=v.w,Object.freeze(v),this._edgeObjs[m]=v,s(this._preds[h],c),s(this._sucs[c],h),this._in[h][m]=v,this._out[c][m]=v,this._edgeCount++,this},i.prototype.edge=function(c,h,f){var d=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,h,f);return this._edgeLabels[d]},i.prototype.hasEdge=function(c,h,f){var d=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,h,f);return n.has(this._edgeLabels,d)},i.prototype.removeEdge=function(c,h,f){var d=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,h,f),p=this._edgeObjs[d];return p&&(c=p.v,h=p.w,delete this._edgeLabels[d],delete this._edgeObjs[d],o(this._preds[h],c),o(this._sucs[c],h),delete this._in[h][d],delete this._out[c][d],this._edgeCount--),this},i.prototype.inEdges=function(c,h){var f=this._in[c];if(f){var d=n.values(f);return h?n.filter(d,function(p){return p.v===h}):d}},i.prototype.outEdges=function(c,h){var f=this._out[c];if(f){var d=n.values(f);return h?n.filter(d,function(p){return p.w===h}):d}},i.prototype.nodeEdges=function(c,h){var f=this.inEdges(c,h);if(f)return f.concat(this.outEdges(c,h))};function s(c,h){c[h]?c[h]++:c[h]=1}function o(c,h){--c[h]||delete c[h]}function a(c,h,f,d){var p=""+h,g=""+f;if(!c&&p>g){var m=p;p=g,g=m}return p+r+g+r+(n.isUndefined(d)?e:d)}function l(c,h,f,d){var p=""+h,g=""+f;if(!c&&p>g){var m=p;p=g,g=m}var v={v:p,w:g};return d&&(v.name=d),v}function u(c,h){return a(c,h.v,h.w,h.name)}return Nf}var Lf,sE;function ZF(){return sE||(sE=1,Lf="2.1.8"),Lf}var Df,oE;function e3(){return oE||(oE=1,Df={Graph:jf(),version:ZF()}),Df}var Bf,aE;function t3(){if(aE)return Bf;aE=1;var n=Ut(),e=jf();Bf={write:t,read:s};function t(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return n.isUndefined(o.graph())||(a.value=n.clone(o.graph())),a}function r(o){return n.map(o.nodes(),function(a){var l=o.node(a),u=o.parent(a),c={v:a};return n.isUndefined(l)||(c.value=l),n.isUndefined(u)||(c.parent=u),c})}function i(o){return n.map(o.edges(),function(a){var l=o.edge(a),u={v:a.v,w:a.w};return n.isUndefined(a.name)||(u.name=a.name),n.isUndefined(l)||(u.value=l),u})}function s(o){var a=new e(o.options).setGraph(o.value);return n.each(o.nodes,function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),n.each(o.edges,function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return Bf}var qf,lE;function r3(){if(lE)return qf;lE=1;var n=Ut();qf=e;function e(t){var r={},i=[],s;function o(a){n.has(r,a)||(r[a]=!0,s.push(a),n.each(t.successors(a),o),n.each(t.predecessors(a),o))}return n.each(t.nodes(),function(a){s=[],o(a),s.length&&i.push(s)}),i}return qf}var Ff,uE;function cE(){if(uE)return Ff;uE=1;var n=Ut();Ff=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return n.has(this._keyIndices,t)},e.prototype.priority=function(t){var r=this._keyIndices[t];if(r!==void 0)return this._arr[r].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,r){var i=this._keyIndices;if(t=String(t),!n.has(i,t)){var s=this._arr,o=s.length;return i[t]=o,s.push({key:t,priority:r}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,r){var i=this._keyIndices[t];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},e.prototype._heapify=function(t){var r=this._arr,i=2*t,s=i+1,o=t;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var r=this._arr,i=r[t].priority,s;t!==0&&(s=t>>1,!(r[s].priority<i));)this._swap(t,s),t=s},e.prototype._swap=function(t,r){var i=this._arr,s=this._keyIndices,o=i[t],a=i[r];i[t]=a,i[r]=o,s[a.key]=t,s[o.key]=r},Ff}var $f,hE;function fE(){if(hE)return $f;hE=1;var n=Ut(),e=cE();$f=r;var t=n.constant(1);function r(s,o,a,l){return i(s,String(o),a||t,l||function(u){return s.outEdges(u)})}function i(s,o,a,l){var u={},c=new e,h,f,d=function(p){var g=p.v!==h?p.v:p.w,m=u[g],v=a(p),y=f.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);y<m.distance&&(m.distance=y,m.predecessor=h,c.decrease(g,y))};for(s.nodes().forEach(function(p){var g=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:g},c.add(p,g)});c.size()>0&&(h=c.removeMin(),f=u[h],f.distance!==Number.POSITIVE_INFINITY);)l(h).forEach(d);return u}return $f}var Uf,dE;function n3(){if(dE)return Uf;dE=1;var n=fE(),e=Ut();Uf=t;function t(r,i,s){return e.transform(r.nodes(),function(o,a){o[a]=n(r,a,i,s)},{})}return Uf}var zf,pE;function gE(){if(pE)return zf;pE=1;var n=Ut();zf=e;function e(t){var r=0,i=[],s={},o=[];function a(l){var u=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),t.successors(l).forEach(function(f){n.has(s,f)?s[f].onStack&&(u.lowlink=Math.min(u.lowlink,s[f].index)):(a(f),u.lowlink=Math.min(u.lowlink,s[f].lowlink))}),u.lowlink===u.index){var c=[],h;do h=i.pop(),s[h].onStack=!1,c.push(h);while(l!==h);o.push(c)}}return t.nodes().forEach(function(l){n.has(s,l)||a(l)}),o}return zf}var Vf,mE;function i3(){if(mE)return Vf;mE=1;var n=Ut(),e=gE();Vf=t;function t(r){return n.filter(e(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Vf}var Wf,yE;function s3(){if(yE)return Wf;yE=1;var n=Ut();Wf=t;var e=n.constant(1);function t(i,s,o){return r(i,s||e,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(u){a[u]={},a[u][u]={distance:0},l.forEach(function(c){u!==c&&(a[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var h=c.v===u?c.w:c.v,f=s(c);a[u][h]={distance:f,predecessor:u}})}),l.forEach(function(u){var c=a[u];l.forEach(function(h){var f=a[h];l.forEach(function(d){var p=f[u],g=c[d],m=f[d],v=p.distance+g.distance;v<m.distance&&(m.distance=v,m.predecessor=g.predecessor)})})}),a}return Wf}var Gf,bE;function vE(){if(bE)return Gf;bE=1;var n=Ut();Gf=e,e.CycleException=t;function e(r){var i={},s={},o=[];function a(l){if(n.has(s,l))throw new t;n.has(i,l)||(s[l]=!0,i[l]=!0,n.each(r.predecessors(l),a),delete s[l],o.push(l))}if(n.each(r.sinks(),a),n.size(i)!==r.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Gf}var Hf,wE;function o3(){if(wE)return Hf;wE=1;var n=vE();Hf=e;function e(t){try{n(t)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}return Hf}var Kf,_E;function xE(){if(_E)return Kf;_E=1;var n=Ut();Kf=e;function e(r,i,s){n.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],l={};return n.each(i,function(u){if(!r.hasNode(u))throw new Error("Graph does not have node: "+u);t(r,u,s==="post",l,o,a)}),a}function t(r,i,s,o,a,l){n.has(o,i)||(o[i]=!0,s||l.push(i),n.each(a(i),function(u){t(r,u,s,o,a,l)}),s&&l.push(i))}return Kf}var Yf,EE;function a3(){if(EE)return Yf;EE=1;var n=xE();Yf=e;function e(t,r){return n(t,r,"post")}return Yf}var Jf,SE;function l3(){if(SE)return Jf;SE=1;var n=xE();Jf=e;function e(t,r){return n(t,r,"pre")}return Jf}var Xf,AE;function u3(){if(AE)return Xf;AE=1;var n=Ut(),e=jf(),t=cE();Xf=r;function r(i,s){var o=new e,a={},l=new t,u;function c(f){var d=f.v===u?f.w:f.v,p=l.priority(d);if(p!==void 0){var g=s(f);g<p&&(a[d]=u,l.decrease(d,g))}}if(i.nodeCount()===0)return o;n.each(i.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),o.setNode(f)}),l.decrease(i.nodes()[0],0);for(var h=!1;l.size()>0;){if(u=l.removeMin(),n.has(a,u))o.setEdge(u,a[u]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(u).forEach(c)}return o}return Xf}var Qf,PE;function c3(){return PE||(PE=1,Qf={components:r3(),dijkstra:fE(),dijkstraAll:n3(),findCycles:i3(),floydWarshall:s3(),isAcyclic:o3(),postorder:a3(),preorder:l3(),prim:u3(),tarjan:gE(),topsort:vE()}),Qf}var Zf,OE;function h3(){if(OE)return Zf;OE=1;var n=e3();return Zf={Graph:n.Graph,json:t3(),alg:c3(),version:n.version},Zf}var ed,CE;function Zt(){if(CE)return ed;CE=1;var n;if(typeof $l=="function")try{n=h3()}catch{}return n||(n=window.graphlib),ed=n,ed}var td,TE;function f3(){if(TE)return td;TE=1;var n=Q1(),e=1,t=4;function r(i){return n(i,e|t)}return td=r,td}var rd,ME;function Bo(){if(ME)return rd;ME=1;var n=di(),e=Or(),t=To(),r=$t();function i(s,o,a){if(!r(a))return!1;var l=typeof o;return(l=="number"?e(a)&&t(o,a.length):l=="string"&&o in a)?n(a[o],s):!1}return rd=i,rd}var nd,IE;function d3(){if(IE)return nd;IE=1;var n=Do(),e=di(),t=Bo(),r=xn(),i=Object.prototype,s=i.hasOwnProperty,o=n(function(a,l){a=Object(a);var u=-1,c=l.length,h=c>2?l[2]:void 0;for(h&&t(l[0],l[1],h)&&(c=1);++u<c;)for(var f=l[u],d=r(f),p=-1,g=d.length;++p<g;){var m=d[p],v=a[m];(v===void 0||e(v,i[m])&&!s.call(a,m))&&(a[m]=f[m])}return a});return nd=o,nd}var id,RE;function p3(){if(RE)return id;RE=1;var n=Cr(),e=Or(),t=Zr();function r(i){return function(s,o,a){var l=Object(s);if(!e(s)){var u=n(o,3);s=t(s),o=function(h){return u(l[h],h,l)}}var c=i(s,o,a);return c>-1?l[u?s[c]:c]:void 0}}return id=r,id}var sd,kE;function g3(){if(kE)return sd;kE=1;var n=/\s/;function e(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}return sd=e,sd}var od,NE;function m3(){if(NE)return od;NE=1;var n=g3(),e=/^\s+/;function t(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return od=t,od}var ad,jE;function y3(){if(jE)return ad;jE=1;var n=m3(),e=$t(),t=yi(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return r;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=n(u);var h=s.test(u);return h||o.test(u)?a(u.slice(2),h?2:8):i.test(u)?r:+u}return ad=l,ad}var ld,LE;function DE(){if(LE)return ld;LE=1;var n=y3(),e=1/0,t=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=n(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return ld=r,ld}var ud,BE;function b3(){if(BE)return ud;BE=1;var n=DE();function e(t){var r=n(t),i=r%1;return r===r?i?r-i:r:0}return ud=e,ud}var cd,qE;function v3(){if(qE)return cd;qE=1;var n=Ux(),e=Cr(),t=b3(),r=Math.max;function i(s,o,a){var l=s==null?0:s.length;if(!l)return-1;var u=a==null?0:t(a);return u<0&&(u=r(l+u,0)),n(s,e(o,3),u)}return cd=i,cd}var hd,FE;function w3(){if(FE)return hd;FE=1;var n=p3(),e=v3(),t=n(e);return hd=t,hd}var fd,$E;function UE(){if($E)return fd;$E=1;var n=df();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return fd=e,fd}var dd,zE;function _3(){if(zE)return dd;zE=1;var n=Qc(),e=l_(),t=xn();function r(i,s){return i==null?i:n(i,e(s),t)}return dd=r,dd}var pd,VE;function x3(){if(VE)return pd;VE=1;function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return pd=n,pd}var gd,WE;function E3(){if(WE)return gd;WE=1;var n=Oo(),e=eh(),t=Cr();function r(i,s){var o={};return s=t(s,3),e(i,function(a,l,u){n(o,l,s(a,l,u))}),o}return gd=r,gd}var md,GE;function yd(){if(GE)return md;GE=1;var n=yi();function e(t,r,i){for(var s=-1,o=t.length;++s<o;){var a=t[s],l=r(a);if(l!=null&&(u===void 0?l===l&&!n(l):i(l,u)))var u=l,c=a}return c}return md=e,md}var bd,HE;function S3(){if(HE)return bd;HE=1;function n(e,t){return e>t}return bd=n,bd}var vd,KE;function A3(){if(KE)return vd;KE=1;var n=yd(),e=S3(),t=En();function r(i){return i&&i.length?n(i,t,e):void 0}return vd=r,vd}var wd,YE;function JE(){if(YE)return wd;YE=1;var n=Oo(),e=di();function t(r,i,s){(s!==void 0&&!e(r[i],s)||s===void 0&&!(i in r))&&n(r,i,s)}return wd=t,wd}var _d,XE;function P3(){if(XE)return _d;XE=1;var n=wn(),e=Ro(),t=ar(),r="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,a=s.hasOwnProperty,l=o.call(Object);function u(c){if(!t(c)||n(c)!=r)return!1;var h=e(c);if(h===null)return!0;var f=a.call(h,"constructor")&&h.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return _d=u,_d}var xd,QE;function ZE(){if(QE)return xd;QE=1;function n(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return xd=n,xd}var Ed,eS;function O3(){if(eS)return Ed;eS=1;var n=os(),e=xn();function t(r){return n(r,e(r))}return Ed=t,Ed}var Sd,tS;function C3(){if(tS)return Sd;tS=1;var n=JE(),e=l1(),t=$1(),r=c1(),i=G1(),s=as(),o=lt(),a=Qx(),l=gi(),u=ss(),c=$t(),h=P3(),f=cs(),d=ZE(),p=O3();function g(m,v,y,b,_,w,x){var E=d(m,y),A=d(v,y),O=x.get(A);if(O){n(m,y,O);return}var T=w?w(E,A,y+"",m,v,x):void 0,M=T===void 0;if(M){var C=o(A),k=!C&&l(A),N=!C&&!k&&f(A);T=A,C||k||N?o(E)?T=E:a(E)?T=r(E):k?(M=!1,T=e(A,!0)):N?(M=!1,T=t(A,!0)):T=[]:h(A)||s(A)?(T=E,s(E)?T=p(E):(!c(E)||u(E))&&(T=i(A))):M=!1}M&&(x.set(A,T),_(T,A,b,w,x),x.delete(A)),n(m,y,T)}return Sd=g,Sd}var Ad,rS;function T3(){if(rS)return Ad;rS=1;var n=Po(),e=JE(),t=Qc(),r=C3(),i=$t(),s=xn(),o=ZE();function a(l,u,c,h,f){l!==u&&t(u,function(d,p){if(f||(f=new n),i(d))r(l,u,p,c,a,h,f);else{var g=h?h(o(l,p),d,p+"",l,u,f):void 0;g===void 0&&(g=d),e(l,p,g)}},s)}return Ad=a,Ad}var Pd,nS;function M3(){if(nS)return Pd;nS=1;var n=Do(),e=Bo();function t(r){return n(function(i,s){var o=-1,a=s.length,l=a>1?s[a-1]:void 0,u=a>2?s[2]:void 0;for(l=r.length>3&&typeof l=="function"?(a--,l):void 0,u&&e(s[0],s[1],u)&&(l=a<3?void 0:l,a=1),i=Object(i);++o<a;){var c=s[o];c&&r(i,c,o,l)}return i})}return Pd=t,Pd}var Od,iS;function I3(){if(iS)return Od;iS=1;var n=T3(),e=M3(),t=e(function(r,i,s){n(r,i,s)});return Od=t,Od}var Cd,sS;function oS(){if(sS)return Cd;sS=1;function n(e,t){return e<t}return Cd=n,Cd}var Td,aS;function R3(){if(aS)return Td;aS=1;var n=yd(),e=oS(),t=En();function r(i){return i&&i.length?n(i,t,e):void 0}return Td=r,Td}var Md,lS;function k3(){if(lS)return Md;lS=1;var n=yd(),e=Cr(),t=oS();function r(i,s){return i&&i.length?n(i,e(s,2),t):void 0}return Md=r,Md}var Id,uS;function N3(){if(uS)return Id;uS=1;var n=Qt(),e=function(){return n.Date.now()};return Id=e,Id}var Rd,cS;function j3(){if(cS)return Rd;cS=1;var n=Co(),e=jo(),t=To(),r=$t(),i=fs();function s(o,a,l,u){if(!r(o))return o;a=e(a,o);for(var c=-1,h=a.length,f=h-1,d=o;d!=null&&++c<h;){var p=i(a[c]),g=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=f){var m=d[p];g=u?u(m,p,d):void 0,g===void 0&&(g=r(m)?m:t(a[c+1])?[]:{})}n(d,p,g),d=d[p]}return o}return Rd=s,Rd}var kd,hS;function L3(){if(hS)return kd;hS=1;var n=Lo(),e=j3(),t=jo();function r(i,s,o){for(var a=-1,l=s.length,u={};++a<l;){var c=s[a],h=n(i,c);o(h,c)&&e(u,t(c,i),h)}return u}return kd=r,kd}var Nd,fS;function D3(){if(fS)return Nd;fS=1;var n=L3(),e=ex();function t(r,i){return n(r,i,function(s,o){return e(r,o)})}return Nd=t,Nd}var jd,dS;function B3(){if(dS)return jd;dS=1;var n=UE(),e=jx(),t=qx();function r(i){return t(e(i,void 0,n),i+"")}return jd=r,jd}var Ld,pS;function q3(){if(pS)return Ld;pS=1;var n=D3(),e=B3(),t=e(function(r,i){return r==null?{}:n(r,i)});return Ld=t,Ld}var Dd,gS;function F3(){if(gS)return Dd;gS=1;var n=Math.ceil,e=Math.max;function t(r,i,s,o){for(var a=-1,l=e(n((i-r)/(s||1)),0),u=Array(l);l--;)u[o?l:++a]=r,r+=s;return u}return Dd=t,Dd}var Bd,mS;function $3(){if(mS)return Bd;mS=1;var n=F3(),e=Bo(),t=DE();function r(i){return function(s,o,a){return a&&typeof a!="number"&&e(s,o,a)&&(o=a=void 0),s=t(s),o===void 0?(o=s,s=0):o=t(o),a=a===void 0?s<o?1:-1:t(a),n(s,o,a,i)}}return Bd=r,Bd}var qd,yS;function U3(){if(yS)return qd;yS=1;var n=$3(),e=n();return qd=e,qd}var Fd,bS;function z3(){if(bS)return Fd;bS=1;function n(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return Fd=n,Fd}var $d,vS;function V3(){if(vS)return $d;vS=1;var n=yi();function e(t,r){if(t!==r){var i=t!==void 0,s=t===null,o=t===t,a=n(t),l=r!==void 0,u=r===null,c=r===r,h=n(r);if(!u&&!h&&!a&&t>r||a&&l&&c&&!u&&!h||s&&l&&c||!i&&c||!o)return 1;if(!s&&!a&&!h&&t<r||h&&i&&o&&!s&&!a||u&&i&&o||!l&&o||!c)return-1}return 0}return $d=e,$d}var Ud,wS;function W3(){if(wS)return Ud;wS=1;var n=V3();function e(t,r,i){for(var s=-1,o=t.criteria,a=r.criteria,l=o.length,u=i.length;++s<l;){var c=n(o[s],a[s]);if(c){if(s>=u)return c;var h=i[s];return c*(h=="desc"?-1:1)}}return t.index-r.index}return Ud=e,Ud}var zd,_S;function G3(){if(_S)return zd;_S=1;var n=No(),e=Lo(),t=Cr(),r=mx(),i=z3(),s=Mo(),o=W3(),a=En(),l=lt();function u(c,h,f){h.length?h=n(h,function(g){return l(g)?function(m){return e(m,g.length===1?g[0]:g)}:g}):h=[a];var d=-1;h=n(h,s(t));var p=r(c,function(g,m,v){var y=n(h,function(b){return b(g)});return{criteria:y,index:++d,value:g}});return i(p,function(g,m){return o(g,m,f)})}return zd=u,zd}var Vd,xS;function H3(){if(xS)return Vd;xS=1;var n=df(),e=G3(),t=Do(),r=Bo(),i=t(function(s,o){if(s==null)return[];var a=o.length;return a>1&&r(s,o[0],o[1])?o=[]:a>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(s,n(o,1),[])});return Vd=i,Vd}var Wd,ES;function K3(){if(ES)return Wd;ES=1;var n=W_(),e=0;function t(r){var i=++e;return n(r)+i}return Wd=t,Wd}var Gd,SS;function Y3(){if(SS)return Gd;SS=1;function n(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var l=i<o?t[i]:void 0;r(a,e[i],l)}return a}return Gd=n,Gd}var Hd,AS;function J3(){if(AS)return Hd;AS=1;var n=Co(),e=Y3();function t(r,i){return e(r||[],i||[],n)}return Hd=t,Hd}var Kd,PS;function Je(){if(PS)return Kd;PS=1;var n;if(typeof $l=="function")try{n={cloneDeep:f3(),constant:Yc(),defaults:d3(),each:f_(),filter:lx(),find:w3(),flatten:UE(),forEach:c_(),forIn:_3(),has:hx(),isUndefined:px(),last:x3(),map:bx(),mapValues:E3(),max:A3(),merge:I3(),min:R3(),minBy:k3(),now:N3(),pick:q3(),range:U3(),reduce:Ex(),sortBy:H3(),uniqueId:K3(),values:rE(),zipObject:J3()}}catch{}return n||(n=window._),Kd=n,Kd}var Yd,OS;function X3(){if(OS)return Yd;OS=1,Yd=n;function n(){var r={};r._next=r._prev=r,this._sentinel=r}n.prototype.dequeue=function(){var r=this._sentinel,i=r._prev;if(i!==r)return e(i),i},n.prototype.enqueue=function(r){var i=this._sentinel;r._prev&&r._next&&e(r),r._next=i._next,i._next._prev=r,i._next=r,r._prev=i},n.prototype.toString=function(){for(var r=[],i=this._sentinel,s=i._prev;s!==i;)r.push(JSON.stringify(s,t)),s=s._prev;return"["+r.join(", ")+"]"};function e(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function t(r,i){if(r!=="_next"&&r!=="_prev")return i}return Yd}var Jd,CS;function Q3(){if(CS)return Jd;CS=1;var n=Je(),e=Zt().Graph,t=X3();Jd=i;var r=n.constant(1);function i(u,c){if(u.nodeCount()<=1)return[];var h=a(u,c||r),f=s(h.graph,h.buckets,h.zeroIdx);return n.flatten(n.map(f,function(d){return u.outEdges(d.v,d.w)}),!0)}function s(u,c,h){for(var f=[],d=c[c.length-1],p=c[0],g;u.nodeCount();){for(;g=p.dequeue();)o(u,c,h,g);for(;g=d.dequeue();)o(u,c,h,g);if(u.nodeCount()){for(var m=c.length-2;m>0;--m)if(g=c[m].dequeue(),g){f=f.concat(o(u,c,h,g,!0));break}}}return f}function o(u,c,h,f,d){var p=d?[]:void 0;return n.forEach(u.inEdges(f.v),function(g){var m=u.edge(g),v=u.node(g.v);d&&p.push({v:g.v,w:g.w}),v.out-=m,l(c,h,v)}),n.forEach(u.outEdges(f.v),function(g){var m=u.edge(g),v=g.w,y=u.node(v);y.in-=m,l(c,h,y)}),u.removeNode(f.v),p}function a(u,c){var h=new e,f=0,d=0;n.forEach(u.nodes(),function(m){h.setNode(m,{v:m,in:0,out:0})}),n.forEach(u.edges(),function(m){var v=h.edge(m.v,m.w)||0,y=c(m),b=v+y;h.setEdge(m.v,m.w,b),d=Math.max(d,h.node(m.v).out+=y),f=Math.max(f,h.node(m.w).in+=y)});var p=n.range(d+f+3).map(function(){return new t}),g=f+1;return n.forEach(h.nodes(),function(m){l(p,g,h.node(m))}),{graph:h,buckets:p,zeroIdx:g}}function l(u,c,h){h.out?h.in?u[h.out-h.in+c].enqueue(h):u[u.length-1].enqueue(h):u[0].enqueue(h)}return Jd}var Xd,TS;function Z3(){if(TS)return Xd;TS=1;var n=Je(),e=Q3();Xd={run:t,undo:i};function t(s){var o=s.graph().acyclicer==="greedy"?e(s,a(s)):r(s);n.forEach(o,function(l){var u=s.edge(l);s.removeEdge(l),u.forwardName=l.name,u.reversed=!0,s.setEdge(l.w,l.v,u,n.uniqueId("rev"))});function a(l){return function(u){return l.edge(u).weight}}}function r(s){var o=[],a={},l={};function u(c){n.has(l,c)||(l[c]=!0,a[c]=!0,n.forEach(s.outEdges(c),function(h){n.has(a,h.w)?o.push(h):u(h.w)}),delete a[c])}return n.forEach(s.nodes(),u),o}function i(s){n.forEach(s.edges(),function(o){var a=s.edge(o);if(a.reversed){s.removeEdge(o);var l=a.forwardName;delete a.reversed,delete a.forwardName,s.setEdge(o.w,o.v,a,l)}})}return Xd}var Qd,MS;function Tt(){if(MS)return Qd;MS=1;var n=Je(),e=Zt().Graph;Qd={addDummyNode:t,simplify:r,asNonCompoundGraph:i,successorWeights:s,predecessorWeights:o,intersectRect:a,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:h,maxRank:f,partition:d,time:p,notime:g};function t(m,v,y,b){var _;do _=n.uniqueId(b);while(m.hasNode(_));return y.dummy=v,m.setNode(_,y),_}function r(m){var v=new e().setGraph(m.graph());return n.forEach(m.nodes(),function(y){v.setNode(y,m.node(y))}),n.forEach(m.edges(),function(y){var b=v.edge(y.v,y.w)||{weight:0,minlen:1},_=m.edge(y);v.setEdge(y.v,y.w,{weight:b.weight+_.weight,minlen:Math.max(b.minlen,_.minlen)})}),v}function i(m){var v=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return n.forEach(m.nodes(),function(y){m.children(y).length||v.setNode(y,m.node(y))}),n.forEach(m.edges(),function(y){v.setEdge(y,m.edge(y))}),v}function s(m){var v=n.map(m.nodes(),function(y){var b={};return n.forEach(m.outEdges(y),function(_){b[_.w]=(b[_.w]||0)+m.edge(_).weight}),b});return n.zipObject(m.nodes(),v)}function o(m){var v=n.map(m.nodes(),function(y){var b={};return n.forEach(m.inEdges(y),function(_){b[_.v]=(b[_.v]||0)+m.edge(_).weight}),b});return n.zipObject(m.nodes(),v)}function a(m,v){var y=m.x,b=m.y,_=v.x-y,w=v.y-b,x=m.width/2,E=m.height/2;if(!_&&!w)throw new Error("Not possible to find intersection inside of the rectangle");var A,O;return Math.abs(w)*x>Math.abs(_)*E?(w<0&&(E=-E),A=E*_/w,O=E):(_<0&&(x=-x),A=x,O=x*w/_),{x:y+A,y:b+O}}function l(m){var v=n.map(n.range(f(m)+1),function(){return[]});return n.forEach(m.nodes(),function(y){var b=m.node(y),_=b.rank;n.isUndefined(_)||(v[_][b.order]=y)}),v}function u(m){var v=n.min(n.map(m.nodes(),function(y){return m.node(y).rank}));n.forEach(m.nodes(),function(y){var b=m.node(y);n.has(b,"rank")&&(b.rank-=v)})}function c(m){var v=n.min(n.map(m.nodes(),function(w){return m.node(w).rank})),y=[];n.forEach(m.nodes(),function(w){var x=m.node(w).rank-v;y[x]||(y[x]=[]),y[x].push(w)});var b=0,_=m.graph().nodeRankFactor;n.forEach(y,function(w,x){n.isUndefined(w)&&x%_!==0?--b:b&&n.forEach(w,function(E){m.node(E).rank+=b})})}function h(m,v,y,b){var _={width:0,height:0};return arguments.length>=4&&(_.rank=y,_.order=b),t(m,"border",_,v)}function f(m){return n.max(n.map(m.nodes(),function(v){var y=m.node(v).rank;if(!n.isUndefined(y))return y}))}function d(m,v){var y={lhs:[],rhs:[]};return n.forEach(m,function(b){v(b)?y.lhs.push(b):y.rhs.push(b)}),y}function p(m,v){var y=n.now();try{return v()}finally{console.log(m+" time: "+(n.now()-y)+"ms")}}function g(m,v){return v()}return Qd}var Zd,IS;function e$(){if(IS)return Zd;IS=1;var n=Je(),e=Tt();Zd={run:t,undo:i};function t(s){s.graph().dummyChains=[],n.forEach(s.edges(),function(o){r(s,o)})}function r(s,o){var a=o.v,l=s.node(a).rank,u=o.w,c=s.node(u).rank,h=o.name,f=s.edge(o),d=f.labelRank;if(c!==l+1){s.removeEdge(o);var p,g,m;for(m=0,++l;l<c;++m,++l)f.points=[],g={width:0,height:0,edgeLabel:f,edgeObj:o,rank:l},p=e.addDummyNode(s,"edge",g,"_d"),l===d&&(g.width=f.width,g.height=f.height,g.dummy="edge-label",g.labelpos=f.labelpos),s.setEdge(a,p,{weight:f.weight},h),m===0&&s.graph().dummyChains.push(p),a=p;s.setEdge(a,u,{weight:f.weight},h)}}function i(s){n.forEach(s.graph().dummyChains,function(o){var a=s.node(o),l=a.edgeLabel,u;for(s.setEdge(a.edgeObj,l);a.dummy;)u=s.successors(o)[0],s.removeNode(o),l.points.push({x:a.x,y:a.y}),a.dummy==="edge-label"&&(l.x=a.x,l.y=a.y,l.width=a.width,l.height=a.height),o=u,a=s.node(o)})}return Zd}var ep,RS;function qo(){if(RS)return ep;RS=1;var n=Je();ep={longestPath:e,slack:t};function e(r){var i={};function s(o){var a=r.node(o);if(n.has(i,o))return a.rank;i[o]=!0;var l=n.min(n.map(r.outEdges(o),function(u){return s(u.w)-r.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),a.rank=l}n.forEach(r.sources(),s)}function t(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return ep}var tp,kS;function NS(){if(kS)return tp;kS=1;var n=Je(),e=Zt().Graph,t=qo().slack;tp=r;function r(a){var l=new e({directed:!1}),u=a.nodes()[0],c=a.nodeCount();l.setNode(u,{});for(var h,f;i(l,a)<c;)h=s(l,a),f=l.hasNode(h.v)?t(a,h):-t(a,h),o(l,a,f);return l}function i(a,l){function u(c){n.forEach(l.nodeEdges(c),function(h){var f=h.v,d=c===f?h.w:f;!a.hasNode(d)&&!t(l,h)&&(a.setNode(d,{}),a.setEdge(c,d,{}),u(d))})}return n.forEach(a.nodes(),u),a.nodeCount()}function s(a,l){return n.minBy(l.edges(),function(u){if(a.hasNode(u.v)!==a.hasNode(u.w))return t(l,u)})}function o(a,l,u){n.forEach(a.nodes(),function(c){l.node(c).rank+=u})}return tp}var rp,jS;function t$(){if(jS)return rp;jS=1;var n=Je(),e=NS(),t=qo().slack,r=qo().longestPath,i=Zt().alg.preorder,s=Zt().alg.postorder,o=Tt().simplify;rp=a,a.initLowLimValues=h,a.initCutValues=l,a.calcCutValue=c,a.leaveEdge=d,a.enterEdge=p,a.exchangeEdges=g;function a(b){b=o(b),r(b);var _=e(b);h(_),l(_,b);for(var w,x;w=d(_);)x=p(_,b,w),g(_,b,w,x)}function l(b,_){var w=s(b,b.nodes());w=w.slice(0,w.length-1),n.forEach(w,function(x){u(b,_,x)})}function u(b,_,w){var x=b.node(w),E=x.parent;b.edge(w,E).cutvalue=c(b,_,w)}function c(b,_,w){var x=b.node(w),E=x.parent,A=!0,O=_.edge(w,E),T=0;return O||(A=!1,O=_.edge(E,w)),T=O.weight,n.forEach(_.nodeEdges(w),function(M){var C=M.v===w,k=C?M.w:M.v;if(k!==E){var N=C===A,R=_.edge(M).weight;if(T+=N?R:-R,v(b,w,k)){var $=b.edge(w,k).cutvalue;T+=N?-$:$}}}),T}function h(b,_){arguments.length<2&&(_=b.nodes()[0]),f(b,{},1,_)}function f(b,_,w,x,E){var A=w,O=b.node(x);return _[x]=!0,n.forEach(b.neighbors(x),function(T){n.has(_,T)||(w=f(b,_,w,T,x))}),O.low=A,O.lim=w++,E?O.parent=E:delete O.parent,w}function d(b){return n.find(b.edges(),function(_){return b.edge(_).cutvalue<0})}function p(b,_,w){var x=w.v,E=w.w;_.hasEdge(x,E)||(x=w.w,E=w.v);var A=b.node(x),O=b.node(E),T=A,M=!1;A.lim>O.lim&&(T=O,M=!0);var C=n.filter(_.edges(),function(k){return M===y(b,b.node(k.v),T)&&M!==y(b,b.node(k.w),T)});return n.minBy(C,function(k){return t(_,k)})}function g(b,_,w,x){var E=w.v,A=w.w;b.removeEdge(E,A),b.setEdge(x.v,x.w,{}),h(b),l(b,_),m(b,_)}function m(b,_){var w=n.find(b.nodes(),function(E){return!_.node(E).parent}),x=i(b,w);x=x.slice(1),n.forEach(x,function(E){var A=b.node(E).parent,O=_.edge(E,A),T=!1;O||(O=_.edge(A,E),T=!0),_.node(E).rank=_.node(A).rank+(T?O.minlen:-O.minlen)})}function v(b,_,w){return b.hasEdge(_,w)}function y(b,_,w){return w.low<=_.lim&&_.lim<=w.lim}return rp}var np,LS;function r$(){if(LS)return np;LS=1;var n=qo(),e=n.longestPath,t=NS(),r=t$();np=i;function i(l){switch(l.graph().ranker){case"network-simplex":a(l);break;case"tight-tree":o(l);break;case"longest-path":s(l);break;default:a(l)}}var s=e;function o(l){e(l),t(l)}function a(l){r(l)}return np}var ip,DS;function n$(){if(DS)return ip;DS=1;var n=Je();ip=e;function e(i){var s=r(i);n.forEach(i.graph().dummyChains,function(o){for(var a=i.node(o),l=a.edgeObj,u=t(i,s,l.v,l.w),c=u.path,h=u.lca,f=0,d=c[f],p=!0;o!==l.w;){if(a=i.node(o),p){for(;(d=c[f])!==h&&i.node(d).maxRank<a.rank;)f++;d===h&&(p=!1)}if(!p){for(;f<c.length-1&&i.node(d=c[f+1]).minRank<=a.rank;)f++;d=c[f]}i.setParent(o,d),o=i.successors(o)[0]}})}function t(i,s,o,a){var l=[],u=[],c=Math.min(s[o].low,s[a].low),h=Math.max(s[o].lim,s[a].lim),f,d;f=o;do f=i.parent(f),l.push(f);while(f&&(s[f].low>c||h>s[f].lim));for(d=f,f=a;(f=i.parent(f))!==d;)u.push(f);return{path:l.concat(u.reverse()),lca:d}}function r(i){var s={},o=0;function a(l){var u=o;n.forEach(i.children(l),a),s[l]={low:u,lim:o++}}return n.forEach(i.children(),a),s}return ip}var sp,BS;function i$(){if(BS)return sp;BS=1;var n=Je(),e=Tt();sp={run:t,cleanup:o};function t(a){var l=e.addDummyNode(a,"root",{},"_root"),u=i(a),c=n.max(n.values(u))-1,h=2*c+1;a.graph().nestingRoot=l,n.forEach(a.edges(),function(d){a.edge(d).minlen*=h});var f=s(a)+1;n.forEach(a.children(),function(d){r(a,l,h,f,c,u,d)}),a.graph().nodeRankFactor=h}function r(a,l,u,c,h,f,d){var p=a.children(d);if(!p.length){d!==l&&a.setEdge(l,d,{weight:0,minlen:u});return}var g=e.addBorderNode(a,"_bt"),m=e.addBorderNode(a,"_bb"),v=a.node(d);a.setParent(g,d),v.borderTop=g,a.setParent(m,d),v.borderBottom=m,n.forEach(p,function(y){r(a,l,u,c,h,f,y);var b=a.node(y),_=b.borderTop?b.borderTop:y,w=b.borderBottom?b.borderBottom:y,x=b.borderTop?c:2*c,E=_!==w?1:h-f[d]+1;a.setEdge(g,_,{weight:x,minlen:E,nestingEdge:!0}),a.setEdge(w,m,{weight:x,minlen:E,nestingEdge:!0})}),a.parent(d)||a.setEdge(l,g,{weight:0,minlen:h+f[d]})}function i(a){var l={};function u(c,h){var f=a.children(c);f&&f.length&&n.forEach(f,function(d){u(d,h+1)}),l[c]=h}return n.forEach(a.children(),function(c){u(c,1)}),l}function s(a){return n.reduce(a.edges(),function(l,u){return l+a.edge(u).weight},0)}function o(a){var l=a.graph();a.removeNode(l.nestingRoot),delete l.nestingRoot,n.forEach(a.edges(),function(u){var c=a.edge(u);c.nestingEdge&&a.removeEdge(u)})}return sp}var op,qS;function s$(){if(qS)return op;qS=1;var n=Je(),e=Tt();op=t;function t(i){function s(o){var a=i.children(o),l=i.node(o);if(a.length&&n.forEach(a,s),n.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)r(i,"borderLeft","_bl",o,l,u),r(i,"borderRight","_br",o,l,u)}}n.forEach(i.children(),s)}function r(i,s,o,a,l,u){var c={width:0,height:0,rank:u,borderType:s},h=l[s][u-1],f=e.addDummyNode(i,"border",c,o);l[s][u]=f,i.setParent(f,a),h&&i.setEdge(h,f,{weight:1})}return op}var ap,FS;function o$(){if(FS)return ap;FS=1;var n=Je();ap={adjust:e,undo:t};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&r(u)}function t(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&s(u),(c==="lr"||c==="rl")&&(a(u),r(u))}function r(u){n.forEach(u.nodes(),function(c){i(u.node(c))}),n.forEach(u.edges(),function(c){i(u.edge(c))})}function i(u){var c=u.width;u.width=u.height,u.height=c}function s(u){n.forEach(u.nodes(),function(c){o(u.node(c))}),n.forEach(u.edges(),function(c){var h=u.edge(c);n.forEach(h.points,o),n.has(h,"y")&&o(h)})}function o(u){u.y=-u.y}function a(u){n.forEach(u.nodes(),function(c){l(u.node(c))}),n.forEach(u.edges(),function(c){var h=u.edge(c);n.forEach(h.points,l),n.has(h,"x")&&l(h)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return ap}var lp,$S;function a$(){if($S)return lp;$S=1;var n=Je();lp=e;function e(t){var r={},i=n.filter(t.nodes(),function(u){return!t.children(u).length}),s=n.max(n.map(i,function(u){return t.node(u).rank})),o=n.map(n.range(s+1),function(){return[]});function a(u){if(!n.has(r,u)){r[u]=!0;var c=t.node(u);o[c.rank].push(u),n.forEach(t.successors(u),a)}}var l=n.sortBy(i,function(u){return t.node(u).rank});return n.forEach(l,a),o}return lp}var up,US;function l$(){if(US)return up;US=1;var n=Je();up=e;function e(r,i){for(var s=0,o=1;o<i.length;++o)s+=t(r,i[o-1],i[o]);return s}function t(r,i,s){for(var o=n.zipObject(s,n.map(s,function(f,d){return d})),a=n.flatten(n.map(i,function(f){return n.sortBy(n.map(r.outEdges(f),function(d){return{pos:o[d.w],weight:r.edge(d).weight}}),"pos")}),!0),l=1;l<s.length;)l<<=1;var u=2*l-1;l-=1;var c=n.map(new Array(u),function(){return 0}),h=0;return n.forEach(a.forEach(function(f){var d=f.pos+l;c[d]+=f.weight;for(var p=0;d>0;)d%2&&(p+=c[d+1]),d=d-1>>1,c[d]+=f.weight;h+=f.weight*p})),h}return up}var cp,zS;function u$(){if(zS)return cp;zS=1;var n=Je();cp=e;function e(t,r){return n.map(r,function(i){var s=t.inEdges(i);if(s.length){var o=n.reduce(s,function(a,l){var u=t.edge(l),c=t.node(l.v);return{sum:a.sum+u.weight*c.order,weight:a.weight+u.weight}},{sum:0,weight:0});return{v:i,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:i}})}return cp}var hp,VS;function c$(){if(VS)return hp;VS=1;var n=Je();hp=e;function e(i,s){var o={};n.forEach(i,function(l,u){var c=o[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};n.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),n.forEach(s.edges(),function(l){var u=o[l.v],c=o[l.w];!n.isUndefined(u)&&!n.isUndefined(c)&&(c.indegree++,u.out.push(o[l.w]))});var a=n.filter(o,function(l){return!l.indegree});return t(a)}function t(i){var s=[];function o(u){return function(c){c.merged||(n.isUndefined(c.barycenter)||n.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&r(u,c)}}function a(u){return function(c){c.in.push(u),--c.indegree===0&&i.push(c)}}for(;i.length;){var l=i.pop();s.push(l),n.forEach(l.in.reverse(),o(l)),n.forEach(l.out,a(l))}return n.map(n.filter(s,function(u){return!u.merged}),function(u){return n.pick(u,["vs","i","barycenter","weight"])})}function r(i,s){var o=0,a=0;i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),s.weight&&(o+=s.barycenter*s.weight,a+=s.weight),i.vs=s.vs.concat(i.vs),i.barycenter=o/a,i.weight=a,i.i=Math.min(s.i,i.i),s.merged=!0}return hp}var fp,WS;function h$(){if(WS)return fp;WS=1;var n=Je(),e=Tt();fp=t;function t(s,o){var a=e.partition(s,function(g){return n.has(g,"barycenter")}),l=a.lhs,u=n.sortBy(a.rhs,function(g){return-g.i}),c=[],h=0,f=0,d=0;l.sort(i(!!o)),d=r(c,u,d),n.forEach(l,function(g){d+=g.vs.length,c.push(g.vs),h+=g.barycenter*g.weight,f+=g.weight,d=r(c,u,d)});var p={vs:n.flatten(c,!0)};return f&&(p.barycenter=h/f,p.weight=f),p}function r(s,o,a){for(var l;o.length&&(l=n.last(o)).i<=a;)o.pop(),s.push(l.vs),a++;return a}function i(s){return function(o,a){return o.barycenter<a.barycenter?-1:o.barycenter>a.barycenter?1:s?a.i-o.i:o.i-a.i}}return fp}var dp,GS;function f$(){if(GS)return dp;GS=1;var n=Je(),e=u$(),t=c$(),r=h$();dp=i;function i(a,l,u,c){var h=a.children(l),f=a.node(l),d=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,g={};d&&(h=n.filter(h,function(w){return w!==d&&w!==p}));var m=e(a,h);n.forEach(m,function(w){if(a.children(w.v).length){var x=i(a,w.v,u,c);g[w.v]=x,n.has(x,"barycenter")&&o(w,x)}});var v=t(m,u);s(v,g);var y=r(v,c);if(d&&(y.vs=n.flatten([d,y.vs,p],!0),a.predecessors(d).length)){var b=a.node(a.predecessors(d)[0]),_=a.node(a.predecessors(p)[0]);n.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.order+_.order)/(y.weight+2),y.weight+=2}return y}function s(a,l){n.forEach(a,function(u){u.vs=n.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function o(a,l){n.isUndefined(a.barycenter)?(a.barycenter=l.barycenter,a.weight=l.weight):(a.barycenter=(a.barycenter*a.weight+l.barycenter*l.weight)/(a.weight+l.weight),a.weight+=l.weight)}return dp}var pp,HS;function d$(){if(HS)return pp;HS=1;var n=Je(),e=Zt().Graph;pp=t;function t(i,s,o){var a=r(i),l=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(u){return i.node(u)});return n.forEach(i.nodes(),function(u){var c=i.node(u),h=i.parent(u);(c.rank===s||c.minRank<=s&&s<=c.maxRank)&&(l.setNode(u),l.setParent(u,h||a),n.forEach(i[o](u),function(f){var d=f.v===u?f.w:f.v,p=l.edge(d,u),g=n.isUndefined(p)?0:p.weight;l.setEdge(d,u,{weight:i.edge(f).weight+g})}),n.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[s],borderRight:c.borderRight[s]}))}),l}function r(i){for(var s;i.hasNode(s=n.uniqueId("_root")););return s}return pp}var gp,KS;function p$(){if(KS)return gp;KS=1;var n=Je();gp=e;function e(t,r,i){var s={},o;n.forEach(i,function(a){for(var l=t.parent(a),u,c;l;){if(u=t.parent(l),u?(c=s[u],s[u]=l):(c=o,o=l),c&&c!==l){r.setEdge(c,l);return}l=u}})}return gp}var mp,YS;function g$(){if(YS)return mp;YS=1;var n=Je(),e=a$(),t=l$(),r=f$(),i=d$(),s=p$(),o=Zt().Graph,a=Tt();mp=l;function l(f){var d=a.maxRank(f),p=u(f,n.range(1,d+1),"inEdges"),g=u(f,n.range(d-1,-1,-1),"outEdges"),m=e(f);h(f,m);for(var v=Number.POSITIVE_INFINITY,y,b=0,_=0;_<4;++b,++_){c(b%2?p:g,b%4>=2),m=a.buildLayerMatrix(f);var w=t(f,m);w<v&&(_=0,y=n.cloneDeep(m),v=w)}h(f,y)}function u(f,d,p){return n.map(d,function(g){return i(f,g,p)})}function c(f,d){var p=new o;n.forEach(f,function(g){var m=g.graph().root,v=r(g,m,p,d);n.forEach(v.vs,function(y,b){g.node(y).order=b}),s(g,p,v.vs)})}function h(f,d){n.forEach(d,function(p){n.forEach(p,function(g,m){f.node(g).order=m})})}return mp}var yp,JS;function m$(){if(JS)return yp;JS=1;var n=Je(),e=Zt().Graph,t=Tt();yp={positionX:p,findType1Conflicts:r,findType2Conflicts:i,addConflict:o,hasConflict:a,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:d};function r(v,y){var b={};function _(w,x){var E=0,A=0,O=w.length,T=n.last(x);return n.forEach(x,function(M,C){var k=s(v,M),N=k?v.node(k).order:O;(k||M===T)&&(n.forEach(x.slice(A,C+1),function(R){n.forEach(v.predecessors(R),function($){var G=v.node($),H=G.order;(H<E||N<H)&&!(G.dummy&&v.node(R).dummy)&&o(b,$,R)})}),A=C+1,E=N)}),x}return n.reduce(y,_),b}function i(v,y){var b={};function _(x,E,A,O,T){var M;n.forEach(n.range(E,A),function(C){M=x[C],v.node(M).dummy&&n.forEach(v.predecessors(M),function(k){var N=v.node(k);N.dummy&&(N.order<O||N.order>T)&&o(b,k,M)})})}function w(x,E){var A=-1,O,T=0;return n.forEach(E,function(M,C){if(v.node(M).dummy==="border"){var k=v.predecessors(M);k.length&&(O=v.node(k[0]).order,_(E,T,C,A,O),T=C,A=O)}_(E,T,E.length,O,x.length)}),E}return n.reduce(y,w),b}function s(v,y){if(v.node(y).dummy)return n.find(v.predecessors(y),function(b){return v.node(b).dummy})}function o(v,y,b){if(y>b){var _=y;y=b,b=_}var w=v[y];w||(v[y]=w={}),w[b]=!0}function a(v,y,b){if(y>b){var _=y;y=b,b=_}return n.has(v[y],b)}function l(v,y,b,_){var w={},x={},E={};return n.forEach(y,function(A){n.forEach(A,function(O,T){w[O]=O,x[O]=O,E[O]=T})}),n.forEach(y,function(A){var O=-1;n.forEach(A,function(T){var M=_(T);if(M.length){M=n.sortBy(M,function($){return E[$]});for(var C=(M.length-1)/2,k=Math.floor(C),N=Math.ceil(C);k<=N;++k){var R=M[k];x[T]===T&&O<E[R]&&!a(b,T,R)&&(x[R]=T,x[T]=w[T]=w[R],O=E[R])}}})}),{root:w,align:x}}function u(v,y,b,_,w){var x={},E=c(v,y,b,w),A=w?"borderLeft":"borderRight";function O(C,k){for(var N=E.nodes(),R=N.pop(),$={};R;)$[R]?C(R):($[R]=!0,N.push(R),N=N.concat(k(R))),R=N.pop()}function T(C){x[C]=E.inEdges(C).reduce(function(k,N){return Math.max(k,x[N.v]+E.edge(N))},0)}function M(C){var k=E.outEdges(C).reduce(function(R,$){return Math.min(R,x[$.w]-E.edge($))},Number.POSITIVE_INFINITY),N=v.node(C);k!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(x[C]=Math.max(x[C],k))}return O(T,E.predecessors.bind(E)),O(M,E.successors.bind(E)),n.forEach(_,function(C){x[C]=x[b[C]]}),x}function c(v,y,b,_){var w=new e,x=v.graph(),E=g(x.nodesep,x.edgesep,_);return n.forEach(y,function(A){var O;n.forEach(A,function(T){var M=b[T];if(w.setNode(M),O){var C=b[O],k=w.edge(C,M);w.setEdge(C,M,Math.max(E(v,T,O),k||0))}O=T})}),w}function h(v,y){return n.minBy(n.values(y),function(b){var _=Number.NEGATIVE_INFINITY,w=Number.POSITIVE_INFINITY;return n.forIn(b,function(x,E){var A=m(v,E)/2;_=Math.max(x+A,_),w=Math.min(x-A,w)}),_-w})}function f(v,y){var b=n.values(y),_=n.min(b),w=n.max(b);n.forEach(["u","d"],function(x){n.forEach(["l","r"],function(E){var A=x+E,O=v[A],T;if(O!==y){var M=n.values(O);T=E==="l"?_-n.min(M):w-n.max(M),T&&(v[A]=n.mapValues(O,function(C){return C+T}))}})})}function d(v,y){return n.mapValues(v.ul,function(b,_){if(y)return v[y.toLowerCase()][_];var w=n.sortBy(n.map(v,_));return(w[1]+w[2])/2})}function p(v){var y=t.buildLayerMatrix(v),b=n.merge(r(v,y),i(v,y)),_={},w;n.forEach(["u","d"],function(E){w=E==="u"?y:n.values(y).reverse(),n.forEach(["l","r"],function(A){A==="r"&&(w=n.map(w,function(C){return n.values(C).reverse()}));var O=(E==="u"?v.predecessors:v.successors).bind(v),T=l(v,w,b,O),M=u(v,w,T.root,T.align,A==="r");A==="r"&&(M=n.mapValues(M,function(C){return-C})),_[E+A]=M})});var x=h(v,_);return f(_,x),d(_,v.graph().align)}function g(v,y,b){return function(_,w,x){var E=_.node(w),A=_.node(x),O=0,T;if(O+=E.width/2,n.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":T=-E.width/2;break;case"r":T=E.width/2;break}if(T&&(O+=b?T:-T),T=0,O+=(E.dummy?y:v)/2,O+=(A.dummy?y:v)/2,O+=A.width/2,n.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":T=A.width/2;break;case"r":T=-A.width/2;break}return T&&(O+=b?T:-T),T=0,O}}function m(v,y){return v.node(y).width}return yp}var bp,XS;function y$(){if(XS)return bp;XS=1;var n=Je(),e=Tt(),t=m$().positionX;bp=r;function r(s){s=e.asNonCompoundGraph(s),i(s),n.forEach(t(s),function(o,a){s.node(a).x=o})}function i(s){var o=e.buildLayerMatrix(s),a=s.graph().ranksep,l=0;n.forEach(o,function(u){var c=n.max(n.map(u,function(h){return s.node(h).height}));n.forEach(u,function(h){s.node(h).y=l+c/2}),l+=c+a})}return bp}var vp,QS;function b$(){if(QS)return vp;QS=1;var n=Je(),e=Z3(),t=e$(),r=r$(),i=Tt().normalizeRanks,s=n$(),o=Tt().removeEmptyRanks,a=i$(),l=s$(),u=o$(),c=g$(),h=y$(),f=Tt(),d=Zt().Graph;vp=p;function p(U,q){var re=q&&q.debugTiming?f.time:f.notime;re("layout",function(){var F=re(" buildLayoutGraph",function(){return O(U)});re(" runLayout",function(){g(F,re)}),re(" updateInputGraph",function(){m(U,F)})})}function g(U,q){q(" makeSpaceForEdgeLabels",function(){T(U)}),q(" removeSelfEdges",function(){se(U)}),q(" acyclic",function(){e.run(U)}),q(" nestingGraph.run",function(){a.run(U)}),q(" rank",function(){r(f.asNonCompoundGraph(U))}),q(" injectEdgeLabelProxies",function(){M(U)}),q(" removeEmptyRanks",function(){o(U)}),q(" nestingGraph.cleanup",function(){a.cleanup(U)}),q(" normalizeRanks",function(){i(U)}),q(" assignRankMinMax",function(){C(U)}),q(" removeEdgeLabelProxies",function(){k(U)}),q(" normalize.run",function(){t.run(U)}),q(" parentDummyChains",function(){s(U)}),q(" addBorderSegments",function(){l(U)}),q(" order",function(){c(U)}),q(" insertSelfEdges",function(){V(U)}),q(" adjustCoordinateSystem",function(){u.adjust(U)}),q(" position",function(){h(U)}),q(" positionSelfEdges",function(){te(U)}),q(" removeBorderNodes",function(){H(U)}),q(" normalize.undo",function(){t.undo(U)}),q(" fixupEdgeLabelCoords",function(){$(U)}),q(" undoCoordinateSystem",function(){u.undo(U)}),q(" translateGraph",function(){N(U)}),q(" assignNodeIntersects",function(){R(U)}),q(" reversePoints",function(){G(U)}),q(" acyclic.undo",function(){e.undo(U)})}function m(U,q){n.forEach(U.nodes(),function(re){var F=U.node(re),D=q.node(re);F&&(F.x=D.x,F.y=D.y,q.children(re).length&&(F.width=D.width,F.height=D.height))}),n.forEach(U.edges(),function(re){var F=U.edge(re),D=q.edge(re);F.points=D.points,n.has(D,"x")&&(F.x=D.x,F.y=D.y)}),U.graph().width=q.graph().width,U.graph().height=q.graph().height}var v=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],_=["width","height"],w={width:0,height:0},x=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function O(U){var q=new d({multigraph:!0,compound:!0}),re=ne(U.graph());return q.setGraph(n.merge({},y,B(re,v),n.pick(re,b))),n.forEach(U.nodes(),function(F){var D=ne(U.node(F));q.setNode(F,n.defaults(B(D,_),w)),q.setParent(F,U.parent(F))}),n.forEach(U.edges(),function(F){var D=ne(U.edge(F));q.setEdge(F,n.merge({},E,B(D,x),n.pick(D,A)))}),q}function T(U){var q=U.graph();q.ranksep/=2,n.forEach(U.edges(),function(re){var F=U.edge(re);F.minlen*=2,F.labelpos.toLowerCase()!=="c"&&(q.rankdir==="TB"||q.rankdir==="BT"?F.width+=F.labeloffset:F.height+=F.labeloffset)})}function M(U){n.forEach(U.edges(),function(q){var re=U.edge(q);if(re.width&&re.height){var F=U.node(q.v),D=U.node(q.w),ae={rank:(D.rank-F.rank)/2+F.rank,e:q};f.addDummyNode(U,"edge-proxy",ae,"_ep")}})}function C(U){var q=0;n.forEach(U.nodes(),function(re){var F=U.node(re);F.borderTop&&(F.minRank=U.node(F.borderTop).rank,F.maxRank=U.node(F.borderBottom).rank,q=n.max(q,F.maxRank))}),U.graph().maxRank=q}function k(U){n.forEach(U.nodes(),function(q){var re=U.node(q);re.dummy==="edge-proxy"&&(U.edge(re.e).labelRank=re.rank,U.removeNode(q))})}function N(U){var q=Number.POSITIVE_INFINITY,re=0,F=Number.POSITIVE_INFINITY,D=0,ae=U.graph(),Y=ae.marginx||0,Q=ae.marginy||0;function ie(ye){var ue=ye.x,L=ye.y,J=ye.width,ee=ye.height;q=Math.min(q,ue-J/2),re=Math.max(re,ue+J/2),F=Math.min(F,L-ee/2),D=Math.max(D,L+ee/2)}n.forEach(U.nodes(),function(ye){ie(U.node(ye))}),n.forEach(U.edges(),function(ye){var ue=U.edge(ye);n.has(ue,"x")&&ie(ue)}),q-=Y,F-=Q,n.forEach(U.nodes(),function(ye){var ue=U.node(ye);ue.x-=q,ue.y-=F}),n.forEach(U.edges(),function(ye){var ue=U.edge(ye);n.forEach(ue.points,function(L){L.x-=q,L.y-=F}),n.has(ue,"x")&&(ue.x-=q),n.has(ue,"y")&&(ue.y-=F)}),ae.width=re-q+Y,ae.height=D-F+Q}function R(U){n.forEach(U.edges(),function(q){var re=U.edge(q),F=U.node(q.v),D=U.node(q.w),ae,Y;re.points?(ae=re.points[0],Y=re.points[re.points.length-1]):(re.points=[],ae=D,Y=F),re.points.unshift(f.intersectRect(F,ae)),re.points.push(f.intersectRect(D,Y))})}function $(U){n.forEach(U.edges(),function(q){var re=U.edge(q);if(n.has(re,"x"))switch((re.labelpos==="l"||re.labelpos==="r")&&(re.width-=re.labeloffset),re.labelpos){case"l":re.x-=re.width/2+re.labeloffset;break;case"r":re.x+=re.width/2+re.labeloffset;break}})}function G(U){n.forEach(U.edges(),function(q){var re=U.edge(q);re.reversed&&re.points.reverse()})}function H(U){n.forEach(U.nodes(),function(q){if(U.children(q).length){var re=U.node(q),F=U.node(re.borderTop),D=U.node(re.borderBottom),ae=U.node(n.last(re.borderLeft)),Y=U.node(n.last(re.borderRight));re.width=Math.abs(Y.x-ae.x),re.height=Math.abs(D.y-F.y),re.x=ae.x+re.width/2,re.y=F.y+re.height/2}}),n.forEach(U.nodes(),function(q){U.node(q).dummy==="border"&&U.removeNode(q)})}function se(U){n.forEach(U.edges(),function(q){if(q.v===q.w){var re=U.node(q.v);re.selfEdges||(re.selfEdges=[]),re.selfEdges.push({e:q,label:U.edge(q)}),U.removeEdge(q)}})}function V(U){var q=f.buildLayerMatrix(U);n.forEach(q,function(re){var F=0;n.forEach(re,function(D,ae){var Y=U.node(D);Y.order=ae+F,n.forEach(Y.selfEdges,function(Q){f.addDummyNode(U,"selfedge",{width:Q.label.width,height:Q.label.height,rank:Y.rank,order:ae+ ++F,e:Q.e,label:Q.label},"_se")}),delete Y.selfEdges})})}function te(U){n.forEach(U.nodes(),function(q){var re=U.node(q);if(re.dummy==="selfedge"){var F=U.node(re.e.v),D=F.x+F.width/2,ae=F.y,Y=re.x-D,Q=F.height/2;U.setEdge(re.e,re.label),U.removeNode(q),re.label.points=[{x:D+2*Y/3,y:ae-Q},{x:D+5*Y/6,y:ae-Q},{x:D+Y,y:ae},{x:D+5*Y/6,y:ae+Q},{x:D+2*Y/3,y:ae+Q}],re.label.x=re.x,re.label.y=re.y}})}function B(U,q){return n.mapValues(n.pick(U,q),Number)}function ne(U){var q={};return n.forEach(U,function(re,F){q[F.toLowerCase()]=re}),q}return vp}var wp,ZS;function v$(){if(ZS)return wp;ZS=1;var n=Je(),e=Tt(),t=Zt().Graph;wp={debugOrdering:r};function r(i){var s=e.buildLayerMatrix(i),o=new t({compound:!0,multigraph:!0}).setGraph({});return n.forEach(i.nodes(),function(a){o.setNode(a,{label:a}),o.setParent(a,"layer"+i.node(a).rank)}),n.forEach(i.edges(),function(a){o.setEdge(a.v,a.w,{},a.name)}),n.forEach(s,function(a,l){var u="layer"+l;o.setNode(u,{rank:"same"}),n.reduce(a,function(c,h){return o.setEdge(c,h,{style:"invis"}),h})}),o}return wp}var _p,eA;function w$(){return eA||(eA=1,_p="0.8.5"),_p}var xp,tA;function _$(){return tA||(tA=1,xp={graphlib:Zt(),layout:b$(),debug:v$(),util:{time:Tt().time,notime:Tt().notime},version:w$()}),xp}var x$=_$();const rA=oq(x$);function E$(n){let e;const t={panning:!0,interacting:!1,mousewheel:{enabled:!0},scaling:{min:.1,max:10}};function r(d){const p=Dm(t,n);e=new wt({container:d,...p})}function i(d){e.resetCells(d)}function s(d,p="LR"){const{node_w:g,node_h:m,nodesep:v,ranksep:y}=d,b=e.getNodes(),_=e.getEdges(),w=new rA.graphlib.Graph;w.setGraph({rankdir:p,nodesep:v,ranksep:y}),w.setDefaultEdgeLabel(()=>({}));const x=g,E=m;b.forEach(A=>{w.setNode(A.id,{width:x,height:E})}),_.forEach(A=>{const O=A.getSource(),T=A.getTarget();w.setEdge(O.cell,T.cell)}),rA.layout(w),w.nodes().forEach(A=>{const O=e.getCellById(A);if(O){const T=w.node(A);O.position(T.x,T.y)}}),_.forEach(A=>{const O=A.getSourceNode(),T=A.getTargetNode(),M=O.getBBox(),C=T.getBBox();if((p==="LR"||p==="RL")&&M.y!==C.y){const k=p==="LR"?C.x-M.x-M.width:-M.x+C.x+C.width,N=p==="LR"?M.width:0,R=M.x+N+k/2;A.setVertices([{x:R,y:M.center.y},{x:R,y:C.center.y}])}else if((p==="TB"||p==="BT")&&M.x!==C.x){const k=p==="TB"?C.y-M.y-M.height:-M.y+C.y+C.height,N=p==="TB"?M.height:0,R=M.y+N+k/2;A.setVertices([{x:M.center.x,y:R},{x:C.center.x,y:R}])}else A.setVertices([])})}function o(d){e.zoomToFit({padding:d,maxScale:1.2}),e.centerContent()}function a(d){const p=[];return d.forEach(g=>{const m=e.createNode(g);p.push(m)}),p}function l(d){const p=[];return d.forEach(g=>{const m=e.createEdge({shape:g.shape,source:{cell:g.source_id},target:{cell:g.target_id}});p.push(m)}),p}function u(d){Object.keys(d).forEach(g=>{const m=d[g];d[g]=p(m,"g",e),e.on(g,d[g])});function p(g,m,v){return function(...y){return y[0][m]=v,g.apply(this,y)}}}function c(d){Object.keys(d.nodes).forEach(p=>{const g=d.nodes[p];wt.registerNode(p,g,!0)}),Object.keys(d.edges).forEach(p=>{const g=d.edges[p];wt.registerEdge(p,g,!0)})}function h(){return e.getNodes()}function f(){e?.clearCells()}return{init:r,add_graph_elements:i,layout:s,center_content:o,createNodes:a,createEdges:l,register_event:u,register_custom_elements:c,get_nodes:h,clear:f}}var Ep=Object.defineProperty,S$=Object.getOwnPropertyDescriptor,A$=Object.getOwnPropertyNames,P$=Object.prototype.hasOwnProperty,Mt=(n,e)=>()=>(n&&(e=n(n=0)),e),ve=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),bi=(n,e)=>{for(var t in e)Ep(n,t,{get:e[t],enumerable:!0})},O$=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of A$(e))!P$.call(n,i)&&i!==t&&Ep(n,i,{get:()=>e[i],enumerable:!(r=S$(e,i))||r.enumerable});return n},$e=n=>O$(Ep({},"__esModule",{value:!0}),n),pe=Mt(()=>{}),Ge={};bi(Ge,{_debugEnd:()=>ig,_debugProcess:()=>ng,_events:()=>wg,_eventsCount:()=>_g,_exiting:()=>zp,_fatalExceptions:()=>eg,_getActiveHandles:()=>uA,_getActiveRequests:()=>lA,_kill:()=>Gp,_linkedBinding:()=>oA,_maxListeners:()=>vg,_preload_modules:()=>mg,_rawDebug:()=>Fp,_startProfilerIdleNotifier:()=>sg,_stopProfilerIdleNotifier:()=>og,_tickCallback:()=>rg,abort:()=>cg,addListener:()=>xg,allowedNodeEnvironmentFlags:()=>Qp,arch:()=>Pp,argv:()=>Tp,argv0:()=>gg,assert:()=>cA,binding:()=>Np,browser:()=>qp,chdir:()=>Dp,config:()=>Vp,cpuUsage:()=>ps,cwd:()=>Lp,debugPort:()=>pg,default:()=>Mg,dlopen:()=>aA,domain:()=>Up,emit:()=>Og,emitWarning:()=>kp,env:()=>Cp,execArgv:()=>Mp,execPath:()=>dg,exit:()=>Jp,features:()=>Zp,hasUncaughtExceptionCaptureCallback:()=>hA,hrtime:()=>Fo,kill:()=>Yp,listeners:()=>dA,memoryUsage:()=>Kp,moduleLoadList:()=>$p,nextTick:()=>iA,off:()=>Sg,on:()=>Tr,once:()=>Eg,openStdin:()=>Xp,pid:()=>hg,platform:()=>Op,ppid:()=>fg,prependListener:()=>Cg,prependOnceListener:()=>Tg,reallyExit:()=>Wp,release:()=>Bp,removeAllListeners:()=>Pg,removeListener:()=>Ag,resourceUsage:()=>Hp,setSourceMapsEnabled:()=>yg,setUncaughtExceptionCaptureCallback:()=>tg,stderr:()=>lg,stdin:()=>ug,stdout:()=>ag,title:()=>Ap,umask:()=>jp,uptime:()=>fA,version:()=>Ip,versions:()=>Rp});function Sp(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function C$(){!Sn||!An||(Sn=!1,An.length?lr=An.concat(lr):ds=-1,lr.length&&nA())}function nA(){if(!Sn){var n=setTimeout(C$,0);Sn=!0;for(var e=lr.length;e;){for(An=lr,lr=[];++ds<e;)An&&An[ds].run();ds=-1,e=lr.length}An=null,Sn=!1,clearTimeout(n)}}function iA(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];lr.push(new sA(n,e)),lr.length===1&&!Sn&&setTimeout(nA,0)}function sA(n,e){this.fun=n,this.array=e}function Et(){}function oA(n){Sp("_linkedBinding")}function aA(n){Sp("dlopen")}function lA(){return[]}function uA(){return[]}function cA(n,e){if(!n)throw new Error(e||"assertion error")}function hA(){return!1}function fA(){return Mr.now()/1e3}function Fo(n){var e=Math.floor((Date.now()-Mr.now())*.001),t=Mr.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=$o)),[r,i]}function Tr(){return Mg}function dA(n){return[]}var lr,Sn,An,ds,Ap,Pp,Op,Cp,Tp,Mp,Ip,Rp,kp,Np,jp,Lp,Dp,Bp,qp,Fp,$p,Up,zp,Vp,Wp,Gp,ps,Hp,Kp,Yp,Jp,Xp,Qp,Zp,eg,tg,rg,ng,ig,sg,og,ag,lg,ug,cg,hg,fg,dg,pg,gg,mg,yg,Mr,bg,$o,vg,wg,_g,xg,Eg,Sg,Ag,Pg,Og,Cg,Tg,Mg,T$=Mt(()=>{pe(),me(),ge(),lr=[],Sn=!1,ds=-1,sA.prototype.run=function(){this.fun.apply(null,this.array)},Ap="browser",Pp="x64",Op="browser",Cp={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Tp=["/usr/bin/node"],Mp=[],Ip="v16.8.0",Rp={},kp=function(n,e){console.warn((e?e+": ":"")+n)},Np=function(n){Sp("binding")},jp=function(n){return 0},Lp=function(){return"/"},Dp=function(n){},Bp={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},qp=!0,Fp=Et,$p=[],Up={},zp=!1,Vp={},Wp=Et,Gp=Et,ps=function(){return{}},Hp=ps,Kp=ps,Yp=Et,Jp=Et,Xp=Et,Qp={},Zp={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},eg=Et,tg=Et,rg=Et,ng=Et,ig=Et,sg=Et,og=Et,ag=void 0,lg=void 0,ug=void 0,cg=Et,hg=2,fg=1,dg="/bin/usr/node",pg=9229,gg="node",mg=[],yg=Et,Mr={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Mr.now===void 0&&(bg=Date.now(),Mr.timing&&Mr.timing.navigationStart&&(bg=Mr.timing.navigationStart),Mr.now=()=>Date.now()-bg),$o=1e9,Fo.bigint=function(n){var e=Fo(n);return typeof BigInt>"u"?e[0]*$o+e[1]:BigInt(e[0]*$o)+BigInt(e[1])},vg=10,wg={},_g=0,xg=Tr,Eg=Tr,Sg=Tr,Ag=Tr,Pg=Tr,Og=Et,Cg=Tr,Tg=Tr,Mg={version:Ip,versions:Rp,arch:Pp,platform:Op,browser:qp,release:Bp,_rawDebug:Fp,moduleLoadList:$p,binding:Np,_linkedBinding:oA,_events:wg,_eventsCount:_g,_maxListeners:vg,on:Tr,addListener:xg,once:Eg,off:Sg,removeListener:Ag,removeAllListeners:Pg,emit:Og,prependListener:Cg,prependOnceListener:Tg,listeners:dA,domain:Up,_exiting:zp,config:Vp,dlopen:aA,uptime:fA,_getActiveRequests:lA,_getActiveHandles:uA,reallyExit:Wp,_kill:Gp,cpuUsage:ps,resourceUsage:Hp,memoryUsage:Kp,kill:Yp,exit:Jp,openStdin:Xp,allowedNodeEnvironmentFlags:Qp,assert:cA,features:Zp,_fatalExceptions:eg,setUncaughtExceptionCaptureCallback:tg,hasUncaughtExceptionCaptureCallback:hA,emitWarning:kp,nextTick:iA,_tickCallback:rg,_debugProcess:ng,_debugEnd:ig,_startProfilerIdleNotifier:sg,_stopProfilerIdleNotifier:og,stdout:ag,stdin:ug,stderr:lg,abort:cg,umask:jp,chdir:Dp,cwd:Lp,env:Cp,title:Ap,argv:Tp,execArgv:Mp,pid:hg,ppid:fg,execPath:dg,debugPort:pg,hrtime:Fo,argv0:gg,_preload_modules:mg,setSourceMapsEnabled:yg}}),ge=Mt(()=>{T$()});function M$(){if(Ig)return vi;Ig=!0,vi.byteLength=a,vi.toByteArray=u,vi.fromByteArray=f;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(d){var p=d.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=d.indexOf("=");g===-1&&(g=p);var m=g===p?0:4-g%4;return[g,m]}function a(d){var p=o(d),g=p[0],m=p[1];return(g+m)*3/4-m}function l(d,p,g){return(p+g)*3/4-g}function u(d){var p,g=o(d),m=g[0],v=g[1],y=new t(l(d,m,v)),b=0,_=v>0?m-4:m,w;for(w=0;w<_;w+=4)p=e[d.charCodeAt(w)]<<18|e[d.charCodeAt(w+1)]<<12|e[d.charCodeAt(w+2)]<<6|e[d.charCodeAt(w+3)],y[b++]=p>>16&255,y[b++]=p>>8&255,y[b++]=p&255;return v===2&&(p=e[d.charCodeAt(w)]<<2|e[d.charCodeAt(w+1)]>>4,y[b++]=p&255),v===1&&(p=e[d.charCodeAt(w)]<<10|e[d.charCodeAt(w+1)]<<4|e[d.charCodeAt(w+2)]>>2,y[b++]=p>>8&255,y[b++]=p&255),y}function c(d){return n[d>>18&63]+n[d>>12&63]+n[d>>6&63]+n[d&63]}function h(d,p,g){for(var m,v=[],y=p;y<g;y+=3)m=(d[y]<<16&16711680)+(d[y+1]<<8&65280)+(d[y+2]&255),v.push(c(m));return v.join("")}function f(d){for(var p,g=d.length,m=g%3,v=[],y=16383,b=0,_=g-m;b<_;b+=y)v.push(h(d,b,b+y>_?_:b+y));return m===1?(p=d[g-1],v.push(n[p>>2]+n[p<<4&63]+"==")):m===2&&(p=(d[g-2]<<8)+d[g-1],v.push(n[p>>10]+n[p>>4&63]+n[p<<2&63]+"=")),v.join("")}return vi}function I$(){return Rg?gs:(Rg=!0,gs.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,h=t?i-1:0,f=t?-1:1,d=n[e+h];for(h+=f,s=d&(1<<-c)-1,d>>=-c,c+=a;c>0;s=s*256+n[e+h],h+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+h],h+=f,c-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(d?-1:1)*o*Math.pow(2,s-r)},gs.write=function(n,e,t,r,i,s){var o,a,l,u=s*8-i-1,c=(1<<u)-1,h=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,p=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?e+=f/l:e+=f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*l-1)*Math.pow(2,i),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;n[t+d]=a&255,d+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;n[t+d]=o&255,d+=p,o/=256,u-=8);n[t+d-p]|=g*128},gs)}function R$(){if(kg)return en;kg=!0;let n=M$(),e=I$(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;en.Buffer=o,en.SlowBuffer=v,en.INSPECT_MAX_BYTES=50;let r=2147483647;en.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let S=new Uint8Array(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(S,P),S.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(S){if(S>r)throw new RangeError('The value "'+S+'" is invalid for option "size"');let P=new Uint8Array(S);return Object.setPrototypeOf(P,o.prototype),P}function o(S,P,I){if(typeof S=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(S)}return a(S,P,I)}o.poolSize=8192;function a(S,P,I){if(typeof S=="string")return h(S,P);if(ArrayBuffer.isView(S))return d(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(X(S,ArrayBuffer)||S&&X(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(X(S,SharedArrayBuffer)||S&&X(S.buffer,SharedArrayBuffer)))return p(S,P,I);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let K=S.valueOf&&S.valueOf();if(K!=null&&K!==S)return o.from(K,P,I);let oe=g(S);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return o.from(S[Symbol.toPrimitive]("string"),P,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}o.from=function(S,P,I){return a(S,P,I)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function u(S,P,I){return l(S),S<=0?s(S):P!==void 0?typeof I=="string"?s(S).fill(P,I):s(S).fill(P):s(S)}o.alloc=function(S,P,I){return u(S,P,I)};function c(S){return l(S),s(S<0?0:m(S)|0)}o.allocUnsafe=function(S){return c(S)},o.allocUnsafeSlow=function(S){return c(S)};function h(S,P){if((typeof P!="string"||P==="")&&(P="utf8"),!o.isEncoding(P))throw new TypeError("Unknown encoding: "+P);let I=y(S,P)|0,K=s(I),oe=K.write(S,P);return oe!==I&&(K=K.slice(0,oe)),K}function f(S){let P=S.length<0?0:m(S.length)|0,I=s(P);for(let K=0;K<P;K+=1)I[K]=S[K]&255;return I}function d(S){if(X(S,Uint8Array)){let P=new Uint8Array(S);return p(P.buffer,P.byteOffset,P.byteLength)}return f(S)}function p(S,P,I){if(P<0||S.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<P+(I||0))throw new RangeError('"length" is outside of buffer bounds');let K;return P===void 0&&I===void 0?K=new Uint8Array(S):I===void 0?K=new Uint8Array(S,P):K=new Uint8Array(S,P,I),Object.setPrototypeOf(K,o.prototype),K}function g(S){if(o.isBuffer(S)){let P=m(S.length)|0,I=s(P);return I.length===0||S.copy(I,0,0,P),I}if(S.length!==void 0)return typeof S.length!="number"||be(S.length)?s(0):f(S);if(S.type==="Buffer"&&Array.isArray(S.data))return f(S.data)}function m(S){if(S>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return S|0}function v(S){return+S!=S&&(S=0),o.alloc(+S)}o.isBuffer=function(S){return S!=null&&S._isBuffer===!0&&S!==o.prototype},o.compare=function(S,P){if(X(S,Uint8Array)&&(S=o.from(S,S.offset,S.byteLength)),X(P,Uint8Array)&&(P=o.from(P,P.offset,P.byteLength)),!o.isBuffer(S)||!o.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===P)return 0;let I=S.length,K=P.length;for(let oe=0,de=Math.min(I,K);oe<de;++oe)if(S[oe]!==P[oe]){I=S[oe],K=P[oe];break}return I<K?-1:K<I?1:0},o.isEncoding=function(S){switch(String(S).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(S,P){if(!Array.isArray(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return o.alloc(0);let I;if(P===void 0)for(P=0,I=0;I<S.length;++I)P+=S[I].length;let K=o.allocUnsafe(P),oe=0;for(I=0;I<S.length;++I){let de=S[I];if(X(de,Uint8Array))oe+de.length>K.length?(o.isBuffer(de)||(de=o.from(de)),de.copy(K,oe)):Uint8Array.prototype.set.call(K,de,oe);else if(o.isBuffer(de))de.copy(K,oe);else throw new TypeError('"list" argument must be an Array of Buffers');oe+=de.length}return K};function y(S,P){if(o.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||X(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);let I=S.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&I===0)return 0;let oe=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return J(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return fe(S).length;default:if(oe)return K?-1:J(S).length;P=(""+P).toLowerCase(),oe=!0}}o.byteLength=y;function b(S,P,I){let K=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,P>>>=0,I<=P))return"";for(S||(S="utf8");;)switch(S){case"hex":return H(this,P,I);case"utf8":case"utf-8":return k(this,P,I);case"ascii":return $(this,P,I);case"latin1":case"binary":return G(this,P,I);case"base64":return C(this,P,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,P,I);default:if(K)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),K=!0}}o.prototype._isBuffer=!0;function _(S,P,I){let K=S[P];S[P]=S[I],S[I]=K}o.prototype.swap16=function(){let S=this.length;if(S%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<S;P+=2)_(this,P,P+1);return this},o.prototype.swap32=function(){let S=this.length;if(S%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<S;P+=4)_(this,P,P+3),_(this,P+1,P+2);return this},o.prototype.swap64=function(){let S=this.length;if(S%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<S;P+=8)_(this,P,P+7),_(this,P+1,P+6),_(this,P+2,P+5),_(this,P+3,P+4);return this},o.prototype.toString=function(){let S=this.length;return S===0?"":arguments.length===0?k(this,0,S):b.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(S){if(!o.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S?!0:o.compare(this,S)===0},o.prototype.inspect=function(){let S="",P=en.INSPECT_MAX_BYTES;return S=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(S+=" ... "),"<Buffer "+S+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(S,P,I,K,oe){if(X(S,Uint8Array)&&(S=o.from(S,S.offset,S.byteLength)),!o.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(P===void 0&&(P=0),I===void 0&&(I=S?S.length:0),K===void 0&&(K=0),oe===void 0&&(oe=this.length),P<0||I>S.length||K<0||oe>this.length)throw new RangeError("out of range index");if(K>=oe&&P>=I)return 0;if(K>=oe)return-1;if(P>=I)return 1;if(P>>>=0,I>>>=0,K>>>=0,oe>>>=0,this===S)return 0;let de=oe-K,xe=I-P,Z=Math.min(de,xe),le=this.slice(K,oe),Ce=S.slice(P,I);for(let Me=0;Me<Z;++Me)if(le[Me]!==Ce[Me]){de=le[Me],xe=Ce[Me];break}return de<xe?-1:xe<de?1:0};function w(S,P,I,K,oe){if(S.length===0)return-1;if(typeof I=="string"?(K=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,be(I)&&(I=oe?0:S.length-1),I<0&&(I=S.length+I),I>=S.length){if(oe)return-1;I=S.length-1}else if(I<0)if(oe)I=0;else return-1;if(typeof P=="string"&&(P=o.from(P,K)),o.isBuffer(P))return P.length===0?-1:x(S,P,I,K,oe);if(typeof P=="number")return P=P&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(S,P,I):Uint8Array.prototype.lastIndexOf.call(S,P,I):x(S,[P],I,K,oe);throw new TypeError("val must be string, number or Buffer")}function x(S,P,I,K,oe){let de=1,xe=S.length,Z=P.length;if(K!==void 0&&(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(S.length<2||P.length<2)return-1;de=2,xe/=2,Z/=2,I/=2}function le(Me,je){return de===1?Me[je]:Me.readUInt16BE(je*de)}let Ce;if(oe){let Me=-1;for(Ce=I;Ce<xe;Ce++)if(le(S,Ce)===le(P,Me===-1?0:Ce-Me)){if(Me===-1&&(Me=Ce),Ce-Me+1===Z)return Me*de}else Me!==-1&&(Ce-=Ce-Me),Me=-1}else for(I+Z>xe&&(I=xe-Z),Ce=I;Ce>=0;Ce--){let Me=!0;for(let je=0;je<Z;je++)if(le(S,Ce+je)!==le(P,je)){Me=!1;break}if(Me)return Ce}return-1}o.prototype.includes=function(S,P,I){return this.indexOf(S,P,I)!==-1},o.prototype.indexOf=function(S,P,I){return w(this,S,P,I,!0)},o.prototype.lastIndexOf=function(S,P,I){return w(this,S,P,I,!1)};function E(S,P,I,K){I=Number(I)||0;let oe=S.length-I;K?(K=Number(K),K>oe&&(K=oe)):K=oe;let de=P.length;K>de/2&&(K=de/2);let xe;for(xe=0;xe<K;++xe){let Z=parseInt(P.substr(xe*2,2),16);if(be(Z))return xe;S[I+xe]=Z}return xe}function A(S,P,I,K){return we(J(P,S.length-I),S,I,K)}function O(S,P,I,K){return we(ee(P),S,I,K)}function T(S,P,I,K){return we(fe(P),S,I,K)}function M(S,P,I,K){return we(he(P,S.length-I),S,I,K)}o.prototype.write=function(S,P,I,K){if(P===void 0)K="utf8",I=this.length,P=0;else if(I===void 0&&typeof P=="string")K=P,I=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(I)?(I=I>>>0,K===void 0&&(K="utf8")):(K=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let oe=this.length-P;if((I===void 0||I>oe)&&(I=oe),S.length>0&&(I<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");let de=!1;for(;;)switch(K){case"hex":return E(this,S,P,I);case"utf8":case"utf-8":return A(this,S,P,I);case"ascii":case"latin1":case"binary":return O(this,S,P,I);case"base64":return T(this,S,P,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,S,P,I);default:if(de)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),de=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(S,P,I){return P===0&&I===S.length?n.fromByteArray(S):n.fromByteArray(S.slice(P,I))}function k(S,P,I){I=Math.min(S.length,I);let K=[],oe=P;for(;oe<I;){let de=S[oe],xe=null,Z=de>239?4:de>223?3:de>191?2:1;if(oe+Z<=I){let le,Ce,Me,je;switch(Z){case 1:de<128&&(xe=de);break;case 2:le=S[oe+1],(le&192)===128&&(je=(de&31)<<6|le&63,je>127&&(xe=je));break;case 3:le=S[oe+1],Ce=S[oe+2],(le&192)===128&&(Ce&192)===128&&(je=(de&15)<<12|(le&63)<<6|Ce&63,je>2047&&(je<55296||je>57343)&&(xe=je));break;case 4:le=S[oe+1],Ce=S[oe+2],Me=S[oe+3],(le&192)===128&&(Ce&192)===128&&(Me&192)===128&&(je=(de&15)<<18|(le&63)<<12|(Ce&63)<<6|Me&63,je>65535&&je<1114112&&(xe=je))}}xe===null?(xe=65533,Z=1):xe>65535&&(xe-=65536,K.push(xe>>>10&1023|55296),xe=56320|xe&1023),K.push(xe),oe+=Z}return R(K)}let N=4096;function R(S){let P=S.length;if(P<=N)return String.fromCharCode.apply(String,S);let I="",K=0;for(;K<P;)I+=String.fromCharCode.apply(String,S.slice(K,K+=N));return I}function $(S,P,I){let K="";I=Math.min(S.length,I);for(let oe=P;oe<I;++oe)K+=String.fromCharCode(S[oe]&127);return K}function G(S,P,I){let K="";I=Math.min(S.length,I);for(let oe=P;oe<I;++oe)K+=String.fromCharCode(S[oe]);return K}function H(S,P,I){let K=S.length;(!P||P<0)&&(P=0),(!I||I<0||I>K)&&(I=K);let oe="";for(let de=P;de<I;++de)oe+=_e[S[de]];return oe}function se(S,P,I){let K=S.slice(P,I),oe="";for(let de=0;de<K.length-1;de+=2)oe+=String.fromCharCode(K[de]+K[de+1]*256);return oe}o.prototype.slice=function(S,P){let I=this.length;S=~~S,P=P===void 0?I:~~P,S<0?(S+=I,S<0&&(S=0)):S>I&&(S=I),P<0?(P+=I,P<0&&(P=0)):P>I&&(P=I),P<S&&(P=S);let K=this.subarray(S,P);return Object.setPrototypeOf(K,o.prototype),K};function V(S,P,I){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+P>I)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||V(S,P,this.length);let K=this[S],oe=1,de=0;for(;++de<P&&(oe*=256);)K+=this[S+de]*oe;return K},o.prototype.readUintBE=o.prototype.readUIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||V(S,P,this.length);let K=this[S+--P],oe=1;for(;P>0&&(oe*=256);)K+=this[S+--P]*oe;return K},o.prototype.readUint8=o.prototype.readUInt8=function(S,P){return S=S>>>0,P||V(S,1,this.length),this[S]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(S,P){return S=S>>>0,P||V(S,2,this.length),this[S]|this[S+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(S,P){return S=S>>>0,P||V(S,2,this.length),this[S]<<8|this[S+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(S,P){return S=S>>>0,P||V(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+this[S+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(S,P){return S=S>>>0,P||V(S,4,this.length),this[S]*16777216+(this[S+1]<<16|this[S+2]<<8|this[S+3])},o.prototype.readBigUInt64LE=ce(function(S){S=S>>>0,ie(S,"offset");let P=this[S],I=this[S+7];(P===void 0||I===void 0)&&ye(S,this.length-8);let K=P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24,oe=this[++S]+this[++S]*2**8+this[++S]*2**16+I*2**24;return BigInt(K)+(BigInt(oe)<<BigInt(32))}),o.prototype.readBigUInt64BE=ce(function(S){S=S>>>0,ie(S,"offset");let P=this[S],I=this[S+7];(P===void 0||I===void 0)&&ye(S,this.length-8);let K=P*2**24+this[++S]*2**16+this[++S]*2**8+this[++S],oe=this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I;return(BigInt(K)<<BigInt(32))+BigInt(oe)}),o.prototype.readIntLE=function(S,P,I){S=S>>>0,P=P>>>0,I||V(S,P,this.length);let K=this[S],oe=1,de=0;for(;++de<P&&(oe*=256);)K+=this[S+de]*oe;return oe*=128,K>=oe&&(K-=Math.pow(2,8*P)),K},o.prototype.readIntBE=function(S,P,I){S=S>>>0,P=P>>>0,I||V(S,P,this.length);let K=P,oe=1,de=this[S+--K];for(;K>0&&(oe*=256);)de+=this[S+--K]*oe;return oe*=128,de>=oe&&(de-=Math.pow(2,8*P)),de},o.prototype.readInt8=function(S,P){return S=S>>>0,P||V(S,1,this.length),this[S]&128?(255-this[S]+1)*-1:this[S]},o.prototype.readInt16LE=function(S,P){S=S>>>0,P||V(S,2,this.length);let I=this[S]|this[S+1]<<8;return I&32768?I|4294901760:I},o.prototype.readInt16BE=function(S,P){S=S>>>0,P||V(S,2,this.length);let I=this[S+1]|this[S]<<8;return I&32768?I|4294901760:I},o.prototype.readInt32LE=function(S,P){return S=S>>>0,P||V(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},o.prototype.readInt32BE=function(S,P){return S=S>>>0,P||V(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},o.prototype.readBigInt64LE=ce(function(S){S=S>>>0,ie(S,"offset");let P=this[S],I=this[S+7];(P===void 0||I===void 0)&&ye(S,this.length-8);let K=this[S+4]+this[S+5]*2**8+this[S+6]*2**16+(I<<24);return(BigInt(K)<<BigInt(32))+BigInt(P+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24)}),o.prototype.readBigInt64BE=ce(function(S){S=S>>>0,ie(S,"offset");let P=this[S],I=this[S+7];(P===void 0||I===void 0)&&ye(S,this.length-8);let K=(P<<24)+this[++S]*2**16+this[++S]*2**8+this[++S];return(BigInt(K)<<BigInt(32))+BigInt(this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+I)}),o.prototype.readFloatLE=function(S,P){return S=S>>>0,P||V(S,4,this.length),e.read(this,S,!0,23,4)},o.prototype.readFloatBE=function(S,P){return S=S>>>0,P||V(S,4,this.length),e.read(this,S,!1,23,4)},o.prototype.readDoubleLE=function(S,P){return S=S>>>0,P||V(S,8,this.length),e.read(this,S,!0,52,8)},o.prototype.readDoubleBE=function(S,P){return S=S>>>0,P||V(S,8,this.length),e.read(this,S,!1,52,8)};function te(S,P,I,K,oe,de){if(!o.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>oe||P<de)throw new RangeError('"value" argument is out of bounds');if(I+K>S.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(S,P,I,K){if(S=+S,P=P>>>0,I=I>>>0,!K){let xe=Math.pow(2,8*I)-1;te(this,S,P,I,xe,0)}let oe=1,de=0;for(this[P]=S&255;++de<I&&(oe*=256);)this[P+de]=S/oe&255;return P+I},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(S,P,I,K){if(S=+S,P=P>>>0,I=I>>>0,!K){let xe=Math.pow(2,8*I)-1;te(this,S,P,I,xe,0)}let oe=I-1,de=1;for(this[P+oe]=S&255;--oe>=0&&(de*=256);)this[P+oe]=S/de&255;return P+I},o.prototype.writeUint8=o.prototype.writeUInt8=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,1,255,0),this[P]=S&255,P+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,2,65535,0),this[P]=S&255,this[P+1]=S>>>8,P+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,2,65535,0),this[P]=S>>>8,this[P+1]=S&255,P+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,4,4294967295,0),this[P+3]=S>>>24,this[P+2]=S>>>16,this[P+1]=S>>>8,this[P]=S&255,P+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,4,4294967295,0),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4};function B(S,P,I,K,oe){Q(P,K,oe,S,I,7);let de=Number(P&BigInt(4294967295));S[I++]=de,de=de>>8,S[I++]=de,de=de>>8,S[I++]=de,de=de>>8,S[I++]=de;let xe=Number(P>>BigInt(32)&BigInt(4294967295));return S[I++]=xe,xe=xe>>8,S[I++]=xe,xe=xe>>8,S[I++]=xe,xe=xe>>8,S[I++]=xe,I}function ne(S,P,I,K,oe){Q(P,K,oe,S,I,7);let de=Number(P&BigInt(4294967295));S[I+7]=de,de=de>>8,S[I+6]=de,de=de>>8,S[I+5]=de,de=de>>8,S[I+4]=de;let xe=Number(P>>BigInt(32)&BigInt(4294967295));return S[I+3]=xe,xe=xe>>8,S[I+2]=xe,xe=xe>>8,S[I+1]=xe,xe=xe>>8,S[I]=xe,I+8}o.prototype.writeBigUInt64LE=ce(function(S,P=0){return B(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ce(function(S,P=0){return ne(this,S,P,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(S,P,I,K){if(S=+S,P=P>>>0,!K){let Z=Math.pow(2,8*I-1);te(this,S,P,I,Z-1,-Z)}let oe=0,de=1,xe=0;for(this[P]=S&255;++oe<I&&(de*=256);)S<0&&xe===0&&this[P+oe-1]!==0&&(xe=1),this[P+oe]=(S/de>>0)-xe&255;return P+I},o.prototype.writeIntBE=function(S,P,I,K){if(S=+S,P=P>>>0,!K){let Z=Math.pow(2,8*I-1);te(this,S,P,I,Z-1,-Z)}let oe=I-1,de=1,xe=0;for(this[P+oe]=S&255;--oe>=0&&(de*=256);)S<0&&xe===0&&this[P+oe+1]!==0&&(xe=1),this[P+oe]=(S/de>>0)-xe&255;return P+I},o.prototype.writeInt8=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,1,127,-128),S<0&&(S=255+S+1),this[P]=S&255,P+1},o.prototype.writeInt16LE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,2,32767,-32768),this[P]=S&255,this[P+1]=S>>>8,P+2},o.prototype.writeInt16BE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,2,32767,-32768),this[P]=S>>>8,this[P+1]=S&255,P+2},o.prototype.writeInt32LE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,4,2147483647,-2147483648),this[P]=S&255,this[P+1]=S>>>8,this[P+2]=S>>>16,this[P+3]=S>>>24,P+4},o.prototype.writeInt32BE=function(S,P,I){return S=+S,P=P>>>0,I||te(this,S,P,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[P]=S>>>24,this[P+1]=S>>>16,this[P+2]=S>>>8,this[P+3]=S&255,P+4},o.prototype.writeBigInt64LE=ce(function(S,P=0){return B(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ce(function(S,P=0){return ne(this,S,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function U(S,P,I,K,oe,de){if(I+K>S.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function q(S,P,I,K,oe){return P=+P,I=I>>>0,oe||U(S,P,I,4),e.write(S,P,I,K,23,4),I+4}o.prototype.writeFloatLE=function(S,P,I){return q(this,S,P,!0,I)},o.prototype.writeFloatBE=function(S,P,I){return q(this,S,P,!1,I)};function re(S,P,I,K,oe){return P=+P,I=I>>>0,oe||U(S,P,I,8),e.write(S,P,I,K,52,8),I+8}o.prototype.writeDoubleLE=function(S,P,I){return re(this,S,P,!0,I)},o.prototype.writeDoubleBE=function(S,P,I){return re(this,S,P,!1,I)},o.prototype.copy=function(S,P,I,K){if(!o.isBuffer(S))throw new TypeError("argument should be a Buffer");if(I||(I=0),!K&&K!==0&&(K=this.length),P>=S.length&&(P=S.length),P||(P=0),K>0&&K<I&&(K=I),K===I||S.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),S.length-P<K-I&&(K=S.length-P+I);let oe=K-I;return this===S&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,I,K):Uint8Array.prototype.set.call(S,this.subarray(I,K),P),oe},o.prototype.fill=function(S,P,I,K){if(typeof S=="string"){if(typeof P=="string"?(K=P,P=0,I=this.length):typeof I=="string"&&(K=I,I=this.length),K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!o.isEncoding(K))throw new TypeError("Unknown encoding: "+K);if(S.length===1){let de=S.charCodeAt(0);(K==="utf8"&&de<128||K==="latin1")&&(S=de)}}else typeof S=="number"?S=S&255:typeof S=="boolean"&&(S=Number(S));if(P<0||this.length<P||this.length<I)throw new RangeError("Out of range index");if(I<=P)return this;P=P>>>0,I=I===void 0?this.length:I>>>0,S||(S=0);let oe;if(typeof S=="number")for(oe=P;oe<I;++oe)this[oe]=S;else{let de=o.isBuffer(S)?S:o.from(S,K),xe=de.length;if(xe===0)throw new TypeError('The value "'+S+'" is invalid for argument "value"');for(oe=0;oe<I-P;++oe)this[oe+P]=de[oe%xe]}return this};let F={};function D(S,P,I){F[S]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(S,P){return`The "${S}" argument must be of type number. Received type ${typeof P}`},TypeError),D("ERR_OUT_OF_RANGE",function(S,P,I){let K=`The value of "${S}" is out of range.`,oe=I;return Number.isInteger(I)&&Math.abs(I)>2**32?oe=ae(String(I)):typeof I=="bigint"&&(oe=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(oe=ae(oe)),oe+="n"),K+=` It must be ${P}. Received ${oe}`,K},RangeError);function ae(S){let P="",I=S.length,K=S[0]==="-"?1:0;for(;I>=K+4;I-=3)P=`_${S.slice(I-3,I)}${P}`;return`${S.slice(0,I)}${P}`}function Y(S,P,I){ie(P,"offset"),(S[P]===void 0||S[P+I]===void 0)&&ye(P,S.length-(I+1))}function Q(S,P,I,K,oe,de){if(S>I||S<P){let xe=typeof P=="bigint"?"n":"",Z;throw P===0||P===BigInt(0)?Z=`>= 0${xe} and < 2${xe} ** ${(de+1)*8}${xe}`:Z=`>= -(2${xe} ** ${(de+1)*8-1}${xe}) and < 2 ** ${(de+1)*8-1}${xe}`,new F.ERR_OUT_OF_RANGE("value",Z,S)}Y(K,oe,de)}function ie(S,P){if(typeof S!="number")throw new F.ERR_INVALID_ARG_TYPE(P,"number",S)}function ye(S,P,I){throw Math.floor(S)!==S?(ie(S,I),new F.ERR_OUT_OF_RANGE("offset","an integer",S)):P<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,S)}let ue=/[^+/0-9A-Za-z-_]/g;function L(S){if(S=S.split("=")[0],S=S.trim().replace(ue,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function J(S,P){P=P||1/0;let I,K=S.length,oe=null,de=[];for(let xe=0;xe<K;++xe){if(I=S.charCodeAt(xe),I>55295&&I<57344){if(!oe){if(I>56319){(P-=3)>-1&&de.push(239,191,189);continue}else if(xe+1===K){(P-=3)>-1&&de.push(239,191,189);continue}oe=I;continue}if(I<56320){(P-=3)>-1&&de.push(239,191,189),oe=I;continue}I=(oe-55296<<10|I-56320)+65536}else oe&&(P-=3)>-1&&de.push(239,191,189);if(oe=null,I<128){if((P-=1)<0)break;de.push(I)}else if(I<2048){if((P-=2)<0)break;de.push(I>>6|192,I&63|128)}else if(I<65536){if((P-=3)<0)break;de.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((P-=4)<0)break;de.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return de}function ee(S){let P=[];for(let I=0;I<S.length;++I)P.push(S.charCodeAt(I)&255);return P}function he(S,P){let I,K,oe,de=[];for(let xe=0;xe<S.length&&!((P-=2)<0);++xe)I=S.charCodeAt(xe),K=I>>8,oe=I%256,de.push(oe),de.push(K);return de}function fe(S){return n.toByteArray(L(S))}function we(S,P,I,K){let oe;for(oe=0;oe<K&&!(oe+I>=P.length||oe>=S.length);++oe)P[oe+I]=S[oe];return oe}function X(S,P){return S instanceof P||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===P.name}function be(S){return S!==S}let _e=(function(){let S="0123456789abcdef",P=new Array(256);for(let I=0;I<16;++I){let K=I*16;for(let oe=0;oe<16;++oe)P[K+oe]=S[I]+S[oe]}return P})();function ce(S){return typeof BigInt>"u"?Re:S}function Re(){throw new Error("BigInt not supported")}return en}var vi,Ig,gs,Rg,en,kg,k$=Mt(()=>{pe(),me(),ge(),vi={},Ig=!1,gs={},Rg=!1,en={},kg=!1}),mt={};bi(mt,{Buffer:()=>Uo,INSPECT_MAX_BYTES:()=>pA,default:()=>Ir,kMaxLength:()=>gA});var Ir,Uo,pA,gA,yt=Mt(()=>{pe(),me(),ge(),k$(),Ir=R$(),Ir.Buffer,Ir.SlowBuffer,Ir.INSPECT_MAX_BYTES,Ir.kMaxLength,Uo=Ir.Buffer,pA=Ir.INSPECT_MAX_BYTES,gA=Ir.kMaxLength}),me=Mt(()=>{yt()}),Qe=ve((n,e)=>{pe(),me(),ge();var t=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let i="";for(let s=0;s<r.length;s++)i+=` ${r[s].stack}
|
|
260
|
-
`;super(i),this.name="AggregateError",this.errors=r}};e.exports={AggregateError:t,ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,i){return r.includes(i)},ArrayPrototypeIndexOf(r,i){return r.indexOf(i)},ArrayPrototypeJoin(r,i){return r.join(i)},ArrayPrototypeMap(r,i){return r.map(i)},ArrayPrototypePop(r,i){return r.pop(i)},ArrayPrototypePush(r,i){return r.push(i)},ArrayPrototypeSlice(r,i,s){return r.slice(i,s)},Error,FunctionPrototypeCall(r,i,...s){return r.call(i,...s)},FunctionPrototypeSymbolHasInstance(r,i){return Function.prototype[Symbol.hasInstance].call(r,i)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,i){return Object.defineProperties(r,i)},ObjectDefineProperty(r,i,s){return Object.defineProperty(r,i,s)},ObjectGetOwnPropertyDescriptor(r,i){return Object.getOwnPropertyDescriptor(r,i)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,i){return Object.setPrototypeOf(r,i)},Promise,PromisePrototypeCatch(r,i){return r.catch(i)},PromisePrototypeThen(r,i,s){return r.then(i,s)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,i){return r.test(i)},SafeSet:Set,String,StringPrototypeSlice(r,i,s){return r.slice(i,s)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,i,s){return r.set(i,s)},Boolean,Uint8Array}}),mA=ve((n,e)=>{pe(),me(),ge(),e.exports={format(t,...r){return t.replace(/%([sdifj])/g,function(...[i,s]){let o=r.shift();return s==="f"?o.toFixed(6):s==="j"?JSON.stringify(o):s==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}}),Ot=ve((n,e)=>{pe(),me(),ge();var{format:t,inspect:r}=mA(),{AggregateError:i}=Qe(),s=globalThis.AggregateError||i,o=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u="__node_internal_",c={};function h(y,b){if(!y)throw new c.ERR_INTERNAL_ASSERTION(b)}function f(y){let b="",_=y.length,w=y[0]==="-"?1:0;for(;_>=w+4;_-=3)b=`_${y.slice(_-3,_)}${b}`;return`${y.slice(0,_)}${b}`}function d(y,b,_){if(typeof b=="function")return h(b.length<=_.length,`Code: ${y}; The provided arguments length (${_.length}) does not match the required ones (${b.length}).`),b(..._);let w=(b.match(/%[dfijoOs]/g)||[]).length;return h(w===_.length,`Code: ${y}; The provided arguments length (${_.length}) does not match the required ones (${w}).`),_.length===0?b:t(b,..._)}function p(y,b,_){_||(_=Error);class w extends _{constructor(...E){super(d(y,b,E))}toString(){return`${this.name} [${y}]: ${this.message}`}}Object.defineProperties(w.prototype,{name:{value:_.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${y}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),w.prototype.code=y,w.prototype[o]=!0,c[y]=w}function g(y){let b=u+y.name;return Object.defineProperty(y,"name",{value:b}),y}function m(y,b){if(y&&b&&y!==b){if(Array.isArray(b.errors))return b.errors.push(y),b;let _=new s([b,y],b.message);return _.code=b.code,_}return y||b}var v=class extends Error{constructor(y="The operation was aborted",b=void 0){if(b!==void 0&&typeof b!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",b);super(y,b),this.code="ABORT_ERR",this.name="AbortError"}};p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(y,b,_)=>{h(typeof y=="string","'name' must be a string"),Array.isArray(b)||(b=[b]);let w="The ";y.endsWith(" argument")?w+=`${y} `:w+=`"${y}" ${y.includes(".")?"property":"argument"} `,w+="must be ";let x=[],E=[],A=[];for(let T of b)h(typeof T=="string","All expected entries have to be of type string"),a.includes(T)?x.push(T.toLowerCase()):l.test(T)?E.push(T):(h(T!=="object",'The value "object" should be written as "Object"'),A.push(T));if(E.length>0){let T=x.indexOf("object");T!==-1&&(x.splice(x,T,1),E.push("Object"))}if(x.length>0){switch(x.length){case 1:w+=`of type ${x[0]}`;break;case 2:w+=`one of type ${x[0]} or ${x[1]}`;break;default:{let T=x.pop();w+=`one of type ${x.join(", ")}, or ${T}`}}(E.length>0||A.length>0)&&(w+=" or ")}if(E.length>0){switch(E.length){case 1:w+=`an instance of ${E[0]}`;break;case 2:w+=`an instance of ${E[0]} or ${E[1]}`;break;default:{let T=E.pop();w+=`an instance of ${E.join(", ")}, or ${T}`}}A.length>0&&(w+=" or ")}switch(A.length){case 0:break;case 1:A[0].toLowerCase()!==A[0]&&(w+="an "),w+=`${A[0]}`;break;case 2:w+=`one of ${A[0]} or ${A[1]}`;break;default:{let T=A.pop();w+=`one of ${A.join(", ")}, or ${T}`}}if(_==null)w+=`. Received ${_}`;else if(typeof _=="function"&&_.name)w+=`. Received function ${_.name}`;else if(typeof _=="object"){var O;if((O=_.constructor)!==null&&O!==void 0&&O.name)w+=`. Received an instance of ${_.constructor.name}`;else{let T=r(_,{depth:-1});w+=`. Received ${T}`}}else{let T=r(_,{colors:!1});T.length>25&&(T=`${T.slice(0,25)}...`),w+=`. Received type ${typeof _} (${T})`}return w},TypeError),p("ERR_INVALID_ARG_VALUE",(y,b,_="is invalid")=>{let w=r(b);return w.length>128&&(w=w.slice(0,128)+"..."),`The ${y.includes(".")?"property":"argument"} '${y}' ${_}. Received ${w}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(y,b,_)=>{var w;let x=_!=null&&(w=_.constructor)!==null&&w!==void 0&&w.name?`instance of ${_.constructor.name}`:`type ${typeof _}`;return`Expected ${y} to be returned from the "${b}" function but got ${x}.`},TypeError),p("ERR_MISSING_ARGS",(...y)=>{h(y.length>0,"At least one arg needs to be specified");let b,_=y.length;switch(y=(Array.isArray(y)?y:[y]).map(w=>`"${w}"`).join(" or "),_){case 1:b+=`The ${y[0]} argument`;break;case 2:b+=`The ${y[0]} and ${y[1]} arguments`;break;default:{let w=y.pop();b+=`The ${y.join(", ")}, and ${w} arguments`}break}return`${b} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(y,b,_)=>{h(b,'Missing "range" argument');let w;if(Number.isInteger(_)&&Math.abs(_)>2**32)w=f(String(_));else if(typeof _=="bigint"){w=String(_);let x=BigInt(2)**BigInt(32);(_>x||_<-x)&&(w=f(w)),w+="n"}else w=r(_);return`The value of "${y}" is out of range. It must be ${b}. Received ${w}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:v,aggregateTwoErrors:g(m),hideStackFrames:g,codes:c}}),ms=ve((n,e)=>{pe(),me(),ge();var{AbortController:t,AbortSignal:r}=typeof self<"u"?self:typeof window<"u"?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t}),tn={};bi(tn,{EventEmitter:()=>yA,default:()=>wi,defaultMaxListeners:()=>bA,init:()=>vA,listenerCount:()=>wA,on:()=>_A,once:()=>xA});function N$(){if(Ng)return ys;Ng=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(_,w,x){return Function.prototype.apply.call(_,w,x)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:t=function(_){return Object.getOwnPropertyNames(_)};function r(_){console&&console.warn&&console.warn(_)}var i=Number.isNaN||function(_){return _!==_};function s(){s.init.call(this)}ys=s,ys.once=v,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");o=_}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||i(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function l(_){return _._maxListeners===void 0?s.defaultMaxListeners:_._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(_){for(var w=[],x=1;x<arguments.length;x++)w.push(arguments[x]);var E=_==="error",A=this._events;if(A!==void 0)E=E&&A.error===void 0;else if(!E)return!1;if(E){var O;if(w.length>0&&(O=w[0]),O instanceof Error)throw O;var T=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw T.context=O,T}var M=A[_];if(M===void 0)return!1;if(typeof M=="function")e(M,this,w);else for(var C=M.length,k=p(M,C),x=0;x<C;++x)e(k[x],this,w);return!0};function u(_,w,x,E){var A,O,T;if(a(x),O=_._events,O===void 0?(O=_._events=Object.create(null),_._eventsCount=0):(O.newListener!==void 0&&(_.emit("newListener",w,x.listener?x.listener:x),O=_._events),T=O[w]),T===void 0)T=O[w]=x,++_._eventsCount;else if(typeof T=="function"?T=O[w]=E?[x,T]:[T,x]:E?T.unshift(x):T.push(x),A=l(_),A>0&&T.length>A&&!T.warned){T.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=_,M.type=w,M.count=T.length,r(M)}return _}s.prototype.addListener=function(_,w){return u(this,_,w,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(_,w){return u(this,_,w,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(_,w,x){var E={fired:!1,wrapFn:void 0,target:_,type:w,listener:x},A=c.bind(E);return A.listener=x,E.wrapFn=A,A}s.prototype.once=function(_,w){return a(w),this.on(_,h(this,_,w)),this},s.prototype.prependOnceListener=function(_,w){return a(w),this.prependListener(_,h(this,_,w)),this},s.prototype.removeListener=function(_,w){var x,E,A,O,T;if(a(w),E=this._events,E===void 0)return this;if(x=E[_],x===void 0)return this;if(x===w||x.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete E[_],E.removeListener&&this.emit("removeListener",_,x.listener||w));else if(typeof x!="function"){for(A=-1,O=x.length-1;O>=0;O--)if(x[O]===w||x[O].listener===w){T=x[O].listener,A=O;break}if(A<0)return this;A===0?x.shift():g(x,A),x.length===1&&(E[_]=x[0]),E.removeListener!==void 0&&this.emit("removeListener",_,T||w)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(_){var w,x,E;if(x=this._events,x===void 0)return this;if(x.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):x[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete x[_]),this;if(arguments.length===0){var A=Object.keys(x),O;for(E=0;E<A.length;++E)O=A[E],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=x[_],typeof w=="function")this.removeListener(_,w);else if(w!==void 0)for(E=w.length-1;E>=0;E--)this.removeListener(_,w[E]);return this};function f(_,w,x){var E=_._events;if(E===void 0)return[];var A=E[w];return A===void 0?[]:typeof A=="function"?x?[A.listener||A]:[A]:x?m(A):p(A,A.length)}s.prototype.listeners=function(_){return f(this,_,!0)},s.prototype.rawListeners=function(_){return f(this,_,!1)},s.listenerCount=function(_,w){return typeof _.listenerCount=="function"?_.listenerCount(w):d.call(_,w)},s.prototype.listenerCount=d;function d(_){var w=this._events;if(w!==void 0){var x=w[_];if(typeof x=="function")return 1;if(x!==void 0)return x.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function p(_,w){for(var x=new Array(w),E=0;E<w;++E)x[E]=_[E];return x}function g(_,w){for(;w+1<_.length;w++)_[w]=_[w+1];_.pop()}function m(_){for(var w=new Array(_.length),x=0;x<w.length;++x)w[x]=_[x].listener||_[x];return w}function v(_,w){return new Promise(function(x,E){function A(T){_.removeListener(w,O),E(T)}function O(){typeof _.removeListener=="function"&&_.removeListener("error",A),x([].slice.call(arguments))}b(_,w,O,{once:!0}),w!=="error"&&y(_,A,{once:!0})})}function y(_,w,x){typeof _.on=="function"&&b(_,"error",w,x)}function b(_,w,x,E){if(typeof _.on=="function")E.once?_.once(w,x):_.on(w,x);else if(typeof _.addEventListener=="function")_.addEventListener(w,function A(O){E.once&&_.removeEventListener(w,A),x(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return ys}var ys,Ng,wi,yA,bA,vA,wA,_A,xA,Pn=Mt(()=>{pe(),me(),ge(),ys={},Ng=!1,wi=N$(),wi.once,wi.once=function(n,e){return new Promise((t,r)=>{function i(...o){s!==void 0&&n.removeListener("error",s),t(o)}let s;e!=="error"&&(s=o=>{n.removeListener(name,i),r(o)},n.once("error",s)),n.once(e,i)})},wi.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let u=t.shift();if(u)return createIterResult(u,!1);if(i){let c=Promise.reject(i);return i=null,c}return s?createIterResult(void 0,!0):new Promise((c,h)=>r.push({resolve:c,reject:h}))},async return(){n.removeListener(e,a),n.removeListener("error",l),s=!0;for(let u of r)u.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(u){i=u,n.removeListener(e,a),n.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return n.on(e,a),n.on("error",l),o;function a(...u){let c=r.shift();c?c.resolve(createIterResult(u,!1)):t.push(u)}function l(u){s=!0;let c=r.shift();c?c.reject(u):i=u,o.return()}},{EventEmitter:yA,defaultMaxListeners:bA,init:vA,listenerCount:wA,on:_A,once:xA}=wi}),It=ve((n,e)=>{pe(),me(),ge();var t=(yt(),$e(mt)),{format:r,inspect:i}=mA(),{codes:{ERR_INVALID_ARG_TYPE:s}}=Ot(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:l}=Qe(),u=globalThis.AbortSignal||ms().AbortSignal,c=globalThis.AbortController||ms().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||t.Blob,d=typeof f<"u"?function(m){return m instanceof f}:function(m){return!1},p=(m,v)=>{if(m!==void 0&&(m===null||typeof m!="object"||!("aborted"in m)))throw new s(v,"AbortSignal",m)},g=(m,v)=>{if(typeof m!="function")throw new s(v,"Function",m)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(m){let v=!1;return function(...y){v||(v=!0,m.apply(this,y))}},createDeferredPromise:function(){let m,v;return{promise:new Promise((y,b)=>{m=y,v=b}),resolve:m,reject:v}},promisify(m){return new Promise((v,y)=>{m((b,..._)=>b?y(b):v(..._))})},debuglog(){return function(){}},format:r,inspect:i,types:{isAsyncFunction(m){return m instanceof h},isArrayBufferView(m){return ArrayBuffer.isView(m)}},isBlob:d,deprecate(m,v){return m},addAbortListener:(Pn(),$e(tn)).addAbortListener||function(m,v){if(m===void 0)throw new s("signal","AbortSignal",m);p(m,"signal"),g(v,"listener");let y;return m.aborted?queueMicrotask(()=>v()):(m.addEventListener("abort",v,{__proto__:null,once:!0,[o]:!0}),y=()=>{m.removeEventListener("abort",v)}),{__proto__:null,[l](){var b;(b=y)===null||b===void 0||b()}}},AbortSignalAny:u.any||function(m){if(m.length===1)return m[0];let v=new c,y=()=>v.abort();return m.forEach(b=>{p(b,"signals"),b.addEventListener("abort",y,{once:!0})}),v.signal.addEventListener("abort",()=>{m.forEach(b=>b.removeEventListener("abort",y))},{once:!0}),v.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),bs=ve((n,e)=>{pe(),me(),ge();var{ArrayIsArray:t,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:i,ArrayPrototypeMap:s,NumberIsInteger:o,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:d,StringPrototypeToUpperCase:p,StringPrototypeTrim:g}=Qe(),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:y,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:w}}=Ot(),{normalizeEncoding:x}=It(),{isAsyncFunction:E,isArrayBufferView:A}=It().types,O={};function T(X){return X===(X|0)}function M(X){return X===X>>>0}var C=/^[0-7]+$/,k="must be a 32-bit unsigned integer or an octal string";function N(X,be,_e){if(typeof X>"u"&&(X=_e),typeof X=="string"){if(f(C,X)===null)throw new b(be,X,k);X=c(X,8)}return G(X,be),X}var R=m((X,be,_e=u,ce=l)=>{if(typeof X!="number")throw new y(be,"number",X);if(!o(X))throw new _(be,"an integer",X);if(X<_e||X>ce)throw new _(be,`>= ${_e} && <= ${ce}`,X)}),$=m((X,be,_e=-2147483648,ce=2147483647)=>{if(typeof X!="number")throw new y(be,"number",X);if(!o(X))throw new _(be,"an integer",X);if(X<_e||X>ce)throw new _(be,`>= ${_e} && <= ${ce}`,X)}),G=m((X,be,_e=!1)=>{if(typeof X!="number")throw new y(be,"number",X);if(!o(X))throw new _(be,"an integer",X);let ce=_e?1:0,Re=4294967295;if(X<ce||X>Re)throw new _(be,`>= ${ce} && <= ${Re}`,X)});function H(X,be){if(typeof X!="string")throw new y(be,"string",X)}function se(X,be,_e=void 0,ce){if(typeof X!="number")throw new y(be,"number",X);if(_e!=null&&X<_e||ce!=null&&X>ce||(_e!=null||ce!=null)&&a(X))throw new _(be,`${_e!=null?`>= ${_e}`:""}${_e!=null&&ce!=null?" && ":""}${ce!=null?`<= ${ce}`:""}`,X)}var V=m((X,be,_e)=>{if(!r(_e,X)){let ce="must be one of: "+i(s(_e,Re=>typeof Re=="string"?`'${Re}'`:d(Re)),", ");throw new b(be,X,ce)}});function te(X,be){if(typeof X!="boolean")throw new y(be,"boolean",X)}function B(X,be,_e){return X==null||!h(X,be)?_e:X[be]}var ne=m((X,be,_e=null)=>{let ce=B(_e,"allowArray",!1),Re=B(_e,"allowFunction",!1);if(!B(_e,"nullable",!1)&&X===null||!ce&&t(X)||typeof X!="object"&&(!Re||typeof X!="function"))throw new y(be,"Object",X)}),U=m((X,be)=>{if(X!=null&&typeof X!="object"&&typeof X!="function")throw new y(be,"a dictionary",X)}),q=m((X,be,_e=0)=>{if(!t(X))throw new y(be,"Array",X);if(X.length<_e){let ce=`must be longer than ${_e}`;throw new b(be,X,ce)}});function re(X,be){q(X,be);for(let _e=0;_e<X.length;_e++)H(X[_e],`${be}[${_e}]`)}function F(X,be){q(X,be);for(let _e=0;_e<X.length;_e++)te(X[_e],`${be}[${_e}]`)}function D(X,be){q(X,be);for(let _e=0;_e<X.length;_e++){let ce=X[_e],Re=`${be}[${_e}]`;if(ce==null)throw new y(Re,"AbortSignal",ce);ye(ce,Re)}}function ae(X,be="signal"){if(H(X,be),O[X]===void 0)throw O[p(X)]!==void 0?new w(X+" (signals must use all capital letters)"):new w(X)}var Y=m((X,be="buffer")=>{if(!A(X))throw new y(be,["Buffer","TypedArray","DataView"],X)});function Q(X,be){let _e=x(be),ce=X.length;if(_e==="hex"&&ce%2!==0)throw new b("encoding",be,`is invalid for data of length ${ce}`)}function ie(X,be="Port",_e=!0){if(typeof X!="number"&&typeof X!="string"||typeof X=="string"&&g(X).length===0||+X!==+X>>>0||X>65535||X===0&&!_e)throw new v(be,X,_e);return X|0}var ye=m((X,be)=>{if(X!==void 0&&(X===null||typeof X!="object"||!("aborted"in X)))throw new y(be,"AbortSignal",X)}),ue=m((X,be)=>{if(typeof X!="function")throw new y(be,"Function",X)}),L=m((X,be)=>{if(typeof X!="function"||E(X))throw new y(be,"Function",X)}),J=m((X,be)=>{if(X!==void 0)throw new y(be,"undefined",X)});function ee(X,be,_e){if(!r(_e,X))throw new y(be,`('${i(_e,"|")}')`,X)}var he=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function fe(X,be){if(typeof X>"u"||!f(he,X))throw new b(be,X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function we(X){if(typeof X=="string")return fe(X,"hints"),X;if(t(X)){let be=X.length,_e="";if(be===0)return _e;for(let ce=0;ce<be;ce++){let Re=X[ce];fe(Re,"hints"),_e+=Re,ce!==be-1&&(_e+=", ")}return _e}throw new b("hints",X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:T,isUint32:M,parseFileMode:N,validateArray:q,validateStringArray:re,validateBooleanArray:F,validateAbortSignalArray:D,validateBoolean:te,validateBuffer:Y,validateDictionary:U,validateEncoding:Q,validateFunction:ue,validateInt32:$,validateInteger:R,validateNumber:se,validateObject:ne,validateOneOf:V,validatePlainFunction:L,validatePort:ie,validateSignalName:ae,validateString:H,validateUint32:G,validateUndefined:J,validateUnion:ee,validateAbortSignal:ye,validateLinkHeaderValue:we}}),On=ve((n,e)=>{pe(),me(),ge();var t=e.exports={},r,i;function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s}catch{r=s}try{typeof clearTimeout=="function"?i=clearTimeout:i=o}catch{i=o}})();function a(v){if(r===setTimeout)return setTimeout(v,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(v,0);try{return r(v,0)}catch{try{return r.call(null,v,0)}catch{return r.call(this,v,0)}}}function l(v){if(i===clearTimeout)return clearTimeout(v);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(v);try{return i(v)}catch{try{return i.call(null,v)}catch{return i.call(this,v)}}}var u=[],c=!1,h,f=-1;function d(){!c||!h||(c=!1,h.length?u=h.concat(u):f=-1,u.length&&p())}function p(){if(!c){var v=a(d);c=!0;for(var y=u.length;y;){for(h=u,u=[];++f<y;)h&&h[f].run();f=-1,y=u.length}h=null,c=!1,l(v)}}t.nextTick=function(v){var y=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)y[b-1]=arguments[b];u.push(new g(v,y)),u.length===1&&!c&&a(p)};function g(v,y){this.fun=v,this.array=y}g.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(v){return[]},t.binding=function(v){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(v){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}}),Rr=ve((n,e)=>{pe(),me(),ge();var{SymbolAsyncIterator:t,SymbolIterator:r,SymbolFor:i}=Qe(),s=i("nodejs.stream.destroyed"),o=i("nodejs.stream.errored"),a=i("nodejs.stream.readable"),l=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),c=i("nodejs.webstream.isClosedPromise"),h=i("nodejs.webstream.controllerErrorFunction");function f(B,ne=!1){var U;return!!(B&&typeof B.pipe=="function"&&typeof B.on=="function"&&(!ne||typeof B.pause=="function"&&typeof B.resume=="function")&&(!B._writableState||((U=B._readableState)===null||U===void 0?void 0:U.readable)!==!1)&&(!B._writableState||B._readableState))}function d(B){var ne;return!!(B&&typeof B.write=="function"&&typeof B.on=="function"&&(!B._readableState||((ne=B._writableState)===null||ne===void 0?void 0:ne.writable)!==!1))}function p(B){return!!(B&&typeof B.pipe=="function"&&B._readableState&&typeof B.on=="function"&&typeof B.write=="function")}function g(B){return B&&(B._readableState||B._writableState||typeof B.write=="function"&&typeof B.on=="function"||typeof B.pipe=="function"&&typeof B.on=="function")}function m(B){return!!(B&&!g(B)&&typeof B.pipeThrough=="function"&&typeof B.getReader=="function"&&typeof B.cancel=="function")}function v(B){return!!(B&&!g(B)&&typeof B.getWriter=="function"&&typeof B.abort=="function")}function y(B){return!!(B&&!g(B)&&typeof B.readable=="object"&&typeof B.writable=="object")}function b(B){return m(B)||v(B)||y(B)}function _(B,ne){return B==null?!1:ne===!0?typeof B[t]=="function":ne===!1?typeof B[r]=="function":typeof B[t]=="function"||typeof B[r]=="function"}function w(B){if(!g(B))return null;let ne=B._writableState,U=B._readableState,q=ne||U;return!!(B.destroyed||B[s]||q!=null&&q.destroyed)}function x(B){if(!d(B))return null;if(B.writableEnded===!0)return!0;let ne=B._writableState;return ne!=null&&ne.errored?!1:typeof ne?.ended!="boolean"?null:ne.ended}function E(B,ne){if(!d(B))return null;if(B.writableFinished===!0)return!0;let U=B._writableState;return U!=null&&U.errored?!1:typeof U?.finished!="boolean"?null:!!(U.finished||ne===!1&&U.ended===!0&&U.length===0)}function A(B){if(!f(B))return null;if(B.readableEnded===!0)return!0;let ne=B._readableState;return!ne||ne.errored?!1:typeof ne?.ended!="boolean"?null:ne.ended}function O(B,ne){if(!f(B))return null;let U=B._readableState;return U!=null&&U.errored?!1:typeof U?.endEmitted!="boolean"?null:!!(U.endEmitted||ne===!1&&U.ended===!0&&U.length===0)}function T(B){return B&&B[a]!=null?B[a]:typeof B?.readable!="boolean"?null:w(B)?!1:f(B)&&B.readable&&!O(B)}function M(B){return B&&B[l]!=null?B[l]:typeof B?.writable!="boolean"?null:w(B)?!1:d(B)&&B.writable&&!x(B)}function C(B,ne){return g(B)?w(B)?!0:!(ne?.readable!==!1&&T(B)||ne?.writable!==!1&&M(B)):null}function k(B){var ne,U;return g(B)?B.writableErrored?B.writableErrored:(ne=(U=B._writableState)===null||U===void 0?void 0:U.errored)!==null&&ne!==void 0?ne:null:null}function N(B){var ne,U;return g(B)?B.readableErrored?B.readableErrored:(ne=(U=B._readableState)===null||U===void 0?void 0:U.errored)!==null&&ne!==void 0?ne:null:null}function R(B){if(!g(B))return null;if(typeof B.closed=="boolean")return B.closed;let ne=B._writableState,U=B._readableState;return typeof ne?.closed=="boolean"||typeof U?.closed=="boolean"?ne?.closed||U?.closed:typeof B._closed=="boolean"&&$(B)?B._closed:null}function $(B){return typeof B._closed=="boolean"&&typeof B._defaultKeepAlive=="boolean"&&typeof B._removedConnection=="boolean"&&typeof B._removedContLen=="boolean"}function G(B){return typeof B._sent100=="boolean"&&$(B)}function H(B){var ne;return typeof B._consuming=="boolean"&&typeof B._dumped=="boolean"&&((ne=B.req)===null||ne===void 0?void 0:ne.upgradeOrConnect)===void 0}function se(B){if(!g(B))return null;let ne=B._writableState,U=B._readableState,q=ne||U;return!q&&G(B)||!!(q&&q.autoDestroy&&q.emitClose&&q.closed===!1)}function V(B){var ne;return!!(B&&((ne=B[u])!==null&&ne!==void 0?ne:B.readableDidRead||B.readableAborted))}function te(B){var ne,U,q,re,F,D,ae,Y,Q,ie;return!!(B&&((ne=(U=(q=(re=(F=(D=B[o])!==null&&D!==void 0?D:B.readableErrored)!==null&&F!==void 0?F:B.writableErrored)!==null&&re!==void 0?re:(ae=B._readableState)===null||ae===void 0?void 0:ae.errorEmitted)!==null&&q!==void 0?q:(Y=B._writableState)===null||Y===void 0?void 0:Y.errorEmitted)!==null&&U!==void 0?U:(Q=B._readableState)===null||Q===void 0?void 0:Q.errored)!==null&&ne!==void 0?ne:!((ie=B._writableState)===null||ie===void 0)&&ie.errored))}e.exports={isDestroyed:w,kIsDestroyed:s,isDisturbed:V,kIsDisturbed:u,isErrored:te,kIsErrored:o,isReadable:T,kIsReadable:a,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:l,isClosed:R,isDuplexNodeStream:p,isFinished:C,isIterable:_,isReadableNodeStream:f,isReadableStream:m,isReadableEnded:A,isReadableFinished:O,isReadableErrored:N,isNodeStream:g,isWebStream:b,isWritable:M,isWritableNodeStream:d,isWritableStream:v,isWritableEnded:x,isWritableFinished:E,isWritableErrored:k,isServerRequest:H,isServerResponse:G,willEmitClose:se,isTransformStream:y}}),rn=ve((n,e)=>{pe(),me(),ge();var t=On(),{AbortError:r,codes:i}=Ot(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:a,once:l}=It(),{validateAbortSignal:u,validateFunction:c,validateObject:h,validateBoolean:f}=bs(),{Promise:d,PromisePrototypeThen:p,SymbolDispose:g}=Qe(),{isClosed:m,isReadable:v,isReadableNodeStream:y,isReadableStream:b,isReadableFinished:_,isReadableErrored:w,isWritable:x,isWritableNodeStream:E,isWritableStream:A,isWritableFinished:O,isWritableErrored:T,isNodeStream:M,willEmitClose:C,kIsClosedPromise:k}=Rr(),N;function R(V){return V.setHeader&&typeof V.abort=="function"}var $=()=>{};function G(V,te,B){var ne,U;if(arguments.length===2?(B=te,te=a):te==null?te=a:h(te,"options"),c(B,"callback"),u(te.signal,"options.signal"),B=l(B),b(V)||A(V))return H(V,te,B);if(!M(V))throw new s("stream",["ReadableStream","WritableStream","Stream"],V);let q=(ne=te.readable)!==null&&ne!==void 0?ne:y(V),re=(U=te.writable)!==null&&U!==void 0?U:E(V),F=V._writableState,D=V._readableState,ae=()=>{V.writable||ie()},Y=C(V)&&y(V)===q&&E(V)===re,Q=O(V,!1),ie=()=>{Q=!0,V.destroyed&&(Y=!1),!(Y&&(!V.readable||q))&&(!q||ye)&&B.call(V)},ye=_(V,!1),ue=()=>{ye=!0,V.destroyed&&(Y=!1),!(Y&&(!V.writable||re))&&(!re||Q)&&B.call(V)},L=X=>{B.call(V,X)},J=m(V),ee=()=>{J=!0;let X=T(V)||w(V);if(X&&typeof X!="boolean")return B.call(V,X);if(q&&!ye&&y(V,!0)&&!_(V,!1))return B.call(V,new o);if(re&&!Q&&!O(V,!1))return B.call(V,new o);B.call(V)},he=()=>{J=!0;let X=T(V)||w(V);if(X&&typeof X!="boolean")return B.call(V,X);B.call(V)},fe=()=>{V.req.on("finish",ie)};R(V)?(V.on("complete",ie),Y||V.on("abort",ee),V.req?fe():V.on("request",fe)):re&&!F&&(V.on("end",ae),V.on("close",ae)),!Y&&typeof V.aborted=="boolean"&&V.on("aborted",ee),V.on("end",ue),V.on("finish",ie),te.error!==!1&&V.on("error",L),V.on("close",ee),J?t.nextTick(ee):F!=null&&F.errorEmitted||D!=null&&D.errorEmitted?Y||t.nextTick(he):(!q&&(!Y||v(V))&&(Q||x(V)===!1)||!re&&(!Y||x(V))&&(ye||v(V)===!1)||D&&V.req&&V.aborted)&&t.nextTick(he);let we=()=>{B=$,V.removeListener("aborted",ee),V.removeListener("complete",ie),V.removeListener("abort",ee),V.removeListener("request",fe),V.req&&V.req.removeListener("finish",ie),V.removeListener("end",ae),V.removeListener("close",ae),V.removeListener("finish",ie),V.removeListener("end",ue),V.removeListener("error",L),V.removeListener("close",ee)};if(te.signal&&!J){let X=()=>{let be=B;we(),be.call(V,new r(void 0,{cause:te.signal.reason}))};if(te.signal.aborted)t.nextTick(X);else{N=N||It().addAbortListener;let be=N(te.signal,X),_e=B;B=l((...ce)=>{be[g](),_e.apply(V,ce)})}}return we}function H(V,te,B){let ne=!1,U=$;if(te.signal)if(U=()=>{ne=!0,B.call(V,new r(void 0,{cause:te.signal.reason}))},te.signal.aborted)t.nextTick(U);else{N=N||It().addAbortListener;let re=N(te.signal,U),F=B;B=l((...D)=>{re[g](),F.apply(V,D)})}let q=(...re)=>{ne||t.nextTick(()=>B.apply(V,re))};return p(V[k].promise,q,q),$}function se(V,te){var B;let ne=!1;return te===null&&(te=a),(B=te)!==null&&B!==void 0&&B.cleanup&&(f(te.cleanup,"cleanup"),ne=te.cleanup),new d((U,q)=>{let re=G(V,te,F=>{ne&&re(),F?q(F):U()})})}e.exports=G,e.exports.finished=se}),_i=ve((n,e)=>{pe(),me(),ge();var t=On(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:s}=Ot(),{Symbol:o}=Qe(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:c}=Rr(),h=o("kDestroy"),f=o("kConstruct");function d(C,k,N){C&&(C.stack,k&&!k.errored&&(k.errored=C),N&&!N.errored&&(N.errored=C))}function p(C,k){let N=this._readableState,R=this._writableState,$=R||N;return R!=null&&R.destroyed||N!=null&&N.destroyed?(typeof k=="function"&&k(),this):(d(C,R,N),R&&(R.destroyed=!0),N&&(N.destroyed=!0),$.constructed?g(this,C,k):this.once(h,function(G){g(this,r(G,C),k)}),this)}function g(C,k,N){let R=!1;function $(G){if(R)return;R=!0;let H=C._readableState,se=C._writableState;d(G,se,H),se&&(se.closed=!0),H&&(H.closed=!0),typeof N=="function"&&N(G),G?t.nextTick(m,C,G):t.nextTick(v,C)}try{C._destroy(k||null,$)}catch(G){$(G)}}function m(C,k){y(C,k),v(C)}function v(C){let k=C._readableState,N=C._writableState;N&&(N.closeEmitted=!0),k&&(k.closeEmitted=!0),(N!=null&&N.emitClose||k!=null&&k.emitClose)&&C.emit("close")}function y(C,k){let N=C._readableState,R=C._writableState;R!=null&&R.errorEmitted||N!=null&&N.errorEmitted||(R&&(R.errorEmitted=!0),N&&(N.errorEmitted=!0),C.emit("error",k))}function b(){let C=this._readableState,k=this._writableState;C&&(C.constructed=!0,C.closed=!1,C.closeEmitted=!1,C.destroyed=!1,C.errored=null,C.errorEmitted=!1,C.reading=!1,C.ended=C.readable===!1,C.endEmitted=C.readable===!1),k&&(k.constructed=!0,k.destroyed=!1,k.closed=!1,k.closeEmitted=!1,k.errored=null,k.errorEmitted=!1,k.finalCalled=!1,k.prefinished=!1,k.ended=k.writable===!1,k.ending=k.writable===!1,k.finished=k.writable===!1)}function _(C,k,N){let R=C._readableState,$=C._writableState;if($!=null&&$.destroyed||R!=null&&R.destroyed)return this;R!=null&&R.autoDestroy||$!=null&&$.autoDestroy?C.destroy(k):k&&(k.stack,$&&!$.errored&&($.errored=k),R&&!R.errored&&(R.errored=k),N?t.nextTick(y,C,k):y(C,k))}function w(C,k){if(typeof C._construct!="function")return;let N=C._readableState,R=C._writableState;N&&(N.constructed=!1),R&&(R.constructed=!1),C.once(f,k),!(C.listenerCount(f)>1)&&t.nextTick(x,C)}function x(C){let k=!1;function N(R){if(k){_(C,R??new i);return}k=!0;let $=C._readableState,G=C._writableState,H=G||$;$&&($.constructed=!0),G&&(G.constructed=!0),H.destroyed?C.emit(h,R):R?_(C,R,!0):t.nextTick(E,C)}try{C._construct(R=>{t.nextTick(N,R)})}catch(R){t.nextTick(N,R)}}function E(C){C.emit(f)}function A(C){return C?.setHeader&&typeof C.abort=="function"}function O(C){C.emit("close")}function T(C,k){C.emit("error",k),t.nextTick(O,C)}function M(C,k){!C||l(C)||(!k&&!u(C)&&(k=new s),c(C)?(C.socket=null,C.destroy(k)):A(C)?C.abort():A(C.req)?C.req.abort():typeof C.destroy=="function"?C.destroy(k):typeof C.close=="function"?C.close():k?t.nextTick(T,C,k):t.nextTick(O,C),C.destroyed||(C[a]=!0))}e.exports={construct:w,destroyer:M,destroy:p,undestroy:b,errorOrDestroy:_}}),jg=ve((n,e)=>{pe(),me(),ge();var{ArrayIsArray:t,ObjectSetPrototypeOf:r}=Qe(),{EventEmitter:i}=(Pn(),$e(tn));function s(a){i.call(this,a)}r(s.prototype,i.prototype),r(s,i),s.prototype.pipe=function(a,l){let u=this;function c(v){a.writable&&a.write(v)===!1&&u.pause&&u.pause()}u.on("data",c);function h(){u.readable&&u.resume&&u.resume()}a.on("drain",h),!a._isStdio&&(!l||l.end!==!1)&&(u.on("end",d),u.on("close",p));let f=!1;function d(){f||(f=!0,a.end())}function p(){f||(f=!0,typeof a.destroy=="function"&&a.destroy())}function g(v){m(),i.listenerCount(this,"error")===0&&this.emit("error",v)}o(u,"error",g),o(a,"error",g);function m(){u.removeListener("data",c),a.removeListener("drain",h),u.removeListener("end",d),u.removeListener("close",p),u.removeListener("error",g),a.removeListener("error",g),u.removeListener("end",m),u.removeListener("close",m),a.removeListener("close",m)}return u.on("end",m),u.on("close",m),a.on("close",m),a.emit("pipe",u),a};function o(a,l,u){if(typeof a.prependListener=="function")return a.prependListener(l,u);!a._events||!a._events[l]?a.on(l,u):t(a._events[l])?a._events[l].unshift(u):a._events[l]=[u,a._events[l]]}e.exports={Stream:s,prependListener:o}}),zo=ve((n,e)=>{pe(),me(),ge();var{SymbolDispose:t}=Qe(),{AbortError:r,codes:i}=Ot(),{isNodeStream:s,isWebStream:o,kControllerErrorFunction:a}=Rr(),l=rn(),{ERR_INVALID_ARG_TYPE:u}=i,c,h=(f,d)=>{if(typeof f!="object"||!("aborted"in f))throw new u(d,"AbortSignal",f)};e.exports.addAbortSignal=function(f,d){if(h(f,"signal"),!s(d)&&!o(d))throw new u("stream",["ReadableStream","WritableStream","Stream"],d);return e.exports.addAbortSignalNoValidate(f,d)},e.exports.addAbortSignalNoValidate=function(f,d){if(typeof f!="object"||!("aborted"in f))return d;let p=s(d)?()=>{d.destroy(new r(void 0,{cause:f.reason}))}:()=>{d[a](new r(void 0,{cause:f.reason}))};if(f.aborted)p();else{c=c||It().addAbortListener;let g=c(f,p);l(d,g[t])}return d}}),j$=ve((n,e)=>{pe(),me(),ge();var{StringPrototypeSlice:t,SymbolIterator:r,TypedArrayPrototypeSet:i,Uint8Array:s}=Qe(),{Buffer:o}=(yt(),$e(mt)),{inspect:a}=It();e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(l){let u={data:l,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(l){let u={data:l,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;let l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}clear(){this.head=this.tail=null,this.length=0}join(l){if(this.length===0)return"";let u=this.head,c=""+u.data;for(;(u=u.next)!==null;)c+=l+u.data;return c}concat(l){if(this.length===0)return o.alloc(0);let u=o.allocUnsafe(l>>>0),c=this.head,h=0;for(;c;)i(u,c.data,h),h+=c.data.length,c=c.next;return u}consume(l,u){let c=this.head.data;if(l<c.length){let h=c.slice(0,l);return this.head.data=c.slice(l),h}return l===c.length?this.shift():u?this._getString(l):this._getBuffer(l)}first(){return this.head.data}*[r](){for(let l=this.head;l;l=l.next)yield l.data}_getString(l){let u="",c=this.head,h=0;do{let f=c.data;if(l>f.length)u+=f,l-=f.length;else{l===f.length?(u+=f,++h,c.next?this.head=c.next:this.head=this.tail=null):(u+=t(f,0,l),this.head=c,c.data=t(f,l));break}++h}while((c=c.next)!==null);return this.length-=h,u}_getBuffer(l){let u=o.allocUnsafe(l),c=l,h=this.head,f=0;do{let d=h.data;if(l>d.length)i(u,d,c-l),l-=d.length;else{l===d.length?(i(u,d,c-l),++f,h.next?this.head=h.next:this.head=this.tail=null):(i(u,new s(d.buffer,d.byteOffset,l),c-l),this.head=h,h.data=d.slice(l));break}++f}while((h=h.next)!==null);return this.length-=f,u}[Symbol.for("nodejs.util.inspect.custom")](l,u){return a(this,{...u,depth:0,customInspect:!1})}}}),Vo=ve((n,e)=>{pe(),me(),ge();var{MathFloor:t,NumberIsInteger:r}=Qe(),{validateInteger:i}=bs(),{ERR_INVALID_ARG_VALUE:s}=Ot().codes,o=16*1024,a=16;function l(f,d,p){return f.highWaterMark!=null?f.highWaterMark:d?f[p]:null}function u(f){return f?a:o}function c(f,d){i(d,"value",0),f?a=d:o=d}function h(f,d,p,g){let m=l(d,g,p);if(m!=null){if(!r(m)||m<0){let v=g?`options.${p}`:"options.highWaterMark";throw new s(v,m)}return t(m)}return u(f.objectMode)}e.exports={getHighWaterMark:h,getDefaultHighWaterMark:u,setDefaultHighWaterMark:c}}),L$=ve((n,e)=>{pe(),me(),ge();var t=(yt(),$e(mt)),r=t.Buffer;function i(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=t:(i(t,n),n.Buffer=s);function s(o,a,l){return r(o,a,l)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},s.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=r(o);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}}),D$=ve(n=>{pe(),me(),ge();var e=L$().Buffer,t=e.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(y){if(!y)return"utf8";for(var b;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(b)return;y=(""+y).toLowerCase(),b=!0}}function i(y){var b=r(y);if(typeof b!="string"&&(e.isEncoding===t||!t(y)))throw new Error("Unknown encoding: "+y);return b||y}n.StringDecoder=s;function s(y){this.encoding=i(y);var b;switch(this.encoding){case"utf16le":this.text=f,this.end=d,b=4;break;case"utf8":this.fillLast=u,b=4;break;case"base64":this.text=p,this.end=g,b=3;break;default:this.write=m,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(b)}s.prototype.write=function(y){if(y.length===0)return"";var b,_;if(this.lastNeed){if(b=this.fillLast(y),b===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<y.length?b?b+this.text(y,_):this.text(y,_):b||""},s.prototype.end=h,s.prototype.text=c,s.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function o(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function a(y,b,_){var w=b.length-1;if(w<_)return 0;var x=o(b[w]);return x>=0?(x>0&&(y.lastNeed=x-1),x):--w<_||x===-2?0:(x=o(b[w]),x>=0?(x>0&&(y.lastNeed=x-2),x):--w<_||x===-2?0:(x=o(b[w]),x>=0?(x>0&&(x===2?x=0:y.lastNeed=x-3),x):0))}function l(y,b,_){if((b[0]&192)!==128)return y.lastNeed=0,"�";if(y.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return y.lastNeed=1,"�";if(y.lastNeed>2&&b.length>2&&(b[2]&192)!==128)return y.lastNeed=2,"�"}}function u(y){var b=this.lastTotal-this.lastNeed,_=l(this,y);if(_!==void 0)return _;if(this.lastNeed<=y.length)return y.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,b,0,y.length),this.lastNeed-=y.length}function c(y,b){var _=a(this,y,b);if(!this.lastNeed)return y.toString("utf8",b);this.lastTotal=_;var w=y.length-(_-this.lastNeed);return y.copy(this.lastChar,0,w),y.toString("utf8",b,w)}function h(y){var b=y&&y.length?this.write(y):"";return this.lastNeed?b+"�":b}function f(y,b){if((y.length-b)%2===0){var _=y.toString("utf16le",b);if(_){var w=_.charCodeAt(_.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",b,y.length-1)}function d(y){var b=y&&y.length?this.write(y):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,_)}return b}function p(y,b){var _=(y.length-b)%3;return _===0?y.toString("base64",b):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",b,y.length-_))}function g(y){var b=y&&y.length?this.write(y):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function m(y){return y.toString(this.encoding)}function v(y){return y&&y.length?this.write(y):""}}),EA=ve((n,e)=>{pe(),me(),ge();var t=On(),{PromisePrototypeThen:r,SymbolAsyncIterator:i,SymbolIterator:s}=Qe(),{Buffer:o}=(yt(),$e(mt)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=Ot().codes;function u(c,h,f){let d;if(typeof h=="string"||h instanceof o)return new c({objectMode:!0,...f,read(){this.push(h),this.push(null)}});let p;if(h&&h[i])p=!0,d=h[i]();else if(h&&h[s])p=!1,d=h[s]();else throw new a("iterable",["Iterable"],h);let g=new c({objectMode:!0,highWaterMark:1,...f}),m=!1;g._read=function(){m||(m=!0,y())},g._destroy=function(b,_){r(v(b),()=>t.nextTick(_,b),w=>t.nextTick(_,w||b))};async function v(b){let _=b!=null,w=typeof d.throw=="function";if(_&&w){let{value:x,done:E}=await d.throw(b);if(await x,E)return}if(typeof d.return=="function"){let{value:x}=await d.return();await x}}async function y(){for(;;){try{let{value:b,done:_}=p?await d.next():d.next();if(_)g.push(null);else{let w=b&&typeof b.then=="function"?await b:b;if(w===null)throw m=!1,new l;if(g.push(w))continue;m=!1}}catch(b){g.destroy(b)}break}}return g}e.exports=u}),Wo=ve((n,e)=>{pe(),me(),ge();var t=On(),{ArrayPrototypeIndexOf:r,NumberIsInteger:i,NumberIsNaN:s,NumberParseInt:o,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:c,SafeSet:h,SymbolAsyncDispose:f,SymbolAsyncIterator:d,Symbol:p}=Qe();e.exports=ce,ce.ReadableState=_e;var{EventEmitter:g}=(Pn(),$e(tn)),{Stream:m,prependListener:v}=jg(),{Buffer:y}=(yt(),$e(mt)),{addAbortSignal:b}=zo(),_=rn(),w=It().debuglog("stream",j=>{w=j}),x=j$(),E=_i(),{getHighWaterMark:A,getDefaultHighWaterMark:O}=Vo(),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:M,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_OUT_OF_RANGE:k,ERR_STREAM_PUSH_AFTER_EOF:N,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:R},AbortError:$}=Ot(),{validateObject:G}=bs(),H=p("kPaused"),{StringDecoder:se}=D$(),V=EA();u(ce.prototype,m.prototype),u(ce,m);var te=()=>{},{errorOrDestroy:B}=E,ne=1,U=2,q=4,re=8,F=16,D=32,ae=64,Y=128,Q=256,ie=512,ye=1024,ue=2048,L=4096,J=8192,ee=16384,he=32768,fe=65536,we=1<<17,X=1<<18;function be(j){return{enumerable:!1,get(){return(this.state&j)!==0},set(z){z?this.state|=j:this.state&=~j}}}a(_e.prototype,{objectMode:be(ne),ended:be(U),endEmitted:be(q),reading:be(re),constructed:be(F),sync:be(D),needReadable:be(ae),emittedReadable:be(Y),readableListening:be(Q),resumeScheduled:be(ie),errorEmitted:be(ye),emitClose:be(ue),autoDestroy:be(L),destroyed:be(J),closed:be(ee),closeEmitted:be(he),multiAwaitDrain:be(fe),readingMore:be(we),dataEmitted:be(X)});function _e(j,z,Ee){typeof Ee!="boolean"&&(Ee=z instanceof kr()),this.state=ue|L|F|D,j&&j.objectMode&&(this.state|=ne),Ee&&j&&j.readableObjectMode&&(this.state|=ne),this.highWaterMark=j?A(this,j,"readableHighWaterMark",Ee):O(!1),this.buffer=new x,this.length=0,this.pipes=[],this.flowing=null,this[H]=null,j&&j.emitClose===!1&&(this.state&=~ue),j&&j.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,j&&j.encoding&&(this.decoder=new se(j.encoding),this.encoding=j.encoding)}function ce(j){if(!(this instanceof ce))return new ce(j);let z=this instanceof kr();this._readableState=new _e(j,this,z),j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&!z&&b(j.signal,this)),m.call(this,j),E.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}ce.prototype.destroy=E.destroy,ce.prototype._undestroy=E.undestroy,ce.prototype._destroy=function(j,z){z(j)},ce.prototype[g.captureRejectionSymbol]=function(j){this.destroy(j)},ce.prototype[f]=function(){let j;return this.destroyed||(j=this.readableEnded?null:new $,this.destroy(j)),new c((z,Ee)=>_(this,Ae=>Ae&&Ae!==j?Ee(Ae):z(null)))},ce.prototype.push=function(j,z){return Re(this,j,z,!1)},ce.prototype.unshift=function(j,z){return Re(this,j,z,!0)};function Re(j,z,Ee,Ae){w("readableAddChunk",z);let Oe=j._readableState,ht;if((Oe.state&ne)===0&&(typeof z=="string"?(Ee=Ee||Oe.defaultEncoding,Oe.encoding!==Ee&&(Ae&&Oe.encoding?z=y.from(z,Ee).toString(Oe.encoding):(z=y.from(z,Ee),Ee=""))):z instanceof y?Ee="":m._isUint8Array(z)?(z=m._uint8ArrayToBuffer(z),Ee=""):z!=null&&(ht=new M("chunk",["string","Buffer","Uint8Array"],z))),ht)B(j,ht);else if(z===null)Oe.state&=~re,oe(j,Oe);else if((Oe.state&ne)!==0||z&&z.length>0)if(Ae)if((Oe.state&q)!==0)B(j,new R);else{if(Oe.destroyed||Oe.errored)return!1;S(j,Oe,z,!0)}else if(Oe.ended)B(j,new N);else{if(Oe.destroyed||Oe.errored)return!1;Oe.state&=~re,Oe.decoder&&!Ee?(z=Oe.decoder.write(z),Oe.objectMode||z.length!==0?S(j,Oe,z,!1):Z(j,Oe)):S(j,Oe,z,!1)}else Ae||(Oe.state&=~re,Z(j,Oe));return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function S(j,z,Ee,Ae){z.flowing&&z.length===0&&!z.sync&&j.listenerCount("data")>0?((z.state&fe)!==0?z.awaitDrainWriters.clear():z.awaitDrainWriters=null,z.dataEmitted=!0,j.emit("data",Ee)):(z.length+=z.objectMode?1:Ee.length,Ae?z.buffer.unshift(Ee):z.buffer.push(Ee),(z.state&ae)!==0&&de(j)),Z(j,z)}ce.prototype.isPaused=function(){let j=this._readableState;return j[H]===!0||j.flowing===!1},ce.prototype.setEncoding=function(j){let z=new se(j);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;let Ee=this._readableState.buffer,Ae="";for(let Oe of Ee)Ae+=z.write(Oe);return Ee.clear(),Ae!==""&&Ee.push(Ae),this._readableState.length=Ae.length,this};var P=1073741824;function I(j){if(j>P)throw new k("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++,j}function K(j,z){return j<=0||z.length===0&&z.ended?0:(z.state&ne)!==0?1:s(j)?z.flowing&&z.length?z.buffer.first().length:z.length:j<=z.length?j:z.ended?z.length:0}ce.prototype.read=function(j){w("read",j),j===void 0?j=NaN:i(j)||(j=o(j,10));let z=this._readableState,Ee=j;if(j>z.highWaterMark&&(z.highWaterMark=I(j)),j!==0&&(z.state&=~Y),j===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return w("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?dr(this):de(this),null;if(j=K(j,z),j===0&&z.ended)return z.length===0&&dr(this),null;let Ae=(z.state&ae)!==0;if(w("need readable",Ae),(z.length===0||z.length-j<z.highWaterMark)&&(Ae=!0,w("length less than watermark",Ae)),z.ended||z.reading||z.destroyed||z.errored||!z.constructed)Ae=!1,w("reading, ended or constructing",Ae);else if(Ae){w("do read"),z.state|=re|D,z.length===0&&(z.state|=ae);try{this._read(z.highWaterMark)}catch(ht){B(this,ht)}z.state&=~D,z.reading||(j=K(Ee,z))}let Oe;return j>0?Oe=Ai(j,z):Oe=null,Oe===null?(z.needReadable=z.length<=z.highWaterMark,j=0):(z.length-=j,z.multiAwaitDrain?z.awaitDrainWriters.clear():z.awaitDrainWriters=null),z.length===0&&(z.ended||(z.needReadable=!0),Ee!==j&&z.ended&&dr(this)),Oe!==null&&!z.errorEmitted&&!z.closeEmitted&&(z.dataEmitted=!0,this.emit("data",Oe)),Oe};function oe(j,z){if(w("onEofChunk"),!z.ended){if(z.decoder){let Ee=z.decoder.end();Ee&&Ee.length&&(z.buffer.push(Ee),z.length+=z.objectMode?1:Ee.length)}z.ended=!0,z.sync?de(j):(z.needReadable=!1,z.emittedReadable=!0,xe(j))}}function de(j){let z=j._readableState;w("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(w("emitReadable",z.flowing),z.emittedReadable=!0,t.nextTick(xe,j))}function xe(j){let z=j._readableState;w("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&!z.errored&&(z.length||z.ended)&&(j.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,hr(j)}function Z(j,z){!z.readingMore&&z.constructed&&(z.readingMore=!0,t.nextTick(le,j,z))}function le(j,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){let Ee=z.length;if(w("maybeReadMore read 0"),j.read(0),Ee===z.length)break}z.readingMore=!1}ce.prototype._read=function(j){throw new C("_read()")},ce.prototype.pipe=function(j,z){let Ee=this,Ae=this._readableState;Ae.pipes.length===1&&(Ae.multiAwaitDrain||(Ae.multiAwaitDrain=!0,Ae.awaitDrainWriters=new h(Ae.awaitDrainWriters?[Ae.awaitDrainWriters]:[]))),Ae.pipes.push(j),w("pipe count=%d opts=%j",Ae.pipes.length,z);let Oe=(!z||z.end!==!1)&&j!==t.stdout&&j!==t.stderr?Ct:Rn;Ae.endEmitted?t.nextTick(Oe):Ee.once("end",Oe),j.on("unpipe",ht);function ht(gr,Br){w("onunpipe"),gr===Ee&&Br&&Br.hasUnpiped===!1&&(Br.hasUnpiped=!0,Es())}function Ct(){w("onend"),j.end()}let er,xs=!1;function Es(){w("cleanup"),j.removeListener("close",pr),j.removeListener("finish",an),er&&j.removeListener("drain",er),j.removeListener("error",In),j.removeListener("unpipe",ht),Ee.removeListener("end",Ct),Ee.removeListener("end",Rn),Ee.removeListener("data",xa),xs=!0,er&&Ae.awaitDrainWriters&&(!j._writableState||j._writableState.needDrain)&&er()}function Ss(){xs||(Ae.pipes.length===1&&Ae.pipes[0]===j?(w("false write response, pause",0),Ae.awaitDrainWriters=j,Ae.multiAwaitDrain=!1):Ae.pipes.length>1&&Ae.pipes.includes(j)&&(w("false write response, pause",Ae.awaitDrainWriters.size),Ae.awaitDrainWriters.add(j)),Ee.pause()),er||(er=Ce(Ee,j),j.on("drain",er))}Ee.on("data",xa);function xa(gr){w("ondata");let Br=j.write(gr);w("dest.write",Br),Br===!1&&Ss()}function In(gr){if(w("onerror",gr),Rn(),j.removeListener("error",In),j.listenerCount("error")===0){let Br=j._writableState||j._readableState;Br&&!Br.errorEmitted?B(j,gr):j.emit("error",gr)}}v(j,"error",In);function pr(){j.removeListener("finish",an),Rn()}j.once("close",pr);function an(){w("onfinish"),j.removeListener("close",pr),Rn()}j.once("finish",an);function Rn(){w("unpipe"),Ee.unpipe(j)}return j.emit("pipe",Ee),j.writableNeedDrain===!0?Ss():Ae.flowing||(w("pipe resume"),Ee.resume()),j};function Ce(j,z){return function(){let Ee=j._readableState;Ee.awaitDrainWriters===z?(w("pipeOnDrain",1),Ee.awaitDrainWriters=null):Ee.multiAwaitDrain&&(w("pipeOnDrain",Ee.awaitDrainWriters.size),Ee.awaitDrainWriters.delete(z)),(!Ee.awaitDrainWriters||Ee.awaitDrainWriters.size===0)&&j.listenerCount("data")&&j.resume()}}ce.prototype.unpipe=function(j){let z=this._readableState,Ee={hasUnpiped:!1};if(z.pipes.length===0)return this;if(!j){let Oe=z.pipes;z.pipes=[],this.pause();for(let ht=0;ht<Oe.length;ht++)Oe[ht].emit("unpipe",this,{hasUnpiped:!1});return this}let Ae=r(z.pipes,j);return Ae===-1?this:(z.pipes.splice(Ae,1),z.pipes.length===0&&this.pause(),j.emit("unpipe",this,Ee),this)},ce.prototype.on=function(j,z){let Ee=m.prototype.on.call(this,j,z),Ae=this._readableState;return j==="data"?(Ae.readableListening=this.listenerCount("readable")>0,Ae.flowing!==!1&&this.resume()):j==="readable"&&!Ae.endEmitted&&!Ae.readableListening&&(Ae.readableListening=Ae.needReadable=!0,Ae.flowing=!1,Ae.emittedReadable=!1,w("on readable",Ae.length,Ae.reading),Ae.length?de(this):Ae.reading||t.nextTick(je,this)),Ee},ce.prototype.addListener=ce.prototype.on,ce.prototype.removeListener=function(j,z){let Ee=m.prototype.removeListener.call(this,j,z);return j==="readable"&&t.nextTick(Me,this),Ee},ce.prototype.off=ce.prototype.removeListener,ce.prototype.removeAllListeners=function(j){let z=m.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&t.nextTick(Me,this),z};function Me(j){let z=j._readableState;z.readableListening=j.listenerCount("readable")>0,z.resumeScheduled&&z[H]===!1?z.flowing=!0:j.listenerCount("data")>0?j.resume():z.readableListening||(z.flowing=null)}function je(j){w("readable nexttick read 0"),j.read(0)}ce.prototype.resume=function(){let j=this._readableState;return j.flowing||(w("resume"),j.flowing=!j.readableListening,Le(this,j)),j[H]=!1,this};function Le(j,z){z.resumeScheduled||(z.resumeScheduled=!0,t.nextTick(cr,j,z))}function cr(j,z){w("resume",z.reading),z.reading||j.read(0),z.resumeScheduled=!1,j.emit("resume"),hr(j),z.flowing&&!z.reading&&j.read(0)}ce.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[H]=!0,this};function hr(j){let z=j._readableState;for(w("flow",z.flowing);z.flowing&&j.read()!==null;);}ce.prototype.wrap=function(j){let z=!1;j.on("data",Ae=>{!this.push(Ae)&&j.pause&&(z=!0,j.pause())}),j.on("end",()=>{this.push(null)}),j.on("error",Ae=>{B(this,Ae)}),j.on("close",()=>{this.destroy()}),j.on("destroy",()=>{this.destroy()}),this._read=()=>{z&&j.resume&&(z=!1,j.resume())};let Ee=l(j);for(let Ae=1;Ae<Ee.length;Ae++){let Oe=Ee[Ae];this[Oe]===void 0&&typeof j[Oe]=="function"&&(this[Oe]=j[Oe].bind(j))}return this},ce.prototype[d]=function(){return Pt(this)},ce.prototype.iterator=function(j){return j!==void 0&&G(j,"options"),Pt(this,j)};function Pt(j,z){typeof j.read!="function"&&(j=ce.wrap(j,{objectMode:!0}));let Ee=fr(j,z);return Ee.stream=j,Ee}async function*fr(j,z){let Ee=te;function Ae(Ct){this===j?(Ee(),Ee=te):Ee=Ct}j.on("readable",Ae);let Oe,ht=_(j,{writable:!1},Ct=>{Oe=Ct?T(Oe,Ct):null,Ee(),Ee=te});try{for(;;){let Ct=j.destroyed?null:j.read();if(Ct!==null)yield Ct;else{if(Oe)throw Oe;if(Oe===null)return;await new c(Ae)}}}catch(Ct){throw Oe=T(Oe,Ct),Oe}finally{(Oe||z?.destroyOnReturn!==!1)&&(Oe===void 0||j._readableState.autoDestroy)?E.destroyer(j,null):(j.off("readable",Ae),ht())}}a(ce.prototype,{readable:{__proto__:null,get(){let j=this._readableState;return!!j&&j.readable!==!1&&!j.destroyed&&!j.errorEmitted&&!j.endEmitted},set(j){this._readableState&&(this._readableState.readable=!!j)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(j){this._readableState&&(this._readableState.flowing=j)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(j){this._readableState&&(this._readableState.destroyed=j)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),a(_e.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[H]!==!1},set(j){this[H]=!!j}}}),ce._fromList=Ai;function Ai(j,z){if(z.length===0)return null;let Ee;return z.objectMode?Ee=z.buffer.shift():!j||j>=z.length?(z.decoder?Ee=z.buffer.join(""):z.buffer.length===1?Ee=z.buffer.first():Ee=z.buffer.concat(z.length),z.buffer.clear()):Ee=z.buffer.consume(j,z.decoder),Ee}function dr(j){let z=j._readableState;w("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,t.nextTick(kt,z,j))}function kt(j,z){if(w("endReadableNT",j.endEmitted,j.length),!j.errored&&!j.closeEmitted&&!j.endEmitted&&j.length===0){if(j.endEmitted=!0,z.emit("end"),z.writable&&z.allowHalfOpen===!1)t.nextTick(_a,z);else if(j.autoDestroy){let Ee=z._writableState;(!Ee||Ee.autoDestroy&&(Ee.finished||Ee.writable===!1))&&z.destroy()}}}function _a(j){j.writable&&!j.writableEnded&&!j.destroyed&&j.end()}ce.from=function(j,z){return V(ce,j,z)};var Pi;function _s(){return Pi===void 0&&(Pi={}),Pi}ce.fromWeb=function(j,z){return _s().newStreamReadableFromReadableStream(j,z)},ce.toWeb=function(j,z){return _s().newReadableStreamFromStreamReadable(j,z)},ce.wrap=function(j,z){var Ee,Ae;return new ce({objectMode:(Ee=(Ae=j.readableObjectMode)!==null&&Ae!==void 0?Ae:j.objectMode)!==null&&Ee!==void 0?Ee:!0,...z,destroy(Oe,ht){E.destroyer(j,Oe),ht(Oe)}}).wrap(j)}}),Lg=ve((n,e)=>{pe(),me(),ge();var t=On(),{ArrayPrototypeSlice:r,Error:i,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:o,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:c,SymbolHasInstance:h}=Qe();e.exports=G,G.WritableState=R;var{EventEmitter:f}=(Pn(),$e(tn)),d=jg().Stream,{Buffer:p}=(yt(),$e(mt)),g=_i(),{addAbortSignal:m}=zo(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=Vo(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:x,ERR_STREAM_DESTROYED:E,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:O,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:M}=Ot().codes,{errorOrDestroy:C}=g;l(G.prototype,d.prototype),l(G,d);function k(){}var N=c("kOnFinished");function R(L,J,ee){typeof ee!="boolean"&&(ee=J instanceof kr()),this.objectMode=!!(L&&L.objectMode),ee&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?v(this,L,"writableHighWaterMark",ee):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let he=!!(L&&L.decodeStrings===!1);this.decodeStrings=!he,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=B.bind(void 0,J),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[N]=[]}function $(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}R.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},o(R.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function G(L){let J=this instanceof kr();if(!J&&!s(G,this))return new G(L);this._writableState=new R(L,this,J),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&m(L.signal,this)),d.call(this,L),g.construct(this,()=>{let ee=this._writableState;ee.writing||re(this,ee),Y(this,ee)})}o(G,h,{__proto__:null,value:function(L){return s(this,L)?!0:this!==G?!1:L&&L._writableState instanceof R}}),G.prototype.pipe=function(){C(this,new x)};function H(L,J,ee,he){let fe=L._writableState;if(typeof ee=="function")he=ee,ee=fe.defaultEncoding;else{if(!ee)ee=fe.defaultEncoding;else if(ee!=="buffer"&&!p.isEncoding(ee))throw new M(ee);typeof he!="function"&&(he=k)}if(J===null)throw new O;if(!fe.objectMode)if(typeof J=="string")fe.decodeStrings!==!1&&(J=p.from(J,ee),ee="buffer");else if(J instanceof p)ee="buffer";else if(d._isUint8Array(J))J=d._uint8ArrayToBuffer(J),ee="buffer";else throw new b("chunk",["string","Buffer","Uint8Array"],J);let we;return fe.ending?we=new T:fe.destroyed&&(we=new E("write")),we?(t.nextTick(he,we),C(L,we,!0),we):(fe.pendingcb++,se(L,fe,J,ee,he))}G.prototype.write=function(L,J,ee){return H(this,L,J,ee)===!0},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){let L=this._writableState;L.corked&&(L.corked--,L.writing||re(this,L))},G.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=u(L)),!p.isEncoding(L))throw new M(L);return this._writableState.defaultEncoding=L,this};function se(L,J,ee,he,fe){let we=J.objectMode?1:ee.length;J.length+=we;let X=J.length<J.highWaterMark;return X||(J.needDrain=!0),J.writing||J.corked||J.errored||!J.constructed?(J.buffered.push({chunk:ee,encoding:he,callback:fe}),J.allBuffers&&he!=="buffer"&&(J.allBuffers=!1),J.allNoop&&fe!==k&&(J.allNoop=!1)):(J.writelen=we,J.writecb=fe,J.writing=!0,J.sync=!0,L._write(ee,he,J.onwrite),J.sync=!1),X&&!J.errored&&!J.destroyed}function V(L,J,ee,he,fe,we,X){J.writelen=he,J.writecb=X,J.writing=!0,J.sync=!0,J.destroyed?J.onwrite(new E("write")):ee?L._writev(fe,J.onwrite):L._write(fe,we,J.onwrite),J.sync=!1}function te(L,J,ee,he){--J.pendingcb,he(ee),q(J),C(L,ee)}function B(L,J){let ee=L._writableState,he=ee.sync,fe=ee.writecb;if(typeof fe!="function"){C(L,new w);return}ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0,J?(J.stack,ee.errored||(ee.errored=J),L._readableState&&!L._readableState.errored&&(L._readableState.errored=J),he?t.nextTick(te,L,ee,J,fe):te(L,ee,J,fe)):(ee.buffered.length>ee.bufferedIndex&&re(L,ee),he?ee.afterWriteTickInfo!==null&&ee.afterWriteTickInfo.cb===fe?ee.afterWriteTickInfo.count++:(ee.afterWriteTickInfo={count:1,cb:fe,stream:L,state:ee},t.nextTick(ne,ee.afterWriteTickInfo)):U(L,ee,1,fe))}function ne({stream:L,state:J,count:ee,cb:he}){return J.afterWriteTickInfo=null,U(L,J,ee,he)}function U(L,J,ee,he){for(!J.ending&&!L.destroyed&&J.length===0&&J.needDrain&&(J.needDrain=!1,L.emit("drain"));ee-- >0;)J.pendingcb--,he();J.destroyed&&q(J),Y(L,J)}function q(L){if(L.writing)return;for(let fe=L.bufferedIndex;fe<L.buffered.length;++fe){var J;let{chunk:we,callback:X}=L.buffered[fe],be=L.objectMode?1:we.length;L.length-=be,X((J=L.errored)!==null&&J!==void 0?J:new E("write"))}let ee=L[N].splice(0);for(let fe=0;fe<ee.length;fe++){var he;ee[fe]((he=L.errored)!==null&&he!==void 0?he:new E("end"))}$(L)}function re(L,J){if(J.corked||J.bufferProcessing||J.destroyed||!J.constructed)return;let{buffered:ee,bufferedIndex:he,objectMode:fe}=J,we=ee.length-he;if(!we)return;let X=he;if(J.bufferProcessing=!0,we>1&&L._writev){J.pendingcb-=we-1;let be=J.allNoop?k:ce=>{for(let Re=X;Re<ee.length;++Re)ee[Re].callback(ce)},_e=J.allNoop&&X===0?ee:r(ee,X);_e.allBuffers=J.allBuffers,V(L,J,!0,J.length,_e,"",be),$(J)}else{do{let{chunk:be,encoding:_e,callback:ce}=ee[X];ee[X++]=null;let Re=fe?1:be.length;V(L,J,!1,Re,be,_e,ce)}while(X<ee.length&&!J.writing);X===ee.length?$(J):X>256?(ee.splice(0,X),J.bufferedIndex=0):J.bufferedIndex=X}J.bufferProcessing=!1}G.prototype._write=function(L,J,ee){if(this._writev)this._writev([{chunk:L,encoding:J}],ee);else throw new _("_write()")},G.prototype._writev=null,G.prototype.end=function(L,J,ee){let he=this._writableState;typeof L=="function"?(ee=L,L=null,J=null):typeof J=="function"&&(ee=J,J=null);let fe;if(L!=null){let we=H(this,L,J);we instanceof i&&(fe=we)}return he.corked&&(he.corked=1,this.uncork()),fe||(!he.errored&&!he.ending?(he.ending=!0,Y(this,he,!0),he.ended=!0):he.finished?fe=new A("end"):he.destroyed&&(fe=new E("end"))),typeof ee=="function"&&(fe||he.finished?t.nextTick(ee,fe):he[N].push(ee)),this};function F(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function D(L,J){let ee=!1;function he(fe){if(ee){C(L,fe??w());return}if(ee=!0,J.pendingcb--,fe){let we=J[N].splice(0);for(let X=0;X<we.length;X++)we[X](fe);C(L,fe,J.sync)}else F(J)&&(J.prefinished=!0,L.emit("prefinish"),J.pendingcb++,t.nextTick(Q,L,J))}J.sync=!0,J.pendingcb++;try{L._final(he)}catch(fe){he(fe)}J.sync=!1}function ae(L,J){!J.prefinished&&!J.finalCalled&&(typeof L._final=="function"&&!J.destroyed?(J.finalCalled=!0,D(L,J)):(J.prefinished=!0,L.emit("prefinish")))}function Y(L,J,ee){F(J)&&(ae(L,J),J.pendingcb===0&&(ee?(J.pendingcb++,t.nextTick((he,fe)=>{F(fe)?Q(he,fe):fe.pendingcb--},L,J)):F(J)&&(J.pendingcb++,Q(L,J))))}function Q(L,J){J.pendingcb--,J.finished=!0;let ee=J[N].splice(0);for(let he=0;he<ee.length;he++)ee[he]();if(L.emit("finish"),J.autoDestroy){let he=L._readableState;(!he||he.autoDestroy&&(he.endEmitted||he.readable===!1))&&L.destroy()}}a(G.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(L){this._writableState&&(this._writableState.destroyed=L)}},writable:{__proto__:null,get(){let L=this._writableState;return!!L&&L.writable!==!1&&!L.destroyed&&!L.errored&&!L.ending&&!L.ended},set(L){this._writableState&&(this._writableState.writable=!!L)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let L=this._writableState;return L?!L.destroyed&&!L.ending&&L.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ie=g.destroy;G.prototype.destroy=function(L,J){let ee=this._writableState;return!ee.destroyed&&(ee.bufferedIndex<ee.buffered.length||ee[N].length)&&t.nextTick(q,ee),ie.call(this,L,J),this},G.prototype._undestroy=g.undestroy,G.prototype._destroy=function(L,J){J(L)},G.prototype[f.captureRejectionSymbol]=function(L){this.destroy(L)};var ye;function ue(){return ye===void 0&&(ye={}),ye}G.fromWeb=function(L,J){return ue().newStreamWritableFromWritableStream(L,J)},G.toWeb=function(L){return ue().newWritableStreamFromStreamWritable(L)}}),B$=ve((n,e)=>{pe(),me(),ge();var t=On(),r=(yt(),$e(mt)),{isReadable:i,isWritable:s,isIterable:o,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:c,isReadableStream:h,isWritableStream:f}=Rr(),d=rn(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:m}}=Ot(),{destroyer:v}=_i(),y=kr(),b=Wo(),_=Lg(),{createDeferredPromise:w}=It(),x=EA(),E=globalThis.Blob||r.Blob,A=typeof E<"u"?function(N){return N instanceof E}:function(N){return!1},O=globalThis.AbortController||ms().AbortController,{FunctionPrototypeCall:T}=Qe(),M=class extends y{constructor(N){super(N),N?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),N?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};e.exports=function N(R,$){if(c(R))return R;if(l(R))return k({readable:R});if(u(R))return k({writable:R});if(a(R))return k({writable:!1,readable:!1});if(h(R))return k({readable:b.fromWeb(R)});if(f(R))return k({writable:_.fromWeb(R)});if(typeof R=="function"){let{value:H,write:se,final:V,destroy:te}=C(R);if(o(H))return x(M,H,{objectMode:!0,write:se,final:V,destroy:te});let B=H?.then;if(typeof B=="function"){let ne,U=T(B,H,q=>{if(q!=null)throw new m("nully","body",q)},q=>{v(ne,q)});return ne=new M({objectMode:!0,readable:!1,write:se,final(q){V(async()=>{try{await U,t.nextTick(q,null)}catch(re){t.nextTick(q,re)}})},destroy:te})}throw new m("Iterable, AsyncIterable or AsyncFunction",$,H)}if(A(R))return N(R.arrayBuffer());if(o(R))return x(M,R,{objectMode:!0,writable:!1});if(h(R?.readable)&&f(R?.writable))return M.fromWeb(R);if(typeof R?.writable=="object"||typeof R?.readable=="object"){let H=R!=null&&R.readable?l(R?.readable)?R?.readable:N(R.readable):void 0,se=R!=null&&R.writable?u(R?.writable)?R?.writable:N(R.writable):void 0;return k({readable:H,writable:se})}let G=R?.then;if(typeof G=="function"){let H;return T(G,R,se=>{se!=null&&H.push(se),H.push(null)},se=>{v(H,se)}),H=new M({objectMode:!0,writable:!1,read(){}})}throw new g($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],R)};function C(N){let{promise:R,resolve:$}=w(),G=new O,H=G.signal;return{value:N((async function*(){for(;;){let se=R;R=null;let{chunk:V,done:te,cb:B}=await se;if(t.nextTick(B),te)return;if(H.aborted)throw new p(void 0,{cause:H.reason});({promise:R,resolve:$}=w()),yield V}})(),{signal:H}),write(se,V,te){let B=$;$=null,B({chunk:se,done:!1,cb:te})},final(se){let V=$;$=null,V({done:!0,cb:se})},destroy(se,V){G.abort(),V(se)}}}function k(N){let R=N.readable&&typeof N.readable.read!="function"?b.wrap(N.readable):N.readable,$=N.writable,G=!!i(R),H=!!s($),se,V,te,B,ne;function U(q){let re=B;B=null,re?re(q):q&&ne.destroy(q)}return ne=new M({readableObjectMode:!!(R!=null&&R.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:G,writable:H}),H&&(d($,q=>{H=!1,q&&v(R,q),U(q)}),ne._write=function(q,re,F){$.write(q,re)?F():se=F},ne._final=function(q){$.end(),V=q},$.on("drain",function(){if(se){let q=se;se=null,q()}}),$.on("finish",function(){if(V){let q=V;V=null,q()}})),G&&(d(R,q=>{G=!1,q&&v(R,q),U(q)}),R.on("readable",function(){if(te){let q=te;te=null,q()}}),R.on("end",function(){ne.push(null)}),ne._read=function(){for(;;){let q=R.read();if(q===null){te=ne._read;return}if(!ne.push(q))return}}),ne._destroy=function(q,re){!q&&B!==null&&(q=new p),te=null,se=null,V=null,B===null?re(q):(B=re,v($,q),v(R,q))},ne}}),kr=ve((n,e)=>{pe(),me(),ge();var{ObjectDefineProperties:t,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:i,ObjectSetPrototypeOf:s}=Qe();e.exports=l;var o=Wo(),a=Lg();s(l.prototype,o.prototype),s(l,o);{let f=i(a.prototype);for(let d=0;d<f.length;d++){let p=f[d];l.prototype[p]||(l.prototype[p]=a.prototype[p])}}function l(f){if(!(this instanceof l))return new l(f);o.call(this,f),a.call(this,f),f?(this.allowHalfOpen=f.allowHalfOpen!==!1,f.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),f.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}t(l.prototype,{writable:{__proto__:null,...r(a.prototype,"writable")},writableHighWaterMark:{__proto__:null,...r(a.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...r(a.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...r(a.prototype,"writableBuffer")},writableLength:{__proto__:null,...r(a.prototype,"writableLength")},writableFinished:{__proto__:null,...r(a.prototype,"writableFinished")},writableCorked:{__proto__:null,...r(a.prototype,"writableCorked")},writableEnded:{__proto__:null,...r(a.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...r(a.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(f){this._readableState&&this._writableState&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}});var u;function c(){return u===void 0&&(u={}),u}l.fromWeb=function(f,d){return c().newStreamDuplexFromReadableWritablePair(f,d)},l.toWeb=function(f){return c().newReadableWritablePairFromDuplex(f)};var h;l.from=function(f){return h||(h=B$()),h(f,"body")}}),SA=ve((n,e)=>{pe(),me(),ge();var{ObjectSetPrototypeOf:t,Symbol:r}=Qe();e.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:i}=Ot().codes,s=kr(),{getHighWaterMark:o}=Vo();t(l.prototype,s.prototype),t(l,s);var a=r("kCallback");function l(h){if(!(this instanceof l))return new l(h);let f=h?o(this,h,"readableHighWaterMark",!0):null;f===0&&(h={...h,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:h.writableHighWaterMark||0}),s.call(this,h),this._readableState.sync=!1,this[a]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",c)}function u(h){typeof this._flush=="function"&&!this.destroyed?this._flush((f,d)=>{if(f){h?h(f):this.destroy(f);return}d!=null&&this.push(d),this.push(null),h&&h()}):(this.push(null),h&&h())}function c(){this._final!==u&&u.call(this)}l.prototype._final=u,l.prototype._transform=function(h,f,d){throw new i("_transform()")},l.prototype._write=function(h,f,d){let p=this._readableState,g=this._writableState,m=p.length;this._transform(h,f,(v,y)=>{if(v){d(v);return}y!=null&&this.push(y),g.ended||m===p.length||p.length<p.highWaterMark?d():this[a]=d})},l.prototype._read=function(){if(this[a]){let h=this[a];this[a]=null,h()}}}),AA=ve((n,e)=>{pe(),me(),ge();var{ObjectSetPrototypeOf:t}=Qe();e.exports=i;var r=SA();t(i.prototype,r.prototype),t(i,r);function i(s){if(!(this instanceof i))return new i(s);r.call(this,s)}i.prototype._transform=function(s,o,a){a(null,s)}}),Dg=ve((n,e)=>{pe(),me(),ge();var t=On(),{ArrayIsArray:r,Promise:i,SymbolAsyncIterator:s,SymbolDispose:o}=Qe(),a=rn(),{once:l}=It(),u=_i(),c=kr(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:d,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:v}=Ot(),{validateFunction:y,validateAbortSignal:b}=bs(),{isIterable:_,isReadable:w,isReadableNodeStream:x,isNodeStream:E,isTransformStream:A,isWebStream:O,isReadableStream:T,isReadableFinished:M}=Rr(),C=globalThis.AbortController||ms().AbortController,k,N,R;function $(q,re,F){let D=!1;q.on("close",()=>{D=!0});let ae=a(q,{readable:re,writable:F},Y=>{D=!Y});return{destroy:Y=>{D||(D=!0,u.destroyer(q,Y||new g("pipe")))},cleanup:ae}}function G(q){return y(q[q.length-1],"streams[stream.length - 1]"),q.pop()}function H(q){if(_(q))return q;if(x(q))return se(q);throw new f("val",["Readable","Iterable","AsyncIterable"],q)}async function*se(q){N||(N=Wo()),yield*N.prototype[s].call(q)}async function V(q,re,F,{end:D}){let ae,Y=null,Q=ue=>{if(ue&&(ae=ue),Y){let L=Y;Y=null,L()}},ie=()=>new i((ue,L)=>{ae?L(ae):Y=()=>{ae?L(ae):ue()}});re.on("drain",Q);let ye=a(re,{readable:!1},Q);try{re.writableNeedDrain&&await ie();for await(let ue of q)re.write(ue)||await ie();D&&(re.end(),await ie()),F()}catch(ue){F(ae!==ue?h(ae,ue):ue)}finally{ye(),re.off("drain",Q)}}async function te(q,re,F,{end:D}){A(re)&&(re=re.writable);let ae=re.getWriter();try{for await(let Y of q)await ae.ready,ae.write(Y).catch(()=>{});await ae.ready,D&&await ae.close(),F()}catch(Y){try{await ae.abort(Y),F(Y)}catch(Q){F(Q)}}}function B(...q){return ne(q,l(G(q)))}function ne(q,re,F){if(q.length===1&&r(q[0])&&(q=q[0]),q.length<2)throw new p("streams");let D=new C,ae=D.signal,Y=F?.signal,Q=[];b(Y,"options.signal");function ie(){fe(new v)}R=R||It().addAbortListener;let ye;Y&&(ye=R(Y,ie));let ue,L,J=[],ee=0;function he(_e){fe(_e,--ee===0)}function fe(_e,ce){var Re;if(_e&&(!ue||ue.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ue=_e),!(!ue&&!ce)){for(;J.length;)J.shift()(ue);(Re=ye)===null||Re===void 0||Re[o](),D.abort(),ce&&(ue||Q.forEach(S=>S()),t.nextTick(re,ue,L))}}let we;for(let _e=0;_e<q.length;_e++){let ce=q[_e],Re=_e<q.length-1,S=_e>0,P=Re||F?.end!==!1,I=_e===q.length-1;if(E(ce)){let K=function(oe){oe&&oe.name!=="AbortError"&&oe.code!=="ERR_STREAM_PREMATURE_CLOSE"&&he(oe)};if(P){let{destroy:oe,cleanup:de}=$(ce,Re,S);J.push(oe),w(ce)&&I&&Q.push(de)}ce.on("error",K),w(ce)&&I&&Q.push(()=>{ce.removeListener("error",K)})}if(_e===0)if(typeof ce=="function"){if(we=ce({signal:ae}),!_(we))throw new d("Iterable, AsyncIterable or Stream","source",we)}else _(ce)||x(ce)||A(ce)?we=ce:we=c.from(ce);else if(typeof ce=="function"){if(A(we)){var X;we=H((X=we)===null||X===void 0?void 0:X.readable)}else we=H(we);if(we=ce(we,{signal:ae}),Re){if(!_(we,!0))throw new d("AsyncIterable",`transform[${_e-1}]`,we)}else{var be;k||(k=AA());let K=new k({objectMode:!0}),oe=(be=we)===null||be===void 0?void 0:be.then;if(typeof oe=="function")ee++,oe.call(we,Z=>{L=Z,Z!=null&&K.write(Z),P&&K.end(),t.nextTick(he)},Z=>{K.destroy(Z),t.nextTick(he,Z)});else if(_(we,!0))ee++,V(we,K,he,{end:P});else if(T(we)||A(we)){let Z=we.readable||we;ee++,V(Z,K,he,{end:P})}else throw new d("AsyncIterable or Promise","destination",we);we=K;let{destroy:de,cleanup:xe}=$(we,!1,!0);J.push(de),I&&Q.push(xe)}}else if(E(ce)){if(x(we)){ee+=2;let K=U(we,ce,he,{end:P});w(ce)&&I&&Q.push(K)}else if(A(we)||T(we)){let K=we.readable||we;ee++,V(K,ce,he,{end:P})}else if(_(we))ee++,V(we,ce,he,{end:P});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],we);we=ce}else if(O(ce)){if(x(we))ee++,te(H(we),ce,he,{end:P});else if(T(we)||_(we))ee++,te(we,ce,he,{end:P});else if(A(we))ee++,te(we.readable,ce,he,{end:P});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],we);we=ce}else we=c.from(ce)}return(ae!=null&&ae.aborted||Y!=null&&Y.aborted)&&t.nextTick(ie),we}function U(q,re,F,{end:D}){let ae=!1;if(re.on("close",()=>{ae||F(new m)}),q.pipe(re,{end:!1}),D){let Y=function(){ae=!0,re.end()};M(q)?t.nextTick(Y):q.once("end",Y)}else F();return a(q,{readable:!0,writable:!1},Y=>{let Q=q._readableState;Y&&Y.code==="ERR_STREAM_PREMATURE_CLOSE"&&Q&&Q.ended&&!Q.errored&&!Q.errorEmitted?q.once("end",F).once("error",F):F(Y)}),a(re,{readable:!1,writable:!0},F)}e.exports={pipelineImpl:ne,pipeline:B}}),PA=ve((n,e)=>{pe(),me(),ge();var{pipeline:t}=Dg(),r=kr(),{destroyer:i}=_i(),{isNodeStream:s,isReadable:o,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:c,isReadableStream:h}=Rr(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:p}}=Ot(),g=rn();e.exports=function(...m){if(m.length===0)throw new p("streams");if(m.length===1)return r.from(m[0]);let v=[...m];if(typeof m[0]=="function"&&(m[0]=r.from(m[0])),typeof m[m.length-1]=="function"){let C=m.length-1;m[C]=r.from(m[C])}for(let C=0;C<m.length;++C)if(!(!s(m[C])&&!l(m[C]))){if(C<m.length-1&&!(o(m[C])||h(m[C])||u(m[C])))throw new d(`streams[${C}]`,v[C],"must be readable");if(C>0&&!(a(m[C])||c(m[C])||u(m[C])))throw new d(`streams[${C}]`,v[C],"must be writable")}let y,b,_,w,x;function E(C){let k=w;w=null,k?k(C):C?x.destroy(C):!M&&!T&&x.destroy()}let A=m[0],O=t(m,E),T=!!(a(A)||c(A)||u(A)),M=!!(o(O)||h(O)||u(O));if(x=new r({writableObjectMode:!!(A!=null&&A.writableObjectMode),readableObjectMode:!!(O!=null&&O.readableObjectMode),writable:T,readable:M}),T){if(s(A))x._write=function(k,N,R){A.write(k,N)?R():y=R},x._final=function(k){A.end(),b=k},A.on("drain",function(){if(y){let k=y;y=null,k()}});else if(l(A)){let k=(u(A)?A.writable:A).getWriter();x._write=async function(N,R,$){try{await k.ready,k.write(N).catch(()=>{}),$()}catch(G){$(G)}},x._final=async function(N){try{await k.ready,k.close().catch(()=>{}),b=N}catch(R){N(R)}}}let C=u(O)?O.readable:O;g(C,()=>{if(b){let k=b;b=null,k()}})}if(M){if(s(O))O.on("readable",function(){if(_){let C=_;_=null,C()}}),O.on("end",function(){x.push(null)}),x._read=function(){for(;;){let C=O.read();if(C===null){_=x._read;return}if(!x.push(C))return}};else if(l(O)){let C=(u(O)?O.readable:O).getReader();x._read=async function(){for(;;)try{let{value:k,done:N}=await C.read();if(!x.push(k))return;if(N){x.push(null);return}}catch{return}}}}return x._destroy=function(C,k){!C&&w!==null&&(C=new f),_=null,y=null,b=null,w===null?k(C):(w=k,s(O)&&i(O,C))},x}}),q$=ve((n,e)=>{pe(),me(),ge();var t=globalThis.AbortController||ms().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:o},AbortError:a}=Ot(),{validateAbortSignal:l,validateInteger:u,validateObject:c}=bs(),h=Qe().Symbol("kWeak"),f=Qe().Symbol("kResistStopPropagation"),{finished:d}=rn(),p=PA(),{addAbortSignalNoValidate:g}=zo(),{isWritable:m,isNodeStream:v}=Rr(),{deprecate:y}=It(),{ArrayPrototypePush:b,Boolean:_,MathFloor:w,Number:x,NumberIsNaN:E,Promise:A,PromiseReject:O,PromiseResolve:T,PromisePrototypeThen:M,Symbol:C}=Qe(),k=C("kEmpty"),N=C("kEof");function R(Y,Q){if(Q!=null&&c(Q,"options"),Q?.signal!=null&&l(Q.signal,"options.signal"),v(Y)&&!m(Y))throw new r("stream",Y,"must be writable");let ie=p(this,Y);return Q!=null&&Q.signal&&g(Q.signal,ie),ie}function $(Y,Q){if(typeof Y!="function")throw new i("fn",["Function","AsyncFunction"],Y);Q!=null&&c(Q,"options"),Q?.signal!=null&&l(Q.signal,"options.signal");let ie=1;Q?.concurrency!=null&&(ie=w(Q.concurrency));let ye=ie-1;return Q?.highWaterMark!=null&&(ye=w(Q.highWaterMark)),u(ie,"options.concurrency",1),u(ye,"options.highWaterMark",0),ye+=ie,(async function*(){let ue=It().AbortSignalAny([Q?.signal].filter(_)),L=this,J=[],ee={signal:ue},he,fe,we=!1,X=0;function be(){we=!0,_e()}function _e(){X-=1,ce()}function ce(){fe&&!we&&X<ie&&J.length<ye&&(fe(),fe=null)}async function Re(){try{for await(let S of L){if(we)return;if(ue.aborted)throw new a;try{if(S=Y(S,ee),S===k)continue;S=T(S)}catch(P){S=O(P)}X+=1,M(S,_e,be),J.push(S),he&&(he(),he=null),!we&&(J.length>=ye||X>=ie)&&await new A(P=>{fe=P})}J.push(N)}catch(S){let P=O(S);M(P,_e,be),J.push(P)}finally{we=!0,he&&(he(),he=null)}}Re();try{for(;;){for(;J.length>0;){let S=await J[0];if(S===N)return;if(ue.aborted)throw new a;S!==k&&(yield S),J.shift(),ce()}await new A(S=>{he=S})}}finally{we=!0,fe&&(fe(),fe=null)}}).call(this)}function G(Y=void 0){return Y!=null&&c(Y,"options"),Y?.signal!=null&&l(Y.signal,"options.signal"),(async function*(){let Q=0;for await(let ye of this){var ie;if(Y!=null&&(ie=Y.signal)!==null&&ie!==void 0&&ie.aborted)throw new a({cause:Y.signal.reason});yield[Q++,ye]}}).call(this)}async function H(Y,Q=void 0){for await(let ie of B.call(this,Y,Q))return!0;return!1}async function se(Y,Q=void 0){if(typeof Y!="function")throw new i("fn",["Function","AsyncFunction"],Y);return!await H.call(this,async(...ie)=>!await Y(...ie),Q)}async function V(Y,Q){for await(let ie of B.call(this,Y,Q))return ie}async function te(Y,Q){if(typeof Y!="function")throw new i("fn",["Function","AsyncFunction"],Y);async function ie(ye,ue){return await Y(ye,ue),k}for await(let ye of $.call(this,ie,Q));}function B(Y,Q){if(typeof Y!="function")throw new i("fn",["Function","AsyncFunction"],Y);async function ie(ye,ue){return await Y(ye,ue)?ye:k}return $.call(this,ie,Q)}var ne=class extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function U(Y,Q,ie){var ye;if(typeof Y!="function")throw new i("reducer",["Function","AsyncFunction"],Y);ie!=null&&c(ie,"options"),ie?.signal!=null&&l(ie.signal,"options.signal");let ue=arguments.length>1;if(ie!=null&&(ye=ie.signal)!==null&&ye!==void 0&&ye.aborted){let fe=new a(void 0,{cause:ie.signal.reason});throw this.once("error",()=>{}),await d(this.destroy(fe)),fe}let L=new t,J=L.signal;if(ie!=null&&ie.signal){let fe={once:!0,[h]:this,[f]:!0};ie.signal.addEventListener("abort",()=>L.abort(),fe)}let ee=!1;try{for await(let fe of this){var he;if(ee=!0,ie!=null&&(he=ie.signal)!==null&&he!==void 0&&he.aborted)throw new a;ue?Q=await Y(Q,fe,{signal:J}):(Q=fe,ue=!0)}if(!ee&&!ue)throw new ne}finally{L.abort()}return Q}async function q(Y){Y!=null&&c(Y,"options"),Y?.signal!=null&&l(Y.signal,"options.signal");let Q=[];for await(let ye of this){var ie;if(Y!=null&&(ie=Y.signal)!==null&&ie!==void 0&&ie.aborted)throw new a(void 0,{cause:Y.signal.reason});b(Q,ye)}return Q}function re(Y,Q){let ie=$.call(this,Y,Q);return(async function*(){for await(let ye of ie)yield*ye}).call(this)}function F(Y){if(Y=x(Y),E(Y))return 0;if(Y<0)throw new o("number",">= 0",Y);return Y}function D(Y,Q=void 0){return Q!=null&&c(Q,"options"),Q?.signal!=null&&l(Q.signal,"options.signal"),Y=F(Y),(async function*(){var ie;if(Q!=null&&(ie=Q.signal)!==null&&ie!==void 0&&ie.aborted)throw new a;for await(let ue of this){var ye;if(Q!=null&&(ye=Q.signal)!==null&&ye!==void 0&&ye.aborted)throw new a;Y--<=0&&(yield ue)}}).call(this)}function ae(Y,Q=void 0){return Q!=null&&c(Q,"options"),Q?.signal!=null&&l(Q.signal,"options.signal"),Y=F(Y),(async function*(){var ie;if(Q!=null&&(ie=Q.signal)!==null&&ie!==void 0&&ie.aborted)throw new a;for await(let ue of this){var ye;if(Q!=null&&(ye=Q.signal)!==null&&ye!==void 0&&ye.aborted)throw new a;if(Y-- >0&&(yield ue),Y<=0)return}}).call(this)}e.exports.streamReturningOperators={asIndexedPairs:y(G,"readable.asIndexedPairs will be removed in a future version."),drop:D,filter:B,flatMap:re,map:$,take:ae,compose:R},e.exports.promiseReturningOperators={every:se,forEach:te,reduce:U,toArray:q,some:H,find:V}}),OA=ve((n,e)=>{pe(),me(),ge();var{ArrayPrototypePop:t,Promise:r}=Qe(),{isIterable:i,isNodeStream:s,isWebStream:o}=Rr(),{pipelineImpl:a}=Dg(),{finished:l}=rn();CA();function u(...c){return new r((h,f)=>{let d,p,g=c[c.length-1];if(g&&typeof g=="object"&&!s(g)&&!i(g)&&!o(g)){let m=t(c);d=m.signal,p=m.end}a(c,(m,v)=>{m?f(m):h(v)},{signal:d,end:p})})}e.exports={finished:l,pipeline:u}}),CA=ve((n,e)=>{pe(),me(),ge();var{Buffer:t}=(yt(),$e(mt)),{ObjectDefineProperty:r,ObjectKeys:i,ReflectApply:s}=Qe(),{promisify:{custom:o}}=It(),{streamReturningOperators:a,promiseReturningOperators:l}=q$(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=Ot(),c=PA(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:f}=Vo(),{pipeline:d}=Dg(),{destroyer:p}=_i(),g=rn(),m=OA(),v=Rr(),y=e.exports=jg().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=Wo();for(let _ of i(a)){let w=function(...E){if(new.target)throw u();return y.Readable.from(s(x,this,E))},x=a[_];r(w,"name",{__proto__:null,value:x.name}),r(w,"length",{__proto__:null,value:x.length}),r(y.Readable.prototype,_,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let _ of i(l)){let w=function(...E){if(new.target)throw u();return s(x,this,E)},x=l[_];r(w,"name",{__proto__:null,value:x.name}),r(w,"length",{__proto__:null,value:x.length}),r(y.Readable.prototype,_,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}y.Writable=Lg(),y.Duplex=kr(),y.Transform=SA(),y.PassThrough=AA(),y.pipeline=d;var{addAbortSignal:b}=zo();y.addAbortSignal=b,y.finished=g,y.destroy=p,y.compose=c,y.setDefaultHighWaterMark=h,y.getDefaultHighWaterMark=f,r(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),r(d,o,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),r(g,o,{__proto__:null,enumerable:!0,get(){return m.finished}}),y.Stream=y,y._isUint8Array=function(_){return _ instanceof Uint8Array},y._uint8ArrayToBuffer=function(_){return t.from(_.buffer,_.byteOffset,_.byteLength)}}),Cn=ve((n,e)=>{pe(),me(),ge();var t=CA(),r=OA(),i=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=i,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports}),F$=ve((n,e)=>{pe(),me(),ge(),typeof Object.create=="function"?e.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}}),$$=ve((n,e)=>{pe(),me(),ge();var{Buffer:t}=(yt(),$e(mt)),r=Symbol.for("BufferList");function i(s){if(!(this instanceof i))return new i(s);i._init.call(this,s)}i._init=function(s){Object.defineProperty(this,r,{value:!0}),this._bufs=[],this.length=0,s&&this.append(s)},i.prototype._new=function(s){return new i(s)},i.prototype._offset=function(s){if(s===0)return[0,0];let o=0;for(let a=0;a<this._bufs.length;a++){let l=o+this._bufs[a].length;if(s<l||a===this._bufs.length-1)return[a,s-o];o=l}},i.prototype._reverseOffset=function(s){let o=s[0],a=s[1];for(let l=0;l<o;l++)a+=this._bufs[l].length;return a},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(s){if(s>this.length||s<0)return;let o=this._offset(s);return this._bufs[o[0]][o[1]]},i.prototype.slice=function(s,o){return typeof s=="number"&&s<0&&(s+=this.length),typeof o=="number"&&o<0&&(o+=this.length),this.copy(null,0,s,o)},i.prototype.copy=function(s,o,a,l){if((typeof a!="number"||a<0)&&(a=0),(typeof l!="number"||l>this.length)&&(l=this.length),a>=this.length||l<=0)return s||t.alloc(0);let u=!!s,c=this._offset(a),h=l-a,f=h,d=u&&o||0,p=c[1];if(a===0&&l===this.length){if(!u)return this._bufs.length===1?this._bufs[0]:t.concat(this._bufs,this.length);for(let g=0;g<this._bufs.length;g++)this._bufs[g].copy(s,d),d+=this._bufs[g].length;return s}if(f<=this._bufs[c[0]].length-p)return u?this._bufs[c[0]].copy(s,o,p,p+f):this._bufs[c[0]].slice(p,p+f);u||(s=t.allocUnsafe(h));for(let g=c[0];g<this._bufs.length;g++){let m=this._bufs[g].length-p;if(f>m)this._bufs[g].copy(s,d,p),d+=m;else{this._bufs[g].copy(s,d,p,p+f),d+=m;break}f-=m,p&&(p=0)}return s.length>d?s.slice(0,d):s},i.prototype.shallowSlice=function(s,o){if(s=s||0,o=typeof o!="number"?this.length:o,s<0&&(s+=this.length),o<0&&(o+=this.length),s===o)return this._new();let a=this._offset(s),l=this._offset(o),u=this._bufs.slice(a[0],l[0]+1);return l[1]===0?u.pop():u[u.length-1]=u[u.length-1].slice(0,l[1]),a[1]!==0&&(u[0]=u[0].slice(a[1])),this._new(u)},i.prototype.toString=function(s,o,a){return this.slice(o,a).toString(s)},i.prototype.consume=function(s){if(s=Math.trunc(s),Number.isNaN(s)||s<=0)return this;for(;this._bufs.length;)if(s>=this._bufs[0].length)s-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(s),this.length-=s;break}return this},i.prototype.duplicate=function(){let s=this._new();for(let o=0;o<this._bufs.length;o++)s.append(this._bufs[o]);return s},i.prototype.append=function(s){return this._attach(s,i.prototype._appendBuffer)},i.prototype.prepend=function(s){return this._attach(s,i.prototype._prependBuffer,!0)},i.prototype._attach=function(s,o,a){if(s==null)return this;if(s.buffer)o.call(this,t.from(s.buffer,s.byteOffset,s.byteLength));else if(Array.isArray(s)){let[l,u]=a?[s.length-1,-1]:[0,1];for(let c=l;c>=0&&c<s.length;c+=u)this._attach(s[c],o,a)}else if(this._isBufferList(s)){let[l,u]=a?[s._bufs.length-1,-1]:[0,1];for(let c=l;c>=0&&c<s._bufs.length;c+=u)this._attach(s._bufs[c],o,a)}else typeof s=="number"&&(s=s.toString()),o.call(this,t.from(s));return this},i.prototype._appendBuffer=function(s){this._bufs.push(s),this.length+=s.length},i.prototype._prependBuffer=function(s){this._bufs.unshift(s),this.length+=s.length},i.prototype.indexOf=function(s,o,a){if(a===void 0&&typeof o=="string"&&(a=o,o=void 0),typeof s=="function"||Array.isArray(s))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof s=="number"?s=t.from([s]):typeof s=="string"?s=t.from(s,a):this._isBufferList(s)?s=s.slice():Array.isArray(s.buffer)?s=t.from(s.buffer,s.byteOffset,s.byteLength):t.isBuffer(s)||(s=t.from(s)),o=Number(o||0),isNaN(o)&&(o=0),o<0&&(o=this.length+o),o<0&&(o=0),s.length===0)return o>this.length?this.length:o;let l=this._offset(o),u=l[0],c=l[1];for(;u<this._bufs.length;u++){let h=this._bufs[u];for(;c<h.length;)if(h.length-c>=s.length){let f=h.indexOf(s,c);if(f!==-1)return this._reverseOffset([u,f]);c=h.length-s.length+1}else{let f=this._reverseOffset([u,c]);if(this._match(f,s))return f;c++}c=0}return-1},i.prototype._match=function(s,o){if(this.length-s<o.length)return!1;for(let a=0;a<o.length;a++)if(this.get(s+a)!==o[a])return!1;return!0},(function(){let s={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let o in s)(function(a){s[a]===null?i.prototype[a]=function(l,u){return this.slice(l,l+u)[a](0,u)}:i.prototype[a]=function(l=0){return this.slice(l,l+s[a])[a](0)}})(o)})(),i.prototype._isBufferList=function(s){return s instanceof i||i.isBufferList(s)},i.isBufferList=function(s){return s!=null&&s[r]},e.exports=i}),U$=ve((n,e)=>{pe(),me(),ge();var t=Cn().Duplex,r=F$(),i=$$();function s(o){if(!(this instanceof s))return new s(o);if(typeof o=="function"){this._callback=o;let a=(function(l){this._callback&&(this._callback(l),this._callback=null)}).bind(this);this.on("pipe",function(l){l.on("error",a)}),this.on("unpipe",function(l){l.removeListener("error",a)}),o=null}i._init.call(this,o),t.call(this)}r(s,t),Object.assign(s.prototype,i.prototype),s.prototype._new=function(o){return new s(o)},s.prototype._write=function(o,a,l){this._appendBuffer(o),typeof l=="function"&&l()},s.prototype._read=function(o){if(!this.length)return this.push(null);o=Math.min(o,this.length),this.push(this.slice(0,o)),this.consume(o)},s.prototype.end=function(o){t.prototype.end.call(this,o),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(o,a){this._bufs.length=0,this.length=0,a(o)},s.prototype._isBufferList=function(o){return o instanceof s||o instanceof i||s.isBufferList(o)},s.isBufferList=i.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=i}),z$=ve((n,e)=>{pe(),me(),ge();var t=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};e.exports=t}),TA=ve((n,e)=>{pe(),me(),ge();var t=e.exports,{Buffer:r}=(yt(),$e(mt));t.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},t.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},t.requiredHeaderFlagsErrors={};for(let s in t.requiredHeaderFlags){let o=t.requiredHeaderFlags[s];t.requiredHeaderFlagsErrors[s]="Invalid header flag bits, must be 0x"+o.toString(16)+" for "+t.types[s]+" packet"}t.codes={};for(let s in t.types){let o=t.types[s];t.codes[o]=s}t.CMD_SHIFT=4,t.CMD_MASK=240,t.DUP_MASK=8,t.QOS_MASK=3,t.QOS_SHIFT=1,t.RETAIN_MASK=1,t.VARBYTEINT_MASK=127,t.VARBYTEINT_FIN_MASK=128,t.VARBYTEINT_MAX=268435455,t.SESSIONPRESENT_MASK=1,t.SESSIONPRESENT_HEADER=r.from([t.SESSIONPRESENT_MASK]),t.CONNACK_HEADER=r.from([t.codes.connack<<t.CMD_SHIFT]),t.USERNAME_MASK=128,t.PASSWORD_MASK=64,t.WILL_RETAIN_MASK=32,t.WILL_QOS_MASK=24,t.WILL_QOS_SHIFT=3,t.WILL_FLAG_MASK=4,t.CLEAN_SESSION_MASK=2,t.CONNECT_HEADER=r.from([t.codes.connect<<t.CMD_SHIFT]),t.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},t.propertiesCodes={};for(let s in t.properties){let o=t.properties[s];t.propertiesCodes[o]=s}t.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function i(s){return[0,1,2].map(o=>[0,1].map(a=>[0,1].map(l=>{let u=r.alloc(1);return u.writeUInt8(t.codes[s]<<t.CMD_SHIFT|(a?t.DUP_MASK:0)|o<<t.QOS_SHIFT|l,0,!0),u})))}t.PUBLISH_HEADER=i("publish"),t.SUBSCRIBE_HEADER=i("subscribe"),t.SUBSCRIBE_OPTIONS_QOS_MASK=3,t.SUBSCRIBE_OPTIONS_NL_MASK=1,t.SUBSCRIBE_OPTIONS_NL_SHIFT=2,t.SUBSCRIBE_OPTIONS_RAP_MASK=1,t.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,t.SUBSCRIBE_OPTIONS_RH_MASK=3,t.SUBSCRIBE_OPTIONS_RH_SHIFT=4,t.SUBSCRIBE_OPTIONS_RH=[0,16,32],t.SUBSCRIBE_OPTIONS_NL=4,t.SUBSCRIBE_OPTIONS_RAP=8,t.SUBSCRIBE_OPTIONS_QOS=[0,1,2],t.UNSUBSCRIBE_HEADER=i("unsubscribe"),t.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},t.SUBACK_HEADER=r.from([t.codes.suback<<t.CMD_SHIFT]),t.VERSION3=r.from([3]),t.VERSION4=r.from([4]),t.VERSION5=r.from([5]),t.VERSION131=r.from([131]),t.VERSION132=r.from([132]),t.QOS=[0,1,2].map(s=>r.from([s])),t.EMPTY={pingreq:r.from([t.codes.pingreq<<4,0]),pingresp:r.from([t.codes.pingresp<<4,0]),disconnect:r.from([t.codes.disconnect<<4,0])},t.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},t.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},t.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},t.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},t.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},t.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),V$=ve((n,e)=>{pe(),me(),ge();var t=1e3,r=t*60,i=r*60,s=i*24,o=s*7,a=s*365.25;e.exports=function(f,d){d=d||{};var p=typeof f;if(p==="string"&&f.length>0)return l(f);if(p==="number"&&isFinite(f))return d.long?c(f):u(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function l(f){if(f=String(f),!(f.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(d){var p=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return p*a;case"weeks":case"week":case"w":return p*o;case"days":case"day":case"d":return p*s;case"hours":case"hour":case"hrs":case"hr":case"h":return p*i;case"minutes":case"minute":case"mins":case"min":case"m":return p*r;case"seconds":case"second":case"secs":case"sec":case"s":return p*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function u(f){var d=Math.abs(f);return d>=s?Math.round(f/s)+"d":d>=i?Math.round(f/i)+"h":d>=r?Math.round(f/r)+"m":d>=t?Math.round(f/t)+"s":f+"ms"}function c(f){var d=Math.abs(f);return d>=s?h(f,d,s,"day"):d>=i?h(f,d,i,"hour"):d>=r?h(f,d,r,"minute"):d>=t?h(f,d,t,"second"):f+" ms"}function h(f,d,p,g){var m=d>=p*1.5;return Math.round(f/p)+" "+g+(m?"s":"")}}),W$=ve((n,e)=>{pe(),me(),ge();function t(r){s.debug=s,s.default=s,s.coerce=h,s.disable=u,s.enable=a,s.enabled=c,s.humanize=V$(),s.destroy=f,Object.keys(r).forEach(d=>{s[d]=r[d]}),s.names=[],s.skips=[],s.formatters={};function i(d){let p=0;for(let g=0;g<d.length;g++)p=(p<<5)-p+d.charCodeAt(g),p|=0;return s.colors[Math.abs(p)%s.colors.length]}s.selectColor=i;function s(d){let p,g=null,m,v;function y(...b){if(!y.enabled)return;let _=y,w=Number(new Date),x=w-(p||w);_.diff=x,_.prev=p,_.curr=w,p=w,b[0]=s.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let E=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(A,O)=>{if(A==="%%")return"%";E++;let T=s.formatters[O];if(typeof T=="function"){let M=b[E];A=T.call(_,M),b.splice(E,1),E--}return A}),s.formatArgs.call(_,b),(_.log||s.log).apply(_,b)}return y.namespace=d,y.useColors=s.useColors(),y.color=s.selectColor(d),y.extend=o,y.destroy=s.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(m!==s.namespaces&&(m=s.namespaces,v=s.enabled(d)),v),set:b=>{g=b}}),typeof s.init=="function"&&s.init(y),y}function o(d,p){let g=s(this.namespace+(typeof p>"u"?":":p)+d);return g.log=this.log,g}function a(d){s.save(d),s.namespaces=d,s.names=[],s.skips=[];let p=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of p)g[0]==="-"?s.skips.push(g.slice(1)):s.names.push(g)}function l(d,p){let g=0,m=0,v=-1,y=0;for(;g<d.length;)if(m<p.length&&(p[m]===d[g]||p[m]==="*"))p[m]==="*"?(v=m,y=g,m++):(g++,m++);else if(v!==-1)m=v+1,y++,g=y;else return!1;for(;m<p.length&&p[m]==="*";)m++;return m===p.length}function u(){let d=[...s.names,...s.skips.map(p=>"-"+p)].join(",");return s.enable(""),d}function c(d){for(let p of s.skips)if(l(d,p))return!1;for(let p of s.names)if(l(d,p))return!0;return!1}function h(d){return d instanceof Error?d.stack||d.message:d}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}e.exports=t}),Nr=ve((n,e)=>{pe(),me(),ge(),n.formatArgs=r,n.save=i,n.load=s,n.useColors=t,n.storage=o(),n.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let u="color: "+this.color;l.splice(1,0,u,"color: inherit");let c=0,h=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(c++,f==="%c"&&(h=c))}),l.splice(h,0,u)}n.log=console.debug||console.log||(()=>{});function i(l){try{l?n.storage.setItem("debug",l):n.storage.removeItem("debug")}catch{}}function s(){let l;try{l=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!l&&typeof Ge<"u"&&"env"in Ge&&(l=Ge.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=W$()(n);var{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}}),G$=ve((n,e)=>{pe(),me(),ge();var t=U$(),{EventEmitter:r}=(Pn(),$e(tn)),i=z$(),s=TA(),o=Nr()("mqtt-packet:parser"),a=class jm extends r{constructor(){super(),this.parser=this.constructor.parser}static parser(u){return this instanceof jm?(this.settings=u||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new jm().parser(u)}_resetState(){o("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=t(),this._stateCounter=0}parse(u){for(this.error&&this._resetState(),this._list.append(u),o("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,o("parse: state complete. _stateCounter is now: %d",this._stateCounter),o("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return o("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let u=this._list.readUInt8(0),c=u>>s.CMD_SHIFT;this.packet.cmd=s.types[c];let h=u&15,f=s.requiredHeaderFlags[c];return f!=null&&h!==f?this._emitError(new Error(s.requiredHeaderFlagsErrors[c])):(this.packet.retain=(u&s.RETAIN_MASK)!==0,this.packet.qos=u>>s.QOS_SHIFT&s.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(u&s.DUP_MASK)!==0,o("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let u=this._parseVarByteNum(!0);return u&&(this.packet.length=u.value,this._list.consume(u.bytes)),o("_parseLength %d",u.value),!!u}_parsePayload(){o("_parsePayload: payload %O",this._list);let u=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}u=!0}return o("_parsePayload complete result: %s",u),u}_parseConnect(){o("_parseConnect");let u,c,h,f,d={},p=this.packet,g=this._parseString();if(g===null)return this._emitError(new Error("Cannot parse protocolId"));if(g!=="MQTT"&&g!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(p.protocolId=g,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(p.protocolVersion=this._list.readUInt8(this._pos),p.protocolVersion>=128&&(p.bridgeMode=!0,p.protocolVersion=p.protocolVersion-128),p.protocolVersion!==3&&p.protocolVersion!==4&&p.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));d.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,d.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,d.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;let m=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),v=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(d.will)p.will={},p.will.retain=m,p.will.qos=v;else{if(m)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(v)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(p.clean=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK)!==0,this._pos++,p.keepalive=this._parseNum(),p.keepalive===-1)return this._emitError(new Error("Packet too short"));if(p.protocolVersion===5){let b=this._parseProperties();Object.getOwnPropertyNames(b).length&&(p.properties=b)}let y=this._parseString();if(y===null)return this._emitError(new Error("Packet too short"));if(p.clientId=y,o("_parseConnect: packet.clientId: %s",p.clientId),d.will){if(p.protocolVersion===5){let b=this._parseProperties();Object.getOwnPropertyNames(b).length&&(p.will.properties=b)}if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse will topic"));if(p.will.topic=u,o("_parseConnect: packet.will.topic: %s",p.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));p.will.payload=c,o("_parseConnect: packet.will.paylaod: %s",p.will.payload)}if(d.username){if(f=this._parseString(),f===null)return this._emitError(new Error("Cannot parse username"));p.username=f,o("_parseConnect: packet.username: %s",p.username)}if(d.password){if(h=this._parseBuffer(),h===null)return this._emitError(new Error("Cannot parse password"));p.password=h}return this.settings=p,o("_parseConnect: complete"),p}_parseConnack(){o("_parseConnack");let u=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(u.sessionPresent=!!(c&s.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?u.reasonCode=this._list.readUInt8(this._pos++):u.reasonCode=0;else{if(this._list.length<2)return null;u.returnCode=this._list.readUInt8(this._pos++)}if(u.returnCode===-1||u.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(u.properties=h)}o("_parseConnack: complete")}_parsePublish(){o("_parsePublish");let u=this.packet;if(u.topic=this._parseString(),u.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(u.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}u.payload=this._list.slice(this._pos,u.length),o("_parsePublish: payload from buffer list: %o",u.payload)}}_parseSubscribe(){o("_parseSubscribe");let u=this.packet,c,h,f,d,p,g,m;if(u.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(u.properties=v)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(h=this._parseByte(),this.settings.protocolVersion===5){if(h&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(h&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(f=h&s.SUBSCRIBE_OPTIONS_QOS_MASK,f>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(g=(h>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK)!==0,p=(h>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,d=h>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,d>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));m={topic:c,qos:f},this.settings.protocolVersion===5?(m.nl=g,m.rap=p,m.rh=d):this.settings.bridgeMode&&(m.rh=0,m.rap=!0,m.nl=!0),o("_parseSubscribe: push subscription `%s` to subscription",m),u.subscriptions.push(m)}}}_parseSuback(){o("_parseSuback");let u=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}if(u.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!s.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){o("_parseUnsubscribe");let u=this.packet;if(u.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}if(u.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<u.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));o("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),u.unsubscriptions.push(c)}}}_parseUnsuback(){o("_parseUnsuback");let u=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&u.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(u.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(u.properties=c),u.granted=[];this._pos<this.packet.length;){let h=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[h])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(h)}}}_parseConfirmation(){o("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let u=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(u.length>2){switch(u.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!s.MQTT5_PUBACK_PUBREC_CODES[u.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[u.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}o("_parseConfirmation: packet.reasonCode `%d`",u.reasonCode)}else u.reasonCode=0;if(u.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}}return!0}_parseDisconnect(){let u=this.packet;if(o("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(u.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[u.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):u.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(u.properties=c)}return o("_parseDisconnect result: true"),!0}_parseAuth(){o("_parseAuth");let u=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(u.reasonCode=this._parseByte(),!s.MQTT5_AUTH_CODES[u.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(u.properties=c),o("_parseAuth: result: true"),!0}_parseMessageId(){let u=this.packet;return u.messageId=this._parseNum(),u.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(o("_parseMessageId: packet.messageId %d",u.messageId),!0)}_parseString(u){let c=this._parseNum(),h=c+this._pos;if(c===-1||h>this._list.length||h>this.packet.length)return null;let f=this._list.toString("utf8",this._pos,h);return this._pos+=c,o("_parseString: result: %s",f),f}_parseStringPair(){return o("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let u=this._parseNum(),c=u+this._pos;if(u===-1||c>this._list.length||c>this.packet.length)return null;let h=this._list.slice(this._pos,c);return this._pos+=u,o("_parseBuffer: result: %o",h),h}_parseNum(){if(this._list.length-this._pos<2)return-1;let u=this._list.readUInt16BE(this._pos);return this._pos+=2,o("_parseNum: result: %s",u),u}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let u=this._list.readUInt32BE(this._pos);return this._pos+=4,o("_parse4ByteNum: result: %s",u),u}_parseVarByteNum(u){o("_parseVarByteNum");let c=4,h=0,f=1,d=0,p=!1,g,m=this._pos?this._pos:0;for(;h<c&&m+h<this._list.length;){if(g=this._list.readUInt8(m+h++),d+=f*(g&s.VARBYTEINT_MASK),f*=128,(g&s.VARBYTEINT_FIN_MASK)===0){p=!0;break}if(this._list.length<=h)break}return!p&&h===c&&this._list.length>=h&&this._emitError(new Error("Invalid variable byte integer")),m&&(this._pos+=h),p?u?p={bytes:h,value:d}:p=d:p=!1,o("_parseVarByteNum: result: %o",p),p}_parseByte(){let u;return this._pos<this._list.length&&(u=this._list.readUInt8(this._pos),this._pos++),o("_parseByte: result: %o",u),u}_parseByType(u){switch(o("_parseByType: type: %s",u),u){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){o("_parseProperties");let u=this._parseVarByteNum(),c=this._pos+u,h={};for(;this._pos<c;){let f=this._parseByte();if(!f)return this._emitError(new Error("Cannot parse property code type")),!1;let d=s.propertiesCodes[f];if(!d)return this._emitError(new Error("Unknown property")),!1;if(d==="userProperties"){h[d]||(h[d]=Object.create(null));let p=this._parseByType(s.propertiesTypes[d]);if(h[d][p.name])if(Array.isArray(h[d][p.name]))h[d][p.name].push(p.value);else{let g=h[d][p.name];h[d][p.name]=[g],h[d][p.name].push(p.value)}else h[d][p.name]=p.value;continue}h[d]?Array.isArray(h[d])?h[d].push(this._parseByType(s.propertiesTypes[d])):(h[d]=[h[d]],h[d].push(this._parseByType(s.propertiesTypes[d]))):h[d]=this._parseByType(s.propertiesTypes[d])}return h}_newPacket(){return o("_newPacket"),this.packet&&(this._list.consume(this.packet.length),o("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),o("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(u){o("_emitError",u),this.error=u,this.emit("error",u)}};e.exports=a}),H$=ve((n,e)=>{pe(),me(),ge();var{Buffer:t}=(yt(),$e(mt)),r=65536,i={},s=t.isBuffer(t.from([1,2]).subarray(0,1));function o(c){let h=t.allocUnsafe(2);return h.writeUInt8(c>>8,0),h.writeUInt8(c&255,1),h}function a(){for(let c=0;c<r;c++)i[c]=o(c)}function l(c){let h=0,f=0,d=t.allocUnsafe(4);do h=c%128|0,c=c/128|0,c>0&&(h=h|128),d.writeUInt8(h,f++);while(c>0&&f<4);return c>0&&(f=0),s?d.subarray(0,f):d.slice(0,f)}function u(c){let h=t.allocUnsafe(4);return h.writeUInt32BE(c,0),h}e.exports={cache:i,generateCache:a,generateNumber:o,genBufVariableByteInt:l,generate4ByteBuffer:u}}),K$=ve((n,e)=>{pe(),me(),ge(),typeof Ge>"u"||!Ge.version||Ge.version.indexOf("v0.")===0||Ge.version.indexOf("v1.")===0&&Ge.version.indexOf("v1.8.")!==0?e.exports={nextTick:t}:e.exports=Ge;function t(r,i,s,o){if(typeof r!="function")throw new TypeError('"callback" argument must be a function');var a=arguments.length,l,u;switch(a){case 0:case 1:return Ge.nextTick(r);case 2:return Ge.nextTick(function(){r.call(null,i)});case 3:return Ge.nextTick(function(){r.call(null,i,s)});case 4:return Ge.nextTick(function(){r.call(null,i,s,o)});default:for(l=new Array(a-1),u=0;u<l.length;)l[u++]=arguments[u];return Ge.nextTick(function(){r.apply(null,l)})}}}),MA=ve((n,e)=>{pe(),me(),ge();var t=TA(),{Buffer:r}=(yt(),$e(mt)),i=r.allocUnsafe(0),s=r.from([0]),o=H$(),a=K$().nextTick,l=Nr()("mqtt-packet:writeToStream"),u=o.cache,c=o.generateNumber,h=o.generateCache,f=o.genBufVariableByteInt,d=o.generate4ByteBuffer,p=G,g=!0;function m(F,D,ae){switch(l("generate called"),D.cork&&(D.cork(),a(v,D)),g&&(g=!1,h()),l("generate: packet.cmd: %s",F.cmd),F.cmd){case"connect":return y(F,D);case"connack":return b(F,D,ae);case"publish":return _(F,D,ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return w(F,D,ae);case"subscribe":return x(F,D,ae);case"suback":return E(F,D,ae);case"unsubscribe":return A(F,D,ae);case"unsuback":return O(F,D,ae);case"pingreq":case"pingresp":return T(F,D);case"disconnect":return M(F,D,ae);case"auth":return C(F,D,ae);default:return D.destroy(new Error("Unknown command")),!1}}Object.defineProperty(m,"cacheNumbers",{get(){return p===G},set(F){F?((!u||Object.keys(u).length===0)&&(g=!0),p=G):(g=!1,p=H)}});function v(F){F.uncork()}function y(F,D,ae){let Y=F||{},Q=Y.protocolId||"MQTT",ie=Y.protocolVersion||4,ye=Y.will,ue=Y.clean,L=Y.keepalive||0,J=Y.clientId||"",ee=Y.username,he=Y.password,fe=Y.properties;ue===void 0&&(ue=!0);let we=0;if(typeof Q!="string"&&!r.isBuffer(Q))return D.destroy(new Error("Invalid protocolId")),!1;if(we+=Q.length+2,ie!==3&&ie!==4&&ie!==5)return D.destroy(new Error("Invalid protocol version")),!1;if(we+=1,(typeof J=="string"||r.isBuffer(J))&&(J||ie>=4)&&(J||ue))we+=r.byteLength(J)+2;else{if(ie<4)return D.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ue*1===0)return D.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof L!="number"||L<0||L>65535||L%1!==0)return D.destroy(new Error("Invalid keepalive")),!1;we+=2,we+=1;let X,be;if(ie===5){if(X=te(D,fe),!X)return!1;we+=X.length}if(ye){if(typeof ye!="object")return D.destroy(new Error("Invalid will")),!1;if(!ye.topic||typeof ye.topic!="string")return D.destroy(new Error("Invalid will topic")),!1;if(we+=r.byteLength(ye.topic)+2,we+=2,ye.payload)if(ye.payload.length>=0)typeof ye.payload=="string"?we+=r.byteLength(ye.payload):we+=ye.payload.length;else return D.destroy(new Error("Invalid will payload")),!1;if(be={},ie===5){if(be=te(D,ye.properties),!be)return!1;we+=be.length}}let _e=!1;if(ee!=null)if(re(ee))_e=!0,we+=r.byteLength(ee)+2;else return D.destroy(new Error("Invalid username")),!1;if(he!=null){if(!_e)return D.destroy(new Error("Username is required to use password")),!1;if(re(he))we+=q(he)+2;else return D.destroy(new Error("Invalid password")),!1}D.write(t.CONNECT_HEADER),N(D,we),V(D,Q),Y.bridgeMode&&(ie+=128),D.write(ie===131?t.VERSION131:ie===132?t.VERSION132:ie===4?t.VERSION4:ie===5?t.VERSION5:t.VERSION3);let ce=0;return ce|=ee!=null?t.USERNAME_MASK:0,ce|=he!=null?t.PASSWORD_MASK:0,ce|=ye&&ye.retain?t.WILL_RETAIN_MASK:0,ce|=ye&&ye.qos?ye.qos<<t.WILL_QOS_SHIFT:0,ce|=ye?t.WILL_FLAG_MASK:0,ce|=ue?t.CLEAN_SESSION_MASK:0,D.write(r.from([ce])),p(D,L),ie===5&&X.write(),V(D,J),ye&&(ie===5&&be.write(),R(D,ye.topic),V(D,ye.payload)),ee!=null&&V(D,ee),he!=null&&V(D,he),!0}function b(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Y===5?Q.reasonCode:Q.returnCode,ye=Q.properties,ue=2;if(typeof ie!="number")return D.destroy(new Error("Invalid return code")),!1;let L=null;if(Y===5){if(L=te(D,ye),!L)return!1;ue+=L.length}return D.write(t.CONNACK_HEADER),N(D,ue),D.write(Q.sessionPresent?t.SESSIONPRESENT_HEADER:s),D.write(r.from([ie])),L?.write(),!0}function _(F,D,ae){l("publish: packet: %o",F);let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.qos||0,ye=Q.retain?t.RETAIN_MASK:0,ue=Q.topic,L=Q.payload||i,J=Q.messageId,ee=Q.properties,he=0;if(typeof ue=="string")he+=r.byteLength(ue)+2;else if(r.isBuffer(ue))he+=ue.length+2;else return D.destroy(new Error("Invalid topic")),!1;if(r.isBuffer(L)?he+=L.length:he+=r.byteLength(L),ie&&typeof J!="number")return D.destroy(new Error("Invalid messageId")),!1;ie&&(he+=2);let fe=null;if(Y===5){if(fe=te(D,ee),!fe)return!1;he+=fe.length}return D.write(t.PUBLISH_HEADER[ie][Q.dup?1:0][ye?1:0]),N(D,he),p(D,q(ue)),D.write(ue),ie>0&&p(D,J),fe?.write(),l("publish: payload: %o",L),D.write(L)}function w(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.cmd||"puback",ye=Q.messageId,ue=Q.dup&&ie==="pubrel"?t.DUP_MASK:0,L=0,J=Q.reasonCode,ee=Q.properties,he=Y===5?3:2;if(ie==="pubrel"&&(L=1),typeof ye!="number")return D.destroy(new Error("Invalid messageId")),!1;let fe=null;if(Y===5&&typeof ee=="object"){if(fe=B(D,ee,ae,he),!fe)return!1;he+=fe.length}return D.write(t.ACKS[ie][L][ue][0]),he===3&&(he+=J!==0?1:-1),N(D,he),p(D,ye),Y===5&&he!==2&&D.write(r.from([J])),fe!==null?fe.write():he===4&&D.write(r.from([0])),!0}function x(F,D,ae){l("subscribe: packet: ");let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.dup?t.DUP_MASK:0,ye=Q.messageId,ue=Q.subscriptions,L=Q.properties,J=0;if(typeof ye!="number")return D.destroy(new Error("Invalid messageId")),!1;J+=2;let ee=null;if(Y===5){if(ee=te(D,L),!ee)return!1;J+=ee.length}if(typeof ue=="object"&&ue.length)for(let fe=0;fe<ue.length;fe+=1){let we=ue[fe].topic,X=ue[fe].qos;if(typeof we!="string")return D.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof X!="number")return D.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(Y===5){if(typeof(ue[fe].nl||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ue[fe].rap||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let be=ue[fe].rh||0;if(typeof be!="number"||be>2)return D.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}J+=r.byteLength(we)+2+1}else return D.destroy(new Error("Invalid subscriptions")),!1;l("subscribe: writing to stream: %o",t.SUBSCRIBE_HEADER),D.write(t.SUBSCRIBE_HEADER[1][ie?1:0][0]),N(D,J),p(D,ye),ee!==null&&ee.write();let he=!0;for(let fe of ue){let we=fe.topic,X=fe.qos,be=+fe.nl,_e=+fe.rap,ce=fe.rh,Re;R(D,we),Re=t.SUBSCRIBE_OPTIONS_QOS[X],Y===5&&(Re|=be?t.SUBSCRIBE_OPTIONS_NL:0,Re|=_e?t.SUBSCRIBE_OPTIONS_RAP:0,Re|=ce?t.SUBSCRIBE_OPTIONS_RH[ce]:0),he=D.write(r.from([Re]))}return he}function E(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.messageId,ye=Q.granted,ue=Q.properties,L=0;if(typeof ie!="number")return D.destroy(new Error("Invalid messageId")),!1;if(L+=2,typeof ye=="object"&&ye.length)for(let ee=0;ee<ye.length;ee+=1){if(typeof ye[ee]!="number")return D.destroy(new Error("Invalid qos vector")),!1;L+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let J=null;if(Y===5){if(J=B(D,ue,ae,L),!J)return!1;L+=J.length}return D.write(t.SUBACK_HEADER),N(D,L),p(D,ie),J!==null&&J.write(),D.write(r.from(ye))}function A(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.messageId,ye=Q.dup?t.DUP_MASK:0,ue=Q.unsubscriptions,L=Q.properties,J=0;if(typeof ie!="number")return D.destroy(new Error("Invalid messageId")),!1;if(J+=2,typeof ue=="object"&&ue.length)for(let fe=0;fe<ue.length;fe+=1){if(typeof ue[fe]!="string")return D.destroy(new Error("Invalid unsubscriptions")),!1;J+=r.byteLength(ue[fe])+2}else return D.destroy(new Error("Invalid unsubscriptions")),!1;let ee=null;if(Y===5){if(ee=te(D,L),!ee)return!1;J+=ee.length}D.write(t.UNSUBSCRIBE_HEADER[1][ye?1:0][0]),N(D,J),p(D,ie),ee!==null&&ee.write();let he=!0;for(let fe=0;fe<ue.length;fe++)he=R(D,ue[fe]);return he}function O(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.messageId,ye=Q.dup?t.DUP_MASK:0,ue=Q.granted,L=Q.properties,J=Q.cmd,ee=0,he=2;if(typeof ie!="number")return D.destroy(new Error("Invalid messageId")),!1;if(Y===5)if(typeof ue=="object"&&ue.length)for(let we=0;we<ue.length;we+=1){if(typeof ue[we]!="number")return D.destroy(new Error("Invalid qos vector")),!1;he+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let fe=null;if(Y===5){if(fe=B(D,L,ae,he),!fe)return!1;he+=fe.length}return D.write(t.ACKS[J][ee][ye][0]),N(D,he),p(D,ie),fe!==null&&fe.write(),Y===5&&D.write(r.from(ue)),!0}function T(F,D,ae){return D.write(t.EMPTY[F.cmd])}function M(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.reasonCode,ye=Q.properties,ue=Y===5?1:0,L=null;if(Y===5){if(L=B(D,ye,ae,ue),!L)return!1;ue+=L.length}return D.write(r.from([t.codes.disconnect<<4])),N(D,ue),Y===5&&D.write(r.from([ie])),L!==null&&L.write(),!0}function C(F,D,ae){let Y=ae?ae.protocolVersion:4,Q=F||{},ie=Q.reasonCode,ye=Q.properties,ue=Y===5?1:0;Y!==5&&D.destroy(new Error("Invalid mqtt version for auth packet"));let L=B(D,ye,ae,ue);return L?(ue+=L.length,D.write(r.from([t.codes.auth<<4])),N(D,ue),D.write(r.from([ie])),L!==null&&L.write(),!0):!1}var k={};function N(F,D){if(D>t.VARBYTEINT_MAX)return F.destroy(new Error(`Invalid variable byte integer: ${D}`)),!1;let ae=k[D];return ae||(ae=f(D),D<16384&&(k[D]=ae)),l("writeVarByteInt: writing to stream: %o",ae),F.write(ae)}function R(F,D){let ae=r.byteLength(D);return p(F,ae),l("writeString: %s",D),F.write(D,"utf8")}function $(F,D,ae){R(F,D),R(F,ae)}function G(F,D){return l("writeNumberCached: number: %d",D),l("writeNumberCached: %o",u[D]),F.write(u[D])}function H(F,D){let ae=c(D);return l("writeNumberGenerated: %o",ae),F.write(ae)}function se(F,D){let ae=d(D);return l("write4ByteNumber: %o",ae),F.write(ae)}function V(F,D){typeof D=="string"?R(F,D):D?(p(F,D.length),F.write(D)):p(F,0)}function te(F,D){if(typeof D!="object"||D.length!=null)return{length:1,write(){U(F,{},0)}};let ae=0;function Y(Q,ie){let ye=t.propertiesTypes[Q],ue=0;switch(ye){case"byte":{if(typeof ie!="boolean")return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=2;break}case"int8":{if(typeof ie!="number"||ie<0||ie>255)return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=2;break}case"binary":{if(ie&&ie===null)return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=1+r.byteLength(ie)+2;break}case"int16":{if(typeof ie!="number"||ie<0||ie>65535)return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=3;break}case"int32":{if(typeof ie!="number"||ie<0||ie>4294967295)return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=5;break}case"var":{if(typeof ie!="number"||ie<0||ie>268435455)return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=1+r.byteLength(f(ie));break}case"string":{if(typeof ie!="string")return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=3+r.byteLength(ie.toString());break}case"pair":{if(typeof ie!="object")return F.destroy(new Error(`Invalid ${Q}: ${ie}`)),!1;ue+=Object.getOwnPropertyNames(ie).reduce((L,J)=>{let ee=ie[J];return Array.isArray(ee)?L+=ee.reduce((he,fe)=>(he+=3+r.byteLength(J.toString())+2+r.byteLength(fe.toString()),he),0):L+=3+r.byteLength(J.toString())+2+r.byteLength(ie[J].toString()),L},0);break}default:return F.destroy(new Error(`Invalid property ${Q}: ${ie}`)),!1}return ue}if(D)for(let Q in D){let ie=0,ye=0,ue=D[Q];if(ue!==void 0){if(Array.isArray(ue))for(let L=0;L<ue.length;L++){if(ye=Y(Q,ue[L]),!ye)return!1;ie+=ye}else{if(ye=Y(Q,ue),!ye)return!1;ie=ye}if(!ie)return!1;ae+=ie}}return{length:r.byteLength(f(ae))+ae,write(){U(F,D,ae)}}}function B(F,D,ae,Y){let Q=["reasonString","userProperties"],ie=ae&&ae.properties&&ae.properties.maximumPacketSize?ae.properties.maximumPacketSize:0,ye=te(F,D);if(ie)for(;Y+ye.length>ie;){let ue=Q.shift();if(ue&&D[ue])delete D[ue],ye=te(F,D);else return!1}return ye}function ne(F,D,ae){switch(t.propertiesTypes[D]){case"byte":{F.write(r.from([t.properties[D]])),F.write(r.from([+ae]));break}case"int8":{F.write(r.from([t.properties[D]])),F.write(r.from([ae]));break}case"binary":{F.write(r.from([t.properties[D]])),V(F,ae);break}case"int16":{F.write(r.from([t.properties[D]])),p(F,ae);break}case"int32":{F.write(r.from([t.properties[D]])),se(F,ae);break}case"var":{F.write(r.from([t.properties[D]])),N(F,ae);break}case"string":{F.write(r.from([t.properties[D]])),R(F,ae);break}case"pair":{Object.getOwnPropertyNames(ae).forEach(Y=>{let Q=ae[Y];Array.isArray(Q)?Q.forEach(ie=>{F.write(r.from([t.properties[D]])),$(F,Y.toString(),ie.toString())}):(F.write(r.from([t.properties[D]])),$(F,Y.toString(),Q.toString()))});break}default:return F.destroy(new Error(`Invalid property ${D} value: ${ae}`)),!1}}function U(F,D,ae){N(F,ae);for(let Y in D)if(Object.prototype.hasOwnProperty.call(D,Y)&&D[Y]!=null){let Q=D[Y];if(Array.isArray(Q))for(let ie=0;ie<Q.length;ie++)ne(F,Y,Q[ie]);else ne(F,Y,Q)}}function q(F){return F?F instanceof r?F.length:r.byteLength(F):0}function re(F){return typeof F=="string"||F instanceof r}e.exports=m}),Y$=ve((n,e)=>{pe(),me(),ge();var t=MA(),{EventEmitter:r}=(Pn(),$e(tn)),{Buffer:i}=(yt(),$e(mt));function s(a,l){let u=new o;return t(a,u,l),u.concat()}var o=class extends r{constructor(){super(),this._array=new Array(20),this._i=0}write(a){return this._array[this._i++]=a,!0}concat(){let a=0,l=new Array(this._array.length),u=this._array,c=0,h;for(h=0;h<u.length&&u[h]!==void 0;h++)typeof u[h]!="string"?l[h]=u[h].length:l[h]=i.byteLength(u[h]),a+=l[h];let f=i.allocUnsafe(a);for(h=0;h<u.length&&u[h]!==void 0;h++)typeof u[h]!="string"?(u[h].copy(f,c),c+=l[h]):(f.write(u[h],c),c+=l[h]);return f}destroy(a){a&&this.emit("error",a)}};e.exports=s}),J$=ve(n=>{pe(),me(),ge(),n.parser=G$().parser,n.generate=Y$(),n.writeToStream=MA()}),X$=ve((n,e)=>{pe(),me(),ge(),e.exports=r;function t(s){return s instanceof Uo?Uo.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function r(s){if(s=s||{},s.circles)return i(s);let o=new Map;if(o.set(Date,h=>new Date(h)),o.set(Map,(h,f)=>new Map(l(Array.from(h),f))),o.set(Set,(h,f)=>new Set(l(Array.from(h),f))),s.constructorHandlers)for(let h of s.constructorHandlers)o.set(h[0],h[1]);let a=null;return s.proto?c:u;function l(h,f){let d=Object.keys(h),p=new Array(d.length);for(let g=0;g<d.length;g++){let m=d[g],v=h[m];typeof v!="object"||v===null?p[m]=v:v.constructor!==Object&&(a=o.get(v.constructor))?p[m]=a(v,f):ArrayBuffer.isView(v)?p[m]=t(v):p[m]=f(v)}return p}function u(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return l(h,u);if(h.constructor!==Object&&(a=o.get(h.constructor)))return a(h,u);let f={};for(let d in h){if(Object.hasOwnProperty.call(h,d)===!1)continue;let p=h[d];typeof p!="object"||p===null?f[d]=p:p.constructor!==Object&&(a=o.get(p.constructor))?f[d]=a(p,u):ArrayBuffer.isView(p)?f[d]=t(p):f[d]=u(p)}return f}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return l(h,c);if(h.constructor!==Object&&(a=o.get(h.constructor)))return a(h,c);let f={};for(let d in h){let p=h[d];typeof p!="object"||p===null?f[d]=p:p.constructor!==Object&&(a=o.get(p.constructor))?f[d]=a(p,c):ArrayBuffer.isView(p)?f[d]=t(p):f[d]=c(p)}return f}}function i(s){let o=[],a=[],l=new Map;if(l.set(Date,d=>new Date(d)),l.set(Map,(d,p)=>new Map(c(Array.from(d),p))),l.set(Set,(d,p)=>new Set(c(Array.from(d),p))),s.constructorHandlers)for(let d of s.constructorHandlers)l.set(d[0],d[1]);let u=null;return s.proto?f:h;function c(d,p){let g=Object.keys(d),m=new Array(g.length);for(let v=0;v<g.length;v++){let y=g[v],b=d[y];if(typeof b!="object"||b===null)m[y]=b;else if(b.constructor!==Object&&(u=l.get(b.constructor)))m[y]=u(b,p);else if(ArrayBuffer.isView(b))m[y]=t(b);else{let _=o.indexOf(b);_!==-1?m[y]=a[_]:m[y]=p(b)}}return m}function h(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return c(d,h);if(d.constructor!==Object&&(u=l.get(d.constructor)))return u(d,h);let p={};o.push(d),a.push(p);for(let g in d){if(Object.hasOwnProperty.call(d,g)===!1)continue;let m=d[g];if(typeof m!="object"||m===null)p[g]=m;else if(m.constructor!==Object&&(u=l.get(m.constructor)))p[g]=u(m,h);else if(ArrayBuffer.isView(m))p[g]=t(m);else{let v=o.indexOf(m);v!==-1?p[g]=a[v]:p[g]=h(m)}}return o.pop(),a.pop(),p}function f(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return c(d,f);if(d.constructor!==Object&&(u=l.get(d.constructor)))return u(d,f);let p={};o.push(d),a.push(p);for(let g in d){let m=d[g];if(typeof m!="object"||m===null)p[g]=m;else if(m.constructor!==Object&&(u=l.get(m.constructor)))p[g]=u(m,f);else if(ArrayBuffer.isView(m))p[g]=t(m);else{let v=o.indexOf(m);v!==-1?p[g]=a[v]:p[g]=f(m)}}return o.pop(),a.pop(),p}}}),Q$=ve((n,e)=>{pe(),me(),ge(),e.exports=X$()()}),Z$=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.validateTopic=e,n.validateTopics=t;function e(r){let i=r.split("/");for(let s=0;s<i.length;s++)if(i[s]!=="+"){if(i[s]==="#")return s===i.length-1;if(i[s].indexOf("+")!==-1||i[s].indexOf("#")!==-1)return!1}return!0}function t(r){if(r.length===0)return"empty_topic_list";for(let i=0;i<r.length;i++)if(!e(r[i]))return r[i];return null}}),IA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=Cn(),t={objectMode:!0},r={clean:!0},i=class{options;_inflights;constructor(s){this.options=s||{},this.options={...r,...s},this._inflights=new Map}put(s,o){return this._inflights.set(s.messageId,s),o&&o(),this}createStream(){let s=new e.Readable(t),o=[],a=!1,l=0;return this._inflights.forEach((u,c)=>{o.push(u)}),s._read=()=>{!a&&l<o.length?s.push(o[l++]):s.push(null)},s.destroy=u=>{if(!a)return a=!0,setTimeout(()=>{s.emit("close")},0),s},s}del(s,o){let a=this._inflights.get(s.messageId);return a?(this._inflights.delete(s.messageId),o(null,a)):o&&o(new Error("missing packet")),this}get(s,o){let a=this._inflights.get(s.messageId);return a?o(null,a):o&&o(new Error("missing packet")),this}close(s){this.options.clean&&(this._inflights=null),s&&s()}};n.default=i}),eU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=[0,16,128,131,135,144,145,151,153],t=(r,i,s)=>{r.log("handlePublish: packet %o",i),s=typeof s<"u"?s:r.noop;let o=i.topic.toString(),a=i.payload,{qos:l}=i,{messageId:u}=i,{options:c}=r;if(r.options.protocolVersion===5){let h;if(i.properties&&(h=i.properties.topicAlias),typeof h<"u")if(o.length===0)if(h>0&&h<=65535){let f=r.topicAliasRecv.getTopicByAlias(h);if(f)o=f,r.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",o,h);else{r.log("handlePublish :: unregistered topic alias. alias: %d",h),r.emit("error",new Error("Received unregistered Topic Alias"));return}}else{r.log("handlePublish :: topic alias out of range. alias: %d",h),r.emit("error",new Error("Received Topic Alias is out of range"));return}else if(r.topicAliasRecv.put(o,h))r.log("handlePublish :: registered topic: %s - alias: %d",o,h);else{r.log("handlePublish :: topic alias out of range. alias: %d",h),r.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(r.log("handlePublish: qos %d",l),l){case 2:{c.customHandleAcks(o,a,i,(h,f)=>{if(typeof h=="number"&&(f=h,h=null),h)return r.emit("error",h);if(e.indexOf(f)===-1)return r.emit("error",new Error("Wrong reason code for pubrec"));f?r._sendPacket({cmd:"pubrec",messageId:u,reasonCode:f},s):r.incomingStore.put(i,()=>{r._sendPacket({cmd:"pubrec",messageId:u},s)})});break}case 1:{c.customHandleAcks(o,a,i,(h,f)=>{if(typeof h=="number"&&(f=h,h=null),h)return r.emit("error",h);if(e.indexOf(f)===-1)return r.emit("error",new Error("Wrong reason code for puback"));f||r.emit("message",o,a,i),r.handleMessage(i,d=>{if(d)return s&&s(d);r._sendPacket({cmd:"puback",messageId:u,reasonCode:f},s)})});break}case 0:r.emit("message",o,a,i),r.handleMessage(i,s);break;default:r.log("handlePublish: unknown QoS. Doing nothing.");break}};n.default=t}),tU=ve((n,e)=>{e.exports={version:"5.14.1"}}),xi=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.MQTTJS_VERSION=n.nextTick=n.ErrorWithSubackPacket=n.ErrorWithReasonCode=void 0,n.applyMixin=r;var e=class NO extends Error{code;constructor(s,o){super(s),this.code=o,Object.setPrototypeOf(this,NO.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};n.ErrorWithReasonCode=e;var t=class jO extends Error{packet;constructor(s,o){super(s),this.packet=o,Object.setPrototypeOf(this,jO.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};n.ErrorWithSubackPacket=t;function r(i,s,o=!1){let a=[s];for(;;){let l=a[0],u=Object.getPrototypeOf(l);if(u?.prototype)a.unshift(u);else break}for(let l of a)for(let u of Object.getOwnPropertyNames(l.prototype))(o||u!=="constructor")&&Object.defineProperty(i.prototype,u,Object.getOwnPropertyDescriptor(l.prototype,u)??Object.create(null))}n.nextTick=typeof Ge?.nextTick=="function"?Ge.nextTick:i=>{setTimeout(i,0)},n.MQTTJS_VERSION=tU().version}),Go=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.ReasonCodes=void 0;var e=xi();n.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var t=(r,i)=>{let{messageId:s}=i,o=i.cmd,a=null,l=r.outgoing[s]?r.outgoing[s].cb:null,u=null;if(!l){r.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(r.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":{let c=i.reasonCode;c&&c>0&&c!==16?(u=new e.ErrorWithReasonCode(`Publish error: ${n.ReasonCodes[c]}`,c),r._removeOutgoingAndStoreMessage(s,()=>{l(u,i)})):r._removeOutgoingAndStoreMessage(s,l);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:s};let c=i.reasonCode;c&&c>0&&c!==16?(u=new e.ErrorWithReasonCode(`Publish error: ${n.ReasonCodes[c]}`,c),r._removeOutgoingAndStoreMessage(s,()=>{l(u,i)})):r._sendPacket(a);break}case"suback":{delete r.outgoing[s],r.messageIdProvider.deallocate(s);let c=i.granted;for(let h=0;h<c.length;h++){let f=c[h];if((f&128)!==0){u=new Error(`Subscribe error: ${n.ReasonCodes[f]}`),u.code=f;let d=r.messageIdToTopic[s];d&&d.forEach(p=>{delete r._resubscribeTopics[p]})}}delete r.messageIdToTopic[s],r._invokeStoreProcessingQueue(),l(u,i);break}case"unsuback":{delete r.outgoing[s],r.messageIdProvider.deallocate(s),r._invokeStoreProcessingQueue(),l(null,i);break}default:r.emit("error",new Error("unrecognized packet type"))}r.disconnecting&&Object.keys(r.outgoing).length===0&&r.emit("outgoingEmpty")};n.default=t}),rU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=xi(),t=Go(),r=(i,s)=>{let{options:o}=i,a=o.protocolVersion,l=a===5?s.reasonCode:s.returnCode;if(a!==5){let u=new e.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,l);i.emit("error",u);return}i.handleAuth(s,(u,c)=>{if(u){i.emit("error",u);return}if(l===24)i.reconnecting=!1,i._sendPacket(c);else{let h=new e.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[l]}`,l);i.emit("error",h)}})};n.default=r}),nU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.LRUCache=void 0;var e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=new Set,r=typeof Ge=="object"&&Ge?Ge:{},i=(d,p,g,m)=>{typeof r.emitWarning=="function"?r.emitWarning(d,p,g,m):console.error(`[${g}] ${p}: ${d}`)},s=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof s>"u"){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(g,m){this._onabort.push(m)}},s=class{constructor(){p()}signal=new o;abort(g){if(!this.signal.aborted){this.signal.reason=g,this.signal.aborted=!0;for(let m of this.signal._onabort)m(g);this.signal.onabort?.(g)}}};let d=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",p=()=>{d&&(d=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",p))}}var a=d=>!t.has(d),l=d=>d&&d===Math.floor(d)&&d>0&&isFinite(d),u=d=>l(d)?d<=Math.pow(2,8)?Uint8Array:d<=Math.pow(2,16)?Uint16Array:d<=Math.pow(2,32)?Uint32Array:d<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(d){super(d),this.fill(0)}},h=class As{heap;length;static#l=!1;static create(p){let g=u(p);if(!g)return[];As.#l=!0;let m=new As(p,g);return As.#l=!1,m}constructor(p,g){if(!As.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new g(p),this.length=0}push(p){this.heap[this.length++]=p}pop(){return this.heap[--this.length]}},f=class LO{#l;#h;#g;#m;#M;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#y;#n;#r;#e;#u;#f;#a;#s;#b;#o;#v;#w;#d;#_;#P;#c;static unsafeExposeInternals(p){return{starts:p.#w,ttls:p.#d,sizes:p.#v,keyMap:p.#n,keyList:p.#r,valList:p.#e,next:p.#u,prev:p.#f,get head(){return p.#a},get tail(){return p.#s},free:p.#b,isBackgroundFetch:g=>p.#t(g),backgroundFetch:(g,m,v,y)=>p.#N(g,m,v,y),moveToTail:g=>p.#T(g),indexes:g=>p.#x(g),rindexes:g=>p.#E(g),isStale:g=>p.#p(g)}}get max(){return this.#l}get maxSize(){return this.#h}get calculatedSize(){return this.#y}get size(){return this.#i}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#g}get disposeAfter(){return this.#m}constructor(p){let{max:g=0,ttl:m,ttlResolution:v=1,ttlAutopurge:y,updateAgeOnGet:b,updateAgeOnHas:_,allowStale:w,dispose:x,disposeAfter:E,noDisposeOnSet:A,noUpdateTTL:O,maxSize:T=0,maxEntrySize:M=0,sizeCalculation:C,fetchMethod:k,memoMethod:N,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:H,ignoreFetchAbort:se}=p;if(g!==0&&!l(g))throw new TypeError("max option must be a nonnegative integer");let V=g?u(g):Array;if(!V)throw new Error("invalid max value: "+g);if(this.#l=g,this.#h=T,this.maxEntrySize=M||this.#h,this.sizeCalculation=C,this.sizeCalculation){if(!this.#h&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(N!==void 0&&typeof N!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=N,k!==void 0&&typeof k!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=k,this.#P=!!k,this.#n=new Map,this.#r=new Array(g).fill(void 0),this.#e=new Array(g).fill(void 0),this.#u=new V(g),this.#f=new V(g),this.#a=0,this.#s=0,this.#b=h.create(g),this.#i=0,this.#y=0,typeof x=="function"&&(this.#g=x),typeof E=="function"?(this.#m=E,this.#o=[]):(this.#m=void 0,this.#o=void 0),this.#_=!!this.#g,this.#c=!!this.#m,this.noDisposeOnSet=!!A,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!H,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(this.#h!==0&&!l(this.#h))throw new TypeError("maxSize must be a positive integer if specified");if(!l(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!w,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!b,this.updateAgeOnHas=!!_,this.ttlResolution=l(v)||v===0?v:1,this.ttlAutopurge=!!y,this.ttl=m||0,this.ttl){if(!l(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#j()}if(this.#l===0&&this.ttl===0&&this.#h===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#h){let te="LRU_CACHE_UNBOUNDED";a(te)&&(t.add(te),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",te,LO))}}getRemainingTTL(p){return this.#n.has(p)?1/0:0}#j(){let p=new c(this.#l),g=new c(this.#l);this.#d=p,this.#w=g,this.#L=(y,b,_=e.now())=>{if(g[y]=b!==0?_:0,p[y]=b,b!==0&&this.ttlAutopurge){let w=setTimeout(()=>{this.#p(y)&&this.#S(this.#r[y],"expire")},b+1);w.unref&&w.unref()}},this.#O=y=>{g[y]=p[y]!==0?e.now():0},this.#A=(y,b)=>{if(p[b]){let _=p[b],w=g[b];if(!_||!w)return;y.ttl=_,y.start=w,y.now=m||v();let x=y.now-w;y.remainingTTL=_-x}};let m=0,v=()=>{let y=e.now();if(this.ttlResolution>0){m=y;let b=setTimeout(()=>m=0,this.ttlResolution);b.unref&&b.unref()}return y};this.getRemainingTTL=y=>{let b=this.#n.get(y);if(b===void 0)return 0;let _=p[b],w=g[b];if(!_||!w)return 1/0;let x=(m||v())-w;return _-x},this.#p=y=>{let b=g[y],_=p[y];return!!_&&!!b&&(m||v())-b>_}}#O=()=>{};#A=()=>{};#L=()=>{};#p=()=>!1;#$(){let p=new c(this.#l);this.#y=0,this.#v=p,this.#C=g=>{this.#y-=p[g],p[g]=0},this.#D=(g,m,v,y)=>{if(this.#t(m))return 0;if(!l(v))if(y){if(typeof y!="function")throw new TypeError("sizeCalculation must be a function");if(v=y(m,g),!l(v))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return v},this.#R=(g,m,v)=>{if(p[g]=m,this.#h){let y=this.#h-p[g];for(;this.#y>y;)this.#k(!0)}this.#y+=p[g],v&&(v.entrySize=m,v.totalCalculatedSize=this.#y)}}#C=p=>{};#R=(p,g,m)=>{};#D=(p,g,m,v)=>{if(m||v)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:p=this.allowStale}={}){if(this.#i)for(let g=this.#s;!(!this.#B(g)||((p||!this.#p(g))&&(yield g),g===this.#a));)g=this.#f[g]}*#E({allowStale:p=this.allowStale}={}){if(this.#i)for(let g=this.#a;!(!this.#B(g)||((p||!this.#p(g))&&(yield g),g===this.#s));)g=this.#u[g]}#B(p){return p!==void 0&&this.#n.get(this.#r[p])===p}*entries(){for(let p of this.#x())this.#e[p]!==void 0&&this.#r[p]!==void 0&&!this.#t(this.#e[p])&&(yield[this.#r[p],this.#e[p]])}*rentries(){for(let p of this.#E())this.#e[p]!==void 0&&this.#r[p]!==void 0&&!this.#t(this.#e[p])&&(yield[this.#r[p],this.#e[p]])}*keys(){for(let p of this.#x()){let g=this.#r[p];g!==void 0&&!this.#t(this.#e[p])&&(yield g)}}*rkeys(){for(let p of this.#E()){let g=this.#r[p];g!==void 0&&!this.#t(this.#e[p])&&(yield g)}}*values(){for(let p of this.#x())this.#e[p]!==void 0&&!this.#t(this.#e[p])&&(yield this.#e[p])}*rvalues(){for(let p of this.#E())this.#e[p]!==void 0&&!this.#t(this.#e[p])&&(yield this.#e[p])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(p,g={}){for(let m of this.#x()){let v=this.#e[m],y=this.#t(v)?v.__staleWhileFetching:v;if(y!==void 0&&p(y,this.#r[m],this))return this.get(this.#r[m],g)}}forEach(p,g=this){for(let m of this.#x()){let v=this.#e[m],y=this.#t(v)?v.__staleWhileFetching:v;y!==void 0&&p.call(g,y,this.#r[m],this)}}rforEach(p,g=this){for(let m of this.#E()){let v=this.#e[m],y=this.#t(v)?v.__staleWhileFetching:v;y!==void 0&&p.call(g,y,this.#r[m],this)}}purgeStale(){let p=!1;for(let g of this.#E({allowStale:!0}))this.#p(g)&&(this.#S(this.#r[g],"expire"),p=!0);return p}info(p){let g=this.#n.get(p);if(g===void 0)return;let m=this.#e[g],v=this.#t(m)?m.__staleWhileFetching:m;if(v===void 0)return;let y={value:v};if(this.#d&&this.#w){let b=this.#d[g],_=this.#w[g];if(b&&_){let w=b-(e.now()-_);y.ttl=w,y.start=Date.now()}}return this.#v&&(y.size=this.#v[g]),y}dump(){let p=[];for(let g of this.#x({allowStale:!0})){let m=this.#r[g],v=this.#e[g],y=this.#t(v)?v.__staleWhileFetching:v;if(y===void 0||m===void 0)continue;let b={value:y};if(this.#d&&this.#w){b.ttl=this.#d[g];let _=e.now()-this.#w[g];b.start=Math.floor(Date.now()-_)}this.#v&&(b.size=this.#v[g]),p.unshift([m,b])}return p}load(p){this.clear();for(let[g,m]of p){if(m.start){let v=Date.now()-m.start;m.start=e.now()-v}this.set(g,m.value,m)}}set(p,g,m={}){if(g===void 0)return this.delete(p),this;let{ttl:v=this.ttl,start:y,noDisposeOnSet:b=this.noDisposeOnSet,sizeCalculation:_=this.sizeCalculation,status:w}=m,{noUpdateTTL:x=this.noUpdateTTL}=m,E=this.#D(p,g,m.size||0,_);if(this.maxEntrySize&&E>this.maxEntrySize)return w&&(w.set="miss",w.maxEntrySizeExceeded=!0),this.#S(p,"set"),this;let A=this.#i===0?void 0:this.#n.get(p);if(A===void 0)A=this.#i===0?this.#s:this.#b.length!==0?this.#b.pop():this.#i===this.#l?this.#k(!1):this.#i,this.#r[A]=p,this.#e[A]=g,this.#n.set(p,A),this.#u[this.#s]=A,this.#f[A]=this.#s,this.#s=A,this.#i++,this.#R(A,E,w),w&&(w.set="add"),x=!1;else{this.#T(A);let O=this.#e[A];if(g!==O){if(this.#P&&this.#t(O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:T}=O;T!==void 0&&!b&&(this.#_&&this.#g?.(T,p,"set"),this.#c&&this.#o?.push([T,p,"set"]))}else b||(this.#_&&this.#g?.(O,p,"set"),this.#c&&this.#o?.push([O,p,"set"]));if(this.#C(A),this.#R(A,E,w),this.#e[A]=g,w){w.set="replace";let T=O&&this.#t(O)?O.__staleWhileFetching:O;T!==void 0&&(w.oldValue=T)}}else w&&(w.set="update")}if(v!==0&&!this.#d&&this.#j(),this.#d&&(x||this.#L(A,v,y),w&&this.#A(w,A)),!b&&this.#c&&this.#o){let O=this.#o,T;for(;T=O?.shift();)this.#m?.(...T)}return this}pop(){try{for(;this.#i;){let p=this.#e[this.#a];if(this.#k(!0),this.#t(p)){if(p.__staleWhileFetching)return p.__staleWhileFetching}else if(p!==void 0)return p}}finally{if(this.#c&&this.#o){let p=this.#o,g;for(;g=p?.shift();)this.#m?.(...g)}}}#k(p){let g=this.#a,m=this.#r[g],v=this.#e[g];return this.#P&&this.#t(v)?v.__abortController.abort(new Error("evicted")):(this.#_||this.#c)&&(this.#_&&this.#g?.(v,m,"evict"),this.#c&&this.#o?.push([v,m,"evict"])),this.#C(g),p&&(this.#r[g]=void 0,this.#e[g]=void 0,this.#b.push(g)),this.#i===1?(this.#a=this.#s=0,this.#b.length=0):this.#a=this.#u[g],this.#n.delete(m),this.#i--,g}has(p,g={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:v}=g,y=this.#n.get(p);if(y!==void 0){let b=this.#e[y];if(this.#t(b)&&b.__staleWhileFetching===void 0)return!1;if(this.#p(y))v&&(v.has="stale",this.#A(v,y));else return m&&this.#O(y),v&&(v.has="hit",this.#A(v,y)),!0}else v&&(v.has="miss");return!1}peek(p,g={}){let{allowStale:m=this.allowStale}=g,v=this.#n.get(p);if(v===void 0||!m&&this.#p(v))return;let y=this.#e[v];return this.#t(y)?y.__staleWhileFetching:y}#N(p,g,m,v){let y=g===void 0?void 0:this.#e[g];if(this.#t(y))return y;let b=new s,{signal:_}=m;_?.addEventListener("abort",()=>b.abort(_.reason),{signal:b.signal});let w={signal:b.signal,options:m,context:v},x=(C,k=!1)=>{let{aborted:N}=b.signal,R=m.ignoreFetchAbort&&C!==void 0;if(m.status&&(N&&!k?(m.status.fetchAborted=!0,m.status.fetchError=b.signal.reason,R&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),N&&!R&&!k)return A(b.signal.reason);let $=T;return this.#e[g]===T&&(C===void 0?$.__staleWhileFetching?this.#e[g]=$.__staleWhileFetching:this.#S(p,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(p,C,w.options))),C},E=C=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=C),A(C)),A=C=>{let{aborted:k}=b.signal,N=k&&m.allowStaleOnFetchAbort,R=N||m.allowStaleOnFetchRejection,$=R||m.noDeleteOnFetchRejection,G=T;if(this.#e[g]===T&&(!$||G.__staleWhileFetching===void 0?this.#S(p,"fetch"):N||(this.#e[g]=G.__staleWhileFetching)),R)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw C},O=(C,k)=>{let N=this.#M?.(p,y,w);N&&N instanceof Promise&&N.then(R=>C(R===void 0?void 0:R),k),b.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(C(void 0),m.allowStaleOnFetchAbort&&(C=R=>x(R,!0)))})};m.status&&(m.status.fetchDispatched=!0);let T=new Promise(O).then(x,E),M=Object.assign(T,{__abortController:b,__staleWhileFetching:y,__returned:void 0});return g===void 0?(this.set(p,M,{...w.options,status:void 0}),g=this.#n.get(p)):this.#e[g]=M,M}#t(p){if(!this.#P)return!1;let g=p;return!!g&&g instanceof Promise&&g.hasOwnProperty("__staleWhileFetching")&&g.__abortController instanceof s}async fetch(p,g={}){let{allowStale:m=this.allowStale,updateAgeOnGet:v=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,ttl:b=this.ttl,noDisposeOnSet:_=this.noDisposeOnSet,size:w=0,sizeCalculation:x=this.sizeCalculation,noUpdateTTL:E=this.noUpdateTTL,noDeleteOnFetchRejection:A=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:O=this.allowStaleOnFetchRejection,ignoreFetchAbort:T=this.ignoreFetchAbort,allowStaleOnFetchAbort:M=this.allowStaleOnFetchAbort,context:C,forceRefresh:k=!1,status:N,signal:R}=g;if(!this.#P)return N&&(N.fetch="get"),this.get(p,{allowStale:m,updateAgeOnGet:v,noDeleteOnStaleGet:y,status:N});let $={allowStale:m,updateAgeOnGet:v,noDeleteOnStaleGet:y,ttl:b,noDisposeOnSet:_,size:w,sizeCalculation:x,noUpdateTTL:E,noDeleteOnFetchRejection:A,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:M,ignoreFetchAbort:T,status:N,signal:R},G=this.#n.get(p);if(G===void 0){N&&(N.fetch="miss");let H=this.#N(p,G,$,C);return H.__returned=H}else{let H=this.#e[G];if(this.#t(H)){let B=m&&H.__staleWhileFetching!==void 0;return N&&(N.fetch="inflight",B&&(N.returnedStale=!0)),B?H.__staleWhileFetching:H.__returned=H}let se=this.#p(G);if(!k&&!se)return N&&(N.fetch="hit"),this.#T(G),v&&this.#O(G),N&&this.#A(N,G),H;let V=this.#N(p,G,$,C),te=V.__staleWhileFetching!==void 0&&m;return N&&(N.fetch=se?"stale":"refresh",te&&se&&(N.returnedStale=!0)),te?V.__staleWhileFetching:V.__returned=V}}async forceFetch(p,g={}){let m=await this.fetch(p,g);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(p,g={}){let m=this.#I;if(!m)throw new Error("no memoMethod provided to constructor");let{context:v,forceRefresh:y,...b}=g,_=this.get(p,b);if(!y&&_!==void 0)return _;let w=m(p,_,{options:b,context:v});return this.set(p,w,b),w}get(p,g={}){let{allowStale:m=this.allowStale,updateAgeOnGet:v=this.updateAgeOnGet,noDeleteOnStaleGet:y=this.noDeleteOnStaleGet,status:b}=g,_=this.#n.get(p);if(_!==void 0){let w=this.#e[_],x=this.#t(w);return b&&this.#A(b,_),this.#p(_)?(b&&(b.get="stale"),x?(b&&m&&w.__staleWhileFetching!==void 0&&(b.returnedStale=!0),m?w.__staleWhileFetching:void 0):(y||this.#S(p,"expire"),b&&m&&(b.returnedStale=!0),m?w:void 0)):(b&&(b.get="hit"),x?w.__staleWhileFetching:(this.#T(_),v&&this.#O(_),w))}else b&&(b.get="miss")}#q(p,g){this.#f[g]=p,this.#u[p]=g}#T(p){p!==this.#s&&(p===this.#a?this.#a=this.#u[p]:this.#q(this.#f[p],this.#u[p]),this.#q(this.#s,p),this.#s=p)}delete(p){return this.#S(p,"delete")}#S(p,g){let m=!1;if(this.#i!==0){let v=this.#n.get(p);if(v!==void 0)if(m=!0,this.#i===1)this.#F(g);else{this.#C(v);let y=this.#e[v];if(this.#t(y)?y.__abortController.abort(new Error("deleted")):(this.#_||this.#c)&&(this.#_&&this.#g?.(y,p,g),this.#c&&this.#o?.push([y,p,g])),this.#n.delete(p),this.#r[v]=void 0,this.#e[v]=void 0,v===this.#s)this.#s=this.#f[v];else if(v===this.#a)this.#a=this.#u[v];else{let b=this.#f[v];this.#u[b]=this.#u[v];let _=this.#u[v];this.#f[_]=this.#f[v]}this.#i--,this.#b.push(v)}}if(this.#c&&this.#o?.length){let v=this.#o,y;for(;y=v?.shift();)this.#m?.(...y)}return m}clear(){return this.#F("delete")}#F(p){for(let g of this.#E({allowStale:!0})){let m=this.#e[g];if(this.#t(m))m.__abortController.abort(new Error("deleted"));else{let v=this.#r[g];this.#_&&this.#g?.(m,v,p),this.#c&&this.#o?.push([m,v,p])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#v&&this.#v.fill(0),this.#a=0,this.#s=0,this.#b.length=0,this.#y=0,this.#i=0,this.#c&&this.#o){let g=this.#o,m;for(;m=g?.shift();)this.#m?.(...m)}}};n.LRUCache=f}),jr=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.ContainerIterator=n.Container=n.Base=void 0;var e=class{constructor(i=0){this.iteratorType=i}equals(i){return this.o===i.o}};n.ContainerIterator=e;var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};n.Base=t;var r=class extends t{};n.Container=r}),iU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=jr(),t=class extends e.Base{constructor(i=[]){super(),this.S=[];let s=this;i.forEach(function(o){s.push(o)})}clear(){this.i=0,this.S=[]}push(i){return this.S.push(i),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},r=t;n.default=r}),sU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=jr(),t=class extends e.Base{constructor(i=[]){super(),this.j=0,this.q=[];let s=this;i.forEach(function(o){s.push(o)})}clear(){this.q=[],this.i=this.j=0}push(i){let s=this.q.length;if(this.j/s>.5&&this.j+this.i>=s&&s>4096){let o=this.i;for(let a=0;a<o;++a)this.q[a]=this.q[this.j+a];this.j=0,this.q[this.i]=i}else this.q[this.j+this.i]=i;return++this.i}pop(){if(this.i===0)return;let i=this.q[this.j++];return this.i-=1,i}front(){if(this.i!==0)return this.q[this.j]}},r=t;n.default=r}),oU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=jr(),t=class extends e.Base{constructor(i=[],s=function(a,l){return a>l?-1:a<l?1:0},o=!0){if(super(),this.v=s,Array.isArray(i))this.C=o?[...i]:i;else{this.C=[];let l=this;i.forEach(function(u){l.C.push(u)})}this.i=this.C.length;let a=this.i>>1;for(let l=this.i-1>>1;l>=0;--l)this.k(l,a)}m(i){let s=this.C[i];for(;i>0;){let o=i-1>>1,a=this.C[o];if(this.v(a,s)<=0)break;this.C[i]=a,i=o}this.C[i]=s}k(i,s){let o=this.C[i];for(;i<s;){let a=i<<1|1,l=a+1,u=this.C[a];if(l<this.i&&this.v(u,this.C[l])>0&&(a=l,u=this.C[l]),this.v(u,o)>=0)break;this.C[i]=u,i=a}this.C[i]=o}clear(){this.i=0,this.C.length=0}push(i){this.C.push(i),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let i=this.C[0],s=this.C.pop();return this.i-=1,this.i&&(this.C[0]=s,this.k(0,this.i>>1)),i}top(){return this.C[0]}find(i){return this.C.indexOf(i)>=0}remove(i){let s=this.C.indexOf(i);return s<0?!1:(s===0?this.pop():s===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(s,1,this.C.pop()),this.i-=1,this.m(s),this.k(s,this.i>>1)),!0)}updateItem(i){let s=this.C.indexOf(i);return s<0?!1:(this.m(s),this.k(s,this.i>>1),!0)}toArray(){return[...this.C]}},r=t;n.default=r}),Bg=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=jr(),t=class extends e.Container{},r=t;n.default=r}),Lr=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.throwIteratorAccessError=e;function e(){throw new RangeError("Iterator access denied!")}}),RA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.RandomIterator=void 0;var e=jr(),t=Lr(),r=class extends e.ContainerIterator{constructor(i,s){super(s),this.o=i,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,t.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,t.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,t.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,t.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(i){this.container.setElementByPos(this.o,i)}};n.RandomIterator=r}),aU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=r(Bg()),t=RA();function r(a){return a&&a.t?a:{default:a}}var i=class DO extends t.RandomIterator{constructor(l,u,c){super(l,c),this.container=u}copy(){return new DO(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(a=[],l=!0){if(super(),Array.isArray(a))this.J=l?[...a]:a,this.i=a.length;else{this.J=[];let u=this;a.forEach(function(c){u.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;return this.J[a]}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;return this.J.splice(a,1),this.i-=1,this.i}eraseElementByValue(a){let l=0;for(let u=0;u<this.i;++u)this.J[u]!==a&&(this.J[l++]=this.J[u]);return this.i=this.J.length=l,this.i}eraseElementByIterator(a){let l=a.o;return a=a.next(),this.eraseElementByPos(l),a}pushBack(a){return this.J.push(a),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(a,l){if(a<0||a>this.i-1)throw new RangeError;this.J[a]=l}insert(a,l,u=1){if(a<0||a>this.i)throw new RangeError;return this.J.splice(a,0,...new Array(u).fill(l)),this.i+=u,this.i}find(a){for(let l=0;l<this.i;++l)if(this.J[l]===a)return new i(l,this);return this.end()}reverse(){this.J.reverse()}unique(){let a=1;for(let l=1;l<this.i;++l)this.J[l]!==this.J[l-1]&&(this.J[a++]=this.J[l]);return this.i=this.J.length=a,this.i}sort(a){this.J.sort(a)}forEach(a){for(let l=0;l<this.i;++l)a(this.J[l],l,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},o=s;n.default=o}),lU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=i(Bg()),t=jr(),r=Lr();function i(l){return l&&l.t?l:{default:l}}var s=class BO extends t.ContainerIterator{constructor(u,c,h,f){super(f),this.o=u,this.h=c,this.container=h,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.l}set pointer(u){this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.l=u}copy(){return new BO(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(l=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let u=this;l.forEach(function(c){u.pushBack(c)})}V(l){let{L:u,B:c}=l;u.B=c,c.L=u,l===this.p&&(this.p=c),l===this._&&(this._=u),this.i-=1}G(l,u){let c=u.B,h={l,L:u,B:c};u.B=h,c.L=h,u===this.h&&(this.p=h),c===this.h&&(this._=h),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return u.l}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return this.V(u),this.i}eraseElementByValue(l){let u=this.p;for(;u!==this.h;)u.l===l&&this.V(u),u=u.B;return this.i}eraseElementByIterator(l){let u=l.o;return u===this.h&&(0,r.throwIteratorAccessError)(),l=l.next(),this.V(u),l}pushBack(l){return this.G(l,this._),this.i}popBack(){if(this.i===0)return;let l=this._.l;return this.V(this._),l}pushFront(l){return this.G(l,this.h),this.i}popFront(){if(this.i===0)return;let l=this.p.l;return this.V(this.p),l}setElementByPos(l,u){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;c.l=u}insert(l,u,c=1){if(l<0||l>this.i)throw new RangeError;if(c<=0)return this.i;if(l===0)for(;c--;)this.pushFront(u);else if(l===this.i)for(;c--;)this.pushBack(u);else{let h=this.p;for(let d=1;d<l;++d)h=h.B;let f=h.B;for(this.i+=c;c--;)h.B={l:u,L:h},h.B.L=h,h=h.B;h.B=f,f.L=h}return this.i}find(l){let u=this.p;for(;u!==this.h;){if(u.l===l)return new s(u,this.h,this);u=u.B}return this.end()}reverse(){if(this.i<=1)return;let l=this.p,u=this._,c=0;for(;c<<1<this.i;){let h=l.l;l.l=u.l,u.l=h,l=l.B,u=u.L,c+=1}}unique(){if(this.i<=1)return this.i;let l=this.p;for(;l!==this.h;){let u=l;for(;u.B!==this.h&&u.l===u.B.l;)u=u.B,this.i-=1;l.B=u.B,l.B.L=l,l=l.B}return this.i}sort(l){if(this.i<=1)return;let u=[];this.forEach(function(h){u.push(h)}),u.sort(l);let c=this.p;u.forEach(function(h){c.l=h,c=c.B})}merge(l){let u=this;if(this.i===0)l.forEach(function(c){u.pushBack(c)});else{let c=this.p;l.forEach(function(h){for(;c!==u.h&&c.l<=h;)c=c.B;u.G(h,c.L)})}return this.i}forEach(l){let u=this.p,c=0;for(;u!==this.h;)l(u.l,c++,this),u=u.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let l=this.p;for(;l!==this.h;)yield l.l,l=l.B}).bind(this)()}},a=o;n.default=a}),uU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=r(Bg()),t=RA();function r(a){return a&&a.t?a:{default:a}}var i=class qO extends t.RandomIterator{constructor(l,u,c){super(l,c),this.container=u}copy(){return new qO(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(a=[],l=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let u=(()=>{if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size;if(typeof a.size=="function")return a.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=l,this.P=Math.max(Math.ceil(u/this.F),1);for(let f=0;f<this.P;++f)this.A.push(new Array(this.F));let c=Math.ceil(u/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-u%this.F>>1;let h=this;a.forEach(function(f){h.pushBack(f)})}T(){let a=[],l=Math.max(this.P>>1,1);for(let u=0;u<l;++u)a[u]=new Array(this.F);for(let u=this.j;u<this.P;++u)a[a.length]=this.A[u];for(let u=0;u<this.R;++u)a[a.length]=this.A[u];a[a.length]=[...this.A[this.R]],this.j=l,this.R=a.length-1;for(let u=0;u<l;++u)a[a.length]=new Array(this.F);this.A=a,this.P=a.length}O(a){let l=this.D+a+1,u=l%this.F,c=u-1,h=this.j+(l-u)/this.F;return u===0&&(h-=1),h%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:h,curNodePointerIndex:c}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(a){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=a,this.i}popBack(){if(this.i===0)return;let a=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,a}pushFront(a){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=a,this.i}popFront(){if(this.i===0)return;let a=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,a}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:u}=this.O(a);return this.A[l][u]}setElementByPos(a,l){if(a<0||a>this.i-1)throw new RangeError;let{curNodeBucketIndex:u,curNodePointerIndex:c}=this.O(a);this.A[u][c]=l}insert(a,l,u=1){if(a<0||a>this.i)throw new RangeError;if(a===0)for(;u--;)this.pushFront(l);else if(a===this.i)for(;u--;)this.pushBack(l);else{let c=[];for(let h=a;h<this.i;++h)c.push(this.getElementByPos(h));this.cut(a-1);for(let h=0;h<u;++h)this.pushBack(l);for(let h=0;h<c.length;++h)this.pushBack(c[h])}return this.i}cut(a){if(a<0)return this.clear(),0;let{curNodeBucketIndex:l,curNodePointerIndex:u}=this.O(a);return this.R=l,this.N=u,this.i=a+1,this.i}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;if(a===0)this.popFront();else if(a===this.i-1)this.popBack();else{let l=[];for(let c=a+1;c<this.i;++c)l.push(this.getElementByPos(c));this.cut(a),this.popBack();let u=this;l.forEach(function(c){u.pushBack(c)})}return this.i}eraseElementByValue(a){if(this.i===0)return 0;let l=[];for(let c=0;c<this.i;++c){let h=this.getElementByPos(c);h!==a&&l.push(h)}let u=l.length;for(let c=0;c<u;++c)this.setElementByPos(c,l[c]);return this.cut(u-1)}eraseElementByIterator(a){let l=a.o;return this.eraseElementByPos(l),a=a.next(),a}find(a){for(let l=0;l<this.i;++l)if(this.getElementByPos(l)===a)return new i(l,this);return this.end()}reverse(){let a=0,l=this.i-1;for(;a<l;){let u=this.getElementByPos(a);this.setElementByPos(a,this.getElementByPos(l)),this.setElementByPos(l,u),a+=1,l-=1}}unique(){if(this.i<=1)return this.i;let a=1,l=this.getElementByPos(0);for(let u=1;u<this.i;++u){let c=this.getElementByPos(u);c!==l&&(l=c,this.setElementByPos(a++,c))}for(;this.i>a;)this.popBack();return this.i}sort(a){let l=[];for(let u=0;u<this.i;++u)l.push(this.getElementByPos(u));l.sort(a);for(let u=0;u<this.i;++u)this.setElementByPos(u,l[u])}shrinkToFit(){if(this.i===0)return;let a=[];this.forEach(function(l){a.push(l)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let l=0;l<this.P;++l)this.A.push(new Array(this.F));for(let l=0;l<a.length;++l)this.pushBack(a[l])}forEach(a){for(let l=0;l<this.i;++l)a(this.getElementByPos(l),l,this)}[Symbol.iterator](){return(function*(){for(let a=0;a<this.i;++a)yield this.getElementByPos(a)}).bind(this)()}},o=s;n.default=o}),cU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.TreeNodeEnableIndex=n.TreeNode=void 0;var e=class{constructor(r,i){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=r,this.l=i}L(){let r=this;if(r.ee===1&&r.tt.tt===r)r=r.W;else if(r.U)for(r=r.U;r.W;)r=r.W;else{let i=r.tt;for(;i.U===r;)r=i,i=r.tt;r=i}return r}B(){let r=this;if(r.W){for(r=r.W;r.U;)r=r.U;return r}else{let i=r.tt;for(;i.W===r;)r=i,i=r.tt;return r.W!==i?i:r}}te(){let r=this.tt,i=this.W,s=i.U;return r.tt===this?r.tt=i:r.U===this?r.U=i:r.W=i,i.tt=r,i.U=this,this.tt=i,this.W=s,s&&(s.tt=this),i}se(){let r=this.tt,i=this.U,s=i.W;return r.tt===this?r.tt=i:r.U===this?r.U=i:r.W=i,i.tt=r,i.W=this,this.tt=i,this.U=s,s&&(s.tt=this),i}};n.TreeNode=e;var t=class extends e{constructor(){super(...arguments),this.rt=1}te(){let r=super.te();return this.ie(),r.ie(),r}se(){let r=super.se();return this.ie(),r.ie(),r}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};n.TreeNodeEnableIndex=t}),kA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=cU(),t=jr(),r=Lr(),i=class extends t.Container{constructor(o=function(l,u){return l<u?-1:l>u?1:0},a=!1){super(),this.Y=void 0,this.v=o,a?(this.re=e.TreeNodeEnableIndex,this.M=function(l,u,c){let h=this.ne(l,u,c);if(h){let f=h.tt;for(;f!==this.h;)f.rt+=1,f=f.tt;let d=this.he(h);if(d){let{parentNode:p,grandParent:g,curNode:m}=d;p.ie(),g.ie(),m.ie()}}return this.i},this.V=function(l){let u=this.fe(l);for(;u!==this.h;)u.rt-=1,u=u.tt}):(this.re=e.TreeNode,this.M=function(l,u,c){let h=this.ne(l,u,c);return h&&this.he(h),this.i},this.V=this.fe),this.h=new this.re}X(o,a){let l=this.h;for(;o;){let u=this.v(o.u,a);if(u<0)o=o.W;else if(u>0)l=o,o=o.U;else return o}return l}Z(o,a){let l=this.h;for(;o;)this.v(o.u,a)<=0?o=o.W:(l=o,o=o.U);return l}$(o,a){let l=this.h;for(;o;){let u=this.v(o.u,a);if(u<0)l=o,o=o.W;else if(u>0)o=o.U;else return o}return l}rr(o,a){let l=this.h;for(;o;)this.v(o.u,a)<0?(l=o,o=o.W):o=o.U;return l}ue(o){for(;;){let a=o.tt;if(a===this.h)return;if(o.ee===1){o.ee=0;return}if(o===a.U){let l=a.W;if(l.ee===1)l.ee=0,a.ee=1,a===this.Y?this.Y=a.te():a.te();else if(l.W&&l.W.ee===1){l.ee=a.ee,a.ee=0,l.W.ee=0,a===this.Y?this.Y=a.te():a.te();return}else l.U&&l.U.ee===1?(l.ee=1,l.U.ee=0,l.se()):(l.ee=1,o=a)}else{let l=a.U;if(l.ee===1)l.ee=0,a.ee=1,a===this.Y?this.Y=a.se():a.se();else if(l.U&&l.U.ee===1){l.ee=a.ee,a.ee=0,l.U.ee=0,a===this.Y?this.Y=a.se():a.se();return}else l.W&&l.W.ee===1?(l.ee=1,l.W.ee=0,l.te()):(l.ee=1,o=a)}}}fe(o){if(this.i===1)return this.clear(),this.h;let a=o;for(;a.U||a.W;){if(a.W)for(a=a.W;a.U;)a=a.U;else a=a.U;[o.u,a.u]=[a.u,o.u],[o.l,a.l]=[a.l,o.l],o=a}this.h.U===a?this.h.U=a.tt:this.h.W===a&&(this.h.W=a.tt),this.ue(a);let l=a.tt;return a===l.U?l.U=void 0:l.W=void 0,this.i-=1,this.Y.ee=0,l}oe(o,a){return o===void 0?!1:this.oe(o.U,a)||a(o)?!0:this.oe(o.W,a)}he(o){for(;;){let a=o.tt;if(a.ee===0)return;let l=a.tt;if(a===l.U){let u=l.W;if(u&&u.ee===1){if(u.ee=a.ee=0,l===this.Y)return;l.ee=1,o=l;continue}else if(o===a.W){if(o.ee=0,o.U&&(o.U.tt=a),o.W&&(o.W.tt=l),a.W=o.U,l.U=o.W,o.U=a,o.W=l,l===this.Y)this.Y=o,this.h.tt=o;else{let c=l.tt;c.U===l?c.U=o:c.W=o}return o.tt=l.tt,a.tt=o,l.tt=o,l.ee=1,{parentNode:a,grandParent:l,curNode:o}}else a.ee=0,l===this.Y?this.Y=l.se():l.se(),l.ee=1}else{let u=l.U;if(u&&u.ee===1){if(u.ee=a.ee=0,l===this.Y)return;l.ee=1,o=l;continue}else if(o===a.U){if(o.ee=0,o.U&&(o.U.tt=l),o.W&&(o.W.tt=a),l.W=o.U,a.U=o.W,o.U=l,o.W=a,l===this.Y)this.Y=o,this.h.tt=o;else{let c=l.tt;c.U===l?c.U=o:c.W=o}return o.tt=l.tt,a.tt=o,l.tt=o,l.ee=1,{parentNode:a,grandParent:l,curNode:o}}else a.ee=0,l===this.Y?this.Y=l.te():l.te(),l.ee=1}return}}ne(o,a,l){if(this.Y===void 0){this.i+=1,this.Y=new this.re(o,a),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let u,c=this.h.U,h=this.v(c.u,o);if(h===0){c.l=a;return}else if(h>0)c.U=new this.re(o,a),c.U.tt=c,u=c.U,this.h.U=u;else{let f=this.h.W,d=this.v(f.u,o);if(d===0){f.l=a;return}else if(d<0)f.W=new this.re(o,a),f.W.tt=f,u=f.W,this.h.W=u;else{if(l!==void 0){let p=l.o;if(p!==this.h){let g=this.v(p.u,o);if(g===0){p.l=a;return}else if(g>0){let m=p.L(),v=this.v(m.u,o);if(v===0){m.l=a;return}else v<0&&(u=new this.re(o,a),m.W===void 0?(m.W=u,u.tt=m):(p.U=u,u.tt=p))}}}if(u===void 0)for(u=this.Y;;){let p=this.v(u.u,o);if(p>0){if(u.U===void 0){u.U=new this.re(o,a),u.U.tt=u,u=u.U;break}u=u.U}else if(p<0){if(u.W===void 0){u.W=new this.re(o,a),u.W.tt=u,u=u.W;break}u=u.W}else{u.l=a;return}}}}return this.i+=1,u}I(o,a){for(;o;){let l=this.v(o.u,a);if(l<0)o=o.W;else if(l>0)o=o.U;else return o}return o||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(o,a){let l=o.o;if(l===this.h&&(0,r.throwIteratorAccessError)(),this.i===1)return l.u=a,!0;if(l===this.h.U)return this.v(l.B().u,a)>0?(l.u=a,!0):!1;if(l===this.h.W)return this.v(l.L().u,a)<0?(l.u=a,!0):!1;let u=l.L().u;if(this.v(u,a)>=0)return!1;let c=l.B().u;return this.v(c,a)<=0?!1:(l.u=a,!0)}eraseElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let a=0,l=this;return this.oe(this.Y,function(u){return o===a?(l.V(u),!0):(a+=1,!1)}),this.i}eraseElementByKey(o){if(this.i===0)return!1;let a=this.I(this.Y,o);return a===this.h?!1:(this.V(a),!0)}eraseElementByIterator(o){let a=o.o;a===this.h&&(0,r.throwIteratorAccessError)();let l=a.W===void 0;return o.iteratorType===0?l&&o.next():(!l||a.U===void 0)&&o.next(),this.V(a),o}forEach(o){let a=0;for(let l of this)o(l,a++,this)}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let a,l=0;for(let u of this){if(l===o){a=u;break}l+=1}return a}getHeight(){if(this.i===0)return 0;let o=function(a){return a?Math.max(o(a.U),o(a.W))+1:0};return o(this.Y)}},s=i;n.default=s}),NA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=jr(),t=Lr(),r=class extends e.ContainerIterator{constructor(s,o,a){super(a),this.o=s,this.h=o,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,t.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let s=this.o,o=this.h.tt;if(s===this.h)return o?o.rt-1:0;let a=0;for(s.U&&(a+=s.U.rt);s!==o;){let l=s.tt;s===l.W&&(a+=1,l.U&&(a+=l.U.rt)),s=l}return a}},i=r;n.default=i}),hU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=i(kA()),t=i(NA()),r=Lr();function i(l){return l&&l.t?l:{default:l}}var s=class FO extends t.default{constructor(u,c,h,f){super(u,c,f),this.container=h}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new FO(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(l=[],u,c){super(u,c);let h=this;l.forEach(function(f){h.insert(f)})}*K(l){l!==void 0&&(yield*this.K(l.U),yield l.u,yield*this.K(l.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(l,u){return this.M(l,void 0,u)}find(l){let u=this.I(this.Y,l);return new s(u,this.h,this)}lowerBound(l){let u=this.X(this.Y,l);return new s(u,this.h,this)}upperBound(l){let u=this.Z(this.Y,l);return new s(u,this.h,this)}reverseLowerBound(l){let u=this.$(this.Y,l);return new s(u,this.h,this)}reverseUpperBound(l){let u=this.rr(this.Y,l);return new s(u,this.h,this)}union(l){let u=this;return l.forEach(function(c){u.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},a=o;n.default=a}),fU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=i(kA()),t=i(NA()),r=Lr();function i(l){return l&&l.t?l:{default:l}}var s=class $O extends t.default{constructor(u,c,h,f){super(u,c,f),this.container=h}get pointer(){this.o===this.h&&(0,r.throwIteratorAccessError)();let u=this;return new Proxy([],{get(c,h){if(h==="0")return u.o.u;if(h==="1")return u.o.l},set(c,h,f){if(h!=="1")throw new TypeError("props must be 1");return u.o.l=f,!0}})}copy(){return new $O(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(l=[],u,c){super(u,c);let h=this;l.forEach(function(f){h.setElement(f[0],f[1])})}*K(l){l!==void 0&&(yield*this.K(l.U),yield[l.u,l.l],yield*this.K(l.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i===0)return;let l=this.h.U;return[l.u,l.l]}back(){if(this.i===0)return;let l=this.h.W;return[l.u,l.l]}lowerBound(l){let u=this.X(this.Y,l);return new s(u,this.h,this)}upperBound(l){let u=this.Z(this.Y,l);return new s(u,this.h,this)}reverseLowerBound(l){let u=this.$(this.Y,l);return new s(u,this.h,this)}reverseUpperBound(l){let u=this.rr(this.Y,l);return new s(u,this.h,this)}setElement(l,u,c){return this.M(l,u,c)}find(l){let u=this.I(this.Y,l);return new s(u,this.h,this)}getElementByKey(l){return this.I(this.Y,l).l}union(l){let u=this;return l.forEach(function(c){u.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},a=o;n.default=a}),jA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=e;function e(t){let r=typeof t;return r==="object"&&t!==null||r==="function"}}),LA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.HashContainerIterator=n.HashContainer=void 0;var e=jr(),t=i(jA()),r=Lr();function i(a){return a&&a.t?a:{default:a}}var s=class extends e.ContainerIterator{constructor(a,l,u){super(u),this.o=a,this.h=l,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L,this})}};n.HashContainerIterator=s;var o=class extends e.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(a){let{L:l,B:u}=a;l.B=u,u.L=l,a===this.p&&(this.p=u),a===this._&&(this._=l),this.i-=1}M(a,l,u){u===void 0&&(u=(0,t.default)(a));let c;if(u){let h=a[this.HASH_TAG];if(h!==void 0)return this.H[h].l=l,this.i;Object.defineProperty(a,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:a,l,L:this._,B:this.h},this.H.push(c)}else{let h=this.g[a];if(h)return h.l=l,this.i;c={u:a,l,L:this._,B:this.h},this.g[a]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(a,l){if(l===void 0&&(l=(0,t.default)(a)),l){let u=a[this.HASH_TAG];return u===void 0?this.h:this.H[u]}else return this.g[a]||this.h}clear(){let a=this.HASH_TAG;this.H.forEach(function(l){delete l.u[a]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(a,l){let u;if(l===void 0&&(l=(0,t.default)(a)),l){let c=a[this.HASH_TAG];if(c===void 0)return!1;delete a[this.HASH_TAG],u=this.H[c],delete this.H[c]}else{if(u=this.g[a],u===void 0)return!1;delete this.g[a]}return this.V(u),!0}eraseElementByIterator(a){let l=a.o;return l===this.h&&(0,r.throwIteratorAccessError)(),this.V(l),a.next()}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let l=this.p;for(;a--;)l=l.B;return this.V(l),this.i}};n.HashContainer=o}),dU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=LA(),t=Lr(),r=class UO extends e.HashContainerIterator{constructor(a,l,u,c){super(a,l,c),this.container=u}get pointer(){return this.o===this.h&&(0,t.throwIteratorAccessError)(),this.o.u}copy(){return new UO(this.o,this.h,this.container,this.iteratorType)}},i=class extends e.HashContainer{constructor(o=[]){super();let a=this;o.forEach(function(l){a.insert(l)})}begin(){return new r(this.p,this.h,this)}end(){return new r(this.h,this.h,this)}rBegin(){return new r(this._,this.h,this,1)}rEnd(){return new r(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(o,a){return this.M(o,void 0,a)}getElementByPos(o){if(o<0||o>this.i-1)throw new RangeError;let a=this.p;for(;o--;)a=a.B;return a.u}find(o,a){let l=this.I(o,a);return new r(l,this.h,this)}forEach(o){let a=0,l=this.p;for(;l!==this.h;)o(l.u,a++,this),l=l.B}[Symbol.iterator](){return(function*(){let o=this.p;for(;o!==this.h;)yield o.u,o=o.B}).bind(this)()}},s=i;n.default=s}),pU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),n.default=void 0;var e=LA(),t=i(jA()),r=Lr();function i(l){return l&&l.t?l:{default:l}}var s=class zO extends e.HashContainerIterator{constructor(u,c,h,f){super(u,c,f),this.container=h}get pointer(){this.o===this.h&&(0,r.throwIteratorAccessError)();let u=this;return new Proxy([],{get(c,h){if(h==="0")return u.o.u;if(h==="1")return u.o.l},set(c,h,f){if(h!=="1")throw new TypeError("props must be 1");return u.o.l=f,!0}})}copy(){return new zO(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.HashContainer{constructor(l=[]){super();let u=this;l.forEach(function(c){u.setElement(c[0],c[1])})}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(l,u,c){return this.M(l,u,c)}getElementByKey(l,u){if(u===void 0&&(u=(0,t.default)(l)),u){let h=l[this.HASH_TAG];return h!==void 0?this.H[h].l:void 0}let c=this.g[l];return c?c.l:void 0}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;return[u.u,u.l]}find(l,u){let c=this.I(l,u);return new s(c,this.h,this)}forEach(l){let u=0,c=this.p;for(;c!==this.h;)l([c.u,c.l],u++,this),c=c.B}[Symbol.iterator](){return(function*(){let l=this.p;for(;l!==this.h;)yield[l.u,l.l],l=l.B}).bind(this)()}},a=o;n.default=a}),gU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"t",{value:!0}),Object.defineProperty(n,"Deque",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"HashSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(n,"LinkList",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"PriorityQueue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"Queue",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"Stack",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"Vector",{enumerable:!0,get:function(){return i.default}});var e=h(iU()),t=h(sU()),r=h(oU()),i=h(aU()),s=h(lU()),o=h(uU()),a=h(hU()),l=h(fU()),u=h(dU()),c=h(pU());function h(f){return f&&f.t?f:{default:f}}}),mU=ve((n,e)=>{pe(),me(),ge();var t=gU().OrderedSet,r=Nr()("number-allocator:trace"),i=Nr()("number-allocator:error");function s(a,l){this.low=a,this.high=l}s.prototype.equals=function(a){return this.low===a.low&&this.high===a.high},s.prototype.compare=function(a){return this.low<a.low&&this.high<a.low?-1:a.low<this.low&&a.high<this.low?1:0};function o(a,l){if(!(this instanceof o))return new o(a,l);this.min=a,this.max=l,this.ss=new t([],(u,c)=>u.compare(c)),r("Create"),this.clear()}o.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},o.prototype.alloc=function(){if(this.ss.size()===0)return r("alloc():empty"),null;let a=this.ss.begin(),l=a.pointer.low,u=a.pointer.high,c=l;return c+1<=u?this.ss.updateKeyByIterator(a,new s(l+1,u)):this.ss.eraseElementByPos(0),r("alloc():"+c),c},o.prototype.use=function(a){let l=new s(a,a),u=this.ss.lowerBound(l);if(!u.equals(this.ss.end())){let c=u.pointer.low,h=u.pointer.high;return u.pointer.equals(l)?(this.ss.eraseElementByIterator(u),r("use():"+a),!0):c>a?!1:c===a?(this.ss.updateKeyByIterator(u,new s(c+1,h)),r("use():"+a),!0):h===a?(this.ss.updateKeyByIterator(u,new s(c,h-1)),r("use():"+a),!0):(this.ss.updateKeyByIterator(u,new s(a+1,h)),this.ss.insert(new s(c,a-1)),r("use():"+a),!0)}return r("use():failed"),!1},o.prototype.free=function(a){if(a<this.min||a>this.max){i("free():"+a+" is out of range");return}let l=new s(a,a),u=this.ss.upperBound(l);if(u.equals(this.ss.end())){if(u.equals(this.ss.begin())){this.ss.insert(l);return}u.pre();let c=u.pointer.high;u.pointer.high+1===a?this.ss.updateKeyByIterator(u,new s(c,a)):this.ss.insert(l)}else if(u.equals(this.ss.begin()))if(a+1===u.pointer.low){let c=u.pointer.high;this.ss.updateKeyByIterator(u,new s(a,c))}else this.ss.insert(l);else{let c=u.pointer.low,h=u.pointer.high;u.pre();let f=u.pointer.low;u.pointer.high+1===a?a+1===c?(this.ss.eraseElementByIterator(u),this.ss.updateKeyByIterator(u,new s(f,h))):this.ss.updateKeyByIterator(u,new s(f,a)):a+1===c?(this.ss.eraseElementByIterator(u.next()),this.ss.insert(new s(a,h))):this.ss.insert(l)}r("free():"+a)},o.prototype.clear=function(){r("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},o.prototype.intervalCount=function(){return this.ss.size()},o.prototype.dump=function(){console.log("length:"+this.ss.size());for(let a of this.ss)console.log(a)},e.exports=o}),DA=ve((n,e)=>{pe(),me(),ge();var t=mU();e.exports.NumberAllocator=t}),yU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=nU(),t=DA(),r=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(i){i>0&&(this.aliasToTopic=new e.LRUCache({max:i}),this.topicToAlias={},this.numberAllocator=new t.NumberAllocator(1,i),this.max=i,this.length=0)}put(i,s){if(s===0||s>this.max)return!1;let o=this.aliasToTopic.get(s);return o&&delete this.topicToAlias[o],this.aliasToTopic.set(s,i),this.topicToAlias[i]=s,this.numberAllocator.use(s),this.length=this.aliasToTopic.size,!0}getTopicByAlias(i){return this.aliasToTopic.get(i)}getAliasByTopic(i){let s=this.topicToAlias[i];return typeof s<"u"&&this.aliasToTopic.get(s),s}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};n.default=r}),bU=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(n,"__esModule",{value:!0});var t=Go(),r=e(yU()),i=xi(),s=(o,a)=>{o.log("_handleConnack");let{options:l}=o,u=l.protocolVersion===5?a.reasonCode:a.returnCode;if(clearTimeout(o.connackTimer),delete o.topicAliasSend,a.properties){if(a.properties.topicAliasMaximum){if(a.properties.topicAliasMaximum>65535){o.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}a.properties.topicAliasMaximum>0&&(o.topicAliasSend=new r.default(a.properties.topicAliasMaximum))}a.properties.serverKeepAlive&&l.keepalive&&(l.keepalive=a.properties.serverKeepAlive),a.properties.maximumPacketSize&&(l.properties||(l.properties={}),l.properties.maximumPacketSize=a.properties.maximumPacketSize)}if(u===0)o.reconnecting=!1,o._onConnect(a);else if(u>0){let c=new i.ErrorWithReasonCode(`Connection refused: ${t.ReasonCodes[u]}`,u);o.emit("error",c),o.options.reconnectOnConnackError&&o._cleanUp(!0)}};n.default=s}),vU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=(t,r,i)=>{t.log("handling pubrel packet");let s=typeof i<"u"?i:t.noop,{messageId:o}=r,a={cmd:"pubcomp",messageId:o};t.incomingStore.get(r,(l,u)=>{l?t._sendPacket(a,s):(t.emit("message",u.topic,u.payload,u),t.handleMessage(u,c=>{if(c)return s(c);t.incomingStore.del(u,t.noop),t._sendPacket(a,s)}))})};n.default=e}),wU=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(n,"__esModule",{value:!0});var t=e(eU()),r=e(rU()),i=e(bU()),s=e(Go()),o=e(vU()),a=(l,u,c)=>{let{options:h}=l;if(h.protocolVersion===5&&h.properties&&h.properties.maximumPacketSize&&h.properties.maximumPacketSize<u.length)return l.emit("error",new Error(`exceeding packets size ${u.cmd}`)),l.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),l;switch(l.log("_handlePacket :: emitting packetreceive"),l.emit("packetreceive",u),u.cmd){case"publish":(0,t.default)(l,u,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":l.reschedulePing(),(0,s.default)(l,u),c();break;case"pubrel":l.reschedulePing(),(0,o.default)(l,u,c);break;case"connack":(0,i.default)(l,u),c();break;case"auth":l.reschedulePing(),(0,r.default)(l,u),c();break;case"pingresp":l.log("_handlePacket :: received pingresp"),l.reschedulePing(!0),c();break;case"disconnect":l.emit("disconnect",u),c();break;default:l.log("_handlePacket :: unknown command"),c();break}};n.default=a}),BA=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let t=this.nextId++;return this.nextId===65536&&(this.nextId=1),t}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}};n.default=e}),_U=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=class{aliasToTopic;max;length;constructor(t){this.aliasToTopic={},this.max=t}put(t,r){return r===0||r>this.max?!1:(this.aliasToTopic[r]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};n.default=e}),xU=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(n,"__esModule",{value:!0}),n.TypedEventEmitter=void 0;var t=e((Pn(),$e(tn))),r=xi(),i=class{};n.TypedEventEmitter=i,(0,r.applyMixin)(i,t.default)}),Ho=ve((n,e)=>{pe(),me(),ge();function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),EU=ve((n,e)=>{pe(),me(),ge();var t=Ho().default;function r(i,s){if(t(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var a=o.call(i,s||"default");if(t(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),SU=ve((n,e)=>{pe(),me(),ge();var t=Ho().default,r=EU();function i(s){var o=r(s,"string");return t(o)=="symbol"?o:o+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),AU=ve((n,e)=>{pe(),me(),ge();var t=SU();function r(i,s,o){return(s=t(s))in i?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),PU=ve((n,e)=>{pe(),me(),ge();function t(r){if(Array.isArray(r))return r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),OU=ve((n,e)=>{pe(),me(),ge();function t(r,i){var s=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(s!=null){var o,a,l,u,c=[],h=!0,f=!1;try{if(l=(s=s.call(r)).next,i===0){if(Object(s)!==s)return;h=!1}else for(;!(h=(o=l.call(s)).done)&&(c.push(o.value),c.length!==i);h=!0);}catch(d){f=!0,a=d}finally{try{if(!h&&s.return!=null&&(u=s.return(),Object(u)!==u))return}finally{if(f)throw a}}return c}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),CU=ve((n,e)=>{pe(),me(),ge();function t(r,i){(i==null||i>r.length)&&(i=r.length);for(var s=0,o=Array(i);s<i;s++)o[s]=r[s];return o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),TU=ve((n,e)=>{pe(),me(),ge();var t=CU();function r(i,s){if(i){if(typeof i=="string")return t(i,s);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(i,s):void 0}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),MU=ve((n,e)=>{pe(),me(),ge();function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
261
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),IU=ve((n,e)=>{pe(),me(),ge();var t=PU(),r=OU(),i=TU(),s=MU();function o(a,l){return t(a)||r(a,l)||i(a,l)||s()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}),qA=ve((n,e)=>{pe(),me(),ge(),(function(t,r){typeof n=="object"&&typeof e<"u"?r(n):typeof define=="function"&&define.amd?define(["exports"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.fastUniqueNumbers={}))})(n,function(t){var r=function(d){return function(p){var g=d(p);return p.add(g),g}},i=function(d){return function(p,g){return d.set(p,g),g}},s=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,a=o*2,l=function(d,p){return function(g){var m=p.get(g),v=m===void 0?g.size:m<a?m+1:0;if(!g.has(v))return d(g,v);if(g.size<o){for(;g.has(v);)v=Math.floor(Math.random()*a);return d(g,v)}if(g.size>s)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;g.has(v);)v=Math.floor(Math.random()*s);return d(g,v)}},u=new WeakMap,c=i(u),h=l(c,u),f=r(h);t.addUniqueNumber=f,t.generateUniqueNumber=h})}),RU=ve((n,e)=>{pe(),me(),ge();function t(i,s,o,a,l,u,c){try{var h=i[u](c),f=h.value}catch(d){return void o(d)}h.done?s(f):Promise.resolve(f).then(a,l)}function r(i){return function(){var s=this,o=arguments;return new Promise(function(a,l){var u=i.apply(s,o);function c(f){t(u,a,l,c,h,"next",f)}function h(f){t(u,a,l,c,h,"throw",f)}c(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),FA=ve((n,e)=>{pe(),me(),ge();function t(r,i){this.v=r,this.k=i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),$A=ve((n,e)=>{pe(),me(),ge();function t(r,i,s,o){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}e.exports=t=function(l,u,c,h){function f(d,p){t(l,d,function(g){return this._invoke(d,p,g)})}u?a?a(l,u,{value:c,enumerable:!h,configurable:!h,writable:!h}):l[u]=c:(f("next",0),f("throw",1),f("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,i,s,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),UA=ve((n,e)=>{pe(),me(),ge();var t=$A();function r(){var i,s,o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",l=o.toStringTag||"@@toStringTag";function u(v,y,b,_){var w=y&&y.prototype instanceof h?y:h,x=Object.create(w.prototype);return t(x,"_invoke",(function(E,A,O){var T,M,C,k=0,N=O||[],R=!1,$={p:0,n:0,v:i,a:G,f:G.bind(i,4),d:function(H,se){return T=H,M=0,C=i,$.n=se,c}};function G(H,se){for(M=H,C=se,s=0;!R&&k&&!V&&s<N.length;s++){var V,te=N[s],B=$.p,ne=te[2];H>3?(V=ne===se)&&(C=te[(M=te[4])?5:(M=3,3)],te[4]=te[5]=i):te[0]<=B&&((V=H<2&&B<te[1])?(M=0,$.v=se,$.n=te[1]):B<ne&&(V=H<3||te[0]>se||se>ne)&&(te[4]=H,te[5]=se,$.n=ne,M=0))}if(V||H>1)return c;throw R=!0,se}return function(H,se,V){if(k>1)throw TypeError("Generator is already running");for(R&&se===1&&G(se,V),M=se,C=V;(s=M<2?i:C)||!R;){T||(M?M<3?(M>1&&($.n=-1),G(M,C)):$.n=C:$.v=C);try{if(k=2,T){if(M||(H="next"),s=T[H]){if(!(s=s.call(T,C)))throw TypeError("iterator result is not an object");if(!s.done)return s;C=s.value,M<2&&(M=0)}else M===1&&(s=T.return)&&s.call(T),M<2&&(C=TypeError("The iterator does not provide a '"+H+"' method"),M=1);T=i}else if((s=(R=$.n<0)?C:E.call(A,$))!==c)break}catch(te){T=i,M=1,C=te}finally{k=1}}return{value:s,done:R}}})(v,b,_),!0),x}var c={};function h(){}function f(){}function d(){}s=Object.getPrototypeOf;var p=[][a]?s(s([][a]())):(t(s={},a,function(){return this}),s),g=d.prototype=h.prototype=Object.create(p);function m(v){return Object.setPrototypeOf?Object.setPrototypeOf(v,d):(v.__proto__=d,t(v,l,"GeneratorFunction")),v.prototype=Object.create(g),v}return f.prototype=d,t(g,"constructor",d),t(d,"constructor",f),f.displayName="GeneratorFunction",t(d,l,"GeneratorFunction"),t(g),t(g,l,"Generator"),t(g,a,function(){return this}),t(g,"toString",function(){return"[object Generator]"}),(e.exports=r=function(){return{w:u,m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),zA=ve((n,e)=>{pe(),me(),ge();var t=FA(),r=$A();function i(s,o){function a(u,c,h,f){try{var d=s[u](c),p=d.value;return p instanceof t?o.resolve(p.v).then(function(g){a("next",g,h,f)},function(g){a("throw",g,h,f)}):o.resolve(p).then(function(g){d.value=g,h(d)},function(g){return a("throw",g,h,f)})}catch(g){f(g)}}var l;this.next||(r(i.prototype),r(i.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(u,c,h){function f(){return new o(function(d,p){a(u,h,d,p)})}return l=l?l.then(f,f):f()},!0)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),VA=ve((n,e)=>{pe(),me(),ge();var t=UA(),r=zA();function i(s,o,a,l,u){return new r(t().w(s,o,a,l),u||Promise)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),kU=ve((n,e)=>{pe(),me(),ge();var t=VA();function r(i,s,o,a,l){var u=t(i,s,o,a,l);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),NU=ve((n,e)=>{pe(),me(),ge();function t(r){var i=Object(r),s=[];for(var o in i)s.unshift(o);return function a(){for(;s.length;)if((o=s.pop())in i)return a.value=o,a.done=!1,a;return a.done=!0,a}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),jU=ve((n,e)=>{pe(),me(),ge();var t=Ho().default;function r(i){if(i!=null){var s=i[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(s)return s.call(i);if(typeof i.next=="function")return i;if(!isNaN(i.length))return{next:function(){return i&&o>=i.length&&(i=void 0),{value:i&&i[o++],done:!i}}}}throw new TypeError(t(i)+" is not iterable")}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),LU=ve((n,e)=>{pe(),me(),ge();var t=FA(),r=UA(),i=kU(),s=VA(),o=zA(),a=NU(),l=jU();function u(){var c=r(),h=c.m(u),f=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function d(m){var v=typeof m=="function"&&m.constructor;return!!v&&(v===f||(v.displayName||v.name)==="GeneratorFunction")}var p={throw:1,return:2,break:3,continue:3};function g(m){var v,y;return function(b){v||(v={stop:function(){return y(b.a,2)},catch:function(){return b.v},abrupt:function(_,w){return y(b.a,p[_],w)},delegateYield:function(_,w,x){return v.resultName=w,y(b.d,l(_),x)},finish:function(_){return y(b.f,_)}},y=function(_,w,x){b.p=v.prev,b.n=v.next;try{return _(w,x)}finally{v.next=b.n}}),v.resultName&&(v[v.resultName]=b.v,v.resultName=void 0),v.sent=b.v,v.next=b.n;try{return m.call(this,v)}finally{b.p=v.prev,b.n=v.next}}}return(e.exports=u=function(){return{wrap:function(m,v,y,b){return c.w(g(m),v,y,b&&b.reverse())},isGeneratorFunction:d,mark:c.m,awrap:function(m,v){return new t(m,v)},AsyncIterator:o,async:function(m,v,y,b,_){return(d(v)?s:i)(g(m),v,y,b,_)},keys:a,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports}),DU=ve((n,e)=>{pe(),me(),ge();var t=LU()();e.exports=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}),BU=ve((n,e)=>{pe(),me(),ge(),(function(t,r){typeof n=="object"&&typeof e<"u"?r(n,AU(),IU(),qA(),RU(),DU()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.brokerFactory={},t._defineProperty,t._slicedToArray,t.fastUniqueNumbers,t._asyncToGenerator,t._regeneratorRuntime))})(n,function(t,r,i,s,o,a){var l=function(y){return typeof y.start=="function"},u=new WeakMap;function c(y,b){var _=Object.keys(y);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(y);b&&(w=w.filter(function(x){return Object.getOwnPropertyDescriptor(y,x).enumerable})),_.push.apply(_,w)}return _}function h(y){for(var b=1;b<arguments.length;b++){var _=arguments[b]!=null?arguments[b]:{};b%2?c(Object(_),!0).forEach(function(w){r(y,w,_[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(_)):c(Object(_)).forEach(function(w){Object.defineProperty(y,w,Object.getOwnPropertyDescriptor(_,w))})}return y}var f=function(y){return h(h({},y),{},{connect:function(b){var _=b.call;return o(a.mark(function w(){var x,E,A,O;return a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return x=new MessageChannel,E=x.port1,A=x.port2,T.next=1,_("connect",{port:E},[E]);case 1:return O=T.sent,u.set(A,O),T.abrupt("return",A);case 2:case"end":return T.stop()}},w)}))},disconnect:function(b){var _=b.call;return(function(){var w=o(a.mark(function x(E){var A;return a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(A=u.get(E),A!==void 0){O.next=1;break}throw new Error("The given port is not connected.");case 1:return O.next=2,_("disconnect",{portId:A});case 2:case"end":return O.stop()}},x)}));return function(x){return w.apply(this,arguments)}})()},isSupported:function(b){var _=b.call;return function(){return _("isSupported")}}})};function d(y,b){var _=Object.keys(y);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(y);b&&(w=w.filter(function(x){return Object.getOwnPropertyDescriptor(y,x).enumerable})),_.push.apply(_,w)}return _}function p(y){for(var b=1;b<arguments.length;b++){var _=arguments[b]!=null?arguments[b]:{};b%2?d(Object(_),!0).forEach(function(w){r(y,w,_[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(_)):d(Object(_)).forEach(function(w){Object.defineProperty(y,w,Object.getOwnPropertyDescriptor(_,w))})}return y}var g=new WeakMap,m=function(y){if(g.has(y))return g.get(y);var b=new Map;return g.set(y,b),b},v=function(y){var b=f(y);return function(_){var w=m(_);_.addEventListener("message",function(N){var R=N.data,$=R.id;if($!==null&&w.has($)){var G=w.get($),H=G.reject,se=G.resolve;w.delete($),R.error===void 0?se(R.result):H(new Error(R.error.message))}}),l(_)&&_.start();for(var x=function(N){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(G,H){var se=s.generateUniqueNumber(w);w.set(se,{reject:H,resolve:G}),R===null?_.postMessage({id:se,method:N},$):_.postMessage({id:se,method:N,params:R},$)})},E=function(N,R){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];_.postMessage({id:null,method:N,params:R},$)},A={},O=0,T=Object.entries(b);O<T.length;O++){var M=i(T[O],2),C=M[0],k=M[1];A=p(p({},A),{},r({},C,k({call:x,notify:E})))}return p({},A)}};t.createBroker=v})}),qU=ve((n,e)=>{pe(),me(),ge(),(function(t,r){typeof n=="object"&&typeof e<"u"?r(n,Ho(),BU(),qA()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.workerTimersBroker={},t._typeof,t.brokerFactory,t.fastUniqueNumbers))})(n,function(t,r,i,s){var o=new Map([[0,null]]),a=new Map([[0,null]]),l=i.createBroker({clearInterval:function(c){var h=c.call;return function(f){r(o.get(f))==="symbol"&&(o.set(f,null),h("clear",{timerId:f,timerType:"interval"}).then(function(){o.delete(f)}))}},clearTimeout:function(c){var h=c.call;return function(f){r(a.get(f))==="symbol"&&(a.set(f,null),h("clear",{timerId:f,timerType:"timeout"}).then(function(){a.delete(f)}))}},setInterval:function(c){var h=c.call;return function(f){for(var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length,g=new Array(p>2?p-2:0),m=2;m<p;m++)g[m-2]=arguments[m];var v=Symbol(),y=s.generateUniqueNumber(o);o.set(y,v);var b=function(){return h("set",{delay:d,now:performance.timeOrigin+performance.now(),timerId:y,timerType:"interval"}).then(function(){var _=o.get(y);if(_===void 0)throw new Error("The timer is in an undefined state.");_===v&&(f.apply(void 0,g),o.get(y)===v&&b())})};return b(),y}},setTimeout:function(c){var h=c.call;return function(f){for(var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=arguments.length,g=new Array(p>2?p-2:0),m=2;m<p;m++)g[m-2]=arguments[m];var v=Symbol(),y=s.generateUniqueNumber(a);return a.set(y,v),h("set",{delay:d,now:performance.timeOrigin+performance.now(),timerId:y,timerType:"timeout"}).then(function(){var b=a.get(y);if(b===void 0)throw new Error("The timer is in an undefined state.");b===v&&(a.delete(y),f.apply(void 0,g))}),y}}}),u=function(c){var h=new Worker(c);return l(h)};t.load=u,t.wrap=l})}),FU=ve((n,e)=>{pe(),me(),ge(),(function(t,r){typeof n=="object"&&typeof e<"u"?r(n,qU()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.workerTimers={},t.workerTimersBroker))})(n,function(t,r){var i=function(h,f){var d=null;return function(){if(d!==null)return d;var p=new Blob([f],{type:"application/javascript; charset=utf-8"}),g=URL.createObjectURL(p);return d=h(g),setTimeout(function(){return URL.revokeObjectURL(g)}),d}},s=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,o=i(r.load,s),a=function(h){return o().clearInterval(h)},l=function(h){return o().clearTimeout(h)},u=function(){var h;return(h=o()).setInterval.apply(h,arguments)},c=function(){var h;return(h=o()).setTimeout.apply(h,arguments)};t.clearInterval=a,t.clearTimeout=l,t.setInterval=u,t.setTimeout=c})}),Ko=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.isReactNativeBrowser=n.isWebWorker=void 0;var e=()=>typeof window<"u"?typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&Ge?.versions?!Object.prototype.hasOwnProperty.call(Ge.versions,"electron"):typeof window.document<"u":!1,t=()=>!!(typeof self=="object"&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),r=()=>typeof navigator<"u"&&navigator.product==="ReactNative",i=e()||t()||r();n.isWebWorker=t(),n.isReactNativeBrowser=r(),n.default=i}),$U=ve(n=>{pe(),me(),ge();var e=n&&n.__createBinding||(Object.create?function(u,c,h,f){f===void 0&&(f=h);var d=Object.getOwnPropertyDescriptor(c,h);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(u,f,d)}:function(u,c,h,f){f===void 0&&(f=h),u[f]=c[h]}),t=n&&n.__setModuleDefault||(Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c}),r=n&&n.__importStar||(function(){var u=function(c){return u=Object.getOwnPropertyNames||function(h){var f=[];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(f[f.length]=d);return f},u(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var f=u(c),d=0;d<f.length;d++)f[d]!=="default"&&e(h,c,f[d]);return t(h,c),h}})();Object.defineProperty(n,"__esModule",{value:!0});var i=FU(),s=r(Ko()),o={set:i.setInterval,clear:i.clearInterval},a={set:(u,c)=>setInterval(u,c),clear:u=>clearInterval(u)},l=u=>{switch(u){case"native":return a;case"worker":return o;case"auto":default:return s.default&&!s.isWebWorker&&!s.isReactNativeBrowser?o:a}};n.default=l}),WA=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(n,"__esModule",{value:!0});var t=e($U()),r=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(i,s){this.client=i,this.timer=typeof s=="object"&&"set"in s&&"clear"in s?s:(0,t.default)(s),this.setKeepalive(i.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(i){if(i*=1e3,isNaN(i)||i<=0||i>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${i}`);this._keepalive=i,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${i}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let i=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+i,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};n.default=r}),qg=ve(n=>{pe(),me(),ge();var e=n&&n.__createBinding||(Object.create?function(w,x,E,A){A===void 0&&(A=E);var O=Object.getOwnPropertyDescriptor(x,E);(!O||("get"in O?!x.__esModule:O.writable||O.configurable))&&(O={enumerable:!0,get:function(){return x[E]}}),Object.defineProperty(w,A,O)}:function(w,x,E,A){A===void 0&&(A=E),w[A]=x[E]}),t=n&&n.__setModuleDefault||(Object.create?function(w,x){Object.defineProperty(w,"default",{enumerable:!0,value:x})}:function(w,x){w.default=x}),r=n&&n.__importStar||(function(){var w=function(x){return w=Object.getOwnPropertyNames||function(E){var A=[];for(var O in E)Object.prototype.hasOwnProperty.call(E,O)&&(A[A.length]=O);return A},w(x)};return function(x){if(x&&x.__esModule)return x;var E={};if(x!=null)for(var A=w(x),O=0;O<A.length;O++)A[O]!=="default"&&e(E,x,A[O]);return t(E,x),E}})(),i=n&&n.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(n,"__esModule",{value:!0});var s=i(J$()),o=Cn(),a=i(Q$()),l=i(Nr()),u=r(Z$()),c=i(IA()),h=i(wU()),f=i(BA()),d=i(_U()),p=xi(),g=xU(),m=i(WA()),v=r(Ko()),y=globalThis.setImmediate||((...w)=>{let x=w.shift();(0,p.nextTick)(()=>{x(...w)})}),b={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},_=class Lm extends g.TypedEventEmitter{static VERSION=p.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_deferredReconnect;connackPacket;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(x,E){super(),this.options=E||{};for(let A in b)typeof this.options[A]>"u"?this.options[A]=b[A]:this.options[A]=E[A];this.log=this.options.log||(0,l.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",Lm.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",E.protocol),this.log("MqttClient :: options.protocolVersion",E.protocolVersion),this.log("MqttClient :: options.username",E.username),this.log("MqttClient :: options.keepalive",E.keepalive),this.log("MqttClient :: options.reconnectPeriod",E.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",E.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",E.properties?E.properties.topicAliasMaximum:void 0),this.options.clientId=typeof E.clientId=="string"?E.clientId:Lm.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=E.protocolVersion===5&&E.customHandleAcks?E.customHandleAcks:(...A)=>{A[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=x,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new f.default:this.options.messageIdProvider,this.outgoingStore=E.outgoingStore||new c.default,this.incomingStore=E.incomingStore||new c.default,this.queueQoSZero=E.queueQoSZero===void 0?!0:E.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,E.properties&&E.properties.topicAliasMaximum>0&&(E.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new d.default(E.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:A}=this,O=()=>{let T=A.shift();this.log("deliver :: entry %o",T);let M=null;if(!T){this._resubscribe();return}M=T.packet,this.log("deliver :: call _sendPacket for %o",M);let C=!0;M.messageId&&M.messageId!==0&&(this.messageIdProvider.register(M.messageId)||(C=!1)),C?this._sendPacket(M,k=>{T.cb&&T.cb(k),O()}):(this.log("messageId: %d has already used. The message is skipped and removed.",M.messageId),O())};this.log("connect :: sending queued packets"),O()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(x,E){E()}handleMessage(x,E){E()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let x=new o.Writable,E=s.default.parser(this.options),A=null,O=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),E.on("packet",N=>{this.log("parser :: on packet push to packets array."),O.push(N)});let T=()=>{this.log("work :: getting next packet in queue");let N=O.shift();if(N)this.log("work :: packet pulled from queue"),(0,h.default)(this,N,M);else{this.log("work :: no packets in queue");let R=A;A=null,this.log("work :: done flag is %s",!!R),R&&R()}},M=()=>{if(O.length)(0,p.nextTick)(T);else{let N=A;A=null,N()}};x._write=(N,R,$)=>{A=$,this.log("writable stream :: parsing buffer"),E.parse(N),T()};let C=N=>{this.log("streamErrorHandler :: error",N.message),N.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",N)):this.noop(N)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(x),this.stream.on("error",C),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let k={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(k.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(k.properties||(k.properties={}),this.topicAliasRecv&&(k.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(k),E.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let N={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(N)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(x,E,A,O){this.log("publish :: message `%s` to topic `%s`",E,x);let{options:T}=this;typeof A=="function"&&(O=A,A=null),A=A||{},A={qos:0,retain:!1,dup:!1,...A};let{qos:M,retain:C,dup:k,properties:N,cbStorePut:R}=A;if(this._checkDisconnecting(O))return this;let $=()=>{let G=0;if((M===1||M===2)&&(G=this._nextId(),G===null))return this.log("No messageId left"),!1;let H={cmd:"publish",topic:x,payload:E,qos:M,retain:C,messageId:G,dup:k};switch(T.protocolVersion===5&&(H.properties=N),this.log("publish :: qos",M),M){case 1:case 2:this.outgoing[H.messageId]={volatile:!1,cb:O||this.noop},this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,void 0,R);break;default:this.log("MqttClient:publish: packet cmd: %s",H.cmd),this._sendPacket(H,O,R);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!$())&&this._storeProcessingQueue.push({invoke:$,cbStorePut:A.cbStorePut,callback:O}),this}publishAsync(x,E,A){return new Promise((O,T)=>{this.publish(x,E,A,(M,C)=>{M?T(M):O(C)})})}subscribe(x,E,A){let O=this.options.protocolVersion;typeof E=="function"&&(A=E),A=A||this.noop;let T=!1,M=[];typeof x=="string"?(x=[x],M=x):Array.isArray(x)?M=x:typeof x=="object"&&(T=x.resubscribe,delete x.resubscribe,M=Object.keys(x));let C=u.validateTopics(M);if(C!==null)return y(A,new Error(`Invalid topic ${C}`)),this;if(this._checkDisconnecting(A))return this.log("subscribe: discconecting true"),this;let k={qos:0};O===5&&(k.nl=!1,k.rap=!1,k.rh=0),E={...k,...E};let{properties:N}=E,R=[],$=(se,V)=>{if(V=V||E,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,se)||this._resubscribeTopics[se].qos<V.qos||T){let te={topic:se,qos:V.qos};O===5&&(te.nl=V.nl,te.rap=V.rap,te.rh=V.rh,te.properties=N),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",te.topic,te.qos),R.push(te)}};if(Array.isArray(x)?x.forEach(se=>{this.log("subscribe: array topic %s",se),$(se)}):Object.keys(x).forEach(se=>{this.log("subscribe: object topic %s, %o",se,x[se]),$(se,x[se])}),!R.length)return A(null,[]),this;let G=(se,V)=>{let te={cmd:"subscribe",subscriptions:se,messageId:V};if(N&&(te.properties=N),this.options.resubscribe){this.log("subscribe :: resubscribe true");let ne=[];se.forEach(U=>{if(this.options.reconnectPeriod>0){let q={qos:U.qos};O===5&&(q.nl=U.nl||!1,q.rap=U.rap||!1,q.rh=U.rh||0,q.properties=U.properties),this._resubscribeTopics[U.topic]=q,ne.push(U.topic)}}),this.messageIdToTopic[te.messageId]=ne}let B=new Promise((ne,U)=>{this.outgoing[te.messageId]={volatile:!0,cb(q,re){if(!q){let{granted:F}=re;for(let D=0;D<F.length;D+=1)se[D].qos=F[D]}q?U(new p.ErrorWithSubackPacket(q.message,re)):ne(re)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(te),B},H=()=>{let se=this.options.subscribeBatchSize??R.length,V=[];for(let te=0;te<R.length;te+=se){let B=R.slice(te,te+se),ne=this._nextId();if(ne===null)return this.log("No messageId left"),!1;V.push(G(B,ne))}return Promise.all(V).then(te=>{A(null,R,te.at(-1))}).catch(te=>{A(te,R,te.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!H())&&this._storeProcessingQueue.push({invoke:H,callback:A}),this}subscribeAsync(x,E){return new Promise((A,O)=>{this.subscribe(x,E,(T,M)=>{T?O(T):A(M)})})}unsubscribe(x,E,A){typeof x=="string"&&(x=[x]),typeof E=="function"&&(A=E),A=A||this.noop;let O=u.validateTopics(x);if(O!==null)return y(A,new Error(`Invalid topic ${O}`)),this;if(this._checkDisconnecting(A))return this;let T=()=>{let M=this._nextId();if(M===null)return this.log("No messageId left"),!1;let C={cmd:"unsubscribe",messageId:M,unsubscriptions:[]};return typeof x=="string"?C.unsubscriptions=[x]:Array.isArray(x)&&(C.unsubscriptions=x),this.options.resubscribe&&C.unsubscriptions.forEach(k=>{delete this._resubscribeTopics[k]}),typeof E=="object"&&E.properties&&(C.properties=E.properties),this.outgoing[C.messageId]={volatile:!0,cb:A},this.log("unsubscribe: call _sendPacket"),this._sendPacket(C),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!T())&&this._storeProcessingQueue.push({invoke:T,callback:A}),this}unsubscribeAsync(x,E){return new Promise((A,O)=>{this.unsubscribe(x,E,(T,M)=>{T?O(T):A(M)})})}end(x,E,A){this.log("end :: (%s)",this.options.clientId),(x==null||typeof x!="boolean")&&(A=A||E,E=x,x=!1),typeof E!="object"&&(A=A||E,E=null),this.log("end :: cb? %s",!!A),(!A||typeof A!="function")&&(A=this.noop);let O=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(M=>{this.outgoingStore.close(C=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),A){let k=M||C;this.log("end :: closeStores: invoking callback with args"),A(k)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},T=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,x),this._cleanUp(x,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,p.nextTick)(O)},E)};return this.disconnecting?(A(),this):(this._clearReconnect(),this.disconnecting=!0,!x&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,T,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),T()),this)}endAsync(x,E){return new Promise((A,O)=>{this.end(x,E,T=>{T?O(T):A()})})}removeOutgoingMessage(x){if(this.outgoing[x]){let{cb:E}=this.outgoing[x];this._removeOutgoingAndStoreMessage(x,()=>{E(new Error("Message removed"))})}return this}reconnect(x){this.log("client reconnect");let E=()=>{x?(this.options.incomingStore=x.incomingStore,this.options.outgoingStore=x.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=E:E(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(x=>{this.outgoing[x].volatile&&typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(x=>{typeof this.outgoing[x].cb=="function"&&(this.outgoing[x].cb(new Error("Connection closed")),delete this.outgoing[x])}))}_removeTopicAliasAndRecoverTopicName(x){let E;x.properties&&(E=x.properties.topicAlias);let A=x.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",E,A),A.length===0){if(typeof E>"u")return new Error("Unregistered Topic Alias");if(A=this.topicAliasSend.getTopicByAlias(E),typeof A>"u")return new Error("Unregistered Topic Alias");x.topic=A}E&&delete x.properties.topicAlias}_checkDisconnecting(x){return this.disconnecting&&(x&&x!==this.noop?x(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(x,E,A={}){if(E&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",E)),this.log("_cleanUp :: forced? %s",x),x)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let O={cmd:"disconnect",...A};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(O,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),y(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),E&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",E),E())}_storeAndSend(x,E,A){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",x.cmd);let O=x,T;if(O.cmd==="publish"&&(O=(0,a.default)(x),T=this._removeTopicAliasAndRecoverTopicName(O),T))return E&&E(T);this.outgoingStore.put(O,M=>{if(M)return E&&E(M);A(),this._writePacket(x,E)})}_applyTopicAlias(x){if(this.options.protocolVersion===5&&x.cmd==="publish"){let E;x.properties&&(E=x.properties.topicAlias);let A=x.topic.toString();if(this.topicAliasSend)if(E){if(A.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",A,E),!this.topicAliasSend.put(A,E)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",A,E),new Error("Sending Topic Alias out of range")}else A.length!==0&&(this.options.autoAssignTopicAlias?(E=this.topicAliasSend.getAliasByTopic(A),E?(x.topic="",x.properties={...x.properties,topicAlias:E},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",A,E)):(E=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(A,E),x.properties={...x.properties,topicAlias:E},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",A,E))):this.options.autoUseTopicAlias&&(E=this.topicAliasSend.getAliasByTopic(A),E&&(x.topic="",x.properties={...x.properties,topicAlias:E},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",A,E))));else if(E)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",A,E),new Error("Sending Topic Alias out of range")}}_noop(x){this.log("noop ::",x)}_writePacket(x,E){this.log("_writePacket :: packet: %O",x),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",x),this.log("_writePacket :: writing to stream");let A=s.default.writeToStream(x,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",A),!A&&E&&E!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",E)):E&&(this.log("_writePacket :: invoking cb"),E())}_sendPacket(x,E,A,O){this.log("_sendPacket :: (%s) :: start",this.options.clientId),A=A||this.noop,E=E||this.noop;let T=this._applyTopicAlias(x);if(T){E(T);return}if(!this.connected){if(x.cmd==="auth"){this._writePacket(x,E);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(x,E,A);return}if(O){this._writePacket(x,E);return}switch(x.cmd){case"publish":break;case"pubrel":this._storeAndSend(x,E,A);return;default:this._writePacket(x,E);return}switch(x.qos){case 2:case 1:this._storeAndSend(x,E,A);break;case 0:default:this._writePacket(x,E);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(x,E,A){this.log("_storePacket :: packet: %o",x),this.log("_storePacket :: cb? %s",!!E),A=A||this.noop;let O=x;if(O.cmd==="publish"){O=(0,a.default)(x);let M=this._removeTopicAliasAndRecoverTopicName(O);if(M)return E&&E(M)}let T=O.qos||0;T===0&&this.queueQoSZero||O.cmd!=="publish"?this.queue.push({packet:O,cb:E}):T>0?(E=this.outgoing[O.messageId]?this.outgoing[O.messageId].cb:null,this.outgoingStore.put(O,M=>{if(M)return E&&E(M);A()})):E&&E(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new m.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(x=!1){this.keepaliveManager&&this.options.keepalive&&(x||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let x=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&x.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let E=0;E<x.length;E++){let A={};A[x[E]]=this._resubscribeTopics[x[E]],A.resubscribe=!0,this.subscribe(A,{properties:A[x[E]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(x){if(this.disconnected){this.emit("connect",x);return}this.connackPacket=x,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let E=()=>{let A=this.outgoingStore.createStream(),O=()=>{A.destroy(),A=null,this._flushStoreProcessingQueue(),T()},T=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",O),A.on("error",C=>{T(),this._flushStoreProcessingQueue(),this.removeListener("close",O),this.emit("error",C)});let M=()=>{if(!A)return;let C=A.read(1),k;if(!C){A.once("readable",M);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[C.messageId]){M();return}!this.disconnecting&&!this.reconnectTimer?(k=this.outgoing[C.messageId]?this.outgoing[C.messageId].cb:null,this.outgoing[C.messageId]={volatile:!1,cb(N,R){k&&k(N,R),M()}},this._packetIdsDuringStoreProcessing[C.messageId]=!0,this.messageIdProvider.register(C.messageId)?this._sendPacket(C,void 0,void 0,!0):this.log("messageId: %d has already used.",C.messageId)):A.destroy&&A.destroy()};A.on("end",()=>{let C=!0;for(let k in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[k]){C=!1;break}this.removeListener("close",O),C?(T(),this._invokeAllStoreProcessingQueue(),this.emit("connect",x)):E()}),M()};E()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let x=this._storeProcessingQueue[0];if(x&&x.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let x of this._storeProcessingQueue)x.cbStorePut&&x.cbStorePut(new Error("Connection closed")),x.callback&&x.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(x,E){delete this.outgoing[x],this.outgoingStore.del({messageId:x},(A,O)=>{E(A,O),this.messageIdProvider.deallocate(x),this._invokeStoreProcessingQueue()})}};n.default=_}),UU=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=DA(),t=class{numberAllocator;lastId;constructor(){this.numberAllocator=new e.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(r){return this.numberAllocator.use(r)}deallocate(r){this.numberAllocator.free(r)}clear(){this.numberAllocator.clear()}};n.default=t});function zU(){if(Fg)return Yo;Fg=!0;let n=2147483647,e=36,t=1,r=26,i=38,s=700,o=72,a=128,l="-",u=/^xn--/,c=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=e-t,p=Math.floor,g=String.fromCharCode;function m(T){throw new RangeError(f[T])}function v(T,M){let C=[],k=T.length;for(;k--;)C[k]=M(T[k]);return C}function y(T,M){let C=T.split("@"),k="";C.length>1&&(k=C[0]+"@",T=C[1]),T=T.replace(h,".");let N=T.split("."),R=v(N,M).join(".");return k+R}function b(T){let M=[],C=0,k=T.length;for(;C<k;){let N=T.charCodeAt(C++);if(N>=55296&&N<=56319&&C<k){let R=T.charCodeAt(C++);(R&64512)==56320?M.push(((N&1023)<<10)+(R&1023)+65536):(M.push(N),C--)}else M.push(N)}return M}let _=T=>String.fromCodePoint(...T),w=function(T){return T>=48&&T<58?26+(T-48):T>=65&&T<91?T-65:T>=97&&T<123?T-97:e},x=function(T,M){return T+22+75*(T<26)-((M!=0)<<5)},E=function(T,M,C){let k=0;for(T=C?p(T/s):T>>1,T+=p(T/M);T>d*r>>1;k+=e)T=p(T/d);return p(k+(d+1)*T/(T+i))},A=function(T){let M=[],C=T.length,k=0,N=a,R=o,$=T.lastIndexOf(l);$<0&&($=0);for(let G=0;G<$;++G)T.charCodeAt(G)>=128&&m("not-basic"),M.push(T.charCodeAt(G));for(let G=$>0?$+1:0;G<C;){let H=k;for(let V=1,te=e;;te+=e){G>=C&&m("invalid-input");let B=w(T.charCodeAt(G++));B>=e&&m("invalid-input"),B>p((n-k)/V)&&m("overflow"),k+=B*V;let ne=te<=R?t:te>=R+r?r:te-R;if(B<ne)break;let U=e-ne;V>p(n/U)&&m("overflow"),V*=U}let se=M.length+1;R=E(k-H,se,H==0),p(k/se)>n-N&&m("overflow"),N+=p(k/se),k%=se,M.splice(k++,0,N)}return String.fromCodePoint(...M)},O=function(T){let M=[];T=b(T);let C=T.length,k=a,N=0,R=o;for(let H of T)H<128&&M.push(g(H));let $=M.length,G=$;for($&&M.push(l);G<C;){let H=n;for(let V of T)V>=k&&V<H&&(H=V);let se=G+1;H-k>p((n-N)/se)&&m("overflow"),N+=(H-k)*se,k=H;for(let V of T)if(V<k&&++N>n&&m("overflow"),V===k){let te=N;for(let B=e;;B+=e){let ne=B<=R?t:B>=R+r?r:B-R;if(te<ne)break;let U=te-ne,q=e-ne;M.push(g(x(ne+U%q,0))),te=p(U/q)}M.push(g(x(te,0))),R=E(N,se,G===$),N=0,++G}++N,++k}return M.join("")};return Yo={version:"2.3.1",ucs2:{decode:b,encode:_},decode:A,encode:O,toASCII:function(T){return y(T,function(M){return c.test(M)?"xn--"+O(M):M})},toUnicode:function(T){return y(T,function(M){return u.test(M)?A(M.slice(4).toLowerCase()):M})}},Yo}var Yo,Fg,nn,VU=Mt(()=>{pe(),me(),ge(),Yo={},Fg=!1,nn=zU(),nn.decode,nn.encode,nn.toASCII,nn.toUnicode,nn.ucs2,nn.version});function WU(){return Vg||(Vg=!0,zg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),t=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;var r=42;n[e]=r;for(e in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var i=Object.getOwnPropertySymbols(n);if(i.length!==1||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==r||s.enumerable!==!0)return!1}return!0}),zg}function GU(){return Gg||(Gg=!0,Wg=Error),Wg}function HU(){return Kg||(Kg=!0,Hg=EvalError),Hg}function KU(){return Jg||(Jg=!0,Yg=RangeError),Yg}function YU(){return Qg||(Qg=!0,Xg=ReferenceError),Xg}function GA(){return em||(em=!0,Zg=SyntaxError),Zg}function vs(){return rm||(rm=!0,tm=TypeError),tm}function JU(){return im||(im=!0,nm=URIError),nm}function XU(){if(sm)return Jo;sm=!0;var n=typeof Symbol<"u"&&Symbol,e=WU();return Jo=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Jo}function QU(){if(om)return Xo;om=!0;var n={__proto__:null,foo:{}},e=Object;return Xo=function(){return{__proto__:n}.foo===n.foo&&!(n instanceof e)},Xo}function ZU(){if(am)return Qo;am=!0;var n="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,r="[object Function]",i=function(a,l){for(var u=[],c=0;c<a.length;c+=1)u[c]=a[c];for(var h=0;h<l.length;h+=1)u[h+a.length]=l[h];return u},s=function(a,l){for(var u=[],c=l,h=0;c<a.length;c+=1,h+=1)u[h]=a[c];return u},o=function(a,l){for(var u="",c=0;c<a.length;c+=1)u+=a[c],c+1<a.length&&(u+=l);return u};return Qo=function(a){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(n+l);for(var u=s(arguments,1),c,h=function(){if(this instanceof c){var m=l.apply(this,i(u,arguments));return Object(m)===m?m:this}return l.apply(a,i(u,arguments))},f=t(0,l.length-u.length),d=[],p=0;p<f;p++)d[p]="$"+p;if(c=Function("binder","return function ("+o(d,",")+"){ return binder.apply(this,arguments); }")(h),l.prototype){var g=function(){};g.prototype=l.prototype,c.prototype=new g,g.prototype=null}return c},Qo}function $g(){if(lm)return Zo;lm=!0;var n=ZU();return Zo=Function.prototype.bind||n,Zo}function e6(){if(um)return ea;um=!0;var n=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=$g();return ea=t.call(n,e),ea}function Ei(){if(cm)return ta;cm=!0;var n,e=GU(),t=HU(),r=KU(),i=YU(),s=GA(),o=vs(),a=JU(),l=Function,u=function(G){try{return l('"use strict"; return ('+G+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new o},f=c?(function(){try{return arguments.callee,h}catch{try{return c(arguments,"callee").get}catch{return h}}})():h,d=XU()(),p=QU()(),g=Object.getPrototypeOf||(p?function(G){return G.__proto__}:null),m={},v=typeof Uint8Array>"u"||!g?n:g(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":d&&g?g([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":m,"%AsyncGenerator%":m,"%AsyncGeneratorFunction%":m,"%AsyncIteratorPrototype%":m,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":m,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d&&g?g(g([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!d||!g?n:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!d||!g?n:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d&&g?g(""[Symbol.iterator]()):n,"%Symbol%":d?Symbol:n,"%SyntaxError%":s,"%ThrowTypeError%":f,"%TypedArray%":v,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet};if(g)try{null.error}catch(G){var b=g(g(G));y["%Error.prototype%"]=b}var _=function G(H){var se;if(H==="%AsyncFunction%")se=u("async function () {}");else if(H==="%GeneratorFunction%")se=u("function* () {}");else if(H==="%AsyncGeneratorFunction%")se=u("async function* () {}");else if(H==="%AsyncGenerator%"){var V=G("%AsyncGeneratorFunction%");V&&(se=V.prototype)}else if(H==="%AsyncIteratorPrototype%"){var te=G("%AsyncGenerator%");te&&g&&(se=g(te.prototype))}return y[H]=se,se},w={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},x=$g(),E=e6(),A=x.call(Function.call,Array.prototype.concat),O=x.call(Function.apply,Array.prototype.splice),T=x.call(Function.call,String.prototype.replace),M=x.call(Function.call,String.prototype.slice),C=x.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,R=function(G){var H=M(G,0,1),se=M(G,-1);if(H==="%"&&se!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(se==="%"&&H!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var V=[];return T(G,k,function(te,B,ne,U){V[V.length]=ne?T(U,N,"$1"):B||te}),V},$=function(G,H){var se=G,V;if(E(w,se)&&(V=w[se],se="%"+V[0]+"%"),E(y,se)){var te=y[se];if(te===m&&(te=_(se)),typeof te>"u"&&!H)throw new o("intrinsic "+G+" exists, but is not available. Please file an issue!");return{alias:V,name:se,value:te}}throw new s("intrinsic "+G+" does not exist!")};return ta=function(G,H){if(typeof G!="string"||G.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new o('"allowMissing" argument must be a boolean');if(C(/^%?[^%]*%?$/,G)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var se=R(G),V=se.length>0?se[0]:"",te=$("%"+V+"%",H),B=te.name,ne=te.value,U=!1,q=te.alias;q&&(V=q[0],O(se,A([0,1],q)));for(var re=1,F=!0;re<se.length;re+=1){var D=se[re],ae=M(D,0,1),Y=M(D,-1);if((ae==='"'||ae==="'"||ae==="`"||Y==='"'||Y==="'"||Y==="`")&&ae!==Y)throw new s("property names with quotes must have matching quotes");if((D==="constructor"||!F)&&(U=!0),V+="."+D,B="%"+V+"%",E(y,B))ne=y[B];else if(ne!=null){if(!(D in ne)){if(!H)throw new o("base intrinsic for "+G+" exists, but the property is not available.");return}if(c&&re+1>=se.length){var Q=c(ne,D);F=!!Q,F&&"get"in Q&&!("originalValue"in Q.get)?ne=Q.get:ne=ne[D]}else F=E(ne,D),ne=ne[D];F&&!U&&(y[B]=ne)}}return ne},ta}function Ug(){if(hm)return ra;hm=!0;var n=Ei(),e=n("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ra=e,ra}function HA(){if(fm)return na;fm=!0;var n=Ei(),e=n("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return na=e,na}function t6(){if(dm)return ia;dm=!0;var n=Ug(),e=GA(),t=vs(),r=HA();return ia=function(i,s,o){if(!i||typeof i!="object"&&typeof i!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!r&&r(i,s);if(n)n(i,s,{configurable:u===null&&h?h.configurable:!u,enumerable:a===null&&h?h.enumerable:!a,value:o,writable:l===null&&h?h.writable:!l});else if(c||!a&&!l&&!u)i[s]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ia}function r6(){if(pm)return sa;pm=!0;var n=Ug(),e=function(){return!!n};return e.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},sa=e,sa}function n6(){if(gm)return oa;gm=!0;var n=Ei(),e=t6(),t=r6()(),r=HA(),i=vs(),s=n("%Math.floor%");return oa=function(o,a){if(typeof o!="function")throw new i("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||s(a)!==a)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,c=!0;if("length"in o&&r){var h=r(o,"length");h&&!h.configurable&&(u=!1),h&&!h.writable&&(c=!1)}return(u||c||!l)&&(t?e(o,"length",a,!0,!0):e(o,"length",a)),o},oa}function i6(){if(mm)return Si;mm=!0;var n=$g(),e=Ei(),t=n6(),r=vs(),i=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),o=e("%Reflect.apply%",!0)||n.call(s,i),a=Ug(),l=e("%Math.max%");Si=function(c){if(typeof c!="function")throw new r("a function is required");var h=o(n,s,arguments);return t(h,1+l(0,c.length-(arguments.length-1)),!0)};var u=function(){return o(n,i,arguments)};return a?a(Si,"apply",{value:u}):Si.apply=u,Si}function s6(){if(ym)return aa;ym=!0;var n=Ei(),e=i6(),t=e(n("String.prototype.indexOf"));return aa=function(r,i){var s=n(r,!!i);return typeof s=="function"&&t(r,".prototype.")>-1?e(s):s},aa}var zg,Vg,Wg,Gg,Hg,Kg,Yg,Jg,Xg,Qg,Zg,em,tm,rm,nm,im,Jo,sm,Xo,om,Qo,am,Zo,lm,ea,um,ta,cm,ra,hm,na,fm,ia,dm,sa,pm,oa,gm,Si,mm,aa,ym,o6=Mt(()=>{pe(),me(),ge(),zg={},Vg=!1,Wg={},Gg=!1,Hg={},Kg=!1,Yg={},Jg=!1,Xg={},Qg=!1,Zg={},em=!1,tm={},rm=!1,nm={},im=!1,Jo={},sm=!1,Xo={},om=!1,Qo={},am=!1,Zo={},lm=!1,ea={},um=!1,ta={},cm=!1,ra={},hm=!1,na={},fm=!1,ia={},dm=!1,sa={},pm=!1,oa={},gm=!1,Si={},mm=!1,aa={},ym=!1});function bm(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function a6(){!Tn||!Mn||(Tn=!1,Mn.length?ur=Mn.concat(ur):ws=-1,ur.length&&KA())}function KA(){if(!Tn){var n=setTimeout(a6,0);Tn=!0;for(var e=ur.length;e;){for(Mn=ur,ur=[];++ws<e;)Mn&&Mn[ws].run();ws=-1,e=ur.length}Mn=null,Tn=!1,clearTimeout(n)}}function l6(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ur.push(new YA(n,e)),ur.length===1&&!Tn&&setTimeout(KA,0)}function YA(n,e){this.fun=n,this.array=e}function St(){}function u6(n){bm("_linkedBinding")}function c6(n){bm("dlopen")}function h6(){return[]}function f6(){return[]}function d6(n,e){if(!n)throw new Error(e||"assertion error")}function p6(){return!1}function g6(){return Dr.now()/1e3}function vm(n){var e=Math.floor((Date.now()-Dr.now())*.001),t=Dr.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=ua)),[r,i]}function sn(){return _m}function m6(n){return[]}var ur,Tn,Mn,ws,JA,XA,QA,ZA,eP,tP,rP,nP,iP,sP,oP,aP,lP,uP,cP,hP,fP,dP,pP,gP,mP,la,yP,bP,vP,wP,_P,xP,EP,SP,AP,PP,OP,CP,TP,MP,IP,RP,kP,NP,jP,LP,DP,BP,qP,FP,$P,Dr,wm,ua,UP,zP,VP,WP,GP,HP,KP,YP,JP,XP,QP,_m,ZP=Mt(()=>{pe(),me(),ge(),ur=[],Tn=!1,ws=-1,YA.prototype.run=function(){this.fun.apply(null,this.array)},JA="browser",XA="x64",QA="browser",ZA={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},eP=["/usr/bin/node"],tP=[],rP="v16.8.0",nP={},iP=function(n,e){console.warn((e?e+": ":"")+n)},sP=function(n){bm("binding")},oP=function(n){return 0},aP=function(){return"/"},lP=function(n){},uP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},cP=St,hP=[],fP={},dP=!1,pP={},gP=St,mP=St,la=function(){return{}},yP=la,bP=la,vP=St,wP=St,_P=St,xP={},EP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},SP=St,AP=St,PP=St,OP=St,CP=St,TP=St,MP=St,IP=void 0,RP=void 0,kP=void 0,NP=St,jP=2,LP=1,DP="/bin/usr/node",BP=9229,qP="node",FP=[],$P=St,Dr={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Dr.now===void 0&&(wm=Date.now(),Dr.timing&&Dr.timing.navigationStart&&(wm=Dr.timing.navigationStart),Dr.now=()=>Date.now()-wm),ua=1e9,vm.bigint=function(n){var e=vm(n);return typeof BigInt>"u"?e[0]*ua+e[1]:BigInt(e[0]*ua)+BigInt(e[1])},UP=10,zP={},VP=0,WP=sn,GP=sn,HP=sn,KP=sn,YP=sn,JP=St,XP=sn,QP=sn,_m={version:rP,versions:nP,arch:XA,platform:QA,release:uP,_rawDebug:cP,moduleLoadList:hP,binding:sP,_linkedBinding:u6,_events:zP,_eventsCount:VP,_maxListeners:UP,on:sn,addListener:WP,once:GP,off:HP,removeListener:KP,removeAllListeners:YP,emit:JP,prependListener:XP,prependOnceListener:QP,listeners:m6,domain:fP,_exiting:dP,config:pP,dlopen:c6,uptime:g6,_getActiveRequests:h6,_getActiveHandles:f6,reallyExit:gP,_kill:mP,cpuUsage:la,resourceUsage:yP,memoryUsage:bP,kill:vP,exit:wP,openStdin:_P,allowedNodeEnvironmentFlags:xP,assert:d6,features:EP,_fatalExceptions:SP,setUncaughtExceptionCaptureCallback:AP,hasUncaughtExceptionCaptureCallback:p6,emitWarning:iP,nextTick:l6,_tickCallback:PP,_debugProcess:OP,_debugEnd:CP,_startProfilerIdleNotifier:TP,_stopProfilerIdleNotifier:MP,stdout:IP,stdin:kP,stderr:RP,abort:NP,umask:oP,chdir:lP,cwd:aP,env:ZA,title:JA,argv:eP,execArgv:tP,pid:jP,ppid:LP,execPath:DP,debugPort:BP,hrtime:vm,argv0:qP,_preload_modules:FP,setSourceMapsEnabled:$P}});function y6(){if(xm)return ca;xm=!0;var n=_m;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,o){for(var a="",l=0,u=-1,c=0,h,f=0;f<=s.length;++f){if(f<s.length)h=s.charCodeAt(f);else{if(h===47)break;h=47}if(h===47){if(!(u===f-1||c===1))if(u!==f-1&&c===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var d=a.lastIndexOf("/");if(d!==a.length-1){d===-1?(a="",l=0):(a=a.slice(0,d),l=a.length-1-a.lastIndexOf("/")),u=f,c=0;continue}}else if(a.length===2||a.length===1){a="",l=0,u=f,c=0;continue}}o&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+s.slice(u+1,f):a=s.slice(u+1,f),l=f-u-1;u=f,c=0}else h===46&&c!==-1?++c:c=-1}return a}function r(s,o){var a=o.dir||o.root,l=o.base||(o.name||"")+(o.ext||"");return a?a===o.root?a+l:a+s+l:l}var i={resolve:function(){for(var s="",o=!1,a,l=arguments.length-1;l>=-1&&!o;l--){var u;l>=0?u=arguments[l]:(a===void 0&&(a=n.cwd()),u=a),e(u),u.length!==0&&(s=u+"/"+s,o=u.charCodeAt(0)===47)}return s=t(s,!o),o?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var o=s.charCodeAt(0)===47,a=s.charCodeAt(s.length-1)===47;return s=t(s,!o),s.length===0&&!o&&(s="."),s.length>0&&a&&(s+="/"),o?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,o=0;o<arguments.length;++o){var a=arguments[o];e(a),a.length>0&&(s===void 0?s=a:s+="/"+a)}return s===void 0?".":i.normalize(s)},relative:function(s,o){if(e(s),e(o),s===o||(s=i.resolve(s),o=i.resolve(o),s===o))return"";for(var a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var l=s.length,u=l-a,c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var h=o.length,f=h-c,d=u<f?u:f,p=-1,g=0;g<=d;++g){if(g===d){if(f>d){if(o.charCodeAt(c+g)===47)return o.slice(c+g+1);if(g===0)return o.slice(c+g)}else u>d&&(s.charCodeAt(a+g)===47?p=g:g===0&&(p=0));break}var m=s.charCodeAt(a+g),v=o.charCodeAt(c+g);if(m!==v)break;m===47&&(p=g)}var y="";for(g=a+p+1;g<=l;++g)(g===l||s.charCodeAt(g)===47)&&(y.length===0?y+="..":y+="/..");return y.length>0?y+o.slice(c+p):(c+=p,o.charCodeAt(c)===47&&++c,o.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var o=s.charCodeAt(0),a=o===47,l=-1,u=!0,c=s.length-1;c>=1;--c)if(o=s.charCodeAt(c),o===47){if(!u){l=c;break}}else u=!1;return l===-1?a?"/":".":a&&l===1?"//":s.slice(0,l)},basename:function(s,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');e(s);var a=0,l=-1,u=!0,c;if(o!==void 0&&o.length>0&&o.length<=s.length){if(o.length===s.length&&o===s)return"";var h=o.length-1,f=-1;for(c=s.length-1;c>=0;--c){var d=s.charCodeAt(c);if(d===47){if(!u){a=c+1;break}}else f===-1&&(u=!1,f=c+1),h>=0&&(d===o.charCodeAt(h)?--h===-1&&(l=c):(h=-1,l=f))}return a===l?l=f:l===-1&&(l=s.length),s.slice(a,l)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!u){a=c+1;break}}else l===-1&&(u=!1,l=c+1);return l===-1?"":s.slice(a,l)}},extname:function(s){e(s);for(var o=-1,a=0,l=-1,u=!0,c=0,h=s.length-1;h>=0;--h){var f=s.charCodeAt(h);if(f===47){if(!u){a=h+1;break}continue}l===-1&&(u=!1,l=h+1),f===46?o===-1?o=h:c!==1&&(c=1):o!==-1&&(c=-1)}return o===-1||l===-1||c===0||c===1&&o===l-1&&o===a+1?"":s.slice(o,l)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){e(s);var o={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return o;var a=s.charCodeAt(0),l=a===47,u;l?(o.root="/",u=1):u=0;for(var c=-1,h=0,f=-1,d=!0,p=s.length-1,g=0;p>=u;--p){if(a=s.charCodeAt(p),a===47){if(!d){h=p+1;break}continue}f===-1&&(d=!1,f=p+1),a===46?c===-1?c=p:g!==1&&(g=1):c!==-1&&(g=-1)}return c===-1||f===-1||g===0||g===1&&c===f-1&&c===h+1?f!==-1&&(h===0&&l?o.base=o.name=s.slice(1,f):o.base=o.name=s.slice(h,f)):(h===0&&l?(o.name=s.slice(1,c),o.base=s.slice(1,f)):(o.name=s.slice(h,c),o.base=s.slice(h,f)),o.ext=s.slice(c,f)),h>0?o.dir=s.slice(0,h-1):l&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,ca=i,ca}var ca,xm,Em,b6=Mt(()=>{pe(),me(),ge(),ZP(),ca={},xm=!1,Em=y6()}),eO={};bi(eO,{URL:()=>hO,Url:()=>oO,default:()=>At,fileURLToPath:()=>rO,format:()=>aO,parse:()=>cO,pathToFileURL:()=>nO,resolve:()=>lO,resolveObject:()=>uO});function v6(){if(Am)return ha;Am=!0;var n=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=n&&e&&typeof e.get=="function"?e.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&s&&typeof s.get=="function"?s.get:null,a=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,h=c?WeakSet.prototype.has:null,f=typeof WeakRef=="function"&&WeakRef.prototype,d=f?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,_=String.prototype.toUpperCase,w=String.prototype.toLowerCase,x=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,T=Math.floor,M=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,N=typeof Symbol=="function"&&typeof Symbol.iterator=="object",R=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Z){return Z.__proto__}:null);function H(Z,le){if(Z===1/0||Z===-1/0||Z!==Z||Z&&Z>-1e3&&Z<1e3||x.call(/e/,le))return le;var Ce=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Z=="number"){var Me=Z<0?-T(-Z):T(Z);if(Me!==Z){var je=String(Me),Le=y.call(le,je.length+1);return b.call(je,Ce,"$&_")+"."+b.call(b.call(Le,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(le,Ce,"$&_")}var se=iO,V=se.custom,te=Q(V)?V:null;ha=function Z(le,Ce,Me,je){var Le=Ce||{};if(ue(Le,"quoteStyle")&&Le.quoteStyle!=="single"&&Le.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ue(Le,"maxStringLength")&&(typeof Le.maxStringLength=="number"?Le.maxStringLength<0&&Le.maxStringLength!==1/0:Le.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var cr=ue(Le,"customInspect")?Le.customInspect:!0;if(typeof cr!="boolean"&&cr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ue(Le,"indent")&&Le.indent!==null&&Le.indent!==" "&&!(parseInt(Le.indent,10)===Le.indent&&Le.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ue(Le,"numericSeparator")&&typeof Le.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var hr=Le.numericSeparator;if(typeof le>"u")return"undefined";if(le===null)return"null";if(typeof le=="boolean")return le?"true":"false";if(typeof le=="string")return ce(le,Le);if(typeof le=="number"){if(le===0)return 1/0/le>0?"0":"-0";var Pt=String(le);return hr?H(le,Pt):Pt}if(typeof le=="bigint"){var fr=String(le)+"n";return hr?H(le,fr):fr}var Ai=typeof Le.depth>"u"?5:Le.depth;if(typeof Me>"u"&&(Me=0),Me>=Ai&&Ai>0&&typeof le=="object")return U(le)?"[Array]":"[Object]";var dr=oe(Le,Me);if(typeof je>"u")je=[];else if(ee(je,le)>=0)return"[Circular]";function kt(pr,an,Rn){if(an&&(je=O.call(je),je.push(an)),Rn){var gr={depth:Le.depth};return ue(Le,"quoteStyle")&&(gr.quoteStyle=Le.quoteStyle),Z(pr,gr,Me+1,je)}return Z(pr,Le,Me+1,je)}if(typeof le=="function"&&!re(le)){var _a=J(le),Pi=xe(le,kt);return"[Function"+(_a?": "+_a:" (anonymous)")+"]"+(Pi.length>0?" { "+A.call(Pi,", ")+" }":"")}if(Q(le)){var _s=N?b.call(String(le),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(le);return typeof le=="object"&&!N?S(_s):_s}if(_e(le)){for(var j="<"+w.call(String(le.nodeName)),z=le.attributes||[],Ee=0;Ee<z.length;Ee++)j+=" "+z[Ee].name+"="+B(ne(z[Ee].value),"double",Le);return j+=">",le.childNodes&&le.childNodes.length&&(j+="..."),j+="</"+w.call(String(le.nodeName))+">",j}if(U(le)){if(le.length===0)return"[]";var Ae=xe(le,kt);return dr&&!K(Ae)?"["+de(Ae,dr)+"]":"[ "+A.call(Ae,", ")+" ]"}if(F(le)){var Oe=xe(le,kt);return!("cause"in Error.prototype)&&"cause"in le&&!$.call(le,"cause")?"{ ["+String(le)+"] "+A.call(E.call("[cause]: "+kt(le.cause),Oe),", ")+" }":Oe.length===0?"["+String(le)+"]":"{ ["+String(le)+"] "+A.call(Oe,", ")+" }"}if(typeof le=="object"&&cr){if(te&&typeof le[te]=="function"&&se)return se(le,{depth:Ai-Me});if(cr!=="symbol"&&typeof le.inspect=="function")return le.inspect()}if(he(le)){var ht=[];return r&&r.call(le,function(pr,an){ht.push(kt(an,le,!0)+" => "+kt(pr,le))}),I("Map",t.call(le),ht,dr)}if(X(le)){var Ct=[];return a&&a.call(le,function(pr){Ct.push(kt(pr,le))}),I("Set",o.call(le),Ct,dr)}if(fe(le))return P("WeakMap");if(be(le))return P("WeakSet");if(we(le))return P("WeakRef");if(ae(le))return S(kt(Number(le)));if(ie(le))return S(kt(M.call(le)));if(Y(le))return S(p.call(le));if(D(le))return S(kt(String(le)));if(typeof window<"u"&&le===window)return"{ [object Window] }";if(typeof globalThis<"u"&&le===globalThis||typeof fa<"u"&&le===fa)return"{ [object globalThis] }";if(!q(le)&&!re(le)){var er=xe(le,kt),xs=G?G(le)===Object.prototype:le instanceof Object||le.constructor===Object,Es=le instanceof Object?"":"null prototype",Ss=!xs&&R&&Object(le)===le&&R in le?y.call(L(le),8,-1):Es?"Object":"",xa=xs||typeof le.constructor!="function"?"":le.constructor.name?le.constructor.name+" ":"",In=xa+(Ss||Es?"["+A.call(E.call([],Ss||[],Es||[]),": ")+"] ":"");return er.length===0?In+"{}":dr?In+"{"+de(er,dr)+"}":In+"{ "+A.call(er,", ")+" }"}return String(le)};function B(Z,le,Ce){var Me=(Ce.quoteStyle||le)==="double"?'"':"'";return Me+Z+Me}function ne(Z){return b.call(String(Z),/"/g,""")}function U(Z){return L(Z)==="[object Array]"&&(!R||!(typeof Z=="object"&&R in Z))}function q(Z){return L(Z)==="[object Date]"&&(!R||!(typeof Z=="object"&&R in Z))}function re(Z){return L(Z)==="[object RegExp]"&&(!R||!(typeof Z=="object"&&R in Z))}function F(Z){return L(Z)==="[object Error]"&&(!R||!(typeof Z=="object"&&R in Z))}function D(Z){return L(Z)==="[object String]"&&(!R||!(typeof Z=="object"&&R in Z))}function ae(Z){return L(Z)==="[object Number]"&&(!R||!(typeof Z=="object"&&R in Z))}function Y(Z){return L(Z)==="[object Boolean]"&&(!R||!(typeof Z=="object"&&R in Z))}function Q(Z){if(N)return Z&&typeof Z=="object"&&Z instanceof Symbol;if(typeof Z=="symbol")return!0;if(!Z||typeof Z!="object"||!k)return!1;try{return k.call(Z),!0}catch{}return!1}function ie(Z){if(!Z||typeof Z!="object"||!M)return!1;try{return M.call(Z),!0}catch{}return!1}var ye=Object.prototype.hasOwnProperty||function(Z){return Z in(this||fa)};function ue(Z,le){return ye.call(Z,le)}function L(Z){return g.call(Z)}function J(Z){if(Z.name)return Z.name;var le=v.call(m.call(Z),/^function\s*([\w$]+)/);return le?le[1]:null}function ee(Z,le){if(Z.indexOf)return Z.indexOf(le);for(var Ce=0,Me=Z.length;Ce<Me;Ce++)if(Z[Ce]===le)return Ce;return-1}function he(Z){if(!t||!Z||typeof Z!="object")return!1;try{t.call(Z);try{o.call(Z)}catch{return!0}return Z instanceof Map}catch{}return!1}function fe(Z){if(!u||!Z||typeof Z!="object")return!1;try{u.call(Z,u);try{h.call(Z,h)}catch{return!0}return Z instanceof WeakMap}catch{}return!1}function we(Z){if(!d||!Z||typeof Z!="object")return!1;try{return d.call(Z),!0}catch{}return!1}function X(Z){if(!o||!Z||typeof Z!="object")return!1;try{o.call(Z);try{t.call(Z)}catch{return!0}return Z instanceof Set}catch{}return!1}function be(Z){if(!h||!Z||typeof Z!="object")return!1;try{h.call(Z,h);try{u.call(Z,u)}catch{return!0}return Z instanceof WeakSet}catch{}return!1}function _e(Z){return!Z||typeof Z!="object"?!1:typeof HTMLElement<"u"&&Z instanceof HTMLElement?!0:typeof Z.nodeName=="string"&&typeof Z.getAttribute=="function"}function ce(Z,le){if(Z.length>le.maxStringLength){var Ce=Z.length-le.maxStringLength,Me="... "+Ce+" more character"+(Ce>1?"s":"");return ce(y.call(Z,0,le.maxStringLength),le)+Me}var je=b.call(b.call(Z,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Re);return B(je,"single",le)}function Re(Z){var le=Z.charCodeAt(0),Ce={8:"b",9:"t",10:"n",12:"f",13:"r"}[le];return Ce?"\\"+Ce:"\\x"+(le<16?"0":"")+_.call(le.toString(16))}function S(Z){return"Object("+Z+")"}function P(Z){return Z+" { ? }"}function I(Z,le,Ce,Me){var je=Me?de(Ce,Me):A.call(Ce,", ");return Z+" ("+le+") {"+je+"}"}function K(Z){for(var le=0;le<Z.length;le++)if(ee(Z[le],`
|
|
262
|
-
`)>=0)return!1;return!0}function oe(Z,le){var Ce;if(Z.indent===" ")Ce=" ";else if(typeof Z.indent=="number"&&Z.indent>0)Ce=A.call(Array(Z.indent+1)," ");else return null;return{base:Ce,prev:A.call(Array(le+1),Ce)}}function de(Z,le){if(Z.length===0)return"";var Ce=`
|
|
263
|
-
`+le.prev+le.base;return Ce+A.call(Z,","+Ce)+`
|
|
264
|
-
`+le.prev}function xe(Z,le){var Ce=U(Z),Me=[];if(Ce){Me.length=Z.length;for(var je=0;je<Z.length;je++)Me[je]=ue(Z,je)?le(Z[je],Z):""}var Le=typeof C=="function"?C(Z):[],cr;if(N){cr={};for(var hr=0;hr<Le.length;hr++)cr["$"+Le[hr]]=Le[hr]}for(var Pt in Z)ue(Z,Pt)&&(Ce&&String(Number(Pt))===Pt&&Pt<Z.length||N&&cr["$"+Pt]instanceof Symbol||(x.call(/[^\w$]/,Pt)?Me.push(le(Pt,Z)+": "+le(Z[Pt],Z)):Me.push(Pt+": "+le(Z[Pt],Z))));if(typeof C=="function")for(var fr=0;fr<Le.length;fr++)$.call(Z,Le[fr])&&Me.push("["+le(Le[fr])+"]: "+le(Z[Le[fr]],Z));return Me}return ha}function w6(){if(Pm)return da;Pm=!0;var n=Ei(),e=s6(),t=v6(),r=vs(),i=n("%WeakMap%",!0),s=n("%Map%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),l=e("WeakMap.prototype.has",!0),u=e("Map.prototype.get",!0),c=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),f=function(m,v){for(var y=m,b;(b=y.next)!==null;y=b)if(b.key===v)return y.next=b.next,b.next=m.next,m.next=b,b},d=function(m,v){var y=f(m,v);return y&&y.value},p=function(m,v,y){var b=f(m,v);b?b.value=y:m.next={key:v,next:m.next,value:y}},g=function(m,v){return!!f(m,v)};return da=function(){var m,v,y,b={assert:function(_){if(!b.has(_))throw new r("Side channel does not contain "+t(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(m)return o(m,_)}else if(s){if(v)return u(v,_)}else if(y)return d(y,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(m)return l(m,_)}else if(s){if(v)return h(v,_)}else if(y)return g(y,_);return!1},set:function(_,w){i&&_&&(typeof _=="object"||typeof _=="function")?(m||(m=new i),a(m,_,w)):s?(v||(v=new s),c(v,_,w)):(y||(y={key:{},next:null}),p(y,_,w))}};return b},da}function Sm(){if(Om)return pa;Om=!0;var n=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return pa={default:t.RFC3986,formatters:{RFC1738:function(r){return n.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},pa}function tO(){if(Cm)return ga;Cm=!0;var n=Sm(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r=(function(){for(var m=[],v=0;v<256;++v)m.push("%"+((v<16?"0":"")+v.toString(16)).toUpperCase());return m})(),i=function(m){for(;m.length>1;){var v=m.pop(),y=v.obj[v.prop];if(t(y)){for(var b=[],_=0;_<y.length;++_)typeof y[_]<"u"&&b.push(y[_]);v.obj[v.prop]=b}}},s=function(m,v){for(var y=v&&v.plainObjects?Object.create(null):{},b=0;b<m.length;++b)typeof m[b]<"u"&&(y[b]=m[b]);return y},o=function m(v,y,b){if(!y)return v;if(typeof y!="object"){if(t(v))v.push(y);else if(v&&typeof v=="object")(b&&(b.plainObjects||b.allowPrototypes)||!e.call(Object.prototype,y))&&(v[y]=!0);else return[v,y];return v}if(!v||typeof v!="object")return[v].concat(y);var _=v;return t(v)&&!t(y)&&(_=s(v,b)),t(v)&&t(y)?(y.forEach(function(w,x){if(e.call(v,x)){var E=v[x];E&&typeof E=="object"&&w&&typeof w=="object"?v[x]=m(E,w,b):v.push(w)}else v[x]=w}),v):Object.keys(y).reduce(function(w,x){var E=y[x];return e.call(w,x)?w[x]=m(w[x],E,b):w[x]=E,w},_)},a=function(m,v){return Object.keys(v).reduce(function(y,b){return y[b]=v[b],y},m)},l=function(m,v,y){var b=m.replace(/\+/g," ");if(y==="iso-8859-1")return b.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(b)}catch{return b}},u=1024,c=function(m,v,y,b,_){if(m.length===0)return m;var w=m;if(typeof m=="symbol"?w=Symbol.prototype.toString.call(m):typeof m!="string"&&(w=String(m)),y==="iso-8859-1")return escape(w).replace(/%u[0-9a-f]{4}/gi,function(C){return"%26%23"+parseInt(C.slice(2),16)+"%3B"});for(var x="",E=0;E<w.length;E+=u){for(var A=w.length>=u?w.slice(E,E+u):w,O=[],T=0;T<A.length;++T){var M=A.charCodeAt(T);if(M===45||M===46||M===95||M===126||M>=48&&M<=57||M>=65&&M<=90||M>=97&&M<=122||_===n.RFC1738&&(M===40||M===41)){O[O.length]=A.charAt(T);continue}if(M<128){O[O.length]=r[M];continue}if(M<2048){O[O.length]=r[192|M>>6]+r[128|M&63];continue}if(M<55296||M>=57344){O[O.length]=r[224|M>>12]+r[128|M>>6&63]+r[128|M&63];continue}T+=1,M=65536+((M&1023)<<10|A.charCodeAt(T)&1023),O[O.length]=r[240|M>>18]+r[128|M>>12&63]+r[128|M>>6&63]+r[128|M&63]}x+=O.join("")}return x},h=function(m){for(var v=[{obj:{o:m},prop:"o"}],y=[],b=0;b<v.length;++b)for(var _=v[b],w=_.obj[_.prop],x=Object.keys(w),E=0;E<x.length;++E){var A=x[E],O=w[A];typeof O=="object"&&O!==null&&y.indexOf(O)===-1&&(v.push({obj:w,prop:A}),y.push(O))}return i(v),m},f=function(m){return Object.prototype.toString.call(m)==="[object RegExp]"},d=function(m){return!m||typeof m!="object"?!1:!!(m.constructor&&m.constructor.isBuffer&&m.constructor.isBuffer(m))},p=function(m,v){return[].concat(m,v)},g=function(m,v){if(t(m)){for(var y=[],b=0;b<m.length;b+=1)y.push(v(m[b]));return y}return v(m)};return ga={arrayToObject:s,assign:a,combine:p,compact:h,decode:l,encode:c,isBuffer:d,isRegExp:f,maybeMap:g,merge:o},ga}function _6(){if(Tm)return ma;Tm=!0;var n=w6(),e=tO(),t=Sm(),r=Object.prototype.hasOwnProperty,i={brackets:function(g){return g+"[]"},comma:"comma",indices:function(g,m){return g+"["+m+"]"},repeat:function(g){return g}},s=Array.isArray,o=Array.prototype.push,a=function(g,m){o.apply(g,s(m)?m:[m])},l=Date.prototype.toISOString,u=t.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:u,formatter:t.formatters[u],indices:!1,serializeDate:function(g){return l.call(g)},skipNulls:!1,strictNullHandling:!1},h=function(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"},f={},d=function g(m,v,y,b,_,w,x,E,A,O,T,M,C,k,N,R,$,G){for(var H=m,se=G,V=0,te=!1;(se=se.get(f))!==void 0&&!te;){var B=se.get(m);if(V+=1,typeof B<"u"){if(B===V)throw new RangeError("Cyclic object value");te=!0}typeof se.get(f)>"u"&&(V=0)}if(typeof O=="function"?H=O(v,H):H instanceof Date?H=C(H):y==="comma"&&s(H)&&(H=e.maybeMap(H,function(L){return L instanceof Date?C(L):L})),H===null){if(w)return A&&!R?A(v,c.encoder,$,"key",k):v;H=""}if(h(H)||e.isBuffer(H)){if(A){var ne=R?v:A(v,c.encoder,$,"key",k);return[N(ne)+"="+N(A(H,c.encoder,$,"value",k))]}return[N(v)+"="+N(String(H))]}var U=[];if(typeof H>"u")return U;var q;if(y==="comma"&&s(H))R&&A&&(H=e.maybeMap(H,A)),q=[{value:H.length>0?H.join(",")||null:void 0}];else if(s(O))q=O;else{var re=Object.keys(H);q=T?re.sort(T):re}var F=E?v.replace(/\./g,"%2E"):v,D=b&&s(H)&&H.length===1?F+"[]":F;if(_&&s(H)&&H.length===0)return D+"[]";for(var ae=0;ae<q.length;++ae){var Y=q[ae],Q=typeof Y=="object"&&typeof Y.value<"u"?Y.value:H[Y];if(!(x&&Q===null)){var ie=M&&E?Y.replace(/\./g,"%2E"):Y,ye=s(H)?typeof y=="function"?y(D,ie):D:D+(M?"."+ie:"["+ie+"]");G.set(m,V);var ue=n();ue.set(f,G),a(U,g(Q,ye,y,b,_,w,x,E,y==="comma"&&R&&s(H)?null:A,O,T,M,C,k,N,R,$,ue))}}return U},p=function(g){if(!g)return c;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.encodeDotInKeys<"u"&&typeof g.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");var m=g.charset||c.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var v=t.default;if(typeof g.format<"u"){if(!r.call(t.formatters,g.format))throw new TypeError("Unknown format option provided.");v=g.format}var y=t.formatters[v],b=c.filter;(typeof g.filter=="function"||s(g.filter))&&(b=g.filter);var _;if(g.arrayFormat in i?_=g.arrayFormat:"indices"in g?_=g.indices?"indices":"repeat":_=c.arrayFormat,"commaRoundTrip"in g&&typeof g.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var w=typeof g.allowDots>"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:w,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:_,charset:m,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:b,format:v,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return ma=function(g,m){var v=g,y=p(m),b,_;typeof y.filter=="function"?(_=y.filter,v=_("",v)):s(y.filter)&&(_=y.filter,b=_);var w=[];if(typeof v!="object"||v===null)return"";var x=i[y.arrayFormat],E=x==="comma"&&y.commaRoundTrip;b||(b=Object.keys(v)),y.sort&&b.sort(y.sort);for(var A=n(),O=0;O<b.length;++O){var T=b[O];y.skipNulls&&v[T]===null||a(w,d(v[T],T,x,E,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,A))}var M=w.join(y.delimiter),C=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),M.length>0?C+M:""},ma}function x6(){if(Mm)return ya;Mm=!0;var n=tO(),e=Object.prototype.hasOwnProperty,t=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(f){return f.replace(/&#(\d+);/g,function(d,p){return String.fromCharCode(parseInt(p,10))})},s=function(f,d){return f&&typeof f=="string"&&d.comma&&f.indexOf(",")>-1?f.split(","):f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(f,d){var p={__proto__:null},g=d.ignoreQueryPrefix?f.replace(/^\?/,""):f;g=g.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=d.parameterLimit===1/0?void 0:d.parameterLimit,v=g.split(d.delimiter,m),y=-1,b,_=d.charset;if(d.charsetSentinel)for(b=0;b<v.length;++b)v[b].indexOf("utf8=")===0&&(v[b]===a?_="utf-8":v[b]===o&&(_="iso-8859-1"),y=b,b=v.length);for(b=0;b<v.length;++b)if(b!==y){var w=v[b],x=w.indexOf("]="),E=x===-1?w.indexOf("="):x+1,A,O;E===-1?(A=d.decoder(w,r.decoder,_,"key"),O=d.strictNullHandling?null:""):(A=d.decoder(w.slice(0,E),r.decoder,_,"key"),O=n.maybeMap(s(w.slice(E+1),d),function(M){return d.decoder(M,r.decoder,_,"value")})),O&&d.interpretNumericEntities&&_==="iso-8859-1"&&(O=i(O)),w.indexOf("[]=")>-1&&(O=t(O)?[O]:O);var T=e.call(p,A);T&&d.duplicates==="combine"?p[A]=n.combine(p[A],O):(!T||d.duplicates==="last")&&(p[A]=O)}return p},u=function(f,d,p,g){for(var m=g?d:s(d,p),v=f.length-1;v>=0;--v){var y,b=f[v];if(b==="[]"&&p.parseArrays)y=p.allowEmptyArrays&&(m===""||p.strictNullHandling&&m===null)?[]:[].concat(m);else{y=p.plainObjects?Object.create(null):{};var _=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,w=p.decodeDotInKeys?_.replace(/%2E/g,"."):_,x=parseInt(w,10);!p.parseArrays&&w===""?y={0:m}:!isNaN(x)&&b!==w&&String(x)===w&&x>=0&&p.parseArrays&&x<=p.arrayLimit?(y=[],y[x]=m):w!=="__proto__"&&(y[w]=m)}m=y}return m},c=function(f,d,p,g){if(f){var m=p.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,v=/(\[[^[\]]*])/,y=/(\[[^[\]]*])/g,b=p.depth>0&&v.exec(m),_=b?m.slice(0,b.index):m,w=[];if(_){if(!p.plainObjects&&e.call(Object.prototype,_)&&!p.allowPrototypes)return;w.push(_)}for(var x=0;p.depth>0&&(b=y.exec(m))!==null&&x<p.depth;){if(x+=1,!p.plainObjects&&e.call(Object.prototype,b[1].slice(1,-1))&&!p.allowPrototypes)return;w.push(b[1])}if(b){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");w.push("["+m.slice(b.index)+"]")}return u(w,d,p,g)}},h=function(f){if(!f)return r;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var d=typeof f.charset>"u"?r.charset:f.charset,p=typeof f.duplicates>"u"?r.duplicates:f.duplicates;if(p!=="combine"&&p!=="first"&&p!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var g=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:r.allowDots:!!f.allowDots;return{allowDots:g,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:r.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:r.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:r.arrayLimit,charset:d,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:r.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:r.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:r.decoder,delimiter:typeof f.delimiter=="string"||n.isRegExp(f.delimiter)?f.delimiter:r.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:r.depth,duplicates:p,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:r.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:r.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:r.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:r.strictNullHandling}};return ya=function(f,d){var p=h(d);if(f===""||f===null||typeof f>"u")return p.plainObjects?Object.create(null):{};for(var g=typeof f=="string"?l(f,p):f,m=p.plainObjects?Object.create(null):{},v=Object.keys(g),y=0;y<v.length;++y){var b=v[y],_=c(b,g[b],p,typeof f=="string");m=n.merge(m,_,p)}return p.allowSparse===!0?m:n.compact(m)},ya}function E6(){if(Im)return ba;Im=!0;var n=_6(),e=x6(),t=Sm();return ba={formats:t,parse:e,stringify:n},ba}function S6(){if(Rm)return on;Rm=!0;var n=nn;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r",`
|
|
265
|
-
`," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),l=["%","/","?",";","#"].concat(a),u=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=E6();function v(w,x,E){if(w&&typeof w=="object"&&w instanceof e)return w;var A=new e;return A.parse(w,x,E),A}e.prototype.parse=function(w,x,E){if(typeof w!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof w);var A=w.indexOf("?"),O=A!==-1&&A<w.indexOf("#")?"?":"#",T=w.split(O),M=/\\/g;T[0]=T[0].replace(M,"/"),w=T.join(O);var C=w;if(C=C.trim(),!E&&w.split("#").length===1){var k=i.exec(C);if(k)return this.path=C,this.href=C,this.pathname=k[1],k[2]?(this.search=k[2],x?this.query=m.parse(this.search.substr(1)):this.query=this.search.substr(1)):x&&(this.search="",this.query={}),this}var N=t.exec(C);if(N){N=N[0];var R=N.toLowerCase();this.protocol=R,C=C.substr(N.length)}if(E||N||C.match(/^\/\/[^@/]+@[^@/]+/)){var $=C.substr(0,2)==="//";$&&!(N&&p[N])&&(C=C.substr(2),this.slashes=!0)}if(!p[N]&&($||N&&!g[N])){for(var G=-1,H=0;H<u.length;H++){var se=C.indexOf(u[H]);se!==-1&&(G===-1||se<G)&&(G=se)}var V,te;G===-1?te=C.lastIndexOf("@"):te=C.lastIndexOf("@",G),te!==-1&&(V=C.slice(0,te),C=C.slice(te+1),this.auth=decodeURIComponent(V)),G=-1;for(var H=0;H<l.length;H++){var se=C.indexOf(l[H]);se!==-1&&(G===-1||se<G)&&(G=se)}G===-1&&(G=C.length),this.host=C.slice(0,G),C=C.slice(G),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var ne=this.hostname.split(/\./),H=0,U=ne.length;H<U;H++){var q=ne[H];if(q&&!q.match(h)){for(var re="",F=0,D=q.length;F<D;F++)q.charCodeAt(F)>127?re+="x":re+=q[F];if(!re.match(h)){var ae=ne.slice(0,H),Y=ne.slice(H+1),Q=q.match(f);Q&&(ae.push(Q[1]),Y.unshift(Q[2])),Y.length&&(C="/"+Y.join(".")+C),this.hostname=ae.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=n.toASCII(this.hostname));var ie=this.port?":"+this.port:"",ye=this.hostname||"";this.host=ye+ie,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!d[R])for(var H=0,U=a.length;H<U;H++){var ue=a[H];if(C.indexOf(ue)!==-1){var L=encodeURIComponent(ue);L===ue&&(L=escape(ue)),C=C.split(ue).join(L)}}var J=C.indexOf("#");J!==-1&&(this.hash=C.substr(J),C=C.slice(0,J));var ee=C.indexOf("?");if(ee!==-1?(this.search=C.substr(ee),this.query=C.substr(ee+1),x&&(this.query=m.parse(this.query)),C=C.slice(0,ee)):x&&(this.search="",this.query={}),C&&(this.pathname=C),g[R]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ie=this.pathname||"",he=this.search||"";this.path=ie+he}return this.href=this.format(),this};function y(w){return typeof w=="string"&&(w=v(w)),w instanceof e?w.format():e.prototype.format.call(w)}e.prototype.format=function(){var w=this.auth||"";w&&(w=encodeURIComponent(w),w=w.replace(/%3A/i,":"),w+="@");var x=this.protocol||"",E=this.pathname||"",A=this.hash||"",O=!1,T="";this.host?O=w+this.host:this.hostname&&(O=w+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(O+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(T=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var M=this.search||T&&"?"+T||"";return x&&x.substr(-1)!==":"&&(x+=":"),this.slashes||(!x||g[x])&&O!==!1?(O="//"+(O||""),E&&E.charAt(0)!=="/"&&(E="/"+E)):O||(O=""),A&&A.charAt(0)!=="#"&&(A="#"+A),M&&M.charAt(0)!=="?"&&(M="?"+M),E=E.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),M=M.replace("#","%23"),x+O+E+M+A};function b(w,x){return v(w,!1,!0).resolve(x)}e.prototype.resolve=function(w){return this.resolveObject(v(w,!1,!0)).format()};function _(w,x){return w?v(w,!1,!0).resolveObject(x):x}return e.prototype.resolveObject=function(w){if(typeof w=="string"){var x=new e;x.parse(w,!1,!0),w=x}for(var E=new e,A=Object.keys(this),O=0;O<A.length;O++){var T=A[O];E[T]=this[T]}if(E.hash=w.hash,w.href==="")return E.href=E.format(),E;if(w.slashes&&!w.protocol){for(var M=Object.keys(w),C=0;C<M.length;C++){var k=M[C];k!=="protocol"&&(E[k]=w[k])}return g[E.protocol]&&E.hostname&&!E.pathname&&(E.pathname="/",E.path=E.pathname),E.href=E.format(),E}if(w.protocol&&w.protocol!==E.protocol){if(!g[w.protocol]){for(var N=Object.keys(w),R=0;R<N.length;R++){var $=N[R];E[$]=w[$]}return E.href=E.format(),E}if(E.protocol=w.protocol,!w.host&&!p[w.protocol]){for(var U=(w.pathname||"").split("/");U.length&&!(w.host=U.shift()););w.host||(w.host=""),w.hostname||(w.hostname=""),U[0]!==""&&U.unshift(""),U.length<2&&U.unshift(""),E.pathname=U.join("/")}else E.pathname=w.pathname;if(E.search=w.search,E.query=w.query,E.host=w.host||"",E.auth=w.auth,E.hostname=w.hostname||w.host,E.port=w.port,E.pathname||E.search){var G=E.pathname||"",H=E.search||"";E.path=G+H}return E.slashes=E.slashes||w.slashes,E.href=E.format(),E}var se=E.pathname&&E.pathname.charAt(0)==="/",V=w.host||w.pathname&&w.pathname.charAt(0)==="/",te=V||se||E.host&&w.pathname,B=te,ne=E.pathname&&E.pathname.split("/")||[],U=w.pathname&&w.pathname.split("/")||[],q=E.protocol&&!g[E.protocol];if(q&&(E.hostname="",E.port=null,E.host&&(ne[0]===""?ne[0]=E.host:ne.unshift(E.host)),E.host="",w.protocol&&(w.hostname=null,w.port=null,w.host&&(U[0]===""?U[0]=w.host:U.unshift(w.host)),w.host=null),te=te&&(U[0]===""||ne[0]==="")),V)E.host=w.host||w.host===""?w.host:E.host,E.hostname=w.hostname||w.hostname===""?w.hostname:E.hostname,E.search=w.search,E.query=w.query,ne=U;else if(U.length)ne||(ne=[]),ne.pop(),ne=ne.concat(U),E.search=w.search,E.query=w.query;else if(w.search!=null){if(q){E.host=ne.shift(),E.hostname=E.host;var re=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;re&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname)}return E.search=w.search,E.query=w.query,(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.href=E.format(),E}if(!ne.length)return E.pathname=null,E.search?E.path="/"+E.search:E.path=null,E.href=E.format(),E;for(var F=ne.slice(-1)[0],D=(E.host||w.host||ne.length>1)&&(F==="."||F==="..")||F==="",ae=0,Y=ne.length;Y>=0;Y--)F=ne[Y],F==="."?ne.splice(Y,1):F===".."?(ne.splice(Y,1),ae++):ae&&(ne.splice(Y,1),ae--);if(!te&&!B)for(;ae--;ae)ne.unshift("..");te&&ne[0]!==""&&(!ne[0]||ne[0].charAt(0)!=="/")&&ne.unshift(""),D&&ne.join("/").substr(-1)!=="/"&&ne.push("");var Q=ne[0]===""||ne[0]&&ne[0].charAt(0)==="/";if(q){E.hostname=Q?"":ne.length?ne.shift():"",E.host=E.hostname;var re=E.host&&E.host.indexOf("@")>0?E.host.split("@"):!1;re&&(E.auth=re.shift(),E.hostname=re.shift(),E.host=E.hostname)}return te=te||E.host&&ne.length,te&&!Q&&ne.unshift(""),ne.length>0?E.pathname=ne.join("/"):(E.pathname=null,E.path=null),(E.pathname!==null||E.search!==null)&&(E.path=(E.pathname?E.pathname:"")+(E.search?E.search:"")),E.auth=w.auth||E.auth,E.slashes=E.slashes||w.slashes,E.href=E.format(),E},e.prototype.parseHost=function(){var w=this.host,x=r.exec(w);x&&(x=x[0],x!==":"&&(this.port=x.substr(1)),w=w.substr(0,w.length-x.length)),w&&(this.hostname=w)},on.parse=v,on.resolve=b,on.resolveObject=_,on.format=y,on.Url=e,on}function rO(n){if(typeof n=="string")n=new URL(n);else if(!(n instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(n.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return va?A6(n):P6(n)}function A6(n){let e=n.hostname,t=n.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let i=t.codePointAt(r+2)||32;if(t[r+1]==="2"&&i===102||t[r+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(mO,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let r=t.codePointAt(1)|32,i=t[2];if(r<pO||r>gO||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function P6(n){if(n.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=n.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let r=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function nO(n){let e=Em.resolve(n),t=n.charCodeAt(n.length-1);(t===dO||va&&t===fO)&&e[e.length-1]!==Em.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(yO,"%25")),!va&&e.includes("\\")&&(e=e.replace(bO,"%5C")),e.includes(`
|
|
266
|
-
`)&&(e=e.replace(vO,"%0A")),e.includes("\r")&&(e=e.replace(wO,"%0D")),e.includes(" ")&&(e=e.replace(_O,"%09")),r.pathname=e,r}var iO,ha,Am,fa,da,Pm,pa,Om,ga,Cm,ma,Tm,ya,Mm,ba,Im,on,Rm,At,sO,oO,aO,lO,uO,cO,hO,fO,dO,pO,gO,va,mO,yO,bO,vO,wO,_O,O6=Mt(()=>{pe(),me(),ge(),VU(),o6(),b6(),ZP(),iO=Object.freeze(Object.create(null)),ha={},Am=!1,fa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,da={},Pm=!1,pa={},Om=!1,ga={},Cm=!1,ma={},Tm=!1,ya={},Mm=!1,ba={},Im=!1,on={},Rm=!1,At=S6(),At.parse,At.resolve,At.resolveObject,At.format,At.Url,sO=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,At.URL=typeof URL<"u"?URL:null,At.pathToFileURL=nO,At.fileURLToPath=rO,oO=At.Url,aO=At.format,lO=At.resolve,uO=At.resolveObject,cO=At.parse,hO=At.URL,fO=92,dO=47,pO=97,gO=122,va=sO==="win32",mO=/\//g,yO=/%/g,bO=/\\/g,vO=/\n/g,wO=/\r/g,_O=/\t/g}),C6=ve((n,e)=>{pe(),me(),ge(),e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),km=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0}),n.BufferedDuplex=void 0,n.writev=r;var e=Cn(),t=(yt(),$e(mt));function r(s,o){let a=new Array(s.length);for(let l=0;l<s.length;l++)typeof s[l].chunk=="string"?a[l]=t.Buffer.from(s[l].chunk,"utf8"):a[l]=s[l].chunk;this._write(t.Buffer.concat(a),"binary",o)}var i=class extends e.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(s,o,a){super({objectMode:!0}),this.proxy=o,this.socket=a,this.writeQueue=[],s.objectMode||(this._writev=r.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",l=>{!this.destroyed&&this.readable&&this.push(l)})}_read(s){this.proxy.read(s)}_write(s,o,a){this.isSocketOpen?this.writeToProxy(s,o,a):this.writeQueue.push({chunk:s,encoding:o,cb:a})}_final(s){this.writeQueue=[],this.proxy.end(s)}_destroy(s,o){this.writeQueue=[],this.proxy.destroy(),o(s)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(s,o,a){this.proxy.write(s,o)===!1?this.proxy.once("drain",a):a()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:s,encoding:o,cb:a}=this.writeQueue.shift();this.writeToProxy(s,o,a)}}};n.BufferedDuplex=i}),wa=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(n,"__esModule",{value:!0}),n.streamBuilder=n.browserStreamBuilder=void 0;var t=(yt(),$e(mt)),r=e(C6()),i=e(Nr()),s=Cn(),o=e(Ko()),a=km(),l=(0,i.default)("mqttjs:ws"),u=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(v,y){let b=`${v.protocol}://${v.hostname}:${v.port}${v.path}`;return typeof v.transformWsUrl=="function"&&(b=v.transformWsUrl(b,v,y)),b}function h(v){let y=v;return v.port||(v.protocol==="wss"?y.port=443:y.port=80),v.path||(y.path="/"),v.wsOptions||(y.wsOptions={}),!o.default&&!v.forceNativeWebSocket&&v.protocol==="wss"&&u.forEach(b=>{Object.prototype.hasOwnProperty.call(v,b)&&!Object.prototype.hasOwnProperty.call(v.wsOptions,b)&&(y.wsOptions[b]=v[b])}),y}function f(v){let y=h(v);if(y.hostname||(y.hostname=y.host),!y.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let b=new URL(document.URL);y.hostname=b.hostname,y.port||(y.port=Number(b.port))}return y.objectMode===void 0&&(y.objectMode=!(y.binary===!0||y.binary===void 0)),y}function d(v,y,b){l("createWebSocket"),l(`protocol: ${b.protocolId} ${b.protocolVersion}`);let _=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";l(`creating new Websocket for url: ${y} and protocol: ${_}`);let w;return b.createWebsocket?w=b.createWebsocket(y,[_],b):w=new r.default(y,[_],b.wsOptions),w}function p(v,y){let b=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt",_=c(y,v),w;return y.createWebsocket?w=y.createWebsocket(_,[b],y):w=new WebSocket(_,[b]),w.binaryType="arraybuffer",w}var g=(v,y)=>{l("streamBuilder");let b=h(y);b.hostname=b.hostname||b.host||"localhost";let _=c(b,v),w=d(v,_,b),x=r.default.createWebSocketStream(w,b.wsOptions);return x.url=_,w.on("close",()=>{x.destroy()}),x};n.streamBuilder=g;var m=(v,y)=>{l("browserStreamBuilder");let b,_=f(y).browserBufferSize||1024*512,w=y.browserBufferTimeout||1e3,x=!y.objectMode,E=p(v,y),A=T(y,R,$);y.objectMode||(A._writev=a.writev.bind(A)),A.on("close",()=>{E.close()});let O=typeof E.addEventListener<"u";E.readyState===E.OPEN?(b=A,b.socket=E):(b=new a.BufferedDuplex(y,A,E),O?E.addEventListener("open",M):E.onopen=M),O?(E.addEventListener("close",C),E.addEventListener("error",k),E.addEventListener("message",N)):(E.onclose=C,E.onerror=k,E.onmessage=N);function T(G,H,se){let V=new s.Transform({objectMode:G.objectMode});return V._write=H,V._flush=se,V}function M(){l("WebSocket onOpen"),b instanceof a.BufferedDuplex&&b.socketReady()}function C(G){l("WebSocket onClose",G),b.end(),b.destroy()}function k(G){l("WebSocket onError",G);let H=new Error("WebSocket error");H.event=G,b.destroy(H)}async function N(G){if(!A||!A.readable||!A.writable)return;let{data:H}=G;H instanceof ArrayBuffer?H=t.Buffer.from(H):H instanceof Blob?H=t.Buffer.from(await new Response(H).arrayBuffer()):H=t.Buffer.from(H,"utf8"),A.push(H)}function R(G,H,se){if(E.bufferedAmount>_){setTimeout(R,w,G,H,se);return}x&&typeof G=="string"&&(G=t.Buffer.from(G,"utf8"));try{E.send(G)}catch(V){return se(V)}se()}function $(G){E.close(),G()}return b};n.browserStreamBuilder=m}),Nm={};bi(Nm,{Server:()=>Xe,Socket:()=>Xe,Stream:()=>Xe,_createServerHandle:()=>Xe,_normalizeArgs:()=>Xe,_setSimultaneousAccepts:()=>Xe,connect:()=>Xe,createConnection:()=>Xe,createServer:()=>Xe,default:()=>xO,isIP:()=>Xe,isIPv4:()=>Xe,isIPv6:()=>Xe});function Xe(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var xO,EO=Mt(()=>{pe(),me(),ge(),xO={_createServerHandle:Xe,_normalizeArgs:Xe,_setSimultaneousAccepts:Xe,connect:Xe,createConnection:Xe,createServer:Xe,isIP:Xe,isIPv4:Xe,isIPv6:Xe,Server:Xe,Socket:Xe,Stream:Xe}}),SO=ve((n,e)=>{pe(),me(),ge(),e.exports={}}),AO=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(n,"__esModule",{value:!0});var t=e((EO(),$e(Nm))),r=e(Nr()),i=e(SO()),s=(0,r.default)("mqttjs:tcp"),o=(a,l)=>{if(l.port=l.port||1883,l.hostname=l.hostname||l.host||"localhost",l.socksProxy)return(0,i.default)(l.hostname,l.port,l.socksProxy,{timeout:l.socksTimeout});let{port:u,path:c}=l,h=l.hostname;return s("port %d and host %s",u,h),t.default.createConnection({port:u,host:h,path:c})};n.default=o}),PO={};bi(PO,{default:()=>OO});var OO,T6=Mt(()=>{pe(),me(),ge(),OO={}}),CO=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(n,"__esModule",{value:!0});var t=(T6(),$e(PO)),r=e((EO(),$e(Nm))),i=e(Nr()),s=e(SO()),o=(0,i.default)("mqttjs:tls");function a(u){let{host:c,port:h,socksProxy:f,...d}=u;if(f!==void 0){let p=(0,s.default)(c,h,f,{timeout:u.socksTimeout});return(0,t.connect)({...d,socket:p})}return(0,t.connect)(u)}var l=(u,c)=>{c.port=c.port||8883,c.host=c.hostname||c.host||"localhost",r.default.isIP(c.host)===0&&(c.servername=c.host),c.rejectUnauthorized=c.rejectUnauthorized!==!1,delete c.path,o("port %d host %s rejectUnauthorized %b",c.port,c.host,c.rejectUnauthorized);let h=a(c);h.on("secureConnect",()=>{c.rejectUnauthorized&&!h.authorized?h.emit("error",new Error("TLS not authorized")):h.removeListener("error",f)});function f(d){c.rejectUnauthorized&&u.emit("error",d),h.end()}return h.on("error",f),h};n.default=l}),TO=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=(yt(),$e(mt)),t=Cn(),r=km(),i,s,o;function a(){let f=new t.Transform;return f._write=(d,p,g)=>{i.send({data:d.buffer,success(){g()},fail(m){g(new Error(m))}})},f._flush=d=>{i.close({success(){d()}})},f}function l(f){f.hostname||(f.hostname="localhost"),f.path||(f.path="/"),f.wsOptions||(f.wsOptions={})}function u(f,d){let p=f.protocol==="wxs"?"wss":"ws",g=`${p}://${f.hostname}${f.path}`;return f.port&&f.port!==80&&f.port!==443&&(g=`${p}://${f.hostname}:${f.port}${f.path}`),typeof f.transformWsUrl=="function"&&(g=f.transformWsUrl(g,f,d)),g}function c(){i.onOpen(()=>{o.socketReady()}),i.onMessage(f=>{let{data:d}=f;d instanceof ArrayBuffer?d=e.Buffer.from(d):d=e.Buffer.from(d,"utf8"),s.push(d)}),i.onClose(()=>{o.emit("close"),o.end(),o.destroy()}),i.onError(f=>{let d=new Error(f.errMsg);o.destroy(d)})}var h=(f,d)=>{if(d.hostname=d.hostname||d.host,!d.hostname)throw new Error("Could not determine host. Specify host manually.");let p=d.protocolId==="MQIsdp"&&d.protocolVersion===3?"mqttv3.1":"mqtt";l(d);let g=u(d,f);i=wx.connectSocket({url:g,protocols:[p]}),s=a(),o=new r.BufferedDuplex(d,s,i),o._destroy=(v,y)=>{i.close({success(){y&&y(v)}})};let m=o.destroy;return o.destroy=(v,y)=>(o.destroy=m,setTimeout(()=>{i.close({fail(){o._destroy(v,y)}})},0),o),c(),o};n.default=h}),MO=ve(n=>{pe(),me(),ge(),Object.defineProperty(n,"__esModule",{value:!0});var e=(yt(),$e(mt)),t=Cn(),r=km(),i,s,o,a=!1;function l(){let d=new t.Transform;return d._write=(p,g,m)=>{i.sendSocketMessage({data:p.buffer,success(){m()},fail(){m(new Error)}})},d._flush=p=>{i.closeSocket({success(){p()}})},d}function u(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function c(d,p){let g=d.protocol==="alis"?"wss":"ws",m=`${g}://${d.hostname}${d.path}`;return d.port&&d.port!==80&&d.port!==443&&(m=`${g}://${d.hostname}:${d.port}${d.path}`),typeof d.transformWsUrl=="function"&&(m=d.transformWsUrl(m,d,p)),m}function h(){a||(a=!0,i.onSocketOpen(()=>{o.socketReady()}),i.onSocketMessage(d=>{if(typeof d.data=="string"){let p=e.Buffer.from(d.data,"base64");s.push(p)}else{let p=new FileReader;p.addEventListener("load",()=>{if(p.result instanceof ArrayBuffer){s.push(e.Buffer.from(p.result));return}s.push(e.Buffer.from(p.result,"utf-8"))}),p.readAsArrayBuffer(d.data)}}),i.onSocketClose(()=>{o.end(),o.destroy()}),i.onSocketError(d=>{o.destroy(d)}))}var f=(d,p)=>{if(p.hostname=p.hostname||p.host,!p.hostname)throw new Error("Could not determine host. Specify host manually.");let g=p.protocolId==="MQIsdp"&&p.protocolVersion===3?"mqttv3.1":"mqtt";u(p);let m=c(p,d);return i=p.my,i.connectSocket({url:m,protocols:g}),s=l(),o=new r.BufferedDuplex(p,s,i),h(),o};n.default=f}),M6=ve(n=>{pe(),me(),ge();var e=n&&n.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(n,"__esModule",{value:!0}),n.connectAsync=c;var t=e(Nr()),r=e((O6(),$e(eO))),i=e(qg()),s=e(Ko());typeof Ge?.nextTick!="function"&&(Ge.nextTick=setImmediate);var o=(0,t.default)("mqttjs"),a=null;function l(h){let f;if(h.auth)if(f=h.auth.match(/^(.+):(.+)$/),f){let[,d,p]=f;h.username=d,h.password=p}else h.username=h.auth}function u(h,f){if(o("connecting to an MQTT broker..."),typeof h=="object"&&!f&&(f=h,h=""),f=f||{},h&&typeof h=="string"){let g=r.default.parse(h,!0),m={};if(g.port!=null&&(m.port=Number(g.port)),m.host=g.hostname,m.query=g.query,m.auth=g.auth,m.protocol=g.protocol,m.path=g.path,f={...m,...f},!f.protocol)throw new Error("Missing protocol");f.protocol=f.protocol.replace(/:$/,"")}if(f.unixSocket=f.unixSocket||f.protocol?.includes("+unix"),f.unixSocket?f.protocol=f.protocol.replace("+unix",""):!f.protocol?.startsWith("ws")&&!f.protocol?.startsWith("wx")&&delete f.path,l(f),f.query&&typeof f.query.clientId=="string"&&(f.clientId=f.query.clientId),s.default||f.unixSocket?f.socksProxy=void 0:f.socksProxy===void 0&&typeof Ge<"u"&&(f.socksProxy=Ge.env.MQTTJS_SOCKS_PROXY),f.cert&&f.key)if(f.protocol){if(["mqtts","wss","wxs","alis"].indexOf(f.protocol)===-1)switch(f.protocol){case"mqtt":f.protocol="mqtts";break;case"ws":f.protocol="wss";break;case"wx":f.protocol="wxs";break;case"ali":f.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${f.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(a||(a={},!s.default&&!f.forceNativeWebSocket?(a.ws=wa().streamBuilder,a.wss=wa().streamBuilder,a.mqtt=AO().default,a.tcp=AO().default,a.ssl=CO().default,a.tls=a.ssl,a.mqtts=CO().default):(a.ws=wa().browserStreamBuilder,a.wss=wa().browserStreamBuilder,a.wx=TO().default,a.wxs=TO().default,a.ali=MO().default,a.alis=MO().default)),!a[f.protocol]){let g=["mqtts","wss"].indexOf(f.protocol)!==-1;f.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((m,v)=>g&&v%2===0?!1:typeof a[m]=="function")[0]}if(f.clean===!1&&!f.clientId)throw new Error("Missing clientId for unclean clients");f.protocol&&(f.defaultProtocol=f.protocol);function d(g){return f.servers&&((!g._reconnectCount||g._reconnectCount===f.servers.length)&&(g._reconnectCount=0),f.host=f.servers[g._reconnectCount].host,f.port=f.servers[g._reconnectCount].port,f.protocol=f.servers[g._reconnectCount].protocol?f.servers[g._reconnectCount].protocol:f.defaultProtocol,f.hostname=f.host,g._reconnectCount++),o("calling streambuilder for",f.protocol),a[f.protocol](g,f)}let p=new i.default(d,f);return p.on("error",()=>{}),p}function c(h,f,d=!0){return new Promise((p,g)=>{let m=u(h,f),v={connect:b=>{y(),p(m)},end:()=>{y(),p(m)},error:b=>{y(),m.end(),g(b)}};d===!1&&(v.close=()=>{v.error(new Error("Couldn't connect to server"))});function y(){Object.keys(v).forEach(b=>{m.off(b,v[b])})}Object.keys(v).forEach(b=>{m.on(b,v[b])})})}n.default=u}),IO=ve(n=>{pe(),me(),ge();var e=n&&n.__createBinding||(Object.create?function(d,p,g,m){m===void 0&&(m=g);var v=Object.getOwnPropertyDescriptor(p,g);(!v||("get"in v?!p.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return p[g]}}),Object.defineProperty(d,m,v)}:function(d,p,g,m){m===void 0&&(m=g),d[m]=p[g]}),t=n&&n.__setModuleDefault||(Object.create?function(d,p){Object.defineProperty(d,"default",{enumerable:!0,value:p})}:function(d,p){d.default=p}),r=n&&n.__importStar||(function(){var d=function(p){return d=Object.getOwnPropertyNames||function(g){var m=[];for(var v in g)Object.prototype.hasOwnProperty.call(g,v)&&(m[m.length]=v);return m},d(p)};return function(p){if(p&&p.__esModule)return p;var g={};if(p!=null)for(var m=d(p),v=0;v<m.length;v++)m[v]!=="default"&&e(g,p,m[v]);return t(g,p),g}})(),i=n&&n.__exportStar||function(d,p){for(var g in d)g!=="default"&&!Object.prototype.hasOwnProperty.call(p,g)&&e(p,d,g)},s=n&&n.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(n,"__esModule",{value:!0}),n.ReasonCodes=n.KeepaliveManager=n.UniqueMessageIdProvider=n.DefaultMessageIdProvider=n.Store=n.MqttClient=n.connectAsync=n.connect=n.Client=void 0;var o=s(qg());n.MqttClient=o.default;var a=s(BA());n.DefaultMessageIdProvider=a.default;var l=s(UU());n.UniqueMessageIdProvider=l.default;var u=s(IA());n.Store=u.default;var c=r(M6());n.connect=c.default,Object.defineProperty(n,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=s(WA());n.KeepaliveManager=h.default,n.Client=o.default,i(qg(),n),i(xi(),n);var f=Go();Object.defineProperty(n,"ReasonCodes",{enumerable:!0,get:function(){return f.ReasonCodes}})}),I6=ve(n=>{pe(),me(),ge();var e=n&&n.__createBinding||(Object.create?function(o,a,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(a,l);(!c||("get"in c?!a.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return a[l]}}),Object.defineProperty(o,u,c)}:function(o,a,l,u){u===void 0&&(u=l),o[u]=a[l]}),t=n&&n.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=n&&n.__importStar||(function(){var o=function(a){return o=Object.getOwnPropertyNames||function(l){var u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(u[u.length]=c);return u},o(a)};return function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var u=o(a),c=0;c<u.length;c++)u[c]!=="default"&&e(l,a,u[c]);return t(l,a),l}})(),i=n&&n.__exportStar||function(o,a){for(var l in o)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&e(a,o,l)};Object.defineProperty(n,"__esModule",{value:!0});var s=r(IO());n.default=s,i(IO(),n)});I6();/*! Bundled license information:
|
|
267
|
-
|
|
268
|
-
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
269
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
270
|
-
|
|
271
|
-
safe-buffer/index.js:
|
|
272
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
273
|
-
|
|
274
|
-
@babel/runtime/helpers/regenerator.js:
|
|
275
|
-
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
276
|
-
*/function R6(n){const e=tr.ref(!1);let t=tr.shallowRef(null);tr.onMounted(()=>{t.value=document.querySelector(n),t.value?.addEventListener("fullscreenchange",i)}),tr.onUnmounted(()=>{t.value?.removeEventListener("fullscreenchange",i)});function r(){e.value?document.exitFullscreen&&document.exitFullscreen():t.value?.requestFullscreen&&t.value?.requestFullscreen(),e.value=!e.value}function i(){e.value=document.fullscreenElement===t.value}return{container:t,full:e,on_change:r}}Be.canvastoDataURL=Ea,Be.canvastoFile=XO,Be.compress=tC,Be.compressAccurately=rC,Be.dataURLtoFile=Sa,Be.dataURLtoImage=Aa,Be.downloadFile=QO,Be.filetoDataURL=Pa,Be.imagetoCanvas=Oa,Be.urltoBlob=ZO,Be.urltoImage=eC,Be.useEmits=GO,Be.useFile=HO,Be.useFullScreen=R6,Be.useLayoutFlow=E$,Be.usePrintHtml=KO,Be.useWaterMark=YO,Be.useWebSocket=JO,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})}));
|
|
15
|
+
}`,m=document.createElement("style");return m.innerHTML=i,m}function o(){let c=document.getElementById("print-container");c&&document?.querySelector("body")?.removeChild(c)}function n(c){o();let i=document.createElement("div");return i.setAttribute("id","print-container"),i.innerHTML=c,i}function r(c){let i=c.querySelectorAll("img");const m=[].slice.call(i);if(m.length===0)return Promise.resolve();let g=0;return new Promise(y=>{function h(){g++,g===m.length&&y()}m.forEach(s=>{s.addEventListener("load",h),s.addEventListener("error",h)})})}function a(c){const i=document.querySelector(c);i&&t(i.innerHTML)}function u(c){let i="";for(let m=0;m<c.length;m++)i+=c[m].outerHTML;i&&t(i)}return{printHtml:a,printHtmlElement:u}}function K(){const t="A77B030B-E33D-C656-7642-56D6FEA46059";function e(r=null,a,u,c){let i=n(r,a,u,c);document.getElementById(i)===null&&(i=n(r,a,u))}function o(){document.getElementById(t)?.remove()}function n(r=null,a,u,c="#999"){const i=r!=null?document.querySelector(r):document.body,m=document.getElementById(t);m!==null&&i?.removeChild(m);let g=document.createElement("canvas");g.width=250,g.height=150;let y=g.getContext("2d");y&&(y.font="16px Avenir,Helvetica,Arial,sans-serif",y.fillStyle=c.replace(/\,\s(1|(0.\d+)\))/,", 0.1"),y.textAlign="left",y.textBaseline="middle",y.rotate(-15*Math.PI/180),y?.fillText(a,0,g.height),u&&y?.fillText(u,y.measureText(a).width+16,g.height));let h=document.createElement("div");h.id=t,h.style.pointerEvents="none",h.style.top="0px",h.style.left="0px",h.style.position="fixed",h.style.zIndex="100000";const{clientWidth:s,clientHeight:l}=document.documentElement;return h.style.width=s+"px",h.style.height=l+"px",h.style.background="url("+g.toDataURL("image/png")+") left top repeat",i?.appendChild(h),t}return{createWaterMark:e,removeWatermark:o}}function X(t){let e=0,o=!1,n,r;const{server:a,receive:u}=t;window.onbeforeunload=()=>{n?.close()};function c(){try{n=new WebSocket(a),m()}catch(h){console.log("连接建立异常",h)}}function i(){if(e>=5){n?.close();return}if(o)return!1;o=!0,r=setTimeout(function(){c(),o=!1,e++,r&&clearTimeout(r)},5e3)}function m(){n&&(n.onerror=h=>{console.log("连接错误",h),i()},n.onclose=()=>{console.log("连接关闭 - "+new Date().toLocaleTimeString()),i()},n.onopen=()=>{e=0,console.log("连接成功")},n.onmessage=h=>{try{u(h)}catch{console.log("message:"+h.data)}})}function g(h){n?.readyState===WebSocket.OPEN&&n?.send(h)}function y(){n?.close()}return{ws:n,create:c,socketClose:y,sendMessage:g}}var S=(t=>(t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t))(S||{});function I(t){return["image/png","image/jpeg","image/gif"].some(e=>e===t)}async function U(t,e=.92,o=S.JPEG){return I(o)||(o=S.JPEG),t.toDataURL(o,e)}function Y(t,e=.92,o=S.JPEG){return new Promise(n=>t.toBlob(r=>n(r),o,e))}async function j(t,e){const o=t.split(",");let n=o[0].match(/:(.*?);/)?.[1];const r=atob(o[1]);let a=r.length;const u=new Uint8Array(a);for(;a--;)u[a]=r.charCodeAt(a);return I(e)&&(n=e),new Blob([u],{type:n})}function M(t){return new Promise((e,o)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>o(new Error("dataURLtoImage(): dataURL is illegal")),n.src=t})}function Z(t,e){const o=document.createElement("a");o.href=window.URL.createObjectURL(t),o.download=e||Date.now().toString(36),document.body.appendChild(o);const n=document.createEvent("MouseEvents");n.initEvent("click",!1,!1),o.dispatchEvent(n),document.body.removeChild(o)}function z(t){return new Promise(e=>{const o=new FileReader;o.onloadend=n=>e(n.target?.result),o.readAsDataURL(t)})}async function T(t,e={}){const o={...e},n=document.createElement("canvas"),r=n.getContext("2d");let a,u;for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&(o[c]=Number(o[c]));if(!o.scale)u=o.width||(o.height||0)*t.width/t.height||t.width,a=o.height||(o.width||0)*t.height/t.width||t.height;else{const c=o.scale>0&&o.scale<10?o.scale:1;u=t.width*c,a=t.height*c}switch([5,6,7,8].some(c=>c===o.orientation)?(n.height=u,n.width=a):(n.height=a,n.width=u),o.orientation){case 3:r.rotate(180*Math.PI/180),r.drawImage(t,-n.width,-n.height,n.width,n.height);break;case 6:r.rotate(90*Math.PI/180),r.drawImage(t,0,-n.width,n.height,n.width);break;case 8:r.rotate(270*Math.PI/180),r.drawImage(t,-n.height,0,n.height,n.width);break;case 2:r.translate(n.width,0),r.scale(-1,1),r.drawImage(t,0,0,n.width,n.height);break;case 4:r.translate(n.width,0),r.scale(-1,1),r.rotate(180*Math.PI/180),r.drawImage(t,-n.width,-n.height,n.width,n.height);break;case 5:r.translate(n.width,0),r.scale(-1,1),r.rotate(90*Math.PI/180),r.drawImage(t,0,-n.width,n.height,n.width);break;case 7:r.translate(n.width,0),r.scale(-1,1),r.rotate(270*Math.PI/180),r.drawImage(t,-n.height,0,n.height,n.width);break;default:r.drawImage(t,0,0,n.width,n.height)}return n}function ee(t){return fetch(t).then(e=>e.blob())}function te(t){return new Promise((e,o)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>o(new Error("urltoImage(): Image failed to load, please check the image URL")),n.src=t})}async function ne(t,e={}){if(!(t instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if(typeof e!="object"&&(e=Object.assign({quality:e})),e.quality=Number(e.quality),Number.isNaN(e.quality))return t;const o=await z(t);let n=o.split(",")[0].match(/:(.*?);/)?.[1],r=S.JPEG;I(e.type)&&(r=e.type,n=e.type);const a=await M(o),u=await T(a,Object.assign({},e)),c=await U(u,e.quality,r),i=await j(c,n);return i.size>t.size?t:i}async function oe(t,e={}){if(!(t instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if(typeof e!="object"&&(e=Object.assign({size:e})),e.size=Number(e.size),Number.isNaN(e.size)||e.size*1024>t.size)return t;e.accuracy=Number(e.accuracy),(!e.accuracy||e.accuracy<.8||e.accuracy>.99)&&(e.accuracy=.95);const o={max:e.size*(2-e.accuracy)*1024,accurate:e.size*1024,min:e.size*e.accuracy*1024},n=await z(t);let r=n.split(",")[0].match(/:(.*?);/)?.[1],a=S.JPEG;I(e.type)&&(a=e.type,r=e.type);const u=await M(n),c=await T(u,Object.assign({},e)),i=.75;let m=1,g;const y=new Array(2);for(let s=1;s<=7;s++){g=await U(c,m,a);const l=g.length*i;if(s===7){(o.max<l||o.min>l)&&(g=[g,...y].filter(f=>f).sort((f,b)=>Math.abs(f.length*i-o.accurate)-Math.abs(b.length*i-o.accurate))[0]);break}if(o.max<l)y[1]=g,m-=.5**(s+1);else if(o.min>l)y[0]=g,m+=.5**(s+1);else break}const h=await j(g,r);return h.size>t.size?t:h}function q(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"}const re=typeof window<"u";function O(...t){let e=t.length,o=t[0];q(o)||(o={});for(let n=1;n<e;n++){let r=t[n];if(q(r))for(let a in r)a==="__proto__"||o===r[a]||(q(r[a])?o[a]=O(o[a],r[a]):o[a]=r[a])}return o}const ae=new Map;let W;re&&(document.addEventListener("mousedown",t=>W=t),document.addEventListener("mouseup",t=>{for(const e of ae.values())for(const{documentHandler:o}of e)o(t,W)})),L(12),L(14),L(12),L(8),L(16),L(12),L(12),L(12),L(12);function L(t,e=1920){if(!t)return;let o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(!o)return t;let n=o/e;return Number((t*n).toFixed(3))}function ce(t){let e;const o={panning:!0,interacting:!1,mousewheel:{enabled:!0},scaling:{min:.1,max:10}};function n(s){const l=O(o,t);e=new C.Graph({container:s,...l})}function r(s){e.resetCells(s)}function a(s,l="LR"){const{node_w:f,node_h:b,nodesep:N,ranksep:B}=s,se=e.getNodes(),G=e.getEdges(),x=new D.graphlib.Graph;x.setGraph({rankdir:l,nodesep:N,ranksep:B}),x.setDefaultEdgeLabel(()=>({}));const le=f,ue=b;se.forEach(p=>{x.setNode(p.id,{width:le,height:ue})}),G.forEach(p=>{const k=p.getSource(),P=p.getTarget();x.setEdge(k.cell,P.cell)}),D.layout(x),x.nodes().forEach(p=>{const k=e.getCellById(p);if(k){const P=x.node(p);k.position(P.x,P.y)}}),G.forEach(p=>{const k=p.getSourceNode(),P=p.getTargetNode(),w=k.getBBox(),v=P.getBBox();if((l==="LR"||l==="RL")&&w.y!==v.y){const A=l==="LR"?v.x-w.x-w.width:-w.x+v.x+v.width,_=l==="LR"?w.width:0,F=w.x+_+A/2;p.setVertices([{x:F,y:w.center.y},{x:F,y:v.center.y}])}else if((l==="TB"||l==="BT")&&w.x!==v.x){const A=l==="TB"?v.y-w.y-w.height:-w.y+v.y+v.height,_=l==="TB"?w.height:0,F=w.y+_+A/2;p.setVertices([{x:w.center.x,y:F},{x:v.center.x,y:F}])}else p.setVertices([])})}function u(s){e.zoomToFit({padding:s,maxScale:1.2}),e.centerContent()}function c(s){const l=[];return s.forEach(f=>{const b=e.createNode(f);l.push(b)}),l}function i(s){const l=[];return s.forEach(f=>{const b=e.createEdge({shape:f.shape,source:{cell:f.source_id},target:{cell:f.target_id}});l.push(b)}),l}function m(s){Object.keys(s).forEach(f=>{const b=s[f];s[f]=l(b,"g",e),e.on(f,s[f])});function l(f,b,N){return function(...B){return B[0][b]=N,f.apply(this,B)}}}function g(s){Object.keys(s.nodes).forEach(l=>{const f=s.nodes[l];C.Graph.registerNode(l,f,!0)}),Object.keys(s.edges).forEach(l=>{const f=s.edges[l];C.Graph.registerEdge(l,f,!0)})}function y(){return e.getNodes()}function h(){e?.clearCells()}return{init:n,add_graph_elements:r,layout:a,center_content:u,createNodes:c,createEdges:i,register_event:m,register_custom_elements:g,get_nodes:y,clear:h}}function ie(t){const e=E.ref(!1);let o=E.shallowRef(null);E.onMounted(()=>{o.value=document.querySelector(t),o.value?.addEventListener("fullscreenchange",r)}),E.onUnmounted(()=>{o.value?.removeEventListener("fullscreenchange",r)});function n(){e.value?document.exitFullscreen&&document.exitFullscreen():o.value?.requestFullscreen&&o.value?.requestFullscreen(),e.value=!e.value}function r(){e.value=document.fullscreenElement===o.value}return{container:o,full:e,on_change:n}}d.canvastoDataURL=U,d.canvastoFile=Y,d.compress=ne,d.compressAccurately=oe,d.dataURLtoFile=j,d.dataURLtoImage=M,d.downloadFile=Z,d.filetoDataURL=z,d.imagetoCanvas=T,d.urltoBlob=ee,d.urltoImage=te,d.useEmits=V,d.useFile=Q,d.useFullScreen=ie,d.useLayoutFlow=ce,d.usePrintHtml=$,d.useWaterMark=K,d.useWebSocket=X,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|