"use strict";(self.webpackChunk_flagship_io_js_sdk=self.webpackChunk_flagship_io_js_sdk||[]).push([[349],{349:(t,i,e)=>{e.r(i),e.d(i,{ERROR_MESSAGE:()=>o,Item:()=>u});var r=e(719),s=e(761),a=e(487);const o="Transaction Id, Item name and item code are required";class u extends a.HitAbstract{_transactionId;_productName;_productSku;_itemPrice;_itemQuantity;_itemCategory;get transactionId(){return this._transactionId}set transactionId(t){this.isNotEmptyString(t,"transactionId")&&(this._transactionId=t)}get productName(){return this._productName}set productName(t){this.isNotEmptyString(t,"productName")&&(this._productName=t)}get productSku(){return this._productSku}set productSku(t){this.isNotEmptyString(t,"productSku")&&(this._productSku=t)}get itemPrice(){return this._itemPrice}set itemPrice(t){this.isNumeric(t,"itemPrice")&&(this._itemPrice=t)}get itemQuantity(){return this._itemQuantity}set itemQuantity(t){this.isInteger(t,"itemQuantity")&&(this._itemQuantity=Math.trunc(t))}get itemCategory(){return this._itemCategory}set itemCategory(t){this.isNotEmptyString(t,"itemCategory")&&(this._itemCategory=t)}constructor(t){super({type:s.HitType.ITEM,userIp:t.userIp,screenResolution:t.screenResolution,locale:t.locale,sessionNumber:t.sessionNumber,visitorId:t.visitorId,anonymousId:t.anonymousId,qaMode:t.qaMode,isActionTrackingHit:t.isActionTrackingHit});const{transactionId:i,productName:e,productSku:r,itemCategory:a,itemPrice:o,itemQuantity:u}=t;this.transactionId=i,this.productName=e,this.productSku=r,a&&(this.itemCategory=a),o&&(this.itemPrice=o),u&&(this.itemQuantity=u)}isReady(t=!0){return!(t&&!super.isReady()||!this.transactionId||!this.productName||!this.productSku)}toApiKeys(){const t=super.toApiKeys();return t[r.TID_API_ITEM]=this.transactionId,t[r.IN_API_ITEM]=this.productName,t[r.IC_API_ITEM]=this.productSku,this.itemPrice&&(t[r.IP_API_ITEM]=this.itemPrice),this.itemQuantity&&(t[r.IQ_API_ITEM]=this.itemQuantity),this.itemCategory&&(t[r.IV_API_ITEM]=this.itemCategory),t}toObject(){return{...super.toObject(),transactionId:this.transactionId,productName:this.productName,productSku:this.productSku,itemPrice:this.itemPrice,itemQuantity:this.itemQuantity,itemCategory:this.itemCategory}}getErrorMessage(){return o}}}}]);
//# sourceMappingURL=349.56483a275e52b56e8715.js.map