ono-react-element 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/AutoSliderList-CnWoRtlD.js +1 -0
- package/dist/es/AvatarCrop-C7WQ_IFH.js +1 -0
- package/dist/es/Checkbox-Bycqw4Bn.js +1 -0
- package/dist/es/FileDropZone-BYIzhRqM.js +1 -0
- package/dist/es/Input-CTZxreYT.js +1 -0
- package/dist/es/Modal-CeiK0vLA.js +1 -0
- package/dist/es/Radio-DVBUy-W_.js +1 -0
- package/dist/es/ScrollableTabs-DFUBXElA.js +1 -0
- package/dist/es/{Select-D5REq6YE.js → Select-DDAqi_ZE.js} +1 -1
- package/dist/es/SvgImg-BrKeInXs.js +1 -0
- package/dist/es/Switch-D91f6RGo.js +1 -0
- package/dist/es/VirtualList-_WSK1ci6.js +1 -0
- package/dist/es/Waterfall-CZKvZht-.js +1 -0
- package/dist/es/index.js +1 -1
- package/dist/umd/index.umd.cjs +412 -411
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +9 -9
- package/dist/es/AutoSliderList-CnR9cnHk.js +0 -1
- package/dist/es/AvatarCrop-ByE8oq-Y.js +0 -1
- package/dist/es/Checkbox-DI_pnI6U.js +0 -1
- package/dist/es/FileDropZone-DCvpaUuw.js +0 -1
- package/dist/es/Input-DnB8zvWy.js +0 -1
- package/dist/es/Modal-BbixgMNW.js +0 -1
- package/dist/es/Radio-CYirLPd9.js +0 -1
- package/dist/es/ScrollableTabs-yCB3QKsp.js +0 -1
- package/dist/es/SvgImg-DWqVwwgv.js +0 -1
- package/dist/es/Switch-uZtwu9mV.js +0 -1
- package/dist/es/VirtualList-DKHTLs7s.js +0 -1
- package/dist/es/Waterfall-BVjigHTI.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as re,jsxs as ae}from "react/jsx-runtime";import{c as ce}from "react/compiler-runtime";import{useGetElementSize as de,chainClassNames as X,forEach as me,pureNumber as Y}from "./index.js";import{useState as A,useRef as Z,useEffect as ee,cloneElement as fe}from "react";const we=(te)=>{const e=ce(51),{list:E,style:_,disable:s,children:l,sliderBox:$,className:j,sliderStyle:k,duration:J,sliderClassName:I,currentIndex:K,direction:M,sliderTransitionTimingFunction:O}=te,y=J===void 0 ? 300:J,w=K===void 0 ? 0:K,u=M===void 0 ? "Horizontal":M,se=O===void 0 ? "ease-in-out":O,[ie,oe]=A(!1),[t,P]=A(0);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={t:0,l:0},e[0]=x):x=e[0];const [Q,le]=A(x);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={w:0,h:0},e[1]=v):v=e[1];const [n,ne]=A(v),b=Z(null),U=Z(null),L=ie ? `translate ${y/1e3}s ${se}`:"initial",B=`${Q.l}px ${Q.t}px`;let g;e[2]!==n.h||e[3]!==n.w||e[4]!==L||e[5]!==B ?(g={width:n.w,height:n.h,transition:L,translate:B},e[2]=n.h,e[3]=n.w,e[4]=L,e[5]=B,e[6]=g):g=e[6];const D=g;let z;e[7]!==u||e[8]!==s||e[9]!==y||e[10]!==t ?(z=()=>{if(typeof t!="number"||!b.current||!U.current)return;const i=Array.from(b.current.children).slice(1);me(i,(p)=>{p.style.position="relative",p.style.cursor=s ? "not-allowed":"pointer",p.style.zIndex="1";});const h=window.getComputedStyle(b.current),o={t:u==="Horizontal" ? Y(h.paddingTop):i[t].offsetTop,l:u==="Horizontal" ? i[t].offsetLeft:Y(h.paddingLeft)};le(o),ne({w:i[t].offsetWidth,h:i[t].offsetHeight}),setTimeout(()=>oe(!0),y);},e[7]=u,e[8]=s,e[9]=y,e[10]=t,e[11]=z):z=e[11];const F=z,{w:G,h:R}=de();let N,S,C,H;e[12]!==w ?(N=()=>{P(w);},S=[w],e[12]=w,e[13]=N,e[14]=S):(N=e[13],S=e[14]),ee(N,S),e[15]!==F ?(C=()=>{F();},e[15]=F,e[16]=C):C=e[16],e[17]!==s||e[18]!==t||e[19]!==R||e[20]!==G ?(H=[t,G,R,s],e[17]=s,e[18]=t,e[19]=R,e[20]=G,e[21]=H):H=e[21],ee(C,H);const W=s ? "ono-auto-slider-list-is-disable":"";let r;e[22]!==j||e[23]!==W ?(r=X("ono-auto-slider-list-container",j,W),e[22]=j,e[23]=W,e[24]=r):r=e[24];const q=u==="Horizontal" ? "row":"column";let a,c,d,m,f,T;if(e[25]!==_||e[26]!==q ?(a={flexDirection:q,..._},e[25]=_,e[26]=q,e[27]=a):a=e[27],e[28]!==I ?(c=X("ono-auto-slider-list-slider",I),e[28]=I,e[29]=c):c=e[29],e[30]!==D||e[31]!==k ?(d={...k,...D},e[30]=D,e[31]=k,e[32]=d):d=e[32],e[33]!==$||e[34]!==c||e[35]!==d ?(m=re("li",{ref:U,className:c,style:d,children:$}),e[33]=$,e[34]=c,e[35]=d,e[36]=m):m=e[36],e[37]!==l||e[38]!==s||e[39]!==t||e[40]!==E){let i;e[42]!==l||e[43]!==s||e[44]!==t ?(i=(h,o)=>fe(l({item:h,index:o,isActive:o===t}),{onClick:(p)=>{if(s)return;const V=l({item:h,index:o,isActive:o===t}).props.onClick;V&&V(p),P(o);}}),e[42]=l,e[43]=s,e[44]=t,e[45]=i):i=e[45],f=E.map(i),e[37]=l,e[38]=s,e[39]=t,e[40]=E,e[41]=f;}else f=e[41];return e[46]!==r||e[47]!==a||e[48]!==m||e[49]!==f ?(T=ae("ul",{ref:b,className:r,style:a,children:[m,f]}),e[46]=r,e[47]=a,e[48]=m,e[49]=f,e[50]=T):T=e[50],T;};export{we as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as re,jsxs as me,Fragment as fe}from "react/jsx-runtime";import{c as de}from "react/compiler-runtime";import{useState as _,useRef as we,useEffect as he}from "react";import{forEach as ge,loadImage as ue}from "./index.js";const ve=(H)=>{const e=de(70),{imageFile:u,cvsW:J,maskBG:K,border:O,wheelScale:Q,setCtx:R,maskInfo:o,setMaskInfo:v,imageStartState:I,setImageStartState:$,imageState:t,setImageState:a}=H,V=J===void 0 ? 520:J,M=K===void 0 ? "rgba(0,0,0,0.5)":K,w=O===void 0 ? "4px solid #fff":O,F=Q===void 0 ? 0.1:Q,[r,c]=_();let X;e[0]===Symbol.for("react.memo_cache_sentinel")?(X={w:0,h:0},e[0]=X):X=e[0];const [h,ce]=_(X);let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S={w:0,h:0},e[1]=S):S=e[1];const [i,j]=_(S);let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k={x:0,y:0},e[2]=k):k=e[2];const [m,b]=_(k),[p,W]=_(!1),L=we(null),x=we(null),s=Se;let d,y,Y;if(e[3]!==w||e[4]!==u||e[5]!==R||e[6]!==$||e[7]!==a||e[8]!==v){let l;y=()=>{if(!L.current)return;const{width:n}=L.current.getBoundingClientRect();C(n),ce({w:n,h:n});},e[11]!==w ?(l=()=>{const n=w.split(" ");let g=0;return ge(n,(N)=>{N.includes("px")&&(g=Number(N.split("px")[0]));}),g;},e[11]=w,e[12]=l):l=e[12],d=l;const C=async(n)=>{const g=await ue(u);let N,B=g.width,D=g.height;B>D ?(N=B/n,B=n,D/=N,s({w:D},v)):(N=D/n,D=n,B/=N,s({w:B},v));const ne=(n-B)/2,se=(n-D)/2;s({w:g.width,h:g.height},j),c(g),s({w:B,h:D,t:se,l:ne},a),$({w:B,h:D,t:se,l:ne}),s(ne>se ?{l:ne}:{l:se},v),R(x.current?.getContext("2d"));};e[3]=w,e[4]=u,e[5]=R,e[6]=$,e[7]=a,e[8]=v,e[9]=d,e[10]=y;}else d=e[9],y=e[10];e[13]!==t.h||e[14]!==t.l||e[15]!==t.t||e[16]!==t.w||e[17]!==o.l||e[18]!==o.w||e[19]!==a ?(Y=()=>{W(!1),t.l>o.l&&s({l:o.l},a),t.t>o.l&&s({t:o.l},a),-t.l>t.w-o.l-o.w&&s({l:-(t.w-o.l-o.w)},a),-t.t>t.h-o.l-o.w&&s({t:-(t.h-o.l-o.w)},a);},e[13]=t.h,e[14]=t.l,e[15]=t.t,e[16]=t.w,e[17]=o.l,e[18]=o.w,e[19]=a,e[20]=Y):Y=e[20];const f=Y;let G;e[21]!==I.w||e[22]!==i.w||e[23]!==F ?(G=(l,C)=>{let n=l+(C==="in" ? l*F:-l*F);return n>i.w&&(n=i.w),n<I.w&&(n=I.w),n;},e[21]=I.w,e[22]=i.w,e[23]=F,e[24]=G):G=e[24];const T=G;let E;e[25]!==T||e[26]!==t.w||e[27]!==i.h||e[28]!==i.w||e[29]!==f||e[30]!==a ?(E=(l)=>{l.preventDefault(),l.stopPropagation();const C=l.deltaY<0 ? "in":"out",n=T(t.w,C),g=n/i.w;s({w:n,h:i.h*g},a),f();},e[25]=T,e[26]=t.w,e[27]=i.h,e[28]=i.w,e[29]=f,e[30]=a,e[31]=E):E=e[31];const U=E;let Z,ee,te,ae;e[32]!==y ?(Z=()=>{y();},e[32]=y,e[33]=Z):Z=e[33],e[34]===Symbol.for("react.memo_cache_sentinel")?(ee=[L],e[34]=ee):ee=e[34],he(Z,ee),e[35]!==r||e[36]!==t.h||e[37]!==t.l||e[38]!==t.t||e[39]!==t.w ?(te=()=>{if(!x.current||!r)return;const l=x.current.getContext("2d");l&&(l.clearRect(0,0,x.current.width,x.current.height),l.drawImage(r,t.l,t.t,t.w,t.h));},e[35]=r,e[36]=t.h,e[37]=t.l,e[38]=t.t,e[39]=t.w,e[40]=te):te=e[40],e[41]!==r||e[42]!==t ?(ae=[x,r,t],e[41]=r,e[42]=t,e[43]=ae):ae=e[43],he(te,ae);const ie=p ? "grabbing":"grab";let q,oe,A,P,z,le;return e[44]!==V||e[45]!==ie ?(q={width:V,cursor:ie},e[44]=V,e[45]=ie,e[46]=q):q=e[46],e[47]===Symbol.for("react.memo_cache_sentinel")?(oe=(l)=>{s({x:l.clientX,y:l.clientY},b),W(!0);},e[47]=oe):oe=e[47],e[48]!==t.l||e[49]!==t.t||e[50]!==p||e[51]!==a||e[52]!==m ?(A=(l)=>{if(p){const C=l.clientX-m.x,n=l.clientY-m.y;(Math.abs(C)>10||Math.abs(n)>10)&&(s({t:t.t+n,l:t.l+C},a),s({x:l.clientX,y:l.clientY},b));}},e[48]=t.l,e[49]=t.t,e[50]=p,e[51]=a,e[52]=m,e[53]=A):A=e[53],e[54]!==h.h||e[55]!==h.w||e[56]!==A ?(P=re("canvas",{width:h.w,height:h.h,ref:x,onMouseDown:oe,onMouseMove:A}),e[54]=h.h,e[55]=h.w,e[56]=A,e[57]=P):P=e[57],e[58]!==w||e[59]!==d||e[60]!==r||e[61]!==M||e[62]!==o.w ?(z=r&&re("div",{className:"ono-avatar-mask",children:re("div",{style:{border:w,boxShadow:`${M}0 0 0 10000px`,width:`${o.w+2*d()}px`,height:`${o.w+2*d()}px`}})}),e[58]=w,e[59]=d,e[60]=r,e[61]=M,e[62]=o.w,e[63]=z):z=e[63],e[64]!==U||e[65]!==f||e[66]!==q||e[67]!==P||e[68]!==z ?(le=me("div",{ref:L,className:"ono-avatar-canvas",style:q,onWheel:U,onMouseUp:f,onMouseLeave:f,children:[P,z]}),e[64]=U,e[65]=f,e[66]=q,e[67]=P,e[68]=z,e[69]=le):le=e[69],le;};function Se(H,e){e((u)=>({...u,...H}));}const _e=(H)=>{const e=de(24),{imageFile:u,cvsW:J,maskBG:K,border:O,wheelScale:Q,children:R}=H,o=J===void 0 ? 520:J,v=K===void 0 ? "rgba(0,0,0,0.5)":K,I=O===void 0 ? "4px solid #fff":O,$=Q===void 0 ? 0.1:Q;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={w:0,h:0,t:0,l:0},e[0]=t):t=e[0];const [a,V]=_(t);let M;e[1]===Symbol.for("react.memo_cache_sentinel")?(M={w:0,h:0,t:0,l:0},e[1]=M):M=e[1];const [w,F]=_(M);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r={w:0,l:0},e[2]=r):r=e[2];const [c,X]=_(r),[h,ce]=_();let S;e[3]!==a ?(S=(W)=>{F({w:a.w,h:a.h,t:a.t,l:a.l}),W?.();},e[3]=a,e[4]=S):S=e[4];const i=S;let j;e[5]!==h||e[6]!==c ?(j=(W,L)=>{if(!h)return;const x=h.getImageData(c.l,c.l,c.w,c.w),s=document.createElement("canvas"),d=s.getContext("2d");if(s.width=c.w,s.height=c.w,!d)return;const{imageSaveType:y,dataSaveType:Y,quality:f}=L||{},G=y===void 0 ? "png":y,T=Y===void 0 ? "base64":Y,E=f===void 0 ? 100:f;d.putImageData(x,0,0,0,0,c.w,c.w),T==="base64" ? W(s.toDataURL(`image/${G}`,E/100)):T==="blob"&&s.toBlob((U)=>{if(U)return W(U);},`image/${G}`,E/100);},e[5]=h,e[6]=c,e[7]=j):j=e[7];const k=j;let m,b,p;return e[8]!==I||e[9]!==o||e[10]!==u||e[11]!==a||e[12]!==w||e[13]!==v||e[14]!==c||e[15]!==$ ?(m=re(ve,{imageFile:u,cvsW:o,maskBG:v,border:I,wheelScale:$,maskInfo:c,setMaskInfo:X,setCtx:ce,imageStartState:a,setImageStartState:V,imageState:w,setImageState:F}),e[8]=I,e[9]=o,e[10]=u,e[11]=a,e[12]=w,e[13]=v,e[14]=c,e[15]=$,e[16]=m):m=e[16],e[17]!==R||e[18]!==k||e[19]!==i ?(b=R?.({handleConfirm:k,handleReduction:i}),e[17]=R,e[18]=k,e[19]=i,e[20]=b):b=e[20],e[21]!==m||e[22]!==b ?(p=me(fe,{children:[m,b]}),e[21]=m,e[22]=b,e[23]=p):p=e[23],p;};export{_e as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as D}from "react/jsx-runtime";import{c as F}from "react/compiler-runtime";import{chainClassNames as G,forEach as H}from "./index.js";import{useState as R,useRef as I,useEffect as J}from "react";const T=(d)=>{const e=F(29),{id:r,style:n,checked:c,onChange:v,className:a,indeterminate:N,checkedColor:S,indeterminateStyle:$,indeterminateColor:E}=d,t=N!==void 0&&N,s=S===void 0 ? "#0077cc":S,j=$===void 0 ? "line":$,k=E===void 0 ? "#0077cc":E,[u,q]=R(""),o=I(null);let i,l,h;e[0]!==s ?(i={value:s,name:"checkedColor"},e[0]=s,e[1]=i):i=e[1],e[2]!==k ?(l={value:k,name:"indeterminateColor"},e[2]=k,e[3]=l):l=e[3],e[4]!==i||e[5]!==l ?(h=[i,l],e[4]=i,e[5]=l,e[6]=h):h=e[6];const b=h,z=K;let f;e[7]!==u||e[8]!==c||e[9]!==s||e[10]!==t||e[11]!==b ?(f=()=>{if(!o.current)return;const w=getComputedStyle(o.current);u||q(w.borderColor),o.current.style.height=w.width,H([{value:w.width,name:"w"},{value:c||t ? s:u,name:"border-color"},...b],(A)=>{const{value:P,name:B}=A;P&&z(P,B,o.current);});},e[7]=u,e[8]=c,e[9]=s,e[10]=t,e[11]=b,e[12]=f):f=e[12];const x=f;let p,y;e[13]!==t||e[14]!==x ?(p=()=>{x(),o.current&&(o.current.indeterminate=t);},e[13]=t,e[14]=x,e[15]=p):p=e[15],e[16]!==a||e[17]!==t||e[18]!==n ?(y=[o,a,n,t],e[16]=a,e[17]=t,e[18]=n,e[19]=y):y=e[19],J(p,y);const g=j==="line" ? "ono-checkbox-line":"ono-checkbox-border";let m,C;return e[20]!==a||e[21]!==g ?(m=G(a,g),e[20]=a,e[21]=g,e[22]=m):m=e[22],e[23]!==c||e[24]!==r||e[25]!==v||e[26]!==n||e[27]!==m ?(C=D("input",{id:r,type:"checkbox",ref:o,checked:c,onChange:v,className:m,style:n}),e[23]=c,e[24]=r,e[25]=v,e[26]=n,e[27]=m,e[28]=C):C=e[28],C;};function K(d,e,r){typeof d=="string" ? r.style.setProperty(`--${e}`,d):r.style.setProperty(`--${e}`,`${d}px`);}export{T as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as j,Fragment as A,jsx as w}from "react/jsx-runtime";import{chainClassNames as N,forEach as g}from "./index.js";import{useState as G,useRef as R}from "react";const q=({isBox:s=!1,multiple:h=!1,children:o,allowFileType:S="image",style:y={},className:D="",isCanClick:T=!0,getFileListData:b,onFileTypeError:p,readingAnimationOptions:a})=>{const [r,C]=G(!1),v=R(null);let c=0,f=[],m=[],l=[],F=[];const E=S==="all" ? ["image","video","audio","document","directory"]:S,O=(e)=>{const i=[];g(l,(n)=>i.push({name:n.name,fileType:"directory",file:"",isFile:!1,fileSize:0,children:[],parent:""}));for(let n=0;n<i.length;n++)for(let t=0;t<e.length;t++)e[t].parent===i[n].name&&e[t].name!==".DS_Store"&&i[n].children.push(e[t]);i.length===0&&i.push(...e),b(i),f=[],c=0,m=[],l=[],F=[],C(!1);},u=(e,i="")=>{if(e.isDirectory){if(!E.includes("directory"))return p&&p();const n=e.createReader(),t=(k)=>k.readEntries((x)=>{let z=0;g(x,(d)=>{z++,d.isDirectory&&u(d);}),m.push(...x),F.includes(e.name)||(l.push(e),F.push(e.name)),z>=100 ? t(k):g(m,(d)=>u(d,e.name));});t(n);}else e.file((n)=>{if(!E.includes(n.type.split("/")[0])&&n.name!==".DS_Store")return p&&p();f.push({name:n.name,fileType:n.type,file:n,isFile:!0,fileSize:n.size,children:[],parent:i});const t=c>=l.length&&l.length===0 ? c:m.length;f.length===t&&O(f);});};return j(A,{children:[w("input",{ref:v,type:"file",style:{display:"none"},multiple:h,value:"",onChange:(e)=>{const i=[...e.target.files],n=[];C(!0),g(i,(t)=>n.push({name:t.name,fileType:t.type,file:t,isFile:!0,fileSize:t.size,children:[],parent:""})),O(n);}}),w("div",{className:N("ono-file-process-container",s ? "ono-file-process-container-box":"",typeof D=="string" ? D:D(r)),style:{justifyContent:s&&!o ? "center":"initial",cursor:s&&T ? r ? "not-allowed":"pointer":"",...y instanceof Function ? y(r):y},onClick:()=>{if(s&&T){if(r&&a?.readingCannotOperattion)return;v.current.click();}},onDragEnter:(e)=>e.preventDefault(),onDragOver:(e)=>e.preventDefault(),onDrop:(e)=>{if(e.preventDefault(),!r||!a?.readingCannotOperattion)if(c=h ? e.dataTransfer.items.length:1,C(!0),h)for(const i of e.dataTransfer.items)u(i.webkitGetAsEntry());else u(e.dataTransfer.items[0].webkitGetAsEntry());},children:s ? o ? r&&a?.readingCannotOperattion ? a?.animations||"正在读取文件...":o:r&&a?.readingCannotOperattion ? a?.animations||"正在读取文件...":"请将要上传的文件拖拽到此处":o})]});};export{q as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as A,jsx as c,Fragment as Le}from "react/jsx-runtime";import{c as ge}from "react/compiler-runtime";import{chainClassNames as he,forEach as ze,useKeyPress as Se}from "./index.js";import{forwardRef as we,useState as S,useRef as Ce,useEffect as oe}from "react";const Fe=()=>{const d=ge(1);let a;return d[0]===Symbol.for("react.memo_cache_sentinel")?(a=c("svg",{className:"ono-input-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",fill:"currentColor","aria-hidden":"true",children:c("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})}),d[0]=a):a=d[0],a;},Ke=(d)=>{const a=ge(5),{open:e}=d,p=e ? "eye":"eye-invisible";let u,f;return a[0]!==e ?(u=e ? c("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}):A(Le,{children:[c("path",{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}),c("path",{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"})]}),a[0]=e,a[1]=u):u=a[1],a[2]!==p||a[3]!==u ?(f=c("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":p,fill:"currentColor","aria-hidden":"true",className:"ono-input-icon",children:u}),a[2]=p,a[3]=u,a[4]=f):f=a[4],f;},Oe=we((d,a)=>{const e=ge(67),{id:p,name:u,max:f,min:H,maxLength:v,minLength:I,type:ne,className:T,defaultValue:G,placeholder:F,readonly:b,autocomplete:te,autofocus:K,form:J,disabled:m,clearable:C,showPassword:ae,prepend:M,append:P,prefix:k,suffix:y,showCount:g,border:N,boxShadow:re,value:X,onChange:x,onFocus:Z,onBlur:L,onClear:B,onKeyUp:t,onKeyDown:E}=d,xe=ne===void 0 ? "text":ne,n=te===void 0 ? "off":te,o=N===void 0 ? "1px solid #5644b8":N,s=re===void 0 ? "0 0 0 2px #7969d11a":re,i=X===void 0 ? "":X,[l,r]=S(i),[h,w]=S(!1),[z,Ne]=S(!1),ee=Ce(null),se=C&&!m&&l,le=ae&&!m;let ce;e[0]!==o||e[1]!==s ?(ce=()=>{ee.current&&(ee.current.style.setProperty("--ono-input-border",o),ee.current.style.setProperty("--ono-input-box-shadow",s));},e[0]=o,e[1]=s,e[2]=ce):ce=e[2];const fe=ce;let ie,de,ue,pe;e[3]!==fe ?(ie=()=>{fe();},e[3]=fe,e[4]=ie):ie=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(de=[ee],e[5]=de):de=e[5],oe(ie,de),e[6]!==i ?(pe=()=>{r(i);},ue=[i],e[6]=i,e[7]=ue,e[8]=pe):(ue=e[7],pe=e[8]),oe(pe,ue);const ye=m ? "ono-input-is-disabled":"";let O,R;e[9]!==ye ?(O=he("ono-input","ono-input-border",ye),e[9]=ye,e[10]=O):O=e[10],e[11]!==M ?(R=M&&c("div",{className:"ono-prepend",children:M}),e[11]=M,e[12]=R):R=e[12];const ve=h ? "ono-input-is-focus":"";let U,q;e[13]!==T||e[14]!==ve ?(U=he("ono-input-wrapper",ve,T),e[13]=T,e[14]=ve,e[15]=U):U=e[15],e[16]!==k ?(q=k&&c("span",{className:"ono-prefix",children:k}),e[16]=k,e[17]=q):q=e[17];const be=ae ? z ? "text":"password":xe;let Y,_,j,D,Q,V,W,me;return e[18]!==Z ?(Y=($)=>{Z?.($),w(!0);},e[18]=Z,e[19]=Y):Y=e[19],e[20]!==L ?(_=($)=>{L?.($),w(!1);},e[20]=L,e[21]=_):_=e[21],e[22]!==x ?(j=($)=>{x?.($),r($.target.value);},e[22]=x,e[23]=j):j=e[23],e[24]!==n||e[25]!==K||e[26]!==G||e[27]!==m||e[28]!==J||e[29]!==p||e[30]!==l||e[31]!==f||e[32]!==v||e[33]!==H||e[34]!==I||e[35]!==u||e[36]!==E||e[37]!==t||e[38]!==F||e[39]!==b||e[40]!==a||e[41]!==be||e[42]!==Y||e[43]!==_||e[44]!==j ?(D=c("input",{id:p,ref:a,max:f,min:H,name:u,maxLength:v,minLength:I,defaultValue:G,className:"ono-input-inner",type:be,placeholder:F,readOnly:b,autoComplete:n,autoFocus:K,form:J,disabled:m,onFocus:Y,onBlur:_,value:l,onChange:j,onKeyUp:t,onKeyDown:E}),e[24]=n,e[25]=K,e[26]=G,e[27]=m,e[28]=J,e[29]=p,e[30]=l,e[31]=f,e[32]=v,e[33]=H,e[34]=I,e[35]=u,e[36]=E,e[37]=t,e[38]=F,e[39]=b,e[40]=a,e[41]=be,e[42]=Y,e[43]=_,e[44]=j,e[45]=D):D=e[45],e[46]!==z||e[47]!==l||e[48]!==v||e[49]!==B||e[50]!==se||e[51]!==g||e[52]!==le||e[53]!==y ?(Q=(y||se||le||g)&&A("span",{className:"ono-suffix",children:[y,se&&c("button",{className:"ono-clear-icon",onClick:()=>{B?.(),r("");},children:c(Fe,{})}),le&&c("button",{className:"ono-eye-icon",onClick:()=>Ne(!z),children:c(Ke,{open:z})}),g&&v&&A("p",{className:"ono-count",children:[l.length,"/",v]})]}),e[46]=z,e[47]=l,e[48]=v,e[49]=B,e[50]=se,e[51]=g,e[52]=le,e[53]=y,e[54]=Q):Q=e[54],e[55]!==U||e[56]!==q||e[57]!==D||e[58]!==Q ?(V=A("div",{ref:ee,className:U,onMouseDown:Me,children:[q,D,Q]}),e[55]=U,e[56]=q,e[57]=D,e[58]=Q,e[59]=V):V=e[59],e[60]!==P ?(W=P&&c("div",{className:"ono-append",children:P}),e[60]=P,e[61]=W):W=e[61],e[62]!==O||e[63]!==R||e[64]!==V||e[65]!==W ?(me=A("div",{className:O,children:[R,V,W]}),e[62]=O,e[63]=R,e[64]=V,e[65]=W,e[66]=me):me=e[66],me;});function Me(d){d.target.tagName!=="INPUT"&&d.preventDefault();}const Re=we(({id:d,name:a,rows:e,maxLength:p,minLength:u,className:f,placeholder:H,readonly:v,resize:I=!0,autocomplete:ne="off",autofocus:T,form:G,disabled:F,autoSize:b,showCount:te,border:K="1px solid #5644b8",boxShadow:J="0 0 0 2px #7969d11a",value:m="",onChange:C,onFocus:ae,onBlur:M,onKeyUp:P,onKeyDown:k},y)=>{const [g,N]=S(m),[re,X]=S(!1),[x,Z]=S([m]),[L,B]=S(0),t=Ce(null),E=(n)=>{const o=x.slice(0,L+1);o.push(n),Z(o),B(o.length-1);};return ze([{key:"CommandOrControl+z",handler:(n)=>{document.activeElement===t.current&&(n.preventDefault(),(()=>{if(L>0&&t.current){const o=L-1,s=x[o];if(t.current.value=s,N(s),B(o),C){const i={target:t.current};C(i);}}})());},deps:[x]},{key:"CommandOrControl+d",handler:(n)=>{if(t.current&&document.activeElement===t.current){n.preventDefault();const o=((s)=>{const{value:i,selectionStart:l,selectionEnd:r}=s,h=i.substring(0,l)+i.substring(r);return s.value=h,s.setSelectionRange(l,l),h;})(t.current);if(N(o),E(o),C){const s={target:t.current};C(s);}}},deps:[x]}],({key:n,handler:o,deps:s})=>Se(n,o,{target:t.current,deps:s})),oe(()=>{N(m);},[m]),oe(()=>{(()=>{if(!t.current)return;const n=t.current;((o,s,i,l,r)=>{const h=o.parentNode;o.style.resize=s ? "none":i ? "vertical":"none",h.style.setProperty("--ono-input-border",l),h.style.setProperty("--ono-input-box-shadow",r),h.style.setProperty("--ono-input-height","auto");})(n,b||!1,I,K,J),b&&((o,s)=>{const{minRows:i=2,maxRows:l}=typeof s=="object" ? s:{},r=document.createElement("div");r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="pre-wrap",r.style.wordWrap="break-word",r.style.width=`${o.clientWidth}px`,r.style.font=getComputedStyle(o).font,r.style.padding=getComputedStyle(o).padding,r.style.border=getComputedStyle(o).border,r.style.boxSizing="border-box",document.body.appendChild(r);const h=34*i;let w=h;if(o.value){r.textContent=o.value;const z=r.offsetHeight;w=Math.max(h,z),l&&w>34*l ?(w=34*l,o.style.overflowY="auto"):o.style.overflowY="hidden";}else o.style.overflowY="hidden";o.style.height=`${w}px`,o.style.resize=s ? "none":"vertical",document.body.removeChild(r),Math.floor(w/34);})(n,b);})();},[t,b,g]),oe(()=>{y&&t.current&&(y instanceof Function ? y(t.current):y.current=t.current);},[y,t]),A("div",{className:he("ono-textarea",F ? "ono-input-is-disabled":""),children:[c("div",{className:he("ono-textarea-wrapper",re ? K==="none" ? "":"ono-input-is-focus":"",f),onClick:()=>t.current?.focus(),children:c("textarea",{ref:t,className:"ono-textarea-inner",id:d,rows:e,name:a,maxLength:p,minLength:u,placeholder:H,readOnly:v,autoComplete:ne,autoFocus:T,form:G,disabled:F,onFocus:(n)=>{ae?.(n),X(!0);},onBlur:(n)=>{M?.(n),X(!1);},value:g,onChange:(n)=>{N(n.target.value),E(n.target.value),C?.(n);},onKeyUp:P,onKeyDown:k})}),te&&p&&c("p",{className:"ono-count-bar",onClick:(n)=>n.stopPropagation(),children:g.length+"/"+p})]});});export{Oe as O,Re as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as c,Fragment as M}from "react/jsx-runtime";import{portalRenderer as N,adjustingColors as m,chainClassNames as F,forEach as H}from "./index.js";import{useState as L,useRef as v,useEffect as C}from "react";import{B as y}from "./Button-CGyWgrQj.js";const O=({title:d="This is a modal title",icon:B,content:g="This is a modal content",okText:w="confirm",cancelText:k="cancel",confirmDisabled:P,cancelDisabled:T,startPosition:t,onConfirm:j,onCancel:z,mask:h=!0,maskClosable:D=!1,width:f,btnClr:a,footer:u=({OkBtn:s,CancelBtn:i})=>c(M,{children:[o(i,{}),o(s,{})]}),modalBody:b,destroy:x})=>{const [s,i]=L(!1),l=v(null),n=v(null),E=[{label:"themeColor",value:a||""},{label:"themeHoverColor",value:a&&m(a,"light",10)||""},{label:"themeActiveColor",value:a&&m(a,"dark",20)||""},{label:"themeDisabledClr",value:a&&m(a,"light",20)||""}],r=()=>{if(t){if(!n.current)return;n.current.classList.remove("ono-modal-enter"),n.current.classList.add("ono-modal-leave"),setTimeout(()=>{x();},300);}else x();};return C(()=>(l.current&&(h ? l.current.showModal():l.current.show()),()=>{l.current&&l.current.close();}),[l.current,h]),C(()=>{(()=>{if(!n.current)return;const e=n.current.style;f&&e.setProperty("--width",f+"px"),t&&(e.setProperty("--left",(t.x/window.innerWidth*100).toFixed(2)+"%"),e.setProperty("--top",(t.y/window.innerHeight*100).toFixed(2)+"%")),a&&H(E,(p)=>e.setProperty(`--${p.label}`,p.value));})();},[n]),o("dialog",{ref:l,className:"ono-modal",onClick:()=>D&&r(),children:b ? b(r):c("div",{ref:n,className:F("ono-modal-box",t ? "ono-modal-enter":""),onClick:(e)=>e.stopPropagation(),children:[c("div",{className:"ono-modal-box-body",children:[B ?? o("div",{className:"ono-modal-box-body-icon",children:o("svg",{color:"#faad14",viewBox:"64 64 896 896",focusable:"false","data-icon":"exclamation-circle",width:"22px",height:"22px",fill:"currentColor","aria-hidden":"true",style:{marginInlineEnd:"12px"},children:o("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})})}),c("div",{className:"ono-modal-box-body-contentBar",children:[o("h1",{className:"ono-modal-box-body-contentBar-title",children:d}),o("p",{className:"ono-modal-box-body-contentBar-content",children:g})]})]}),u&&o("div",{className:"ono-modal-box-footer",children:u({OkBtn:()=>o(y,{className:"ono-modal-box-footer-confirmBtn",loading:s,disabled:P,onClick:async()=>{i(!0);try{const e=j?.();e instanceof Promise&&await e;}finally{i(!1),r();}},children:w ?? "Confirm"}),CancelBtn:()=>o(y,{className:"ono-modal-box-footer-cancelBtn",disabled:T||s,onClick:()=>{z?.(),r();},children:k ?? "Cancel"}),handleClose:()=>r()})})]})});},V=(d)=>N(O,d,"ono-modal");export{V as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as R,jsxs as V}from "react/jsx-runtime";import{c as L}from "react/compiler-runtime";import{chainClassNames as M,forEach as X}from "./index.js";import{useState as Y,useRef as J,useEffect as Z}from "react";const ee=(C)=>{const e=L(41),{name:n,value:l,style:f,checked:o,onChange:k,children:d,className:b,radioW:j,radioGap:E,checkedColor:P,unCheckedColor:i,disabled:v}=C,u=j===void 0 ? 16:j,m=E===void 0 ? 4:E,a=P===void 0 ? "#532ce1":P,h=i===void 0 ? "transparent":i,t=v!==void 0&&v,[r,g]=Y(""),y=J(null),x=J(null),p=J(null);let c,s,N,w,_;e[0]!==u ?(c={value:u,name:"w"},e[0]=u,e[1]=c):c=e[1],e[2]!==m ?(s={value:m,name:"gap"},e[2]=m,e[3]=s):s=e[3],e[4]!==a ?(N={value:a,name:"checkedColor"},e[4]=a,e[5]=N):N=e[5],e[6]!==h ?(w={value:h,name:"unCheckedColor"},e[6]=h,e[7]=w):w=e[7],e[8]!==c||e[9]!==s||e[10]!==N||e[11]!==w ?(_=[c,s,N,w],e[8]=c,e[9]=s,e[10]=N,e[11]=w,e[12]=_):_=e[12];const A=_,O=oe;let $;e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==A ?($=()=>{if(!p.current||!x.current)return;X(A,(T)=>{const{value:K,name:U}=T;K&&O(K,U,x.current);});const Q=getComputedStyle(p.current);r||g(Q.borderColor),p.current.style.borderColor=o ? a:r;},e[13]=r,e[14]=o,e[15]=a,e[16]=A,e[17]=$):$=e[17];const B=$;let D,F,G,q;e[18]!==B ?(D=()=>{B();},e[18]=B,e[19]=D):D=e[19],e[20]!==r||e[21]!==o ?(F=[x,p,o,r],e[20]=r,e[21]=o,e[22]=F):F=e[22],Z(D,F),e[23]!==b ?(G=M("ono-radio-box",b),e[23]=b,e[24]=G):G=e[24],e[25]===Symbol.for("react.memo_cache_sentinel")?(q=()=>y.current?.click(),e[25]=q):q=e[25];const H=l+"",I=l+""+d;let S,W,z;return e[26]!==o||e[27]!==t||e[28]!==n||e[29]!==k||e[30]!==H||e[31]!==I ?(S=R("div",{ref:p,className:"ono-radio",onClick:q,children:R("input",{type:"radio",name:n,ref:y,value:H,checked:o,disabled:t,id:I,onChange:k})}),e[26]=o,e[27]=t,e[28]=n,e[29]=k,e[30]=H,e[31]=I,e[32]=S):S=e[32],e[33]!==d||e[34]!==l ?(W=d&&R("label",{htmlFor:l+""+d||"",children:d}),e[33]=d,e[34]=l,e[35]=W):W=e[35],e[36]!==f||e[37]!==G||e[38]!==S||e[39]!==W ?(z=V("div",{ref:x,className:G,style:f,children:[S,W]}),e[36]=f,e[37]=G,e[38]=S,e[39]=W,e[40]=z):z=e[40],z;};function oe(C,e,n){const l=typeof C=="number";n.style.setProperty(`--${e}`,l ? `${C}px`:C);}const te=(C)=>{const e=L(25),{name:n,style:l,options:f,onChange:o,className:k,radioW:d,radioGap:b,labelPosition:j,checkedColor:E,unCheckedColor:P,value:i}=C,v=d===void 0 ? 16:d,u=b===void 0 ? 4:b,m=j===void 0 ? "right":j,a=E===void 0 ? "#532ce1":E,h=P===void 0 ? "transparent":P;let t,r,g;if(e[0]!==k ?(t=M("ono-radio-group",k),e[0]=k,e[1]=t):t=e[1],e[2]!==a||e[3]!==m||e[4]!==n||e[5]!==o||e[6]!==f||e[7]!==u||e[8]!==v||e[9]!==i||e[10]!==h){let y;e[12]!==a||e[13]!==m||e[14]!==n||e[15]!==o||e[16]!==u||e[17]!==v||e[18]!==i||e[19]!==h ?(y=(x)=>{const{label:p,value:c,disabled:s}=x;return R(ee,{name:n,value:c,radioW:v,radioGap:u,style:{flexDirection:m==="left" ? "row-reverse":"row"},checkedColor:a,unCheckedColor:h,onChange:()=>o(c),checked:i+""==c+"",disabled:typeof s=="function" ? s(i):s||!1,children:p},p);},e[12]=a,e[13]=m,e[14]=n,e[15]=o,e[16]=u,e[17]=v,e[18]=i,e[19]=h,e[20]=y):y=e[20],r=f.map(y),e[2]=a,e[3]=m,e[4]=n,e[5]=o,e[6]=f,e[7]=u,e[8]=v,e[9]=i,e[10]=h,e[11]=r;}else r=e[11];return e[21]!==l||e[22]!==t||e[23]!==r ?(g=R("div",{className:t,style:l,children:r}),e[21]=l,e[22]=t,e[23]=r,e[24]=g):g=e[24],g;};export{ee as R,te as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as I}from "react/jsx-runtime";import{c as j}from "react/compiler-runtime";import{chainClassNames as R,forEach as z}from "./index.js";import{forwardRef as B,useState as D,useRef as F,useEffect as A}from "react";const G=(L)=>{const t=j(10),{children:e,disabled:r,className:o,style:d,onClick:a}=L;let n,l,s;return t[0]!==o ?(n=R("ono-scrollable-tab",o),t[0]=o,t[1]=n):n=t[1],t[2]!==r||t[3]!==a ?(l=(c)=>!r&&a?.(c),t[2]=r,t[3]=a,t[4]=l):l=t[4],t[5]!==e||t[6]!==d||t[7]!==n||t[8]!==l ?(s=I("li",{className:n,style:d,onClick:l,children:e}),t[5]=e,t[6]=d,t[7]=n,t[8]=l,t[9]=s):s=t[9],s;},O=B((L,t)=>{const e=j(26),{activeIndex:r,children:o,className:d,style:a,position:n,onChange:l}=L,s=n===void 0 ? "center":n,[c,E]=D(0),u=F(null);let g;e[0]!==l ?(g=(f)=>{u.current&&Array.from(u.current.children).some((x,i)=>{if(x.contains(f.target))return E(i),l?.(i),!0;});},e[0]=l,e[1]=g):g=e[1];const v=g;let y,b,C,k,N,S,m,h,W;return e[2]!==r||e[3]!==c||e[4]!==s||e[5]!==a?.gap ?(y=()=>{const f=u.current;if(!f||c<0)return;const x=f.offsetWidth,i=Array.from(f.children);if(c>=i.length)return;const w=parseInt((a?.gap||getComputedStyle(f).gap||"0").toString(),10)||0;let p=0;z(i.slice(0,c+1),(q)=>(p+=q.offsetWidth+w,p));e:switch(s){case "start":f.scrollLeft=p-i[c].offsetWidth-w;break e;case "end":f.scrollLeft=p-x;break e;default:p-=i[c].offsetWidth/2+(r!==i.length-1 ? w:0),f.scrollLeft=p-x/2;}},e[2]=r,e[3]=c,e[4]=s,e[5]=a?.gap,e[6]=y):y=e[6],e[7]!==r||e[8]!==o||e[9]!==s ?(b=[u,o,r,s],e[7]=r,e[8]=o,e[9]=s,e[10]=b):b=e[10],A(y,b),e[11]!==r ?(C=()=>{E(r||0);},k=[r],e[11]=r,e[12]=C,e[13]=k):(C=e[12],k=e[13]),A(C,k),e[14]!==t ?(N=()=>{t&&(typeof t=="function" ? t(u.current):t.current=u.current);},S=[t],e[14]=t,e[15]=N,e[16]=S):(N=e[15],S=e[16]),A(N,S),e[17]!==d ?(m=R("ono-scrollable-tabs",d),e[17]=d,e[18]=m):m=e[18],e[19]!==o ?(h=o(G),e[19]=o,e[20]=h):h=e[20],e[21]!==v||e[22]!==a||e[23]!==h||e[24]!==m ?(W=I("ul",{ref:u,className:m,style:a,onClick:v,children:h}),e[21]=v,e[22]=a,e[23]=h,e[24]=m,e[25]=W):W=e[25],W;});export{O as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s,Fragment as fe}from "react/jsx-runtime";import{c as re}from "react/compiler-runtime";import{chainClassNames as Q}from "./index.js";import{useState as R,useEffect as me}from "react";import{L as he}from "./List-ClfyFOXz.js";import{O as be}from "./Input-
|
|
1
|
+
import{jsx as s,Fragment as fe}from "react/jsx-runtime";import{c as re}from "react/compiler-runtime";import{chainClassNames as Q}from "./index.js";import{useState as R,useEffect as me}from "react";import{L as he}from "./List-ClfyFOXz.js";import{O as be}from "./Input-CTZxreYT.js";import{T as Ce}from "./Tooltip-Dw-vi5zs.js";const ge=(C)=>{const e=re(20),{label:o,value:t,disabled:l,onChange:c,selectValue:i,optionRender:f,currentValue:p,onChangeCursor:g}=C;let m,h,u,b;return e[0]!==c||e[1]!==t ?(m=()=>c?.(t),e[0]=c,e[1]=t,e[2]=m):m=e[2],e[3]!==l||e[4]!==o||e[5]!==g ?(h=()=>!l&&g?.(o),e[3]=l,e[4]=o,e[5]=g,e[6]=h):h=e[6],e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==f||e[11]!==i||e[12]!==t ?(u=f ? f({label:o,value:t,disabled:l},i===o):s("div",{className:Q("ono-option-item-content",p===o&&i!==o ? "ono-option-item-content-active":"",i===o ? "ono-option-item-content-selected":"",l ? "ono-option-item-content-disabled":""),children:o}),e[7]=p,e[8]=l,e[9]=o,e[10]=f,e[11]=i,e[12]=t,e[13]=u):u=e[13],e[14]!==l||e[15]!==o||e[16]!==m||e[17]!==h||e[18]!==u ?(b=s("button",{role:"option","aria-label":o,disabled:l,className:"ono-option-item",onClick:m,onMouseEnter:h,children:u}),e[14]=l,e[15]=o,e[16]=m,e[17]=h,e[18]=u,e[19]=b):b=e[19],b;},xe=(C)=>{const e=re(78),{options:o,defaultValue:t,placeholder:l,inputBorder:c,isShowArrow:i,disabled:f,clearable:p,selectClassName:g,optionsClassName:m,notFoundContent:h,optionRender:u,onClear:b,onChange:v,filterOption:a}=C,[d,se]=R(""),[U,X]=R(""),[r,Y]=R(""),[A,ce]=R(!1),[w,ue]=R(!1),[Z,de]=R("");let B;e[0]!==o ?(B=(n)=>{const K=o.find((pe)=>pe.value===n);se(K ? K.label:"");},e[0]=o,e[1]=B):B=e[1];const N=B;let F;e[2]!==a||e[3]!==o||e[4]!==r ?(F=()=>a ? typeof a=="function" ? a(r,o):o.filter((n)=>n.label.toLocaleLowerCase().includes(r.toLocaleLowerCase())):o,e[2]=a,e[3]=o,e[4]=r,e[5]=F):F=e[5];const $=F;let j;e[6]!==a||e[7]!==r ?(j=(n)=>{ue(n),a&&r&&!n&&Y("");},e[6]=a,e[7]=r,e[8]=j):j=e[8];const ee=j;let z;e[9]!==N||e[10]!==v ?(z=(n)=>{v?.(n),de(n),N(n);},e[9]=N,e[10]=v,e[11]=z):z=e[11];const oe=z;let D;e[12]!==v||e[13]!==b ?(D=()=>{b?.(),v?.(""),de(""),se(""),Y("");},e[12]=v,e[13]=b,e[14]=D):D=e[14];const te=D;let P,T,W,q,S,L;e[15]!==t||e[16]!==N ?(P=()=>{t&&N(t);},e[15]=t,e[16]=N,e[17]=P):P=e[17],e[18]!==t ?(T=[t],e[18]=t,e[19]=T):T=e[19],me(P,T),e[20]!==t||e[21]!==o ?(W=()=>{if(o.length>0){if(t){const n=o.find((K)=>K.value===t);n&&X(n.label);}else for(let n=0;n<o.length;n++)if(o[n]?.disabled!==!0){X(o[0].label);break;}}},q=[o,t],e[20]=t,e[21]=o,e[22]=W,e[23]=q):(W=e[22],q=e[23]),me(W,q),e[24]!==m ?(S=Q("ono-option-container",m),e[24]=m,e[25]=S):S=e[25],e[26]!==$ ?(L=$(),e[26]=$,e[27]=L):L=e[27];const ne=h ?? "No Data";let V,y,_,G,H;e[28]!==ne ?(V=s("div",{className:"ono-option-item",children:s("div",{className:"ono-option-item-content-no-data",onClick:we,children:ne})}),e[28]=ne,e[29]=V):V=e[29],e[30]!==U||e[31]!==oe||e[32]!==d||e[33]!==u ?(y=(n)=>s(ge,{...n,onChange:oe,selectValue:d.toString(),currentValue:U.toString(),optionRender:u,onChangeCursor:X},n.value),e[30]=U,e[31]=oe,e[32]=d,e[33]=u,e[34]=y):y=e[34],e[35]!==L||e[36]!==V||e[37]!==y ?(_=s(he,{list:L,fallback:V,children:y}),e[35]=L,e[36]=V,e[37]=y,e[38]=_):_=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(G=()=>ce(!0),H=()=>ce(!1),e[39]=G,e[40]=H):(G=e[39],H=e[40]);const le=a ? "":"ono-select-readonly";let k,x;e[41]!==g||e[42]!==le ?(k=Q(le,g),e[41]=g,e[42]=le,e[43]=k):k=e[43],e[44]!==a||e[45]!==d||e[46]!==l||e[47]!==Z ?(x=a&&Z ? d.toString()||"":l,e[44]=a,e[45]=d,e[46]=l,e[47]=Z,e[48]=x):x=e[48];const ae=!a;let M;e[49]!==a||e[50]!==d||e[51]!==w||e[52]!==r ?(M=a&&w ? r:d.toString(),e[49]=a,e[50]=d,e[51]=w,e[52]=r,e[53]=M):M=e[53];const ie=A&&p;let O,I,E,J;return e[54]!==p||e[55]!==a||e[56]!==d||e[57]!==A||e[58]!==w||e[59]!==r ?(O=A&&p&&d||p&&r&&a ? s(fe,{}):s(ve,{isVisible:w}),e[54]=p,e[55]=a,e[56]=d,e[57]=A,e[58]=w,e[59]=r,e[60]=O):O=e[60],e[61]===Symbol.for("react.memo_cache_sentinel")?(I=(n)=>Y(n.target.value),e[61]=I):I=e[61],e[62]!==f||e[63]!==te||e[64]!==c||e[65]!==k||e[66]!==x||e[67]!==ae||e[68]!==M||e[69]!==ie||e[70]!==O ?(E=s("div",{className:"ono-select",onMouseEnter:G,onMouseLeave:H,children:s(be,{className:k,border:c,disabled:f,placeholder:x,readonly:ae,value:M,clearable:ie,suffix:O,onClear:te,onChange:I})}),e[62]=f,e[63]=te,e[64]=c,e[65]=k,e[66]=x,e[67]=ae,e[68]=M,e[69]=ie,e[70]=O,e[71]=E):E=e[71],e[72]!==ee||e[73]!==i||e[74]!==S||e[75]!==_||e[76]!==E ?(J=s(Ce,{sameWidth:!0,trigger:"click",placement:"bottom",isShowArrow:i,className:S,onOpenChange:ee,content:_,children:E}),e[72]=ee,e[73]=i,e[74]=S,e[75]=_,e[76]=E,e[77]=J):J=e[77],J;},ve=(C)=>{const e=re(5),{isVisible:o}=C,t=o ? "ono-select-arrow-down-active":"";let l,c,i;return e[0]!==t ?(l=Q("ono-select-arrow-down-icon",t),e[0]=t,e[1]=l):l=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}),e[2]=c):c=e[2],e[3]!==l ?(i=s("svg",{className:l,viewBox:"64 64 896 896",focusable:"false","data-icon":"down",fill:"currentColor","aria-hidden":"true",children:c}),e[3]=l,e[4]=i):i=e[4],i;};function we(C){return C.stopPropagation();}export{xe as O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as d}from "react/jsx-runtime";import{c as w}from "react/compiler-runtime";import{chainClassNames as E,forEach as P}from "./index.js";import{useRef as R,useEffect as S}from "react";const B=(k)=>{const e=w(22),{w:p,h:v,src:h,clr:s,className:y,onClick:g}=k,c=R(null);let r,a,t,n;if(e[0]!==p ?(r={value:p,name:"w"},e[0]=p,e[1]=r):r=e[1],e[2]!==v ?(a={value:v,name:"h"},e[2]=v,e[3]=a):a=e[3],e[4]!==s ?(t={value:s,name:"clr"},e[4]=s,e[5]=t):t=e[5],e[6]!==r||e[7]!==a||e[8]!==t){const j=[r,a,t];n=()=>{c.current&&P(j,(C)=>{var u,N,$;C.value&&(u=C.value,N=C.name,$=c.current,typeof u=="string" ? $.style.setProperty(`--${N}`,u):$.style.setProperty(`--${N}`,`${u}px`));});},e[6]=r,e[7]=a,e[8]=t,e[9]=n;}else n=e[9];const x=n;let m,i,l,o,f;return e[10]!==x ?(m=()=>{x();},e[10]=x,e[11]=m):m=e[11],e[12]!==s ?(i=[c,s],e[12]=s,e[13]=i):i=e[13],S(m,i),e[14]!==y ?(l=E("ono-svg-img",y),e[14]=y,e[15]=l):l=e[15],e[16]!==h ?(o=d("img",{src:h,alt:""}),e[16]=h,e[17]=o):o=e[17],e[18]!==g||e[19]!==l||e[20]!==o ?(f=d("div",{ref:c,className:l,onClick:g,children:o}),e[18]=g,e[19]=l,e[20]=o,e[21]=f):f=e[21],f;};export{B as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as k,jsxs as W}from "react/jsx-runtime";import{c as ce}from "react/compiler-runtime";import{chainClassNames as X,pureNumber as Y,forEach as ne}from "./index.js";import{useRef as f,useEffect as Z}from "react";const oe=(p)=>{const e=ce(50),{id:y,text:t,style:c,color:r,checked:i,onChange:z,name:L,className:n,disabled:M}=p,B=L===void 0 ? "":L,N=M!==void 0&&M,g=f(null),x=f(null),w=f(null),C=f(null),O=f(null),Q=f(null),D=typeof r=="string" ? r:r?.active;let s;e[0]!==D ?(s={value:D,name:"checkedClr"},e[0]=D,e[1]=s):s=e[1];const G=typeof r=="string" ? void 0:r?.inactive;let a,S;e[2]!==G ?(a={value:G,name:"uncheckedClr"},e[2]=G,e[3]=a):a=e[3],e[4]!==s||e[5]!==a ?(S=[s,a],e[4]=s,e[5]=a,e[6]=S):S=e[6];const H=S,ee=re;let _;e[7]!==n||e[8]!==c||e[9]!==H ?(_=()=>{if(!x.current||!g.current)return;let b=60,U=32;if(n||c){const T=getComputedStyle(x.current);b=Y(T.width),U=Y(T.height);}ne([...H,{value:b,name:"w"},{value:U,name:"h"}],(T)=>{const{value:V,name:te}=T;V&&ee(V,te,g.current);}),requestAnimationFrame(()=>{C.current&&(C.current.style.transition="translate 0.3s");});},e[7]=n,e[8]=c,e[9]=H,e[10]=_):_=e[10];const I=_;let j;e[11]!==N||e[12]!==z ?(j=(b)=>{N||z?.(b.currentTarget.checked,b);},e[11]=N,e[12]=z,e[13]=j):j=e[13];const J=j;let E,$,q,A;e[14]!==I ?(E=()=>{I();},e[14]=I,e[15]=E):E=e[15],e[16]!==n||e[17]!==r||e[18]!==c||e[19]!==t ?($=[x,g,C,n,c,r,t,O,Q],e[16]=n,e[17]=r,e[18]=c,e[19]=t,e[20]=$):$=e[20],Z(E,$),e[21]!==i ?(q=()=>{w.current&&(w.current.checked=i);},A=[w,i],e[21]=i,e[22]=q,e[23]=A):(q=e[22],A=e[23]),Z(q,A);const K=N ? "ono-switch-is-disabled":"";let l,o,m,F,h,P,u,d,v,R;return e[24]!==K ?(l=X("ono-switch",K),e[24]=K,e[25]=l):l=e[25],e[26]!==i||e[27]!==y||e[28]!==B||e[29]!==J ?(o=k("input",{id:y,name:B,role:"switch",ref:w,type:"checkbox",checked:i,onChange:J}),e[26]=i,e[27]=y,e[28]=B,e[29]=J,e[30]=o):o=e[30],e[31]!==n ?(m=X("ono-switch-box",n),e[31]=n,e[32]=m):m=e[32],e[33]===Symbol.for("react.memo_cache_sentinel")?(F=()=>w.current?.click(),e[33]=F):F=e[33],e[34]!==t?.active ?(h=t?.active&&k("div",{ref:O,className:"ono-switch-children",children:t?.active}),e[34]=t?.active,e[35]=h):h=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(P=k("div",{className:"ono-switch-slider"}),e[36]=P):P=e[36],e[37]!==t?.inactive ?(u=t?.inactive&&k("div",{ref:Q,className:"ono-switch-children",children:t?.inactive}),e[37]=t?.inactive,e[38]=u):u=e[38],e[39]!==h||e[40]!==u ?(d=W("div",{ref:C,className:"ono-switch-children-bar",children:[h,P,u]}),e[39]=h,e[40]=u,e[41]=d):d=e[41],e[42]!==c||e[43]!==m||e[44]!==d ?(v=k("div",{ref:x,className:m,style:c,onClick:F,children:d}),e[42]=c,e[43]=m,e[44]=d,e[45]=v):v=e[45],e[46]!==l||e[47]!==o||e[48]!==v ?(R=W("div",{ref:g,className:l,children:[o,v]}),e[46]=l,e[47]=o,e[48]=v,e[49]=R):R=e[49],R;};function re(p,e,y){const t=typeof p=="number";y.style.setProperty(`--${e}`,t ? `${p}px`:p);}export{oe as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as x}from "react/jsx-runtime";import{throttle as $,useEventListener as k,forEach as B}from "./index.js";import{useState as L,useRef as E,useEffect as S}from "react";import{L as q}from "./List-ClfyFOXz.js";const O=({containerClassName:z,dataSource:d,containerStyle:w={},onEndCallback:p,refreshSpeed:N=50,wrapperClassName:b,wrapperStyle:A={},estimatedSize:y=35,updateDataSourceScroll2Top:C,direction:l="vertical"})=>{const [o,H]=L({viewSize:0,startIndex:0,listSize:0,renderCount:0,prevLen:0}),[a,M]=L([]),c=typeof y=="number" ? y:y(),T=Math.min(d.length,o.startIndex+o.renderCount),m=o.startIndex>0 ? a[o.startIndex-1]?.end:0,W=x(q,{list:d.slice(o.startIndex,T),children:({id:r,data:i})=>x("li",{"data-virtual-id":r,style:l==="vertical" ?{width:"100%"}:{height:"100%"},children:i},r)}),j={display:"flex",listStyle:"none",flexDirection:l==="vertical" ? "column":"row",height:l==="vertical" ? o.listSize-m+"px":"100%",width:l==="vertical" ? "auto":o.listSize-m+"px",translate:l==="vertical" ? `0 ${m}px 0`:`${m}px 0 0`},h=E(null),u=E(null),g=(r)=>H((i)=>({...i,...r})),D=$(()=>{const{scrollTop:r,clientHeight:i,scrollHeight:s,scrollLeft:n,clientWidth:t,scrollWidth:e}=h.current,f=l==="vertical" ? s-i-r:e-t-n;g({startIndex:R(a,l==="vertical" ? r:n)}),(l==="vertical" ? r===c/2:n===c/2)&&g({startIndex:0}),f<=20&&p&&p();},N),R=(r,i)=>{let s=0,n=r.length-1,t=-1;for(;s<=n;){const e=s+Math.floor((n-s)/2),f=r[e].end;if(f===i)return e+1;f<i ? s=e+1:((t===-1||t>e)&&(t=e),n=e-1);}return t;};return k("scroll",D,{target:h.current,deps:[a,l]}),S(()=>{(()=>{if(!h.current)return;const r=(l==="vertical" ? h.current.offsetHeight:h.current.offsetWidth)||0;g({viewSize:r,renderCount:Math.ceil(r/c)+1});})();},[h,l]),S(()=>{d.length&&u&&(()=>{const r=[],i=d.length-o.prevLen,s=i>0 ? a.length:0,n=s>0 ? a[s-1].end:0;for(let t=0;t<(i>0 ? i:d.length);t++){const e=d[(i>0 ? o.prevLen:0)+t];r.push({index:e.id,size:c,start:n ? n+t*c:e.id*c,end:n ? n+(t+1)*c:(e.id+1)*c,dSize:0});}M((t)=>[...i>0 ? t:[],...r]),g({prevLen:d.length}),C&&h.current?.scrollTo(0,0);})();},[u,d,C]),S(()=>{(()=>{if(!u.current||a.length===0)return;const r=Array.from(u.current.childNodes);if(!r.length)return;B(r,(t)=>{const e=t.getBoundingClientRect(),f=+t.getAttribute("data-virtual-id"),v=a[f],I=v.size-(l==="vertical" ? e.height:e.width);I&&(v.size=l==="vertical" ? e.height:e.width,v.end=v.end-I,v.dSize=I);});const i=+r[0].getAttribute("data-virtual-id"),s=a.length;let n=a[i].dSize;a[i].dSize=0;for(let t=i+1;t<s;t++){const e=a[t];e.start=a[t-1].end,e.end=e.end-n,e.dSize&&(n+=e.dSize,e.dSize=0);}g({listSize:a[s-1].end});})();},[u,a,o.startIndex,l]),x("div",{ref:h,className:z,style:{width:"100%",height:"100%",overflow:"auto",...w},children:x("ul",{ref:u,className:b,style:{...j,...A},children:W})});},P=(z,d)=>z.map((w,p)=>({id:p,data:d(w,p)}));export{O as E,P as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as R,jsx as g}from "react/jsx-runtime";import{throttle as k,useEventListener as B,chainClassNames as G,forEach as I}from "./index.js";import{useState as v,useRef as L,useEffect as $}from "react";import{L as K}from "./List-ClfyFOXz.js";const X=({options:t,pageSize:u,children:j,request:A,reloadData:o,className:H,style:S,updateData:N,loading:l=!0,bottomThreshold:O=50})=>{const [a,p]=v({page:1,reloadData:o,loading:!1,isFinish:!1,gap:typeof t=="number" ? 0:t.gap,imageWidth:typeof t=="number" ? t:0,columns:typeof t=="number" ? 0:t.columns,imageList:[]}),[f,D]=v([]),[y,E]=v([]),w=L(null),m=L(null),c=L(null),h=(i)=>p((e)=>({...e,...i})),x=async(i,e)=>{const s=o&&a.reloadData!==o;if(a.isFinish)return;h({loading:!0});const n=await A(i,e);q(n),h({isFinish:!n.length,imageList:s ? [...n]:[...a.imageList,...n],page:i+1,loading:!1});},q=(i)=>p((e)=>{const s=o&&a.reloadData!==o,n=s ? []:[...y],d=s ? Array(e.columns).fill(0):[...JSON.stringify(f)!=="[]" ? f:Array(e.columns).fill(0)];return I(i,(T)=>{const r=((W)=>{let b=0,z=0;return b=W.indexOf(Math.min(...W)),z=W[b],{index:b,height:z};})(d),J=Math.floor(T.height*e.imageWidth/T.width);n.push({x:r.index%e.columns!==0 ? r.index*e.imageWidth+e.gap*r.index:r.index*e.imageWidth,y:r.height}),d[r.index]+=J+e.gap,D(d);}),E(n),e;}),F=()=>{if(!c.current)return;const i=c.current.clientWidth;let e=0,s=a.page;if(o&&a.reloadData!==o&&(p({page:1,reloadData:o,loading:!1,isFinish:!1,gap:typeof t=="number" ? 0:t.gap,imageWidth:typeof t=="number" ? t:0,columns:typeof t=="number" ? 0:t.columns,imageList:[]}),D([]),E([]),s=1),typeof t=="number"){const n=Math.floor(i/a.imageWidth);e=n-1;const d=e ?(i-n*a.imageWidth)/e:0;h({columns:n,gap:d});}else{e=a.columns-1;const n=(i-e*a.gap)/a.columns;h({imageWidth:n});}x(s,u);},M=()=>{w.current&&clearTimeout(w.current),w.current=setTimeout(F,50);},C=k(()=>{const{scrollTop:i,clientHeight:e,scrollHeight:s}=m.current;s-e-i>O||!a.loading&&x(a.page,u);},50);return B("scroll",C,{target:m.current,deps:[a.loading,a.page]}),$(()=>(F(),window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M);}),[c,o]),$(()=>{N&&x(a.page,u);},[N,a.loading,a.page,m.current]),R("div",{className:"ono-waterfall-container",children:[g("div",{ref:m,className:G(H,"ono-waterfall-content"),style:S,children:g("div",{ref:c,className:"ono-waterfall-wrapper",style:{height:Math.max(...f)-a.gap+"px"},children:g(K,{list:a.imageList,children:(i,e)=>g("div",{className:"ono-waterfall-item",style:{width:`${a.imageWidth}px`,translate:`${y[e].x}px ${y[e].y}px`},children:j(i,e)},i.id)})})}),a.loading&&(typeof l=="function" ? l():l&&typeof l=="boolean" ? g("div",{className:"ono-waterfall-loading",children:"loading..."}):l)]});};export{X as W};
|
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as tn}from "./AutoSliderList-CnR9cnHk.js";import{A as nn}from "./AvatarCrop-ByE8oq-Y.js";import{B as on}from "./Button-CGyWgrQj.js";import{C as sn}from "./Card3D-NqDUZB0c.js";import{C as ln}from "./Carousel-Bnrz70Tw.js";import{C as dn}from "./Checkbox-DI_pnI6U.js";import{c as mn}from "./ContextMenu-Boi1cZFI.js";import{F as fn}from "./FileDropZone-DCvpaUuw.js";import{O as wn,a as bn}from "./Input-DnB8zvWy.js";import{A as xn,L as vn}from "./List-ClfyFOXz.js";import{M as Sn}from "./Mark-DAMtImfr.js";import{M as $n}from "./MenuButton-BZMchW23.js";import{m as Ln}from "./Message-C8cydGYH.js";import{M as Cn}from "./Modal-BbixgMNW.js";import{P as An}from "./Pagination-D428PpRD.js";import{R as Dn,a as On}from "./Radio-CYirLPd9.js";import{S as Nn}from "./ScrollableTabs-yCB3QKsp.js";import{O as Un}from "./Select-D5REq6YE.js";import{S as Bn}from "./SvgImg-DWqVwwgv.js";import{S as Hn}from "./Switch-uZtwu9mV.js";import{T as _n}from "./TemplateDialog-CEfbPFNt.js";import{t as Kn}from "./Toast-nAp61Kbz.js";import{T as Vn}from "./Tooltip-Dw-vi5zs.js";import{E as Zn,c as Gn}from "./VirtualList-DKHTLs7s.js";import{W as Qn}from "./Waterfall-BVjigHTI.js";import{c as y}from "react/compiler-runtime";import{useEffect as M,useState as v,useRef as j,useReducer as V,createContext as X,useContext as Z}from "react";import{jsx as B}from "react/jsx-runtime";import{useShallow as G}from "zustand/shallow";import J from "react-dom/client";const R=(t,e,n)=>{const r=y(19);let o;r[0]!==n ?(o=n||{},r[0]=n,r[1]=o):o=r[1];const{target:a,deps:s,isDeferred:i}=o;let c;r[2]!==e ?(c=(g)=>e(g),r[2]=e,r[3]=c):c=r[3];const l=c;let u,d,h,m;return r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==a ?(u=()=>(typeof t=="string" ?!i&&(a||window).addEventListener(t,l):t.forEach((g)=>!i&&(a||window).addEventListener(g,l)),()=>{typeof t=="string" ?(a||window).removeEventListener(t,l):t.forEach((g)=>(a||window).removeEventListener(g,l));}),r[4]=t,r[5]=l,r[6]=i,r[7]=a,r[8]=u):u=r[8],r[9]!==s ?(d=s||[],r[9]=s,r[10]=d):d=r[10],r[11]!==d||r[12]!==a ?(h=[a,...d],r[11]=d,r[12]=a,r[13]=h):h=r[13],M(u,h),r[14]!==t||r[15]!==l||r[16]!==i||r[17]!==a ?(m=i ?()=>{typeof t=="string" ?(a||window).addEventListener(t,l):t.forEach((g)=>(a||window).addEventListener(g,l));}:void 0,r[14]=t,r[15]=l,r[16]=i,r[17]=a,r[18]=m):m=r[18],m;},kt=(t,e,n)=>{const r=y(10),o=n?.event||"click";let a,s,i,c;return r[0]!==o ?(a=((l)=>{const u=typeof l=="string" ? [l]:l;if(new Set(u).size!==u.length)throw new Error("there are duplicates in the event type");return u;})(o),r[0]=o,r[1]=a):a=r[1],r[2]!==e||r[3]!==t ?(s=(l)=>{if(t)if(t instanceof Array)t.map(Q).some((u)=>!!u&&u.contains(l.target))||e(l);else{const u=t instanceof HTMLElement ? t:t.current;u&&!u.contains(l.target)&&e(l);}},r[2]=e,r[3]=t,r[4]=s):s=r[4],r[5]!==n?.deps ?(i=n?.deps||[],r[5]=n?.deps,r[6]=i):i=r[6],r[7]!==t||r[8]!==i ?(c={deps:[t,...i]},r[7]=t,r[8]=i,r[9]=c):c=r[9],R(a,s,c);};function Q(t){return t instanceof HTMLElement ? t:t.current;}const Ct=(t,e)=>{const n=y(12),r=t===void 0 ? 60:t,[o,a]=v(r),[s,i]=v(!1),c=j(null);let l;n[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),n[0]=l):l=n[0];const u=l;let d;n[1]!==r||n[2]!==e ?(d=()=>{i(!1),a(r),c.current&&(clearTimeout(c.current),c.current=null),e?.();},n[1]=r,n[2]=e,n[3]=d):d=n[3];const h=d;let m,g,f;return n[4]!==s||n[5]!==o||n[6]!==h ?(m=()=>{if(s)return o>0 ? c.current=setTimeout(()=>{a(tt);},1e3):h(),()=>{c.current&&(clearTimeout(c.current),c.current=null);};},g=[s,o,h],n[4]=s,n[5]=o,n[6]=h,n[7]=m,n[8]=g):(m=n[7],g=n[8]),M(m,g),n[9]!==o||n[10]!==h ?(f=[o,u,h],n[9]=o,n[10]=h,n[11]=f):f=n[11],f;};function tt(t){return t-1;}const It=(t)=>{const e=y(8),n=t===void 0 ? 100:t,[r,o]=v(0);let a,s,i,c;if(e[0]!==r||e[1]!==n){const l=()=>a=requestAnimationFrame(()=>{o(r+1),r>=n||l();});l(),e[0]=r,e[1]=n,e[2]=a;}else a=e[2];return e[3]!==a ?(s=()=>()=>{cancelAnimationFrame(a);},e[3]=a,e[4]=s):s=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[5]=i):i=e[5],M(s,i),e[6]!==r ?(c=(l)=>r>l,e[6]=r,e[7]=c):c=e[7],c;},At=(t)=>{const e=y(9);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={w:0,h:0},e[0]=n):n=e[0];const [r,o]=v(n);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=new ResizeObserver((d)=>{for(const h of d)o({w:h.borderBoxSize[0].inlineSize,h:h.borderBoxSize[0].blockSize});}),e[1]=a):a=e[1];const s=a;let i;e[2]!==t ?(i=()=>{if(t&&typeof t!="function")s.observe(t instanceof HTMLElement ? t:t.current);else if(t&&typeof t=="function"){const d=t();s.observe(d instanceof HTMLElement ? d:d.current);}else o({w:window.innerWidth,h:window.innerHeight});},e[2]=t,e[3]=i):i=e[3];const c=i;let l,u;return e[4]!==c||e[5]!==t ?(l=()=>(c(),window.addEventListener("resize",c),()=>{if(window.removeEventListener("resize",c),t&&typeof t!="function")s.unobserve(t instanceof HTMLElement ? t:t.current);else if(t&&typeof t=="function"){const d=t();s.unobserve(d instanceof HTMLElement ? d:d.current);}}),e[4]=c,e[5]=t,e[6]=l):l=e[6],e[7]!==t ?(u=[t],e[7]=t,e[8]=u):u=e[8],M(l,u),r;},L=(t)=>t.toString().toLocaleLowerCase(),Rt=(t,e,n)=>{const r=(o)=>R(o,(a)=>((s,i,c)=>{s.forEach((l)=>{if(l.includes("+")&&l.length>1){const u=l.split("+"),d=i.ctrlKey&&u.includes("ctrl"),h=i.shiftKey&&u.includes("shift"),m=i.altKey&&u.includes("alt"),g=i.metaKey&&u.includes("meta"),f=(i.ctrlKey||i.metaKey)&&u.includes("commandorcontrol");u.length===2 ?(d||h||m||g||f)&&i.key.toLocaleLowerCase()===u[u.length-1]&&e(i,l):u.length===3&&(d&&h||d&&m||d&&g||d&&f||h&&m||h&&g||h&&f||m&&g||m&&f||g&&f)&&i.key.toLocaleLowerCase()===u[u.length-1]&&e(i,l);}else if(l.includes(L(i.key))){if(c)l===L(i.key)&&e(i,l);else if(!(i.ctrlKey||i.metaKey||i.shiftKey||i.altKey))return e(i,l);}});})(t instanceof Array ? t.map((s)=>L(s)):[L(t)],a,n?.exactMatch||!1),{deps:[n?.target,...n?.deps||[]]});n?.events instanceof Array ? n.events.forEach((o)=>r(o)):r(n?.events||"keydown");},Dt=()=>{const t=y(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={clientX:0,clientY:0,screenX:0,screenY:0,pageX:0,pageY:0},t[0]=e):e=t[0];const [n,r]=v(e);let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=(a)=>{const s=a.clientX,i=a.clientY,c=a.screenX,l=a.screenY,u=a.pageX,d=a.pageY;r({clientX:s,clientY:i,screenX:c,screenY:l,pageX:u,pageY:d});},t[1]=o):o=t[1],R("click",o),n;};let C=!1;const et=(t)=>{const e=y(13),{theme:n,onDark:r,onLight:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=window.matchMedia("(prefers-color-scheme:dark)"),e[0]=a):a=e[0];const s=a;let i;e[1]!==r||e[2]!==o ?(i=()=>{s.matches ? r():o();},e[1]=r,e[2]=o,e[3]=i):i=e[3];const c=i;let l;e[4]!==c||e[5]!==r||e[6]!==o||e[7]!==n ?(l=()=>{C&&(C=!1,s.removeEventListener("change",c));t:switch(n){case "light":o();break t;case "dark":r();break t;default:c(),C=!0,s.addEventListener("change",c);}},e[4]=c,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8];const u=l;let d,h;e[9]!==u ?(d=()=>{u();},e[9]=u,e[10]=d):d=e[10],e[11]!==n ?(h=[n],e[11]=n,e[12]=h):h=e[12],M(d,h);},F=(t)=>{const e="ono-view-transition-clip-path-circle",{element:n,duration:r=300,themeRules:o,onChangeTheme:a}=t,s=o?.()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return a(s==="dark" ? "light":"dark");const i=document.startViewTransition(()=>{const f=document.documentElement.classList.contains("dark");a(f ? "light":"dark");}),{top:c,left:l,width:u,height:d}=n.getBoundingClientRect(),h=l+u/2,m=c+d/2,g=[`circle(0%at ${h}px ${m}px)`,`circle(${Math.hypot(Math.max(h,window.innerWidth-h),Math.max(m,window.innerHeight-m))}px at ${h}px ${m}px)`];((f,p)=>{const w=document.createElement("style");w.setAttribute("type","text/css"),w.setAttribute("data-style-tag",p),w.textContent="::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}",document.head.appendChild(w);})(0,e),i.ready.then(()=>{document.documentElement.animate({clipPath:s==="light" ? g:g.reverse()},{duration:r,fill:"forwards",easing:"ease-in-out",pseudoElement:s==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>{return f=e,void document.head.querySelectorAll("style").forEach((p)=>p.getAttribute("data-style-tag")===f&&p.remove());var f;},r+50);});},Ot=(t)=>{const{initTheme:e="light",themeRules:n=(s)=>{s ? document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");}}=t||Object.assign({}),[r,o]=v(e),a=j(null);return et({theme:r,onDark:()=>{a.current ? F({element:a.current,onChangeTheme:()=>n(!0)}):n(!0);},onLight:()=>{a.current ? F({element:a.current,onChangeTheme:()=>n(!1)}):n(!1);}}),[r,({targetTheme:s,element:i,onChange:c})=>{a.current=i||null,c?.(),o(s);}];},Ft=()=>{const t=y(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:0,height:0},t[0]=e):e=t[0];const [n,r]=v(e);let o,a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const s=()=>r({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",s),s(),()=>{window.removeEventListener("resize",s);};},a=[],t[1]=o,t[2]=a):(o=t[1],a=t[2]),M(o,a),n;},Nt=(t)=>{const e=window.fetch,n={status:"pending",value:null},r=(...o)=>{if(n.status==="fulfilled")return n.value;throw n.status==="rejected" ? n.value:e(...o).then((a)=>a.json()).then((a)=>{n.status="fulfilled",n.value=a;}).catch((a)=>{n.status="rejected",n.value=a;});};window.fetch=r;try{t();}catch(o){o instanceof Promise&&o.finally(()=>{window.fetch=r,t(),window.fetch=e;});}window.fetch=e;},Pt=(t,e)=>{if(!e)return t;const n=new URLSearchParams();for(const [o,a] of Object.entries(e))a!==void 0&&(a===null ? n.append(o,"null"):n.append(o,String(a)));if(![...n.keys()].length)return t;const r=t.includes("?")? "&":"?";return `${t}${r}${n.toString()}`;},nt=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);function Ut(){const t=navigator.userAgent;let e="Unknown",n="Unknown";return/Chrome\/(\d+)/.test(t)?(e="Chrome",n=RegExp.$1):/Firefox\/(\d+)/.test(t)?(e="Firefox",n=RegExp.$1):/Safari\/(\d+)/.test(t)&&/Version\/([\d.]+)/.test(t)?(e="Safari",n=RegExp.$1):/Edge\/(\d+)/.test(t)&&(e="Edge",n=RegExp.$1),{name:e,version:n,isMobile:nt()};}function jt(t){if(typeof window>"u")return{};if(t)return new URLSearchParams(window.location.search).get(t);{const e=new URLSearchParams(window.location.search),n={};for(const [r,o] of e.entries())n[r]=o;return n;}}const rt=(t)=>/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t)? "hex":/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t)? "rgb":"unknown",Bt=(t,e,n)=>{const r=rt(t);if(r==="hex"){const o=t.replace("#",""),a=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),i=parseInt(o.slice(4,6),16);if(e==="lighten"){const c=Math.min(255,Math.max(0,a+(255-a)*n/100)),l=Math.min(255,Math.max(0,s+(255-s)*n/100)),u=Math.min(255,Math.max(0,i+(255-i)*n/100));return `#${c.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}if(e==="darken"){const c=Math.min(255,Math.max(0,a-a*n/100)),l=Math.min(255,Math.max(0,s-s*n/100)),u=Math.min(255,Math.max(0,i-i*n/100));return `#${c.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}}else if(r==="rgb"){const o=t.match(/\d+/g),a=parseInt(o[0]),s=parseInt(o[1]),i=parseInt(o[2]);if(e==="lighten")return `rgb(${Math.min(255,Math.max(0,a+(255-a)*n/100))},${Math.min(255,Math.max(0,s+(255-s)*n/100))},${Math.min(255,Math.max(0,i+(255-i)*n/100))})`;if(e==="darken")return `rgb(${Math.min(255,Math.max(0,a-a*n/100))},${Math.min(255,Math.max(0,s-s*n/100))},${Math.min(255,Math.max(0,i-i*n/100))})`;}return t;},z=(t)=>{const e=t.split("#")[1],n=(r)=>[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)];if(e.length===8){const r=parseInt(e.slice(-2),16)/256,o=n(e.slice(0,-2));return o.push(r),"rgba("+o.join(",")+")";}return "rgb("+n(e).join(",")+")";},x=(t)=>t.match(/(\d+\.?\d*)/g),D=(t)=>{const e=x(t),n=Number(e[0])/255,r=Number(e[1])/255,o=Number(e[2])/255,a=Math.min(n,r,o),s=Math.max(n,r,o);let i=0,c=0,l=(s+a)/2;if(s===a)i=c=0;else{const u=s-a;switch(c=l>0.5 ? u/(2-s-a):u/(s+a),s){case n:i=(r-o)/u+(r<o ? 6:0);break;case r:i=(o-n)/u+2;break;case o:i=(n-r)/u+4;}i/=6;}return `hsl(${Math.round(360*i)},${Math.round(100*c)}%,${Math.round(100*l)}%)`;},ot=(t)=>D(z(t)),at=(t)=>{const e=x(t),n=Number(e[0])/360,r=Number(e[1])/100,o=Number(e[2])/100;let a,s,i;function c(d,h,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6 ? d+6*(h-d)*m:m<0.5 ? h:m<2/3 ? d+(h-d)*(2/3-m)*6:d;}let l=o<0.5 ? o*(1+r):o+r-o*r,u=2*o-l;return a=c(u,l,n+1/3),s=c(u,l,n),i=c(u,l,n-1/3),`rgb(${Math.round(255*a)},${Math.round(255*s)},${Math.round(255*i)})`;},O=(t)=>{const e=x(t),n=(a)=>Number(a).toString(16).padStart(2,"0"),r=(a)=>a.reduce((s,i)=>s+n(i),"#"),o=(a)=>{const s=a,i=Number(a[a.length-1])!==1 ? Number(a[a.length-1]):100;return s.pop(),r(s)+n(2.56*i);};return e.length===3 ? r(e):e.length===5 ? o([e[0],e[1],e[2],10*Number(e[e.length-1])]):o(e);},st=(t)=>O(at(t)),zt=(t,e,n)=>{let r=[];if(t.includes("#"))r=x(ot(t));else if(t.includes("rgb"))r=x(D(t));else{if(!t.includes("hsl"))throw new Error("颜色格式错误");r=x(t);}return st(`${r[0]},${r[1]}%,${e==="light" ? Number(r[2])+n>100 ? 100:Number(r[2])+n:Number(r[2])-n<0 ? 0:Number(r[2])-n}%`);},H=(t)=>{const e=x(t);let n=Number(e[0])/255,r=Number(e[1])/255,o=Number(e[2])/255;const a=Math.max(n,r,o),s=Math.min(n,r,o);let i=0,c=0,l=a;const u=a-s;if(c=a===0 ? 0:u/a,a===s)i=0;else{switch(a){case n:i=(r-o)/u+(r<o ? 6:0);break;case r:i=(o-n)/u+2;break;case o:i=(n-r)/u+4;}i/=6;}return `hsv(${360*i},${100*c},${100*l})`;},Ht=(t,e=1,n="rgba")=>{const r=x(t);let o=Number(r[0])/255,a=Number(r[1])/255,s=Number(r[2])/255;switch(n){case "rgba":return `rgba(${o},${a},${s},${e})`;case "hex":return O(t);case "hsl":return D(t);case "hsv":return H(t);default:return t;}},Yt=(t)=>{const e=(function(r){if(r.startsWith("#"))return r.length===4&&(r=`#${r.slice(1).repeat(2)}`),[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)];if(r.startsWith("rgb")){const o=r.match(/\d+/g);return [parseInt(o[0]),parseInt(o[1]),parseInt(o[2])];}return null;})(t);return e===null ? null:(299*(n=e)[0]+587*n[1]+114*n[2])/1e3>128 ? "#000":"#fff";var n;},_t=(t,e,n)=>0.2126*t+0.7152*e+0.0722*n,Wt=(t)=>H(z(t)),Kt=(t)=>{const e=t.replace("#","").split("");return `#${e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}`;},it=(t)=>{const e=x(t);let n=Number(e[0])/360,r=Number(e[1])/100,o=Number(e[2])/100,a=0,s=0,i=0;const c=Math.floor(6*n),l=6*n-c,u=o*(1-r),d=o*(1-l*r),h=o*(1-(1-l)*r);switch(c%6){case 0:a=o,s=h,i=u;break;case 1:a=d,s=o,i=u;break;case 2:a=u,s=o,i=h;break;case 3:a=u,s=d,i=o;break;case 4:a=h,s=u,i=o;break;case 5:a=o,s=u,i=d;}return `rgb(${Math.round(255*a)},${Math.round(255*s)},${Math.round(255*i)})`;},qt=(t)=>O(it(t)),Vt=(t)=>!(!/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t)&&!/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t)),Xt=()=>"#"+Math.random().toString(16).slice(2,8).padEnd(6,"0"),Zt=(t,e)=>{if(!e)return t;if(t.includes("rgba")){const n=t.split(",");return n.pop(),n.push(e+")"),n.join(",");}if(t.includes("rgb")){const n=t.split(","),r="rgba("+n[0].split("(")[1],o=n[n.length-1].split(")")[0];return [r,n[1],o," "+e+")"].join(",");}},Gt=(t)=>{if(typeof t!="number"||isNaN(t))throw new Error("请输入有效的数字");const e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".");},Jt=(t,e,n)=>{const r=t[e];t[e]=function(o){r&&typeof r=="function"&&r.call(this,o),n.call(this,o);};},Qt=(...t)=>{let e="";for(let n=0;n<t.length;n++){const r=t[n];r&&(e&&(e+=" "),e+=r);}return e;},te=(t,e)=>{t.toString().startsWith("2")? e.onSuccess&&e.onSuccess():(t.toString().startsWith("4")||t.toString().startsWith("5"))&&e.onFail&&e.onFail();},ee=(t)=>navigator.clipboard.writeText(t),ne=(t,e)=>{let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r),n=null;},e);};},ct=(t)=>{if(typeof t!="object"||t===null)return t;const e=Array.isArray(t)? []:{};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=ct(t[n]));return e;},re=(t,e,n=t.length)=>e>=t.length ? t:(e<0&&(e=Math.max(0,e+t.length)),n<0&&(n=t.length+n),e>n&&([e,n]=[n,e]),e=Math.max(0,Math.min(e,t.length)),(n=Math.max(0,Math.min(n,t.length)))-e>3 ? t.substring(0,e)+"..."+t.substring(n):t),oe=(t)=>typeof t!="string"||t.length===0 ? "":t.charAt(0).toUpperCase()+t.slice(1),N=(t,e)=>{for(t=Math.abs(t),e=Math.abs(e);e!==0;){const n=e;e=t%e,t=n;}return t;},ae=(t)=>new Promise((e,n)=>{const r=new Image();let o=null;const a=()=>{o&&URL.revokeObjectURL(o);};r.onload=()=>{a(),e({width:r.width,height:r.height});},r.onerror=()=>{a(),n(new Error("Failed to load image"));},typeof t=="string" ? r.src=t:(o=URL.createObjectURL(t),r.src=o);}),se=(t,e,n,r)=>Math.sqrt((t-n)**2+(e-r)**2),ie=(t,e)=>`${Math.floor(t/N(t,e))}:${Math.floor(e/N(t,e))}`,ce=(t)=>Array.from(new Intl.Segmenter("en").segment(t)).length,lt=(t)=>{const e=new Set();for(const n of t){if(e.has(n))return!0;e.add(n);}return!1;},le=(t)=>/^\d+$/.test(t),b=(t)=>t<10 ? `0${t}`:`${t}`,ue=(t)=>{const e={};return t.replace(/([^?=&]+)=([^&]+)/g,(n,r,o)=>e[r]=o),e;},de=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+])[\da-zA-Z]{8,}$/,he=(t)=>navigator.clipboard.readText().then((e)=>t(e)),me=({el:t,str:e="hello world",speed:n=100,isExtendStr:r=!0,onDone:o})=>{let a=0,s=null;t.textContent&&r&&(a=t.textContent.length,e=t.textContent+e);const i=()=>{clearTimeout(s);const c=e.substring(0,a+1);t.textContent=c,a++,a!==e.length ? s=setTimeout(i,n):o?.();};i();},ge=(t)=>parseFloat(t.replace(/[^0-9.]/g,"")),fe=(t)=>{if(t.length<2)return [...t];const e=[...t];return A(e,0,e.length-1),e;};function A(t,e,n){if(e<n){const r=(function(o,a,s){const i=o[s];let c=a-1;for(let l=a;l<s;l++)o[l]<=i&&(c++,[o[c],o[l]]=[o[l],o[c]]);return [o[c+1],o[s]]=[o[s],o[c+1]],c+1;})(t,e,n);A(t,e,r-1),A(t,r+1,n);}}const pe=(t,e)=>{let n=0;const r=(o)=>{n||(n=o),o-n>=e ? t():requestAnimationFrame(r);};requestAnimationFrame(r);},we=(t)=>{if(t<=0)return "";let e="";for(let n=0;n<t;n++)e+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(62*Math.random()));return e;},be=(t)=>new DOMParser().parseFromString(t,"text/html").body.textContent||"",ut=(t,e,n)=>{const{maxWidth:r,maxHeight:o,allowUpscale:a=!1}=Object.assign({maxWidth:1e3,maxHeight:1e3,allowUpscale:!0},n),s=t/r,i=e/o;let c;if(a)c=Math.max(s,i);else if(c=Math.max(s,i),c<=1)return{initWidth:t,initHeight:e};const l=t/c,u=e/c;return{initWidth:Math.round(l),initHeight:Math.round(u)};},ye=({currentIndex:t,itemHeight:e,total:n,showMaxNumber:r,element:o})=>{if(n<=0||r<=0||e<=0||n<=r)return;const a=Math.floor(o.scrollTop/e);if(t>=a&&t<=a+r-1)return;let s;s=t<a ? t*e:(t-r+1)*e;const i=(n-r)*e;s=Math.max(0,Math.min(i,s)),s!==o.scrollTop&&o.scrollTo({top:s});},xe=(t,e=[],n=!0)=>{if(e.length===0)return t;if(lt(e))throw new Error("Each item in properties must be unique");if(n){const r={};for(const o of e)r[o]=t[o];return r;}{const r=new Set(e),o={};for(const a in t)r.has(a)||(o[a]=t[a]);return o;}},ve=(t)=>{let e;const n=new Proxy(t,{construct:(r,o)=>(e||(e=Reflect.construct(r,o)),e)});return n.prototype.construct=n,n;};function Me(t,e,n={}){let r,o=null,a=null,s=0;const i=n.leading!==!1,c=n.trailing!==!1;function l(){a&&(t.apply(r,a),a=null);}function u(){const h=Date.now();h-s>=e ?(c&&a&&l(),o=null):o=setTimeout(u,e-(h-s));}const d=function(...h){const m=Date.now();a=h,r=this,m-s>=e ? o||(s=m,i ? l():c&&(o=setTimeout(u,e))):!o&&c&&(o=setTimeout(u,e-(m-s)));};return d.cancel=function(){o&&(clearTimeout(o),o=null),s=0,a=null;},d;}const P=(t)=>new Promise((e)=>{const n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.videoWidth,n.height=t.videoHeight,r.drawImage(t,0,0,n.width,n.height),n.toBlob((o)=>e({blob:o,url:URL.createObjectURL(o)})),n.remove();}),U=(t,e)=>new Promise((n)=>{if(t instanceof HTMLVideoElement)t.currentTime=e,t.muted=!0,t.autoplay=!0,t.oncanplay=async()=>n(await P(t));else{const r=document.createElement("video");r.currentTime=e,r.muted=!0,r.autoplay=!0,r.src=typeof t=="string" ? t:URL.createObjectURL(t),r.oncanplay=async()=>n(await P(r));}}),Se=(t,e)=>{if(t instanceof HTMLVideoElement)return Promise.all(e.map((n)=>U(t,n)));{const n=document.createElement("video");return n.src=typeof t=="string" ? t:URL.createObjectURL(t),Promise.all(e.map((r)=>U(n,r)));}},dt=(t)=>new Promise((e,n)=>{const r=new Image();if(typeof t=="string"){const o=()=>{r.onload=null,r.onerror=null;};r.onload=()=>{o(),e(r);},r.onerror=()=>{o(),n(new Error(`Failed to load image:${t}`));},r.src=t;}else{const o=URL.createObjectURL(t),a=()=>{r.onload=null,r.onerror=null,URL.revokeObjectURL(o);};r.onload=()=>{a(),e(r);},r.onerror=()=>{a(),n(new Error("Failed to load image from File"));},r.src=o;}}),ht=async(t,e)=>{const n=(r,o)=>{const a=window.URL.createObjectURL(r),s=document.createElement("a");s.href=a,s.download=encodeURIComponent(o),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a);};try{if(typeof t=="string"){const r=await fetch(t);if(!r.ok)throw new Error(`Network response was not ok:${r.statusText}`);n(await r.blob(),e);}else n(t,e);}catch{}},Ee=async(t,e)=>{const{filename:n,imageWidth:r,imageHeight:o}=e||{},a=document.createElement("canvas"),s=a.getContext("2d");((i,c,l,u,d,h)=>{const m=[],{initWidth:g,initHeight:f}=ut(i.naturalWidth,i.naturalHeight,{maxWidth:u,maxHeight:d}),p=c.width=g,w=c.height=f;if(l?.drawImage(i,0,0,p,w),(function k(){if(l.getImageData(p-1,w-1,1,1).data[3]>0)for(let E=0;E<p;E++)for(let $=0;$<w;$++){const T=l.getImageData(E,$,1,1).data;m.push(`${E}px ${$}px rgba(${T[0]},${T[1]},${T[2]},${T[3]/255})`);}else requestAnimationFrame(k);})(),m.length>=p*w){const k=`<html><head><title>Generated HTML</title><style>*{margin:0;padding:0;box-sizing:border-box;}.item{width:1px;height:1px;box-shadow:${m.join(",")};}</style></head><body><div class="item"></div></body></html>`;ht(URL.createObjectURL(new Blob([k],{type:"text/html"})),h ? h.endsWith(".html")? h:h+".html":"download.html");}})(t instanceof HTMLImageElement ? t:await dt(t),a,s,r,o,n);},$e=(t,e="viewport")=>{const n=t.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2;switch(e){case "page":return{x:r+window.pageXOffset,y:o+window.pageYOffset};case "parent":const a=t.parentElement;if(!a)return{x:r,y:o};const s=a.getBoundingClientRect();return{x:r-(s.left+s.width/2),y:o-(s.top+s.height/2)};default:return{x:r,y:o};}},Te=(t,e,n)=>{t.muted=!0,t.play();const r=new AudioContext(),o=r.state==="running";r.close(),o ?(t.muted=!1,e?.()):n?.();},mt=/^data:image\/([a-zA-Z]*);base64,([^\s]*)$/,gt=/^[A-Za-z0-9+/]*={0,2}$/,Y=(t)=>{if(typeof t!="string"||t.length===0)return!1;if(mt.test(t))return!0;if(t.length%4!=0||!gt.test(t))return!1;if(t.length<=100)return!0;try{return btoa(atob(t))===t;}catch{return!1;}},Le=(t)=>{if(!Y(t))throw new Error("Invalid base64 string");const e=t.indexOf(","),n=t.substring(0,e).match(/:(.*?);/);if(!n||!n[1])throw new Error("Could not extract MIME type from base64 string");const r=n[1],o=atob(t.substring(e+1)),a=new Uint8Array(o.length);for(let s=0;s<o.length;s++)a[s]=o.charCodeAt(s);return new Blob([a],{type:r});},ke=(t,e)=>{if(!Y(t))throw new Error("Invalid base64 string");const n=t.indexOf(","),r=t.substring(0,n),o=t.substring(n+1),a=r.match(/:(.*?);/);if(!a||!a[1])throw new Error("Could not extract MIME type from base64 string");const s=a[1],i=atob(o),c=new Uint8Array(i.length);for(let h=0;h<i.length;h++)c[h]=i.charCodeAt(h);const l=s.split("/"),u=l[1]==="jpeg" ? ".jpg":"."+l[1],d=new Blob([c],{type:s});return new File([d],e+u,{type:s,lastModified:Date.now()});},ft=(t)=>new Promise((e)=>{const n=new FileReader();n.readAsDataURL(t),n.onload=(r)=>{const o=r.target?.result,a=o.split(",")[1];e(a);};}),pt=(t,e="abc.jpg")=>new File([t],e,{type:t.type}),Ce=(t)=>new Promise((e)=>{const n=new FileReader();n.readAsDataURL(t),n.onload=(r)=>e(r.target?.result);}),Ie=(t)=>t.slice(0,t.size,t.type),Ae=(t,e)=>{const n=["B","KB","MB","GB","TB"];let r=n.indexOf(e?.unit ?? "B");if(r===-1)throw new Error("Invalid unit");if(!e?.unit)for(;t/Math.pow(1024,r)>=1024;)r++;return `${(t/Math.pow(1024,r)).toFixed(e?.decimalPlaces ?? 0)}${n[r]}`;},wt=(t)=>{if(!t)return "";const e=t.lastIndexOf(".");return e===-1 ? wt(t.substring(t.lastIndexOf("/")+1)):t.substring(0,e);},Re=(t)=>{if(!t)return "";const e=t.lastIndexOf(".");return t.substring(e+1);},De=(t,e)=>{const{onReaderLoad:n,onImageLoad:r}=e||{};return new Promise((o,a)=>{const s=new FileReader();s.onload=(i)=>{const c=new Image();c.onload=()=>{o(c),r?.(c);},c.onerror=a,c.src=i.target?.result,n?.(i);},s.onerror=a,s.readAsDataURL(t);});},_=async(t)=>await(await fetch(t)).blob(),Oe=async(t)=>await ft(await _(t)),Fe=async(t)=>pt(await _(t)),Ne=(t,e,n)=>{const r=new IntersectionObserver(e,n);t instanceof HTMLElement ? r.observe(t):t.forEach((o)=>r.observe(o));},Pe=(t,e,n,r={root:null,rootMargin:"0px",threshold:0})=>{const o=new IntersectionObserver((a)=>a.forEach((s)=>s.isIntersecting ? e(s):n(s)),r);t.forEach((a)=>o.observe(a));},bt=({onAndroid:t,onIOS:e,onUnknown:n})=>{const r=navigator.userAgent;return/android/i.test(r)?(t(),"Android"):/iPad|iPhone|iPod/.test(r)?(e(),"iOS"):(n?.(),"Unknown");},Ue=({onAndroid:t,onIOS:e,onUnknown:n,timeout:r=500})=>()=>{setTimeout(()=>bt({onAndroid:t,onIOS:e,onUnknown:n}),r);},je=(t,e)=>{const n={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!n[e])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(t/n[e]);},Be=(t)=>Math.ceil((t.getTime()-new Date(t.getFullYear(),0,1).getTime())/864e5),ze=(t)=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%60),o=(a)=>a.toString().padStart(2,"0");return(e>0 ? `${o(e)}:${o(n)}:${o(r)}`:`${o(n)}:${o(r)}`)+(t<10 ? ".00":t<100 ? ".0":"");},W=(t)=>t.toString().length>13 ? new Date(Number(t.toString().substring(0,13))):t.toString().length===13 ? new Date(t):t.toString().length<13&&t.toString().length>10 ? new Date(Number((t.toString()+"000").substring(0,13))):t.toString().length===10 ? new Date(1e3*t):new Date(Number((t.toString()+"000000000000").substring(0,13))),He=(t,e="YY-MM-DD hh:mm:ss")=>{const n=["YY","MM","DD","hh","mm","ss"],r=[],o=W(t);r.push(o.getFullYear().toString()),r.push(b(o.getMonth()+1)),r.push(b(o.getDate())),r.push(b(o.getHours())),r.push(b(o.getMinutes())),r.push(b(o.getSeconds()));for(let a in r)e=e.replace(n[a],r[a]);return e;},Ye=(t)=>{const e=new Date(1e3*t),n=new Date();return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear();},_e=(t,e="YY-MM-DD hh:mm:ss",n="cn")=>{const r=["YY","MM","DD","hh","mm","ss"],o=[],a=W(t);o.push(((s,i)=>{const c={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return s.split("").map((l)=>c[i][Number(l)]).join("");})(a.getFullYear().toString(),n)),o.push(((s,i)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[i][Number(s)-1])(b(a.getMonth()+1),n)),o.push(((s,i)=>{let c;return i==="en" ? c=s==="01"||s==="21"||s==="31" ? Number(s)+"st":s==="02"||s==="22" ? Number(s)+"nd":s==="03"||s==="23" ? Number(s)+"rd":Number(s)+"th":s==="01" ? c="一日":s==="02" ? c="二日":s==="03" ? c="三日":s==="04" ? c="四日":s==="05" ? c="五日":s==="06" ? c="六日":s==="07" ? c="七日":s==="08" ? c="八日":s==="09" ? c="九日":s==="10" ? c="十日":s==="11" ? c="十一日":s==="12" ? c="十二日":s==="13" ? c="十三日":s==="14" ? c="十四日":s==="15" ? c="十五日":s==="16" ? c="十六日":s==="17" ? c="十七日":s==="18" ? c="十八日":s==="19" ? c="十九日":s==="20" ? c="二十日":s==="21" ? c="二十一日":s==="22" ? c="二十二日":s==="23" ? c="二十三日":s==="24" ? c="二十四日":s==="25" ? c="二十五日":s==="26" ? c="二十六日":s==="27" ? c="二十七日":s==="28" ? c="二十八日":s==="29" ? c="二十九日":s==="30" ? c="三十日":s==="31"&&(c="三十一日"),c ?? s;})(b(a.getDate()),n)),o.push(b(a.getHours())),o.push(b(a.getMinutes())),o.push(b(a.getSeconds()));for(let s in o)e=e.replace(r[s],o[s]);return e;},We=(t,e)=>{const n=["DD","hh","mm","ss"],r=[];r.push(Math.floor(t/86400)),r.push(b(Math.floor(t%86400/3600))),r.push(b(Math.floor(t%3600/60))),r.push(b(t%60));for(let o=0;o<n.length;o++)e=e.replace(n[o],r[o].toString());return e;},Ke=(t)=>{const e="ono-view-transition-clip-path-circle",{element:n,duration:r=300,themeRules:o,onChangeTheme:a}=t,s=o?.()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return a(s==="dark" ? "light":"dark");const i=document.startViewTransition(()=>{const f=document.documentElement.classList.contains("dark");a(f ? "light":"dark");}),{top:c,left:l,width:u,height:d}=n.getBoundingClientRect(),h=l+u/2,m=c+d/2,g=[`circle(0%at ${h}px ${m}px)`,`circle(${Math.hypot(Math.max(h,window.innerWidth-h),Math.max(m,window.innerHeight-m))}px at ${h}px ${m}px)`];((f,p)=>{const w=document.createElement("style");w.setAttribute("type","text/css"),w.setAttribute("data-style-tag",p),w.textContent="::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}",document.head.appendChild(w);})(0,e),i.ready.then(()=>{document.documentElement.animate({clipPath:s==="light" ? g:g.reverse()},{duration:r,fill:"forwards",easing:"ease-in-out",pseudoElement:s==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>{return f=e,void document.head.querySelectorAll("style").forEach((p)=>p.getAttribute("data-style-tag")===f&&p.remove());var f;},r+50);});},K=(t,e=[],n=!0)=>{if(e.length===0)return t;if(((r)=>{const o=new Set();for(const a of r){if(o.has(a))return!0;o.add(a);}return!1;})(e))throw new Error("Each item in properties must be unique");if(n){const r={};for(const o of e)r[o]=t[o];return r;}{const r=new Set(e),o={};for(const a in t)r.has(a)||(o[a]=t[a]);return o;}},yt={get:(t)=>t,set:(t,e)=>({...t,[e.key]:e.value}),del:(t,e)=>{const n={...t};return delete n[e.key],n;}},xt=(t,e)=>yt[e.type](t,e),q=X(null),qe=(t)=>{const e=y(5),{initData:n,children:r}=t,[o,a]=V(xt,n);let s,i;return e[0]!==o ?(s={data:o,dispatch:a},e[0]=o,e[1]=s):s=e[1],e[2]!==r||e[3]!==s ?(i=B(q.Provider,{value:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i;},vt=(t)=>{const e=y(9),n=Z(q);if(!n)throw new Error("useData must be used within a DataProvider");let r;e[0]!==n ?(r={set:(i,c)=>n.dispatch({type:"set",key:i,value:c}),setAll:(i)=>{Object.keys(i).forEach((c)=>n.dispatch({type:"set",key:c,value:i[c]}));},del:(i)=>n.dispatch({type:"del",key:i})},e[0]=n,e[1]=r):r=e[1];const o=r;let a,s;return e[2]!==n.data||e[3]!==t ?(a=t ? K(n.data,t):n.data,e[2]=n.data,e[3]=t,e[4]=a):a=e[4],e[5]!==n.dispatch||e[6]!==o||e[7]!==a ?(s={data:a,dispatch:o,originDispatch:n.dispatch},e[5]=n.dispatch,e[6]=o,e[7]=a,e[8]=s):s=e[8],s;},Ve=()=>vt,Xe=(t)=>{function e(n){return n ? t(G((r)=>K(r,n))):t();}return e.setState=t.setState,e;},S=new Map(),Ze=(t,e,n,r)=>{const{target:o,root:a,reactRoot:s}=((c,l)=>{const u=c||`${l}-${Math.random().toString(36)}`;if(S.has(u)){const f=S.get(u);if(document.contains(f.target))return f;S.delete(u);}let d,h,m=null;l&&(m=document.getElementById(l),m||(m=document.createElement("div"),m.id=l,document.body.appendChild(m))),c ?(d=document.getElementById(c)?? document.createElement("div"),d.id||(d.id=c,m ? m.appendChild(d):document.body.appendChild(d))):(d=document.createElement("div"),m ? m.appendChild(d):document.body.appendChild(d)),d.__reactContainer$ ? h=d.__reactContainer$:(h=J.createRoot(d),d.__reactContainer$=h);const g={target:d,root:m,reactRoot:h};return S.set(u,g),g;})(n,r),i=(c)=>{try{typeof c=="function"&&c();const l=n||`${r}-${Math.random().toString(36)}`;S.delete(l),s.unmount(),n ? document.getElementById(n)?.remove():o.remove(),requestAnimationFrame(()=>{a&&a.children.length===0&&a.remove();});}catch{}};return s.render(B(t,{...e,destroy:i})),i;};class Mt{events={};constructor(e){for(let n=0;n<e.length;n++)this.events[e[n]]=new Set();}createEvent(e,n=!1){this.events[e]&&!n||(this.events[e]=new Set());}emit(e,...n){if(!this.events[e])throw new Error(`Event ${e}does not exist`);this.events[e].forEach((r)=>{r(...n);});}on(e,n,r=!0){this.createEvent(e,r),this.events[e].add(n);}cancel(e,n){this.events[e]&&this.events[e].delete(n);}clear(e){if(e)this.createEvent(e,!0);else{const n=Object.keys(this.events);for(let r=0;r<n.length;r++)this.createEvent(n[r],!0);}}}let I=null;function Ge(t,e=!1){const n=new Mt([...t]);return e ?(I||(I=n),I):n;}export{tn as AutoSliderList,nn as AvatarCrop,xn as AwaitList,on as Button,sn as Card3D,ln as Carousel,dn as Checkbox,qe as DataProvider,Zn as EstimatedVirtualList,fn as FileDropZone,vn as List,Sn as Mark,$n as MenuButton,Cn as Modal,wn as OnoInput,Un as OnoSelect,bn as OnoTextarea,An as Pagination,Dn as Radio,On as RadioGroup,Nn as ScrollableTabs,Bn as SvgImg,Hn as Switch,_n as TemplateDialog,Vn as Tooltip,Qn as Waterfall,Gt as addCommasToNumber,Jt as addEventWithOriginHandler,Bt as adjustColor,zt as adjustingColors,Le as base64ToBlob,ke as base64ToFile,ft as blobToBase64,pt as blobToFile,U as captureFrame,Se as captureFrames,Qt as chainClassNames,Ke as changeThemeClipPathCircle,Pt as changeUrlByParams,nt as checkDeviceIsMobile,te as checkStatusCode,Nt as clearAsyncContagion,mn as contextMenu,je as convertSecondToOtherTime,ee as copyText,Ve as createContextData,Gn as createDataSource,Xe as createDesignateStore,Ge as createEventEmitter,Ee as createImageHTML,Ne as createIntersectionObserver,Be as dayOfYear,ne as debounce,ct as deepCopy,bt as distinguishPlatform,Ue as distinguishPlatformDelay,ht as downloadFile,Pe as elementIsInViewport,re as ellipsisString,Ce as fileToBase64,Ie as fileToBlob,oe as firstLetter2Capitalize,Ht as formatColor,Ae as formatFileSize,ze as formatSecond,He as formatTime,N as gcd,x as getAllNumbers,Ut as getBrowserInfo,rt as getColorType,Yt as getContrastColor,$e as getElementCenterPosition,wt as getFileName,Re as getFileSuffix,ae as getImageSize,se as getPointDistance,ie as getRatio,ce as getStringRealLenght,jt as getURLSearchParams,_t as grayColor,lt as hasDuplicates,ot as hex2hsl,Wt as hex2hsv,z as hex2rgb,Kt as hex3To6,st as hsl2hex,at as hsl2rgb,qt as hsv2hex,it as hsv2rgb,Y as isBase64,le as isPureNumber,Ye as isToday,Vt as isValidColor,dt as loadImage,_e as localFormat,Te as mediaAutoplayPolicies,Ln as message,b as padZero,ue as parseQuery,de as passwordStrength,he as pasteText,Ze as portalRenderer,me as printStr,ge as pureNumber,fe as quickSort,pe as rafTimeout,Xt as randomColor,we as randomString,De as readerImageFile,be as removeTag,O as rgb2hex,D as rgb2hsl,H as rgb2hsv,Zt as rgb2rgba,ut as scaleSize,ye as scrollToItem,We as second2Day,xe as selectProperties,ve as singleton,Me as throttle,Kn as toast,Oe as urlToBase64,_ as urlToBlob,Fe as urlToFile,kt as useClickOutSide,Ct as useCountdown,It as useDefer,R as useEventListener,At as useGetElementSize,Rt as useKeyPress,Dt as useMouseClick,et as useTheme,Ot as useThemePro,Ft as useWindowSize};
|
|
1
|
+
import{A as sn}from "./AutoSliderList-CnWoRtlD.js";import{A as ln}from "./AvatarCrop-C7WQ_IFH.js";import{B as dn}from "./Button-CGyWgrQj.js";import{C as mn}from "./Card3D-NqDUZB0c.js";import{C as fn}from "./Carousel-Bnrz70Tw.js";import{C as wn}from "./Checkbox-Bycqw4Bn.js";import{c as yn}from "./ContextMenu-Boi1cZFI.js";import{F as vn}from "./FileDropZone-BYIzhRqM.js";import{O as Sn,a as En}from "./Input-CTZxreYT.js";import{A as Tn,L as Ln}from "./List-ClfyFOXz.js";import{M as Cn}from "./Mark-DAMtImfr.js";import{M as In}from "./MenuButton-BZMchW23.js";import{m as Dn}from "./Message-C8cydGYH.js";import{M as Fn}from "./Modal-CeiK0vLA.js";import{P as Pn}from "./Pagination-D428PpRD.js";import{R as jn,a as Bn}from "./Radio-DVBUy-W_.js";import{S as Hn}from "./ScrollableTabs-DFUBXElA.js";import{O as _n}from "./Select-DDAqi_ZE.js";import{S as qn}from "./SvgImg-BrKeInXs.js";import{S as Vn}from "./Switch-D91f6RGo.js";import{T as Zn}from "./TemplateDialog-CEfbPFNt.js";import{t as Jn}from "./Toast-nAp61Kbz.js";import{T as tr}from "./Tooltip-Dw-vi5zs.js";import{E as nr,c as rr}from "./VirtualList-_WSK1ci6.js";import{W as ar}from "./Waterfall-CZKvZht-.js";import{c as y}from "react/compiler-runtime";import{useEffect as S,useState as v,useRef as H,useReducer as G,createContext as J,useContext as Q}from "react";import{jsx as Y}from "react/jsx-runtime";import{useShallow as tt}from "zustand/shallow";import et from "react-dom/client";const R=(t)=>Array.isArray(t),M=(t,e)=>{for(const n of t)e(n,t.indexOf(n));},O=(t,e,n)=>{const r=y(19);let o;r[0]!==n ?(o=n||{},r[0]=n,r[1]=o):o=r[1];const{target:a,deps:s,isDeferred:c}=o;let i;r[2]!==e ?(i=(g)=>e(g),r[2]=e,r[3]=i):i=r[3];const l=i;let u,d,h,m;return r[4]!==t||r[5]!==l||r[6]!==c||r[7]!==a ?(u=()=>(typeof t=="string" ?!c&&(a||window).addEventListener(t,l):M(t,(g)=>!c&&(a||window).addEventListener(g,l)),()=>{typeof t=="string" ?(a||window).removeEventListener(t,l):M(t,(g)=>(a||window).removeEventListener(g,l));}),r[4]=t,r[5]=l,r[6]=c,r[7]=a,r[8]=u):u=r[8],r[9]!==s ?(d=s||[],r[9]=s,r[10]=d):d=r[10],r[11]!==d||r[12]!==a ?(h=[a,...d],r[11]=d,r[12]=a,r[13]=h):h=r[13],S(u,h),r[14]!==t||r[15]!==l||r[16]!==c||r[17]!==a ?(m=c ?()=>{typeof t=="string" ?(a||window).addEventListener(t,l):M(t,(g)=>(a||window).addEventListener(g,l));}:void 0,r[14]=t,r[15]=l,r[16]=c,r[17]=a,r[18]=m):m=r[18],m;},At=(t,e,n)=>{const r=y(10),o=n?.event||"click";let a,s,c,i;return r[0]!==o ?(a=((l)=>{const u=typeof l=="string" ? [l]:l;if(new Set(u).size!==u.length)throw new Error("there are duplicates in the event type");return u;})(o),r[0]=o,r[1]=a):a=r[1],r[2]!==e||r[3]!==t ?(s=(l)=>{if(t)if(R(t))t.map(nt).some((u)=>!!u&&u.contains(l.target))||e(l);else{const u=t instanceof HTMLElement ? t:t.current;u&&!u.contains(l.target)&&e(l);}},r[2]=e,r[3]=t,r[4]=s):s=r[4],r[5]!==n?.deps ?(c=n?.deps||[],r[5]=n?.deps,r[6]=c):c=r[6],r[7]!==t||r[8]!==c ?(i={deps:[t,...c]},r[7]=t,r[8]=c,r[9]=i):i=r[9],O(a,s,i);};function nt(t){return t instanceof HTMLElement ? t:t.current;}const It=(t,e)=>{const n=y(12),r=t===void 0 ? 60:t,[o,a]=v(r),[s,c]=v(!1),i=H(null);let l;n[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>c(!0),n[0]=l):l=n[0];const u=l;let d;n[1]!==r||n[2]!==e ?(d=()=>{c(!1),a(r),i.current&&(clearTimeout(i.current),i.current=null),e?.();},n[1]=r,n[2]=e,n[3]=d):d=n[3];const h=d;let m,g,f;return n[4]!==s||n[5]!==o||n[6]!==h ?(m=()=>{if(s)return o>0 ? i.current=setTimeout(()=>{a(rt);},1e3):h(),()=>{i.current&&(clearTimeout(i.current),i.current=null);};},g=[s,o,h],n[4]=s,n[5]=o,n[6]=h,n[7]=m,n[8]=g):(m=n[7],g=n[8]),S(m,g),n[9]!==o||n[10]!==h ?(f=[o,u,h],n[9]=o,n[10]=h,n[11]=f):f=n[11],f;};function rt(t){return t-1;}const Rt=(t)=>{const e=y(8),n=t===void 0 ? 100:t,[r,o]=v(0);let a,s,c,i;if(e[0]!==r||e[1]!==n){const l=()=>a=requestAnimationFrame(()=>{o(r+1),r>=n||l();});l(),e[0]=r,e[1]=n,e[2]=a;}else a=e[2];return e[3]!==a ?(s=()=>()=>{cancelAnimationFrame(a);},e[3]=a,e[4]=s):s=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[5]=c):c=e[5],S(s,c),e[6]!==r ?(i=(l)=>r>l,e[6]=r,e[7]=i):i=e[7],i;},Dt=(t)=>{const e=y(9);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={w:0,h:0},e[0]=n):n=e[0];const [r,o]=v(n);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=new ResizeObserver((d)=>{for(const h of d)o({w:h.borderBoxSize[0].inlineSize,h:h.borderBoxSize[0].blockSize});}),e[1]=a):a=e[1];const s=a;let c;e[2]!==t ?(c=()=>{if(t&&typeof t!="function")s.observe(t instanceof HTMLElement ? t:t.current);else if(t&&typeof t=="function"){const d=t();s.observe(d instanceof HTMLElement ? d:d.current);}else o({w:window.innerWidth,h:window.innerHeight});},e[2]=t,e[3]=c):c=e[3];const i=c;let l,u;return e[4]!==i||e[5]!==t ?(l=()=>(i(),window.addEventListener("resize",i),()=>{if(window.removeEventListener("resize",i),t&&typeof t!="function")s.unobserve(t instanceof HTMLElement ? t:t.current);else if(t&&typeof t=="function"){const d=t();s.unobserve(d instanceof HTMLElement ? d:d.current);}}),e[4]=i,e[5]=t,e[6]=l):l=e[6],e[7]!==t ?(u=[t],e[7]=t,e[8]=u):u=e[8],S(l,u),r;},k=(t)=>t.toString().toLocaleLowerCase(),Ot=(t,e,n)=>{const r=(o)=>O(o,(a)=>((s,c,i)=>{M(s,(l)=>{if(l.includes("+")&&l.length>1){const u=l.split("+"),d=c.ctrlKey&&u.includes("ctrl"),h=c.shiftKey&&u.includes("shift"),m=c.altKey&&u.includes("alt"),g=c.metaKey&&u.includes("meta"),f=(c.ctrlKey||c.metaKey)&&u.includes("commandorcontrol");u.length===2 ?(d||h||m||g||f)&&c.key.toLocaleLowerCase()===u[u.length-1]&&e(c,l):u.length===3&&(d&&h||d&&m||d&&g||d&&f||h&&m||h&&g||h&&f||m&&g||m&&f||g&&f)&&c.key.toLocaleLowerCase()===u[u.length-1]&&e(c,l);}else if(l.includes(k(c.key))){if(i)l===k(c.key)&&e(c,l);else if(!(c.ctrlKey||c.metaKey||c.shiftKey||c.altKey))return e(c,l);}});})(R(t)? t.map((s)=>k(s)):[k(t)],a,n?.exactMatch||!1),{deps:[n?.target,...n?.deps||[]]});R(n?.events)? M(n.events,r):r(n?.events||"keydown");},Ft=()=>{const t=y(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={clientX:0,clientY:0,screenX:0,screenY:0,pageX:0,pageY:0},t[0]=e):e=t[0];const [n,r]=v(e);let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=(a)=>{const s=a.clientX,c=a.clientY,i=a.screenX,l=a.screenY,u=a.pageX,d=a.pageY;r({clientX:s,clientY:c,screenX:i,screenY:l,pageX:u,pageY:d});},t[1]=o):o=t[1],O("click",o),n;};let I=!1;const ot=(t)=>{const e=y(13),{theme:n,onDark:r,onLight:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=window.matchMedia("(prefers-color-scheme:dark)"),e[0]=a):a=e[0];const s=a;let c;e[1]!==r||e[2]!==o ?(c=()=>{s.matches ? r():o();},e[1]=r,e[2]=o,e[3]=c):c=e[3];const i=c;let l;e[4]!==i||e[5]!==r||e[6]!==o||e[7]!==n ?(l=()=>{I&&(I=!1,s.removeEventListener("change",i));t:switch(n){case "light":o();break t;case "dark":r();break t;default:i(),I=!0,s.addEventListener("change",i);}},e[4]=i,e[5]=r,e[6]=o,e[7]=n,e[8]=l):l=e[8];const u=l;let d,h;e[9]!==u ?(d=()=>{u();},e[9]=u,e[10]=d):d=e[10],e[11]!==n ?(h=[n],e[11]=n,e[12]=h):h=e[12],S(d,h);},P=(t)=>{const e="ono-view-transition-clip-path-circle",{element:n,duration:r=300,themeRules:o,onChangeTheme:a}=t,s=o?.()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return a(s==="dark" ? "light":"dark");const c=document.startViewTransition(()=>{const f=document.documentElement.classList.contains("dark");a(f ? "light":"dark");}),{top:i,left:l,width:u,height:d}=n.getBoundingClientRect(),h=l+u/2,m=i+d/2,g=[`circle(0%at ${h}px ${m}px)`,`circle(${Math.hypot(Math.max(h,window.innerWidth-h),Math.max(m,window.innerHeight-m))}px at ${h}px ${m}px)`];((f,b)=>{const p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("data-style-tag",b),p.textContent="::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}",document.head.appendChild(p);})(0,e),c.ready.then(()=>{document.documentElement.animate({clipPath:s==="light" ? g:g.reverse()},{duration:r,fill:"forwards",easing:"ease-in-out",pseudoElement:s==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>((f)=>{const b=document.head.querySelectorAll("style");M([...b],(p)=>{p.getAttribute("data-style-tag")===f&&p.remove();});})(e),r+50);});},Nt=(t)=>{const{initTheme:e="light",themeRules:n=(s)=>{s ? document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");}}=t||Object.assign({}),[r,o]=v(e),a=H(null);return ot({theme:r,onDark:()=>{a.current ? P({element:a.current,onChangeTheme:()=>n(!0)}):n(!0);},onLight:()=>{a.current ? P({element:a.current,onChangeTheme:()=>n(!1)}):n(!1);}}),[r,({targetTheme:s,element:c,onChange:i})=>{a.current=c||null,i?.(),o(s);}];},Pt=()=>{const t=y(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:0,height:0},t[0]=e):e=t[0];const [n,r]=v(e);let o,a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const s=()=>r({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",s),s(),()=>{window.removeEventListener("resize",s);};},a=[],t[1]=o,t[2]=a):(o=t[1],a=t[2]),S(o,a),n;},Ut=(t)=>{const e=window.fetch,n={status:"pending",value:null},r=(...o)=>{if(n.status==="fulfilled")return n.value;throw n.status==="rejected" ? n.value:e(...o).then((a)=>a.json()).then((a)=>{n.status="fulfilled",n.value=a;}).catch((a)=>{n.status="rejected",n.value=a;});};window.fetch=r;try{t();}catch(o){o instanceof Promise&&o.finally(()=>{window.fetch=r,t(),window.fetch=e;});}window.fetch=e;},jt=(t,e)=>{if(!e)return t;const n=new URLSearchParams();for(const [o,a] of Object.entries(e))a!==void 0&&(a===null ? n.append(o,"null"):n.append(o,String(a)));if(![...n.keys()].length)return t;const r=t.includes("?")? "&":"?";return `${t}${r}${n.toString()}`;},at=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);function Bt(){const t=navigator.userAgent;let e="Unknown",n="Unknown";return/Chrome\/(\d+)/.test(t)?(e="Chrome",n=RegExp.$1):/Firefox\/(\d+)/.test(t)?(e="Firefox",n=RegExp.$1):/Safari\/(\d+)/.test(t)&&/Version\/([\d.]+)/.test(t)?(e="Safari",n=RegExp.$1):/Edge\/(\d+)/.test(t)&&(e="Edge",n=RegExp.$1),{name:e,version:n,isMobile:at()};}function zt(t){if(typeof window>"u")return{};if(t)return new URLSearchParams(window.location.search).get(t);{const e=new URLSearchParams(window.location.search),n={};for(const [r,o] of e.entries())n[r]=o;return n;}}const st=(t)=>/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t)? "hex":/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t)? "rgb":"unknown",Ht=(t,e,n)=>{const r=st(t);if(r==="hex"){const o=t.replace("#",""),a=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),c=parseInt(o.slice(4,6),16);if(e==="lighten"){const i=Math.min(255,Math.max(0,a+(255-a)*n/100)),l=Math.min(255,Math.max(0,s+(255-s)*n/100)),u=Math.min(255,Math.max(0,c+(255-c)*n/100));return `#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}if(e==="darken"){const i=Math.min(255,Math.max(0,a-a*n/100)),l=Math.min(255,Math.max(0,s-s*n/100)),u=Math.min(255,Math.max(0,c-c*n/100));return `#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}}else if(r==="rgb"){const o=t.match(/\d+/g),a=parseInt(o[0]),s=parseInt(o[1]),c=parseInt(o[2]);if(e==="lighten")return `rgb(${Math.min(255,Math.max(0,a+(255-a)*n/100))},${Math.min(255,Math.max(0,s+(255-s)*n/100))},${Math.min(255,Math.max(0,c+(255-c)*n/100))})`;if(e==="darken")return `rgb(${Math.min(255,Math.max(0,a-a*n/100))},${Math.min(255,Math.max(0,s-s*n/100))},${Math.min(255,Math.max(0,c-c*n/100))})`;}return t;},_=(t)=>{const e=t.split("#")[1],n=(r)=>[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)];if(e.length===8){const r=parseInt(e.slice(-2),16)/256,o=n(e.slice(0,-2));return o.push(r),"rgba("+o.join(",")+")";}return "rgb("+n(e).join(",")+")";},x=(t)=>t.match(/(\d+\.?\d*)/g),F=(t)=>{const e=x(t),n=Number(e[0])/255,r=Number(e[1])/255,o=Number(e[2])/255,a=Math.min(n,r,o),s=Math.max(n,r,o);let c=0,i=0,l=(s+a)/2;if(s===a)c=i=0;else{const u=s-a;switch(i=l>0.5 ? u/(2-s-a):u/(s+a),s){case n:c=(r-o)/u+(r<o ? 6:0);break;case r:c=(o-n)/u+2;break;case o:c=(n-r)/u+4;}c/=6;}return `hsl(${Math.round(360*c)},${Math.round(100*i)}%,${Math.round(100*l)}%)`;},it=(t)=>F(_(t)),ct=(t)=>{const e=x(t),n=Number(e[0])/360,r=Number(e[1])/100,o=Number(e[2])/100;let a,s,c;function i(d,h,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6 ? d+6*(h-d)*m:m<0.5 ? h:m<2/3 ? d+(h-d)*(2/3-m)*6:d;}let l=o<0.5 ? o*(1+r):o+r-o*r,u=2*o-l;return a=i(u,l,n+1/3),s=i(u,l,n),c=i(u,l,n-1/3),`rgb(${Math.round(255*a)},${Math.round(255*s)},${Math.round(255*c)})`;},N=(t)=>{const e=x(t),n=(a)=>Number(a).toString(16).padStart(2,"0"),r=(a)=>a.reduce((s,c)=>s+n(c),"#"),o=(a)=>{const s=a,c=Number(a[a.length-1])!==1 ? Number(a[a.length-1]):100;return s.pop(),r(s)+n(2.56*c);};return e.length===3 ? r(e):e.length===5 ? o([e[0],e[1],e[2],10*Number(e[e.length-1])]):o(e);},lt=(t)=>N(ct(t)),Yt=(t,e,n)=>{let r=[];if(t.includes("#"))r=x(it(t));else if(t.includes("rgb"))r=x(F(t));else{if(!t.includes("hsl"))throw new Error("颜色格式错误");r=x(t);}return lt(`${r[0]},${r[1]}%,${e==="light" ? Number(r[2])+n>100 ? 100:Number(r[2])+n:Number(r[2])-n<0 ? 0:Number(r[2])-n}%`);},W=(t)=>{const e=x(t);let n=Number(e[0])/255,r=Number(e[1])/255,o=Number(e[2])/255;const a=Math.max(n,r,o),s=Math.min(n,r,o);let c=0,i=0,l=a;const u=a-s;if(i=a===0 ? 0:u/a,a===s)c=0;else{switch(a){case n:c=(r-o)/u+(r<o ? 6:0);break;case r:c=(o-n)/u+2;break;case o:c=(n-r)/u+4;}c/=6;}return `hsv(${360*c},${100*i},${100*l})`;},_t=(t,e=1,n="rgba")=>{const r=x(t);let o=Number(r[0])/255,a=Number(r[1])/255,s=Number(r[2])/255;switch(n){case "rgba":return `rgba(${o},${a},${s},${e})`;case "hex":return N(t);case "hsl":return F(t);case "hsv":return W(t);default:return t;}},Wt=(t)=>{const e=(function(r){if(r.startsWith("#"))return r.length===4&&(r=`#${r.slice(1).repeat(2)}`),[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)];if(r.startsWith("rgb")){const o=r.match(/\d+/g);return [parseInt(o[0]),parseInt(o[1]),parseInt(o[2])];}return null;})(t);return e===null ? null:(299*(n=e)[0]+587*n[1]+114*n[2])/1e3>128 ? "#000":"#fff";var n;},qt=(t,e,n)=>0.2126*t+0.7152*e+0.0722*n,Kt=(t)=>W(_(t)),Vt=(t)=>{const e=t.replace("#","").split("");return `#${e[0]+e[0]+e[1]+e[1]+e[2]+e[2]}`;},ut=(t)=>{const e=x(t);let n=Number(e[0])/360,r=Number(e[1])/100,o=Number(e[2])/100,a=0,s=0,c=0;const i=Math.floor(6*n),l=6*n-i,u=o*(1-r),d=o*(1-l*r),h=o*(1-(1-l)*r);switch(i%6){case 0:a=o,s=h,c=u;break;case 1:a=d,s=o,c=u;break;case 2:a=u,s=o,c=h;break;case 3:a=u,s=d,c=o;break;case 4:a=h,s=u,c=o;break;case 5:a=o,s=u,c=d;}return `rgb(${Math.round(255*a)},${Math.round(255*s)},${Math.round(255*c)})`;},Xt=(t)=>N(ut(t)),Zt=(t)=>!(!/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t)&&!/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t)),Gt=()=>"#"+Math.random().toString(16).slice(2,8).padEnd(6,"0"),Jt=(t,e)=>{if(!e)return t;if(t.includes("rgba")){const n=t.split(",");return n.pop(),n.push(e+")"),n.join(",");}if(t.includes("rgb")){const n=t.split(","),r="rgba("+n[0].split("(")[1],o=n[n.length-1].split(")")[0];return [r,n[1],o," "+e+")"].join(",");}},Qt=(t)=>{if(typeof t!="number"||isNaN(t))throw new Error("请输入有效的数字");const e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".");},te=(t,e,n)=>{const r=t[e];t[e]=function(o){r&&typeof r=="function"&&r.call(this,o),n.call(this,o);};},ee=(...t)=>{let e="";for(let n=0;n<t.length;n++){const r=t[n];r&&(e&&(e+=" "),e+=r);}return e;},ne=(t,e)=>{t.toString().startsWith("2")? e.onSuccess&&e.onSuccess():(t.toString().startsWith("4")||t.toString().startsWith("5"))&&e.onFail&&e.onFail();},re=(t)=>navigator.clipboard.writeText(t),oe=(t,e)=>{let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r),n=null;},e);};},dt=(t)=>{if(typeof t!="object"||t===null)return t;const e=Array.isArray(t)? []:{};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=dt(t[n]));return e;},ae=(t,e,n=t.length)=>e>=t.length ? t:(e<0&&(e=Math.max(0,e+t.length)),n<0&&(n=t.length+n),e>n&&([e,n]=[n,e]),e=Math.max(0,Math.min(e,t.length)),(n=Math.max(0,Math.min(n,t.length)))-e>3 ? t.substring(0,e)+"..."+t.substring(n):t),se=(t)=>typeof t!="string"||t.length===0 ? "":t.charAt(0).toUpperCase()+t.slice(1),C=(t,e)=>{for(const n of t)e(n,t.indexOf(n));},U=(t,e)=>{for(t=Math.abs(t),e=Math.abs(e);e!==0;){const n=e;e=t%e,t=n;}return t;},ie=(t)=>new Promise((e,n)=>{const r=new Image();let o=null;const a=()=>{o&&URL.revokeObjectURL(o);};r.onload=()=>{a(),e({width:r.width,height:r.height});},r.onerror=()=>{a(),n(new Error("Failed to load image"));},typeof t=="string" ? r.src=t:(o=URL.createObjectURL(t),r.src=o);}),ce=(t,e,n,r)=>Math.sqrt((t-n)**2+(e-r)**2),le=(t,e)=>`${Math.floor(t/U(t,e))}:${Math.floor(e/U(t,e))}`,ue=(t)=>Array.from(new Intl.Segmenter("en").segment(t)).length,ht=(t)=>{const e=new Set();for(const n of t){if(e.has(n))return!0;e.add(n);}return!1;},de=(t)=>/^\d+$/.test(t),w=(t)=>t<10 ? `0${t}`:`${t}`,he=(t)=>{const e={};return t.replace(/([^?=&]+)=([^&]+)/g,(n,r,o)=>e[r]=o),e;},me=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+])[\da-zA-Z]{8,}$/,ge=(t)=>navigator.clipboard.readText().then((e)=>t(e)),fe=({el:t,str:e="hello world",speed:n=100,isExtendStr:r=!0,onDone:o})=>{let a=0,s=null;t.textContent&&r&&(a=t.textContent.length,e=t.textContent+e);const c=()=>{clearTimeout(s);const i=e.substring(0,a+1);t.textContent=i,a++,a!==e.length ? s=setTimeout(c,n):o?.();};c();},pe=(t)=>parseFloat(t.replace(/[^0-9.]/g,"")),we=(t)=>{if(t.length<2)return [...t];const e=[...t];return D(e,0,e.length-1),e;};function D(t,e,n){if(e<n){const r=(function(o,a,s){const c=o[s];let i=a-1;for(let l=a;l<s;l++)o[l]<=c&&(i++,[o[i],o[l]]=[o[l],o[i]]);return [o[i+1],o[s]]=[o[s],o[i+1]],i+1;})(t,e,n);D(t,e,r-1),D(t,r+1,n);}}const be=(t,e)=>{let n=0;const r=(o)=>{n||(n=o),o-n>=e ? t():requestAnimationFrame(r);};requestAnimationFrame(r);},ye=(t)=>{if(t<=0)return "";let e="";for(let n=0;n<t;n++)e+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(62*Math.random()));return e;},xe=(t)=>new DOMParser().parseFromString(t,"text/html").body.textContent||"",mt=(t,e,n)=>{const{maxWidth:r,maxHeight:o,allowUpscale:a=!1}=Object.assign({maxWidth:1e3,maxHeight:1e3,allowUpscale:!0},n),s=t/r,c=e/o;let i;if(a)i=Math.max(s,c);else if(i=Math.max(s,c),i<=1)return{initWidth:t,initHeight:e};const l=t/i,u=e/i;return{initWidth:Math.round(l),initHeight:Math.round(u)};},ve=({currentIndex:t,itemHeight:e,total:n,showMaxNumber:r,element:o})=>{if(n<=0||r<=0||e<=0||n<=r)return;const a=Math.floor(o.scrollTop/e);if(t>=a&&t<=a+r-1)return;let s;s=t<a ? t*e:(t-r+1)*e;const c=(n-r)*e;s=Math.max(0,Math.min(c,s)),s!==o.scrollTop&&o.scrollTo({top:s});},Me=(t,e=[],n=!0)=>{if(e.length===0)return t;if(ht(e))throw new Error("Each item in properties must be unique");if(n){const r={};for(const o of e)r[o]=t[o];return r;}{const r=new Set(e),o={};for(const a in t)r.has(a)||(o[a]=t[a]);return o;}},Se=(t)=>{let e;const n=new Proxy(t,{construct:(r,o)=>(e||(e=Reflect.construct(r,o)),e)});return n.prototype.construct=n,n;};function Ee(t,e,n={}){let r,o=null,a=null,s=0;const c=n.leading!==!1,i=n.trailing!==!1;function l(){a&&(t.apply(r,a),a=null);}function u(){const h=Date.now();h-s>=e ?(i&&a&&l(),o=null):o=setTimeout(u,e-(h-s));}const d=function(...h){const m=Date.now();a=h,r=this,m-s>=e ? o||(s=m,c ? l():i&&(o=setTimeout(u,e))):!o&&i&&(o=setTimeout(u,e-(m-s)));};return d.cancel=function(){o&&(clearTimeout(o),o=null),s=0,a=null;},d;}const j=(t)=>new Promise((e)=>{const n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.videoWidth,n.height=t.videoHeight,r.drawImage(t,0,0,n.width,n.height),n.toBlob((o)=>e({blob:o,url:URL.createObjectURL(o)})),n.remove();}),B=(t,e)=>new Promise((n)=>{if(t instanceof HTMLVideoElement)t.currentTime=e,t.muted=!0,t.autoplay=!0,t.oncanplay=async()=>n(await j(t));else{const r=document.createElement("video");r.currentTime=e,r.muted=!0,r.autoplay=!0,r.src=typeof t=="string" ? t:URL.createObjectURL(t),r.oncanplay=async()=>n(await j(r));}}),$e=(t,e)=>{if(t instanceof HTMLVideoElement)return Promise.all(e.map((n)=>B(t,n)));{const n=document.createElement("video");return n.src=typeof t=="string" ? t:URL.createObjectURL(t),Promise.all(e.map((r)=>B(n,r)));}},gt=(t)=>new Promise((e,n)=>{const r=new Image();if(typeof t=="string"){const o=()=>{r.onload=null,r.onerror=null;};r.onload=()=>{o(),e(r);},r.onerror=()=>{o(),n(new Error(`Failed to load image:${t}`));},r.src=t;}else{const o=URL.createObjectURL(t),a=()=>{r.onload=null,r.onerror=null,URL.revokeObjectURL(o);};r.onload=()=>{a(),e(r);},r.onerror=()=>{a(),n(new Error("Failed to load image from File"));},r.src=o;}}),ft=async(t,e)=>{const n=(r,o)=>{const a=window.URL.createObjectURL(r),s=document.createElement("a");s.href=a,s.download=encodeURIComponent(o),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a);};try{if(typeof t=="string"){const r=await fetch(t);if(!r.ok)throw new Error(`Network response was not ok:${r.statusText}`);n(await r.blob(),e);}else n(t,e);}catch{}},Te=async(t,e)=>{const{filename:n,imageWidth:r,imageHeight:o}=Object.assign({filename:"download.html",imageWidth:1e3,imageHeight:1e3},e),a=document.createElement("canvas"),s=a.getContext("2d",{willReadFrequently:!0});((c,i,l,u,d,h)=>{const m=[],{initWidth:g,initHeight:f}=mt(c.naturalWidth,c.naturalHeight,{maxWidth:d,maxHeight:h}),b=i.width=g,p=i.height=f;if(l?.drawImage(c,0,0,b,p),(function A(){if(l.getImageData(b-1,p-1,1,1).data[3]>0)for(let $=0;$<b;$++)for(let T=0;T<p;T++){const L=l.getImageData($,T,1,1).data;m.push(`${$}px ${T}px rgba(${L[0]},${L[1]},${L[2]},${L[3]/255})`);}else requestAnimationFrame(A);})(),m.length>=b*p){const A=`<html><head><title>Generated HTML</title><style>*{margin:0;padding:0;box-sizing:border-box;}.item{width:1px;height:1px;box-shadow:${m.join(",")};}</style></head><body><div class="item"></div></body></html>`;ft(URL.createObjectURL(new Blob([A],{type:"text/html"})),u.endsWith(".html")? u:u+".html");}})(t instanceof HTMLImageElement ? t:await gt(t),a,s,n,r,o);},Le=(t,e="viewport")=>{const n=t.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2;switch(e){case "page":return{x:r+window.pageXOffset,y:o+window.pageYOffset};case "parent":const a=t.parentElement;if(!a)return{x:r,y:o};const s=a.getBoundingClientRect();return{x:r-(s.left+s.width/2),y:o-(s.top+s.height/2)};default:return{x:r,y:o};}},ke=(t,e,n)=>{t.muted=!0,t.play();const r=new AudioContext(),o=r.state==="running";r.close(),o ?(t.muted=!1,e?.()):n?.();},pt=/^data:image\/([a-zA-Z]*);base64,([^\s]*)$/,wt=/^[A-Za-z0-9+/]*={0,2}$/,q=(t)=>{if(typeof t!="string"||t.length===0)return!1;if(pt.test(t))return!0;if(t.length%4!=0||!wt.test(t))return!1;if(t.length<=100)return!0;try{return btoa(atob(t))===t;}catch{return!1;}},Ce=(t)=>{if(!q(t))throw new Error("Invalid base64 string");const e=t.indexOf(","),n=t.substring(0,e).match(/:(.*?);/);if(!n||!n[1])throw new Error("Could not extract MIME type from base64 string");const r=n[1],o=atob(t.substring(e+1)),a=new Uint8Array(o.length);for(let s=0;s<o.length;s++)a[s]=o.charCodeAt(s);return new Blob([a],{type:r});},Ae=(t,e)=>{if(!q(t))throw new Error("Invalid base64 string");const n=t.indexOf(","),r=t.substring(0,n),o=t.substring(n+1),a=r.match(/:(.*?);/);if(!a||!a[1])throw new Error("Could not extract MIME type from base64 string");const s=a[1],c=atob(o),i=new Uint8Array(c.length);for(let h=0;h<c.length;h++)i[h]=c.charCodeAt(h);const l=s.split("/"),u=l[1]==="jpeg" ? ".jpg":"."+l[1],d=new Blob([i],{type:s});return new File([d],e+u,{type:s,lastModified:Date.now()});},bt=(t)=>new Promise((e)=>{const n=new FileReader();n.readAsDataURL(t),n.onload=(r)=>{const o=r.target?.result,a=o.split(",")[1];e(a);};}),yt=(t,e="abc.jpg")=>new File([t],e,{type:t.type}),Ie=(t)=>new Promise((e)=>{const n=new FileReader();n.readAsDataURL(t),n.onload=(r)=>e(r.target?.result);}),Re=(t)=>t.slice(0,t.size,t.type),De=(t,e)=>{const n=["B","KB","MB","GB","TB"];let r=n.indexOf(e?.unit ?? "B");if(r===-1)throw new Error("Invalid unit");if(!e?.unit)for(;t/Math.pow(1024,r)>=1024;)r++;return `${(t/Math.pow(1024,r)).toFixed(e?.decimalPlaces ?? 0)}${n[r]}`;},xt=(t)=>{if(!t)return "";const e=t.lastIndexOf(".");return e===-1 ? xt(t.substring(t.lastIndexOf("/")+1)):t.substring(0,e);},Oe=(t)=>{if(!t)return "";const e=t.lastIndexOf(".");return t.substring(e+1);},Fe=(t,e)=>{const{onReaderLoad:n,onImageLoad:r}=e||{};return new Promise((o,a)=>{const s=new FileReader();s.onload=(c)=>{const i=new Image();i.onload=()=>{o(i),r?.(i);},i.onerror=a,i.src=c.target?.result,n?.(c);},s.onerror=a,s.readAsDataURL(t);});},K=async(t)=>await(await fetch(t)).blob(),Ne=async(t)=>await bt(await K(t)),Pe=async(t)=>yt(await K(t)),Ue=(t,e,n)=>{const r=new IntersectionObserver(e,n);t instanceof HTMLElement ? r.observe(t):C(t,(o)=>r.observe(o));},je=(t,e,n,r={root:null,rootMargin:"0px",threshold:0})=>{const o=new IntersectionObserver((a)=>C(a,(s)=>s.isIntersecting ? e(s):n(s)),r);C(t,(a)=>o.observe(a));},Be=(t)=>Array.isArray(t),ze=typeof window<"u"&&window.document!==void 0,He=typeof global<"u"&&typeof process<"u"&&process.versions?.node!=null,Ye=(t)=>Object.prototype.toString.call(t)==="[object Object]",vt=({onAndroid:t,onIOS:e,onUnknown:n})=>{const r=navigator.userAgent;return/android/i.test(r)?(t(),"Android"):/iPad|iPhone|iPod/.test(r)?(e(),"iOS"):(n?.(),"Unknown");},_e=({onAndroid:t,onIOS:e,onUnknown:n,timeout:r=500})=>()=>{setTimeout(()=>vt({onAndroid:t,onIOS:e,onUnknown:n}),r);},We=(t,e)=>{const n={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!n[e])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(t/n[e]);},qe=(t)=>Math.ceil((t.getTime()-new Date(t.getFullYear(),0,1).getTime())/864e5),Ke=(t)=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%60),o=(a)=>a.toString().padStart(2,"0");return(e>0 ? `${o(e)}:${o(n)}:${o(r)}`:`${o(n)}:${o(r)}`)+(t<10 ? ".00":t<100 ? ".0":"");},V=(t)=>t.toString().length>13 ? new Date(Number(t.toString().substring(0,13))):t.toString().length===13 ? new Date(t):t.toString().length<13&&t.toString().length>10 ? new Date(Number((t.toString()+"000").substring(0,13))):t.toString().length===10 ? new Date(1e3*t):new Date(Number((t.toString()+"000000000000").substring(0,13))),Ve=(t,e="YY-MM-DD hh:mm:ss")=>{const n=["YY","MM","DD","hh","mm","ss"],r=[],o=V(t);r.push(o.getFullYear().toString()),r.push(w(o.getMonth()+1)),r.push(w(o.getDate())),r.push(w(o.getHours())),r.push(w(o.getMinutes())),r.push(w(o.getSeconds()));for(let a in r)e=e.replace(n[a],r[a]);return e;},Xe=(t)=>{const e=new Date(1e3*t),n=new Date();return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear();},Ze=(t,e="YY-MM-DD hh:mm:ss",n="cn")=>{const r=["YY","MM","DD","hh","mm","ss"],o=[],a=V(t);o.push(((s,c)=>{const i={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return s.split("").map((l)=>i[c][Number(l)]).join("");})(a.getFullYear().toString(),n)),o.push(((s,c)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[c][Number(s)-1])(w(a.getMonth()+1),n)),o.push(((s,c)=>{let i;return c==="en" ? i=s==="01"||s==="21"||s==="31" ? Number(s)+"st":s==="02"||s==="22" ? Number(s)+"nd":s==="03"||s==="23" ? Number(s)+"rd":Number(s)+"th":s==="01" ? i="一日":s==="02" ? i="二日":s==="03" ? i="三日":s==="04" ? i="四日":s==="05" ? i="五日":s==="06" ? i="六日":s==="07" ? i="七日":s==="08" ? i="八日":s==="09" ? i="九日":s==="10" ? i="十日":s==="11" ? i="十一日":s==="12" ? i="十二日":s==="13" ? i="十三日":s==="14" ? i="十四日":s==="15" ? i="十五日":s==="16" ? i="十六日":s==="17" ? i="十七日":s==="18" ? i="十八日":s==="19" ? i="十九日":s==="20" ? i="二十日":s==="21" ? i="二十一日":s==="22" ? i="二十二日":s==="23" ? i="二十三日":s==="24" ? i="二十四日":s==="25" ? i="二十五日":s==="26" ? i="二十六日":s==="27" ? i="二十七日":s==="28" ? i="二十八日":s==="29" ? i="二十九日":s==="30" ? i="三十日":s==="31"&&(i="三十一日"),i ?? s;})(w(a.getDate()),n)),o.push(w(a.getHours())),o.push(w(a.getMinutes())),o.push(w(a.getSeconds()));for(let s in o)e=e.replace(r[s],o[s]);return e;},Ge=(t,e)=>{const n=["DD","hh","mm","ss"],r=[];r.push(Math.floor(t/86400)),r.push(w(Math.floor(t%86400/3600))),r.push(w(Math.floor(t%3600/60))),r.push(w(t%60));for(let o=0;o<n.length;o++)e=e.replace(n[o],r[o].toString());return e;},Je=(t)=>{const e="ono-view-transition-clip-path-circle",{element:n,duration:r=300,themeRules:o,onChangeTheme:a}=t,s=o?.()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return a(s==="dark" ? "light":"dark");const c=document.startViewTransition(()=>{const f=document.documentElement.classList.contains("dark");a(f ? "light":"dark");}),{top:i,left:l,width:u,height:d}=n.getBoundingClientRect(),h=l+u/2,m=i+d/2,g=[`circle(0%at ${h}px ${m}px)`,`circle(${Math.hypot(Math.max(h,window.innerWidth-h),Math.max(m,window.innerHeight-m))}px at ${h}px ${m}px)`];((f,b)=>{const p=document.createElement("style");p.setAttribute("type","text/css"),p.setAttribute("data-style-tag",b),p.textContent="::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}",document.head.appendChild(p);})(0,e),c.ready.then(()=>{document.documentElement.animate({clipPath:s==="light" ? g:g.reverse()},{duration:r,fill:"forwards",easing:"ease-in-out",pseudoElement:s==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>((f)=>{const b=document.head.querySelectorAll("style");C([...b],(p)=>{p.getAttribute("data-style-tag")===f&&p.remove();});})(e),r+50);});},X=(t,e=[],n=!0)=>{if(e.length===0)return t;if(((r)=>{const o=new Set();for(const a of r){if(o.has(a))return!0;o.add(a);}return!1;})(e))throw new Error("Each item in properties must be unique");if(n){const r={};for(const o of e)r[o]=t[o];return r;}{const r=new Set(e),o={};for(const a in t)r.has(a)||(o[a]=t[a]);return o;}},Qe=(t)=>{function e(n){return n ? t(tt((r)=>X(r,((o)=>Array.isArray(o))(n)? n:[n]))):t();}return e.setState=t.setState,e;},Mt={get:(t)=>t,set:(t,e)=>({...t,[e.key]:e.value}),del:(t,e)=>{const n={...t};return delete n[e.key],n;}},St=(t,e)=>Mt[e.type](t,e),Z=J(null),tn=(t)=>{const e=y(5),{initData:n,children:r}=t,[o,a]=G(St,n);let s,c;return e[0]!==o ?(s={data:o,dispatch:a},e[0]=o,e[1]=s):s=e[1],e[2]!==r||e[3]!==s ?(c=Y(Z.Provider,{value:s,children:r}),e[2]=r,e[3]=s,e[4]=c):c=e[4],c;},Et=(t)=>{const e=y(9),n=Q(Z);if(!n)throw new Error("useData must be used within a DataProvider");let r;e[0]!==n ?(r={set:(c,i)=>n.dispatch({type:"set",key:c,value:i}),setAll:(c)=>{((i,l)=>{for(const u of i)l(u,i.indexOf(u));})(Object.keys(c),(i)=>n.dispatch({type:"set",key:i,value:c[i]}));},del:(c)=>n.dispatch({type:"del",key:c})},e[0]=n,e[1]=r):r=e[1];const o=r;let a,s;return e[2]!==n.data||e[3]!==t ?(a=t ? X(n.data,t):n.data,e[2]=n.data,e[3]=t,e[4]=a):a=e[4],e[5]!==n.dispatch||e[6]!==o||e[7]!==a ?(s={data:a,dispatch:o,originDispatch:n.dispatch},e[5]=n.dispatch,e[6]=o,e[7]=a,e[8]=s):s=e[8],s;},en=()=>Et,E=new Map(),nn=(t,e,n,r)=>{const{target:o,root:a,reactRoot:s}=((i,l)=>{const u=i||`${l}-${Math.random().toString(36)}`;if(E.has(u)){const f=E.get(u);if(document.contains(f.target))return f;E.delete(u);}let d,h,m=null;l&&(m=document.getElementById(l),m||(m=document.createElement("div"),m.id=l,document.body.appendChild(m))),i ?(d=document.getElementById(i)?? document.createElement("div"),d.id||(d.id=i,m ? m.appendChild(d):document.body.appendChild(d))):(d=document.createElement("div"),m ? m.appendChild(d):document.body.appendChild(d)),d.__reactContainer$ ? h=d.__reactContainer$:(h=et.createRoot(d),d.__reactContainer$=h);const g={target:d,root:m,reactRoot:h};return E.set(u,g),g;})(n,r),c=(i)=>{try{typeof i=="function"&&i();const l=n||`${r}-${Math.random().toString(36)}`;E.delete(l),s.unmount(),n ? document.getElementById(n)?.remove():o.remove(),requestAnimationFrame(()=>{a&&a.children.length===0&&a.remove();});}catch{}};return s.render(Y(t,{...e,destroy:c})),c;};class z{events={};constructor(e){for(let n=0;n<e.length;n++)this.events[e[n]]=new Set();}createEvent(e,n=!1){this.events[e]&&!n||(this.events[e]=new Set());}emit(e,...n){if(!this.events[e])throw new Error(`Event ${e}does not exist`);((r,o)=>{for(const a of r)o(a,r.indexOf(a));})([...this.events[e]],(r)=>{r(...n);});}on(e,n,r=!0){this.createEvent(e,r),this.events[e].add(n);}cancel(e,n){this.events[e]&&this.events[e].delete(n);}clear(e){if(e)this.createEvent(e,!0);else{const n=Object.keys(this.events);for(let r=0;r<n.length;r++)this.createEvent(n[r],!0);}}}function rn(t,e=!1){const n=new((()=>{let r;const o=new Proxy(z,{construct:(a,s)=>(r||(r=Reflect.construct(a,s)),r)});return o.prototype.construct=o,o;})())(t);return e ? n:new z(t);}export{sn as AutoSliderList,ln as AvatarCrop,Tn as AwaitList,dn as Button,mn as Card3D,fn as Carousel,wn as Checkbox,tn as DataProvider,nr as EstimatedVirtualList,vn as FileDropZone,Ln as List,Cn as Mark,In as MenuButton,Fn as Modal,Sn as OnoInput,_n as OnoSelect,En as OnoTextarea,Pn as Pagination,jn as Radio,Bn as RadioGroup,Hn as ScrollableTabs,qn as SvgImg,Vn as Switch,Zn as TemplateDialog,tr as Tooltip,ar as Waterfall,Qt as addCommasToNumber,te as addEventWithOriginHandler,Ht as adjustColor,Yt as adjustingColors,Ce as base64ToBlob,Ae as base64ToFile,bt as blobToBase64,yt as blobToFile,B as captureFrame,$e as captureFrames,ee as chainClassNames,Je as changeThemeClipPathCircle,jt as changeUrlByParams,at as checkDeviceIsMobile,ne as checkStatusCode,Ut as clearAsyncContagion,yn as contextMenu,We as convertSecondToOtherTime,re as copyText,en as createContextData,rr as createDataSource,Qe as createDesignateStore,rn as createEventEmitter,Te as createImageHTML,Ue as createIntersectionObserver,qe as dayOfYear,oe as debounce,dt as deepCopy,vt as distinguishPlatform,_e as distinguishPlatformDelay,ft as downloadFile,je as elementIsInViewport,ae as ellipsisString,Ie as fileToBase64,Re as fileToBlob,se as firstLetter2Capitalize,C as forEach,_t as formatColor,De as formatFileSize,Ke as formatSecond,Ve as formatTime,U as gcd,x as getAllNumbers,Bt as getBrowserInfo,st as getColorType,Wt as getContrastColor,Le as getElementCenterPosition,xt as getFileName,Oe as getFileSuffix,ie as getImageSize,ce as getPointDistance,le as getRatio,ue as getStringRealLenght,zt as getURLSearchParams,qt as grayColor,ht as hasDuplicates,it as hex2hsl,Kt as hex2hsv,_ as hex2rgb,Vt as hex3To6,lt as hsl2hex,ct as hsl2rgb,Xt as hsv2hex,ut as hsv2rgb,Be as isArray,q as isBase64,ze as isBrowser,He as isNode,Ye as isObject,de as isPureNumber,Xe as isToday,Zt as isValidColor,gt as loadImage,Ze as localFormat,ke as mediaAutoplayPolicies,Dn as message,w as padZero,he as parseQuery,me as passwordStrength,ge as pasteText,nn as portalRenderer,fe as printStr,pe as pureNumber,we as quickSort,be as rafTimeout,Gt as randomColor,ye as randomString,Fe as readerImageFile,xe as removeTag,N as rgb2hex,F as rgb2hsl,W as rgb2hsv,Jt as rgb2rgba,mt as scaleSize,ve as scrollToItem,Ge as second2Day,Me as selectProperties,Se as singleton,Ee as throttle,Jn as toast,Ne as urlToBase64,K as urlToBlob,Pe as urlToFile,At as useClickOutSide,It as useCountdown,Rt as useDefer,O as useEventListener,Dt as useGetElementSize,Ot as useKeyPress,Ft as useMouseClick,ot as useTheme,Nt as useThemePro,Pt as useWindowSize};
|