"use strict";(self.webpackChunkapp_container=self.webpackChunkapp_container||[]).push([[4391],{4391:(e,r,t)=>{function i(e){if(e){const r=864e5;let t;const i=(new Date).getFullYear();let _=new Date(e).getDate();_=_<10?"0"+_:_;let a=new Date(e).getMonth()+1;a=a<10?"0"+a:a;let o=i+"-"+a+"-"+_,d=new Date(o).getTime();const n=(new Date).getTime();let c=d-n;return c<0&&(o=i+1+"-"+a+"-"+_,d=new Date(o).getTime(),c=d-n),t=Math.floor(c/r),t}}function _(e,r,t){"string"==typeof e&&(e=e.replace(".",""));let i="";const _=/\{\{\s*(\w+)\s*\}\}/,a=r||"${{amount}}";function o(e,r){return void 0===e?r:e}function d(e,r,t,i){if(r=o(r,2),t=o(t,","),i=o(i,"."),isNaN(e)||null==e)return"0";const _=(e=(e/100).toFixed(r)).split(".");return _[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+t)+(_[1]?i+_[1]:"")}switch(a.match(_)[1]){case"amount":i=d(e,2);break;case"amount_no_decimals":i=d(e,0);break;case"amount_with_comma_separator":i=d(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":i=d(e,0,".",",")}return function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'")}(a.replace(_,i))}function a(e){return null==e?void 0:e.map((e=>{var r,t,a,o,d,n;let c="",l="",s="",u="",p=!1;if(e.is_default_rule){let g=e.credits;var f;switch(e.is_fixed||"monthly_date"===e.module_on?g=_(Math.abs(g),null===(f=window)||void 0===f||null===(f=f.flitsThemeAppExtensionObjects)||void 0===f?void 0:f.money_format):(g/=100,g+="%"),e.module_on){case"register":c=["flits.how_to_earn_credit_page.register_credit_rule_title","Register credit"],l=["flits.how_to_earn_credit_page.register_credit_rule_description","Register and get {{ credit }} credit.",{credit:g}],null!=e&&e.is_earned||(p=!0);break;case"subscribe":c=["flits.how_to_earn_credit_page.subscribe_credit_rule_title","Subscriber credit"],l=["flits.how_to_earn_credit_page.subscribe_credit_rule_description","Subscribe and get {{ credit }} credit.",{credit:g}];let f="true"===(null===(r=window)||void 0===r||null===(r=r.flitsThemeAppExtensionObjects)||void 0===r||null===(r=r.customer)||void 0===r?void 0:r.customer_accept_marketing)?"1":"0",h=e.is_earned?"1":"0";"1"===f&&"0"===h&&(p=!0);break;case"order_number":c=["flits.how_to_earn_credit_page.specific_order_credit_rule_title","Credit on specific order"],l=["flits.how_to_earn_credit_page.specific_order_credit_rule_description","Earn {{ credit }} credit on your order number {{ order_count }}",{credit:g,order_count:e.column_value}],">="===e.relation&&(c=["flits.how_to_earn_credit_page.specific_order_and_next_orders_credit_rule_title","Credit on order number {{ order_count }} and next orders",{order_count:e.column_value}],l=["flits.how_to_earn_credit_page.specific_order_and_next_orders_credit_rule_description","You can earn {{ credit }} credit on order number {{ order_count }} and next orders {{ order_count+1 }}, {{ order_count+2 }}..... {{ order_count+n }}",{credit:g,order_count:e.column_value}]);let m=parseInt(null===(t=window)||void 0===t||null===(t=t.flitsThemeAppExtensionObjects)||void 0===t||null===(t=t.customer)||void 0===t?void 0:t.order_count),w=parseInt(e.column_value);null!=e&&e.is_earned||m>=w&&(p=!0);break;case"birthdate":c=["flits.how_to_earn_credit_page.birthdate_credit_rule_title","Birthday credit*"],l=["flits.how_to_earn_credit_page.birthdate_credit_rule_description_1","Share your birthdate with us to get {{ credit }} credit on your birthday.",{credit:g}],s=["flits.how_to_earn_credit_page.birthdate_credit_rule_description_2","{{ days }} day/s left for a birthday reward of {{ credit }} credit.",{credit:g,days:i(null===(a=window)||void 0===a||null===(a=a.flitsThemeAppExtensionObjects)||void 0===a||null===(a=a.customer)||void 0===a?void 0:a.birthday)}],u=["flits.how_to_earn_credit_page.birthdate_credit_rule_description_3","*You can avail this credit only once in a year."];break;case"monthly_date":c=["flits.how_to_earn_credit_page.monthly_credit_rule_title","Monthly credit"],l=["flits.how_to_earn_credit_page.monthly_credit_rule_description","You will get {{ credit }} credit on {{ date }} of every month.",{credit:g,date:new Date(e.column_value).getDate()}],e.is_fixed&&(function(e){var r=e.date2,t=e.type||"day",i=!!e.isAbsDisabled&&e.isAbsDisabled;let _,a=new Date(e.date1)-new Date(r);return"day"===t?_=Math.floor(a/864e5):"minute"===t?(_=Math.round(a/1e3),_/=60):"hour"===t&&(_=Math.floor(a/1e3),_/=3600),i?parseInt(_):parseInt(Math.abs(_))}({date1:e.column_value,date2:new Date,type:"day",isAbsDisabled:!0})<0&&(p=!0),c=["flits.how_to_earn_credit_page.special_day_credit_rule_title","Bonus day credit"],l=["flits.how_to_earn_credit_page.special_day_credit_rule_description","Get special day credit on {{ date }}",{date:new Date(e.column_value).getDate()+"/"+(new Date(e.column_value).getMonth()+1)+"/"+new Date(e.column_value).getFullYear()}]);break;case"product_tag":c=["flits.how_to_earn_credit_page.product_tag_credit_rule_title","Credit for specific product collection"];let b=e.avails.map(((e,r)=>'').concat(e,"")));b=b.join(", "),l=["flits.how_to_earn_credit_page.product_tag_credit_rule_description","Buy product/s with (any tag) {{ tag }} and get {{ credit }} credit.",{credit:g,tag:b}];break;case"product_review":c=["flits.how_to_earn_credit_page.product_review_credit_rule_title","Product review credit"],l=["flits.how_to_earn_credit_page.product_review_credit_rule_description","Write a product review and get {{ credit }} credit.",{credit:g}];break;case"add_product_to_wishlist":c=["flits.how_to_earn_credit_page.wishlisted_product_credit_rule_title","Wishlisted product credit"],l=["flits.how_to_earn_credit_page.wishlisted_product_credit_rule_description","You can earn {{ credit }} credit when you add product/s in wishlist.",{credit:g}];break;case"cart":c=["flits.how_to_spend_credit_page.spend_credit_on_cart_rule_title","Spend on cart"];let v=e.column_value.split(":"),y=_(Math.abs(100*v[0]),null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o?void 0:o.money_format),x=_(Math.abs(100*v[1]),null===(d=window)||void 0===d||null===(d=d.flitsThemeAppExtensionObjects)||void 0===d?void 0:d.money_format);e.is_fixed&&"-1"!==v[1]?l=["flits.how_to_spend_credit_page.spend_credit_on_cart_rule_description_1","Your cart value is between {{ min_cart_value }}-{{ max_cart_value }}. Congratulations you are eligible to use {{ credit }} credit.",{min_cart_value:y,max_cart_value:x,credit:g}]:e.is_fixed&&"-1"===v[1]?l=["flits.how_to_spend_credit_page.spend_credit_on_cart_rule_description_3","Your cart value is {{ min_cart_value }} (or more). Congratulations you can use {{ credit }} credit.",{min_cart_value:y,credit:g}]:e.is_fixed||"-1"===v[1]?e.is_fixed||"-1"!==v[1]||(l=["flits.how_to_spend_credit_page.spend_credit_on_cart_rule_description_4","Your cart value is {{ min_cart_value }} (or more). Congratulations you are eligible to use {{ credit }} of cart value as credit.",{credit:g,min_cart_value:y}]):l=["flits.how_to_spend_credit_page.spend_credit_on_cart_rule_description_2","Your cart value is between {{ min_cart_value }}-{{ max_cart_value }}. Congratulations you are eligible to use {{ credit }} of cart value as credit.",{min_cart_value:y,max_cart_value:x,credit:g}];break;case"referrer_friend":c=["flits.refer_friend_page.referrer_credit_rule_title","Referral Program"],l=["flits.refer_friend_page.referrer_credit_rule_description","Invite your friends and get {{ credit }} credit when they sign up.",{credit:g}];break;case"referee_friend":c=["flits.refer_friend_page.referee_credit_rule_title","Referral Program"],l=["flits.refer_friend_page.referee_credit_rule_description","When your friends accept the invitation, they will get {{ credit }} credit.",{credit:g}],null!=e&&e.is_earned||(p=!0);break;case"referrals_total_number":c=["flits.refer_friend_page.credit_on_number_of_referrals_rule_title","Credit on numbers of referrals"],l=["flits.refer_friend_page.credit_on_number_of_referrals_rule_description","When you reach {{ referral_count }} referrals you get {{ credit }} credit.",{credit:g,referral_count:e.column_value}];break;case"referrals_total_spent":c=["flits.refer_friend_page.credit_on_referrals_total_spent_amount_rule_title","Credit after referral's total spent amount"],l=["flits.refer_friend_page.credit_on_referrals_total_spent_amount_rule_description","You can earn {{ credit }} credit when your referral's total spent amount is {{ total_spent_amount }} or more.",{credit:g,total_spent_amount:_(Math.abs(100*parseInt(e.column_value)),null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n?void 0:n.money_format)}];break;case"referrals_order_number":c=["flits.refer_friend_page.referrals_specific_order_credit_rule_title","Credit on specific order by referee"],l=["flits.refer_friend_page.referrals_specific_order_credit_rule_description","You can earn {{ credit }} credit on your referee's order number {{ order_count }}.",{credit:g,order_count:e.column_value}],">="===e.relation&&(c=["flits.refer_friend_page.referrals_specific_order_and_next_orders_credit_rule_title","Credit on referee's order number {{ order_count }} and next orders",{order_count:e.column_value}],l=["flits.refer_friend_page.referrals_specific_order_and_next_orders_credit_rule_description","You can earn {{ credit }} credit on referee's order number {{ order_count }} and next orders {{ order_count+1 }}, {{ order_count+2 }}... {{ order_count+n }}",{credit:g,order_count:e.column_value}]);break;case"checkout_shipping":c=["flits.how_to_spend_credit_page.spend_credit_on_shipping_rule_title","Free Shipping"],l=["flits.how_to_spend_credit_page.spend_credit_on_shipping_rule_description","You can use your credit on shipping charges."]}}else c=[e.title,e.title],l=[e.description,e.description];return{...e,description3:u,title:c,description2:s,description:l,notApplicable:p}}))}t.r(r),t.d(r,{getRuleFormated:()=>a})}}]);