import{H as e,E as t,p as s,q as a,r as i,s as o,t as r,u as n}from"./ppyR687H.js";import"events";const c="event category and event action are required",l="The category value must be either EventCategory::ACTION_TRACKING or EventCategory::ACTION_TRACKING",u="value must be an integer and be >= 0";class g extends e{_category;_action;_label;_value;get category(){return this._category}set category(e){Object.values(t).includes(e)?this._category=e:s(this.config,l,"category")}get action(){return this._action}set action(e){this.isNotEmptyString(e,"action")&&(this._action=e)}get label(){return this._label}set label(e){this.isNotEmptyString(e,"label")&&(this._label=e)}get value(){return this._value}set value(e){!Number.isInteger(e)||e<0?s(this.config,u,"value"):this._value=e}constructor(e){super({type:a.EVENT,userIp:e.userIp,screenResolution:e.screenResolution,locale:e.locale,sessionNumber:e.sessionNumber,visitorId:e.visitorId,anonymousId:e.anonymousId,qaMode:e.qaMode,isActionTrackingHit:e.isActionTrackingHit});const{category:t,action:s,label:i,value:o}=e;this.category=t,this.action=s,i&&(this.label=i),o&&(this.value=o)}toApiKeys(){const e=super.toApiKeys();return e[i]=this.category,e[o]=this.action,this.label&&(e[r]=this.label),this.value&&(e[n]=this.value),e}toObject(){return{...super.toObject(),category:this.category,action:this.action,label:this.label,value:this.value}}isReady(e=!0){return!(e&&!super.isReady()||!this.category||!this.action)}getErrorMessage(){return c}}export{l as CATEGORY_ERROR,c as ERROR_MESSAGE,g as Event,u as VALUE_FIELD_ERROR};
//# sourceMappingURL=D5KFaueH.js.map
