medicine/Medicine-Server/uploadRes/admin/assets/Selection-35940256.js

224 lines
37 KiB
JavaScript

import{d as q,bQ as Ee,o as le,dc as Lt,df as Nt,j as H,r as O,a3 as Mt,bM as ye,bv as J,h as g,q as Bt,bn as xe,v as Pe,an as Kt,em as Ce,m as Wt,b as P,x as R,g as Q,u as Ht,k as oe,bG as Dt,D as Gt,en as Vt,ba as re,n as _e,N as jt,E as Se,e as Z,t as ce,bH as Ut,a2 as ee,i as de,w as Yt,eo as Zt,G as qt}from"./index-616702d4.js";import{d as Fe,e as ne,_ as Xt}from"./Popover-d05722bc.js";import{b as Qt}from"./next-frame-once-7035a838.js";import{a as Jt}from"./Eye-8736ca10.js";import{N as en}from"./Input-c4d1ad6c.js";import{N as ue}from"./Tag-7d12dac1.js";function Wn(e,n){let{target:t}=e;for(;t;){if(t.dataset&&t.dataset[n]!==void 0)return!0;t=t.parentElement}return!1}function tn(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Te(e){return e&-e}class nn{constructor(n,t){this.l=n,this.min=t;const o=new Array(n+1);for(let i=0;i<n+1;++i)o[i]=0;this.ft=o}add(n,t){if(t===0)return;const{l:o,ft:i}=this;for(n+=1;n<=o;)i[n]+=t,n+=Te(n)}get(n){return this.sum(n+1)-this.sum(n)}sum(n){if(n===void 0&&(n=this.l),n<=0)return 0;const{ft:t,min:o,l:i}=this;if(n>i)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=n*o;for(;n>0;)a+=t[n],n-=Te(n);return a}getBound(n){let t=0,o=this.l;for(;o>t;){const i=Math.floor((t+o)/2),a=this.sum(i);if(a>n){o=i;continue}else if(a<n){if(t===i)return this.sum(t+1)<=n?t+1:i;t=i}else return i}return t}}let te;function on(){return te===void 0&&("matchMedia"in window?te=window.matchMedia("(pointer:coarse)").matches:te=!1),te}let fe;function ke(){return fe===void 0&&(fe="chrome"in window?window.devicePixelRatio:1),fe}const rn=ne(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[ne("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[ne("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Hn=q({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const n=Ee();rn.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Fe,ssr:n}),le(()=>{const{defaultScrollIndex:u,defaultScrollKey:h}=e;u!=null?w({index:u}):h!=null&&w({key:h})});let t=!1,o=!1;Lt(()=>{if(t=!1,!o){o=!0;return}w({top:d.value,left:f})}),Nt(()=>{t=!0,o||(o=!0)});const i=H(()=>{const u=new Map,{keyField:h}=e;return e.items.forEach((S,$)=>{u.set(S[h],$)}),u}),a=O(null),s=O(void 0),r=new Map,m=H(()=>{const{items:u,itemSize:h,keyField:S}=e,$=new nn(u.length,h);return u.forEach((N,B)=>{const F=N[S],W=r.get(F);W!==void 0&&$.add(B,W)}),$}),c=O(0);let f=0;const d=O(0),y=Mt(()=>Math.max(m.value.getBound(d.value-ye(e.paddingTop))-1,0)),z=H(()=>{const{value:u}=s;if(u===void 0)return[];const{items:h,itemSize:S}=e,$=y.value,N=Math.min($+Math.ceil(u/S+1),h.length-1),B=[];for(let F=$;F<=N;++F)B.push(h[F]);return B}),w=(u,h)=>{if(typeof u=="number"){x(u,h,"auto");return}const{left:S,top:$,index:N,key:B,position:F,behavior:W,debounce:D=!0}=u;if(S!==void 0||$!==void 0)x(S,$,W);else if(N!==void 0)T(N,W,D);else if(B!==void 0){const V=i.value.get(B);V!==void 0&&T(V,W,D)}else F==="bottom"?x(0,Number.MAX_SAFE_INTEGER,W):F==="top"&&x(0,0,W)};let I,E=null;function T(u,h,S){const{value:$}=m,N=$.sum(u)+ye(e.paddingTop);if(!S)a.value.scrollTo({left:0,top:N,behavior:h});else{I=u,E!==null&&window.clearTimeout(E),E=window.setTimeout(()=>{I=void 0,E=null},16);const{scrollTop:B,offsetHeight:F}=a.value;if(N>B){const W=$.get(u);N+W<=B+F||a.value.scrollTo({left:0,top:N+W-F,behavior:h})}else a.value.scrollTo({left:0,top:N,behavior:h})}}function x(u,h,S){a.value.scrollTo({left:u,top:h,behavior:S})}function _(u,h){var S,$,N;if(t||e.ignoreItemResize||k(h.target))return;const{value:B}=m,F=i.value.get(u),W=B.get(F),D=(N=($=(S=h.borderBoxSize)===null||S===void 0?void 0:S[0])===null||$===void 0?void 0:$.blockSize)!==null&&N!==void 0?N:h.contentRect.height;if(D===W)return;D-e.itemSize===0?r.delete(u):r.set(u,D-e.itemSize);const j=D-W;if(j===0)return;B.add(F,j);const G=a.value;if(G!=null){if(I===void 0){const X=B.sum(F);G.scrollTop>X&&G.scrollBy(0,j)}else if(F<I)G.scrollBy(0,j);else if(F===I){const X=B.sum(F);D+X>G.scrollTop+G.offsetHeight&&G.scrollBy(0,j)}K()}c.value++}const b=!on();let p=!1;function C(u){var h;(h=e.onScroll)===null||h===void 0||h.call(e,u),(!b||!p)&&K()}function L(u){var h;if((h=e.onWheel)===null||h===void 0||h.call(e,u),b){const S=a.value;if(S!=null){if(u.deltaX===0&&(S.scrollTop===0&&u.deltaY<=0||S.scrollTop+S.offsetHeight>=S.scrollHeight&&u.deltaY>=0))return;u.preventDefault(),S.scrollTop+=u.deltaY/ke(),S.scrollLeft+=u.deltaX/ke(),K(),p=!0,Qt(()=>{p=!1})}}}function A(u){if(t||k(u.target)||u.contentRect.height===s.value)return;s.value=u.contentRect.height;const{onResize:h}=e;h!==void 0&&h(u)}function K(){const{value:u}=a;u!=null&&(d.value=u.scrollTop,f=u.scrollLeft)}function k(u){let h=u;for(;h!==null;){if(h.style.display==="none")return!0;h=h.parentElement}return!1}return{listHeight:s,listStyle:{overflow:"auto"},keyToIndex:i,itemsStyle:H(()=>{const{itemResizable:u}=e,h=J(m.value.sum());return c.value,[e.itemsStyle,{boxSizing:"content-box",height:u?"":h,minHeight:u?h:"",paddingTop:J(e.paddingTop),paddingBottom:J(e.paddingBottom)}]}),visibleItemsStyle:H(()=>(c.value,{transform:`translateY(${J(m.value.sum(y.value))})`})),viewportItems:z,listElRef:a,itemsElRef:O(null),scrollTo:w,handleListResize:A,handleListScroll:C,handleListWheel:L,handleItemResize:_}},render(){const{itemResizable:e,keyField:n,keyToIndex:t,visibleItemsTag:o}=this;return g(xe,{onResize:this.handleListResize},{default:()=>{var i,a;return g("div",Bt(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?g("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[g(o,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(s=>{const r=s[n],m=t.get(r),c=this.$slots.default({item:s,index:m})[0];return e?g(xe,{key:r,onResize:f=>this.handleItemResize(r,f)},{default:()=>c}):(c.key=r,c)})})]):(a=(i=this.$slots).empty)===null||a===void 0?void 0:a.call(i)])}})}}),U="v-hidden",ln=ne("[v-hidden]",{display:"none!important"}),Ie=q({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateOverflow:Function},setup(e,{slots:n}){const t=O(null),o=O(null);function i(){const{value:s}=t,{getCounter:r,getTail:m}=e;let c;if(r!==void 0?c=r():c=o.value,!s||!c)return;c.hasAttribute(U)&&c.removeAttribute(U);const{children:f}=s,d=s.offsetWidth,y=[],z=n.tail?m==null?void 0:m():null;let w=z?z.offsetWidth:0,I=!1;const E=s.children.length-(n.tail?1:0);for(let x=0;x<E-1;++x){if(x<0)continue;const _=f[x];if(I){_.hasAttribute(U)||_.setAttribute(U,"");continue}else _.hasAttribute(U)&&_.removeAttribute(U);const b=_.offsetWidth;if(w+=b,y[x]=b,w>d){const{updateCounter:p}=e;for(let C=x;C>=0;--C){const L=E-1-C;p!==void 0?p(L):c.textContent=`${L}`;const A=c.offsetWidth;if(w-=y[C],w+A<=d||C===0){I=!0,x=C-1,z&&(x===-1?(z.style.maxWidth=`${d-A}px`,z.style.boxSizing="border-box"):z.style.maxWidth="");break}}}}const{onUpdateOverflow:T}=e;I?T!==void 0&&T(!0):(T!==void 0&&T(!1),c.setAttribute(U,""))}const a=Ee();return ln.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Fe,ssr:a}),le(i),{selfRef:t,counterRef:o,sync:i}},render(){const{$slots:e}=this;return Pe(this.sync),g("div",{class:"v-overflow",ref:"selfRef"},[Kt(e,"default"),e.counter?e.counter():g("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function sn(e,n){n&&(le(()=>{const{value:t}=e;t&&Ce.registerHandler(t,n)}),Wt(()=>{const{value:t}=e;t&&Ce.unregisterHandler(t)}))}const an=q({name:"Empty",render(){return g("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),g("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),Dn=q({props:{onFocus:Function,onBlur:Function},setup(e){return()=>g("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function ze(e){return Array.isArray(e)?e:[e]}const ge={STOP:"STOP"};function Oe(e,n){const t=n(e);e.children!==void 0&&t!==ge.STOP&&e.children.forEach(o=>Oe(o,n))}function cn(e,n={}){const{preserveGroup:t=!1}=n,o=[],i=t?s=>{s.isLeaf||(o.push(s.key),a(s.children))}:s=>{s.isLeaf||(s.isGroup||o.push(s.key),a(s.children))};function a(s){s.forEach(i)}return a(e),o}function dn(e,n){const{isLeaf:t}=e;return t!==void 0?t:!n(e)}function un(e){return e.children}function fn(e){return e.key}function hn(){return!1}function vn(e,n){const{isLeaf:t}=e;return!(t===!1&&!Array.isArray(n(e)))}function bn(e){return e.disabled===!0}function gn(e,n){return e.isLeaf===!1&&!Array.isArray(n(e))}function he(e){var n;return e==null?[]:Array.isArray(e)?e:(n=e.checkedKeys)!==null&&n!==void 0?n:[]}function ve(e){var n;return e==null||Array.isArray(e)?[]:(n=e.indeterminateKeys)!==null&&n!==void 0?n:[]}function pn(e,n){const t=new Set(e);return n.forEach(o=>{t.has(o)||t.add(o)}),Array.from(t)}function mn(e,n){const t=new Set(e);return n.forEach(o=>{t.has(o)&&t.delete(o)}),Array.from(t)}function wn(e){return(e==null?void 0:e.type)==="group"}function Gn(e){const n=new Map;return e.forEach((t,o)=>{n.set(t.key,o)}),t=>{var o;return(o=n.get(t))!==null&&o!==void 0?o:null}}class yn extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function xn(e,n,t,o){return ie(n.concat(e),t,o,!1)}function Cn(e,n){const t=new Set;return e.forEach(o=>{const i=n.treeNodeMap.get(o);if(i!==void 0){let a=i.parent;for(;a!==null&&!(a.disabled||t.has(a.key));)t.add(a.key),a=a.parent}}),t}function Sn(e,n,t,o){const i=ie(n,t,o,!1),a=ie(e,t,o,!0),s=Cn(e,t),r=[];return i.forEach(m=>{(a.has(m)||s.has(m))&&r.push(m)}),r.forEach(m=>i.delete(m)),i}function be(e,n){const{checkedKeys:t,keysToCheck:o,keysToUncheck:i,indeterminateKeys:a,cascade:s,leafOnly:r,checkStrategy:m,allowNotLoaded:c}=e;if(!s)return o!==void 0?{checkedKeys:pn(t,o),indeterminateKeys:Array.from(a)}:i!==void 0?{checkedKeys:mn(t,i),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(t),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:f}=n;let d;i!==void 0?d=Sn(i,t,n,c):o!==void 0?d=xn(o,t,n,c):d=ie(t,n,c,!1);const y=m==="parent",z=m==="child"||r,w=d,I=new Set,E=Math.max.apply(null,Array.from(f.keys()));for(let T=E;T>=0;T-=1){const x=T===0,_=f.get(T);for(const b of _){if(b.isLeaf)continue;const{key:p,shallowLoaded:C}=b;if(z&&C&&b.children.forEach(k=>{!k.disabled&&!k.isLeaf&&k.shallowLoaded&&w.has(k.key)&&w.delete(k.key)}),b.disabled||!C)continue;let L=!0,A=!1,K=!0;for(const k of b.children){const u=k.key;if(!k.disabled){if(K&&(K=!1),w.has(u))A=!0;else if(I.has(u)){A=!0,L=!1;break}else if(L=!1,A)break}}L&&!K?(y&&b.children.forEach(k=>{!k.disabled&&w.has(k.key)&&w.delete(k.key)}),w.add(p)):A&&I.add(p),x&&z&&w.has(p)&&w.delete(p)}}return{checkedKeys:Array.from(w),indeterminateKeys:Array.from(I)}}function ie(e,n,t,o){const{treeNodeMap:i,getChildren:a}=n,s=new Set,r=new Set(e);return e.forEach(m=>{const c=i.get(m);c!==void 0&&Oe(c,f=>{if(f.disabled)return ge.STOP;const{key:d}=f;if(!s.has(d)&&(s.add(d),r.add(d),gn(f.rawNode,a))){if(o)return ge.STOP;if(!t)throw new yn}})}),r}function Tn(e,{includeGroup:n=!1,includeSelf:t=!0},o){var i;const a=o.treeNodeMap;let s=e==null?null:(i=a.get(e))!==null&&i!==void 0?i:null;const r={keyPath:[],treeNodePath:[],treeNode:s};if(s!=null&&s.ignored)return r.treeNode=null,r;for(;s;)!s.ignored&&(n||!s.isGroup)&&r.treeNodePath.push(s),s=s.parent;return r.treeNodePath.reverse(),t||r.treeNodePath.pop(),r.keyPath=r.treeNodePath.map(m=>m.key),r}function kn(e){if(e.length===0)return null;const n=e[0];return n.isGroup||n.ignored||n.disabled?n.getNext():n}function In(e,n){const t=e.siblings,o=t.length,{index:i}=e;return n?t[(i+1)%o]:i===t.length-1?null:t[i+1]}function Re(e,n,{loop:t=!1,includeDisabled:o=!1}={}){const i=n==="prev"?zn:In,a={reverse:n==="prev"};let s=!1,r=null;function m(c){if(c!==null){if(c===e){if(!s)s=!0;else if(!e.disabled&&!e.isGroup){r=e;return}}else if((!c.disabled||o)&&!c.ignored&&!c.isGroup){r=c;return}if(c.isGroup){const f=pe(c,a);f!==null?r=f:m(i(c,t))}else{const f=i(c,!1);if(f!==null)m(f);else{const d=Rn(c);d!=null&&d.isGroup?m(i(d,t)):t&&m(i(c,!0))}}}}return m(e),r}function zn(e,n){const t=e.siblings,o=t.length,{index:i}=e;return n?t[(i-1+o)%o]:i===0?null:t[i-1]}function Rn(e){return e.parent}function pe(e,n={}){const{reverse:t=!1}=n,{children:o}=e;if(o){const{length:i}=o,a=t?i-1:0,s=t?-1:i,r=t?-1:1;for(let m=a;m!==s;m+=r){const c=o[m];if(!c.disabled&&!c.ignored)if(c.isGroup){const f=pe(c,n);if(f!==null)return f}else return c}}return null}const En={getChild(){return this.ignored?null:pe(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Re(this,"next",e)},getPrev(e={}){return Re(this,"prev",e)}};function Pn(e,n){const t=n?new Set(n):void 0,o=[];function i(a){a.forEach(s=>{o.push(s),!(s.isLeaf||!s.children||s.ignored)&&(s.isGroup||t===void 0||t.has(s.key))&&i(s.children)})}return i(e),o}function _n(e,n){const t=e.key;for(;n;){if(n.key===t)return!0;n=n.parent}return!1}function Ae(e,n,t,o,i,a=null,s=0){const r=[];return e.forEach((m,c)=>{var f;const d=Object.create(o);if(d.rawNode=m,d.siblings=r,d.level=s,d.index=c,d.isFirstChild=c===0,d.isLastChild=c+1===e.length,d.parent=a,!d.ignored){const y=i(m);Array.isArray(y)&&(d.children=Ae(y,n,t,o,i,d,s+1))}r.push(d),n.set(d.key,d),t.has(s)||t.set(s,[]),(f=t.get(s))===null||f===void 0||f.push(d)}),r}function Vn(e,n={}){var t;const o=new Map,i=new Map,{getDisabled:a=bn,getIgnored:s=hn,getIsGroup:r=wn,getKey:m=fn}=n,c=(t=n.getChildren)!==null&&t!==void 0?t:un,f=n.ignoreEmptyChildren?b=>{const p=c(b);return Array.isArray(p)?p.length?p:null:p}:c,d=Object.assign({get key(){return m(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return r(this.rawNode)},get isLeaf(){return dn(this.rawNode,f)},get shallowLoaded(){return vn(this.rawNode,f)},get ignored(){return s(this.rawNode)},contains(b){return _n(this,b)}},En),y=Ae(e,o,i,d,f);function z(b){if(b==null)return null;const p=o.get(b);return p&&!p.isGroup&&!p.ignored?p:null}function w(b){if(b==null)return null;const p=o.get(b);return p&&!p.ignored?p:null}function I(b,p){const C=w(b);return C?C.getPrev(p):null}function E(b,p){const C=w(b);return C?C.getNext(p):null}function T(b){const p=w(b);return p?p.getParent():null}function x(b){const p=w(b);return p?p.getChild():null}const _={treeNodes:y,treeNodeMap:o,levelTreeNodeMap:i,maxLevel:Math.max(...i.keys()),getChildren:f,getFlattenedNodes(b){return Pn(y,b)},getNode:z,getPrev:I,getNext:E,getParent:T,getChild:x,getFirstAvailableNode(){return kn(y)},getPath(b,p={}){return Tn(b,p,_)},getCheckedKeys(b,p={}){const{cascade:C=!0,leafOnly:L=!1,checkStrategy:A="all",allowNotLoaded:K=!1}=p;return be({checkedKeys:he(b),indeterminateKeys:ve(b),cascade:C,leafOnly:L,checkStrategy:A,allowNotLoaded:K},_)},check(b,p,C={}){const{cascade:L=!0,leafOnly:A=!1,checkStrategy:K="all",allowNotLoaded:k=!1}=C;return be({checkedKeys:he(p),indeterminateKeys:ve(p),keysToCheck:b==null?[]:ze(b),cascade:L,leafOnly:A,checkStrategy:K,allowNotLoaded:k},_)},uncheck(b,p,C={}){const{cascade:L=!0,leafOnly:A=!1,checkStrategy:K="all",allowNotLoaded:k=!1}=C;return be({checkedKeys:he(p),indeterminateKeys:ve(p),keysToUncheck:b==null?[]:ze(b),cascade:L,leafOnly:A,checkStrategy:K,allowNotLoaded:k},_)},getNonLeafKeys(b={}){return cn(y,b)}};return _}const Fn=P("empty",`
display: flex;
flex-direction: column;
align-items: center;
font-size: var(--n-font-size);
`,[R("icon",`
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
line-height: var(--n-icon-size);
color: var(--n-icon-color);
transition:
color .3s var(--n-bezier);
`,[Q("+",[R("description",`
margin-top: 8px;
`)])]),R("description",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
`),R("extra",`
text-align: center;
transition: color .3s var(--n-bezier);
margin-top: 12px;
color: var(--n-extra-text-color);
`)]),On=Object.assign(Object.assign({},oe.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),jn=q({name:"Empty",props:On,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:t}=Ht(e),o=oe("Empty","-empty",Fn,Dt,e,n),{localeRef:i}=Jt("Empty"),a=Gt(Vt,null),s=H(()=>{var f,d,y;return(f=e.description)!==null&&f!==void 0?f:(y=(d=a==null?void 0:a.mergedComponentPropsRef.value)===null||d===void 0?void 0:d.Empty)===null||y===void 0?void 0:y.description}),r=H(()=>{var f,d;return((d=(f=a==null?void 0:a.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||d===void 0?void 0:d.renderIcon)||(()=>g(an,null))}),m=H(()=>{const{size:f}=e,{common:{cubicBezierEaseInOut:d},self:{[re("iconSize",f)]:y,[re("fontSize",f)]:z,textColor:w,iconColor:I,extraTextColor:E}}=o.value;return{"--n-icon-size":y,"--n-font-size":z,"--n-bezier":d,"--n-text-color":w,"--n-icon-color":I,"--n-extra-text-color":E}}),c=t?_e("empty",H(()=>{let f="";const{size:d}=e;return f+=d[0],f}),m,e):void 0;return{mergedClsPrefix:n,mergedRenderIcon:r,localizedDescription:H(()=>s.value||i.value.description),cssVars:t?void 0:m,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:n,onRender:t}=this;return t==null||t(),g("div",{class:[`${n}-empty`,this.themeClass],style:this.cssVars},this.showIcon?g("div",{class:`${n}-empty__icon`},e.icon?e.icon():g(jt,{clsPrefix:n},{default:this.mergedRenderIcon})):null,this.showDescription?g("div",{class:`${n}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?g("div",{class:`${n}-empty__extra`},e.extra()):null)}}),An=Q([P("base-selection",`
position: relative;
z-index: auto;
box-shadow: none;
width: 100%;
max-width: 100%;
display: inline-block;
vertical-align: bottom;
border-radius: var(--n-border-radius);
min-height: var(--n-height);
line-height: 1.5;
font-size: var(--n-font-size);
`,[P("base-loading",`
color: var(--n-loading-color);
`),P("base-selection-tags","min-height: var(--n-height);"),R("border, state-border",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
pointer-events: none;
border: var(--n-border);
border-radius: inherit;
transition:
box-shadow .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`),R("state-border",`
z-index: 1;
border-color: #0000;
`),P("base-suffix",`
cursor: pointer;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 10px;
`,[R("arrow",`
font-size: var(--n-arrow-size);
color: var(--n-arrow-color);
transition: color .3s var(--n-bezier);
`)]),P("base-selection-overlay",`
display: flex;
align-items: center;
white-space: nowrap;
pointer-events: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: var(--n-padding-single);
transition: color .3s var(--n-bezier);
`,[R("wrapper",`
flex-basis: 0;
flex-grow: 1;
overflow: hidden;
text-overflow: ellipsis;
`)]),P("base-selection-placeholder",`
color: var(--n-placeholder-color);
`,[R("inner",`
max-width: 100%;
overflow: hidden;
`)]),P("base-selection-tags",`
cursor: pointer;
outline: none;
box-sizing: border-box;
position: relative;
z-index: auto;
display: flex;
padding: var(--n-padding-multiple);
flex-wrap: wrap;
align-items: center;
width: 100%;
vertical-align: bottom;
background-color: var(--n-color);
border-radius: inherit;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
`),P("base-selection-label",`
height: var(--n-height);
display: inline-flex;
width: 100%;
vertical-align: bottom;
cursor: pointer;
outline: none;
z-index: auto;
box-sizing: border-box;
position: relative;
transition:
color .3s var(--n-bezier),
box-shadow .3s var(--n-bezier),
background-color .3s var(--n-bezier);
border-radius: inherit;
background-color: var(--n-color);
align-items: center;
`,[P("base-selection-input",`
font-size: inherit;
line-height: inherit;
outline: none;
cursor: pointer;
box-sizing: border-box;
border:none;
width: 100%;
padding: var(--n-padding-single);
background-color: #0000;
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
caret-color: var(--n-caret-color);
`,[R("content",`
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
`)]),R("render-label",`
color: var(--n-text-color);
`)]),Se("disabled",[Q("&:hover",[R("state-border",`
box-shadow: var(--n-box-shadow-hover);
border: var(--n-border-hover);
`)]),Z("focus",[R("state-border",`
box-shadow: var(--n-box-shadow-focus);
border: var(--n-border-focus);
`)]),Z("active",[R("state-border",`
box-shadow: var(--n-box-shadow-active);
border: var(--n-border-active);
`),P("base-selection-label","background-color: var(--n-color-active);"),P("base-selection-tags","background-color: var(--n-color-active);")])]),Z("disabled","cursor: not-allowed;",[R("arrow",`
color: var(--n-arrow-color-disabled);
`),P("base-selection-label",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`,[P("base-selection-input",`
cursor: not-allowed;
color: var(--n-text-color-disabled);
`),R("render-label",`
color: var(--n-text-color-disabled);
`)]),P("base-selection-tags",`
cursor: not-allowed;
background-color: var(--n-color-disabled);
`),P("base-selection-placeholder",`
cursor: not-allowed;
color: var(--n-placeholder-color-disabled);
`)]),P("base-selection-input-tag",`
height: calc(var(--n-height) - 6px);
line-height: calc(var(--n-height) - 6px);
outline: none;
display: none;
position: relative;
margin-bottom: 3px;
max-width: 100%;
vertical-align: bottom;
`,[R("input",`
font-size: inherit;
font-family: inherit;
min-width: 1px;
padding: 0;
background-color: #0000;
outline: none;
border: none;
max-width: 100%;
overflow: hidden;
width: 1em;
line-height: inherit;
cursor: pointer;
color: var(--n-text-color);
caret-color: var(--n-caret-color);
`),R("mirror",`
position: absolute;
left: 0;
top: 0;
white-space: pre;
visibility: hidden;
user-select: none;
-webkit-user-select: none;
opacity: 0;
`)]),["warning","error"].map(e=>Z(`${e}-status`,[R("state-border",`border: var(--n-border-${e});`),Se("disabled",[Q("&:hover",[R("state-border",`
box-shadow: var(--n-box-shadow-hover-${e});
border: var(--n-border-hover-${e});
`)]),Z("active",[R("state-border",`
box-shadow: var(--n-box-shadow-active-${e});
border: var(--n-border-active-${e});
`),P("base-selection-label",`background-color: var(--n-color-active-${e});`),P("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Z("focus",[R("state-border",`
box-shadow: var(--n-box-shadow-focus-${e});
border: var(--n-border-focus-${e});
`)])])]))]),P("base-selection-popover",`
margin-bottom: -3px;
display: flex;
flex-wrap: wrap;
margin-right: -8px;
`),P("base-selection-tag-wrapper",`
max-width: 100%;
display: inline-flex;
padding: 0 7px 3px 0;
`,[Q("&:last-child","padding-right: 0;"),P("tag",`
font-size: 14px;
max-width: 100%;
`,[R("content",`
line-height: 1.25;
text-overflow: ellipsis;
overflow: hidden;
`)])])]),Un=q({name:"InternalSelection",props:Object.assign(Object.assign({},oe.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const n=O(null),t=O(null),o=O(null),i=O(null),a=O(null),s=O(null),r=O(null),m=O(null),c=O(null),f=O(null),d=O(!1),y=O(!1),z=O(!1),w=oe("InternalSelection","-internal-selection",An,Ut,e,ce(e,"clsPrefix")),I=H(()=>e.clearable&&!e.disabled&&(z.value||e.active)),E=H(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):ee(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),T=H(()=>{const l=e.selectedOption;if(l)return l[e.labelField]}),x=H(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function _(){var l;const{value:v}=n;if(v){const{value:M}=t;M&&(M.style.width=`${v.offsetWidth}px`,e.maxTagCount!=="responsive"&&((l=c.value)===null||l===void 0||l.sync()))}}function b(){const{value:l}=f;l&&(l.style.display="none")}function p(){const{value:l}=f;l&&(l.style.display="inline-block")}de(ce(e,"active"),l=>{l||b()}),de(ce(e,"pattern"),()=>{e.multiple&&Pe(_)});function C(l){const{onFocus:v}=e;v&&v(l)}function L(l){const{onBlur:v}=e;v&&v(l)}function A(l){const{onDeleteOption:v}=e;v&&v(l)}function K(l){const{onClear:v}=e;v&&v(l)}function k(l){const{onPatternInput:v}=e;v&&v(l)}function u(l){var v;(!l.relatedTarget||!(!((v=o.value)===null||v===void 0)&&v.contains(l.relatedTarget)))&&C(l)}function h(l){var v;!((v=o.value)===null||v===void 0)&&v.contains(l.relatedTarget)||L(l)}function S(l){K(l)}function $(){z.value=!0}function N(){z.value=!1}function B(l){!e.active||!e.filterable||l.target!==t.value&&l.preventDefault()}function F(l){A(l)}function W(l){if(l.key==="Backspace"&&!D.value&&!e.pattern.length){const{selectedOptions:v}=e;v!=null&&v.length&&F(v[v.length-1])}}const D=O(!1);let V=null;function j(l){const{value:v}=n;if(v){const M=l.target.value;v.textContent=M,_()}e.ignoreComposition&&D.value?V=l:k(l)}function G(){D.value=!0}function X(){D.value=!1,e.ignoreComposition&&k(V),V=null}function $e(l){var v;y.value=!0,(v=e.onPatternFocus)===null||v===void 0||v.call(e,l)}function Le(l){var v;y.value=!1,(v=e.onPatternBlur)===null||v===void 0||v.call(e,l)}function Ne(){var l,v;if(e.filterable)y.value=!1,(l=s.value)===null||l===void 0||l.blur(),(v=t.value)===null||v===void 0||v.blur();else if(e.multiple){const{value:M}=i;M==null||M.blur()}else{const{value:M}=a;M==null||M.blur()}}function Me(){var l,v,M;e.filterable?(y.value=!1,(l=s.value)===null||l===void 0||l.focus()):e.multiple?(v=i.value)===null||v===void 0||v.focus():(M=a.value)===null||M===void 0||M.focus()}function Be(){const{value:l}=t;l&&(p(),l.focus())}function Ke(){const{value:l}=t;l&&l.blur()}function We(l){const{value:v}=r;v&&v.setTextContent(`+${l}`)}function He(){const{value:l}=m;return l}function De(){return t.value}let se=null;function ae(){se!==null&&window.clearTimeout(se)}function Ge(){e.active||(ae(),se=window.setTimeout(()=>{x.value&&(d.value=!0)},100))}function Ve(){ae()}function je(l){l||(ae(),d.value=!1)}de(x,l=>{l||(d.value=!1)}),le(()=>{Yt(()=>{const l=s.value;l&&(e.disabled?l.removeAttribute("tabindex"):l.tabIndex=y.value?-1:0)})}),sn(o,e.onResize);const{inlineThemeDisabled:me}=e,we=H(()=>{const{size:l}=e,{common:{cubicBezierEaseInOut:v},self:{borderRadius:M,color:Ue,placeholderColor:Ye,textColor:Ze,paddingSingle:qe,paddingMultiple:Xe,caretColor:Qe,colorDisabled:Je,textColorDisabled:et,placeholderColorDisabled:tt,colorActive:nt,boxShadowFocus:ot,boxShadowActive:rt,boxShadowHover:it,border:lt,borderFocus:st,borderHover:at,borderActive:ct,arrowColor:dt,arrowColorDisabled:ut,loadingColor:ft,colorActiveWarning:ht,boxShadowFocusWarning:vt,boxShadowActiveWarning:bt,boxShadowHoverWarning:gt,borderWarning:pt,borderFocusWarning:mt,borderHoverWarning:wt,borderActiveWarning:yt,colorActiveError:xt,boxShadowFocusError:Ct,boxShadowActiveError:St,boxShadowHoverError:Tt,borderError:kt,borderFocusError:It,borderHoverError:zt,borderActiveError:Rt,clearColor:Et,clearColorHover:Pt,clearColorPressed:_t,clearSize:Ft,arrowSize:Ot,[re("height",l)]:At,[re("fontSize",l)]:$t}}=w.value;return{"--n-bezier":v,"--n-border":lt,"--n-border-active":ct,"--n-border-focus":st,"--n-border-hover":at,"--n-border-radius":M,"--n-box-shadow-active":rt,"--n-box-shadow-focus":ot,"--n-box-shadow-hover":it,"--n-caret-color":Qe,"--n-color":Ue,"--n-color-active":nt,"--n-color-disabled":Je,"--n-font-size":$t,"--n-height":At,"--n-padding-single":qe,"--n-padding-multiple":Xe,"--n-placeholder-color":Ye,"--n-placeholder-color-disabled":tt,"--n-text-color":Ze,"--n-text-color-disabled":et,"--n-arrow-color":dt,"--n-arrow-color-disabled":ut,"--n-loading-color":ft,"--n-color-active-warning":ht,"--n-box-shadow-focus-warning":vt,"--n-box-shadow-active-warning":bt,"--n-box-shadow-hover-warning":gt,"--n-border-warning":pt,"--n-border-focus-warning":mt,"--n-border-hover-warning":wt,"--n-border-active-warning":yt,"--n-color-active-error":xt,"--n-box-shadow-focus-error":Ct,"--n-box-shadow-active-error":St,"--n-box-shadow-hover-error":Tt,"--n-border-error":kt,"--n-border-focus-error":It,"--n-border-hover-error":zt,"--n-border-active-error":Rt,"--n-clear-size":Ft,"--n-clear-color":Et,"--n-clear-color-hover":Pt,"--n-clear-color-pressed":_t,"--n-arrow-size":Ot}}),Y=me?_e("internal-selection",H(()=>e.size[0]),we,e):void 0;return{mergedTheme:w,mergedClearable:I,patternInputFocused:y,filterablePlaceholder:E,label:T,selected:x,showTagsPanel:d,isComposing:D,counterRef:r,counterWrapperRef:m,patternInputMirrorRef:n,patternInputRef:t,selfRef:o,multipleElRef:i,singleElRef:a,patternInputWrapperRef:s,overflowRef:c,inputTagElRef:f,handleMouseDown:B,handleFocusin:u,handleClear:S,handleMouseEnter:$,handleMouseLeave:N,handleDeleteOption:F,handlePatternKeyDown:W,handlePatternInputInput:j,handlePatternInputBlur:Le,handlePatternInputFocus:$e,handleMouseEnterCounter:Ge,handleMouseLeaveCounter:Ve,handleFocusout:h,handleCompositionEnd:X,handleCompositionStart:G,onPopoverUpdateShow:je,focus:Me,focusInput:Be,blur:Ne,blurInput:Ke,updateCounter:We,getCounter:He,getTail:De,renderLabel:e.renderLabel,cssVars:me?void 0:we,themeClass:Y==null?void 0:Y.themeClass,onRender:Y==null?void 0:Y.onRender}},render(){const{status:e,multiple:n,size:t,disabled:o,filterable:i,maxTagCount:a,bordered:s,clsPrefix:r,onRender:m,renderTag:c,renderLabel:f}=this;m==null||m();const d=a==="responsive",y=typeof a=="number",z=d||y,w=g(Zt,null,{default:()=>g(en,{clsPrefix:r,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var E,T;return(T=(E=this.$slots).arrow)===null||T===void 0?void 0:T.call(E)}})});let I;if(n){const{labelField:E}=this,T=h=>g("div",{class:`${r}-base-selection-tag-wrapper`,key:h.value},c?c({option:h,handleClose:()=>{this.handleDeleteOption(h)}}):g(ue,{size:t,closable:!h.disabled,disabled:o,onClose:()=>{this.handleDeleteOption(h)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(h,!0):ee(h[E],h,!0)})),x=()=>(y?this.selectedOptions.slice(0,a):this.selectedOptions).map(T),_=i?g("div",{class:`${r}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},g("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:o,value:this.pattern,autofocus:this.autofocus,class:`${r}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),g("span",{ref:"patternInputMirrorRef",class:`${r}-base-selection-input-tag__mirror`},this.pattern)):null,b=d?()=>g("div",{class:`${r}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},g(ue,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:o})):void 0;let p;if(y){const h=this.selectedOptions.length-a;h>0&&(p=g("div",{class:`${r}-base-selection-tag-wrapper`,key:"__counter__"},g(ue,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:o},{default:()=>`+${h}`})))}const C=d?i?g(Ie,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:b,tail:()=>_}):g(Ie,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:b}):y?x().concat(p):x(),L=z?()=>g("div",{class:`${r}-base-selection-popover`},d?x():this.selectedOptions.map(T)):void 0,A=z?{show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover}:null,k=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?g("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`},g("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)):null,u=i?g("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-tags`},C,d?null:_,w):g("div",{ref:"multipleElRef",class:`${r}-base-selection-tags`,tabindex:o?void 0:0},C,w);I=g(qt,null,z?g(Xt,Object.assign({},A,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>u,default:L}):u,k)}else if(i){const E=this.pattern||this.isComposing,T=this.active?!E:!this.selected,x=this.active?!1:this.selected;I=g("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-label`},g("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${r}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:o,disabled:o,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),x?g("div",{class:`${r}-base-selection-label__render-label ${r}-base-selection-overlay`,key:"input"},g("div",{class:`${r}-base-selection-overlay__wrapper`},c?c({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):ee(this.label,this.selectedOption,!0))):null,T?g("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},g("div",{class:`${r}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,w)}else I=g("div",{ref:"singleElRef",class:`${r}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?g("div",{class:`${r}-base-selection-input`,title:tn(this.label),key:"input"},g("div",{class:`${r}-base-selection-input__content`},c?c({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):ee(this.label,this.selectedOption,!0))):g("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},g("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)),w);return g("div",{ref:"selfRef",class:[`${r}-base-selection`,this.themeClass,e&&`${r}-base-selection--${e}-status`,{[`${r}-base-selection--active`]:this.active,[`${r}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${r}-base-selection--disabled`]:this.disabled,[`${r}-base-selection--multiple`]:this.multiple,[`${r}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},I,s?g("div",{class:`${r}-base-selection__border`}):null,s?g("div",{class:`${r}-base-selection__state-border`}):null)}});export{Dn as F,Un as N,Hn as V,jn as _,Gn as a,Vn as c,Pn as f,Wn as h,sn as u};
//# sourceMappingURL=Selection-35940256.js.map