@getartisanflow/alpineflow 0.1.0-alpha
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/LICENSE +21 -0
- package/README.md +88 -0
- package/dist/alpineflow-collab.esm.js +465 -0
- package/dist/alpineflow-collab.esm.js.map +1 -0
- package/dist/alpineflow-collab.js +247 -0
- package/dist/alpineflow-collab.js.map +1 -0
- package/dist/alpineflow-dagre.esm.js +1661 -0
- package/dist/alpineflow-dagre.esm.js.map +1 -0
- package/dist/alpineflow-dagre.js +1655 -0
- package/dist/alpineflow-dagre.js.map +1 -0
- package/dist/alpineflow-elk.esm.js +47378 -0
- package/dist/alpineflow-elk.esm.js.map +1 -0
- package/dist/alpineflow-elk.js +47373 -0
- package/dist/alpineflow-elk.js.map +1 -0
- package/dist/alpineflow-force.esm.js +599 -0
- package/dist/alpineflow-force.esm.js.map +1 -0
- package/dist/alpineflow-force.js +477 -0
- package/dist/alpineflow-force.js.map +1 -0
- package/dist/alpineflow-hierarchy.esm.js +398 -0
- package/dist/alpineflow-hierarchy.esm.js.map +1 -0
- package/dist/alpineflow-hierarchy.js +393 -0
- package/dist/alpineflow-hierarchy.js.map +1 -0
- package/dist/alpineflow-theme.css +473 -0
- package/dist/alpineflow-whiteboard.esm.js +922 -0
- package/dist/alpineflow-whiteboard.esm.js.map +1 -0
- package/dist/alpineflow-whiteboard.js +922 -0
- package/dist/alpineflow-whiteboard.js.map +1 -0
- package/dist/alpineflow.bundle.esm.js +12604 -0
- package/dist/alpineflow.bundle.esm.js.map +1 -0
- package/dist/alpineflow.css +1415 -0
- package/dist/alpineflow.esm.js +158 -0
- package/dist/alpineflow.esm.js.map +1 -0
- package/dist/alpineflow.js +5 -0
- package/dist/alpineflow.js.map +1 -0
- package/dist/export-DjmXOnKD.js +76 -0
- package/dist/export-DjmXOnKD.js.map +1 -0
- package/dist/geometry-DZSZoYHE.js +82 -0
- package/dist/geometry-DZSZoYHE.js.map +1 -0
- package/dist/index-C0N1DL3G.js +11728 -0
- package/dist/index-C0N1DL3G.js.map +1 -0
- package/dist/index-L3Zm-CoX.js +513 -0
- package/dist/index-L3Zm-CoX.js.map +1 -0
- package/dist/registry-CChkuoVJ.js +15 -0
- package/dist/registry-CChkuoVJ.js.map +1 -0
- package/dist/store-CaFAFEdD.js +9 -0
- package/dist/store-CaFAFEdD.js.map +1 -0
- package/dist/timer-B39XOBYL.js +124 -0
- package/dist/timer-B39XOBYL.js.map +1 -0
- package/dist/types/lib/collab.cdn.d.ts +1 -0
- package/dist/types/lib/collab.d.ts +2 -0
- package/dist/types/lib/core.cdn.d.ts +1 -0
- package/dist/types/lib/core.d.ts +2 -0
- package/dist/types/lib/dagre.cdn.d.ts +1 -0
- package/dist/types/lib/dagre.d.ts +1 -0
- package/dist/types/lib/elk.cdn.d.ts +1 -0
- package/dist/types/lib/elk.d.ts +1 -0
- package/dist/types/lib/force.cdn.d.ts +1 -0
- package/dist/types/lib/force.d.ts +1 -0
- package/dist/types/lib/hierarchy.cdn.d.ts +1 -0
- package/dist/types/lib/hierarchy.d.ts +1 -0
- package/dist/types/lib/whiteboard.cdn.d.ts +1 -0
- package/dist/types/lib/whiteboard.d.ts +1 -0
- package/dist/types/src/animate/animator.d.ts +57 -0
- package/dist/types/src/animate/easing.d.ts +4 -0
- package/dist/types/src/animate/edge-transitions.d.ts +22 -0
- package/dist/types/src/animate/engine.d.ts +37 -0
- package/dist/types/src/animate/index.d.ts +10 -0
- package/dist/types/src/animate/interpolators.d.ts +14 -0
- package/dist/types/src/animate/paths.d.ts +64 -0
- package/dist/types/src/animate/timeline.d.ts +149 -0
- package/dist/types/src/collab/awareness.d.ts +40 -0
- package/dist/types/src/collab/bridge.d.ts +36 -0
- package/dist/types/src/collab/directives/flow-cursors.d.ts +16 -0
- package/dist/types/src/collab/index.d.ts +19 -0
- package/dist/types/src/collab/providers/in-memory.d.ts +41 -0
- package/dist/types/src/collab/providers/reverb.d.ts +59 -0
- package/dist/types/src/collab/providers/websocket.d.ts +33 -0
- package/dist/types/src/collab/store.d.ts +22 -0
- package/dist/types/src/collab/types.d.ts +55 -0
- package/dist/types/src/core/__fixtures__/nodes.d.ts +42 -0
- package/dist/types/src/core/announcer.d.ts +21 -0
- package/dist/types/src/core/auto-pan.d.ts +37 -0
- package/dist/types/src/core/child-layout.d.ts +18 -0
- package/dist/types/src/core/child-validation.d.ts +23 -0
- package/dist/types/src/core/clipboard.d.ts +29 -0
- package/dist/types/src/core/collapse.d.ts +54 -0
- package/dist/types/src/core/color-mode.d.ts +11 -0
- package/dist/types/src/core/compute.d.ts +33 -0
- package/dist/types/src/core/connections.d.ts +32 -0
- package/dist/types/src/core/constants.d.ts +18 -0
- package/dist/types/src/core/controls-panel.d.ts +23 -0
- package/dist/types/src/core/debug.d.ts +10 -0
- package/dist/types/src/core/deep-merge.d.ts +10 -0
- package/dist/types/src/core/drag.d.ts +63 -0
- package/dist/types/src/core/edge-paths/avoidant.d.ts +25 -0
- package/dist/types/src/core/edge-paths/bezier.d.ts +26 -0
- package/dist/types/src/core/edge-paths/editable.d.ts +22 -0
- package/dist/types/src/core/edge-paths/index.d.ts +7 -0
- package/dist/types/src/core/edge-paths/orthogonal.d.ts +27 -0
- package/dist/types/src/core/edge-paths/smoothstep.d.ts +22 -0
- package/dist/types/src/core/edge-paths/straight.d.ts +12 -0
- package/dist/types/src/core/edge-paths/utils.d.ts +30 -0
- package/dist/types/src/core/edge-utils.d.ts +57 -0
- package/dist/types/src/core/export.d.ts +12 -0
- package/dist/types/src/core/floating-edge.d.ts +33 -0
- package/dist/types/src/core/geometry.d.ts +79 -0
- package/dist/types/src/core/gradients.d.ts +30 -0
- package/dist/types/src/core/graph.d.ts +38 -0
- package/dist/types/src/core/helper-lines.d.ts +32 -0
- package/dist/types/src/core/history.d.ts +19 -0
- package/dist/types/src/core/index.d.ts +17 -0
- package/dist/types/src/core/intersection.d.ts +30 -0
- package/dist/types/src/core/keyboard-shortcuts.d.ts +45 -0
- package/dist/types/src/core/lasso-hit-test.d.ts +25 -0
- package/dist/types/src/core/lasso.d.ts +10 -0
- package/dist/types/src/core/layout/dagre.d.ts +11 -0
- package/dist/types/src/core/layout/elk.d.ts +13 -0
- package/dist/types/src/core/layout/force.d.ts +15 -0
- package/dist/types/src/core/layout/hierarchy.d.ts +13 -0
- package/dist/types/src/core/long-press.d.ts +11 -0
- package/dist/types/src/core/markers.d.ts +49 -0
- package/dist/types/src/core/minimap.d.ts +18 -0
- package/dist/types/src/core/node-flags.d.ts +19 -0
- package/dist/types/src/core/pan-zoom.d.ts +62 -0
- package/dist/types/src/core/proximity-connect.d.ts +25 -0
- package/dist/types/src/core/registry.d.ts +16 -0
- package/dist/types/src/core/render-plan.d.ts +52 -0
- package/dist/types/src/core/resize.d.ts +31 -0
- package/dist/types/src/core/rotation.d.ts +8 -0
- package/dist/types/src/core/selection-box.d.ts +14 -0
- package/dist/types/src/core/shapes.d.ts +10 -0
- package/dist/types/src/core/sub-flow.d.ts +61 -0
- package/dist/types/src/core/svg-path.d.ts +5 -0
- package/dist/types/src/core/types.d.ts +1238 -0
- package/dist/types/src/core/wire-bridge.d.ts +36 -0
- package/dist/types/src/index.d.ts +43 -0
- package/dist/types/src/layout/dagre.d.ts +2 -0
- package/dist/types/src/layout/elk.d.ts +2 -0
- package/dist/types/src/layout/force.d.ts +2 -0
- package/dist/types/src/layout/hierarchy.d.ts +2 -0
- package/dist/types/src/plugin/connection-utils.d.ts +54 -0
- package/dist/types/src/plugin/data/__test-utils.d.ts +9 -0
- package/dist/types/src/plugin/data/canvas-animation.d.ts +62 -0
- package/dist/types/src/plugin/data/canvas-collapse.d.ts +35 -0
- package/dist/types/src/plugin/data/canvas-compute.d.ts +6 -0
- package/dist/types/src/plugin/data/canvas-condense.d.ts +19 -0
- package/dist/types/src/plugin/data/canvas-config.d.ts +4 -0
- package/dist/types/src/plugin/data/canvas-context.d.ts +570 -0
- package/dist/types/src/plugin/data/canvas-dom.d.ts +13 -0
- package/dist/types/src/plugin/data/canvas-edges.d.ts +37 -0
- package/dist/types/src/plugin/data/canvas-history.d.ts +53 -0
- package/dist/types/src/plugin/data/canvas-layout.d.ts +151 -0
- package/dist/types/src/plugin/data/canvas-nodes.d.ts +73 -0
- package/dist/types/src/plugin/data/canvas-rows.d.ts +13 -0
- package/dist/types/src/plugin/data/canvas-selection.d.ts +45 -0
- package/dist/types/src/plugin/data/canvas-validation.d.ts +21 -0
- package/dist/types/src/plugin/data/canvas-viewport.d.ts +111 -0
- package/dist/types/src/plugin/data/flow-canvas.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-action.d.ts +12 -0
- package/dist/types/src/plugin/directives/flow-animate.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-arrow-draw.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-circle-draw.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-collapse.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-condense.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-context-menu.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-detail.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-devtools.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-drag-handle.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-draggable.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-edge-toolbar.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-edge.d.ts +7 -0
- package/dist/types/src/plugin/directives/flow-eraser.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-filter.d.ts +9 -0
- package/dist/types/src/plugin/directives/flow-follow.d.ts +9 -0
- package/dist/types/src/plugin/directives/flow-freehand.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-handle-connectable.d.ts +12 -0
- package/dist/types/src/plugin/directives/flow-handle-limit.d.ts +9 -0
- package/dist/types/src/plugin/directives/flow-handle-validate.d.ts +10 -0
- package/dist/types/src/plugin/directives/flow-handle.d.ts +29 -0
- package/dist/types/src/plugin/directives/flow-highlighter.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-loading.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-node-toolbar.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-node.d.ts +10 -0
- package/dist/types/src/plugin/directives/flow-panel.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-rectangle-draw.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-resizer.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-rotate.d.ts +11 -0
- package/dist/types/src/plugin/directives/flow-row-select.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-snapshot.d.ts +14 -0
- package/dist/types/src/plugin/directives/flow-text-tool.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-timeline.d.ts +2 -0
- package/dist/types/src/plugin/directives/flow-viewport.d.ts +2 -0
- package/dist/types/src/plugin/magics/flow.d.ts +2 -0
- package/dist/types/src/plugin/store.d.ts +2 -0
- package/dist/types/src/whiteboard/index.d.ts +2 -0
- package/package.json +153 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpineflow-force.js","sources":["../node_modules/d3-force/src/center.js","../node_modules/d3-quadtree/src/add.js","../node_modules/d3-quadtree/src/cover.js","../node_modules/d3-quadtree/src/data.js","../node_modules/d3-quadtree/src/extent.js","../node_modules/d3-quadtree/src/quad.js","../node_modules/d3-quadtree/src/find.js","../node_modules/d3-quadtree/src/remove.js","../node_modules/d3-quadtree/src/root.js","../node_modules/d3-quadtree/src/size.js","../node_modules/d3-quadtree/src/visit.js","../node_modules/d3-quadtree/src/visitAfter.js","../node_modules/d3-quadtree/src/x.js","../node_modules/d3-quadtree/src/y.js","../node_modules/d3-quadtree/src/quadtree.js","../node_modules/d3-force/src/constant.js","../node_modules/d3-force/src/jiggle.js","../node_modules/d3-force/src/collide.js","../node_modules/d3-force/src/link.js","../node_modules/d3-force/src/lcg.js","../node_modules/d3-force/src/simulation.js","../node_modules/d3-force/src/manyBody.js","../src/core/layout/force.ts","../src/layout/force.ts","../lib/force.cdn.ts"],"sourcesContent":["export default function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n}\n","export default function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n}\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nexport function addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n","export default function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n}\n","export default function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n}\n","export default function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n}\n","export default function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new Quad(node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new Quad(node[3], xm, ym, x2, y2),\n new Quad(node[2], x1, ym, xm, y2),\n new Quad(node[1], xm, y1, x2, ym),\n new Quad(node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n}\n","export default function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n}\n\nexport function removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n","export default function() {\n return this._root;\n}\n","export default function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n }\n }\n return this;\n}\n","import Quad from \"./quad.js\";\n\nexport default function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n}\n","export function defaultX(d) {\n return d[0];\n}\n\nexport default function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n}\n","export function defaultY(d) {\n return d[1];\n}\n\nexport default function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n}\n","import tree_add, {addAll as tree_addAll} from \"./add.js\";\nimport tree_cover from \"./cover.js\";\nimport tree_data from \"./data.js\";\nimport tree_extent from \"./extent.js\";\nimport tree_find from \"./find.js\";\nimport tree_remove, {removeAll as tree_removeAll} from \"./remove.js\";\nimport tree_root from \"./root.js\";\nimport tree_size from \"./size.js\";\nimport tree_visit from \"./visit.js\";\nimport tree_visitAfter from \"./visitAfter.js\";\nimport tree_x, {defaultX} from \"./x.js\";\nimport tree_y, {defaultY} from \"./y.js\";\n\nexport default function quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = tree_add;\ntreeProto.addAll = tree_addAll;\ntreeProto.cover = tree_cover;\ntreeProto.data = tree_data;\ntreeProto.extent = tree_extent;\ntreeProto.find = tree_find;\ntreeProto.remove = tree_remove;\ntreeProto.removeAll = tree_removeAll;\ntreeProto.root = tree_root;\ntreeProto.size = tree_size;\ntreeProto.visit = tree_visit;\ntreeProto.visitAfter = tree_visitAfter;\ntreeProto.x = tree_x;\ntreeProto.y = tree_y;\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","export default function(random) {\n return (random() - 0.5) * 1e-6;\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\nexport default function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = constant(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = quadtree(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : radius;\n };\n\n return force;\n}\n","import constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\nexport default function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = constant(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || jiggle(random);\n y = target.y + target.vy - source.y - source.vy || jiggle(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : constant(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n}\n","// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\nexport default function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {timer} from \"d3-timer\";\nimport lcg from \"./lcg.js\";\n\nexport function x(d) {\n return d.x;\n}\n\nexport function y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\nexport default function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = timer(step),\n event = dispatch(\"tick\", \"end\"),\n random = lcg();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n}\n","import {quadtree} from \"d3-quadtree\";\nimport constant from \"./constant.js\";\nimport jiggle from \"./jiggle.js\";\nimport {x, y} from \"./simulation.js\";\n\nexport default function() {\n var nodes,\n node,\n random,\n alpha,\n strength = constant(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = quadtree(nodes, x, y).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = jiggle(random), l += x * x;\n if (y === 0) y = jiggle(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : constant(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n}\n","// ============================================================================\n// Force-Directed Auto-Layout\n//\n// Computes organic/physics-based node positions using d3-force.\n// Returns a position map — does NOT mutate nodes directly.\n// ============================================================================\n\nimport { forceSimulation, forceLink, forceManyBody, forceCenter, forceCollide } from 'd3-force';\nimport type { FlowNode, FlowEdge } from '../types';\nimport { DEFAULT_NODE_WIDTH, DEFAULT_NODE_HEIGHT } from '../geometry';\n\nexport interface ForceLayoutOptions {\n strength?: number;\n distance?: number;\n charge?: number;\n iterations?: number;\n center?: { x: number; y: number };\n}\n\ninterface SimNode {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\ninterface SimLink {\n source: string;\n target: string;\n}\n\nexport function computeForceLayout(\n nodes: FlowNode[],\n edges: FlowEdge[],\n options: ForceLayoutOptions = {},\n): Map<string, { x: number; y: number }> {\n const {\n strength = 1,\n distance = 150,\n charge = -300,\n iterations = 300,\n center = { x: 0, y: 0 },\n } = options;\n\n const simNodes: SimNode[] = nodes.map((node) => ({\n id: node.id,\n x: node.position?.x ?? 0,\n y: node.position?.y ?? 0,\n width: node.dimensions?.width ?? DEFAULT_NODE_WIDTH,\n height: node.dimensions?.height ?? DEFAULT_NODE_HEIGHT,\n }));\n\n const simLinks: SimLink[] = edges.map((edge) => ({\n source: edge.source,\n target: edge.target,\n }));\n\n const simulation = forceSimulation(simNodes)\n .force('link', forceLink<SimNode, SimLink>(simLinks).id((d) => d.id).strength(strength).distance(distance))\n .force('charge', forceManyBody().strength(charge))\n .force('center', forceCenter(center.x, center.y))\n .force('collide', forceCollide<SimNode>().radius((d) => Math.max(d.width, d.height) / 2 + 10))\n .stop();\n\n simulation.tick(iterations);\n\n // d3-force uses center coords; convert to top-left\n const positions = new Map<string, { x: number; y: number }>();\n for (const simNode of simNodes) {\n positions.set(simNode.id, {\n x: simNode.x - simNode.width / 2,\n y: simNode.y - simNode.height / 2,\n });\n }\n\n return positions;\n}\n","import type { Alpine } from 'alpinejs';\nimport { registerAddon } from '../core/registry';\nimport { computeForceLayout } from '../core/layout/force';\n\nexport default function AlpineFlowForce(_Alpine: Alpine): void {\n registerAddon('layout:force', computeForceLayout);\n}\n","import AlpineFlowForce from './force';\n\ndocument.addEventListener('alpine:init', () => {\n (window as any).Alpine.plugin(AlpineFlowForce);\n});\n"],"names":["forceCenter","x","y","nodes","strength","force","n","node","sx","sy","_","tree_add","d","add","tree","parent","leaf","x0","y0","x1","y1","xm","ym","xp","yp","right","bottom","i","j","addAll","data","xz","yz","tree_cover","z","tree_data","tree_extent","Quad","tree_find","radius","x2","y2","x3","y3","quads","q","dx","dy","d2","tree_remove","retainer","previous","next","removeAll","tree_root","tree_size","size","tree_visit","callback","child","tree_visitAfter","defaultX","tree_x","defaultY","tree_y","quadtree","Quadtree","leaf_copy","copy","treeProto","tree_addAll","tree_removeAll","constant","jiggle","random","forceCollide","radii","iterations","xi","yi","ri","ri2","k","prepare","apply","quad","rj","r","l","initialize","_nodes","_random","index","find","nodeById","nodeId","forceLink","links","id","defaultStrength","strengths","distance","distances","count","bias","link","alpha","source","target","b","m","initializeStrength","initializeDistance","a","c","lcg","s","initialRadius","initialAngle","forceSimulation","simulation","alphaMin","alphaDecay","alphaTarget","velocityDecay","forces","stepper","timer","step","event","dispatch","tick","initializeNodes","angle","initializeForce","name","closest","forceManyBody","distanceMin2","distanceMax2","theta2","accumulate","weight","w","computeForceLayout","edges","options","charge","center","simNodes","DEFAULT_NODE_WIDTH","DEFAULT_NODE_HEIGHT","simLinks","edge","positions","simNode","AlpineFlowForce","_Alpine","registerAddon"],"mappings":";;;AAAe,SAAAA,EAASC,GAAGC,GAAG;AAC5B,MAAIC,GAAOC,IAAW;AAEtB,EAAIH,KAAK,SAAMA,IAAI,IACfC,KAAK,SAAMA,IAAI;AAEnB,WAASG,IAAQ;AACf,QAAI,GACAC,IAAIH,EAAM,QACVI,GACAC,IAAK,GACLC,IAAK;AAET,SAAK,IAAI,GAAG,IAAIH,GAAG,EAAE;AACnB,MAAAC,IAAOJ,EAAM,CAAC,GAAGK,KAAMD,EAAK,GAAGE,KAAMF,EAAK;AAG5C,SAAKC,KAAMA,IAAKF,IAAIL,KAAKG,GAAUK,KAAMA,IAAKH,IAAIJ,KAAKE,GAAU,IAAI,GAAG,IAAIE,GAAG,EAAE;AAC/E,MAAAC,IAAOJ,EAAM,CAAC,GAAGI,EAAK,KAAKC,GAAID,EAAK,KAAKE;AAAA,EAE7C;AAEA,SAAAJ,EAAM,aAAa,SAASK,GAAG;AAC7B,IAAAP,IAAQO;AAAA,EACV,GAEAL,EAAM,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AAM,KAAK,IAAIA,EAAE,OAAOA,EAAE,MAAM,IAAI,IAAI,EAAE,CAAC,EAC5F,KAAA,EAEQ,KAAKiE,CAAU;AAG1B,QAAM6E,wBAAgB,IAAA;AACtB,aAAWC,KAAWN;AACpB,IAAAK,EAAU,IAAIC,EAAQ,IAAI;AAAA,MACxB,GAAGA,EAAQ,IAAIA,EAAQ,QAAQ;AAAA,MAC/B,GAAGA,EAAQ,IAAIA,EAAQ,SAAS;AAAA,IAAA,CACjC;AAGH,SAAOD;AACT;ACzEA,SAAwBE,GAAgBC,GAAuB;AAC7D,EAAAC,EAAc,gBAAgBd,EAAkB;AAClD;ACJA,SAAS,iBAAiB,eAAe,MAAM;AAC5C,SAAe,OAAO,OAAOY,EAAe;AAC/C,CAAC;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
const T = "__alpineflow_registry__";
|
|
2
|
+
function D() {
|
|
3
|
+
return typeof globalThis < "u" ? (globalThis[T] || (globalThis[T] = /* @__PURE__ */ new Map()), globalThis[T]) : /* @__PURE__ */ new Map();
|
|
4
|
+
}
|
|
5
|
+
function O(e, n) {
|
|
6
|
+
D().set(e, n);
|
|
7
|
+
}
|
|
8
|
+
function F(e, n) {
|
|
9
|
+
return e.parent === n.parent ? 1 : 2;
|
|
10
|
+
}
|
|
11
|
+
function P(e) {
|
|
12
|
+
return e.reduce(W, 0) / e.length;
|
|
13
|
+
}
|
|
14
|
+
function W(e, n) {
|
|
15
|
+
return e + n.x;
|
|
16
|
+
}
|
|
17
|
+
function Y(e) {
|
|
18
|
+
return 1 + e.reduce(C, 0);
|
|
19
|
+
}
|
|
20
|
+
function C(e, n) {
|
|
21
|
+
return Math.max(e, n.y);
|
|
22
|
+
}
|
|
23
|
+
function K(e) {
|
|
24
|
+
for (var n; n = e.children; ) e = n[0];
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function U(e) {
|
|
28
|
+
for (var n; n = e.children; ) e = n[n.length - 1];
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
function $() {
|
|
32
|
+
var e = F, n = 1, t = 1, r = !1;
|
|
33
|
+
function u(a) {
|
|
34
|
+
var h, p = 0;
|
|
35
|
+
a.eachAfter(function(l) {
|
|
36
|
+
var o = l.children;
|
|
37
|
+
o ? (l.x = P(o), l.y = Y(o)) : (l.x = h ? p += e(l, h) : 0, l.y = 0, h = l);
|
|
38
|
+
});
|
|
39
|
+
var y = K(a), i = U(a), f = y.x - e(y, i) / 2, s = i.x + e(i, y) / 2;
|
|
40
|
+
return a.eachAfter(r ? function(l) {
|
|
41
|
+
l.x = (l.x - a.x) * n, l.y = (a.y - l.y) * t;
|
|
42
|
+
} : function(l) {
|
|
43
|
+
l.x = (l.x - f) / (s - f) * n, l.y = (1 - (a.y ? l.y / a.y : 1)) * t;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return u.separation = function(a) {
|
|
47
|
+
return arguments.length ? (e = a, u) : e;
|
|
48
|
+
}, u.size = function(a) {
|
|
49
|
+
return arguments.length ? (r = !1, n = +a[0], t = +a[1], u) : r ? null : [n, t];
|
|
50
|
+
}, u.nodeSize = function(a) {
|
|
51
|
+
return arguments.length ? (r = !0, n = +a[0], t = +a[1], u) : r ? [n, t] : null;
|
|
52
|
+
}, u;
|
|
53
|
+
}
|
|
54
|
+
function j(e) {
|
|
55
|
+
var n = 0, t = e.children, r = t && t.length;
|
|
56
|
+
if (!r) n = 1;
|
|
57
|
+
else for (; --r >= 0; ) n += t[r].value;
|
|
58
|
+
e.value = n;
|
|
59
|
+
}
|
|
60
|
+
function G() {
|
|
61
|
+
return this.eachAfter(j);
|
|
62
|
+
}
|
|
63
|
+
function V(e, n) {
|
|
64
|
+
let t = -1;
|
|
65
|
+
for (const r of this)
|
|
66
|
+
e.call(n, r, ++t, this);
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
function X(e, n) {
|
|
70
|
+
for (var t = this, r = [t], u, a, h = -1; t = r.pop(); )
|
|
71
|
+
if (e.call(n, t, ++h, this), u = t.children)
|
|
72
|
+
for (a = u.length - 1; a >= 0; --a)
|
|
73
|
+
r.push(u[a]);
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
function q(e, n) {
|
|
77
|
+
for (var t = this, r = [t], u = [], a, h, p, y = -1; t = r.pop(); )
|
|
78
|
+
if (u.push(t), a = t.children)
|
|
79
|
+
for (h = 0, p = a.length; h < p; ++h)
|
|
80
|
+
r.push(a[h]);
|
|
81
|
+
for (; t = u.pop(); )
|
|
82
|
+
e.call(n, t, ++y, this);
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
function J(e, n) {
|
|
86
|
+
let t = -1;
|
|
87
|
+
for (const r of this)
|
|
88
|
+
if (e.call(n, r, ++t, this))
|
|
89
|
+
return r;
|
|
90
|
+
}
|
|
91
|
+
function Q(e) {
|
|
92
|
+
return this.eachAfter(function(n) {
|
|
93
|
+
for (var t = +e(n.data) || 0, r = n.children, u = r && r.length; --u >= 0; ) t += r[u].value;
|
|
94
|
+
n.value = t;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function Z(e) {
|
|
98
|
+
return this.eachBefore(function(n) {
|
|
99
|
+
n.children && n.children.sort(e);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function v(e) {
|
|
103
|
+
for (var n = this, t = ee(n, e), r = [n]; n !== t; )
|
|
104
|
+
n = n.parent, r.push(n);
|
|
105
|
+
for (var u = r.length; e !== t; )
|
|
106
|
+
r.splice(u, 0, e), e = e.parent;
|
|
107
|
+
return r;
|
|
108
|
+
}
|
|
109
|
+
function ee(e, n) {
|
|
110
|
+
if (e === n) return e;
|
|
111
|
+
var t = e.ancestors(), r = n.ancestors(), u = null;
|
|
112
|
+
for (e = t.pop(), n = r.pop(); e === n; )
|
|
113
|
+
u = e, e = t.pop(), n = r.pop();
|
|
114
|
+
return u;
|
|
115
|
+
}
|
|
116
|
+
function ne() {
|
|
117
|
+
for (var e = this, n = [e]; e = e.parent; )
|
|
118
|
+
n.push(e);
|
|
119
|
+
return n;
|
|
120
|
+
}
|
|
121
|
+
function te() {
|
|
122
|
+
return Array.from(this);
|
|
123
|
+
}
|
|
124
|
+
function re() {
|
|
125
|
+
var e = [];
|
|
126
|
+
return this.eachBefore(function(n) {
|
|
127
|
+
n.children || e.push(n);
|
|
128
|
+
}), e;
|
|
129
|
+
}
|
|
130
|
+
function ie() {
|
|
131
|
+
var e = this, n = [];
|
|
132
|
+
return e.each(function(t) {
|
|
133
|
+
t !== e && n.push({ source: t.parent, target: t });
|
|
134
|
+
}), n;
|
|
135
|
+
}
|
|
136
|
+
function* ue() {
|
|
137
|
+
var e = this, n, t = [e], r, u, a;
|
|
138
|
+
do
|
|
139
|
+
for (n = t.reverse(), t = []; e = n.pop(); )
|
|
140
|
+
if (yield e, r = e.children)
|
|
141
|
+
for (u = 0, a = r.length; u < a; ++u)
|
|
142
|
+
t.push(r[u]);
|
|
143
|
+
while (t.length);
|
|
144
|
+
}
|
|
145
|
+
function H(e, n) {
|
|
146
|
+
e instanceof Map ? (e = [void 0, e], n === void 0 && (n = ce)) : n === void 0 && (n = le);
|
|
147
|
+
for (var t = new A(e), r, u = [t], a, h, p, y; r = u.pop(); )
|
|
148
|
+
if ((h = n(r.data)) && (y = (h = Array.from(h)).length))
|
|
149
|
+
for (r.children = h, p = y - 1; p >= 0; --p)
|
|
150
|
+
u.push(a = h[p] = new A(h[p])), a.parent = r, a.depth = r.depth + 1;
|
|
151
|
+
return t.eachBefore(N);
|
|
152
|
+
}
|
|
153
|
+
function ae() {
|
|
154
|
+
return H(this).eachBefore(oe);
|
|
155
|
+
}
|
|
156
|
+
function le(e) {
|
|
157
|
+
return e.children;
|
|
158
|
+
}
|
|
159
|
+
function ce(e) {
|
|
160
|
+
return Array.isArray(e) ? e[1] : null;
|
|
161
|
+
}
|
|
162
|
+
function oe(e) {
|
|
163
|
+
e.data.value !== void 0 && (e.value = e.data.value), e.data = e.data.data;
|
|
164
|
+
}
|
|
165
|
+
function N(e) {
|
|
166
|
+
var n = 0;
|
|
167
|
+
do
|
|
168
|
+
e.height = n;
|
|
169
|
+
while ((e = e.parent) && e.height < ++n);
|
|
170
|
+
}
|
|
171
|
+
function A(e) {
|
|
172
|
+
this.data = e, this.depth = this.height = 0, this.parent = null;
|
|
173
|
+
}
|
|
174
|
+
A.prototype = H.prototype = {
|
|
175
|
+
constructor: A,
|
|
176
|
+
count: G,
|
|
177
|
+
each: V,
|
|
178
|
+
eachAfter: q,
|
|
179
|
+
eachBefore: X,
|
|
180
|
+
find: J,
|
|
181
|
+
sum: Q,
|
|
182
|
+
sort: Z,
|
|
183
|
+
path: v,
|
|
184
|
+
ancestors: ne,
|
|
185
|
+
descendants: te,
|
|
186
|
+
leaves: re,
|
|
187
|
+
links: ie,
|
|
188
|
+
copy: ae,
|
|
189
|
+
[Symbol.iterator]: ue
|
|
190
|
+
};
|
|
191
|
+
function B(e) {
|
|
192
|
+
return e == null ? null : he(e);
|
|
193
|
+
}
|
|
194
|
+
function he(e) {
|
|
195
|
+
if (typeof e != "function") throw new Error();
|
|
196
|
+
return e;
|
|
197
|
+
}
|
|
198
|
+
var fe = { depth: -1 }, k = {}, E = {};
|
|
199
|
+
function se(e) {
|
|
200
|
+
return e.id;
|
|
201
|
+
}
|
|
202
|
+
function de(e) {
|
|
203
|
+
return e.parentId;
|
|
204
|
+
}
|
|
205
|
+
function pe() {
|
|
206
|
+
var e = se, n = de, t;
|
|
207
|
+
function r(u) {
|
|
208
|
+
var a = Array.from(u), h = e, p = n, y, i, f, s, l, o, d, _, c = /* @__PURE__ */ new Map();
|
|
209
|
+
if (t != null) {
|
|
210
|
+
const w = a.map((m, z) => ge(t(m, z, u))), g = w.map(b), x = new Set(w).add("");
|
|
211
|
+
for (const m of g)
|
|
212
|
+
x.has(m) || (x.add(m), w.push(m), g.push(b(m)), a.push(E));
|
|
213
|
+
h = (m, z) => w[z], p = (m, z) => g[z];
|
|
214
|
+
}
|
|
215
|
+
for (f = 0, y = a.length; f < y; ++f)
|
|
216
|
+
i = a[f], o = a[f] = new A(i), (d = h(i, f, u)) != null && (d += "") && (_ = o.id = d, c.set(_, c.has(_) ? k : o)), (d = p(i, f, u)) != null && (d += "") && (o.parent = d);
|
|
217
|
+
for (f = 0; f < y; ++f)
|
|
218
|
+
if (o = a[f], d = o.parent) {
|
|
219
|
+
if (l = c.get(d), !l) throw new Error("missing: " + d);
|
|
220
|
+
if (l === k) throw new Error("ambiguous: " + d);
|
|
221
|
+
l.children ? l.children.push(o) : l.children = [o], o.parent = l;
|
|
222
|
+
} else {
|
|
223
|
+
if (s) throw new Error("multiple roots");
|
|
224
|
+
s = o;
|
|
225
|
+
}
|
|
226
|
+
if (!s) throw new Error("no root");
|
|
227
|
+
if (t != null) {
|
|
228
|
+
for (; s.data === E && s.children.length === 1; )
|
|
229
|
+
s = s.children[0], --y;
|
|
230
|
+
for (let w = a.length - 1; w >= 0 && (o = a[w], o.data === E); --w)
|
|
231
|
+
o.data = null;
|
|
232
|
+
}
|
|
233
|
+
if (s.parent = fe, s.eachBefore(function(w) {
|
|
234
|
+
w.depth = w.parent.depth + 1, --y;
|
|
235
|
+
}).eachBefore(N), s.parent = null, y > 0) throw new Error("cycle");
|
|
236
|
+
return s;
|
|
237
|
+
}
|
|
238
|
+
return r.id = function(u) {
|
|
239
|
+
return arguments.length ? (e = B(u), r) : e;
|
|
240
|
+
}, r.parentId = function(u) {
|
|
241
|
+
return arguments.length ? (n = B(u), r) : n;
|
|
242
|
+
}, r.path = function(u) {
|
|
243
|
+
return arguments.length ? (t = B(u), r) : t;
|
|
244
|
+
}, r;
|
|
245
|
+
}
|
|
246
|
+
function ge(e) {
|
|
247
|
+
e = `${e}`;
|
|
248
|
+
let n = e.length;
|
|
249
|
+
return L(e, n - 1) && !L(e, n - 2) && (e = e.slice(0, -1)), e[0] === "/" ? e : `/${e}`;
|
|
250
|
+
}
|
|
251
|
+
function b(e) {
|
|
252
|
+
let n = e.length;
|
|
253
|
+
if (n < 2) return "";
|
|
254
|
+
for (; --n > 1 && !L(e, n); ) ;
|
|
255
|
+
return e.slice(0, n);
|
|
256
|
+
}
|
|
257
|
+
function L(e, n) {
|
|
258
|
+
if (e[n] === "/") {
|
|
259
|
+
let t = 0;
|
|
260
|
+
for (; n > 0 && e[--n] === "\\"; ) ++t;
|
|
261
|
+
if ((t & 1) === 0) return !0;
|
|
262
|
+
}
|
|
263
|
+
return !1;
|
|
264
|
+
}
|
|
265
|
+
function ye(e, n) {
|
|
266
|
+
return e.parent === n.parent ? 1 : 2;
|
|
267
|
+
}
|
|
268
|
+
function S(e) {
|
|
269
|
+
var n = e.children;
|
|
270
|
+
return n ? n[0] : e.t;
|
|
271
|
+
}
|
|
272
|
+
function M(e) {
|
|
273
|
+
var n = e.children;
|
|
274
|
+
return n ? n[n.length - 1] : e.t;
|
|
275
|
+
}
|
|
276
|
+
function we(e, n, t) {
|
|
277
|
+
var r = t / (n.i - e.i);
|
|
278
|
+
n.c -= r, n.s += t, e.c += r, n.z += t, n.m += t;
|
|
279
|
+
}
|
|
280
|
+
function _e(e) {
|
|
281
|
+
for (var n = 0, t = 0, r = e.children, u = r.length, a; --u >= 0; )
|
|
282
|
+
a = r[u], a.z += n, a.m += n, n += a.s + (t += a.c);
|
|
283
|
+
}
|
|
284
|
+
function me(e, n, t) {
|
|
285
|
+
return e.a.parent === n.parent ? e.a : t;
|
|
286
|
+
}
|
|
287
|
+
function R(e, n) {
|
|
288
|
+
this._ = e, this.parent = null, this.children = null, this.A = null, this.a = this, this.z = 0, this.m = 0, this.c = 0, this.s = 0, this.t = null, this.i = n;
|
|
289
|
+
}
|
|
290
|
+
R.prototype = Object.create(A.prototype);
|
|
291
|
+
function xe(e) {
|
|
292
|
+
for (var n = new R(e, 0), t, r = [n], u, a, h, p; t = r.pop(); )
|
|
293
|
+
if (a = t._.children)
|
|
294
|
+
for (t.children = new Array(p = a.length), h = p - 1; h >= 0; --h)
|
|
295
|
+
r.push(u = t.children[h] = new R(a[h], h)), u.parent = t;
|
|
296
|
+
return (n.parent = new R(null, 0)).children = [n], n;
|
|
297
|
+
}
|
|
298
|
+
function Ae() {
|
|
299
|
+
var e = ye, n = 1, t = 1, r = null;
|
|
300
|
+
function u(i) {
|
|
301
|
+
var f = xe(i);
|
|
302
|
+
if (f.eachAfter(a), f.parent.m = -f.z, f.eachBefore(h), r) i.eachBefore(y);
|
|
303
|
+
else {
|
|
304
|
+
var s = i, l = i, o = i;
|
|
305
|
+
i.eachBefore(function(g) {
|
|
306
|
+
g.x < s.x && (s = g), g.x > l.x && (l = g), g.depth > o.depth && (o = g);
|
|
307
|
+
});
|
|
308
|
+
var d = s === l ? 1 : e(s, l) / 2, _ = d - s.x, c = n / (l.x + d + _), w = t / (o.depth || 1);
|
|
309
|
+
i.eachBefore(function(g) {
|
|
310
|
+
g.x = (g.x + _) * c, g.y = g.depth * w;
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return i;
|
|
314
|
+
}
|
|
315
|
+
function a(i) {
|
|
316
|
+
var f = i.children, s = i.parent.children, l = i.i ? s[i.i - 1] : null;
|
|
317
|
+
if (f) {
|
|
318
|
+
_e(i);
|
|
319
|
+
var o = (f[0].z + f[f.length - 1].z) / 2;
|
|
320
|
+
l ? (i.z = l.z + e(i._, l._), i.m = i.z - o) : i.z = o;
|
|
321
|
+
} else l && (i.z = l.z + e(i._, l._));
|
|
322
|
+
i.parent.A = p(i, l, i.parent.A || s[0]);
|
|
323
|
+
}
|
|
324
|
+
function h(i) {
|
|
325
|
+
i._.x = i.z + i.parent.m, i.m += i.parent.m;
|
|
326
|
+
}
|
|
327
|
+
function p(i, f, s) {
|
|
328
|
+
if (f) {
|
|
329
|
+
for (var l = i, o = i, d = f, _ = l.parent.children[0], c = l.m, w = o.m, g = d.m, x = _.m, m; d = M(d), l = S(l), d && l; )
|
|
330
|
+
_ = S(_), o = M(o), o.a = i, m = d.z + g - l.z - c + e(d._, l._), m > 0 && (we(me(d, i, s), i, m), c += m, w += m), g += d.m, c += l.m, x += _.m, w += o.m;
|
|
331
|
+
d && !M(o) && (o.t = d, o.m += g - w), l && !S(_) && (_.t = l, _.m += c - x, s = i);
|
|
332
|
+
}
|
|
333
|
+
return s;
|
|
334
|
+
}
|
|
335
|
+
function y(i) {
|
|
336
|
+
i.x *= n, i.y = i.depth * t;
|
|
337
|
+
}
|
|
338
|
+
return u.separation = function(i) {
|
|
339
|
+
return arguments.length ? (e = i, u) : e;
|
|
340
|
+
}, u.size = function(i) {
|
|
341
|
+
return arguments.length ? (r = !1, n = +i[0], t = +i[1], u) : r ? null : [n, t];
|
|
342
|
+
}, u.nodeSize = function(i) {
|
|
343
|
+
return arguments.length ? (r = !0, n = +i[0], t = +i[1], u) : r ? [n, t] : null;
|
|
344
|
+
}, u;
|
|
345
|
+
}
|
|
346
|
+
const ze = 150, Ie = 50, I = "__virtual_root";
|
|
347
|
+
function Re(e, n, t = {}) {
|
|
348
|
+
const {
|
|
349
|
+
layoutType: r = "tree",
|
|
350
|
+
direction: u = "TB",
|
|
351
|
+
nodeWidth: a = ze,
|
|
352
|
+
nodeHeight: h = Ie
|
|
353
|
+
} = t;
|
|
354
|
+
if (e.length === 0)
|
|
355
|
+
return /* @__PURE__ */ new Map();
|
|
356
|
+
const p = /* @__PURE__ */ new Map();
|
|
357
|
+
for (const c of n)
|
|
358
|
+
p.set(c.target, c.source);
|
|
359
|
+
const y = e.filter((c) => !p.has(c.id));
|
|
360
|
+
if (y.length === 0)
|
|
361
|
+
return console.warn(
|
|
362
|
+
"[AlpineFlow] computeHierarchyLayout: no root nodes found (every node has an incoming edge). Returning empty layout."
|
|
363
|
+
), /* @__PURE__ */ new Map();
|
|
364
|
+
const i = e.map((c) => ({
|
|
365
|
+
id: c.id,
|
|
366
|
+
parentId: p.get(c.id) ?? null
|
|
367
|
+
})), f = y.length > 1;
|
|
368
|
+
if (f) {
|
|
369
|
+
i.push({ id: I, parentId: null });
|
|
370
|
+
for (const c of i)
|
|
371
|
+
c.parentId === null && c.id !== I && (c.parentId = I);
|
|
372
|
+
}
|
|
373
|
+
const s = pe().id((c) => c.id).parentId((c) => c.parentId)(i), l = r === "cluster" ? $() : Ae();
|
|
374
|
+
l.nodeSize(
|
|
375
|
+
u === "LR" ? [h * 2, a * 2] : [a * 1.5, h * 2]
|
|
376
|
+
), l(s);
|
|
377
|
+
const o = new Map(e.map((c) => [c.id, c])), d = /* @__PURE__ */ new Map(), _ = f ? u === "LR" ? a * 2 : h * 2 : 0;
|
|
378
|
+
for (const c of s.descendants()) {
|
|
379
|
+
if (c.id === I)
|
|
380
|
+
continue;
|
|
381
|
+
const w = o.get(c.id), g = w?.dimensions?.width ?? a, x = w?.dimensions?.height ?? h;
|
|
382
|
+
u === "LR" ? d.set(c.id, {
|
|
383
|
+
x: c.y - _ - g / 2,
|
|
384
|
+
y: c.x - x / 2
|
|
385
|
+
}) : d.set(c.id, {
|
|
386
|
+
x: c.x - g / 2,
|
|
387
|
+
y: c.y - _ - x / 2
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
return d;
|
|
391
|
+
}
|
|
392
|
+
function Te(e) {
|
|
393
|
+
O("layout:hierarchy", Re);
|
|
394
|
+
}
|
|
395
|
+
export {
|
|
396
|
+
Te as default
|
|
397
|
+
};
|
|
398
|
+
//# sourceMappingURL=alpineflow-hierarchy.esm.js.map
|