/**
 * @license @hugeicons/react-pro v0.3.1
 *
 * See the LICENSE file in the root directory of this source tree.
 */

import{decode as I}from"js-base64";import{md5 as u}from"js-md5";const f="Hugeicons LOG",a="=".repeat(60),n=s=>{console.log(`
${a}
${f}:
${s}
${a}
`)};let o=null;const m=s=>{o=s},v=()=>{if(!o)return!1;const s=o.substring(0,32),r=o.substring(32),l=I(r),c=u(r);if(s!==c)return n("Invalid License Key"),!1;const p=l.split(","),t={expiration:0,status:"",version:"",platform:"",startInitials:"",endInitials:""};for(const d of p){const[i,e]=d.split("=");i==="E"&&(t.expiration=parseInt(e)),i==="S"&&(t.status=e),i==="V"&&(t.version=e),i==="P"&&(t.platform=e),i==="ST"&&(t.startInitials=e),i==="ET"&&(t.endInitials=e)}return t.expiration<Date.now()?(n("Invalid License Expiration"),!1):t.status!=="pro"?(n("Invalid License Status"),!1):t.version!=="1"?(n("Invalid License Version"),!1):t.platform!=="Gumroad"?(n("Invalid License Platform"),!1):t.startInitials?.length!==8||t.endInitials?.length!==8?(n("Invalid License"),!1):!0};export{n as logger,m as setLicenseKey,v as validateLicense};
