import{H as t,p as i,B as s,q as e,v as n,C as o,G as a,J as h,K as r,L as p,M as u,P as c,N as d,O as g}from"./ppyR687H.js";import"events";const m="{0} must be a string and have exactly 3 letters",y="Transaction Id and Transaction affiliation are required";class C extends t{_transactionId;_affiliation;_taxes;_currency;_couponCode;_itemCount;_shippingMethod;_paymentMethod;_totalRevenue;_shippingCosts;get transactionId(){return this._transactionId}set transactionId(t){this.isNotEmptyString(t,"transactionId")&&(this._transactionId=t)}get affiliation(){return this._affiliation}set affiliation(t){this.isNotEmptyString(t,"affiliation")&&(this._affiliation=t)}get taxes(){return this._taxes}set taxes(t){this.isNumeric(t,"taxes")&&(this._taxes=t)}get currency(){return this._currency}set currency(t){t&&"string"==typeof t&&3===t.length?this._currency=t:i(this.config,s(m,"currency"),"currency")}get couponCode(){return this._couponCode}set couponCode(t){this.isNotEmptyString(t,"couponCode")&&(this._couponCode=t)}get itemCount(){return this._itemCount}set itemCount(t){this.isInteger(t,"itemCount")&&(this._itemCount=Math.trunc(t))}get shippingMethod(){return this._shippingMethod}set shippingMethod(t){this.isNotEmptyString(t,"shippingMethod")&&(this._shippingMethod=t)}get paymentMethod(){return this._paymentMethod}set paymentMethod(t){this.isNotEmptyString(t,"paymentMethod")&&(this._paymentMethod=t)}get totalRevenue(){return this._totalRevenue}set totalRevenue(t){this.isNumeric(t,"totalRevenue")&&(this._totalRevenue=t)}get shippingCosts(){return this._shippingCosts}set shippingCosts(t){this.isNumeric(t,"shippingCosts")&&(this._shippingCosts=t)}constructor(t){super({type:e.TRANSACTION,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,affiliation:s,taxes:n,currency:o,couponCode:a,itemCount:h,shippingMethod:r,paymentMethod:p,totalRevenue:u,shippingCosts:c}=t;this.transactionId=i,this.affiliation=s,n&&(this.taxes=n),o&&(this.currency=o),a&&(this.couponCode=a),h&&(this.itemCount=h),r&&(this.shippingMethod=r),p&&(this.paymentMethod=p),u&&(this.totalRevenue=u),c&&(this.shippingCosts=c)}isReady(t=!0){return!(t&&!super.isReady()||!this.transactionId||!this.affiliation)}toApiKeys(){const t=super.toApiKeys();return t[n]=this.transactionId,t[o]=this.affiliation,this.taxes&&(t[a]=this.taxes),this.currency&&(t[h]=this.currency),this.couponCode&&(t[r]=this.couponCode),this.itemCount&&(t[p]=this.itemCount),this.shippingMethod&&(t[u]=this.shippingMethod),this.paymentMethod&&(t[c]=this.paymentMethod),this.totalRevenue&&(t[d]=this.totalRevenue),this.shippingCosts&&(t[g]=this.shippingCosts),t}toObject(){return{...super.toObject(),transactionId:this.transactionId,affiliation:this.affiliation,taxes:this.taxes,currency:this.currency,couponCode:this.couponCode,itemCount:this.itemCount,shippingMethod:this.shippingMethod,paymentMethod:this.paymentMethod,totalRevenue:this.totalRevenue,shippingCosts:this.shippingCosts}}getErrorMessage(){return y}}export{m as CURRENCY_ERROR,y as ERROR_MESSAGE,C as Transaction};
//# sourceMappingURL=CjmnZoru.js.map
