PageSourceSearch

https://manhattannydeli.com/wp-content/plugins/clover-online-order…/js/dist/sooMyOrders.min.js?ver=1.6.6

js manhattannydeli.com collected 2026-10-04 07:14:53 UTC 46,227 bytes, 11 lines download raw bytes

1jQuery(function($){"use strict";window.sooMyOrders={showCustomerPanel:function(){this.changeElemVisibility("#sooAuthSection","hide");this.changeElemVisibility("#moo-customerPanel","show");this.clickOnPreviousOrders(null)},changeElemVisibility:function(selector,showOrHide){if(showOrHide==="show"){$(selector).show()}if(showOrHide==="hide"){$(selector).hide()}},showOrHideASection:function(section,show){$("div.moo-section").hide();const elem=$("#moo-"+section);if(show){elem.show()}else{elem.hide()}},showLoadingSection:function(){$("#moo_cp_content").html('<div class="mooLoadingSection"><i class="fas fa-spinner fa-spin"></i></div>')},setNavElmAsActive:function(element){$(".moo_nav_cpanel").removeClass("moo_nav_active");$(element).addClass("moo_nav_active")},clickOnMostPurchased:function(e){e.preventDefault();this.cancelOnFlightRequests();this.cancelAddingAddress();this.setNavElmAsActive("#sooMostPurchasedNavElm");$("#moo_cp_content").html('<div class=""><h1>clickOnMostPurchased</h1></div>')},clickOnFeatured:function(e){e.preventDefault();this.cancelOnFlightRequests();this.cancelAddingAddress();this.setNavElmAsActive("#sooTrendingNavElm");$("#moo_cp_content").html('<div class=""><h1>clickOnFeatured</h1></div>');this.renderFeaturedItemsSection()},clickOnPreviousOrders:function(e){if(e){e.preventDefault()}this.cancelAddingAddress();this.setNavElmAsActive("#sooPreviousOrdersNavElm");this.showLoadingSection();this.getCustomerOrdersByPage(1)},clickOnProfile:function(e){e.preventDefault();this.cancelOnFlightRequests();this.cancelAddingAddress();this.setNavElmAsActive("#sooProfileNavElm");this.showLoadingSection();let customer=this.getLoggedInCustomer();this.renderProfileSection(customer)},clickOnAddresses:function(e){if(e){e.preventDefault()}this.cancelOnFlightRequests();this.setNavElmAsActive("#sooAddressesNavElm");this.showLoadingSection();let customer=this.getLoggedInCustomer();this.renderAddresses(customer.addresses)},clickOnPointsHistory:function(e){e.preventDefault();this.cancelOnFlightRequests();this.setNavElmAsActive("#sooPointsNavElm");this.showLoadingSection();this.getCustomerLoyaltyHistory(1)},clickOnLogout:function(e){e.preventDefault();Swal.fire({title:"Are you sure?",icon:"warning",showCancelButton:true,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, Logout",showLoaderOnConfirm:true,cancelButtonText:"No, cancel!"}).then(data=>{if(data.isConfirmed){localStorage.removeItem("customerJwtToken");localStorage.removeItem("loggedInCustomer");localStorage.removeItem("sooPointsHistory");$("#moo_cp_content").html("");this.changeElemVisibility("#sooAuthSection","show");this.changeElemVisibility("#moo-customerPanel","hide")}})},getCustomerOrdersByPage:function(page){if(page>1){const loadMoreButton=$("#moo_cp_content > div.sooPagination > div > div > div");if(loadMoreButton.length){loadMoreButton.html("Loading").attr("onclick","")}}this.getCustomerOrders(page).then(req=>{if(!req.ok){throw new Error("An error")}return req.json()}).then(response=>{if(response?.data?.length>0){if($("#moo_cp_content>.sooListOfOrders").length===0){$("#moo_cp_content").html('<div class="sooListOfOrders"></div><div class="sooPagination"></div><div class="sooOrderDetails"></div>')}this.renderOrders(response.data);this.renderPagination(response.current_page,response.per_page,response.data.length)}else{if(page===1){$("#moo_cp_content").html('<div class="moo_cp_content_body"><p>There are no orders yet</p></div>')}}}).catch(err=>{if(!err instanceof DOMException){this.showErrorAlert(mooObjectL10n.error,mooObjectL10n.anErrorOccurred)}})},getCustomerLoyaltyHistory:function(page){this.getCustomerPoints().then(req=>{if(!req.ok){throw new Error("An error")}return req.json()}).then(response=>{if($("#moo_cp_content>.moo_cp_content_body>.sooLoyaltyPointsValue").length===0){$("#moo_cp_content").html('<div class="moo_cp_content_body"><div class="sooLoyaltyPointsValue"></div><div class="sooLoyaltyPointsHistory"><div class="sooLoyaltyBody"></div></div><div class="sooPagination"></div></div>')}this.renderPointsValue(response);if(response?.points_history?.length){localStorage.setItem("sooPointsHistory",JSON.stringify(response));this.renderPointsHistory(page)}else{$("#moo_cp_content>.moo_cp_content_body>.sooLoyaltyPointsHistory").html('<div class="sooLoyaltyBody"></div>')}}).catch(err=>{if(!err instanceof DOMException){this.showErrorAlert(mooObjectL10n.error,mooObjectL10n.anErrorOccurred)}})},renderOrders:function(orders){let htmlContent='<div class="">';
1for(let i in orders){const order=orders[i];let html=`<div class="moo_cp_content_oneOrderLigne" onclick="sooMyOrders.openOrderDetails('${order.uuid}')" data-order-uuid="${order.uuid}">`;html+=`<div id="soo-order-${order.uuid}" class="moo-row moo_border moo_cp_content_oneOrder">`;html+='<div class="moo-col-md-5 moo-col-xs-9 moo_right_border moo_cp_content_oneOrderCol moo_cp_content_oneOrderItems">';if(order.title&&order.title.substring(0,3)==="SOO"){const titles=order.title.split(" ");html+=`<div class="moo_cp_orders_ordernumber">${titles[0]}</div>`}else{html+=`<div class="moo_cp_orders_ordernumber">${order.uuid}</div>`}html+='<div class="moo_cp_orders_orderdate">'+order.created_at_hf+"</div>";html+="</div>";const convenienceFee=order.convenience_fee||0;html+='<div class="moo-col-md-2 moo-col-xs-3 moo_right_border moo_cp_content_oneOrderCol moo_center_text moo_cp_content_oneOrderTotal">$'+this.formatPrice(order.tip_amount+order.amount+convenienceFee)+"</div>";if(order.payment_status){html+='<div class="moo-col-md-4 moo-col-xs-10  moo_cp_content_oneOrderCol moo_cp_content_oneOrderStatus">'+order.payment_status+"</div>"}else{html+='<div class="moo-col-md-4 moo-col-xs-10  moo_cp_content_oneOrderCol moo_cp_content_oneOrderStatus"></div>'}html+=`<div class="moo-col-md-1 moo-col-xs-2 moo_cp_content_oneOrderCol moo_center_text  moo_center_text moo_cp_content_oneOrderButton"> > </div>`;html+="</div>";html+="</div>";html+="</div>";html+="</div>";htmlContent+=html;if(orders.length-1===parseInt(i)){htmlContent+="</div>";$("#moo_cp_content>.sooListOfOrders").append(htmlContent)}}},renderPagination:function(currentPage,perPage,total){let html="";html+='<div class="moo_cp_content_filter">';html+='<div class="moo_pagination">';if(perPage===total){html+='<div onclick="sooMyOrders.getCustomerOrdersByPage('+(currentPage+1)+')">Load More Orders</div>'}html+="</div>";html+="</div>";$("#moo_cp_content>.sooPagination").html(html)},renderOrderDetails:function(order,orderUuid,scrollPos){const receiptLink=sooMyOrdersOptions.isSandbox?`https://sandbox.dev.clover.com/r/${orderUuid}`:`https://clover.com/r/${orderUuid}`;if(order.status==="failed"){let htmlContent='<div class="sooOrderDetails">';htmlContent+=`<div class="moo-row sooBackSection">`;htmlContent+=`<div class="backIcon moo-col-xs-1" onclick='sooMyOrders.backToListOfOrders(${scrollPos})'>`;htmlContent+=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2                <path d="M11.2908 12L14.8308 8.46001C15.017 8.27265 15.1216 8.0192 15.1216 7.75501C15.1216 7.49082 15.017 7.23737 14.8308 7.05001C14.7378 6.95628 14.6272 6.88189 14.5054 6.83112C14.3835 6.78035 14.2528 6.75421 14.1208 6.75421C13.9888 6.75421 13.8581 6.78035 13.7362 6.83112C13.6144 6.88189 13.5038 6.95628 13.4108 7.05001L9.1708 11.29C9.07707 11.383 9.00268 11.4936 8.95191 11.6154C8.90114 11.7373 8.875 11.868 8.875 12C8.875 12.132 8.90114 12.2627 8.95191 12.3846C9.00268 12.5064 9.07707 12.617 9.1708 12.71L13.4108 17C13.5042 17.0927 13.6151 17.166 13.7369 17.2158C13.8587 17.2655 13.9892 17.2908 14.1208 17.29C14.2524 17.2908 14.3829 17.2655 14.5047 17.2158C14.6265 17.166 14.7374 17.0927 14.8308 17C15.017 16.8126 15.1216 16.5592 15.1216 16.295C15.1216 16.0308 15.017 15.7774 14.8308 15.59L11.2908 12Z" fill="black"></path>
3              </svg>`;htmlContent+=`</div>`;htmlContent+=`<div class="sooTitle moo-col-xs-5">We couldn't find that order.</div>`;htmlContent+=`<div class="reorderBtn moo-col-xs-6" style="margin-top: 0;">`;htmlContent+=`<a class="receiptLink" href="${receiptLink}" target="_blank">See Receipt</a>`;htmlContent+=`</div>`;htmlContent+=`</div>`;$("#moo_cp_content > div.sooOrderDetails").html(htmlContent);return}let htmlContent='<div class="sooOrderDetails">';htmlContent+=`<div class="moo-row sooBackSection">`;htmlContent+=`<div class="backIcon moo-col-xs-1" onclick='sooMyOrders.backToListOfOrders(${scrollPos})'>`;htmlContent+=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4                <path d="M11.2908 12L14.8308 8.46001C15.017 8.27265 15.1216 8.0192 15.1216 7.75501C15.1216 7.49082 15.017 7.23737 14.8308 7.05001C14.7378 6.95628 14.6272 6.88189 14.5054 6.83112C14.3835 6.78035 14.2528 6.75421 14.1208 6.75421C13.9888 6.75421 13.8581 6.78035 13.7362 6.83112C13.6144 6.88189 13.5038 6.95628 13.4108 7.05001L9.1708 11.29C9.07707 11.383 9.00268 11.4936 8.95191 11.6154C8.90114 11.7373 8.875 11.868 8.875 12C8.875 12.132 8.90114 12.2627 8.95191 12.3846C9.00268 12.5064 9.07707 12.617 9.1708 12.71L13.4108 17C13.5042 17.0927 13.6151 17.166 13.7369 17.2158C13.8587 17.2655 13.9892 17.2908 14.1208 17.29C14.2524 17.2908 14.3829 17.2655 14.5047 17.2158C14.6265 17.166 14.7374 17.0927 14.8308 17C15.017 16.8126 15.1216 16.5592 15.1216 16.295C15.1216 16.0308 15.017 15.7774 14.8308 15.59L11.2908 12Z" fill="black"></path>
5              </svg>`;htmlContent+=`</div>`;htmlContent+=`<div class="sooTitle moo-col-md-4 moo-col-xs-10">Order Details</div>`;htmlContent+=`<div class="reorderBtn moo-col-md-7 moo-col-xs-12">`;htmlContent+=`<a class="receiptLink" href="${receiptLink}" target="_blank">See Receipt</a>`;htmlContent+=`<button class="sooPrimaryButtonInput" onclick="sooMyOrders.clickOnReOrderBtn('${order.uuid}')">Re-Order</button>`;htmlContent+=`</div>`;htmlContent+=`</div>`;htmlContent+=`<div class="sooOrderInfoSection sooBorderedArea">`;htmlContent+=`<div class="moo-row">`;htmlContent+=`<div class="moo-col-md-8 moo-col-xs-12 sooTitle">#${order.uuid}`;if(order.title&&order.title.substring(0,3)==="SOO"){const titles=order.title.split(" ");htmlContent+=` | <div class="sooOrderTitle">${titles[0]}</div>`}htmlContent+=`</div>`;htmlContent+=`<div class="moo-col-md-4 moo-col-xs-12 sooOrderDate">${order.created_at_hf}</div>`;htmlContent+=`</div>`;htmlContent+=`<div class="moo-row">`;htmlContent+=`<div class="moo-col-xs-12 sooOrderStatus">`;if(order.payment_status){htmlContent+=`<div class="tag tag-${order.payment_status?.replaceAll("_","-").replaceAll(" ","").toLowerCase()}">${order.payment_status}</div>`}if(order.payment_method){htmlContent+=` | <div class="tag tag-${order.payment_method?.replaceAll("_","-").replaceAll(" ","").toLowerCase()}">${order.payment_method}</div>`}htmlContent+=`</div>`;htmlContent+=`</div>`;htmlContent+=`<div class="moo-row">`;if(order.order_type_label){htmlContent+=`<div class="moo-col-xs-12 sooOrderMethod"><span>Ordering Method :</span> ${order.order_type_label}</div>`}if(order.address){htmlContent+=`<div class="moo-col-xs-12 sooOrderAddress"><span>
5Delivery Address : </span>`;htmlContent+=`${order.address.address} ${order.address.line2} ${order.address.city}, `;htmlContent+=`${order.address.state} ${order.address.zipcode}`;htmlContent+=`</div>`;if(order.doordash_delivery?.status){if(!order.doordash_delivery.status.includes(["cancelled","delivered","returned","could_not_deliver"])){htmlContent+=`<div class="moo-col-xs-12 sooOrderAddress"><span>Delivery Status : </span>`;htmlContent+=` ${order.doordash_delivery.status_message} (<span>Support ID : ${order.doordash_delivery.external_id}</span>)`;htmlContent+=`, <a href="${order.doordash_delivery.delivery_tracking_url}" target="_blank">Tracking Link</a> `;htmlContent+=`</div>`}}}if(order.scheduled_time){if(order.scheduled_time.includes("Today")){const monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const d=new Date(order.created_at);const day=monthNames[d.getMonth()]+" "+d.getDate();order.scheduled_time=order.scheduled_time.replace("Today",day)}htmlContent+=`<div class="moo-col-xs-12 sooOrderingTime">${order.scheduled_time}</div>`}htmlContent+=`</div>`;htmlContent+=`</div>`;htmlContent+=`<div class="sooLineItemsSection sooBorderedArea">`;htmlContent+=`<div class="sectionTitle">Items</div>`;let subtotal=0;for(let i=0;i<order.cart?.length;i++){const lineItem=order.cart[i];let lineItemSubtoal=lineItem.qty*lineItem.price;htmlContent+=`<div class="moo-row oneItemLine">`;htmlContent+=`<div class="moo-col-xs-2 sooItemQty">${lineItem.qty}x</div>`;htmlContent+=`<div class="moo-col-xs-8 sooItemName">`;if(lineItem.modifiers?.length>0){htmlContent+=`<span>${lineItem.name} ($${this.formatPrice(lineItem.price)})</span>`;htmlContent+=`<div class="sooItemModifiers">`;lineItem.modifiers.forEach(element=>{htmlContent+=`<div>${element.qty} x ${element.name}`;if(element.amount>0){htmlContent+=` ($${this.formatPrice(element.amount)})`;lineItemSubtoal+=lineItem.qty*element.qty*element.amount}htmlContent+=`</div>`});htmlContent+=`</div>`}else{htmlContent+=`<span>${lineItem.name}</span>`}if(lineItem.note){htmlContent+=`<div class="sooItemNote">${lineItem.note}</div>`}htmlContent+=`</div>`;htmlContent+=`<div class="moo-col-xs-2 sooItemPrice">$${this.formatPrice(lineItemSubtoal)}</div>`;htmlContent+=`</div>`;subtotal+=lineItemSubtoal}htmlContent+=`<div class="moo-row totalsSection">`;htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">Subtotal</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(subtotal)}</div>`;htmlContent+=`</div>`;htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">Tax</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(order.tax_amount)}</div>`;htmlContent+=`</div>`;if(order.service_fee){htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">${order.service_fee_name}</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(order.service_fee)}</div>`;htmlContent+=`</div>`}if(order.delivery_fee){htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">${order.delivery_name}</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(order.delivery_fee)}</div>`;htmlContent+=`</div>`}if(order.tip_amount){htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">Tip</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(order.tip_amount)}</div>`;htmlContent+=`</div>`}let totalAdditionalCharges=0;if(order.payments&&Array.isArray(order.payments)){order.payments.forEach(payment=>{if(payment.additional_charges_amount&&payment.additional_charges_amount>0){totalAdditionalCharges+=payment.additional_charges_amount}})}if(totalAdditionalCharges>0){htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">Convenience fee</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(totalAdditionalCharges)}</div>`;htmlContent+=`</div>`}order.discounts.forEach(elm=>{htmlContent+=`<div class="moo-row total">`;htmlContent+=`<div class="moo-col-xs-9">${elm.name}</div>`;htmlContent+=`<div class="moo-col-xs-3">-$${this.formatPrice(-1*elm.amount)}</div>`;htmlContent+=`</div>`});htmlContent+=`<div class="moo-row grandTotal">`;htmlContent+=`<div class="moo-col-xs-9">Total</div>`;htmlContent+=`<div class="moo-col-xs-3">$${this.formatPrice(order.tip_amount+order.amount+totalAdditionalCharges)}</div>`;htmlContent+=`</div>`;htmlContent+=`</div>`;htmlContent+=`</div>`;if(order.special_instructions){htmlContent+=`<div class="sooSpecialInstructionsSection sooBorderedArea">`;htmlContent+=`<div class="sectionTitle">Special instructions</div>`;htmlContent+=`<div class="moo-row">`;htmlContent+=`<div class="moo-col-xs-12">${order.special_instructions}</div>`;htmlContent+=`</div>`;htmlContent+=`</div>`}if(order.payments?.length>0){htmlContent+=`<div class="sooPaymentsSection sooBorderedArea">`;htmlContent+=`<div class="sectionTitle">Payment</div>`;
5order.payments.forEach(payment=>{const convenienceFee=payment.additional_charges_amount||0;const totalPaid=payment.payment_amount+payment.tip_amount+convenienceFee;htmlContent+=`<div class="onePayment">
6                        <div class="moo-row"><div class="paymentLabel moo-col-xs-6">Payment Result :</div><div class="moo-col-xs-6">${payment.result}</div></div>
7                        <div class="moo-row"><div class="paymentLabel moo-col-xs-6">Paid Amount :</div><div class="moo-col-xs-6">$${this.formatPrice(totalPaid)}</div></div>
8                        <div class="moo-row"><div class="paymentLabel moo-col-xs-6">Order amount :</div><div class="moo-col-xs-6">$${this.formatPrice(payment.payment_amount)}</div></div>
9                        <div class="moo-row"><div class="paymentLabel moo-col-xs-6">Tip :</div><div class="moo-col-xs-6">$${this.formatPrice(payment.tip_amount)}</div></div>`;if(convenienceFee>0){htmlContent+=`<div class="moo-row"><div class="paymentLabel moo-col-xs-6">Convenience fee :</div><div class="moo-col-xs-6">$${this.formatPrice(convenienceFee)}</div></div>`}htmlContent+=`<div class="moo-row"><div class="paymentLabel moo-col-xs-6">Payment Method :</div><div class="moo-col-xs-6">Credit Card Ending ${payment.last4}</div></div>
10                        <div class="moo-row"><div class="paymentLabel moo-col-xs-6">Payment date :</div><div class="moo-col-xs-6">${payment.created_at_hf}</div></div>
11                    </div>`})}$("#moo_cp_content > div.sooOrderDetails").html(htmlContent)},getOrderSource:function(channel){if(channel.toLowerCase().includes("ios")){return"Mobile App"}if(channel.toLowerCase().includes("android")){return"Mobile App"}if(channel.toLowerCase().includes("website")){return"Website"}return channel},renderProfileSection:function(user){let html='<div class="moo_cp_content_header"></div>';html+='<div class="moo_cp_content_body">';html+='<div class="moo-row sooBorderedArea m-0" style="margin-bottom: 15px">';html+="<h2>Personal information</h2>";html+='<div class="moo-col-md-12">';html+='<form onsubmit="sooMyOrders.updateProfile(event)" method="post">';html+='<div class="moo-row">';html+='<div class="moo-col-xs-6">';html+='<div class="moo-form-group">';html+='<label for="cp_MooName">First Name</label>';html+='<input type="text" class="sooTextInput" id="cp_MooFirstName" value="'+user.first_name+'">';html+="</div>";html+="</div>";html+='<div class="moo-col-xs-6">';html+='<div class="moo-form-group">';html+='<label for="cp_MooName">Last Name</label>';html+='<input type="text" class="sooTextInput" id="cp_MooLastName" value="'+user.last_name+'">';html+="</div>";html+="</div>";html+="</div>";html+='<div class="moo-row">';html+='<div class="moo-col-xs-12">';html+='<div class="moo-form-group">';html+='<label for="cp_MooEmail">Email</label>';html+='<input type="text" class="sooTextInput" id="cp_MooEmail" value="'+user.email+'">';html+="</div>";html+="</div>";html+="</div>";html+='<div class="moo-row">';html+='<div class="moo-col-xs-12">';html+='<div class="moo-form-group">';html+='<label for="cp_MooPhone">Phone</label>';html+='<input type="text" class="sooTextInput" id="cp_MooPhone" value="'+user.phone+'">';html+="</div>";html+="</div>";html+="</div>";html+='<p style="text-align: right">';html+='<button id="sooUpdateProfileButton" class="sooPrimaryButtonInput" onclick="sooMyOrders.updateProfile(event)">Update profile</button>';html+="</p>";html+="</form>";html+="</div>";html+="</div>";html+='<div class="moo-row sooBorderedArea m-0">';html+="<h2>Change Password</h2>";html+='<div class="moo-col-md-12">';html+='<form onsubmit="sooMyOrders.updatePassword(event)" method="post">';html+='<div class="moo-form-group">';html+='<label for="cp_MooCurrentPassword">Current password</label>';html+='<input type="hidden" autocomplete="username" value="">';html+='<input type="password" class="sooTextInput" id="cp_MooCurrentPassword" autocomplete="current-password">';html+="</div>";html+='<div class="moo-form-group">';html+='<label for="cp_MooNewPassword">New Password</label>';html+='<input type="password" class="sooTextInput" id="cp_MooNewPassword" autocomplete="new-password">';html+="</div>";html+='<div class="moo-form-group">';html+='<label for="cp_MooRepeatNewPassword">Repeat Password</label>';html+='<input type="password" class="sooTextInput" id="cp_MooRepeatNewPassword" autocomplete="new-password">';html+="</div>";html+='<p style="text-align: right" ">';html+='<button id="sooUpdatePasswordButton" class="sooPrimaryButtonInput" onclick="sooMyOrders.updatePassword(event)">
11Change Password</button>';html+="</p>";html+="</form>";html+="</div>";html+="</div>";html+="</div>";html+="</div>";$("#moo_cp_content").html(html)},renderFeaturedItemsSection:function(){this.showLoadingSection();this.getFeaturedItems().then(response=>{return response.json()}).then(data=>{window.moo_nbItemsPerLine=$(".moo_cp_content").width()<600?2:3;var html="";html+='<div class="moo_cp_content_body">';if(data.items&&data.items.length>0){for(let i in data.items){var item=data.items[i];if(typeof item!=="object"){continue}var item_price=parseFloat(item.price);item_price=item_price/100;item_price=item_price.toFixed(2);if(item.price>0&&item.price_type==="PER_UNIT")item_price+="/"+item.unit_name;if(i%window.moo_nbItemsPerLine===0){html+='<div class="moo-col-md-'+12/window.moo_nbItemsPerLine+'" style="clear: both">'}else{html+='<div class="moo-col-md-'+12/window.moo_nbItemsPerLine+'">'}html+='<a title="'+item.description+'" class="link" href="#item-'+item.uuid.toLowerCase()+'" data-item-id="'+item.uuid.toLowerCase()+'" >';if(item.image!==null&&item.image.url!==null&&item.image.url!==""){html+='<div class="image-wrapper"><img class="moo-image" alt="" data-image-vertical="1" width="100%" height="100%" src="'+item.image.url+'" /></div>'}else{html+='<div class="image-wrapper">'+'<img class="moo-image" alt="" data-image-vertical="1" width="100%" height="100%" src="'+moo_params["plugin_img"]+'/noImg.png" />'+"</div>"}html+='<h2 class="title"><span class="brand"></span>'+'<span class="name">'+item.name+"</span>"+"</h2>"+'<div class="price-container clearfix">'+'<div class="price-box">'+'<span class="price">';if(parseFloat(item.price)===0){html+="<span></span>"}else{html+="<span>$"+item_price+"</span>"}html+="</span>"+"</div>"+"</div>"+'<div class="btn-wrapper"><span class="moo-category-name">';if(item.stockCount==="out_of_stock"){html+='<button class="osh-btn"><span class="label">OUT OF STOCK</span></button>'}else{if(item.has_modifiers){html+='<button class="osh-btn" onclick="sooMyOrders.openQtyWindow(event,\''+item.uuid+"','"+item.stockCount+'\',sooMyOrders.clickOnOrderBtnFIWM)"><span class="label">Choose Options</span></button>'}else{html+='<button class="osh-btn" onclick="sooMyOrders.openQtyWindow(event,\''+item.uuid+"','"+item.stockCount+'\',sooMyOrders.clickOnOrderBtn)"><span class="label">Add to cart</span></button>'}}html+="</span></div></a></div>"}}else{html+="<p>There are no items yet</p>"}html+="</div>";$("#moo_cp_content").html(html)})},renderAddresses:function(addresses){var html="";html+='<div class="moo_cp_content_body">';if(addresses.length>0){for(let i in addresses){const address=addresses[i];if(typeof address!=="object"){continue}html+=`<div class="soo-one-address" id="sooAddress-${address.id}">`;if(typeof address.full_name!=="undefined"&&address.full_name!==null){html+="<div class='soo-one-address-name'>"+address.full_name+"</div>"}html+="<div class='soo-one-address-line1'>"+address.address+"</div>";if(address.line2){html+="<div class='soo-one-address-line2'>"+address.line2+"</div>"}html+=`<div class='soo-one-address-line2'>${address.city} ${address.state}, ${address.zipcode}</div>`;html+=`<div class='soo-address-delete-icon' onclick="sooMyOrders.deleteAddress(event,${address.id})"><span class='fas fa-trash-alt'></span></div>`;html+="</div>"}}else{html+="No Saved Addresses Yet"}html+="</div>";html+='<a role="button" aria-label="add new address" class="sooPrimaryButtonInput moo_pull_right" href="#" onclick="sooMyOrders.showAddAddressForm(event)">Add New Address</a>';$("#moo_cp_content").html(html).promise().done(function(){})},renderPointsValue:function(data){var html="";html+='<div class="sooLoyaltyHeader sooBorderedArea">';if(data.valid_points){html+='<div class="sooLoyaltyBalance">';html+="";html+=`<div class="sooValidPoints"><span>Your Balance : </span> ${data.valid_points}`;if(sooMyOrdersOptions?.loyaltySetting?.label){html+=`<span class="sooPointsLabel">${sooMyOrdersOptions.loyaltySetting.label}</span>`}html+="</div>";html+="</div>"}html+='<div class="sooLoyaltyDollarValue">';if(data.points_value){html+="<span>Dollar Value : $</span>";html+=`<span class="sooDollarValue">${this.formatPrice(data.points_value)}</span>`}if(data.pending_points){html+='<div class="sooLoyaltyPendingPoints">';html+="<span>Pending ";if(sooMyOrdersOptions?.loyaltySetting?.label){html+=sooMyOrdersOptions.loyaltySetting.label}html+=" : </span>";html+=`<span class="sooDollarPendingPoints">${data.pending_points}</span>`;html+="</div>"}html+="</div>";html+='<div class="sooLoyaltyConditions">';
11html+='<span onclick="sooMyOrders.openLoyaltyDetails()">Loyalty Requirements</span>';html+="</div>";html+="</div>";$("#moo_cp_content>.moo_cp_content_body>.sooLoyaltyPointsValue").html(html)},renderPointsHistory:function(page){if(page>1){const loadMoreButton=$("#moo_cp_content >.moo_cp_content_body>div.sooPagination > div > div");if(loadMoreButton.length){loadMoreButton.html("Loading").attr("onclick","")}}const data=JSON.parse(localStorage.getItem("sooPointsHistory"));if(data?.points_history?.length>page*20){this.renderPointsPagination(page)}else{$("#moo_cp_content>.moo_cp_content_body>.sooPagination").html("")}var html="";if(data?.points_history?.length>0){for(let i in data.points_history){if(i<20*(page-1)){continue}if(i>=20*page){break}const line=data.points_history[i];const lineDetail=this.getRowDetails(line);const classes=this.getPointsClass(line);html+=`<div class="moo-row soo-one-point-history-line">`;html+=`<div class='moo-col-xs-3 sooPointsDates'>`;html+=`<div>${line.created_on}</div>`;html+=`<div>${line.created_at}</div>`;html+=`</div>`;html+=`<div class='moo-col-xs-6 sooPointsDetails'>`;html+=`<div>${lineDetail.title}</div>`;html+=`<div>${lineDetail.details}</div>`;html+=`</div>`;html+=`<div class='moo-col-xs-3 sooPointsValue'>`;html+=`<div class="${classes}">${line.value}</div>`;if(line.status==="expired"&&line.value-line.used>0){html+=`<div class="lost-points">-${line.value-line.used}</div>`}html+=`</div>`;html+="</div>"}}$("#moo_cp_content>.moo_cp_content_body>.sooLoyaltyPointsHistory>.sooLoyaltyBody").append(html)},renderPointsPagination:function(page){let html="";html+='<div class="moo_pagination">';html+='<div onclick="sooMyOrders.renderPointsHistory('+(page+1)+')">Load More</div>';html+="</div>";$("#moo_cp_content>.moo_cp_content_body>.sooPagination").html(html)},getRowDetails:function(row){let label="Points";let rowDetailsHeader="";let rowDetailsSub="";if(sooMyOrdersOptions?.loyaltySetting?.label){label=sooMyOrdersOptions.loyaltySetting.label}const actionDescriptors={order:"Online purchase",in_store:"In store Purchase",first_order:"Place the first order",app_install:"Install the app",write_review:"Write a review",confirm_email:"Email confirmation",confirm_phone:"Phone number confirmation",birthday:"Birthday Gift"};const wherePointsUsed={in_store:`${label} Used In Store`,kiosk:`${label} Used on KIOSK`,branded_app_ios:`${label} Used on the mobile app`,branded_app_android:`${label} Used on the mobile app`,mobile_flutter_android:`${label} Used on the mobile app`,mobile_flutter_ios:`${label} Used on the mobile app`};const wherePointsEarned={in_store:"In store Purchase",kiosk:"Kiosk Purchase",branded_app_ios:"Mobile app purchase",branded_app_android:"Mobile app purchase",mobile_flutter_android:"Mobile app purchase",mobile_flutter_ios:"Mobile app purchase"};if(row.value>=0&&(row.status==="valid"||row.status==="expired")){if(row.source_type==="manual"){rowDetailsHeader="Added By The merchant"}else{if(row.source_type==="order"){rowDetailsHeader=wherePointsEarned[row.channel]??"Online Purchase"}else{rowDetailsHeader=actionDescriptors[row.source_type]??"Online Purchase"}if(row.status==="expired"&&row.value-row.used>0){rowDetailsSub=`${row.value-row.used} ${label} Expired`}else{rowDetailsSub=row.valid_until_hf?`Valid Until ${row.valid_until_hf}`:row.source_id?`Order #${row.source_id}`:""}}return{title:rowDetailsHeader,details:rowDetailsSub}}if(row.value<0&&row.status==="valid"){if(row.source_type==="manual"||row.channel==="manual_in_store"){rowDetailsHeader="Removed By The merchant"}else{rowDetailsHeader=wherePointsUsed[row.channel]??"Points Used Online";rowDetailsSub=`Order #${row.source_id}`}return{title:rowDetailsHeader,details:rowDetailsSub}}if(row.value>=0&&row.status==="pending"){rowDetailsHeader=`Pending ${label}`;rowDetailsSub=`Order #${row.source_id}. Pending`;return{title:rowDetailsHeader,details:rowDetailsSub}}if(row.value>=0&&row.status==="canceled"){rowDetailsHeader=`Cancelled ${label}`;rowDetailsSub=`Order #${row.source_id} has been deleted`;return{title:rowDetailsHeader,details:rowDetailsSub}}if(row.value>=0&&row.status==="refunded"){rowDetailsHeader="Deleted Order";rowDetailsSub=`Order #${row.source_id} has been refunded`;return{title:rowDetailsHeader,details:rowDetailsSub}}},getPointsClass:function(row){if(row.status==="pending"||row.status==="refunded"||row.status==="canceled"){return"pending-points"}if(row.value>0){return"earned-points"}else{return"lost-points"}},getCustomerOrders:function(page=1){const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v2/customers/orders?page="+page;
11return this.sendGetRequest(url)},getOneOrder:function(uuid=1){const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v2/customers/orders/"+uuid;return this.sendGetRequest(url)},getCustomerPoints:function(){const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v2/customers/points";return this.sendGetRequest(url)},deleteAddress:function(e,address_id){e.preventDefault();Swal.fire({title:"Are you sure?",text:"You will not be able to recover this address",icon:"warning",showCancelButton:true,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, delete it!",showLoaderOnConfirm:true,cancelButtonText:"No, cancel!",preConfirm:()=>{const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v3/customers/addresses/"+address_id;return this.sendDeleteRequest(url).then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).catch(error=>{Swal.showValidationMessage(`Request failed: ${error}`)})},allowOutsideClick:()=>!Swal.isLoading()}).then(data=>{if(data.isConfirmed){if(data.value&&data.value.message){if(data.value.message==="The address has been deleted"){this.showSuccessAlert(data.value.message);$("#sooAddress-"+address_id).hide()}else{this.showErrorAlert(data.value.message,"")}}else{if(data.value&&data.value.error){this.showErrorAlert(data.value.error,"")}else{this.showErrorAlert(mooObjectL10n.anErrorOccurred,"")}}}})},showAddAddressForm:function(e){e.preventDefault();$("#moo-customerPanelContent section.moo_cp_content").hide();$("#moo-customerPanelContent section.moo_cp_add_address").show();if($("form#soo-add-address-form").length){sooMyOrders.addAddressForm=$("form#soo-add-address-form");sooMyOrders.addAddressForm.on("submit",this.addAddress)}},cancelAddingAddress:function(e=null){if(e){e.preventDefault()}$("#moo-customerPanelContent section.moo_cp_content").show();$("#moo-customerPanelContent section.moo_cp_add_address").hide()},addAddress:function(e){e.preventDefault();if(sooMyOrders.addAddressForm.data("submitted")===true){return false}else{sooMyOrders.startSubmitingAform(sooMyOrders.addAddressForm)}const formElements={fullNameInput:sooMyOrders.addAddressForm.find("#sooAddAddressName"),addressInput:sooMyOrders.addAddressForm.find("#sooAddAddressLine1"),line2Input:sooMyOrders.addAddressForm.find("#sooAddAddressLine2"),cityInput:sooMyOrders.addAddressForm.find("#sooAddAddressCity"),stateInput:sooMyOrders.addAddressForm.find("#sooAddAddressState"),zipCodeInput:sooMyOrders.addAddressForm.find("#sooAddAddressZipCode")};const requiredField=["addressInput","cityInput","stateInput","zipCodeInput"];for(const el in formElements){if(requiredField.includes(el)&&!formElements[el].val()){formElements[el].parent().addClass("moo-has-error");formElements[el].next().show();formElements[el].focus();sooMyOrders.finishSubmitingAform(sooMyOrders.addAddressForm);return}}const address={full_name:formElements.fullNameInput.val().trim(),address:formElements.addressInput.val().trim(),line2:formElements.line2Input.val().trim(),city:formElements.cityInput.val().trim(),state:formElements.stateInput.val().trim(),zipcode:formElements.zipCodeInput.val().trim()};const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v3/customers/addresses";sooMyOrders.sendPostRequest(url,address).then(req=>{return req.json()}).then(address=>{if(address.id){sooMyOrders.finishSubmitingAform(sooMyOrders.addAddressForm);sooMyOrders.showSuccessAlert("Address added");let customer=sooMyOrders.getLoggedInCustomer();customer.addresses.push(address);localStorage.setItem("loggedInCustomer",JSON.stringify(customer));$("#moo-customerPanelContent section.moo_cp_content").show();$("#moo-customerPanelContent section.moo_cp_add_address").hide();sooMyOrders.clickOnAddresses(null)}else{if(address.message){throw new Error(address.message)}if(address.error){throw new Error(address.error)}throw new Error(mooObjectL10n.anErrorOccurred)}}).catch(err=>{sooMyOrders.finishSubmitingAform(sooMyOrders.addAddressForm);sooMyOrders.showErrorAlert(err.message,mooObjectL10n.tryAgain)})},getLoggedInCustomer:function(){if(localStorage.getItem("loggedInCustomer")){return JSON.parse(localStorage.getItem("loggedInCustomer"))}return null},updateProfile:function(e){e.preventDefault();const btn=$("#sooUpdateProfileButton");const btnTxt=btn.html();const firstName=document.querySelector("#cp_MooFirstName").value;const lastName=document.querySelector("#cp_MooLastName").value;const email=document.querySelector("#cp_MooEmail").value;const phone=document.querySelector("#cp_MooPhone").value;if(firstName===""){this.showErrorAlert("Your name is required","");return}if(email===""){this.showErrorAlert("Your email is required","");return}if(phone===""){this.showErrorAlert("Your phone is required","");return}btn.html('<div class="dot-flashing"></div>');const profile={email:email,first_name:firstName,last_name:lastName,phone:phone};const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v2/customers/me";this.sendPostRequest(url,profile).then(req=>{return req.json()}).then(data=>{if(data.message){throw new Error(data.message)}else{if(data===false){throw new Error(mooObjectL10n.anErrorOccurred)}else{this.showSuccessAlert("your personal information were updated");localStorage.setItem("loggedInCustomer",JSON.stringify(data));btn.html(btnTxt)}}}).catch(error=>{this.showErrorAlert(error.message,"");btn.html(btnTxt)})},updatePassword:function(e){e.preventDefault();const btn=$("#sooUpdatePasswordButton");const btnTxt=btn.html();const currentPassword=$("#cp_MooCurrentPassword").val();const newPassword=$("#cp_MooNewPassword").val();const repeatnewPassword=$("#cp_MooRepeatNewPassword").val();if(currentPassword===""||newPassword===""||repeatnewPassword===""){this.showErrorAlert("Fill all fields","Please fill the current and new password");return}if(newPassword!==repeatnewPassword){this.showErrorAlert("Attention !","Passwords did not match");return}btn.html('<div class="dot-flashing"></div>');const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v2/customers/password";const data={old_password:currentPassword,new_password:newPassword,new_password_confirmation:repeatnewPassword};this.sendPostRequest(url,data).then(response=>{return response.json()}).then(data=>{if(data.message){throw new Error(data.message)}else{if(data===false){throw new Error(mooObjectL10n.anErrorOccurred)}else{this.showSuccessAlert("Your password were updated");btn.html(btnTxt)}}}).catch(err=>{if(err.message==="The Password has been updated"){this.showSuccessAlert(err.message)}else{this.showErrorAlert("Attention !",err.message)}btn.html(btnTxt)})},getFeaturedItems:function(){const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v1/items/most_purchase";
11return this.sendGetRequest(url)},sendGetRequest:function(url){window.controller=new AbortController;let token=localStorage.getItem("customerJwtToken");return fetch(url,{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:"Bearer "+token},redirect:"follow",referrerPolicy:"no-referrer",signal:window.controller.signal})},sendPostRequest:function(url,body){let token=localStorage.getItem("customerJwtToken");return fetch(url,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:"Bearer "+token},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(body)})},sendDeleteRequest:function(url){let token=localStorage.getItem("customerJwtToken");return fetch(url,{method:"DELETE",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json",Authorization:"Bearer "+token},redirect:"follow",referrerPolicy:"no-referrer"})},formatPrice:function(priceInCentes){var p=priceInCentes/100;p=p.toFixed(2);return p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},openQtyWindow:function(event,item_id,stockCount,callback){event.preventDefault();var inputOptions=new Promise(function(resolve){if(stockCount==="not_tracking_stock"||stockCount==="tracking_stock"){resolve({1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",custom:"Custom Quantity"})}else{var options={};var QtyMax=parseInt(stockCount)>10?10:parseInt(stockCount);var count=QtyMax;for(var $i=1;$i<=QtyMax;$i++){options[$i.toString()]=$i.toString();if(!--count){options["custom"]="Custom Quantity";resolve(options)}}}});Swal.fire({title:"Select the quantity",showLoaderOnConfirm:true,confirmButtonText:"Add",input:"select",inputClass:"moo-form-control",inputOptions:inputOptions,showCancelButton:true,preConfirm:function(value){if(value==="custom"){sooMyOrders.openCustomQtyWindow(event,item_id,callback)}else{callback(event,item_id,value)}}}).then(data=>{console.log(data)}).catch(err=>{console.log(err)})},clickOnOrderBtn:function(event,item_id,qty){var body={item_uuid:item_id,item_qty:qty,item_modifiers:{}};const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v1/cart";sooMyOrders.sendPostRequest(url,body).then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).then(data=>{if(data){if(data.status==="error"){sooMyOrders.showErrorAlert(data.message,"")}else{sooMyOrders.mooShowAddingItemResult(data)}}else{sooMyOrders.showErrorAlert("Item not added, try again","")}}).catch(err=>{sooMyOrders.showErrorAlert(err.message,"")})},clickOnOrderBtnFIWM:function(event,item_id,qty){event.preventDefault();var target=event.target;var old_text=$(target).text();$(target).text("Loading options");const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v1/items/"+item_id;sooMyOrders.sendGetRequest(url).then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).then(data=>{$(target).text(old_text);if(data&&data.modifier_groups){if(data.modifier_groups.length>0){if(typeof mooBuildModifiersPanel=="function"){mooBuildModifiersPanel(data.modifier_groups,item_id,qty)}else{sooMyOrders.showErrorAlert("Try again","Please refresh the page, An error has occurred","error")}}else{sooMyOrders.clickOnOrderBtn(event,item_id,qty)}}else{$(target).text(old_text);sooMyOrders.showErrorAlert("Error","We cannot load the options for this item, please refresh the page or contact us")}}).catch(err=>{$(target).text(old_text);sooMyOrders.showErrorAlert(err.message,"")})},openCustomQtyWindow:function(event,item_id,callback){Swal.fire({title:"Enter the quantity",input:"text",showCancelButton:true,showLoaderOnConfirm:true,preConfirm:function(value){if(value!==""&&parseInt(value)>0){callback(event,item_id,parseInt(value))}else{Swal.showValidationMessage("You need to write a valid number")}}})},openOrderDetails:function(uuid){const scrollPos=$(window).scrollTop();$("#moo_cp_content > div.sooListOfOrders").hide();$("#moo_cp_content > div.sooPagination").hide();$("#moo_cp_content > div.sooOrderDetails").show().html('<div class="mooLoadingSection"><i class="fas fa-spinner fa-spin"></i></div>');this.getOneOrder(uuid).then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).then(data=>{this.renderOrderDetails(data,uuid,scrollPos)}).catch(err=>{this.showErrorAlert(err.message,"")})},backToListOfOrders:function(scrollPos){$("#moo_cp_content > div.sooListOfOrders").show();$("#moo_cp_content > div.sooPagination").show();$("#moo_cp_content > div.sooOrderDetails").hide().html("");$(window).scrollTop(scrollPos||0)},clickOnReOrderBtn:function(order_uuid){Swal.fire({title:"Please wait",text:"We are checking the items",allowOutsideClick:true,showConfirmButton:false,showCancelButton:false}).then(function(){},function(dismiss){});this.getCart().then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).then(data=>{if(Object.keys(data.items).length>0){Swal.fire({title:`You already have ${Object.keys(data.items).length} items in your cart`,icon:"warning",text:"Would you like to add this order to the current item(s) already in the cart?",showCloseButton:true,showCancelButton:true,focusConfirm:true,confirmButtonText:"Yes",cancelButtonText:"No"}).then(value=>{if(value.isConfirmed){this.reOrder(order_uuid,true)}if(value.dismiss==="cancel"){this.reOrder(order_uuid,false)}console.log(value)})}else{this.reOrder(order_uuid,true)}}).catch(err=>{this.showErrorAlert(err.message,"")})},openLoyaltyDetails:function(){const settings=sooMyOrdersOptions.loyaltySetting;let pointsLabel="Points";if(!settings){this.showErrorAlert(mooObjectL10n.error,mooObjectL10n.anErrorOccurred);return}if(settings.label){pointsLabel=settings.label}let htmlDiv='<div class="soo-loyalty-conditions"><div class="moo-row"><div class="moo-col-md-12"><ul>';htmlDiv+=`<li>- Get $${this.formatPrice(settings.per_x_usd)} discount when redeeming ${settings.nb_points} ${pointsLabel}</li>`;if(settings.purchase_usd_value){if(settings.calc_method==="subtotal"){htmlDiv+=`<li>- Earn ${settings.purchase_usd_value} ${pointsLabel} for every dollar spent (based on Subtotal).</li>`}else{htmlDiv+=`<li>- Earn ${settings.purchase_usd_value} ${pointsLabel} for every dollar spent.</li>`}}else{htmlDiv+=`<li>- Earn ${settings.purchase_fixed_points} ${pointsLabel} on each order placed.</li>`}
11if(settings.order_source.website===false){htmlDiv+=`<li>- ${pointsLabel} not earned for purchases made through our website, try our Mobile App.</li>`}if(settings.max_points_per_order){htmlDiv+=`<li>- Maximum of ${settings.max_points_per_order} ${pointsLabel} can be earned per order.</li>`}if(settings.min_points_to_order){htmlDiv+=`<li>- Minimum requirement of ${settings.min_points_to_order} ${pointsLabel} should be used per order.</li>`}if(settings.min_amount_to_up){htmlDiv+=`<li>- Minimum order amount required to use ${pointsLabel} is $${this.formatPrice(settings.min_amount_to_up)}</li>`}htmlDiv+="</ul></div></div></div>";Swal.fire({imageUrl:null,title:"Loyalty Conditions",html:htmlDiv,showCancelButton:false,allowOutsideClick:true}).then(function(){setTimeout(p=>$(".sooLoyaltyDetailsButton").focus(),500)})},showErrorAlert:function(title,message,focusOnElem=null){if(focusOnElem){Swal.fire({title:title,text:message,icon:"error"}).then(function(){setTimeout(function(){$(focusOnElem).focus()},500)})}else{Swal.fire({title:title,text:message,icon:"error"})}},showSuccessAlert:function(title,message=null,focusOnElem=null){if(focusOnElem){Swal.fire(title,message,"success").then(function(){setTimeout(function(){$(focusOnElem).focus()},500)})}else{if(message){Swal.fire(title,message,"success")}else{Swal.fire(title,"","success")}}},onInputChange:function(elem){if(elem.value){$(elem).removeClass("moo-has-error");$(elem).parent().removeClass("moo-has-error");$(elem).next().hide()}},startSubmitingAform:function(form){form.data("submitted",true);form.find("button[type=submit]").html('<div class="dot-flashing"></div>');setTimeout(()=>{this.finishSubmitingAform(form)},3e4)},finishSubmitingAform:function(form){form.data("submitted",false);var button=form.find("button[type=submit]");button.html(button.attr("aria-label"))},cancelOnFlightRequests:function(){if(window.controller){window.controller.abort()}},getCart:function(){const url=sooMyOrdersOptions.restApiUrl+"moo-clover/v1/cart";return this.sendGetRequest(url)},reOrder:function(order_uuid,keepCart){Swal.fire({title:"Please wait",text:"We are creating your order",allowOutsideClick:false,showConfirmButton:false,showCancelButton:false}).then(function(){},function(dismiss){});const url=moo_RestUrl+"moo-clover/v1/customers/orders/"+order_uuid+"/reorder";const body={cart:keepCart?"keep":"empty"};this.sendPostRequest(url,body).then(response=>{if(!response.ok){throw new Error(mooObjectL10n.anErrorOccurred)}return response.json()}).then(data=>{if(data.status==="success"){Swal.fire({title:"Items added to your cart",text:"we are redirecting you to cart page, please wait",icon:"success"});setTimeout(function(){window.location.href=data.cart_url},2e3)}else{Swal.fire({title:"Error",text:data.message,icon:"error"})}}).catch(err=>{this.showErrorAlert(err.message,"")})},mooShowAddingItemResult:function(data){Swal.fire({title:data.name+" added to cart",text:"You can continue shopping from the list of featured items or proceed to checkout to finalize your order.",icon:"success",showCancelButton:true,confirmButtonColor:"#DD6B55",cancelButtonColor:"#6e7881",cancelButtonText:mooObjectL10n.continueShopping,confirmButtonText:mooObjectL10n.continueToCheckout}).then(value=>{console.log(value);if(value.isConfirmed){if(moo_params.checkoutPage){window.location.href=moo_params.checkoutPage}else{window.history.back()}}})}}});function mooShowAddingItemResult(data){sooMyOrders.mooShowAddingItemResult(data)}

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.