@nhdropshipping/y-components 1.0.52 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Ae=["type","disabled","aria-busy","aria-disabled"],We={class:"content"},Ye={key:1,class:"y-btn-group",role:"group"},Pe=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Oe={class:"content"},je={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ue={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},qe={key:2},Ze=e.defineComponent({__name:"ybutton",props:{htmlType:{default:"button"},variant:{default:"primary"},size:{default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1},groupPosition:{default:"single"},groupItems:{default:void 0}},emits:["click","group-click"],setup(n,{emit:E}){const t=n,l=E;function p(B){if(t.disabled||t.loading){B.preventDefault(),B.stopPropagation();return}l("click",B)}const v=e.computed(()=>{switch(t.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),u=e.computed(()=>Array.isArray(t.groupItems)&&t.groupItems.length>0);function x(B,S){if(t.disabled||t.loading||B.disabled||B.loading){S.preventDefault(),S.stopPropagation();return}l("group-click",B.value,S)}return(B,S)=>u.value?(e.openBlock(),e.createElementBlock("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groupItems,(w,y)=>{var h;return e.openBlock(),e.createElementBlock("button",{key:w.value??y,class:e.normalizeClass(["y-btn",[`y-btn--${w.variant??n.variant}`,`y-btn--${w.size??n.size}`,"is-grouped",y===0?"group-pos-start":y===(((h=n.groupItems)==null?void 0:h.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":w.loading||n.loading}]]),type:n.htmlType,disabled:(w.disabled??!1)||n.disabled||n.loading||w.loading,"aria-busy":w.loading||n.loading?"true":"false","aria-disabled":(w.disabled??!1)||n.disabled||n.loading||w.loading?"true":"false","aria-label":w.ariaLabel||w.label,onClick:k=>x(w,k)},[e.createElementVNode("span",Oe,[w.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",je,[...S[0]||(S[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z","clip-rule":"evenodd"},null,-1)])])):w.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",Ue,[...S[1]||(S[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),w.label&&!w.onlyIcon?(e.openBlock(),e.createElementBlock("span",qe,e.toDisplayString(w.label),1)):e.createCommentVNode("",!0)])],10,Pe)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${n.variant}`,`y-btn--${n.size}`,{"is-block":n.block,"is-loading":n.loading},n.groupPosition!=="single"?"is-grouped":"",v.value]]),type:n.htmlType,disabled:n.disabled||n.loading,"aria-busy":n.loading?"true":"false","aria-disabled":n.disabled||n.loading?"true":"false",onClick:p},[e.createElementVNode("span",We,[e.renderSlot(B.$slots,"default",{},void 0,!0)])],10,Ae))}}),ne=(n,E)=>{const t=n.__vccOpts||n;for(const[l,p]of E)t[l]=p;return t},he=ne(Ze,[["__scopeId","data-v-53157673"]]),Qe=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],Je=e.defineComponent({__name:"yinput",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},autocomplete:{default:"off"},inputmode:{default:void 0},id:{default:void 0},name:{default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},size:{default:"medium"},width:{default:"200px"},min:{default:void 0},max:{default:void 0},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue","enter","paste"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(null),v=e.ref(""),u=e.ref(!1),x=e.ref(!1),B=e.ref(t.placeholder||"");e.watch(()=>t.placeholder,z=>{x.value||(B.value=z||"")});function S(z){const W=z.target;u.value=!0,l("update:modelValue",W.value)}function w(){x.value=!0,t.clearOnFocus&&(v.value=t.modelValue||"",u.value=!1,B.value=v.value||t.placeholder||"",l("update:modelValue",""))}function y(){if(x.value=!1,t.clearOnFocus&&!u.value&&(!t.modelValue||t.modelValue==="")&&l("update:modelValue",v.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const z=Number(t.modelValue),W=Number(t.min);!Number.isNaN(z)&&!Number.isNaN(W)&&z<W&&l("update:modelValue",String(W))}B.value=t.placeholder||""}function h(z){const W=z.target;l("enter",W.value)}function k(z){const W=z.target;requestAnimationFrame(()=>{l("paste",W.value)})}return(z,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":n.block}]),style:e.normalizeStyle({width:n.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:p,class:e.normalizeClass(["y-input",`y-input--${n.size}`]),id:n.id,name:n.name,type:n.type,placeholder:B.value,autocomplete:n.autocomplete,inputmode:n.inputmode,min:n.min,max:n.max,disabled:n.disabled,required:n.required,value:n.modelValue,onInput:S,onFocus:w,onBlur:y,onKeyup:e.withKeys(h,["enter"]),onPaste:k},null,42,Qe)],6))}}),Be=ne(Je,[["__scopeId","data-v-c4912c99"]]),Xe={key:0,class:"bulk-bar"},Ge={class:"bulk-left"},et={class:"bulk-actions"},tt={class:"card"},nt={class:"table"},lt={key:0,style:{width:"34px","min-width":"34px"}},ot={key:1,style:{width:"40px","min-width":"40px"}},at={key:0,class:"col-expand"},st={key:1,class:"col-select"},rt=["checked","disabled"],it={key:0,class:"loading-overlay"},ct={key:1,class:"empty-overlay"},dt={key:0,style:{width:"34px","min-width":"34px"}},ut={key:1,style:{width:"40px","min-width":"40px"}},mt={key:0,class:"col-expand"},ft=["onClick"],vt={key:1,class:"col-select"},ht=["value","checked","disabled","onChange"],pt=["colspan"],yt=e.defineComponent({__name:"ytable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},showBulkActions:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},pageSize:{default:10},currentPage:{},total:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"1/页",value:1},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},rowKey:{type:[String,Function],default:"id"},emptyText:{default:"无数据"},searchKeyword:{default:""},searchFields:{default:()=>[]},stickyHeader:{type:Boolean,default:!1},expandable:{type:Boolean},rowDisabled:{type:Function,default:void 0},selectedItems:{default:void 0}},emits:["edit","select","update:selectedItems","page-change","page-size-change"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(t.currentPage||1),v=e.ref(t.pageSize),u=e.ref(t.selectedItems||[]),x=e.ref(new Set),B=e.ref("none"),S=e.ref(),w=e.ref(),y=e.ref(),h=e.ref(),k=e.ref([]),z=e.ref({}),W=e.computed(()=>t.columns.filter(a=>!_(a.width)).map(a=>a.key));function K(){return`${(100/(W.value.length||1)).toFixed(6)}%`}const T=e.ref(),Y=e.ref({show:!1,thumbHeight:40,thumbTop:0});let j=!1,X=0,U=0;const L=e.ref(0);function _(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const c=String(a).trim();if(c)return/^\d+(\.\d+)?$/.test(c)?`${c}px`:c}function M(a){const c=_(a);if(!c)return null;const b=parseFloat(c);return Number.isFinite(b)?b:null}const R=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),Q=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(c=>t.searchFields.some(b=>{const C=g(c,b);return String(C).toLowerCase().includes(a)}))}),P=e.computed(()=>(t.pagination,Q.value)),G=e.computed(()=>{if(!t.selectable)return!1;const a=P.value.map((c,b)=>({key:i(c,b),item:c,index:b})).filter(({item:c,index:b})=>!o(c,b)).map(({key:c})=>c);return a.length>0&&a.every(c=>u.value.includes(c))}),le=e.computed(()=>{if(!t.selectable)return!1;const a=P.value.map((c,b)=>({item:c,index:b}));return a.length>0&&a.every(({item:c,index:b})=>o(c,b))}),A=e.computed(()=>{const a=[];let c=t.selectable?40:0;for(let b=0;b<t.columns.length;b++){const C=t.columns[b];if(C.fixed==="left"){let D=80;const I=M(C.width);I!==null?D=I:k.value[b]&&(D=M(k.value[b])??D),a.push(c),c+=D}}return a}),q=e.computed(()=>{const a=[];let c=0;const b=[];for(let C=t.columns.length-1;C>=0;C--){const D=t.columns[C];if(D.fixed==="right"){let I=80;const O=M(D.width);O!==null?I=O:k.value[C]&&(I=M(k.value[C])??I),b.push({index:C,width:I})}}for(let C=0;C<b.length;C++)a.push(c),c+=b[C].width;return a});function m(a,c){if(c==="left"){let b=0;for(let C=0;C<a;C++)t.columns[C].fixed==="left"&&b++;return b}else{let b=0;for(let C=t.columns.length-1;C>a;C--)t.columns[C].fixed==="right"&&b++;return b}}function i(a,c){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||c}function o(a,c){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,c):!1}function s(a){return x.value.has(a)}function d(a){x.value.has(a)?x.value.delete(a):x.value.add(a)}function g(a,c){return c.split(".").reduce((b,C)=>b==null?void 0:b[C],a)}function V(a,c=!1){const b=[];return a.align&&b.push(`text-${a.align}`),a.fixed==="right"&&(b.push("col-fixed-right"),c&&b.push("col-fixed-right-header")),a.fixed==="left"&&(b.push("col-fixed-left"),c&&b.push("col-fixed-left-header")),b.join(" ")}function $(a,c,b){const C={},D=_(a.width);if(D)C.width=D,C.minWidth=D,C.maxWidth=D;else{const I=K();C.width=I,C.minWidth=I,C.maxWidth=I}if(a.fixed==="left"){const I=m(c,"left"),O=A.value[I]||0;C.left=`${O}px`,C.zIndex=b?`${10+I}`:`${5+I}`}else if(a.fixed==="right"){const I=m(c,"right"),O=q.value[I]||0;b?C.right=`${O-3}px`:C.right=`${O}px`,C.zIndex=b?`${10+I}`:`${5+I}`}return C}function H(a,c){const b=g(a,c.key);return c.formatter?c.formatter(b,a):b||""}function J(a){const c=P.value.find((C,D)=>i(C,D)===a),b=P.value.findIndex((C,D)=>i(C,D)===a);c&&b>=0&&o(c,b)||(u.value.includes(a)?u.value=u.value.filter(C=>C!==a):u.value=[...u.value,a],l("select",u.value),l("update:selectedItems",u.value))}function te(){const a=P.value.map((c,b)=>({key:i(c,b),item:c,index:b})).filter(({item:c,index:b})=>!o(c,b)).map(({key:c})=>c);if(a.length!==0){if(a.every(c=>u.value.includes(c)))u.value=u.value.filter(c=>!a.includes(c));else{const c=new Set([...u.value,...a]);u.value=Array.from(c)}l("select",u.value),l("update:selectedItems",u.value)}}function ae(){u.value=[],l("select",u.value),l("update:selectedItems",u.value)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const c=new Set(u.value),b=new Set(a);(c.size!==b.size||![...c].every(C=>b.has(C)))&&(u.value=[...a])}else a===void 0&&u.value.length>0&&(u.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{p.value=1}),e.watch(()=>t.data,()=>{t.total||(p.value=1)},{deep:!0});function ue(a){p.value=a,l("page-change",a)}function we(a){v.value=a,p.value=1,l("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const c=typeof a=="number"&&a>0?a:1;p.value!==c&&(p.value=c)}),e.watch(()=>t.pageSize,a=>{const c=typeof a=="number"&&a>0?a:10;v.value!==c&&(v.value=c)});function ce(){S.value&&e.nextTick(()=>{const a=S.value.getBoundingClientRect(),c=window.innerHeight,b=a.top,C=S.value.querySelector(".table-header"),D=C?C.offsetHeight:40,I=S.value.querySelector(".ypagination"),O=I?I.offsetHeight:60,ee=S.value.querySelector(".bulk-bar"),Z=ee?ee.offsetHeight:0,oe=D+O+Z+20,ge=c-b-oe,Re=Math.max(200,ge),Ve=S.value.querySelector(".table-body-wrap .table");Ve&&(Ve.offsetHeight>ge?B.value=`${Re}px`:B.value="none")})}let re=!1;function ie(){!w.value||!y.value||re||w.value.scrollLeft!==y.value.scrollLeft&&(re=!0,w.value.scrollLeft=y.value.scrollLeft,requestAnimationFrame(()=>{re=!1}))}function me(){!w.value||!y.value||re||y.value.scrollLeft!==w.value.scrollLeft&&(re=!0,y.value.scrollLeft=w.value.scrollLeft,requestAnimationFrame(()=>{re=!1}))}function fe(){e.nextTick(()=>{if(!y.value)return;const a=y.value,c=a.scrollHeight,b=a.clientHeight,C=a.scrollTop,D=c>b+1;if(Y.value.show=D,!D)return;const I=24,O=b/c,ee=T.value?T.value.clientHeight:b,Z=Math.max(I,Math.floor(ee*O));Y.value.thumbHeight=Z;const oe=Math.max(0,ee-Z),ge=Math.max(1,c-b);Y.value.thumbTop=Math.min(oe,Math.floor(C/ge*oe))})}function ve(a){if(!j||!y.value||!T.value)return;a.preventDefault();const c=T.value.clientHeight,b=Math.max(0,c-Y.value.thumbHeight),C=y.value,D=C.scrollHeight,I=C.clientHeight,O=Math.max(1,D-I),Z=(a.clientY-X)/Math.max(1,b)*O;C.scrollTop=Math.min(O,Math.max(0,U+Z)),fe()}function ye(){j=!1,window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",ye)}function de(){e.nextTick(()=>{var b,C;if(k.value.length===t.columns.length&&k.value.every(D=>!!D))return;const a=[];t.columns.forEach((D,I)=>{const O=_(D.width);if(O)a.push(O),z.value[D.key]=O;else if(z.value[D.key])a.push(z.value[D.key]);else{const ee=k.value[I];if(ee)a.push(ee),z.value[D.key]=ee;else{const Z=K();a.push(Z),z.value[D.key]=Z}}});const c=(b=h.value)==null?void 0:b.querySelector("tbody tr");if(c){const D=t.selectable?1:0,I=Array.from(c.children);for(let O=0;O<t.columns.length;O++)if(!a[O]){const ee=I[D+O];if(ee&&ee.clientWidth>0){const Z=`${ee.clientWidth}px`;a[O]=Z,z.value[t.columns[O].key]=Z}else{const Z=K();a[O]=Z,z.value[t.columns[O].key]=Z}}}else for(let D=0;D<a.length;D++)if(!a[D]){const I=z.value[((C=t.columns[D])==null?void 0:C.key)||""];a[D]=I||k.value[D]||"80px",t.columns[D]&&(z.value[t.columns[D].key]=a[D])}k.value=a})}function r(){ce(),N()}e.watch(()=>t.data,()=>{e.nextTick(()=>{ce(),ie(),N(),x.value.clear()})},{deep:!0}),e.watch([p,v],()=>{e.nextTick(()=>{ce(),ie(),N()})}),e.watch(()=>t.columns,()=>{const a=[],c={...z.value};t.columns.forEach((C,D)=>{const I=_(C.width);I?(a.push(I),c[C.key]=I):c[C.key]?a.push(c[C.key]):k.value[D]?(a.push(k.value[D]),c[C.key]=k.value[D]):a.push("")});const b=new Set(t.columns.map(C=>C.key));Object.keys(c).forEach(C=>{b.has(C)||delete c[C]}),z.value=c,k.value=a,e.nextTick(()=>{de(),ie(),N()})},{deep:!0}),e.watch(()=>u.value,()=>{e.nextTick(()=>{ce(),N()})},{deep:!0}),e.watch(()=>t.loading,()=>{e.nextTick(()=>{N()})}),e.onMounted(()=>{var a,c;e.nextTick(()=>{ce(),de(),N(),fe()}),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),(a=y.value)==null||a.addEventListener("scroll",()=>{ie(),fe(),N()},{passive:!0}),(c=w.value)==null||c.addEventListener("scroll",()=>{me()},{passive:!0}),e.nextTick(()=>ie()),y.value&&typeof ResizeObserver<"u"&&(F=new ResizeObserver(()=>{N()}),F.observe(y.value))}),e.onUnmounted(()=>{var a,c;window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0),(a=y.value)==null||a.removeEventListener("scroll",ie),(c=w.value)==null||c.removeEventListener("scroll",me),window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",ye),F&&(F.disconnect(),F=null)});let f=-1;function N(){!w.value||!y.value||requestAnimationFrame(()=>{if(!w.value||!y.value)return;const a=y.value,c=Math.ceil(a.offsetWidth-a.clientWidth);if(L.value=c,c!==f){f=c;const b=w.value.querySelector(".table"),C=h.value;b&&C&&(w.value.style.paddingRight="0px",b.style.width="",b.style.marginRight="",c>0?(w.value.style.paddingRight=`${c}px`,b.style.width="100%",b.style.marginRight=`-${c}px`):(w.value.style.paddingRight="0px",b.style.width="100%",b.style.marginRight="0px"))}})}let F=null;return(a,c)=>{const b=e.resolveComponent("YButton"),C=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:S},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[u.value.length&&n.showBulkActions?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",Ge,"已选择 "+e.toDisplayString(u.value.length)+" 项",1),e.createElementVNode("div",et,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:u.value,clearSelection:ae},()=>[e.createVNode(b,{size:"small",class:"btn",onClick:ae},{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",tt,[e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:w},[e.createElementVNode("table",nt,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",lt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",ot)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,I)=>(e.openBlock(),e.createElementBlock("col",{key:D.key,style:e.normalizeStyle({width:k.value[I]||void 0,minWidth:k.value[I]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",at)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("th",st,[e.createElementVNode("input",{type:"checkbox",checked:G.value,disabled:le.value,onChange:te},null,40,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,I)=>(e.openBlock(),e.createElementBlock("th",{key:D.key,class:e.normalizeClass(V(D,!0)),style:e.normalizeStyle($(D,I,!0))},e.toDisplayString(D.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":n.loading,"is-empty":!P.value.length&&!n.loading}]),ref_key:"bodyWrapRef",ref:y,style:e.normalizeStyle({maxHeight:B.value})},[n.loading?(e.openBlock(),e.createElementBlock("div",it,[...c[3]||(c[3]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!P.value.length&&!n.loading?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":n.loading}]),ref_key:"bodyTableRef",ref:h},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",dt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",ut)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,I)=>(e.openBlock(),e.createElementBlock("col",{key:D.key,style:e.normalizeStyle({width:k.value[I]||void 0,minWidth:k.value[I]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(D,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i(D,I)},[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("td",mt,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:O=>d(i(D,I))},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":s(i(D,I))}])},null,2)],8,ft)])):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("td",vt,[e.createElementVNode("input",{type:"checkbox",value:i(D,I),checked:u.value.includes(i(D,I)),disabled:o(D,I),onChange:O=>J(i(D,I))},null,40,ht)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(O,ee)=>(e.openBlock(),e.createElementBlock("td",{key:O.key,class:e.normalizeClass(V(O)),style:e.normalizeStyle($(O,ee,!1))},[e.renderSlot(a.$slots,`cell-${O.key}`,{item:D,value:g(D,O.key),index:I},()=>[e.createTextVNode(e.toDisplayString(H(D,O)),1)],!0)],6))),128))]),t.expandable&&s(i(D,I))?(e.openBlock(),e.createElementBlock("tr",{key:`${i(D,I)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:R.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:D,index:I},void 0,!0)],8,pt)])):e.createCommentVNode("",!0)],64))),128))])],2)],6),n.pagination?(e.openBlock(),e.createBlock(C,{key:0,class:"align-right","current-page":p.value,"onUpdate:currentPage":c[0]||(c[0]=D=>p.value=D),"page-size":v.value,"onUpdate:pageSize":c[1]||(c[1]=D=>v.value=D),loading:t.loading,"page-size-options":n.pageSizeOptions,onPageChange:ue,onPageSizeChange:we},null,8,["current-page","page-size","loading","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),Se=ne(yt,[["__scopeId","data-v-d7acfa14"]]),gt=["onKeydown","aria-expanded"],kt=["src"],wt=["placeholder","onKeydown"],bt=["onClick","onMouseenter"],Et=["src"],Bt=e.defineComponent({__name:"yselect",props:{modelValue:{},options:{},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},clearTo:{default:void 0},filterable:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(!1),v=e.ref(-1),u=e.ref(),x=e.ref(),B=e.ref(),S=e.ref(),w=e.ref(!1),y=e.ref(),h=e.ref(""),k=e.computed(()=>t.options.find(o=>Y(o)===t.modelValue)||null),z=e.computed(()=>k.value?j(k.value):""),W=e.computed(()=>{if(!t.filterable)return t.options;const o=h.value.trim().toLowerCase();return o?t.options.filter(s=>{const d=j(s);return String(d).toLowerCase().includes(o)}):t.options}),K=e.computed(()=>{var V;const o={position:"fixed",zIndex:"4000"},s=x.value;if(!s)return o;const d=s.getBoundingClientRect(),g=((V=B.value)==null?void 0:V.getBoundingClientRect().width)||d.width;return o.left=`${d.left}px`,o.width=`${g}px`,w.value?(o.bottom=`${window.innerHeight-d.top+4}px`,o.top="auto"):o.top=`${d.bottom+4}px`,o});function T(){!p.value||!x.value||e.nextTick(()=>{const o=x.value;if(!o)return;const s=o.getBoundingClientRect(),d=window.innerHeight,g=200,V=s.bottom+g+4,$=s.top-g-4,H=V<=d-20,J=$>=20;w.value=!H&&J})}function Y(o){return typeof o=="object"&&o!==null?o[t.valueKey]:o}function j(o){return typeof o=="object"&&o!==null?o[t.labelKey]||String(o[t.valueKey]):String(o)}function X(o,s){return typeof o=="object"&&o!==null&&o.id!==void 0?o.id:Y(o)||s}function U(o){return Y(o)===t.modelValue}function L(o){return typeof o=="object"&&o!==null?o[t.disabledKey]===!0:!1}function _(){t.disabled||(p.value?R():M())}function M(){t.disabled||(p.value=!0,e.nextTick(()=>{T(),A(),t.filterable&&y.value&&(y.value.focus(),h.value="")}))}function R(){p.value=!1,v.value=-1,w.value=!1,t.filterable&&(h.value="")}function Q(o,s){if(L(o))return;const d=Y(o);l("update:modelValue",d),l("change",d,o),R()}function P(){if(!t.clearable||t.disabled)return;const o=t.clearTo;l("update:modelValue",o),l("change",o,null),l("clear"),R()}function G(o){if(!W.value||W.value.length===0){v.value=-1;return}let s=v.value;const d=W.value.length;s===-1?s=o>0?0:d-1:s=(s+o+d)%d;let g=0;for(;g<d&&L(W.value[s]);)s=(s+o+d)%d,g++;v.value=g>=d?-1:s,q()}function le(){if(v.value<0)return;const o=W.value[v.value];!o||L(o)||Q(o,v.value)}function A(){if(!u.value)return;const o=u.value.querySelector(".yselect__option--selected");o&&o.scrollIntoView({block:"nearest"})}function q(){if(!u.value||v.value<0)return;const s=u.value.querySelectorAll(".yselect__option")[v.value];s&&s.scrollIntoView({block:"nearest"})}function m(o){const s=o.target;(!B.value||!B.value.contains(s))&&R()}e.watch(()=>t.modelValue,()=>{v.value=-1});function i(){p.value&&T()}return e.onMounted(()=>{document.addEventListener("click",m),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",m),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":n.disabled,[`yselect--${n.size}`]:!0}]),style:e.normalizeStyle({width:n.width}),ref_key:"selectContainer",ref:B},[e.createElementVNode("div",{ref_key:"triggerElement",ref:x,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":p.value,"yselect__trigger--disabled":n.disabled,"yselect__trigger--error":n.error}]),onMousedown:e.withModifiers(_,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(_,["prevent"]),["enter"]),e.withKeys(e.withModifiers(_,["prevent"]),["space"]),e.withKeys(R,["escape"]),e.withKeys(e.withModifiers(M,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(M,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":p.value,"aria-haspopup":!0},[!n.filterable||!p.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!z.value}])},[e.renderSlot(o.$slots,"value",{value:k.value,label:z.value},()=>{var d;return[k.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(d=k.value)!=null&&d.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:k.value.flagImg,alt:"flag"},null,8,kt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(z.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.placeholder),1)],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:y,class:"yselect__input",type:"text",placeholder:z.value||n.placeholder,"onUpdate:modelValue":s[0]||(s[0]=d=>h.value=d),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(d=>G(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(d=>G(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(d=>le(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(R,["prevent"]),["esc"]),e.withKeys(e.withModifiers(P,["prevent"]),["delete"])]},null,40,wt)),[[e.vModelText,h.value]]),n.clearable&&!n.disabled&&k.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(P,["stop"])},[...s[8]||(s[8]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 3l6 6M9 3L3 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["yselect__arrow",{"yselect__arrow--open":p.value}])},[...s[9]||(s[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],42,gt),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownEl",ref:S,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":w.value}]),style:e.normalizeStyle(K.value),onMousedown:s[6]||(s[6]=e.withModifiers(()=>{},["stop"])),onClick:s[7]||(s[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"yselect__options",ref_key:"optionsContainer",ref:u},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(d,g)=>(e.openBlock(),e.createElementBlock("div",{key:X(d,g),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":U(d),"yselect__option--disabled":L(d),"yselect__option--hover":v.value===g}]),onClick:V=>Q(d),onMouseenter:V=>v.value=g,onMouseleave:s[5]||(s[5]=V=>v.value=-1)},[e.renderSlot(o.$slots,"option",{option:d,index:g,selected:U(d)},()=>[d!=null&&d.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:d.flagImg,alt:"flag"},null,8,Et)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(j(d)),1)],!0)],42,bt))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Ce=ne(Bt,[["__scopeId","data-v-6cd47cb7"]]),Ct={class:"ypagination"},xt={class:"page-actions"},Vt={class:"page-size-select"},Nt=e.defineComponent({__name:"ypagination",props:{currentPage:{},pageSize:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"10/页",value:10},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(t.pageSize),v=e.computed(()=>t.pageSizeOptions),u=e.computed({get:()=>t.currentPage,set:w=>{l("update:currentPage",w),l("page-change",w)}});function x(w){t.loading||w>=1&&w!==t.currentPage&&(u.value=w)}function B(w){t.loading||(p.value=w,l("update:pageSize",w),l("page-size-change",w),u.value=1)}function S(w){t.loading||(w==="prev"?x(u.value-1):w==="next"&&x(u.value+1))}return p.value=t.pageSize,e.watch(()=>t.pageSize,w=>{typeof w=="number"&&p.value!==w&&(p.value=w)}),(w,y)=>{const h=e.resolveComponent("YButton"),k=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("div",xt,[e.createVNode(h,{size:"small",variant:"secondary",disabled:u.value===1||n.loading,onClick:y[0]||(y[0]=z=>x(1))},{default:e.withCtx(()=>[...y[2]||(y[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(h,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:u.value===1||n.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:n.loading,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:S},null,8,["groupItems"]),e.createElementVNode("div",Vt,[e.createVNode(k,{modelValue:p.value,"onUpdate:modelValue":y[1]||(y[1]=z=>p.value=z),options:v.value,size:"small",width:"105px",clearable:!1,disabled:n.loading,onChange:B},null,8,["modelValue","options","disabled"])])])])}}}),$e=ne(Nt,[["__scopeId","data-v-b8406406"]]),Dt=["aria-label"],St={class:"y-badge__inner"},$t={key:0,class:"y-badge__progress","aria-hidden":"true"},_t={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Mt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},zt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Lt={key:1,class:"y-badge__icon","aria-hidden":"true"},Tt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},It={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Kt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ht={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ft={class:"y-badge__label"},Rt=e.defineComponent({__name:"ybadge",props:{tone:{default:"default"},size:{default:"medium"},progress:{default:void 0},icon:{default:void 0},pill:{type:Boolean,default:!0},outline:{type:Boolean,default:!1},label:{default:""}},setup(n){const E=n,t=e.computed(()=>E.tone||"default"),l=e.computed(()=>{const p=(E.label||"").trim(),v=E.tone,u=E.progress;if(u){const x={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return p?`${p},进度:${x[u]||u}`:`进度:${x[u]||u}`}if(v&&v!=="default"){const x={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return p?`${p},语气:${x[v]||v}`:`语气:${x[v]||v}`}return p||"标记"});return(p,v)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${n.size}`,{"is-outline":n.outline,"is-pill":n.pill},n.progress?`y-badge--progress-${n.progress}`:""]]),role:"status","aria-label":l.value},[e.createElementVNode("span",St,[n.progress?(e.openBlock(),e.createElementBlock("span",$t,[n.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",_t,[...v[0]||(v[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):n.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Mt,[...v[1]||(v[1]=[e.createElementVNode("path",{d:"M10 5a5 5 0 100 10V5z"},null,-1),e.createElementVNode("circle",{cx:"10",cy:"10",r:"5",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1)])])):n.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",zt,[...v[2]||(v[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)])):n.icon?(e.openBlock(),e.createElementBlock("span",Lt,[n.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Tt,[...v[3]||(v[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):n.icon==="check"?(e.openBlock(),e.createElementBlock("svg",It,[...v[4]||(v[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):n.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Kt,[...v[5]||(v[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ht,[...v[6]||(v[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",Ft,[e.renderSlot(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)])])],10,Dt))}}),_e=ne(Rt,[["__scopeId","data-v-ce819797"]]),At=["aria-hidden"],Wt=["onKeydown"],Yt={key:0,class:"y-dialog-header"},Pt={class:"y-dialog-title"},Ot={class:"y-dialog-body"},jt={key:1,class:"y-dialog-footer"},Ut=e.defineComponent({__name:"ydialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},width:{default:"520px"},top:{default:"15vh"},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:3e3},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(n,{emit:E}){const t=n,l=E,p=e.computed({get:()=>t.modelValue,set:y=>l("update:modelValue",y)}),v=e.ref(null),u=e.computed(()=>{const y={};return y.width=typeof t.width=="number"?`${t.width}px`:String(t.width),y.margin="0 auto",y.top=t.top,y});function x(){t.maskClosable&&B()}function B(){p.value&&(p.value=!1,l("close"))}function S(){t.closable&&B()}function w(y){y.key==="Escape"&&S()}return e.watch(()=>t.modelValue,y=>{y?(l("open"),requestAnimationFrame(()=>{var h;return(h=v.value)==null?void 0:h.focus()}),document.addEventListener("keydown",w),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",w),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",w),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",w),document.body.style.overflow=""}),(y,h)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:x}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:v,class:e.normalizeClass(["y-dialog-panel",[n.center?"is-center":""]]),style:e.normalizeStyle(u.value),onKeydown:e.withKeys(e.withModifiers(S,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Yt,[e.renderSlot(y.$slots,"header",{},()=>[e.createElementVNode("div",Pt,e.toDisplayString(n.title),1)],!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:B}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ot,[e.renderSlot(y.$slots,"default",{},void 0,!0)]),y.$slots.footer?(e.openBlock(),e.createElementBlock("div",jt,[e.renderSlot(y.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Wt),[[e.vShow,p.value]])]),_:3})],12,At),[[e.vShow,p.value]])]))}}),Me=ne(Ut,[["__scopeId","data-v-a7acc6dc"]]),qt={class:"ypopover__inner"},Zt=e.defineComponent({__name:"ypopover",props:{trigger:{default:"click"},placement:{default:"bottom"},showArrow:{type:Boolean,default:!0},showPadding:{type:Boolean,default:!0},dark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDelay:{default:0},closeDelay:{default:200},closeOnClickOutside:{type:Boolean,default:!0},closeOnClickContent:{type:Boolean,default:!1},width:{default:"auto"},maxWidth:{default:"300px"},offset:{default:8},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","show","hide","before-show","before-hide"],setup(n,{expose:E,emit:t}){const l=n,p=t,v=e.ref(),u=e.ref(),x=e.ref(),B=e.ref(!1),S=e.ref(),w=e.ref(),y=e.ref({});let h=null,k=null;const z=e.computed(()=>{if(!B.value||!S.value)return{};const A={};l.width!=="auto"&&(A.width=typeof l.width=="number"?`${l.width}px`:l.width),l.maxWidth&&(A.maxWidth=typeof l.maxWidth=="number"?`${l.maxWidth}px`:l.maxWidth);const{top:q,left:m}=K();return A.top=`${q}px`,A.left=`${m}px`,A}),W=e.computed(()=>{if(!l.showArrow)return{};if(Object.keys(y.value).length>0)return y.value;const A={};return l.placement.startsWith("top")||l.placement.startsWith("bottom")?A.left="50%":A.top="50%",A});function K(){var H,J;if(!S.value)return{top:0,left:0};const{width:A,height:q,top:m,left:i}=S.value,o=((H=x.value)==null?void 0:H.offsetWidth)||200,s=((J=x.value)==null?void 0:J.offsetHeight)||100;let d=0,g=0;switch(l.placement){case"top":d=m-s-l.offset,g=i+(A-o)/2;break;case"top-start":d=m-s-l.offset,g=i;break;case"top-end":d=m-s-l.offset,g=i+A-o;break;case"bottom":d=m+q+l.offset,g=i+(A-o)/2;break;case"bottom-start":d=m+q+l.offset,g=i;break;case"bottom-end":d=m+q+l.offset,g=i+A-o;break;case"left":d=m+(q-s)/2,g=i-o-l.offset;break;case"left-start":d=m,g=i-o-l.offset;break;case"left-end":d=m+q-s,g=i-o-l.offset;break;case"right":d=m+(q-s)/2,g=i+A+l.offset;break;case"right-start":d=m,g=i+A+l.offset;break;case"right-end":d=m+q-s,g=i+A+l.offset;break}const V=window.innerWidth,$=window.innerHeight;return g<8&&(g=8),g+o>V-8&&(g=V-o-8),d<8&&(d=8),d+s>$-8&&(d=$-s-8),{top:d,left:g}}function T(){l.disabled||B.value||(U(),l.openDelay>0?h=setTimeout(()=>{Y()},l.openDelay):Y())}function Y(){p("before-show"),B.value=!0,p("update:modelValue",!0),p("show"),e.nextTick(()=>{e.nextTick(()=>{_()})})}function j(){B.value&&(U(),l.closeDelay>0?k=setTimeout(()=>{X()},l.closeDelay):X())}function X(){p("before-hide"),B.value=!1,p("update:modelValue",!1),p("hide")}function U(){h&&(clearTimeout(h),h=null),k&&(clearTimeout(k),k=null)}function L(){if(!l.showArrow||!S.value||!x.value){y.value={};return}const A=S.value,q=x.value.getBoundingClientRect();if(q.width===0||q.height===0){const i={};l.placement.startsWith("top")||l.placement.startsWith("bottom")?i.left="50%":i.top="50%",y.value=i;return}const m={};if(l.placement.startsWith("top")){m.bottom="-6px";const i=A.left+A.width/2,o=q.left,s=i-o;m.left=`${Math.max(12,Math.min(s,q.width-12))}px`}else if(l.placement.startsWith("bottom")){m.top="-6px";const i=A.left+A.width/2,o=q.left,s=i-o;m.left=`${Math.max(12,Math.min(s,q.width-12))}px`}else if(l.placement.startsWith("left")){m.right="-6px";const i=A.top+A.height/2,o=q.top,s=i-o;m.top=`${Math.max(12,Math.min(s,q.height-12))}px`}else if(l.placement.startsWith("right")){m.left="-6px";const i=A.top+A.height/2,o=q.top,s=i-o;m.top=`${Math.max(12,Math.min(s,q.height-12))}px`}y.value=m}function _(){u.value&&(S.value=u.value.getBoundingClientRect(),x.value&&(w.value=x.value.getBoundingClientRect(),L(),B.value&&requestAnimationFrame(()=>{x.value&&(w.value=x.value.getBoundingClientRect(),L())})))}function M(){l.disabled||l.trigger==="click"&&(B.value?j():T())}function R(){l.disabled||l.trigger!=="hover"||(U(),T())}function Q(){l.disabled||l.trigger!=="hover"||j()}function P(){l.disabled||l.trigger!=="hover"||U()}function G(){l.disabled||l.trigger!=="hover"||j()}function le(A){if(!l.closeOnClickOutside||!B.value)return;const q=A.target;v.value&&!v.value.contains(q)&&x.value&&!x.value.contains(q)&&j()}return e.watch(()=>l.modelValue,A=>{A!==B.value&&(A?T():j())}),e.watch(B,A=>{A?(document.addEventListener("click",le),window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),e.nextTick(()=>{_(),requestAnimationFrame(()=>{_()}),setTimeout(()=>{_()},0)})):(document.removeEventListener("click",le),window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0))}),e.onMounted(()=>{l.modelValue&&T()}),e.onUnmounted(()=>{U(),document.removeEventListener("click",le),window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}),E({show:T,hide:j,updatePosition:_}),(A,q)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:v},[e.createElementVNode("div",{ref_key:"triggerRef",ref:u,onClick:M,onMouseenter:R,onMouseleave:Q},[e.renderSlot(A.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:x,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${n.placement}`,{"ypopover__content--dark":n.dark,"ypopover__content--no-padding":!n.showPadding}]]),style:e.normalizeStyle(z.value),onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:P,onMouseleave:G},[n.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${n.placement}`]),style:e.normalizeStyle(W.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",qt,[e.renderSlot(A.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),ze=ne(Zt,[["__scopeId","data-v-be755399"]]),Qt={class:"relative"},Jt=["value","placeholder"],Xt={class:"nh-time-suffix"},Gt={class:"nh-time-shortcuts"},en={class:"nh-time-shortcuts-list"},tn=["onClick","onKeydown","onMouseenter"],nn={class:"nh-time-custom"},ln={class:"nh-time-custom-header"},on={class:"nh-time-selection-status"},an={key:0,class:"status-text"},sn={key:1,class:"status-text"},rn={key:2,class:"status-text status-complete"},cn={class:"nh-time-pickers"},dn={class:"nh-time-picker"},un={class:"nh-date-picker"},mn={class:"nh-date-picker-header"},fn={class:"nh-date-picker-header-label"},vn={class:"nh-date-picker-content"},hn={class:"nh-date-table"},pn=["onClick"],yn={class:"nh-date-table-cell"},gn={key:0},kn={class:"nh-time-picker"},wn={class:"nh-date-picker"},bn={class:"nh-date-picker-header"},En={class:"nh-date-picker-header-label"},Bn={class:"nh-date-picker-content"},Cn={class:"nh-date-table"},xn=["onClick"],Vn={class:"nh-date-table-cell"},Nn={key:0},Dn={class:"nh-time-actions"},Sn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const n=new Date,E=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:E,endDate:t}}},{label:"昨天",getValue:()=>{const n=new Date;n.setDate(n.getDate()-1);const E=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:E,endDate:t}}},{label:"近7天",getValue:()=>{const n=new Date,E=new Date;return E.setDate(E.getDate()-6),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}},{label:"近30天",getValue:()=>{const n=new Date,E=new Date;return E.setDate(E.getDate()-29),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}},{label:"近3个月",getValue:()=>{const n=new Date,E=new Date;return E.setMonth(E.getMonth()-3),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(!1),v=e.ref(-1),u=e.ref(-1),x=e.ref(null),B=e.ref(),S=e.ref(),w=e.ref({top:!0,left:!0}),y=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),h=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),k=()=>{const r=new Date(y.value.year,y.value.month).getTime(),f=new Date(h.value.year,h.value.month).getTime();if(r>=f){const N=new Date(y.value.year,y.value.month+1);h.value.year=N.getFullYear(),h.value.month=N.getMonth()}},z=()=>{const r=new Date(y.value.year,y.value.month).getTime();if(new Date(h.value.year,h.value.month).getTime()<=r){const N=new Date(h.value.year,h.value.month-1);y.value.year=N.getFullYear(),y.value.month=N.getMonth()}},W=["一","二","三","四","五","六","日"],K=e.ref(null),T=e.ref(null),Y=r=>{if(!r)return null;if(r instanceof Date)return r;if(typeof r=="number")return new Date(r);if(typeof r=="string"){const f=new Date(r);return isNaN(f.getTime())?null:f}return null},j=r=>{if(!r)return null;const f=r.getFullYear(),N=String(r.getMonth()+1).padStart(2,"0"),F=String(r.getDate()).padStart(2,"0");if(t.includeTime){const a=String(r.getHours()).padStart(2,"0"),c=String(r.getMinutes()).padStart(2,"0"),b=String(r.getSeconds()).padStart(2,"0");return`${f}-${N}-${F} ${a}:${c}:${b}`}else return`${f}-${N}-${F}`},X=r=>r?r.getTime():null,U=r=>r?{startDate:Y(r.startDate),endDate:Y(r.endDate)}:{startDate:null,endDate:null},L=r=>t.format==="string"?{startDate:j(r.startDate),endDate:j(r.endDate)}:t.format==="timestamp"?{startDate:X(r.startDate),endDate:X(r.endDate)}:r,_=(r,f)=>`${String(f+1).padStart(2,"0")}/${r}`,M=(r,f)=>r.getFullYear()===f.getFullYear()&&r.getMonth()===f.getMonth()&&r.getDate()===f.getDate(),R=(r,f,N)=>!f||!N?!1:r>=f&&r<=N,Q=r=>{const f=U(r);if(!(f!=null&&f.startDate)||!(f!=null&&f.endDate))return-1;for(let N=0;N<t.shortcuts.length;N++){const F=t.shortcuts[N].getValue();if(F.startDate&&F.endDate&&f.startDate&&f.endDate){const a=new Date(f.startDate.getFullYear(),f.startDate.getMonth(),f.startDate.getDate()),c=new Date(f.endDate.getFullYear(),f.endDate.getMonth(),f.endDate.getDate()),b=new Date(F.startDate.getFullYear(),F.startDate.getMonth(),F.startDate.getDate()),C=new Date(F.endDate.getFullYear(),F.endDate.getMonth(),F.endDate.getDate());if(a.getTime()===b.getTime()&&c.getTime()===C.getTime())return N}}return-1},P=(r,f)=>{const N=new Date(r,f,1),F=new Date(r,f+1,0),a=N.getDay(),c=F.getDate(),b=[],C=new Date,D=a===0?6:a-1,I=new Date(r,f,0);for(let Z=D-1;Z>=0;Z--){const oe=new Date(r,f-1,I.getDate()-Z);b.push({date:oe,day:oe.getDate(),isCurrentMonth:!1,isToday:M(oe,C),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let Z=1;Z<=c;Z++){const oe=new Date(r,f,Z);b.push({date:oe,day:Z,isCurrentMonth:!0,isToday:M(oe,C),isSelected:!1,isInRange:!1,isDisabled:!1})}const O=42-b.length;for(let Z=1;Z<=O;Z++){const oe=new Date(r,f+1,Z);b.push({date:oe,day:Z,isCurrentMonth:!1,isToday:M(oe,C),isSelected:!1,isInRange:!1,isDisabled:!0})}const ee=[];for(let Z=0;Z<b.length;Z+=7)ee.push(b.slice(Z,Z+7));return ee},G=r=>{const f=L(r);l("update:modelValue",f),l("change",f)},le=()=>{if(!B.value||!S.value)return;const r=B.value.getBoundingClientRect(),f=S.value.getBoundingClientRect(),N=window.innerWidth,a=window.innerHeight-r.bottom,c=r.top,b=f.height||400;a<b&&c>b?w.value.top=!1:w.value.top=!0;const C=N-r.left,D=f.width||640;C<D?w.value.left=!1:w.value.left=!0},A=()=>{if(p.value=!p.value,p.value){const r=U(t.modelValue);if(K.value=(r==null?void 0:r.startDate)||null,T.value=(r==null?void 0:r.endDate)||null,u.value=Q(t.modelValue),v.value=-1,r!=null&&r.startDate&&(y.value.year=r.startDate.getFullYear(),y.value.month=r.startDate.getMonth()),r!=null&&r.endDate)h.value.year=r.endDate.getFullYear(),h.value.month=r.endDate.getMonth();else{const f=new Date(y.value.year,y.value.month+1);h.value.year=f.getFullYear(),h.value.month=f.getMonth()}k(),e.nextTick(()=>{le()})}},q=r=>{const f=r.target,N=B.value,F=S.value;N&&F&&!N.contains(f)&&!F.contains(f)&&(p.value=!1,v.value=-1)},m=r=>{r.key==="Enter"||r.key===" "?(r.preventDefault(),A()):r.key==="ArrowDown"&&(r.preventDefault(),p.value=!0,e.nextTick(()=>{le(),g()}))},i=r=>{var f;r.key==="Escape"&&(p.value=!1,v.value=-1,(f=B.value)==null||f.focus())},o=(r,f)=>{r.key==="ArrowDown"?(r.preventDefault(),v.value=Math.min(f+1,t.shortcuts.length-1),V(v.value)):r.key==="ArrowUp"?(r.preventDefault(),v.value=Math.max(f-1,0),V(v.value)):(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),$(t.shortcuts[f]))},s=r=>{v.value=r},d=()=>{v.value=-1},g=()=>{v.value=0,V(0)},V=r=>{if(S.value){const N=S.value.querySelectorAll(".nh-time-shortcut")[r];N&&N.focus()}},$=r=>{const f=r.getValue();t.includeTime&&f.startDate&&f.endDate&&(f.startDate.setHours(0,0,0,0),f.endDate.setHours(23,59,59,999)),G(f),u.value=t.shortcuts.findIndex(N=>N.label===r.label),v.value=-1,p.value=!1},H=(r,f)=>{if(!r||r.isDisabled)return;let N;if(t.includeTime?(N=new Date(r.date),f==="start"||!K.value?N.setHours(0,0,0,0):N.setHours(23,59,59,999)):N=new Date(r.date.getFullYear(),r.date.getMonth(),r.date.getDate()),!K.value&&!T.value)K.value=N,T.value=null;else if(K.value&&!T.value)if(N>=K.value)t.includeTime&&N.setHours(23,59,59,999),T.value=N;else{const F=K.value;t.includeTime&&F.setHours(23,59,59,999),T.value=F,K.value=N}else K.value=N,T.value=null;if(u.value=-1,K.value&&T.value){const F=new Date(T.value);t.includeTime&&F.setHours(23,59,59,999),x.value={startDate:K.value,endDate:F}}else x.value=null},J=(r,f)=>{if(!r)return["nh-date-table-td"];const N=["nh-date-table-td"];return r.isCurrentMonth||N.push("is-prev-month"),r.isToday&&N.push("is-today"),r.isDisabled&&N.push("is-disabled"),K.value&&M(r.date,K.value)&&N.push("is-selected","is-start"),T.value&&M(r.date,T.value)&&N.push("is-selected","is-end"),K.value&&T.value&&R(r.date,K.value,T.value)&&N.push("is-in-range"),N},te=()=>{x.value&&(t.includeTime&&x.value.endDate&&x.value.endDate.setHours(23,59,59,999),G(x.value),u.value=Q(x.value),p.value=!1)},ae=()=>{G({startDate:null,endDate:null}),ve(),v.value=-1,p.value=!1},ue=()=>{p.value&&e.nextTick(()=>{le()})},we=e.computed(()=>P(y.value.year,y.value.month)),ce=e.computed(()=>P(h.value.year,h.value.month)),re=e.computed(()=>{const r=U(t.modelValue);if(!r||!r.startDate||!r.endDate)return"";const f=a=>{const c=String(a.getFullYear()),b=String(a.getMonth()+1).padStart(2,"0"),C=String(a.getDate()).padStart(2,"0");return`${c}/${b}/${C}`},N=f(r.startDate),F=f(r.endDate);return!t.includeTime&&N===F?N:`${N} - ${F}`}),ie=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!w.value.top,"nh-time-dropdown-right":!w.value.left}]),me=e.computed(()=>{const r=U(t.modelValue);return!!(r!=null&&r.startDate&&(r!=null&&r.endDate))}),fe=e.computed(()=>!!(K.value&&T.value)),ve=()=>{K.value=null,T.value=null,x.value=null,u.value=-1};e.watch(()=>t.modelValue,r=>{const f=U(r);if(f!=null&&f.startDate){const N=f.startDate;y.value.year=N.getFullYear(),y.value.month=N.getMonth()}if(f!=null&&f.endDate){const N=f.endDate;h.value.year=N.getFullYear(),h.value.month=N.getMonth()}else if(f!=null&&f.startDate){const N=new Date(y.value.year,y.value.month+1);h.value.year=N.getFullYear(),h.value.month=N.getMonth()}(f!=null&&f.startDate||f!=null&&f.endDate)&&k(),p.value||(u.value=Q(r))},{immediate:!0,deep:!0}),e.watch([y,h],()=>{const r=new Date(y.value.year,y.value.month).getTime(),f=new Date(h.value.year,h.value.month).getTime();if(r===f){const N=new Date(y.value.year,y.value.month+1);h.value.year=N.getFullYear(),h.value.month=N.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",q),window.addEventListener("resize",ue),window.addEventListener("scroll",ue),u.value=Q(t.modelValue);const r=U(t.modelValue);if(r!=null&&r.startDate&&(y.value.year=r.startDate.getFullYear(),y.value.month=r.startDate.getMonth()),r!=null&&r.endDate)h.value.year=r.endDate.getFullYear(),h.value.month=r.endDate.getMonth();else{const f=new Date(y.value.year,y.value.month+1);h.value.year=f.getFullYear(),h.value.month=f.getMonth()}k()}),e.onUnmounted(()=>{document.removeEventListener("click",q),window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue)});const ye=()=>{t.clearable&&(G({startDate:null,endDate:null}),ve(),v.value=-1)},de=(r,f)=>{if(r==="start"){const N=new Date(y.value.year,y.value.month+f,1);y.value.year=N.getFullYear(),y.value.month=N.getMonth(),k()}else{const N=new Date(h.value.year,h.value.month+f,1);h.value.year=N.getFullYear(),h.value.month=N.getMonth(),z()}};return(r,f)=>{const N=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${n.size}`]])},[e.createElementVNode("div",Qt,[e.createElementVNode("div",{ref_key:"trigger",ref:B,onClick:A,onKeydown:m,class:e.normalizeClass(["nh-time-trigger",{"is-focus":p.value,"has-value":me.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:re.value,placeholder:n.placeholder,class:"nh-time-input"},null,8,Jt),e.createElementVNode("span",Xt,[n.clearable&&me.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(ye,["stop"]),class:"nh-time-clear"},[...f[4]||(f[4]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1 1.9-11.2c1.5-1.2 3.3-1.9 5.2-1.9l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130.1 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0),f[6]||(f[6]=e.createElementVNode("i",{class:"nh-time-icon"},[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648 248v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h112v120H152V248h112v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h312zm184 584H192V424h640v408z",fill:"currentColor"})])],-1)),e.createElementVNode("i",{class:e.normalizeClass(["nh-time-arrow",{"is-reverse":p.value}])},[...f[5]||(f[5]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z",fill:"currentColor"})],-1)])],2)])],34),e.createVNode(e.Transition,{name:"el-zoom-in-top"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:S,class:e.normalizeClass(ie.value),onKeydown:i},[e.createElementVNode("div",Gt,[f[7]||(f[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",en,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.shortcuts,(F,a)=>(e.openBlock(),e.createElementBlock("li",{key:F.label,onClick:c=>$(F),onKeydown:c=>o(c,a),onMouseenter:c=>s(a),onMouseleave:d,class:e.normalizeClass(["nh-time-shortcut",{"is-active":v.value===a,"is-selected":u.value===a}]),tabindex:"0"},e.toDisplayString(F.label),43,tn))),128))])]),e.createElementVNode("div",nn,[e.createElementVNode("div",ln,[f[8]||(f[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",on,[!K.value&&!T.value?(e.openBlock(),e.createElementBlock("span",an," 请选择开始日期 ")):K.value&&!T.value?(e.openBlock(),e.createElementBlock("span",sn," 请选择结束日期 ")):K.value&&T.value?(e.openBlock(),e.createElementBlock("span",rn," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",cn,[e.createElementVNode("div",dn,[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[e.createElementVNode("button",{onClick:f[0]||(f[0]=F=>de("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...f[9]||(f[9]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",fn,e.toDisplayString(_(y.value.year,y.value.month)),1),e.createElementVNode("button",{onClick:f[1]||(f[1]=F=>de("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...f[10]||(f[10]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",vn,[e.createElementVNode("table",hn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,F=>e.createElementVNode("th",{key:F,class:"nh-date-table-th"},e.toDisplayString(F),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(F,a)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${a}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(c,b)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${a}-${b}`,class:e.normalizeClass(J(c)),onClick:C=>H(c,"start")},[e.createElementVNode("div",yn,[c?(e.openBlock(),e.createElementBlock("span",gn,e.toDisplayString(c.day),1)):e.createCommentVNode("",!0)])],10,pn))),128))]))),128))])])])])]),e.createElementVNode("div",kn,[e.createElementVNode("div",wn,[e.createElementVNode("div",bn,[e.createElementVNode("button",{onClick:f[2]||(f[2]=F=>de("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...f[11]||(f[11]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",En,e.toDisplayString(_(h.value.year,h.value.month)),1),e.createElementVNode("button",{onClick:f[3]||(f[3]=F=>de("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...f[12]||(f[12]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",Bn,[e.createElementVNode("table",Cn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,F=>e.createElementVNode("th",{key:F,class:"nh-date-table-th"},e.toDisplayString(F),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(F,a)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${a}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(c,b)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${a}-${b}`,class:e.normalizeClass(J(c)),onClick:C=>H(c,"end")},[e.createElementVNode("div",Vn,[c?(e.openBlock(),e.createElementBlock("span",Nn,e.toDisplayString(c.day),1)):e.createCommentVNode("",!0)])],10,xn))),128))]))),128))])])])])])]),e.createElementVNode("div",Dn,[n.clearable?(e.openBlock(),e.createBlock(N,{key:0,onClick:ae,variant:"secondary",size:n.size},{default:e.withCtx(()=>[...f[13]||(f[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(N,{onClick:te,disabled:!fe.value,variant:"primary",size:n.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value&&!T.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),xe=ne(Sn,[["__scopeId","data-v-e5ef63b1"]]),$n=["aria-checked","aria-disabled","disabled","onKeydown"],_n={class:"yswitch__thumb"},Mn={key:0,class:"yswitch__spinner","aria-hidden":"true"},zn=e.defineComponent({__name:"yswitch",props:{modelValue:{default:!1},trueValue:{default:!0},falseValue:{default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"medium"},activeColor:{default:"#10b981"},inactiveColor:{default:"#e5e7eb"},activeText:{default:"开"},inactiveText:{default:"关"},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(),v=e.computed(()=>t.modelValue===t.trueValue),u=e.computed(()=>{const B={};return B.background=v.value?t.activeColor:t.inactiveColor,B});function x(){if(t.disabled||t.loading)return;const B=v.value?t.falseValue:t.trueValue;l("update:modelValue",B),l("change",B)}return e.onMounted(()=>{const B=p.value;B&&(B.addEventListener("focus",S=>l("focus",S)),B.addEventListener("blur",S=>l("blur",S)))}),(B,S)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:p,class:e.normalizeClass(["yswitch",[`yswitch--${n.size}`,{"yswitch--checked":v.value,"yswitch--disabled":n.disabled,"yswitch--loading":n.loading}]]),style:e.normalizeStyle(u.value),role:"switch","aria-checked":v.value,"aria-disabled":n.disabled,disabled:n.disabled||n.loading,onClick:x,onKeydown:[e.withKeys(e.withModifiers(x,["prevent"]),["enter"]),e.withKeys(e.withModifiers(x,["prevent"]),["space"])]},[S[0]||(S[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",_n,[n.loading?(e.openBlock(),e.createElementBlock("span",Mn)):e.createCommentVNode("",!0)]),n.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!v.value,"yswitch__label--right":v.value}])},e.toDisplayString(v.value?n.activeText:n.inactiveText),3)):e.createCommentVNode("",!0)],46,$n))}}),Le=ne(zn,[["__scopeId","data-v-0b157fc4"]]),Ln=["src","alt"],Tn=["src","alt"],In=e.defineComponent({__name:"yimage",props:{src:{},alt:{default:""},width:{},height:{},lazy:{type:Boolean,default:!0},preview:{type:Boolean,default:!0},fit:{default:"cover"},radius:{default:"0"},className:{default:""},previewSrcList:{}},emits:["load","error","preview"],setup(n,{expose:E,emit:t}){const l=n,p=t,v=e.ref(),u=e.ref(),x=e.ref(),B=e.ref(!1),S=e.ref(!1),w=e.ref(!1),y=e.ref(!1),h=e.ref(!1),k=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),z=e.ref(""),W=e.ref(1),K=e.ref(!1),T=e.ref({overflow:"",paddingRight:""}),Y={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},j=e.computed(()=>l.className||""),X=e.computed(()=>{if(typeof l.radius=="number")return`${l.radius}px`;if(typeof l.radius=="string"){if(/(px|%|rem|em)$/.test(l.radius))return l.radius;if(Y[l.radius])return Y[l.radius]}return""}),U=e.computed(()=>X.value?{borderRadius:X.value}:{}),L=e.computed(()=>["yimage-image",l.preview?"is-previewable":""].filter(Boolean).join(" ")),_=e.computed(()=>{const $={objectFit:l.fit||"cover",backgroundColor:"#fff"};return l.width&&($.width=typeof l.width=="number"?`${l.width}px`:l.width),l.height&&($.height=typeof l.height=="number"?`${l.height}px`:l.height),X.value&&($.borderRadius=X.value),$}),M=e.computed(()=>z.value?z.value:Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),R=()=>{const $=document.createElement("div");$.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild($);const H=$.offsetWidth-$.clientWidth;return document.body.removeChild($),H},Q=()=>{if(T.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const H=R();document.body.style.paddingRight=`${H}px`}document.body.style.overflow="hidden"},P=()=>{document.body.style.overflow=T.value.overflow,document.body.style.paddingRight=T.value.paddingRight};let G=null;const le=()=>{!l.lazy||!v.value||(G=new IntersectionObserver($=>{$.forEach(H=>{H.isIntersecting&&(y.value=!0,k.value=l.src,G==null||G.unobserve(H.target))})},{rootMargin:"50px"}),G.observe(v.value))},A=$=>{B.value=!0,S.value=!1,w.value=!1,p("load",$)},q=$=>{w.value=!0,S.value=!1,B.value=!1,p("error",$)},m=()=>{w.value=!1,S.value=!0,B.value=!1,e.nextTick(()=>{u.value&&(u.value.src=l.src)})},i=()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src,o=()=>{l.preview&&(l.previewSrcList||l.src)?s():m()},s=()=>{if(!l.preview)return;W.value=1;const $=i();if(u.value&&u.value.complete&&u.value.naturalWidth>0){z.value=$,e.nextTick(()=>{h.value=!0,Q(),p("preview",$)});return}const H=new Image;let J=null,te=!1;const ae=()=>{te||(te=!0,J&&(clearTimeout(J),J=null),z.value=$,e.nextTick(()=>{h.value=!0,Q(),p("preview",$)}))};J=setTimeout(()=>{ae()},500),H.onload=()=>{ae()},H.onerror=()=>{ae()},H.src=$,H.complete&&ae()},d=()=>{h.value=!1,setTimeout(()=>{P()},300)},g=$=>{const H=$.deltaY<0?1:-1;let te=W.value+H*.1;te=Math.max(.5,Math.min(2,te)),W.value=te};e.onMounted(()=>{l.lazy?le():y.value=!0,y.value&&(S.value=!0),K.value=!0}),e.onUnmounted(()=>{G&&G.disconnect(),h.value&&P()});const V=()=>{l.src&&y.value&&(S.value=!0,w.value=!1,B.value=!1)};return e.watch(()=>k.value,V),e.watch(()=>l.src,$=>{k.value=$||""}),E({retryLoad:m,closePreview:d}),($,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:v,class:e.normalizeClass(["yimage-container",j.value])},[!B.value&&!w.value&&!y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(U.value)},[...H[1]||(H[1]=[e.createElementVNode("div",{class:"yimage-placeholder-content"},[e.createElementVNode("svg",{class:"yimage-placeholder-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)])],4)):e.createCommentVNode("",!0),S.value&&!w.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(U.value)},[...H[2]||(H[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(U.value),onClick:o},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:"yimage-error-image",style:e.normalizeStyle(U.value)},null,4)],4)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:u,src:k.value,alt:n.alt,class:e.normalizeClass(L.value),onLoad:A,onError:q,onClick:e.withModifiers(s,["stop"]),style:e.normalizeStyle(_.value)},null,46,Ln),[[e.vShow,B.value&&!w.value]]),l.preview&&(!B.value||S.value||w.value||!y.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(s,["stop"])})):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(d,["self"]),onWheel:e.withModifiers(g,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":h.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:x,src:M.value,alt:n.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${W.value})`}),onClick:H[0]||(H[0]=e.withModifiers(()=>{},["stop"]))},null,12,Tn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),Te=ne(In,[["__scopeId","data-v-c1a55c52"]]),Kn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(n){const E=n,t=e.ref(!1),l=e.ref();let p=null;const v=e.computed(()=>`y-dropdown__menu--${E.placement}`),u=e.computed(()=>{if(!E.menuWidth)return{};const h=typeof E.menuWidth=="number"?`${E.menuWidth}px`:E.menuWidth;return{width:h,minWidth:h,maxWidth:h}}),x=()=>{console.log("显示下拉菜单",t.value),!E.disabled&&(p&&(clearTimeout(p),p=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{S()}))},B=()=>{console.log("隐藏下拉菜单"),p=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},S=()=>{if(!l.value)return;const h=l.value.querySelector(".y-dropdown__trigger"),k=l.value.querySelector(".y-dropdown__menu");if(!h||!k)return;const z=h.getBoundingClientRect(),W=k.getBoundingClientRect(),K=window.innerWidth,T=window.innerHeight;k.style.top="",k.style.left="",k.style.right="",k.style.bottom="",k.style.transform="";let Y=0,j=0;switch(E.placement){case"bottom":Y=z.height+4,j=0;break;case"top":Y=-(W.height+4),j=0;break;case"right":Y=0,j=z.width+4;break;case"left":Y=0,j=-(W.width+4);break}let X=z.top+Y,U=z.left+j;if(E.placement==="bottom"||E.placement==="top"){const L=W.width||260;U+L>K-10&&(U=K-L-10),U<10&&(U=10)}if(E.placement==="left"||E.placement==="right"){const L=W.height||200;X+L>T-10&&(X=T-L-10),X<10&&(X=10)}k.style.top=`${X}px`,k.style.left=`${U}px`},w=h=>{E.trigger==="click"&&l.value&&!l.value.contains(h.target)&&(t.value=!1)},y=()=>{t.value&&S()};return e.onMounted(()=>{E.trigger==="click"&&document.addEventListener("click",w),window.addEventListener("resize",y),window.addEventListener("scroll",y)}),e.onUnmounted(()=>{E.trigger==="click"&&document.removeEventListener("click",w),p&&clearTimeout(p),window.removeEventListener("resize",y),window.removeEventListener("scroll",y)}),e.watch(()=>E.menuWidth,()=>{t.value&&e.nextTick(()=>{S()})}),(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:l},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:x,onMouseleave:B},[e.renderSlot(h.$slots,"trigger",{},()=>[k[0]||(k[0]=e.createElementVNode("button",{class:"y-dropdown__button"}," 下拉菜单 ",-1))],!0)],32),e.createVNode(e.Transition,{name:"dropdown-fade",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-dropdown__menu",v.value]),style:e.normalizeStyle(u.value),onMouseenter:x,onMouseleave:B},[e.renderSlot(h.$slots,"default",{},()=>[k[1]||(k[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),k[2]||(k[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),k[3]||(k[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),Ie=ne(Kn,[["__scopeId","data-v-ada3172a"]]),Hn=["aria-hidden"],Fn=["onKeydown"],Rn={key:0,class:"y-drawer-header"},An={class:"y-drawer-title"},Wn={class:"y-drawer-body"},Yn={key:1,class:"y-drawer-footer"},Pn=e.defineComponent({__name:"ydrawer",props:{modelValue:{type:Boolean,default:!1},placement:{default:"right"},width:{default:"420px"},height:{default:"60vh"},title:{default:""},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:3e3},showHeader:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(n,{emit:E}){const t=n,l=E,p=e.computed({get:()=>t.modelValue,set:k=>l("update:modelValue",k)}),v=e.ref(null),u=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),x=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),B=e.computed(()=>{const k={};return t.placement==="right"?(k.width=typeof t.width=="number"?`${t.width}px`:String(t.width),k.height="100%",k.right="0",k.top="0"):(k.height=typeof t.height=="number"?`${t.height}px`:String(t.height),k.width="100%",k.bottom="0",k.left="0"),k});function S(){t.maskClosable&&w()}function w(){p.value&&(p.value=!1,l("close"))}function y(){t.closable&&w()}function h(k){k.key==="Escape"&&y()}return e.watch(()=>t.modelValue,k=>{k?(l("open"),requestAnimationFrame(()=>{var z;return(z=v.value)==null?void 0:z.focus()}),document.addEventListener("keydown",h),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",h),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",h),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",h),document.body.style.overflow=""}),(k,z)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:S}),e.createVNode(e.Transition,{name:u.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:v,class:e.normalizeClass(["y-drawer-panel",[`is-${n.placement}`,x.value]]),style:e.normalizeStyle(B.value),onKeydown:e.withKeys(e.withModifiers(y,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",An,e.toDisplayString(n.title),1),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:w}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wn,[e.renderSlot(k.$slots,"default",{},void 0,!0)]),k.$slots.footer?(e.openBlock(),e.createElementBlock("div",Yn,[e.renderSlot(k.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Fn),[[e.vShow,p.value]])]),_:3},8,["name"])],12,Hn),[[e.vShow,p.value]])]))}}),Ke=ne(Pn,[["__scopeId","data-v-b2797950"]]),On={class:"ytree__container"},jn=["data-level","onClick","onContextmenu"],Un=["onClick"],qn={key:1,class:"w-[16px]"},Zn=["onClick"],Qn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Jn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Xn=["src","alt"],Gn={class:"ytree-node__custom-content"},el={key:0,class:"ytree-node__children"},tl=["data-level","onClick","onContextmenu"],nl=["onClick"],ll={key:1,class:"w-[16px]"},ol=["onClick"],al={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},sl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},rl=["src","alt"],il={class:"ytree-node__custom-content"},cl={key:0,class:"ytree-node__children"},dl=["data-level","onClick","onContextmenu"],ul=["onClick"],ml={key:1,class:"w-[16px]"},fl=["onClick"],vl={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},hl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},pl=["src","alt"],yl={class:"ytree-node__custom-content"},gl={key:0,class:"ytree-node__children"},kl=["data-level","onClick","onContextmenu"],wl=["onClick"],bl={key:1,class:"w-[16px]"},El=["onClick"],Bl={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Cl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},xl=["src","alt"],Vl={class:"ytree-node__custom-content"},Nl={key:0,class:"ytree-node__children"},Dl=["data-level","onClick","onContextmenu"],Sl=["onClick"],$l={key:1,class:"w-[16px]"},_l=["onClick"],Ml={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},zl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Ll=["src","alt"],Tl={class:"ytree-node__custom-content"},Il="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",Kl="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",Hl=e.defineComponent({__name:"ytree",props:{data:{default:()=>[]},emptyText:{default:"暂无数据"},nodeKey:{default:"id"},props:{default:()=>({children:"children",label:"label",disabled:"disabled",isLeaf:"isLeaf"})},renderAfterExpand:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!1},defaultExpandedKeys:{default:()=>[]},defaultCheckedKeys:{default:()=>[]},defaultSelectedKeys:{default:()=>[]},checkStrictly:{type:Boolean,default:!1},checkOnClickNode:{type:Boolean,default:!1},checkDescendants:{type:Boolean,default:!0},autoExpandParent:{type:Boolean,default:!0},defaultChecked:{type:Boolean,default:!1},filterNodeMethod:{},lazy:{type:Boolean,default:!1},load:{},renderContent:{},highlightCurrent:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0},currentNodeKey:{},accordion:{type:Boolean,default:!1},indent:{default:18},iconClass:{default:""},showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:{},allowDrop:{},size:{default:"medium"},disabled:{type:Boolean,default:!1},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},enableFourthLevelSpecialHandling:{type:Boolean,default:!1},restrictAutoExpandFromLevel:{default:void 0},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1}},emits:["node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop","checked-keys-change","child-node-click"],setup(n,{expose:E,emit:t}){const l=n,p=t,v=e.computed(()=>(console.log("ytree 组件接收到的数据:",l.data),l.data||[])),u=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set});e.provide("treeStore",u);const x=e.computed(()=>l.restrictAutoExpandFromLevel&&l.restrictAutoExpandFromLevel>0?l.restrictAutoExpandFromLevel:void 0);function B(m){return m[l.nodeKey]||m.id||Math.random()}function S(m){var i;return((i=l.props)!=null&&i.label?m[l.props.label]:void 0)||m.label||""}function w(m){var i;return!!((i=m==null?void 0:m.data)!=null&&i.isEmployee)}function y(m,i){var V;const o=l.deptIconUrl||Il,s=l.personIconUrl||Kl,d=l.buttonIconUrl||"",g=l.childStyleIconUrl||"";return i&&g&&W(m,i)?g:(V=m==null?void 0:m.data)!=null&&V.isButton&&d?d:w(m)?s:o}function h(m){var o;const i=((o=l.props)!=null&&o.children?m[l.props.children]:void 0)||m.children;return i&&i.length>0}function k(m){var i;return((i=l.props)!=null&&i.children?m[l.props.children]:void 0)||m.children||[]}function z(m,i,o=1){if(m===i)return o;const s=k(m);for(const d of s){const g=z(d,i,o+1);if(g>0)return g}return 0}function W(m,i){return!l.childStyleLevel||l.childStyleLevel<1?!1:z(i,m)===l.childStyleLevel}function K(m){const i=B(m);return u.value.expandedKeys.has(i)}function T(m){const i=B(m);if(u.value.checkedKeys.has(i)){if(h(m)){const s=k(m),d=s.filter(V=>T(V)),g=s.filter(V=>Y(V));return d.length===s.length&&g.length===0}return!0}if(h(m)){const s=k(m);return s.some(g=>Y(g))?!1:s.length>0&&s.every(g=>T(g))}return!1}function Y(m){if(!h(m))return!1;const i=k(m),o=i.filter(d=>T(d)),s=i.filter(d=>Y(d));return o.length===i.length?!1:o.length>0||s.length>0}function j(m){const i=B(m);return u.value.currentKey===i}function X(m){const i=B(m);return u.value.highlightedKeys.has(i)}function U(m){if(l.disabled)return;const i=B(m),s=!u.value.checkedKeys.has(i),d=new Set(u.value.expandedKeys);s?u.value.checkedKeys.add(i):u.value.checkedKeys.delete(i);function g(V,$){V.forEach(H=>{const J=B(H);$?u.value.checkedKeys.add(J):u.value.checkedKeys.delete(J),h(H)&&g(k(H),$)})}g(k(m),s),s&&L(),M(),u.value.expandedKeys=d,p("check-change",m,s,!1),p("check",m,s,!1),p("checked-keys-change",Array.from(u.value.checkedKeys))}function L(m){x.value&&console.log(`已启用从第${x.value}级开始不默认展开的限制(不主动收起已展开节点)`)}function _(m){const i=B(m);u.value.expandedKeys.has(i)?(u.value.expandedKeys.delete(i),p("node-collapse",m,m,null)):(u.value.expandedKeys.add(i),p("node-expand",m,m,null))}function M(){const m=[];function i(s){s.forEach(d=>{m.push(d),h(d)&&i(k(d))})}i(v.value);function o(s){if(h(s)){const d=k(s),g=B(s),V=d.filter(H=>T(H)),$=d.filter(H=>Y(H));V.length===d.length&&$.length===0||V.length>0||$.length>0?u.value.checkedKeys.add(g):u.value.checkedKeys.delete(g)}}for(let s=m.length-1;s>=0;s--)o(m[s])}function R(m,i,o,s){if(l.disabled)return;const d=s?W(m,s):!1;if(l.enableChildStyleCustomClick&&d){p("child-node-click",m,i,o);return}if(l.expandOnClickNode&&h(m)){_(m);return}u.value.currentNode=m,u.value.currentKey=B(m),l.showCheckbox&&U(m),p("node-click",m,i,o)}function Q(m,i,o,s){l.disabled||p("node-contextmenu",m,i,o,s)}e.watch(()=>l.defaultExpandedKeys,m=>{if(m){const i=x.value;if(i){let o=function(V,$,H=1){for(const J of $){if(B(J)===V)return H;if(h(J)){const te=o(V,k(J),H+1);if(te>0)return te}}return 0},s=function(V,$,H){V.forEach(J=>{$<H&&h(J)?(g.add(B(J)),s(k(J),$+1,H)):$<H&&h(J)})};const d=(m||[]).filter(V=>{const $=o(V,v.value,1);return $>0&&$<i}),g=new Set(d);s(v.value,1,i),u.value.expandedKeys.forEach(V=>{o(V,v.value,1)>=i&&g.add(V)}),u.value.expandedKeys=g}else u.value.expandedKeys=new Set(m)}},{immediate:!0});function P(){if(l.defaultExpandAll){let m=function(s,d=1){s.forEach(g=>{if(!h(g))return;const V=k(g);if(o){if(d>=o)return;d+1===o||i.add(B(g)),m(V,d+1)}else i.add(B(g)),m(V,d+1)})};const i=new Set,o=x.value;m(v.value,1),u.value.expandedKeys=i}}function G(){if(l.defaultCheckedKeys&&l.defaultCheckedKeys.length>0){let m=function(d,g=[]){d.forEach(V=>{const $=B(V),H=[...g,$];i.has($)&&g.forEach(J=>o.add(J)),h(V)&&m(k(V),H)})};const i=new Set(l.defaultCheckedKeys),o=new Set;m(v.value);const s=x.value;if(s){console.log(`已启用从第${s}级开始不默认展开:保持当前展开状态不变`);return}u.value.expandedKeys=o}}e.watch(()=>l.defaultExpandAll,P,{immediate:!0}),e.watch(()=>v.value,P,{deep:!0}),e.watch(()=>l.defaultCheckedKeys,m=>{m?(u.value.checkedKeys=new Set(m),l.enableFourthLevelSpecialHandling?console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态"):G()):u.value.checkedKeys.clear()},{immediate:!0});function le(m){try{let i=function(d,g,V=[]){for(const $ of d){const H=B($),J=[...V,H];if(H===g)return J;if(h($)){const te=i(k($),g,J);if(te)return te}}return null};const o=Array.isArray(m)?m:[];if(o.length===0)return;u.value.highlightedKeys.clear();const s=new Set(u.value.expandedKeys);o.forEach(d=>{const g=i(v.value,d);g&&g.length>0&&(g.slice(0,-1).forEach(V=>s.add(V)),u.value.highlightedKeys.add(g[g.length-1]))}),u.value.expandedKeys=s}catch(i){console.warn("highlightAndExpandByIds 执行失败",i)}}function A(){u.value.highlightedKeys.clear()}function q(){u.value.currentNode=null,u.value.currentKey=null}return E({highlightAndExpandByIds:le,clearHighlights:A,clearCurrentNode:q}),e.watch(()=>l.defaultSelectedKeys,m=>{m&&(u.value.selectedKeys=new Set(m))},{immediate:!0}),(m,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${n.size}`,{"ytree--disabled":n.disabled}]])},[e.createElementVNode("div",On,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,o=>(e.openBlock(),e.createElementBlock("div",{key:B(o),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(o),"ytree-node--highlight":X(o)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(o,o)}]),style:{paddingLeft:"8px"},"data-level":z(o,o),onClick:s=>R(o,o,null,o),onContextmenu:s=>Q(s,o,o,null)},[h(o)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(o)}]),onClick:e.withModifiers(s=>_(o),["stop"])},[...i[0]||(i[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Un)):(e.openBlock(),e.createElementBlock("span",qn)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(o),"is-indeterminate":Y(o)}]),onClick:e.withModifiers(s=>U(o),["stop"])},[T(o)?(e.openBlock(),e.createElementBlock("svg",Qn,[...i[1]||(i[1]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(o)?(e.openBlock(),e.createElementBlock("svg",Jn,[...i[2]||(i[2]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Zn)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:y(o,o),alt:w(o)?"person":"dept"},null,8,Xn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(o)}])},e.toDisplayString(S(o)),3),e.createElementVNode("div",Gn,[e.renderSlot(m.$slots,"node-content",{node:o,isCurrent:j(o),isExpanded:K(o),hasChildren:h(o)},void 0,!0)])],42,jn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[h(o)&&K(o)?(e.openBlock(),e.createElementBlock("div",el,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(o),s=>(e.openBlock(),e.createElementBlock("div",{key:B(s),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(s),"ytree-node--highlight":X(s)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(s,o)}]),style:{paddingLeft:"22px"},"data-level":z(o,s),onClick:d=>R(s,s,null,o),onContextmenu:d=>Q(d,s,s,null)},[h(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(s)}]),onClick:e.withModifiers(d=>_(s),["stop"])},[...i[3]||(i[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,nl)):(e.openBlock(),e.createElementBlock("span",ll)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(s),"is-indeterminate":Y(s)}]),onClick:e.withModifiers(d=>U(s),["stop"])},[T(s)?(e.openBlock(),e.createElementBlock("svg",al,[...i[4]||(i[4]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(s)?(e.openBlock(),e.createElementBlock("svg",sl,[...i[5]||(i[5]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,ol)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:y(s,o),alt:w(s)?"person":"dept"},null,8,rl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(s)}])},e.toDisplayString(S(s)),3),e.createElementVNode("div",il,[e.renderSlot(m.$slots,"node-content",{node:s,isCurrent:j(s),isExpanded:K(s),hasChildren:h(s)},void 0,!0)])],42,tl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[h(s)&&K(s)?(e.openBlock(),e.createElementBlock("div",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(s),d=>(e.openBlock(),e.createElementBlock("div",{key:B(d),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(d),"ytree-node--highlight":X(d)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(d,o)}]),style:{paddingLeft:"38px"},"data-level":z(o,d),onClick:g=>R(d,d,null,o),onContextmenu:g=>Q(g,d,d,null)},[h(d)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(d)}]),onClick:e.withModifiers(g=>_(d),["stop"])},[...i[6]||(i[6]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,ul)):(e.openBlock(),e.createElementBlock("span",ml)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(d),"is-indeterminate":Y(d)}]),onClick:e.withModifiers(g=>U(d),["stop"])},[T(d)?(e.openBlock(),e.createElementBlock("svg",vl,[...i[7]||(i[7]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(d)?(e.openBlock(),e.createElementBlock("svg",hl,[...i[8]||(i[8]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,fl)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:y(d,o),alt:w(d)?"person":"dept"},null,8,pl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(d)}])},e.toDisplayString(S(d)),3),e.createElementVNode("div",yl,[e.renderSlot(m.$slots,"node-content",{node:d,isCurrent:j(d),isExpanded:K(d),hasChildren:h(d)},void 0,!0)])],42,dl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[h(d)&&K(d)?(e.openBlock(),e.createElementBlock("div",gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(d),g=>(e.openBlock(),e.createElementBlock("div",{key:B(g),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(g),"ytree-node--highlight":X(g)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(g,o)}]),style:{paddingLeft:"54px"},"data-level":z(o,g),onClick:V=>R(g,g,null,o),onContextmenu:V=>Q(V,g,g,null)},[h(g)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(g)}]),onClick:e.withModifiers(V=>_(g),["stop"])},[...i[9]||(i[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,wl)):(e.openBlock(),e.createElementBlock("span",bl)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(g),"is-indeterminate":Y(g)}]),onClick:e.withModifiers(V=>U(g),["stop"])},[T(g)?(e.openBlock(),e.createElementBlock("svg",Bl,[...i[10]||(i[10]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(g)?(e.openBlock(),e.createElementBlock("svg",Cl,[...i[11]||(i[11]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,El)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:y(g,o),alt:w(g)?"person":"dept"},null,8,xl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(g)}])},e.toDisplayString(S(g)),3),e.createElementVNode("div",Vl,[e.renderSlot(m.$slots,"node-content",{node:g,isCurrent:j(g),isExpanded:K(g),hasChildren:h(g)},void 0,!0)])],42,kl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[h(g)&&K(g)?(e.openBlock(),e.createElementBlock("div",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(g),V=>(e.openBlock(),e.createElementBlock("div",{key:B(V),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(V)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(V,o)}]),style:{paddingLeft:"70px"},"data-level":z(o,V),onClick:$=>R(V,V,null,o),onContextmenu:$=>Q($,V,V,null)},[h(V)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(V)}]),onClick:e.withModifiers($=>_(V),["stop"])},[...i[12]||(i[12]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Sl)):(e.openBlock(),e.createElementBlock("span",$l)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(V),"is-indeterminate":Y(V)}]),onClick:e.withModifiers($=>U(V),["stop"])},[T(V)?(e.openBlock(),e.createElementBlock("svg",Ml,[...i[13]||(i[13]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(V)?(e.openBlock(),e.createElementBlock("svg",zl,[...i[14]||(i[14]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,_l)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:y(V,o),alt:w(V)?"person":"dept"},null,8,Ll),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(V)}])},e.toDisplayString(S(V)),3),e.createElementVNode("div",Tl,[e.renderSlot(m.$slots,"node-content",{node:V,isCurrent:j(V),isExpanded:K(V),hasChildren:h(V)},void 0,!0)])],42,Dl)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])],2))}}),He=ne(Hl,[["__scopeId","data-v-6ab410ed"]]),Fl={class:"query-encapsulation"},Rl={class:"query-encapsulation__container"},Al={class:"query-encapsulation__content"},Wl={class:"query-encapsulation__fields"},Yl={class:"query-encapsulation__field-wrapper"},Pl={key:0,class:"query-encapsulation__field-label"},Ol={key:0,class:"query-encapsulation__toggle"},jl={class:"query-encapsulation__actions"},Ul={class:"query-encapsulation__actions-group"},ql=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(n,{emit:E}){const t=n,l=E,p=e.ref(!1),v=e.reactive({}),u=["select","date","daterange"];let x;const B=e.computed(()=>t.fields.filter(L=>!L.hidden)),S=e.computed(()=>p.value?B.value:B.value.slice(0,t.maxVisibleFields)),w=e.computed(()=>B.value.length>t.maxVisibleFields);function y(L){switch(L){case"select":return Ce;case"date":case"daterange":return xe;case"input":default:return Be}}function h(L){l("field-change",L,v[L.key]),l("update:modelValue",{...v}),u.includes(L.type)&&Y()}function k(){const L=j(v),_=X(L),M={...v};l("search",{data:_,raw:M})}function z(){Object.keys(v).forEach(L=>{const _=t.fields.find(M=>M.key===L);(_==null?void 0:_.type)==="daterange"?v[L]={startDate:null,endDate:null}:(_==null?void 0:_.type)==="date"?v[L]=null:v[L]=""}),l("reset"),l("update:modelValue",{...v})}function W(){p.value=!p.value}function K(L){return L.type!=="input"?{}:{enter:()=>T(),paste:()=>T()}}async function T(){await e.nextTick(),k()}function Y(){x&&clearTimeout(x),x=setTimeout(()=>{x=void 0,e.nextTick().then(()=>k())},0)}function j(L){const _={};return Object.keys(L).forEach(M=>{const R=t.fields.find(G=>G.key===M),Q=L[M],P=typeof Q=="string"?Q.trim():Q;if(!(P==null||P==="")){if(typeof P=="object"&&P.startDate&&P.endDate){P.startDate&&P.endDate&&(_[M]=P);return}if(R&&(R.type==="date"||R.type==="daterange")){P!==0&&(_[M]=P);return}_[M]=P}}),_}function X(L){const _={};return Object.keys(L).forEach(M=>{const R=L[M],Q=t.fields.find(P=>P.key===M);if(Q)if(Q.type==="daterange"&&typeof R=="object"){const P=Q.startKey||`${M}Start`,G=Q.endKey||`${M}End`;R.startDate&&R.endDate&&R.startDate!==0&&R.endDate!==0&&(Q.format==="timestamp"?(_[P]=new Date(R.startDate).getTime(),_[G]=new Date(R.endDate).getTime()):(_[P]=R.startDate,_[G]=R.endDate))}else Q.type==="date"&&R&&R!==0&&Q.format==="timestamp"?_[M]=new Date(R).getTime():_[M]=R;else _[M]=R}),_}function U(){t.fields.forEach(L=>{var _,M,R;v[L.key]===void 0&&(L.type==="daterange"?v[L.key]=((_=t.modelValue)==null?void 0:_[L.key])||{startDate:null,endDate:null}:L.type==="date"?v[L.key]=((M=t.modelValue)==null?void 0:M[L.key])||null:v[L.key]=((R=t.modelValue)==null?void 0:R[L.key])||"")})}return e.watch(()=>t.modelValue,L=>{L&&Object.assign(v,L)},{deep:!0,immediate:!0}),e.onMounted(()=>{U()}),e.onBeforeUnmount(()=>{x&&(clearTimeout(x),x=void 0)}),(L,_)=>(e.openBlock(),e.createElementBlock("div",Fl,[e.createElementVNode("div",Rl,[e.createElementVNode("div",Al,[e.createElementVNode("div",Wl,[e.createVNode(e.TransitionGroup,{name:"qf",tag:"div",class:"query-encapsulation__fields-group"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,M=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:"query-encapsulation__field-item"},[e.createElementVNode("div",Yl,[n.Iflabel?(e.openBlock(),e.createElementBlock("label",Pl,e.toDisplayString(M.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y(M.type)),e.mergeProps({modelValue:v[M.key],"onUpdate:modelValue":R=>v[M.key]=R,placeholder:M.placeholder||`请输入${M.label}`,options:M.options,clearable:M.clearable!==!1,size:M.size||"small",width:M.width||"180px",format:M.format||"timestamp","include-time":M.includeTime||!1,filterable:M.filterable===!0},e.toHandlers(K(M)),{onInput:R=>h(M),onChange:R=>h(M)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","onInput","onChange"]))])]))),128))]),_:1}),w.value?(e.openBlock(),e.createElementBlock("div",Ol,[e.createVNode(he,{variant:"secondary",size:"small",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":p.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",jl,[e.createElementVNode("div",Ul,[e.createVNode(he,{variant:"primary",size:"small",onClick:k,loading:n.loading},{default:e.withCtx(()=>[..._[0]||(_[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(he,{variant:"secondary",size:"small",onClick:z,loading:n.loading},{default:e.withCtx(()=>[..._[1]||(_[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(L.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),Fe=ne(ql,[["__scopeId","data-v-61f05ecd"]]),Zl={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Ql={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Jl={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Xl=["textContent"],Gl=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(n){const E=n,t=e.ref(!1);let l;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,E.duration&&E.duration>0&&(l=window.setTimeout(()=>p(),E.duration))})}),e.onBeforeUnmount(()=>{l&&window.clearTimeout(l)});function p(){t.value=!1}function v(){var u;(u=E.onClose)==null||u.call(E,E.id)}return(u,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:v},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${n.type}`]]),style:e.normalizeStyle({zIndex:n.zIndex}),role:"status","aria-live":"polite"},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${n.type}`]),"aria-hidden":"true"},[n.type==="success"?(e.openBlock(),e.createElementBlock("svg",Zl,[...x[0]||(x[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Ql,[...x[1]||(x[1]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Jl,[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],2),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(n.message)},null,8,Xl),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:p},"✕")):e.createCommentVNode("",!0)],6),[[e.vShow,t.value]])]),_:1}))}}),eo=ne(Gl,[["__scopeId","data-v-c5dc221c"]]);let to=1;const Ee=12,se=[];function no(){let n=20;return se.forEach(E=>{n+=E.height+Ee}),n}function Ne(n){const E=se.findIndex(v=>v.id===n);if(E===-1)return;const{el:t}=se[E],l=t.firstElementChild;if(l){const v=window.getComputedStyle(l).top;l.style.top=v,l.classList.add("is-leaving"),l.style.willChange="opacity, transform"}se[E].leaving=!0,ke(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const v=se.findIndex(u=>u.id===n);v!==-1&&se.splice(v,1),ke()},260)}function be(n){var v;const E=to++,t=document.createElement("div");document.body.appendChild(t);const l=e.createVNode(eo,{id:E,type:n.type||"success",message:n.message,duration:n.duration??2500,offset:no(),zIndex:3e3+E,closable:n.closable??!1,onClose:u=>Ne(u)});e.render(l,t);const p=((v=t.firstElementChild)==null?void 0:v.offsetHeight)||0;return se.push({id:E,el:t,vm:l,height:p,leaving:!1}),ke(),requestAnimationFrame(()=>{const u=t.firstElementChild;if(!u)return;const x=u.offsetHeight||p||0,B=se.find(S=>S.id===E);B&&(B.height=x,ke())}),{close:()=>Ne(E)}}const pe={success(n,E={}){return be({...E,type:"success",message:n})},warning(n,E={}){return be({...E,type:"warning",message:n})},error(n,E={}){return be({...E,type:"error",message:n})}};typeof window<"u"&&(window.YMessage=pe,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=pe));function ke(){let n=20;se.forEach(E=>{const t=E.el.firstElementChild;if(!t)return;const l=n;if(t.style.transform=`translate(-50%, ${l}px)`,t.style.top||(t.style.top="0px"),!E.leaving)n+=(t.offsetHeight||E.height)+Ee;else{const p=t.offsetHeight||E.height;n+=p+Ee}})}const De={YButton:he,YInput:Be,YTable:Se,YSelect:Ce,YPagination:$e,YBadge:_e,YDialog:Me,YPopover:ze,YTime:xe,YSwitch:Le,YImage:Te,YDropdown:Ie,YDrawer:Ke,YTree:He,QueryEncapsulation:Fe},lo={install(n){Object.keys(De).forEach(E=>{n.component(E,De[E])}),n.config.globalProperties.$message=pe,typeof window<"u"&&(window.YMessage=pe)}};exports.QueryEncapsulation=Fe;exports.YBadge=_e;exports.YButton=he;exports.YDialog=Me;exports.YDrawer=Ke;exports.YDropdown=Ie;exports.YImage=Te;exports.YInput=Be;exports.YMessage=pe;exports.YPagination=$e;exports.YPopover=ze;exports.YSelect=Ce;exports.YSwitch=Le;exports.YTable=Se;exports.YTime=xe;exports.YTree=He;exports.default=lo;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Ae=["type","disabled","aria-busy","aria-disabled"],We={class:"content"},Ye={key:1,class:"y-btn-group",role:"group"},Pe=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Oe={class:"content"},je={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Ue={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},qe={key:2},Ze=e.defineComponent({__name:"ybutton",props:{htmlType:{default:"button"},variant:{default:"primary"},size:{default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1},groupPosition:{default:"single"},groupItems:{default:void 0}},emits:["click","group-click"],setup(n,{emit:E}){const t=n,l=E;function h(B){if(t.disabled||t.loading){B.preventDefault(),B.stopPropagation();return}l("click",B)}const u=e.computed(()=>{switch(t.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),m=e.computed(()=>Array.isArray(t.groupItems)&&t.groupItems.length>0);function x(B,$){if(t.disabled||t.loading||B.disabled||B.loading){$.preventDefault(),$.stopPropagation();return}l("group-click",B.value,$)}return(B,$)=>m.value?(e.openBlock(),e.createElementBlock("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groupItems,(w,p)=>{var y;return e.openBlock(),e.createElementBlock("button",{key:w.value??p,class:e.normalizeClass(["y-btn",[`y-btn--${w.variant??n.variant}`,`y-btn--${w.size??n.size}`,"is-grouped",p===0?"group-pos-start":p===(((y=n.groupItems)==null?void 0:y.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":w.loading||n.loading}]]),type:n.htmlType,disabled:(w.disabled??!1)||n.disabled||n.loading||w.loading,"aria-busy":w.loading||n.loading?"true":"false","aria-disabled":(w.disabled??!1)||n.disabled||n.loading||w.loading?"true":"false","aria-label":w.ariaLabel||w.label,onClick:k=>x(w,k)},[e.createElementVNode("span",Oe,[w.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",je,[...$[0]||($[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z","clip-rule":"evenodd"},null,-1)])])):w.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",Ue,[...$[1]||($[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),w.label&&!w.onlyIcon?(e.openBlock(),e.createElementBlock("span",qe,e.toDisplayString(w.label),1)):e.createCommentVNode("",!0)])],10,Pe)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${n.variant}`,`y-btn--${n.size}`,{"is-block":n.block,"is-loading":n.loading},n.groupPosition!=="single"?"is-grouped":"",u.value]]),type:n.htmlType,disabled:n.disabled||n.loading,"aria-busy":n.loading?"true":"false","aria-disabled":n.disabled||n.loading?"true":"false",onClick:h},[e.createElementVNode("span",We,[e.renderSlot(B.$slots,"default",{},void 0,!0)])],10,Ae))}}),le=(n,E)=>{const t=n.__vccOpts||n;for(const[l,h]of E)t[l]=h;return t},he=le(Ze,[["__scopeId","data-v-53157673"]]),Qe=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],Je=e.defineComponent({__name:"yinput",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},autocomplete:{default:"off"},inputmode:{default:void 0},id:{default:void 0},name:{default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},size:{default:"medium"},width:{default:"200px"},min:{default:void 0},max:{default:void 0},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue","enter","paste"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(null),u=e.ref(""),m=e.ref(!1),x=e.ref(!1),B=e.ref(t.placeholder||"");e.watch(()=>t.placeholder,z=>{x.value||(B.value=z||"")});function $(z){const W=z.target;m.value=!0,l("update:modelValue",W.value)}function w(){x.value=!0,t.clearOnFocus&&(u.value=t.modelValue||"",m.value=!1,B.value=u.value||t.placeholder||"",l("update:modelValue",""))}function p(){if(x.value=!1,t.clearOnFocus&&!m.value&&(!t.modelValue||t.modelValue==="")&&l("update:modelValue",u.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const z=Number(t.modelValue),W=Number(t.min);!Number.isNaN(z)&&!Number.isNaN(W)&&z<W&&l("update:modelValue",String(W))}B.value=t.placeholder||""}function y(z){const W=z.target;l("enter",W.value)}function k(z){const W=z.target;requestAnimationFrame(()=>{l("paste",W.value)})}return(z,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":n.block}]),style:e.normalizeStyle({width:n.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:h,class:e.normalizeClass(["y-input",`y-input--${n.size}`]),id:n.id,name:n.name,type:n.type,placeholder:B.value,autocomplete:n.autocomplete,inputmode:n.inputmode,min:n.min,max:n.max,disabled:n.disabled,required:n.required,value:n.modelValue,onInput:$,onFocus:w,onBlur:p,onKeyup:e.withKeys(y,["enter"]),onPaste:k},null,42,Qe)],6))}}),Be=le(Je,[["__scopeId","data-v-c4912c99"]]),Xe={key:0,class:"bulk-bar"},Ge={class:"bulk-left"},et={class:"bulk-actions"},tt={class:"card"},nt={class:"table"},lt={key:0,style:{width:"34px","min-width":"34px"}},ot={key:1,style:{width:"40px","min-width":"40px"}},at={key:0,class:"col-expand"},st={key:1,class:"col-select"},rt=["checked","disabled"],it={key:0,class:"loading-overlay"},ct={key:1,class:"empty-overlay"},dt={key:0,style:{width:"34px","min-width":"34px"}},ut={key:1,style:{width:"40px","min-width":"40px"}},mt={key:0,class:"col-expand"},ft=["onClick"],vt={key:1,class:"col-select"},ht=["value","checked","disabled","onChange"],pt=["colspan"],yt=e.defineComponent({__name:"ytable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},showBulkActions:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},pageSize:{default:10},currentPage:{},total:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"1/页",value:1},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},rowKey:{type:[String,Function],default:"id"},emptyText:{default:"无数据"},searchKeyword:{default:""},searchFields:{default:()=>[]},stickyHeader:{type:Boolean,default:!1},expandable:{type:Boolean},rowDisabled:{type:Function,default:void 0},selectedItems:{default:void 0}},emits:["edit","select","update:selectedItems","page-change","page-size-change"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(t.currentPage||1),u=e.ref(t.pageSize),m=e.ref(t.selectedItems||[]),x=e.ref(new Set),B=e.ref("none"),$=e.ref(),w=e.ref(),p=e.ref(),y=e.ref(),k=e.ref([]),z=e.ref({}),W=e.computed(()=>t.columns.filter(a=>!S(a.width)).map(a=>a.key));function K(){return`${(100/(W.value.length||1)).toFixed(6)}%`}const T=e.ref(),Y=e.ref({show:!1,thumbHeight:40,thumbTop:0});let j=!1,X=0,U=0;const G=e.ref(0);function S(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const c=String(a).trim();if(c)return/^\d+(\.\d+)?$/.test(c)?`${c}px`:c}function I(a){const c=S(a);if(!c)return null;const b=parseFloat(c);return Number.isFinite(b)?b:null}const M=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),H=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(c=>t.searchFields.some(b=>{const C=g(c,b);return String(C).toLowerCase().includes(a)}))}),Z=e.computed(()=>(t.pagination,H.value)),P=e.computed(()=>{if(!t.selectable)return!1;const a=Z.value.map((c,b)=>({key:i(c,b),item:c,index:b})).filter(({item:c,index:b})=>!o(c,b)).map(({key:c})=>c);return a.length>0&&a.every(c=>m.value.includes(c))}),ee=e.computed(()=>{if(!t.selectable)return!1;const a=Z.value.map((c,b)=>({item:c,index:b}));return a.length>0&&a.every(({item:c,index:b})=>o(c,b))}),A=e.computed(()=>{const a=[];let c=t.selectable?40:0;for(let b=0;b<t.columns.length;b++){const C=t.columns[b];if(C.fixed==="left"){let D=80;const L=I(C.width);L!==null?D=L:k.value[b]&&(D=I(k.value[b])??D),a.push(c),c+=D}}return a}),q=e.computed(()=>{const a=[];let c=0;const b=[];for(let C=t.columns.length-1;C>=0;C--){const D=t.columns[C];if(D.fixed==="right"){let L=80;const O=I(D.width);O!==null?L=O:k.value[C]&&(L=I(k.value[C])??L),b.push({index:C,width:L})}}for(let C=0;C<b.length;C++)a.push(c),c+=b[C].width;return a});function f(a,c){if(c==="left"){let b=0;for(let C=0;C<a;C++)t.columns[C].fixed==="left"&&b++;return b}else{let b=0;for(let C=t.columns.length-1;C>a;C--)t.columns[C].fixed==="right"&&b++;return b}}function i(a,c){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||c}function o(a,c){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,c):!1}function s(a){return x.value.has(a)}function d(a){x.value.has(a)?x.value.delete(a):x.value.add(a)}function g(a,c){return c.split(".").reduce((b,C)=>b==null?void 0:b[C],a)}function V(a,c=!1){const b=[];return a.align&&b.push(`text-${a.align}`),a.fixed==="right"&&(b.push("col-fixed-right"),c&&b.push("col-fixed-right-header")),a.fixed==="left"&&(b.push("col-fixed-left"),c&&b.push("col-fixed-left-header")),b.join(" ")}function _(a,c,b){const C={},D=S(a.width);if(D)C.width=D,C.minWidth=D,C.maxWidth=D;else{const L=K();C.width=L,C.minWidth=L,C.maxWidth=L}if(a.fixed==="left"){const L=f(c,"left"),O=A.value[L]||0;C.left=`${O}px`,C.zIndex=b?`${10+L}`:`${5+L}`}else if(a.fixed==="right"){const L=f(c,"right"),O=q.value[L]||0;b?C.right=`${O-3}px`:C.right=`${O}px`,C.zIndex=b?`${10+L}`:`${5+L}`}return C}function F(a,c){const b=g(a,c.key);return c.formatter?c.formatter(b,a):b||""}function J(a){const c=Z.value.find((C,D)=>i(C,D)===a),b=Z.value.findIndex((C,D)=>i(C,D)===a);c&&b>=0&&o(c,b)||(m.value.includes(a)?m.value=m.value.filter(C=>C!==a):m.value=[...m.value,a],l("select",m.value),l("update:selectedItems",m.value))}function ne(){const a=Z.value.map((c,b)=>({key:i(c,b),item:c,index:b})).filter(({item:c,index:b})=>!o(c,b)).map(({key:c})=>c);if(a.length!==0){if(a.every(c=>m.value.includes(c)))m.value=m.value.filter(c=>!a.includes(c));else{const c=new Set([...m.value,...a]);m.value=Array.from(c)}l("select",m.value),l("update:selectedItems",m.value)}}function ae(){m.value=[],l("select",m.value),l("update:selectedItems",m.value)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const c=new Set(m.value),b=new Set(a);(c.size!==b.size||![...c].every(C=>b.has(C)))&&(m.value=[...a])}else a===void 0&&m.value.length>0&&(m.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{h.value=1}),e.watch(()=>t.data,()=>{t.total||(h.value=1)},{deep:!0});function ue(a){h.value=a,l("page-change",a)}function we(a){u.value=a,h.value=1,l("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const c=typeof a=="number"&&a>0?a:1;h.value!==c&&(h.value=c)}),e.watch(()=>t.pageSize,a=>{const c=typeof a=="number"&&a>0?a:10;u.value!==c&&(u.value=c)});function ce(){$.value&&e.nextTick(()=>{const a=$.value.getBoundingClientRect(),c=window.innerHeight,b=a.top,C=$.value.querySelector(".table-header"),D=C?C.offsetHeight:40,L=$.value.querySelector(".ypagination"),O=L?L.offsetHeight:60,te=$.value.querySelector(".bulk-bar"),Q=te?te.offsetHeight:0,oe=D+O+Q+20,ge=c-b-oe,Re=Math.max(200,ge),Ve=$.value.querySelector(".table-body-wrap .table");Ve&&(Ve.offsetHeight>ge?B.value=`${Re}px`:B.value="none")})}let re=!1;function ie(){!w.value||!p.value||re||w.value.scrollLeft!==p.value.scrollLeft&&(re=!0,w.value.scrollLeft=p.value.scrollLeft,requestAnimationFrame(()=>{re=!1}))}function me(){!w.value||!p.value||re||p.value.scrollLeft!==w.value.scrollLeft&&(re=!0,p.value.scrollLeft=w.value.scrollLeft,requestAnimationFrame(()=>{re=!1}))}function fe(){e.nextTick(()=>{if(!p.value)return;const a=p.value,c=a.scrollHeight,b=a.clientHeight,C=a.scrollTop,D=c>b+1;if(Y.value.show=D,!D)return;const L=24,O=b/c,te=T.value?T.value.clientHeight:b,Q=Math.max(L,Math.floor(te*O));Y.value.thumbHeight=Q;const oe=Math.max(0,te-Q),ge=Math.max(1,c-b);Y.value.thumbTop=Math.min(oe,Math.floor(C/ge*oe))})}function ve(a){if(!j||!p.value||!T.value)return;a.preventDefault();const c=T.value.clientHeight,b=Math.max(0,c-Y.value.thumbHeight),C=p.value,D=C.scrollHeight,L=C.clientHeight,O=Math.max(1,D-L),Q=(a.clientY-X)/Math.max(1,b)*O;C.scrollTop=Math.min(O,Math.max(0,U+Q)),fe()}function ye(){j=!1,window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",ye)}function de(){e.nextTick(()=>{var b,C;if(k.value.length===t.columns.length&&k.value.every(D=>!!D))return;const a=[];t.columns.forEach((D,L)=>{const O=S(D.width);if(O)a.push(O),z.value[D.key]=O;else if(z.value[D.key])a.push(z.value[D.key]);else{const te=k.value[L];if(te)a.push(te),z.value[D.key]=te;else{const Q=K();a.push(Q),z.value[D.key]=Q}}});const c=(b=y.value)==null?void 0:b.querySelector("tbody tr");if(c){const D=t.selectable?1:0,L=Array.from(c.children);for(let O=0;O<t.columns.length;O++)if(!a[O]){const te=L[D+O];if(te&&te.clientWidth>0){const Q=`${te.clientWidth}px`;a[O]=Q,z.value[t.columns[O].key]=Q}else{const Q=K();a[O]=Q,z.value[t.columns[O].key]=Q}}}else for(let D=0;D<a.length;D++)if(!a[D]){const L=z.value[((C=t.columns[D])==null?void 0:C.key)||""];a[D]=L||k.value[D]||"80px",t.columns[D]&&(z.value[t.columns[D].key]=a[D])}k.value=a})}function r(){ce(),N()}e.watch(()=>t.data,()=>{e.nextTick(()=>{ce(),ie(),N(),x.value.clear()})},{deep:!0}),e.watch([h,u],()=>{e.nextTick(()=>{ce(),ie(),N()})}),e.watch(()=>t.columns,()=>{const a=[],c={...z.value};t.columns.forEach((C,D)=>{const L=S(C.width);L?(a.push(L),c[C.key]=L):c[C.key]?a.push(c[C.key]):k.value[D]?(a.push(k.value[D]),c[C.key]=k.value[D]):a.push("")});const b=new Set(t.columns.map(C=>C.key));Object.keys(c).forEach(C=>{b.has(C)||delete c[C]}),z.value=c,k.value=a,e.nextTick(()=>{de(),ie(),N()})},{deep:!0}),e.watch(()=>m.value,()=>{e.nextTick(()=>{ce(),N()})},{deep:!0}),e.watch(()=>t.loading,()=>{e.nextTick(()=>{N()})}),e.onMounted(()=>{var a,c;e.nextTick(()=>{ce(),de(),N(),fe()}),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),(a=p.value)==null||a.addEventListener("scroll",()=>{ie(),fe(),N()},{passive:!0}),(c=w.value)==null||c.addEventListener("scroll",()=>{me()},{passive:!0}),e.nextTick(()=>ie()),p.value&&typeof ResizeObserver<"u"&&(R=new ResizeObserver(()=>{N()}),R.observe(p.value))}),e.onUnmounted(()=>{var a,c;window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0),(a=p.value)==null||a.removeEventListener("scroll",ie),(c=w.value)==null||c.removeEventListener("scroll",me),window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",ye),R&&(R.disconnect(),R=null)});let v=-1;function N(){!w.value||!p.value||requestAnimationFrame(()=>{if(!w.value||!p.value)return;const a=p.value,c=Math.ceil(a.offsetWidth-a.clientWidth);if(G.value=c,c!==v){v=c;const b=w.value.querySelector(".table"),C=y.value;b&&C&&(w.value.style.paddingRight="0px",b.style.width="",b.style.marginRight="",c>0?(w.value.style.paddingRight=`${c}px`,b.style.width="100%",b.style.marginRight=`-${c}px`):(w.value.style.paddingRight="0px",b.style.width="100%",b.style.marginRight="0px"))}})}let R=null;return(a,c)=>{const b=e.resolveComponent("YButton"),C=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:$},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[m.value.length&&n.showBulkActions?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",Ge,"已选择 "+e.toDisplayString(m.value.length)+" 项",1),e.createElementVNode("div",et,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:m.value,clearSelection:ae},()=>[e.createVNode(b,{size:"small",class:"btn",onClick:ae},{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",tt,[e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:w},[e.createElementVNode("table",nt,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",lt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",ot)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,L)=>(e.openBlock(),e.createElementBlock("col",{key:D.key,style:e.normalizeStyle({width:k.value[L]||void 0,minWidth:k.value[L]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",at)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("th",st,[e.createElementVNode("input",{type:"checkbox",checked:P.value,disabled:ee.value,onChange:ne},null,40,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,L)=>(e.openBlock(),e.createElementBlock("th",{key:D.key,class:e.normalizeClass(V(D,!0)),style:e.normalizeStyle(_(D,L,!0))},e.toDisplayString(D.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":n.loading,"is-empty":!Z.value.length&&!n.loading}]),ref_key:"bodyWrapRef",ref:p,style:e.normalizeStyle({maxHeight:B.value})},[n.loading?(e.openBlock(),e.createElementBlock("div",it,[...c[3]||(c[3]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!Z.value.length&&!n.loading?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":n.loading}]),ref_key:"bodyTableRef",ref:y},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",dt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",ut)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(D,L)=>(e.openBlock(),e.createElementBlock("col",{key:D.key,style:e.normalizeStyle({width:k.value[L]||void 0,minWidth:k.value[L]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(D,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i(D,L)},[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("td",mt,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:O=>d(i(D,L))},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":s(i(D,L))}])},null,2)],8,ft)])):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("td",vt,[e.createElementVNode("input",{type:"checkbox",value:i(D,L),checked:m.value.includes(i(D,L)),disabled:o(D,L),onChange:O=>J(i(D,L))},null,40,ht)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(O,te)=>(e.openBlock(),e.createElementBlock("td",{key:O.key,class:e.normalizeClass(V(O)),style:e.normalizeStyle(_(O,te,!1))},[e.renderSlot(a.$slots,`cell-${O.key}`,{item:D,value:g(D,O.key),index:L},()=>[e.createTextVNode(e.toDisplayString(F(D,O)),1)],!0)],6))),128))]),t.expandable&&s(i(D,L))?(e.openBlock(),e.createElementBlock("tr",{key:`${i(D,L)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:M.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:D,index:L},void 0,!0)],8,pt)])):e.createCommentVNode("",!0)],64))),128))])],2)],6),n.pagination?(e.openBlock(),e.createBlock(C,{key:0,class:"align-right","current-page":h.value,"onUpdate:currentPage":c[0]||(c[0]=D=>h.value=D),"page-size":u.value,"onUpdate:pageSize":c[1]||(c[1]=D=>u.value=D),loading:t.loading,"page-size-options":n.pageSizeOptions,onPageChange:ue,onPageSizeChange:we},null,8,["current-page","page-size","loading","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),Se=le(yt,[["__scopeId","data-v-eeac0552"]]),gt=["onKeydown","aria-expanded"],kt=["src"],wt=["placeholder","onKeydown"],bt=["onClick","onMouseenter"],Et=["src"],Bt=e.defineComponent({__name:"yselect",props:{modelValue:{},options:{},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},clearTo:{default:void 0},filterable:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(!1),u=e.ref(-1),m=e.ref(),x=e.ref(),B=e.ref(),$=e.ref(),w=e.ref(!1),p=e.ref(),y=e.ref(""),k=e.computed(()=>t.options.find(o=>Y(o)===t.modelValue)||null),z=e.computed(()=>k.value?j(k.value):""),W=e.computed(()=>{if(!t.filterable)return t.options;const o=y.value.trim().toLowerCase();return o?t.options.filter(s=>{const d=j(s);return String(d).toLowerCase().includes(o)}):t.options}),K=e.computed(()=>{var V;const o={position:"fixed",zIndex:"4000"},s=x.value;if(!s)return o;const d=s.getBoundingClientRect(),g=((V=B.value)==null?void 0:V.getBoundingClientRect().width)||d.width;return o.left=`${d.left}px`,o.width=`${g}px`,w.value?(o.bottom=`${window.innerHeight-d.top+4}px`,o.top="auto"):o.top=`${d.bottom+4}px`,o});function T(){!h.value||!x.value||e.nextTick(()=>{const o=x.value;if(!o)return;const s=o.getBoundingClientRect(),d=window.innerHeight,g=200,V=s.bottom+g+4,_=s.top-g-4,F=V<=d-20,J=_>=20;w.value=!F&&J})}function Y(o){return typeof o=="object"&&o!==null?o[t.valueKey]:o}function j(o){return typeof o=="object"&&o!==null?o[t.labelKey]||String(o[t.valueKey]):String(o)}function X(o,s){return typeof o=="object"&&o!==null&&o.id!==void 0?o.id:Y(o)||s}function U(o){return Y(o)===t.modelValue}function G(o){return typeof o=="object"&&o!==null?o[t.disabledKey]===!0:!1}function S(){t.disabled||(h.value?M():I())}function I(){t.disabled||(h.value=!0,e.nextTick(()=>{T(),A(),t.filterable&&p.value&&(p.value.focus(),y.value="")}))}function M(){h.value=!1,u.value=-1,w.value=!1,t.filterable&&(y.value="")}function H(o,s){if(G(o))return;const d=Y(o);l("update:modelValue",d),l("change",d,o),M()}function Z(){if(!t.clearable||t.disabled)return;const o=t.clearTo;l("update:modelValue",o),l("change",o,null),l("clear"),M()}function P(o){if(!W.value||W.value.length===0){u.value=-1;return}let s=u.value;const d=W.value.length;s===-1?s=o>0?0:d-1:s=(s+o+d)%d;let g=0;for(;g<d&&G(W.value[s]);)s=(s+o+d)%d,g++;u.value=g>=d?-1:s,q()}function ee(){if(u.value<0)return;const o=W.value[u.value];!o||G(o)||H(o,u.value)}function A(){if(!m.value)return;const o=m.value.querySelector(".yselect__option--selected");o&&o.scrollIntoView({block:"nearest"})}function q(){if(!m.value||u.value<0)return;const s=m.value.querySelectorAll(".yselect__option")[u.value];s&&s.scrollIntoView({block:"nearest"})}function f(o){const s=o.target;(!B.value||!B.value.contains(s))&&M()}e.watch(()=>t.modelValue,()=>{u.value=-1});function i(){h.value&&T()}return e.onMounted(()=>{document.addEventListener("click",f),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",f),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":n.disabled,[`yselect--${n.size}`]:!0}]),style:e.normalizeStyle({width:n.width}),ref_key:"selectContainer",ref:B},[e.createElementVNode("div",{ref_key:"triggerElement",ref:x,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":h.value,"yselect__trigger--disabled":n.disabled,"yselect__trigger--error":n.error}]),onMousedown:e.withModifiers(S,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(S,["prevent"]),["enter"]),e.withKeys(e.withModifiers(S,["prevent"]),["space"]),e.withKeys(M,["escape"]),e.withKeys(e.withModifiers(I,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(I,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":h.value,"aria-haspopup":!0},[!n.filterable||!h.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!z.value}])},[e.renderSlot(o.$slots,"value",{value:k.value,label:z.value},()=>{var d;return[k.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(d=k.value)!=null&&d.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:k.value.flagImg,alt:"flag"},null,8,kt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(z.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.placeholder),1)],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:p,class:"yselect__input",type:"text",placeholder:z.value||n.placeholder,"onUpdate:modelValue":s[0]||(s[0]=d=>y.value=d),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(d=>P(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(d=>P(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(d=>ee(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(M,["prevent"]),["esc"]),e.withKeys(e.withModifiers(Z,["prevent"]),["delete"])]},null,40,wt)),[[e.vModelText,y.value]]),n.clearable&&!n.disabled&&k.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(Z,["stop"])},[...s[8]||(s[8]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 3l6 6M9 3L3 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["yselect__arrow",{"yselect__arrow--open":h.value}])},[...s[9]||(s[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],42,gt),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[h.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownEl",ref:$,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":w.value}]),style:e.normalizeStyle(K.value),onMousedown:s[6]||(s[6]=e.withModifiers(()=>{},["stop"])),onClick:s[7]||(s[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"yselect__options",ref_key:"optionsContainer",ref:m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(d,g)=>(e.openBlock(),e.createElementBlock("div",{key:X(d,g),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":U(d),"yselect__option--disabled":G(d),"yselect__option--hover":u.value===g}]),onClick:V=>H(d),onMouseenter:V=>u.value=g,onMouseleave:s[5]||(s[5]=V=>u.value=-1)},[e.renderSlot(o.$slots,"option",{option:d,index:g,selected:U(d)},()=>[d!=null&&d.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:d.flagImg,alt:"flag"},null,8,Et)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(j(d)),1)],!0)],42,bt))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Ce=le(Bt,[["__scopeId","data-v-6cd47cb7"]]),Ct={class:"ypagination"},xt={class:"page-actions"},Vt={class:"page-size-select"},Nt=e.defineComponent({__name:"ypagination",props:{currentPage:{},pageSize:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"10/页",value:10},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(t.pageSize),u=e.computed(()=>t.pageSizeOptions),m=e.computed({get:()=>t.currentPage,set:w=>{l("update:currentPage",w),l("page-change",w)}});function x(w){t.loading||w>=1&&w!==t.currentPage&&(m.value=w)}function B(w){t.loading||(h.value=w,l("update:pageSize",w),l("page-size-change",w),m.value=1)}function $(w){t.loading||(w==="prev"?x(m.value-1):w==="next"&&x(m.value+1))}return h.value=t.pageSize,e.watch(()=>t.pageSize,w=>{typeof w=="number"&&h.value!==w&&(h.value=w)}),(w,p)=>{const y=e.resolveComponent("YButton"),k=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("div",xt,[e.createVNode(y,{size:"small",variant:"secondary",disabled:m.value===1||n.loading,onClick:p[0]||(p[0]=z=>x(1))},{default:e.withCtx(()=>[...p[2]||(p[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(y,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:m.value===1||n.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:n.loading,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:$},null,8,["groupItems"]),e.createElementVNode("div",Vt,[e.createVNode(k,{modelValue:h.value,"onUpdate:modelValue":p[1]||(p[1]=z=>h.value=z),options:u.value,size:"small",width:"105px",clearable:!1,disabled:n.loading,onChange:B},null,8,["modelValue","options","disabled"])])])])}}}),$e=le(Nt,[["__scopeId","data-v-b8406406"]]),Dt=["aria-label"],St={class:"y-badge__inner"},$t={key:0,class:"y-badge__progress","aria-hidden":"true"},_t={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Mt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},zt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Lt={key:1,class:"y-badge__icon","aria-hidden":"true"},Tt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},It={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Kt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ht={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ft={class:"y-badge__label"},Rt=e.defineComponent({__name:"ybadge",props:{tone:{default:"default"},size:{default:"medium"},progress:{default:void 0},icon:{default:void 0},pill:{type:Boolean,default:!0},outline:{type:Boolean,default:!1},label:{default:""}},setup(n){const E=n,t=e.computed(()=>E.tone||"default"),l=e.computed(()=>{const h=(E.label||"").trim(),u=E.tone,m=E.progress;if(m){const x={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return h?`${h},进度:${x[m]||m}`:`进度:${x[m]||m}`}if(u&&u!=="default"){const x={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return h?`${h},语气:${x[u]||u}`:`语气:${x[u]||u}`}return h||"标记"});return(h,u)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${n.size}`,{"is-outline":n.outline,"is-pill":n.pill},n.progress?`y-badge--progress-${n.progress}`:""]]),role:"status","aria-label":l.value},[e.createElementVNode("span",St,[n.progress?(e.openBlock(),e.createElementBlock("span",$t,[n.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",_t,[...u[0]||(u[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):n.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Mt,[...u[1]||(u[1]=[e.createElementVNode("path",{d:"M10 5a5 5 0 100 10V5z"},null,-1),e.createElementVNode("circle",{cx:"10",cy:"10",r:"5",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1)])])):n.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",zt,[...u[2]||(u[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)])):n.icon?(e.openBlock(),e.createElementBlock("span",Lt,[n.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Tt,[...u[3]||(u[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):n.icon==="check"?(e.openBlock(),e.createElementBlock("svg",It,[...u[4]||(u[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):n.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Kt,[...u[5]||(u[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ht,[...u[6]||(u[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",Ft,[e.renderSlot(h.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)])])],10,Dt))}}),_e=le(Rt,[["__scopeId","data-v-ce819797"]]),At=["aria-hidden"],Wt=["onKeydown"],Yt={key:0,class:"y-dialog-header"},Pt={class:"y-dialog-title"},Ot={class:"y-dialog-body"},jt={key:1,class:"y-dialog-footer"},Ut=e.defineComponent({__name:"ydialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},width:{default:"520px"},top:{default:"15vh"},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:3e3},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(n,{emit:E}){const t=n,l=E,h=e.computed({get:()=>t.modelValue,set:p=>l("update:modelValue",p)}),u=e.ref(null),m=e.computed(()=>{const p={};return p.width=typeof t.width=="number"?`${t.width}px`:String(t.width),p.margin="0 auto",p.top=t.top,p});function x(){t.maskClosable&&B()}function B(){h.value&&(h.value=!1,l("close"))}function $(){t.closable&&B()}function w(p){p.key==="Escape"&&$()}return e.watch(()=>t.modelValue,p=>{p?(l("open"),requestAnimationFrame(()=>{var y;return(y=u.value)==null?void 0:y.focus()}),document.addEventListener("keydown",w),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",w),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",w),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",w),document.body.style.overflow=""}),(p,y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!h.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:x}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:u,class:e.normalizeClass(["y-dialog-panel",[n.center?"is-center":""]]),style:e.normalizeStyle(m.value),onKeydown:e.withKeys(e.withModifiers($,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Yt,[e.renderSlot(p.$slots,"header",{},()=>[e.createElementVNode("div",Pt,e.toDisplayString(n.title),1)],!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:B}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ot,[e.renderSlot(p.$slots,"default",{},void 0,!0)]),p.$slots.footer?(e.openBlock(),e.createElementBlock("div",jt,[e.renderSlot(p.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Wt),[[e.vShow,h.value]])]),_:3})],12,At),[[e.vShow,h.value]])]))}}),Me=le(Ut,[["__scopeId","data-v-a7acc6dc"]]),qt={class:"ypopover__inner"},Zt=e.defineComponent({__name:"ypopover",props:{trigger:{default:"click"},placement:{default:"bottom"},showArrow:{type:Boolean,default:!0},showPadding:{type:Boolean,default:!0},dark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDelay:{default:0},closeDelay:{default:200},closeOnClickOutside:{type:Boolean,default:!0},closeOnClickContent:{type:Boolean,default:!1},width:{default:"auto"},maxWidth:{default:"300px"},offset:{default:8},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","show","hide","before-show","before-hide"],setup(n,{expose:E,emit:t}){const l=n,h=t,u=e.ref(),m=e.ref(),x=e.ref(),B=e.ref(!1),$=e.ref(),w=e.ref(),p=e.ref({});let y=null,k=null;const z=e.computed(()=>{if(!B.value||!$.value)return{};const A={};l.width!=="auto"&&(A.width=typeof l.width=="number"?`${l.width}px`:l.width),l.maxWidth&&(A.maxWidth=typeof l.maxWidth=="number"?`${l.maxWidth}px`:l.maxWidth);const{top:q,left:f}=K();return A.top=`${q}px`,A.left=`${f}px`,A}),W=e.computed(()=>{if(!l.showArrow)return{};if(Object.keys(p.value).length>0)return p.value;const A={};return l.placement.startsWith("top")||l.placement.startsWith("bottom")?A.left="50%":A.top="50%",A});function K(){var F,J;if(!$.value)return{top:0,left:0};const{width:A,height:q,top:f,left:i}=$.value,o=((F=x.value)==null?void 0:F.offsetWidth)||200,s=((J=x.value)==null?void 0:J.offsetHeight)||100;let d=0,g=0;switch(l.placement){case"top":d=f-s-l.offset,g=i+(A-o)/2;break;case"top-start":d=f-s-l.offset,g=i;break;case"top-end":d=f-s-l.offset,g=i+A-o;break;case"bottom":d=f+q+l.offset,g=i+(A-o)/2;break;case"bottom-start":d=f+q+l.offset,g=i;break;case"bottom-end":d=f+q+l.offset,g=i+A-o;break;case"left":d=f+(q-s)/2,g=i-o-l.offset;break;case"left-start":d=f,g=i-o-l.offset;break;case"left-end":d=f+q-s,g=i-o-l.offset;break;case"right":d=f+(q-s)/2,g=i+A+l.offset;break;case"right-start":d=f,g=i+A+l.offset;break;case"right-end":d=f+q-s,g=i+A+l.offset;break}const V=window.innerWidth,_=window.innerHeight;return g<8&&(g=8),g+o>V-8&&(g=V-o-8),d<8&&(d=8),d+s>_-8&&(d=_-s-8),{top:d,left:g}}function T(){l.disabled||B.value||(U(),l.openDelay>0?y=setTimeout(()=>{Y()},l.openDelay):Y())}function Y(){h("before-show"),B.value=!0,h("update:modelValue",!0),h("show"),e.nextTick(()=>{e.nextTick(()=>{S()})})}function j(){B.value&&(U(),l.closeDelay>0?k=setTimeout(()=>{X()},l.closeDelay):X())}function X(){h("before-hide"),B.value=!1,h("update:modelValue",!1),h("hide")}function U(){y&&(clearTimeout(y),y=null),k&&(clearTimeout(k),k=null)}function G(){if(!l.showArrow||!$.value||!x.value){p.value={};return}const A=$.value,q=x.value.getBoundingClientRect();if(q.width===0||q.height===0){const i={};l.placement.startsWith("top")||l.placement.startsWith("bottom")?i.left="50%":i.top="50%",p.value=i;return}const f={};if(l.placement.startsWith("top")){f.bottom="-6px";const i=A.left+A.width/2,o=q.left,s=i-o;f.left=`${Math.max(12,Math.min(s,q.width-12))}px`}else if(l.placement.startsWith("bottom")){f.top="-6px";const i=A.left+A.width/2,o=q.left,s=i-o;f.left=`${Math.max(12,Math.min(s,q.width-12))}px`}else if(l.placement.startsWith("left")){f.right="-6px";const i=A.top+A.height/2,o=q.top,s=i-o;f.top=`${Math.max(12,Math.min(s,q.height-12))}px`}else if(l.placement.startsWith("right")){f.left="-6px";const i=A.top+A.height/2,o=q.top,s=i-o;f.top=`${Math.max(12,Math.min(s,q.height-12))}px`}p.value=f}function S(){m.value&&($.value=m.value.getBoundingClientRect(),x.value&&(w.value=x.value.getBoundingClientRect(),G(),B.value&&requestAnimationFrame(()=>{x.value&&(w.value=x.value.getBoundingClientRect(),G())})))}function I(){l.disabled||l.trigger==="click"&&(B.value?j():T())}function M(){l.disabled||l.trigger!=="hover"||(U(),T())}function H(){l.disabled||l.trigger!=="hover"||j()}function Z(){l.disabled||l.trigger!=="hover"||U()}function P(){l.disabled||l.trigger!=="hover"||j()}function ee(A){if(!l.closeOnClickOutside||!B.value)return;const q=A.target;u.value&&!u.value.contains(q)&&x.value&&!x.value.contains(q)&&j()}return e.watch(()=>l.modelValue,A=>{A!==B.value&&(A?T():j())}),e.watch(B,A=>{A?(document.addEventListener("click",ee),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),e.nextTick(()=>{S(),requestAnimationFrame(()=>{S()}),setTimeout(()=>{S()},0)})):(document.removeEventListener("click",ee),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0))}),e.onMounted(()=>{l.modelValue&&T()}),e.onUnmounted(()=>{U(),document.removeEventListener("click",ee),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}),E({show:T,hide:j,updatePosition:S}),(A,q)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:u},[e.createElementVNode("div",{ref_key:"triggerRef",ref:m,onClick:I,onMouseenter:M,onMouseleave:H},[e.renderSlot(A.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:x,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${n.placement}`,{"ypopover__content--dark":n.dark,"ypopover__content--no-padding":!n.showPadding}]]),style:e.normalizeStyle(z.value),onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:Z,onMouseleave:P},[n.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${n.placement}`]),style:e.normalizeStyle(W.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",qt,[e.renderSlot(A.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),ze=le(Zt,[["__scopeId","data-v-be755399"]]),Qt={class:"relative"},Jt=["value","placeholder"],Xt={class:"nh-time-suffix"},Gt={class:"nh-time-shortcuts"},en={class:"nh-time-shortcuts-list"},tn=["onClick","onKeydown","onMouseenter"],nn={class:"nh-time-custom"},ln={class:"nh-time-custom-header"},on={class:"nh-time-selection-status"},an={key:0,class:"status-text"},sn={key:1,class:"status-text"},rn={key:2,class:"status-text status-complete"},cn={class:"nh-time-pickers"},dn={class:"nh-time-picker"},un={class:"nh-date-picker"},mn={class:"nh-date-picker-header"},fn={class:"nh-date-picker-header-label"},vn={class:"nh-date-picker-content"},hn={class:"nh-date-table"},pn=["onClick"],yn={class:"nh-date-table-cell"},gn={key:0},kn={class:"nh-time-picker"},wn={class:"nh-date-picker"},bn={class:"nh-date-picker-header"},En={class:"nh-date-picker-header-label"},Bn={class:"nh-date-picker-content"},Cn={class:"nh-date-table"},xn=["onClick"],Vn={class:"nh-date-table-cell"},Nn={key:0},Dn={class:"nh-time-actions"},Sn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const n=new Date,E=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:E,endDate:t}}},{label:"昨天",getValue:()=>{const n=new Date;n.setDate(n.getDate()-1);const E=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:E,endDate:t}}},{label:"近7天",getValue:()=>{const n=new Date,E=new Date;return E.setDate(E.getDate()-6),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}},{label:"近30天",getValue:()=>{const n=new Date,E=new Date;return E.setDate(E.getDate()-29),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}},{label:"近3个月",getValue:()=>{const n=new Date,E=new Date;return E.setMonth(E.getMonth()-3),E.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:E,endDate:n}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(!1),u=e.ref(-1),m=e.ref(-1),x=e.ref(null),B=e.ref(),$=e.ref(),w=e.ref({top:!0,left:!0}),p=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),y=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),k=()=>{const r=new Date(p.value.year,p.value.month).getTime(),v=new Date(y.value.year,y.value.month).getTime();if(r>=v){const N=new Date(p.value.year,p.value.month+1);y.value.year=N.getFullYear(),y.value.month=N.getMonth()}},z=()=>{const r=new Date(p.value.year,p.value.month).getTime();if(new Date(y.value.year,y.value.month).getTime()<=r){const N=new Date(y.value.year,y.value.month-1);p.value.year=N.getFullYear(),p.value.month=N.getMonth()}},W=["一","二","三","四","五","六","日"],K=e.ref(null),T=e.ref(null),Y=r=>{if(!r)return null;if(r instanceof Date)return r;if(typeof r=="number")return new Date(r);if(typeof r=="string"){const v=new Date(r);return isNaN(v.getTime())?null:v}return null},j=r=>{if(!r)return null;const v=r.getFullYear(),N=String(r.getMonth()+1).padStart(2,"0"),R=String(r.getDate()).padStart(2,"0");if(t.includeTime){const a=String(r.getHours()).padStart(2,"0"),c=String(r.getMinutes()).padStart(2,"0"),b=String(r.getSeconds()).padStart(2,"0");return`${v}-${N}-${R} ${a}:${c}:${b}`}else return`${v}-${N}-${R}`},X=r=>r?r.getTime():null,U=r=>r?{startDate:Y(r.startDate),endDate:Y(r.endDate)}:{startDate:null,endDate:null},G=r=>t.format==="string"?{startDate:j(r.startDate),endDate:j(r.endDate)}:t.format==="timestamp"?{startDate:X(r.startDate),endDate:X(r.endDate)}:r,S=(r,v)=>`${String(v+1).padStart(2,"0")}/${r}`,I=(r,v)=>r.getFullYear()===v.getFullYear()&&r.getMonth()===v.getMonth()&&r.getDate()===v.getDate(),M=(r,v,N)=>!v||!N?!1:r>=v&&r<=N,H=r=>{const v=U(r);if(!(v!=null&&v.startDate)||!(v!=null&&v.endDate))return-1;for(let N=0;N<t.shortcuts.length;N++){const R=t.shortcuts[N].getValue();if(R.startDate&&R.endDate&&v.startDate&&v.endDate){const a=new Date(v.startDate.getFullYear(),v.startDate.getMonth(),v.startDate.getDate()),c=new Date(v.endDate.getFullYear(),v.endDate.getMonth(),v.endDate.getDate()),b=new Date(R.startDate.getFullYear(),R.startDate.getMonth(),R.startDate.getDate()),C=new Date(R.endDate.getFullYear(),R.endDate.getMonth(),R.endDate.getDate());if(a.getTime()===b.getTime()&&c.getTime()===C.getTime())return N}}return-1},Z=(r,v)=>{const N=new Date(r,v,1),R=new Date(r,v+1,0),a=N.getDay(),c=R.getDate(),b=[],C=new Date,D=a===0?6:a-1,L=new Date(r,v,0);for(let Q=D-1;Q>=0;Q--){const oe=new Date(r,v-1,L.getDate()-Q);b.push({date:oe,day:oe.getDate(),isCurrentMonth:!1,isToday:I(oe,C),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let Q=1;Q<=c;Q++){const oe=new Date(r,v,Q);b.push({date:oe,day:Q,isCurrentMonth:!0,isToday:I(oe,C),isSelected:!1,isInRange:!1,isDisabled:!1})}const O=42-b.length;for(let Q=1;Q<=O;Q++){const oe=new Date(r,v+1,Q);b.push({date:oe,day:Q,isCurrentMonth:!1,isToday:I(oe,C),isSelected:!1,isInRange:!1,isDisabled:!0})}const te=[];for(let Q=0;Q<b.length;Q+=7)te.push(b.slice(Q,Q+7));return te},P=r=>{const v=G(r);l("update:modelValue",v),l("change",v)},ee=()=>{if(!B.value||!$.value)return;const r=B.value.getBoundingClientRect(),v=$.value.getBoundingClientRect(),N=window.innerWidth,a=window.innerHeight-r.bottom,c=r.top,b=v.height||400;a<b&&c>b?w.value.top=!1:w.value.top=!0;const C=N-r.left,D=v.width||640;C<D?w.value.left=!1:w.value.left=!0},A=()=>{if(h.value=!h.value,h.value){const r=U(t.modelValue);if(K.value=(r==null?void 0:r.startDate)||null,T.value=(r==null?void 0:r.endDate)||null,m.value=H(t.modelValue),u.value=-1,r!=null&&r.startDate&&(p.value.year=r.startDate.getFullYear(),p.value.month=r.startDate.getMonth()),r!=null&&r.endDate)y.value.year=r.endDate.getFullYear(),y.value.month=r.endDate.getMonth();else{const v=new Date(p.value.year,p.value.month+1);y.value.year=v.getFullYear(),y.value.month=v.getMonth()}k(),e.nextTick(()=>{ee()})}},q=r=>{const v=r.target,N=B.value,R=$.value;N&&R&&!N.contains(v)&&!R.contains(v)&&(h.value=!1,u.value=-1)},f=r=>{r.key==="Enter"||r.key===" "?(r.preventDefault(),A()):r.key==="ArrowDown"&&(r.preventDefault(),h.value=!0,e.nextTick(()=>{ee(),g()}))},i=r=>{var v;r.key==="Escape"&&(h.value=!1,u.value=-1,(v=B.value)==null||v.focus())},o=(r,v)=>{r.key==="ArrowDown"?(r.preventDefault(),u.value=Math.min(v+1,t.shortcuts.length-1),V(u.value)):r.key==="ArrowUp"?(r.preventDefault(),u.value=Math.max(v-1,0),V(u.value)):(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),_(t.shortcuts[v]))},s=r=>{u.value=r},d=()=>{u.value=-1},g=()=>{u.value=0,V(0)},V=r=>{if($.value){const N=$.value.querySelectorAll(".nh-time-shortcut")[r];N&&N.focus()}},_=r=>{const v=r.getValue();t.includeTime&&v.startDate&&v.endDate&&(v.startDate.setHours(0,0,0,0),v.endDate.setHours(23,59,59,999)),P(v),m.value=t.shortcuts.findIndex(N=>N.label===r.label),u.value=-1,h.value=!1},F=(r,v)=>{if(!r||r.isDisabled)return;let N;if(t.includeTime?(N=new Date(r.date),v==="start"||!K.value?N.setHours(0,0,0,0):N.setHours(23,59,59,999)):N=new Date(r.date.getFullYear(),r.date.getMonth(),r.date.getDate()),!K.value&&!T.value)K.value=N,T.value=null;else if(K.value&&!T.value)if(N>=K.value)t.includeTime&&N.setHours(23,59,59,999),T.value=N;else{const R=K.value;t.includeTime&&R.setHours(23,59,59,999),T.value=R,K.value=N}else K.value=N,T.value=null;if(m.value=-1,K.value&&T.value){const R=new Date(T.value);t.includeTime&&R.setHours(23,59,59,999),x.value={startDate:K.value,endDate:R}}else x.value=null},J=(r,v)=>{if(!r)return["nh-date-table-td"];const N=["nh-date-table-td"];return r.isCurrentMonth||N.push("is-prev-month"),r.isToday&&N.push("is-today"),r.isDisabled&&N.push("is-disabled"),K.value&&I(r.date,K.value)&&N.push("is-selected","is-start"),T.value&&I(r.date,T.value)&&N.push("is-selected","is-end"),K.value&&T.value&&M(r.date,K.value,T.value)&&N.push("is-in-range"),N},ne=()=>{x.value&&(t.includeTime&&x.value.endDate&&x.value.endDate.setHours(23,59,59,999),P(x.value),m.value=H(x.value),h.value=!1)},ae=()=>{P({startDate:null,endDate:null}),ve(),u.value=-1,h.value=!1},ue=()=>{h.value&&e.nextTick(()=>{ee()})},we=e.computed(()=>Z(p.value.year,p.value.month)),ce=e.computed(()=>Z(y.value.year,y.value.month)),re=e.computed(()=>{const r=U(t.modelValue);if(!r||!r.startDate||!r.endDate)return"";const v=a=>{const c=String(a.getFullYear()),b=String(a.getMonth()+1).padStart(2,"0"),C=String(a.getDate()).padStart(2,"0");return`${c}/${b}/${C}`},N=v(r.startDate),R=v(r.endDate);return!t.includeTime&&N===R?N:`${N} - ${R}`}),ie=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!w.value.top,"nh-time-dropdown-right":!w.value.left}]),me=e.computed(()=>{const r=U(t.modelValue);return!!(r!=null&&r.startDate&&(r!=null&&r.endDate))}),fe=e.computed(()=>!!(K.value&&T.value)),ve=()=>{K.value=null,T.value=null,x.value=null,m.value=-1};e.watch(()=>t.modelValue,r=>{const v=U(r);if(v!=null&&v.startDate){const N=v.startDate;p.value.year=N.getFullYear(),p.value.month=N.getMonth()}if(v!=null&&v.endDate){const N=v.endDate;y.value.year=N.getFullYear(),y.value.month=N.getMonth()}else if(v!=null&&v.startDate){const N=new Date(p.value.year,p.value.month+1);y.value.year=N.getFullYear(),y.value.month=N.getMonth()}(v!=null&&v.startDate||v!=null&&v.endDate)&&k(),h.value||(m.value=H(r))},{immediate:!0,deep:!0}),e.watch([p,y],()=>{const r=new Date(p.value.year,p.value.month).getTime(),v=new Date(y.value.year,y.value.month).getTime();if(r===v){const N=new Date(p.value.year,p.value.month+1);y.value.year=N.getFullYear(),y.value.month=N.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",q),window.addEventListener("resize",ue),window.addEventListener("scroll",ue),m.value=H(t.modelValue);const r=U(t.modelValue);if(r!=null&&r.startDate&&(p.value.year=r.startDate.getFullYear(),p.value.month=r.startDate.getMonth()),r!=null&&r.endDate)y.value.year=r.endDate.getFullYear(),y.value.month=r.endDate.getMonth();else{const v=new Date(p.value.year,p.value.month+1);y.value.year=v.getFullYear(),y.value.month=v.getMonth()}k()}),e.onUnmounted(()=>{document.removeEventListener("click",q),window.removeEventListener("resize",ue),window.removeEventListener("scroll",ue)});const ye=()=>{t.clearable&&(P({startDate:null,endDate:null}),ve(),u.value=-1)},de=(r,v)=>{if(r==="start"){const N=new Date(p.value.year,p.value.month+v,1);p.value.year=N.getFullYear(),p.value.month=N.getMonth(),k()}else{const N=new Date(y.value.year,y.value.month+v,1);y.value.year=N.getFullYear(),y.value.month=N.getMonth(),z()}};return(r,v)=>{const N=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${n.size}`]])},[e.createElementVNode("div",Qt,[e.createElementVNode("div",{ref_key:"trigger",ref:B,onClick:A,onKeydown:f,class:e.normalizeClass(["nh-time-trigger",{"is-focus":h.value,"has-value":me.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:re.value,placeholder:n.placeholder,class:"nh-time-input"},null,8,Jt),e.createElementVNode("span",Xt,[n.clearable&&me.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(ye,["stop"]),class:"nh-time-clear"},[...v[4]||(v[4]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1 1.9-11.2c1.5-1.2 3.3-1.9 5.2-1.9l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130.1 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0),v[6]||(v[6]=e.createElementVNode("i",{class:"nh-time-icon"},[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648 248v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h112v120H152V248h112v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h312zm184 584H192V424h640v408z",fill:"currentColor"})])],-1)),e.createElementVNode("i",{class:e.normalizeClass(["nh-time-arrow",{"is-reverse":h.value}])},[...v[5]||(v[5]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z",fill:"currentColor"})],-1)])],2)])],34),e.createVNode(e.Transition,{name:"el-zoom-in-top"},{default:e.withCtx(()=>[h.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:$,class:e.normalizeClass(ie.value),onKeydown:i},[e.createElementVNode("div",Gt,[v[7]||(v[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",en,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.shortcuts,(R,a)=>(e.openBlock(),e.createElementBlock("li",{key:R.label,onClick:c=>_(R),onKeydown:c=>o(c,a),onMouseenter:c=>s(a),onMouseleave:d,class:e.normalizeClass(["nh-time-shortcut",{"is-active":u.value===a,"is-selected":m.value===a}]),tabindex:"0"},e.toDisplayString(R.label),43,tn))),128))])]),e.createElementVNode("div",nn,[e.createElementVNode("div",ln,[v[8]||(v[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",on,[!K.value&&!T.value?(e.openBlock(),e.createElementBlock("span",an," 请选择开始日期 ")):K.value&&!T.value?(e.openBlock(),e.createElementBlock("span",sn," 请选择结束日期 ")):K.value&&T.value?(e.openBlock(),e.createElementBlock("span",rn," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",cn,[e.createElementVNode("div",dn,[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[e.createElementVNode("button",{onClick:v[0]||(v[0]=R=>de("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...v[9]||(v[9]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",fn,e.toDisplayString(S(p.value.year,p.value.month)),1),e.createElementVNode("button",{onClick:v[1]||(v[1]=R=>de("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...v[10]||(v[10]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",vn,[e.createElementVNode("table",hn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,R=>e.createElementVNode("th",{key:R,class:"nh-date-table-th"},e.toDisplayString(R),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(R,a)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${a}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(c,b)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${a}-${b}`,class:e.normalizeClass(J(c)),onClick:C=>F(c,"start")},[e.createElementVNode("div",yn,[c?(e.openBlock(),e.createElementBlock("span",gn,e.toDisplayString(c.day),1)):e.createCommentVNode("",!0)])],10,pn))),128))]))),128))])])])])]),e.createElementVNode("div",kn,[e.createElementVNode("div",wn,[e.createElementVNode("div",bn,[e.createElementVNode("button",{onClick:v[2]||(v[2]=R=>de("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...v[11]||(v[11]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",En,e.toDisplayString(S(y.value.year,y.value.month)),1),e.createElementVNode("button",{onClick:v[3]||(v[3]=R=>de("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...v[12]||(v[12]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",Bn,[e.createElementVNode("table",Cn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,R=>e.createElementVNode("th",{key:R,class:"nh-date-table-th"},e.toDisplayString(R),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(R,a)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${a}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(c,b)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${a}-${b}`,class:e.normalizeClass(J(c)),onClick:C=>F(c,"end")},[e.createElementVNode("div",Vn,[c?(e.openBlock(),e.createElementBlock("span",Nn,e.toDisplayString(c.day),1)):e.createCommentVNode("",!0)])],10,xn))),128))]))),128))])])])])])]),e.createElementVNode("div",Dn,[n.clearable?(e.openBlock(),e.createBlock(N,{key:0,onClick:ae,variant:"secondary",size:n.size},{default:e.withCtx(()=>[...v[13]||(v[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(N,{onClick:ne,disabled:!fe.value,variant:"primary",size:n.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value&&!T.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),xe=le(Sn,[["__scopeId","data-v-e5ef63b1"]]),$n=["aria-checked","aria-disabled","disabled","onKeydown"],_n={class:"yswitch__thumb"},Mn={key:0,class:"yswitch__spinner","aria-hidden":"true"},zn=e.defineComponent({__name:"yswitch",props:{modelValue:{default:!1},trueValue:{default:!0},falseValue:{default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"medium"},activeColor:{default:"#10b981"},inactiveColor:{default:"#e5e7eb"},activeText:{default:"开"},inactiveText:{default:"关"},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(),u=e.computed(()=>t.modelValue===t.trueValue),m=e.computed(()=>{const B={};return B.background=u.value?t.activeColor:t.inactiveColor,B});function x(){if(t.disabled||t.loading)return;const B=u.value?t.falseValue:t.trueValue;l("update:modelValue",B),l("change",B)}return e.onMounted(()=>{const B=h.value;B&&(B.addEventListener("focus",$=>l("focus",$)),B.addEventListener("blur",$=>l("blur",$)))}),(B,$)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:h,class:e.normalizeClass(["yswitch",[`yswitch--${n.size}`,{"yswitch--checked":u.value,"yswitch--disabled":n.disabled,"yswitch--loading":n.loading}]]),style:e.normalizeStyle(m.value),role:"switch","aria-checked":u.value,"aria-disabled":n.disabled,disabled:n.disabled||n.loading,onClick:x,onKeydown:[e.withKeys(e.withModifiers(x,["prevent"]),["enter"]),e.withKeys(e.withModifiers(x,["prevent"]),["space"])]},[$[0]||($[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",_n,[n.loading?(e.openBlock(),e.createElementBlock("span",Mn)):e.createCommentVNode("",!0)]),n.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!u.value,"yswitch__label--right":u.value}])},e.toDisplayString(u.value?n.activeText:n.inactiveText),3)):e.createCommentVNode("",!0)],46,$n))}}),Le=le(zn,[["__scopeId","data-v-0b157fc4"]]),Ln=["src","alt"],Tn=["src","alt"],In=e.defineComponent({__name:"yimage",props:{src:{},alt:{default:""},width:{},height:{},lazy:{type:Boolean,default:!0},preview:{type:Boolean,default:!0},fit:{default:"cover"},radius:{default:"0"},className:{default:""},previewSrcList:{}},emits:["load","error","preview"],setup(n,{expose:E,emit:t}){const l=n,h=t,u=e.ref(),m=e.ref(),x=e.ref(),B=e.ref(!1),$=e.ref(!1),w=e.ref(!1),p=e.ref(!1),y=e.ref(!1),k=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),z=e.ref(""),W=e.ref(1),K=e.ref(!1),T=e.ref({overflow:"",paddingRight:""}),Y={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},j=e.computed(()=>l.className||""),X=e.computed(()=>{if(typeof l.radius=="number")return`${l.radius}px`;if(typeof l.radius=="string"){if(/(px|%|rem|em)$/.test(l.radius))return l.radius;if(Y[l.radius])return Y[l.radius]}return""}),U=e.computed(()=>X.value?{borderRadius:X.value}:{}),G=e.computed(()=>["yimage-image",l.preview?"is-previewable":""].filter(Boolean).join(" ")),S=e.computed(()=>{const _={objectFit:l.fit||"cover",backgroundColor:"#fff"};return l.width&&(_.width=typeof l.width=="number"?`${l.width}px`:l.width),l.height&&(_.height=typeof l.height=="number"?`${l.height}px`:l.height),X.value&&(_.borderRadius=X.value),_}),I=e.computed(()=>z.value?z.value:Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),M=()=>{const _=document.createElement("div");_.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(_);const F=_.offsetWidth-_.clientWidth;return document.body.removeChild(_),F},H=()=>{if(T.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const F=M();document.body.style.paddingRight=`${F}px`}document.body.style.overflow="hidden"},Z=()=>{document.body.style.overflow=T.value.overflow,document.body.style.paddingRight=T.value.paddingRight};let P=null;const ee=()=>{!l.lazy||!u.value||(P=new IntersectionObserver(_=>{_.forEach(F=>{F.isIntersecting&&(p.value=!0,k.value=l.src,P==null||P.unobserve(F.target))})},{rootMargin:"50px"}),P.observe(u.value))},A=_=>{B.value=!0,$.value=!1,w.value=!1,h("load",_)},q=_=>{w.value=!0,$.value=!1,B.value=!1,h("error",_)},f=()=>{w.value=!1,$.value=!0,B.value=!1,e.nextTick(()=>{m.value&&(m.value.src=l.src)})},i=()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src,o=()=>{l.preview&&(l.previewSrcList||l.src)?s():f()},s=()=>{if(!l.preview)return;W.value=1;const _=i();if(m.value&&m.value.complete&&m.value.naturalWidth>0){z.value=_,e.nextTick(()=>{y.value=!0,H(),h("preview",_)});return}const F=new Image;let J=null,ne=!1;const ae=()=>{ne||(ne=!0,J&&(clearTimeout(J),J=null),z.value=_,e.nextTick(()=>{y.value=!0,H(),h("preview",_)}))};J=setTimeout(()=>{ae()},500),F.onload=()=>{ae()},F.onerror=()=>{ae()},F.src=_,F.complete&&ae()},d=()=>{y.value=!1,setTimeout(()=>{Z()},300)},g=_=>{const F=_.deltaY<0?1:-1;let ne=W.value+F*.1;ne=Math.max(.5,Math.min(2,ne)),W.value=ne};e.onMounted(()=>{l.lazy?ee():p.value=!0,p.value&&($.value=!0),K.value=!0}),e.onUnmounted(()=>{P&&P.disconnect(),y.value&&Z()});const V=()=>{l.src&&p.value&&($.value=!0,w.value=!1,B.value=!1)};return e.watch(()=>k.value,V),e.watch(()=>l.src,_=>{k.value=_||""}),E({retryLoad:f,closePreview:d}),(_,F)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:u,class:e.normalizeClass(["yimage-container",j.value])},[!B.value&&!w.value&&!p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(U.value)},[...F[1]||(F[1]=[e.createElementVNode("div",{class:"yimage-placeholder-content"},[e.createElementVNode("svg",{class:"yimage-placeholder-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)])],4)):e.createCommentVNode("",!0),$.value&&!w.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(U.value)},[...F[2]||(F[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(U.value),onClick:o},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:"yimage-error-image",style:e.normalizeStyle(U.value)},null,4)],4)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:m,src:k.value,alt:n.alt,class:e.normalizeClass(G.value),onLoad:A,onError:q,onClick:e.withModifiers(s,["stop"]),style:e.normalizeStyle(S.value)},null,46,Ln),[[e.vShow,B.value&&!w.value]]),l.preview&&(!B.value||$.value||w.value||!p.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(s,["stop"])})):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(d,["self"]),onWheel:e.withModifiers(g,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":y.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:x,src:I.value,alt:n.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${W.value})`}),onClick:F[0]||(F[0]=e.withModifiers(()=>{},["stop"]))},null,12,Tn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),Te=le(In,[["__scopeId","data-v-00c771d6"]]),Kn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(n){const E=n,t=e.ref(!1),l=e.ref();let h=null;const u=e.computed(()=>`y-dropdown__menu--${E.placement}`),m=e.computed(()=>{if(!E.menuWidth)return{};const y=typeof E.menuWidth=="number"?`${E.menuWidth}px`:E.menuWidth;return{width:y,minWidth:y,maxWidth:y}}),x=()=>{console.log("显示下拉菜单",t.value),!E.disabled&&(h&&(clearTimeout(h),h=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{$()}))},B=()=>{console.log("隐藏下拉菜单"),h=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},$=()=>{if(!l.value)return;const y=l.value.querySelector(".y-dropdown__trigger"),k=l.value.querySelector(".y-dropdown__menu");if(!y||!k)return;const z=y.getBoundingClientRect(),W=k.getBoundingClientRect(),K=window.innerWidth,T=window.innerHeight;k.style.top="",k.style.left="",k.style.right="",k.style.bottom="",k.style.transform="";let Y=0,j=0;switch(E.placement){case"bottom":Y=z.height+4,j=0;break;case"top":Y=-(W.height+4),j=0;break;case"right":Y=0,j=z.width+4;break;case"left":Y=0,j=-(W.width+4);break}let X=z.top+Y,U=z.left+j;if(E.placement==="bottom"||E.placement==="top"){const G=W.width||260;U+G>K-10&&(U=K-G-10),U<10&&(U=10)}if(E.placement==="left"||E.placement==="right"){const G=W.height||200;X+G>T-10&&(X=T-G-10),X<10&&(X=10)}k.style.top=`${X}px`,k.style.left=`${U}px`},w=y=>{E.trigger==="click"&&l.value&&!l.value.contains(y.target)&&(t.value=!1)},p=()=>{t.value&&$()};return e.onMounted(()=>{E.trigger==="click"&&document.addEventListener("click",w),window.addEventListener("resize",p),window.addEventListener("scroll",p)}),e.onUnmounted(()=>{E.trigger==="click"&&document.removeEventListener("click",w),h&&clearTimeout(h),window.removeEventListener("resize",p),window.removeEventListener("scroll",p)}),e.watch(()=>E.menuWidth,()=>{t.value&&e.nextTick(()=>{$()})}),(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:l},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:x,onMouseleave:B},[e.renderSlot(y.$slots,"trigger",{},()=>[k[0]||(k[0]=e.createElementVNode("button",{class:"y-dropdown__button"}," 下拉菜单 ",-1))],!0)],32),e.createVNode(e.Transition,{name:"dropdown-fade",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-dropdown__menu",u.value]),style:e.normalizeStyle(m.value),onMouseenter:x,onMouseleave:B},[e.renderSlot(y.$slots,"default",{},()=>[k[1]||(k[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),k[2]||(k[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),k[3]||(k[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),Ie=le(Kn,[["__scopeId","data-v-ada3172a"]]),Hn=["aria-hidden"],Fn=["onKeydown"],Rn={key:0,class:"y-drawer-header"},An={class:"y-drawer-title"},Wn={class:"y-drawer-body"},Yn={key:1,class:"y-drawer-footer"},Pn=e.defineComponent({__name:"ydrawer",props:{modelValue:{type:Boolean,default:!1},placement:{default:"right"},width:{default:"420px"},height:{default:"60vh"},title:{default:""},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:3e3},showHeader:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(n,{emit:E}){const t=n,l=E,h=e.computed({get:()=>t.modelValue,set:k=>l("update:modelValue",k)}),u=e.ref(null),m=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),x=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),B=e.computed(()=>{const k={};return t.placement==="right"?(k.width=typeof t.width=="number"?`${t.width}px`:String(t.width),k.height="100%",k.right="0",k.top="0"):(k.height=typeof t.height=="number"?`${t.height}px`:String(t.height),k.width="100%",k.bottom="0",k.left="0"),k});function $(){t.maskClosable&&w()}function w(){h.value&&(h.value=!1,l("close"))}function p(){t.closable&&w()}function y(k){k.key==="Escape"&&p()}return e.watch(()=>t.modelValue,k=>{k?(l("open"),requestAnimationFrame(()=>{var z;return(z=u.value)==null?void 0:z.focus()}),document.addEventListener("keydown",y),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",y),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",y),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",y),document.body.style.overflow=""}),(k,z)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!h.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:$}),e.createVNode(e.Transition,{name:m.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:u,class:e.normalizeClass(["y-drawer-panel",[`is-${n.placement}`,x.value]]),style:e.normalizeStyle(B.value),onKeydown:e.withKeys(e.withModifiers(p,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Rn,[e.createElementVNode("div",An,e.toDisplayString(n.title),1),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:w}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wn,[e.renderSlot(k.$slots,"default",{},void 0,!0)]),k.$slots.footer?(e.openBlock(),e.createElementBlock("div",Yn,[e.renderSlot(k.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Fn),[[e.vShow,h.value]])]),_:3},8,["name"])],12,Hn),[[e.vShow,h.value]])]))}}),Ke=le(Pn,[["__scopeId","data-v-b2797950"]]),On={class:"ytree__container"},jn=["data-level","onClick","onContextmenu"],Un=["onClick"],qn={key:1,class:"w-[16px]"},Zn=["onClick"],Qn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Jn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Xn=["src","alt"],Gn={class:"ytree-node__custom-content"},el={key:0,class:"ytree-node__children"},tl=["data-level","onClick","onContextmenu"],nl=["onClick"],ll={key:1,class:"w-[16px]"},ol=["onClick"],al={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},sl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},rl=["src","alt"],il={class:"ytree-node__custom-content"},cl={key:0,class:"ytree-node__children"},dl=["data-level","onClick","onContextmenu"],ul=["onClick"],ml={key:1,class:"w-[16px]"},fl=["onClick"],vl={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},hl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},pl=["src","alt"],yl={class:"ytree-node__custom-content"},gl={key:0,class:"ytree-node__children"},kl=["data-level","onClick","onContextmenu"],wl=["onClick"],bl={key:1,class:"w-[16px]"},El=["onClick"],Bl={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Cl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},xl=["src","alt"],Vl={class:"ytree-node__custom-content"},Nl={key:0,class:"ytree-node__children"},Dl=["data-level","onClick","onContextmenu"],Sl=["onClick"],$l={key:1,class:"w-[16px]"},_l=["onClick"],Ml={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},zl={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Ll=["src","alt"],Tl={class:"ytree-node__custom-content"},Il="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",Kl="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",Hl=e.defineComponent({__name:"ytree",props:{data:{default:()=>[]},emptyText:{default:"暂无数据"},nodeKey:{default:"id"},props:{default:()=>({children:"children",label:"label",disabled:"disabled",isLeaf:"isLeaf"})},renderAfterExpand:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!1},defaultExpandedKeys:{default:()=>[]},defaultCheckedKeys:{default:()=>[]},defaultSelectedKeys:{default:()=>[]},checkStrictly:{type:Boolean,default:!1},checkOnClickNode:{type:Boolean,default:!1},checkDescendants:{type:Boolean,default:!0},autoExpandParent:{type:Boolean,default:!0},defaultChecked:{type:Boolean,default:!1},filterNodeMethod:{},lazy:{type:Boolean,default:!1},load:{},renderContent:{},highlightCurrent:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0},currentNodeKey:{},accordion:{type:Boolean,default:!1},indent:{default:18},iconClass:{default:""},showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:{},allowDrop:{},size:{default:"medium"},disabled:{type:Boolean,default:!1},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},enableFourthLevelSpecialHandling:{type:Boolean,default:!1},restrictAutoExpandFromLevel:{default:void 0},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1}},emits:["node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop","checked-keys-change","child-node-click"],setup(n,{expose:E,emit:t}){const l=n,h=t,u=e.computed(()=>(console.log("ytree 组件接收到的数据:",l.data),l.data||[])),m=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set});e.provide("treeStore",m);const x=e.computed(()=>l.restrictAutoExpandFromLevel&&l.restrictAutoExpandFromLevel>0?l.restrictAutoExpandFromLevel:void 0);function B(f){return f[l.nodeKey]||f.id||Math.random()}function $(f){var i;return((i=l.props)!=null&&i.label?f[l.props.label]:void 0)||f.label||""}function w(f){var i;return!!((i=f==null?void 0:f.data)!=null&&i.isEmployee)}function p(f,i){var V;const o=l.deptIconUrl||Il,s=l.personIconUrl||Kl,d=l.buttonIconUrl||"",g=l.childStyleIconUrl||"";return i&&g&&W(f,i)?g:(V=f==null?void 0:f.data)!=null&&V.isButton&&d?d:w(f)?s:o}function y(f){var o;const i=((o=l.props)!=null&&o.children?f[l.props.children]:void 0)||f.children;return i&&i.length>0}function k(f){var i;return((i=l.props)!=null&&i.children?f[l.props.children]:void 0)||f.children||[]}function z(f,i,o=1){if(f===i)return o;const s=k(f);for(const d of s){const g=z(d,i,o+1);if(g>0)return g}return 0}function W(f,i){return!l.childStyleLevel||l.childStyleLevel<1?!1:z(i,f)===l.childStyleLevel}function K(f){const i=B(f);return m.value.expandedKeys.has(i)}function T(f){const i=B(f);if(m.value.checkedKeys.has(i)){if(y(f)){const s=k(f),d=s.filter(V=>T(V)),g=s.filter(V=>Y(V));return d.length===s.length&&g.length===0}return!0}if(y(f)){const s=k(f);return s.some(g=>Y(g))?!1:s.length>0&&s.every(g=>T(g))}return!1}function Y(f){if(!y(f))return!1;const i=k(f),o=i.filter(d=>T(d)),s=i.filter(d=>Y(d));return o.length===i.length?!1:o.length>0||s.length>0}function j(f){const i=B(f);return m.value.currentKey===i}function X(f){const i=B(f);return m.value.highlightedKeys.has(i)}function U(f){if(l.disabled)return;const i=B(f),s=!m.value.checkedKeys.has(i),d=new Set(m.value.expandedKeys);s?m.value.checkedKeys.add(i):m.value.checkedKeys.delete(i);function g(V,_){V.forEach(F=>{const J=B(F);_?m.value.checkedKeys.add(J):m.value.checkedKeys.delete(J),y(F)&&g(k(F),_)})}g(k(f),s),s&&G(),I(),m.value.expandedKeys=d,h("check-change",f,s,!1),h("check",f,s,!1),h("checked-keys-change",Array.from(m.value.checkedKeys))}function G(f){x.value&&console.log(`已启用从第${x.value}级开始不默认展开的限制(不主动收起已展开节点)`)}function S(f){const i=B(f);m.value.expandedKeys.has(i)?(m.value.expandedKeys.delete(i),h("node-collapse",f,f,null)):(m.value.expandedKeys.add(i),h("node-expand",f,f,null))}function I(){const f=[];function i(s){s.forEach(d=>{f.push(d),y(d)&&i(k(d))})}i(u.value);function o(s){if(y(s)){const d=k(s),g=B(s),V=d.filter(F=>T(F)),_=d.filter(F=>Y(F));V.length===d.length&&_.length===0||V.length>0||_.length>0?m.value.checkedKeys.add(g):m.value.checkedKeys.delete(g)}}for(let s=f.length-1;s>=0;s--)o(f[s])}function M(f,i,o,s){if(l.disabled)return;const d=s?W(f,s):!1;if(l.enableChildStyleCustomClick&&d){h("child-node-click",f,i,o);return}if(l.expandOnClickNode&&y(f)){S(f);return}m.value.currentNode=f,m.value.currentKey=B(f),l.showCheckbox&&U(f),h("node-click",f,i,o)}function H(f,i,o,s){l.disabled||h("node-contextmenu",f,i,o,s)}e.watch(()=>l.defaultExpandedKeys,f=>{if(f){const i=x.value;if(i){let o=function(V,_,F=1){for(const J of _){if(B(J)===V)return F;if(y(J)){const ne=o(V,k(J),F+1);if(ne>0)return ne}}return 0},s=function(V,_,F){V.forEach(J=>{_<F&&y(J)?(g.add(B(J)),s(k(J),_+1,F)):_<F&&y(J)})};const d=(f||[]).filter(V=>{const _=o(V,u.value,1);return _>0&&_<i}),g=new Set(d);s(u.value,1,i),m.value.expandedKeys.forEach(V=>{o(V,u.value,1)>=i&&g.add(V)}),m.value.expandedKeys=g}else m.value.expandedKeys=new Set(f)}},{immediate:!0});function Z(){if(l.defaultExpandAll){let f=function(s,d=1){s.forEach(g=>{if(!y(g))return;const V=k(g);if(o){if(d>=o)return;d+1===o||i.add(B(g)),f(V,d+1)}else i.add(B(g)),f(V,d+1)})};const i=new Set,o=x.value;f(u.value,1),m.value.expandedKeys=i}}function P(){if(l.defaultCheckedKeys&&l.defaultCheckedKeys.length>0){let f=function(d,g=[]){d.forEach(V=>{const _=B(V),F=[...g,_];i.has(_)&&g.forEach(J=>o.add(J)),y(V)&&f(k(V),F)})};const i=new Set(l.defaultCheckedKeys),o=new Set;f(u.value);const s=x.value;if(s){console.log(`已启用从第${s}级开始不默认展开:保持当前展开状态不变`);return}m.value.expandedKeys=o}}e.watch(()=>l.defaultExpandAll,Z,{immediate:!0}),e.watch(()=>u.value,Z,{deep:!0}),e.watch(()=>l.defaultCheckedKeys,f=>{f?(m.value.checkedKeys=new Set(f),l.enableFourthLevelSpecialHandling?console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态"):P()):m.value.checkedKeys.clear()},{immediate:!0});function ee(f){try{let i=function(d,g,V=[]){for(const _ of d){const F=B(_),J=[...V,F];if(F===g)return J;if(y(_)){const ne=i(k(_),g,J);if(ne)return ne}}return null};const o=Array.isArray(f)?f:[];if(o.length===0)return;m.value.highlightedKeys.clear();const s=new Set(m.value.expandedKeys);o.forEach(d=>{const g=i(u.value,d);g&&g.length>0&&(g.slice(0,-1).forEach(V=>s.add(V)),m.value.highlightedKeys.add(g[g.length-1]))}),m.value.expandedKeys=s}catch(i){console.warn("highlightAndExpandByIds 执行失败",i)}}function A(){m.value.highlightedKeys.clear()}function q(){m.value.currentNode=null,m.value.currentKey=null}return E({highlightAndExpandByIds:ee,clearHighlights:A,clearCurrentNode:q}),e.watch(()=>l.defaultSelectedKeys,f=>{f&&(m.value.selectedKeys=new Set(f))},{immediate:!0}),(f,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${n.size}`,{"ytree--disabled":n.disabled}]])},[e.createElementVNode("div",On,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,o=>(e.openBlock(),e.createElementBlock("div",{key:B(o),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(o),"ytree-node--highlight":X(o)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(o,o)}]),style:{paddingLeft:"8px"},"data-level":z(o,o),onClick:s=>M(o,o,null,o),onContextmenu:s=>H(s,o,o,null)},[y(o)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(o)}]),onClick:e.withModifiers(s=>S(o),["stop"])},[...i[0]||(i[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Un)):(e.openBlock(),e.createElementBlock("span",qn)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(o),"is-indeterminate":Y(o)}]),onClick:e.withModifiers(s=>U(o),["stop"])},[T(o)?(e.openBlock(),e.createElementBlock("svg",Qn,[...i[1]||(i[1]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(o)?(e.openBlock(),e.createElementBlock("svg",Jn,[...i[2]||(i[2]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Zn)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:p(o,o),alt:w(o)?"person":"dept"},null,8,Xn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(o)}])},e.toDisplayString($(o)),3),e.createElementVNode("div",Gn,[e.renderSlot(f.$slots,"node-content",{node:o,isCurrent:j(o),isExpanded:K(o),hasChildren:y(o)},void 0,!0)])],42,jn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[y(o)&&K(o)?(e.openBlock(),e.createElementBlock("div",el,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(o),s=>(e.openBlock(),e.createElementBlock("div",{key:B(s),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(s),"ytree-node--highlight":X(s)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(s,o)}]),style:{paddingLeft:"22px"},"data-level":z(o,s),onClick:d=>M(s,s,null,o),onContextmenu:d=>H(d,s,s,null)},[y(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(s)}]),onClick:e.withModifiers(d=>S(s),["stop"])},[...i[3]||(i[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,nl)):(e.openBlock(),e.createElementBlock("span",ll)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(s),"is-indeterminate":Y(s)}]),onClick:e.withModifiers(d=>U(s),["stop"])},[T(s)?(e.openBlock(),e.createElementBlock("svg",al,[...i[4]||(i[4]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(s)?(e.openBlock(),e.createElementBlock("svg",sl,[...i[5]||(i[5]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,ol)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:p(s,o),alt:w(s)?"person":"dept"},null,8,rl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(s)}])},e.toDisplayString($(s)),3),e.createElementVNode("div",il,[e.renderSlot(f.$slots,"node-content",{node:s,isCurrent:j(s),isExpanded:K(s),hasChildren:y(s)},void 0,!0)])],42,tl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[y(s)&&K(s)?(e.openBlock(),e.createElementBlock("div",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(s),d=>(e.openBlock(),e.createElementBlock("div",{key:B(d),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(d),"ytree-node--highlight":X(d)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(d,o)}]),style:{paddingLeft:"38px"},"data-level":z(o,d),onClick:g=>M(d,d,null,o),onContextmenu:g=>H(g,d,d,null)},[y(d)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(d)}]),onClick:e.withModifiers(g=>S(d),["stop"])},[...i[6]||(i[6]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,ul)):(e.openBlock(),e.createElementBlock("span",ml)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(d),"is-indeterminate":Y(d)}]),onClick:e.withModifiers(g=>U(d),["stop"])},[T(d)?(e.openBlock(),e.createElementBlock("svg",vl,[...i[7]||(i[7]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(d)?(e.openBlock(),e.createElementBlock("svg",hl,[...i[8]||(i[8]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,fl)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:p(d,o),alt:w(d)?"person":"dept"},null,8,pl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(d)}])},e.toDisplayString($(d)),3),e.createElementVNode("div",yl,[e.renderSlot(f.$slots,"node-content",{node:d,isCurrent:j(d),isExpanded:K(d),hasChildren:y(d)},void 0,!0)])],42,dl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[y(d)&&K(d)?(e.openBlock(),e.createElementBlock("div",gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(d),g=>(e.openBlock(),e.createElementBlock("div",{key:B(g),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(g),"ytree-node--highlight":X(g)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(g,o)}]),style:{paddingLeft:"54px"},"data-level":z(o,g),onClick:V=>M(g,g,null,o),onContextmenu:V=>H(V,g,g,null)},[y(g)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(g)}]),onClick:e.withModifiers(V=>S(g),["stop"])},[...i[9]||(i[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,wl)):(e.openBlock(),e.createElementBlock("span",bl)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(g),"is-indeterminate":Y(g)}]),onClick:e.withModifiers(V=>U(g),["stop"])},[T(g)?(e.openBlock(),e.createElementBlock("svg",Bl,[...i[10]||(i[10]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(g)?(e.openBlock(),e.createElementBlock("svg",Cl,[...i[11]||(i[11]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,El)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:p(g,o),alt:w(g)?"person":"dept"},null,8,xl),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(g)}])},e.toDisplayString($(g)),3),e.createElementVNode("div",Vl,[e.renderSlot(f.$slots,"node-content",{node:g,isCurrent:j(g),isExpanded:K(g),hasChildren:y(g)},void 0,!0)])],42,kl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[y(g)&&K(g)?(e.openBlock(),e.createElementBlock("div",Nl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(g),V=>(e.openBlock(),e.createElementBlock("div",{key:B(V),class:e.normalizeClass(["ytree-node",{"ytree-node--current":j(V)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(V,o)}]),style:{paddingLeft:"70px"},"data-level":z(o,V),onClick:_=>M(V,V,null,o),onContextmenu:_=>H(_,V,V,null)},[y(V)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":K(V)}]),onClick:e.withModifiers(_=>S(V),["stop"])},[...i[12]||(i[12]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Sl)):(e.openBlock(),e.createElementBlock("span",$l)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":T(V),"is-indeterminate":Y(V)}]),onClick:e.withModifiers(_=>U(V),["stop"])},[T(V)?(e.openBlock(),e.createElementBlock("svg",Ml,[...i[13]||(i[13]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):Y(V)?(e.openBlock(),e.createElementBlock("svg",zl,[...i[14]||(i[14]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,_l)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:p(V,o),alt:w(V)?"person":"dept"},null,8,Ll),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":w(V)}])},e.toDisplayString($(V)),3),e.createElementVNode("div",Tl,[e.renderSlot(f.$slots,"node-content",{node:V,isCurrent:j(V),isExpanded:K(V),hasChildren:y(V)},void 0,!0)])],42,Dl)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])],2))}}),He=le(Hl,[["__scopeId","data-v-6ab410ed"]]),Fl={class:"query-encapsulation"},Rl={class:"query-encapsulation__container"},Al={class:"query-encapsulation__content"},Wl={class:"query-encapsulation__fields"},Yl={class:"query-encapsulation__field-wrapper"},Pl={key:0,class:"query-encapsulation__field-label"},Ol={key:0,class:"query-encapsulation__toggle"},jl={class:"query-encapsulation__actions"},Ul={class:"query-encapsulation__actions-group"},ql=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(n,{emit:E}){const t=n,l=E,h=e.ref(!1),u=e.reactive({}),m=["select","date","daterange"];let x;const B=e.computed(()=>t.fields.filter(S=>!S.hidden)),$=e.computed(()=>h.value?B.value:B.value.slice(0,t.maxVisibleFields)),w=e.computed(()=>B.value.length>t.maxVisibleFields);function p(S){switch(S){case"select":return Ce;case"date":case"daterange":return xe;case"input":default:return Be}}function y(S,I){u[S]=I;const M=t.fields.find(H=>H.key===S);M&&k(M)}function k(S){l("field-change",S,u[S.key]),l("update:modelValue",{...u}),m.includes(S.type)&&j()}function z(){const S=X(u),I=U(S),M={...u};l("search",{data:I,raw:M})}function W(){Object.keys(u).forEach(S=>{const I=t.fields.find(M=>M.key===S);(I==null?void 0:I.type)==="daterange"?u[S]={startDate:null,endDate:null}:(I==null?void 0:I.type)==="date"?u[S]=null:u[S]=""}),l("reset"),l("update:modelValue",{...u})}function K(){h.value=!h.value}function T(S){return S.type!=="input"?{}:{enter:()=>Y(),paste:()=>Y()}}async function Y(){await e.nextTick(),z()}function j(){x&&clearTimeout(x),x=setTimeout(()=>{x=void 0,e.nextTick().then(()=>z())},0)}function X(S){const I={};return Object.keys(S).forEach(M=>{const H=t.fields.find(ee=>ee.key===M),Z=S[M],P=typeof Z=="string"?Z.trim():Z;if(!(P==null||P==="")){if(typeof P=="object"&&P.startDate&&P.endDate){P.startDate&&P.endDate&&(I[M]=P);return}if(H&&(H.type==="date"||H.type==="daterange")){P!==0&&(I[M]=P);return}I[M]=P}}),I}function U(S){const I={};return Object.keys(S).forEach(M=>{const H=S[M],Z=t.fields.find(P=>P.key===M);if(Z)if(Z.type==="daterange"&&typeof H=="object"){const P=Z.startKey||`${M}Start`,ee=Z.endKey||`${M}End`;H.startDate&&H.endDate&&H.startDate!==0&&H.endDate!==0&&(Z.format==="timestamp"?(I[P]=new Date(H.startDate).getTime(),I[ee]=new Date(H.endDate).getTime()):(I[P]=H.startDate,I[ee]=H.endDate))}else Z.type==="date"&&H&&H!==0&&Z.format==="timestamp"?I[M]=new Date(H).getTime():I[M]=H;else I[M]=H}),I}function G(){t.fields.forEach(S=>{var I,M,H;u[S.key]===void 0&&(S.type==="daterange"?u[S.key]=((I=t.modelValue)==null?void 0:I[S.key])||{startDate:null,endDate:null}:S.type==="date"?u[S.key]=((M=t.modelValue)==null?void 0:M[S.key])||null:u[S.key]=((H=t.modelValue)==null?void 0:H[S.key])||"")})}return e.watch(()=>t.modelValue,S=>{S&&Object.assign(u,S)},{deep:!0,immediate:!0}),e.onMounted(()=>{G()}),e.onBeforeUnmount(()=>{x&&(clearTimeout(x),x=void 0)}),(S,I)=>(e.openBlock(),e.createElementBlock("div",Fl,[e.createElementVNode("div",Rl,[e.createElementVNode("div",Al,[e.createElementVNode("div",Wl,[e.createVNode(e.TransitionGroup,{name:"qf",tag:"div",class:"query-encapsulation__fields-group"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,M=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:"query-encapsulation__field-item"},[e.renderSlot(S.$slots,`field-${M.key}`,{field:M,value:u[M.key],updateValue:H=>y(M.key,H)},()=>[e.createElementVNode("div",Yl,[n.Iflabel?(e.openBlock(),e.createElementBlock("label",Pl,e.toDisplayString(M.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p(M.type)),e.mergeProps({modelValue:u[M.key],"onUpdate:modelValue":H=>u[M.key]=H,placeholder:M.placeholder||`请输入${M.label}`,options:M.options,clearable:M.clearable!==!1,size:M.size||"small",width:M.width||"180px",format:M.format||"timestamp","include-time":M.includeTime||!1,filterable:M.filterable===!0},e.toHandlers(T(M)),{onInput:H=>k(M),onChange:H=>k(M)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","onInput","onChange"]))])],!0)]))),128))]),_:3}),w.value?(e.openBlock(),e.createElementBlock("div",Ol,[e.createVNode(he,{variant:"secondary",size:"small",onClick:K},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":h.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",jl,[e.createElementVNode("div",Ul,[e.createVNode(he,{variant:"primary",size:"small",onClick:z,loading:n.loading},{default:e.withCtx(()=>[...I[0]||(I[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(he,{variant:"secondary",size:"small",onClick:W,loading:n.loading},{default:e.withCtx(()=>[...I[1]||(I[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(S.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),Fe=le(ql,[["__scopeId","data-v-73456475"]]),Zl={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Ql={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Jl={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Xl=["textContent"],Gl=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(n){const E=n,t=e.ref(!1);let l;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,E.duration&&E.duration>0&&(l=window.setTimeout(()=>h(),E.duration))})}),e.onBeforeUnmount(()=>{l&&window.clearTimeout(l)});function h(){t.value=!1}function u(){var m;(m=E.onClose)==null||m.call(E,E.id)}return(m,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:u},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${n.type}`]]),style:e.normalizeStyle({zIndex:n.zIndex}),role:"status","aria-live":"polite"},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${n.type}`]),"aria-hidden":"true"},[n.type==="success"?(e.openBlock(),e.createElementBlock("svg",Zl,[...x[0]||(x[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Ql,[...x[1]||(x[1]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Jl,[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],2),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(n.message)},null,8,Xl),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:h},"✕")):e.createCommentVNode("",!0)],6),[[e.vShow,t.value]])]),_:1}))}}),eo=le(Gl,[["__scopeId","data-v-c5dc221c"]]);let to=1;const Ee=12,se=[];function no(){let n=20;return se.forEach(E=>{n+=E.height+Ee}),n}function Ne(n){const E=se.findIndex(u=>u.id===n);if(E===-1)return;const{el:t}=se[E],l=t.firstElementChild;if(l){const u=window.getComputedStyle(l).top;l.style.top=u,l.classList.add("is-leaving"),l.style.willChange="opacity, transform"}se[E].leaving=!0,ke(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const u=se.findIndex(m=>m.id===n);u!==-1&&se.splice(u,1),ke()},260)}function be(n){var u;const E=to++,t=document.createElement("div");document.body.appendChild(t);const l=e.createVNode(eo,{id:E,type:n.type||"success",message:n.message,duration:n.duration??2500,offset:no(),zIndex:3e3+E,closable:n.closable??!1,onClose:m=>Ne(m)});e.render(l,t);const h=((u=t.firstElementChild)==null?void 0:u.offsetHeight)||0;return se.push({id:E,el:t,vm:l,height:h,leaving:!1}),ke(),requestAnimationFrame(()=>{const m=t.firstElementChild;if(!m)return;const x=m.offsetHeight||h||0,B=se.find($=>$.id===E);B&&(B.height=x,ke())}),{close:()=>Ne(E)}}const pe={success(n,E={}){return be({...E,type:"success",message:n})},warning(n,E={}){return be({...E,type:"warning",message:n})},error(n,E={}){return be({...E,type:"error",message:n})}};typeof window<"u"&&(window.YMessage=pe,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=pe));function ke(){let n=20;se.forEach(E=>{const t=E.el.firstElementChild;if(!t)return;const l=n;if(t.style.transform=`translate(-50%, ${l}px)`,t.style.top||(t.style.top="0px"),!E.leaving)n+=(t.offsetHeight||E.height)+Ee;else{const h=t.offsetHeight||E.height;n+=h+Ee}})}const De={YButton:he,YInput:Be,YTable:Se,YSelect:Ce,YPagination:$e,YBadge:_e,YDialog:Me,YPopover:ze,YTime:xe,YSwitch:Le,YImage:Te,YDropdown:Ie,YDrawer:Ke,YTree:He,QueryEncapsulation:Fe},lo={install(n){Object.keys(De).forEach(E=>{n.component(E,De[E])}),n.config.globalProperties.$message=pe,typeof window<"u"&&(window.YMessage=pe)}};exports.QueryEncapsulation=Fe;exports.YBadge=_e;exports.YButton=he;exports.YDialog=Me;exports.YDrawer=Ke;exports.YDropdown=Ie;exports.YImage=Te;exports.YInput=Be;exports.YMessage=pe;exports.YPagination=$e;exports.YPopover=ze;exports.YSelect=Ce;exports.YSwitch=Le;exports.YTable=Se;exports.YTime=xe;exports.YTree=He;exports.default=lo;
2
2
  //# sourceMappingURL=index.cjs.js.map