import '@das-fed/ui/packages/components/search-form/style.css';
import { defineComponent as Ke, watch as Ea, ref as A, createElementBlock as _, openBlock as y, normalizeClass as G, unref as c, createCommentVNode as h, createVNode as q, normalizeStyle as Ua, withDirectives as Ne, createTextVNode as Ma, toDisplayString as ae, mergeProps as j, isRef as ce, createBlock as P, Fragment as z, useCssVars as Ct, computed as pa, onMounted as _t, createElementVNode as N, renderSlot as W, withCtx as E, renderList as ye, vShow as wt, nextTick as Pe } from "vue";
import { withInstall as St } from "@das-fed/utils/with-install/index";
import { DasCustomSearchItem as Tt } from "@das-fed/ui/packages/components/custom-search-item/index";
import { DasForm as da } from "@das-fed/ui/packages/components/form/index";
import { DasFormItem as ee } from "@das-fed/ui/packages/components/form-item/index";
import { DasAutoRegisterIcon as Vt, DasIcon as At } from "@das-fed/ui/packages/components/icon/index";
import { DasSearch as Ot } from "@das-fed/ui/packages/components/search/index";
import { DasSelectInput as kt } from "@das-fed/ui/packages/components/select-input/index";
import { DasTag as jt } from "@das-fed/ui/packages/components/tag/index";
import { vScrollbar as Pt } from "@das-fed/ui/packages/components/scrollbar/index";
import { useModelValue as Q } from "@das-fed/utils/vue";
import { ElCollapseTransition as Rt } from "element-plus";
import { DasInputDialogSelect as Dt } from "@das-fed/ui/packages/components/input-dialog-select/index";
import { vDasTooltip as Ba } from "@das-fed/ui/packages/components/text-tooltip/index";
import { t as L, currentLang as I, setI18nRule as Lt } from "@das-fed/web/packages/i18n/index";
import mt from "dayjs";
import { DasSelect as It } from "@das-fed/ui/packages/components/select/index";
import { DasDateRangePicker as Ft, DasRangePicker as Kt, DasTimeRangePicker as Nt } from "@das-fed/ui/packages/components/date-picker/index";
import { setThemeRule as Et } from "@das-fed/web/packages/theme/index";
const Ut = (e, r) => ({ innerValue: Q(e, "modelValue"), openDialogHandle: () => {
  r("openDialogHandle");
} }), Ee = (e, r) => {
  if (r === "top")
    return "100%";
  let o = 4;
  return typeof e == "string" ? o = parseInt(e) : typeof e == "number" && (o = e), `${o * 12}px`;
}, Mt = (e, r) => e ? mt.isDayjs(e) ? e.format(r) : e : "", Bt = (e) => {
  const r = (o, s, g) => {
    const f = e != null && e.format ? e.format.replace("QQ", "qQ") : g[s];
    let p = o ? Mt(o, f) : "";
    return p && (I.value === "zh-CN" && s === "week" && (p = p.replace("th", L("周")).replace("nd", L("周"))), s === "quarter" && (p = p.replace("q", "Q"))), p;
  };
  if (e != null && e.type.endsWith("Range")) {
    const o = {
      default: "YYYY/MM/DD HH:mm:ss"
    };
    return ((e == null ? void 0 : e.value) || (e == null ? void 0 : e.storageValue) || ["", ""]).map((g) => r(g, "default", o)).join(L("至"));
  } else {
    const o = {
      date: "YYYY/MM/DD",
      dateTime: "YYYY/MM/DD HH:mm:ss",
      week: "YYYY-wo",
      month: "YYYY-MM",
      quarter: "YYYY-qQ",
      year: "YYYY"
    };
    return r(e == null ? void 0 : e.tagName, e == null ? void 0 : e.type, o);
  }
}, zt = { class: "label-context" }, Gt = { key: 0 }, Ht = /* @__PURE__ */ Ke({
  __name: "InputSelect",
  props: {
    optionsLabelKey: { default: "name" },
    optionsValueKey: { default: "id" },
    modelValue: {},
    labelLength: {},
    labelPosition: {},
    label: { default: "" },
    selectedOptions: { default: [] },
    showFilterPanel: { type: Boolean, default: !1 }
  },
  emits: ["update:modelValue", "dateRangeChange", "update:optionValue", "selectChange", "openDialogHandle", "openDialogChange"],
  setup(e, { emit: r }) {
    const o = e, s = r, { innerValue: g, openDialogHandle: f } = Ut(o, s);
    Ea(
      () => o.selectedOptions,
      (d) => {
        s("openDialogChange", d);
      }
    );
    const p = A(Ee(o.labelLength, o.labelPosition));
    return (d, C) => (y(), _(
      "div",
      {
        class: G(["das-input-select-search-container", { "das-input-select-search-container-en": c(I) != "zh-CN" }])
      },
      [
        d.label ? (y(), _(
          "div",
          {
            key: 0,
            class: "label",
            style: Ua({ width: p.value })
          },
          [
            Ne((y(), _("div", zt, [
              Ma(
                ae(d.label),
                1
                /* TEXT */
              )
            ])), [
              [c(Ba)]
            ]),
            o.showFilterPanel ? (y(), _("span", Gt, "：")) : h("v-if", !0)
          ],
          4
          /* STYLE */
        )) : h("v-if", !0),
        q(c(Dt), j({
          "selected-options": d.selectedOptions,
          width: "200px",
          optionsLabelKey: d.optionsLabelKey,
          optionsValueKey: d.optionsValueKey,
          onOpenDialog: c(f),
          modelValue: c(g),
          "onUpdate:modelValue": C[0] || (C[0] = ($) => ce(g) ? g.value = $ : null)
        }, d.$attrs), null, 16, ["selected-options", "optionsLabelKey", "optionsValueKey", "onOpenDialog", "modelValue"])
      ],
      2
      /* CLASS */
    ));
  }
}), Ue = (e, r) => {
  const o = e.__vccOpts || e;
  for (const [s, g] of r)
    o[s] = g;
  return o;
}, xt = /* @__PURE__ */ Ue(Ht, [["__scopeId", "data-v-72fa1cba"]]);
var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Yt(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function Wt() {
  this.__data__ = [], this.size = 0;
}
var Jt = Wt;
function qt(e, r) {
  return e === r || e !== e && r !== r;
}
var za = qt, Qt = za;
function Xt(e, r) {
  for (var o = e.length; o--; )
    if (Qt(e[o][0], r))
      return o;
  return -1;
}
var _e = Xt, Zt = _e, er = Array.prototype, ar = er.splice;
function tr(e) {
  var r = this.__data__, o = Zt(r, e);
  if (o < 0)
    return !1;
  var s = r.length - 1;
  return o == s ? r.pop() : ar.call(r, o, 1), --this.size, !0;
}
var rr = tr, nr = _e;
function or(e) {
  var r = this.__data__, o = nr(r, e);
  return o < 0 ? void 0 : r[o][1];
}
var lr = or, sr = _e;
function ir(e) {
  return sr(this.__data__, e) > -1;
}
var ur = ir, cr = _e;
function pr(e, r) {
  var o = this.__data__, s = cr(o, e);
  return s < 0 ? (++this.size, o.push([e, r])) : o[s][1] = r, this;
}
var dr = pr, fr = Jt, gr = rr, yr = lr, hr = ur, vr = dr;
function te(e) {
  var r = -1, o = e == null ? 0 : e.length;
  for (this.clear(); ++r < o; ) {
    var s = e[r];
    this.set(s[0], s[1]);
  }
}
te.prototype.clear = fr;
te.prototype.delete = gr;
te.prototype.get = yr;
te.prototype.has = hr;
te.prototype.set = vr;
var we = te, br = we;
function $r() {
  this.__data__ = new br(), this.size = 0;
}
var Cr = $r;
function _r(e) {
  var r = this.__data__, o = r.delete(e);
  return this.size = r.size, o;
}
var wr = _r;
function Sr(e) {
  return this.__data__.get(e);
}
var Tr = Sr;
function Vr(e) {
  return this.__data__.has(e);
}
var Ar = Vr, Or = typeof he == "object" && he && he.Object === Object && he, Ga = Or, kr = Ga, jr = typeof self == "object" && self && self.Object === Object && self, Pr = kr || jr || Function("return this")(), U = Pr, Rr = U, Dr = Rr.Symbol, Me = Dr, fa = Me, Ha = Object.prototype, Lr = Ha.hasOwnProperty, mr = Ha.toString, ue = fa ? fa.toStringTag : void 0;
function Ir(e) {
  var r = Lr.call(e, ue), o = e[ue];
  try {
    e[ue] = void 0;
    var s = !0;
  } catch {
  }
  var g = mr.call(e);
  return s && (r ? e[ue] = o : delete e[ue]), g;
}
var Fr = Ir, Kr = Object.prototype, Nr = Kr.toString;
function Er(e) {
  return Nr.call(e);
}
var Ur = Er, ga = Me, Mr = Fr, Br = Ur, zr = "[object Null]", Gr = "[object Undefined]", ya = ga ? ga.toStringTag : void 0;
function Hr(e) {
  return e == null ? e === void 0 ? Gr : zr : ya && ya in Object(e) ? Mr(e) : Br(e);
}
var Se = Hr;
function xr(e) {
  var r = typeof e;
  return e != null && (r == "object" || r == "function");
}
var pe = xr, Yr = Se, Wr = pe, Jr = "[object AsyncFunction]", qr = "[object Function]", Qr = "[object GeneratorFunction]", Xr = "[object Proxy]";
function Zr(e) {
  if (!Wr(e))
    return !1;
  var r = Yr(e);
  return r == qr || r == Qr || r == Jr || r == Xr;
}
var xa = Zr, en = U, an = en["__core-js_shared__"], tn = an, Re = tn, ha = function() {
  var e = /[^.]+$/.exec(Re && Re.keys && Re.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function rn(e) {
  return !!ha && ha in e;
}
var nn = rn, on = Function.prototype, ln = on.toString;
function sn(e) {
  if (e != null) {
    try {
      return ln.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var Ya = sn, un = xa, cn = nn, pn = pe, dn = Ya, fn = /[\\^$.*+?()[\]{}|]/g, gn = /^\[object .+?Constructor\]$/, yn = Function.prototype, hn = Object.prototype, vn = yn.toString, bn = hn.hasOwnProperty, $n = RegExp(
  "^" + vn.call(bn).replace(fn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function Cn(e) {
  if (!pn(e) || cn(e))
    return !1;
  var r = un(e) ? $n : gn;
  return r.test(dn(e));
}
var _n = Cn;
function wn(e, r) {
  return e == null ? void 0 : e[r];
}
var Sn = wn, Tn = _n, Vn = Sn;
function An(e, r) {
  var o = Vn(e, r);
  return Tn(o) ? o : void 0;
}
var X = An, On = X, kn = U, jn = On(kn, "Map"), Be = jn, Pn = X, Rn = Pn(Object, "create"), Te = Rn, va = Te;
function Dn() {
  this.__data__ = va ? va(null) : {}, this.size = 0;
}
var Ln = Dn;
function mn(e) {
  var r = this.has(e) && delete this.__data__[e];
  return this.size -= r ? 1 : 0, r;
}
var In = mn, Fn = Te, Kn = "__lodash_hash_undefined__", Nn = Object.prototype, En = Nn.hasOwnProperty;
function Un(e) {
  var r = this.__data__;
  if (Fn) {
    var o = r[e];
    return o === Kn ? void 0 : o;
  }
  return En.call(r, e) ? r[e] : void 0;
}
var Mn = Un, Bn = Te, zn = Object.prototype, Gn = zn.hasOwnProperty;
function Hn(e) {
  var r = this.__data__;
  return Bn ? r[e] !== void 0 : Gn.call(r, e);
}
var xn = Hn, Yn = Te, Wn = "__lodash_hash_undefined__";
function Jn(e, r) {
  var o = this.__data__;
  return this.size += this.has(e) ? 0 : 1, o[e] = Yn && r === void 0 ? Wn : r, this;
}
var qn = Jn, Qn = Ln, Xn = In, Zn = Mn, eo = xn, ao = qn;
function re(e) {
  var r = -1, o = e == null ? 0 : e.length;
  for (this.clear(); ++r < o; ) {
    var s = e[r];
    this.set(s[0], s[1]);
  }
}
re.prototype.clear = Qn;
re.prototype.delete = Xn;
re.prototype.get = Zn;
re.prototype.has = eo;
re.prototype.set = ao;
var to = re, ba = to, ro = we, no = Be;
function oo() {
  this.size = 0, this.__data__ = {
    hash: new ba(),
    map: new (no || ro)(),
    string: new ba()
  };
}
var lo = oo;
function so(e) {
  var r = typeof e;
  return r == "string" || r == "number" || r == "symbol" || r == "boolean" ? e !== "__proto__" : e === null;
}
var io = so, uo = io;
function co(e, r) {
  var o = e.__data__;
  return uo(r) ? o[typeof r == "string" ? "string" : "hash"] : o.map;
}
var Ve = co, po = Ve;
function fo(e) {
  var r = po(this, e).delete(e);
  return this.size -= r ? 1 : 0, r;
}
var go = fo, yo = Ve;
function ho(e) {
  return yo(this, e).get(e);
}
var vo = ho, bo = Ve;
function $o(e) {
  return bo(this, e).has(e);
}
var Co = $o, _o = Ve;
function wo(e, r) {
  var o = _o(this, e), s = o.size;
  return o.set(e, r), this.size += o.size == s ? 0 : 1, this;
}
var So = wo, To = lo, Vo = go, Ao = vo, Oo = Co, ko = So;
function ne(e) {
  var r = -1, o = e == null ? 0 : e.length;
  for (this.clear(); ++r < o; ) {
    var s = e[r];
    this.set(s[0], s[1]);
  }
}
ne.prototype.clear = To;
ne.prototype.delete = Vo;
ne.prototype.get = Ao;
ne.prototype.has = Oo;
ne.prototype.set = ko;
var jo = ne, Po = we, Ro = Be, Do = jo, Lo = 200;
function mo(e, r) {
  var o = this.__data__;
  if (o instanceof Po) {
    var s = o.__data__;
    if (!Ro || s.length < Lo - 1)
      return s.push([e, r]), this.size = ++o.size, this;
    o = this.__data__ = new Do(s);
  }
  return o.set(e, r), this.size = o.size, this;
}
var Io = mo, Fo = we, Ko = Cr, No = wr, Eo = Tr, Uo = Ar, Mo = Io;
function oe(e) {
  var r = this.__data__ = new Fo(e);
  this.size = r.size;
}
oe.prototype.clear = Ko;
oe.prototype.delete = No;
oe.prototype.get = Eo;
oe.prototype.has = Uo;
oe.prototype.set = Mo;
var Bo = oe;
function zo(e, r) {
  for (var o = -1, s = e == null ? 0 : e.length; ++o < s && r(e[o], o, e) !== !1; )
    ;
  return e;
}
var Go = zo, Ho = X, xo = function() {
  try {
    var e = Ho(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}(), Yo = xo, $a = Yo;
function Wo(e, r, o) {
  r == "__proto__" && $a ? $a(e, r, {
    configurable: !0,
    enumerable: !0,
    value: o,
    writable: !0
  }) : e[r] = o;
}
var Wa = Wo, Jo = Wa, qo = za, Qo = Object.prototype, Xo = Qo.hasOwnProperty;
function Zo(e, r, o) {
  var s = e[r];
  (!(Xo.call(e, r) && qo(s, o)) || o === void 0 && !(r in e)) && Jo(e, r, o);
}
var Ja = Zo, el = Ja, al = Wa;
function tl(e, r, o, s) {
  var g = !o;
  o || (o = {});
  for (var f = -1, p = r.length; ++f < p; ) {
    var d = r[f], C = s ? s(o[d], e[d], d, o, e) : void 0;
    C === void 0 && (C = e[d]), g ? al(o, d, C) : el(o, d, C);
  }
  return o;
}
var Ae = tl;
function rl(e, r) {
  for (var o = -1, s = Array(e); ++o < e; )
    s[o] = r(o);
  return s;
}
var nl = rl;
function ol(e) {
  return e != null && typeof e == "object";
}
var de = ol, ll = Se, sl = de, il = "[object Arguments]";
function ul(e) {
  return sl(e) && ll(e) == il;
}
var cl = ul, Ca = cl, pl = de, qa = Object.prototype, dl = qa.hasOwnProperty, fl = qa.propertyIsEnumerable, gl = Ca(/* @__PURE__ */ function() {
  return arguments;
}()) ? Ca : function(e) {
  return pl(e) && dl.call(e, "callee") && !fl.call(e, "callee");
}, yl = gl, hl = Array.isArray, ze = hl, be = { exports: {} };
function vl() {
  return !1;
}
var bl = vl;
be.exports;
(function(e, r) {
  var o = U, s = bl, g = r && !r.nodeType && r, f = g && !0 && e && !e.nodeType && e, p = f && f.exports === g, d = p ? o.Buffer : void 0, C = d ? d.isBuffer : void 0, $ = C || s;
  e.exports = $;
})(be, be.exports);
var Qa = be.exports, $l = 9007199254740991, Cl = /^(?:0|[1-9]\d*)$/;
function _l(e, r) {
  var o = typeof e;
  return r = r ?? $l, !!r && (o == "number" || o != "symbol" && Cl.test(e)) && e > -1 && e % 1 == 0 && e < r;
}
var wl = _l, Sl = 9007199254740991;
function Tl(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Sl;
}
var Xa = Tl, Vl = Se, Al = Xa, Ol = de, kl = "[object Arguments]", jl = "[object Array]", Pl = "[object Boolean]", Rl = "[object Date]", Dl = "[object Error]", Ll = "[object Function]", ml = "[object Map]", Il = "[object Number]", Fl = "[object Object]", Kl = "[object RegExp]", Nl = "[object Set]", El = "[object String]", Ul = "[object WeakMap]", Ml = "[object ArrayBuffer]", Bl = "[object DataView]", zl = "[object Float32Array]", Gl = "[object Float64Array]", Hl = "[object Int8Array]", xl = "[object Int16Array]", Yl = "[object Int32Array]", Wl = "[object Uint8Array]", Jl = "[object Uint8ClampedArray]", ql = "[object Uint16Array]", Ql = "[object Uint32Array]", T = {};
T[zl] = T[Gl] = T[Hl] = T[xl] = T[Yl] = T[Wl] = T[Jl] = T[ql] = T[Ql] = !0;
T[kl] = T[jl] = T[Ml] = T[Pl] = T[Bl] = T[Rl] = T[Dl] = T[Ll] = T[ml] = T[Il] = T[Fl] = T[Kl] = T[Nl] = T[El] = T[Ul] = !1;
function Xl(e) {
  return Ol(e) && Al(e.length) && !!T[Vl(e)];
}
var Zl = Xl;
function es(e) {
  return function(r) {
    return e(r);
  };
}
var Ge = es, $e = { exports: {} };
$e.exports;
(function(e, r) {
  var o = Ga, s = r && !r.nodeType && r, g = s && !0 && e && !e.nodeType && e, f = g && g.exports === s, p = f && o.process, d = function() {
    try {
      var C = g && g.require && g.require("util").types;
      return C || p && p.binding && p.binding("util");
    } catch {
    }
  }();
  e.exports = d;
})($e, $e.exports);
var He = $e.exports, as = Zl, ts = Ge, _a = He, wa = _a && _a.isTypedArray, rs = wa ? ts(wa) : as, ns = rs, os = nl, ls = yl, ss = ze, is = Qa, us = wl, cs = ns, ps = Object.prototype, ds = ps.hasOwnProperty;
function fs(e, r) {
  var o = ss(e), s = !o && ls(e), g = !o && !s && is(e), f = !o && !s && !g && cs(e), p = o || s || g || f, d = p ? os(e.length, String) : [], C = d.length;
  for (var $ in e)
    (r || ds.call(e, $)) && !(p && // Safari 9 has enumerable `arguments.length` in strict mode.
    ($ == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    g && ($ == "offset" || $ == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    f && ($ == "buffer" || $ == "byteLength" || $ == "byteOffset") || // Skip index properties.
    us($, C))) && d.push($);
  return d;
}
var Za = fs, gs = Object.prototype;
function ys(e) {
  var r = e && e.constructor, o = typeof r == "function" && r.prototype || gs;
  return e === o;
}
var xe = ys;
function hs(e, r) {
  return function(o) {
    return e(r(o));
  };
}
var et = hs, vs = et, bs = vs(Object.keys, Object), $s = bs, Cs = xe, _s = $s, ws = Object.prototype, Ss = ws.hasOwnProperty;
function Ts(e) {
  if (!Cs(e))
    return _s(e);
  var r = [];
  for (var o in Object(e))
    Ss.call(e, o) && o != "constructor" && r.push(o);
  return r;
}
var Vs = Ts, As = xa, Os = Xa;
function ks(e) {
  return e != null && Os(e.length) && !As(e);
}
var at = ks, js = Za, Ps = Vs, Rs = at;
function Ds(e) {
  return Rs(e) ? js(e) : Ps(e);
}
var Ye = Ds, Ls = Ae, ms = Ye;
function Is(e, r) {
  return e && Ls(r, ms(r), e);
}
var Fs = Is;
function Ks(e) {
  var r = [];
  if (e != null)
    for (var o in Object(e))
      r.push(o);
  return r;
}
var Ns = Ks, Es = pe, Us = xe, Ms = Ns, Bs = Object.prototype, zs = Bs.hasOwnProperty;
function Gs(e) {
  if (!Es(e))
    return Ms(e);
  var r = Us(e), o = [];
  for (var s in e)
    s == "constructor" && (r || !zs.call(e, s)) || o.push(s);
  return o;
}
var Hs = Gs, xs = Za, Ys = Hs, Ws = at;
function Js(e) {
  return Ws(e) ? xs(e, !0) : Ys(e);
}
var We = Js, qs = Ae, Qs = We;
function Xs(e, r) {
  return e && qs(r, Qs(r), e);
}
var Zs = Xs, Ce = { exports: {} };
Ce.exports;
(function(e, r) {
  var o = U, s = r && !r.nodeType && r, g = s && !0 && e && !e.nodeType && e, f = g && g.exports === s, p = f ? o.Buffer : void 0, d = p ? p.allocUnsafe : void 0;
  function C($, M) {
    if (M)
      return $.slice();
    var v = $.length, k = d ? d(v) : new $.constructor(v);
    return $.copy(k), k;
  }
  e.exports = C;
})(Ce, Ce.exports);
var ei = Ce.exports;
function ai(e, r) {
  var o = -1, s = e.length;
  for (r || (r = Array(s)); ++o < s; )
    r[o] = e[o];
  return r;
}
var ti = ai;
function ri(e, r) {
  for (var o = -1, s = e == null ? 0 : e.length, g = 0, f = []; ++o < s; ) {
    var p = e[o];
    r(p, o, e) && (f[g++] = p);
  }
  return f;
}
var ni = ri;
function oi() {
  return [];
}
var tt = oi, li = ni, si = tt, ii = Object.prototype, ui = ii.propertyIsEnumerable, Sa = Object.getOwnPropertySymbols, ci = Sa ? function(e) {
  return e == null ? [] : (e = Object(e), li(Sa(e), function(r) {
    return ui.call(e, r);
  }));
} : si, Je = ci, pi = Ae, di = Je;
function fi(e, r) {
  return pi(e, di(e), r);
}
var gi = fi;
function yi(e, r) {
  for (var o = -1, s = r.length, g = e.length; ++o < s; )
    e[g + o] = r[o];
  return e;
}
var rt = yi, hi = et, vi = hi(Object.getPrototypeOf, Object), nt = vi, bi = rt, $i = nt, Ci = Je, _i = tt, wi = Object.getOwnPropertySymbols, Si = wi ? function(e) {
  for (var r = []; e; )
    bi(r, Ci(e)), e = $i(e);
  return r;
} : _i, ot = Si, Ti = Ae, Vi = ot;
function Ai(e, r) {
  return Ti(e, Vi(e), r);
}
var Oi = Ai, ki = rt, ji = ze;
function Pi(e, r, o) {
  var s = r(e);
  return ji(e) ? s : ki(s, o(e));
}
var lt = Pi, Ri = lt, Di = Je, Li = Ye;
function mi(e) {
  return Ri(e, Li, Di);
}
var Ii = mi, Fi = lt, Ki = ot, Ni = We;
function Ei(e) {
  return Fi(e, Ni, Ki);
}
var Ui = Ei, Mi = X, Bi = U, zi = Mi(Bi, "DataView"), Gi = zi, Hi = X, xi = U, Yi = Hi(xi, "Promise"), Wi = Yi, Ji = X, qi = U, Qi = Ji(qi, "Set"), Xi = Qi, Zi = X, eu = U, au = Zi(eu, "WeakMap"), tu = au, De = Gi, Le = Be, me = Wi, Ie = Xi, Fe = tu, st = Se, le = Ya, Ta = "[object Map]", ru = "[object Object]", Va = "[object Promise]", Aa = "[object Set]", Oa = "[object WeakMap]", ka = "[object DataView]", nu = le(De), ou = le(Le), lu = le(me), su = le(Ie), iu = le(Fe), J = st;
(De && J(new De(new ArrayBuffer(1))) != ka || Le && J(new Le()) != Ta || me && J(me.resolve()) != Va || Ie && J(new Ie()) != Aa || Fe && J(new Fe()) != Oa) && (J = function(e) {
  var r = st(e), o = r == ru ? e.constructor : void 0, s = o ? le(o) : "";
  if (s)
    switch (s) {
      case nu:
        return ka;
      case ou:
        return Ta;
      case lu:
        return Va;
      case su:
        return Aa;
      case iu:
        return Oa;
    }
  return r;
});
var qe = J, uu = Object.prototype, cu = uu.hasOwnProperty;
function pu(e) {
  var r = e.length, o = new e.constructor(r);
  return r && typeof e[0] == "string" && cu.call(e, "index") && (o.index = e.index, o.input = e.input), o;
}
var du = pu, fu = U, gu = fu.Uint8Array, yu = gu, ja = yu;
function hu(e) {
  var r = new e.constructor(e.byteLength);
  return new ja(r).set(new ja(e)), r;
}
var Qe = hu, vu = Qe;
function bu(e, r) {
  var o = r ? vu(e.buffer) : e.buffer;
  return new e.constructor(o, e.byteOffset, e.byteLength);
}
var $u = bu, Cu = /\w*$/;
function _u(e) {
  var r = new e.constructor(e.source, Cu.exec(e));
  return r.lastIndex = e.lastIndex, r;
}
var wu = _u, Pa = Me, Ra = Pa ? Pa.prototype : void 0, Da = Ra ? Ra.valueOf : void 0;
function Su(e) {
  return Da ? Object(Da.call(e)) : {};
}
var Tu = Su, Vu = Qe;
function Au(e, r) {
  var o = r ? Vu(e.buffer) : e.buffer;
  return new e.constructor(o, e.byteOffset, e.length);
}
var Ou = Au, ku = Qe, ju = $u, Pu = wu, Ru = Tu, Du = Ou, Lu = "[object Boolean]", mu = "[object Date]", Iu = "[object Map]", Fu = "[object Number]", Ku = "[object RegExp]", Nu = "[object Set]", Eu = "[object String]", Uu = "[object Symbol]", Mu = "[object ArrayBuffer]", Bu = "[object DataView]", zu = "[object Float32Array]", Gu = "[object Float64Array]", Hu = "[object Int8Array]", xu = "[object Int16Array]", Yu = "[object Int32Array]", Wu = "[object Uint8Array]", Ju = "[object Uint8ClampedArray]", qu = "[object Uint16Array]", Qu = "[object Uint32Array]";
function Xu(e, r, o) {
  var s = e.constructor;
  switch (r) {
    case Mu:
      return ku(e);
    case Lu:
    case mu:
      return new s(+e);
    case Bu:
      return ju(e, o);
    case zu:
    case Gu:
    case Hu:
    case xu:
    case Yu:
    case Wu:
    case Ju:
    case qu:
    case Qu:
      return Du(e, o);
    case Iu:
      return new s();
    case Fu:
    case Eu:
      return new s(e);
    case Ku:
      return Pu(e);
    case Nu:
      return new s();
    case Uu:
      return Ru(e);
  }
}
var Zu = Xu, ec = pe, La = Object.create, ac = /* @__PURE__ */ function() {
  function e() {
  }
  return function(r) {
    if (!ec(r))
      return {};
    if (La)
      return La(r);
    e.prototype = r;
    var o = new e();
    return e.prototype = void 0, o;
  };
}(), tc = ac, rc = tc, nc = nt, oc = xe;
function lc(e) {
  return typeof e.constructor == "function" && !oc(e) ? rc(nc(e)) : {};
}
var sc = lc, ic = qe, uc = de, cc = "[object Map]";
function pc(e) {
  return uc(e) && ic(e) == cc;
}
var dc = pc, fc = dc, gc = Ge, ma = He, Ia = ma && ma.isMap, yc = Ia ? gc(Ia) : fc, hc = yc, vc = qe, bc = de, $c = "[object Set]";
function Cc(e) {
  return bc(e) && vc(e) == $c;
}
var _c = Cc, wc = _c, Sc = Ge, Fa = He, Ka = Fa && Fa.isSet, Tc = Ka ? Sc(Ka) : wc, Vc = Tc, Ac = Bo, Oc = Go, kc = Ja, jc = Fs, Pc = Zs, Rc = ei, Dc = ti, Lc = gi, mc = Oi, Ic = Ii, Fc = Ui, Kc = qe, Nc = du, Ec = Zu, Uc = sc, Mc = ze, Bc = Qa, zc = hc, Gc = pe, Hc = Vc, xc = Ye, Yc = We, Wc = 1, Jc = 2, qc = 4, it = "[object Arguments]", Qc = "[object Array]", Xc = "[object Boolean]", Zc = "[object Date]", ep = "[object Error]", ut = "[object Function]", ap = "[object GeneratorFunction]", tp = "[object Map]", rp = "[object Number]", ct = "[object Object]", np = "[object RegExp]", op = "[object Set]", lp = "[object String]", sp = "[object Symbol]", ip = "[object WeakMap]", up = "[object ArrayBuffer]", cp = "[object DataView]", pp = "[object Float32Array]", dp = "[object Float64Array]", fp = "[object Int8Array]", gp = "[object Int16Array]", yp = "[object Int32Array]", hp = "[object Uint8Array]", vp = "[object Uint8ClampedArray]", bp = "[object Uint16Array]", $p = "[object Uint32Array]", w = {};
w[it] = w[Qc] = w[up] = w[cp] = w[Xc] = w[Zc] = w[pp] = w[dp] = w[fp] = w[gp] = w[yp] = w[tp] = w[rp] = w[ct] = w[np] = w[op] = w[lp] = w[sp] = w[hp] = w[vp] = w[bp] = w[$p] = !0;
w[ep] = w[ut] = w[ip] = !1;
function ve(e, r, o, s, g, f) {
  var p, d = r & Wc, C = r & Jc, $ = r & qc;
  if (o && (p = g ? o(e, s, g, f) : o(e)), p !== void 0)
    return p;
  if (!Gc(e))
    return e;
  var M = Mc(e);
  if (M) {
    if (p = Nc(e), !d)
      return Dc(e, p);
  } else {
    var v = Kc(e), k = v == ut || v == ap;
    if (Bc(e))
      return Rc(e, d);
    if (v == ct || v == it || k && !g) {
      if (p = C || k ? {} : Uc(e), !d)
        return C ? mc(e, Pc(p, e)) : Lc(e, jc(p, e));
    } else {
      if (!w[v])
        return g ? e : {};
      p = Ec(e, v, d);
    }
  }
  f || (f = new Ac());
  var R = f.get(e);
  if (R)
    return R;
  f.set(e, p), Hc(e) ? e.forEach(function(K) {
    p.add(ve(K, r, o, K, e, f));
  }) : zc(e) && e.forEach(function(K, D) {
    p.set(D, ve(K, r, o, D, e, f));
  });
  var se = $ ? C ? Fc : Ic : C ? Yc : xc, O = M ? void 0 : se(e);
  return Oc(O || e, function(K, D) {
    O && (D = K, K = e[D]), kc(p, D, ve(K, r, o, D, e, f));
  }), p;
}
var Cp = ve, _p = Cp, wp = 1, Sp = 4;
function Tp(e) {
  return _p(e, wp | Sp);
}
var Vp = Tp;
const Ap = /* @__PURE__ */ Yt(Vp), Op = (e, r) => {
  const o = Q(e, "modelValue"), s = Q(e, "optionValue"), g = (d) => {
    d == "custom" && r("update:modelValue", ""), r("update:optionValue", d), r("selectChange", d);
  }, f = A(null);
  return { innerValue: o, selectValue: s, selectChangeHandler: g, dateRangeChangeHandler: (d) => {
    JSON.stringify(d) !== JSON.stringify(f.value) && (f.value = Ap(d), r("update:modelValue", d), r("dateRangeChange", d));
  } };
}, kp = { class: "label-context" }, jp = { key: 0 }, Pp = { key: 1 }, Rp = /* @__PURE__ */ Ke({
  __name: "SearchDateRange",
  props: {
    options: { default: [] },
    optionValue: { default: "" },
    optionsLabelKey: { default: "label" },
    optionsValueKey: { default: "value" },
    modelValue: { default: [] },
    mode: { default: "default" },
    type: { default: "" },
    labelLength: {},
    labelPosition: {},
    label: { default: "" },
    showFilterPanel: { type: Boolean, default: !1 },
    isNeedSelect: { type: Boolean, default: !0 },
    labelWidth: { default: "" }
  },
  emits: ["update:modelValue", "dateRangeChange", "update:optionValue", "selectChange", "openDialogHandle", "openDialogChange"],
  setup(e, { emit: r }) {
    const o = e, s = Q(o, "labelWidth"), g = r, { innerValue: f, selectValue: p, dateRangeChangeHandler: d, selectChangeHandler: C } = Op(o, g), $ = A("200px");
    A(null);
    const M = A();
    return M.value = s.value ? s.value + "!important" : Ee(o.labelLength, o.labelPosition), (v, k) => (y(), _(
      "div",
      {
        class: G(["das-select-date-range", [{ "das-select-date-range-en-filter": c(I) != "zh-CN" && o.showFilterPanel }, { "das-select-date-range-en-nonefilter": c(I) != "zh-CN" && !o.showFilterPanel }]]),
        id: "das-select-date-range"
      },
      [
        v.label ? (y(), _(
          "div",
          {
            key: 0,
            class: "label",
            style: Ua({ width: M.value })
          },
          [
            Ne((y(), _("div", kp, [
              Ma(
                ae(v.label),
                1
                /* TEXT */
              )
            ])), [
              [c(Ba)]
            ]),
            o.showFilterPanel ? (y(), _("span", jp, "：")) : h("v-if", !0)
          ],
          4
          /* STYLE */
        )) : h("v-if", !0),
        v.isNeedSelect ? (y(), _("div", Pp, [
          q(c(It), {
            size: v.mode == "default" ? "mini" : "small",
            dropdownClassName: "das-select-date-select-container",
            class: G({ "optional-select-item": v.mode != "default" }),
            modelValue: c(p),
            "onUpdate:modelValue": k[0] || (k[0] = (R) => ce(p) ? p.value = R : null),
            width: c(I) == "zh-CN" ? v.mode == "default" ? "95px" : "100px" : "165px",
            dropdownMatchSelectWidth: !1,
            "border-type": v.mode == "default" ? "none" : "underline",
            options: v.options,
            fieldNames: {
              value: v.optionsValueKey,
              label: v.optionsLabelKey
            },
            onChange: c(C)
          }, null, 8, ["size", "class", "modelValue", "width", "border-type", "options", "fieldNames", "onChange"])
        ])) : h("v-if", !0),
        v.mode == "default" ? (y(), P(c(Ft), j({
          key: 2,
          modelValue: c(f),
          "onUpdate:modelValue": k[1] || (k[1] = (R) => ce(f) ? f.value = R : null),
          itemWidth: $.value
        }, v.$attrs, { onChange: c(d) }), null, 16, ["modelValue", "itemWidth", "onChange"])) : h("v-if", !0),
        v.mode == "optional" && c(p) == "custom" ? (y(), _(
          z,
          { key: 3 },
          [
            h(" 日期范围选择器 "),
            v.type == "dateRange" || v.type == "dateTimeRange" || v.type == "weekRange" || v.type == "monthRange" || v.type == "yearRange" ? (y(), P(c(Kt), j({
              key: 0,
              "show-time": v.type === "dateTimeRange",
              picker: v.type,
              size: "small",
              modelValue: c(f),
              "onUpdate:modelValue": k[2] || (k[2] = (R) => ce(f) ? f.value = R : null)
            }, v.$attrs, { onChange: c(d) }), null, 16, ["show-time", "picker", "modelValue", "onChange"])) : v.type === "timeRange" ? (y(), P(c(Nt), j({
              key: 1,
              modelValue: c(f),
              "onUpdate:modelValue": k[3] || (k[3] = (R) => ce(f) ? f.value = R : null),
              size: "small"
            }, v.$attrs, { onChange: c(d) }), null, 16, ["modelValue", "onChange"])) : h("v-if", !0)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : h("v-if", !0)
      ],
      2
      /* CLASS */
    ));
  }
}), Na = /* @__PURE__ */ Ue(Rp, [["__scopeId", "data-v-b9b880e5"]]), Dp = { class: "search-content" }, Lp = {
  key: 0,
  class: "search-title"
}, mp = {
  key: 1,
  class: "left"
}, Ip = { class: "align-left-filter-content" }, Fp = {
  key: 2,
  class: "search-selected-content"
}, Kp = {
  key: 0,
  class: "label"
}, Np = { class: "tag-content" }, Ep = {
  key: 0,
  class: "right"
}, Up = { class: "status" }, Mp = {
  key: 2,
  class: "margin-filter"
}, Bp = { class: "filter-scroll-content" }, zp = /* @__PURE__ */ Ke({
  __name: "Index",
  props: {
    title: { default: "" },
    options: { default: () => [] },
    labelLength: { default: 4 },
    showFilterPanel: { type: Boolean, default: !1 },
    layout: { default: "horizontal" },
    isMarginRight: { type: Boolean, default: !1 },
    labelPosition: { default: "left" },
    hasBtn: { type: Boolean, default: !1 },
    isExpandAtFocus: { type: Boolean, default: !0 },
    isExpandFilter: { type: Boolean, default: !1 }
  },
  emits: ["confirm", "clearSearch"],
  setup(e, { expose: r, emit: o }) {
    Ct((n) => ({
      "1861621f": R.value,
      "2bad78c9": p.value
    })), Vt({
      fold: import("@das-fed/ui/packages/icons/fold")
    });
    const s = e, g = I.value === "zh-CN" ? "，" : ", ", f = A(70), p = A("50px"), d = A(0), C = A(Number(s.labelLength) + 1), $ = Q(s, "isExpandFilter"), M = () => {
      $.value = !$.value;
    }, v = o;
    let k = A([]);
    const R = A("36%"), se = A();
    pa(() => window.screen.width), _t(() => {
      var u, t;
      f.value = I.value == "zh-CN" ? window.screen.width > 1440 ? 70 : 50 : 30, p.value = f.value + "px", k.value = JSON.parse(JSON.stringify(O.value));
      let n = Ee(C.value, s.labelPosition).replace("px", "");
      I.value == "zh-CN" ? R.value = (((n * 1 >= 84 ? 84 : n * 1) + 208) * 2 + f.value) / (((u = se.value) == null ? void 0 : u.clientWidth) - 80) * 100 + "%" : R.value = (378 + f.value) * 2 / (((t = se.value) == null ? void 0 : t.clientWidth) - 80) * 100 + "%";
    });
    const O = Q(s, "options"), K = Q(s, "options");
    O.value.forEach((n) => {
      n.layout = n.layout ? n.layout : "inner";
    });
    let D = A([]), Xe = A([]), Oe = A([]);
    const m = (n, u) => {
      var a, i;
      const { key: t, ...l } = n;
      if ((l.type != "selectDateRange" && s.showFilterPanel || !s.showFilterPanel && !["dateRange", "dateTimeRange", "weekRange", "monthRange", "yearRange", "selectDateRange"].includes(l.type)) && (l.width = (l == null ? void 0 : l.width) || "200px"), s.showFilterPanel) {
        if ((l.type == "radio" || l.type == "checkbox") && (l.optionType = "filterSquare"), n != null && n.custom && u == "childItem")
          return l.customOption.defaultProps || (l.customOption.defaultProps = {
            value: "id",
            label: "name"
          }), l.customOption;
        if (n.options && (l.optionsLabelKey = l.optionsLabelKey ? l.optionsLabelKey : "label", l.optionsValueKey = l.optionsValueKey ? l.optionsValueKey : "value"), n.type == "selectDateRange") {
          const { value: V, ...S } = l;
          return S.mode = S.mode ? S.mode : "default", S;
        } else
          return l;
      } else if (u == "outDate") {
        const { type: V, ...S } = l;
        return S;
      }
      return l.hasOwnProperty("isChangeTrigger") || (l.isChangeTrigger = !0), n.type == "treeSelect" && (l.optionsLabelKey = ((a = l.treeProps) == null ? void 0 : a.label) || "name", l.optionsValueKey = ((i = l.treeProps) == null ? void 0 : i.value) || l.nodeKey || "value", l.props = l == null ? void 0 : l.treeProps, l.keyword = l.keyword ? l.keyword : "", l.selectAttrs = l.selectAttrs ? l.selectAttrs : {}, Pe(() => l)), l;
    }, H = () => {
      const n = {};
      return Pe(() => {
        O.value.map((u) => n[u.key] = u.value);
      }), n;
    };
    let pt = [
      "dateRange",
      "dateTimeRange",
      "weekRange",
      "monthRange",
      "selectDateRange",
      "yearRange",
      "date",
      "dateTime",
      "week",
      "month",
      "quarter",
      "year"
    ], F = A([]);
    const fe = () => {
      let n, u = D.value.map((a) => {
        var ie, sa, ia, ua, ca;
        let i;
        a.optionsLabelKey = a.optionsLabelKey ? a.optionsLabelKey : "label", a.optionsValueKey = a.optionsValueKey ? a.optionsValueKey : "value", n = a.label, a.options && a.options.length ? a.type != "selectDateRange" && a.type != "treeSelect" ? (i = a.options.filter((b) => {
          if (Array.isArray(a.value) && !b.mutual)
            return a.value.includes(b[a.optionsValueKey]);
          if (!b.mutual && !b[a.optionsLabelKey].toLowerCase().includes(L("全部").toLowerCase()) && !b[a.optionsLabelKey].toLowerCase().includes(L("不限").toLowerCase()) && !Array.isArray(a.value) && b[a.optionsLabelKey] != "" && b[a.optionsLabelKey] != null)
            return a.value === b[a.optionsValueKey];
        }), n = a.label) : a.type == "selectDateRange" && (n = a.options.filter((b) => a.optionValue == b[a.optionsValueKey])[0][a.optionsLabelKey], i = a.value) : a != null && a.custom && a.customOption && a.customOption.options.length && (i = a.customOption.options.filter((b) => a.customOption.value == b[a.customOption.defaultProps.value])), a.type == "treeSelect" && (a.optionsLabelKey = ((ie = a.treeProps) == null ? void 0 : ie.label) || "name", a.optionsValueKey = ((sa = a.treeProps) == null ? void 0 : sa.value) || a.nodeKey || "value", a.props = a == null ? void 0 : a.treeProps, n = a.label, i = a.checkedNodes ? Array.isArray(a.checkedNodes) ? (ia = a.checkedNodes) == null ? void 0 : ia.map((b) => b[a.optionsLabelKey]) : a.checkedNodes[a.optionsLabelKey] : []);
        let V = a.type == "selectDateRange" ? a.dateType : a.type;
        a.type != "selectDateRange" && (V == "dateRange" || V == "dateTimeRange" || V == "weekRange" || V == "monthRange" || V == "yearRange" || V == "timeRange") && (a.value = a.value && a.value.length ? !a.value[0] && !a.value[1] ? "" : a.value : "");
        let S = "";
        if (a.type == "treeSelect")
          S = i && !Array.isArray(i) ? i : i.join(g);
        else if (a.custom)
          S = a.value ? a.value : i.map((b) => b[a.customOption.defaultProps.label]).join(g);
        else if (a.type != "selectDateRange" && a.options && a.options.length)
          S = i.map((b) => b[a.optionsLabelKey]).join(g);
        else if (a.type == "selectDateRange" || a.type == "dateRange" || V == "dateTimeRange" || a.type == "timeRange" || V == "weekRange" || V == "monthRange" || V == "yearRange" || a.type == "inputSelect") {
          if ((ua = a.value) != null && ua.length || (ca = a == null ? void 0 : a.storageValue) != null && ca.length) {
            let b = a.value || (a == null ? void 0 : a.storageValue);
            b.length == 2 ? b != null && b.every((je) => !!je) ? S = I.value == "zh-CN" ? b.join(L("至")) : b.join(" " + L("至") + " ") : b != null && b.every((je) => !je) ? S = "" : !b[0] || !b[1] ? S = b[0] || b[1] : S = b : S = b;
          }
        } else a.type == "select" && a.mode == "multiple" ? S = !a.value || !(i != null && i.length) ? "" : i.map((b) => b[a.optionsLabelKey]).join(g) : S = a.value;
        return {
          show: a.show,
          closable: a.closable,
          key: a.key,
          value: a.value || (a == null ? void 0 : a.storageValue),
          label: n,
          tagName: S,
          type: a.type
        };
      });
      u.forEach((a) => {
        a.show = !!a.tagName;
      });
      let t = {}, l = F.value.concat(u);
      l = l.reduce((a, i) => (t[i.key] ? a[a.findIndex((V) => V.key == i.key)] = i : t[i.key] = a.push(i), a), []), F.value = l.filter((a) => !!a.show), F.value.forEach((a) => {
        pt.includes(a.type) && (a.tagName = Bt(a));
      });
    };
    let dt = pa(() => {
      O.value.forEach((t) => {
        t.layout = t.layout ? t.layout : "inner";
      }), D.value = s.showFilterPanel ? O.value.filter((t) => t.layout == "inner") : [], D.value.forEach((t, l) => {
        t.keyCount = t.keyCount > 0 ? t.keyCount : 0, t.marginRight = I.value == "zh-CN" ? t.marginRight ? t.marginRight : `${f.value}px` : "30px";
      }), Xe.value = s.showFilterPanel ? O.value.filter((t) => t.layout == "out") : O.value.filter((t) => t.type == "searchInput" || t.type == "selectSearch"), Oe.value = s.showFilterPanel ? [] : O.value.filter((t) => t.type != "searchInput" && t.type != "selectSearch");
      let u = O.value.filter((t) => t.layout == "inner" && t.type != "input").map((t) => t.value || t.optionValue);
      return s.showFilterPanel ? u : [];
    });
    Ea(
      () => dt,
      () => {
        s.showFilterPanel && fe();
      },
      { deep: !0, immediate: !0 }
    );
    const B = async (n, u, t, l) => {
      var a, i, V;
      x.value || (n.change && n.change(n, u, H(), l), s.showFilterPanel && (n.custom && (t == "childItem" ? (n.value = "", n.customerActive = !1) : (n.customOption.value = "", n.customerActive = !0)), n.type == "treeSelect" ? (n.checkedNodes = Array.isArray(l) ? l : [l], n.selectChange && n.selectChange(u, H(), l), n != null && n.parentLinkChildrenStrictly && fe()) : n.type == "input" ? fe() : ["dateRange", "dateTimeRange", "weekRange", "monthRange", "selectDateRange", "yearRange"].includes(n.type) && (!((a = n.value) != null && a.length) || (i = n.value) != null && i.length && ((V = n.value) != null && V.every((S) => !S))) && (n.storageValue = [], n.value = [])), n.hasOwnProperty("isChangeTrigger") || (n.isChangeTrigger = !0), n.isChangeTrigger && Y());
    }, Ze = (n, u) => {
      x.value || (n.dateRangeChange && n.dateRangeChange(n, u, H()), s.showFilterPanel && fe(), n.hasOwnProperty("isChangeTrigger") || (n.isChangeTrigger = !0), n.isChangeTrigger && Y());
    }, ea = (n, u) => {
      (n.type == "dateRange" || n.type == "dateTimeRange" || n.type == "weekRange" || n.type == "monthRange" || n.type == "yearRange") && (n.storageValue = n.value ? JSON.parse(JSON.stringify(n.value)) : void 0, n.openChange && n.openChange(u, H()));
    }, aa = (n, u) => {
      (n.type == "dateRange" || n.type == "dateTimeRange" || n.type == "weekRange" || n.type == "monthRange" || n.type == "yearRange") && n.calendarChange && n.calendarChange(u, H());
    }, ft = (n, u) => {
      n.type == "select" && n.dropdownVisibleChange && n.dropdownVisibleChange(u);
    }, Z = async (n, u) => {
      x.value || (n.type != "treeSelect" && (n.selectChange && n.selectChange(n, u, H()), n.type == "selectDateRange" && F.value.forEach((t) => {
        t.key == n.key && (t.label = n.options.filter((l) => n.optionValue == l[n.optionsValueKey])[0][n.optionsLabelKey]);
      })), Y());
    }, gt = (n, u) => {
      n.openDialog && n.openDialog(n, u);
    }, yt = (n, u) => {
      H(), !x.value && Y();
    }, ge = (n, u, t) => t.type !== "select" ? !1 : t.filterOption ? t.filterOption(n, u, t) : u[t.optionsLabelKey].toLowerCase().indexOf(n.toLowerCase()) >= 0, Y = (n = !0) => {
      const u = {};
      O.value.forEach((t) => u[t.key] = t.value), v("confirm", H());
    };
    let ta = {
      string: "",
      number: [],
      object: {},
      function: [],
      array: []
    };
    const ra = A(0), na = (n, u = !1) => {
      F.value = F.value.filter((l) => l.key != n.key);
      let t = !1;
      D.value.forEach((l) => {
        var a;
        if (n.key == l.key) {
          const i = K.value.find((S) => S.key == n.key);
          l.show = !1;
          let V = typeof (i == null ? void 0 : i.value) == "object" && Array.isArray(i == null ? void 0 : i.value) ? "array" : typeof (i == null ? void 0 : i.value);
          if (l.type == "select") {
            let S = i.options.find(
              (ie) => ie[i.optionsLabelKey].toLowerCase().includes(L("全部").toLowerCase()) || ie[i.optionsLabelKey] == L("不限")
            );
            l.value = S ? S[i.optionsValueKey] : l.mode == "multiple" ? [] : null, (a = l.value) != null && a.length && typeof l.value != "string" && (l.value = JSON.parse(JSON.stringify(ta[V]))), l.keyCount++;
          } else l.type == "treeSelect" ? (l.value = Array.isArray(i.value) ? [] : "", l.checkedNodes = [], ra.value++) : l.type == "selectDateRange" ? (l.optionValue = i.optionValue, l.value = []) : l.type == "inputSelect" ? (l.value = [], l.options = [], t = !0) : l.type == "dateRange" || l.type == "dateTimeRange" || l.type == "weekRange" || l.type == "monthRange" || l.type == "yearRange" ? (l.value = [], l.storageValue = []) : ["date", "dateTime", "week", "month", "quarter", "year"].includes(l.type) ? l.value = "" : l.value = ta[V];
          l.custom && (l.customerActive = !1, l.customOption.value && (l.customOption.value = i.customOption.value));
        }
      }), v("clearSearch", n), !t && !u && Y();
    };
    let oa = A({});
    const la = (n, u) => {
      oa.value[`treeSelect${u.key}`] = n;
    }, ht = (n) => {
      let u = oa.value[`treeSelect${n}`];
      Pe(() => {
        var t, l;
        (l = (t = u == null ? void 0 : u.$treeSelect) == null ? void 0 : t.$tree) == null || l.resetLazyLoad();
      });
    }, x = A(!1), vt = async (n = !0) => {
      x.value = !0, F.value = [], await O.value.forEach((u) => {
        let t = k.value.find((l) => l.key == u.key);
        t && (u.value = t.value, t.type == "select" ? (u.value = t.options.find(
          (l) => l[t.optionsLabelKey].toLowerCase().includes(l("全部").toLowerCase()) || l[t.optionsLabelKey].toLowerCase().includes(l("不限").toLowerCase())
        )[t.optionsValueKey], u.keyCount++) : t.type == "inputSelect" ? u.options = t.options : t.type == "treeSelect" ? u.checkedNodes = t.checkedNodes : t.optionValue && (u.optionValue = t.optionValue));
      }), O.value = JSON.parse(JSON.stringify(O.value)), d.value++, x.value = !1, n && Y();
    }, bt = async (n) => {
      if (Array.isArray(n)) {
        x.value = !0;
        let u = n.map((l) => l.key), t = k.value.filter((l) => u.includes(l.key));
        F.value = F.value.filter((l) => !u.includes(l.key)), await O.value.forEach((l) => {
          let a = t.find((i) => i.key == l.key);
          a && (l.value = a.value, a.type == "select" ? (l.value = a.options.find(
            (i) => i[a.optionsLabelKey].toLowerCase().includes(i("全部").toLowerCase()) || i[a.optionsLabelKey].toLowerCase().includes(i("不限").toLowerCase())
          )[a.optionsValueKey], l.keyCount++) : a.type == "inputSelect" ? l.options = a.options : a.type == "treeSelect" ? l.checkedNodes = a.checkedNodes : a.optionValue && (l.optionValue = a.optionValue));
        }), O.value = JSON.parse(JSON.stringify(O.value)), x.value = !1, Y();
      } else
        na(n);
    }, $t = () => $.value, ke = (n) => {
      if (!((n == null ? void 0 : n.type) != "input" && (n == null ? void 0 : n.type) != "search" && (n == null ? void 0 : n.type) != "searchInput" && (n == null ? void 0 : n.type) != "selectSearch"))
        return n != null && n.placeholder ? n == null ? void 0 : n.placeholder : !(n != null && n.placeholder) && !(n != null && n.label) && (n == null ? void 0 : n.type) == "searchInput" ? "请输入" : n != null && n.label ? L("das-search-form-search-pre", (n == null ? void 0 : n.label) ?? "") : void 0;
    };
    return r({
      /**treeSelect 调用懒加载树刷新 */
      treeSelectResetLazyLoad: ht,
      closeSearch: bt,
      resetSearch: vt,
      getCollapseStatus: $t
    }), (n, u) => (y(), _(
      "div",
      {
        class: G(["das-ui-search-form", {
          "expand-hasbtn-padding": n.hasBtn && c($) && n.showFilterPanel,
          "expand-nobtn-padding": !n.hasBtn && c($) && n.showFilterPanel,
          "packup-hasbtn-padding": n.hasBtn && !c($) && n.showFilterPanel,
          "packup-nobtn-padding": !n.hasBtn,
          "nofilter-hasbtn-padding": n.hasBtn && !n.showFilterPanel,
          "das-ui-search-form-en-nonefilter": c(I) != "zh-CN" && !n.showFilterPanel,
          "das-ui-search-form-en-filter": c(I) != "zh-CN" && n.showFilterPanel
        }]),
        ref_key: "searchForm",
        ref: se
      },
      [
        N("div", Dp, [
          N(
            "div",
            {
              class: G(["search-form-left", { "align-center": c(Oe).length }])
            },
            [
              h(" 页面标题 "),
              n.title ? (y(), _(
                "div",
                Lp,
                ae(n.title),
                1
                /* TEXT */
              )) : h("v-if", !0),
              n.$slots.left ? (y(), _("div", mp, [
                h(" @slot slot左侧内容 "),
                W(n.$slots, "left", {}, void 0, !0)
              ])) : h("v-if", !0),
              h(" 无过滤面板 "),
              N("div", Ip, [
                q(c(da), {
                  alignType: "horizontal",
                  labelLength: C.value - 1,
                  labelPosition: n.labelPosition,
                  contentWidth: "",
                  isSearchForm: !0
                }, {
                  default: E(() => [
                    (y(!0), _(
                      z,
                      null,
                      ye(c(Oe), (t, l) => (y(), _(
                        z,
                        { key: l },
                        [
                          t.type != "selectDateRange" && t.type != "treeSelect" ? (y(), P(c(ee), j({
                            key: 0,
                            modelValue: t.value,
                            "onUpdate:modelValue": (a) => t.value = a,
                            ref_for: !0
                          }, m(t), {
                            onChange: (a) => {
                              B(t, a);
                            },
                            "filter-option": (a, i) => ge(a, i, t),
                            onSelectChange: (a) => {
                              Z(t, a);
                            },
                            onDropdownVisibleChange: (a) => {
                              ft(t, a);
                            },
                            placeholder: ke(t)
                          }), {
                            default: E(() => [
                              W(n.$slots, t.key, {}, void 0, !0)
                            ]),
                            _: 2
                            /* DYNAMIC */
                          }, 1040, ["modelValue", "onUpdate:modelValue", "onChange", "filter-option", "onSelectChange", "onDropdownVisibleChange", "placeholder"])) : h("v-if", !0),
                          t.type == "treeSelect" ? (y(), P(c(ee), j({
                            key: 1,
                            ref_for: !0,
                            ref: (a) => la(a, t),
                            style: t.marginRight,
                            modelValue: t.value,
                            "onUpdate:modelValue": (a) => t.value = a,
                            keyword: t.keyword,
                            "onUpdate:keyword": (a) => t.keyword = a
                          }, m(t), {
                            onChange: (a, i) => {
                              B(t, a, "", i);
                            },
                            "filter-option": (a, i) => ge(a, i, t),
                            onSelectChange: (a) => {
                              Z(t, a);
                            }
                          }), {
                            default: E(() => [
                              W(n.$slots, t.key, {}, void 0, !0)
                            ]),
                            _: 2
                            /* DYNAMIC */
                          }, 1040, ["style", "modelValue", "onUpdate:modelValue", "keyword", "onUpdate:keyword", "onChange", "filter-option", "onSelectChange"])) : h("v-if", !0),
                          h(" 带select的日期范围选择 "),
                          t.type == "selectDateRange" ? (y(), P(Na, j({
                            key: 2,
                            label: t.label,
                            labelLength: C.value - 1,
                            labelPosition: n.labelPosition,
                            mode: "optional",
                            type: t.dateType,
                            class: "",
                            showFilterPanel: s.showFilterPanel,
                            optionValue: t.optionValue,
                            "onUpdate:optionValue": (a) => t.optionValue = a,
                            modelValue: t.value,
                            "onUpdate:modelValue": (a) => t.value = a,
                            ref_for: !0
                          }, m(t, "outDate"), {
                            onDateRangeChange: (a) => {
                              Ze(t, a);
                            },
                            onSelectChange: (a) => {
                              Z(t, a);
                            },
                            labelWidth: t == null ? void 0 : t.labelWidth
                          }), null, 16, ["label", "labelLength", "labelPosition", "type", "showFilterPanel", "optionValue", "onUpdate:optionValue", "modelValue", "onUpdate:modelValue", "onDateRangeChange", "onSelectChange", "labelWidth"])) : h("v-if", !0)
                        ],
                        64
                        /* STABLE_FRAGMENT */
                      ))),
                      128
                      /* KEYED_FRAGMENT */
                    ))
                  ]),
                  _: 3
                  /* FORWARDED */
                }, 8, ["labelLength", "labelPosition"])
              ]),
              h(" 已选条件区 "),
              n.showFilterPanel ? (y(), _("div", Fp, [
                c(F).length ? (y(), _(
                  "span",
                  Kp,
                  ae(c(L)("筛选条件")),
                  1
                  /* TEXT */
                )) : h("v-if", !0),
                N("div", Np, [
                  (y(!0), _(
                    z,
                    null,
                    ye(c(F), (t, l) => (y(), _(
                      z,
                      { key: l },
                      [
                        t.show ? (y(), P(c(jt), {
                          effect: "list",
                          maxWidth: "186px",
                          toolTip: "",
                          key: t.tagName,
                          toolTipLabel: `${t.tagName}`,
                          closable: t.closable,
                          onClose: (a) => na(t)
                        }, {
                          default: E(() => [
                            N(
                              "span",
                              null,
                              ae(t.label) + "：",
                              1
                              /* TEXT */
                            )
                          ]),
                          _: 2
                          /* DYNAMIC */
                        }, 1032, ["toolTipLabel", "closable", "onClose"])) : h("v-if", !0)
                      ],
                      64
                      /* STABLE_FRAGMENT */
                    ))),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])
              ])) : h("v-if", !0)
            ],
            2
            /* CLASS */
          ),
          N(
            "div",
            {
              class: G(["search-form-right", { "filter-panel-left": n.showFilterPanel }])
            },
            [
              n.$slots.right ? (y(), _("div", Ep, [
                W(n.$slots, "right", {}, void 0, !0)
              ])) : h("v-if", !0),
              h(" 外部右侧搜索筛选条件 "),
              N(
                "div",
                {
                  class: G(["out-filter-content", { "no-fileter-panel": !n.showFilterPanel }])
                },
                [
                  (y(!0), _(
                    z,
                    null,
                    ye(c(Xe), (t, l) => (y(), _(
                      z,
                      { key: l },
                      [
                        t.type == "searchInput" ? (y(), P(c(Ot), j({
                          key: d.value,
                          clearable: !0,
                          modelValue: t.value,
                          "onUpdate:modelValue": (a) => t.value = a,
                          ref_for: !0
                        }, m(t), {
                          onChange: (a) => {
                            B(t, a);
                          },
                          placeholder: ke(t),
                          isExpandAtFocus: n.isExpandAtFocus
                        }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange", "placeholder", "isExpandAtFocus"])) : h("v-if", !0),
                        t.type == "selectSearch" ? (y(), P(c(kt), j({
                          key: 1,
                          ref_for: !0
                        }, m(t), {
                          optionValue: t.optionValue,
                          "onUpdate:optionValue": (a) => t.optionValue = a,
                          modelValue: t.value,
                          "onUpdate:modelValue": (a) => t.value = a,
                          onSelectChange: (a) => {
                            Z(t, a);
                          },
                          onInputChange: (a) => {
                            B(t, a);
                          },
                          key: d.value,
                          clearable: !0,
                          isSearch: !0,
                          placeholder: ke(t),
                          isExpandAtFocus: n.isExpandAtFocus
                        }), null, 16, ["optionValue", "onUpdate:optionValue", "modelValue", "onUpdate:modelValue", "onSelectChange", "onInputChange", "placeholder", "isExpandAtFocus"])) : h("v-if", !0)
                      ],
                      64
                      /* STABLE_FRAGMENT */
                    ))),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                2
                /* CLASS */
              ),
              n.showFilterPanel ? (y(), _("div", {
                key: 1,
                class: "filter-handle-status",
                onClick: M
              }, [
                N(
                  "span",
                  Up,
                  ae(c($) ? c(L)("收起过滤") : c(L)("展开过滤")),
                  1
                  /* TEXT */
                ),
                q(c(At), {
                  icon: "fold",
                  size: "medium",
                  iconColor: "#5582F3",
                  class: G({
                    arrowTransform: c($),
                    arrowTransformReturn: !c($)
                  })
                }, null, 8, ["class"])
              ])) : h("v-if", !0),
              !n.showFilterPanel && n.isMarginRight ? (y(), _("div", Mp)) : h("v-if", !0)
            ],
            2
            /* CLASS */
          )
        ]),
        h(" 展开过滤条件区 "),
        h(` :class="{\r
                'filter-item':\r
                  (item.type == 'dateRange' || item.type == 'dateTimeRange' || item.type == 'weekRange' || item.type == 'monthRange' || item.type == 'yearRange') && layout == 'horizontal',\r
              }" `),
        q(c(Rt), null, {
          default: E(() => [
            Ne((y(), _(
              "div",
              {
                class: G(["filter-content", { "horizontal-filter-content": n.layout == "horizontal" }])
              },
              [
                N("div", Bp, [
                  q(c(da), {
                    labelLength: C.value,
                    labelPosition: n.layout == "horizontal" ? "right" : "left",
                    contentWidth: n.layout == "horizontal" ? "100%" : "",
                    alignType: n.layout,
                    isSearchForm: !0
                  }, {
                    default: E(() => [
                      (y(!0), _(
                        z,
                        null,
                        ye(c(D), (t, l) => (y(), _(
                          z,
                          { key: l },
                          [
                            t.type != "dateRange" && t.type != "dateTimeRange" && t.type != "weekRange" && t.type != "monthRange" && t.type != "yearRange" && t.type != "treeSelect" && !(t != null && t.custom) && t.type != "selectDateRange" && t.type != "inputSelect" ? (y(), P(c(ee), j({
                              key: 0,
                              col: 1,
                              showColon: !0,
                              style: t.marginRight,
                              modelValue: t.value,
                              "onUpdate:modelValue": (a) => t.value = a,
                              ref_for: !0
                            }, m(t), {
                              onChange: (a, i) => {
                                B(t, a, "", i);
                              },
                              onOpenChange: (a) => {
                                ea(t, a);
                              },
                              onCalendarChange: (a) => {
                                aa(t, a);
                              },
                              "disabled-date": t == null ? void 0 : t.disabledDate,
                              key: t.keyCount,
                              "filter-option": (a, i) => ge(a, i, t)
                            }), {
                              default: E(() => [
                                W(n.$slots, t.key, {}, void 0, !0)
                              ]),
                              _: 2
                              /* DYNAMIC */
                            }, 1040, ["style", "modelValue", "onUpdate:modelValue", "onChange", "onOpenChange", "onCalendarChange", "disabled-date", "filter-option"])) : h("v-if", !0),
                            t.type == "treeSelect" ? (y(), P(c(ee), j({
                              showColon: !0,
                              ref_for: !0,
                              ref: (a) => la(a, t),
                              style: t.marginRight,
                              modelValue: t.value,
                              "onUpdate:modelValue": (a) => t.value = a,
                              key: ra.value,
                              keyword: t.keyword,
                              "onUpdate:keyword": (a) => t.keyword = a
                            }, m(t), {
                              onChange: (a, i) => {
                                B(t, a, "", i);
                              },
                              "filter-option": (a, i) => ge(a, i, t),
                              onSelectChange: (a) => {
                                Z(t, a);
                              }
                            }), {
                              default: E(() => [
                                W(n.$slots, t.key, {}, void 0, !0)
                              ]),
                              _: 2
                              /* DYNAMIC */
                            }, 1040, ["style", "modelValue", "onUpdate:modelValue", "keyword", "onUpdate:keyword", "onChange", "filter-option", "onSelectChange"])) : h("v-if", !0),
                            t.type == "dateRange" || t.type == "dateTimeRange" || t.type == "weekRange" || t.type == "monthRange" || t.type == "yearRange" ? (y(), P(c(ee), j({
                              key: 2,
                              showColon: !0,
                              style: t.marginRight,
                              modelValue: t.value,
                              "onUpdate:modelValue": (a) => t.value = a,
                              ref_for: !0
                            }, m(t), {
                              onChange: (a, i) => {
                                B(t, a, "", i);
                              },
                              onOpenChange: (a) => {
                                ea(t, a);
                              },
                              onCalendarChange: (a) => {
                                aa(t, a);
                              },
                              "disabled-date": t == null ? void 0 : t.disabledDate
                            }), {
                              default: E(() => [
                                W(n.$slots, t.key, {}, void 0, !0)
                              ]),
                              _: 2
                              /* DYNAMIC */
                            }, 1040, ["style", "modelValue", "onUpdate:modelValue", "onChange", "onOpenChange", "onCalendarChange", "disabled-date"])) : h("v-if", !0),
                            t != null && t.custom ? (y(), P(c(Tt), j({
                              key: 3,
                              labelLength: C.value,
                              labelPosition: "left",
                              customerActive: t.customerActive,
                              label: t.label,
                              modelValue: t.customOption.value,
                              "onUpdate:modelValue": (a) => t.customOption.value = a,
                              ref_for: !0
                            }, m(t, "childItem"), {
                              onChange: (a) => {
                                B(t, a, "childItem");
                              }
                            }), {
                              default: E(() => [
                                q(c(ee), j({
                                  class: "child-form-item",
                                  label: "",
                                  modelValue: t.value,
                                  "onUpdate:modelValue": (a) => t.value = a,
                                  ref_for: !0
                                }, m(t), {
                                  onChange: (a) => {
                                    B(t, a);
                                  }
                                }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])
                              ]),
                              _: 2
                              /* DYNAMIC */
                            }, 1040, ["labelLength", "customerActive", "label", "modelValue", "onUpdate:modelValue", "onChange"])) : h("v-if", !0),
                            h(" 带select的日期范围选择 "),
                            t.type == "selectDateRange" ? (y(), P(Na, j({
                              key: 4,
                              mode: t.mode,
                              label: t.label,
                              labelLength: C.value,
                              labelPosition: "left",
                              class: "filter-item",
                              optionValue: t.optionValue,
                              "onUpdate:optionValue": (a) => t.optionValue = a,
                              modelValue: t.value,
                              "onUpdate:modelValue": (a) => t.value = a,
                              ref_for: !0
                            }, m(t), {
                              onSelectChange: (a) => {
                                Z(t, a);
                              },
                              type: t.dateType,
                              onDateRangeChange: (a) => {
                                Ze(t, a);
                              },
                              showFilterPanel: s.showFilterPanel
                            }), null, 16, ["mode", "label", "labelLength", "optionValue", "onUpdate:optionValue", "modelValue", "onUpdate:modelValue", "onSelectChange", "type", "onDateRangeChange", "showFilterPanel"])) : h("v-if", !0),
                            t.type == "inputSelect" ? (y(), P(xt, j({
                              key: 5,
                              showFilterPanel: s.showFilterPanel,
                              style: `margin-right:${t.marginRight}`,
                              onOpenDialog: (a) => {
                                gt(t, a);
                              },
                              label: t.label,
                              labelLength: C.value,
                              modelValue: t.value,
                              "onUpdate:modelValue": (a) => t.value = a,
                              "selected-options": t.options,
                              ref_for: !0
                            }, m(t), {
                              class: "filter-input-select-item",
                              onOpenDialogChange: (a) => {
                                yt();
                              }
                            }), null, 16, ["showFilterPanel", "style", "onOpenDialog", "label", "labelLength", "modelValue", "onUpdate:modelValue", "selected-options", "onOpenDialogChange"])) : h("v-if", !0)
                          ],
                          64
                          /* STABLE_FRAGMENT */
                        ))),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ]),
                    _: 3
                    /* FORWARDED */
                  }, 8, ["labelLength", "labelPosition", "contentWidth", "alignType"]),
                  u[0] || (u[0] = N(
                    "div",
                    { class: "filter-line" },
                    null,
                    -1
                    /* HOISTED */
                  ))
                ])
              ],
              2
              /* CLASS */
            )), [
              [c(Pt)],
              [wt, c($)]
            ])
          ]),
          _: 3
          /* FORWARDED */
        })
      ],
      2
      /* CLASS */
    ));
  }
}), Gp = /* @__PURE__ */ Ue(zp, [["__scopeId", "data-v-b27c00e3"]]), Hp = {
  "--demo-alert-bg": {
    light: "#fff",
    dark: "rgba(255,255,255,.2)"
  },
  "--das-ui-search-form-font-color": "#212121",
  "--das-ui-search-form-primary-color": "#5582F3",
  "--das-ui-search-form-tip-color": "#999999",
  "--das-ui-search-form-filter-bgcolor": "#fafafa",
  "--das-ui-search-form-filter-border-color": "#d9d9d9",
  "--das-ui-search-form-filter-font-color": "#666666"
}, xp = {
  筛选条件: { "zh-CN": "筛选条件", en: "Filter Criteria", _appCode: "framework" },
  收起过滤: { "zh-CN": "收起过滤", en: "Collapse Filter", _appCode: "framework" },
  展开过滤: { "zh-CN": "展开过滤", en: "Expand Filter", _appCode: "framework" },
  全部: { "zh-CN": "全部", en: "All", _appCode: "framework" },
  不限: { "zh-CN": "不限", en: "Unlimited", _appCode: "framework" },
  至: { "zh-CN": "-", en: "-", _appCode: "framework" },
  "das-search-form-search-pre": { "zh-CN": "搜索$0", en: "Search $0", _appCode: "framework" }
};
Et(Hp);
Lt(xp);
const dd = () => A(null), fd = St(Gp);
export {
  fd as DasSearchForm,
  dd as DasSearchFormRef,
  fd as default
};
