@uozi-admin/curd
Version:
Easy to implement curd.
1,244 lines • 190 kB
JavaScript
import { readonly as xn, watch as De, getCurrentScope as wo, onScopeDispose as So, toRef as Co, customRef as $n, ref as B, toValue as yt, nextTick as ct, inject as In, toRaw as Eo, reactive as Pe, computed as _, watchEffect as Zt, defineComponent as ie, useModel as ve, openBlock as S, createBlock as Y, unref as f, mergeProps as he, mergeModels as me, shallowRef as Do, createElementBlock as ae, createVNode as k, withCtx as R, createTextVNode as ne, toDisplayString as H, createCommentVNode as de, createElementVNode as re, withKeys as To, Fragment as Fe, renderList as ft, withDirectives as Rn, vShow as Mn, renderSlot as pe, onMounted as ca, withModifiers as ko, h as ea, onUnmounted as xo, normalizeClass as ta, onBeforeUnmount as $o, normalizeProps as An, guardReactiveProps as Pn, getCurrentInstance as Io, useSlots as Ro, createSlots as sn, provide as Mo } from "vue";
import { useRoute as Ao, useRouter as Po } from "vue-router";
import { AutoComplete as Fo, Cascader as Oo, CheckboxGroup as _o, DatePicker as Bo, Input as Na, InputNumber as No, SpaceCompact as Uo, InputPassword as Lo, Button as Se, RadioGroup as Fn, DateRangePicker as zo, Rate as Yo, Select as On, Modal as Ft, Flex as wt, Form as Ua, FormItem as La, Dropdown as jo, Checkbox as Ma, Table as _n, Popconfirm as ha, Slider as Ko, Switch as Wo, TimePicker as Vo, RadioButton as un, UploadDragger as Ho, Progress as qo, TextArea as Go, Row as Xo, Col as Qo, message as Ve, Descriptions as dn, DescriptionsItem as cn, Card as Jo, Spin as Zo, Divider as er, Pagination as tr, Image as ar } from "antdv-next";
import { merge as nr, cloneDeep as Ue, get as Re, set as aa, isNumber as za, isEqual as Aa, isFunction as or, debounce as rr, isNil as ga, isArray as lr, assign as ir } from "lodash-es";
import { utils as ya, writeFile as sr } from "xlsx";
import { useI18n as Bn, createI18n as Nn } from "vue-i18n";
import { UpOutlined as ur, DownOutlined as dr, SettingOutlined as cr, HolderOutlined as Un, ReloadOutlined as fr, FileOutlined as fn, FolderOutlined as pr, InboxOutlined as vr, DeleteOutlined as mr } from "@antdv-next/icons";
function hr(e, t) {
return wo() ? (So(e, t), !0) : !1;
}
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const gr = () => {
};
function yr(...e) {
if (e.length !== 1) return Co(...e);
const t = e[0];
return typeof t == "function" ? xn($n(() => ({
get: t,
set: gr
}))) : B(t);
}
function br(e, t) {
function n(...a) {
return new Promise((o, r) => {
Promise.resolve(e(() => t.apply(this, a), {
fn: t,
thisArg: this,
args: a
})).then(o).catch(r);
});
}
return n;
}
const Ln = (e) => e();
function wr(e = Ln, t = {}) {
const { initialState: n = "active" } = t, a = yr(n === "active");
function o() {
a.value = !1;
}
function r() {
a.value = !0;
}
const l = (...s) => {
a.value && e(...s);
};
return {
isActive: xn(a),
pause: o,
resume: r,
eventFilter: l
};
}
function Sr(e, t, n = {}) {
const { eventFilter: a = Ln, ...o } = n;
return De(e, br(a, t), o);
}
function zn(e, t, n = {}) {
const { eventFilter: a, initialState: o = "active", ...r } = n, { eventFilter: l, pause: s, resume: u, isActive: d } = wr(a, { initialState: o });
return {
stop: Sr(e, t, {
...r,
eventFilter: l
}),
pause: s,
resume: u,
isActive: d
};
}
const ba = /* @__PURE__ */ new WeakMap();
function ht(e, t, n = {}) {
const { mode: a = "replace", route: o = Ao(), router: r = Po(), transform: l } = n;
let s = (g) => g, u = (g) => g;
typeof l == "function" ? s = l : l && (l.get && (s = l.get), l.set && (u = l.set)), ba.has(r) || ba.set(r, /* @__PURE__ */ new Map());
const d = ba.get(r);
let c = o.query[e];
hr(() => {
c = void 0;
});
let i;
const p = $n((g, h) => (i = h, {
get() {
return g(), s(c !== void 0 ? c : yt(t));
},
set(v) {
v = u(v), c !== v && (c = v === yt(t) ? void 0 : v, d.set(e, v === yt(t) ? void 0 : v), h(), ct(() => {
if (d.size === 0) return;
const $ = Object.fromEntries(d.entries());
d.clear();
const { params: m, query: P, hash: I } = o;
r[yt(a)]({
params: m,
query: {
...P,
...$
},
hash: I
});
}));
}
}));
return De(() => o.query[e], (g) => {
c !== s(g) && (c = g, i());
}, { flush: "sync" }), p;
}
const Ya = "YYYY-MM-DD", ja = "YYYY-MM-DD HH:mm:ss", Ka = "HH:mm:ss", Wa = "YYYY", Va = "YYYY-MM", Ha = "YYYY-wo", oc = Ya, rc = ja, lc = Ka, ic = Wa, sc = Va, uc = Ha;
let Ot = {
date: Ya,
datetime: ja,
time: Ka,
year: Wa,
month: Va,
week: Ha
};
function Yn(e) {
Ot = { ...Ot, ...e };
}
function dc() {
return { ...Ot };
}
function cc(e) {
return Ot[e];
}
const rt = new Proxy({}, {
get(e, t) {
return Ot[t];
}
}), Cr = "Total", Er = "View", Dr = "Edit", Tr = "Restore", kr = "Delete Permanently", xr = "Search", $r = "Reset", Ir = "Close", Rr = "OK", Mr = "Selector", Ar = "Generate", Pr = "Save", Fr = "Add", Or = "Trash", _r = "Back to List", Br = "Export Excel", Nr = "List", Ur = "Please fill all fields correctly", Lr = "Are you sure you want to delete?", zr = "Are you sure you want to restore?", Yr = "Are you sure you want to delete permanently?", jr = "Saved successfully", Kr = "Deleted successfully", Wr = "Restored successfully", Vr = "Select all", Hr = "Batch Edit", qr = "Please select at least one item", Gr = "Batch Modify", Xr = "Save successfully", Qr = "Save successful", Jr = "Cancel", Zr = "Belows are selected items that you want to batch modify", el = "Leave blank if do not want to modify", tl = "No", al = { required: "This field should not be empty", email: "This field should be a valid email address", db_unique: "This value is already taken", hostname: "This field should be a valid hostname", safety_text: "This field should only contain letters, unicode characters, numbers, and -_./:" }, nl = { uploadFiles: "Upload Files", uploadFolders: "Upload Folders", clickOrDragFilesToThisAreaToUpload: "Click or drag files to this area to upload", clickOrDragFoldersToThisAreaToUpload: "Click or drag folders to this area to upload", supportForSingleOrBatchUploadOfFiles: "Support single or batch upload of files", supportForUploadingEntireFolders: "Support uploading entire folders", mainTipsForFiles: "Click or drag files to this area to upload", mainTipsForFolders: "Click or drag folders to this area to upload", subTipsForFiles: "Support single or batch upload of files", subTipsForFolders: "Support uploading entire folders", selectedFiles: "Selected {count} files", processing: "Processing {count}/{total}", path: "Path", size: "Size" }, ol = "Apply", rl = "Refresh", ll = "Collapse", il = "Expand", sl = {
total: Cr,
"item(s)": "item(s)",
view: Er,
edit: Dr,
delete: "Delete",
restore: Tr,
deletePermanently: kr,
search: xr,
reset: $r,
close: Ir,
ok: Rr,
selectorTitle: Mr,
generate: Ar,
save: Pr,
add: Fr,
trash: Or,
backToList: _r,
exportExcel: Br,
list: Nr,
formValidateError: Ur,
deleteConfirm: Lr,
restoreConfirm: zr,
deletePermanentlyConfirm: Yr,
savedSuccessfully: jr,
deletedSuccessfully: Kr,
restoredSuccessfully: Wr,
selectAll: Vr,
batchEdit: Hr,
pleaseSelectAtLeastOneItem: qr,
batchModify: Gr,
saveSuccessfully: Xr,
saveSuccess: Qr,
cancel: Jr,
belowsAreSelectedItems: Zr,
leaveBlankIfDoNotWantToModify: el,
no: tl,
validate: al,
upload: nl,
"Column Settings": "Column Settings",
Apply: ol,
"Confirm Delete": "Confirm Delete",
"Please Input": "Please enter",
"to comfirm delete": "to confirm deletion",
"to confirm deletion": "to confirm deletion",
refresh: rl,
collapse: ll,
expand: il
}, ul = "总计", dl = "查看", cl = "编辑", fl = "恢复", pl = "永久删除", vl = "搜索", ml = "重置", hl = "关闭", gl = "确定", yl = "选择器", bl = "生成", wl = "保存", Sl = "添加", Cl = "回收站", El = "返回列表", Dl = "导出 Excel", Tl = "列表", kl = "请正确填写所有字段", xl = "确定要删除吗?", $l = "确定要恢复吗?", Il = "确定要永久删除吗?", Rl = "保存成功", Ml = "删除成功", Al = "恢复成功", Pl = "全选", Fl = "批量编辑", Ol = "请至少选择一项", _l = "批量修改", Bl = "保存成功", Nl = "保存成功", Ul = "取消", Ll = "以下是您要批量修改的选中项", zl = "如不想修改请留空", Yl = "取消", jl = { required: "此字段不能为空", email: "此字段应该是有效的电子邮件地址", db_unique: "此值已被占用", hostname: "此字段应该是有效的主机名", safety_text: "此字段应该只包含字母、Unicode字符、数字和-_./:" }, Kl = { uploadFiles: "上传文件", uploadFolders: "上传文件夹", clickOrDragFilesToThisAreaToUpload: "点击或拖拽文件到此区域上传", clickOrDragFoldersToThisAreaToUpload: "点击或拖拽文件夹到此区域上传", supportForSingleOrBatchUploadOfFiles: "支持单个或批量上传文件", supportForUploadingEntireFolders: "支持上传整个文件夹", mainTipsForFiles: "点击或拖拽文件到此区域上传", mainTipsForFolders: "点击或拖拽文件夹到此区域上传", subTipsForFiles: "支持单个或批量上传文件", subTipsForFolders: "支持上传整个文件夹", selectedFiles: "已选择 {count} 个文件", processing: "处理中 {count}/{total}", path: "路径", size: "大小" }, Wl = "应用", Vl = "刷新", Hl = "折叠", ql = "展开", Gl = {
total: ul,
"item(s)": "项",
view: dl,
edit: cl,
delete: "删除",
restore: fl,
deletePermanently: pl,
search: vl,
reset: ml,
close: hl,
ok: gl,
selectorTitle: yl,
generate: bl,
save: wl,
add: Sl,
trash: Cl,
backToList: El,
exportExcel: Dl,
list: Tl,
formValidateError: kl,
deleteConfirm: xl,
restoreConfirm: $l,
deletePermanentlyConfirm: Il,
savedSuccessfully: Rl,
deletedSuccessfully: Ml,
restoredSuccessfully: Al,
selectAll: Pl,
batchEdit: Fl,
pleaseSelectAtLeastOneItem: Ol,
batchModify: _l,
saveSuccessfully: Bl,
saveSuccess: Nl,
cancel: Ul,
belowsAreSelectedItems: Ll,
leaveBlankIfDoNotWantToModify: zl,
no: Yl,
validate: jl,
upload: Kl,
"Column Settings": "列设置",
Apply: Wl,
"Confirm Delete": "确认删除",
"Please Input": "请输入",
"to comfirm delete": "确认删除",
"to confirm deletion": "确认删除",
refresh: Vl,
collapse: Hl,
expand: ql
}, Xl = "總計", Ql = "查看", Jl = "編輯", Zl = "恢復", ei = "永久刪除", ti = "搜索", ai = "重設", ni = "關閉", oi = "確定", ri = "選擇器", li = "生成", ii = "保存", si = "新增", ui = "回收站", di = "返回列表", ci = "導出 Excel", fi = "列表", pi = "請正確填寫所有欄位", vi = "確定要刪除嗎?", mi = "確定要恢復嗎?", hi = "確定要永久刪除嗎?", gi = "保存成功", yi = "刪除成功", bi = "恢復成功", wi = "全選", Si = "批量編輯", Ci = "請至少選擇一項", Ei = "批量修改", Di = "保存成功", Ti = "保存成功", ki = "取消", xi = "以下是您要批量修改的選中項", $i = "如不想修改請留空", Ii = "取消", Ri = { required: "此欄位不能為空", email: "此欄位應該是有效的電子郵件地址", db_unique: "此值已被佔用", hostname: "此欄位應該是有效的主機名", safety_text: "此欄位應該只包含字母、Unicode字符、數字和-_./:" }, Mi = { uploadFiles: "上傳文件", uploadFolders: "上傳文件夾", clickOrDragFilesToThisAreaToUpload: "點擊或拖拽文件到此區域上傳", clickOrDragFoldersToThisAreaToUpload: "點擊或拖拽文件夾到此區域上傳", supportForSingleOrBatchUploadOfFiles: "支持單個或批量上傳文件", supportForUploadingEntireFolders: "支持上傳整個文件夾", mainTipsForFiles: "點擊或拖拽文件到此區域上傳", mainTipsForFolders: "點擊或拖拽文件夾到此區域上傳", subTipsForFiles: "支持單個或批量上傳文件", subTipsForFolders: "支持上傳整個文件夾", selectedFiles: "已選擇 {count} 個文件", processing: "處理中 {count}/{total}", path: "路徑", size: "大小" }, Ai = "應用", Pi = "刷新", Fi = "折疊", Oi = "展開", _i = {
total: Xl,
"item(s)": "項",
view: Ql,
edit: Jl,
delete: "刪除",
restore: Zl,
deletePermanently: ei,
search: ti,
reset: ai,
close: ni,
ok: oi,
selectorTitle: ri,
generate: li,
save: ii,
add: si,
trash: ui,
backToList: di,
exportExcel: ci,
list: fi,
formValidateError: pi,
deleteConfirm: vi,
restoreConfirm: mi,
deletePermanentlyConfirm: hi,
savedSuccessfully: gi,
deletedSuccessfully: yi,
restoredSuccessfully: bi,
selectAll: wi,
batchEdit: Si,
pleaseSelectAtLeastOneItem: Ci,
batchModify: Ei,
saveSuccessfully: Di,
saveSuccess: Ti,
cancel: ki,
belowsAreSelectedItems: xi,
leaveBlankIfDoNotWantToModify: $i,
no: Ii,
validate: Ri,
upload: Mi,
"Column Settings": "列設置",
Apply: Ai,
"Confirm Delete": "確認刪除",
"Please Input": "請輸入",
"to comfirm delete": "確認刪除",
"to confirm deletion": "確認刪除",
refresh: Pi,
collapse: Fi,
expand: Oi
}, Bi = "總計", Ni = "檢視", Ui = "編輯", Li = "復原", zi = "永久刪除", Yi = "搜尋", ji = "重設", Ki = "關閉", Wi = "確定", Vi = "選擇器", Hi = "產生", qi = "儲存", Gi = "新增", Xi = "資源回收桶", Qi = "返回列表", Ji = "匯出 Excel", Zi = "列表", es = "請正確填寫所有欄位", ts = "確定要刪除嗎?", as = "確定要復原嗎?", ns = "確定要永久刪除嗎?", os = "儲存成功", rs = "刪除成功", ls = "復原成功", is = "全選", ss = "批量編輯", us = "請至少選擇一項", ds = "批量修改", cs = "儲存成功", fs = "儲存成功", ps = "取消", vs = "以下是您要批量修改的選中項", ms = "如不想修改請留空", hs = "取消", gs = { required: "此欄位不能為空", email: "此欄位應該是有效的電子郵件地址", db_unique: "此值已被佔用", hostname: "此欄位應該是有效的主機名", safety_text: "此欄位應該只包含字母、Unicode字元、數字和-_./:" }, ys = { uploadFiles: "上傳文件", uploadFolders: "上傳文件夾", clickOrDragFilesToThisAreaToUpload: "點擊或拖拽文件到此區域上傳", clickOrDragFoldersToThisAreaToUpload: "點擊或拖拽文件夾到此區域上傳", supportForSingleOrBatchUploadOfFiles: "支持單個或批量上傳文件", supportForUploadingEntireFolders: "支持上傳整個文件夾", mainTipsForFiles: "點擊或拖拽文件到此區域上傳", mainTipsForFolders: "點擊或拖拽文件夾到此區域上傳", subTipsForFiles: "支持單個或批量上傳文件", subTipsForFolders: "支持上傳整個文件夾", selectedFiles: "已選擇 {count} 個文件", processing: "處理中 {count}/{total}", path: "路徑", size: "大小" }, bs = "應用", ws = "刷新", Ss = "折疊", Cs = "展開", Es = {
total: Bi,
"item(s)": "項",
view: Ni,
edit: Ui,
delete: "刪除",
restore: Li,
deletePermanently: zi,
search: Yi,
reset: ji,
close: Ki,
ok: Wi,
selectorTitle: Vi,
generate: Hi,
save: qi,
add: Gi,
trash: Xi,
backToList: Qi,
exportExcel: Ji,
list: Zi,
formValidateError: es,
deleteConfirm: ts,
restoreConfirm: as,
deletePermanentlyConfirm: ns,
savedSuccessfully: os,
deletedSuccessfully: rs,
restoredSuccessfully: ls,
selectAll: is,
batchEdit: ss,
pleaseSelectAtLeastOneItem: us,
batchModify: ds,
saveSuccessfully: cs,
saveSuccess: fs,
cancel: ps,
belowsAreSelectedItems: vs,
leaveBlankIfDoNotWantToModify: ms,
no: hs,
validate: gs,
upload: ys,
"Column Settings": "列設置",
Apply: bs,
"Confirm Delete": "確認刪除",
"Please Input": "請輸入",
"to comfirm delete": "確認刪除",
"to confirm deletion": "確認刪除",
refresh: ws,
collapse: Ss,
expand: Cs
}, Ct = {
listApi: {
paginationPath: "$.pagination",
paginationMap: {
params: {
current: "current",
pageSize: "pageSize"
},
response: {
current: "current",
pageSize: "pageSize",
total: "total",
totalPages: "totalPages"
}
}
},
locale: "zh-CN",
i18n: {
legacy: !1,
locale: "zh-CN",
fallbackLocale: "en-US",
messages: {
"zh-CN": Gl,
"zh-HK": _i,
"zh-TW": Es,
"en-US": sl
}
},
dateFormat: {
date: Ya,
datetime: ja,
time: Ka,
year: Wa,
month: Va,
week: Ha
},
time: {
timestamp: !1
},
selector: {
omitZeroString: !0
},
search: {
showSearchBtn: !1,
hideResetBtn: !0
},
deleteConfirmConfig: {
mode: "popconfirm",
valueKey: "id"
},
modal: {
width: 600
}
}, fa = /* @__PURE__ */ Symbol("curdConfig");
function na(...e) {
const t = nr({}, ...e);
for (const n of e)
Object.prototype.hasOwnProperty.call(n, "locale") && n.locale !== void 0 && (t.locale = n.locale);
return t;
}
function lt() {
return In(fa, Ct);
}
function Ds() {
try {
return In(fa, Ct);
} catch {
return Ct;
}
}
function Ts(e, t, n) {
return (t = Is(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function Ze() {
return Ze = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
}
return e;
}, Ze.apply(null, arguments);
}
function pn(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
t && (a = a.filter(function(o) {
return Object.getOwnPropertyDescriptor(e, o).enumerable;
})), n.push.apply(n, a);
}
return n;
}
function Xe(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? pn(Object(n), !0).forEach(function(a) {
Ts(e, a, n[a]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pn(Object(n)).forEach(function(a) {
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
});
}
return e;
}
function ks(e, t) {
if (e == null) return {};
var n, a, o = xs(e, t);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
for (a = 0; a < r.length; a++) n = r[a], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
}
return o;
}
function xs(e, t) {
if (e == null) return {};
var n = {};
for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
if (t.indexOf(a) !== -1) continue;
n[a] = e[a];
}
return n;
}
function $s(e, t) {
if (typeof e != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var a = n.call(e, t);
if (typeof a != "object") return a;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function Is(e) {
var t = $s(e, "string");
return typeof t == "symbol" ? t : t + "";
}
function Pa(e) {
"@babel/helpers - typeof";
return Pa = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, Pa(e);
}
var Rs = "1.15.7";
function Je(e) {
if (typeof window < "u" && window.navigator)
return !!/* @__PURE__ */ navigator.userAgent.match(e);
}
var et = Je(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), _t = Je(/Edge/i), vn = Je(/firefox/i), $t = Je(/safari/i) && !Je(/chrome/i) && !Je(/android/i), qa = Je(/iP(ad|od|hone)/i), jn = Je(/chrome/i) && Je(/android/i), Kn = {
capture: !1,
passive: !1
};
function te(e, t, n) {
e.addEventListener(t, n, !et && Kn);
}
function Z(e, t, n) {
e.removeEventListener(t, n, !et && Kn);
}
function oa(e, t) {
if (t) {
if (t[0] === ">" && (t = t.substring(1)), e)
try {
if (e.matches)
return e.matches(t);
if (e.msMatchesSelector)
return e.msMatchesSelector(t);
if (e.webkitMatchesSelector)
return e.webkitMatchesSelector(t);
} catch {
return !1;
}
return !1;
}
}
function Wn(e) {
return e.host && e !== document && e.host.nodeType && e.host !== e ? e.host : e.parentNode;
}
function He(e, t, n, a) {
if (e) {
n = n || document;
do {
if (t != null && (t[0] === ">" ? e.parentNode === n && oa(e, t) : oa(e, t)) || a && e === n)
return e;
if (e === n) break;
} while (e = Wn(e));
}
return null;
}
var mn = /\s+/g;
function Be(e, t, n) {
if (e && t)
if (e.classList)
e.classList[n ? "add" : "remove"](t);
else {
var a = (" " + e.className + " ").replace(mn, " ").replace(" " + t + " ", " ");
e.className = (a + (n ? " " + t : "")).replace(mn, " ");
}
}
function q(e, t, n) {
var a = e && e.style;
if (a) {
if (n === void 0)
return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
!(t in a) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), a[t] = n + (typeof n == "string" ? "" : "px");
}
}
function St(e, t) {
var n = "";
if (typeof e == "string")
n = e;
else
do {
var a = q(e, "transform");
a && a !== "none" && (n = a + " " + n);
} while (!t && (e = e.parentNode));
var o = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
return o && new o(n);
}
function Vn(e, t, n) {
if (e) {
var a = e.getElementsByTagName(t), o = 0, r = a.length;
if (n)
for (; o < r; o++)
n(a[o], o);
return a;
}
return [];
}
function Ge() {
var e = document.scrollingElement;
return e || document.documentElement;
}
function Ee(e, t, n, a, o) {
if (!(!e.getBoundingClientRect && e !== window)) {
var r, l, s, u, d, c, i;
if (e !== window && e.parentNode && e !== Ge() ? (r = e.getBoundingClientRect(), l = r.top, s = r.left, u = r.bottom, d = r.right, c = r.height, i = r.width) : (l = 0, s = 0, u = window.innerHeight, d = window.innerWidth, c = window.innerHeight, i = window.innerWidth), (t || n) && e !== window && (o = o || e.parentNode, !et))
do
if (o && o.getBoundingClientRect && (q(o, "transform") !== "none" || n && q(o, "position") !== "static")) {
var p = o.getBoundingClientRect();
l -= p.top + parseInt(q(o, "border-top-width")), s -= p.left + parseInt(q(o, "border-left-width")), u = l + r.height, d = s + r.width;
break;
}
while (o = o.parentNode);
if (a && e !== window) {
var g = St(o || e), h = g && g.a, v = g && g.d;
g && (l /= v, s /= h, i /= h, c /= v, u = l + c, d = s + i);
}
return {
top: l,
left: s,
bottom: u,
right: d,
width: i,
height: c
};
}
}
function hn(e, t, n) {
for (var a = ot(e, !0), o = Ee(e)[t]; a; ) {
var r = Ee(a)[n], l = void 0;
if (l = o >= r, !l) return a;
if (a === Ge()) break;
a = ot(a, !1);
}
return !1;
}
function Et(e, t, n, a) {
for (var o = 0, r = 0, l = e.children; r < l.length; ) {
if (l[r].style.display !== "none" && l[r] !== V.ghost && (a || l[r] !== V.dragged) && He(l[r], n.draggable, e, !1)) {
if (o === t)
return l[r];
o++;
}
r++;
}
return null;
}
function Ga(e, t) {
for (var n = e.lastElementChild; n && (n === V.ghost || q(n, "display") === "none" || t && !oa(n, t)); )
n = n.previousElementSibling;
return n || null;
}
function ze(e, t) {
var n = 0;
if (!e || !e.parentNode)
return -1;
for (; e = e.previousElementSibling; )
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== V.clone && (!t || oa(e, t)) && n++;
return n;
}
function gn(e) {
var t = 0, n = 0, a = Ge();
if (e)
do {
var o = St(e), r = o.a, l = o.d;
t += e.scrollLeft * r, n += e.scrollTop * l;
} while (e !== a && (e = e.parentNode));
return [t, n];
}
function Ms(e, t) {
for (var n in e)
if (e.hasOwnProperty(n)) {
for (var a in t)
if (t.hasOwnProperty(a) && t[a] === e[n][a]) return Number(n);
}
return -1;
}
function ot(e, t) {
if (!e || !e.getBoundingClientRect) return Ge();
var n = e, a = !1;
do
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
var o = q(n);
if (n.clientWidth < n.scrollWidth && (o.overflowX == "auto" || o.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (o.overflowY == "auto" || o.overflowY == "scroll")) {
if (!n.getBoundingClientRect || n === document.body) return Ge();
if (a || t) return n;
a = !0;
}
}
while (n = n.parentNode);
return Ge();
}
function As(e, t) {
if (e && t)
for (var n in t)
t.hasOwnProperty(n) && (e[n] = t[n]);
return e;
}
function wa(e, t) {
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
}
var It;
function Hn(e, t) {
return function() {
if (!It) {
var n = arguments, a = this;
n.length === 1 ? e.call(a, n[0]) : e.apply(a, n), It = setTimeout(function() {
It = void 0;
}, t);
}
};
}
function Ps() {
clearTimeout(It), It = void 0;
}
function qn(e, t, n) {
e.scrollLeft += t, e.scrollTop += n;
}
function Gn(e) {
var t = window.Polymer, n = window.jQuery || window.Zepto;
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
}
function Xn(e, t, n) {
var a = {};
return Array.from(e.children).forEach(function(o) {
var r, l, s, u;
if (!(!He(o, t.draggable, e, !1) || o.animated || o === n)) {
var d = Ee(o);
a.left = Math.min((r = a.left) !== null && r !== void 0 ? r : 1 / 0, d.left), a.top = Math.min((l = a.top) !== null && l !== void 0 ? l : 1 / 0, d.top), a.right = Math.max((s = a.right) !== null && s !== void 0 ? s : -1 / 0, d.right), a.bottom = Math.max((u = a.bottom) !== null && u !== void 0 ? u : -1 / 0, d.bottom);
}
}), a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
var _e = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function Fs() {
var e = [], t;
return {
captureAnimationState: function() {
if (e = [], !!this.options.animation) {
var a = [].slice.call(this.el.children);
a.forEach(function(o) {
if (!(q(o, "display") === "none" || o === V.ghost)) {
e.push({
target: o,
rect: Ee(o)
});
var r = Xe({}, e[e.length - 1].rect);
if (o.thisAnimationDuration) {
var l = St(o, !0);
l && (r.top -= l.f, r.left -= l.e);
}
o.fromRect = r;
}
});
}
},
addAnimationState: function(a) {
e.push(a);
},
removeAnimationState: function(a) {
e.splice(Ms(e, {
target: a
}), 1);
},
animateAll: function(a) {
var o = this;
if (!this.options.animation) {
clearTimeout(t), typeof a == "function" && a();
return;
}
var r = !1, l = 0;
e.forEach(function(s) {
var u = 0, d = s.target, c = d.fromRect, i = Ee(d), p = d.prevFromRect, g = d.prevToRect, h = s.rect, v = St(d, !0);
v && (i.top -= v.f, i.left -= v.e), d.toRect = i, d.thisAnimationDuration && wa(p, i) && !wa(c, i) && // Make sure animatingRect is on line between toRect & fromRect
(h.top - i.top) / (h.left - i.left) === (c.top - i.top) / (c.left - i.left) && (u = _s(h, p, g, o.options)), wa(i, c) || (d.prevFromRect = c, d.prevToRect = i, u || (u = o.options.animation), o.animate(d, h, i, u)), u && (r = !0, l = Math.max(l, u), clearTimeout(d.animationResetTimer), d.animationResetTimer = setTimeout(function() {
d.animationTime = 0, d.prevFromRect = null, d.fromRect = null, d.prevToRect = null, d.thisAnimationDuration = null;
}, u), d.thisAnimationDuration = u);
}), clearTimeout(t), r ? t = setTimeout(function() {
typeof a == "function" && a();
}, l) : typeof a == "function" && a(), e = [];
},
animate: function(a, o, r, l) {
if (l) {
q(a, "transition", ""), q(a, "transform", "");
var s = St(this.el), u = s && s.a, d = s && s.d, c = (o.left - r.left) / (u || 1), i = (o.top - r.top) / (d || 1);
a.animatingX = !!c, a.animatingY = !!i, q(a, "transform", "translate3d(" + c + "px," + i + "px,0)"), this.forRepaintDummy = Os(a), q(a, "transition", "transform " + l + "ms" + (this.options.easing ? " " + this.options.easing : "")), q(a, "transform", "translate3d(0,0,0)"), typeof a.animated == "number" && clearTimeout(a.animated), a.animated = setTimeout(function() {
q(a, "transition", ""), q(a, "transform", ""), a.animated = !1, a.animatingX = !1, a.animatingY = !1;
}, l);
}
}
};
}
function Os(e) {
return e.offsetWidth;
}
function _s(e, t, n, a) {
return Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) / Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) * a.animation;
}
var vt = [], Sa = {
initializeByDefault: !0
}, Bt = {
mount: function(t) {
for (var n in Sa)
Sa.hasOwnProperty(n) && !(n in t) && (t[n] = Sa[n]);
vt.forEach(function(a) {
if (a.pluginName === t.pluginName)
throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
}), vt.push(t);
},
pluginEvent: function(t, n, a) {
var o = this;
this.eventCanceled = !1, a.cancel = function() {
o.eventCanceled = !0;
};
var r = t + "Global";
vt.forEach(function(l) {
n[l.pluginName] && (n[l.pluginName][r] && n[l.pluginName][r](Xe({
sortable: n
}, a)), n.options[l.pluginName] && n[l.pluginName][t] && n[l.pluginName][t](Xe({
sortable: n
}, a)));
});
},
initializePlugins: function(t, n, a, o) {
vt.forEach(function(s) {
var u = s.pluginName;
if (!(!t.options[u] && !s.initializeByDefault)) {
var d = new s(t, n, t.options);
d.sortable = t, d.options = t.options, t[u] = d, Ze(a, d.defaults);
}
});
for (var r in t.options)
if (t.options.hasOwnProperty(r)) {
var l = this.modifyOption(t, r, t.options[r]);
typeof l < "u" && (t.options[r] = l);
}
},
getEventProperties: function(t, n) {
var a = {};
return vt.forEach(function(o) {
typeof o.eventProperties == "function" && Ze(a, o.eventProperties.call(n[o.pluginName], t));
}), a;
},
modifyOption: function(t, n, a) {
var o;
return vt.forEach(function(r) {
t[r.pluginName] && r.optionListeners && typeof r.optionListeners[n] == "function" && (o = r.optionListeners[n].call(t[r.pluginName], a));
}), o;
}
};
function Bs(e) {
var t = e.sortable, n = e.rootEl, a = e.name, o = e.targetEl, r = e.cloneEl, l = e.toEl, s = e.fromEl, u = e.oldIndex, d = e.newIndex, c = e.oldDraggableIndex, i = e.newDraggableIndex, p = e.originalEvent, g = e.putSortable, h = e.extraEventProperties;
if (t = t || n && n[_e], !!t) {
var v, $ = t.options, m = "on" + a.charAt(0).toUpperCase() + a.substr(1);
window.CustomEvent && !et && !_t ? v = new CustomEvent(a, {
bubbles: !0,
cancelable: !0
}) : (v = document.createEvent("Event"), v.initEvent(a, !0, !0)), v.to = l || n, v.from = s || n, v.item = o || n, v.clone = r, v.oldIndex = u, v.newIndex = d, v.oldDraggableIndex = c, v.newDraggableIndex = i, v.originalEvent = p, v.pullMode = g ? g.lastPutMode : void 0;
var P = Xe(Xe({}, h), Bt.getEventProperties(a, t));
for (var I in P)
v[I] = P[I];
n && n.dispatchEvent(v), $[m] && $[m].call(t, v);
}
}
var Ns = ["evt"], Oe = function(t, n) {
var a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = a.evt, r = ks(a, Ns);
Bt.pluginEvent.bind(V)(t, n, Xe({
dragEl: D,
parentEl: we,
ghostEl: X,
rootEl: ye,
nextEl: dt,
lastDownEl: Kt,
cloneEl: be,
cloneHidden: nt,
dragStarted: Tt,
putSortable: xe,
activeSortable: V.active,
originalEvent: o,
oldIndex: bt,
oldDraggableIndex: Rt,
newIndex: Ne,
newDraggableIndex: at,
hideGhostForTarget: eo,
unhideGhostForTarget: to,
cloneNowHidden: function() {
nt = !0;
},
cloneNowShown: function() {
nt = !1;
},
dispatchSortableEvent: function(s) {
Ae({
sortable: n,
name: s,
originalEvent: o
});
}
}, r));
};
function Ae(e) {
Bs(Xe({
putSortable: xe,
cloneEl: be,
targetEl: D,
rootEl: ye,
oldIndex: bt,
oldDraggableIndex: Rt,
newIndex: Ne,
newDraggableIndex: at
}, e));
}
var D, we, X, ye, dt, Kt, be, nt, bt, Ne, Rt, at, Ut, xe, gt = !1, ra = !1, la = [], st, We, Ca, Ea, yn, bn, Tt, mt, Mt, At = !1, Lt = !1, Wt, Ie, Da = [], Fa = !1, ia = [], pa = typeof document < "u", zt = qa, wn = _t || et ? "cssFloat" : "float", Us = pa && !jn && !qa && "draggable" in document.createElement("div"), Qn = (function() {
if (pa) {
if (et)
return !1;
var e = document.createElement("x");
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
}
})(), Jn = function(t, n) {
var a = q(t), o = parseInt(a.width) - parseInt(a.paddingLeft) - parseInt(a.paddingRight) - parseInt(a.borderLeftWidth) - parseInt(a.borderRightWidth), r = Et(t, 0, n), l = Et(t, 1, n), s = r && q(r), u = l && q(l), d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + Ee(r).width, c = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + Ee(l).width;
if (a.display === "flex")
return a.flexDirection === "column" || a.flexDirection === "column-reverse" ? "vertical" : "horizontal";
if (a.display === "grid")
return a.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
if (r && s.float && s.float !== "none") {
var i = s.float === "left" ? "left" : "right";
return l && (u.clear === "both" || u.clear === i) ? "vertical" : "horizontal";
}
return r && (s.display === "block" || s.display === "flex" || s.display === "table" || s.display === "grid" || d >= o && a[wn] === "none" || l && a[wn] === "none" && d + c > o) ? "vertical" : "horizontal";
}, Ls = function(t, n, a) {
var o = a ? t.left : t.top, r = a ? t.right : t.bottom, l = a ? t.width : t.height, s = a ? n.left : n.top, u = a ? n.right : n.bottom, d = a ? n.width : n.height;
return o === s || r === u || o + l / 2 === s + d / 2;
}, zs = function(t, n) {
var a;
return la.some(function(o) {
var r = o[_e].options.emptyInsertThreshold;
if (!(!r || Ga(o))) {
var l = Ee(o), s = t >= l.left - r && t <= l.right + r, u = n >= l.top - r && n <= l.bottom + r;
if (s && u)
return a = o;
}
}), a;
}, Zn = function(t) {
function n(r, l) {
return function(s, u, d, c) {
var i = s.options.group.name && u.options.group.name && s.options.group.name === u.options.group.name;
if (r == null && (l || i))
return !0;
if (r == null || r === !1)
return !1;
if (l && r === "clone")
return r;
if (typeof r == "function")
return n(r(s, u, d, c), l)(s, u, d, c);
var p = (l ? s : u).options.group.name;
return r === !0 || typeof r == "string" && r === p || r.join && r.indexOf(p) > -1;
};
}
var a = {}, o = t.group;
(!o || Pa(o) != "object") && (o = {
name: o
}), a.name = o.name, a.checkPull = n(o.pull, !0), a.checkPut = n(o.put), a.revertClone = o.revertClone, t.group = a;
}, eo = function() {
!Qn && X && q(X, "display", "none");
}, to = function() {
!Qn && X && q(X, "display", "");
};
pa && !jn && document.addEventListener("click", function(e) {
if (ra)
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), ra = !1, !1;
}, !0);
var ut = function(t) {
if (D) {
t = t.touches ? t.touches[0] : t;
var n = zs(t.clientX, t.clientY);
if (n) {
var a = {};
for (var o in t)
t.hasOwnProperty(o) && (a[o] = t[o]);
a.target = a.rootEl = n, a.preventDefault = void 0, a.stopPropagation = void 0, n[_e]._onDragOver(a);
}
}
}, Ys = function(t) {
D && D.parentNode[_e]._isOutsideThisEl(t.target);
};
function V(e, t) {
if (!(e && e.nodeType && e.nodeType === 1))
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
this.el = e, this.options = t = Ze({}, t), e[_e] = this;
var n = {
group: null,
sort: !0,
disabled: !1,
store: null,
handle: null,
draggable: /^[uo]l$/i.test(e.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 Jn(e, this.options);
},
ghostClass: "sortable-ghost",
chosenClass: "sortable-chosen",
dragClass: "sortable-drag",
ignore: "a, img",
filter: null,
preventOnFilter: !0,
animation: 0,
easing: null,
setData: function(l, s) {
l.setData("Text", s.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
},
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
supportPointer: V.supportPointer !== !1 && "PointerEvent" in window && (!$t || qa),
emptyInsertThreshold: 5
};
Bt.initializePlugins(this, e, n);
for (var a in n)
!(a in t) && (t[a] = n[a]);
Zn(t);
for (var o in this)
o.charAt(0) === "_" && typeof this[o] == "function" && (this[o] = this[o].bind(this));
this.nativeDraggable = t.forceFallback ? !1 : Us, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? te(e, "pointerdown", this._onTapStart) : (te(e, "mousedown", this._onTapStart), te(e, "touchstart", this._onTapStart)), this.nativeDraggable && (te(e, "dragover", this), te(e, "dragenter", this)), la.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Ze(this, Fs());
}
V.prototype = /** @lends Sortable.prototype */
{
constructor: V,
_isOutsideThisEl: function(t) {
!this.el.contains(t) && t !== this.el && (mt = null);
},
_getDirection: function(t, n) {
return typeof this.options.direction == "function" ? this.options.direction.call(this, t, n, D) : this.options.direction;
},
_onTapStart: function(t) {
if (t.cancelable) {
var n = this, a = this.el, o = this.options, r = o.preventOnFilter, l = t.type, s = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, u = (s || t).target, d = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || u, c = o.filter;
if (Xs(a), !D && !(/mousedown|pointerdown/.test(l) && t.button !== 0 || o.disabled) && !d.isContentEditable && !(!this.nativeDraggable && $t && u && u.tagName.toUpperCase() === "SELECT") && (u = He(u, o.draggable, a, !1), !(u && u.animated) && Kt !== u)) {
if (bt = ze(u), Rt = ze(u, o.draggable), typeof c == "function") {
if (c.call(this, t, u, this)) {
Ae({
sortable: n,
rootEl: d,
name: "filter",
targetEl: u,
toEl: a,
fromEl: a
}), Oe("filter", n, {
evt: t
}), r && t.preventDefault();
return;
}
} else if (c && (c = c.split(",").some(function(i) {
if (i = He(d, i.trim(), a, !1), i)
return Ae({
sortable: n,
rootEl: i,
name: "filter",
targetEl: u,
fromEl: a,
toEl: a
}), Oe("filter", n, {
evt: t
}), !0;
}), c)) {
r && t.preventDefault();
return;
}
o.handle && !He(d, o.handle, a, !1) || this._prepareDragStart(t, s, u);
}
}
},
_prepareDragStart: function(t, n, a) {
var o = this, r = o.el, l = o.options, s = r.ownerDocument, u;
if (a && !D && a.parentNode === r) {
var d = Ee(a);
if (ye = r, D = a, we = D.parentNode, dt = D.nextSibling, Kt = a, Ut = l.group, V.dragged = D, st = {
target: D,
clientX: (n || t).clientX,
clientY: (n || t).clientY
}, yn = st.clientX - d.left, bn = st.clientY - d.top, this._lastX = (n || t).clientX, this._lastY = (n || t).clientY, D.style["will-change"] = "all", u = function() {
if (Oe("delayEnded", o, {
evt: t
}), V.eventCanceled) {
o._onDrop();
return;
}
o._disableDelayedDragEvents(), !vn && o.nativeDraggable && (D.draggable = !0), o._triggerDragStart(t, n), Ae({
sortable: o,
name: "choose",
originalEvent: t
}), Be(D, l.chosenClass, !0);
}, l.ignore.split(",").forEach(function(c) {
Vn(D, c.trim(), Ta);
}), te(s, "dragover", ut), te(s, "mousemove", ut), te(s, "touchmove", ut), l.supportPointer ? (te(s, "pointerup", o._onDrop), !this.nativeDraggable && te(s, "pointercancel", o._onDrop)) : (te(s, "mouseup", o._onDrop), te(s, "touchend", o._onDrop), te(s, "touchcancel", o._onDrop)), vn && this.nativeDraggable && (this.options.touchStartThreshold = 4, D.draggable = !0), Oe("delayStart", this, {
evt: t
}), l.delay && (!l.delayOnTouchOnly || n) && (!this.nativeDraggable || !(_t || et))) {
if (V.eventCanceled) {
this._onDrop();
return;
}
l.supportPointer ? (te(s, "pointerup", o._disableDelayedDrag), te(s, "pointercancel", o._disableDelayedDrag)) : (te(s, "mouseup", o._disableDelayedDrag), te(s, "touchend", o._disableDelayedDrag), te(s, "touchcancel", o._disableDelayedDrag)), te(s, "mousemove", o._delayedDragTouchMoveHandler), te(s, "touchmove", o._delayedDragTouchMoveHandler), l.supportPointer && te(s, "pointermove", o._delayedDragTouchMoveHandler), o._dragStartTimer = setTimeout(u, l.delay);
} else
u();
}
},
_delayedDragTouchMoveHandler: function(t) {
var n = t.touches ? t.touches[0] : t;
Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
},
_disableDelayedDrag: function() {
D && Ta(D), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
},
_disableDelayedDragEvents: function() {
var t = this.el.ownerDocument;
Z(t, "mouseup", this._disableDelayedDrag), Z(t, "touchend", this._disableDelayedDrag), Z(t, "touchcancel", this._disableDelayedDrag), Z(t, "pointerup", this._disableDelayedDrag), Z(t, "pointercancel", this._disableDelayedDrag), Z(t, "mousemove", this._delayedDragTouchMoveHandler), Z(t, "touchmove", this._delayedDragTouchMoveHandler), Z(t, "pointermove", this._delayedDragTouchMoveHandler);
},
_triggerDragStart: function(t, n) {
n = n || t.pointerType == "touch" && t, !this.nativeDraggable || n ? this.options.supportPointer ? te(document, "pointermove", this._onTouchMove) : n ? te(document, "touchmove", this._onTouchMove) : te(document, "mousemove", this._onTouchMove) : (te(D, "dragend", this), te(ye, "dragstart", this._onDragStart));
try {
document.selection ? Vt(function() {
document.selection.empty();
}) : window.getSelection().removeAllRanges();
} catch {
}
},
_dragStarted: function(t, n) {
if (gt = !1, ye && D) {
Oe("dragStarted", this, {
evt: n
}), this.nativeDraggable && te(document, "dragover", Ys);
var a = this.options;
!t && Be(D, a.dragClass, !1), Be(D, a.ghostClass, !0), V.active = this, t && this._appendGhost(), Ae({
sortable: this,
name: "start",
originalEvent: n
});
} else
this._nulling();
},
_emulateDragOver: function() {
if (We) {
this._lastX = We.clientX, this._lastY = We.clientY, eo();
for (var t = document.elementFromPoint(We.clientX, We.clientY), n = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(We.clientX, We.clientY), t !== n); )
n = t;
if (D.parentNode[_e]._isOutsideThisEl(t), n)
do {
if (n[_e]) {
var a = void 0;
if (a = n[_e]._onDragOver({
clientX: We.clientX,
clientY: We.clientY,
target: t,
rootEl: n
}), a && !this.options.dragoverBubble)
break;
}
t = n;
} while (n = Wn(n));
to();
}
},
_onTouchMove: function(t) {
if (st) {
var n = this.options, a = n.fallbackTolerance, o = n.fallbackOffset, r = t.touches ? t.touches[0] : t, l = X && St(X, !0), s = X && l && l.a, u = X && l && l.d, d = zt && Ie && gn(Ie), c = (r.clientX - st.clientX + o.x) / (s || 1) + (d ? d[0] - Da[0] : 0) / (s || 1), i = (r.clientY - st.clientY + o.y) / (u || 1) + (d ? d[1] - Da[1] : 0) / (u || 1);
if (!V.active && !gt) {
if (a && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < a)
return;
this._onDragStart(t, !0);
}
if (X) {
l ? (l.e += c - (Ca || 0), l.f += i - (Ea || 0)) : l = {
a: 1,
b: 0,
c: 0,
d: 1,
e: c,
f: i
};
var p = "matrix(".concat(l.a, ",").concat(l.b, ",").concat(l.c, ",").concat(l.d, ",").concat(l.e, ",").concat(l.f, ")");
q(X, "webkitTransform", p), q(X, "mozTransform", p), q(X, "msTransform", p), q(X, "transform", p), Ca = c, Ea = i, We = r;
}
t.cancelable && t.preventDefault();
}
},
_appendGhost: function() {
if (!X) {
var t = this.options.fallbackOnBody ? document.body : ye, n = Ee(D, !0, zt, !0, t), a = this.options;
if (zt) {
for (Ie = t; q(Ie, "position") === "static" && q(Ie, "transform") === "none" && Ie !== document; )
Ie = Ie.parentNode;
Ie !== document.body && Ie !== document.documentElement ? (Ie === document && (Ie = Ge()), n.top += Ie.scrollTop, n.left += Ie.scrollLeft) : Ie = Ge(), Da = gn(Ie);
}
X = D.cloneNode(!0), Be(X, a.ghostClass, !1), Be(X, a.fallbackClass, !0), Be(X, a.dragClass, !0), q(X, "transition", ""), q(X, "transform", ""), q(X, "box-sizing", "border-box"), q(X, "margin", 0), q(X, "top", n.top), q(X, "left", n.left), q(X, "width", n.width), q(X, "height", n.height), q(X, "opacity", "0.8"), q(X, "position", zt ? "absolute" : "fixed"), q(X, "zIndex", "100000"), q(X, "pointerEvents", "none"), V.ghost = X, t.appendChild(X), q(X, "transform-origin", yn / parseInt(X.style.width) * 100 + "% " + bn / parseInt(X.style.height) * 100 + "%");
}
},
_onDragStart: function(t, n) {
var a = this, o = t.dataTransfer, r = a.options;
if (Oe("dragStart", this, {
evt: t
}), V.eventCanceled) {
this._onDrop();
return;
}
Oe("setupClone", this), V.eventCanceled || (be = Gn(D), be.removeAttribute("id"), be.draggable = !1, be.style["will-change"] = "", this._hideClone(), Be(be, this.options.chosenClass, !1), V.clone = be), a.cloneId = Vt(function() {
Oe("clone", a), !V.eventCanceled && (a.options.removeCloneOnHide || ye.insertBefore(be, D), a._hideClone(), Ae({
sortable: a,
name: "clone"
}));
}), !n && Be(D, r.dragClass, !0), n ? (ra = !0, a._loopId = setInterval(a._emulateDragOver, 50)) : (Z(document, "mouseup", a._onDrop), Z(document, "touchend", a._onDrop), Z(document, "touchcancel", a._onDrop), o && (o.effectAllowed = "move", r.setData && r.setData.call(a, o, D)), te(document, "drop", a), q(D, "transform", "translateZ(0)")), gt = !0, a._dragStartId = Vt(a._dragStarted.bind(a, n, t)), te(document, "selectstart", a), Tt = !0, window.getSelection().removeAllRanges(), $t && q(document.body, "user-select", "none");
},
// Returns true - if no further action is needed (either inserted or another condition)
_onDragOver: function(t) {
var n = this.el, a = t.target, o, r, l, s = this.options, u = s.group, d = V.active, c = Ut === u, i = s.sort, p = xe || d, g, h = this, v = !1;
if (Fa) return;
function $(y, z) {
Oe(y, h, Xe({
evt: t,
isOwner: c,
axis: g ? "vertical" : "horizontal",
revert: l,
dragRect: o,
targetRect: r,
canSort: i,
fromSortable: p,
target: a,
completed: P,
onMove: function(J, oe) {
return Yt(ye, n, D, o, J, Ee(J), t, oe);
},
changed: I
}, z));
}
function m() {
$("dragOverAnimationCapture"), h.captureAnimationState(), h !== p && p.captureAnimationState();
}
function P(y) {
return $("dragOverCompleted", {
insertion: y
}), y && (c ? d._hideClone() : d._showClone(h), h !== p && (Be(D, xe ? xe.options.ghostClass : d.options.ghostClass, !1), Be(D, s.ghostClass, !0)), xe !== h && h !== V.active ? xe = h : h === V.active && xe && (xe = null), p === h && (h._ignoreWhileAnimating = a), h.animateAll(function() {
$("dragOverAnimationComplete"), h._ignoreWhileAnimating = null;
}), h !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (a === D && !D.animated || a === n && !a.animated) && (mt = null), !s.dragoverBubble && !t.rootEl && a !== document && (D.parentNode[_e]._isOutsideThisEl(t.target), !y && ut(t)), !s.dragoverBubble && t.stopPropagation && t.stopPropagation(), v = !0;
}
function I() {
Ne = ze(D), at = ze(D, s.draggable), Ae({
sortable: h,
name: "change",
toEl: n,
newIndex: Ne,
newDraggableIndex: at,
originalEvent: t
});
}
if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), a = He(a, s.draggable, n, !0), $("dragOver"), V.eventCanceled) return v;
if (D.contains(t.target) || a.animated && a.animatingX && a.animatingY || h._ignoreWhileAnimating === a)
return P(!1);
if (ra = !1, d && !s.disabled && (c ? i || (l = we !== ye) : xe === this || (this.lastPutMode = Ut.checkPull(this, d, D, t)) && u.checkPut(this, d, D, t))) {
if (g = this._getDirection(t, a) === "vertical", o = Ee(D), $("dragOverValid"), V.eventCanceled) return v;
if (l)
return we = ye, m(), this._hideClone(), $("revert"), V.eventCanceled || (dt ? ye.insertBefore(D, dt) : ye.appendChild(D)), P(!0);
var K = Ga(n, s.draggable);
if (!K || Vs(t, g, this) && !K.animated) {
if (K === D)
return P(!1);
if (K && n === t.target && (a = K), a && (r = Ee(a)), Yt(ye, n, D, o, a, r, t, !!a) !== !1)
return m(), K && K.nextSibling ? n.insertBefore(D, K.nextSibling) : n.appendChild(D), we = n, I(), P(!0);
} else if (K && Ws(t, g, this)) {
var G = Et(n, 0, s, !0);
if (G === D)
return P(!1);
if (a = G, r = Ee(a), Yt(ye, n, D, o, a, r, t, !1) !== !1)
return m(), n.insertBefore(D, G), we = n, I(), P(!0);
} else if (a.parentNode === n)