class t{constructor(r=null,s=null){if(r)this.release=r,this.version=r.tag_name,this.versionName=r.name,this.versionTag=r.tag_tag;else if(s)this.release=null,this.version=s,this.versionName=null,this.versionTag=null;else throw new Error("Either release or version must be provided");this.versionParts=this.parseVersion(this.version),this.versionMajor=this.versionParts?this.versionParts[0]:null,this.versionMinor=this.versionParts?this.versionParts[1]:null,this.versionPatch=this.versionParts?this.versionParts[2]:null}parseVersion(r){if(!r)return null;let s=r;return s.indexOf("v")===0&&(s=s.substring(1)),s.split(".").map(Number)}isGreater(r){let s;if(r instanceof t)s=r.versionParts;else if(typeof r=="string")s=this.parseVersion(r);else throw new Error("Invalid argument: otherVersion must be a SunshineVersion object or a version string");if(!this.versionParts||!s)return!1;for(let i=0;i<Math.min(3,this.versionParts.length,s.length);i++)if(this.versionParts[i]!==s[i])return this.versionParts[i]>s[i];return!1}}export{t as S};
