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