"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o<t;o++)a[o]=e[o];return a}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a,n,i,r,s=[],l=!0,c=!1;try{if(i=(o=o.call(e)).next,0===t){if(Object(o)!==o)return;l=!1}else for(;!(l=(a=i.call(o)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,n=e}finally{try{if(!l&&null!=o.return&&(r=o.return(),Object(r)!==r))return}finally{if(c)throw n}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}var ga_script,gtag;function hj(){return!0}function setCookie(e,t,o){var a,n="";o&&((a=new Date).setTime(a.getTime()+24*o*60*60*1e3),n="; expires="+a.toUTCString()),document.cookie=e+"="+(t||"")+n+"; path=/"}function getCookie(e){for(var t=e+"=",o=document.cookie.split(";"),a=0;a<o.length;a++){for(var n=o[a];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t)){var i=n.substring(t.length,n.length);try{return decodeURIComponent(i)}catch(e){return i}}}return null}function deleteCookie(e){document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function getStringJustBefore(e,t){return e&&"string"==typeof e?e.split(t)[0]:""}function getUrlVars(){var a={};return window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,o){a[t]=getStringJustBefore(o,"#")}),a}!function(e,t){var o=e.amplitude||{_q:[],_iq:{}},a=t.createElement("script"),t=(a.type="text/javascript",a.async=!0,a.src="https://cdn.amplitude.com/libs/amplitude-4.5.2-min.gz.js",a.onload=function(){e.amplitude.runQueuedFunctions?e.amplitude.runQueuedFunctions():console.log("[Amplitude] Error: could not load SDK")},t.getElementsByTagName("script")[0]);function n(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}t.parentNode.insertBefore(a,t);for(var i=function(){return this._q=[],this},r=["add","append","clearAll","prepend","set","setOnce","unset"],s=0;s<r.length;s++)n(i,r[s]);o.Identify=i;for(var l=function(){return this._q=[],this},c=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],d=0;d<c.length;d++)n(l,c[d]);o.Revenue=l;var g=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function p(t){for(var e=0;e<g.length;e++)!function(e){t[e]=function(){t._q.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(g[e])}p(o),o.getInstance=function(e){return e=(e&&0!==e.length?e:"$default_instance").toLowerCase(),o._iq.hasOwnProperty(e)||(o._iq[e]={_q:[]},p(o._iq[e])),o._iq[e]},e.amplitude=o}(window,document),(-1<window.location.origin.indexOf("//animall.appspot")||-1<window.location.origin.indexOf("animall.in")||-1<window.location.origin.indexOf("animall.app")&&-1===window.location.origin.indexOf("-animall.appspot"))&&-1===window.location.origin.indexOf("dev")?(amplitude.getInstance().init("6ca407c6c2bf2bcd8b3ccf471db026c6",null,{saveEvents:!0,includeUtm:!0,includeReferrer:!0,saveParamsReferrerOncePerSession:!1,sessionTimeout:18e5,unsetParamsReferrerOnNewSession:!0}),console.log=function(){}):amplitude.getInstance().init("e5dc74a2fb3d5fc7480e5b3642ddce7b",null,{saveEvents:!0,includeUtm:!0,includeReferrer:!0,saveParamsReferrerOncePerSession:!1,sessionTimeout:18e5,unsetParamsReferrerOnNewSession:!0}),-1===window.location.pathname.indexOf("/user")&&(document.querySelector('script[src="https://www.googletagmanager.com/gtag/js?id=G-M9FDSR64LQ"]')||(ga_script=document.createElement("script"),ga_script.type="text/javascript",ga_script.src="https://www.googletagmanager.com/gtag/js?id=G-M9FDSR64LQ",ga_script.async=!0,document.body.appendChild(ga_script)),window.dataLayer=window.dataLayer||[],window.gtag||(gtag=function(){dataLayer.push(arguments)},window.gtag=gtag,gtag("js",new Date),gtag("config","G-M9FDSR64LQ"),gtag("config","AW-689702283")));var languageParams=getUrlVars(),language=languageParams.lang||getCookie("lang")||"hi",platform=languageParams.platform||"web",appVersion=languageParams.appVer,apiVersion=languageParams.apiVersion,currentDateTime=new Date,todayMidnight=(new Date).setHours(24,0,0,0),remainingHoursToMidnight=(todayMidnight-currentDateTime)/60/60/1e3,utmCookieExpiryTime=1/(24/remainingHoursToMidnight),AMART_DISTRICT_MAPPINGS,AMART_PINCODE_MAPPINGS;function amartReferralLink(e){setCookie("amartReferrer",e,365),getCookie("accessToken")&&(window.location.href="/mart?source=REFERRAL_LINK&code="+e)}languageParams.utm_campaign&&setCookie("latestUtmCampaign",languageParams.utm_campaign,utmCookieExpiryTime),languageParams.utm_source&&setCookie("latestUtmSource",languageParams.utm_source,utmCookieExpiryTime),languageParams.utm_medium&&setCookie("latestUtmMedium",languageParams.utm_medium,utmCookieExpiryTime),languageParams.utm_content&&setCookie("latestUtmContent",languageParams.utm_content,utmCookieExpiryTime),languageParams.amartReferrer&&amartReferralLink(languageParams.amartReferrer),"android"===platform&&setCookie("isAndroid",!0,365),appVersion&&(appVersion=appVersion.split("-")[0],setCookie("appVersion",appVersion,365));var deepLink=void 0;function attachCommonEventProps(t){var o={LANGUAGE:language,PLATFORM:getCookie("isAndroid")?"android":"web",USERNAME:getCookie("userName")?getCookie("userName"):"NA",USERPHONE:getCookie("userPhone")?getCookie("userPhone"):"NA",APPVERSION:getCookie("appVersion")?getCookie("appVersion"):"NA",LOGIN:getCookie("accessToken")?"YES":"NO",LAST_UTM_CAMPAIGN:getCookie("latestUtmCampaign")?getCookie("latestUtmCampaign"):"IN_APP",LAST_UTM_SOURCE:getCookie("latestUtmSource")?getCookie("latestUtmSource"):"IN_APP",LAST_UTM_MEDIUM:getCookie("latestUtmMedium")?getCookie("latestUtmMedium"):"IN_APP",LAST_UTM_CONTENT:getCookie("latestUtmContent")?getCookie("latestUtmContent"):"IN_APP",BUCKET_ID:getCookie("bucketId"),PATH:window.location.pathname,QPARAMS:window.location.search||"NA",HASH:window.location.hash||"NA",ODD_EVEN:localStorage.getItem("userData")?JSON.parse(localStorage.getItem("userData")).id%2==0?"EVEN":"ODD":"NA"};return sessionStorage.setItem("lastEventFired",Date.now()),Object.keys(o).forEach(function(e){t[e]=o[e]}),t}function logAmplitudeEvent(e,t){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=e.split("_"),n=a[0],i=a[1],a=a[2],n=((t=attachCommonEventProps(t||{})).ACTION=n,t.LOCATION=a,t.SCREEN_NAME=i,"amplitudeSessionExcludedItems"),a=JSON.parse(sessionStorage.getItem(n))||[];if(o){if(a.includes(e))return void console.log(e+" already triggered in this session");a.push(e),sessionStorage.setItem(n,JSON.stringify(a))}getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.9.6")&&compareVersions(getCookie("appVersion"),"!==","1.9.9")?AndroidBridge.logAmplitudeEvent(e,JSON.stringify(t)):amplitude.getInstance().logEvent(e,t),console.log(e,t)}function setAmplitudeUserProperties(e,t){var o;getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.9.6")&&compareVersions(getCookie("appVersion"),"!==","1.9.9")?AndroidBridge.setAmplitudeUserProperties(e.toString(),t.toString()):(o=(new amplitude.Identify).set(e,t),amplitude.getInstance().identify(o)),console.log("=== Amplitude User Property Set === ",e,": ",t)}function fireFbEvent(e,t,o,a,n){var i,r,s,l,c,d;getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.6.5")?(i=getCookie("bucketId")?getCookie("bucketId"):"NA",r=getCookie("userName")?getCookie("userName"):"NA",s=getCookie("userPhone")?getCookie("userPhone"):"NA",l=n||"NA",c=a||"NA",d=o||"NA",n=t||"NA",Android.logFacebookEvent(e,i,r,s,l,c,d,n),compareVersions(getCookie("appVersion"),">=","3.0.8")&&Android.logFirebaseEvent(e,i,r,s,l,c,d,n)):"function"==typeof window.gtag?(window.gtag("event",e,{event_category:"Web Events",bucket_id:i,type:l,status:c,position:d}),console.log("Event fired to GA: "+e)):console.warn("Google Analytics gtag function not found")}function setUserLanguage(o,e){-1!==["hi","en","te","mr","gu","pa","kn","ta"].indexOf(o)&&(setCookie("lang",o,365),setAmplitudeUserProperties("userLanguage",o),$(".loader-overlay").show(),logAmplitudeEvent("SWITCH_LANGUAGE_GLOBAL",{LANGUAGE:o,SOURCE:e}),$.ajax({url:"/api/user/lang",method:"PUT",data:JSON.stringify({langPreference:o}),contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")||""}}).done(function(e){var t;getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.9.8")&&-1===["ka","tn"].indexOf(o)?AndroidBridge.updateLanguagePreference(o):(delete languageParams.lang,t=new URLSearchParams(languageParams).toString(),window.location.href=window.location.origin+window.location.pathname+(t?"?"+t:""))}).fail(function(e){$(".loader-overlay").hide(),delete languageParams.lang;var t=new URLSearchParams(languageParams).toString();window.location.href=window.location.origin+window.location.pathname+(t?"?"+t:"")}))}function getAnimalTrans(e,o,a){return o=o||"FEMALE","BUFFALO"===e&&"FEMALE"===o?t.common.animalType.buffalo:"COW"===e&&"FEMALE"===o?t.common.animalType.cow:"BUFFALO"===e&&"MALE"===o?t.common.animalType.maleBuffalo:"COW"===e&&"MALE"===o?t.common.animalType.maleCow:"OTHER"===e&&a?"":t.common.animalType.cattle}function getUserProfileUrl(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return getCookie("userSlug")&&getCookie("accessToken")?"/next/user/"+getCookie("userSlug").slice(-10)+(e?"?source="+e:""):"/login"}-1<window.location.search.indexOf("redirect")&&(window.location.search.split("redirect=")[1].startsWith("https://animall.in")||window.location.search.split("redirect=")[1].startsWith("https://animall.appspot.com/"))&&(deepLink=window.location.search.split("redirect=")[1]),languageParams.lang&&setUserLanguage(languageParams.lang,"query");var insideNavigation=!1,userPlatform,locationName,geocodingApiMMI,lat,_long,currentUserData,joinedDate,fullYear,week,formattedWeek,userJoinedWeek,currentSessionId;function triggerBottomMenu(e,t,o){insideNavigation=!0,$(".loader-overlay").show();var a=attachCommonEventProps({ACTION:"CLICKED",LOCATION:"GLOBAL",SCREEN_NAME:"MENU",LANGUAGE:language,POSITION:e,PAGE:window.location.href});if("Home"===e?logAppsflyerEvent("Pashu Kharide",a):"Sell"===e?logAppsflyerEvent("Pashu Beche",a):"Community"===e?logAppsflyerEvent("Pashu Chat",a):"Pashu Suvidhaen"===e?logAppsflyerEvent("Pratiyogita",a):"Vet"===e?logAppsflyerEvent("Vet",a):"Pashu Illaj"===e&&logAppsflyerEvent("Pashu Illaj",a),"Profile"!==e)return!0;window.location.href=getUserProfileUrl(o||"BottomMenu")}function triggerSellTop(e){return logAmplitudeEvent("CLICKED_SELL_GLOBAL",attachCommonEventProps({ACTION:"CLICKED",LOCATION:"GLOBAL",SCREEN_NAME:"SELL",POSITION:e})),!0}function inviteFriends(e,t){logAmplitudeEvent("CLICKED_INVITE_GLOBAL",attachCommonEventProps({ACTION:"CLICKED",LOCATION:"GLOBAL",SCREEN_NAME:"INVITE",POSITION:t})),Android.showToast(e)}function triggerAppInstall(e){return fbq("track","InitiateCheckout"),logAmplitudeEvent("CLICKED_APPINSTALL_GLOBAL",attachCommonEventProps({ACTION:"CLICKED",LOCATION:"GLOBAL",SCREEN_NAME:"APPINSTALL",POSITION:e})),!0}function isScrolledIntoView(e,t){var o=$(window).scrollTop(),a=o+$(window).height(),n=$(e).offset().top,i=n+$(e).height();return t?i<=a&&o<=n:o<=(n=$(e).offset().top-250)&&n<=a||o<=i&&i<=a}function checkVisible(e,t,o){t=t||0,o=o||"visible";var e=(e="function"==typeof jQuery&&e instanceof jQuery?e[0]:e).getBoundingClientRect(),a=Math.max(document.documentElement.clientHeight,window.innerHeight),n=e.bottom-t<0,e=0<=e.top-a+t;return"above"===o?n:"below"===o?e:!n&&!e}function isAndroid(){return/Android/i.test(navigator.userAgent)}function isMobile(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)}function formatPashuPrice(){var e,t=this.value||"";""!=(t=t.replace(/[^0-9\.]/g,""))&&((e=t.split("."))[0]=parseInt(e[0]),e[0]<1e3||5e5<e[0]?$("#animal-price").addClass("error"):($("#animal-price").removeClass("error"),$(".price-error").hide()),e[0]=e[0].toLocaleString("en-IN"),t=e.join(".")),this.value=t}function commaSeparatorNumber(e){var t;if(e)return""!=(e=(e=e.toString()).replace(/[^0-9\.]/g,""))&&((t=e.split("."))[0]=parseInt(t[0],10).toLocaleString("en-IN"),t[1]&&(t[1]=t[1].substring(0,1)),e=t.join(".")),e}function closePopUp(){window.location.hash="#",$(".popup-backdrop, .popup").fadeOut()}function getAmartZoneMapping(){var t="amartDistrictMappings",o="amartPincodeMappings",a=sessionStorage.getItem(t),n=sessionStorage.getItem(o);a&&(AMART_DISTRICT_MAPPINGS=JSON.parse(a)),n&&(AMART_PINCODE_MAPPINGS=JSON.parse(n)),n&&a||Smartjax.ajax({url:"/api/exp/mart/zone",method:"GET",async:!1}).done(function(e){a=e.districtMappings,n=e.pincodeMappings,sessionStorage.setItem(t,JSON.stringify(a)),sessionStorage.setItem(o,JSON.stringify(n)),AMART_DISTRICT_MAPPINGS=a,AMART_PINCODE_MAPPINGS=n}).fail(function(e){console.log("error",e)})}function compareVersions(v1,comparator,v2){if(!v1||!v2)return!1;var comparator="="==comparator?"==":comparator;if(-1==["==","===","<","<=",">",">=","!=","!=="].indexOf(comparator))throw new Error("Invalid comparator. "+comparator);for(var v1parts=v1.split("."),v2parts=v2.split("."),maxLen=Math.max(v1parts.length,v2parts.length),part1,part2,cmp=0,i=0;i<maxLen&&!cmp;i++)part1=parseInt(v1parts[i],10)||0,part2=parseInt(v2parts[i],10)||0,part1<part2&&(cmp=1),part2<part1&&(cmp=-1);return eval("0"+comparator+cmp)}function timeSince(e,o){var e=Math.floor((new Date-e)/1e3),a=Math.floor(e/31536e3);if(o&&"trending"===o){if(24<(a=Math.floor(e/3600))&&a<48)return t.common.inDemand;a=Math.floor(e/31536e3)}return 1<=a?a+" "+t.common.interval.yearAgo:1<=(a=Math.floor(e/2592e3))?a+" "+t.common.interval.monthAgo:1<=(a=Math.floor(e/86400))?a+" "+t.common.interval.dayAgo:1<=(a=Math.floor(e/3600))?a+" "+t.common.interval.hourAgo:1<=(a=Math.floor(e/60))?a+" "+t.common.interval.minuteAgo:(e<0&&(e=0),Math.floor(e)+" "+t.common.interval.secondAgo)}function goBack(e,t){t=t||"/";var o=window.location.href;window.history.go(-e),setTimeout(function(){window.location.href==o&&(window.location.href=t)},1500)}function linkify(e){e=e.replace(/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,'<a href="$1" target="_blank">$1</a>');return e=e.replace(/(^|[^\/])(www\.[\S]+(\b|$))/gim,'$1<a href="http://$2" target="_blank">$2</a>')}function generateDeviceUuid(){var o=(new Date).getTime(),a=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<o?(t=(o+t)%16|0,o=Math.floor(o/16)):(t=(a+t)%16|0,a=Math.floor(a/16)),("x"===e?t:3&t|8).toString(16)})}function checkDeviceRegistered(e,t,o,a){"noreload"!==a&&setTimeout(function(){window.location.reload(!0)},50)}function setDistrictFromCords(a,n,t){Smartjax.ajax({url:"/zap/location/coords",data:{lat:a,long:n,vertical:3<arguments.length&&void 0!==arguments[3]?arguments[3]:"discovery"},method:"GET"}).done(function(e){var t,o;e&&e.data&&(t=e.data.adminLevel5,o=getLocationString(e.data)||"",setCookie("district",t,365),setCookie("userState",e.data.adminLevel4,365),setAmplitudeUserProperties("userDistrict",t),getCookie("userLocationSaved")||setUserLocation(a,n,t,null,o))}).fail(function(e){console.log(e),getCookie("userLocationSaved")||setUserLocation(a,n,null,null,t)})}function setUserLocation(e,t,o,a,n){getCookie("userLocationSaved")||(setAmplitudeUserProperties("userDistrict",o),getCookie("accessToken")&&$.ajax({url:"/api/user/location",data:JSON.stringify({locationName:n||void 0,locationLat:e,locationLng:t,district:o||void 0,placeId:a||void 0}),method:"POST",contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")},success:function(e){console.log(e),setCookie("userLocationSaved",!0,365),"/sell"!==window.location.pathname&&"/create"!==window.location.pathname||window.location.reload()},error:function(e){console.log(e)}}))}function reportUserStrike(t,o,e,a){"MULTIPLE_USER_SINGLE_DEVICE"!==t&&(a||getCookie("accessToken")?(logAmplitudeEvent("STRIKE_USER_GLOBAL",attachCommonEventProps({ACTION:"STRIKE",LOCATION:"GLOBAL",SCREEN_NAME:"USER",TYPE:t,MODE:o,OLD_PHONE:e||"NA"})),$.ajax({url:"/api/report/strike",data:JSON.stringify({type:t,oldUserPhone:e||void 0}),method:"POST",contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")},success:function(e){console.log(e),"MULTIPLE_USER_SINGLE_DEVICE"===t?setTimeout(function(){window.location.reload(!0)},50):"PINCODE"===o&&(deepLink?window.location.replace(deepLink):window.location.replace("/buy"))},error:function(e){console.log(e),"MULTIPLE_USER_SINGLE_DEVICE"===t?setTimeout(function(){window.location.reload(!0)},50):"PINCODE"===o&&(deepLink?window.location.replace(deepLink):window.location.replace("/buy"))}})):"PINCODE"===o&&(deepLink?window.location.replace(deepLink):window.location.replace("/buy")))}function checkCoordinatesDistance(e,t,o,a,n){var i;console.log("DISTANCE CHECK: ",e,t,o,a,n),o&&a&&(i=(o-e)*(Math.PI/180),a=(a-t)*(Math.PI/180),t=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e*(Math.PI/180))*Math.cos(o*(Math.PI/180))*Math.sin(a/2)*Math.sin(a/2),350<6371*(2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t))))?reportUserStrike("GEOLOC_INPUTLOC_MISMATCH",n):"PINCODE"===n&&(deepLink?window.location.replace(deepLink):window.location.replace("/buy"))}function addScript(e,t){var o=document.createElement("script");o.setAttribute("src",e),document.body.appendChild(o),o.onload=function(){t()}}function addCSS(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"#",t=e.replace("..",window.location.origin),o=!1,a=0;a<document.styleSheets.length;a++)if(document.styleSheets[a].href===t){o=!0;break}o||$("head").append($('<link rel="stylesheet" type="text/css" href="'+e+'" />'))}function permissionDenied(e){logAmplitudeEvent("DENIED_PERMISSION_GLOBAL",attachCommonEventProps({ACTION:"DENIED",LOCATION:"GLOBAL",SCREEN_NAME:"PERMISSION",TYPE:e})),"GALLERY"!==e||"/create"!==window.location.pathname&&"/sell"!==window.location.pathname||showPermissionErrorMsg()}function isScriptAdded(e){return 0<$('script[src="'+e+'"]').length}function getDeliveryInfoText(e,o,a){return!1===e?t.common.delivery.no:(e=t.common.delivery.before,o||0===o&&a?0===(o=parseFloat(o))?t.common.delivery.thisWeek:.25===o?t.common.delivery.weekAgo.replace("#var#","1"):.5===o?t.common.delivery.weekAgo.replace("#var#","2"):.75===o?t.common.delivery.weekAgo.replace("#var#","3"):1<=o&&o<=6?t.common.delivery.monthAgo.replace("#var#",o):12===o?t.common.delivery.yearAgo.replace("#var#","1"):18===o?t.common.delivery.yearAgo.replace("#var#","1.5"):24===o?t.common.delivery.year2:"":e)}function getPregnancyInfoText(e,o,a){return!1===e?t.common.pregnancy.notNow:(e=t.common.pregnancy.now,o&&a?(o=parseInt(o))<=9?t.common.pregnancy.months.replace("#var#",o):t.common.pregnancy.more10:e)}function getPostTitle(e,o,a,n,i,r,s,l,c,d,g,p,u,m,f){var h=!(15<arguments.length&&void 0!==arguments[15])||arguments[15],k="",A="";return f.type||(f.type="NA"),r&&!isNaN(parseInt(r))&&(A=(h?'<span class="price">':"")+" ₹"+commaSeparatorNumber(r)+(h?"</span>":"")),"OTHER"===a?"FEMALE"===o&&-1===["DOG - Female","HEN"].indexOf(s)?k+=(l?l+" "+t.common.litreCapacity+", ":n+" "+t.common.litreMilk+", ")+(s?getOtherAnimalName(s,o)+", ":"")+A:k+=(s?getOtherAnimalName(s,o)+", ":"")+A:"FEMALE"===o?(f="",i&&void 0!==i&&(f=(h?'<span class="lactation">':"")+e.lactationTime[i]+(0<i?" "+t.common.calving:"")+"</span>"),r="",l&&void 0!==l&&0<l?r=(h?'<span class="milk">':"")+l+" "+t.common.litreCapacity+", "+(h?"</span>":""):n&&void 0!==n&&(r=(h?'<span class="milk">':"")+n+" "+t.common.litreMilk+", "+(h?"</span>":"")),k+=void 0!==l?r+(null!=c?c+" "+t.common.monthPregnant:null!=d?getDeliveryInfoText(p,d,m).replace(" है।",""):s&&a?(t.common.breedMap[s]?t.common.breedMap[s].replace("होल्सटीन फ्रीसिएन (HF)","होल्सटीन (HF)"):s)+" "+getAnimalTrans(a,o):f)+", "+A:r+f+A):"MALE"===o&&(k+=(s?t.common.breedMap[s]||s:"")+" "+getAnimalTrans(a,o)+", "+A),k}function getPostTitleNew(e,o,a,n,i,r,s,l,c,d,g,p,u,m,f){var h=15<arguments.length&&void 0!==arguments[15]&&arguments[15],k="",A="";return f.type||(f.type="NA"),r&&!isNaN(parseInt(r))&&(A="<strong> ₹"+commaSeparatorNumber(r)+"</strong>",h)&&(A='<span class="chosen-suggested-price">'+A+'<img class="chosen-suggested-price-icon" src="https://static-assets.animall.in/static/images/teal-like.svg" width="18.5" height="18" /></span>'),"OTHER"===a?"FEMALE"===o&&-1===["DOG - Female","HEN"].indexOf(s)?k+=(l?"<strong>"+l+"L "+t.common.litreCapacity+"</strong> | ":"<strong>"+n+"L "+t.common.litreMilk+"</strong> | ")+(s?"<strong>"+getOtherAnimalName(s,o)+"</strong> | ":"")+A:k+=(s?"<strong>"+getOtherAnimalName(s,o)+"</strong> | ":"")+A:"FEMALE"===o?(f="",i&&void 0!==i&&(f=e.lactationTime[i]+(0<i?" "+t.common.calving:"")),r="",l&&void 0!==l&&0<l?r="<strong>"+l+"L "+t.home.filters.smartFilters.filterMilkCapacity+"</strong> | ":n&&void 0!==n&&(r="<strong>"+n+"L "+t.common.currentMilk+"</strong> | "),k=r+(s&&a?t.common.breedMap[s]?"<strong>"+t.common.breedMap[s].replace("होल्सटीन फ्रीसिएन (HF)","HF")+"</strong> | ":"<strong>"+s+"</strong> | ":"")+(f?"<strong>"+f+"</strong> | ":"")+"<br><strong>"+n+"L "+t.common.currentMilk+"</strong> | "+A):"MALE"===o&&(k=(s?t.common.breedMap[s]?"<strong>"+t.common.breedMap[s]+"</strong> | ":"<strong>"+s+"</strong> | ":"")+A),k}function getPostDescription(e,o,a,n,i,r,s,l,c,d,g,p,u,m,f,h){var k=null!=n?t.common.description.currentMilk.replace("#var#",n):"",A="",v=(f&&"undefined"!==f?(v=(s&&"undefined"!==s?t.common.breedMap[s]||s:"")+" "+getAnimalTrans(a,o,!0),A=("MALE"===o?t.common.description.breedAndAge:t.common.description.breedAndAgeMale).replace("#breedAndType#",v).replace("#age#",f)):a&&void 0!==a&&(v=(s&&"undefined"!==s?t.common.breedMap[s]||s:"")+" "+getAnimalTrans(a,o,!0),A=t.common.description.breedWithoutAge.replace("#breedAndType#",v)),""),C=(null!=i&&(v=0<i?(C=e.lactationTime[i],"te"===getCookie("lang")&&(C+=" ("+Object.keys(e.lactationTime)[i]+"వ)"),t.home.core.lactationInfo.replace("#var#",C)):t.home.core.lactationInfoNo.replace("#var#",e.lactationTime[i])),null!=g?getPregnancyInfoText(g,c,m):""),g=0<i&&(null!=d||!1===p)?getDeliveryInfoText(p,d,m):"",c="",p="",d=("OTHER"===a&&"FEMALE"===o&&(p=(p+=n?n+" "+t.common.litreMilk+", ":"")+e.lactationTime[i]+(0<i?" "+t.home.filters.lactation:"")+"। "),u&&("NA"===u?c=t.common.calf.no:"MALE"===u&&"COW"===a?c=t.common.calf.maleCow:"FEMALE"===u&&"COW"===a?c=t.common.calf.femaleCow:"MALE"===u&&"BUFFALO"===a?c=t.common.calf.maleBuffalo:"FEMALE"===u&&"BUFFALO"===a&&(c=t.common.calf.femaleBuffalo)),"");return h&&(d=h),f||(v=v.replace("ये","ये"+(s&&"undefined"!==s?t.common.breedMap[s]?" "+t.common.breedMap[s]:" "+s:"")+" "+getAnimalTrans(a,o))),"FEMALE"===o?(m=filterMilk?'<span class="current-milk-highlight">'+k+"</span>":k,A+v+(0<i?0!==n?" "+t.common.and+" "+m+" ":" "+t.home.core.milkingStopped:"")+" "+C+" "+g+" "+c+" "+p+d):A+d}function getPostDescriptionNew(e,o,a,n,i,r,s,l,c,d,g,p,u,m,f,h){var k="",A="",v="",g=(null!=g&&(v=getPregnancyInfoText(g,c,m)+" "),""),c=(0<i&&(null!=d||!1===p)&&(g=getDeliveryInfoText(p,d,m)+" "),"");return u&&("NA"===u?c=t.common.calf.no+" ":"MALE"===u&&"COW"===a?c=t.common.calf.maleCow+" ":"FEMALE"===u&&"COW"===a?c=t.common.calf.femaleCow+" ":"MALE"===u&&"BUFFALO"===a?c=t.common.calf.maleBuffalo+" ":"FEMALE"===u&&"BUFFALO"===a&&(c=t.common.calf.femaleBuffalo+" ")),(A+=v+g+c).trim()&&(k+="<div>👉 "+A.trim()+"</div>"),h&&(k+="<p>"+h+"</p>"),k}function getOtherAnimalName(e,t){return t=t||"FEMALE","BAKARI"===e&&"FEMALE"===t?"बकरी":"BAKRA"===e&&"MALE"===t?"बकरा":"SHEEP - Female"===e&&"FEMALE"===t?"मादा भेड़":"SHEEP - Male"===e&&"MALE"===t?"नर भेड़":"HEN"===e&&"FEMALE"===t?"मुर्गी":"DOG - Female"===e&&"FEMALE"===t?"कुतिया":"DOG - Male"===e&&"MALE"===t?"कुत्ता":"CAMEL - Female"===e&&"FEMALE"===t?"मादा ऊंट":"CAMEL - Male"===e&&"MALE"===t?"ऊंट":"HORSE - Female"===e&&"FEMALE"===t?"घोड़ी":"HORSE - Male"===e&&"MALE"===t?"घोडा":"ELEPHANT - Female"===e&&"FEMALE"===t?"हथिनी":"ELEPHANT - Male"===e&&"MALE"===t?"हाथी":"NA"===e?"पशु":e}function recordUserVisit(){var e;"localhost"!==window.location.hostname&&"devo-dot-animall.appspot.com"!==window.location.hostname&&"/downloadapp"!==window.location.pathname&&(getCookie("accessToken")&&sessionStorage.getItem("userVisitId")?$.ajax({url:"/api/analytics/user-visit/"+sessionStorage.getItem("userVisitId"),method:"PATCH",contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")||""}}).done(function(e){console.log(e),sessionStorage.removeItem("userVisitId")}).fail(function(e){console.log("err",e.statusText)}):sessionStorage.getItem("userVisit")||(e={landingPage:-1<window.location.search.indexOf("redirect")&&!window.location.search.split("redirect=")[1].startsWith("https://animall.in")?window.location.pathname+window.location.search.split("&redirect=")[0]:window.location.pathname+window.location.search,platform:getCookie("isAndroid")?"ANDROID":"WEB",appVersion:getCookie("appVersion")||null,bucketId:getCookie("bucketId")||null},$.ajax({url:"/api/analytics/user-visit",method:"POST",data:JSON.stringify(e),contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")||""}}).done(function(e){sessionStorage.setItem("userVisit",Date.now()),!getCookie("accessToken")&&e.id&&sessionStorage.setItem("userVisitId",e.id)}).fail(function(e){console.log("err",e.statusText)})))}function getUserPincode(t){var e=getCookie("pincode");e?(setCookie("pincode",e,365),setAmplitudeUserProperties("userPincode",e)):getCookie("accessToken")&&$.ajax({url:"/zap/location/amart/zone",type:"GET",headers:{accessToken:getCookie("accessToken")},success:function(e){e.data.pincode&&(setCookie("pincode",e=e.data.pincode,365),setAmplitudeUserProperties("userPincode",e),isAmartRegionUser(),t)&&t()},error:function(e,t,o){console.error("Error fetching details: "+o)}})}function checkAndCloseModal(){""===window.location.hash&&($(".photo-popup-backdrop, .photo-popup, .share-popup, .popup-backdrop, .popup, .stories-full-screen, .pashu-feedback--main-container").fadeOut(),$(".filter-slider, .sort-slider, .justtalk-messges, .help-section").slideUp(),$(".search-full-screen, .search-background").fadeOut(),$(".change-user-location, .change-user-distance").slideUp(),$("body").removeClass("hidden"),$(".search-section .change").removeClass("active"),$(".userlocation-popup-backdrop, .userLocation-info, .userLocation-loader, .manual-location").fadeOut(),$(".userlogin-popup-backdrop, .userLogin-phone, .userLogin-otp, .userLogin-name, .userLogin-success").fadeOut(),$(".photo-popup #animalPhoto").empty(),$("#pashu-feedback-form").trigger("reset"),$(".sold-popup-backdrop, .sold-popup.popup").fadeOut())}function checkAndRegisterDeviceId(){var t;sessionStorage.getItem("deviceIdRegistered")||(t=amplitude.getInstance().options.deviceId,getCookie("accessToken")&&t&&$.ajax({url:"/api/user/check-device-status",method:"POST",data:JSON.stringify({deviceId:t}),contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")}}).done(function(e){sessionStorage.setItem("deviceIdRegistered",t)}).fail(function(e){console.log("err",e)}))}function showToast(e){$(".toast").text(e),$(".toast").addClass("show"),setTimeout(function(){$(".toast").removeClass("show"),$(".toast").text("")},5e3)}function endSession(){if("localhost"===window.location.hostname||"devo-dot-animall.appspot.com"===window.location.hostname||!navigator.sendBeacon||insideNavigation||!getCookie("userPhone"))return!0;var e=(Date.now()-sessionStorage.getItem("lastEventFired"))/1e3;10<=e&&(e={api_key:"6ca407c6c2bf2bcd8b3ccf471db026c6",events:[{user_id:getCookie("animallUserId"),event_type:"ENDSESSION_USER_GLOBAL",event_properties:{ACTION:"ENDSESSION",LOCATION:"GLOBAL",SCREEN_NAME:"USER",VALUE:e,USERNAME:getCookie("userName")||"NA",USERPHONE:getCookie("userPhone")||"NA",PATH:window.location.pathname,QPARAMS:window.location.search||"NA"},session_id:currentSessionId}]},e=new Blob([JSON.stringify(e)],{"Content-Type":"application/json",Accept:"*/*"}),e=navigator.sendBeacon("https://api2.amplitude.com/2/httpapi",e),console.log("ENDSESSION_USER_GLOBAL",e))}function recordPostView(t,o,a,n,i,e){var r,s;"localhost"===window.location.hostname||"devo-dot-animall.appspot.com"===window.location.hostname||"stag-dot-animall.appspot.com"===window.location.hostname||!t||!o||isNaN(a)||isNaN(n)||isNaN(i)||(r=[],sessionStorage.getItem("viewedPosts")&&(r=JSON.parse(sessionStorage.getItem("viewedPosts"))),"HOME_PAIDPOST"===o&&(s=getCookie("paidPostView_"+t)?parseInt(getCookie("paidPostView_"+t)):0,setCookie("paidPostView_"+t,++s,14)),-1===r.indexOf(t)&&(r.push(t),sessionStorage.setItem("viewedPosts",JSON.stringify(r)),$.ajax({url:"/api/analytics/post-view",method:"POST",data:JSON.stringify({postId:t,viewPage:o,position:a,distance:n,timeElapsed:i}),contentType:"application/json",dataType:"json",headers:{accessToken:getCookie("accessToken")||""}}).done(function(e){console.log("Post View:",t,o,a,n,i)}).fail(function(e){console.log("err",e.statusText)})))}getCookie("isAndroid")?setAmplitudeUserProperties("userPlatform","android"):setAmplitudeUserProperties("userPlatform","web"),getCookie("appVersion")&&(setAmplitudeUserProperties("appVersion",getCookie("appVersion")),amplitude.getInstance().setVersionName(getCookie("appVersion")),setAmplitudeUserProperties("bucketId",getCookie("bucketId"))),apiVersion&&(setCookie("apiVersion",apiVersion,365),setAmplitudeUserProperties("apiVersion",apiVersion)),"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||$.ajaxSetup({crossDomain:!0,xhrFields:{withCredentials:!0}}),getCookie("accessToken")&&(getCookie("setUserData")?!getCookie("setUserJoining")&&getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.6.4")&&$.ajax({url:"/api/user/me",headers:{accessToken:getCookie("accessToken")},method:"GET",success:function(e){e&&e.createdAt&&(e=e.createdAt.slice(0,7),Android.setJoiningMonthGAUserProperty(e),setCookie("setUserJoining",!0,365))}}):$.ajax({url:"/api/user/me",headers:{accessToken:getCookie("accessToken")},method:"GET",success:function(e){e&&e.id&&(console.log("userDetails:",e),getCookie("appVersion")&&compareVersions(getCookie("appVersion"),"<","1.9.6")&&(10<e.id.toString().length?amplitude.getInstance().setUserId(e.id):amplitude.getInstance().setUserId(e.phone)),setAmplitudeUserProperties("nameEn",e.name),setAmplitudeUserProperties("slugId",e.slugId),setCookie("userSlug",e.slug,365),setCookie("userJoinedDate",e.createdAt,365),setCookie("animallUserId",e.id,365),setCookie("userName",e.name,365),e.phone&&e.status&&"UNVERIFIED"!==e.status&&(setCookie("userPhone",e.phone,365),setAmplitudeUserProperties("phone",e.phone),setCookie("setUserData",!0,365)),setCookie("userSlug",e.slug,365),getCookie("isAndroid"))&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.6.4")&&(e=e.createdAt.slice(0,7),Android.setJoiningMonthGAUserProperty(e),setCookie("setUserJoining",!0,365))}})),setAmplitudeUserProperties("websiteDomain",window.location.hostname.replace("www.","")),getAmartZoneMapping(),window.localStorage.getItem("animallDeviceId")||localStorage.setItem("animallDeviceId",generateDeviceUuid()),!window.localStorage.getItem("animallUserPhone")&&getCookie("userPhone")&&localStorage.setItem("animallUserPhone",getCookie("userPhone")),window.addEventListener("pageshow",function(e){e.persisted&&($(".loader-overlay").fadeOut(),-1!==window.location.pathname.indexOf("/mart")?window.location.reload():(e=new Event("userLocationChange"),this.document.dispatchEvent(e)),-1!==window.location.pathname.indexOf("/buy"))&&"#farms"===window.location.hash&&"farms"!==$(".tab.active").data("tab")&&"function"==typeof toggleTab&&toggleTab("farms")}),getCookie("latitude")&&getCookie("longitude")&&!getCookie("userLocationSaved")&&(locationName=getCookie("locationName"),locationName?setDistrictFromCords(getCookie("latitude"),getCookie("longitude"),locationName):(geocodingApiMMI="/zap/location/coords",lat=Number(Number(getCookie("latitude")).toFixed(4)),_long=Number(Number(getCookie("longitude")).toFixed(4)),$.ajax({url:geocodingApiMMI,type:"GET",data:{lat:lat,long:_long},dataType:"json",timeout:3500,success:function(e){var t;e&&e.data&&(t=e.data,locationName=getLocationString(t)||""),locationName&&(setCookie("locationName",locationName=locationName.replace("null",""),365),localStorage.setItem("gpsLocationName",locationName),t.adminLevel5&&setCookie("district",t.adminLevel5,365),t.adminLevel4&&setCookie("userState",t.adminLevel4,365),getCookie("userLocationSaved")||setUserLocation(lat,_long,t.adminLevel5,void 0,locationName))},error:function(e){console.log(e),setDistrictFromCords(getCookie("latitude"),getCookie("longitude"),locationName),console.log("ERROR_RGEOMMI_HOME"),logAmplitudeEvent("ERROR_LOCATIONIQ_HOME",attachCommonEventProps({ACTION:"ERROR",LOCATION:"HOME",SCREEN_NAME:"LOCATIONIQ",TYPE:"ONBOARDING",ERROR:xmlhttprequest.statusText}))}}))),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(function(e){}).catch(function(e){}),getCookie("accessToken")&&!getCookie("userReferralCode")&&$.ajax({url:"/api/user/me",headers:{accessToken:getCookie("accessToken")},method:"GET"}).done(function(e){e.referralCode&&e.referralLink?(setCookie("userReferralCode",e=e.referralCode+","+e.referralLink,365),console.log(e)):setCookie("userReferralCode","NA",1)}).fail(function(e){console.log("Error Fetching User Referral Link",e.statusText),setCookie("userReferralCode","NA",1)}),getCookie("accessToken")&&!getCookie("animallUserId")&&$.ajax({url:"/api/user/me",headers:{accessToken:getCookie("accessToken")},method:"GET"}).done(function(e){e.id&&setCookie("animallUserId",e.id,365)}).fail(function(e){console.log("Error",e.statusText)}),localStorage.getItem("userData")&&!window.localStorage.getItem("userJoinedDate")&&(currentUserData=JSON.parse(localStorage.getItem("userData")),joinedDate=new Date(currentUserData.createdAt),fullYear=new Date(joinedDate.getFullYear(),0,1),week=Math.ceil(((joinedDate.getTime()-fullYear.getTime())/864e5+fullYear.getDay()+1)/7),formattedWeek=("0"+week).slice(-2),userJoinedWeek="W"+formattedWeek+" "+joinedDate.toString().split(" ")[1].toUpperCase()+" "+joinedDate.getFullYear(),setAmplitudeUserProperties("userJoinedWeek",userJoinedWeek),setAmplitudeUserProperties("userJoinedDate",joinedDate),localStorage.setItem("userJoinedDate",joinedDate),"function"==typeof isEligibleForMicroTransactions)&&isEligibleForMicroTransactions(),recordUserVisit(),sessionStorage.getItem("userIdleRecorded")||setTimeout(function(){sessionStorage.getItem("lastEventFired")&&20<=(Date.now()-sessionStorage.getItem("lastEventFired"))/1e3&&(logAmplitudeEvent("IDLE_USER_GLOBAL",attachCommonEventProps({ACTION:"IDLE",LOCATION:"GLOBAL",SCREEN_NAME:"USER",SCROLL_POSITION:$(window).scrollTop()})),sessionStorage.setItem("userIdleRecorded",Date.now()))},32e3),window.onload=function(){window.onhashchange=function(){checkAndCloseModal()},setTimeout(function(){checkAndRegisterDeviceId()},1e3),$("a").bind("click",function(){insideNavigation=!0})},sessionStorage.getItem("userData")||getCookie("accessToken")&&$.ajax({url:"/api/user/me",headers:{accessToken:getCookie("accessToken")},method:"GET",success:function(e){e&&e.id&&(sessionStorage.setItem("userData",JSON.stringify(e)),localStorage.setItem("userData",JSON.stringify(e)),setCookie("accessToken",getCookie("accessToken"),365),setCookie("userName",e.name,365),!window.amplitude||amplitude.getInstance().options&&amplitude.getInstance().options.userId?console.error("[common.js] Amplitude not found"):amplitude.getInstance().setUserId(e.id))}}),sessionStorage.getItem("userStats")||getCookie("accessToken")&&Smartjax.ajax({url:"/api/user/stats",headers:{accessToken:getCookie("accessToken")},method:"GET"}).done(function(e){e&&(sessionStorage.setItem("userStats",JSON.stringify(e)),localStorage.setItem("userStats",JSON.stringify(e)))}).fail(function(e){console.log("Error Fetching User Stats",e)});var adjustLoaded=!1;function trackAdjustEvent(e,t){var o,a;getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.4")&&compareVersions(getCookie("appVersion"),"<","1.9.7.1")&&adjustLoaded&&(o=JSON.parse(localStorage.getItem("userData")),a=new AdjustEvent(e),"uv1ept"!==e&&o&&a.addPartnerParameter("userId",o.id),t&&a.addPartnerParameter("postId",t),Adjust.trackEvent(a))}function receiveFcmToken(e){localStorage.setItem("userFcmToken",e),getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.4")&&adjustLoaded&&Adjust.setPushToken(e)}function isPackageInstalled(e){getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.5")&&Android.isThisAppInstalled(e)}function getPackageInstalledStatus(e,t){var o;switch(e){case"com.google.android.apps.nbu.paisa.user":o="Google Pay";break;case"com.phonepe.app":o="PhonePay";break;case"net.one97.paytm":o="Paytm";break;case"com.mobikwik_new":o="Mobikwik";break;case"com.truecaller":o="Truecaller";break;case"com.instagram.android":o="Instagram";break;case"in.mohalla.video":o="Moj";break;case"com.eterno.shortvideos":o="Josh";break;case"com.next.innovation.takatak":o="MX TakaTak";break;case"com.moo":o="Moo Farm";break;case"com.pashu_mandi.pashu_mela.pashu_bazaar.market":o="Pashu Mandi";break;case"farmstock.agriculture.plants.kisan.krishi":o="Krishify";break;case"org.telegram.messenger":o="Telegram";break;case"com.cloudflare.onedotonedotonedotone":o="1.1.1.1";break;case"com.lexa.fakegps":o="Fake GPS location";break;case"com.hopefactory2021.fakegpslocation":o="Fake GPS location 2022";break;case"com.marlon.floating.fake.location":o="Fake GPS location Floater";break;case"com.rosteam.gpsemulator":o="GPS Emulator";break;case"com.locationchanger":o="Location Changer";break;default:o=e}"com.truecaller"!==e&&logAmplitudeEvent("INSTALLED_APPS_GLOBAL",attachCommonEventProps({ACTION:"INSTALLED",LOCATION:"GLOBAL",SCREEN_NAME:"APPS",NAME:o,VALUE:t}))}function storeAdIdInDb(){var e,t;getCookie("accessToken")&&getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.9.3")&&!localStorage.getItem("adIdStored")&&(t=localStorage.getItem("gpsAdId")?100:(Android.androidGPSId(),5e3),setTimeout(function(){(e=localStorage.getItem("gpsAdId"))&&"00000000-0000-0000-0000-000000000000"!==e&&$.ajax({url:"/api/user/store-ad-id",method:"POST",data:{adId:e},headers:{accessToken:getCookie("accessToken")},success:function(e){e.adIdUpdated?localStorage.setItem("adIdStored",!0):!e.adIdUpdated&&e.oldUserPhone&&(localStorage.setItem("adIdStored","Duplicate"),logAmplitudeEvent("DUPLICATE_DEVICE_GLOBAL",{POSITION:"HOME",NEW_PHONE:e.userPhone,OLD_PHONE:e.oldUserPhone}))},fail:function(e){console.log("error : "+e)}})},t))}function getGPSAdID(e){e&&(localStorage.setItem("gpsAdId",e),e={api_key:"6ca407c6c2bf2bcd8b3ccf471db026c6",events:[{user_id:getCookie("animallUserId"),event_type:"SET_GPSID_GLOBAL",adid:e,event_properties:{ACTION:"SET",LOCATION:"GLOBAL",SCREEN_NAME:"GPSID",VALUE:e,USERNAME:getCookie("userName")||"NA",USERPHONE:getCookie("userPhone")||"NA",PATH:window.location.pathname,QPARAMS:window.location.search||"NA"},user_properties:{gpsAdId:e}}]},$.ajax({url:"https://api2.amplitude.com/2/httpapi",method:"post",data:JSON.stringify(e),headers:{"Content-Type":"application/json",Accept:"*/*"},success:function(e){console.log("Response Amplitude: ",JSON.stringify(e))}}))}function captureInstallEvent(e,t,o){logAmplitudeEvent("INSTALL_APP_GLOBAL",attachCommonEventProps({ACTION:"INSTALL",LOCATION:"GLOBAL",SCREEN_NAME:"APP",utm_source:e,utm_campaign:t,utm_medium:o})),AndroidBridge.installCapturedCallback()}function sendAmplitudeEvent(e){var t=e.split("_");logAmplitudeEvent(e,attachCommonEventProps({ACTION:t[0],SCREEN_NAME:t[1],LOCATION:t[2]}))}function logAppsflyerEvent(e,t){}getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.4")&&compareVersions(getCookie("appVersion"),"<","1.9.7.1")&&setTimeout(function(){$.when($.getScript("https://static-assets.animall.in/static/js/adjust.js"),$.getScript("https://static-assets.animall.in/static/js/adjust_config.js"),$.getScript("https://static-assets.animall.in/static/js/adjust_event.js"),$.Deferred(function(e){$(e.resolve)})).done(function(){var e=AdjustConfig.EnvironmentProduction,e=new AdjustConfig("9qvoc14r99mo",e);e.setUrlStrategy("url_strategy_india"),e.setOpenDeferredDeeplink(!1),e.setDeferredDeeplinkCallback(function(e){e&&!deepLink&&(deepLink=e)}),Adjust.onCreate(e),adjustLoaded=!0,Android.requestFcmToken()})},2e3),getCookie("isAndroid")&&getCookie("animallUserId")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.5")&&!localStorage.getItem("gpsAdId")&&(compareVersions(getCookie("appVersion"),">=","1.9.3")?Android.androidGPSId():Android.getAndroidGPSId());var nativeSellPageOpened=!1,stats,listingStats,eligible,listingBlockStrategy,assessPrimePrice;function openEditPage(e,t,o){$(".loader-overlay").show();var a=getCookie("appVersion"),n=getCookie("isAndroid"),i=getCookie("userLocationSaved"),a=a&&compareVersions(a,">=","3.0.8"),r=isListingMonetizationEligible(),s=JSON.parse(getCookie("incompletePost"))||{};!r&&n&&a&&i?nativeSellPageOpened||(nativeSellPageOpened=!0,AndroidBridge.openNativeSellPage(JSON.stringify({postId:t})),setTimeout(function(){nativeSellPageOpened=!1},500)):(n=(r=s.post)&&"DRAFTED"===r.state?"/sell?uuid="+r.uuid+"&source="+e:"/post/edit?source="+e+"&postId="+t,o&&(n+="&"+o),window.location.href=n)}function sellPageSwitch(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=($(".loader-overlay").show(),getCookie("appVersion")),n=getCookie("isAndroid"),i=getCookie("userLocationSaved"),r=a&&compareVersions(a,">=","3.0.3");isListingMonetizationEligible()&&(o=!0),trackVisitedPage("sell"),!o&&n&&r&&i?(nativeSellPageOpened||(nativeSellPageOpened=!0,compareVersions(a,">=","3.0.8")?AndroidBridge.openNativeSellPage(JSON.stringify({postId:null})):AndroidBridge.openNativeSellPage(),setTimeout(function(){nativeSellPageOpened=!1},500)),compareVersions(a,"<","3.0.7")&&setTimeout(function(){$(".loader-overlay").hide()},2e3)):window.location.href=t?"/sell?source="+e:"/sell?"+e}function getNotificationStatus(e){sessionStorage.getItem("notificationStatus")||(sessionStorage.setItem("notificationStatus",e),setAmplitudeUserProperties("notificationStatus",e))}function distanceBetweenCoordinates(e,t,o,a){var n=(o-e)*(Math.PI/180),a=(a-t)*(Math.PI/180),t=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e*(Math.PI/180))*Math.cos(o*(Math.PI/180))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t)))}function joinStrings(){return Array.prototype.slice.call(arguments).join("")}function getFeedURL(){var e,t,o,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",s=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",l=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"",c=6<arguments.length&&void 0!==arguments[6]?arguments[6]:"",d=7<arguments.length&&void 0!==arguments[7]?arguments[7]:"";return e=8<arguments.length&&void 0!==arguments[8]?arguments[8]:["c2c","prime"],t=parseFloat(getCookie("latitude")),o=parseFloat(getCookie("longitude")),e=serializeArray("categories",e),r=r&&serializeArray("breed",r.split(",")),l=l&&serializeArray("milk",l.split(",")),s=s&&serializeArray("lactation",s.split(",")),joinStrings("/zap/feed/","?lat=",t,"&long=",o,"&count=",a,"&offset=",n,l,i=i&&"&animalType="+i,c=c&&"&gender="+c,e,r,s,d=d&&"&sortBy="+d)}function getFeedURLV2(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"",n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",i=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"",r=6<arguments.length&&void 0!==arguments[6]?arguments[6]:"",s=7<arguments.length&&void 0!==arguments[7]?arguments[7]:"",l=8<arguments.length&&void 0!==arguments[8]?arguments[8]:"",c=9<arguments.length&&void 0!==arguments[9]?arguments[9]:"",d=10<arguments.length&&void 0!==arguments[10]?arguments[10]:"",g=11<arguments.length&&void 0!==arguments[11]?arguments[11]:void 0,p=12<arguments.length&&void 0!==arguments[12]?arguments[12]:["c2c","prime"],u=parseFloat(getCookie("latitude")),m=parseFloat(getCookie("longitude")),p=serializeArray("categories",p),a=a&&serializeArray("breed",a.split(",")),i=i&&serializeArray("milk",i.split(",")),n=n&&serializeArray("lactation",n.split(",")),s=s&&serializeArray("milkCapacity",s.split(",")),l=l&&serializeArray("price",l.split(","));return g&&(g="&isCalf="+g,n=""),o=o&&"&animalType="+o,r=r&&"&gender="+r,c=c&&"&sortBy="+c,d.toString()&&(d="&partialMatch="+d),joinStrings("/zap/feed/","?lat=",u,"&long=",m,"&count=",e,"&offset=",t,i,s,l,o,r,p,a,n,g,c,d,"&isDelayed=false")}function getPrimeFilterFeedURL(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";return joinStrings("/api/exp/assessment/seller/feed/filter/active","?lat=",parseFloat(getCookie("latitude")),"&long=",parseFloat(getCookie("longitude")),"&limit=",e,"&offset=",t,o=o&&"&sortBy="+o)}function getQueryString(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return e?2<arguments.length&&void 0!==arguments[2]&&arguments[2]?"?"+e+"="+encodeURIComponent(t):"&"+e+"="+encodeURIComponent(t):""}function serializeArray(o,e){return e.reduce(function(e,t){return e+=joinStrings("&",o,"[]=",t)},"")}function isInBuckets(e){var e=_slicedToArray(e,2),t=e[0],e=e[1],o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:getCookie("bucketId");return t<=o&&o<=e}function getHeightDisplayValue(e){var t=Math.floor(e/12);return t+" फुट "+(e-12*t)+" इंची"}function isAmartRegionUser(e){var t,o,a=JSON.parse(localStorage.getItem("amartAddress"))||void 0,n=JSON.parse(sessionStorage.getItem("amartDistrictMappings")),i=JSON.parse(sessionStorage.getItem("amartPincodeMappings")),e="BANNER"!==e&&a&&(a.pincode||a.district)?(t=a.district,a.pincode):(t=(getCookie("district")||"").toUpperCase(),(getCookie("pincode")||"").toString()),a="amartZone";return(o=(o=e?AMART_PINCODE_MAPPINGS?AMART_PINCODE_MAPPINGS[e]:i?(AMART_PINCODE_MAPPINGS=i)[e]:null:o)||e?o:AMART_DISTRICT_MAPPINGS?AMART_DISTRICT_MAPPINGS[t]:n?(AMART_DISTRICT_MAPPINGS=n)[t]:null)?(sessionStorage.setItem(a,o),$(".menu-mart").length&&showHideAmartNewTag(),!0):(sessionStorage.getItem(a)&&sessionStorage.removeItem(a),!1)}function isListingMonetizationEligible(){return"true"===sessionStorage.getItem("listingMonetizationEligible")}function registerAmartUserVisit(){var e=getUrlVars(),t=window.location.pathname,e=e.source||"",o="registerAmartVisit:"+t,a=sessionStorage.getItem(o),n=sessionStorage.getItem("amartZone"),i=getCookie("pincode"),r=getCookie("accessToken");!a&&n&&i&&t&&r&&$.ajax({url:"/api/exp/mart/user-visit",method:"PATCH",contentType:"application/json",dataType:"json",data:JSON.stringify({zone:n,pincode:i,path:t,source:e}),headers:{accessToken:r}}).done(function(e){sessionStorage.setItem(o,!0)}).fail(function(e){console.log(e)})}function isPrimePashuEligible(){return getCookie("accessToken")}function isInNonControlBuckets(){return isInBuckets([0,79],getCookie("bucketId"))}function regenerateAccessToken(e,t,o){$.ajax({url:"/places-token",type:"GET",data:{vertical:o},success:e,error:t})}function getLocationString(t){var o="";return["street","adminLevel10","adminLevel8","adminLevel6","adminLevel5","adminLevel4","pincode"].forEach(function(e){t[e]&&(o=o?o+", "+t[e]:o+t[e])}),o}function hideLoader(){$(".loader-overlay").hide()}function toggleSwipeToRefresh(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];if(!compareVersions(getCookie("appVersion"),">=","3.0.7"))return null;AndroidBridge.setEnableSwipeToRefresh(e)}function getRandomNumberByHour(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:23,n=(new Date).getHours();return n<o?e:a<=n?t:(n=e+Math.pow((n-o)/(a-o),2)*(t-e),Math.round(n))}function seededRandom(t){return function(){var e=1e4*Math.sin(t++);return e-Math.floor(e)}}function shuffleArray(e,t){for(var o,a,n=e.length,i=seededRandom(t);0!==n;)a=Math.floor(i()*n),o=e[--n],e[n]=e[a],e[a]=o;return e}function getDailyShuffledArray(e){var t=new Date,t=1e4*t.getFullYear()+100*(t.getMonth()+1)+t.getDate();return shuffleArray(e.slice(),t)}function trackVisitedPage(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=new Set(JSON.parse(sessionStorage.getItem("visitedPages"))||[]);t.add(e),sessionStorage.setItem("visitedPages",JSON.stringify(Array.from(t)))}function allFieldsPresentInPost(e){if(e&&e.resources&&e.resources.length){var t="CHATBOT"===e.sourcePage?["lactation","currentMilk","price"]:"MALE"===e.gender?["price","animalType"]:["animalType","lactation","currentMilk","price","highestMilk"];if(1e3<=parseInt(e.price)&&parseInt(e.price)<=5e5){var o=!0;if(!e.sourcePage&&"FEMALE"===e.gender&&"0"===e.currentMilk&&!e.highestMilk)return o=!1;for(var a=0;a<t.length;a+=1)if([null,void 0,""].includes(e[t[a]])){o=!1;break}return o}}return!1}function showSlidingToast(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-60,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:90,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:3e3,n=$(e);n.removeClass("hidden"),n.css({opacity:1,bottom:o+"px"}),setTimeout(function(){n.css({opacity:0,bottom:t+"px"}),setTimeout(function(){n.addClass("hidden")},300)},a)}function isEligibleForWallet(){return!!getCookie("accessToken")}function setDailyStreakInitialTimer(){var t,e,o,a,n;!getCookie("viewedStreakPopup")&&isEligibleForWallet()&&(e=getCookie("appVersion"),t=!!!(!e||!compareVersions(e,">=","3.1.0")),e=Date.now(),o=t?1e4:6e4,(a=sessionStorage.getItem("dailyStreakStartTime"))&&o<(a=e-Number(a))&&(o=0),sessionStorage.setItem("dailyStreakStartTime",e),n=setTimeout(function(){var e=new Event(t?"adMobStreakTimerEnd":"dailyStreakTimerEnd");document.dispatchEvent(e),clearTimeout(n)},o-a))}function getStreakData(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;!getCookie("viewedStreakPopup")&&getCookie("accessToken")&&$.ajax({url:"/api/exp/streak",method:"PATCH",body:{streakType:"DEFAULT"}}).done(function(e){var t,o;e&&e.data&&e.data.streak&&((o=1===(t=e.data.streak%10)&&e.data.lastActiveDaysAgo&&e.data.lastActiveStreakCount&&e.data.lastActiveDaysAgo<10&&e.data.isUpdated)&&(t=e.data.lastActiveStreakCount%10),sessionStorage.setItem("streakResponse",JSON.stringify(e.data)),e.data.isUpdated&&t%10==0&&logAmplitudeEvent("STREAK_COMPLETED_GLOBAL",{STREAK_COUNT:e.data.streak,OFFER:e.data.offer&&e.data.offer.type?e.data.offer.type:"NA"}),e.data.offer&&"combo_offer"===e.data.offer.type&&setCookie("combo_streak_offer",new Date,1),a?a(t,o):"function"==typeof showStreakPopup&&showStreakPopup(t,o,e.data.isUpdated,e.data.streak,e.data.offer))}).fail(function(e){console.error(e)}).always(function(){sessionStorage.removeItem("dailyStreakStartTime")})}function getUserProfileData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["userState","userDistrict","userLat","userLng","userJoinedOn"],o=JSON.parse(sessionStorage.getItem("userData")||"{}"),a={},n={userState:"locationState",userDistrict:"district",userLat:"locationLat",userLng:"locationLng",userJoinedOn:"createdAt"};return e.forEach(function(e){var t=o[n[e]]||"";"string"==typeof t&&(t=t.trim().toUpperCase()),a[e]=t}),a}getCookie("isAndroid")&&getCookie("appVersion")&&compareVersions(getCookie("appVersion"),">=","1.7.5")&&!sessionStorage.getItem("notificationStatus")&&Android.isNotificationEnabled(),window.location.href.includes("firstDownloadApp")&&window.open("https://play.google.com/store/apps/details?id=in.animall.android","_self"),sessionStorage.getItem("listingMonetizationEligible")||(stats={},"undefined"!=typeof monetizationStats?stats=monetizationStats:getCookie("accessToken")&&$.ajax({url:"/api/monetization/subscription/stats",method:"GET",async:!1,timeout:3500,headers:{accessToken:getCookie("accessToken")},success:function(e){e&&e.stats&&(stats=e.stats)},error:function(){console.log("[listing-monetization] Failed to fetch monetization stats"),stats={}}}),listingStats=stats.listing||{},eligible=listingStats.isEligible||!1,listingBlockStrategy=listingStats.strategy||null,sessionStorage.setItem("listingMonetizationEligible",eligible),sessionStorage.setItem("listingBlockStrategy",listingBlockStrategy),console.info("[listing-monetization] Eligible:",eligible),console.info("[listing-monetization] Block Strategy:",listingBlockStrategy)),document.addEventListener("DOMContentLoaded",function(){if(""===window.location.pathname.split("/").pop())return toggleSwipeToRefresh(!1);toggleSwipeToRefresh(!0)}),window.addEventListener("hashchange",function(e){var t=e.newURL.split("#")[1],e=e.newURL.includes("/pashu-scanner");toggleSwipeToRefresh(!t&&!e)}),setDailyStreakInitialTimer(),document.addEventListener("dailyStreakTimerEnd",function(){getStreakData()});