import { defineComponent as ut, ref as le, resolveComponent as N, openBlock as dt, createBlock as jt, withCtx as w, createElementVNode as me, createVNode as h, createTextVNode as P, createElementBlock as Ct, Fragment as Tt, nextTick as Gt, inject as zt, computed as Lt } from "vue";
import { l as mt, d as Ot, j as Ut } from "./index-fe29d0c3.mjs";
const qt = { class: "dialog-footer" }, Kt = /* @__PURE__ */ ut({
  __name: "MethodParaEditorDialog",
  setup(o, { expose: e }) {
    function t(s, l) {
      i.value = s, r = l, n.value = !0;
    }
    const n = le(!1), i = le({});
    let r;
    const a = le(), u = async (s) => {
      s && await s.validate((l) => {
        l && (n.value = !1, r && r(i.value));
      });
    };
    return e({ show: t }), (s, l) => {
      const f = N("el-input"), c = N("el-form-item"), v = N("el-option"), E = N("el-select"), y = N("el-form"), p = N("el-button"), b = N("el-dialog");
      return dt(), jt(b, {
        modelValue: n.value,
        "onUpdate:modelValue": l[5] || (l[5] = (C) => n.value = C),
        title: "Method parameter editor",
        "close-on-click-modal": !1,
        "close-on-press-escape": !1
      }, {
        footer: w(() => [
          me("span", qt, [
            h(p, {
              onClick: l[3] || (l[3] = (C) => n.value = !1)
            }, {
              default: w(() => [
                P("Cancel")
              ]),
              _: 1
            }),
            h(p, {
              type: "primary",
              onClick: l[4] || (l[4] = (C) => u(a.value))
            }, {
              default: w(() => [
                P(" Save ")
              ]),
              _: 1
            })
          ])
        ]),
        default: w(() => [
          h(y, {
            ref_key: "dataEditorFormRef",
            ref: a,
            model: i.value,
            "label-width": "120px"
          }, {
            default: w(() => [
              h(c, {
                label: "Name",
                prop: "key",
                required: ""
              }, {
                default: w(() => [
                  h(f, {
                    modelValue: i.value.key,
                    "onUpdate:modelValue": l[0] || (l[0] = (C) => i.value.key = C)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }),
              h(c, {
                label: "Description",
                prop: "description"
              }, {
                default: w(() => [
                  h(f, {
                    modelValue: i.value.description,
                    "onUpdate:modelValue": l[1] || (l[1] = (C) => i.value.description = C)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }),
              h(c, {
                label: "Data type",
                prop: "type",
                required: ""
              }, {
                default: w(() => [
                  h(E, {
                    modelValue: i.value.type,
                    "onUpdate:modelValue": l[2] || (l[2] = (C) => i.value.type = C)
                  }, {
                    default: w(() => [
                      h(v, {
                        label: "String",
                        value: "String"
                      }),
                      h(v, {
                        label: "Number",
                        value: "Number"
                      }),
                      h(v, {
                        label: "Boolean",
                        value: "Boolean"
                      }),
                      h(v, {
                        label: "Object",
                        value: "Object"
                      }),
                      h(v, {
                        label: "Array",
                        value: "Array"
                      })
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["model"])
        ]),
        _: 1
      }, 8, ["modelValue"]);
    };
  }
});
/**!
 * Sortable 1.15.2
 * @author	RubaXa   <trash@rubaxa.org>
 * @author	owenm    <owen23355@gmail.com>
 * @license MIT
 */
function gt(o, e) {
  var t = Object.keys(o);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(o);
    e && (n = n.filter(function(i) {
      return Object.getOwnPropertyDescriptor(o, i).enumerable;
    })), t.push.apply(t, n);
  }
  return t;
}
function K(o) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? gt(Object(t), !0).forEach(function(n) {
      Zt(o, n, t[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : gt(Object(t)).forEach(function(n) {
      Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
    });
  }
  return o;
}
function Xe(o) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Xe = function(e) {
    return typeof e;
  } : Xe = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Xe(o);
}
function Zt(o, e, t) {
  return e in o ? Object.defineProperty(o, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : o[e] = t, o;
}
function te() {
  return te = Object.assign || function(o) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var n in t)
        Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
    }
    return o;
  }, te.apply(this, arguments);
}
function Qt(o, e) {
  if (o == null)
    return {};
  var t = {}, n = Object.keys(o), i, r;
  for (r = 0; r < n.length; r++)
    i = n[r], !(e.indexOf(i) >= 0) && (t[i] = o[i]);
  return t;
}
function Jt(o, e) {
  if (o == null)
    return {};
  var t = Qt(o, e), n, i;
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(o);
    for (i = 0; i < r.length; i++)
      n = r[i], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (t[n] = o[n]);
  }
  return t;
}
var en = "1.15.2";
function ee(o) {
  if (typeof window < "u" && window.navigator)
    return !!/* @__PURE__ */ navigator.userAgent.match(o);
}
var ne = ee(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ne = ee(/Edge/i), vt = ee(/firefox/i), Oe = ee(/safari/i) && !ee(/chrome/i) && !ee(/android/i), xt = ee(/iP(ad|od|hone)/i), It = ee(/chrome/i) && ee(/android/i), At = {
  capture: !1,
  passive: !1
};
function S(o, e, t) {
  o.addEventListener(e, t, !ne && At);
}
function D(o, e, t) {
  o.removeEventListener(e, t, !ne && At);
}
function je(o, e) {
  if (e) {
    if (e[0] === ">" && (e = e.substring(1)), o)
      try {
        if (o.matches)
          return o.matches(e);
        if (o.msMatchesSelector)
          return o.msMatchesSelector(e);
        if (o.webkitMatchesSelector)
          return o.webkitMatchesSelector(e);
      } catch {
        return !1;
      }
    return !1;
  }
}
function tn(o) {
  return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
}
function U(o, e, t, n) {
  if (o) {
    t = t || document;
    do {
      if (e != null && (e[0] === ">" ? o.parentNode === t && je(o, e) : je(o, e)) || n && o === t)
        return o;
      if (o === t)
        break;
    } while (o = tn(o));
  }
  return null;
}
var bt = /\s+/g;
function H(o, e, t) {
  if (o && e)
    if (o.classList)
      o.classList[t ? "add" : "remove"](e);
    else {
      var n = (" " + o.className + " ").replace(bt, " ").replace(" " + e + " ", " ");
      o.className = (n + (t ? " " + e : "")).replace(bt, " ");
    }
}
function m(o, e, t) {
  var n = o && o.style;
  if (n) {
    if (t === void 0)
      return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (t = o.currentStyle), e === void 0 ? t : t[e];
    !(e in n) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), n[e] = t + (typeof t == "string" ? "" : "px");
  }
}
function ye(o, e) {
  var t = "";
  if (typeof o == "string")
    t = o;
  else
    do {
      var n = m(o, "transform");
      n && n !== "none" && (t = n + " " + t);
    } while (!e && (o = o.parentNode));
  var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  return i && new i(t);
}
function Pt(o, e, t) {
  if (o) {
    var n = o.getElementsByTagName(e), i = 0, r = n.length;
    if (t)
      for (; i < r; i++)
        t(n[i], i);
    return n;
  }
  return [];
}
function q() {
  var o = document.scrollingElement;
  return o || document.documentElement;
}
function F(o, e, t, n, i) {
  if (!(!o.getBoundingClientRect && o !== window)) {
    var r, a, u, s, l, f, c;
    if (o !== window && o.parentNode && o !== q() ? (r = o.getBoundingClientRect(), a = r.top, u = r.left, s = r.bottom, l = r.right, f = r.height, c = r.width) : (a = 0, u = 0, s = window.innerHeight, l = window.innerWidth, f = window.innerHeight, c = window.innerWidth), (e || t) && o !== window && (i = i || o.parentNode, !ne))
      do
        if (i && i.getBoundingClientRect && (m(i, "transform") !== "none" || t && m(i, "position") !== "static")) {
          var v = i.getBoundingClientRect();
          a -= v.top + parseInt(m(i, "border-top-width")), u -= v.left + parseInt(m(i, "border-left-width")), s = a + r.height, l = u + r.width;
          break;
        }
      while (i = i.parentNode);
    if (n && o !== window) {
      var E = ye(i || o), y = E && E.a, p = E && E.d;
      E && (a /= p, u /= y, c /= y, f /= p, s = a + f, l = u + c);
    }
    return {
      top: a,
      left: u,
      bottom: s,
      right: l,
      width: c,
      height: f
    };
  }
}
function _t(o, e, t) {
  for (var n = se(o, !0), i = F(o)[e]; n; ) {
    var r = F(n)[t], a = void 0;
    if (t === "top" || t === "left" ? a = i >= r : a = i <= r, !a)
      return n;
    if (n === q())
      break;
    n = se(n, !1);
  }
  return !1;
}
function we(o, e, t, n) {
  for (var i = 0, r = 0, a = o.children; r < a.length; ) {
    if (a[r].style.display !== "none" && a[r] !== g.ghost && (n || a[r] !== g.dragged) && U(a[r], t.draggable, o, !1)) {
      if (i === e)
        return a[r];
      i++;
    }
    r++;
  }
  return null;
}
function ct(o, e) {
  for (var t = o.lastElementChild; t && (t === g.ghost || m(t, "display") === "none" || e && !je(t, e)); )
    t = t.previousElementSibling;
  return t || null;
}
function z(o, e) {
  var t = 0;
  if (!o || !o.parentNode)
    return -1;
  for (; o = o.previousElementSibling; )
    o.nodeName.toUpperCase() !== "TEMPLATE" && o !== g.clone && (!e || je(o, e)) && t++;
  return t;
}
function yt(o) {
  var e = 0, t = 0, n = q();
  if (o)
    do {
      var i = ye(o), r = i.a, a = i.d;
      e += o.scrollLeft * r, t += o.scrollTop * a;
    } while (o !== n && (o = o.parentNode));
  return [e, t];
}
function nn(o, e) {
  for (var t in o)
    if (o.hasOwnProperty(t)) {
      for (var n in e)
        if (e.hasOwnProperty(n) && e[n] === o[t][n])
          return Number(t);
    }
  return -1;
}
function se(o, e) {
  if (!o || !o.getBoundingClientRect)
    return q();
  var t = o, n = !1;
  do
    if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
      var i = m(t);
      if (t.clientWidth < t.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
        if (!t.getBoundingClientRect || t === document.body)
          return q();
        if (n || e)
          return t;
        n = !0;
      }
    }
  while (t = t.parentNode);
  return q();
}
function on(o, e) {
  if (o && e)
    for (var t in e)
      e.hasOwnProperty(t) && (o[t] = e[t]);
  return o;
}
function Ke(o, e) {
  return Math.round(o.top) === Math.round(e.top) && Math.round(o.left) === Math.round(e.left) && Math.round(o.height) === Math.round(e.height) && Math.round(o.width) === Math.round(e.width);
}
var xe;
function Nt(o, e) {
  return function() {
    if (!xe) {
      var t = arguments, n = this;
      t.length === 1 ? o.call(n, t[0]) : o.apply(n, t), xe = setTimeout(function() {
        xe = void 0;
      }, e);
    }
  };
}
function rn() {
  clearTimeout(xe), xe = void 0;
}
function kt(o, e, t) {
  o.scrollLeft += e, o.scrollTop += t;
}
function Mt(o) {
  var e = window.Polymer, t = window.jQuery || window.Zepto;
  return e && e.dom ? e.dom(o).cloneNode(!0) : t ? t(o).clone(!0)[0] : o.cloneNode(!0);
}
function Ft(o, e, t) {
  var n = {};
  return Array.from(o.children).forEach(function(i) {
    var r, a, u, s;
    if (!(!U(i, e.draggable, o, !1) || i.animated || i === t)) {
      var l = F(i);
      n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, l.left), n.top = Math.min((a = n.top) !== null && a !== void 0 ? a : 1 / 0, l.top), n.right = Math.max((u = n.right) !== null && u !== void 0 ? u : -1 / 0, l.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, l.bottom);
    }
  }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
}
var j = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function an() {
  var o = [], e;
  return {
    captureAnimationState: function() {
      if (o = [], !!this.options.animation) {
        var n = [].slice.call(this.el.children);
        n.forEach(function(i) {
          if (!(m(i, "display") === "none" || i === g.ghost)) {
            o.push({
              target: i,
              rect: F(i)
            });
            var r = K({}, o[o.length - 1].rect);
            if (i.thisAnimationDuration) {
              var a = ye(i, !0);
              a && (r.top -= a.f, r.left -= a.e);
            }
            i.fromRect = r;
          }
        });
      }
    },
    addAnimationState: function(n) {
      o.push(n);
    },
    removeAnimationState: function(n) {
      o.splice(nn(o, {
        target: n
      }), 1);
    },
    animateAll: function(n) {
      var i = this;
      if (!this.options.animation) {
        clearTimeout(e), typeof n == "function" && n();
        return;
      }
      var r = !1, a = 0;
      o.forEach(function(u) {
        var s = 0, l = u.target, f = l.fromRect, c = F(l), v = l.prevFromRect, E = l.prevToRect, y = u.rect, p = ye(l, !0);
        p && (c.top -= p.f, c.left -= p.e), l.toRect = c, l.thisAnimationDuration && Ke(v, c) && !Ke(f, c) && // Make sure animatingRect is on line between toRect & fromRect
        (y.top - c.top) / (y.left - c.left) === (f.top - c.top) / (f.left - c.left) && (s = sn(y, v, E, i.options)), Ke(c, f) || (l.prevFromRect = f, l.prevToRect = c, s || (s = i.options.animation), i.animate(l, y, c, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(l.animationResetTimer), l.animationResetTimer = setTimeout(function() {
          l.animationTime = 0, l.prevFromRect = null, l.fromRect = null, l.prevToRect = null, l.thisAnimationDuration = null;
        }, s), l.thisAnimationDuration = s);
      }), clearTimeout(e), r ? e = setTimeout(function() {
        typeof n == "function" && n();
      }, a) : typeof n == "function" && n(), o = [];
    },
    animate: function(n, i, r, a) {
      if (a) {
        m(n, "transition", ""), m(n, "transform", "");
        var u = ye(this.el), s = u && u.a, l = u && u.d, f = (i.left - r.left) / (s || 1), c = (i.top - r.top) / (l || 1);
        n.animatingX = !!f, n.animatingY = !!c, m(n, "transform", "translate3d(" + f + "px," + c + "px,0)"), this.forRepaintDummy = ln(n), m(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), m(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
          m(n, "transition", ""), m(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
        }, a);
      }
    }
  };
}
function ln(o) {
  return o.offsetWidth;
}
function sn(o, e, t, n) {
  return Math.sqrt(Math.pow(e.top - o.top, 2) + Math.pow(e.left - o.left, 2)) / Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) * n.animation;
}
var ge = [], Ze = {
  initializeByDefault: !0
}, ke = {
  mount: function(e) {
    for (var t in Ze)
      Ze.hasOwnProperty(t) && !(t in e) && (e[t] = Ze[t]);
    ge.forEach(function(n) {
      if (n.pluginName === e.pluginName)
        throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
    }), ge.push(e);
  },
  pluginEvent: function(e, t, n) {
    var i = this;
    this.eventCanceled = !1, n.cancel = function() {
      i.eventCanceled = !0;
    };
    var r = e + "Global";
    ge.forEach(function(a) {
      t[a.pluginName] && (t[a.pluginName][r] && t[a.pluginName][r](K({
        sortable: t
      }, n)), t.options[a.pluginName] && t[a.pluginName][e] && t[a.pluginName][e](K({
        sortable: t
      }, n)));
    });
  },
  initializePlugins: function(e, t, n, i) {
    ge.forEach(function(u) {
      var s = u.pluginName;
      if (!(!e.options[s] && !u.initializeByDefault)) {
        var l = new u(e, t, e.options);
        l.sortable = e, l.options = e.options, e[s] = l, te(n, l.defaults);
      }
    });
    for (var r in e.options)
      if (e.options.hasOwnProperty(r)) {
        var a = this.modifyOption(e, r, e.options[r]);
        typeof a < "u" && (e.options[r] = a);
      }
  },
  getEventProperties: function(e, t) {
    var n = {};
    return ge.forEach(function(i) {
      typeof i.eventProperties == "function" && te(n, i.eventProperties.call(t[i.pluginName], e));
    }), n;
  },
  modifyOption: function(e, t, n) {
    var i;
    return ge.forEach(function(r) {
      e[r.pluginName] && r.optionListeners && typeof r.optionListeners[t] == "function" && (i = r.optionListeners[t].call(e[r.pluginName], n));
    }), i;
  }
};
function un(o) {
  var e = o.sortable, t = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, u = o.fromEl, s = o.oldIndex, l = o.newIndex, f = o.oldDraggableIndex, c = o.newDraggableIndex, v = o.originalEvent, E = o.putSortable, y = o.extraEventProperties;
  if (e = e || t && t[j], !!e) {
    var p, b = e.options, C = "on" + n.charAt(0).toUpperCase() + n.substr(1);
    window.CustomEvent && !ne && !Ne ? p = new CustomEvent(n, {
      bubbles: !0,
      cancelable: !0
    }) : (p = document.createEvent("Event"), p.initEvent(n, !0, !0)), p.to = a || t, p.from = u || t, p.item = i || t, p.clone = r, p.oldIndex = s, p.newIndex = l, p.oldDraggableIndex = f, p.newDraggableIndex = c, p.originalEvent = v, p.pullMode = E ? E.lastPutMode : void 0;
    var x = K(K({}, y), ke.getEventProperties(n, e));
    for (var R in x)
      p[R] = x[R];
    t && t.dispatchEvent(p), b[C] && b[C].call(e, p);
  }
}
var dn = ["evt"], $ = function(e, t) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = Jt(n, dn);
  ke.pluginEvent.bind(g)(e, t, K({
    dragEl: d,
    parentEl: A,
    ghostEl: _,
    rootEl: T,
    nextEl: he,
    lastDownEl: Ve,
    cloneEl: O,
    cloneHidden: ae,
    dragStarted: Se,
    putSortable: Y,
    activeSortable: g.active,
    originalEvent: i,
    oldIndex: _e,
    oldDraggableIndex: Ie,
    newIndex: W,
    newDraggableIndex: re,
    hideGhostForTarget: Xt,
    unhideGhostForTarget: Vt,
    cloneNowHidden: function() {
      ae = !0;
    },
    cloneNowShown: function() {
      ae = !1;
    },
    dispatchSortableEvent: function(u) {
      V({
        sortable: t,
        name: u,
        originalEvent: i
      });
    }
  }, r));
};
function V(o) {
  un(K({
    putSortable: Y,
    cloneEl: O,
    targetEl: d,
    rootEl: T,
    oldIndex: _e,
    oldDraggableIndex: Ie,
    newIndex: W,
    newDraggableIndex: re
  }, o));
}
var d, A, _, T, he, Ve, O, ae, _e, W, Ie, re, Fe, Y, be = !1, Ge = !1, ze = [], fe, L, Qe, Je, wt, Et, Se, ve, Ae, Pe = !1, Re = !1, $e, B, et = [], rt = !1, Le = [], qe = typeof document < "u", Ye = xt, Dt = Ne || ne ? "cssFloat" : "float", cn = qe && !It && !xt && "draggable" in document.createElement("div"), Rt = function() {
  if (qe) {
    if (ne)
      return !1;
    var o = document.createElement("x");
    return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
  }
}(), Yt = function(e, t) {
  var n = m(e), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = we(e, 0, t), a = we(e, 1, t), u = r && m(r), s = a && m(a), l = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + F(r).width, f = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + F(a).width;
  if (n.display === "flex")
    return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
  if (n.display === "grid")
    return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
  if (r && u.float && u.float !== "none") {
    var c = u.float === "left" ? "left" : "right";
    return a && (s.clear === "both" || s.clear === c) ? "vertical" : "horizontal";
  }
  return r && (u.display === "block" || u.display === "flex" || u.display === "table" || u.display === "grid" || l >= i && n[Dt] === "none" || a && n[Dt] === "none" && l + f > i) ? "vertical" : "horizontal";
}, fn = function(e, t, n) {
  var i = n ? e.left : e.top, r = n ? e.right : e.bottom, a = n ? e.width : e.height, u = n ? t.left : t.top, s = n ? t.right : t.bottom, l = n ? t.width : t.height;
  return i === u || r === s || i + a / 2 === u + l / 2;
}, pn = function(e, t) {
  var n;
  return ze.some(function(i) {
    var r = i[j].options.emptyInsertThreshold;
    if (!(!r || ct(i))) {
      var a = F(i), u = e >= a.left - r && e <= a.right + r, s = t >= a.top - r && t <= a.bottom + r;
      if (u && s)
        return n = i;
    }
  }), n;
}, Bt = function(e) {
  function t(r, a) {
    return function(u, s, l, f) {
      var c = u.options.group.name && s.options.group.name && u.options.group.name === s.options.group.name;
      if (r == null && (a || c))
        return !0;
      if (r == null || r === !1)
        return !1;
      if (a && r === "clone")
        return r;
      if (typeof r == "function")
        return t(r(u, s, l, f), a)(u, s, l, f);
      var v = (a ? u : s).options.group.name;
      return r === !0 || typeof r == "string" && r === v || r.join && r.indexOf(v) > -1;
    };
  }
  var n = {}, i = e.group;
  (!i || Xe(i) != "object") && (i = {
    name: i
  }), n.name = i.name, n.checkPull = t(i.pull, !0), n.checkPut = t(i.put), n.revertClone = i.revertClone, e.group = n;
}, Xt = function() {
  !Rt && _ && m(_, "display", "none");
}, Vt = function() {
  !Rt && _ && m(_, "display", "");
};
qe && !It && document.addEventListener("click", function(o) {
  if (Ge)
    return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), Ge = !1, !1;
}, !0);
var pe = function(e) {
  if (d) {
    e = e.touches ? e.touches[0] : e;
    var t = pn(e.clientX, e.clientY);
    if (t) {
      var n = {};
      for (var i in e)
        e.hasOwnProperty(i) && (n[i] = e[i]);
      n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[j]._onDragOver(n);
    }
  }
}, hn = function(e) {
  d && d.parentNode[j]._isOutsideThisEl(e.target);
};
function g(o, e) {
  if (!(o && o.nodeType && o.nodeType === 1))
    throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
  this.el = o, this.options = e = te({}, e), o[j] = this;
  var t = {
    group: null,
    sort: !0,
    disabled: !1,
    store: null,
    handle: null,
    draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
    swapThreshold: 1,
    // percentage; 0 <= x <= 1
    invertSwap: !1,
    // invert always
    invertedSwapThreshold: null,
    // will be set to same as swapThreshold if default
    removeCloneOnHide: !0,
    direction: function() {
      return Yt(o, this.options);
    },
    ghostClass: "sortable-ghost",
    chosenClass: "sortable-chosen",
    dragClass: "sortable-drag",
    ignore: "a, img",
    filter: null,
    preventOnFilter: !0,
    animation: 0,
    easing: null,
    setData: function(a, u) {
      a.setData("Text", u.textContent);
    },
    dropBubble: !1,
    dragoverBubble: !1,
    dataIdAttr: "data-id",
    delay: 0,
    delayOnTouchOnly: !1,
    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
    forceFallback: !1,
    fallbackClass: "sortable-fallback",
    fallbackOnBody: !1,
    fallbackTolerance: 0,
    fallbackOffset: {
      x: 0,
      y: 0
    },
    supportPointer: g.supportPointer !== !1 && "PointerEvent" in window && !Oe,
    emptyInsertThreshold: 5
  };
  ke.initializePlugins(this, o, t);
  for (var n in t)
    !(n in e) && (e[n] = t[n]);
  Bt(e);
  for (var i in this)
    i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
  this.nativeDraggable = e.forceFallback ? !1 : cn, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? S(o, "pointerdown", this._onTapStart) : (S(o, "mousedown", this._onTapStart), S(o, "touchstart", this._onTapStart)), this.nativeDraggable && (S(o, "dragover", this), S(o, "dragenter", this)), ze.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), te(this, an());
}
g.prototype = /** @lends Sortable.prototype */
{
  constructor: g,
  _isOutsideThisEl: function(e) {
    !this.el.contains(e) && e !== this.el && (ve = null);
  },
  _getDirection: function(e, t) {
    return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, d) : this.options.direction;
  },
  _onTapStart: function(e) {
    if (e.cancelable) {
      var t = this, n = this.el, i = this.options, r = i.preventOnFilter, a = e.type, u = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (u || e).target, l = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, f = i.filter;
      if (En(n), !d && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || i.disabled) && !l.isContentEditable && !(!this.nativeDraggable && Oe && s && s.tagName.toUpperCase() === "SELECT") && (s = U(s, i.draggable, n, !1), !(s && s.animated) && Ve !== s)) {
        if (_e = z(s), Ie = z(s, i.draggable), typeof f == "function") {
          if (f.call(this, e, s, this)) {
            V({
              sortable: t,
              rootEl: l,
              name: "filter",
              targetEl: s,
              toEl: n,
              fromEl: n
            }), $("filter", t, {
              evt: e
            }), r && e.cancelable && e.preventDefault();
            return;
          }
        } else if (f && (f = f.split(",").some(function(c) {
          if (c = U(l, c.trim(), n, !1), c)
            return V({
              sortable: t,
              rootEl: c,
              name: "filter",
              targetEl: s,
              fromEl: n,
              toEl: n
            }), $("filter", t, {
              evt: e
            }), !0;
        }), f)) {
          r && e.cancelable && e.preventDefault();
          return;
        }
        i.handle && !U(l, i.handle, n, !1) || this._prepareDragStart(e, u, s);
      }
    }
  },
  _prepareDragStart: function(e, t, n) {
    var i = this, r = i.el, a = i.options, u = r.ownerDocument, s;
    if (n && !d && n.parentNode === r) {
      var l = F(n);
      if (T = r, d = n, A = d.parentNode, he = d.nextSibling, Ve = n, Fe = a.group, g.dragged = d, fe = {
        target: d,
        clientX: (t || e).clientX,
        clientY: (t || e).clientY
      }, wt = fe.clientX - l.left, Et = fe.clientY - l.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, d.style["will-change"] = "all", s = function() {
        if ($("delayEnded", i, {
          evt: e
        }), g.eventCanceled) {
          i._onDrop();
          return;
        }
        i._disableDelayedDragEvents(), !vt && i.nativeDraggable && (d.draggable = !0), i._triggerDragStart(e, t), V({
          sortable: i,
          name: "choose",
          originalEvent: e
        }), H(d, a.chosenClass, !0);
      }, a.ignore.split(",").forEach(function(f) {
        Pt(d, f.trim(), tt);
      }), S(u, "dragover", pe), S(u, "mousemove", pe), S(u, "touchmove", pe), S(u, "mouseup", i._onDrop), S(u, "touchend", i._onDrop), S(u, "touchcancel", i._onDrop), vt && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), $("delayStart", this, {
        evt: e
      }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Ne || ne))) {
        if (g.eventCanceled) {
          this._onDrop();
          return;
        }
        S(u, "mouseup", i._disableDelayedDrag), S(u, "touchend", i._disableDelayedDrag), S(u, "touchcancel", i._disableDelayedDrag), S(u, "mousemove", i._delayedDragTouchMoveHandler), S(u, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && S(u, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
      } else
        s();
    }
  },
  _delayedDragTouchMoveHandler: function(e) {
    var t = e.touches ? e.touches[0] : e;
    Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
  },
  _disableDelayedDrag: function() {
    d && tt(d), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
  },
  _disableDelayedDragEvents: function() {
    var e = this.el.ownerDocument;
    D(e, "mouseup", this._disableDelayedDrag), D(e, "touchend", this._disableDelayedDrag), D(e, "touchcancel", this._disableDelayedDrag), D(e, "mousemove", this._delayedDragTouchMoveHandler), D(e, "touchmove", this._delayedDragTouchMoveHandler), D(e, "pointermove", this._delayedDragTouchMoveHandler);
  },
  _triggerDragStart: function(e, t) {
    t = t || e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? S(document, "pointermove", this._onTouchMove) : t ? S(document, "touchmove", this._onTouchMove) : S(document, "mousemove", this._onTouchMove) : (S(d, "dragend", this), S(T, "dragstart", this._onDragStart));
    try {
      document.selection ? He(function() {
        document.selection.empty();
      }) : window.getSelection().removeAllRanges();
    } catch {
    }
  },
  _dragStarted: function(e, t) {
    if (be = !1, T && d) {
      $("dragStarted", this, {
        evt: t
      }), this.nativeDraggable && S(document, "dragover", hn);
      var n = this.options;
      !e && H(d, n.dragClass, !1), H(d, n.ghostClass, !0), g.active = this, e && this._appendGhost(), V({
        sortable: this,
        name: "start",
        originalEvent: t
      });
    } else
      this._nulling();
  },
  _emulateDragOver: function() {
    if (L) {
      this._lastX = L.clientX, this._lastY = L.clientY, Xt();
      for (var e = document.elementFromPoint(L.clientX, L.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(L.clientX, L.clientY), e !== t); )
        t = e;
      if (d.parentNode[j]._isOutsideThisEl(e), t)
        do {
          if (t[j]) {
            var n = void 0;
            if (n = t[j]._onDragOver({
              clientX: L.clientX,
              clientY: L.clientY,
              target: e,
              rootEl: t
            }), n && !this.options.dragoverBubble)
              break;
          }
          e = t;
        } while (t = t.parentNode);
      Vt();
    }
  },
  _onTouchMove: function(e) {
    if (fe) {
      var t = this.options, n = t.fallbackTolerance, i = t.fallbackOffset, r = e.touches ? e.touches[0] : e, a = _ && ye(_, !0), u = _ && a && a.a, s = _ && a && a.d, l = Ye && B && yt(B), f = (r.clientX - fe.clientX + i.x) / (u || 1) + (l ? l[0] - et[0] : 0) / (u || 1), c = (r.clientY - fe.clientY + i.y) / (s || 1) + (l ? l[1] - et[1] : 0) / (s || 1);
      if (!g.active && !be) {
        if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
          return;
        this._onDragStart(e, !0);
      }
      if (_) {
        a ? (a.e += f - (Qe || 0), a.f += c - (Je || 0)) : a = {
          a: 1,
          b: 0,
          c: 0,
          d: 1,
          e: f,
          f: c
        };
        var v = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
        m(_, "webkitTransform", v), m(_, "mozTransform", v), m(_, "msTransform", v), m(_, "transform", v), Qe = f, Je = c, L = r;
      }
      e.cancelable && e.preventDefault();
    }
  },
  _appendGhost: function() {
    if (!_) {
      var e = this.options.fallbackOnBody ? document.body : T, t = F(d, !0, Ye, !0, e), n = this.options;
      if (Ye) {
        for (B = e; m(B, "position") === "static" && m(B, "transform") === "none" && B !== document; )
          B = B.parentNode;
        B !== document.body && B !== document.documentElement ? (B === document && (B = q()), t.top += B.scrollTop, t.left += B.scrollLeft) : B = q(), et = yt(B);
      }
      _ = d.cloneNode(!0), H(_, n.ghostClass, !1), H(_, n.fallbackClass, !0), H(_, n.dragClass, !0), m(_, "transition", ""), m(_, "transform", ""), m(_, "box-sizing", "border-box"), m(_, "margin", 0), m(_, "top", t.top), m(_, "left", t.left), m(_, "width", t.width), m(_, "height", t.height), m(_, "opacity", "0.8"), m(_, "position", Ye ? "absolute" : "fixed"), m(_, "zIndex", "100000"), m(_, "pointerEvents", "none"), g.ghost = _, e.appendChild(_), m(_, "transform-origin", wt / parseInt(_.style.width) * 100 + "% " + Et / parseInt(_.style.height) * 100 + "%");
    }
  },
  _onDragStart: function(e, t) {
    var n = this, i = e.dataTransfer, r = n.options;
    if ($("dragStart", this, {
      evt: e
    }), g.eventCanceled) {
      this._onDrop();
      return;
    }
    $("setupClone", this), g.eventCanceled || (O = Mt(d), O.removeAttribute("id"), O.draggable = !1, O.style["will-change"] = "", this._hideClone(), H(O, this.options.chosenClass, !1), g.clone = O), n.cloneId = He(function() {
      $("clone", n), !g.eventCanceled && (n.options.removeCloneOnHide || T.insertBefore(O, d), n._hideClone(), V({
        sortable: n,
        name: "clone"
      }));
    }), !t && H(d, r.dragClass, !0), t ? (Ge = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (D(document, "mouseup", n._onDrop), D(document, "touchend", n._onDrop), D(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, d)), S(document, "drop", n), m(d, "transform", "translateZ(0)")), be = !0, n._dragStartId = He(n._dragStarted.bind(n, t, e)), S(document, "selectstart", n), Se = !0, Oe && m(document.body, "user-select", "none");
  },
  // Returns true - if no further action is needed (either inserted or another condition)
  _onDragOver: function(e) {
    var t = this.el, n = e.target, i, r, a, u = this.options, s = u.group, l = g.active, f = Fe === s, c = u.sort, v = Y || l, E, y = this, p = !1;
    if (rt)
      return;
    function b(De, Ht) {
      $(De, y, K({
        evt: e,
        isOwner: f,
        axis: E ? "vertical" : "horizontal",
        revert: a,
        dragRect: i,
        targetRect: r,
        canSort: c,
        fromSortable: v,
        target: n,
        completed: x,
        onMove: function(ht, Wt) {
          return Be(T, t, d, i, ht, F(ht), e, Wt);
        },
        changed: R
      }, Ht));
    }
    function C() {
      b("dragOverAnimationCapture"), y.captureAnimationState(), y !== v && v.captureAnimationState();
    }
    function x(De) {
      return b("dragOverCompleted", {
        insertion: De
      }), De && (f ? l._hideClone() : l._showClone(y), y !== v && (H(d, Y ? Y.options.ghostClass : l.options.ghostClass, !1), H(d, u.ghostClass, !0)), Y !== y && y !== g.active ? Y = y : y === g.active && Y && (Y = null), v === y && (y._ignoreWhileAnimating = n), y.animateAll(function() {
        b("dragOverAnimationComplete"), y._ignoreWhileAnimating = null;
      }), y !== v && (v.animateAll(), v._ignoreWhileAnimating = null)), (n === d && !d.animated || n === t && !n.animated) && (ve = null), !u.dragoverBubble && !e.rootEl && n !== document && (d.parentNode[j]._isOutsideThisEl(e.target), !De && pe(e)), !u.dragoverBubble && e.stopPropagation && e.stopPropagation(), p = !0;
    }
    function R() {
      W = z(d), re = z(d, u.draggable), V({
        sortable: y,
        name: "change",
        toEl: t,
        newIndex: W,
        newDraggableIndex: re,
        originalEvent: e
      });
    }
    if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = U(n, u.draggable, t, !0), b("dragOver"), g.eventCanceled)
      return p;
    if (d.contains(e.target) || n.animated && n.animatingX && n.animatingY || y._ignoreWhileAnimating === n)
      return x(!1);
    if (Ge = !1, l && !u.disabled && (f ? c || (a = A !== T) : Y === this || (this.lastPutMode = Fe.checkPull(this, l, d, e)) && s.checkPut(this, l, d, e))) {
      if (E = this._getDirection(e, n) === "vertical", i = F(d), b("dragOverValid"), g.eventCanceled)
        return p;
      if (a)
        return A = T, C(), this._hideClone(), b("revert"), g.eventCanceled || (he ? T.insertBefore(d, he) : T.appendChild(d)), x(!0);
      var k = ct(t, u.draggable);
      if (!k || bn(e, E, this) && !k.animated) {
        if (k === d)
          return x(!1);
        if (k && t === e.target && (n = k), n && (r = F(n)), Be(T, t, d, i, n, r, e, !!n) !== !1)
          return C(), k && k.nextSibling ? t.insertBefore(d, k.nextSibling) : t.appendChild(d), A = t, R(), x(!0);
      } else if (k && vn(e, E, this)) {
        var Z = we(t, 0, u, !0);
        if (Z === d)
          return x(!1);
        if (n = Z, r = F(n), Be(T, t, d, i, n, r, e, !1) !== !1)
          return C(), t.insertBefore(d, Z), A = t, R(), x(!0);
      } else if (n.parentNode === t) {
        r = F(n);
        var G = 0, Q, ue = d.parentNode !== t, X = !fn(d.animated && d.toRect || i, n.animated && n.toRect || r, E), de = E ? "top" : "left", I = _t(n, "top", "top") || _t(d, "top", "top"), oe = I ? I.scrollTop : void 0;
        ve !== n && (Q = r[de], Pe = !1, Re = !X && u.invertSwap || ue), G = _n(e, n, r, E, X ? 1 : u.swapThreshold, u.invertedSwapThreshold == null ? u.swapThreshold : u.invertedSwapThreshold, Re, ve === n);
        var J;
        if (G !== 0) {
          var ce = z(d);
          do
            ce -= G, J = A.children[ce];
          while (J && (m(J, "display") === "none" || J === _));
        }
        if (G === 0 || J === n)
          return x(!1);
        ve = n, Ae = G;
        var Ee = n.nextElementSibling, ie = !1;
        ie = G === 1;
        var Me = Be(T, t, d, i, n, r, e, ie);
        if (Me !== !1)
          return (Me === 1 || Me === -1) && (ie = Me === 1), rt = !0, setTimeout(gn, 30), C(), ie && !Ee ? t.appendChild(d) : n.parentNode.insertBefore(d, ie ? Ee : n), I && kt(I, 0, oe - I.scrollTop), A = d.parentNode, Q !== void 0 && !Re && ($e = Math.abs(Q - F(n)[de])), R(), x(!0);
      }
      if (t.contains(d))
        return x(!1);
    }
    return !1;
  },
  _ignoreWhileAnimating: null,
  _offMoveEvents: function() {
    D(document, "mousemove", this._onTouchMove), D(document, "touchmove", this._onTouchMove), D(document, "pointermove", this._onTouchMove), D(document, "dragover", pe), D(document, "mousemove", pe), D(document, "touchmove", pe);
  },
  _offUpEvents: function() {
    var e = this.el.ownerDocument;
    D(e, "mouseup", this._onDrop), D(e, "touchend", this._onDrop), D(e, "pointerup", this._onDrop), D(e, "touchcancel", this._onDrop), D(document, "selectstart", this);
  },
  _onDrop: function(e) {
    var t = this.el, n = this.options;
    if (W = z(d), re = z(d, n.draggable), $("drop", this, {
      evt: e
    }), A = d && d.parentNode, W = z(d), re = z(d, n.draggable), g.eventCanceled) {
      this._nulling();
      return;
    }
    be = !1, Re = !1, Pe = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), at(this.cloneId), at(this._dragStartId), this.nativeDraggable && (D(document, "drop", this), D(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Oe && m(document.body, "user-select", ""), m(d, "transform", ""), e && (Se && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), _ && _.parentNode && _.parentNode.removeChild(_), (T === A || Y && Y.lastPutMode !== "clone") && O && O.parentNode && O.parentNode.removeChild(O), d && (this.nativeDraggable && D(d, "dragend", this), tt(d), d.style["will-change"] = "", Se && !be && H(d, Y ? Y.options.ghostClass : this.options.ghostClass, !1), H(d, this.options.chosenClass, !1), V({
      sortable: this,
      name: "unchoose",
      toEl: A,
      newIndex: null,
      newDraggableIndex: null,
      originalEvent: e
    }), T !== A ? (W >= 0 && (V({
      rootEl: A,
      name: "add",
      toEl: A,
      fromEl: T,
      originalEvent: e
    }), V({
      sortable: this,
      name: "remove",
      toEl: A,
      originalEvent: e
    }), V({
      rootEl: A,
      name: "sort",
      toEl: A,
      fromEl: T,
      originalEvent: e
    }), V({
      sortable: this,
      name: "sort",
      toEl: A,
      originalEvent: e
    })), Y && Y.save()) : W !== _e && W >= 0 && (V({
      sortable: this,
      name: "update",
      toEl: A,
      originalEvent: e
    }), V({
      sortable: this,
      name: "sort",
      toEl: A,
      originalEvent: e
    })), g.active && ((W == null || W === -1) && (W = _e, re = Ie), V({
      sortable: this,
      name: "end",
      toEl: A,
      originalEvent: e
    }), this.save()))), this._nulling();
  },
  _nulling: function() {
    $("nulling", this), T = d = A = _ = he = O = Ve = ae = fe = L = Se = W = re = _e = Ie = ve = Ae = Y = Fe = g.dragged = g.ghost = g.clone = g.active = null, Le.forEach(function(e) {
      e.checked = !0;
    }), Le.length = Qe = Je = 0;
  },
  handleEvent: function(e) {
    switch (e.type) {
      case "drop":
      case "dragend":
        this._onDrop(e);
        break;
      case "dragenter":
      case "dragover":
        d && (this._onDragOver(e), mn(e));
        break;
      case "selectstart":
        e.preventDefault();
        break;
    }
  },
  /**
   * Serializes the item into an array of string.
   * @returns {String[]}
   */
  toArray: function() {
    for (var e = [], t, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
      t = n[i], U(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || wn(t));
    return e;
  },
  /**
   * Sorts the elements according to the array.
   * @param  {String[]}  order  order of the items
   */
  sort: function(e, t) {
    var n = {}, i = this.el;
    this.toArray().forEach(function(r, a) {
      var u = i.children[a];
      U(u, this.options.draggable, i, !1) && (n[r] = u);
    }, this), t && this.captureAnimationState(), e.forEach(function(r) {
      n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
    }), t && this.animateAll();
  },
  /**
   * Save the current sorting
   */
  save: function() {
    var e = this.options.store;
    e && e.set && e.set(this);
  },
  /**
   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
   * @param   {HTMLElement}  el
   * @param   {String}       [selector]  default: `options.draggable`
   * @returns {HTMLElement|null}
   */
  closest: function(e, t) {
    return U(e, t || this.options.draggable, this.el, !1);
  },
  /**
   * Set/get option
   * @param   {string} name
   * @param   {*}      [value]
   * @returns {*}
   */
  option: function(e, t) {
    var n = this.options;
    if (t === void 0)
      return n[e];
    var i = ke.modifyOption(this, e, t);
    typeof i < "u" ? n[e] = i : n[e] = t, e === "group" && Bt(n);
  },
  /**
   * Destroy
   */
  destroy: function() {
    $("destroy", this);
    var e = this.el;
    e[j] = null, D(e, "mousedown", this._onTapStart), D(e, "touchstart", this._onTapStart), D(e, "pointerdown", this._onTapStart), this.nativeDraggable && (D(e, "dragover", this), D(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(t) {
      t.removeAttribute("draggable");
    }), this._onDrop(), this._disableDelayedDragEvents(), ze.splice(ze.indexOf(this.el), 1), this.el = e = null;
  },
  _hideClone: function() {
    if (!ae) {
      if ($("hideClone", this), g.eventCanceled)
        return;
      m(O, "display", "none"), this.options.removeCloneOnHide && O.parentNode && O.parentNode.removeChild(O), ae = !0;
    }
  },
  _showClone: function(e) {
    if (e.lastPutMode !== "clone") {
      this._hideClone();
      return;
    }
    if (ae) {
      if ($("showClone", this), g.eventCanceled)
        return;
      d.parentNode == T && !this.options.group.revertClone ? T.insertBefore(O, d) : he ? T.insertBefore(O, he) : T.appendChild(O), this.options.group.revertClone && this.animate(d, O), m(O, "display", ""), ae = !1;
    }
  }
};
function mn(o) {
  o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
}
function Be(o, e, t, n, i, r, a, u) {
  var s, l = o[j], f = l.options.onMove, c;
  return window.CustomEvent && !ne && !Ne ? s = new CustomEvent("move", {
    bubbles: !0,
    cancelable: !0
  }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = o, s.dragged = t, s.draggedRect = n, s.related = i || e, s.relatedRect = r || F(e), s.willInsertAfter = u, s.originalEvent = a, o.dispatchEvent(s), f && (c = f.call(l, s, a)), c;
}
function tt(o) {
  o.draggable = !1;
}
function gn() {
  rt = !1;
}
function vn(o, e, t) {
  var n = F(we(t.el, 0, t.options, !0)), i = Ft(t.el, t.options, _), r = 10;
  return e ? o.clientX < i.left - r || o.clientY < n.top && o.clientX < n.right : o.clientY < i.top - r || o.clientY < n.bottom && o.clientX < n.left;
}
function bn(o, e, t) {
  var n = F(ct(t.el, t.options.draggable)), i = Ft(t.el, t.options, _), r = 10;
  return e ? o.clientX > i.right + r || o.clientY > n.bottom && o.clientX > n.left : o.clientY > i.bottom + r || o.clientX > n.right && o.clientY > n.top;
}
function _n(o, e, t, n, i, r, a, u) {
  var s = n ? o.clientY : o.clientX, l = n ? t.height : t.width, f = n ? t.top : t.left, c = n ? t.bottom : t.right, v = !1;
  if (!a) {
    if (u && $e < l * i) {
      if (!Pe && (Ae === 1 ? s > f + l * r / 2 : s < c - l * r / 2) && (Pe = !0), Pe)
        v = !0;
      else if (Ae === 1 ? s < f + $e : s > c - $e)
        return -Ae;
    } else if (s > f + l * (1 - i) / 2 && s < c - l * (1 - i) / 2)
      return yn(e);
  }
  return v = v || a, v && (s < f + l * r / 2 || s > c - l * r / 2) ? s > f + l / 2 ? 1 : -1 : 0;
}
function yn(o) {
  return z(d) < z(o) ? 1 : -1;
}
function wn(o) {
  for (var e = o.tagName + o.className + o.src + o.href + o.textContent, t = e.length, n = 0; t--; )
    n += e.charCodeAt(t);
  return n.toString(36);
}
function En(o) {
  Le.length = 0;
  for (var e = o.getElementsByTagName("input"), t = e.length; t--; ) {
    var n = e[t];
    n.checked && Le.push(n);
  }
}
function He(o) {
  return setTimeout(o, 0);
}
function at(o) {
  return clearTimeout(o);
}
qe && S(document, "touchmove", function(o) {
  (g.active || be) && o.cancelable && o.preventDefault();
});
g.utils = {
  on: S,
  off: D,
  css: m,
  find: Pt,
  is: function(e, t) {
    return !!U(e, t, e, !1);
  },
  extend: on,
  throttle: Nt,
  closest: U,
  toggleClass: H,
  clone: Mt,
  index: z,
  nextTick: He,
  cancelNextTick: at,
  detectDirection: Yt,
  getChild: we
};
g.get = function(o) {
  return o[j];
};
g.mount = function() {
  for (var o = arguments.length, e = new Array(o), t = 0; t < o; t++)
    e[t] = arguments[t];
  e[0].constructor === Array && (e = e[0]), e.forEach(function(n) {
    if (!n.prototype || !n.prototype.constructor)
      throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
    n.utils && (g.utils = K(K({}, g.utils), n.utils)), ke.mount(n);
  });
};
g.create = function(o, e) {
  return new g(o, e);
};
g.version = en;
var M = [], Ce, lt, st = !1, nt, ot, Ue, Te;
function Dn() {
  function o() {
    this.defaults = {
      scroll: !0,
      forceAutoScrollFallback: !1,
      scrollSensitivity: 30,
      scrollSpeed: 10,
      bubbleScroll: !0
    };
    for (var e in this)
      e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
  }
  return o.prototype = {
    dragStarted: function(t) {
      var n = t.originalEvent;
      this.sortable.nativeDraggable ? S(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? S(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? S(document, "touchmove", this._handleFallbackAutoScroll) : S(document, "mousemove", this._handleFallbackAutoScroll);
    },
    dragOverCompleted: function(t) {
      var n = t.originalEvent;
      !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
    },
    drop: function() {
      this.sortable.nativeDraggable ? D(document, "dragover", this._handleAutoScroll) : (D(document, "pointermove", this._handleFallbackAutoScroll), D(document, "touchmove", this._handleFallbackAutoScroll), D(document, "mousemove", this._handleFallbackAutoScroll)), St(), We(), rn();
    },
    nulling: function() {
      Ue = lt = Ce = st = Te = nt = ot = null, M.length = 0;
    },
    _handleFallbackAutoScroll: function(t) {
      this._handleAutoScroll(t, !0);
    },
    _handleAutoScroll: function(t, n) {
      var i = this, r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, u = document.elementFromPoint(r, a);
      if (Ue = t, n || this.options.forceAutoScrollFallback || Ne || ne || Oe) {
        it(t, this.options, u, n);
        var s = se(u, !0);
        st && (!Te || r !== nt || a !== ot) && (Te && St(), Te = setInterval(function() {
          var l = se(document.elementFromPoint(r, a), !0);
          l !== s && (s = l, We()), it(t, i.options, l, n);
        }, 10), nt = r, ot = a);
      } else {
        if (!this.options.bubbleScroll || se(u, !0) === q()) {
          We();
          return;
        }
        it(t, this.options, se(u, !1), !1);
      }
    }
  }, te(o, {
    pluginName: "scroll",
    initializeByDefault: !0
  });
}
function We() {
  M.forEach(function(o) {
    clearInterval(o.pid);
  }), M = [];
}
function St() {
  clearInterval(Te);
}
var it = Nt(function(o, e, t, n) {
  if (e.scroll) {
    var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = e.scrollSensitivity, u = e.scrollSpeed, s = q(), l = !1, f;
    lt !== t && (lt = t, We(), Ce = e.scroll, f = e.scrollFn, Ce === !0 && (Ce = se(t, !0)));
    var c = 0, v = Ce;
    do {
      var E = v, y = F(E), p = y.top, b = y.bottom, C = y.left, x = y.right, R = y.width, k = y.height, Z = void 0, G = void 0, Q = E.scrollWidth, ue = E.scrollHeight, X = m(E), de = E.scrollLeft, I = E.scrollTop;
      E === s ? (Z = R < Q && (X.overflowX === "auto" || X.overflowX === "scroll" || X.overflowX === "visible"), G = k < ue && (X.overflowY === "auto" || X.overflowY === "scroll" || X.overflowY === "visible")) : (Z = R < Q && (X.overflowX === "auto" || X.overflowX === "scroll"), G = k < ue && (X.overflowY === "auto" || X.overflowY === "scroll"));
      var oe = Z && (Math.abs(x - i) <= a && de + R < Q) - (Math.abs(C - i) <= a && !!de), J = G && (Math.abs(b - r) <= a && I + k < ue) - (Math.abs(p - r) <= a && !!I);
      if (!M[c])
        for (var ce = 0; ce <= c; ce++)
          M[ce] || (M[ce] = {});
      (M[c].vx != oe || M[c].vy != J || M[c].el !== E) && (M[c].el = E, M[c].vx = oe, M[c].vy = J, clearInterval(M[c].pid), (oe != 0 || J != 0) && (l = !0, M[c].pid = setInterval((function() {
        n && this.layer === 0 && g.active._onTouchMove(Ue);
        var Ee = M[this.layer].vy ? M[this.layer].vy * u : 0, ie = M[this.layer].vx ? M[this.layer].vx * u : 0;
        typeof f == "function" && f.call(g.dragged.parentNode[j], ie, Ee, o, Ue, M[this.layer].el) !== "continue" || kt(M[this.layer].el, ie, Ee);
      }).bind({
        layer: c
      }), 24))), c++;
    } while (e.bubbleScroll && v !== s && (v = se(v, !1)));
    st = l;
  }
}, 30), $t = function(e) {
  var t = e.originalEvent, n = e.putSortable, i = e.dragEl, r = e.activeSortable, a = e.dispatchSortableEvent, u = e.hideGhostForTarget, s = e.unhideGhostForTarget;
  if (t) {
    var l = n || r;
    u();
    var f = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, c = document.elementFromPoint(f.clientX, f.clientY);
    s(), l && !l.el.contains(c) && (a("spill"), this.onSpill({
      dragEl: i,
      putSortable: n
    }));
  }
};
function ft() {
}
ft.prototype = {
  startIndex: null,
  dragStart: function(e) {
    var t = e.oldDraggableIndex;
    this.startIndex = t;
  },
  onSpill: function(e) {
    var t = e.dragEl, n = e.putSortable;
    this.sortable.captureAnimationState(), n && n.captureAnimationState();
    var i = we(this.sortable.el, this.startIndex, this.options);
    i ? this.sortable.el.insertBefore(t, i) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
  },
  drop: $t
};
te(ft, {
  pluginName: "revertOnSpill"
});
function pt() {
}
pt.prototype = {
  onSpill: function(e) {
    var t = e.dragEl, n = e.putSortable, i = n || this.sortable;
    i.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), i.animateAll();
  },
  drop: $t
};
te(pt, {
  pluginName: "removeOnSpill"
});
g.mount(new Dn());
g.mount(pt, ft);
const Sn = /* @__PURE__ */ me("br", null, null, -1), Cn = /* @__PURE__ */ me("br", null, null, -1), Tn = /* @__PURE__ */ me("br", null, null, -1), On = /* @__PURE__ */ me("br", null, null, -1), xn = { class: "dialog-footer" }, In = /* @__PURE__ */ ut({
  __name: "MethodEditorDialog",
  setup(o, { expose: e }) {
    let t = -1;
    const n = le();
    function i(p, b) {
      a.value = p, u = b, r.value = !0, Gt(() => y());
    }
    const r = le(!1), a = le({});
    let u;
    const s = le();
    function l() {
      t = -1, n.value.show({}, c);
    }
    function f(p) {
      t = p.$index;
      const b = Ot(p.row);
      n.value.show(b, c);
    }
    const c = (p) => {
      t < 0 ? a.value.paras.push(p) : a.value.paras[t] = p;
    }, v = (p) => {
      a.value.paras.splice(p.$index, 1);
    }, E = async (p) => {
      p && await p.validate((b) => {
        b && (r.value = !1, u && u(a.value));
      });
    };
    function y() {
      document.body.ondrop = function(b) {
        b.preventDefault(), b.stopPropagation();
      };
      const p = document.querySelector(".draggable-dummy .el-table__body tbody");
      if (!p) {
        console.log("no table is found,drag and drop disabeld");
        return;
      }
      g.create(p, {
        handle: ".table-drag-handle",
        // handle's class
        animation: 150,
        onEnd({ newIndex: b, oldIndex: C }) {
          const x = a.value.paras.splice(C, 1)[0];
          a.value.paras.splice(b, 0, x);
        }
      });
    }
    return e({ show: i }), (p, b) => {
      const C = N("el-input"), x = N("el-form-item"), R = N("el-table-column"), k = N("el-button"), Z = N("el-button-group"), G = N("el-table"), Q = N("el-popover"), ue = N("b-ace-editor"), X = N("el-form"), de = N("el-dialog");
      return dt(), Ct(Tt, null, [
        h(de, {
          modelValue: r.value,
          "onUpdate:modelValue": b[7] || (b[7] = (I) => r.value = I),
          title: "Method editor",
          "close-on-click-modal": !1,
          "close-on-press-escape": !1
        }, {
          footer: w(() => [
            me("span", xn, [
              h(k, {
                onClick: b[5] || (b[5] = (I) => r.value = !1)
              }, {
                default: w(() => [
                  P("Cancel")
                ]),
                _: 1
              }),
              h(k, {
                type: "primary",
                onClick: b[6] || (b[6] = (I) => E(s.value))
              }, {
                default: w(() => [
                  P(" Save ")
                ]),
                _: 1
              })
            ])
          ]),
          default: w(() => [
            h(X, {
              ref_key: "dataEditorFormRef",
              ref: s,
              model: a.value,
              "label-width": "120px"
            }, {
              default: w(() => [
                h(x, {
                  label: "Key",
                  prop: "key",
                  required: ""
                }, {
                  default: w(() => [
                    h(C, {
                      modelValue: a.value.key,
                      "onUpdate:modelValue": b[0] || (b[0] = (I) => a.value.key = I)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                h(x, {
                  label: "Description",
                  prop: "description"
                }, {
                  default: w(() => [
                    h(C, {
                      modelValue: a.value.description,
                      "onUpdate:modelValue": b[1] || (b[1] = (I) => a.value.description = I)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                h(x, {
                  label: "Parameters",
                  prop: "paras",
                  class: "draggable-dummy"
                }, {
                  default: w(() => [
                    h(G, {
                      data: a.value.paras,
                      style: { width: "100%" },
                      "row-key": "key"
                    }, {
                      empty: w(() => [
                        P(" Please "),
                        h(k, {
                          type: "primary",
                          onClick: b[3] || (b[3] = (I) => l())
                        }, {
                          default: w(() => [
                            P("Add")
                          ]),
                          _: 1
                        }),
                        P(" a new record ")
                      ]),
                      default: w(() => [
                        h(R, { label: "Drag" }, {
                          default: w(() => [
                            h(mt, {
                              icon: "mdiDrag",
                              class: "table-drag-handle",
                              size: "2em"
                            })
                          ]),
                          _: 1
                        }),
                        h(R, {
                          prop: "key",
                          label: "Key"
                        }),
                        h(R, {
                          prop: "description",
                          label: "Description"
                        }),
                        h(R, {
                          prop: "type",
                          label: "Data type"
                        }),
                        h(R, {
                          fixed: "right",
                          label: "Operations",
                          width: "240px"
                        }, {
                          default: w((I) => [
                            h(Z, null, {
                              default: w(() => [
                                h(k, {
                                  type: "primary",
                                  onClick: b[2] || (b[2] = (oe) => l())
                                }, {
                                  default: w(() => [
                                    P("Add")
                                  ]),
                                  _: 1
                                }),
                                h(k, {
                                  type: "success",
                                  onClick: (oe) => f(I)
                                }, {
                                  default: w(() => [
                                    P("Edit")
                                  ]),
                                  _: 2
                                }, 1032, ["onClick"]),
                                h(k, {
                                  type: "danger",
                                  onClick: (oe) => v(I)
                                }, {
                                  default: w(() => [
                                    P("Delete")
                                  ]),
                                  _: 2
                                }, 1032, ["onClick"])
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ]),
                  _: 1
                }),
                h(x, { prop: "code" }, {
                  label: w(() => [
                    h(Q, {
                      placement: "bottom",
                      title: "How to use",
                      width: 640,
                      trigger: "click",
                      content: "this is content, this is content, this is content"
                    }, {
                      reference: w(() => [
                        me("span", null, [
                          P(" Code "),
                          h(mt, {
                            icon: "mdiHelpCircleOutline",
                            size: "1.2em"
                          })
                        ])
                      ]),
                      default: w(() => [
                        P(" The first parameter of method is c which is page context."),
                        Sn,
                        P(" If the parameter names are provided above, you can use it directly."),
                        Cn,
                        P(" Otherwise,argument names will be set to arg0/arg1..."),
                        Tn,
                        P(" And please also note, if method is triggered by event, warpContext will be added automatically."),
                        On,
                        P(" You need to set parameter name manually,otherwise it is arg0 as the second parameter after context. ")
                      ]),
                      _: 1
                    })
                  ]),
                  default: w(() => [
                    h(ue, {
                      modelValue: a.value.code,
                      "onUpdate:modelValue": b[4] || (b[4] = (I) => a.value.code = I),
                      lang: "javascript",
                      width: "100%",
                      height: "40vh",
                      readonly: !1,
                      "font-size": 14
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["model"])
          ]),
          _: 1
        }, 8, ["modelValue"]),
        h(Kt, {
          ref_key: "methodParaEditorDialogRef",
          ref: n
        }, null, 512)
      ], 64);
    };
  }
}), kn = /* @__PURE__ */ ut({
  __name: "index",
  setup(o) {
    const e = le();
    let t = -1;
    const n = zt("context");
    function i() {
      t = -1, e.value.show({
        paras: [{
          key: "contextWrap",
          type: "Object"
        }],
        code: ""
      }, a);
    }
    function r(l) {
      t = l.$index;
      const f = Ot(l.row);
      e.value.show(f, a);
    }
    const a = (l) => {
      t < 0 ? s.value.push(l) : s.value[t] = l;
    }, u = (l) => {
      Ut.confirm(
        "Will you want to delte this method",
        "Warning",
        {
          confirmButtonText: "Yes",
          cancelButtonText: "No",
          type: "warning"
        }
      ).then(() => {
        s.value.splice(l.$index, 1);
      });
    }, s = Lt(() => n.codeManager.getCode().methods);
    return (l, f) => {
      const c = N("el-table-column"), v = N("el-button"), E = N("el-button-group"), y = N("el-table");
      return dt(), Ct(Tt, null, [
        h(y, {
          data: s.value,
          border: ""
        }, {
          empty: w(() => [
            P(" Please "),
            h(v, {
              type: "primary",
              onClick: f[1] || (f[1] = (p) => i())
            }, {
              default: w(() => [
                P("Add")
              ]),
              _: 1
            }),
            P(" a new record ")
          ]),
          default: w(() => [
            h(c, {
              prop: "key",
              label: "Key"
            }),
            h(c, {
              prop: "description",
              label: "Description"
            }),
            h(c, {
              fixed: "right",
              label: "Operations",
              width: "220px"
            }, {
              default: w((p) => [
                h(E, null, {
                  default: w(() => [
                    h(v, {
                      type: "primary",
                      onClick: f[0] || (f[0] = (b) => i())
                    }, {
                      default: w(() => [
                        P("Add")
                      ]),
                      _: 1
                    }),
                    h(v, {
                      type: "success",
                      onClick: (b) => r(p)
                    }, {
                      default: w(() => [
                        P("Edit")
                      ]),
                      _: 2
                    }, 1032, ["onClick"]),
                    h(v, {
                      type: "danger",
                      onClick: (b) => u(p)
                    }, {
                      default: w(() => [
                        P("Delete")
                      ]),
                      _: 2
                    }, 1032, ["onClick"])
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["data"]),
        h(In, {
          ref_key: "methodEditorDialogRef",
          ref: e
        }, null, 512)
      ], 64);
    };
  }
});
export {
  kn as default
};
//# sourceMappingURL=index-5b783d94.mjs.map
