PageSourceSearch

https://olivetreepeople.com/cdn/shop/t/53/assets/app.controller.js?v=107856014471543937821789435735

js olivetreepeople.com collected 2026-09-24 19:18:53 UTC 31,141 bytes, 4 lines download raw bytes

1var app=angular.module("DSShopify",["ui.bootstrap"]);app.config(["$interpolateProvider",function($interpolateProvider){$interpolateProvider.startSymbol("{[{").endSymbol("}]}")}]),app.directive("focusout",["$parse",function($parse){return{compile:function($element,attr){var fn=$parse(attr.focusout);return function(scope,element){element.on("focusout",function(event){scope.$apply(function(){fn(scope,{$event:event})})})}}}}]),app.factory("sideBarService",["$parse",function($parse){var service={};return service.Items=[],service.setItems=function(items){console.log("items",items),service.Items=items},service}]),app.factory("calculateService",[function(){var service={calculateOrderResponse:{},calculateAutoOrderResponse:{},createCheckoutResponse:{}};return service}]),app.directive("enterPressed",function(){return function(scope,element,attrs){element.bind("keydown keypress",function(event){event.which===13&&(scope.$apply(function(){scope.$eval(attrs.enterPressed)}),event.preventDefault())})}}),app.directive("validate",function(){return{restrict:"A",link:function(scope,element,attrs,rootScope){element=$(element[0]);var windowBlur=!1;$(window).on("blur",function(){windowBlur=!0}),$(window).on("focus",function(){windowBlur=!1});var regexValidate=function(value,showError2,regxExp,hostElement){var charfilter=new RegExp("(.{10,})"),casefilter=new RegExp("(?=.*[A-Z])(?=.*[a-z])"),numberfilter=new RegExp("(?=.*\\d)"),symbolfilter=new RegExp("(?=.*\\W)");charfilter.test(value)?scope.$root.stantdardPassReq.character=!0:(scope.$root.stantdardPassReq.character=!1,showError2&&showInvalidPassword(0,hostElement)),casefilter.test(value)?scope.$root.stantdardPassReq.case=!0:(scope.$root.stantdardPassReq.case=!1,showError2&&showInvalidPassword(0,hostElement)),numberfilter.test(value)?scope.$root.stantdardPassReq.number=!0:(scope.$root.stantdardPassReq.number=!1,showError2&&showInvalidPassword(0,hostElement)),symbolfilter.test(value)?(scope.$root.stantdardPassReq.symbol=!0,showSuccess(hostElement)):(scope.$root.stantdardPassReq.symbol=!1,showError2&&showInvalidPassword(0,hostElement)),scope.$apply()};element.on("focus",function(){element.closest(".control-group").removeClass("has-error"),element.closest(".control-group").find(".has-error").remove(),element.parent(".ds-validate").removeClass("ds-validate--has-error"),element.parent(".ds-validate").find(".has-error").remove(),element.find("state-error").remove(),element.removeClass("state-error"),element.removeClass("state-success"),element.find("state-success").remove()}),element.on("focusout",function(){element.parent(".ds-validate").removeClass("ds-validate--has-error"),element.parent(".ds-validate").find(".has-error").remove()});var cancelBox=element.closest(".controls").find(".cancel-validation");cancelBox.click(function(){element.toggleClass("novalidate"),$(this).is(":checked")?(element.closest(".control-group").removeClass("has-error"),element.closest(".control-group").find(".has-error").remove(),element.closest(".control-group").hide(),scope.$apply(attrs.updateId)):element.closest(".control-group").show()}),element.on("blur",function(){checkForm(element,0)}),element.keypress("keydown keypress",function(e){if(element.attr("inputspace")){var altkeypress;if(e.altKey)altkeypress=!0;else if(altkeypress)return altkeypress=!1,!1;if(e.which===32||e.which===33||e.which===34||e.which===35||e.which===36||e.which===37||e.which===38||e.which===39||e.which===40||e.which===41||e.which===42||e.which===43||e.which===44||e.which===46||e.which===47||e.which===45||e.which===58||e.which===59||e.which===60||e.which===61||e.which===62||e.which===63||e.which===64||e.which===91||e.which===93||e.which===92||e.which===94||e.which===95||e.which===96||e.which===123||e.which===124||e.which===125||e.which===126)return!1}if(element.attr("inputonlynumber")&&(e.which>=32&&e.which<=47||e.which===58||e.which===59||e.which===60||e.which===61||e.which===62||e.which===63||e.which===64||e.which<=122&&e.which>=65||e.which===123||e.which===124||e.which===125||e.which===126)||element.attr("inputmobilespacendash")&&(e.which===33||e.which===34||e.which===35||e.which===36||e.which===37||e.which===38||e.which===39||e.which===40||e.which===41||e.which===42||e.which===43||e.which===44||e.
1which===46||e.which===47||e.which===58||e.which===59||e.which===60||e.which===61||e.which===62||e.which===63||e.which===64||e.which===91||e.which===93||e.which===92||e.which===94||e.which===95||e.which===96||e.which===123||e.which===124||e.which===125||e.which===126))return!1;if(element.attr("validate-maxlength")){var attr=element.attr("validate-maxlength");if(element.val().length+1>attr){var customErrorMessgae=element.attr("error-message");element.closest(".control-group").find(".has-error").remove(),showError(customErrorMessgae||"Max Character Allowed",element,attr)}else showSuccess(element)}if(element.attr("inputspacehypens")&&(e.which===32||e.which===45)||element.attr("nospaceallow")&&e.which===32)return!1}),element.keydown("keydown",function(e){(e.which==8||e.which==46)&&element.attr("validate-maxlength")&&element.parent(".ds-validate").find(".has-error").remove(),element.attr("regxvalid")&&element.val()&&regexValidate(element.val(),!1,element.attr("regxvalidValue"),element)});var checkForm=function(element2,type){var attr,value=element2.val();if(element2.attr("noempty")&&($.trim(value)===""?type===0&&(element2.closest(".control-group").find(".has-error").remove(),showError("This field is Required",element2)):showSuccess(element2)),element2.attr("ValidName")&&(value.match(/[*^|":<>[\]{}\\()';?/~!,]/)?type===0&&showError("Special Character Not Allowed",element2):showSuccess(element2)),element2.attr("phoneno")&&(value.match(/^\d*$/)||type===0&&showError("Only Number Allow",element2)),element2.attr("minlength")&&(attr=element2.attr("minlength"),value&&(value.length<attr?type===0&&(element2.closest(".ds-validate").addClass("ds-field--is-dirty"),showError("Minimum Charcater Required",element2,attr)):showSuccess(element2))),element2.attr("validate-maxlength"))if(attr=element2.attr("validate-maxlength"),value.length>attr){if(type===0){var customErrorMessgae=element2.attr("error-message");showError(customErrorMessgae||"error_maxlength_chars",element2,attr)}}else showSuccess(element2);element2.attr("email")&&value&&validateEmail(value);function validateEmail(value2){var filter=new RegExp("^([\\w-\\.+]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,10}|[0-9]{1,3})(\\]?)$");filter.test(value2)?showSuccess(element2):type===0&&showError("Not Valid Email",element2)}element2.attr("alphanumericdash")&&value&&validateAlphaNumericDash(value);function validateAlphaNumericDash(value2){var filter=new RegExp("^[a-zA-Z0-9]+$");filter.test(value2)?showSuccess(element2):type===0&&showError("Only Alpha Numeric Value Allow",element2)}if(element2.attr("password-match")){var currentPw=$("#txtPassword").val();element2.val()&&(currentPw==element2.val()?showSuccess(element2):type===0&&(element2.closest(".control-group").find(".has-error").remove(),showError("Password Not Match",element2,attr)))}if(element2.attr("email-match")){var currentEID=$("#txtEmailAdd").val();element2.val()&&(currentEID==element2.val()?showSuccess(element2):type===0&&(element2.closest(".control-group").find(".has-error").remove(),showError("Email Not Matched!",element2,attr)))}element2.attr("nospaces")&&(value.match(/\s/g)?type===0&&(element2.closest(".control-group").find(".has-error").remove(),showError("Space Not Allow",element2)):showSuccess(element2)),element2.attr("validate-select")&&(value=element2.find("option:selected").text(),value.match(/Select a/)||value===""?type===0&&showError("Please Make a Selection",element2):showSuccess(element2)),element2.attr("validate-custom-select")&&(value=$("#freq_dd").val(),value===""?type===0&&showError("Please Make a Selection",element2):showSuccess(element2)),element2.attr("checkbox-validate")&&(element2.is(":checked")?showSuccess(element2):type===0&&showError("Checkbox Required",element2.parent())),element2.attr("checkbox-validate-autoship")&&(!element2.is(":checked")&&element2.hasClass("ischeck")?type===0&&showError("Autoship Required",element2.parent()):showSuccess(element2)),element2.attr("regxvalid")&&value&&regexValidate(value,!0,element2.attr("regxvalidValue"),element2),element2.attr("regxvalidzip")&&value&&regexValidateZip(value,element2.attr("regexcountry").toUpperCase());function regexValidateZip(value2,countrycode){var regxExp="",filter=new RegExp(regxExp);filter.test(value2)?showSuccess(element2):type===0&&showError("INVALID ZIP",element2)}if(element2.attr("greater-than-zero")&&value){var number=value.replace(/[^0-9]/g,"");number>0?showSuccess(element2):type===0&&showError("greater_then_zero",element2,attr)}},showError=function(msg,element2,value){if(!element2.hasClass("novalidate")&&!windowBlur&&!element2.closest(".control-group").find("span").hasClass("has-error")){element2.removeClass("state-success"),element2.addClass("state-error");var container=$("<small />");element2.attr("custommsg")&&(msg=element2.attr("custommsg")),msg=msg+" "+(value||""),console.log("msg",msg),container.text(msg).addClass("has-error help-block ").attr("translate",""),element2.parent(".ds-validate").addClass("ds-validate--has-error"),element2.parent(".custom-validate").addClass("custom-validate--has-error"),(element2.hasClass("ds-checkbox")||element2.hasClass("ds-radio"))&&element2.after(container),element2.parent().hasClass("ds-validate--has-error")&&element2.after(container),element2.parent().hasClass("custom-validate--has-error")&&element2.parent().after(container),element2.closest(".control-group").addClass("has-error")}},showSuccess=function(element2){!element2.hasClass("novalidate")&&!windowBlur&&(element2.closest(".control-group").find("span").hasClass("has-error")||(element2.removeClass("state-error"),element2.addClass("state-success")))},showInvalidPassword=function(type,element2){type===0&&(element2.closest(".control-group").find(".has-error").remove(),showError(`
2					Password doesn't meet minimum requirement!
3					`,element2))};attrs.triggerCheck&&element.click(function(ev){ev.preventDefault(),$(".control-group.has-error").removeClass("has-error"),$(".control-group").find(".has-error").remove(),scope.$apply(attrs.pvCheck);var sectiontype=attrs.sectiontype,inputs=$("["+sectiontype+"]").not("input[trigger-checksection]");inputs.each(function(i,e){var element2=$(e);checkForm(element2,0)});var errors=$(".control-group.has-error");
3if(errors.length===0)scope.$apply(attrs.success);else{var target=$(".control-group.has-error")[0];$("html, body").animate({scrollTop:$(target).offset().top-100},1e3)}}),attrs.triggerWithoutScroll&&element.click(function(ev){ev.preventDefault(),$(".control-group.has-error").removeClass("has-error"),$(".control-group").find(".has-error").remove(),scope.$apply(attrs.pvCheck);var sectiontype=attrs.sectiontype,inputs=$("["+sectiontype+"]").not("input[trigger-checksection]");inputs.each(function(i,e){var element2=$(e);checkForm(element2,0)});var errors=$(".control-group.has-error");errors.length===0&&scope.$apply(attrs.success)}),attrs.triggerChecksection&&element.click(function(ev){ev.preventDefault(),$(".control-group.has-error").not(".ccvalidation, .sumlength").removeClass("has-error"),$(".control-group").not(".ccvalidation, .sumlength").find(".has-error").remove(),scope.$apply(attrs.pvCheck);var sectiontype=attrs.sectiontype,inputs=$("["+sectiontype+"]").not("input[trigger-checksection]").not(".novalidate");if(inputs.each(function(i,e){var element2=$(e);checkForm(element2,0)}),$("#password1").length>0){var pw1=$("#password1"),pw2=$("#password2"),ctrlGrps=pw1.closest(".controls-row").find(".control-group");pw1.val()!==pw2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}if($("#emailAdd1").length>0){var ew1=$("#emailAdd1"),ew2=$("#emailAdd2"),ctrlGrps=ew1.closest(".controls-row").find(".control-group");ew1.val()!==ew2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}var errors=$(".control-group.has-error");if(errors.length===0)scope.$apply(attrs.success);else{var target=$(".control-group.has-error")[0],link=$(target),offset=link.offset(),top=offset.top,bottom=$(window).height()-top-link.height();$("html, body").animate({scrollTop:bottom>1?bottom:$(target).offset().top},1e3)}}),attrs.triggerTabSection&&(element.click(function(ev){setTimeout(function(){ev.preventDefault();var sections=$("div[trigger-tab-section='true']").not("[currenttab='true']");if(sections.each(function(n,item){var element1=$(item),inputs=element1.find(":input");inputs.each(function(i,e){var element2=$(e);element2.closest(".control-group").removeClass("has-error"),element2.closest(".control-group").find(".has-error").remove(),checkForm(element2,0)})}),$("#password1").length>0){var pw1=$("#password1"),pw2=$("#password2"),ctrlGrps=pw1.closest(".controls-row").find(".control-group");pw1.val()!==pw2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}if($("#emailAdd1").length>0){var ew1=$("#emailAdd1"),ew2=$("#emailAdd2"),ctrlGrps=ew1.closest(".controls-row").find(".control-group");ew1.val()!==ew2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}},1e3)}),element.on("focusin",function(ev){setTimeout(function(){ev.preventDefault();var sections=$("div[trigger-tab-section='true']").not("[currenttab='true']");if(sections.each(function(n,item){var element1=$(item),inputs=element1.find(":input");inputs.each(function(i,e){var element2=$(e);element2.closest(".control-group").removeClass("has-error"),element2.closest(".control-group").find(".has-error").remove(),checkForm(element2,0)})}),$("#password1").length>0){var pw1=$("#password1"),pw2=$("#password2"),ctrlGrps=pw1.closest(".controls-row").find(".control-group");pw1.val()!==pw2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}if($("#emailAdd1").length>0){var ew1=$("#emailAdd1"),ew2=$("#emailAdd2"),ctrlGrps=ew1.closest(".controls-row").find(".control-group");ew1.val()!==ew2.val()&&(ctrlGrps.addClass("has-error"),$(".password-match").text("No Match").addClass("has-error"))}},1e3)}))}}}).filter("unique",[function(){return function(collection,keyname){var output=[],keys=[];return angular.forEach(collection,function(item){var key=item[keyname];keys.indexOf(key)===-1&&(keys.push(key),output.push(item))}),output}}]),app.controller("AppCtrl",["$window","$scope","$rootScope","$uibModal","$compile","$templateCache","$location","sideBarService","calculateService",function($window,$scope,$rootScope,$uibModal,$compile,$templateCache,$location,sideBarService,calculateService){if($rootScope.ClientSettings={},$.getJSON("/search?q=&view=clientsettings").then(function(response){$rootScope.ClientSettings=response,$rootScope.$apply()}),$rootScope.EnrollmentPack=$rootScope.EnrollmentPack||JSON.parse(localStorage.getItem("cart.packs"))||[],$rootScope.AutoshipItems=$rootScope.AutoshipItems||JSON.parse(localStorage.getItem("cart.autoship"))||[],$rootScope.BundlePack=$rootScope.BundlePack||JSON.parse(localStorage.getItem("cart.bundle"))||[],$rootScope.OrderItems=$rootScope.OrderItems||JSON.parse(localStorage.getItem("cart.orderItems"))||[],$rootScope.SponsorDetails=$rootScope.SponsorDetails||JSON.parse(localStorage.getItem("sponserDetails")),$rootScope.showLoader=function(){$("#vjenroll-loading").css("display","block")},$rootScope.hideLoader=function(){$("#vjenroll-loading").css("display","none")},$rootScope.stantdardPassReq={character:!1,case:!1,number:!1,symbol:!1},$rootScope.isContainOrderItem=!1,$rootScope.UserData=$rootScope.UserData||{},$scope.selectedFrequency={},$scope.frequnecyStartDate="",$rootScope.$watch(function(){return $window.localStorage.getItem("cart.packs")},function(newCodes,oldCodes){$rootScope.EnrollmentPack=JSON.parse(newCodes)||[]}),$rootScope.$watch(function(){return $window.localStorage.getItem("cart.bundle")},function(newCodes,oldCodes){$rootScope.BundlePack=JSON.parse(newCodes)||[]}),$rootScope.$watch(function(){return $window.localStorage.getItem("cart.orderItems")},function(newCodes,oldCodes){$rootScope.OrderItems=JSON.parse(newCodes)||[]}
3),$scope.getCustomerTypeDescription=function(typeID){if(console.log("getCustomerTypeDescription",typeID),typeID==0&&(typeID=2),$rootScope.ClientSettings&&$rootScope.ClientSettings.CustomerTypes){var Des=$rootScope.ClientSettings.CustomerTypes.filter(function(customerTypes){return customerTypes.ID==typeID})[0].Description;return console.log("getCustomerTypeDescription",Des),Des}},$rootScope.$watch(function(){return $window.localStorage.getItem("cart.autoship")},function(newCodes,oldCodes){console.log("autoshipitem")}),$rootScope.$watch(function(){return $window.localStorage.getItem("enrollerinfo")},function(newCodes,oldCodes){$rootScope.EnrollerInfo=JSON.parse(newCodes)||[],console.log("EnrollerInfo")}),$scope.changeFrequency=function(frequency){$scope.selectedFrequency=frequency},$("#frequencyStartDate").bind("input",function(){$scope.frequnecyStartDate=$(this).val()}),(()=>{try{const webAlias=localStorage.getItem("enrollerinfo")?JSON.parse(localStorage.getItem("enrollerinfo")).WebAlias:localStorage.getItem("ALS")||"";var url=new URL($window.location.href);if(url.searchParams.get("referral"))return;webAlias&&(url.searchParams.set("referral",webAlias),$window.history.pushState(null,"",url),$window.location.href=url.href)}catch(error){console.error(error)}})(),$scope.updateCustomerType=function(customerType){customerType!=sessionStorage.getItem("customerType")&&swal({html:!0,title:"",text:'<div class="cnf_cus_type"><h3 class="mb-3">Update Customer Type </h3> <p>Updating Existing Customer Type Will Impact Existing Customer Cart Item</p></div>',showCancelButton:!0,confirmButtonText:"YES",closeOnConfirm:!0,confirmButtonClass:"btn btn-theme",cancelButtonClass:"",cancelButtonText:"NO"},function(confirm){if(confirm){localStorage.setItem("cart.packs","[]"),localStorage.setItem("cart.order","[]"),localStorage.setItem("cart.autoship","[]"),document.cookie="cart=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;",sessionStorage.setItem("customerType",customerType);const params=new URLSearchParams(location.search);params.set("type",customerType),window.history.replaceState({},"",`/collections/all?${params}`),window.location.reload()}})},localStorage.getItem("customerData"))$rootScope.UserData=JSON.parse(localStorage.getItem("customerData"));else{var enrollment={mailingAddress:{FirstName:"test",LastName:"test",StreetAddress:"770 E M",Apartment:"Test",City:"Lehi",State:"UT",ZipCode:"84043",Contact:"9667191786"}};$rootScope.UserData={MainAddress1:enrollment.mailingAddress.StreetAddress,MainAddress2:enrollment.mailingAddress.Apartment,MainAddress3:"",MainCity:enrollment.mailingAddress.City,MainCountry:"enrollment.mailingAddress.Country",MainZip:enrollment.mailingAddress.ZipCode,MainState:enrollment.mailingAddress.State,LanguageCode:"en"}}$scope.CalculateOrder=function(){var Details=[];console.log("callcalculateorder AppCtrl"),jQuery.getJSON("/cart.js",function(cart){jQuery.get("/cart?view=data",function(cart2){}),cart.items.forEach(function(element){var itemQuantityArray=[];if(element.properties.discoitemid&&parseInt(element.quantity,10)>0){var iskitItem=$rootScope.EnrollmentPack.some(function(packelement){return packelement.id===element.id?(itemQuantityArray.push({ordertype:"pack",quantity:packelement.quantity}),element.quantity>packelement.quantity&&itemQuantityArray.push({ordertype:"order",quantity:element.quantity-packelement.quantity}),!0):!1});iskitItem||(console.log("sdasdasdas",itemQuantityArray),itemQuantityArray.push({ordertype:"order",quantity:element.quantity})),itemQuantityArray.forEach(function(item){Details.push({CurrencyCode:"USD",ItemCode:element.properties.discoitemid,Sku:element.properties.discoitemid,IskitItem:item.ordertype=="pack",Quantity:parseInt(item.quantity,10),VariantID:element.variant_id})})}});var calculateOrderRequest={Address1:$rootScope.UserData.MainAddress1,Address2:$rootScope.UserData.MainAddress2,Address3:$rootScope.UserData.MainAddress3,City:$rootScope.UserData.MainCity,Country:$rootScope.UserData.MainCountry,CouponCodes:[],CurrencyCode:"USD",ShipMethodID:0,StoreID:3,PriceTypeID:$rootScope.UserData.CustomerTypeID||sessionStorage.getItem("customerType")||2,CustomerId:0,CustomerType:$rootScope.UserData.CustomerTypeID||sessionStorage.getItem("customerType")||2,Details,OrderType:1,State:$rootScope.UserData.MainState,Zip:$rootScope.UserData.MainZip,Language:$rootScope.UserData.LanguageCode||"en"};console.log("callcalculateorder AppCtrl"),window.DI.Enrollment.calculateorder(calculateOrderRequest).then(function(response,error){response&&response.Status==1&&response.Data?(console.log("callcalculateorder AppCtrl",response.Data),calculateService.calculateOrderResponse=response.Data,$scope.$apply()):window.DI.DI.notification("Error","S
3omething Wrong With Your Cart Item Please Remove Them one By One","error")})})},$scope.CalculateAutoOrder=function(){var Details=[];console.log("CalculateAutoOrder AppCtrl");var autoshipItems=JSON.parse(localStorage.getItem("cart.autoship"))||[];if(autoshipItems&&autoshipItems.length>0){var Details=[];autoshipItems.forEach(element=>{element.properties.discoitemid&&parseInt(element.quantity,10)>0&&Details.push({CurrencyCode:"USD",ItemCode:element.properties.discoitemid,IskitItem:!1,Quantity:parseInt(element.quantity,10)})});var calculateAutoOrderRequest={Address1:$rootScope.UserData.MainAddress1,Address2:$rootScope.UserData.MainAddress2,Address3:$rootScope.UserData.MainAddress3,City:$rootScope.UserData.MainCity,Country:$rootScope.UserData.MainCountry,CouponCodes:[],CurrencyCode:"USD",ShipMethodID:0,StoreID:3,PriceTypeID:$rootScope.UserData.CustomerTypeID||sessionStorage.getItem("customerType")||2,CustomerId:0,CustomerType:$rootScope.UserData.CustomerTypeID||sessionStorage.getItem("customerType")||2,Details,OrderType:2,State:$rootScope.UserData.MainState,Zip:$rootScope.UserData.MainZip,Language:$rootScope.UserData.LanguageCode||"en"};console.log("calculateAutoOrderRequest AppCtrl"),window.DI.Enrollment.calculateautoorder(calculateAutoOrderRequest).then(function(response,error){console.log("calculateAutoOrderRequest AppCtrl",response),console.log("calculateAutoOrderRequest AppCtrl",error),calculateService.calculateAutoOrderResponse=response.Data,$scope.getautoshipcartitem(),$scope.$apply()})}else calculateService.calculateAutoOrderResponse={},$scope.getautoshipcartitem()},$scope.getcartitem=function(){jQuery.getJSON("/cart.js",function(cart){$scope.cartItems=[],cart.items.forEach(function(element){var iskitItem=!1;$rootScope.EnrollmentPack=$rootScope.EnrollmentPack||JSON.parse(localStorage.getItem("cart.packs")||"[]")||[],iskitItem=$rootScope.EnrollmentPack.some(function(pack){return pack.id===element.id}),iskitItem==!0?$rootScope.EnrollmentPack.forEach(function(packelement){packelement.id===element.id&&(element.showinorder=element.quantity-packelement.quantity>0,console.log("cartitem.packquantitycartitem.packquantitycartitem.packquantity"),element.quantity=element.quantity-packelement.quantity,element.packquantity=packelement.quantity,element.ispackitem=!0)}):(element.showinorder=!0,element.quantity=element.quantity,element.packquantity=0,element.ispackitem=!1),$scope.cartItems.push(element)}),console.log("isContainOrderItem"),!localStorage.getItem("cart.packs")&&!localStorage.getItem("cart.order")&&localStorage.setItem("cart.order",JSON.stringify($scope.cartItems)),$rootScope.isContainOrderItem=JSON.parse(localStorage.getItem("cart.order")||"[]").length>0,sideBarService.setItems($scope.cartItems),$scope.$apply()})},$scope.getautoshipcartitem=function(){setTimeout(function(){$rootScope.AutoshipItems=JSON.parse(localStorage.getItem("cart.autoship"))||[],$scope.$apply()},200)},$scope.setConsultantCheckoutEnrollment=function(selectedSponsor){sessionStorage.setItem("sponsorSearch",selectedSponsor.WebAliases[0]),$scope.SelectedSponsor=selectedSponsor,$scope.SetSponsor()},$scope.setConsultantCheckout=function(selectedSponsor){console.log("test 1",selectedSponsor),$scope.SelectedSponsor=selectedSponsor,console.log("test 2",$scope.SelectedSponsor),$scope.SetSponsor()},$scope.SetSponsor=function(){$scope.SelectedSponsor&&$scope.SelectedSponsor.BackOfficeId?($rootScope.showLoader(),window.DI.Users.getcustomersitebyid($scope.SelectedSponsor.BackOfficeId).then(function(result){if(result.Data&&(result.Data.Webalias??result.Data.Username)){const url=new URL(location.href);url.searchParams.set("referral",result.Data.Webalias??result.Data.Username),history.pushState(null,"",url),window.location.href.includes("/login")&&console.log("Page has login in the url"),window.location.href.includes("/account/login")?window.DI.DI.notification("Success","Sponsor Updated","success"):window.location.reload()}else window.DI.DI.notification("Error","Webalias Not Exist","error");$rootScope.hideLoader()}).catch(error=>{window.DI.DI.notification("Error","Something went wrong!","error"),$rootScope.hideLoader()})):window.DI.DI.notification("Error","Select Any Sponsor","error")},$scope.navigateToChangeAffiliate=function(){$rootScope.showLoader(),$.get("/search?q=&view=find-enroller").then(function(response){var template=$templateCache.put("findenroller.html",response);$uibModal.open({animation:!0,templateUrl:"findenroller.html",backdrop:"static",keyboard:!0,closeOnEscape:!1,windowClass:"uibmodalclass",controller:["$rootScope","$scope","$uibModalInstance",function($rootScope2,$scope2,$uibModalInstance){$scope2.title="",$scope2.message="",$scope2.type="",$scope2.data="",$scope2.updateClosedPopupValue=function(){var closedPopupValue=sessionStorage.getItem("closedPopup");closedPopupValue==null||closedPopupValue===""?sessionStorage.setItem("closedPopup","1"):sessionStorage.setItem("closedPopup","2")},$scope2.close=function(isclose,arg){$uibModalInstance.dismiss("cancel")},$scope2.SearchSponsors=function(){$rootScope2.showLoader(),window.DI.Users.findenroller($scope2.name).then(function(result){try{if(parseInt(result.Status,10)===1){var SearchList=result.Data;SearchList=_.reject(SearchList,function(enroll){return enroll.AssociateType==2||enroll.AssociateType==3||enroll.StatusId!=1}),SearchList&&SearchList.length>0?($scope2.Search={},$scope2.IsSearchValidated="",$scope2.SearchedSponsors=SearchList,$scope2.$apply()):($scope2.Search={},$scope2.IsSearchValidated="",window.DI.DI.notification("Info","No Record Found","error"))}$rootScope2.hideLoader()}catch{$rootScope2.hideLoader()}})},$scope2.SelectSponsor=function(event,sponsor){console.log("event",event),console.log("sponsor",sponsor),$(".selected_sponsor").each(function(){this.checked=!1}
3),$(event.currentTarget)[0].checked=!0,$scope2.SelectedSponsor=sponsor,console.log("Selected Sponsor:",sponsor)},$scope2.SetSponsor=function(){$scope2.SelectedSponsor&&$scope2.SelectedSponsor.BackOfficeId?($rootScope2.showLoader(),window.DI.Users.getcustomersitebyid($scope2.SelectedSponsor.BackOfficeId).then(function(result){if(result.Data&&(result.Data.Webalias??result.Data.Username)){const url=new URL(location.href);url.searchParams.set("referral",result.Data.Webalias??result.Data.Username),history.pushState(null,"",url),window.location.href.includes("/login")&&console.log("Page has login in the url"),window.location.href.includes("/account/login")?window.DI.DI.notification("Success","Sponsor Updated","success"):window.location.reload()}else window.DI.DI.notification("Error","Webalias Not Exist","error");$rootScope2.hideLoader()}).catch(error=>{window.DI.DI.notification("Error","Something went wrong!","error"),$rootScope2.hideLoader()})):window.DI.DI.notification("Error","Select Any Sponsor","error")},$scope2.SetDefaultSponsor=function(){const url=new URL(location.href);url.searchParams.set("referral","OlivedaOrphan"),history.pushState(null,"",url),$scope2.close(),window.DI.DI.notification("Success","Sponsor Updated","success"),window.location.reload()}}]}),$rootScope.hideLoader()}).catch(error=>$rootScope.hideLoader())},$scope.navigateToContact=function(){console.log("sddfsd"),$.get("/search?q=&view=contact").then(function(response){var template=$templateCache.put("contact.html",response);$uibModal.open({animation:!0,templateUrl:"contact.html",backdrop:"static",keyboard:!0,closeOnEscape:!1,windowClass:"",controller:["$rootScope","$scope","$uibModalInstance",function($rootScope2,$scope2,$uibModalInstance){$scope2.title="",$scope2.message="",$scope2.type="",$scope2.data="",$(function(){$("body").addClass("contact-info-modal-dialog")}),$scope2.$on("$destroy",function(){$("body").removeClass("contact-info-modal-dialog")}),$scope2.close=function(isclose,arg){$uibModalInstance.dismiss("cancel")}}]})})},$scope.setDefaultAddress=function(id){id>0&&($("#address_default_address_"+id).trigger("click"),$("#address_form_"+id).submit())},$scope.handleSSOLogin=function(){let customerId;if(window.ShopifyAnalytics.meta.page.customerId!=null&&window.ShopifyAnalytics.meta.page.customerId!=null)customerId=window.ShopifyAnalytics.meta.page.customerId;else{window.location.href="https://backoffice.olivetreepeople.com";return}if(customerId>0){$("#vjenroll-loading").css("display","block");let request={externalId:customerId};$.ajax({url:"https://eusync.connectolive.com/SSO",type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify(request),success:function(response){response&&(response.Data!=null?window.location.href=response.Data:window.location.href="https://backoffice.olivetreepeople.com"),$("#vjenroll-loading").css("display","none")},error:function(error){$("#vjenroll-loading").css("display","none"),window.location.href="https://backoffice.olivetreepeople.com"}})}else window.location.href="https://backoffice.olivetreepeople.com"},$scope.onEnrollmentPage=!1,(function(){window.location.pathname.includes("enrollment")&&($scope.onEnrollmentPage=!0)})(),$(document).ready(()=>{$scope.handleSponsorHeaderDisplay();const pathname=window.location.pathname;if(pathname=="/"||pathname=="/cart"||pathname=="/pages/join-us"){var enrollInfo=localStorage.getItem("enrollerinfo");enrollInfo=="null"&&(!getParameterByName("referral")||getParameterByName("referral")=="OlivedaOrphan")&&setTimeout(function(){},1e3)}}),$scope.handleSponsorHeaderDisplay=function(){$rootScope.EnrollerInfo.WebAlias?($(".sponsor_details-section").addClass("d-flex"),$(".sponsor_details-section").removeClass("d-none")):($(".no-sponsor-section").addClass("d-flex"),$(".no-sponsor-section").removeClass("d-none"))},getParameterByName=function(name){query=window.location.search.toString(),name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS);return results=regex.exec(query),results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}
3,$scope.saveUserMetafields=function(sourcePage){return;var filter}}]);
4//# sourceMappingURL=/cdn/shop/t/53/assets/app.controller.js.map?v=107856014471543937821789435735

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.