UNPKG

react-loadly

Version:

⚛️ React Loadly - Modern React loader, spinner, and skeleton loader components. High-performance loading indicators for React apps with TypeScript support, Next.js compatibility, accessibility, and 30+ customizable animations. Perfect for dashboards, form

1 lines 67.2 kB
import e,{useMemo as t,useRef as a,useState as r,useEffect as n,cloneElement as l,useCallback as i}from"react";function o(e,t){const a={...e};for(const r in t){const e=t[r];void 0!==e&&(a[r]=e)}return a}function s(e,t="40px"){return void 0===e?t:"number"==typeof e?`${e}px`:e}function d(e){const t={};return Object.entries(e).forEach(([e,a])=>{void 0!==a&&(t[e]=a)}),t}function c(e,t=1){return`${e/Math.max(t,.1)}ms`}function u(e){return`react-loadly-${e}`}function y(){if("undefined"==typeof window||!window.matchMedia)return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}function m(e=1,t=!0){if("undefined"!=typeof process&&"test"===process.env.NODE_ENV)return{duration:"0ms",playState:"paused",iterationCount:1};const a=t&&y();return{duration:a?"0ms":c(1e3,e),playState:a?"paused":"running",iterationCount:a?1:"infinite"}}function p(e="normal"){return e}function g(e="ease"){return e}function h(e,t,a="ease",r="normal",n="infinite"){return`${e} ${t} ${a} ${r} ${n}`}function f(e,t,a){return Math.min(Math.max(e,t),a)}function v(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function x(e,t){const a=v(e);return a?`rgba(${a.r}, ${a.g}, ${a.b}, ${f(t,0,1)})`:e}function b(e="loader"){return`${e}-${Math.random().toString(36).substr(2,9)}`}function $(e){if(null!=e)return"number"==typeof e?`${e}px`:"string"==typeof e?e.replace(/[<>'"]/g,""):void 0}function w(...e){return e.flat().filter(e=>"string"==typeof e&&e.trim()).join(" ")}const C=({size:t=8,color:a="var(--react-loadly-color)",opacity:r=1,className:n="",style:l={},animation:i,animationDuration:o,animationDelay:d,glowIntensity:c=0,"data-testid":u,...y})=>{const m=s(t),p={width:m,height:m,borderRadius:"50%",backgroundColor:a,opacity:r,animation:i?`${i} ${o||"1s"} infinite`:void 0,animationDelay:d,display:"inline-block",boxShadow:c>0?`0 0 ${10*c}px ${a}`:void 0,...l};return e.createElement("div",{className:`react-loadly-dot ${n}`.trim(),style:p,"data-testid":u,...y})},E=({width:t=30,height:a=4,color:r="var(--react-loadly-color)",opacity:n=1,borderRadius:l=2,className:i="",style:o={},animation:d,animationDuration:c,animationDelay:u,orientation:y="horizontal","data-testid":m,...p})=>{const g=s(t),h=s(a),f={width:"vertical"===y?h:g,height:"vertical"===y?g:h,backgroundColor:r,opacity:n,borderRadius:$(l),animation:d?`${d} ${c||"1s"} infinite`:void 0,animationDelay:u,display:"inline-block",...o};return e.createElement("div",{className:`react-loadly-line react-loadly-line-${y} ${i}`.trim(),style:f,"data-testid":m,...p})},k=({width:t=20,height:a=20,color:r="var(--react-loadly-color)",borderColor:n,borderWidth:l=0,borderRadius:i=0,opacity:o=1,className:d="",style:c={},animation:u,animationDuration:y,animationDelay:m,"data-testid":p,...g})=>{const h=s(t),f=s(a),v=$(l),x={width:h,height:f,backgroundColor:n?"transparent":r,border:n?`${v} solid ${n}`:void 0,borderRadius:$(i),opacity:o,animation:u?`${u} ${y||"1s"} infinite`:void 0,animationDelay:m,display:"inline-block",...c};return e.createElement("div",{className:`react-loadly-rectangle ${d}`.trim(),style:x,"data-testid":p,...g})},N=({size:t=20,color:a="var(--react-loadly-color)",borderColor:r,borderWidth:n=0,opacity:l=1,className:i="",style:o={},animation:d,animationDuration:c,animationDelay:u,"data-testid":y,...m})=>{const p=s(t),g=$(n),h={width:p,height:p,borderRadius:"50%",backgroundColor:r?"transparent":a,border:r?`${g} solid ${r}`:void 0,opacity:l,animation:d?`${d} ${c||"1s"} infinite`:void 0,animationDelay:u,display:"inline-block",...o};return e.createElement("div",{className:`react-loadly-circle ${i}`.trim(),style:h,"data-testid":y,...m})},I=({count:t=3,dotSize:a=8,color:r="var(--react-loadly-color)",secondaryColor:n,spacing:l=8,speed:i=1,arrangement:o="linear",className:d="",style:u={},animationType:y="wave","data-testid":m,...p})=>{const g=s(l),h=c(1200,i),f=e=>{if("circular"===o){const a=e/t*2*Math.PI,r=parseInt(g);return{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%, -50%) translate(${Math.cos(a)*r}px, ${Math.sin(a)*r}px)`}}return{}},v=e=>.1*e/i+"s",x={...(()=>{switch(o){case"circular":return{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",width:2*(parseInt(s(a))+parseInt(g))+"px",height:2*(parseInt(s(a))+parseInt(g))+"px"};case"grid":return{display:"grid",gridTemplateColumns:`repeat(${Math.ceil(Math.sqrt(t))}, 1fr)`,gap:g};default:return{display:"flex",alignItems:"center",gap:g}}})(),...u};return e.createElement("div",{className:`react-loadly-dot-cluster react-loadly-dot-cluster-${o} ${d}`.trim(),style:x,"data-testid":m,...p},Array.from({length:t},(t,l)=>e.createElement(C,{key:l,size:a,color:n&&l%2==1?n:r,animation:`react-loadly-${y}`,animationDuration:h,animationDelay:v(l),style:f(l),"data-testid":m?`${m}-dot-${l}`:void 0})))},z=({count:t=5,lineWidth:a=4,lineHeight:r=35,color:n="var(--react-loadly-color)",secondaryColor:l,spacing:i=6,speed:o=1,arrangement:d="parallel",orientation:u="vertical",className:y="",style:m={},animationType:p="wave","data-testid":g,...h})=>{const f=s(i),v=c(1e3,o),x=e=>{if("radial"===d){return{position:"absolute",left:"50%",top:"50%",transformOrigin:"center",transform:`translate(-50%, -50%) rotate(${e/t*2*Math.PI}rad)`}}if("staggered"===d){const a=.3+.7*Math.sin(e/t*Math.PI);return{height:"vertical"===u?parseInt(s(r))*a+"px":s(r)}}return{}},b=e=>.1*e/o+"s",$={...(()=>{switch(d){case"radial":return{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",width:1.5*parseInt(s(r))+"px",height:1.5*parseInt(s(r))+"px"};case"staggered":return{display:"flex",alignItems:"flex-end",justifyContent:"center",gap:f};default:return{display:"flex",alignItems:"center",justifyContent:"center",gap:f}}})(),...m};return e.createElement("div",{className:`react-loadly-line-group react-loadly-line-group-${d} ${y}`.trim(),style:$,"data-testid":g,...h},Array.from({length:t},(t,i)=>e.createElement(E,{key:i,width:"horizontal"===u?a:r,height:"horizontal"===u?r:a,color:l&&i%2==1?l:n,orientation:u,animation:`react-loadly-${p}`,animationDuration:v,animationDelay:b(i),style:x(i),"data-testid":g?`${g}-line-${i}`:void 0})))},L=({count:t=4,shapeSize:a=16,color:r="var(--react-loadly-color)",secondaryColor:n,spacing:l=8,speed:i=1,arrangement:o="linear",shapeTypes:d=["circle","rectangle"],className:u="",style:y={},animationType:m="pulse",borderWidth:p=0,"data-testid":g,...h})=>{const f=s(l),v=c(800,i),x=e=>{if("circular"===o){const a=e/t*2*Math.PI,r=2*parseInt(f);return{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%, -50%) translate(${Math.cos(a)*r}px, ${Math.sin(a)*r}px)`}}if("spiral"===o){const a=e/t*4*Math.PI,r=(e+1)*parseInt(f)/2;return{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%, -50%) translate(${Math.cos(a)*r}px, ${Math.sin(a)*r}px)`}}return{}},b=e=>.15*e/i+"s",$={...(()=>{switch(o){case"circular":return{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",width:2.5*(parseInt(s(a))+parseInt(f))+"px",height:2.5*(parseInt(s(a))+parseInt(f))+"px"};case"spiral":return{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",width:3*(parseInt(s(a))+parseInt(f))+"px",height:3*(parseInt(s(a))+parseInt(f))+"px"};default:return{display:"flex",alignItems:"center",gap:f}}})(),...y},w=t=>{const l=(e=>d[e%d.length])(t),i=n&&t%2==1?n:r,o={key:t,color:p>0?void 0:i,borderColor:p>0?i:void 0,borderWidth:p>0?p:void 0,animation:`react-loadly-${m}`,animationDuration:v,animationDelay:b(t),style:x(t),"data-testid":g?`${g}-shape-${t}`:void 0};return"circle"===l?e.createElement(N,{...o,size:a}):e.createElement(k,{...o,width:a,height:a})};return e.createElement("div",{className:`react-loadly-shape-group react-loadly-shape-group-${o} ${u}`.trim(),style:$,"data-testid":g,...h},Array.from({length:t},(e,t)=>w(t)))},M={size:20,color:"var(--react-loadly-color)",speed:1,loading:!0,count:5,"aria-label":"Loading..."},T=a=>{const r=o(M,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,className:u="",style:y={},count:p=5,showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("bars-loader"),[]),z=s(n),L=m(d);if(!c)return null;const T={display:"inline-flex",flexDirection:"column",alignItems:"center",...y,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":y.justifyContent}},D={width:"4px",height:z,backgroundColor:l,borderRadius:"2px",animation:`react-loadly-bars ${L.duration} ease-in-out infinite`,animationPlayState:L.playState},j=Array.from({length:p}).map((t,a)=>{const r=.1*a+"s",n=.5+a%3*.25,o=i&&a%2==1?i:l;return e.createElement("div",{key:a,style:{...D,animationDelay:r,height:parseFloat(z)*n+"px",backgroundColor:o},"data-testid":v?`${v}-bar-${a}`:void 0})});return e.createElement("div",{className:w("react-loadly react-loadly-bars",u),style:T,role:"status","aria-label":f,"aria-live":"polite","aria-busy":c,"data-testid":v,...N},e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"4px"}},j),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f))},D={size:60,color:"var(--react-loadly-color)",speed:1,loading:!0,fluidity:1,amplitude:1,"aria-label":"Loading..."},j=a=>{const r=o(D,a),{size:n,color:l,secondaryColor:i,speed:d,loading:u,fluidity:y,amplitude:m,className:p="",style:g={},showText:h,loadingText:f="Loading...","aria-label":v,"data-testid":x,...$}=r,C=t(()=>b("blob-loader"),[]),E=s(n),k=c(2500,d);if(!u)return null;const N={display:"inline-flex",flexDirection:"column",alignItems:"center",...g},I={width:E,height:E,background:`linear-gradient(45deg, ${l}, ${i||l})`,borderRadius:"30% 70% 70% 30% / 30% 30% 70% 70%",animation:`blob-morph ${k} ease-in-out infinite`,filter:"blur(1px)",position:"relative"},z={position:"absolute",top:"20%",left:"20%",width:"60%",height:"60%",background:`radial-gradient(circle, ${i||l}, transparent)`,borderRadius:"40% 60% 60% 40% / 40% 40% 60% 60%",animation:`blob-inner ${k} ease-in-out infinite reverse`,opacity:.7};return e.createElement(e.Fragment,null,e.createElement("style",null,`\n @keyframes blob-morph {\n 0%, 100% {\n border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;\n transform: scale(1) rotate(0deg);\n }\n 25% {\n border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;\n transform: scale(${1+.1*(m??1)}) rotate(90deg);\n }\n 50% {\n border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;\n transform: scale(${1-.05*(m??1)}) rotate(180deg);\n }\n 75% {\n border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;\n transform: scale(${1+.08*(m??1)}) rotate(270deg);\n }\n }\n \n @keyframes blob-inner {\n 0%, 100% {\n border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;\n transform: scale(1) rotate(0deg);\n }\n 33% {\n border-radius: 70% 30% 50% 50% / 30% 70% 30% 70%;\n transform: scale(${1.1+.1*(y??1)}) rotate(-120deg);\n }\n 66% {\n border-radius: 30% 70% 40% 60% / 70% 30% 70% 30%;\n transform: scale(${.9+.05*(y??1)}) rotate(-240deg);\n }\n }\n `),e.createElement("div",{className:w("react-loadly react-loadly-blob",p),style:N,role:"status","aria-label":v,"aria-live":"polite","aria-busy":u,"data-testid":x,...$},e.createElement("div",{style:I,"data-testid":x?`${x}-blob`:void 0},e.createElement("div",{style:z})),h&&e.createElement("div",{className:"react-loadly-text",id:`${C}-text`,"aria-live":"polite"},f),e.createElement("span",{className:"react-loadly-sr-only"},v)))},R={size:15,color:"var(--react-loadly-color)",speed:1,loading:!0,count:3,"aria-label":"Loading..."},S=a=>{const r=o(R,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,className:u="",style:y={},count:p=3,showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("bounce-loader"),[]),z=s(n),L=m(d);if(!c)return null;const M={display:"inline-flex",flexDirection:"column",alignItems:"center",...y,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":y.justifyContent}},T={width:z,height:z,borderRadius:"50%",backgroundColor:l,animation:`react-loadly-bounce ${L.duration} ease-in-out infinite`,animationPlayState:L.playState},D=Array.from({length:p}).map((t,a)=>{const r=.1*a+"s",n=i&&a%2==1?i:l;return e.createElement("div",{key:a,style:{...T,animationDelay:r,backgroundColor:n},"data-testid":v?`${v}-ball-${a}`:void 0})});return e.createElement("div",{className:w("react-loadly react-loadly-bounce",u),style:M,role:"status","aria-label":f,"aria-live":"polite","aria-busy":c,"data-testid":v,...N},e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px"}},D),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f))},W={size:12,color:"var(--react-loadly-color)",speed:1,loading:!0,count:3,"aria-label":"Loading..."},B=a=>{const r=o(W,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,className:u="",style:y={},count:p=3,showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("dots-loader"),[]),z=s(n),L=m(d);if(!c)return null;const M={display:"inline-flex",flexDirection:"column",alignItems:"center",...y,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":y.justifyContent}},T={width:z,height:z,borderRadius:"50%",backgroundColor:l,animation:`react-loadly-dots ${L.duration} ease-in-out infinite`,animationPlayState:L.playState},D=Array.from({length:p}).map((t,a)=>{const r=.2*a+"s",n=i&&a%2==1?i:l;return e.createElement("div",{key:a,style:{...T,animationDelay:r,backgroundColor:n},"data-testid":v?`${v}-dot-${a}`:void 0})});return e.createElement("div",{className:w("react-loadly react-loadly-dots",u),style:M,role:"status","aria-label":f,"aria-live":"polite","aria-busy":c,"data-testid":v,...N},e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"6px"}},D),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f))},H={size:60,speed:1,loading:!0,animationType:"spin",glowIntensity:.3,"aria-label":"Loading..."},P=t=>{const a=o(H,t),{size:r,width:n,height:l,speed:i=1,loading:s,animationType:d,glowIntensity:u,className:y="",style:m={},color:p="var(--react-loadly-color)","aria-label":g,loadingText:h,showText:f,"data-testid":v,fullscreen:x,screenWidth:b,screenHeight:$,loaderCenter:C,screenBackground:E,children:k,...N}=a;if(!s)return null;const I={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...x&&{position:"fixed",top:0,left:0,width:b||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}},z=n||r,L=l||r,M={width:"number"==typeof z?`${z}px`:z,height:"number"==typeof L?`${L}px`:L,animation:(()=>{switch(d){case"pulse":return`react-loadly-pulse ${c(2e3,i)} infinite`;case"glow":return`react-loadly-glow ${c(2e3,i)} infinite`;case"bounce":return`react-loadly-bounce ${c(2e3,i)} infinite`;case"flip":return`react-loadly-flip ${c(2e3,i)} infinite`;default:return`react-loadly-spin ${c(2e3,i)} infinite`}})(),filter:(u??0)>0?`drop-shadow(0 0 ${20*(u??0)}px ${p})`:void 0,transformStyle:"preserve-3d",willChange:"transform",display:"flex",alignItems:"center",justifyContent:"center",transformOrigin:"center center"};return e.createElement("div",{className:w("react-loadly react-loadly-element-loader",y),style:I,role:"status","aria-label":g,"aria-live":"polite","aria-busy":s,"data-testid":v,...N},e.createElement("div",{style:M,className:"react-loadly-element","data-testid":v?`${v}-element`:void 0},k),f&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite"},h||g),e.createElement("span",{className:"react-loadly-sr-only"},g))},A=({className:t=""})=>e.createElement("svg",{className:t,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e.createElement("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z"})),F=({className:t=""})=>e.createElement("svg",{className:t,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e.createElement("path",{fillRule:"evenodd",d:"M9.243 3.03a1 1 0 01.727 1.213L9.53 6h2.94l.56-2.243a1 1 0 111.94.486L14.53 6H16a1 1 0 110 2h-1.97l-1 4H15a1 1 0 110 2h-2.47l-.56 2.242a1 1 0 11-1.94-.485L10.47 14H7.53l-.56 2.242a1 1 0 11-1.94-.485L5.47 14H4a1 1 0 110-2h1.97l1-4H5a1 1 0 110-2h2.47l.56-2.243a1 1 0 011.213-.727zM9.03 8l-1 4h2.94l1-4H9.03z",clipRule:"evenodd"})),q=({className:t=""})=>e.createElement("svg",{className:t,fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"})),Y=({error:t="Something went wrong",onRetry:a,retryLabel:r,showRetry:n=!0,children:l,type:i="error",className:o="",style:s={},fullscreen:d,screenWidth:c,screenHeight:u,loaderCenter:y,screenBackground:m,...p})=>{const g={...s,...d&&{position:"fixed",top:0,left:0,width:c||"100vw",height:u||"100vh",backgroundColor:m||"var(--react-loadly-error-background)",zIndex:9999,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:y?"center":s.justifyContent}};return l?e.createElement("div",{className:`react-loadly-fallback ${o}`.trim(),style:g,...p},l):e.createElement("div",{className:`react-loadly-error ${o}`.trim(),style:g,role:"alert","aria-live":"polite",...p},(()=>{switch(i){case"network":return e.createElement(F,{className:"react-loadly-error-icon"});case"timeout":return e.createElement(q,{className:"react-loadly-error-icon"});default:return e.createElement(A,{className:"react-loadly-error-icon"})}})(),e.createElement("p",{className:"react-loadly-error-message"},(()=>{switch(i){case"network":return t||"Network connection failed. Please check your internet connection.";case"timeout":return t||"Loading timeout. The operation took too long to complete.";default:return t||"Something went wrong. Please try again."}})()),n&&a&&e.createElement("button",{className:"react-loadly-retry-button",onClick:a,type:"button","aria-label":"Retry loading"},r||"Try Again"))},X={size:60,color:"var(--react-loadly-color)",speed:1,loading:!0,fluidity:1,amplitude:1,"aria-label":"Loading..."},O=a=>{const r=o(X,a),{size:n,color:l,secondaryColor:i,speed:d,loading:u,amplitude:y,className:m="",style:p={},showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("flow-loader"),[]),z=s(n),L=parseInt(z),M=Math.max(.4*L,10),T=c(1500,d);if(!u)return null;const D={display:"inline-flex",flexDirection:"column",alignItems:"center",...p,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":p.justifyContent}},j={width:z,height:`${M}px`,position:"relative",overflow:"hidden",borderRadius:`${Math.max(.2*L,4)}px`,backgroundColor:"rgba(0, 0, 0, 0.1)"},R=Math.max(Math.floor(L/15),3);return e.createElement(e.Fragment,null,e.createElement("style",null,`\n @keyframes flow-particle-${I} {\n 0% {\n transform: translateX(0) translateY(0) scale(0);\n opacity: 0;\n }\n 10% {\n transform: translateX(${Math.min(.1*L,10)}px) translateY(${Math.sin(.1)*(y??Math.min(5,M/4))}px) scale(1);\n opacity: 0.8;\n }\n 50% {\n transform: translateX(${Math.min(.5*L,.7*L)}px) translateY(${Math.sin(.5)*(y??Math.min(5,M/4))}px) scale(1);\n opacity: 0.8;\n }\n 90% {\n transform: translateX(${Math.min(.9*L,L-10)}px) translateY(${Math.sin(.9)*(y??Math.min(5,M/4))}px) scale(1);\n opacity: 0.8;\n }\n 100% {\n transform: translateX(${L}px) translateY(${Math.sin(1)*(y??Math.min(5,M/4))}px) scale(0);\n opacity: 0;\n }\n }\n `),e.createElement("div",{className:w("react-loadly react-loadly-flow",m),style:D,role:"status","aria-label":f,"aria-live":"polite","aria-busy":u,"data-testid":v,...N},e.createElement("div",{style:j,"data-testid":v?`${v}-container`:void 0},Array.from({length:R},(t,a)=>(t=>{const a=.2*t/(d??1),r=parseFloat(T)+100*t,n=Math.max(L/10,4),o=n+t%3*(n/2);return e.createElement("div",{key:t,style:{position:"absolute",width:`${o}px`,height:`${o}px`,borderRadius:"50%",background:t%2==0?l:i||l,animation:`flow-particle-${I} ${r}ms ease-in-out infinite`,animationDelay:`${a}s`,opacity:.8-.1*t,left:"0px",top:(M-o)/2+t%3*(M/(R+1))+"px"},"data-testid":v?`${v}-particle-${t}`:void 0})})(a))),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f)))},Z={size:40,color:"var(--react-loadly-color)",speed:1,loading:!0,count:4,"aria-label":"Loading..."},V=a=>{const r=o(Z,a),{size:n,color:l,secondaryColor:i,speed:d=1,loading:c,count:u,className:y="",style:m={},showText:p,loadingText:g="Loading...","aria-label":h,"data-testid":f,fullscreen:v,screenWidth:x,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=r,N=t(()=>b("grid-loader"),[]),I=t(()=>{const e="number"==typeof n?n:parseInt(s(n)),t=Math.ceil(Math.sqrt(u||4));return Math.max(e/(1.5*t),8)},[n,u]);if(!c)return null;const z={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}};return e.createElement("div",{className:w("react-loadly react-loadly-grid",y),style:z,role:"status","aria-label":h,"aria-live":"polite","aria-busy":c,"data-testid":f,...k},e.createElement("div",{className:"react-loadly-grid-container",style:{display:"grid",gridTemplateColumns:`repeat(${Math.ceil(Math.sqrt(u||4))}, 1fr)`,gap:I/3+"px"},"data-testid":f?`${f}-grid`:void 0},Array.from({length:u||4}).map((t,a)=>e.createElement("div",{key:a,className:"react-loadly-grid-item",style:{width:`${I}px`,height:`${I}px`,backgroundColor:a%2==0?l:i||l,borderRadius:"20%",animation:`react-loadly-scale ${1.2/(d||1)}s ease-in-out infinite`,animationDelay:.1*a/(d||1)+"s"}}))),p&&e.createElement("div",{className:"react-loadly-text",id:`${N}-text`,"aria-live":"polite"},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},U={size:60,color:"var(--react-loadly-color)",speed:1,loading:!0,fluidity:1,amplitude:1,"aria-label":"Loading..."},_=a=>{const r=o(U,a),{size:n,color:l,secondaryColor:i,speed:d,loading:u,amplitude:y,className:m="",style:p={},showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("liquid-loader"),[]),z=s(n),L=c(2e3,d);if(!u)return null;const M={display:"inline-flex",flexDirection:"column",alignItems:"center",...p,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":p.justifyContent}},T={width:z,height:z,position:"relative",overflow:"hidden",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.1)"},D=50-10*(y??1),j={position:"absolute",bottom:0,left:0,width:"200%",height:"200%",background:`linear-gradient(180deg, ${l} 0%, ${i||l} 100%)`,borderRadius:"40%",animation:`react-loadly-liquid-wave ${L} ease-in-out infinite`,transform:"translate(-25%, 50%) rotate(0deg)",animationTimingFunction:"cubic-bezier(0.36, 0.45, 0.63, 0.53)"},R={...j,background:`linear-gradient(180deg, ${i||l} 0%, ${l} 100%)`,animation:`react-loadly-liquid-wave ${L} ease-in-out infinite reverse`,animationDelay:-.5/(d??1)+"s",opacity:.8};return e.createElement(e.Fragment,null,e.createElement("style",null,`\n @keyframes react-loadly-liquid-wave {\n 0%, 100% {\n transform: translate(-25%, 50%) rotate(0deg);\n }\n 50% {\n transform: translate(-25%, ${D}%) rotate(180deg);\n }\n }\n `),e.createElement("div",{className:w("react-loadly react-loadly-liquid",m),style:M,role:"status","aria-label":f,"aria-live":"polite","aria-busy":u,"data-testid":v,...N},e.createElement("div",{style:T,"data-testid":v?`${v}-container`:void 0},e.createElement("div",{style:j}),e.createElement("div",{style:R})),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f)))},G={size:60,speed:1,loading:!0,animationType:"spin",glowIntensity:.3,"aria-label":"Loading...",alt:"Loading"},J=t=>{const a=o(G,t),{src:r,alt:n,size:l,speed:i,loading:s,animationType:d,glowIntensity:u,className:y="",style:m={},color:p="var(--react-loadly-color)","aria-label":g,loadingText:h,showText:f,"data-testid":v,fullscreen:x,screenWidth:b,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=a;if(!s)return null;const N={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...x&&{position:"fixed",top:0,left:0,width:b||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}},I={width:"number"==typeof l?`${l}px`:l,height:"number"==typeof l?`${l}px`:l,animation:`react-loadly-${d} ${c(2e3,i)} infinite`,filter:(u??0)>0?`drop-shadow(0 0 ${20*(u??0)}px ${p})`:void 0};return e.createElement("div",{className:w("`react-loadly react-loadly-logo-spin",y),style:N,role:"status","aria-label":g,"aria-live":"polite","aria-busy":s,"data-testid":v,...k},e.createElement("img",{src:r,alt:n,style:I,className:"react-loadly-logo","data-testid":v?`${v}-logo`:void 0}),f&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite"},h||g),e.createElement("span",{className:"react-loadly-sr-only"},g))},K={size:40,color:"var(--react-loadly-color)",speed:1,loading:!0,count:3,"aria-label":"Loading..."},Q=a=>{const r=o(K,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,count:u,className:y="",style:m={},showText:p,loadingText:g="Loading...","aria-label":h,"data-testid":f,fullscreen:v,screenWidth:x,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=r,N=t(()=>b("pulse-loader"),[]),z=t(()=>{const e="number"==typeof n?n:parseInt(s(n));return Math.max(e/5,6)},[n]);if(!c)return null;const L={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}};return e.createElement("div",{className:w("react-loadly react-loadly-pulse",y),style:L,role:"status","aria-label":h,"aria-live":"polite","aria-busy":c,"data-testid":f,...k},e.createElement(I,{count:u,dotSize:z,color:l,secondaryColor:i,speed:d,arrangement:"linear",animationType:"pulse",spacing:z/2,"data-testid":f?`${f}-dots`:void 0}),p&&e.createElement("div",{className:"react-loadly-text",id:`${N}-text`,"aria-live":"polite"},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},ee={size:60,color:"var(--react-loadly-color)",speed:1,loading:!0,borderWidth:4,"aria-label":"Loading..."},te=t=>{const r=o(ee,t),{size:n,color:l,speed:i,loading:d,className:c="",style:u={},borderWidth:y,showText:p,loadingText:g="Loading...","aria-label":h,"data-testid":f,fullscreen:v,screenWidth:x,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=r,N=a(b("ring-loader")),I=s(n),z=m(i);if(!d)return null;const L={display:"inline-flex",flexDirection:"column",alignItems:"center",...u,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":u.justifyContent}},M={position:"relative",width:I,height:I},T={boxSizing:"border-box",display:"block",position:"absolute",width:I,height:I,border:`${y}px solid transparent`,borderTop:`${y}px solid ${l}`,borderBottom:`${y}px solid ${l}`,borderRadius:"50%",animation:`react-loadly-ring ${z.duration} cubic-bezier(0.5, 0, 0.5, 1) infinite`,animationPlayState:z.playState},D=Array.from({length:4}).map((t,a)=>{const r=90*a+"deg",n=-.15*a+"s";return e.createElement("div",{key:a,style:{...T,transform:`rotate(${r})`,animationDelay:n},"data-testid":f?`${f}-segment-${a}`:void 0})});return e.createElement("div",{className:w("react-loadly react-loadly-ring",c),style:L,role:"status","aria-label":h,"aria-live":"polite","aria-busy":d,"data-testid":f,...k},e.createElement("div",{style:M},D),p&&e.createElement("div",{className:"react-loadly-text",id:`${N.current}-text`,"aria-live":"polite"},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},ae={size:15,color:"var(--react-loadly-color)",speed:1,loading:!0,count:2,"aria-label":"Loading..."},re=a=>{const r=o(ae,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,className:u="",style:y={},count:p=2,showText:g,loadingText:h="Loading...","aria-label":f,"data-testid":v,fullscreen:x,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=r,I=t(()=>b("rotate-loader"),[]),z=s(n),L=m(d);if(!c)return null;const M={display:"inline-flex",flexDirection:"column",alignItems:"center",...y,...x&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":y.justifyContent}},T={position:"relative",width:z,height:z},D={position:"absolute",width:z,height:z,border:"2px solid transparent",borderTopColor:l,borderBottomColor:l,borderRadius:"50%",animation:`react-loadly-ring ${L.duration} cubic-bezier(0.5, 0, 0.5, 1) infinite`,animationPlayState:L.playState,transform:"rotate(0deg)"},j=Array.from({length:p}).map((t,a)=>{const r=1-.2*a,n=2+a,o=-.15*a+"s",s=i&&a%2==1?i:l;return e.createElement("div",{key:a,style:{...D,width:parseFloat(z)*r+"px",height:parseFloat(z)*r+"px",borderWidth:`${n}px`,borderTopColor:s,borderBottomColor:s,animationDuration:parseFloat(L.duration)*(1+.5*a)+"ms",animationDelay:o},"data-testid":v?`${v}-element-${a}`:void 0})});return e.createElement("div",{className:w("react-loadly react-loadly-rotate",u),style:M,role:"status","aria-label":f,"aria-live":"polite","aria-busy":c,"data-testid":v,...N},e.createElement("div",{style:T},j),g&&e.createElement("div",{className:"react-loadly-text",id:`${I}-text`,"aria-live":"polite"},h),e.createElement("span",{className:"react-loadly-sr-only"},f))},ne={size:40,speed:1,loading:!0,lines:1,variant:"card",shimmer:!0,color:"#e2e8f0",highlightColor:"#f1f5f9",shimmerColor:"rgba(255, 255, 255, 0.6)",borderRadius:"4px",spacing:"8px",waveWidth:"200px",waveDirection:"left-to-right","aria-label":"Loading content..."},le=t=>{const a=o(ne,t),{size:r,width:n,height:l,speed:i,loading:d,className:c="",style:u={},lines:y=1,variant:m,borderRadius:p,spacing:g,shimmer:h,color:f,highlightColor:v,shimmerColor:x,waveWidth:b,waveDirection:$,showText:C,loadingText:E="Loading content...","aria-label":k,"data-testid":N,fullscreen:I,screenWidth:z,screenHeight:L,loaderCenter:M,screenBackground:T,...D}=a;if(!d)return null;const j={display:"inline-flex",flexDirection:"column",alignItems:"center",...u,...I&&{position:"fixed",top:0,left:0,width:z||"100vw",height:L||"100vh",backgroundColor:T||"var(--react-loadly-background)",zIndex:9999,justifyContent:M?"center":u.justifyContent}},R=(()=>{switch(m){case"avatar":return{width:n||r||"40px",height:l||r||"40px",borderRadius:p||"50%"};case"card":return{width:n||r||"300px",height:l||r||"200px",borderRadius:p||"8px"};default:return{width:n||r||"100%",height:l||r||"16px",borderRadius:p||"4px"}}})(),S=s(g,"8px"),W=s(b,"200px"),B={...{width:s(R.width),height:s(R.height),backgroundColor:f,borderRadius:s(R.borderRadius),position:"relative",overflow:"hidden"},...h&&{background:`linear-gradient(${"left-to-right"===$?"90deg":"right-to-left"===$?"270deg":"top-to-bottom"===$?"180deg":"0deg"}, ${f} 0%, ${v} 50%, ${f} 100%)`,backgroundSize:`${W} 100%`,animation:`react-loadly-shimmer ${1.5/(i||1)}s ease-in-out infinite`}};return e.createElement("div",{className:w("react-loadly react-loadly-skeleton",c),style:j,role:"status","aria-label":k,"aria-live":"polite","aria-busy":d,"data-testid":N,...D},e.createElement("div",{style:{display:"flex",flexDirection:"column",width:"100%"}},"card"===m?e.createElement("div",{style:B,"data-testid":N?`${N}-skeleton`:void 0},h&&e.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:`linear-gradient(90deg, transparent, ${x}, transparent)`,animation:`react-loadly-shimmer-overlay ${1.5/(i||1)}s ease-in-out infinite`}})):"avatar"===m?e.createElement("div",{style:B,"data-testid":N?`${N}-skeleton`:void 0},h&&e.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"50%",background:`linear-gradient(90deg, transparent, ${x}, transparent)`,animation:`react-loadly-shimmer-overlay ${1.5/(i||1)}s ease-in-out infinite`}})):Array.from({length:y},(t,a)=>{const r=a===y-1&&y>1?"60%":"100%";return e.createElement("div",{key:a,style:{...B,width:r,marginBottom:a<y-1?S:0},"data-testid":N?`${N}-skeleton-${a}`:void 0},h&&e.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:`linear-gradient(90deg, transparent, ${x}, transparent)`,animation:`react-loadly-shimmer-overlay ${1.5/(i||1)}s ease-in-out infinite`,animationDelay:.1*a+"s"}}))})),C&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite"},E),e.createElement("span",{className:"react-loadly-sr-only"},k))},ie={size:40,color:"var(--react-loadly-color)",speed:1,loading:!0,borderWidth:4,"aria-label":"Loading..."},oe=t=>{const r=o(ie,t),{size:n,color:l,speed:i,loading:d,className:c="",style:u={},borderWidth:y,showText:p,loadingText:g="Loading...","aria-label":h,"data-testid":f,fullscreen:v,screenWidth:x,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=r,N=a(b("spin-loader")),I=s(n),z=m(i);if(!d)return null;const L={display:"inline-flex",flexDirection:"column",alignItems:"center",...u,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":u.justifyContent}},M={width:I,height:I,border:`${y}px solid transparent`,borderTop:`${y}px solid ${l}`,borderRadius:"50%",animation:`react-loadly-spin ${z.duration} linear infinite`,animationPlayState:z.playState};return e.createElement("div",{className:w("react-loadly react-loadly-spin",c),style:L,role:"status","aria-label":h,"aria-live":"polite","aria-busy":d,"data-testid":f,...k},e.createElement("div",{style:M,"data-testid":f?`${f}-spinner`:void 0}),p&&e.createElement("div",{className:"react-loadly-text",id:`${N.current}-text`,"aria-live":"polite"},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},se={speed:1,loading:!0,charDelay:100,"aria-label":"Loading...",loop:!0},de=t=>{const l=o(se,t),{loadingText:i="loading...",speed:s=1,loading:d,charDelay:c=100,loop:u,className:y="",style:m={},color:p="var(--react-loadly-text-color)",fontFamily:g,fontWeight:h=500,"aria-label":f,"data-testid":v,fullscreen:x,screenWidth:b,screenHeight:$,loaderCenter:C,screenBackground:E,size:k=18,...N}=l,[I,z]=r(""),[L,M]=r(!1),T=a(null);if(n(()=>{if(T.current&&(clearTimeout(T.current),T.current=null),!d||!i)return void z("");M(!0),z("");const e=(t=0)=>{t<i.length?(z(i.substring(0,t+1)),T.current=setTimeout(()=>e(t+1),c/s)):u?T.current=setTimeout(()=>{z(""),e(0)},2*c):M(!1)};return e(0),()=>{T.current&&clearTimeout(T.current)}},[d,i,c,s,u]),!d)return null;const D={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...x&&{position:"fixed",top:0,left:0,width:b||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}},j={color:p,fontFamily:g,fontWeight:h,fontSize:k,whiteSpace:"pre"};return e.createElement("div",{className:w("react-loadly react-loadly-typing",y),style:D,role:"status","aria-label":f,"aria-live":"polite","aria-busy":d,"data-testid":v,...N},e.createElement("div",{style:j,"data-testid":v?`${v}-text`:void 0},I,e.createElement("span",{className:"react-loadly-typing-cursor",style:{display:L?"inline-block":"none",animation:`react-loadly-blink ${1/s}s step-end infinite`,marginLeft:"2px",verticalAlign:"baseline"}},"|")),e.createElement("span",{className:"react-loadly-sr-only"},f))},ce={size:40,color:"var(--react-loadly-color)",speed:1,loading:!0,count:5,"aria-label":"Loading..."},ue=a=>{const r=o(ce,a),{size:n,color:l,secondaryColor:i,speed:d,loading:c,count:u,className:y="",style:m={},showText:p,loadingText:g="Loading...","aria-label":h,"data-testid":f,fullscreen:v,screenWidth:x,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=r,N=t(()=>b("wave-loader"),[]),I=t(()=>{const e="number"==typeof n?n:parseInt(s(n));return{width:Math.max(e/10,3),height:e,spacing:Math.max(e/8,4)}},[n]);if(!c)return null;const L={display:"inline-flex",flexDirection:"column",alignItems:"center",...m,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":m.justifyContent}};return e.createElement("div",{className:w("react-loadly react-loadly-wave",y),style:L,role:"status","aria-label":h,"aria-live":"polite","aria-busy":c,"data-testid":f,...k},e.createElement(z,{count:u,lineWidth:I.width,lineHeight:I.height,color:l,secondaryColor:i,speed:d,arrangement:"staggered",orientation:"vertical",animationType:"wave",spacing:I.spacing,"data-testid":f?`${f}-lines`:void 0}),p&&e.createElement("div",{className:"react-loadly-text",id:`${N}-text`,"aria-live":"polite"},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},ye={loading:!0,inheritStyles:!1,shimmer:!0,color:"#e2e8f0",highlightColor:"#f1f5f9",shimmerColor:"rgba(255, 255, 255, 0.6)",waveWidthValue:"200px",waveDirection:"left-to-right","aria-label":"Loading content...",speed:1},me=a=>{const r=o(ye,a),{component:n,loading:i,inheritStyles:s,styless:d={},shimmer:c,highlightColor:u,waveWidthValue:y,waveDirection:m,color:p,"aria-label":g,className:h="",style:f={},speed:v,...x}=r,b=e=>{const{type:t,props:a}=e,r="100%",n="16px",l="6px";if("string"==typeof t)switch(t){case"h1":return{width:"100%",height:"2.2em",borderRadius:"6px"};case"h2":return{width:"100%",height:"1.8em",borderRadius:"6px"};case"h3":return{width:"100%",height:"1.6em",borderRadius:"6px"};case"p":case"span":if("string"==typeof a.children){const e=a.children.length;return{width:`${Math.min(100,Math.max(30,.5*e))}%`,height:"1em",borderRadius:"6px"}}return{width:"90%",height:"1em",borderRadius:"6px"};case"img":return{width:a.width||"100%",height:a.height||"200px",borderRadius:a.style?.borderRadius||"8px"};case"button":if("string"==typeof a.children){const e=a.children.length;return{width:`${Math.max(80,8*e)}px`,height:"40px",borderRadius:a.style?.borderRadius||"8px"}}return{width:"120px",height:"40px",borderRadius:"8px"};default:return{width:a.style?.width||r,height:a.style?.height||n,borderRadius:a.style?.borderRadius||l}}return{width:e.props?.style?.width||r,height:e.props?.style?.height||n,borderRadius:e.props?.style?.borderRadius||l}},$=(t,a)=>{const r=!t.display||"inline"!==t.display,n=c?{background:`linear-gradient(${"left-to-right"===m?"90deg":"right-to-left"===m?"270deg":"top-to-bottom"===m?"180deg":"0deg"}, ${p} 0%, ${u} 50%, ${p} 100%)`,backgroundSize:`${y} 100%`,animation:`react-loadly-shimmer ${1.5/(v||1)}s ease-in-out infinite`}:{backgroundColor:p},l={display:r?"block":"inline-block",width:t.width,height:t.height,borderRadius:t.borderRadius,margin:t.margin||"6px 0",...n,position:"relative",overflow:"hidden"};return e.createElement("div",{key:String(a),style:l,"aria-hidden":"true",className:"react-loadly-skeleton-block"})},C=(t,a=0)=>{if(null==t||"string"==typeof t||"number"==typeof t)return null;if(Array.isArray(t))return e.createElement(e.Fragment,null,t.map((e,t)=>C(e,t)));if(t.type===e.Fragment){const r=t;return e.createElement(e.Fragment,{key:a},e.Children.map(r.props.children,(e,t)=>C(e,t)))}const r=t,{type:n,props:l}=r;if("string"==typeof n){if(["div","section","article","header","footer","nav","main","ul","ol","li","figure"].includes(n)){const t=s&&l.style?{...l.style}:{};return e.createElement(n,{key:a,...l,style:t},e.Children.map(l.children,(e,t)=>C(e,t)))}let t={...b(r)};return s&&l.style&&(t={...t,...l.style}),d[n]&&(t={...t,...d[n]}),$(t,`${a}-${n}`)}if("function"==typeof n)try{const t=n(l);if(e.isValidElement(t)||Array.isArray(t))return C(t,a)}catch(o){}if(l&&l.children)return e.createElement(e.Fragment,{key:a},e.Children.map(l.children,(e,t)=>C(e,t)));const i=b(r);return $(i,`${a}-fallback`)},E=t(()=>C(n),[n,d,s,c,u,y,m,p]);if(!i)try{return l(n)}catch{return e.createElement(e.Fragment,null,n)}return e.createElement("div",{className:w("react-loadly react-loadly-auto-skeleton",h),style:{...f,transition:"opacity 0.2s ease-in-out"},role:"status","aria-label":g,"aria-live":"polite","aria-busy":i,...x},E)},pe={size:40,color:"var(--react-loadly-color)",speed:1,loading:!0,"aria-label":"Loading...",showText:!1,loadingText:"Loading...",fullscreen:!1};let ge={...pe};function he(){return{...ge}}function fe(e){ge={...ge,...e}}function ve(){ge={...pe}}const xe={progress:null,thickness:4},be=a=>{const r=o(pe,a),{progress:n=1,thickness:l=4,size:i=40,color:d="var(--react-loadly-color)",secondaryColor:c,speed:u=1,loading:y=!0,className:p="",style:g={},showText:h,loadingText:f="Loading...","aria-label":v="Loading...","data-testid":x,fullscreen:b,screenWidth:$,screenHeight:C,loaderCenter:E,screenBackground:k,...N}=o(xe,r),I=m(u),z=s(i),L=t(()=>{if("number"==typeof i)return i;const e=parseFloat(z);return isNaN(e)?40:e},[i,z]),M=t(()=>(L-l)/2,[L,l]),T=t(()=>2*Math.PI*M,[M]),D=t(()=>{if(null==n)return T;const e=Math.max(0,Math.min(100,n));return T-e/100*T},[n,T]);if(!y)return null;const j={display:"inline-flex",flexDirection:"column",alignItems:"center",...g,...b&&{position:"fixed",top:0,left:0,width:$||"100vw",height:C||"100vh",backgroundColor:k||"var(--react-loadly-background)",zIndex:9999,justifyContent:E?"center":g.justifyContent}},R={width:z,height:z,transform:"rotate(-90deg)",willChange:"transform"},S={fill:"none",stroke:d,strokeWidth:l,strokeLinecap:"round",transformOrigin:"center",willChange:"transform, opacity"},W={...S,stroke:c||"var(--react-loadly-secondary-color, rgba(0,0,0,0.1))",opacity:.2},B={...S,strokeDasharray:T,strokeDashoffset:D||0,transition:null!==n?"stroke-dashoffset 0.3s ease":void 0,animationPlayState:I.playState};return e.createElement("div",{className:w("react-loadly react-loadly-progress-ring",p),style:j,role:"status","aria-label":v,"aria-live":"polite","aria-busy":y,"aria-valuemin":null!==n?0:void 0,"aria-valuemax":null!==n?100:void 0,"aria-valuenow":null!==n?n:void 0,"data-testid":x,...N},e.createElement("svg",{style:R,viewBox:`0 0 ${L} ${L}`,"data-testid":x?`${x}-svg`:void 0,className:"react-loadly-progress-ring-svg"},e.createElement("circle",{cx:L/2,cy:L/2,r:M,style:W,"data-testid":x?`${x}-background-circle`:void 0,className:"react-loadly-progress-ring-background"}),e.createElement("circle",{cx:L/2,cy:L/2,r:M,style:B,"data-testid":x?`${x}-progress-circle`:void 0,className:"react-loadly-progress-ring-progress"})),h&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite","data-testid":x?`${x}-text`:void 0},f),e.createElement("span",{className:"react-loadly-sr-only"},v))},$e={variant:"blob",speed:1},we=a=>{const r=o(pe,a),{variant:n="blob",speed:l=1,size:i=40,color:d="var(--react-loadly-color)",loading:c=!0,className:u="",style:y={},showText:p,loadingText:g="Loading...","aria-label":h="Loading...","data-testid":f,fullscreen:v,screenWidth:x,screenHeight:b,loaderCenter:$,screenBackground:C,...E}=o($e,r),k=m(l),N=s(i),I=t(()=>{const e="number"==typeof i?i:parseInt(s(i)),t=e/2,a=e/2-4;switch(n){case"soft":return`M ${t},${t-a} \n C ${t+.8*a},${t-a} ${t+a},${t-.8*a} ${t+a},${t}\n C ${t+a},${t+.8*a} ${t+.8*a},${t+a} ${t},${t+a}\n C ${t-.8*a},${t+a} ${t-a},${t+.8*a} ${t-a},${t}\n C ${t-a},${t-.8*a} ${t-.8*a},${t-a} ${t},${t-a}\n Z`;case"sharp":return`M ${t},${t-a} \n L ${t+.7*a},${t-.7*a}\n L ${t+a},${t}\n L ${t+.7*a},${t+.7*a}\n L ${t},${t+a}\n L ${t-.7*a},${t+.7*a}\n L ${t-a},${t}\n L ${t-.7*a},${t-.7*a}\n Z`;default:return`M ${t},${t-a} \n C ${t+.5*a},${t-a} ${t+a},${t-.5*a} ${t+a},${t}\n C ${t+a},${t+.5*a} ${t+.5*a},${t+a} ${t},${t+a}\n C ${t-.5*a},${t+a} ${t-a},${t+.5*a} ${t-a},${t}\n C ${t-a},${t-.5*a} ${t-.5*a},${t-a} ${t},${t-a}\n Z`}},[n,i]);if(!c)return null;const z={display:"inline-flex",flexDirection:"column",alignItems:"center",...y,...v&&{position:"fixed",top:0,left:0,width:x||"100vw",height:b||"100vh",backgroundColor:C||"var(--react-loadly-background)",zIndex:9999,justifyContent:$?"center":y.justifyContent}},L={width:N,height:N,willChange:"transform"},M={transformOrigin:"center",willChange:"transform",animation:`react-loadly-morph ${k.duration} ease-in-out infinite`,animationPlayState:k.playState};return e.createElement("div",{className:w("react-loadly react-loadly-morph",u),style:z,role:"status","aria-label":h,"aria-live":"polite","aria-busy":c,"data-testid":f,...E},e.createElement("svg",{style:L,viewBox:`0 0 ${N} ${N}`,"data-testid":f?`${f}-svg`:void 0},e.createElement("path",{d:I,fill:d,style:M,"data-testid":f?`${f}-shape`:void 0})),p&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite","data-testid":f?`${f}-text`:void 0},g),e.createElement("span",{className:"react-loadly-sr-only"},h))},Ce={dots:3,gap:8},Ee=a=>{const r=o(pe,a),{dots:n=3,gap:l=8,size:i=40,color:d="var(--react-loadly-color)",speed:c=1,loading:u=!0,className:y="",style:p={},showText:g,loadingText:h="Loading...","aria-label":f="Loading...","data-testid":v,fullscreen:x,screenWidth:b,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=o(Ce,r),N=m(c),I=s(i),z=t(()=>{const e="number"==typeof i?i:parseInt(s(i));return Math.max((e-(n-1)*l)/n,4)},[i,n,l]),L=t(()=>Array.from({length:n}).map((t,a)=>{const r=a/n*2*Math.PI,l=(parseInt(I)-z)/2,i=l*Math.cos(r),o=l*Math.sin(r),s={position:"absolute",width:`${z}px`,height:`${z}px`,backgroundColor:d,borderRadius:"50%",willChange:"transform, opacity",transform:"translateZ(0)",left:`calc(50% + ${i}px - ${z/2}px)`,top:`calc(50% + ${o}px - ${z/2}px)`,animation:`react-loadly-dots ${N.duration} ease-in-out infinite`,animationDelay:.2*a/c+"s",animationPlayState:N.playState};return e.createElement("div",{key:a,style:s,"data-testid":v?`${v}-dot-${a}`:void 0})}),[n,I,z,d,N,c,v]);if(!u)return null;const M={display:"inline-flex",flexDirection:"column",alignItems:"center",...p,...x&&{position:"fixed",top:0,left:0,width:b||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":p.justifyContent}},T={position:"relative",width:I,height:I,willChange:"transform"};return e.createElement("div",{className:w("react-loadly react-loadly-spin-dots",y),style:M,role:"status","aria-label":f,"aria-live":"polite","aria-busy":u,"data-testid":v,...k},e.createElement("div",{style:T,"data-testid":v?`${v}-spinner`:void 0},L),g&&e.createElement("div",{className:"react-loadly-text","aria-live":"polite","data-testid":v?`${v}-text`:void 0},h),e.createElement("span",{className:"react-loadly-sr-only"},f))},ke={rows:3,cols:5},Ne=a=>{const r=o(pe,a),{rows:n=3,cols:l=5,size:i=40,color:d="var(--react-loadly-color)",speed:c=1,loading:u=!0,className:y="",style:p={},showText:g,loadingText:h="Loading...","aria-label":f="Loading...","data-testid":v,fullscreen:x,screenWidth:b,screenHeight:$,loaderCenter:C,screenBackground:E,...k}=o(ke,r),N=m(c),I=s(i),z=t(()=>{const e="number"==typeof i?i:parseInt(s(i));return Math.max(e/l-2,8)},[i,l]),L=t(()=>{const e="number"==typeof i?i:parseInt(s(i));return Math.max(e/n-2,8)},[i,n]),M=t(()=>Array.from({length:n*l}).map((t,a)=>{const r=Math.floor(a/l),n=a%l,i={width:`${z}px`,height:`${L}px`,backgroundColor:d,margin:"1px",opacity:.3,willChange:"opacity",animation:`react-loadly-pulse ${N.duration} ease-in-out infinite`,animationDelay:.1*(r+n)/c+"s",animationPlayState:N.playState};return e.createElement("div",{key:a,style:i,"data-testid":v?`${v}-cell-${a}`:void 0})}),[n,l,z,L,d,N,c,v]);if(!u)return null;const T={display:"inline-flex",flexDirection:"column",alignItems:"center",...p,...x&&{position:"fixed",top:0,left:0,width:b||"100vw",height:$||"100vh",backgroundColor:E||"var(--react-loadly-background)",zIndex:9999,justifyContent:C?"center":p