@ioca/react 1.1.8 → 1.1.9

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/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"classnames";import{debounce as a,uid as r,throttle as s,pick as l,title as o}from"radash";import{createElement as c,useEffect as d,isValidElement as u,cloneElement as p,useState as m,useMemo as h,Children as g,useRef as v,Fragment as f,useLayoutEffect as b,createContext as y,useContext as k,useImperativeHandle as N}from"react";import{SkipPreviousRound as C,CloseRound as w,MinusRound as x,PlusRound as $,InboxTwotone as z,PauseRound as P,PlayArrowRound as T,StopRound as D,FullscreenExitRound as I,FullscreenRound as M,VolumeOffRound as S,VolumeDownRound as O,FeedOutlined as E,AspectRatioRound as j,OpenInNewRound as B,FileDownloadOutlined as A,RotateRightRound as V,RotateLeftRound as Y,KeyboardArrowLeftRound as L,KeyboardArrowRightRound as W,HideImageTwotone as H,VisibilityRound as F,VisibilityOffRound as q,SyncAltRound as R,MoreHorizRound as X,SearchRound as U,CheckRound as G,UnfoldMoreRound as K,CalendarMonthTwotone as Z,AccessTimeRound as _,InfoOutlined as J,KeyboardArrowDownRound as Q,ListAltRound as ee,CloudUploadTwotone as te,PlusSharp as ne}from"@ricons/material";import{useReactive as ie,useClickAway as ae,useCreation as re,useSize as se}from"ahooks";import{createRoot as le}from"react-dom/client";import oe from"react-custom-scrollbars-2";import{createPortal as ce}from"react-dom";import de from"rc-virtual-list";import ue from"pubsub-js";import{findAll as pe}from"highlight-words-core";import me from"@rc-component/color-picker";import"@rc-component/color-picker/assets/index.css";import he from"dayjs";import ge from"dayjs/plugin/customParseFormat";const ve=500;function fe(e){const t=e.target,n=t.closest("[data-ripple]");t&&n&&function(e,t){const[n,i]=function(){const e=document.createElement("SPAN"),t=document.createElement("SPAN");return e.className="i-ripple-container",t.className="i-ripple",e.append(t),[e,t]}(),a=e.getBoundingClientRect(),r=2*Math.max(a.width,a.height);i.style.cssText=`\n left: ${t.pageX-a.left}px;\n top: ${t.pageY-a.top}px;\n width: ${r}px;\n height: ${r}px;\n transition: all 0.5s;\n `,e.insertAdjacentElement("afterbegin",n),e.offsetHeight,i.classList.add("i-ripple-active"),setTimeout((()=>{n.remove()}),ve)}(n,e)}const be=n=>{const{icon:a,text:r,size:s,absolute:l,style:o,className:c,...d}=n;return e("div",{className:i("i-loading-container",{absolute:l},c),style:{...o,inset:l?0:"unset"},...d,children:[a??t("svg",{width:"24",height:"24",stroke:"#000",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"i-loading-icon",style:{fontSize:s},children:t("circle",{cx:"12",cy:"12",r:"9.5",fill:"none",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:40,strokeDashoffset:0})}),r]})},ye=({outline:e,flat:t,loading:n,disabled:a,size:r="normal",block:s,round:l,square:o,secondary:c,className:d})=>i("i-btn",d,{"i-btn-outline":e,"i-btn-flat":t,"i-btn-block":s,"i-btn-loading":n,"i-btn-square":o,"i-btn-secondary":c,[`i-btn-${r}`]:"normal"!==r,round:l,disabled:a}),ke=e=>{const{as:i="a",ref:a,children:r,className:s,loading:l,flat:o,outline:u,square:p,secondary:m,size:h,round:g,href:v,ripple:f=!0,onClick:b,...y}=e;if(!r)return t(n,{});const k=[l&&t(be,{},"loading"),c("span",{key:"content",className:"i-btn-content"},r)],N={className:ye(e),"data-ripple":f,onClick:e=>{l||y.disabled?e.stopPropagation():b?.(e)}};return d((()=>{f&&(document.documentElement.dataset.useripple||(document.documentElement.dataset.useripple="enable",document.addEventListener("mousedown",fe)))}),[f]),c(i,"string"==typeof i?{ref:a,href:v,...N,...y}:{to:v||"",...N,...y},k)};ke.Toggle=function(e){const{ref:n,active:a,activeClass:r,after:s,disabled:l,children:o,className:c,onClick:u,onToggle:p,...m}=e,h=ie({active:a,done:!0}),g=()=>{const e=void 0!==s,t=!h.active;Object.assign(h,{active:t,done:!e}),p?.(t),e&&setTimeout((()=>{h.done=!0}),16)};return d((()=>{h.active!==a&&g()}),[a]),t(ke,{ref:n,className:i(c,{[r||""]:h.active},"i-btn-toggle"),...m,onClick:e=>{u?.(e),!l&&g()},children:t("div",{className:i("i-btn-toggle-content",{"i-btn-toggle-active":h.done}),children:h.active?s??o:o})})},ke.Group=function(e){const{children:n,vertical:a,className:r,style:s}=e;return t("div",{className:i(r,a?"i-btn-group-vertical":"i-btn-group-horizonal"),style:s,children:n})};const Ne=e=>{const{ref:t,icon:n,size:a="1.425em",rotate:r,style:s,className:l,...o}=e;if(!u(n))return n;const c={ref:t,style:{transform:r?`rotate(${r}deg)`:void 0,...s,width:a,height:a},className:i("i-icon",l),...o};return p(n,c)};function Ce(e){const{style:n,className:a,onClick:r}=e;return t(ke,{square:!0,className:i("i-affix-totop",a),style:{...n},onClick:r,children:t(Ne,{icon:t(C,{}),rotate:90})})}const we=e=>{const{position:n="fixed",left:r,top:s,right:l,bottom:o,offset:c,style:u,className:v,children:f,getContainer:b=()=>document.body}=e,[y,k]=m(!1),N=h((()=>g.map(f,(e=>{if(e.type===Ce){const{onClick:t}=e.props;return p(e,{key:e.key,...e.props,onClick:e=>{const n=b();t?.(e),n?.scrollTo({top:0,left:0,behavior:"smooth"})}})}return e}))),[f,b]);return d((()=>{const e=b();if(!c||!e)return;const t=a({delay:160},(()=>{const t=e.scrollTop;k(t<c)}));return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[c,b]),t("div",{className:i("i-affix",v,{"i-affix-hidden":y}),style:{...u,position:n,left:r,top:s,right:l,bottom:o},children:N})};we.ToTop=Ce;const xe=n=>{const{content:a,contentClass:r,dot:s,dotSize:l,round:o,disabled:c,style:d,className:u,children:p}=n;return e("div",{style:d,className:i("i-badge",{rounded:o},u),children:[p,t("div",{className:i("i-badge-content",r,{"i-badge-dot":s,"i-badge-hidden":c}),style:{fontSize:l},children:a})]})},$e=n=>{const{hideShadow:a,border:r,style:s,className:l,children:o,header:c,footer:d}=n;return e("div",{style:s,className:i("i-card",l,{shadow:!a,"i-card-bordered":r}),children:[c&&t("div",{className:"i-card-header",children:c}),o&&t("div",{className:"i-card-content",children:o}),d&&t("div",{className:"i-card-footer",children:d})]})};var ze;function Pe(e,t,n={}){const{refWindow:i,gap:a=0,offset:r=0,position:s="top",align:l}=n;if(!e||!t)return[0,0,{arrowX:0,arrowY:0,arrowPos:"bottom"}];const o=e.getBoundingClientRect(),c=t.getBoundingClientRect();let d=window.innerWidth,u=window.innerHeight,{left:p,top:m,right:h,bottom:g,width:v,height:f}=o;const{height:b,width:y}=c;if(!i){const t=e.offsetParent?.getBoundingClientRect();d=t?.width||d,u=t?.height||u,p=e.offsetLeft,m=e.offsetTop,h=p+o.width,g=m+o.height}let k=0,N=0,C=0,w=0,x="bottom";switch(s){case"left":case"right":k=f!==b?De({containerSize:u,targetSize:f,targetOffset:m,contentSize:b,gap:a,align:l}):m,w=k<m?m-k+f/2:f/2;const e=p-r-y,t=h+r+y;if("left"===s){const n=e<0&&t<=d;N=n?h+r:e,C=n?0:y,x=n?"left":"right"}else{const n=d>t||e<0;N=n?h+r:e,C=n?0:y,x=n?"left":"right"}break;case"top":case"bottom":N=v!==y?De({containerSize:d,targetOffset:p,targetSize:v,contentSize:y,gap:a,align:l}):p,C=N>p?y/2:p-N+v/2;const n=m-r-b,i=g+r+b;if("top"===s){const e=n<0&&i<=u;k=e?g+r:n,w=e?0:b,x=e?"top":"bottom"}else{const e=u>i||n<0;k=e?g+r:n,w=e?0:b,x=e?"top":"bottom"}}return[N,k,{arrowX:C,arrowY:w,arrowPos:x}]}function Te(e,t){const{width:n,height:i}=t.getBoundingClientRect(),a=t.offsetParent;let r,s,l=0,o=0;if(a){const{width:e,height:t,left:n,top:i}=a.getBoundingClientRect();r=e,s=t,o=i,l=n}else r=window.innerWidth,s=window.innerHeight;const c=e.pageX-l,d=e.pageY-o;return[c+n>=r&&c-n>0?c-n:c,d+i>=s&&d-i>0?d-i:d]}function De({containerSize:e,targetSize:t,targetOffset:n,contentSize:i,gap:a,align:r="center"}){const s=n+t/2;switch(r){case"start":return n+i>e?e-i-a:n;case"center":return t>=i?s-i/2:s+i/2+a>e?n+t-i:s-i/2-a<0?a:s-i/2;case"end":const r=n+t-i;return r>0?r:a;default:return s-i/2}}function Ie(e){return e.map((e=>["string","number"].includes(typeof e)?{label:e,value:e}:e))}function Me(e,t={}){const{precision:n,thousand:i}=t,a=e.toFixed(n);if(!i)return a;const r=a.split("."),s=r[0].replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,`$&${i}`);return 1===r.length?s:`${s}.${r[1]}`}function Se(e,t=document.body){const n=document.createElement("div");t.append(n);const i=le(n),a=setTimeout((()=>{i?.render(e)}),0);return()=>{n?.remove(),i?.unmount(),a&&clearTimeout(a)}}function Oe(e){return e.match(/\.([^\./\?]+)($|\?)/)?.[1]}function Ee(e,t){switch(!0){case["jpg","jpeg","png","webp","svg"].includes(e)||t?.startsWith("image/"):return ze.IMAGE;case["mp4","avi"].includes(e)||t?.startsWith("video/"):return ze.VIDEO;default:return ze.UNKNOWN}}function je(e,t=2){if(!+e)return"0 Bytes";const n=t<0?0:t,i=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,i)).toFixed(n))} ${["B","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}`}function Be(e,t,n){return e<t?t:e>n?n:e}function Ae(n){const{type:a="default",label:r,name:s,value:l=!1,className:o,status:c="normal",message:u,disabled:p,partof:m,children:h,onChange:g,...v}=n,f=ie({value:l,status:c,message:u});return d((()=>{f.value=l}),[l]),e("label",{className:i("i-checkbox-item",{[`i-checkbox-${f.status}`]:"normal"!==f.status,disabled:p},o),...v,children:[t("input",{type:"checkbox",name:s,className:i("i-checkbox-input",{[`i-checkbox-${a}`]:!m,"i-checkbox-partof":m}),checked:f.value,disabled:p,onChange:e=>{const t=e.target.checked;Object.assign(f,{value:t,status:c,message:u}),g?.(t,e)}}),t("span",{className:"i-checkbox-text",children:h||r}),f.message&&e("span",{className:"i-checkbox-message",children:["*",f.message]})]})}function Ve(n){const{label:a,name:r,options:s=[],value:l="",type:o="default",optionInline:c=!0,labelInline:u,disabled:p,status:m="normal",message:g,required:v,className:f,onChange:b,...y}=n,k=ie({value:l}),N=h((()=>Ie(s)),[s]);return d((()=>{k.value=l}),[l]),e("div",{className:i("i-checkbox i-input-label",{[`i-checkbox-${m}`]:"normal"!==m,"i-input-inline":u},f),...y,children:[a&&e("span",{className:"i-input-label-text",children:[v&&t("span",{className:"error",children:"*"}),a,g&&t("p",{className:"i-checkbox-message",children:g})]}),t("div",{className:i("i-checkbox-options",{"i-options-block":!c,"i-checkbox-options-button":"button"===o}),children:N.map((e=>t(Ae,{name:r,value:k.value.includes(e.value),type:o,disabled:p||e.disabled,onChange:(t,n)=>((e,t,n)=>{const i=[...k.value],a=i.findIndex((e=>e===t.value));e&&a<0?i.push(t.value):!e&&a>-1&&i.splice(a,1),k.value=i,b?.(i,t,n)})(t,e,n),children:e.label},e.value)))})]})}!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.PDF="PDF",e.EXCEL="EXCEL",e.TXT="TXT",e.UNKNOWN="UNKNOWN"}(ze||(ze={})),Ve.Item=Ae;const Ye=e=>{const{as:a="a",active:s,className:l,icon:o=t(w,{}),...d}=e;return s?c(a,{className:i("i-helpericon",l),...d},[c(Ne,{key:r(3),icon:o})]):t(n,{})};const Le=n=>{const{active:a,items:r,multiple:s,border:l,headerClickable:o,className:c,children:d,renderToggle:u=e=>t(e?x:$,{}),onCollapse:p,...m}=n,v=ie({active:a}),f=h((()=>r||(d&&g.map(d,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,disabled:l,...o}=i;return{...o,key:n||t,title:a,content:r||s,disabled:l}}))||[])),[d]),b=(e,t)=>{const{key:n,disabled:i}=e;if(t?.stopPropagation(),i)return;if(!s)return v.active=v.active===n?void 0:n,void p?.(n,void 0!==v.active);Array.isArray(v.active)||(v.active=[]);const a=v.active.findIndex((e=>e===n));a>-1?v.active.splice(a,1):void 0!==n&&v.active.push(n),p?.(n,a<0)};return t("div",{className:i("i-collapse",{"i-collapse-bordered":l},c),...m,children:f.map((n=>{const{key:a,title:r,content:l,disabled:c,className:d,...p}=n,m=s?(v.active||[]).includes(a):v.active===a;return e("div",{className:i("i-collapse-item",d,{"i-collapse-active":m,"i-collapse-disabled":c}),...p,children:[e("div",{className:"i-collapse-header",onClick:()=>(e=>{o&&b(e)})(n),children:[r,t(Ye,{active:!0,className:"i-collapse-toggle",icon:u(m),onClick:e=>b(n,e)})]}),t("div",{className:"i-collapse-content",children:l})]},a)}))})};function We(e){const{className:n,...a}=e;return t(z,{className:i("i-empty",n),...a})}function He({justify:e,col:t,row:n,colSpan:i=1,rowSpan:a=1}){return{"--datagrid-justify":e,gridArea:`${n+1} / ${t+1} / ${n+1+a} / ${t+1+i}`,insetInline:`var(--datagrid-cell-inset-${t})`}}function Fe(e){const{column:n,row:a,col:r,data:s,cellEllipsis:l,onCellClick:o,onCellDoubleClick:c}=e,{id:d,fixed:u,justify:p,rowSpan:m,render:h}=n,g=He({justify:p,fixed:u,col:r,row:a,rowSpan:m});return t("div",{className:i("i-datagrid-cell",{[`i-datagrid-cell-fixed-${u}`]:u}),"data-col":d,style:g,onClick:e=>o?.(s,n,a,r,e),onDoubleClick:e=>c?.(s,n,a,r,e),children:h?.(s[d],s,r)??t("div",{className:i("i-datagrid-cell-content",{"i-datagrid-cell-content-ellipsis":l}),children:s[d]})})}Le.Item=function(e){return t(n,{})};const qe=new Set,Re=new Set,Xe="ontouchend"in document,Ue={MOVE:Xe?"touchmove":"mousemove",UP:Xe?"touchend":"mouseup"};function Ge(e){d((()=>(qe.add(e),()=>{qe.delete(e)})),[e])}function Ke(e){d((()=>(Re.add(e),()=>{Re.delete(e)})),[e])}function Ze(e){const t=new WeakMap,n=new IntersectionObserver((e=>{e.map((e=>{const n=t.get(e.target);n?.(e.target,e.isIntersecting)}))}),e);return{observe:function(e,i){t.get(e)||(t.set(e,i),e&&n.observe(e))},unobserve:function(e){e&&n.unobserve(e),t.delete(e)},disconnect:function(){n.disconnect()}}}function _e(e){const{index:n,onWidthChange:i}=e,a=ie({resizing:!1,x:0,width:0});return Ge((e=>{if(!a.resizing)return;e.preventDefault();const t=a.width+e.pageX-a.x;t<=24||i(n,t)})),Ke((()=>{a.resizing&&(a.resizing=!1)})),t("i",{className:"i-datagrid-resizor",onMouseDown:e=>{const t=e.target.offsetParent.offsetWidth;Object.assign(a,{x:e.pageX,resizing:!0,width:t})},onClick:e=>e.stopPropagation()})}document.addEventListener(Ue.MOVE,(e=>{for(const t of qe.values())t(e)}),{passive:!1}),document.addEventListener(Ue.UP,(e=>{for(const t of Re.values())t(e)}));const Je=e=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...e,children:t("g",{fill:"none",children:t("path",{d:"M9 17.898c0 1.074 1.265 1.648 2.073.941l6.31-5.522a1.75 1.75 0 0 0 0-2.634l-6.31-5.522C10.265 4.454 9 5.028 9 6.102v11.796z",fill:"currentColor"})})});function Qe(n){const{type:a}=n;return e("a",{className:i("i-datagrid-sorter",{[`i-datagrid-sorter-${a}`]:a}),children:[t(Je,{className:"i-datagrid-sorter-caret"}),t(Je,{className:"i-datagrid-sorter-caret"})]})}function et(e){const{row:n,data:i,columns:a,cellEllipsis:r,onRowClick:s,onCellClick:l,onCellDoubleClick:o}=e;return t("div",{className:"i-datagrid-row",onClick:()=>s?.(i,n),children:a.map(((e,a)=>t(Fe,{column:e,col:a,row:n,data:i,cellEllipsis:r,onCellClick:l,onCellDoubleClick:o},a)))})}function tt(n){const{columns:a,resizable:r,cellEllipsis:s,sortBy:l,sortType:o,onWidthChange:c,onHeaderClick:d}=n;return t("div",{className:"i-datagrid-header i-datagrid-row",children:a.map(((n,a)=>{const{id:u,title:p,fixed:m,colSpan:h,sorter:g,justify:v,renderHeader:f}=n,b=He({justify:v,row:0,col:a,colSpan:h}),y=l===u?o:"";return e("div",{"data-col":u,className:i("i-datagrid-cell",{"i-datagrid-has-sorter":g,"i-datagrid-cell-fixed":m}),style:{...b,insetBlockStart:0},onClick:e=>d?.(n,e),children:[f?.(n,a)??t("div",{className:i("i-datagrid-cell-content",{"i-datagrid-cell-content-ellipsis":s}),children:p||u}),g&&t(Qe,{type:y}),r&&t(_e,{index:a,onWidthChange:c})]},a)}))})}const nt=n=>{const{data:a=[],columns:r=[],border:s,striped:l,header:o=!0,resizable:c,cellPadding:u=".5em",cellEllipsis:p,empty:m=t(We,{}),loading:g,height:f="unset",style:b,className:y,renderLoading:k=()=>t(be,{size:"1.5em",className:"color-3"}),onCellClick:N,onRowClick:C,onHeaderClick:w,onSort:x,onScroll:$,onResize:z}=n,P=v(null),T=v(null),D=ie({rows:a,widths:r.map((e=>e.width??"min-content")),sortBy:"",sortType:""}),I=h((()=>{const{widths:e}=D,t={...b,"--grid-template-columns":e.map((e=>"number"==typeof e?`${e}px`:e)).join(" ")};if(!c)return t;const n=r.map(((t,n)=>{const{fixed:i}=t;return i?e[n]:0}));return r.map(((e,i)=>{const{fixed:a}=e;if(a)if(0===i)t["--datagrid-cell-inset-0"]=0;else if(i===n.length-1)t["--datagrid-cell-inset-"+(n.length-1)]="auto 0";else{const e="left"===a,r=(e?n.slice(0,i):n.slice(i+1)).reduce(((e,t)=>e+t))+"px",s=e?`${r} auto`:`auto ${r}`;t[`--datagrid-cell-inset-${i}`]=s}})),t}),[D.widths,c]),M=h((()=>{const{sortBy:e,sortType:t}=D;if(e&&!x){const n=r.find((t=>t.id===e))?.sorter,i="function"==typeof n?n:(t,n)=>n[e]-t[e],s=[...a].sort(i);return"desc"===t?s:s.reverse()}return a}),[a,r,D.sortBy,D.sortType]);d((()=>{if(!P.current)return;const{current:e}=P,t=e.querySelector(".i-datagrid-row")?.children;t?.length&&(D.widths=Array.from(t).map((e=>e.offsetWidth)))}),[r,c]),d((()=>{g&&T.current?.scrollTop(0)}),[g]);const S={"--cell-padding":u,...I};return e(oe,{ref:T,autoHide:!0,autoHeight:!0,autoHeightMax:f,style:S,className:i("i-datagrid-container",y,{"i-datagrid-bordered":s,"i-datagrid-striped":l}),renderView:e=>t("div",{...e,className:i({"i-datagrid-loading":g})}),onScroll:$,children:[e("div",{ref:P,className:"i-datagrid",children:[o&&t(tt,{columns:r,resizable:c,sortType:D.sortType,sortBy:D.sortBy,cellEllipsis:p,onWidthChange:(e,t)=>{if(!c)return;const[...n]=D.widths;n[e]=t,D.widths=n,z?.(r[e],t)},onHeaderClick:(e,t)=>{if(e?.sorter){const[t,n]=function(e,t,n){const i=["desc","asc"];if(e===n){const e=i.findIndex((e=>e===t))+1,a=i[e]||"";return[""===a?"":n,a]}return[n,"desc"]}(D.sortBy,D.sortType,e.id);Object.assign(D,{sortBy:t,sortType:n}),x?.(t,n)}w?.(e,t)}}),M.map(((e,n)=>t(et,{row:n+(o?1:0),data:e,cellEllipsis:p,columns:r,onCellClick:N,onRowClick:C},n))),M.length<1&&m]}),g&&k()]})},it=n=>{const{data:a,colon:r,columns:s=1,gap:l=".5em",align:o,labelWidth:c,labelAlign:d,vertical:u,equally:p,style:m,className:h}=n;return t("div",{className:i("i-description",h),style:{"--description-label-width":c,gridTemplateColumns:`repeat(${s}, ${p?"1fr":"auto"})`,gap:l,textAlign:o,...m},children:a.map(((n,a)=>{const{label:s,value:l,style:o,hidden:c,rowSpan:p=1,colSpan:m=1}=n;return c?t(f,{},a):e("div",{className:i("i-description-item",{"i-description-item-vertical":u}),style:{gridColumn:`span ${m}`,gridRow:`span ${p}`,...o},children:[s&&e("div",{className:"i-description-label",style:{textAlign:d},children:[s,r]}),t("div",{className:"i-description-value",children:l})]},a)}))})};function at(n){const{visible:a,position:r="left",header:s,footer:l,backdropClosable:o=!0,hideCloseButton:c,keepDOM:u,className:p,children:m,onVisibleChange:h,onClose:g,...f}=n,b=v(!0),y=ie({show:a,active:a,init:!1});d((()=>{a?k():N()}),[a]);const k=()=>{b.current&&(y.show=!0,h?.(!0),b.current=!1,setTimeout((()=>{y.active=!0,b.current=!0,y.init=!0}),24))},N=()=>{b.current&&(b.current=!1,y.active=!1,setTimeout((()=>{u||(y.show=!1),h?.(!1),b.current=!0,g?.()}),240))};return ce(y.show&&t("div",{className:i("i-backdrop-drawer",p,{"i-active":y.active}),onClick:function(){o&&N()},...f,children:e("div",{className:i("i-drawer",`i-drawer-${r}`),onClick:e=>e.stopPropagation(),children:[e("header",{className:"i-drawer-header",children:[s,t(Ye,{active:!c,className:"i-drawer-close",onClick:N})]}),t("div",{className:"i-drawer-content",children:m}),t("div",{className:"i-drawer-footer",children:l})]})}),document.body)}const rt=e=>{const{label:n,type:a,className:r,children:s,...l}=e;return t("ul",{className:i("i-list",r),...l,children:g.map(s,((e,t)=>{const i="function"==typeof n?n(t):n;return e.type===f?e:p(e,{label:i,...e.props,type:a})}))})};rt.Virtual=e=>{const{data:n,itemKey:i,renderItem:a,...r}=e;return t(de,{data:n,itemKey:i,...r,children:(e,t)=>a?.(e,t)})},rt.Item=n=>{const{ref:a,active:r,type:s,align:l,disabled:o,label:c,style:d,className:u,children:p,...m}=n;return e("li",{ref:a,className:i("i-list-item",u,{"i-list-item-active":r,"i-list-option":"option"===s,disabled:o}),style:{alignItems:l,...d},...m,children:[void 0!==c&&t("span",{className:"i-list-item-label",children:c}),p]})};const st=n=>{const{ref:a,getContainer:r=e=>e?.offsetParent??document.body,trigger:s,arrow:l,arrowProps:o={},className:c,children:d,...u}=n,p=h((()=>{let{left:e,top:t,pos:n}=o,i="";switch(n){case"left":e+=2,i="translate(-100%, -50%) rotate(180deg)";break;case"right":e-=2,i="translate(0, -50%)";break;case"top":t-=2,i="translate(-50%, -50%) rotate(-90deg)";break;case"bottom":t+=2,i="translate(-50%, -50%) rotate(90deg)"}return{left:e,top:t,transform:i}}),[o]),m=e("div",{ref:a,className:i("i-popup",c),...u,children:[l&&t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"i-popup-arrow",style:p,children:t("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z"})}),d]});return ce(m,r(s))};function lt(i){const{visible:a=!1,content:r,trigger:s="hover",gap:l=12,offset:o=8,fixed:c,position:m="top",showDelay:f=16,hideDelay:y=12,touchable:k,arrow:N=!0,align:C,fitSize:w,watchResize:x,clickOutside:$=!0,disabled:z,referToWindow:P,style:T,className:D,getContainer:I,children:M,onVisibleChange:S}=i,O=v(null),E=v(null),j=ie({show:!1,toggling:!1,style:{position:c?"fixed":"absolute"},arrowProps:{}});ae((e=>{if(!$)return;const t=e.target,n=O.current?.contains(t);j.show&&(!n||"contextmenu"===s)&&V(!1)}),E);const B=()=>{z||j.show&&("hover"!==s||"hover"===s&&!k)||(j.show=!0,j.toggling&&clearTimeout(j.toggling),j.toggling=setTimeout((()=>{const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=Pe(O.current,E.current,{position:m,gap:l,offset:o,align:C,refWindow:P});j.style={...j.style,opacity:1,transform:"none",left:e,top:t},j.arrowProps={left:n,top:i,pos:a},j.toggling&&clearTimeout(j.toggling),S?.(!0)}),f))},A=()=>{j.show&&(j.toggling=setTimeout((()=>{j.style={...j.style,opacity:0,transform:"translate(0, 2px)"},setTimeout((()=>{j.show=!1,j.toggling&&clearTimeout(j.toggling),S?.(!1)}),160)}),y))},V=e=>{void 0===e?j.show?A():B():e?B():A()},Y=re((()=>({click:{onClick:()=>V(!0)},hover:{onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1)},focus:{onFocus:()=>V(!0),onBlur:()=>V(!1)},contextmenu:{onContextMenu:e=>{if(e.preventDefault(),e.stopPropagation(),j.show){const[t,n]=Te(e,E.current);j.style={...j.style,left:t,top:n}}else j.show=!0,j.toggling=setTimeout((()=>{const[t,n]=Te(e,E.current);j.style={...j.style,opacity:1,transform:"none",left:t,top:n},j.toggling&&clearTimeout(j.toggling),S?.(!0)}),f)}},none:{}})),[]),L=h((()=>{if(!k)return{};const e={};return"hover"===s&&(e.onMouseEnter=()=>V(!0),e.onMouseLeave=()=>V(!1)),e}),[k,s]),W=()=>{if(!j.show)return;const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=Pe(O.current,E.current,{position:m,gap:l,offset:o,align:C,refWindow:P});Object.assign(j,{style:{...j.style,left:e,top:t},arrowProps:{left:n,top:i,pos:a}})};return d((()=>{if("contextmenu"===s)return;const{observe:e,unobserve:t,disconnect:n}=function(){const e=new WeakMap,t=new ResizeObserver((t=>{t.map((t=>{const n=e.get(t.target);n?.(t.target)}))}));return{observe:function(n,i){e.get(n)||(n&&t.observe(n),e.set(n,i))},unobserve:function(n){n&&t.unobserve(n),e.delete(n)},disconnect:function(){t.disconnect()}}}();return O.current&&e(O.current,W),x&&E.current?(e(E.current,W),()=>{x&&E.current&&(t(E.current),O.current&&t(O.current),n())}):void 0}),[x,E.current,O.current]),b((()=>{if(!w||!j.show)return;const e=["top","bottom"].includes(m),t=O.current?.[e?"offsetWidth":"offsetHeight"];j.style={...j.style,[e?"width":"height"]:t}}),[j.show,w]),b((()=>{V(a)}),[a]),e(n,{children:[g.map(M,(e=>{if(!u(e))return;const{className:t,...n}=e.props;return Object.keys(Y[s]).map((e=>{if(!n[e])return;const t=Y[s][e];Y[s][e]=i=>{t(),n[e](i)}})),p(e,{ref:O,className:t,...n,...Y[s]})})),j.show&&t(st,{ref:E,arrow:N&&"contextmenu"!==s,style:{...T,...j.style},arrowProps:j.arrowProps,className:D,...L,trigger:O.current,getContainer:I,children:r})]})}const{Item:ot}=rt,ct=e=>{const{width:n,content:i,children:a,...r}=e;return t(lt,{trigger:"click",position:"bottom",touchable:!0,content:t(rt,{className:"i-dropdown-content",style:{minWidth:n},children:i}),...r,children:a})};ct.Item=e=>{const{more:n,moreProps:i,...a}=e,r=t(ot,{...a});return n?t(lt,{position:"right",touchable:!0,arrow:!1,align:"start",offset:10,hideDelay:240,...i,content:t(rt,{className:"i-dropdown-content",onClick:e=>e.stopPropagation(),children:n}),children:r}):r};const dt=e=>{const{as:n="div",align:a,justify:r,direction:s,wrap:l,gap:o,columns:c,className:d,style:u,...p}=e,m=h((()=>{if(c)return"number"==typeof c?`repeat(${c}, 1fr)`:c}),[c]);return t(n,{...p,style:{alignItems:a,justifyContent:r,gap:o,flexDirection:s,flexWrap:!0===l?"wrap":l,gridTemplateColumns:m,...u},className:i(d,{[c?"grid":"flex"]:!0})})},ut=y({});class pt{id;data={};cacheData={};rules={};constructor(){this.id=r(8),this.data={}}get(e){return e?this.data[e]:this.data}set(e,t){const n=this.id;if(this.data)return"string"==typeof e?(this.data[e]=t,this.cacheData[e]=t,void ue.publish(`${n}:set:${e}`,t)):void Object.keys(e).map((t=>{this.data[t]=e[t],this.cacheData[t]=e[t],ue.publish(`${n}:set:${t}`,e[t])}))}delete(e){delete this.data[e]}clear(){this.data&&(this.cacheData={},Object.keys(this.data).map((e=>{ue.publish(`${this.id}:set:${e}`,void 0),this.data[e]=void 0})))}async validate(e){const{id:t,rules:n,data:i}=this;if(!n)return i;if(e){const a=n[e],r={validator:e=>Array.isArray(e)?e.length>0:![void 0,null,""].includes(e),message:void 0};"function"==typeof a?r.validator=a:!0===a?r.message="required":Object.assign(r,a);const s=r.validator?.(i[e],this);return s?(ue.publish(`${t}:invalid:${name}`,{message:null,status:"normal"}),!0):(ue.publish(`${t}:invalid:${e}`,{message:r.message,status:"error"}),!1)}let a=!0;return Object.keys(i).map((e=>{const r=n[e];if(void 0===r)return;const s={validator:e=>Array.isArray(e)?e.length>0:!!e,message:void 0};"function"==typeof r?s.validator=r:!0===r?s.message="required":Object.assign(s,r);const l=s.validator?.(i[e],this);l?ue.publish(`${t}:invalid:${e}`,{message:null,status:"normal"}):(ue.publish(`${t}:invalid:${e}`,{message:s.message,status:"error"}),a=!1)})),!!a&&i}}const mt=e=>{const{form:n={},rules:a,initialValues:r,style:s,className:l,width:o,children:c,onEnter:u,...p}=e;return d((()=>{Object.assign(n,{data:{...r},rules:a})}),[n]),t(ut.Provider,{value:n,children:t("form",{style:{...s,width:o},className:i("i-form",l),onKeyDown:e=>{13===e.keyCode&&u?.(n.data,n)},...p,children:c})})};function ht(i){const{title:a,footer:r,hideCloseButton:s,footerLeft:l,okButtonProps:o={children:"确定",onClick:i.onOk},cancelButtonProps:c={secondary:!0,children:"关闭",onClick:i.onClose},children:d,onClose:u}=i,p=a||!s,m=h((()=>{if(r||null===r)return r;const i=Object.assign({},o),a=Object.assign({},c);return e(n,{children:[l,t(ke,{...i}),t(ke,{...a})]})}),[r,o,c]);return e(n,{children:[p&&e("header",{className:"i-modal-header",children:[a&&t("b",{children:a}),t(Ye,{active:!s,className:"i-modal-close",onClick:u})]}),t("div",{className:"i-modal-content",children:d}),t("footer",{className:"i-modal-footer",children:m})]})}function gt(n){const{visible:a,title:r,footer:s,okButtonProps:l,cancelButtonProps:o,closable:c=!0,hideBackdrop:u,backdropClosable:p=!0,hideCloseButton:h,width:g,height:f,customized:b,fixed:y,shadow:k=!0,children:N,style:C,className:w,footerLeft:x,onVisibleChange:$,onClose:z,onOk:P,...T}=n,[D,I]=m(a),[M,S]=m(!1),[O,E]=m(!1),j=v(!0),B=()=>{if(j.current){if(j.current=!1,!c)return E(!0),void setTimeout((()=>{E(!1),j.current=!0}),400);S(!1),setTimeout((()=>{I(!1),j.current=!0,$?.(!1),z?.()}),240)}};return d((()=>{a?j.current&&(I(!0),j.current=!1,setTimeout((()=>{S(!0),$?.(!0),j.current=!0}),24)):B()}),[a]),D?ce(t("div",{className:i("i-modal-container",{"i-modal-backdrop":!u,"i-modal-customized":b,"i-modal-active":M,fixed:y},w),style:C,onClick:function(){p&&B()},children:e("div",{className:i("i-modal",{bounced:O,shadow:k}),style:{width:g,height:f},onClick:e=>e.stopPropagation(),...T,children:[b&&N,!b&&t(ht,{title:r,hideCloseButton:h,footer:s,okButtonProps:l,cancelButtonProps:o,children:N,footerLeft:x,onOk:P,onClose:B})]})}),document.body):null}mt.useForm=function(e){const t=v(null);return t.current||(t.current=e??new pt),t.current},mt.Field=function(e){const{name:t,required:n,children:i}=e,a=ie({value:void 0,status:"normal",message:void 0,update:0}),r=k(ut),{id:s}=r,l=h((()=>g.map(i,(e=>{if(!u(e))return null;const{onChange:i}=e.props,{value:s,status:l,message:o}=a;return p(e,{value:s,status:l,message:o,required:n,onChange:(...e)=>{var n;n=e[0],t&&r.set(t,n),i?.(...e),Object.assign(a,{status:"normal",message:void 0})}})}))),[i,a.update]);return d((()=>{if(t)return ue.subscribe(`${s}:set:${t}`,((e,t)=>{a.value=t,a.update+=1})),ue.subscribe(`${s}:invalid:${t}`,((e,t)=>{Object.assign(a,t),a.update+=1})),Promise.resolve().then((()=>{r.set(t,r.cacheData[t]??void 0)})),()=>{ue.unsubscribe(`${s}:set:${t}`),ue.unsubscribe(`${s}:invalid:${t}`),r.delete(t)}}),[t,i]),t?l:i};const vt=e=>{const{ref:n}=e,i=ie({});return N(n,(()=>({update:(e={})=>{Object.assign(i,e)}}))),t(gt,{...e,...i})},ft=e=>{const{as:n="span",size:a,weight:r,decoration:s,gradient:l,wave:o,style:c,className:d,children:u}=e,p=h((()=>l&&Array.isArray(l)?{backgroundImage:`-webkit-linear-gradient(${l.join(",")})`,backgroundClip:"text"}:{}),[l]);return t(n,{style:{fontSize:a,fontWeight:r,textDecoration:s,...p,...c},className:i(d,{"i-text-gradient":l,"i-text-gradient-wave":o}),children:u})};function bt(n){const{value:i,height:a=40,size:r=8}=n;return e("div",{className:"i-progress-circle",children:[e("svg",{width:a,height:a,children:[t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--background-opacity-2)",strokeWidth:r}),t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--color-main)",strokeWidth:r,strokeDasharray:100,pathLength:100,className:"i-progress-circle-path",strokeLinecap:"round",style:{strokeDashoffset:`calc(100 - ${i})`}})]}),e("span",{className:"i-progress-circle-value",children:[t("span",{children:i}),t(ft,{size:".81em",className:"color-7",children:"%"})]})]})}ft.Number=function(e){const{count:n,to:i,decimal:a,thousand:r=",",duration:s=2400,easing:l,...o}=e,[c,u]=m(n),p=h((()=>{if(void 0===c)return;const e=c.toFixed(a);return r?Me(c,{precision:a,thousand:r}):e}),[c,r]);return d((()=>{void 0!==n&&void 0!==i&&function(e,t,n=1e3,i,a=e=>1-Math.pow(1-e,4)){const r=performance.now(),s=t-e;let l=requestAnimationFrame((function e(){l=requestAnimationFrame(e);let t=(performance.now()-r)/n;t>=1&&(t=1,cancelAnimationFrame(l));const o=s*a(t);i?.(o)}))}(n,i,s,(e=>u(n+e)),l)}),[i]),d((()=>u(n)),[n]),t(ft,{...o,children:p})},ft.Time=function(e){const{seconds:n,zero:i,units:a,...r}=e,s=h((()=>void 0===n?"":function(e,t){const n=[],{zero:i=!0,units:a=["",":",":"]}=t,r=a.length;let s=0;for(;s<r&&!(e<=0&&s>1);){const t=Math.round(e%60);e=Math.floor(e/60),n.unshift((i&&t<10?`0${t}`:t)+a[s++])}return n.join("")}(n,{zero:i,units:a})),[n]);return t(ft,{...r,children:s})},ft.HighLight=function(e){const{keyword:n,text:i,escape:a,caseSensitive:r,renderWord:s=e=>t("mark",{children:e}),...l}=e,o=h((()=>{const e=i;return pe({searchWords:"string"==typeof n?[n]:n,textToHighlight:i,caseSensitive:r,autoEscape:a}).map(((n,i)=>{const{end:a,highlight:r,start:l}=n,o=e.slice(l,a);return r?t(f,{children:s(o)},i):o}))}),[n,i,a,r]);return t(ft,{...l,children:o})};const yt=e=>{const{ref:n,value:a,size:r,barClass:s,dragging:l,renderCursor:o,onMouseDown:c,onTouchStart:d}=e;return t("div",{ref:n,className:"i-progress",style:{height:r},onMouseDown:c,onTouchStart:d,children:t("div",{className:i("i-progress-bar",s,{"no-transition":l}),style:{width:`${a}%`},children:o&&t("a",{className:"i-progress-cursor",children:o(a??0)})})})},kt=n=>{const{value:a=0,size:r=8,height:s=40,precision:l=0,style:o,draggable:c=!0,type:u="line",barClass:p,label:m,labelInline:g,className:f,renderCursor:b,onChange:y}=n,k=v(null),N=ie({value:a,dragging:!1,width:0,start:0}),C=h((()=>{let e=+N.value.toFixed(l);return e=Math.min(100,e),e=Math.max(0,e),e}),[N.value,l]),w=e=>{if(!k.current||!c)return;e.touches&&(e=e.touches[0]);const t=k.current.getBoundingClientRect(),n=100*(e.pageX-t.left)/t.width;Object.assign(N,{value:n,width:t.width,start:t.left,dragging:!0})};return Ge((e=>{if(!N.dragging||!c)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const{start:t,width:n}=N,i=e.pageX-t;i<0||i>n||(N.value=100*(e.pageX-t)/n)})),Ke((()=>{N.dragging&&c&&(y?.(C),N.dragging=!1)})),d((()=>{N.value=a>100?100:a<0?0:a}),[a]),e("div",{className:i("i-input-label",f,{"i-input-inline":g}),style:o,children:[m&&t("span",{className:"i-input-label-text",children:m}),"line"===u&&t(yt,{ref:k,size:r,barClass:p,dragging:N.dragging,value:N.value,renderCursor:b,onMouseDown:w,onTouchStart:w}),"circle"===u&&t(bt,{value:N.value,height:s,size:r})]})},Nt=n=>{const{ref:a,style:r,hideControls:l,autoplay:o,muted:c,volume:u=50,height:p,width:m,useOriginControls:h,timeProgressProps:g={barClass:"bg-2"},volumeProgressProps:f={barClass:"bg-1"},className:b,onFullScreenChange:y,...k}=n,C=ie({playing:o,volume:c?0:u,volumeCache:0,muted:c,current:0,duration:0,isFullscreen:!1,controlHidden:!0}),w=v(null),x=v(null),$=e=>{const t=e.target;t.paused||Object.assign(C,{current:t.currentTime})},z=e=>{C.playing=!e.target.paused},E=()=>{const e=w.current?.parentElement;e&&(C.isFullscreen=document.fullscreenElement===e)},j=e=>{const t=e.target;Object.assign(C,{volume:100*t.volume,muted:0===t.volume})},B=()=>{const e=w.current;e&&(e.paused?e.play():e.pause())},A=()=>{const e=w.current;e&&(e.currentTime=0,e.pause())},V=()=>{const e=w.current?.parentElement;var t;e&&(C.isFullscreen?document.exitFullscreen?.():(t=e,t.requestFullscreen?.()),y?.(!C.isFullscreen))},Y=!l&&!h,L=()=>{x.current&&(clearTimeout(x.current),x.current=null)},W=s({interval:300},(()=>{Y&&(C.controlHidden=!1,L(),x.current=setTimeout((()=>{C.controlHidden=!0}),1e3))}));return N(a,(()=>({play:()=>{const e=w.current;e&&e.play()},pause:()=>{const e=w.current;e&&e.pause()},stop:A,fullscreen:V,getVideo:()=>w.current}))),d((()=>{const e=w.current;if(e)return e.addEventListener("timeupdate",$),e.addEventListener("play",z),e.addEventListener("pause",z),e.addEventListener("volumechange",j),document.addEventListener("fullscreenchange",E),()=>{L(),e.removeEventListener("timeupdate",$),e.removeEventListener("play",z),e.removeEventListener("pause",z),e.removeEventListener("volumechange",j),document.removeEventListener("fullscreenchange",E)}}),[]),e("div",{className:i("i-video",b),style:{height:p,width:m,...r},onClick:B,onDoubleClick:()=>V(),onMouseMove:W,children:[t("video",{ref:w,onCanPlay:e=>{const t=e.target;Object.assign(C,{duration:t.duration,current:t.currentTime}),t.volume=C.volume/100},...k,controls:h}),Y&&e("div",{className:i("i-video-controls",{"i-video-controls-hidden":C.controlHidden}),onClick:e=>e.stopPropagation(),children:[e("div",{className:"i-video-control flex-1",children:[t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(Ne,{icon:t(P,{})}),active:C.playing,onClick:B,children:t(Ne,{icon:t(T,{})})}),t(ke,{className:"i-video-btn",flat:!0,square:!0,onClick:A,children:t(Ne,{icon:t(D,{})})}),e("span",{className:"i-video-times font-sm",children:[t(ft.Time,{seconds:C.current})," /",t(ft.Time,{seconds:C.duration})]}),t(kt,{className:"mr-8",...g,value:C.current/C.duration*100,onChange:e=>{const t=w.current;t&&(t.currentTime=C.duration*e/100)}})]}),t("div",{className:"i-video-control",children:t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(Ne,{icon:t(I,{})}),active:C.isFullscreen,onClick:()=>V(),children:t(Ne,{icon:t(M,{})})})}),e("div",{className:"i-video-control",children:[t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,active:C.volume<=0,after:t(Ne,{icon:t(S,{}),size:"1.2em"}),onClick:()=>{const e=w.current;if(e)return e.volume>0?(C.volumeCache=e.volume,void(e.volume=0)):void(e.volume=0===C.volumeCache?.5:C.volumeCache)},children:t(Ne,{icon:t(O,{})})}),t(kt,{style:{width:100},className:"mr-8",...f,value:C.volume,onChange:e=>{const t=w.current;t&&(t.volume=e/100)}})]})]})]})};function Ct(n){const{name:i,suffix:a,type:r}=n;switch(r){case ze.IMAGE:return t("img",{src:n.src});case ze.VIDEO:return t(Nt,{...n});default:return e("div",{className:"i-preview-unknown",children:[t(Ne,{icon:t(E,{}),size:"3em"}),t("h5",{className:"mt-4",children:i||a||"?"})]})}}function wt(a){const{items:r=[],initial:l=0,renderFile:o=Ct,onRotate:c,onChange:d,onClose:u,onZoom:p}=a,m=ie({current:l,rotate:0,scale:1,translate:[0,0],start:[0,0],dragging:!1}),g=v(null),f=v([0,0]),b=h((()=>r.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Oe(t.src)||"",t.type=Ee(t.suffix,e.type),t}))),[r]),{file:y,content:k}=h((()=>{const e=b[m.current];return{file:e,content:o(e)}}),[m.current,r]),N=y.type===ze.IMAGE,C=e=>{const t=b.length,{current:n}=m;m.current=e>=t?0:e<0?t-1:e,d?.(m.current,n),m.rotate=b[m.current].rotate||0,1!==m.scale&&(m.scale=1,p?.(1)),c?.(m.rotate),m.translate=f.current=[0,0]},x=e=>{m.rotate+=e,c?.(m.rotate)},$=s({interval:60},(e=>{if(!N)return;let t=m.scale+(e.deltaY<0?.05:-.05);t>2&&(t=2),t<.25&&(t=.25),p?.(t),m.scale=t}));return Ge((e=>{if(!m.dragging)return;e.preventDefault();const[t,n]=f.current,[i,a]=m.start,r=e.pageX-i,s=e.pageY-a;m.translate=[t+r,n+s]})),Ke((()=>{m.dragging&&(m.dragging=!1,f.current=m.translate)})),e(n,{children:[t("div",{ref:g,className:i("i-preview-content",{"no-transition":m.dragging}),style:{transform:`translate(${m.translate.map((e=>`${e}px`)).join(",")}) rotate(${m.rotate}deg) scale(${m.scale})`},onWheel:$,onMouseDown:e=>{N&&(e.preventDefault(),m.dragging=!0,m.start=[e.pageX,e.pageY])},onClick:e=>e.stopPropagation(),children:k}),e("div",{className:"i-preview-controls",children:[t(ke,{square:!0,flat:!0,onClick:u,children:t(Ne,{icon:t(w,{})})}),b.length>1&&e("span",{className:"px-8",children:[m.current+1," / ",b.length]}),1!==m.scale&&e(ke,{flat:!0,onClick:()=>m.scale=1,children:[t(Ne,{icon:t(j,{})}),e("span",{className:"mt-2",children:[(100*m.scale).toFixed(0),"%"]})]}),t(ke,{square:!0,flat:!0,href:y.src,target:"_blank",children:t(Ne,{icon:t(B,{})})}),t(ke,{square:!0,flat:!0,href:y.src,download:!0,target:"_blank",children:t(Ne,{icon:t(A,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>x(90),children:t(Ne,{icon:t(V,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>x(-90),children:t(Ne,{icon:t(Y,{})})}),b.length>1&&e(n,{children:[t(ke,{square:!0,flat:!0,onClick:()=>C(m.current-1),children:t(Ne,{icon:t(L,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>C(m.current+1),children:t(Ne,{icon:t(W,{})})})]})]})]})}function xt(){const e=v(null);return n=>{const{items:i,modalProps:a,onClose:r,...s}=n,l=Se(t(vt,{ref:e,visible:!0,className:"i-preview",customized:!0,shadow:!1,...a,children:t(wt,{...s,items:i,onClose:()=>{e.current?.update({visible:!1})}}),fixed:!0,onClose:()=>{r?.(),l?.()}}))}}const $t=a=>{const{src:r,round:s,size:l,initSize:o,lazyload:c,fallback:u=t(Ne,{icon:t(H,{}),size:"2em",className:"color-5"}),fit:p,style:m,className:h,cover:g,coverClass:f,usePreview:b,onLoad:y,onError:k,onClick:N,...C}=a,w=ie({status:"loading"}),x=v(null),$=p?"100%":void 0,{observe:z,unobserve:P}=Ze(),T=xt(),D=e=>{N?.(e),b&&r&&T({items:[{src:r,type:ze.IMAGE}]})};d((()=>{if(r&&(x.current?.complete||(w.status="loading"),c&&x.current))return z(x.current,((e,t)=>{t&&(e.setAttribute("src",e.dataset.src||""),P(e))})),()=>{x.current&&P(x.current)}}),[r]),C[c?"data-src":"src"]=r;const I="loading"===w.status?o:void 0;return t("div",{style:{width:l??I,height:l??I,...m},className:i("i-image",h,{rounded:s,[`i-image-${w.status}`]:w.status}),children:"error"===w.status?u:e(n,{children:[r&&t("img",{ref:x,style:{objectFit:p,width:$,height:$},...C,onLoad:e=>{y?.(e),w.status=void 0},onError:e=>{k?.(e),w.status="error"},onClick:D}),r&&"loading"===w.status&&t(be,{absolute:!0}),g&&t("div",{className:i("i-image-cover",f),onClick:D,children:g})]})})};function zt(n){const{label:a,className:r,labelInline:s,style:l,children:o,status:c,tip:d,required:u}=n;return e("label",{className:i("i-input-label",r,{"i-input-inline":s}),style:l,children:[a&&e("span",{className:"i-input-label-text",children:[u&&t("span",{className:"error",children:"*"}),a]}),o,d&&t("span",{className:i("i-input-message",{[`i-input-${c}`]:"normal"!==c}),children:d})]})}$t.List=function(e){const{items:n=[],gap:i=8,columns:a,wrap:r,direction:s,usePreview:l,onClick:o,...c}=e,d=xt(),u=h((()=>n.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Oe(t.src)||"",t.type=Ee(t.suffix,e.type),t}))),[n]);return u.length?t(dt,{className:"i-image-list",gap:i,columns:a,wrap:r,direction:s,children:u.map(((e,n)=>t($t,{src:e.src,size:60,usePreview:!1,onClick:e=>((e,t)=>{o?.(e),l&&d({items:u,initial:t})})(e,n),...c},n)))}):""};const Pt=n=>{const{ref:a,type:r="text",label:s,name:l,value:o=n.initValue??"",initValue:c="",prepend:u,append:p,labelInline:m,className:g,status:v="normal",message:f,tip:b,clear:y,hideVisible:k,border:N,required:C,onChange:w,onEnter:x,style:$,...z}=n,P=ie({value:o,type:r,visible:!1}),T=h((()=>{if("password"===r)return P.visible?t(F,{}):t(q,{})}),[P.visible]);d((()=>{P.value=o}),[o]);const D={ref:a,type:P.type,name:l,value:P.value,className:i("i-input",`i-input-${r}`),onChange:e=>{const t=e.target.value;P.value=t,w?.(t,e)},onKeyDown:e=>{"Enter"===e.code&&x?.(e)},...z},I=y&&P.value,M="password"===r&&!!P.value;return t(zt,{label:s,labelInline:m,className:g,style:$,tip:f??b,status:v,required:C,children:e("div",{className:i("i-input-item",{[`i-input-${v}`]:"normal"!==v,"i-input-borderless":!N}),children:[u&&t("div",{className:"i-input-prepend",children:u}),t("input",{...D}),t(Ye,{active:!!I||M,icon:T,onClick:()=>{if("password"===r&&!k)return void Object.assign(P,{visible:!P.visible,type:P.visible?"password":"text"});w?.("")}}),p&&t("div",{className:"i-input-append",children:p})]})})};Pt.Textarea=e=>{const{ref:n,label:a,name:r,value:s=e.initValue,initValue:l,labelInline:o,className:c,status:u="normal",message:p,tip:m,autoSize:h,border:g,style:f,onChange:b,onEnter:y,...k}=e,N=ie({value:s}),C=v(null);d((()=>{N.value=s}),[s]);const w={ref:n,name:r,value:N.value,className:"i-input i-textarea",onChange:e=>{const t=e.target.value;N.value=t;const n=C.current?.firstChild;h&&n&&(n.style.height=`${n.scrollHeight}px`),b?.(t,e)},onKeyDown:e=>{"Enter"===e.code&&(e.stopPropagation(),y?.(e))},...k};return t(zt,{label:a,labelInline:o,className:c,style:f,tip:p??m,status:u,children:t("div",{ref:C,className:i("i-input-item",{[`i-input-${u}`]:"normal"!==u,"i-input-borderless":!g}),children:t("textarea",{...w})})})},Pt.Number=n=>{const{ref:a,label:r,name:s,value:l=n.initValue??"",initValue:o,labelInline:c,step:u=1,min:p=-1/0,max:m=1/0,thousand:h,precision:g,type:v,className:f,status:b="normal",append:y,border:k,prepend:N,message:C,tip:w,hideControl:z,style:P,onChange:T,onEnter:D,onInput:I,onBlur:M,...S}=n,O=ie({value:l}),E=e=>e?"number"!=typeof e&&h?e.replaceAll(h,""):e:"",j=e=>{const t=E(O.value)??0,n=Be(+t+e,p,m);O.value=(e=>Me(e,{precision:g,thousand:h}))(n),T?.(n)};d((()=>{O.value=l}),[l]);const B={ref:a,name:s,value:O.value,className:"i-input i-input-number",onChange:e=>{const{value:t}=e.target,n=E(t.replace(/[^\d\.-]/g,""));O.value=n,T?.(+n,e)},...S};return t(zt,{label:r,labelInline:c,className:f,style:P,tip:C??w,status:b,children:e("div",{className:i("i-input-item",{[`i-input-${b}`]:"normal"!==b,"i-input-borderless":!k}),children:[N&&t("div",{className:"i-input-prepend",children:N}),!z&&t(Ye,{active:!0,icon:t(x,{}),onClick:()=>j(-u)}),t("input",{...B}),!z&&t(Ye,{active:!0,icon:t($,{}),onClick:()=>j(u)}),y&&t("div",{className:"i-input-append",children:y})]})})},Pt.Range=n=>{const{label:a,name:r,value:s=n.initValue??"",initValue:l,labelInline:o,min:c=-1/0,max:u=1/0,type:p,className:m,status:h="normal",message:g,tip:v,append:f,prepend:b,step:y=1,thousand:k,precision:N,hideControl:C,placeholder:w,border:z,onChange:P,onBlur:T,style:D,...I}=n,M=ie({value:s}),S=e=>e?"number"!=typeof e&&k?e.replaceAll(k,""):e:"",O=(e,t)=>{const{value:n}=e.target,i=S(n.replace(/[^\d\.-]/g,"")),a=Array.isArray(M.value)?M.value:[];a[t]=+i,M.value=a,P?.(a,e)},E=(e,t,n)=>{e.preventDefault(),e.stopPropagation();const i=Array.isArray(M.value)?M.value:[],a=S(i[n])??0,r=Be(+a+t,c,u);i[n]=(e=>Me(e,{precision:N,thousand:k}))(r),M.value=i,P?.(i,e)};d((()=>{M.value=s}),[s]);const j={name:r,className:"i-input i-input-number",...I};return t(zt,{label:a,labelInline:o,className:m,style:D,tip:g??v,status:h,children:e("div",{className:i("i-input-item",{[`i-input-${h}`]:"normal"!==h,"i-input-borderless":!z}),children:[b&&t("div",{className:"i-input-prepend",children:b}),!C&&t(Ye,{active:!0,icon:t(x,{}),onClick:e=>E(e,-y,0)}),t("input",{value:M.value?.[0]||"",placeholder:w?.[0],...j,onChange:e=>O(e,0)}),!C&&t(Ye,{active:!0,icon:t($,{}),onClick:e=>E(e,y,0)}),t(Ye,{active:!0,icon:t(R,{}),style:{margin:0},onClick:e=>{e.preventDefault(),e.stopPropagation();const t=M.value?M.value:[],n=t[0];t[0]=t[1],t[1]=n,M.value=t,P?.(t)}}),!C&&t(Ye,{active:!0,icon:t(x,{}),onClick:e=>E(e,-y,1)}),t("input",{value:M.value?.[1]||"",placeholder:w?.[1],...j,onChange:e=>O(e,1)}),!C&&t(Ye,{active:!0,icon:t($,{}),onClick:e=>E(e,y,1)}),f&&t("div",{className:"i-input-append",children:f})]})})};const Tt={left:"flex-start",center:"center",right:"flex-end"},Dt=12,It={duration:3e3,closable:!0,active:!1},Mt=function(){const e=document.createElement("div");return e.dataset.id="messages",document.body.append(e),e}(),St={callout(e){},close(){}},Ot={left:[],center:[],right:[]},Et={left:[],center:[],right:[]};le(Mt).render(t((function(){const i=v(null),a=ie({items:{left:[],center:[],right:[]},tops:{left:[],center:[],right:[]}}),r={left:0,center:0,right:0};d((()=>{Object.assign(St,{callout:function(e){const{align:t="center",unshift:n,onShow:r}=e,s=Ot[t][n?"unshift":"push"](e);a.items[t]=[...Ot[t]],setTimeout((()=>{const e=i.current?.offsetHeight||0;Ot[t][n?0:s-1].active=!0,a.items[t]=[...Ot[t]],Et[t][n?"unshift":"push"](e),a.tops[t]=[...Et[t]],r?.()}),0),0!==e.duration&&setTimeout(this.close.bind(e),e.duration)},close:function(){const e=this,{align:t="center",onHide:n}=e,i=Ot[t].findIndex((t=>t.id===e.id));i<0||(Ot[t][i].active=!1,a.items[t]=[...Ot[t]],e.timer=setTimeout((()=>{const i=Ot[t].findIndex((t=>t.id===e.id));Ot[t].splice(i,1),Et[t].splice(i,1),a.tops[t]=[...Et[t]],a.items[t]=[...Ot[t]],e.timer&&clearTimeout(e.timer),n?.()}),240))}})}),[]);const s=(e,s)=>{if(!e)return t(n,{});const{id:l,active:o,content:c,align:d="center",className:u}=e;r[d]+=a.tops[d][s-1]||0;const p=Dt*s+r[d];return t(jt,{ref:i,active:o,content:c,top:p,className:u,style:{alignSelf:Tt[d]},onClick:St.close.bind(e)},l)};return e("div",{className:"i-messages",children:[a.items.left.map(s),a.items.center.map(s),a.items.right.map(s)]})}),{}));const jt=function({ref:e,active:n,content:a,top:r,className:s,style:l,onClick:o}){return t("div",{ref:e,className:i("i-message",s,{"i-message-active":n}),style:{...l,top:r},onClick:o,children:a})};function Bt(e){return(["string","number"].includes(typeof e)||u(e))&&(e={content:e}),e=Object.assign({id:r(7)},It,e),St.callout(e),St.close.bind(e)}Bt.error=e=>Bt({content:e,className:"bg-error"}),Bt.success=e=>Bt({content:e,className:"bg-success"}),Bt.warning=e=>Bt({content:e,className:"bg-warning"}),gt.useModal=function(){const e=v(null);return{open:n=>{const i=Se(t(vt,{ref:e,visible:!0,...n,onClose:()=>{n.onClose?.(),i?.()}}))},update:t=>{if(!e.current)return;const{update:n}=e.current;n(t)}}};const At=n=>{const{page:a,active:r,children:s,onChange:l}=n,[o,c]=m(!1);return e("a",{className:i("i-page",{"i-page-active":r,"i-page-loading":o,"i-page-disabled":!1}),"data-page":a,onClick:async()=>{r||o||(c(!0),await(l?.(a)),c(!1))},children:[o&&t(be,{}),s]})},Vt=a=>{const{page:r=1,size:s=10,total:l=0,sibling:o=2,prev:c=t(Ne,{icon:t(L,{})}),next:u=t(Ne,{icon:t(W,{})}),simple:p,jumper:g,className:v,renderEllipsis:f=()=>t(Ne,{icon:t(X,{}),className:"color-7"}),renderPage:b=e=>e,onChange:y,...k}=a,[N,C]=m(r),[w,x]=m(!1),$=h((()=>Math.ceil(l/s)),[s,l]),[z,P,T]=h((()=>{const e=Math.max(1,N-o),t=Math.min($,N+o);return[e,t,Array.from({length:t-e+1}).map(((t,n)=>e+n))]}),[N,$,o]);if($<=N&&1===N)return t(n,{});const D=async e=>{if(y&&!w)return x(!0),new Promise((async t=>{void 0!==e&&(await y(e),C(e),x(!1),t())}))};return d((()=>C(r)),[r]),e("div",{className:i("i-pagination",v),...k,children:[c&&t(At,{page:N-1||1,onChange:D,children:c}),z>1&&t(At,{page:1,onChange:D,children:b(1)}),z>2&&f(),T.map((e=>t(At,{page:e,active:e===N,onChange:D,children:b(e)},e))),P<$-1&&f(),P<$&&t(At,{page:$,onChange:D,children:b($)}),u&&t(At,{page:N+1,onChange:D,children:u})]})},Yt=n=>{const{dot:a,dotClass:r,outline:s,round:l,size:o="normal",className:c,children:d,onClose:u,onClick:p,...m}=n;return e("span",{className:i("i-tag",{"i-tag-outline":s,"i-tag-clickable":p,[`i-tag-${o}`]:"normal"!==o,round:l},c),onClick:p,...m,children:[a&&t("span",{className:i("i-tag-dot",r)}),d,u&&t(Ye,{active:!0,className:"i-tag-close",onClick:u})]})},Lt=n=>{const{value:a,options:r,filter:s,filterPlaceholder:l,multiple:o,empty:c=t(We,{}),onSelect:d,onFilter:u}=n;return e("div",{className:i("i-select-options",{"i-select-options-multiple":o}),children:[s&&o&&e("div",{className:"i-select-filter",children:[t(Ne,{icon:t(U,{}),className:"color-8 ml-8 my-auto",size:"1.2em"}),t("input",{type:"text",className:"i-input",placeholder:l,onChange:u})]}),0===r.length&&c,r.map(((n,i)=>{const{label:r,value:s,disabled:l}=n,c=o?a?.includes(s):a===s;return e(rt.Item,{active:c,type:"option",onClick:()=>d?.(s,n),disabled:l,children:[o&&t(Ne,{icon:t(G,{}),className:"i-select-option-check",size:"1em"}),r]},s||i)}))]})},Wt=n=>{const{options:i,value:a,maxDisplay:r,multiple:s,onSelect:l}=n;return s?((e=[],t=[],n=3)=>{const i=e.flatMap((e=>t.includes(e.value)?[e]:[]));if(n>=i.length)return i;const a=i.length-n,r=i.slice(0,n);return r.push(a),r})(i,a,r).map(((n,i)=>{if("number"==typeof n)return e(Yt,{children:["+",n]},i);const{label:a,value:r}=n;return t(Yt,{onClose:e=>{e?.stopPropagation(),l?.(r,n)},children:a},r)})):i.find((e=>e.value===a))?.label},Ht=n=>{const{ref:r,type:s="text",name:l,label:o,value:c="",placeholder:u,options:p=[],multiple:g,prepend:v,append:f,labelInline:b,style:y,className:k,message:N,status:C="normal",hideClear:w,hideArrow:x,maxDisplay:$,border:z,filter:P,tip:T,filterPlaceholder:D="...",popupProps:I,onSelect:M,onChange:S,...O}=n,E=ie({inputValue:"",filterValue:"",value:c,loading:!1}),[j,B]=m(!1),A=h((()=>Ie(p)),[p]),V=h((()=>{const{filterValue:e}=E;if(!e||!P)return A;const t="function"==typeof P?P:t=>t.value.includes(e)||t.label.includes(e);return A.filter(t)}),[A,P,E.filterValue]),Y=e=>{E.value=e,S?.(e)},L=(e,t)=>{if(M?.(e,t),g){const t=[...E.value],n=t.findIndex((t=>t===e));return n>-1?t.splice(n,1):t.push(e),void Y(t)}B(!1),Y(e)},W=a({delay:400},(e=>{const t=e.target.value;E.filterValue=t}));d((()=>{E.value=c}),[c]);const H=g?E.value.length>0:!!E.value,F=!w&&j&&H,q=N??T;return e("label",{className:i("i-input-label",k,{"i-input-inline":b}),style:y,children:[o&&t("span",{className:"i-input-label-text",children:o}),t(lt,{position:"bottom",arrow:!1,fitSize:!0,...I,visible:j,trigger:"none",onVisibleChange:e=>{B(e),P&&(E.filterValue="")},content:t(Lt,{options:V,value:E.value,multiple:g,filter:!!P,filterPlaceholder:D,onSelect:L,onFilter:W}),children:e("div",{className:i("i-input-item",{[`i-input-${C}`]:"normal"!==C,"i-input-borderless":!z,"i-input-focus":j}),onClick:()=>B(!0),children:[v,t("input",{ref:r,type:"hidden",value:E.value,...O}),g?H?t("div",{className:i("i-input i-select",{"i-select-multiple":g}),children:Wt({options:A,value:E.value,multiple:g,maxDisplay:$,onSelect:L})}):t("input",{className:"i-input i-select",placeholder:u,readOnly:!0}):null,!g&&t("input",{value:j?E.filterValue:E.value,className:"i-input i-select",placeholder:E.value||u,onChange:e=>{E.filterValue=e.target.value},readOnly:!P}),t(Ye,{active:!x,icon:F?void 0:t(K,{}),onClick:()=>{j&&Y(g?[]:"")}}),f]})}),q&&t("span",{className:"i-input-message",children:q})]})},Ft={HEX:"toHexString",RGB:"toRgbString",HSB:"toHsbString"};function qt(n){const{value:i,type:a,onTypeChange:r,onChange:s}=n,l=ie({value:i,type:a});return d((()=>{l.value=i,l.type=a}),[i,a]),e("div",{className:"i-colorpicker-footer",children:[t(Ht,{readOnly:!0,hideClear:!0,hideArrow:!0,style:{width:"5.6em"},options:["RGB","HEX","HSB"],value:l.type,onChange:e=>{l.type=e,r(e)}}),t(Pt,{value:l.value,onChange:e=>{l.value=e,s?.(e)}})]})}const Rt=n=>{const{ref:a,color:r,handle:s,placeholder:l,className:o,...c}=n;return e("div",{ref:a,className:i("i-colorpicker-handle",o),...c,children:["text"!==s&&t("i",{className:"i-colorpicker-square",style:{background:r}}),"square"!==s&&t("span",{className:"i-colorpicker-text",style:{color:r},children:r??l})]})};function Xt(i){const{value:a,type:r="HEX",disabledAlpha:s,children:l,usePanel:o,handle:c="both",placeholder:u="Colors",popupProps:p,onChange:m}=i,h=ie({type:r,value:a,syncValue:a,visible:p?.visible}),g=e=>{const t=Ft[e];h.type=e,h.value=h.syncValue[t]?.()},v=e=>{h.value=e,h.syncValue=e,m?.(e)};return d((()=>{h.syncValue=a,h.value=a}),[a]),o?t(me,{...i}):t(lt,{trigger:"click",touchable:!0,position:"bottom",...p,visible:h.visible,content:t(me,{value:h.syncValue,disabledAlpha:s,panelRender:i=>e(n,{children:[i,t(qt,{value:h.value,type:h.type,onTypeChange:g,onChange:v})]}),onChange:e=>{h.syncValue=e},onChangeComplete:e=>{const t=Ft[h.type];1!==e.a&&(e.a=parseFloat(e.a.toFixed(3))),h.value=e[t]?.(),m?.(h.value)}}),onVisibleChange:e=>{h.visible=e,p?.onVisibleChange?.(e)},children:l??t(Rt,{color:h.value,handle:c,placeholder:u})})}const Ut=a=>{const{value:r,month:s,weeks:l=["一","二","三","四","五","六","日"],renderDate:o=e=>e.date(),disabledDate:c,onDateClick:d}=a,u=he(),p=h((()=>{const e=[],t=s.add(-1,"month").endOf("month");let{$W:n,$D:i}=t;if(0!==n){const i=Array.from({length:n}).map(((e,i)=>t.add(i+1-n,"day")));e.push(...i)}const a=s.endOf("month");return i=a.$D,n=a.$W,e.push(...Array.from({length:i}).map(((e,t)=>a.add(t+1-i,"day")))),0!==n&&e.push(...Array.from({length:7-n}).map(((e,t)=>a.add(t+1,"day")))),e}),[s]);return e(n,{children:[t("div",{className:"i-datepicker-weeks",children:l.map(((e,n)=>t("span",{className:"i-datepicker-week",children:e},n)))}),t("div",{className:"i-datepicker-dates",children:p.map(((e,n)=>{const a=e.isSame(r,"day"),l=e.isSame(s,"month"),p=e.isSame(u,"day"),m=c?.(e);return t("div",{className:i("i-datepicker-item",{"i-datepicker-active":a,"i-datepicker-same-month":l,"i-datepicker-today":p,"i-datepicker-disabled":m}),onClick:()=>(e=>{c?.(e)||d?.(e)})(e),children:o(e)},n)}))})]})},Gt=[1,2,3,4,5,6,7,8,9,10,11,12],Kt=n=>{const{value:i,unitMonth:a="月",unitYear:r="年",renderYear:s,renderMonth:l,onClick:o}=n;return e("a",{className:"i-datepicker-action","data-ripple":!0,onClick:o,children:[t("span",{children:s?.(i.year())}),r,t("span",{children:l?.(i.month()+1)}),a]})},Zt=n=>{const{value:a,unitYear:r,unitMonth:l,renderDate:o,renderMonth:c=e=>e,renderYear:u=e=>e,disabledDate:p,onDateClick:m}=n,h=ie({today:a,month:a||he(),selectedYear:he(),years:[],selectable:!1}),g=v(null),f=e=>{h.month=h.month[e?"add":"subtract"](1,"month")},b=s({interval:100},(e=>{const t=e.deltaY<0;h.years=h.years.map((e=>e+(t?-1:1)))}));return d((()=>{if(!h.selectable)return;h.selectedYear=h.month;const e=h.selectedYear.year(),t=Array.from({length:7}).map(((t,n)=>e-3+n));h.years=[...t]}),[h.selectable]),d((()=>{h.today=a,h.month=a||he()}),[a]),e("div",{className:"i-datepicker",children:[e("div",{className:"i-datepicker-units",children:[t(Kt,{value:h.month,unitYear:r,unitMonth:l,renderMonth:c,renderYear:u,onClick:()=>h.selectable=!0}),t("a",{className:"ml-auto i-datepicker-action","data-ripple":!0,onClick:()=>f(!1),children:t(Ne,{icon:t(L,{})})}),t("a",{className:"i-datepicker-action","data-ripple":!0,onClick:()=>f(!0),children:t(Ne,{icon:t(W,{})})})]}),e("div",{className:i("i-datepicker-ym",{"i-datepicker-active":h.selectable}),children:[t(Ye,{active:!0,className:"i-datepicker-close",onClick:e=>{e.stopPropagation(),h.selectable=!1}}),t("div",{ref:g,className:"i-datepicker-years",onWheel:b,children:h.years.map((e=>t("a",{className:i("i-datepicker-year",{"i-datepicker-active":e===h.selectedYear.year()}),onClick:()=>h.selectedYear=h.selectedYear.year(e),children:u(e)},e)))}),t("div",{className:"i-datepicker-months",children:Gt.map((e=>t("a",{className:i("i-datepicker-month",{"i-datepicker-active":e===h.month.month()+1}),onClick:()=>{return t=e,h.month=h.month.year(h.selectedYear.year()).month(t-1),void(h.selectable=!1);var t},children:c(e)},e)))})]}),t(Ut,{value:h.today,month:h.month,disabledDate:p,onDateClick:e=>{e.isSame(h.today,"day")||(e.isSame(h.month,"month")||(h.month=e),h.today=e,m?.(e))},renderDate:o})]})};he.extend(ge);const _t=["YYYY-MM-DD","YYYY-M-D","YYYY/MM/DD","YYYY/M/D"],Jt="YYYY-MM-DD",Qt=e=>{const{name:n,value:i,weeks:a,format:r=Jt,placeholder:s=e.format??Jt,renderDate:l,renderMonth:o,renderYear:c,popupProps:u,disabledDate:p,onDateClick:g,onChange:v,onBlur:f,...b}=e,y=ie({value:i}),[k,N]=m(!1),C=h((()=>{if(!y.value)return null;const e=he(y.value,r,!0);return e.isValid()?e:null}),[y.value]),w=e=>{y.value=e,v?.(e)},x=()=>{if(!y.value)return;const e=he(y.value,_t,!0);e.isValid()?w(e.format(r)):w("")};return d((()=>{y.value=i}),[i]),t(lt,{visible:k,trigger:"click",position:"bottom",arrow:!1,align:"start",onVisibleChange:e=>{u?.onVisibleChange?.(e),N(e)},watchResize:!0,content:t(Zt,{value:C,weeks:a,renderDate:l,renderMonth:o,renderYear:c,disabledDate:p,onDateClick:e=>{w(e.format(r))}}),...u,children:t(Pt,{value:y.value,append:t(Ne,{icon:t(Z,{}),className:"i-datepicker-icon",size:"1em"}),placeholder:s,onChange:w,onBlur:e=>{f?.(e),x()},onEnter:x,...b})})};function en(e){const{items:n=[],active:a,renderItem:r,unit:s,onClick:l}=e;return n.map((e=>{const n=e===a;return t("a",{className:i("i-timepicker-item",{"i-timepicker-item-active":n}),onClick:()=>l(e),children:r?.(e,n,s)??(e<10?`0${e}`:e)},e)}))}const tn={h:"hour",hh:"hour",m:"minute",mm:"minute",s:"second",ss:"second"};function nn(i){const{value:a,stepH:r=1,stepM:s=1,stepS:l=1,format:o,periods:c,renderItem:u,onChange:p,onFallback:m}=i,g=ie({period:void 0,hour:void 0,minute:void 0,second:void 0}),[v,f,b]=h((()=>{const e=o.includes("h"),t=o.includes("m"),n=o.includes("s");return[e?Array.from({length:(c?12:24)/r},((e,t)=>t*r)):[],t?Array.from({length:60/s},((e,t)=>t*s)):[],n?Array.from({length:60/l},((e,t)=>t*l)):[]]}),[r,s,l,o,c]),y=(e,t)=>{g[t]=e,(()=>{let e=o.replace(/(hh|h){1}|(mm|m){1}|(ss|s){1}/gi,(e=>{const t=e.toLowerCase(),n=g[tn[t]]??0;return t.length>1&&n<10?`0${n??0}`:n??0}));c&&v.length>0&&(e=`${g.period??c[0]} ${e}`),p(e)})()};return d((()=>{let e=a??"";if(c&&v.length>0&&a){const[t,n]=a.split(" ");e=n??"",g.period=c.includes(t)?t:void 0}const t=e.match(/\d+/g)??[];if(!t.length)return void m("");let n=0;const i=o.replace(/(hh|h)+|(mm|m)+|(ss|s)+/gi,(e=>{const i=t[n++]??0;let a=e;return"hour"===tn[e]&&(a=Math.min(c?11:23,i)),a=Math.min(59,i),g[tn[e]]=a,e.length>1&&a<10?`0${a}`:a}));m(i)}),[a]),e("div",{className:"i-timepicker",children:[v.length>0&&e(n,{children:[c&&t("div",{className:"i-timepicker-list",children:t(en,{items:c,active:g.period,onClick:e=>y(e,"period")})}),t("div",{className:"i-timepicker-list",children:t(en,{items:v,active:g.hour,unit:"hour",renderItem:u,onClick:e=>y(e,"hour")})})]}),f.length>0&&t("div",{className:"i-timepicker-list",children:t(en,{items:f,active:g.minute,unit:"minute",renderItem:u,onClick:e=>y(e,"minute")})}),b.length>0&&t("div",{className:"i-timepicker-list",children:t(en,{items:b,active:g.second,unit:"second",renderItem:u,onClick:e=>y(e,"second")})})]})}const an="hh:mm:ss";function rn(e){const{name:n,value:i,format:a=an,periods:r,placeholder:s=e.format??an,renderItem:l,onChange:o,onBlur:c,popupProps:u,...p}=e,h=ie({value:i,safeValue:void 0}),[g,v]=m(!1),f=e=>{h.value=e};return d((()=>{h.value=i}),[i]),t(lt,{visible:g,trigger:"click",position:"bottom",arrow:!1,align:"start",watchResize:!0,...u,onVisibleChange:e=>{u?.onVisibleChange?.(e),v(e)},content:t(nn,{value:h.value,format:a,periods:r,renderItem:l,onChange:f,onFallback:e=>{h.safeValue=e}}),children:t(Pt,{value:h.value,placeholder:s,append:t(Ne,{icon:t(_,{}),className:"i-timepicker-icon",size:"1em"}),onChange:f,onBlur:e=>{c?.(e),h.value&&(h.value=h.safeValue,f(h.safeValue))},...p})})}const sn={children:"确定"},ln={children:"取消",secondary:!0},on=n=>{const{trigger:i="click",visible:a,icon:r=t(Ne,{icon:t(J,{}),className:"error"}),content:s,okButtonProps:l,cancelButtonProps:o,children:c,align:d="end",position:u="top",offset:p=12,extra:m,onOk:h,onClose:g,...v}=n,f=ie({loading:!1,visible:a}),b=l?Object.assign({},sn,l):sn,y=o?Object.assign({},ln,o):ln,k=e("div",{className:"i-popconfirm",children:[e(dt,{gap:12,children:[r,t("div",{className:"i-popconfirm-content",children:s})]}),e(dt,{gap:12,justify:"flex-end",className:"mt-8 i-popconfirm-footer",children:[null!==o&&t(ke,{...y,onClick:async e=>{y.onClick?.(e),await(g?.()),f.visible=!1}}),m,null!==l&&t(ke,{loading:f.loading,...b,onClick:async e=>{f.loading=!0,b.onClick?.(e),h?.()?.then((()=>{f.visible=!1})).finally((()=>{f.loading=!1}))}})]})]});return t(lt,{content:k,...v,trigger:i,visible:f.visible,align:d,offset:p,position:u,onVisibleChange:e=>{f.visible=e,v.onVisibleChange?.(e)},children:c})};function cn(n){const{type:a="default",name:r,value:s,checked:l,disabled:o,children:c,onChange:d}=n;return e("label",{className:i("i-radio-item",{disabled:o}),children:[t("input",{type:"radio",name:r,checked:l,className:i("i-radio-input",`i-radio-${a}`),disabled:o,onChange:e=>{d?.(s,e)}}),t("span",{className:"i-radio-text",children:c})]})}function dn(n){const{label:a,name:r,options:s,value:l,type:o="default",status:c="normal",message:u,optionInline:p=!0,labelInline:m,disabled:g,required:v,className:f,onChange:b}=n,y=ie({value:l}),k=h((()=>Ie(s)),[s]),N=(e,t)=>{y.value=e,b?.(e,t)};return d((()=>{y.value=l}),[l]),e("div",{className:i("i-radio i-input-label",{[`i-radio-${c}`]:"normal"!==c,"i-input-inline":m},f),children:[a&&e("span",{className:"i-input-label-text",children:[v&&t("span",{className:"error",children:"*"}),a,u&&t("p",{className:"i-radio-message",children:u})]}),t("div",{className:i("i-radio-options",{"i-options-block":!p,"i-radio-options-button":"button"===o}),children:k.map((e=>t(cn,{name:r,value:e.value,checked:y.value===e.value,type:o,disabled:g||e.disabled,onChange:N,children:e.label},e.value)))})]})}dn.Item=cn;const un=n=>{const{other:a,children:r,vertical:s,height:l,size:o="auto",minSize:c=0,maxSize:d="100%",style:u,line:p,className:m,asPercent:h,onResize:g,onResizeComplete:f}=n,b=ie({size:o,resizing:!1,start:0,total:0}),y=v(null),k=()=>{const e=y.current?.getBoundingClientRect();if(e){if(b.resizing=!0,s)return b.total=e.height,void(b.start=e.top);b.total=e.width,b.start=e.left}};return Ke((()=>{b.resizing&&(b.resizing=!1,f?.(b.size))})),Ge((e=>{if(!b.resizing)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const t=e[s?"pageY":"pageX"]-b.start;b.size=h?t/b.total*100+"%":t,g?.(b.size)})),e("div",{ref:y,className:i("i-resizable",m,{"i-resizable-vertical":s}),style:{...u,height:l},children:[t("div",{className:"i-resizable-a",style:{[s?"height":"width"]:b.size,[s?"minHeight":"minWidth"]:c,[s?"maxHeight":"maxWidth"]:d},children:a}),t("div",{className:i("i-resizable-line",{"i-resizable-resizing":b.resizing}),onMouseDown:k,onTouchStart:k,onContextMenu:e=>e.preventDefault(),children:t("div",{className:"i-resizable-line-node",children:p})}),t("div",{className:"i-resizable-b",children:r})]})};function pn(){return t("i",{className:"i-step-divider"})}const mn=["finished","active","pending"];function hn(e,n){return t("span",{className:"i-step-item-index",children:"finished"===n?t(G,{style:{width:"1em",height:"1.5em"}}):e+1})}function gn(a){const{index:r=0,active:s=0,renderIcon:l=hn,title:o,vertical:c,line:d=t(pn,{}),asList:u,style:p,className:m,children:h,onClick:g}=a,v=mn[r===s?1:r<s?0:2];return t("div",{style:p,className:i("i-step-item",{[`i-step-item-${v}`]:!u},m),onClick:()=>{g?.(r)},children:e(n,c?{children:[e("div",{className:"i-step-item-left",children:[l?.(r,v),d]}),e("div",{className:"i-step-item-right",children:[t("div",{className:"i-step-item-title",children:o}),h&&t("div",{className:"i-step-item-content",children:h})]})]}:{children:[e("div",{className:"i-step-item-title",children:[l?.(r,v),t("span",{children:o}),d]}),h&&t("div",{className:"i-step-item-content",children:h})]})})}const vn=e=>{const{active:n=0,vertical:a,renderIcon:r,line:s,style:l,asList:o,className:c,children:d,onClick:u}=e,p=h((()=>{const e=[];let t=0;return g.map(d,(i=>{if(!i||i.type!==gn)return;const{props:l}=i;e.push({...i,props:{renderIcon:r,line:s,onClick:u,...l,vertical:a,active:n,asList:o,index:t++}})})),e}),[n,d]);return t("div",{className:i("i-step",{"i-step-vertical":a},c),style:l,children:p})};function fn(e){const{index:n=0,active:a,type:r,transition:s,gap:l=0,itemHeight:o,vertical:c,style:d,className:u,children:p}=e,m=h((()=>"normal"===r?{[c?"paddingBlock":"paddingInline"]:l/2,height:o}:{transform:`translate(-${100*n}%, 0)`,transition:s}),[n,l,o,c,r]);return t("div",{style:{...d,...m},className:i("i-swiper-item",u,{"i-swiper-active":a}),"data-index":n,children:p})}vn.Item=gn;const bn=a=>{const{ref:r,type:s="normal",initial:l=0,display:o=1,scroll:c=1,loop:u=!0,vertical:p,prev:m=t(Ne,{icon:t(L,{}),size:"2em"}),next:f=t(Ne,{icon:t(W,{}),size:"2em"}),duration:b=600,interval:y=3e3,autoplay:k,pauseOnHover:C,arrow:w=!0,reverse:x,draggable:$,dragOffset:z=40,gap:P=0,itemHeight:T,indicator:D,style:I,className:M,children:S,renderIndicator:O,onBeforeSwipe:E,onAfterSwipe:j}=a,B=v(null),A=v(null),V=`all ${b/1e3}s`,Y=ie({current:l,swipable:!0,transition:"fade"===s?"none":V,dragStart:0,dragging:!1,initialized:!1}),H=h((()=>g.map(S,(e=>{if(e.type===fn)return e}))),[S]),[F,q,R,X,U]=h((()=>{const e="normal"===s&&u&&H.length>o?o+1:0;let t=[];if(e<=0)t=[...H];else{const n=H.slice(0,e);t=[...H.slice(-e),...H,...n]}const n=t.length/o*100+"%";return[t,e,H.length,t.length,n]}),[o,u,s,H]),G=h((()=>-100*(Y.current+q)/X),[Y.current,X]),K=h((()=>{if(R<=o||"fade"===s)return;return`translate3d(${p?`0, ${G}%`:`${G}%, 0`}, 0)`}),[G,p,o,R,s]),Z=h((()=>{if(p&&T)return{height:T*o}}),[p,T,o]),_=h((()=>Array.from({length:Math.ceil((R-o)/c)+1})),[u,D]),J=()=>{clearTimeout(A.current),A.current=null},Q=e=>{if(!Y.swipable||e===Y.current)return;Y.swipable=!1,E?.(Y.current);let t=!1,n=e;const i=R-o;return u?e>i?(t=!0,e=R,n=0):e<0&&(t=!0,e=-o,n=i):(n=Be(n,0,i),e=n),setTimeout((()=>{Y.swipable=!0}),b+32),"fade"===s?(Y.current=n,void j?.(n)):(Y.current=e,t?void setTimeout((()=>{Y.transition="none",Y.current=n,j?.(n),k&&(A.current=setTimeout(ee,y)),setTimeout((()=>{Y.transition=V}),60)}),b+20):(k&&(A.current=setTimeout(ee,y)),void setTimeout((()=>{j?.(n)}),b+12)))},ee=()=>{Q(x?Y.current-c:Y.current+c)},te=()=>{Q(x?Y.current+c:Y.current-c)},ne=e=>{$&&Y.swipable&&"fade"!==s&&(e.stopPropagation(),e.touches&&(e=e.touches[0]),Object.assign(Y,{dragStart:p?e.clientY:e.clientX,dragging:!0,transition:"none"}))};return Ge((e=>{if(!Y.dragging||!B.current)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const t=61.8*((p?e.clientY:e.clientX)-Y.dragStart)/B.current[p?"offsetHeight":"offsetWidth"]+G;B.current.style.transform=`translate3d(${p?`0, ${t}%`:`${t}%, 0`}, 0)`})),Ke((e=>{if(!Y.dragging||!B.current)return;e.changedTouches&&(e=e.changedTouches[0]);const t=p?e.clientY:e.clientX,n=B.current[p?"offsetHeight":"offsetWidth"]/X,i=.618*(t-Y.dragStart),a=Math.abs(i);if(a>z){const e=Math.floor(a/n)+(a%n-z>0?1:0);let t=Y.current+(i>0?-e:e);Q(t)}B.current.style.transform=K||"",Object.assign(Y,{dragging:!1,transition:V})})),N(r,(()=>({swipeTo:Q,swipeNext:ee,swipePrev:te}))),d((()=>{if(k)return A.current=setTimeout(ee,y),()=>{clearTimeout(A.current),A.current=null}}),[k,y]),e("div",{style:I,className:i("i-swiper",{"i-swiper-vertical":p,"i-swiper-initialized":Y.initialized},M),children:[e("div",{className:"i-swiper-track",style:Z,onMouseOver:()=>{C&&J()},onMouseLeave:()=>{C&&(J(),A.current=setTimeout(ee,y))},children:[t("div",{ref:B,className:i("i-swiper-list",{"i-swiper-fade":"fade"===s}),style:{[p?"height":"width"]:U,transform:K,transition:Y.transition},onMouseDown:ne,onTouchStart:ne,children:F.map(((e,n)=>{const{props:i}=e;return t(fn,{index:n,active:n-q===Y.current,type:s,gap:P,transition:V,itemHeight:T,vertical:p,...i},n)}))}),w&&e(n,{children:[t("a",{className:"i-swiper-arrow i-swiper-prev",onClick:te,children:m}),t("a",{className:"i-swiper-arrow i-swiper-next",onClick:ee,children:f})]})]}),D&&t("div",{className:"i-swiper-indicators",children:_.map(((e,n)=>t("a",{className:i("i-swiper-indicator",{"i-indicator-active":n===Math[u?"floor":"ceil"]((Y.current+R)%R/c)}),onClick:()=>Q(n*c),children:O?.(n)},n)))})]})};bn.Item=fn;const yn=n=>{const{ref:a,active:r,tabs:s,type:o="default",prepend:c,append:u,children:p,className:m,vertical:h,toggable:f,bar:b=!0,hideMore:y,barClass:k,renderMore:C=()=>t(ke,{flat:!0,square:!0,size:"small",children:t(Ne,{icon:t(X,{})})}),onTabChange:w,...x}=n,$=v([]),z=v(null),P=v(null),T=ie({active:r,prevActive:void 0,barStyle:{},cachedTabs:[],overflow:!1,more:[],tabs:[]}),{observe:D,unobserve:I}=Ze(),M=se(P);d((()=>{if(!s)return p?void(T.tabs=g.map(p,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,keepDOM:o}=i,c=r?"string"==typeof r?r:l(r,["props","type","$$typeof","ref"]):s;return{key:n||String(t),title:a,content:c,keepDOM:o}}))):void(T.tabs=[]);T.tabs=s.map(((e,t)=>["string","number"].includes(typeof e)?{key:e,title:e}:(void 0===e.key&&(e.key=t),e)))}),[p,s]);const S=e=>{const{key:t}=e,n=T.tabs.findIndex((e=>e.key===t));if(n>-1)return void E(T.tabs[n].key??n);const i=T.tabs.length,a=e.key??i;T.tabs.push({...e,key:a}),E(a)},O=e=>{const t=T.tabs.findIndex((t=>t.key===e));if(t<0)return;if(T.tabs.splice(t,1),T.active!==e)return;const n=T.tabs[t]||T.tabs[t-1];E(T.prevActive??n?.key??"")},E=e=>{if(e===T.active){if(!f)return;return w?.(void 0,e),T.active=void 0,void(T.barStyle={height:0,width:0})}T.prevActive=T.active,w?.(e,T.active),T.active=e},j=e=>{e.stopPropagation(),e.preventDefault(),h||P.current?.scrollBy({left:e.deltaY+e.deltaX})};return d((()=>{if(!M||y)return;const{scrollHeight:e,scrollWidth:t}=P.current,{width:n,height:i}=M;T.overflow=e>i||t>n,T.overflow&&$.current.map(((e,t)=>{e&&D(e,((e,n)=>{T.tabs[t]&&(T.tabs[t].intersecting=n,T.more=T.tabs.filter((e=>!e.intersecting)))}))}))}),[M,y,T.tabs.length]),d((()=>{if(!b||"pane"===o||void 0===T.active)return;const e=T.tabs.findIndex((e=>e.key===T.active));setTimeout((()=>{const t=$.current[e];if(!t)return;if(T.tabs[e].keepDOM&&T.active){T.cachedTabs.findIndex((e=>e===T.active))<0&&T.cachedTabs.unshift(T.active)}const{offsetHeight:n,offsetLeft:i,offsetTop:a,offsetWidth:r}=t,s="line"===o;T.barStyle={height:!h&&s?".25em":n,width:h&&s?".25em":r,transform:`translate(${i}px, ${a}px)`}}),16)}),[T.active,b]),d((()=>{void 0!==r&&T.active!==r&&E(r)}),[r]),d((()=>{if(!y)return()=>{$.current?.map(I)}}),[T.tabs.length]),d((()=>{if(P.current&&!h)return P.current.addEventListener("wheel",j,{passive:!1}),()=>{P.current&&P.current.removeEventListener("wheel",j)}}),[P.current]),N(a,(()=>({open:E,close:O,add:S,navs:P}))),e("div",{className:i("i-tabs",{flex:h,[`i-tabs-${o}`]:"default"!==o},m),...x,children:[e("div",{className:i("i-tab-navs-container",{"i-tab-navs-vertical":h}),children:[c,e("div",{ref:P,className:"i-tab-navs",children:[T.tabs.map(((n,a)=>{const{title:r,key:s=a,closable:l}=n;return e("a",{ref:e=>$.current[a]=e,className:i("i-tab-nav",{"i-tab-active":T.active===s}),onClick:()=>E(s),children:[r,l&&t(Ye,{as:"i",active:!0,className:"i-tab-nav-close",onClick:e=>{e.stopPropagation(),O(s)}})]},s)})),b&&t("span",{ref:z,className:i("i-tab-navs-bar",k),style:T.barStyle})]}),!y&&T.overflow&&T.more.length>0&&t(lt,{arrow:!1,position:h?"right":"bottom",align:"end",touchable:!0,hideDelay:500,content:t("div",{className:"i-tabs-morelist pd-4",children:T.more.map(((e,n)=>{const{key:a=n,title:r}=e,s=T.active===a;return t("a",{className:i("i-tab-nav",{"i-tab-active":s}),onClick:()=>E(a),children:r},a)}))}),children:C(T.more)}),u]}),t("div",{className:"i-tab-contents",children:T.tabs.map(((e,n)=>{const{key:a=n,content:r}=e,s=T.active===a;return(s||void 0!==a&&T.cachedTabs.includes(a))&&t("div",{className:i("i-tab-content",{"i-tab-active":s}),children:r},a)}))})]})};function kn(e){const{data:a=[],depth:r=0,round:s,style:l,className:o,parent:c,nodeProps:d,...u}=e,p=a.map(((e,n)=>{const{type:i}=e,a=e[d.title],s=e[d.key]||(void 0!==c?.key?`${c.key}-${n}`:`${n}`);return e.key=s,e.parent=c,"title"===i?t("div",{className:"i-tree-group-title",children:a},n):i&&"item"!==i?t("div",{className:`i-tree-type-${i}`,children:a},n):t(Cn,{index:n,item:e,depth:r,nodeProps:d,...u},s)}));return r>0?t(n,{children:p}):t("div",{className:i("i-tree",o,{"i-tree-round":s}),style:l,children:p})}yn.Item=e=>t(n,{});const Nn=e=>{const{as:n="a",href:a,selected:r,children:s,...l}=e,o=i("i-tree-item-header",{"i-tree-item-selected":r});return t(n,"string"==typeof n?{href:a,className:o,...l,children:s}:{to:a||"",className:o,...l,children:s})},Cn=n=>{const{item:a,depth:r=0,index:s,selected:l,checked:o=[],partofs:c={},checkable:d,nodeProps:u,renderExtra:p,onItemClick:h,onItemSelect:g,onItemCheck:v,...f}=n,{as:b,key:y="",href:k,icon:N,title:C,expanded:w,disabled:x}=a,$=a[u.children],[z,P]=m(w),T=(e,t)=>{t&&(e.preventDefault(),e.stopPropagation()),!x&&$?.length&&P((e=>!e))},D=o.includes(y);return e("div",{className:i("i-tree-item",{"i-tree-expand":z}),children:[e(Nn,{as:b,href:k,style:{paddingLeft:1.5*r+.5+"em"},selected:l===y,onClick:e=>{if(x)return e.preventDefault(),void e.stopPropagation();T(e),h?.(a,e),g?.(y,a)},children:[d&&t(Ve.Item,{value:D,partof:!D&&c[y],className:"i-tree-checkbox",onChange:e=>v?.(a,e,[]),onClick:e=>e.stopPropagation()}),N&&t("span",{className:"i-tree-item-icon",children:N}),t("span",{className:"i-tree-item-title",children:C}),p?.(a),$&&t(Ne,{icon:t(Q,{}),className:"i-tree-toggle",onClick:e=>T(e,!0)})]}),$?.length&&t("div",{className:"i-tree-item-content",children:t(kn,{data:$,depth:r+1,selected:l,checkable:d,parent:a,partofs:c,checked:o,nodeProps:u,renderExtra:p,onItemClick:h,onItemSelect:g,onItemCheck:v,...f})})]})},wn={key:"key",title:"title",children:"children"},xn=e=>{const{data:n=[],ref:i,selected:a,checked:r=[],disabledRelated:s,nodeProps:l,onItemSelect:o,onItemCheck:c,...u}=e,p=ie({selected:a,checked:r,partofs:{},nodeMaps:new Map}),m=Object.assign({},wn,l),h=e=>p.checked.includes(e||""),g=(e,t,n)=>{const{key:i="",parent:a,children:r}=e,l={[i]:t},o={[i]:!1};if(s)return[l];if(t){if(a&&"leaf"!==n){const e=a.children?.some((e=>e.key!==i&&!h(e.key))),[t,n]=g(a,!0,"root");e||Object.assign(l,t),Object.assign(o,e?n:{},{[a.key]:!0})}return r?.length&&"root"!==n&&r.map((e=>{if(h(e.key))return;const[t]=g(e,!0,"leaf");Object.assign(l,t),o[e.key]=!1})),[l,o]}if(a&&"leaf"!==n){const[e,t]=g(a,!1,"root");Object.assign(l,e);const n=a.children?.some((e=>h(e.key)&&e.key!==i));Object.assign(o,n?{}:t,{[a.key]:n,[i]:!1})}return r?.length&&"root"!==n&&r.map((e=>{const[t]=g(e,!1,"leaf");h(e.key)&&(Object.assign(l,t),o[e.key]=!1)})),[l,o]};return d((()=>{void 0!==a&&(p.selected=a)}),[a]),d((()=>{p.nodeMaps.clear();const{key:e,children:t}=m,i=n=>{n.map((n=>{p.nodeMaps.set(n[e],n),n[t]?.length>0&&i(n[t])}))};i(n)}),[n]),N(i,(()=>({getChecked:()=>{const e=[];return p.checked.map((t=>{const n=p.nodeMaps.get(t);e.push(n)})),[p.checked,e]},getSelected:()=>{const e=p.nodeMaps.get(p.selected);return[p.selected,e]},getPartofs:()=>{const e=[];return[Object.keys(p.partofs).filter((t=>{const n=p.partofs[t];if(n){const n=p.nodeMaps.get(t);e.push(n)}return n})),e]}}))),t(kn,{data:n,selected:p.selected,checked:p.checked,partofs:p.partofs,nodeProps:m,onItemCheck:(e,t)=>{const[n,i]=g(e,t),a=Object.keys(n);p.checked=t?Array.from(new Set([...p.checked,...a])):p.checked.filter((e=>!a.includes(e))),Object.assign(p.partofs,i),c?.(e,t,p.checked)},onItemSelect:(t,n)=>{e.selectable&&(p.selected=t,o?.(t,n))},...u})};function $n(i){const{mode:a,index:r,file:s,onRemove:l,onPreview:c}=i;if(!s)return"";const{name:d,size:u,url:p,src:m}=s,h=Ee(d,s.type),g=t(Ye,{active:!0,className:"i-upload-delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),l(r)}});if("card"===a){let i=t(n,{});switch(h){case ze.IMAGE:i=t($t,{lazyload:!0,src:p||m,fit:"cover",usePreview:!1});break;case ze.VIDEO:i=t("video",{src:p||m,preload:"none"});break;default:i=e(n,{children:[t(Ne,{icon:t(ee,{})}),t("span",{className:"i-upload-file-name",children:o(d)})]})}return e("div",{title:d,className:"i-upload-item-card",onClick:()=>c?.(r),children:[i,g]})}return e("div",{className:"i-upload-item",onClick:()=>c?.(r),children:[t("span",{children:d}),t("i",{className:"i-upload-size",children:je(u??0)}),g]})}const zn=n=>{const{ref:a,label:s,labelInline:l,value:o,files:c=[],placeholder:u,status:p="normal",message:m,className:g,style:b,children:y,mode:k="default",cardSize:C="4em",disabled:w,limit:x=(n.multiple?1/0:1),multiple:$,renderItem:z=$n,shouldUpload:P=()=>!0,uploader:T,onChange:D,onFilesChange:I,onUpload:M,...S}=n,O=ie({files:c,value:o,status:p,message:m,update:0}),E=v(null),j=xt(),B=h((()=>y||("card"===k?t(ke,{className:"i-upload-card-btn color-5",square:!0,flat:!0,outline:!0,disabled:w,children:t(Ne,{icon:t(ne,{})})}):e(ke,{className:"i-upload-btn",disabled:w,children:[t(Ne,{icon:t(te,{})})," Upload"]}))),[k,y]),A=e=>{const[...t]=O.files,n=t.splice(e,1);URL.revokeObjectURL(n[0]?.src||""),O.files=t,I?.(t,n),D?.(t),E.current&&(E.current.value="")},V=async e=>{T&&e.forEach((async e=>{if(!P(e))return;const t=await T(e),n=O.files.findIndex((e=>e.uid===t.uid));n>-1&&(O.files[n]=t),"completed"===t?.status&&M?.(t)}))},Y=e=>{j({items:O.files,initial:e})};d((()=>{Object.assign(O,{status:p,message:m})}),[p,m]),d((()=>{O.value=o}),[o]),N(a,(()=>({getFileList:()=>O.files})),[]);const{message:L,files:W}=O;return e(zt,{label:s,labelInline:l,className:i("i-input-label-file",g),style:b,children:[t("input",{...S,disabled:w,ref:E,type:"file",className:"i-input-file-hidden",multiple:$,onChange:e=>{const t=Array.from(e.target.files||[]),{files:n}=O,i=[];t.map((e=>{const{name:t,size:a,type:s}=e,l=n.find((e=>{const{name:n,size:i,type:r}=e;return n===t&&i===a&&r===s})),o=URL.createObjectURL(e);e.src=o,O.update+=1,Object.assign(e,{uid:r(7),src:e.src||e.name}),!l&&i.push(e)}));const a=[...n,...i];Object.assign(O,{files:$?a.slice(0,x):[a.at(-1)],status:p,message:m}),I?.(O.files,i,e),D?.(O.files,e),V(i),E.current&&(E.current.value="")}}),e("div",{className:i("i-upload-inner",{[`i-upload-${k}`]:"default"!==k}),style:{"--upload-card-size":C},children:[t("div",{className:"i-upload-list",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:W?.map(((e,n)=>t(f,{children:$n({index:n,file:e,mode:k,onRemove:A,onPreview:Y})},n)))}),L&&t("span",{className:"i-upload-message",children:L}),W.length<x&&B]})]})};export{we as Affix,xe as Badge,ke as Button,$e as Card,Ve as Checkbox,Le as Collapse,Xt as ColorPicker,nt as Datagrid,Qt as DatePicker,it as Description,at as Drawer,ct as Dropdown,dt as Flex,mt as Form,Ne as Icon,$t as Image,Pt as Input,rt as List,be as Loading,Bt as Message,gt as Modal,Vt as Pagination,on as Popconfirm,lt as Popup,kt as Progress,dn as Radio,un as Resizable,Ht as Select,vn as Step,bn as Swiper,yn as Tabs,Yt as Tag,ft as Text,rn as TimePicker,xn as Tree,zn as Upload,Nt as Video,xt as usePreview};
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import i from"classnames";import{debounce as a,uid as r,throttle as s,pick as l,title as o}from"radash";import{createElement as c,useEffect as d,isValidElement as u,cloneElement as p,useState as m,useMemo as h,Children as g,useRef as v,Fragment as f,useLayoutEffect as b,createContext as y,useContext as k,useImperativeHandle as N}from"react";import{SkipPreviousRound as C,CloseRound as w,MinusRound as x,PlusRound as $,InboxTwotone as z,PauseRound as T,PlayArrowRound as P,StopRound as D,FullscreenExitRound as S,FullscreenRound as I,VolumeOffRound as M,VolumeDownRound as O,FeedOutlined as E,AspectRatioRound as j,OpenInNewRound as B,FileDownloadOutlined as A,RotateRightRound as V,RotateLeftRound as Y,KeyboardArrowLeftRound as L,KeyboardArrowRightRound as H,HideImageTwotone as W,VisibilityRound as F,VisibilityOffRound as q,SyncAltRound as R,MoreHorizRound as X,SearchRound as U,CheckRound as G,UnfoldMoreRound as K,CalendarMonthTwotone as Z,AccessTimeRound as _,InfoOutlined as J,KeyboardArrowDownRound as Q,ListAltRound as ee,CloudUploadTwotone as te,PlusSharp as ne}from"@ricons/material";import{useReactive as ie,useClickAway as ae,useCreation as re,useSize as se}from"ahooks";import{createRoot as le}from"react-dom/client";import oe from"react-custom-scrollbars-2";import{createPortal as ce}from"react-dom";import de from"rc-virtual-list";import ue from"pubsub-js";import{findAll as pe}from"highlight-words-core";import me from"@rc-component/color-picker";import"@rc-component/color-picker/assets/index.css";import he from"dayjs";import ge from"dayjs/plugin/customParseFormat";const ve=500;function fe(e){const t=e.target,n=t.closest("[data-ripple]");t&&n&&function(e,t){const[n,i]=function(){const e=document.createElement("SPAN"),t=document.createElement("SPAN");return e.className="i-ripple-container",t.className="i-ripple",e.append(t),[e,t]}(),a=e.getBoundingClientRect(),r=2*Math.max(a.width,a.height);i.style.cssText=`\n left: ${t.pageX-a.left}px;\n top: ${t.pageY-a.top}px;\n width: ${r}px;\n height: ${r}px;\n transition: all 0.5s;\n `,e.insertAdjacentElement("afterbegin",n),e.offsetHeight,i.classList.add("i-ripple-active"),setTimeout((()=>{n.remove()}),ve)}(n,e)}const be=n=>{const{icon:a,text:r,size:s,absolute:l,style:o,className:c,...d}=n;return e("div",{className:i("i-loading-container",{absolute:l},c),style:{...o,inset:l?0:"unset"},...d,children:[a??t("svg",{width:"24",height:"24",stroke:"#000",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"i-loading-icon",style:{fontSize:s},children:t("circle",{cx:"12",cy:"12",r:"9.5",fill:"none",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:40,strokeDashoffset:0})}),r]})},ye=({outline:e,flat:t,loading:n,disabled:a,size:r="normal",block:s,round:l,square:o,secondary:c,className:d})=>i("i-btn",d,{"i-btn-outline":e,"i-btn-flat":t,"i-btn-block":s,"i-btn-loading":n,"i-btn-square":o,"i-btn-secondary":c,[`i-btn-${r}`]:"normal"!==r,round:l,disabled:a}),ke=e=>{const{as:i="a",ref:a,children:r,className:s,loading:l,flat:o,outline:u,square:p,secondary:m,size:h,round:g,href:v,ripple:f=!0,onClick:b,...y}=e;if(!r)return t(n,{});const k=[l&&t(be,{},"loading"),c("span",{key:"content",className:"i-btn-content"},r)],N={className:ye(e),"data-ripple":f,onClick:e=>{l||y.disabled?e.stopPropagation():b?.(e)}};return d((()=>{f&&(document.documentElement.dataset.useripple||(document.documentElement.dataset.useripple="enable",document.addEventListener("mousedown",fe)))}),[f]),c(i,"string"==typeof i?{ref:a,href:v,...N,...y}:{to:v||"",...N,...y},k)};ke.Toggle=function(e){const{ref:n,active:a,activeClass:r,after:s,disabled:l,children:o,className:c,onClick:u,onToggle:p,...m}=e,h=ie({active:a,done:!0}),g=()=>{const e=void 0!==s,t=!h.active;Object.assign(h,{active:t,done:!e}),p?.(t),e&&setTimeout((()=>{h.done=!0}),16)};return d((()=>{h.active!==a&&g()}),[a]),t(ke,{ref:n,className:i(c,{[r||""]:h.active},"i-btn-toggle"),...m,onClick:e=>{u?.(e),!l&&g()},children:t("div",{className:i("i-btn-toggle-content",{"i-btn-toggle-active":h.done}),children:h.active?s??o:o})})},ke.Group=function(e){const{children:n,vertical:a,className:r,style:s}=e;return t("div",{className:i(r,a?"i-btn-group-vertical":"i-btn-group-horizonal"),style:s,children:n})};const Ne=e=>{const{ref:t,icon:n,size:a="1.425em",rotate:r,style:s,className:l,...o}=e;if(!u(n))return n;const c={ref:t,style:{transform:r?`rotate(${r}deg)`:void 0,...s,width:a,height:a},className:i("i-icon",l),...o};return p(n,c)};function Ce(e){const{style:n,className:a,onClick:r}=e;return t(ke,{square:!0,className:i("i-affix-totop",a),style:{...n},onClick:r,children:t(Ne,{icon:t(C,{}),rotate:90})})}const we=e=>{const{position:n="fixed",left:r,top:s,right:l,bottom:o,offset:c,style:u,className:v,children:f,getContainer:b=()=>document.body}=e,[y,k]=m(!1),N=h((()=>g.map(f,(e=>{if(e.type===Ce){const{onClick:t}=e.props;return p(e,{key:e.key,...e.props,onClick:e=>{const n=b();t?.(e),n?.scrollTo({top:0,left:0,behavior:"smooth"})}})}return e}))),[f,b]);return d((()=>{const e=b();if(!c||!e)return;const t=a({delay:160},(()=>{const t=e.scrollTop;k(t<c)}));return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[c,b]),t("div",{className:i("i-affix",v,{"i-affix-hidden":y}),style:{...u,position:n,left:r,top:s,right:l,bottom:o},children:N})};we.ToTop=Ce;const xe=n=>{const{content:a,contentClass:r,dot:s,dotSize:l,round:o,disabled:c,style:d,className:u,children:p}=n;return e("div",{style:d,className:i("i-badge",{rounded:o},u),children:[p,t("div",{className:i("i-badge-content",r,{"i-badge-dot":s,"i-badge-hidden":c}),style:{fontSize:l},children:a})]})},$e=n=>{const{hideShadow:a,border:r,className:s,children:l,header:o,footer:c,...d}=n;return e("div",{className:i("i-card",s,{shadow:!a,"i-card-bordered":r}),...d,children:[o&&t("div",{className:"i-card-header",children:o}),l&&t("div",{className:"i-card-content",children:l}),c&&t("div",{className:"i-card-footer",children:c})]})};var ze;function Te(e,t,n={}){const{refWindow:i,gap:a=0,offset:r=0,position:s="top",align:l}=n;if(!e||!t)return[0,0,{arrowX:0,arrowY:0,arrowPos:"bottom"}];const o=e.getBoundingClientRect(),c=t.getBoundingClientRect();let d=window.innerWidth,u=window.innerHeight,{left:p,top:m,right:h,bottom:g,width:v,height:f}=o;const{height:b,width:y}=c;if(!i){const t=e.offsetParent?.getBoundingClientRect();d=t?.width||d,u=t?.height||u,p=e.offsetLeft,m=e.offsetTop,h=p+o.width,g=m+o.height}let k=0,N=0,C=0,w=0,x="bottom";switch(s){case"left":case"right":k=f!==b?De({containerSize:u,targetSize:f,targetOffset:m,contentSize:b,gap:a,align:l}):m,w=k<m?m-k+f/2:f/2;const e=p-r-y,t=h+r+y;if("left"===s){const n=e<0&&t<=d;N=n?h+r:e,C=n?0:y,x=n?"left":"right"}else{const n=d>t||e<0;N=n?h+r:e,C=n?0:y,x=n?"left":"right"}break;case"top":case"bottom":N=v!==y?De({containerSize:d,targetOffset:p,targetSize:v,contentSize:y,gap:a,align:l}):p,C=N>p?y/2:p-N+v/2;const n=m-r-b,i=g+r+b;if("top"===s){const e=n<0&&i<=u;k=e?g+r:n,w=e?0:b,x=e?"top":"bottom"}else{const e=u>i||n<0;k=e?g+r:n,w=e?0:b,x=e?"top":"bottom"}}return[N,k,{arrowX:C,arrowY:w,arrowPos:x}]}function Pe(e,t){const{width:n,height:i}=t.getBoundingClientRect(),a=t.offsetParent;let r,s,l=0,o=0;if(a){const{width:e,height:t,left:n,top:i}=a.getBoundingClientRect();r=e,s=t,o=i,l=n}else r=window.innerWidth,s=window.innerHeight;const c=e.pageX-l,d=e.pageY-o;return[c+n>=r&&c-n>0?c-n:c,d+i>=s&&d-i>0?d-i:d]}function De({containerSize:e,targetSize:t,targetOffset:n,contentSize:i,gap:a,align:r="center"}){const s=n+t/2;switch(r){case"start":return n+i>e?e-i-a:n;case"center":return t>=i?s-i/2:s+i/2+a>e?n+t-i:s-i/2-a<0?a:s-i/2;case"end":const r=n+t-i;return r>0?r:a;default:return s-i/2}}function Se(e){return e.map((e=>["string","number"].includes(typeof e)?{label:e,value:e}:e))}function Ie(e,t={}){const{precision:n,thousand:i}=t,a=e.toFixed(n);if(!i)return a;const r=a.split("."),s=r[0].replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,`$&${i}`);return 1===r.length?s:`${s}.${r[1]}`}function Me(e,t=document.body){const n=document.createElement("div");t.append(n);const i=le(n),a=setTimeout((()=>{i?.render(e)}),0);return()=>{n?.remove(),i?.unmount(),a&&clearTimeout(a)}}function Oe(e){return e.match(/\.([^\./\?]+)($|\?)/)?.[1]}function Ee(e,t){switch(!0){case["jpg","jpeg","png","webp","svg"].includes(e)||t?.startsWith("image/"):return ze.IMAGE;case["mp4","avi"].includes(e)||t?.startsWith("video/"):return ze.VIDEO;default:return ze.UNKNOWN}}function je(e,t=2){if(!+e)return"0 Bytes";const n=t<0?0:t,i=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,i)).toFixed(n))} ${["B","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}`}function Be(e,t,n){return e<t?t:e>n?n:e}function Ae(n){const{type:a="default",label:r,name:s,value:l=!1,className:o,status:c="normal",message:u,disabled:p,partof:m,children:h,onChange:g,...v}=n,f=ie({value:l,status:c,message:u});return d((()=>{f.value=l}),[l]),e("label",{className:i("i-checkbox-item",{[`i-checkbox-${f.status}`]:"normal"!==f.status,disabled:p},o),...v,children:[t("input",{type:"checkbox",name:s,className:i("i-checkbox-input",{[`i-checkbox-${a}`]:!m,"i-checkbox-partof":m}),checked:f.value,disabled:p,onChange:e=>{const t=e.target.checked;Object.assign(f,{value:t,status:c,message:u}),g?.(t,e)}}),t("span",{className:"i-checkbox-text",children:h||r}),f.message&&e("span",{className:"i-checkbox-message",children:["*",f.message]})]})}function Ve(n){const{label:a,name:r,options:s=[],value:l="",type:o="default",optionInline:c=!0,labelInline:u,disabled:p,status:m="normal",message:g,required:v,className:f,onChange:b,...y}=n,k=ie({value:l}),N=h((()=>Se(s)),[s]);return d((()=>{k.value=l}),[l]),e("div",{className:i("i-checkbox i-input-label",{[`i-checkbox-${m}`]:"normal"!==m,"i-input-inline":u},f),...y,children:[a&&e("span",{className:"i-input-label-text",children:[v&&t("span",{className:"error",children:"*"}),a,g&&t("p",{className:"i-checkbox-message",children:g})]}),t("div",{className:i("i-checkbox-options",{"i-options-block":!c,"i-checkbox-options-button":"button"===o}),children:N.map((e=>t(Ae,{name:r,value:k.value.includes(e.value),type:o,disabled:p||e.disabled,onChange:(t,n)=>((e,t,n)=>{const i=[...k.value],a=i.findIndex((e=>e===t.value));e&&a<0?i.push(t.value):!e&&a>-1&&i.splice(a,1),k.value=i,b?.(i,t,n)})(t,e,n),children:e.label},e.value)))})]})}!function(e){e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.PDF="PDF",e.EXCEL="EXCEL",e.TXT="TXT",e.UNKNOWN="UNKNOWN"}(ze||(ze={})),Ve.Item=Ae;const Ye=e=>{const{as:a="a",active:s,className:l,icon:o=t(w,{}),...d}=e;return s?c(a,{className:i("i-helpericon",l),...d},[c(Ne,{key:r(3),icon:o})]):t(n,{})};const Le=n=>{const{active:a,items:r,multiple:s,border:l,headerClickable:o,className:c,children:d,renderToggle:u=e=>t(e?x:$,{}),onCollapse:p,...m}=n,v=ie({active:a}),f=h((()=>r||(d&&g.map(d,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,disabled:l,...o}=i;return{...o,key:n||t,title:a,content:r||s,disabled:l}}))||[])),[d]),b=(e,t)=>{const{key:n,disabled:i}=e;if(t?.stopPropagation(),i)return;if(!s)return v.active=v.active===n?void 0:n,void p?.(n,void 0!==v.active);Array.isArray(v.active)||(v.active=[]);const a=v.active.findIndex((e=>e===n));a>-1?v.active.splice(a,1):void 0!==n&&v.active.push(n),p?.(n,a<0)};return t("div",{className:i("i-collapse",{"i-collapse-bordered":l},c),...m,children:f.map((n=>{const{key:a,title:r,content:l,disabled:c,className:d,...p}=n,m=s?(v.active||[]).includes(a):v.active===a;return e("div",{className:i("i-collapse-item",d,{"i-collapse-active":m,"i-collapse-disabled":c}),...p,children:[e("div",{className:"i-collapse-header",onClick:()=>(e=>{o&&b(e)})(n),children:[r,t(Ye,{active:!0,className:"i-collapse-toggle",icon:u(m),onClick:e=>b(n,e)})]}),t("div",{className:"i-collapse-content",children:l})]},a)}))})};function He(e){const{className:n,...a}=e;return t(z,{className:i("i-empty",n),...a})}function We({justify:e,col:t,row:n,colSpan:i=1,rowSpan:a=1}){return{"--datagrid-justify":e,gridArea:`${n+1} / ${t+1} / ${n+1+a} / ${t+1+i}`,insetInline:`var(--datagrid-cell-inset-${t})`}}function Fe(e){const{column:n,row:a,col:r,data:s,cellEllipsis:l,onCellClick:o,onCellDoubleClick:c}=e,{id:d,fixed:u,justify:p,rowSpan:m,render:h}=n,g=We({justify:p,fixed:u,col:r,row:a,rowSpan:m});return t("div",{className:i("i-datagrid-cell",{[`i-datagrid-cell-fixed-${u}`]:u}),"data-col":d,style:g,onClick:e=>o?.(s,n,a,r,e),onDoubleClick:e=>c?.(s,n,a,r,e),children:h?.(s[d],s,r)??t("div",{className:i("i-datagrid-cell-content",{"i-datagrid-cell-content-ellipsis":l}),children:s[d]})})}Le.Item=function(e){return t(n,{})};const qe=new Set,Re=new Set,Xe="ontouchend"in document,Ue={MOVE:Xe?"touchmove":"mousemove",UP:Xe?"touchend":"mouseup"};function Ge(e){d((()=>(qe.add(e),()=>{qe.delete(e)})),[e])}function Ke(e){d((()=>(Re.add(e),()=>{Re.delete(e)})),[e])}function Ze(e){const t=new WeakMap,n=new IntersectionObserver((e=>{e.map((e=>{const n=t.get(e.target);n?.(e.target,e.isIntersecting)}))}),e);return{observe:function(e,i){t.get(e)||(t.set(e,i),e&&n.observe(e))},unobserve:function(e){e&&n.unobserve(e),t.delete(e)},disconnect:function(){n.disconnect()}}}function _e(e){const{index:n,onWidthChange:i}=e,a=ie({resizing:!1,x:0,width:0});return Ge((e=>{if(!a.resizing)return;e.preventDefault();const t=a.width+e.pageX-a.x;t<=24||i(n,t)})),Ke((()=>{a.resizing&&(a.resizing=!1)})),t("i",{className:"i-datagrid-resizor",onMouseDown:e=>{const t=e.target.offsetParent.offsetWidth;Object.assign(a,{x:e.pageX,resizing:!0,width:t})},onClick:e=>e.stopPropagation()})}document.addEventListener(Ue.MOVE,(e=>{for(const t of qe.values())t(e)}),{passive:!1}),document.addEventListener(Ue.UP,(e=>{for(const t of Re.values())t(e)}));const Je=e=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...e,children:t("g",{fill:"none",children:t("path",{d:"M9 17.898c0 1.074 1.265 1.648 2.073.941l6.31-5.522a1.75 1.75 0 0 0 0-2.634l-6.31-5.522C10.265 4.454 9 5.028 9 6.102v11.796z",fill:"currentColor"})})});function Qe(n){const{type:a}=n;return e("a",{className:i("i-datagrid-sorter",{[`i-datagrid-sorter-${a}`]:a}),children:[t(Je,{className:"i-datagrid-sorter-caret"}),t(Je,{className:"i-datagrid-sorter-caret"})]})}function et(e){const{row:n,data:i,columns:a,cellEllipsis:r,onRowClick:s,onCellClick:l,onCellDoubleClick:o}=e;return t("div",{className:"i-datagrid-row",onClick:()=>s?.(i,n),children:a.map(((e,a)=>t(Fe,{column:e,col:a,row:n,data:i,cellEllipsis:r,onCellClick:l,onCellDoubleClick:o},a)))})}function tt(n){const{columns:a,resizable:r,cellEllipsis:s,sortBy:l,sortType:o,onWidthChange:c,onHeaderClick:d}=n;return t("div",{className:"i-datagrid-header i-datagrid-row",children:a.map(((n,a)=>{const{id:u,title:p,fixed:m,colSpan:h,sorter:g,justify:v,renderHeader:f}=n,b=We({justify:v,row:0,col:a,colSpan:h}),y=l===u?o:"";return e("div",{"data-col":u,className:i("i-datagrid-cell",{"i-datagrid-has-sorter":g,"i-datagrid-cell-fixed":m}),style:{...b,insetBlockStart:0},onClick:e=>d?.(n,e),children:[f?.(n,a)??t("div",{className:i("i-datagrid-cell-content",{"i-datagrid-cell-content-ellipsis":s}),children:p||u}),g&&t(Qe,{type:y}),r&&t(_e,{index:a,onWidthChange:c})]},a)}))})}const nt=n=>{const{data:a=[],columns:r=[],border:s,striped:l,header:o=!0,resizable:c,cellPadding:u=".5em",cellEllipsis:p,empty:m=t(He,{}),loading:g,height:f="unset",style:b,className:y,renderLoading:k=()=>t(be,{size:"1.5em",className:"color-3"}),onCellClick:N,onRowClick:C,onHeaderClick:w,onSort:x,onScroll:$,onResize:z}=n,T=v(null),P=v(null),D=ie({rows:a,widths:r.map((e=>e.width??"min-content")),sortBy:"",sortType:""}),S=h((()=>{const{widths:e}=D,t={...b,"--grid-template-columns":e.map((e=>"number"==typeof e?`${e}px`:e)).join(" ")};if(!c)return t;const n=r.map(((t,n)=>{const{fixed:i}=t;return i?e[n]:0}));return r.map(((e,i)=>{const{fixed:a}=e;if(a)if(0===i)t["--datagrid-cell-inset-0"]=0;else if(i===n.length-1)t["--datagrid-cell-inset-"+(n.length-1)]="auto 0";else{const e="left"===a,r=(e?n.slice(0,i):n.slice(i+1)).reduce(((e,t)=>e+t))+"px",s=e?`${r} auto`:`auto ${r}`;t[`--datagrid-cell-inset-${i}`]=s}})),t}),[D.widths,c]),I=h((()=>{const{sortBy:e,sortType:t}=D;if(e&&!x){const n=r.find((t=>t.id===e))?.sorter,i="function"==typeof n?n:(t,n)=>n[e]-t[e],s=[...a].sort(i);return"desc"===t?s:s.reverse()}return a}),[a,r,D.sortBy,D.sortType]);d((()=>{if(!T.current)return;const{current:e}=T,t=e.querySelector(".i-datagrid-row")?.children;t?.length&&(D.widths=Array.from(t).map((e=>e.offsetWidth)))}),[r,c]),d((()=>{g&&P.current?.scrollTop(0)}),[g]);const M={"--cell-padding":u,...S};return e(oe,{ref:P,autoHide:!0,autoHeight:!0,autoHeightMax:f,style:M,className:i("i-datagrid-container",y,{"i-datagrid-bordered":s,"i-datagrid-striped":l}),renderView:e=>t("div",{...e,className:i({"i-datagrid-loading":g})}),onScroll:$,children:[e("div",{ref:T,className:"i-datagrid",children:[o&&t(tt,{columns:r,resizable:c,sortType:D.sortType,sortBy:D.sortBy,cellEllipsis:p,onWidthChange:(e,t)=>{if(!c)return;const[...n]=D.widths;n[e]=t,D.widths=n,z?.(r[e],t)},onHeaderClick:(e,t)=>{if(e?.sorter){const[t,n]=function(e,t,n){const i=["desc","asc"];if(e===n){const e=i.findIndex((e=>e===t))+1,a=i[e]||"";return[""===a?"":n,a]}return[n,"desc"]}(D.sortBy,D.sortType,e.id);Object.assign(D,{sortBy:t,sortType:n}),x?.(t,n)}w?.(e,t)}}),I.map(((e,n)=>t(et,{row:n+(o?1:0),data:e,cellEllipsis:p,columns:r,onCellClick:N,onRowClick:C},n))),I.length<1&&m]}),g&&k()]})},it=n=>{const{data:a,colon:r,columns:s=1,gap:l=".5em",align:o,labelWidth:c,labelAlign:d,vertical:u,equally:p,style:m,className:h}=n;return t("div",{className:i("i-description",h),style:{"--description-label-width":c,gridTemplateColumns:`repeat(${s}, ${p?"1fr":"auto"})`,gap:l,textAlign:o,...m},children:a.map(((n,a)=>{const{label:s,value:l,style:o,hidden:c,rowSpan:p=1,colSpan:m=1}=n;return c?t(f,{},a):e("div",{className:i("i-description-item",{"i-description-item-vertical":u}),style:{gridColumn:`span ${m}`,gridRow:`span ${p}`,...o},children:[s&&e("div",{className:"i-description-label",style:{textAlign:d},children:[s,r]}),t("div",{className:"i-description-value",children:l})]},a)}))})};function at(n){const{visible:a,position:r="left",header:s,footer:l,backdropClosable:o=!0,hideCloseButton:c,keepDOM:u,className:p,children:m,onVisibleChange:h,onClose:g,...f}=n,b=v(!0),y=ie({show:a,active:a,init:!1});d((()=>{a?k():N()}),[a]);const k=()=>{b.current&&(y.show=!0,h?.(!0),b.current=!1,setTimeout((()=>{y.active=!0,b.current=!0,y.init=!0}),24))},N=()=>{b.current&&(b.current=!1,y.active=!1,setTimeout((()=>{u||(y.show=!1),h?.(!1),b.current=!0,g?.()}),240))};return ce(y.show&&t("div",{className:i("i-backdrop-drawer",p,{"i-active":y.active}),onClick:function(){o&&N()},...f,children:e("div",{className:i("i-drawer",`i-drawer-${r}`),onClick:e=>e.stopPropagation(),children:[e("header",{className:"i-drawer-header",children:[s,t(Ye,{active:!c,className:"i-drawer-close",onClick:N})]}),t("div",{className:"i-drawer-content",children:m}),t("div",{className:"i-drawer-footer",children:l})]})}),document.body)}const rt=e=>{const{label:n,type:a,className:r,children:s,...l}=e;return t("ul",{className:i("i-list",r),...l,children:g.map(s,((e,t)=>{const i="function"==typeof n?n(t):n;return e.type===f?e:p(e,{label:i,...e.props,type:a})}))})};rt.Virtual=e=>{const{data:n,itemKey:i,renderItem:a,...r}=e;return t(de,{data:n,itemKey:i,...r,children:(e,t)=>a?.(e,t)})},rt.Item=n=>{const{ref:a,active:r,type:s,align:l,disabled:o,label:c,style:d,className:u,children:p,...m}=n;return e("li",{ref:a,className:i("i-list-item",u,{"i-list-item-active":r,"i-list-option":"option"===s,disabled:o}),style:{alignItems:l,...d},...m,children:[void 0!==c&&t("span",{className:"i-list-item-label",children:c}),p]})};const st=n=>{const{ref:a,getContainer:r=e=>e?.offsetParent??document.body,trigger:s,arrow:l,arrowProps:o={},className:c,children:d,...u}=n,p=h((()=>{let{left:e,top:t,pos:n}=o,i="";switch(n){case"left":e+=2,i="translate(-100%, -50%) rotate(180deg)";break;case"right":e-=2,i="translate(0, -50%)";break;case"top":t-=2,i="translate(-50%, -50%) rotate(-90deg)";break;case"bottom":t+=2,i="translate(-50%, -50%) rotate(90deg)"}return{left:e,top:t,transform:i}}),[o]),m=e("div",{ref:a,className:i("i-popup",c),...u,children:[l&&t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"i-popup-arrow",style:p,children:t("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z"})}),d]});return ce(m,r(s))};function lt(i){const{visible:a=!1,content:r,trigger:s="hover",gap:l=12,offset:o=8,fixed:c,position:m="top",showDelay:f=16,hideDelay:y=12,touchable:k,arrow:N=!0,align:C,fitSize:w,watchResize:x,clickOutside:$=!0,disabled:z,referToWindow:T,style:P,className:D,getContainer:S,children:I,onVisibleChange:M}=i,O=v(null),E=v(null),j=ie({show:!1,toggling:!1,style:{position:c?"fixed":"absolute"},arrowProps:{}});ae((e=>{if(!$)return;const t=e.target,n=O.current?.contains(t);j.show&&(!n||"contextmenu"===s)&&V(!1)}),E);const B=()=>{z||j.show&&("hover"!==s||"hover"===s&&!k)||(j.show=!0,j.toggling&&clearTimeout(j.toggling),j.toggling=setTimeout((()=>{const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=Te(O.current,E.current,{position:m,gap:l,offset:o,align:C,refWindow:T});j.style={...j.style,opacity:1,transform:"none",left:e,top:t},j.arrowProps={left:n,top:i,pos:a},j.toggling&&clearTimeout(j.toggling),M?.(!0)}),f))},A=()=>{j.show&&(j.toggling=setTimeout((()=>{j.style={...j.style,opacity:0,transform:"translate(0, 2px)"},setTimeout((()=>{j.show=!1,j.toggling&&clearTimeout(j.toggling),M?.(!1)}),160)}),y))},V=e=>{void 0===e?j.show?A():B():e?B():A()},Y=re((()=>({click:{onClick:()=>V(!0)},hover:{onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1)},focus:{onFocus:()=>V(!0),onBlur:()=>V(!1)},contextmenu:{onContextMenu:e=>{if(e.preventDefault(),e.stopPropagation(),j.show){const[t,n]=Pe(e,E.current);j.style={...j.style,left:t,top:n}}else j.show=!0,j.toggling=setTimeout((()=>{const[t,n]=Pe(e,E.current);j.style={...j.style,opacity:1,transform:"none",left:t,top:n},j.toggling&&clearTimeout(j.toggling),M?.(!0)}),f)}},none:{}})),[]),L=h((()=>{if(!k)return{};const e={};return"hover"===s&&(e.onMouseEnter=()=>V(!0),e.onMouseLeave=()=>V(!1)),e}),[k,s]),H=()=>{if(!j.show)return;const[e,t,{arrowX:n,arrowY:i,arrowPos:a}]=Te(O.current,E.current,{position:m,gap:l,offset:o,align:C,refWindow:T});Object.assign(j,{style:{...j.style,left:e,top:t},arrowProps:{left:n,top:i,pos:a}})};return d((()=>{if("contextmenu"===s)return;const{observe:e,unobserve:t,disconnect:n}=function(){const e=new WeakMap,t=new ResizeObserver((t=>{t.map((t=>{const n=e.get(t.target);n?.(t.target)}))}));return{observe:function(n,i){e.get(n)||(n&&t.observe(n),e.set(n,i))},unobserve:function(n){n&&t.unobserve(n),e.delete(n)},disconnect:function(){t.disconnect()}}}();return O.current&&e(O.current,H),x&&E.current?(e(E.current,H),()=>{x&&E.current&&(t(E.current),O.current&&t(O.current),n())}):void 0}),[x,E.current,O.current]),b((()=>{if(!w||!j.show)return;const e=["top","bottom"].includes(m),t=O.current?.[e?"offsetWidth":"offsetHeight"];j.style={...j.style,[e?"width":"height"]:t}}),[j.show,w]),b((()=>{V(a)}),[a]),e(n,{children:[g.map(I,(e=>{if(!u(e))return;const{className:t,...n}=e.props;return Object.keys(Y[s]).map((e=>{if(!n[e])return;const t=Y[s][e];Y[s][e]=i=>{t(),n[e](i)}})),p(e,{ref:O,className:t,...n,...Y[s]})})),j.show&&t(st,{ref:E,arrow:N&&"contextmenu"!==s,style:{...P,...j.style},arrowProps:j.arrowProps,className:D,...L,trigger:O.current,getContainer:S,children:r})]})}const{Item:ot}=rt,ct=e=>{const{width:n,content:i,children:a,...r}=e;return t(lt,{trigger:"click",position:"bottom",touchable:!0,content:t(rt,{className:"i-dropdown-content",style:{minWidth:n},children:i}),...r,children:a})};ct.Item=e=>{const{more:n,moreProps:i,...a}=e,r=t(ot,{...a});return n?t(lt,{position:"right",touchable:!0,arrow:!1,align:"start",offset:10,hideDelay:240,...i,content:t(rt,{className:"i-dropdown-content",onClick:e=>e.stopPropagation(),children:n}),children:r}):r};const dt=e=>{const{as:n="div",align:a,justify:r,direction:s,wrap:l,gap:o,columns:c,className:d,style:u,...p}=e,m=h((()=>{if(c)return"number"==typeof c?`repeat(${c}, 1fr)`:c}),[c]);return t(n,{...p,style:{alignItems:a,justifyContent:r,gap:o,flexDirection:s,flexWrap:!0===l?"wrap":l,gridTemplateColumns:m,...u},className:i(d,{[c?"grid":"flex"]:!0})})},ut=y({});class pt{id;data={};cacheData={};rules={};constructor(){this.id=r(8),this.data={}}get(e){return e?this.data[e]:this.data}set(e,t){const n=this.id;if(this.data)return"string"==typeof e?(this.data[e]=t,this.cacheData[e]=t,void ue.publish(`${n}:set:${e}`,t)):void Object.keys(e).map((t=>{this.data[t]=e[t],this.cacheData[t]=e[t],ue.publish(`${n}:set:${t}`,e[t])}))}delete(e){delete this.data[e]}clear(){this.data&&(this.cacheData={},Object.keys(this.data).map((e=>{ue.publish(`${this.id}:set:${e}`,void 0),this.data[e]=void 0})))}async validate(e){const{id:t,rules:n,data:i}=this;if(!n)return i;if(e){const a=n[e],r={validator:e=>Array.isArray(e)?e.length>0:![void 0,null,""].includes(e),message:void 0};"function"==typeof a?r.validator=a:!0===a?r.message="required":Object.assign(r,a);const s=r.validator?.(i[e],this);return s?(ue.publish(`${t}:invalid:${name}`,{message:null,status:"normal"}),!0):(ue.publish(`${t}:invalid:${e}`,{message:r.message,status:"error"}),!1)}let a=!0;return Object.keys(i).map((e=>{const r=n[e];if(void 0===r)return;const s={validator:e=>Array.isArray(e)?e.length>0:!!e,message:void 0};"function"==typeof r?s.validator=r:!0===r?s.message="required":Object.assign(s,r);const l=s.validator?.(i[e],this);l?ue.publish(`${t}:invalid:${e}`,{message:null,status:"normal"}):(ue.publish(`${t}:invalid:${e}`,{message:s.message,status:"error"}),a=!1)})),!!a&&Promise.resolve(i)}}const mt=e=>{const{form:n={},rules:a,initialValues:r,style:s,className:l,width:o,gap:c="1em",children:u,onEnter:p,...m}=e;return d((()=>{Object.assign(n,{data:{...r},rules:a})}),[n]),t(ut.Provider,{value:n,children:t("form",{style:{...s,width:o,gap:c},className:i("i-form",l),onKeyDown:e=>{13===e.keyCode&&p?.(n.data,n)},...m,children:u})})};function ht(i){const{title:a,footer:r,hideCloseButton:s,footerLeft:l,okButtonProps:o={children:"确定",onClick:i.onOk},cancelButtonProps:c={secondary:!0,children:"关闭",onClick:i.onClose},children:d,onClose:u}=i,p=a||!s,m=h((()=>{if(r||null===r)return r;const i=Object.assign({},o),a=Object.assign({},c);return e(n,{children:[l,t(ke,{...i}),t(ke,{...a})]})}),[r,o,c]);return e(n,{children:[p&&e("header",{className:"i-modal-header",children:[a&&t("b",{children:a}),t(Ye,{active:!s,className:"i-modal-close",onClick:u})]}),t("div",{className:"i-modal-content",children:d}),t("footer",{className:"i-modal-footer",children:m})]})}function gt(n){const{visible:a,title:r,footer:s,okButtonProps:l,cancelButtonProps:o,closable:c=!0,hideBackdrop:u,backdropClosable:p=!0,hideCloseButton:h,width:g,height:f,customized:b,fixed:y,shadow:k=!0,children:N,style:C,className:w,footerLeft:x,onVisibleChange:$,onClose:z,onOk:T,...P}=n,[D,S]=m(a),[I,M]=m(!1),[O,E]=m(!1),j=v(!0),B=()=>{if(j.current){if(j.current=!1,!c)return E(!0),void setTimeout((()=>{E(!1),j.current=!0}),400);M(!1),setTimeout((()=>{S(!1),j.current=!0,$?.(!1),z?.()}),240)}};return d((()=>{a?j.current&&(S(!0),j.current=!1,setTimeout((()=>{M(!0),$?.(!0),j.current=!0}),24)):B()}),[a]),D?ce(t("div",{className:i("i-modal-container",{"i-modal-backdrop":!u,"i-modal-customized":b,"i-modal-active":I,fixed:y},w),style:C,onClick:function(){p&&B()},children:e("div",{className:i("i-modal",{bounced:O,shadow:k}),style:{width:g,height:f},onClick:e=>e.stopPropagation(),...P,children:[b&&N,!b&&t(ht,{title:r,hideCloseButton:h,footer:s,okButtonProps:l,cancelButtonProps:o,children:N,footerLeft:x,onOk:T,onClose:B})]})}),document.body):null}mt.useForm=function(e){const t=v(null);return t.current||(t.current=e??new pt),t.current},mt.Field=function(e){const{name:t,required:n,children:i}=e,a=ie({value:void 0,status:"normal",message:void 0,update:0}),r=k(ut),{id:s}=r,l=h((()=>g.map(i,(e=>{if(!u(e))return null;const{onChange:i}=e.props,{value:s,status:l,message:o}=a;return p(e,{value:s,status:l,message:o,required:n,onChange:(...e)=>{var n;n=e[0],t&&r.set(t,n),i?.(...e),Object.assign(a,{status:"normal",message:void 0})}})}))),[i,a.update]);return d((()=>{if(t)return ue.subscribe(`${s}:set:${t}`,((e,t)=>{a.value=t,a.update+=1})),ue.subscribe(`${s}:invalid:${t}`,((e,t)=>{Object.assign(a,t),a.update+=1})),Promise.resolve().then((()=>{r.set(t,r.cacheData[t]??void 0)})),()=>{ue.unsubscribe(`${s}:set:${t}`),ue.unsubscribe(`${s}:invalid:${t}`),r.delete(t)}}),[t,i]),t?l:i};const vt=e=>{const{ref:n}=e,i=ie({});return N(n,(()=>({update:(e={})=>{Object.assign(i,e)}}))),t(gt,{...e,...i})},ft=e=>{const{as:n="span",size:a,weight:r,decoration:s,gradient:l,wave:o,style:c,className:d,children:u}=e,p=h((()=>l&&Array.isArray(l)?{backgroundImage:`-webkit-linear-gradient(${l.join(",")})`,backgroundClip:"text"}:{}),[l]);return t(n,{style:{fontSize:a,fontWeight:r,textDecoration:s,...p,...c},className:i(d,{"i-text-gradient":l,"i-text-gradient-wave":o}),children:u})};function bt(n){const{value:i,height:a=40,size:r=8}=n;return e("div",{className:"i-progress-circle",children:[e("svg",{width:a,height:a,children:[t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--background-opacity-2)",strokeWidth:r}),t("circle",{cx:a/2,cy:a/2,r:a/2-r/2,fill:"none",stroke:"var(--color-main)",strokeWidth:r,strokeDasharray:100,pathLength:100,className:"i-progress-circle-path",strokeLinecap:"round",style:{strokeDashoffset:`calc(100 - ${i})`}})]}),e("span",{className:"i-progress-circle-value",children:[t("span",{children:i}),t(ft,{size:".81em",className:"color-7",children:"%"})]})]})}ft.Number=function(e){const{count:n,to:i,decimal:a,thousand:r=",",duration:s=2400,easing:l,...o}=e,[c,u]=m(n),p=h((()=>{if(void 0===c)return;const e=c.toFixed(a);return r?Ie(c,{precision:a,thousand:r}):e}),[c,r]);return d((()=>{void 0!==n&&void 0!==i&&function(e,t,n=1e3,i,a=e=>1-Math.pow(1-e,4)){const r=performance.now(),s=t-e;let l=requestAnimationFrame((function e(){l=requestAnimationFrame(e);let t=(performance.now()-r)/n;t>=1&&(t=1,cancelAnimationFrame(l));const o=s*a(t);i?.(o)}))}(n,i,s,(e=>u(n+e)),l)}),[i]),d((()=>u(n)),[n]),t(ft,{...o,children:p})},ft.Time=function(e){const{seconds:n,zero:i,units:a,...r}=e,s=h((()=>void 0===n?"":function(e,t){const n=[],{zero:i=!0,units:a=["",":",":"]}=t,r=a.length;let s=0;for(;s<r&&!(e<=0&&s>1);){const t=Math.round(e%60);e=Math.floor(e/60),n.unshift((i&&t<10?`0${t}`:t)+a[s++])}return n.join("")}(n,{zero:i,units:a})),[n]);return t(ft,{...r,children:s})},ft.HighLight=function(e){const{keyword:n,text:i,escape:a,caseSensitive:r,renderWord:s=e=>t("mark",{children:e}),...l}=e,o=h((()=>{const e=i;return pe({searchWords:"string"==typeof n?[n]:n,textToHighlight:i,caseSensitive:r,autoEscape:a}).map(((n,i)=>{const{end:a,highlight:r,start:l}=n,o=e.slice(l,a);return r?t(f,{children:s(o)},i):o}))}),[n,i,a,r]);return t(ft,{...l,children:o})};const yt=e=>{const{ref:n,value:a,size:r,barClass:s,dragging:l,renderCursor:o,onMouseDown:c,onTouchStart:d}=e;return t("div",{ref:n,className:"i-progress",style:{height:r},onMouseDown:c,onTouchStart:d,children:t("div",{className:i("i-progress-bar",s,{"no-transition":l}),style:{width:`${a}%`},children:o&&t("a",{className:"i-progress-cursor",children:o(a??0)})})})},kt=n=>{const{value:a=0,size:r=8,height:s=40,precision:l=0,style:o,draggable:c=!0,type:u="line",barClass:p,label:m,labelInline:g,className:f,renderCursor:b,onChange:y}=n,k=v(null),N=ie({value:a,dragging:!1,width:0,start:0}),C=h((()=>{let e=+N.value.toFixed(l);return e=Math.min(100,e),e=Math.max(0,e),e}),[N.value,l]),w=e=>{if(!k.current||!c)return;e.touches&&(e=e.touches[0]);const t=k.current.getBoundingClientRect(),n=100*(e.pageX-t.left)/t.width;Object.assign(N,{value:n,width:t.width,start:t.left,dragging:!0})};return Ge((e=>{if(!N.dragging||!c)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const{start:t,width:n}=N,i=e.pageX-t;i<0||i>n||(N.value=100*(e.pageX-t)/n)})),Ke((()=>{N.dragging&&c&&(y?.(C),N.dragging=!1)})),d((()=>{N.value=a>100?100:a<0?0:a}),[a]),e("div",{className:i("i-input-label",f,{"i-input-inline":g}),style:o,children:[m&&t("span",{className:"i-input-label-text",children:m}),"line"===u&&t(yt,{ref:k,size:r,barClass:p,dragging:N.dragging,value:N.value,renderCursor:b,onMouseDown:w,onTouchStart:w}),"circle"===u&&t(bt,{value:N.value,height:s,size:r})]})},Nt=n=>{const{ref:a,style:r,hideControls:l,autoplay:o,muted:c,volume:u=50,height:p,width:m,useOriginControls:h,timeProgressProps:g={barClass:"bg-2"},volumeProgressProps:f={barClass:"bg-1"},className:b,onFullScreenChange:y,...k}=n,C=ie({playing:o,volume:c?0:u,volumeCache:0,muted:c,current:0,duration:0,isFullscreen:!1,controlHidden:!0}),w=v(null),x=v(null),$=e=>{const t=e.target;t.paused||Object.assign(C,{current:t.currentTime})},z=e=>{C.playing=!e.target.paused},E=()=>{const e=w.current?.parentElement;e&&(C.isFullscreen=document.fullscreenElement===e)},j=e=>{const t=e.target;Object.assign(C,{volume:100*t.volume,muted:0===t.volume})},B=()=>{const e=w.current;e&&(e.paused?e.play():e.pause())},A=()=>{const e=w.current;e&&(e.currentTime=0,e.pause())},V=()=>{const e=w.current?.parentElement;var t;e&&(C.isFullscreen?document.exitFullscreen?.():(t=e,t.requestFullscreen?.()),y?.(!C.isFullscreen))},Y=!l&&!h,L=()=>{x.current&&(clearTimeout(x.current),x.current=null)},H=s({interval:300},(()=>{Y&&(C.controlHidden=!1,L(),x.current=setTimeout((()=>{C.controlHidden=!0}),1e3))}));return N(a,(()=>({play:()=>{const e=w.current;e&&e.play()},pause:()=>{const e=w.current;e&&e.pause()},stop:A,fullscreen:V,getVideo:()=>w.current}))),d((()=>{const e=w.current;if(e)return e.addEventListener("timeupdate",$),e.addEventListener("play",z),e.addEventListener("pause",z),e.addEventListener("volumechange",j),document.addEventListener("fullscreenchange",E),()=>{L(),e.removeEventListener("timeupdate",$),e.removeEventListener("play",z),e.removeEventListener("pause",z),e.removeEventListener("volumechange",j),document.removeEventListener("fullscreenchange",E)}}),[]),e("div",{className:i("i-video",b),style:{height:p,width:m,...r},onClick:B,onDoubleClick:()=>V(),onMouseMove:H,children:[t("video",{ref:w,onCanPlay:e=>{const t=e.target;Object.assign(C,{duration:t.duration,current:t.currentTime}),t.volume=C.volume/100},...k,controls:h}),Y&&e("div",{className:i("i-video-controls",{"i-video-controls-hidden":C.controlHidden}),onClick:e=>e.stopPropagation(),children:[e("div",{className:"i-video-control flex-1",children:[t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(Ne,{icon:t(T,{})}),active:C.playing,onClick:B,children:t(Ne,{icon:t(P,{})})}),t(ke,{className:"i-video-btn",flat:!0,square:!0,onClick:A,children:t(Ne,{icon:t(D,{})})}),e("span",{className:"i-video-times font-sm",children:[t(ft.Time,{seconds:C.current})," /",t(ft.Time,{seconds:C.duration})]}),t(kt,{className:"mr-8",...g,value:C.current/C.duration*100,onChange:e=>{const t=w.current;t&&(t.currentTime=C.duration*e/100)}})]}),t("div",{className:"i-video-control",children:t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:t(Ne,{icon:t(S,{})}),active:C.isFullscreen,onClick:()=>V(),children:t(Ne,{icon:t(I,{})})})}),e("div",{className:"i-video-control",children:[t(ke.Toggle,{className:"i-video-btn",flat:!0,square:!0,active:C.volume<=0,after:t(Ne,{icon:t(M,{}),size:"1.2em"}),onClick:()=>{const e=w.current;if(e)return e.volume>0?(C.volumeCache=e.volume,void(e.volume=0)):void(e.volume=0===C.volumeCache?.5:C.volumeCache)},children:t(Ne,{icon:t(O,{})})}),t(kt,{style:{width:100},className:"mr-8",...f,value:C.volume,onChange:e=>{const t=w.current;t&&(t.volume=e/100)}})]})]})]})};function Ct(n){const{name:i,suffix:a,type:r}=n;switch(r){case ze.IMAGE:return t("img",{src:n.src});case ze.VIDEO:return t(Nt,{...n});default:return e("div",{className:"i-preview-unknown",children:[t(Ne,{icon:t(E,{}),size:"3em"}),t("h5",{className:"mt-4",children:i||a||"?"})]})}}function wt(a){const{items:r=[],initial:l=0,renderFile:o=Ct,onRotate:c,onChange:d,onClose:u,onZoom:p}=a,m=ie({current:l,rotate:0,scale:1,translate:[0,0],start:[0,0],dragging:!1,controlHidden:!0}),g=v(null),f=v([0,0]),b=v(null),y=h((()=>r.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Oe(t.src)||"",t.type=Ee(t.suffix,e.type),t}))),[r]),{file:k,content:N}=h((()=>{const e=y[m.current];return{file:e,content:o(e)}}),[m.current,r]),C=k.type===ze.IMAGE,x=e=>{const t=y.length,{current:n}=m;m.current=e>=t?0:e<0?t-1:e,d?.(m.current,n),m.rotate=y[m.current].rotate||0,1!==m.scale&&(m.scale=1,p?.(1)),c?.(m.rotate),m.translate=f.current=[0,0]},$=e=>{m.rotate+=e,c?.(m.rotate)},z=s({interval:60},(e=>{if(!C)return;let t=m.scale+(e.deltaY<0?.05:-.05);t>2&&(t=2),t<.25&&(t=.25),p?.(t),m.scale=t})),T=s({interval:300},(()=>{m.controlHidden=!1,b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout((()=>{m.controlHidden=!0}),1e3)}));return Ge((e=>{if(T(),!m.dragging)return;e.preventDefault();const[t,n]=f.current,[i,a]=m.start,r=e.pageX-i,s=e.pageY-a;m.translate=[t+r,n+s]})),Ke((()=>{m.dragging&&(m.dragging=!1,f.current=m.translate)})),e(n,{children:[t("div",{ref:g,className:i("i-preview-content",{"no-transition":m.dragging}),style:{transform:`translate(${m.translate.map((e=>`${e}px`)).join(",")}) rotate(${m.rotate}deg) scale(${m.scale})`},onWheel:z,onMouseDown:e=>{C&&(e.preventDefault(),m.dragging=!0,m.start=[e.pageX,e.pageY])},onClick:e=>e.stopPropagation(),children:N}),e("div",{className:i("i-preview-controls",{"i-preview-controls-hidden":m.controlHidden}),children:[t(ke,{square:!0,flat:!0,onClick:u,children:t(Ne,{icon:t(w,{})})}),y.length>1&&e("span",{className:"px-8",children:[m.current+1," / ",y.length]}),1!==m.scale&&e(ke,{flat:!0,onClick:()=>m.scale=1,children:[t(Ne,{icon:t(j,{})}),e("span",{className:"mt-2",children:[(100*m.scale).toFixed(0),"%"]})]}),t(ke,{square:!0,flat:!0,href:k.src,target:"_blank",children:t(Ne,{icon:t(B,{})})}),t(ke,{square:!0,flat:!0,href:k.src,download:!0,target:"_blank",children:t(Ne,{icon:t(A,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>$(90),children:t(Ne,{icon:t(V,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>$(-90),children:t(Ne,{icon:t(Y,{})})}),y.length>1&&e(n,{children:[t(ke,{square:!0,flat:!0,onClick:()=>x(m.current-1),children:t(Ne,{icon:t(L,{})})}),t(ke,{square:!0,flat:!0,onClick:()=>x(m.current+1),children:t(Ne,{icon:t(H,{})})})]})]})]})}function xt(){const e=v(null);return n=>{const{items:i,modalProps:a,onClose:r,...s}=n,l=Me(t(vt,{ref:e,visible:!0,className:"i-preview",customized:!0,shadow:!1,...a,children:t(wt,{...s,items:i,onClose:()=>{e.current?.update({visible:!1})}}),fixed:!0,onClose:()=>{r?.(),l?.()}}))}}const $t=a=>{const{src:r,round:s,size:l,initSize:o,lazyload:c,fallback:u=t(Ne,{icon:t(W,{}),size:"2em",className:"color-5"}),fit:p,style:m,className:h,cover:g,coverClass:f,usePreview:b,onLoad:y,onError:k,onClick:N,...C}=a,w=ie({status:"loading"}),x=v(null),$=p?"100%":void 0,{observe:z,unobserve:T}=Ze(),P=xt(),D=e=>{N?.(e),b&&r&&P({items:[{src:r,type:ze.IMAGE}]})};d((()=>{if(r&&(x.current?.complete||(w.status="loading"),c&&x.current))return z(x.current,((e,t)=>{t&&(e.setAttribute("src",e.dataset.src||""),T(e))})),()=>{x.current&&T(x.current)}}),[r]),C[c?"data-src":"src"]=r;const S="loading"===w.status?o:void 0;return t("div",{style:{width:l??S,height:l??S,...m},className:i("i-image",h,{rounded:s,[`i-image-${w.status}`]:w.status}),children:"error"===w.status?u:e(n,{children:[r&&t("img",{ref:x,style:{objectFit:p,width:$,height:$},...C,onLoad:e=>{y?.(e),w.status=void 0},onError:e=>{k?.(e),w.status="error"},onClick:D}),r&&"loading"===w.status&&t(be,{absolute:!0}),g&&t("div",{className:i("i-image-cover",f),onClick:D,children:g})]})})};function zt(n){const{label:a,className:r,labelInline:s,style:l,children:o,status:c,tip:d,required:u}=n;return e("label",{className:i("i-input-label",r,{"i-input-inline":s}),style:l,children:[a&&e("span",{className:"i-input-label-text",children:[u&&t("span",{className:"error",children:"*"}),a]}),o,d&&t("span",{className:i("i-input-message",{[`i-input-${c}`]:"normal"!==c}),children:d})]})}$t.List=function(e){const{items:n=[],gap:i=8,columns:a,wrap:r,direction:s,usePreview:l,onClick:o,...c}=e,d=xt(),u=h((()=>n.map((e=>{const t={src:""};return"string"==typeof e?t.src=e:Object.assign(t,e),t.suffix=Oe(t.src)||"",t.type=Ee(t.suffix,e.type),t}))),[n]);return u.length?t(dt,{className:"i-image-list",gap:i,columns:a,wrap:r,direction:s,children:u.map(((e,n)=>t($t,{src:e.src,size:60,usePreview:!1,onClick:e=>((e,t)=>{o?.(e),l&&d({items:u,initial:t})})(e,n),...c},n)))}):""};const Tt=n=>{const{ref:a,type:r="text",label:s,name:l,value:o=n.initValue??"",initValue:c="",prepend:u,append:p,labelInline:m,className:g,status:v="normal",message:f,tip:b,clear:y,hideVisible:k,border:N,required:C,onChange:w,onEnter:x,style:$,...z}=n,T=ie({value:o,type:r,visible:!1}),P=h((()=>{if("password"===r)return T.visible?t(F,{}):t(q,{})}),[T.visible]);d((()=>{T.value=o}),[o]);const D={ref:a,type:T.type,name:l,value:T.value,className:i("i-input",`i-input-${r}`),onChange:e=>{const t=e.target.value;T.value=t,w?.(t,e)},onKeyDown:e=>{"Enter"===e.code&&x?.(e)},...z},S=y&&T.value,I="password"===r&&!!T.value;return t(zt,{label:s,labelInline:m,className:g,style:$,tip:f??b,status:v,required:C,children:e("div",{className:i("i-input-item",{[`i-input-${v}`]:"normal"!==v,"i-input-borderless":!N}),children:[u&&t("div",{className:"i-input-prepend",children:u}),t("input",{...D}),t(Ye,{active:!!S||I,icon:P,onClick:()=>{if("password"===r&&!k)return void Object.assign(T,{visible:!T.visible,type:T.visible?"password":"text"});w?.("")}}),p&&t("div",{className:"i-input-append",children:p})]})})};Tt.Textarea=e=>{const{ref:n,label:a,name:r,value:s=e.initValue,initValue:l,labelInline:o,className:c,status:u="normal",message:p,tip:m,autoSize:h,border:g,style:f,onChange:b,onEnter:y,...k}=e,N=ie({value:s}),C=v(null);d((()=>{N.value=s}),[s]);const w={ref:n,name:r,value:N.value,className:"i-input i-textarea",onChange:e=>{const t=e.target.value;N.value=t;const n=C.current?.firstChild;h&&n&&(n.style.height=`${n.scrollHeight}px`),b?.(t,e)},onKeyDown:e=>{"Enter"===e.code&&(e.stopPropagation(),y?.(e))},...k};return t(zt,{label:a,labelInline:o,className:c,style:f,tip:p??m,status:u,children:t("div",{ref:C,className:i("i-input-item",{[`i-input-${u}`]:"normal"!==u,"i-input-borderless":!g}),children:t("textarea",{...w})})})},Tt.Number=n=>{const{ref:a,label:r,name:s,value:l=n.initValue??"",initValue:o,labelInline:c,step:u=1,min:p=-1/0,max:m=1/0,thousand:h,precision:g,type:v,className:f,status:b="normal",append:y,border:k,prepend:N,message:C,tip:w,hideControl:z,style:T,onChange:P,onEnter:D,onInput:S,onBlur:I,...M}=n,O=ie({value:l}),E=e=>e?"number"!=typeof e&&h?e.replaceAll(h,""):e:"",j=e=>{const t=E(O.value)??0,n=Be(+t+e,p,m);O.value=(e=>Ie(e,{precision:g,thousand:h}))(n),P?.(n)};d((()=>{O.value=l}),[l]);const B={ref:a,name:s,value:O.value,className:"i-input i-input-number",onChange:e=>{const{value:t}=e.target,n=E(t.replace(/[^\d\.-]/g,""));O.value=n,P?.(+n,e)},...M};return t(zt,{label:r,labelInline:c,className:f,style:T,tip:C??w,status:b,children:e("div",{className:i("i-input-item",{[`i-input-${b}`]:"normal"!==b,"i-input-borderless":!k}),children:[N&&t("div",{className:"i-input-prepend",children:N}),!z&&t(Ye,{active:!0,icon:t(x,{}),onClick:()=>j(-u)}),t("input",{...B}),!z&&t(Ye,{active:!0,icon:t($,{}),onClick:()=>j(u)}),y&&t("div",{className:"i-input-append",children:y})]})})},Tt.Range=n=>{const{label:a,name:r,value:s=n.initValue??"",initValue:l,labelInline:o,min:c=-1/0,max:u=1/0,type:p,className:m,status:h="normal",message:g,tip:v,append:f,prepend:b,step:y=1,thousand:k,precision:N,hideControl:C,placeholder:w,border:z,onChange:T,onBlur:P,style:D,...S}=n,I=ie({value:s}),M=e=>e?"number"!=typeof e&&k?e.replaceAll(k,""):e:"",O=(e,t)=>{const{value:n}=e.target,i=M(n.replace(/[^\d\.-]/g,"")),a=Array.isArray(I.value)?I.value:[];a[t]=+i,I.value=a,T?.(a,e)},E=(e,t,n)=>{e.preventDefault(),e.stopPropagation();const i=Array.isArray(I.value)?I.value:[],a=M(i[n])??0,r=Be(+a+t,c,u);i[n]=(e=>Ie(e,{precision:N,thousand:k}))(r),I.value=i,T?.(i,e)};d((()=>{I.value=s}),[s]);const j={name:r,className:"i-input i-input-number",...S};return t(zt,{label:a,labelInline:o,className:m,style:D,tip:g??v,status:h,children:e("div",{className:i("i-input-item",{[`i-input-${h}`]:"normal"!==h,"i-input-borderless":!z}),children:[b&&t("div",{className:"i-input-prepend",children:b}),!C&&t(Ye,{active:!0,icon:t(x,{}),onClick:e=>E(e,-y,0)}),t("input",{value:I.value?.[0]||"",placeholder:w?.[0],...j,onChange:e=>O(e,0)}),!C&&t(Ye,{active:!0,icon:t($,{}),onClick:e=>E(e,y,0)}),t(Ye,{active:!0,icon:t(R,{}),style:{margin:0},onClick:e=>{e.preventDefault(),e.stopPropagation();const t=I.value?I.value:[],n=t[0];t[0]=t[1],t[1]=n,I.value=t,T?.(t)}}),!C&&t(Ye,{active:!0,icon:t(x,{}),onClick:e=>E(e,-y,1)}),t("input",{value:I.value?.[1]||"",placeholder:w?.[1],...j,onChange:e=>O(e,1)}),!C&&t(Ye,{active:!0,icon:t($,{}),onClick:e=>E(e,y,1)}),f&&t("div",{className:"i-input-append",children:f})]})})};const Pt={left:"flex-start",center:"center",right:"flex-end"},Dt=12,St={duration:3e3,closable:!0,active:!1},It=function(){const e=document.createElement("div");return e.dataset.id="messages",document.body.append(e),e}(),Mt={callout(e){},close(){}},Ot={left:[],center:[],right:[]},Et={left:[],center:[],right:[]};le(It).render(t((function(){const i=v(null),a=ie({items:{left:[],center:[],right:[]},tops:{left:[],center:[],right:[]}}),r={left:0,center:0,right:0};d((()=>{Object.assign(Mt,{callout:function(e){const{align:t="center",unshift:n,onShow:r}=e,s=Ot[t][n?"unshift":"push"](e);a.items[t]=[...Ot[t]],setTimeout((()=>{const e=i.current?.offsetHeight||0;Ot[t][n?0:s-1].active=!0,a.items[t]=[...Ot[t]],Et[t][n?"unshift":"push"](e),a.tops[t]=[...Et[t]],r?.()}),0),0!==e.duration&&setTimeout(this.close.bind(e),e.duration)},close:function(){const e=this,{align:t="center",onHide:n}=e,i=Ot[t].findIndex((t=>t.id===e.id));i<0||(Ot[t][i].active=!1,a.items[t]=[...Ot[t]],e.timer=setTimeout((()=>{const i=Ot[t].findIndex((t=>t.id===e.id));Ot[t].splice(i,1),Et[t].splice(i,1),a.tops[t]=[...Et[t]],a.items[t]=[...Ot[t]],e.timer&&clearTimeout(e.timer),n?.()}),240))}})}),[]);const s=(e,s)=>{if(!e)return t(n,{});const{id:l,active:o,content:c,align:d="center",className:u}=e;r[d]+=a.tops[d][s-1]||0;const p=Dt*s+r[d];return t(jt,{ref:i,active:o,content:c,top:p,className:u,style:{alignSelf:Pt[d]},onClick:Mt.close.bind(e)},l)};return e("div",{className:"i-messages",children:[a.items.left.map(s),a.items.center.map(s),a.items.right.map(s)]})}),{}));const jt=function({ref:e,active:n,content:a,top:r,className:s,style:l,onClick:o}){return t("div",{ref:e,className:i("i-message",s,{"i-message-active":n}),style:{...l,top:r},onClick:o,children:a})};function Bt(e){return(["string","number"].includes(typeof e)||u(e))&&(e={content:e}),e=Object.assign({id:r(7)},St,e),Mt.callout(e),Mt.close.bind(e)}Bt.error=e=>Bt({content:e,className:"bg-error"}),Bt.success=e=>Bt({content:e,className:"bg-success"}),Bt.warning=e=>Bt({content:e,className:"bg-warning"}),gt.useModal=function(){const e=v(null);return{open:n=>{const i=Me(t(vt,{ref:e,visible:!0,...n,onClose:()=>{n.onClose?.(),i?.()}}))},update:t=>{if(!e.current)return;const{update:n}=e.current;n(t)}}};const At=n=>{const{page:a,active:r,children:s,onChange:l}=n,[o,c]=m(!1);return e("a",{className:i("i-page",{"i-page-active":r,"i-page-loading":o,"i-page-disabled":!1}),"data-page":a,onClick:async()=>{r||o||(c(!0),await(l?.(a)),c(!1))},children:[o&&t(be,{}),s]})},Vt=a=>{const{page:r=1,size:s=10,total:l=0,sibling:o=2,prev:c=t(Ne,{icon:t(L,{})}),next:u=t(Ne,{icon:t(H,{})}),simple:p,jumper:g,className:v,renderEllipsis:f=()=>t(Ne,{icon:t(X,{}),className:"color-7"}),renderPage:b=e=>e,onChange:y,...k}=a,[N,C]=m(r),[w,x]=m(!1),$=h((()=>Math.ceil(l/s)),[s,l]),[z,T,P]=h((()=>{const e=Math.max(1,N-o),t=Math.min($,N+o);return[e,t,Array.from({length:t-e+1}).map(((t,n)=>e+n))]}),[N,$,o]);if($<=N&&1===N)return t(n,{});const D=async e=>{if(y&&!w)return x(!0),new Promise((async t=>{void 0!==e&&(await y(e),C(e),x(!1),t())}))};return d((()=>C(r)),[r]),e("div",{className:i("i-pagination",v),...k,children:[c&&t(At,{page:N-1||1,onChange:D,children:c}),z>1&&t(At,{page:1,onChange:D,children:b(1)}),z>2&&f(),P.map((e=>t(At,{page:e,active:e===N,onChange:D,children:b(e)},e))),T<$-1&&f(),T<$&&t(At,{page:$,onChange:D,children:b($)}),u&&t(At,{page:N+1,onChange:D,children:u})]})},Yt=n=>{const{dot:a,dotClass:r,outline:s,round:l,size:o="normal",hoverShowClose:c,className:d,children:u,onClose:p,onClick:m,...h}=n;return e("span",{className:i("i-tag",{"i-tag-outline":s,"i-tag-clickable":m,[`i-tag-${o}`]:"normal"!==o,round:l},d),onClick:m,...h,children:[a&&t("span",{className:i("i-tag-dot",r)}),u,p&&t(Ye,{active:!0,className:i("i-tag-close",{"i-tag-hover-close":c}),onClick:p})]})},Lt=n=>{const{value:a,options:r,filter:s,filterPlaceholder:l,multiple:o,empty:c=t(He,{}),onSelect:d,onFilter:u}=n;return e("div",{className:i("i-select-options",{"i-select-options-multiple":o}),children:[s&&o&&e("div",{className:"i-select-filter",children:[t(Ne,{icon:t(U,{}),className:"color-8 ml-8 my-auto",size:"1.2em"}),t("input",{type:"text",className:"i-input",placeholder:l,onChange:u})]}),0===r.length&&c,r.map(((n,i)=>{const{label:r,value:s,disabled:l}=n,c=o?a?.includes(s):a===s;return e(rt.Item,{active:c,type:"option",onClick:()=>d?.(s,n),disabled:l,children:[o&&t(Ne,{icon:t(G,{}),className:"i-select-option-check",size:"1em"}),r]},s||i)}))]})},Ht=n=>{const{options:i,value:a,maxDisplay:r,multiple:s,onSelect:l}=n;return s?((e=[],t=[],n=3)=>{const i=e.flatMap((e=>t.includes(e.value)?[e]:[]));if(n>=i.length)return i;const a=i.length-n,r=i.slice(0,n);return r.push(a),r})(i,a,r).map(((n,i)=>{if("number"==typeof n)return e(Yt,{children:["+",n]},i);const{label:a,value:r}=n;return t(Yt,{hoverShowClose:!0,onClose:e=>{e?.stopPropagation(),l?.(r,n)},children:a},r)})):i.find((e=>e.value===a))?.label},Wt=n=>{const{ref:r,type:s="text",name:l,label:o,value:c="",placeholder:u,options:p=[],multiple:g,prepend:v,append:f,labelInline:b,style:y,className:k,message:N,status:C="normal",hideClear:w,hideArrow:x,maxDisplay:$,border:z,filter:T,tip:P,filterPlaceholder:D="...",popupProps:S,onSelect:I,onChange:M,...O}=n,E=ie({inputValue:"",filterValue:"",value:c,loading:!1}),[j,B]=m(!1),A=h((()=>Se(p)),[p]),V=h((()=>{const{filterValue:e}=E;if(!e||!T)return A;const t="function"==typeof T?T:t=>t.value.includes(e)||t.label.includes(e);return A.filter(t)}),[A,T,E.filterValue]),Y=e=>{E.value=e,M?.(e)},L=(e,t)=>{if(I?.(e,t),g){const t=[...E.value],n=t.findIndex((t=>t===e));return n>-1?t.splice(n,1):t.push(e),void Y(t)}B(!1),Y(e)},H=a({delay:400},(e=>{const t=e.target.value;E.filterValue=t}));d((()=>{E.value=c}),[c]);const W=g?E.value.length>0:!!E.value,F=!w&&j&&W,q=N??P;return e("label",{className:i("i-input-label",k,{"i-input-inline":b}),style:y,children:[o&&t("span",{className:"i-input-label-text",children:o}),t(lt,{position:"bottom",arrow:!1,fitSize:!0,...S,visible:j,trigger:"none",onVisibleChange:e=>{B(e),T&&(E.filterValue="")},content:t(Lt,{options:V,value:E.value,multiple:g,filter:!!T,filterPlaceholder:D,onSelect:L,onFilter:H}),children:e("div",{className:i("i-input-item",{[`i-input-${C}`]:"normal"!==C,"i-input-borderless":!z,"i-input-focus":j}),onClick:()=>B(!0),children:[v,t("input",{ref:r,type:"hidden",value:E.value,...O}),g?W?t("div",{className:i("i-input i-select",{"i-select-multiple":g}),children:Ht({options:A,value:E.value,multiple:g,maxDisplay:$,onSelect:L})}):t("input",{className:"i-input i-select",placeholder:u,readOnly:!0}):null,!g&&t("input",{value:j?E.filterValue:E.value,className:"i-input i-select",placeholder:E.value||u,onChange:e=>{E.filterValue=e.target.value},readOnly:!T}),t(Ye,{active:!x,icon:F?void 0:t(K,{}),onClick:()=>{j&&Y(g?[]:"")}}),f]})}),q&&t("span",{className:"i-input-message",children:q})]})},Ft={HEX:"toHexString",RGB:"toRgbString",HSB:"toHsbString"};function qt(n){const{value:i,type:a,onTypeChange:r,onChange:s}=n,l=ie({value:i,type:a});return d((()=>{l.value=i,l.type=a}),[i,a]),e("div",{className:"i-colorpicker-footer",children:[t(Wt,{readOnly:!0,hideClear:!0,hideArrow:!0,style:{width:"5.6em"},options:["RGB","HEX","HSB"],value:l.type,onChange:e=>{l.type=e,r(e)}}),t(Tt,{value:l.value,onChange:e=>{l.value=e,s?.(e)}})]})}const Rt=n=>{const{ref:a,color:r,handle:s,placeholder:l,className:o,...c}=n;return e("div",{ref:a,className:i("i-colorpicker-handle",o),...c,children:["text"!==s&&t("i",{className:"i-colorpicker-square",style:{background:r}}),"square"!==s&&t("span",{className:"i-colorpicker-text",style:{color:r},children:r??l})]})};function Xt(i){const{value:a,type:r="HEX",disabledAlpha:s,children:l,usePanel:o,handle:c="both",placeholder:u="Colors",popupProps:p,onChange:m}=i,h=ie({type:r,value:a,syncValue:a,visible:p?.visible}),g=e=>{const t=Ft[e];h.type=e,h.value=h.syncValue[t]?.()},v=e=>{h.value=e,h.syncValue=e,m?.(e)};return d((()=>{h.syncValue=a,h.value=a}),[a]),o?t(me,{...i}):t(lt,{trigger:"click",touchable:!0,position:"bottom",...p,visible:h.visible,content:t(me,{value:h.syncValue,disabledAlpha:s,panelRender:i=>e(n,{children:[i,t(qt,{value:h.value,type:h.type,onTypeChange:g,onChange:v})]}),onChange:e=>{h.syncValue=e},onChangeComplete:e=>{const t=Ft[h.type];1!==e.a&&(e.a=parseFloat(e.a.toFixed(3))),h.value=e[t]?.(),m?.(h.value)}}),onVisibleChange:e=>{h.visible=e,p?.onVisibleChange?.(e)},children:l??t(Rt,{color:h.value,handle:c,placeholder:u})})}const Ut=a=>{const{value:r,month:s,weeks:l=["一","二","三","四","五","六","日"],renderDate:o=e=>e.date(),disabledDate:c,onDateClick:d}=a,u=he(),p=h((()=>{const e=[],t=s.add(-1,"month").endOf("month");let{$W:n,$D:i}=t;if(0!==n){const i=Array.from({length:n}).map(((e,i)=>t.add(i+1-n,"day")));e.push(...i)}const a=s.endOf("month");return i=a.$D,n=a.$W,e.push(...Array.from({length:i}).map(((e,t)=>a.add(t+1-i,"day")))),0!==n&&e.push(...Array.from({length:7-n}).map(((e,t)=>a.add(t+1,"day")))),e}),[s]);return e(n,{children:[t("div",{className:"i-datepicker-weeks",children:l.map(((e,n)=>t("span",{className:"i-datepicker-week",children:e},n)))}),t("div",{className:"i-datepicker-dates",children:p.map(((e,n)=>{const a=e.isSame(r,"day"),l=e.isSame(s,"month"),p=e.isSame(u,"day"),m=c?.(e);return t("div",{className:i("i-datepicker-item",{"i-datepicker-active":a,"i-datepicker-same-month":l,"i-datepicker-today":p,"i-datepicker-disabled":m}),onClick:()=>(e=>{c?.(e)||d?.(e)})(e),children:o(e)},n)}))})]})},Gt=[1,2,3,4,5,6,7,8,9,10,11,12],Kt=n=>{const{value:i,unitMonth:a="月",unitYear:r="年",renderYear:s,renderMonth:l,onClick:o}=n;return e("a",{className:"i-datepicker-action","data-ripple":!0,onClick:o,children:[t("span",{children:s?.(i.year())}),r,t("span",{children:l?.(i.month()+1)}),a]})},Zt=n=>{const{value:a,unitYear:r,unitMonth:l,renderDate:o,renderMonth:c=e=>e,renderYear:u=e=>e,disabledDate:p,onDateClick:m}=n,h=ie({today:a,month:a||he(),selectedYear:he(),years:[],selectable:!1}),g=v(null),f=e=>{h.month=h.month[e?"add":"subtract"](1,"month")},b=s({interval:100},(e=>{const t=e.deltaY<0;h.years=h.years.map((e=>e+(t?-1:1)))}));return d((()=>{if(!h.selectable)return;h.selectedYear=h.month;const e=h.selectedYear.year(),t=Array.from({length:7}).map(((t,n)=>e-3+n));h.years=[...t]}),[h.selectable]),d((()=>{h.today=a,h.month=a||he()}),[a]),e("div",{className:"i-datepicker",children:[e("div",{className:"i-datepicker-units",children:[t(Kt,{value:h.month,unitYear:r,unitMonth:l,renderMonth:c,renderYear:u,onClick:()=>h.selectable=!0}),t("a",{className:"ml-auto i-datepicker-action","data-ripple":!0,onClick:()=>f(!1),children:t(Ne,{icon:t(L,{})})}),t("a",{className:"i-datepicker-action","data-ripple":!0,onClick:()=>f(!0),children:t(Ne,{icon:t(H,{})})})]}),e("div",{className:i("i-datepicker-ym",{"i-datepicker-active":h.selectable}),children:[t(Ye,{active:!0,className:"i-datepicker-close",onClick:e=>{e.stopPropagation(),h.selectable=!1}}),t("div",{ref:g,className:"i-datepicker-years",onWheel:b,children:h.years.map((e=>t("a",{className:i("i-datepicker-year",{"i-datepicker-active":e===h.selectedYear.year()}),onClick:()=>h.selectedYear=h.selectedYear.year(e),children:u(e)},e)))}),t("div",{className:"i-datepicker-months",children:Gt.map((e=>t("a",{className:i("i-datepicker-month",{"i-datepicker-active":e===h.month.month()+1}),onClick:()=>{return t=e,h.month=h.month.year(h.selectedYear.year()).month(t-1),void(h.selectable=!1);var t},children:c(e)},e)))})]}),t(Ut,{value:h.today,month:h.month,disabledDate:p,onDateClick:e=>{e.isSame(h.today,"day")||(e.isSame(h.month,"month")||(h.month=e),h.today=e,m?.(e))},renderDate:o})]})};he.extend(ge);const _t=["YYYY-MM-DD","YYYY-M-D","YYYY/MM/DD","YYYY/M/D"],Jt="YYYY-MM-DD",Qt=e=>{const{name:n,value:i,weeks:a,format:r=Jt,placeholder:s=e.format??Jt,renderDate:l,renderMonth:o,renderYear:c,popupProps:u,disabledDate:p,onDateClick:g,onChange:v,onBlur:f,...b}=e,y=ie({value:i}),[k,N]=m(!1),C=h((()=>{if(!y.value)return null;const e=he(y.value,r,!0);return e.isValid()?e:null}),[y.value]),w=e=>{y.value=e,v?.(e)},x=()=>{if(!y.value)return;const e=he(y.value,_t,!0);e.isValid()?w(e.format(r)):w("")};return d((()=>{y.value=i}),[i]),t(lt,{visible:k,trigger:"click",position:"bottom",arrow:!1,align:"start",onVisibleChange:e=>{u?.onVisibleChange?.(e),N(e)},watchResize:!0,content:t(Zt,{value:C,weeks:a,renderDate:l,renderMonth:o,renderYear:c,disabledDate:p,onDateClick:e=>{w(e.format(r))}}),...u,children:t(Tt,{value:y.value,append:t(Ne,{icon:t(Z,{}),className:"i-datepicker-icon",size:"1em"}),placeholder:s,onChange:w,onBlur:e=>{f?.(e),x()},onEnter:x,...b})})};function en(e){const{items:n=[],active:a,renderItem:r,unit:s,onClick:l}=e;return n.map((e=>{const n=e===a;return t("a",{className:i("i-timepicker-item",{"i-timepicker-item-active":n}),onClick:()=>l(e),children:r?.(e,n,s)??(e<10?`0${e}`:e)},e)}))}const tn={h:"hour",hh:"hour",m:"minute",mm:"minute",s:"second",ss:"second"};function nn(i){const{value:a,stepH:r=1,stepM:s=1,stepS:l=1,format:o,periods:c,renderItem:u,onChange:p,onFallback:m}=i,g=ie({period:void 0,hour:void 0,minute:void 0,second:void 0}),[v,f,b]=h((()=>{const e=o.includes("h"),t=o.includes("m"),n=o.includes("s");return[e?Array.from({length:(c?12:24)/r},((e,t)=>t*r)):[],t?Array.from({length:60/s},((e,t)=>t*s)):[],n?Array.from({length:60/l},((e,t)=>t*l)):[]]}),[r,s,l,o,c]),y=(e,t)=>{g[t]=e,(()=>{let e=o.replace(/(hh|h){1}|(mm|m){1}|(ss|s){1}/gi,(e=>{const t=e.toLowerCase(),n=g[tn[t]]??0;return t.length>1&&n<10?`0${n??0}`:n??0}));c&&v.length>0&&(e=`${g.period??c[0]} ${e}`),p(e)})()};return d((()=>{let e=a??"";if(c&&v.length>0&&a){const[t,n]=a.split(" ");e=n??"",g.period=c.includes(t)?t:void 0}const t=e.match(/\d+/g)??[];if(!t.length)return void m("");let n=0;const i=o.replace(/(hh|h)+|(mm|m)+|(ss|s)+/gi,(e=>{const i=t[n++]??0;let a=e;return"hour"===tn[e]&&(a=Math.min(c?11:23,i)),a=Math.min(59,i),g[tn[e]]=a,e.length>1&&a<10?`0${a}`:a}));m(i)}),[a]),e("div",{className:"i-timepicker",children:[v.length>0&&e(n,{children:[c&&t("div",{className:"i-timepicker-list",children:t(en,{items:c,active:g.period,onClick:e=>y(e,"period")})}),t("div",{className:"i-timepicker-list",children:t(en,{items:v,active:g.hour,unit:"hour",renderItem:u,onClick:e=>y(e,"hour")})})]}),f.length>0&&t("div",{className:"i-timepicker-list",children:t(en,{items:f,active:g.minute,unit:"minute",renderItem:u,onClick:e=>y(e,"minute")})}),b.length>0&&t("div",{className:"i-timepicker-list",children:t(en,{items:b,active:g.second,unit:"second",renderItem:u,onClick:e=>y(e,"second")})})]})}const an="hh:mm:ss";function rn(e){const{name:n,value:i,format:a=an,periods:r,placeholder:s=e.format??an,renderItem:l,onChange:o,onBlur:c,popupProps:u,...p}=e,h=ie({value:i,safeValue:void 0}),[g,v]=m(!1),f=e=>{h.value=e};return d((()=>{h.value=i}),[i]),t(lt,{visible:g,trigger:"click",position:"bottom",arrow:!1,align:"start",watchResize:!0,...u,onVisibleChange:e=>{u?.onVisibleChange?.(e),v(e)},content:t(nn,{value:h.value,format:a,periods:r,renderItem:l,onChange:f,onFallback:e=>{h.safeValue=e}}),children:t(Tt,{value:h.value,placeholder:s,append:t(Ne,{icon:t(_,{}),className:"i-timepicker-icon",size:"1em"}),onChange:f,onBlur:e=>{c?.(e),h.value&&(h.value=h.safeValue,f(h.safeValue))},...p})})}const sn={children:"确定"},ln={children:"取消",secondary:!0},on=n=>{const{trigger:i="click",visible:a,icon:r=t(Ne,{icon:t(J,{}),className:"error"}),content:s,okButtonProps:l,cancelButtonProps:o,children:c,align:d="end",position:u="top",offset:p=12,extra:m,onOk:h,onClose:g,...v}=n,f=ie({loading:!1,visible:a}),b=l?Object.assign({},sn,l):sn,y=o?Object.assign({},ln,o):ln,k=e("div",{className:"i-popconfirm",children:[e(dt,{gap:12,children:[r,t("div",{className:"i-popconfirm-content",children:s})]}),e(dt,{gap:12,justify:"flex-end",className:"mt-8 i-popconfirm-footer",children:[null!==o&&t(ke,{...y,onClick:async e=>{y.onClick?.(e),await(g?.()),f.visible=!1}}),m,null!==l&&t(ke,{loading:f.loading,...b,onClick:async e=>{f.loading=!0,b.onClick?.(e),h?.()?.then((()=>{f.visible=!1})).finally((()=>{f.loading=!1}))}})]})]});return t(lt,{content:k,...v,trigger:i,visible:f.visible,align:d,offset:p,position:u,onVisibleChange:e=>{f.visible=e,v.onVisibleChange?.(e)},children:c})};function cn(n){const{type:a="default",name:r,value:s,checked:l,disabled:o,children:c,onChange:d}=n;return e("label",{className:i("i-radio-item",{disabled:o}),children:[t("input",{type:"radio",name:r,checked:l,className:i("i-radio-input",`i-radio-${a}`),disabled:o,onChange:e=>{d?.(s,e)}}),t("span",{className:"i-radio-text",children:c})]})}function dn(n){const{label:a,name:r,options:s,value:l,type:o="default",status:c="normal",message:u,optionInline:p=!0,labelInline:m,disabled:g,required:v,className:f,onChange:b}=n,y=ie({value:l}),k=h((()=>Se(s)),[s]),N=(e,t)=>{y.value=e,b?.(e,t)};return d((()=>{y.value=l}),[l]),e("div",{className:i("i-radio i-input-label",{[`i-radio-${c}`]:"normal"!==c,"i-input-inline":m},f),children:[a&&e("span",{className:"i-input-label-text",children:[v&&t("span",{className:"error",children:"*"}),a,u&&t("p",{className:"i-radio-message",children:u})]}),t("div",{className:i("i-radio-options",{"i-options-block":!p,"i-radio-options-button":"button"===o}),children:k.map((e=>t(cn,{name:r,value:e.value,checked:y.value===e.value,type:o,disabled:g||e.disabled,onChange:N,children:e.label},e.value)))})]})}dn.Item=cn;const un=n=>{const{other:a,children:r,vertical:s,height:l,size:o="auto",minSize:c=0,maxSize:d="100%",style:u,line:p,className:m,asPercent:h,onResize:g,onResizeComplete:f}=n,b=ie({size:o,resizing:!1,start:0,total:0}),y=v(null),k=()=>{const e=y.current?.getBoundingClientRect();if(e){if(b.resizing=!0,s)return b.total=e.height,void(b.start=e.top);b.total=e.width,b.start=e.left}};return Ke((()=>{b.resizing&&(b.resizing=!1,f?.(b.size))})),Ge((e=>{if(!b.resizing)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const t=e[s?"pageY":"pageX"]-b.start;b.size=h?t/b.total*100+"%":t,g?.(b.size)})),e("div",{ref:y,className:i("i-resizable",m,{"i-resizable-vertical":s}),style:{...u,height:l},children:[t("div",{className:"i-resizable-a",style:{[s?"height":"width"]:b.size,[s?"minHeight":"minWidth"]:c,[s?"maxHeight":"maxWidth"]:d},children:a}),t("div",{className:i("i-resizable-line",{"i-resizable-resizing":b.resizing}),onMouseDown:k,onTouchStart:k,onContextMenu:e=>e.preventDefault(),children:t("div",{className:"i-resizable-line-node",children:p})}),t("div",{className:"i-resizable-b",children:r})]})};function pn(){return t("i",{className:"i-step-divider"})}const mn=["finished","active","pending"];function hn(e,n){return t("span",{className:"i-step-item-index",children:"finished"===n?t(G,{style:{width:"1em",height:"1.5em"}}):e+1})}function gn(a){const{index:r=0,active:s=0,renderIcon:l=hn,title:o,vertical:c,line:d=t(pn,{}),asList:u,style:p,className:m,children:h,onClick:g}=a,v=mn[r===s?1:r<s?0:2];return t("div",{style:p,className:i("i-step-item",{[`i-step-item-${v}`]:!u},m),onClick:()=>{g?.(r)},children:e(n,c?{children:[e("div",{className:"i-step-item-left",children:[l?.(r,v),d]}),e("div",{className:"i-step-item-right",children:[t("div",{className:"i-step-item-title",children:o}),h&&t("div",{className:"i-step-item-content",children:h})]})]}:{children:[e("div",{className:"i-step-item-title",children:[l?.(r,v),t("span",{children:o}),d]}),h&&t("div",{className:"i-step-item-content",children:h})]})})}const vn=e=>{const{active:n=0,vertical:a,renderIcon:r,line:s,style:l,asList:o,className:c,children:d,onClick:u}=e,p=h((()=>{const e=[];let t=0;return g.map(d,(i=>{if(!i||i.type!==gn)return;const{props:l}=i;e.push({...i,props:{renderIcon:r,line:s,onClick:u,...l,vertical:a,active:n,asList:o,index:t++}})})),e}),[n,d]);return t("div",{className:i("i-step",{"i-step-vertical":a},c),style:l,children:p})};function fn(e){const{index:n=0,active:a,type:r,transition:s,gap:l=0,itemHeight:o,vertical:c,style:d,className:u,children:p}=e,m=h((()=>"normal"===r?{[c?"paddingBlock":"paddingInline"]:l/2,height:o}:{transform:`translate(-${100*n}%, 0)`,transition:s}),[n,l,o,c,r]);return t("div",{style:{...d,...m},className:i("i-swiper-item",u,{"i-swiper-active":a}),"data-index":n,children:p})}vn.Item=gn;const bn=a=>{const{ref:r,type:s="normal",initial:l=0,display:o=1,scroll:c=1,loop:u=!0,vertical:p,prev:m=t(Ne,{icon:t(L,{}),size:"2em"}),next:f=t(Ne,{icon:t(H,{}),size:"2em"}),duration:b=600,interval:y=3e3,autoplay:k,pauseOnHover:C,arrow:w=!0,reverse:x,draggable:$,dragOffset:z=40,gap:T=0,itemHeight:P,indicator:D,style:S,className:I,children:M,renderIndicator:O,onBeforeSwipe:E,onAfterSwipe:j}=a,B=v(null),A=v(null),V=`all ${b/1e3}s`,Y=ie({current:l,swipable:!0,transition:"fade"===s?"none":V,dragStart:0,dragging:!1,initialized:!1}),W=h((()=>g.map(M,(e=>{if(e.type===fn)return e}))),[M]),[F,q,R,X,U]=h((()=>{const e="normal"===s&&u&&W.length>o?o+1:0;let t=[];if(e<=0)t=[...W];else{const n=W.slice(0,e);t=[...W.slice(-e),...W,...n]}const n=t.length/o*100+"%";return[t,e,W.length,t.length,n]}),[o,u,s,W]),G=h((()=>-100*(Y.current+q)/X),[Y.current,X]),K=h((()=>{if(R<=o||"fade"===s)return;return`translate3d(${p?`0, ${G}%`:`${G}%, 0`}, 0)`}),[G,p,o,R,s]),Z=h((()=>{if(p&&P)return{height:P*o}}),[p,P,o]),_=h((()=>Array.from({length:Math.ceil((R-o)/c)+1})),[u,D]),J=()=>{clearTimeout(A.current),A.current=null},Q=e=>{if(!Y.swipable||e===Y.current)return;Y.swipable=!1,E?.(Y.current);let t=!1,n=e;const i=R-o;return u?e>i?(t=!0,e=R,n=0):e<0&&(t=!0,e=-o,n=i):(n=Be(n,0,i),e=n),setTimeout((()=>{Y.swipable=!0}),b+32),"fade"===s?(Y.current=n,void j?.(n)):(Y.current=e,t?void setTimeout((()=>{Y.transition="none",Y.current=n,j?.(n),k&&(A.current=setTimeout(ee,y)),setTimeout((()=>{Y.transition=V}),60)}),b+20):(k&&(A.current=setTimeout(ee,y)),void setTimeout((()=>{j?.(n)}),b+12)))},ee=()=>{Q(x?Y.current-c:Y.current+c)},te=()=>{Q(x?Y.current+c:Y.current-c)},ne=e=>{$&&Y.swipable&&"fade"!==s&&(e.stopPropagation(),e.touches&&(e=e.touches[0]),Object.assign(Y,{dragStart:p?e.clientY:e.clientX,dragging:!0,transition:"none"}))};return Ge((e=>{if(!Y.dragging||!B.current)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const t=61.8*((p?e.clientY:e.clientX)-Y.dragStart)/B.current[p?"offsetHeight":"offsetWidth"]+G;B.current.style.transform=`translate3d(${p?`0, ${t}%`:`${t}%, 0`}, 0)`})),Ke((e=>{if(!Y.dragging||!B.current)return;e.changedTouches&&(e=e.changedTouches[0]);const t=p?e.clientY:e.clientX,n=B.current[p?"offsetHeight":"offsetWidth"]/X,i=.618*(t-Y.dragStart),a=Math.abs(i);if(a>z){const e=Math.floor(a/n)+(a%n-z>0?1:0);let t=Y.current+(i>0?-e:e);Q(t)}B.current.style.transform=K||"",Object.assign(Y,{dragging:!1,transition:V})})),N(r,(()=>({swipeTo:Q,swipeNext:ee,swipePrev:te}))),d((()=>{if(k)return A.current=setTimeout(ee,y),()=>{clearTimeout(A.current),A.current=null}}),[k,y]),e("div",{style:S,className:i("i-swiper",{"i-swiper-vertical":p,"i-swiper-initialized":Y.initialized},I),children:[e("div",{className:"i-swiper-track",style:Z,onMouseOver:()=>{C&&J()},onMouseLeave:()=>{C&&(J(),A.current=setTimeout(ee,y))},children:[t("div",{ref:B,className:i("i-swiper-list",{"i-swiper-fade":"fade"===s}),style:{[p?"height":"width"]:U,transform:K,transition:Y.transition},onMouseDown:ne,onTouchStart:ne,children:F.map(((e,n)=>{const{props:i}=e;return t(fn,{index:n,active:n-q===Y.current,type:s,gap:T,transition:V,itemHeight:P,vertical:p,...i},n)}))}),w&&e(n,{children:[t("a",{className:"i-swiper-arrow i-swiper-prev",onClick:te,children:m}),t("a",{className:"i-swiper-arrow i-swiper-next",onClick:ee,children:f})]})]}),D&&t("div",{className:"i-swiper-indicators",children:_.map(((e,n)=>t("a",{className:i("i-swiper-indicator",{"i-indicator-active":n===Math[u?"floor":"ceil"]((Y.current+R)%R/c)}),onClick:()=>Q(n*c),children:O?.(n)},n)))})]})};bn.Item=fn;const yn=n=>{const{ref:a,active:r,tabs:s,type:o="default",prepend:c,append:u,children:p,className:m,vertical:h,toggable:f,navsJustify:b="start",bar:y=!0,hideMore:k,barClass:C,renderMore:w=()=>t(ke,{flat:!0,square:!0,size:"small",children:t(Ne,{icon:t(X,{})})}),onTabChange:x,...$}=n,z=v([]),T=v(null),P=v(null),D=ie({active:r,prevActive:void 0,barStyle:{},cachedTabs:[],overflow:!1,more:[],tabs:[]}),{observe:S,unobserve:I}=Ze(),M=se(P);d((()=>{if(!s)return p?void(D.tabs=g.map(p,((e,t)=>{const{key:n,props:i}=e,{title:a,children:r,content:s,keepDOM:o}=i,c=r?"string"==typeof r?r:l(r,["props","type","$$typeof","ref"]):s;return{key:n||String(t),title:a,content:c,keepDOM:o}}))):void(D.tabs=[]);D.tabs=s.map(((e,t)=>["string","number"].includes(typeof e)?{key:e,title:e}:(void 0===e.key&&(e.key=t),e)))}),[p,s]);const O=e=>{const{key:t}=e,n=D.tabs.findIndex((e=>e.key===t));if(n>-1)return void j(D.tabs[n].key??n);const i=D.tabs.length,a=e.key??i;D.tabs.push({...e,key:a}),j(a)},E=e=>{const t=D.tabs.findIndex((t=>t.key===e));if(t<0)return;if(D.tabs.splice(t,1),D.active!==e)return;const n=D.tabs[t]||D.tabs[t-1];j(D.prevActive??n?.key??"")},j=e=>{if(e===D.active){if(!f)return;return x?.(void 0,e),D.active=void 0,void(D.barStyle={height:0,width:0})}D.prevActive=D.active,x?.(e,D.active),D.active=e},B=e=>{e.stopPropagation(),e.preventDefault(),h||P.current?.scrollBy({left:e.deltaY+e.deltaX})};return d((()=>{if(!M||k)return;const{scrollHeight:e,scrollWidth:t}=P.current,{width:n,height:i}=M;D.overflow=e>i||t>n,D.overflow&&z.current.map(((e,t)=>{e&&S(e,((e,n)=>{D.tabs[t]&&(D.tabs[t].intersecting=n,D.more=D.tabs.filter((e=>!e.intersecting)))}))}))}),[M,k,D.tabs.length]),d((()=>{if(!y||"pane"===o||void 0===D.active)return;const e=D.tabs.findIndex((e=>e.key===D.active));setTimeout((()=>{const t=z.current[e];if(!t)return;if(D.tabs[e].keepDOM&&D.active){D.cachedTabs.findIndex((e=>e===D.active))<0&&D.cachedTabs.unshift(D.active)}const{offsetHeight:n,offsetLeft:i,offsetTop:a,offsetWidth:r}=t,s="line"===o;D.barStyle={height:!h&&s?".25em":n,width:h&&s?".25em":r,transform:`translate(${i}px, ${a}px)`}}),16)}),[D.active,y]),d((()=>{void 0!==r&&D.active!==r&&j(r)}),[r]),d((()=>{if(!k)return()=>{z.current?.map(I)}}),[D.tabs.length]),d((()=>{if(P.current&&!h)return P.current.addEventListener("wheel",B,{passive:!1}),()=>{P.current&&P.current.removeEventListener("wheel",B)}}),[P.current]),N(a,(()=>({open:j,close:E,add:O,navs:P}))),e("div",{className:i("i-tabs",{flex:h,[`i-tabs-${o}`]:"default"!==o},m),...$,children:[e("div",{className:i("i-tab-navs-container",{"i-tab-navs-vertical":h}),children:[c,e("div",{ref:P,className:i("i-tab-navs",`justify-${b}`),children:[D.tabs.map(((n,a)=>{const{title:r,key:s=a,closable:l}=n;return e("a",{ref:e=>z.current[a]=e,className:i("i-tab-nav",{"i-tab-active":D.active===s}),onClick:()=>j(s),children:[r,l&&t(Ye,{as:"i",active:!0,className:"i-tab-nav-close",onClick:e=>{e.stopPropagation(),E(s)}})]},s)})),y&&t("span",{ref:T,className:i("i-tab-navs-bar",C),style:D.barStyle})]}),!k&&D.overflow&&D.more.length>0&&t(lt,{arrow:!1,position:h?"right":"bottom",align:"end",touchable:!0,hideDelay:500,content:t("div",{className:"i-tabs-morelist pd-4",children:D.more.map(((e,n)=>{const{key:a=n,title:r}=e,s=D.active===a;return t("a",{className:i("i-tab-nav",{"i-tab-active":s}),onClick:()=>j(a),children:r},a)}))}),children:w(D.more)}),u]}),t("div",{className:"i-tab-contents",children:D.tabs.map(((e,n)=>{const{key:a=n,content:r}=e,s=D.active===a;return(s||void 0!==a&&D.cachedTabs.includes(a))&&t("div",{className:i("i-tab-content",{"i-tab-active":s}),children:r},a)}))})]})};function kn(e){const{data:a=[],depth:r=0,round:s,style:l,className:o,parent:c,nodeProps:d,...u}=e,p=a.map(((e,n)=>{const{type:i}=e,a=e[d.title],s=e[d.key]||(void 0!==c?.key?`${c.key}-${n}`:`${n}`);return e.key=s,e.parent=c,"title"===i?t("div",{className:"i-tree-group-title",children:a},n):i&&"item"!==i?t("div",{className:`i-tree-type-${i}`,children:a},n):t(Cn,{index:n,item:e,depth:r,nodeProps:d,...u},s)}));return r>0?t(n,{children:p}):t("div",{className:i("i-tree",o,{"i-tree-round":s}),style:l,children:p})}yn.Item=e=>t(n,{});const Nn=e=>{const{as:n="a",href:a,selected:r,children:s,...l}=e,o=i("i-tree-item-header",{"i-tree-item-selected":r});return t(n,"string"==typeof n?{href:a,className:o,...l,children:s}:{to:a||"",className:o,...l,children:s})},Cn=n=>{const{item:a,depth:r=0,index:s,selected:l,checked:o=[],partofs:c={},checkable:d,nodeProps:u,renderExtra:p,onItemClick:h,onItemSelect:g,onItemCheck:v,...f}=n,{as:b,key:y="",href:k,icon:N,title:C,expanded:w,disabled:x}=a,$=a[u.children],[z,T]=m(w),P=(e,t)=>{t&&(e.preventDefault(),e.stopPropagation()),!x&&$?.length&&T((e=>!e))},D=o.includes(y);return e("div",{className:i("i-tree-item",{"i-tree-expand":z}),children:[e(Nn,{as:b,href:k,style:{paddingLeft:1.5*r+.5+"em"},selected:l===y,onClick:e=>{if(x)return e.preventDefault(),void e.stopPropagation();P(e),h?.(a,e),g?.(y,a)},children:[d&&t(Ve.Item,{value:D,partof:!D&&c[y],className:"i-tree-checkbox",onChange:e=>v?.(a,e,[]),onClick:e=>e.stopPropagation()}),N&&t("span",{className:"i-tree-item-icon",children:N}),t("span",{className:"i-tree-item-title",children:C}),p?.(a),$&&t(Ne,{icon:t(Q,{}),className:"i-tree-toggle",onClick:e=>P(e,!0)})]}),$?.length&&t("div",{className:"i-tree-item-content",children:t(kn,{data:$,depth:r+1,selected:l,checkable:d,parent:a,partofs:c,checked:o,nodeProps:u,renderExtra:p,onItemClick:h,onItemSelect:g,onItemCheck:v,...f})})]})},wn={key:"key",title:"title",children:"children"},xn=e=>{const{data:n=[],ref:i,selected:a,checked:r=[],disabledRelated:s,nodeProps:l,onItemSelect:o,onItemCheck:c,...u}=e,p=ie({selected:a,checked:r,partofs:{},nodeMaps:new Map}),m=Object.assign({},wn,l),h=e=>p.checked.includes(e||""),g=(e,t,n)=>{const{key:i="",parent:a,children:r}=e,l={[i]:t},o={[i]:!1};if(s)return[l];if(t){if(a&&"leaf"!==n){const e=a.children?.some((e=>e.key!==i&&!h(e.key))),[t,n]=g(a,!0,"root");e||Object.assign(l,t),Object.assign(o,e?n:{},{[a.key]:!0})}return r?.length&&"root"!==n&&r.map((e=>{if(h(e.key))return;const[t]=g(e,!0,"leaf");Object.assign(l,t),o[e.key]=!1})),[l,o]}if(a&&"leaf"!==n){const[e,t]=g(a,!1,"root");Object.assign(l,e);const n=a.children?.some((e=>h(e.key)&&e.key!==i));Object.assign(o,n?{}:t,{[a.key]:n,[i]:!1})}return r?.length&&"root"!==n&&r.map((e=>{const[t]=g(e,!1,"leaf");h(e.key)&&(Object.assign(l,t),o[e.key]=!1)})),[l,o]};return d((()=>{void 0!==a&&(p.selected=a)}),[a]),d((()=>{p.nodeMaps.clear();const{key:e,children:t}=m,i=n=>{n.map((n=>{p.nodeMaps.set(n[e],n),n[t]?.length>0&&i(n[t])}))};i(n)}),[n]),N(i,(()=>({getChecked:()=>{const e=[];return p.checked.map((t=>{const n=p.nodeMaps.get(t);e.push(n)})),[p.checked,e]},getSelected:()=>{const e=p.nodeMaps.get(p.selected);return[p.selected,e]},getPartofs:()=>{const e=[];return[Object.keys(p.partofs).filter((t=>{const n=p.partofs[t];if(n){const n=p.nodeMaps.get(t);e.push(n)}return n})),e]}}))),t(kn,{data:n,selected:p.selected,checked:p.checked,partofs:p.partofs,nodeProps:m,onItemCheck:(e,t)=>{const[n,i]=g(e,t),a=Object.keys(n);p.checked=t?Array.from(new Set([...p.checked,...a])):p.checked.filter((e=>!a.includes(e))),Object.assign(p.partofs,i),c?.(e,t,p.checked)},onItemSelect:(t,n)=>{e.selectable&&(p.selected=t,o?.(t,n))},...u})};function $n(i){const{mode:a,index:r,file:s,onRemove:l,onPreview:c}=i;if(!s)return"";const{name:d,size:u,url:p,src:m}=s,h=Ee(d,s.type),g=t(Ye,{active:!0,className:"i-upload-delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),l(r)}});if("card"===a){let i=t(n,{});switch(h){case ze.IMAGE:i=t($t,{lazyload:!0,src:p||m,fit:"cover",usePreview:!1});break;case ze.VIDEO:i=t("video",{src:p||m,preload:"none"});break;default:i=e(n,{children:[t(Ne,{icon:t(ee,{})}),t("span",{className:"i-upload-file-name",children:o(d)})]})}return e("div",{title:d,className:"i-upload-item-card",onClick:()=>c?.(r),children:[i,g]})}return e("div",{className:"i-upload-item",onClick:()=>c?.(r),children:[t("span",{children:d}),t("i",{className:"i-upload-size",children:je(u??0)}),g]})}const zn=n=>{const{ref:a,label:s,labelInline:l,value:o,files:c=[],placeholder:u,status:p="normal",message:m,className:g,style:b,children:y,mode:k="default",cardSize:C="4em",disabled:w,limit:x=(n.multiple?1/0:1),multiple:$,renderItem:z=$n,shouldUpload:T=()=>!0,uploader:P,onChange:D,onFilesChange:S,onUpload:I,...M}=n,O=ie({files:c,value:o,status:p,message:m,update:0}),E=v(null),j=xt(),B=h((()=>y||("card"===k?t(ke,{className:"i-upload-card-btn color-5",square:!0,flat:!0,outline:!0,disabled:w,children:t(Ne,{icon:t(ne,{})})}):e(ke,{className:"i-upload-btn",disabled:w,children:[t(Ne,{icon:t(te,{})})," Upload"]}))),[k,y]),A=e=>{const[...t]=O.files,n=t.splice(e,1);URL.revokeObjectURL(n[0]?.src||""),O.files=t,S?.(t,n),D?.(t),E.current&&(E.current.value="")},V=async e=>{P&&e.forEach((async e=>{if(!T(e))return;const t=await P(e),n=O.files.findIndex((e=>e.uid===t.uid));n>-1&&(O.files[n]=t),"completed"===t?.status&&I?.(t)}))},Y=e=>{j({items:O.files,initial:e})};d((()=>{Object.assign(O,{status:p,message:m})}),[p,m]),d((()=>{O.value=o}),[o]),N(a,(()=>({getFileList:()=>O.files})),[]);const{message:L,files:H}=O;return e(zt,{label:s,labelInline:l,className:i("i-input-label-file",g),style:b,children:[t("input",{...M,disabled:w,ref:E,type:"file",className:"i-input-file-hidden",multiple:$,onChange:e=>{const t=Array.from(e.target.files||[]),{files:n}=O,i=[];t.map((e=>{const{name:t,size:a,type:s}=e,l=n.find((e=>{const{name:n,size:i,type:r}=e;return n===t&&i===a&&r===s})),o=URL.createObjectURL(e);e.src=o,O.update+=1,Object.assign(e,{uid:r(7),src:e.src||e.name}),!l&&i.push(e)}));const a=[...n,...i];Object.assign(O,{files:$?a.slice(0,x):[a.at(-1)],status:p,message:m}),S?.(O.files,i,e),D?.(O.files,e),V(i),E.current&&(E.current.value="")}}),e("div",{className:i("i-upload-inner",{[`i-upload-${k}`]:"default"!==k}),style:{"--upload-card-size":C},children:[t("div",{className:"i-upload-list",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:H?.map(((e,n)=>t(f,{children:$n({index:n,file:e,mode:k,onRemove:A,onPreview:Y})},n)))}),L&&t("span",{className:"i-upload-message",children:L}),H.length<x&&B]})]})};export{we as Affix,xe as Badge,ke as Button,$e as Card,Ve as Checkbox,Le as Collapse,Xt as ColorPicker,nt as Datagrid,Qt as DatePicker,it as Description,at as Drawer,ct as Dropdown,dt as Flex,mt as Form,Ne as Icon,$t as Image,Tt as Input,rt as List,be as Loading,Bt as Message,gt as Modal,Vt as Pagination,on as Popconfirm,lt as Popup,kt as Progress,dn as Radio,un as Resizable,Wt as Select,vn as Step,bn as Swiper,yn as Tabs,Yt as Tag,ft as Text,rn as TimePicker,xn as Tree,zn as Upload,Nt as Video,xt as usePreview};
2
2
  //# sourceMappingURL=index.js.map