import{d as o}from"./dayjs.min-2rai63wT.js";import{A as m,t as n}from"./Translator-Bios5QX5.js";import{S as l}from"./Str-Ckn63bs5.js";import{u as p,t as y}from"./timezone-C2U15obx.js";import{S as f}from"./Badge-CAEsoWyQ.js";import{E as h,q as S}from"./index-D0R5Hqh1.js";const L=function(t,r){if(r===0||r===null||r===void 0)return t===0?0:100;const s=(t-r)/r*100;return Math.round(s*100)/100},g=(t,r="")=>{let s="";return typeof t=="string"?s=t:t&&t.message?s=t.message:s=l.objectToString(t),s||(s=r||n("Nothing....")),s},B=(t,r="",s=1e3)=>{let e=g(t,n("Something is wrong!"));u({offset:20,type:"error",title:n("Error"),message:e,dangerouslyUseHTMLString:!0,customClass:r,duration:s})},N=(t,r="",s=1e3)=>{let e=g(t,n("Okay...!"));u({offset:20,type:"success",title:n("Success"),message:e,dangerouslyUseHTMLString:!0,customClass:r,duration:s})};o.extend(p);o.extend(y);let $=o.tz.guess();function z(t){return/([Zz]|[+-]\d{2}:\d{2}|[+-]\d{4})/.test(t)}const j=(t,r=!1,s=null,e="UTC",a=!1)=>{if(!t)return"";const i=M(t,e,s||$);if(a)return d(i);const c=b(i);return r?`${c} at ${d(i)}`:c},M=(t,r,s)=>{if(T(t)){const e=Number(t),a=e<1e12?e*1e3:e;return o(a).tz(s)}return z(t)?o(t).tz(s):o.tz(t,r).tz(s)},T=t=>typeof t=="number"||/^\d+$/.test(t),b=t=>{const r=t.year(),s=t.date().toString().padStart(2,"0"),e=t.format("MMM");return r===o().year()?`${e} ${s}`:`${s} ${e}, ${r}`},d=t=>{const r=t.format("h"),s=t.format("mm"),e=t.format("a");return`${r}:${s} ${e}`},u=S,A=h.confirm,H=(t,r)=>f.readableFileSizeFromBytes(t)+" of "+f.readableFileSizeFromBytes(r),R=t=>{try{const r=new URL(t);return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}},Y=(t,r="")=>{const s={visa:"images/credit-card/visa.svg",mastercard:"images/credit-card/mastercard.svg",unionpay:"images/credit-card/unionpay.svg",amex:"images/credit-card/amex.svg"};return t in s?m.assetUrl(s[t]):r==="card"?m.assetUrl("images/credit-card/card.svg"):null};export{A as $,B as a,H as b,L as c,j as f,Y as g,N as h,R as i};
