@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,457 lines (1,456 loc) • 161 kB
JavaScript
var Kt = Object.defineProperty;
var en = (e, t, n) => t in e ? Kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var ke = (e, t, n) => en(e, typeof t != "symbol" ? t + "" : t, n);
import { ref as O, computed as z, defineComponent as de, watch as qe, onUnmounted as tn, createVNode as d, withDirectives as nn, createTextVNode as q, resolveDirective as sn, resolveComponent as on, onMounted as $e, mergeProps as rn, inject as Re } from "vue";
import { isPlainObject as Ye, cloneDeep as Ce, debounce as an } from "lodash-es";
import { getSchemaByType as ln, createPropsResolver as cn } from "../dynamic-resolver/index.esm.js";
import { DgControl as un, useDesignerComponent as dn } from "../designer-canvas/index.esm.js";
import { useGuid as mn, getCustomClass as oe, getCustomStyle as re, useDateFormat as fn, withInstall as pn } from "../common/index.esm.js";
import { FNotifyService as gn } from "../notify/index.esm.js";
import { createI18n as hn, useI18n as yn } from "vue-i18n";
import bn from "../popover/index.esm.js";
import vn from "../input-group/index.esm.js";
import Cn from "../pagination/index.esm.js";
import { BaseControlProperty as Sn } from "../property-panel/index.esm.js";
const xn = "https://json-schema.org/draft/2020-12/schema", Tn = "https://farris-design.gitee.io/comment.schema.json", wn = "comment", En = "A Farris Component", Dn = "object", Pn = {
id: {
description: "The unique identifier for comment",
type: "string"
},
type: {
description: "The type string of comment",
type: "string",
default: "comment"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
personSearchUrl: {
description: "",
type: "string"
},
replyUser: {
description: "",
type: "object"
},
personnels: {
description: "",
type: "object",
default: []
},
editorHeight: {
description: "",
type: "number"
},
editorClass: {
description: "",
type: "string"
},
editorStyle: {
description: "",
type: "string"
},
editorVisible: {
description: "",
type: "boolean",
default: !0
},
listClass: {
description: "",
type: "string"
},
listStyle: {
description: "",
type: "string"
},
listVisible: {
description: "",
type: "boolean",
default: !0
}
}, On = [
"id",
"type"
], kn = {
onValueChange: "提交评论事件",
onQueryFrequentAtUsers: "加载常用@人员事件",
onQueryComments: "获取评论"
}, ft = {
$schema: xn,
$id: Tn,
title: wn,
description: En,
type: Dn,
properties: Pn,
required: On,
events: kn
};
function pt(e, t) {
let n;
function s(u) {
const { properties: h, title: b, ignore: a } = u, g = a && Array.isArray(a), p = Object.keys(h).reduce((C, x) => ((!g || !a.find((w) => w === x)) && (C[x] = h[x].type === "object" && h[x].properties ? s(h[x]) : Ce(h[x].default)), C), {});
if (b && (!g || !a.find((C) => C === "id"))) {
const C = b.toLowerCase().replace(/-/g, "_");
p.id = `${C}_${Math.random().toString().slice(2, 6)}`;
}
return p;
}
function o(u) {
const { properties: h, title: b, required: a } = u;
if (a && Array.isArray(a)) {
const g = a.reduce((p, C) => (p[C] = h[C].type === "object" && h[C].properties ? s(h[C]) : Ce(h[C].default), p), {});
if (b && a.find((p) => p === "id")) {
const p = b.toLowerCase().replace(/-/g, "_");
g.id = `${p}_${Math.random().toString().slice(2, 6)}`;
}
return g;
}
return {
type: b
};
}
function i(u, h = {}, b) {
const a = e[u];
if (a) {
let g = o(a);
const p = t[u];
return g = p ? p({ getSchemaByType: i }, g, h, b) : g, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(g), g;
}
return null;
}
function r(u, h) {
const b = s(h);
return Object.keys(b).reduce((a, g) => (Object.prototype.hasOwnProperty.call(u, g) && (a[g] && Ye(a[g]) && Ye(u[g] || !u[g]) ? Object.assign(a[g], u[g] || {}) : a[g] = u[g]), a), b), b;
}
function c(u, h) {
return Object.keys(u).filter((a) => u[a] != null).reduce((a, g) => {
if (h.has(g)) {
const p = h.get(g);
if (typeof p == "string")
a[p] = u[g];
else {
const C = p(g, u[g], u);
Object.assign(a, C);
}
} else
a[g] = u[g];
return a;
}, {});
}
function y(u, h, b = /* @__PURE__ */ new Map()) {
const a = r(u, h);
return c(a, b);
}
function f(u) {
var b;
const h = u.type;
if (h) {
const a = e[h];
if (!a)
return u;
const g = r(u, a), p = ((b = u.editor) == null ? void 0 : b.type) || "";
if (p) {
const C = e[p], x = r(u.editor, C);
g.editor = x;
}
return g;
}
return u;
}
function l(u) {
n = u;
}
return { getSchemaByType: i, resolveSchemaWithDefaultValue: f, resolveSchemaToProps: y, mappingSchemaToProps: c, setDesignerContext: l };
}
const gt = {}, ht = {}, { resolveSchemaWithDefaultValue: Fn, resolveSchemaToProps: An, mappingSchemaToProps: Ln } = pt(gt, ht);
function Rn(e = {}) {
function t(f, l, u, h) {
if (typeof u == "number")
return h[f].length === u;
if (typeof u == "object") {
const b = Object.keys(u)[0], a = u[b];
if (b === "not")
return Number(h[f].length) !== Number(a);
if (b === "moreThan")
return Number(h[f].length) >= Number(a);
if (b === "lessThan")
return Number(h[f].length) <= Number(a);
}
return !1;
}
function n(f, l, u, h) {
return h[f] && h[f].propertyValue && String(h[f].propertyValue.value) === String(u);
}
const s = /* @__PURE__ */ new Map([
["length", t],
["getProperty", n]
]);
Object.keys(e).reduce((f, l) => (f.set(l, e[l]), f), s);
function o(f, l) {
const u = f;
return typeof l == "number" ? [{ target: u, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: u, operator: "getProperty", param: f, value: !!l }] : typeof l == "object" ? Object.keys(l).map((h) => {
if (h === "length")
return { target: u, operator: "length", param: null, value: l[h] };
const b = h, a = l[h];
return { target: u, operator: "getProperty", param: b, value: a };
}) : [];
}
function i(f) {
return Object.keys(f).reduce((u, h) => {
const b = o(h, f[h]);
return u.push(...b), u;
}, []);
}
function r(f, l) {
if (s.has(f.operator)) {
const u = s.get(f.operator);
return u && u(f.target, f.param, f.value, l) || !1;
}
return !1;
}
function c(f, l) {
return i(f).reduce((b, a) => b && r(a, l), !0);
}
function y(f, l) {
const u = Object.keys(f), h = u.includes("allOf"), b = u.includes("anyOf"), a = h || b, C = (a ? f[a ? h ? "allOf" : "anyOf" : "allOf"] : [f]).map((w) => c(w, l));
return h ? !C.includes(!1) : C.includes(!0);
}
return { parseValueSchema: y };
}
const Mn = {
convertTo: (e, t, n, s) => {
e.appearance || (e.appearance = {}), e.appearance[t] = n;
},
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
}, Nn = {
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, Bn = {
convertTo: (e, t, n, s) => {
e.editor && (e.editor[t] = n);
},
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
}, In = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
"drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" },
image: { type: "image", name: "图像" },
"discussion-editor": { type: "discussion-editor", name: "评论编辑区" },
"discussion-list": { type: "discussion-list", name: "评论列表" },
comment: { type: "comment", name: "评论区" },
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
wizard: { type: "wizard", name: "向导", icon: "wizard" },
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
step: { type: "step", name: "步骤条", icon: "step" },
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
}, Un = {
convertFrom: (e, t, n) => {
var o;
const s = e.editor && e.editor[t] ? e.editor[t] : e[t];
return ((o = In[s]) == null ? void 0 : o.name) || s;
}
}, qn = {
convertTo: (e, t, n, s) => {
e[t] = e[t];
},
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
}, $n = {
convertTo: (e, t, n, s) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
[t]: n
});
},
convertFrom: (e, t, n) => {
if (e.formatter) {
if (t === "trueText")
return e.formatter.trueText;
if (t === "falseText")
return e.formatter.falseText;
if (t === "prefix")
return e.formatter.prefix;
if (t === "suffix")
return e.formatter.suffix;
if (t === "precision")
return e.formatter.precision;
if (t === "decimal")
return e.formatter.decimal;
if (t === "thousand")
return e.formatter.thousand;
if (t === "dateFormat")
return e.formatter.dateFormat || "yyyy-MM-dd";
if (t === "customFormat")
return e.formatter.customFormat;
if (t === "type")
return e.formatter.type || "none";
if (t === "customFormat")
return e.formmater.customFormat;
}
return "none";
}
}, jn = {
convertTo: (e, t, n, s) => {
e.command ? e.command[t] = n : e.command = {
[t]: n
}, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [
{
value: "add",
text: "增加",
type: "link"
},
{
value: "edit",
text: "编辑",
type: "danger"
},
{
value: "remove",
text: "删除",
type: "remove"
}
]), t === "enableType" && n === "unable" && (e.command.enable = !1);
},
convertFrom: (e, t, n) => {
var s, o;
if (e.command) {
if (t === "enableType") {
const i = (o = (s = e.command) == null ? void 0 : s.commands) == null ? void 0 : o.find((r) => r.command === "edit" && r.type === "primary");
return e.command.enable ? i ? "default" : "custom" : "unable";
}
if (t === "commands")
return e.command.enableType === "custom" ? e.command.commands : [];
if (t === "formatter")
return e.command.formatter;
if (t === "count")
return e.command.count;
if (t === "columnWidth")
return e.command.columnWidth || 200;
}
return "";
}
}, Vn = {
convertTo: (e, t, n, s) => {
e.column ? e.column[t] = n : e.column = {
[t]: n
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, t, n) => {
if (e.column) {
if (t === "fitColumns")
return e.column.fitColumns;
if (t === "fitMode")
return e.column.fitMode;
}
return "";
}
}, zn = {
convertTo: (e, t, n, s) => {
e.summary ? e.summary[t] = n : e.summary = {
[t]: n
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: n,
groupFields: []
});
},
convertFrom: (e, t, n) => {
var s, o;
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((s = e.summary) == null ? void 0 : s[t]) || "bottom" : t === "customRender" ? ((o = e.summary) == null ? void 0 : o[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
}
}, Wn = {
convertTo: (e, t, n, s) => {
e.group ? e.group[t] = n : e.group = {
[t]: n
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: n,
groupFields: [],
showSummary: !1,
customRender: ""
});
},
convertFrom: (e, t, n) => {
if (e.group) {
if (t === "enable")
return e.group.enable;
if (t === "showSummary")
return e.group.showSummary;
if (t === "customRender")
return e.group.customRender;
if (t === "groupFields")
return e.group.groupFields;
}
}
}, Hn = {
convertFrom: (e, t) => e.binding ? e.binding.path : "",
convertTo: (e, t, n) => {
if (n && n.length > 0) {
const s = n[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = s.bindingField, e.binding.field = s.id, e.binding.fullPath = s.path, e.path = s.bindingPath;
}
}
}, _n = {
convertTo: (e, t, n, s) => {
e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n;
},
convertFrom: (e, t, n) => e.pagination ? t === "sizeLimits" ? e.pagination.sizeLimits.join(",") : e.pagination[t] : e[t]
}, Jn = {
convertTo: (e, t, n, s) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
},
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
}, Yn = {
convertTo: (e, t, n, s) => {
e.selection || (e.selection = {}), e.selection[t] = n;
},
convertFrom: (e, t, n) => {
var s, o;
return t === "showCheckbox" ? (s = e.selection) != null && s.multiSelect ? !0 : (o = e.selection) == null ? void 0 : o.showCheckbox : e.selection ? e.selection[t] : e[t];
}
}, Gn = {
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
}, Qn = {
convertFrom: (e, t) => e[t] || "",
convertTo: (e, t, n) => {
e[t] = n;
}
}, Xn = {
convertTo: (e, t, n, s) => {
e.size || (e.size = {}), e.size[t] = n;
},
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
}, Zn = {
convertFrom: (e, t, n) => {
var s, o;
return (s = e.formatter) != null && s.data && t === "formatterEnumData" && !e.formatterEnumData ? (o = e.formatter) == null ? void 0 : o.data : e.formatterEnumData;
}
}, Kn = {
convertTo: (e, t, n, s) => {
e.sort || (e.sort = {}), e.sort[t] = n;
},
convertFrom: (e, t, n) => {
var s, o;
if (t === "mode")
return ((s = e.sort) == null ? void 0 : s.mode) || "client";
if (t === "multiSort")
return !!((o = e.sort) != null && o.multiSort);
}
}, es = {
convertTo: (e, t, n, s) => {
e.filter || (e.filter = {}), e.filter[t] = n;
},
convertFrom: (e, t, n) => {
var s;
if (t === "mode")
return ((s = e.filter) == null ? void 0 : s.mode) || "client";
}
}, ts = {
convertTo: (e, t, n, s) => {
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
[t]: n
};
},
convertFrom: (e, t, n) => {
if (e.rowOption) {
if (t === "customRowStyle")
return e.rowOption.customRowStyle;
if (t === "customCellStyle")
return e.rowOption.customCellStyle;
if (t === "height")
return e.rowOption.height;
}
return "";
}
}, ns = {
convertTo: (e, t, n, s) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer"
@click="(ctx)=>viewModel.current.${e.onClickLinkCommand || ""}({id: rowData.id,context: ctx})">
{{rowData.${e.field}}}
</span>` : e.columnTemplate = `
<span class="f-pretend-link f-cursor-pointer">
{{rowData.${e.field}}}
</span>`), t === "columnTemplateType" && n === "default" && (e.columnTemplate = ""), t === "columnTemplateType" && n === "custom" && (e.columnTemplate = ""));
},
convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : ""
};
function yt(e, t, n) {
const s = /* @__PURE__ */ new Map([
["/converter/appearance.converter", Mn],
["/converter/buttons.converter", Nn],
["/converter/property-editor.converter", Bn],
["/converter/items-count.converter", Gn],
["/converter/type.converter", Un],
["/converter/change-editor.converter", qn],
["/converter/change-formatter.converter", $n],
["/converter/column-command.converter", jn],
["/converter/column-option.converter", Vn],
["/converter/summary.converter", zn],
["/converter/group.converter", Wn],
["/converter/form-group-label.converter", Qn],
["/converter/field-selector.converter", Hn],
["/converter/pagination.converter", _n],
["/converter/row-number.converter", Jn],
["/converter/grid-selection.converter", Yn],
["/converter/size.converter", Xn],
["/converter/change-formatter-enum.converter", Zn],
["/converter/grid-sort.converter", Kn],
["/converter/grid-filter.converter", es],
["/converter/row-option.converter", ts],
["/converter/change-formatter-type.converter", ns]
]), o = /* @__PURE__ */ new Map([
["string", { type: "input-group", enableClear: !1 }],
["boolean", {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
enableClear: !1,
editable: !1,
data: [
{
value: !0,
name: "是"
},
{
value: !1,
name: "否"
}
]
}],
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
["array", { type: "button-edit" }],
["number", { type: "number-spinner", placeholder: "" }],
["events-editor", { type: "events-editor", hide: !0 }],
["multiLanguage", { type: "language-textbox" }]
]), i = Rn();
function r(a, g) {
return () => i.parseValueSchema(a, g);
}
function c(a, g, p) {
return a.includes("visible") && g.visible !== void 0 ? typeof g.visible == "boolean" ? () => !!g.visible : g.visible === void 0 ? !0 : r(g.visible, p) : () => !0;
}
function y(a, g, p) {
return a.includes("readonly") && g.readonly !== void 0 ? typeof g.readonly == "boolean" ? () => !!g.readonly : r(g.readonly, p) : () => !1;
}
function f(a, g) {
const p = a.$converter || g;
return typeof p == "string" && p && s.has(p) ? s.get(p) || null : p || null;
}
function l(a, g, p, C, x, w = "", P = "") {
return Object.keys(a).map((D) => {
const F = O(1), U = D, k = a[D], v = Object.keys(k), L = k.title, N = k.type, B = o.get(N) || { type: "input-group", enableClear: !1 }, M = k.editor ? Object.assign({}, B, k.editor) : Object.assign({}, B), Y = c(v, k, g), I = y(v, k, g);
M.readonly = M.readonly === void 0 ? I() : M.readonly;
const X = k.type === "cascade" ? l(k.properties, g, p, C, x, w, P) : [], $ = !0;
let W = f(k, P);
const ce = z({
get() {
if (F.value) {
if (["class", "style"].find((Zt) => Zt === U) && !W && (W = s.get("/converter/appearance.converter") || null), W && W.convertFrom)
return W.convertFrom(p, D, x, w);
const K = p[D];
return Object.prototype.hasOwnProperty.call(k, "defaultValue") && (K === void 0 || typeof K == "string" && K === "") ? k.type === "boolean" ? k.defaultValue : k.defaultValue || "" : K;
}
return null;
},
set(K) {
F.value += 1, W && W.convertTo ? (W.convertTo(C, D, K, x, w), W.convertTo(p, D, K, x, w)) : (C[D] = K, p[D] = K);
}
}), { refreshPanelAfterChanged: T, description: j, isExpand: H, parentPropertyID: G } = k, se = { propertyID: U, propertyName: L, propertyType: N, propertyValue: ce, editor: M, visible: Y, readonly: I, cascadeConfig: X, hideCascadeTitle: $, refreshPanelAfterChanged: T, description: j, isExpand: H, parentPropertyID: G };
return g[U] = se, se;
});
}
function u(a, g, p = {}) {
const C = {}, x = e[a];
return x && x.categories ? Object.keys(x.categories).map((P) => {
const S = x.categories[P], D = S == null ? void 0 : S.title, F = l(S.properties || {}, C, {}, p, g);
return { categoryId: P, categoryName: D, properties: F };
}) : [];
}
function h(a, g, p, C, x = "") {
const w = g.$ref.schema, P = g.$ref.converter, S = p[w], D = S.type, F = n(S), U = {}, k = e[D];
if (k && k.categories) {
const v = k.categories[a], L = v == null ? void 0 : v.title;
P && Object.keys(v.properties).forEach((M) => {
v.properties[M].$converter = P;
});
const N = (v == null ? void 0 : v.properties) || {}, B = l(N, U, F, S, C, x);
return { categoryId: a, categoryName: L, properties: B };
}
return { categoryId: a, categoryName: "", properties: [] };
}
function b(a, g, p, C, x) {
const w = a.type, P = n(a), S = {};
let D = x || e[w];
if (!(D && Object.keys(D).length > 0) && p && p.getPropConfig && (D = p.getPropConfig(C)), D && D.categories) {
const U = [];
return Object.keys(D.categories).map((k) => {
const v = D.categories[k];
if (v.$ref) {
U.push(h(k, v, a, g, C));
return;
}
const L = v == null ? void 0 : v.title, N = v == null ? void 0 : v.tabId, B = v == null ? void 0 : v.tabName, M = v == null ? void 0 : v.hide, Y = v == null ? void 0 : v.hideTitle, I = l(v.properties || {}, S, P, a, g, C, v.$converter), { setPropertyRelates: X } = v, $ = v == null ? void 0 : v.parentPropertyID;
U.push({ categoryId: k, categoryName: L, tabId: N, tabName: B, hide: M, properties: I, hideTitle: Y, setPropertyRelates: X, parentPropertyID: $ });
}), U;
}
return [];
}
return {
getPropertyConfigBySchema: b,
getPropertyConfigByType: u,
propertyConverterMap: s
};
}
const bt = {}, vt = {};
yt(bt, vt, Fn);
const Ct = {}, St = {}, { resolveSchemaWithDefaultValue: ss } = pt(Ct, St), xt = {}, Tt = {};
yt(xt, Tt, ss);
function os(e, t, n = /* @__PURE__ */ new Map(), s = (r, c, y, f) => c, o = {}, i = (r) => r) {
return gt[t.title] = t, ht[t.title] = s, bt[t.title] = o, vt[t.title] = i, Ct[t.title] = t, St[t.title] = s, xt[t.title] = o, Tt[t.title] = i, (r = {}, c = !0) => {
if (!c)
return Ln(r, n);
const y = An(r, t, n), f = Object.keys(e).reduce((l, u) => (l[u] = e[u].default, l), {});
return Object.assign(f, y);
};
}
function rs(e, t) {
return { customClass: t.class, customStyle: t.style };
}
const wt = /* @__PURE__ */ new Map([
["appearance", rs]
]);
function is(e, t) {
const n = t == null ? void 0 : t.formSchemaUtils, s = e.parentComponentInstance, o = "7690ac62-f2fd-43aa-96a2-973f0d450f82";
function i() {
const l = ln(un.comment.type);
if (!l)
return;
const u = Math.random().toString(36).substr(2, 4);
return Object.assign(l, {
id: "comment-" + u,
personSearchUrl: "/api/runtime/comment/v1.0/bill-comment/atUser"
}), { comment: l };
}
function r(l, u) {
let h;
if (l && l.commands) {
let b = l.commands.find((a) => a.handlerName === u.handlerName && a.cmpId === o);
return b ? b.params && b.params.length && b.params.forEach((a) => a.value = "") : (h = mn().guid(), b = {
id: h,
code: `${l.id.replace(/-/g, "").replace("component", "").replace("viewmodel", "")}${u.handlerName}1`,
name: u.name,
params: u.params,
handlerName: u.handlerName,
cmpId: o
}, l.commands.push(b)), { commandId: h, commandCode: b.code };
}
return { commandId: "", commandCode: "" };
}
function c(l, u) {
const h = n.getCommands();
if (h) {
let b = h.find((a) => a.id === o);
b || (b = {
id: o,
path: "Gsp/Web/WebCmp/bo-webcmp/metadata/webcmd-vue",
name: "DiscussionController.webcmd",
refedHandlers: []
}, n.getCommands().push(b)), l && b.refedHandlers.push(
{
host: l,
handler: u
}
);
}
}
function y(l) {
const u = s.belongedComponentId, h = n.getViewModelIdByComponentId(u), b = n.getViewModelById(h);
[
{
handlerName: "createComment",
name: "提交评论",
params: [
{
name: "id",
shownName: "数据ID",
value: "",
defaultValue: null
},
{
name: "summary",
shownName: "备注",
value: "",
defaultValue: null
},
{
name: "configID",
shownName: "配置ID",
value: "",
defaultValue: null
}
],
emitEvent: "onValueChange"
},
{
handlerName: "queryFrequentMentionUsers",
name: "加载常用@人员",
params: [],
emitEvent: "onQueryFrequentAtUsers"
},
{
handlerName: "queryComments",
name: "查询评论",
params: [
{
name: "id",
shownName: "数据ID",
value: "",
defaultValue: null
},
{
name: "configID",
shownName: "配置ID",
value: "",
defaultValue: null
}
],
emitEvent: "onQueryComments"
}
].forEach((g) => {
const { commandId: p, commandCode: C } = r(b, g);
C && (l[g.emitEvent] = C), p && c(p, g.handlerName);
});
}
function f() {
const { comment: l } = i();
y(l);
const u = t == null ? void 0 : t.useFormCommand;
return u && u.checkCommands(), l;
}
return { createComment: f };
}
function Et(e, t, n, s) {
if (n.parentComponentInstance && s) {
const r = is(n, s).createComment();
if (r)
return r;
}
return t;
}
const je = {
/** 发表评论的取消按钮是否可见 */
cancelVisible: { Type: Boolean, default: !0 },
/** @人员时,区分人员的标识 */
personnelsPrimaryKey: { Type: String, default: "id" },
/** @人员时,展示的人员信息字段 */
personnelsDisplayKey: { Type: String, default: "name" },
/** 回复人员时,展示的回复人员信息字段 */
replyPersonnelsDisplayKey: { Type: String, default: "userName" },
/** 编辑区高度 */
editorHeight: { Type: Number, default: 130 },
type: { Type: String, default: "user" },
/** 组织查询链接,应用在组织人员窗口 */
orgUrl: { Type: String, default: "" },
/** 人员查询链接,根据组织查询对应的人员 */
personSearchUrl: { Type: String, default: "" },
/** 查询所有部门数据 */
sectionData: { Type: Object, default: [] },
/** 回复人员数据信息 */
replyUser: { Type: Object },
/** 获取@用户|获取常用@用户 */
personnels: { Type: Object, default: [] },
/** 评论附加的组件 */
attachFiles: { Type: Object, default: [] },
/** 弹出窗口的样式 */
popupClass: { Type: String, default: "" },
/** 控制是否可见 */
visible: { type: Boolean, default: !0 },
/** 组件自定义样式 */
customClass: { type: String, default: "" },
customStyle: { type: String, default: "" },
/** 回复评论是所有人可见还是只被回复人可见 */
permissionType: { type: String, default: "ALL" },
/** 组件id */
id: { Type: String, default: "" }
}, Dt = {
pagerOnServer: { Type: Boolean, default: !0 },
/** 是否支持分页 */
supportPaging: { Type: Boolean, default: !0 },
/** 当前页码 */
pageIndex: { Type: Number, default: 1 },
/** 总条数 */
total: { Type: Number, default: 0 },
/** 每页显示个数 */
pageSize: { Type: Number, default: 10 },
/** 评论数据 */
discussionData: { Type: Object, default: [] },
replyPersonnelsDisplayKey: { Type: String, default: "userName" },
id: { Type: String, default: "" },
/** 组件自定义样式 */
customClass: { type: String, default: "" },
customStyle: { type: String, default: "" },
/** 控制是否可见 */
visible: { type: Boolean, default: !0 }
}, Ve = Object.assign({}, je, Dt, {
customClass: { type: String, default: "" },
/** 讨论区编辑器样式 */
editorClass: { type: String, default: "" },
editorStyle: { type: String, default: "" },
editorVisible: { type: Boolean, default: !0 },
/** 讨论区列表样式 */
listClass: { type: String, default: "" },
listStyle: { type: String, default: "" },
listVisible: { type: Boolean, default: !0 },
visible: { type: Boolean, default: !0 }
}), as = cn(Ve, ft, wt, Et);
var Me = /* @__PURE__ */ ((e) => (e[e.Cancel = 0] = "Cancel", e[e.Confirm = 1] = "Confirm", e))(Me || {});
const ls = "F_COMMENT_LIST_SERVICE_TOKEN", Ge = "zh-CHS", cs = {
locale: Ge,
fallbackLocale: Ge,
uri: ""
};
function Pt(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: us } = Object.prototype, { getPrototypeOf: ze } = Object, { iterator: we, toStringTag: Ot } = Symbol, Ee = /* @__PURE__ */ ((e) => (t) => {
const n = us.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), Q = (e) => (e = e.toLowerCase(), (t) => Ee(t) === e), De = (e) => (t) => typeof t === e, { isArray: ae } = Array, ie = De("undefined");
function me(e) {
return e !== null && !ie(e) && e.constructor !== null && !ie(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const kt = Q("ArrayBuffer");
function ds(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && kt(e.buffer), t;
}
const ms = De("string"), _ = De("function"), Ft = De("number"), fe = (e) => e !== null && typeof e == "object", fs = (e) => e === !0 || e === !1, ye = (e) => {
if (Ee(e) !== "object")
return !1;
const t = ze(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ot in e) && !(we in e);
}, ps = (e) => {
if (!fe(e) || me(e))
return !1;
try {
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
} catch {
return !1;
}
}, gs = Q("Date"), hs = Q("File"), ys = Q("Blob"), bs = Q("FileList"), vs = (e) => fe(e) && _(e.pipe), Cs = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = Ee(e)) === "formdata" || // detect form-data instance
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
}, Ss = Q("URLSearchParams"), [xs, Ts, ws, Es] = ["ReadableStream", "Request", "Response", "Headers"].map(Q), Ds = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function pe(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let s, o;
if (typeof e != "object" && (e = [e]), ae(e))
for (s = 0, o = e.length; s < o; s++)
t.call(null, e[s], s, e);
else {
if (me(e))
return;
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), r = i.length;
let c;
for (s = 0; s < r; s++)
c = i[s], t.call(null, e[c], c, e);
}
}
function At(e, t) {
if (me(e))
return null;
t = t.toLowerCase();
const n = Object.keys(e);
let s = n.length, o;
for (; s-- > 0; )
if (o = n[s], t === o.toLowerCase())
return o;
return null;
}
const ee = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Lt = (e) => !ie(e) && e !== ee;
function Ne() {
const { caseless: e, skipUndefined: t } = Lt(this) && this || {}, n = {}, s = (o, i) => {
const r = e && At(n, i) || i;
ye(n[r]) && ye(o) ? n[r] = Ne(n[r], o) : ye(o) ? n[r] = Ne({}, o) : ae(o) ? n[r] = o.slice() : (!t || !ie(o)) && (n[r] = o);
};
for (let o = 0, i = arguments.length; o < i; o++)
arguments[o] && pe(arguments[o], s);
return n;
}
const Ps = (e, t, n, { allOwnKeys: s } = {}) => (pe(t, (o, i) => {
n && _(o) ? e[i] = Pt(o, n) : e[i] = o;
}, { allOwnKeys: s }), e), Os = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), ks = (e, t, n, s) => {
e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, Fs = (e, t, n, s) => {
let o, i, r;
const c = {};
if (t = t || {}, e == null) return t;
do {
for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
r = o[i], (!s || s(r, e, t)) && !c[r] && (t[r] = e[r], c[r] = !0);
e = n !== !1 && ze(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, As = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const s = e.indexOf(t, n);
return s !== -1 && s === n;
}, Ls = (e) => {
if (!e) return null;
if (ae(e)) return e;
let t = e.length;
if (!Ft(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Rs = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ze(Uint8Array)), Ms = (e, t) => {
const s = (e && e[we]).call(e);
let o;
for (; (o = s.next()) && !o.done; ) {
const i = o.value;
t.call(e, i[0], i[1]);
}
}, Ns = (e, t) => {
let n;
const s = [];
for (; (n = e.exec(t)) !== null; )
s.push(n);
return s;
}, Bs = Q("HTMLFormElement"), Is = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, s, o) {
return s.toUpperCase() + o;
}
), Qe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Us = Q("RegExp"), Rt = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), s = {};
pe(n, (o, i) => {
let r;
(r = t(o, i, e)) !== !1 && (s[i] = r || o);
}), Object.defineProperties(e, s);
}, qs = (e) => {
Rt(e, (t, n) => {
if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const s = e[n];
if (_(s)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, $s = (e, t) => {
const n = {}, s = (o) => {
o.forEach((i) => {
n[i] = !0;
});
};
return ae(e) ? s(e) : s(String(e).split(t)), n;
}, js = () => {
}, Vs = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function zs(e) {
return !!(e && _(e.append) && e[Ot] === "FormData" && e[we]);
}
const Ws = (e) => {
const t = new Array(10), n = (s, o) => {
if (fe(s)) {
if (t.indexOf(s) >= 0)
return;
if (me(s))
return s;
if (!("toJSON" in s)) {
t[o] = s;
const i = ae(s) ? [] : {};
return pe(s, (r, c) => {
const y = n(r, o + 1);
!ie(y) && (i[c] = y);
}), t[o] = void 0, i;
}
}
return s;
};
return n(e, 0);
}, Hs = Q("AsyncFunction"), _s = (e) => e && (fe(e) || _(e)) && _(e.then) && _(e.catch), Mt = ((e, t) => e ? setImmediate : t ? ((n, s) => (ee.addEventListener("message", ({ source: o, data: i }) => {
o === ee && i === n && s.length && s.shift()();
}, !1), (o) => {
s.push(o), ee.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
_(ee.postMessage)
), Js = typeof queueMicrotask < "u" ? queueMicrotask.bind(ee) : typeof process < "u" && process.nextTick || Mt, Ys = (e) => e != null && _(e[we]), m = {
isArray: ae,
isArrayBuffer: kt,
isBuffer: me,
isFormData: Cs,
isArrayBufferView: ds,
isString: ms,
isNumber: Ft,
isBoolean: fs,
isObject: fe,
isPlainObject: ye,
isEmptyObject: ps,
isReadableStream: xs,
isRequest: Ts,
isResponse: ws,
isHeaders: Es,
isUndefined: ie,
isDate: gs,
isFile: hs,
isBlob: ys,
isRegExp: Us,
isFunction: _,
isStream: vs,
isURLSearchParams: Ss,
isTypedArray: Rs,
isFileList: bs,
forEach: pe,
merge: Ne,
extend: Ps,
trim: Ds,
stripBOM: Os,
inherits: ks,
toFlatObject: Fs,
kindOf: Ee,
kindOfTest: Q,
endsWith: As,
toArray: Ls,
forEachEntry: Ms,
matchAll: Ns,
isHTMLForm: Bs,
hasOwnProperty: Qe,
hasOwnProp: Qe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Rt,
freezeMethods: qs,
toObjectSet: $s,
toCamelCase: Is,
noop: js,
toFiniteNumber: Vs,
findKey: At,
global: ee,
isContextDefined: Lt,
isSpecCompliantForm: zs,
toJSONObject: Ws,
isAsyncFn: Hs,
isThenable: _s,
setImmediate: Mt,
asap: Js,
isIterable: Ys
};
function E(e, t, n, s, o) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), s && (this.request = s), o && (this.response = o, this.status = o.status ? o.status : null);
}
m.inherits(E, Error, {
toJSON: function() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: m.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Nt = E.prototype, Bt = {};
[
"ERR_BAD_OPTION_VALUE",
"ERR_BAD_OPTION",
"ECONNABORTED",
"ETIMEDOUT",
"ERR_NETWORK",
"ERR_FR_TOO_MANY_REDIRECTS",
"ERR_DEPRECATED",
"ERR_BAD_RESPONSE",
"ERR_BAD_REQUEST",
"ERR_CANCELED",
"ERR_NOT_SUPPORT",
"ERR_INVALID_URL"
// eslint-disable-next-line func-names
].forEach((e) => {
Bt[e] = { value: e };
});
Object.defineProperties(E, Bt);
Object.defineProperty(Nt, "isAxiosError", { value: !0 });
E.from = (e, t, n, s, o, i) => {
const r = Object.create(Nt);
m.toFlatObject(e, r, function(l) {
return l !== Error.prototype;
}, (f) => f !== "isAxiosError");
const c = e && e.message ? e.message : "Error", y = t == null && e ? e.code : t;
return E.call(r, c, y, n, s, o), e && r.cause == null && Object.defineProperty(r, "cause", { value: e, configurable: !0 }), r.name = e && e.name || "Error", i && Object.assign(r, i), r;
};
const Gs = null;
function Be(e) {
return m.isPlainObject(e) || m.isArray(e);
}
function It(e) {
return m.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Xe(e, t, n) {
return e ? e.concat(t).map(function(o, i) {
return o = It(o), !n && i ? "[" + o + "]" : o;
}).join(n ? "." : "") : t;
}
function Qs(e) {
return m.isArray(e) && !e.some(Be);
}
const Xs = m.toFlatObject(m, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function Pe(e, t, n) {
if (!m.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = m.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(g, p) {
return !m.isUndefined(p[g]);
});
const s = n.metaTokens, o = n.visitor || l, i = n.dots, r = n.indexes, y = (n.Blob || typeof Blob < "u" && Blob) && m.isSpecCompliantForm(t);
if (!m.isFunction(o))
throw new TypeError("visitor must be a function");
function f(a) {
if (a === null) return "";
if (m.isDate(a))
return a.toISOString();
if (m.isBoolean(a))
return a.toString();
if (!y && m.isBlob(a))
throw new E("Blob is not supported. Use a Buffer instead.");
return m.isArrayBuffer(a) || m.isTypedArray(a) ? y && typeof Blob == "function" ? new Blob([a]) : Buffer.from(a) : a;
}
function l(a, g, p) {
let C = a;
if (a && !p && typeof a == "object") {
if (m.endsWith(g, "{}"))
g = s ? g : g.slice(0, -2), a = JSON.stringify(a);
else if (m.isArray(a) && Qs(a) || (m.isFileList(a) || m.endsWith(g, "[]")) && (C = m.toArray(a)))
return g = It(g), C.forEach(function(w, P) {
!(m.isUndefined(w) || w === null) && t.append(
// eslint-disable-next-line no-nested-ternary
r === !0 ? Xe([g], P, i) : r === null ? g : g + "[]",
f(w)
);
}), !1;
}
return Be(a) ? !0 : (t.append(Xe(p, g, i), f(a)), !1);
}
const u = [], h = Object.assign(Xs, {
defaultVisitor: l,
convertValue: f,
isVisitable: Be
});
function b(a, g) {
if (!m.isUndefined(a)) {
if (u.indexOf(a) !== -1)
throw Error("Circular reference detected in " + g.join("."));
u.push(a), m.forEach(a, function(C, x) {
(!(m.isUndefined(C) || C === null) && o.call(
t,
C,
m.isString(x) ? x.trim() : x,
g,
h
)) === !0 && b(C, g ? g.concat(x) : [x]);
}), u.pop();
}
}
if (!m.isObject(e))
throw new TypeError("data must be an object");
return b(e), t;
}
function Ze(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
return t[s];
});
}
function We(e, t) {
this._pairs = [], e && Pe(e, this, t);
}
const Ut = We.prototype;
Ut.append = function(t, n) {
this._pairs.push([t, n]);
};
Ut.toString = function(t) {
const n = t ? function(s) {
return t.call(this, s, Ze);
} : Ze;
return this._pairs.map(function(o) {
return n(o[0]) + "=" + n(o[1]);
}, "").join("&");
};
function Zs(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function qt(e, t, n) {
if (!t)
return e;
const s = n && n.encode || Zs;
m.isFunction(n) && (n = {
serialize: n
});
const o = n && n.serialize;
let i;
if (o ? i = o(t, n) : i = m.isURLSearchParams(t) ? t.toString() : new We(t, n).toString(s), i) {
const r = e.indexOf("#");
r !== -1 && (e = e.slice(0, r)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
}
return e;
}
class Ke {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(t, n, s) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: s ? s.synchronous : !1,
runWhen: s ? s.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {void}
*/
eject(t) {
this.handlers[t] && (this.handlers[t] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(t) {
m.forEach(this.handlers, function(s) {
s !== null && t(s);
});
}
}
const $t = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Ks = typeof URLSearchParams < "u" ? URLSearchParams : We, eo = typeof FormData < "u" ? FormData : null, to = typeof Blob < "u" ? Blob : null, no = {
isBrowser: !0,
classes: {
URLSearchParams: Ks,
FormData: eo,
Blob: to
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, He = typeof window < "u" && typeof document < "u", Ie = typeof navigator == "object" && navigator || void 0, so = He && (!Ie || ["ReactNative", "NativeScript", "NS"].indexOf(Ie.product) < 0), oo = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ro = He && window.location.href || "http://localhost", io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: He,
hasStandardBrowserEnv: so,
hasStandardBrowserWebWorkerEnv: oo,
navigator: Ie,
origin: ro
}, Symbol.toStringTag, { value: "Module" })), V = {
...io,
...no
};
function ao(e, t) {
return Pe(e, new V.classes.URLSearchParams(), {
visitor: function(n, s, o, i) {
return V.isNode && m.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
},
...t
});
}
function lo(e) {
return m.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function co(e) {
const t = {}, n = Object.keys(e);
let s;
const o = n.length;
let i;
for (s = 0; s < o; s++)
i = n[s], t[i] = e[i];
return t;
}
function jt(e) {
function t(n, s, o, i) {
let r = n[i++];
if (r === "__proto__") return !0;
const c = Number.isFinite(+r), y = i >= n.length;
return r = !r && m.isArray(o) ? o.length : r, y ? (m.hasOwnProp(o, r) ? o[r] = [o[r], s] : o[r] = s, !c) : ((!o[r] || !m.isObject(o[r])) && (o[r] = []), t(n, s, o[r], i) && m.isArray(o[r]) && (o[r] = co(o[r])), !c);
}
if (m.isFormData(e) && m.isFunction(e.entries)) {
const n = {};
return m.forEachEntry(e, (s, o) => {
t(lo(s), o, n, 0);
}), n;
}
return null;
}
function uo(e, t, n) {
if (m.isString(e))
try {
return (t || JSON.parse)(e), m.trim(e);
} catch (s) {
if (s.name !== "SyntaxError")
throw s;
}
return (n || JSON.stringify)(e);
}
const ge = {
transitional: $t,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const s = n.getContentType() || "", o = s.indexOf("application/json") > -1, i = m.isObject(t);
if (i && m.isHTMLForm(t) && (t = new FormData(t)), m.isFormData(t))
return o ? JSON.stringify(jt(t)) : t;
if (m.isArrayBuffer(t) || m.isBuffer(t) || m.isStream(t) || m.isFile(t) || m.isBlob(t) || m.isReadableStream(t))
return t;
if (m.isArrayBufferView(t))
return t.buffer;
if (m.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let c;
if (i) {
if (s.indexOf("application/x-www-form-urlencoded") > -1)
return ao(t, this.formSerializer).toString();
if ((c = m.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
const y = this.env && this.env.FormData;
return Pe(
c ? { "files[]": t } : t,
y && new y(),
this.formSerializer
);
}
}
return i || o ? (n.setContentType("application/json", !1), uo(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || ge.transitional, s = n && n.forcedJSONParsing, o = this.responseType === "json";
if (m.isResponse(t) || m.isReadableStream(t))
return t;
if (t && m.isString(t) && (s && !this.responseType || o)) {
const r = !(n && n.silentJSONParsing) && o;
try {
return JSON.parse(t, this.parseReviver);
} catch (c) {
if (r)
throw c.name === "SyntaxError" ? E.from(c, E.ERR_BAD_RESPONSE, this, null, this.response) : c;