PageSourceSearch

https://voklaagyo.com/assets/js/front.bundle.js?version=1790261778

js voklaagyo.com collected 2026-09-24 14:57:17 UTC 392,600 bytes, 2,269 lines download raw bytes

1(function(p){"use strict";var A=[];var n={};var $={};var Y;var K;const c=8e4;const m={form:"application/x-www-form-urlencoded; charset=UTF-8",json:"application/json"};var L;const z=[{featureType:"administrative.country",elementType:"geometry",stylers:[{visibility:"off"}]}];const q=site_url+"/apilocations";const V="store";window.StoreMapName="Mapstore";var u=function(e){console.debug(e)};var U=function(e){alert(JSON.stringify(e))};var B=function(e,t){localStorage.setItem(e,t)};var J=function(e){return localStorage.getItem(e)};var G=function(e){localStorage.removeItem(e)};function i(e,t,a){let s=JSON.parse(localStorage.getItem(e));if(!s){s={}}s[t]=a;localStorage.setItem(e,JSON.stringify(s))}window.getFromLocalStorageStore=function(e,t){const a=JSON.parse(localStorage.getItem(e));return a?a[t]:undefined};function W(e,t){let a=JSON.parse(localStorage.getItem(e));if(!a){return}delete a[t];localStorage.setItem(e,JSON.stringify(a))}window.getLocation=function(){const e=getFromLocalStorageStore(V,"selectedCityId");const t=getFromLocalStorageStore(V,"selectedAreaId");const a=getFromLocalStorageStore(V,"selectedStateId");const s=getFromLocalStorageStore(V,"selectedPostalId");return{city_id:e,area_id:t,state_id:a,postal_id:s}};jQuery.fn.exists=function(){return this.length>0};window.empty=function(e){if(typeof e==="undefined"||e==null||e==""||e=="null"||e=="undefined"){return true}return false};jQuery(document).ready(function(){if(p(".sidebar-panel").exists()){p(".sidebar-panel").slideAndSwipe()}if(p(".headroom").exists()){var e=document.querySelector(".headroom");u(e);var t=new Headroom(e);t.init()}p(document).ready(function(){p(".dropdown").on("show.bs.dropdown",function(){p(this).find(".dropdown-menu").first().stop(true,true).slideDown(150)});p(".dropdown").on("hide.bs.dropdown",function(){p(this).find(".dropdown-menu").first().stop(true,true).slideUp(150)})});if(p(".star-rating").exists()){ne()}p(document).on("change","#min_range_slider",function(){p(".min-selected-range").html(p(this).val())});p(".collapse").on("show.bs.collapse",function(){p(this).parent().find("a").removeClass("closed").addClass("opened")}).on("hidden.bs.collapse",function(){p(this).parent().find("a").removeClass("opened").addClass("closed")});if(p(".sticky-sidebar").exists()){Y=new StickySidebar(".sticky-sidebar",{topSpacing:20})}if(p(".sticky-cart").exists()){K=new StickySidebar(".sticky-cart",{topSpacing:20})}p(".category-nav").sticky({topSpacing:0});p(".gallery_magnific").magnificPopup({delegate:"a",type:"image",gallery:{enabled:true},removalDelay:300,mainClass:"mfp-fade"});p(document).on("click",".toogle-radio",function(){var e=p(this).find("input");if(e.prop("checked")==false){e.prop("checked",true)}else{e.prop("checked",false)}});p(document).on("click",".desired_delivery",function(){ee(p(this).find("input").val(),{now:"hide",schedule:"show"},".schedule-section")});p(document).on("click",".a-account",function(){p(".login-wrap,.signup-wrap,.account-section").hide();p("."+p(this).data("id")).show()});p(document).on("click",".close-modal",function(){te(p(this).data("id"))});if(p(".auto_typehead").exists()){var r={};p(".auto_typehead").each(function(e,t){var a=p(this);var s=a.data("api");var i=a.data("display");var o=X(a.data("settings"));p.each(o,function(e,t){if(t=="true"){r[e]=true}else if(t=="false"){r[e]=false}else{r[e]=t}});r["input"]=a;r["source"]={user:{display:i.split(","),ajax:{method:"POST",url:ajaxurl+"/"+s,path:"details.data",data:{q:"{{query}}",YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")},beforeSend:function(e,t){u("before send");if(s=="getlocation_autocomplete"){if(p(".change-address-modal").exists()){p(".change-address-modal").find(".modal-content").addClass("opened")}}},callback:{done:function(e){return e},fail:function(e,t,a){},always:function(e,t,a){u("always")},then:function(e,t){}}}}};r["template"]=function(e,t){return a.data("template")};r["emptyTemplate"]=a.data("emptytemplate");r["callback"]={onClickAfter:function(e,t,a,s){var i=e.data("api");switch(i){case"getlocation_autocomplete":var o=Q();var r="id="+a.id+"&addressLine1="+a.addressLine1+"&addressLine2="+a.addressLine2;if(a.provider=="google.maps"){if(typeof a.place_type!=="undefined"&&a.place_type!==null){r+="&place_type="+a.place_type}}else if(a.provider=="mapbox"){if(typeof a.latitude!=="undefined"&&a.latitude!==null){r+="&latitude="+a.latitude;r+="&longitude="+a.longitude;r+="&place_type="+a.place_type}}r+="&services="+o;
1v("getLocationDetails",r,"typeahead_loader",1);break;case"getSearchSuggestion":window.location.href=a.url;break}},onCancel:function(e,t,a){if(s=="getlocation_autocomplete"){if(p(".change-address-modal").exists()){p(".change-address-modal").find(".modal-content").removeClass("opened")}}}};r["selector"]={list:"typeahead__list list-unstyled"};p.typeahead(r)})}p(document).on("click",".get_current_location",function(){H("get_place_details")});if(p(".load-ajax").exists()){p(".load-ajax").each(function(e,t){var a=p(t).data("action");var s=p(t).data("params");var i=p(t).data("loader_type");var o=p(t).data("single_call");var r=p(t).data("silent");var d=p(t).data("method");var l=p(t).data("content_type");var n=X(s);if(l=="json"){if(a=="getFeed"){var c=n.services;s={local_id:n.local_id,target:n.target,YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),filters:{services:c.split(",")}}}s=JSON.stringify(s)}v(a,s,i,o,r,d,l)})}p(document).on("click",".show-more",function(e){var t=p(this).data("action");var a=p(this).data("params");var s=p(this).data("loader_type");var i=p(this).data("single_call");var o=X(a);var r=o.filters;r=r.replace(/\\/g,"");r=JSON.parse(r);a={local_id:o.local_id,page:o.page,target:o.target,YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),filters:r};a=JSON.stringify(a);v(t,a,s,i,null,"PUT","json")});p(document).on("click",".restaurants-filter",function(e){var t=p("#local_id").val();var a=p("#target").val();var s="";var i=p(".sort:checked").val();var o=p(".price_range:checked").val();var r=p("#min_range_slider").val();var d=p(".ratings_selected").val();var l=[];var n=[];p(".services:checked").each(function(){l.push(p(this).val())});p(".cuisine:checked").each(function(){n.push(p(this).val())});if(typeof i!=="undefined"&&i!==null){}else i="";s={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),local_id:t,target:a,filters:{services:l,cuisine:n,price_range:o,max_fee:parseInt(r),ratings:parseInt(d),sort:i}};s=JSON.stringify(s);v("getFeed",s,"restaurants_filter",1,1,"PUT","json")});p(function(){ae()});p("#changeAddress").on("shown.bs.modal",function(e){p(".auto_typehead").val("");p(".auto_typehead").focus()});p("#changeAddress").on("hidden.bs.modal",function(e){p(".change-address-modal").find(".modal-content").removeClass("opened")});p(document).on("click",".get-item-details",function(e){var t=p(this).data("item_uuid");var a=p(this).closest("section").data("cat_id");v("getMenuItem","&merchant_id="+merchant_id+"&item_uuid="+t+"&cat_id="+a)});p(document).on("click",".choose-size",function(){var e=p(this).find("input:checked").val();if(typeof e!=="undefined"&&e!==null){pe(e)}});p(document).on("click",".addon-items",function(e){})});var Z=function(e){var t="";var a=parseInt(list_limit);u("$itemlimit=>"+a);for(let e=0;e<a;e++){t+='<div class="col-lg-3 col-md-3 mb-4 mb-lg-3">';t+='<div class="position-relative skeleton-height">';t+='<div class="skeleton-placeholder"></div>';t+="</div>";t+="</div>"}e.html(t)};var H=function(a){var e={enableHighAccuracy:true,timeout:5e3,maximumAge:0};if(navigator.geolocation){le("typeahead_loader",1);navigator.geolocation.getCurrentPosition(function(e){var t=Q();v("reverseGeocoding","lat="+e.coords.latitude+"&lng="+e.coords.longitude+"&services="+t+"&next_steps="+a,"typeahead_loader",1)},function(e){le("typeahead_loader",false);f(e.message)},e)}else{f(_("Error: Your browser doesn't support geolocation."));le("typeahead_loader",false)}};var Q=function(){var e="";if(p("#services").exists()){p("#services option:selected").each(function(){e+=p(this).val()+","})}return e};function X(e){if(typeof e!="string"||e.length==0)return{};var t=e.split("&");var a=t.length;var s,i={},o,r;for(var d=0;d<a;d++){s=t[d].split("=");o=decodeURIComponent(s[0]);if(o.length==0)continue;r=decodeURIComponent(s[1]);if(typeof i[o]=="undefined")i[o]=r;else if(i[o]instanceof Array)i[o].push(r);else i[o]=[i[o],r]}return i}var ee=function(a,e,s){p.each(e,function(e,t){u(e+"=>"+t+"=>"+a);if(a==e){if(t=="show"){p(s).show()}else{p(s).hide()}}})};var te=function(e){p("#"+e).modal("hide")};var ae=function(){L=p(".lazy").Lazy({chainable:false,beforeLoad:function(e){},afterLoad:function(e){e.parent().parent().addClass("image-loaded")},onError:function(e){},onFinishedAll:function(){}})};var h=function(){setTimeout(()=>{ae()},500)};var _=function(e){return e};const se=new Notyf({duration:1e3*4});var f=function(e,t){switch(t){case"error":se.error(e);break;default:se.success(e);break}};const ie=new Notyf({duration:1e4*6,dismissible:true,icon:""});var oe=function(e){ie.success(e)};var g=function(){var e=Date.now()+(Math.random()*1e5).toFixed();return e};window.addValidationRequest=function(){var e="";var t=p("meta[name=YII_CSRF_TOKEN]").attr("content");e+="&YII_CSRF_TOKEN="+t;return e};var v=function(e,t,a,s,i,o,r){var d=g();if(!empty(s)){d=s}if(empty(i)){i=null}var l="";if(empty(o)){o="POST"}if(empty(r)){l="application/x-www-form-urlencoded; charset=UTF-8";t+=addValidationRequest()}else{l="application/json"}n[d]=p.ajax({url:ajaxurl+"/"+e,method:o,data:t,dataType:"json",contentType:l,timeout:c,crossDomain:true,beforeSend:function(e){if(i==null){}else{le(a,true)}if(n[d]!=null){n[d].abort();clearTimeout($[d])}else{$[d]=setTimeout(function(){n[d].abort()},c)}}});n[d].done(function(e){var t="";if(typeof e.details!=="undefined"&&e.details!==null){if(typeof e.details.next_action!=="undefined"&&e.details.next_action!==null){t=e.details.next_action}}if(e.code==1){switch(t){case"redirect":window.location.href=e.details.redirect_url;break;case"get_place_details":var a=e.details.data;p(".auto_typehead").val(a.address.address1);var s="id="+a.place_id+"&addressLine1="+a.address.address1+"&addressLine2="+a.address.address2;if(e.details.provider=="google.maps"){if(typeof a.place_type!=="undefined"&&a.place_type!==null){s+="&place_type="+a.place_type}}else if(e.details.provider=="mapbox"){if(typeof a.latitude!=="undefined"&&a.latitude!==null){s+="&latitude="+a.latitude;s+="&longitude="+a.longitude;s+="&place_type="+a.place_type}}s+="&services="+e.details.services;
1v("getLocationDetails",s,"typeahead_loader",1);break;case"sidebar_filter":p(".sidenav-filter").html(e.details.data);p(".min-selected-range").html(p("#min_range_slider").val());ne();p("#moreCuisine").on("shown.bs.collapse",function(){p(".more-cuisine u").html(_("View less"))});p("#moreCuisine").on("hidden.bs.collapse",function(){p(".more-cuisine u").html(_("Show more +"))});break;case"fill_feed":re({action:e.details.action,title:e.details.total_message,data:e.details.data,target:e.details.target,append:e.details.append,show_next_page:e.details.show_next_page,next_page_data:e.details.next_page_data});break;case"merchant_menu":MerchantMenu({data:e.details.data});break;case"show_item_details":p("#itemModal").modal("show");he(e.details.data);break;case"fill_price_format":p(e.details.data.target).html(e.details.data.pretty_price);break}}else{switch(t){case"location_details_no_results":f(e.msg);p(".typeahead__container").removeClass("loading");break;case"clear_restaurant_results":var i=e.details.target;var o="";o+='<div class="list-items mt-4 row hover01 list-loader load-ajax"></div>';o+=e.details.data;p(i).html(o);break;default:f(e.msg);break}}});n[d].always(function(){le(a,false);n[d]=null;clearTimeout($[d])});n[d].fail(function(e,t){clearTimeout($[d])})};var re=function(e){var t="";var a="";var s;var i;var o="";var r=parseInt(e.append);var d=e.target;var l=e.show_next_page;t+='<h4 class="total_message title">';t+="<span>"+e.title+"</span>";t+='<div class="skeleton-placeholder"></div>';t+="</h4>";t+='<div class="list-items mt-4 row hover01 list-loader load-ajax">';p.each(e.data,function(e,t){a+='<div class="col-lg-3 col-md-3 mb-4 mb-lg-3">';a+='<a href="'+t.url+'">';a+='<div class="position-relative">';a+='<div class="skeleton-placeholder"></div>';a+='<figure><img class="rounded lazy" data-src="'+t.url_logo+'"/></figure>';a+='<h6 class="mt-2">'+t.restaurant_name+"</h6>";a+='<div class="row">';a+='<div class="col d-flex justify-content-start align-items-center"> ';a+='<p class="m-0"><i class="zmdi zmdi-time"></i> '+t.delivery_estimation+"</p>";a+="</div>";a+='<div class="col d-flex justify-content-end align-items-center">';if(t.delivery_fee_raw>0){a+='<p class="m-0"><i class="zmdi zmdi-car"></i> '+t.delivery_fee+"</p>"}a+="</div>";a+="</div>";a+='<div class="position-top">';if(typeof t.cuisine!=="undefined"&&t.cuisine!==null){if(t.cuisine.length>0){s=t.cuisine[0].bgcolor;i=t.cuisine[0].fncolor;a+='<span class="badge" style="background:'+s+";font-color:"+i+';">'+t.cuisine[0].cuisine_name+"</span>"}}a+='<span class="badge rounded-pill float-right" style="background:'+s+";font-color:"+i+';" >'+t.ratings+"</span>";a+="</div>";a+="</div>";a+="</a>";a+="</div>"});if(r<=0){t+=a}t+="</div>";if(l==true){u("SHOW NEXT");p.each(e.next_page_data,function(e,t){if(e=="filters"){o+="&filters="+de(JSON.stringify(t))}else o+=e+"="+t+"&"});u("ATTRIBUTES");u(o);t+='<div class="text-center show_more_section mt-5">';t+='<a href="javascript:;" class="btn btn-black  show-more" ';t+="data-action="+e.action+" data-params="+o;t+="\n";t+="data-loader_type="+"show_more"+' data-single_call="1"';t+='data-silent=""';t+=">"+_("Show more")+"</a>";t+='<div class="m-auto circle-loader medium" data-loader="circle-side"></div>';t+="</div>"}else{p(".show_more_section").hide()}if(r>0){p(".list-items").append(a)}else{p(d).html(t)}h()};var de=function(e){return(e+"").replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0")};var le=function(e,t){switch(e){case"getLocationDetails":case"typeahead_loader":if(t){p(".typeahead__container").addClass("loading")}else{setTimeout(function(){p(".typeahead__container").removeClass("loading")},1e3)}break;case"show_more":if(t){p(".show_more_section").addClass("loading")}else{p(".show_more_section").removeClass("loading")}break;case"results_loader":if(t){Z(p(".list-loader"))}else{}break;case"restaurants_filter":if(t){Z(p(".list-loader"));p(".restaurants-filter").addClass("loading");p(".total_message").addClass("loading");p(".show_more_section").hide()}else{p(".restaurants-filter").removeClass("loading");p(".total_message").removeClass("loading")}break;case"add_to_cart":if(t){p(".add_to_cart").addClass("loading")}else{p(".add_to_cart").removeClass("loading")}break;default:break}};var ne=function(){var _={};p(".star-rating").each(function(e,t){var a=p(this);var s=p(this).data("totalstars");var i=p(this).data("initialrating");var o=p(this).data("strokecolor");var r=p(this).data("ratedcolor");var d=parseInt(p(this).data("strokewidth"));var l=parseInt(p(this).data("starsize"));var n=p(this).data("readonly");var c=p(this).data("minrating");var m=p(this).data("disableafterrate");var u=p(this).data("usefullstars");var h=p(this).data("hovercolor");_["totalStars"]=!empty(s)?s:"";_["initialRating"]=!empty(i)?i:"";_["minRating"]=!empty(c)?c:"";_["strokeColor"]=!empty(o)?o:"";_["ratedColor"]=!empty(r)?r:"";_["hoverColor"]=!empty(h)?h:"";_["strokeWidth"]=!empty(d)?d:"";_["starSize"]=!empty(l)?l:"";_["readOnly"]=!empty(n)?n:"";_["disableAfterRate"]=m;_["useFullStars"]=!empty(u)?u:"";_["callback"]=function(e,t){t.parent().find(".ratings_selected").val(e);Va.$refs.ReviewRef.rating_value=e};p(this).starRating(_)})};var ce=function(){setTimeout(function(){Y.updateSticky()}
1,1)};var me=function(){setTimeout(function(){if(typeof K!=="undefined"&&K!==null){K.updateSticky()}},1)};var ue=function(e){p(".menu-left").removeClass("loading");p("#merchant-menu").removeClass("loading");var t=e.data.category;var a=e.data.items;Vue.createApp({data(){return e.data}}).mount("#menu-category");var s=[];var i=[];if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){i.push(a[t])});s.push({cat_id:t.cat_id,category_name:t.category_name,category_uiid:t.category_uiid,items:i});i=[]})}var s={category:s};Vue.createApp({data(){return s}}).mount("#merchant-menu");ce()};var r;var d;var l;var he=function(e){r=e.items;d=e.addons;l=e.addon_items;var t={items:r};if(typeof E!=="undefined"&&E!==null){E.$data.items=r;p("#item-details .lazy").attr("src",r.url_image)}else{E=Vue.createApp({data(){return t},created(){}}).mount("#item-details")}};var _e=function(e){var t=p("#itemModal .modal-body");r=e.items;d=e.addons;l=e.addon_items;var i="";i+='<div class="item_s" data-item_token="'+r.item_token+'" >';i+='<div class="list-items">';i+='<div class="position-relative">';i+='<div class="skeleton-placeholder"></div>';i+='<img class="rounded lazy" data-src="'+r.url_image+'"/>';
1i+="</div>";i+="</div>";i+="</div>";i+='<h4 class="m-0 mt-2 mb-2">'+r.item_name+"</h4>";if(!empty(r.item_description)){i+="<p>"+r.item_description+"</p>"}var a=0;if(typeof r.price!=="undefined"&&r.price!==null){a=Object.keys(r.price).length}if(a>0){i+='<div class="mb-4 btn-group btn-group-toggle input-group-small choose-size flex-wrap" data-toggle="buttons">';var o=1;p.each(r.price,function(e,t){var a=o==1?"active":"";var s=o==1?"checked='checked'":"";i+='<label class="btn '+a+' ">';i+='<input value="'+t.item_size_id+'" name="size_uuid" id="size_uuid" class="size_uuid" type="radio" '+s+"> ";if(t.discount<=0){i+=t.size_name+" "+t.pretty_price}else{i+=t.size_name+" <del>"+t.pretty_price+"</del> "+t.pretty_price_after_discount}i+="</label>";o++});i+="</div>"}i+='<div class="addon-list"></div>';t.html(i);i="";var s=p('input[name="size_uuid"]:checked').val();pe(s)};var pe=function(e){var i="";var t=p("#itemModal .addon-list");if(typeof r.item_addons!=="undefined"&&r.item_addons!==null){if(typeof r.item_addons[e]!=="undefined"&&r.item_addons[e]!==null){p.each(r.item_addons[e],function(e,a){if(typeof d[a]!=="undefined"&&d[a]!==null){var s={multi_option:d[a].multi_option,multi_option_value:d[a].multi_option_value,require_addon:d[a].require_addon,pre_selected:d[a].pre_selected,sub_items:d[a].sub_items};i+='<DIV class="addon-rows">';i+='<div class="d-flex align-items-center heads">';i+='<div class="flexcol flex-grow-1">';i+='<h5 class="m-0">'+d[a].subcategory_name+"</h5>";i+='<p class="text-grey m-0 mb-1">'+ge(s)+"</p>";i+="</div>";i+='<div class="flexcol">';i+='<h6 class="m-0">'+ve(d[a].require_addon)+"</h6>";i+="</div>";i+="</div>";var t=d[a].sub_items;if(t.length>0){i+='<ul class="list-unstyled list-selection list-addon no-hover m-0 p-0"';i+='data-subcat_id="'+a+'" ';i+='data-multi_option="'+s.multi_option+'" data-multi_option_value="'+s.multi_option_value+'" ';i+='data-require_addon="'+s.require_addon+'" data-pre_selected="'+s.pre_selected+'" ';i+=">";p.each(t,function(e,t){if(typeof l[t]!=="undefined"&&l[t]!==null){i+=fe(l[t],a,s)}});i+="</ul>"}i+="</DIV>"}})}}t.html(i);ItemSummary()};var fe=function(e,t,a){u("AddonItemsRows");u(a);var s=!empty(a.multi_option)?a.multi_option:"";var i=!empty(a.multi_option_value)?a.multi_option_value:"";u("multi_option=>"+s);u("multi_option_value=>"+i);var o="";o+='<li class="d-flex align-items-center" >';switch(s){case"custom":o+='<div class="custom-control custom-checkbox flex-grow-1">';o+='<input type="checkbox" id="sub_item_id'+e.sub_item_id+'" name="sub_item_id_'+t+'" value="'+e.sub_item_id+'" class="addon-items custom-control-input">';o+='<label class="custom-control-label font14 bold" for="sub_item_id'+e.sub_item_id+'">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+="</label>";o+="</div>";o+='<p class="m-0">+'+e.pretty_price+"</p>";break;case"multiple":o+='<div class="position-relative quantity-wrapper ">';o+='<div class="quantity-parent">';o+='<div class="quantity d-flex justify-content-between m-auto">';o+='<div><a href="javascript:;" class="rounded-pill qty-btn multiple_qty" data-id="less"><i class="zmdi zmdi-minus"></i></a></div>';o+='<div class="qty" data-id="'+e.sub_item_id+'">0</div>';o+='<div><a href="javascript:;" class="rounded-pill qty-btn multiple_qty" data-id="plus"><i class="zmdi zmdi-plus"></i></a></div>';o+="</div>";o+="</div> ";o+='<a href="javascript:;" class="btn quantity-add-cart multiple_qty">';o+='<i class="zmdi zmdi-plus"></i>';o+="</a>";o+="</div>";o+='<div class="flexcol ml-3">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+='<p class="m-0 text-grey">+'+e.pretty_price+"</p>";o+="</div>";break;default:o+='<div class="custom-control custom-radio flex-grow-1">';o+='<input type="radio" id="sub_item_id'+e.sub_item_id+'" name="sub_item_id_'+t+'" value="'+e.sub_item_id+'" class="addon-items custom-control-input">';o+='<label class="custom-control-label font14 bold" for="sub_item_id'+e.sub_item_id+'">';o+='<h6 class="m-0">'+e.sub_item_name+"</h6>";o+="</label>";o+="</div>";o+='<p class="m-0">+'+e.pretty_price+"</p>";break}o+="</li>";return o};var ge=function(e){var t="";var a=!empty(e.multi_option)?e.multi_option:"";var s=!empty(e.sub_items)?e.sub_items:"";var i=!empty(e.multi_option_value)?e.multi_option_value:"";switch(a){case"one":t=_("Select 1");break;case"multiple":t=_("Choose up to ")+i;break;case"two_flavor":t=_("Select flavor "+i);break;
1case"custom":t=_("Choose up to ")+i;break;default:break}return t};var ve=function(e){if(e>0){return _("Required")}else return _("Optional")};var y=0;var b=0;var ye=0;var t=0;var be="";var w=0;var we=0;var x;var S;var xe=0;var Se=[];var o=[];var Te=0;var ke=0;var Ie=function(){u("ItemSummary");w=0;y=0;ye=0;b=0;t=E.size_id;we=0;r=C;l=j;if(!empty(r.price[t])){if(r.price[t].discount>0){we=!empty(r.price[t])?parseFloat(r.price[t].price_after_discount):0}else we=!empty(r.price[t])?parseFloat(r.price[t].price):0}w+=we;var i=[];var o=[];p(".list-addon").each(function(e,t){x=p(t).attr("data-multi_option");Te=p(t).attr("data-require_addon");xe=p(t).attr("data-subcat_id");ke=p(t).attr("data-multi_option_value");if(x=="custom"||x=="one"){S=p(t).find(".addon-items:checked")}else if(x=="multiple"){S=p(t).find(".qty")}if(Te==1){o.push(xe)}if(ke>0){var a=p(t).find("input:checked");var s=a.length;if(s>=ke){p(t).find("input:checkbox:not(:checked)").attr("disabled",true)}else{p(t).find("input:disabled").attr("disabled",false)}}if(typeof S!=="undefined"&&S!==null){S.each(function(e,t){if(x=="multiple"){y=p(t).data("id");b=parseInt(p(t).html());ye=!empty(l[y])?parseFloat(l[y].price):0;w+=b*ye;if(b>0){i.push(xe)}}else{y=p(t).val();ye=!empty(l[y])?parseFloat(l[y].price):0;w+=ye;i.push(xe)}})}});u("REQUIRED");u(o);u(i);u("END REQUIRED");var a=true;if(o.length>0){p.each(o,function(e,t){if(i.includes(t)===false){a=false;return false}})}u("$required_meet=>"+a);if(a==false){p(".add_to_cart").attr("disabled",true)}else p(".add_to_cart").attr("disabled",false);v("priceFormat","price="+w+"&target=.item-summary","")};var Ce=function(){t=p('input[name="size_uuid"]:checked').val();be=p(".item_s").attr("data-item_token");y=0;b=0;ye=0;Se=[];o="";var s="";p(".list-addon").each(function(e,t){x=p(t).attr("data-multi_option");xe=p(t).attr("data-subcat_id");if(x=="custom"||x=="one"){S=p(t).find(".addon-items:checked")}else if(x=="multiple"){S=p(t).find(".qty")}var a=0;if(typeof S!=="undefined"&&S!==null){S.each(function(e,t){if(x=="multiple"){y=p(t).attr("data-id");b=parseInt(p(t).html());ye=!empty(j[y])?parseFloat(j[y].price):0}else{y=p(t).val();ye=!empty(j[y])?parseFloat(j[y].price):0;b=1}if(b>0){s+='{"sub_item_id":'+y+', "sub_item_qty":'+b+"},"}})}if(!empty(s)){s=s.slice(0,-1);o+='"'+xe+'":['+s+"],";s="";Se.push({subcat_id:xe,multi_option:x,multi_option_value:p(t).attr("data-multi_option_value")})}});o=o.slice(0,-1);o="{"+o+"}";o=JSON.parse(o);u(o);var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),item_token:be,item_size_id:t,addons_category:Se,addons_items:o};e=JSON.stringify(e);v("addCartItems",e,"add_to_cart",1,1,"PUT","json")};window.setCookie=function(e,t,a){const s=new Date;s.setTime(s.getTime()+a*24*60*60*1e3);let i="expires="+s.toUTCString();document.cookie=e+"="+t+";"+i+";path=/"};window.getCookie=function(e,t,a){let s=e+"=";let i=document.cookie.split(";");for(let t=0;t<i.length;t++){let e=i[t];while(e.charAt(0)==" "){e=e.substring(1)}if(e.indexOf(s)==0){return e.substring(s.length,e.length)}}return""};const Oe={props:["message","donnot_close"],data(){return{new_message:""}},methods:{show(){p("#loadingBox").modal("show")},close(){p("#loadingBox").modal("hide")},setMessage(e){this.new_message=e}},template:`
2	<div class="modal" id="loadingBox" tabindex="-1" role="dialog" aria-labelledby="loadingBox" aria-hidden="true"
3	data-backdrop="static" data-keyboard="false" 	 
4	 >
5	   <div class="modal-dialog modal-dialog-centered modal-loadingbox" role="document">
6	     <div class="modal-content">
7	         <div class="modal-body">
8	            <div class="loading mt-2">
9	              <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 
10	            </div>
11	            <p class="text-center mt-2">
12	              <div v-if="!new_message">{{message}}</div>
13	              <div v-if="new_message">{{new_message}}</div>
14	              <div>{{donnot_close}}</div>
15	            </p>	            
16	         </div>
17	       </div> <!--content-->
18	  </div> <!--dialog-->
19	</div> <!--modal-->      
20	`};const je={props:["title","label","next_url","auto_generate_uuid","enabled_auto_detect_address"],components:{"loading-box":Oe},data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],autosaved_addres:true}},created(){if(this.enabled_auto_detect_address){this.detectLocation()}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{detectLocation(){if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(s=>
20{if(s.data.code==1){let e={id:s.data.details.data.place_id,country:s.data.details.data.address.country,country_code:s.data.details.data.address.country_code};let t=JSON.parse(some_words);let a=t.we_detected;a=a.replace("{address}",s.data.details.data.address.formatted_address);ElementPlus.ElMessageBox.confirm(a,t.address_detected,{confirmButtonText:t.yes,cancelButtonText:t.no,type:"info"}).then(()=>{this.getLocationDetails(e)})["catch"](()=>{})}})["catch"](e=>{}).then(e=>{})},showList(){this.show_list=true},clearData(){this.data=[];this.q=""},getLocationDetails(e){this.show_list=false;var t;var a=3;t="id="+e.id;t+="&country="+e.country;t+="&country_code="+e.country_code;t+="&description="+e.description;t+="&autosaved_addres="+this.autosaved_addres;t+="&auto_generate_uuid="+this.auto_generate_uuid;t+="&cart_uuid="+getCookie("cart_uuid");t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/getLocationDetails",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.awaitingSearch=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.q=e.details.data.address.formatted_address;if(this.auto_generate_uuid==true||this.auto_generate_uuid=="true"){setCookie("cart_uuid",e.details.cart_uuid,30)}window.location.href=this.next_url}else{this.error[0]=e.msg}});n[a].always(e=>{this.awaitingSearch=false})}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:`	
21	<loading-box ref="loading_box" message="Getting address" donnot_close="do not close this window" ></loading-box>
22	<div class="position-relative search-geocomplete"> 	
23	   <div v-if="!awaitingSearch" class="img-20 m-auto pin_placeholder icon"></div>
24	   <div v-if="awaitingSearch" class="icon" data-loader="circle"></div>    
25	   	   
26	   <input @click="showList" v-model="q" class="form-control form-control-text" 
27	   :placeholder="label.enter_address" >
28	   
29	   <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div>
30	   <div v-if="!hasData" class="search_placeholder pos-right img-20"></div>
31	  </div>
32	
33	   <div class="search-geocomplete-results" v-if="show_list">		      
34	    <ul class="list-unstyled m-0 border">
35	     <li v-for="items in data">			      
36	      <a href="javascript:;"  @click="getLocationDetails(items)" >
37	       <h6 class="m-0">{{items.addressLine1}}</h6>
38	       <p class="m-0 text-grey">{{items.addressLine2}}</p>
39	      </a>
40	     </li>	     
41	    </ul>
42   </div>
43	`};const Ee={props:["label","addresses","location_data","saveplace"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],autosaved_addres:true,is_fullwidth:false,visible:false}},mounted(){if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile){this.is_fullwidth=true}}},computed:{hasAddress(){if(!empty(this.addresses)){if(Object.keys(this.addresses).length>0){return true}}return false},hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},showModal(){this.visible=true},closeModal(){this.visible=false;this.$emit("afterClose")},close(){this.visible=false},getLocationDetails(e){const t=e?.provider??null;console.debug("provider",t);console.debug("getLocationDetails",e);this.show_list=false;var a;var s=3;if(t=="mapbox"){a="id="+`${e.longitude},${e.latitude}`}else{a="id="+e.id}a+="&country="+e.country;a+="&country_code="+e.country_code;a+="&autosaved_addres="+this.autosaved_addres;a+="&saveplace="+this.saveplace;a+="&description="+e.description;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/getLocationDetails",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.awaitingSearch=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.q="";this.closeModal();this.$emit("setLocation",e.details.data)}else{this.error[0]=e.msg}});n[s].always(e=>{this.awaitingSearch=false})},setPlaceID(e){var t;var a=4;t="place_id="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/setPlaceID",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$emit("setPlaceid")}else{this.error[0]=e.msg}});n[a].always(e=>{})},editAddress(e){this.$emit("setEdit",e)},deleteAddress(e){var t;var a=5;t="address_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/deleteAddress",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$emit("loadData");this.$emit("afterDelete",e)}
43else{this.error[0]=e.msg}});n[a].always(e=>{})},locateLocation(){this.awaitingSearch=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{this.awaitingSearch=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.awaitingSearch=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(t=>{if(t.data.code==1){let e=[];e.id=t.data.details.data.place_id;e.country=t.data.details.data.address.country;e.country_code=t.data.details.data.address.country_code;this.getLocationDetails(e)}else{ElementPlus.ElNotification({title:"",message:t.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false})},searchLocation(e,t){let a=[];axios({method:"POST",url:ajaxurl+"/getlocationAutocomplete",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){a=e.data.details.data}else{a=[]}t(a)})["catch"](e=>{}).then(e=>{})}},template:`	  	 
44	<el-dialog v-model="visible" :close-on-click-modal="false" :show-close="true" :title="label.title"  >
45	
46	   <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
47	     <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
48       </div> 
49
50	   <div class="position-relative search-geocomplete" v-loading="awaitingSearch" > 
51			<el-autocomplete
52				v-model="q"				
53				:placeholder="label.enter_address"				
54				size="large"
55				class="w-100"
56				:trigger-on-focus="false"
57				value-key="description"
58				:fit-input-width="is_fullwidth"
59				clearable
60				:fetch-suggestions="searchLocation"				
61				@select="getLocationDetails"
62			>
63			<template #suffix>
64				<button @click="locateLocation" type="button" class="btn btn-link">
65				<i class="zmdi zmdi-my-location font20" style="color:#000;"></i>
66				</button>
67			</template>			
68			</el-autocomplete>
69	   </div>
70
71	   <template v-if="hasAddress">
72	    <div class="p-2"></div>
73		<el-scrollbar max-height="200px" class="w-100">
74			<ul class="m-0 list-unstyled w-100 list-with-icon-button" >
75				<li v-for="valadd in addresses" class="row align-items-center no-gutters" >	 
76													
77				<div class="col-1" @click="setPlaceID(valadd.place_id)" ><i class="zmdi zmdi-pin icon-25"></i></div>
78				<div class="col-9" @click="setPlaceID(valadd.place_id)" >
79					<h5 class="m-0">{{valadd.address.complete_delivery_address}}</h5>					
80				</div>
81							
82				<div class="col-2 ">	           
83					<div class="float-right">
84					<a href="javascript:;" @click="editAddress(valadd)" class="rounded-pill rounded-button-icon d-inline-block mr-2">
85					<i class="zmdi zmdi-edit"></i>
86					</a>
87					
88					<a href="javascript:;" v-if="location_data.address_uuid != valadd.address_uuid " @click="deleteAddress(valadd.address_uuid)" 
89					class="rounded-pill rounded-button-icon d-inline-block">
90					<i class="zmdi zmdi-close"></i>
91					</a>
92					
93					</div>	          
94				</div>
95				</li>	        	      	       
96			</ul> 
97		</el-scrollbar>
98		</template>
99
100	</el-dialog>
101	`};const Pe={props:["label","set_place_id","cmaps_config"],data(){return{data:[],is_loading:false,error:[],cmaps:undefined,cmaps_full:false,location_name:"",delivery_options:"",address_label:"",delivery_instructions:"",delivery_options_data:[],address_label_data:[],address1:"",formatted_address:"",new_coordinates:[],inline_edit:false,address2:"",postal_code:"",company:"",custom_field_enabled:false,custom_field1:"",custom_field2:"",custom_field1_data:[],formattedAddress:null}},mounted(){autosize(document.getElementById("delivery_instructions"));this.getAddressAttributes()},computed:{DataValid(){if(Object.keys(this.data).length>0){return true}return false},DataValidNew(){if(Object.keys(this.new_coordinates).length>0){return true}return false}},methods:{show(e){this.cmaps_full=false;this.getAdddress(e);p(this.$refs.modal_address).modal("show")},clearForms(){this.data=[];this.location_name="";this.delivery_options="";this.address_label="";this.delivery_instructions="";this.address1="";this.formatted_address="";this.address2="";this.postal_code="";this.company=""},showWithData(e){console.debug("showWithData",e);this.clearForms();p(this.$refs.modal_address).modal("show");this.data=e;this.address1=e?.parsed_address.street_number??e.address.address1;this.formatted_address=e?.parsed_address.street_name??e.address.formatted_address;this.formattedAddress=e?.parsed_address?.formatted_address??"";console.debug("this.formattedAddress",this.formattedAddress);this.loadMap()},close(){p(this.$refs.modal_address).modal("hide")},closeModal(){p(this.$refs.modal_address).modal("hide");this.$emit("afterClose")},getAddressAttributes(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddressAttributes",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.delivery_options_data=e.details.delivery_option;this.address_label_data=e.details.address_label;this.delivery_options=e.details.default_atts.delivery_options;this.address_label=e.details.default_atts.address_label;this.custom_field_enabled=e.details.custom_field_enabled;this.custom_field1_data=e.details.custom_field1_data;this.custom_field1=Object.keys(this.custom_field1_data)[0]}else{this.delivery_options_data=[];this.address_label_data=[];this.delivery_options="";this.address_label="";this.custom_field1_data=[];this.custom_field_enabled=false}});n[t].always(e=>{this.is_loading=false})},getAdddress(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/getAdddress",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.location_name=e.details.data.attributes.location_name;this.delivery_options=e.details.data.attributes.delivery_options;this.address_label=e.details.data.attributes.address_label;this.delivery_instructions=e.details.data.attributes.delivery_instructions;this.address1=e.details.data.address.address1;this.formatted_address=e.details.data.address.formatted_address;this.formattedAddress=e?.details?.data?.address?.formattedAddress??this.formatted_address;this.address2=e.details.data.address.address2;this.postal_code=e.details.data.address.postal_code;this.company=e.details.data.address.company;this.custom_field1=e.details.data.attributes.custom_field1;this.custom_field2=e.details.data.attributes.custom_field2;this.loadMap()}else{this.clearForms()}});n[a].always(e=>{this.is_loading=false})},loadMap(){this.renderMap()},renderMap(){switch(this.cmaps_config.provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{u("render map here");this.cmaps=new google.maps.Map(this.$refs.cmaps,{center:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true})}this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break;
101case"yandex":this.initYandexAddress();break}},async initYandexAddress(){console.debug("initYandexAddress");await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:t,YMapMarker:a,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};if(T){T.destroy();T=null}if(!T){T=new e(this.$refs.cmaps,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);P=new r({coordinates:n.center});T.addChild(P)}},addMarker(t){switch(this.cmaps_config.provider){case"google.maps":P=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}P=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){switch(this.cmaps_config.provider){case"google.maps":P.setMap(null);break;case"mapbox":u("remove marker");P.remove();break}},adjustPin(){console.debug("adjustPin");this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:this.cmaps_config.provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_config.provider=="google.maps"){P.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_config.provider=="mapbox"){P.on("dragend",e=>{const t=P.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}else if(this.cmaps_config.provider=="yandex"){const t={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};P.update({coordinates:t.center,draggable:true,onDragEnd:e=>{this.new_coordinates={lat:e[1],lng:e[0]}}})}},mapBoxResize(){if(this.cmaps_config.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},cancelPin(){this.error=[];this.cmaps_full=false;if(this.cmaps_config.provider=="yandex"){const e={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};P.update({coordinates:e.center,draggable:false})}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps,animation:this.cmaps_config.provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}},setNewCoordinates(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),lat:this.data.latitude,lng:this.data.longitude,new_lat:this.new_coordinates.lat,new_lng:this.new_coordinates.lng};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutValidateCoordinates",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data.latitude=this.new_coordinates.lat;this.data.longitude=this.new_coordinates.lng;this.cmaps_full=false;if(this.cmaps_config.provider=="yandex"){}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},map:this.cmaps})}}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:this.data.address_uuid,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,latitude:this.data.latitude,longitude:this.data.longitude,address1:this.address1,formatted_address:this.formatted_address,formattedAddress:this.formattedAddress,set_place_id:this.set_place_id,address2:this.address2,postal_code:this.postal_code,company:this.company,data:this.data,address_format_use:this.cmaps_config.address_format_use,custom_field1:this.custom_field1,custom_field2:this.custom_field2};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/SaveAddress",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.close();this.$emit("afterSave",true)}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},ConfirmDelete(t){D.confirm().then(e=>{if(e){this.deleteAddress(t)}})},deleteAddress(e){var t;var a=5;t="address_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/deleteAddress",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.close();this.$emit("afterDelete",true)}else{this.error[0]=e.msg}});n[a].always(e=>{})}},template:`
102	   <div class="modal" ref="modal_address" id="ModalAddress" tabindex="-1" role="dialog" 
103    aria-labelledby="ModalAddress" aria-hidden="true" data-backdrop="static" data-keyboard="false"  >
104	   <div class="modal-dialog modal-lg" role="document">
105	     <div class="modal-content"> 
106
107		  <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;">
108			<h5 class="modal-title">{{label.title}}</h5>        
109		 	<a href="javascript:;" @click="closeModal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>
110		  </div>
111
112	       <div class="modal-body" >
113	       			   	       
114		   <template v-if="cmaps_config.provider=='mapbox'">      
115				<div  :class="{ 'map-large': cmaps_full, 'map-small': !cmaps_full }"  >
116					<div ref="cmaps" id="cmaps" style="height:100%; width:100%;"></div>
117				</div>	   
118			</template>
119			<template v-else>			
120			    <div ref="cmaps" id="cmaps" :class="{ 'map-large': cmaps_full, 'map-small': !cmaps_full }"></div>	   
121			</template>
122	       
123	       <template v-if="!cmaps_full">
124	       	       
125	        <div class="row mt-3" >
126		     <div class="col">
127		       <h5 class="m-0">
128			   {{formattedAddress}}
129			   </h5>			   
130		     </div>
131		     <div class="col text-right">
132		       <button class="btn small btn-black" @click="adjustPin" :disabled="!DataValid" >{{label.adjust_pin}}</button>
133		     </div>
134		   </div>
135		    <!--row-->				   
136		    
137		   <div class="forms mt-3 mb-2">		  
138				   		   	   
139		   
140		   
141		   <template v-if="cmaps_config.address_format_use==2">
142		        
143		        <div class="row">
144				  <div class="col">
145						<div class="form-label-group">
146							<input v-model="formatted_address" class="form-control form-control-text" placeholder="" id="formatted_address" type="text">
147							<label for="formatted_address">
148							{{label.street_name}} ({{label.mandatory}})
149							</label>
150						</div>
151				  </div>
152				  <div class="col">
153				        <div class="form-label-group">
154							<input v-model="address1" class="form-control form-control-text" placeholder="" id="address1" type="text">
155							<label for="address1">
156							{{label.street_number}} ({{label.mandatory}})
157							</label>
158						</div>						
159				  </div>
160			   </div>
161							
162			   <div class="row">
163				  <div class="col">
164				    <div class="form-label-group">
165						<input v-model="location_name" class="form-control form-control-text" placeholder="" id="location_name" type="text">
166						<label for="location_name">
167						{{label.entrance}}
168						</label>
169					</div>
170				  </div>
171				  <div class="col">
172				    <div class="form-label-group">
173						<input v-model="address2" class="form-control form-control-text" placeholder="" id="address2" type="text">
174						<label for="address2">
175						{{label.floor}}
176						</label>
177					</div>				  
178				  </div>
179			   </div>
180
181							
182			  <div class="row">
183				 <div class="col">
184
185				   <div class="form-label-group">
186						<input v-model="postal_code" class="form-control form-control-text" placeholder="" id="postal_code" type="text">
187						<label for="postal_code">
188						{{label.door}} ({{label.mandatory}})
189						</label>
190					</div>			
191				 
192				 </div>
193				 <div class="col">
194
195					<div class="form-label-group">
196						<input v-model="company" class="form-control form-control-text" placeholder="" id="company" type="text">
197						<label for="company">
198						{{label.company}}
199						</label>
200					</div>		
201				 
202				 </div>
203			  </div>
204											
205		   
206		   </template>
207		   <template v-else>
208
209			<div class="form-label-group">
210				<input v-model="formatted_address" class="form-control form-control-text" placeholder="" id="formatted_address" type="text">
211					<label for="formatted_address">
212					{{label.street_name}}
213					</label>
214				</div>
215
216				<div class="form-label-group">
217				<input v-model="address1" class="form-control form-control-text" placeholder="" id="address1" type="text">
218				<label for="address1">
219				{{label.street_number}}
220				</label>
221				</div>
222			
223				<div class="form-label-group">    
224				<input class="form-control form-control-text" v-model="location_name"
225				id="location_name" type="text" >   
226				<label for="location_name">{{label.location_name}}</label> 
227				</div>   
228
229			</template>
230	        	        
231	        <h5 class="m-0 mt-2 mb-2">{{label.delivery_options}}</h5>       
232	        <select class="form-control custom-select" v-model="delivery_options">		 
233	         <option v-for="(items, key) in delivery_options_data" :value="key" >{{items}}</option>      
234		    </select>  
235		    
236			     
237			<h5 class="m-0 mt-2 mb-2">{{label.delivery_instructions}}</h5>      
238			<div class="form-label-group">    
239			<textarea id="delivery_instructions" 
240			style="max-height:150px;" v-model="delivery_instructions"  class="form-control form-control-text font13" 
241					:placeholder="label.notes">
242			</textarea>       
243			</div>  
244			
245			<template v-if="custom_field_enabled">			    
246				<div class="d-flex align-items-center">
247				  <div class="mr-2"><h5 class="m-0 mt-2 mb-2">{{label.custom_field1}}</h5></div>
248				  <div>				 
249				  <el-tooltip placement="top" :content="label.custom_field1_info">				
250					<el-button link type="plain">
251					 <i class="zmdi zmdi-info font20"></i>
252					</el-button>
253				  </el-tooltip>				  
254				  </div>
255				</div>
256
257				<select class="form-control custom-select" v-model="custom_field1">		 
258				<option v-for="(items, key) in custom_field1_data" :value="key" >{{items}}</option>      
259				</select> 
260				
261				<div class="d-flex align-items-center">
262				  <div class="m-0 mt-2 mb-2"><h5 class="m-0 mt-2 mb-2">{{label.custom_field2}}</h5></div>
263				  <div>				 
264				  <el-tooltip placement="top" :content="label.custom_field2_info">				
265					<el-button link type="plain">
266					 <i class="zmdi zmdi-info font20"></i>
267					</el-button>
268				  </el-tooltip>				  
269				  </div>
270				</div>
271
272				<div class="form-label-group">    
273				<textarea id="delivery_instructions" 
274				style="max-height:150px;" v-model="custom_field2"  class="form-control form-control-text font13" >
275				</textarea>       
276				</div>  
277			</template>
278
279			<div class="mb-1 mt-1"></div>
280		      
281		    <p>{{label.address_label}}</p>  
282		    <div class="btn-group btn-group-toggle input-group-small mb-4" >
283	           <label class="btn" v-for="(items, key) in address_label_data" :class="{ active: address_label==key }" >
284	             <input v-model="address_label" type="radio" :value="key" > 
285	             {{ items }}
286	           </label>           
287	        </div>
288		    <!--btn-group-->   
289		   
290		   </div> <!--forms--> 
291	   
292		   </template>
293		   
294		   <div id="error_message"  v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
295	         <p v-for="err in error" class="m-0">{{err}}</p>	    
296	       </div>   
297	           	   
298	        
299	       </div> <!--modal-body-->
300	       
301	       
302	       <div class="modal-footer justify-content-start">
303      
304       <template v-if="!cmaps_full">
305	       <div class="border flex-fill">
306	           <button class="btn btn-black w-100" @click="closeModal" >
307		          {{label.cancel}}
308		       </button>
309	       </div>
310	       <div class="border flex-fill">
311	           <button class="btn btn-green w-100" @click="save" :class="{ loading: is_loading }" :disabled="!DataValid"  >
312		          <span class="label">{{label.save}}</span>
313		          <div class="m-auto circle-loader" data-loader="circle-side"></div>
314		       </button>
315	       </div>
316	       </template>
317	       
318	       <template v-else-if="cmaps_full">
319	        <div class="border flex-fill">
320	           <button class="btn btn-black w-100" @click="cancelPin" >
321		          {{label.cancel}}
322		       </button>
323	       </div>       
324	       <div class="border flex-fill">		   
325	           <button class="btn btn-green w-100" @click="setNewCoordinates" 
326	           :class="{ loading: is_loading }" :disabled="!DataValidNew" >
327		          <span class="label">{{label.save}}</span>
328		          <div class="m-auto circle-loader" data-loader="circle-side"></div>
329		       </button>
330	       </div>
331       </template>
332       
333	   </div> <!--content-->
334	  </div> <!--dialog-->
335	</div> <!--modal-->
336	`};const Fe={beforeMount:(t,a)=>{t.clickOutsideEvent=e=>{if(!(t==e.target||t.contains(e.target))){a.value()}};document.addEventListener("click",t.clickOutsideEvent)},unmounted:e=>{document.removeEventListener("click",e.clickOutsideEvent)}};const Ne={props:["title","label"],data(){return{transaction_list:[],transaction:"",loading:false,charge_type:"",estimation:[]}},mounted(){this.getMerchantServices()},methods:{getMerchantServices(){var e;var t=g();e="merchant_id="+merchant_id;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/servicesList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){this.loading=false;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_list=e.details.data;this.transaction=e.details.transaction;this.charge_type=e.details.charge_type;this.estimation=e.details.estimation}else{this.transaction_list=[];this.transaction="";this.charge_type="";this.estimation=[]}});n[t].always(e=>{this.loading=false})},doUpdateService(e){this.transaction=e;this.updateService()},updateService(){axios({method:"POST",url:ajaxurl+"/updateService",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+this.transaction+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){setCookie("cart_transaction_type",this.transaction,30);
336setCookie("cart_uuid",e.data.details.cart_uuid,30)}if(typeof M!=="undefined"&&M!==null){M.addressNeeded()}})["catch"](e=>{}).then(e=>{this.$emit("afterUpdate",this.transaction)})}},template:` 				
337	<div class="btn-group-rounded btn-group btn-group-toggle" >
338	  <label class="btn d-flex"
339	   v-for="trans in transaction_list" :class="{ active: transaction==trans.service_code }" >
340	     <input type="radio" :value="trans.service_code" v-model="transaction" @click="doUpdateService(trans.service_code)" > 
341	       <div class="align-self-center">
342	         <div class="bold">{{ trans.service_name }}</div>
343	         
344	         <template v-if="estimation[trans.service_code]">
345	           <template v-for="(item,index) in estimation[trans.service_code] ">
346	           
347	             <template v-if="trans.service_code=='delivery'">
348		             <template v-if="item.charge_type==charge_type">	              
349		              <p class="m-0">{{item.estimation}} {{label.min}}</p>
350		             </template>
351	             </template>
352	             <template v-else> 
353	                 <template v-if="item.charge_type=='fixed'">	              
354		              <p class="m-0">{{item.estimation}} {{label.min}}</p>
355		             </template>
356	             </template>
357	             
358	           </template>
359	         </template>
360	         
361	       </div>
362	   </label>           
363	</div> 
364	`};const Re={props:["sitekey","size","theme","is_enabled","captcha_lang"],data(){return{recaptcha:null}},mounted(){if(this.is_enabled==1||this.is_enabled=="true"||this.is_enabled==true){this.initCapcha()}},methods:{initCapcha(){if(window.grecaptcha==null){new Promise(e=>{window.recaptchaReady=function(){e()};const t=window.document;const a="recaptcha-script";const s=t.createElement("script");s.id=a;s.setAttribute("src","https://www.google.com/recaptcha/api.js?onload=recaptchaReady&render=explicit&hl="+this.captcha_lang);t.head.appendChild(s)}).then(()=>{this.renderRecaptcha()})}else{this.renderRecaptcha()}},renderRecaptcha(){this.recaptcha=grecaptcha.render(this.$refs.recaptcha_target,{sitekey:this.sitekey,theme:this.theme,size:this.size,tabindex:this.tabindex,callback:e=>this.$emit("verify",e),"expired-callback":()=>this.$emit("expire"),"error-callback":()=>this.$emit("fail")})},reset(){grecaptcha.reset(this.recaptcha)}},template:`	
365    <div class="mb-2 mt-2" ref="recaptcha_target"></div>
366    `};const e={props:["label","mobile_number","mobile_prefix","default_country","only_countries"],emits:["update:mobile_number","update:mobile_prefix"],data(){return{data:[],country_flag:""}},updated(){},mounted(){this.getLocationCountries()},methods:{getLocationCountries(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),default_country:this.default_country,only_countries:this.only_countries};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getLocationCountries",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.country_flag=e.details.default_data.flag;this.$emit("update:mobile_prefix",e.details.default_data.phonecode)}else{this.data=[];this.country_flag="";this.mobile_prefix=""}});n[t].always(e=>{})},setValue(e){this.country_flag=e.flag;this.$emit("update:mobile_prefix",e.phonecode);this.$refs.ref_mobile_number.focus()}},template:`					
367	 <div class="inputs-with-dropdown d-flex align-items-center mb-3" >
368	    <div class="dropdown">
369		  <button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
370		    <img v-if="country_flag" :src="country_flag">
371		  </button>
372		  <div class="dropdown-menu" >		    
373		    <a v-for="item in data" @click="setValue(item)"
374		    href="javascript:;"  class="dropdown-item d-flex align-items-center">
375		      <div class="mr-2">
376		        <img :src="item.flag">
377		      </div>
378		      <div>{{item.country_name}}</div>
379		    </a>		    
380		  </div>
381		</div> <!--dropdown-->
382		
383		<div class="mr-0 ml-1" v-if="mobile_prefix">+{{mobile_prefix}}</div>
384		<input type="text"  v-maska="'###################'"  ref="ref_mobile_number"
385		:value="mobile_number" @input="$emit('update:mobile_number', $event.target.value)" >
386		
387	</div> <!--inputs-->
388	`};const De={props:["label","size"],methods:{confirm(){bootbox.confirm({size:this.size,title:this.label.confirm,message:this.label.are_you_sure,centerVertical:true,animate:false,buttons:{cancel:{label:this.label.cancel,className:"btn btn-black small pl-4 pr-4"},confirm:{label:this.label.yes,className:"btn btn-green small pl-4 pr-4"}},callback:e=>{this.$emit("callback",e)}})},alert(e,t){bootbox.alert({size:!empty(t.size)?t.size:"",closeButton:false,message:e,animate:false,centerVertical:true,buttons:{ok:{label:this.label.ok,className:"btn btn-green small pl-4 pr-4"}}})}}};var Me,Ae,$e;
388const Ye={components:{"star-rating":VueStarRating["default"]},props:["label","accepted_files","max_file"],data(){return{upload_images:[],required_message:[],rating_value:"",review_content:"",as_anonymous:false,order_uuid:"",is_loading:false,error:[],is_reset:false}},mounted(){Me=new Tagify(document.querySelector(".tags_like"));Ae=new Tagify(document.querySelector(".tags_not_like"));autosize(document.getElementById("review_content"));this.initDropZone(this.label,this)},methods:{show(){p("#reviewModal").modal("show")},close(){p(this.$refs.review_modal).modal("hide");Dropzone.forElement("#dropzone_multiple").removeAllFiles(true)},reset(){Dropzone.forElement("#dropzone_multiple").files=[];p(".dz-preview").remove();p(".dropzone").removeClass("dz-started");this.upload_images=[];this.rating_value="";this.review_content="";this.as_anonymous=false;this.order_uuid="";this.error=[];Me.removeAllTags();Ae.removeAllTags()},initDropZone(t,i){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};Dropzone.autoDiscover=false;$e=p("#dropzone_multiple").dropzone({dictDefaultMessage:t.dictDefaultMessage,dictFallbackMessage:t.dictFallbackMessage,dictFallbackText:t.dictFallbackText,dictFileTooBig:t.dictFileTooBig,dictInvalidFileType:t.dictInvalidFileType,dictResponseError:t.dictResponseError,dictCancelUpload:t.dictCancelUpload,dictCancelUploadConfirmation:t.dictCancelUploadConfirmation,dictRemoveFile:t.dictRemoveFile,dictMaxFilesExceeded:t.dictMaxFilesExceeded,paramName:"file",url:ajaxurl+"/uploadReview",params:e,addRemoveLinks:true,maxFiles:parseInt(this.max_file),acceptedFiles:this.accepted_files,autoProcessQueue:true,init:function(){var s=this;s.on("maxfilesexceeded",function(e){f(t.max_file_exceeded,"error");s.removeFile(e)});s.on("removedfile",function(e){u("removedfile");i.removeUpload(e.upload_uuid)});s.on("success",(e,t)=>{u(t);var a=t;if(a.code==1){e.upload_uuid=a.details.id;i.upload_images.push(a.details)}else{var a=JSON.parse(t);f(a.msg,"error");s.removeFile(e)}});s.on("addedfile",function(){u("addedfile")})}})},removeUpload(i){return new Promise((t,e)=>{var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:i};var s=g();n[s]=p.ajax({url:ajaxurl+"/removeReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[s]!=null){n[s].abort();this.is_loading=false}}});n[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});n[s].always(e=>{this.is_loading=false})})},remove(a){if(this.upload_images){this.upload_images.forEach((e,t)=>{if(e.id==a){u("index remove=>"+t);this.upload_images.splice(t,1)}})}},getTag(e){var a=[];if(e){e.forEach((e,t)=>{a.push(e.value)})}return a},addReview(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid,review_content:this.review_content,rating_value:this.rating_value,as_anonymous:this.as_anonymous,tags_like:this.getTag(Me.value),tags_not_like:this.getTag(Ae.value),upload_images:this.upload_images};var t=1;n[t]=p.ajax({url:ajaxurl+"/addReview",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort();this.is_loading=false}}});n[t].done(e=>{u(e);if(e.code==1){f(e.msg);this.reset();p(this.$refs.review_modal).modal("hide");this.$emit("afterAddreview")}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});n[t].always(e=>{this.is_loading=false})},deleteAllImages(){if(this.upload_images.length<=0){return false}var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),upload_images:this.upload_images};var t=g();n[t]=p.ajax({url:ajaxurl+"/removeAllReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.upload_images=[];Dropzone.forElement("#dropzone_multiple").removeAllFiles(true)}})}},template:`
389  <div class="modal" ref="review_modal" id="reviewModal" tabindex="-1" role="dialog" aria-labelledby="reviewModal" aria-hidden="true"  data-backdrop="static" data-keyboard="false" >
390       <div class="modal-dialog modal-dialog-centered" role="document">
391       <div class="modal-content">     
392                
393        	      
394          <div class="modal-body" >    
395          
396          <a href="javascript:;" @click="close" 
397	        class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 
398          
399          <h4 class="bold m-0 mb-3 mt-3">{{label.write_review}}</h4> 	 
400                              	     	    
401	     <star-rating  
402         v-model:rating="rating_value"
403		 :star-size="30"
404		 :show-rating="false" 
405		 @update:rating="rating_value = $event"
406		 >
407		 </star-rating>	      	    		
408	       
409	     <h5 class="m-0 mt-3 mb-2">{{label.what_did_you_like}}</h5>     
410	     <input type="text" name="tags_like" class="tags_like" id="tags_like" :placeholder="label.search_tag"> 
411	     
412	     <h5 class="m-0 mt-2 mb-2">{{label.what_did_you_not_like}}</h5>     
413	     <input type="text" name="tags_not_like" class="tags_not_like" id="tags_not_like" :placeholder="label.search_tag"> 
414	      	     
415	     <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5>      
416	     <div class="mb-3">
417	         <div class="dropzone dropzone_container" id="dropzone_multiple" data-action="gallery_create">
418			   <div class="dz-default dz-message">
419			    <i class="fas fa-cloud-upload-alt"></i>
420			     <p>{{label.drop_files_here}}</p>
421			    </div>
422			</div> 
423	     </div>
424	     	     	    
425	    <!-- <div v-if="upload_images.length>0" class="row gallery m-0">
426	      <div v-for="images in upload_images" class="col-lg-4 col-md-4 col-sm-12 mb-0 mb-lg-0  p-1">
427	        <div class="position-relative">
428	           <img :src="images.url_image">
429	           <a  href="javascript:;"  
430	           @click="removeUpload(images.id)" data-dz-remove 
431	           class="remove btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-plus"></i></a>
432	        </div>
433	      </div>	      
434	     </div>-->
435	     
436	     <h5 class="m-0 mt-2 mb-2">{{label.write_your_review}}</h5>      
437         <div class="form-label-group">    
438           <textarea id="review_content" class="form-control form-control-text font13" 
439           :placeholder="label.review_helps"
440           v-model="review_content"
441	       style="max-height:150px;"
442           >
443           </textarea>       
444        </div>
445                
446		<div  class="custom-control custom-checkbox flex-grow-1">            
447		  <input type="checkbox" class="custom-control-input"
448		  name="as_anonymous" value="1" 
449		  id="as_anonymous"	    
450		  v-model="as_anonymous"  
451		  >	  
452		  <label class="custom-control-label font14 bold" for="as_anonymous" >
453		   {{label.post_review_anonymous}}
454		  </label>
455		</div>    
456		
457				
458		<div id="error_message" v-cloak v-if="error.length>0" class="alert alert-warning mb-2 mt-2" role="alert">
459          <p v-cloak v-for="message in error" class="m-0">{{message}}</p>	    
460        </div>  
461            
462          </div> <!--modal body-->
463          
464          <div class="modal-footer justify-content-start">
465            <button class="btn btn-black w-100" @click="addReview" :class="{ loading: is_loading }" >               
466               <span class="label">{{label.add_review}}</span>
467               <div class="m-auto circle-loader" data-loader="circle-side"></div>
468            </button>
469          </div> <!--footer-->
470       
471	   </div> <!--content-->
472	  </div> <!--dialog-->
473	</div> <!--modal-->  
474  `};const Ke={props:["ajax_url","amount","price_format"],data(){return{data:0,config:JSON.parse(money_config)}},mounted(){this.data=window["v-money3"].format(this.amount,this.config)},watch:{price_format(e,t){this.config=e}},updated(){this.data=window["v-money3"].format(this.amount,this.config)},methods:{formatNumber(e){return window["v-money3"].format(e,this.config)}},template:`		
475    {{data}}
476    `};var Le=function(e){return window["v-money3"].format(e,JSON.parse(money_config))};let T;let k=16.6;const ze={props:["keys","provider","zoom","center","markers","size"],template:`     		
477    <div ref="cmaps" class="map border" :class="size"></div>    
478		
479	<div class="position-absolute map-buttons-wrap" v-if="size=='map-lg-large'" >
480		<div class="btn-group-vertical" v-loading="loading" v-if="provider!='yandex'" >
481		    <div class="mb-2">
482			<button @click="locateLocation" type="button" class="btn btn-white rounded-circle">
483				<i class="zmdi zmdi-gps-dot font25"></i>
484			</button>
485			</div>
486			<button @click="setPlusZoom()" type="button" class="btn btn-white">
487				<i class="zmdi zmdi-plus font25"></i>
488			</button>
489			<div class="divider py-1 bg-dark"></div>
490			<button @click="setLessZoom()" type="button" class="btn btn-white">
491				<i class="zmdi zmdi-minus font25"></i>
492			</button>
493		</div>
494	</div>
495    `,data(){return{cmapsMarker:[],latLng:[],cmaps:undefined,bounds:undefined,loading:false}},mounted(){this.renderMap()},watch:{markers(e,t){this.renderMap()}},methods:{locateLocation(){this.$emit("dragMarker",true);this.loading=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.$emit("dragMarker",false);this.loading=false;this.$emit("afterSelectmap",e.coords.latitude,e.coords.longitude);u(e)},e=>{this.$emit("dragMarker",false);this.loading=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.$emit("dragMarker",false);this.loading=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},renderMap(){try{switch(this.provider){case"google.maps":this.bounds=new window.google.maps.LatLngBounds;if(typeof this.cmaps!=="undefined"&&this.cmaps!==null&&Object.keys(this.cmapsMarker).length>0){this.moveAllMarker()}else{this.cmaps=new window.google.maps.Map(this.$refs.cmaps,{center:{lat:parseFloat(this.center.lat),lng:parseFloat(this.center.lng)},zoom:parseInt(this.zoom),disableDefaultUI:true,styles:z});
495Object.entries(this.markers).forEach(([e,t])=>{this.addMarker({position:{lat:parseFloat(t.lat),lng:parseFloat(t.lng)},map:this.cmaps,draggable:t.draggable==1?true:false,label:t.label},t.id,t.draggable)})}break;case"mapbox":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null&&Object.keys(this.cmapsMarker).length>0){this.moveAllMarker()}else{mapboxgl.accessToken=this.keys;this.bounds=new mapboxgl.LngLatBounds;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.center.lng),parseFloat(this.center.lat)],zoom:14});this.cmaps.on("error",e=>{u(e.error.message)});Object.entries(this.markers).forEach(([e,t])=>{this.addMarker({position:{lat:parseFloat(t.lat),lng:parseFloat(t.lng)},map:this.cmaps,draggable:t.draggable==1?true:false},t.id,t.draggable)});if(Object.keys(this.markers).length>1){this.FitBounds()}else{if(this.markers[0]){this.setCenter(this.markers[0].lat,this.markers[0].lng)}}}break;case"yandex":this.initYandex();break}}catch(e){console.error(e)}},async initYandex(){console.debug("initYandex");await ymaps3.ready;const{YMap:t,YMapDefaultSchemeLayer:a,YMapMarker:e,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.center.lng),parseFloat(this.center.lat)],zoom:k};if(typeof this.$refs.cmaps!=="undefined"&&this.$refs.cmaps!==null){}else{return}console.debug("yandex_map",T);console.debug("this.markers",this.markers);if(!T){console.debug("ADD Yandex map");T=new t(this.$refs.cmaps,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new a({}),new s({})]);let e=true;if(Object.keys(this.markers).length>0){e=this.markers[0].draggable}console.debug("is_dragable",e);if(e){T.addChild(new i({onUpdate:e=>{if(e.mapInAction){this.cmapsMarker[0].update({coordinates:e.location.center});this.$emit("dragMarker",true)}else{this.$emit("dragMarker",false)}},onActionEnd:e=>{console.log("onActionEnd",e.type);if(e.type=="drag"){this.cmapsMarker[0].update({coordinates:e.location.center});this.$emit("afterSelectmap",e.location.center[1],e.location.center[0])}else if(e.type=="scrollZoom"){k=e.location.zoom}}}))}if(this.size=="map-lg-large"){T.addChild(new o({position:"right"}).addChild(new d({})));T.addChild(new o({position:"top right"}).addChild(new l({onGeolocatePosition:e=>{console.log("onGeolocatePosition",e);this.$emit("afterSelectmap",e[1],e[0])}})))}Object.entries(this.markers).forEach(([e,t])=>{let a=t.id;this.cmapsMarker[a]=new r({coordinates:[parseFloat(t.lng),parseFloat(t.lat)],draggable:t.draggable,onDragEnd:e=>{console.log("onDragEnd",e);this.$emit("afterSelectmap",e[1],e[0])}});T.addChild(this.cmapsMarker[a])});if(Object.keys(this.markers).length>1){}else{if(this.markers[0]){const c={center:[this.markers[0].lng,this.markers[0].lat],zoom:k};T.update({location:c})}}}else{console.debug("move all marker");Object.entries(this.markers).forEach(([e,t])=>{let a=t.id;if(this.cmapsMarker[a]){this.cmapsMarker[a].update({coordinates:[t.lng,t.lat]})}});if(Object.keys(this.markers).length>1){}else{if(this.markers[0]){const c={center:[this.markers[0].lng,this.markers[0].lat],zoom:k};T.update({location:c})}}}},async addMarker(e,a,t){try{switch(this.provider){case"google.maps":this.cmapsMarker[a]=new window.google.maps.Marker(e);this.cmaps.panTo(new window.google.maps.LatLng(e.position.lat,e.position.lng));this.bounds.extend(this.cmapsMarker[a].position);if(t===true){google.maps.event.addListener(this.cmaps,"drag",e=>{this.$emit("dragMarker",true);let t=new google.maps.LatLng(this.cmaps.getCenter().lat(),this.cmaps.getCenter().lng());this.cmapsMarker[a].setPosition(t)});google.maps.event.addListener(this.cmaps,"dragend",e=>{let t=new google.maps.LatLng(this.cmaps.getCenter().lat(),this.cmaps.getCenter().lng());this.$emit("dragMarker",false);this.$emit("afterSelectmap",t.lat(),t.lng())});window.google.maps.event.addListener(this.cmapsMarker[a],"drag",e=>{this.$emit("dragMarker",true)});window.google.maps.event.addListener(this.cmapsMarker[a],"dragend",e=>{const t=e.latLng;this.latLng={lat:t.lat(),lng:t.lng()};this.$emit("dragMarker",false);this.$emit("afterSelectmap",t.lat(),t.lng())})}break;case"mapbox":this.cmapsMarker[a]=new mapboxgl.Marker(e).setLngLat([e.position.lng,e.position.lat]).addTo(this.cmaps);this.bounds.extend(new mapboxgl.LngLat(e.position.lng,e.position.lat));if(t===true){this.cmapsMarker[a].on("dragend",e=>{const t=this.cmapsMarker[a].getLngLat();u(t.lat+"=>"+t.lng);this.$emit("afterSelectmap",t.lat,t.lng)});this.cmaps.on("drag",()=>{this.cmapsMarker[a].setLngLat([this.cmaps.getCenter().lng.toFixed(4),this.cmaps.getCenter().lat.toFixed(4)])});this.cmaps.on("dragend",()=>{this.cmapsMarker[a].setLngLat([this.cmaps.getCenter().lng.toFixed(4),this.cmaps.getCenter().lat.toFixed(4)]);this.$emit("afterSelectmap",this.cmaps.getCenter().lat.toFixed(4),this.cmaps.getCenter().lng.toFixed(4))})}this.mapBoxResize();break}}catch(s){console.error(s)}},mapBoxResize(){if(this.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},moveAllMarker(){console.log("moveAllMarker");console.log(this.markers);if(this.provider=="google.maps"){if(Object.keys(this.markers).length>
4950){Object.entries(this.markers).forEach(([e,t])=>{let a=new google.maps.LatLng(parseFloat(t.lat),parseFloat(t.lng));if(!empty(this.cmapsMarker[t.id])){this.cmapsMarker[t.id].setPosition(a)}});if(Object.keys(this.markers).length>1){this.FitBounds()}else{this.cmaps.panTo(new window.google.maps.LatLng(this.markers[0].lat,this.markers[0].lng))}}}else{if(Object.keys(this.markers).length>0){Object.entries(this.markers).forEach(([e,t])=>{if(!empty(this.cmapsMarker[t.id])){this.cmapsMarker[t.id].setLngLat([t.lng,t.lat]).addTo(this.cmaps)}});if(Object.keys(this.markers).length>1){this.FitBounds()}else{this.cmaps.flyTo({center:[this.markers[0].lng,this.markers[0].lat],essential:true,zoom:14})}}}},centerMap(){this.FitBounds()},FitBounds(){try{switch(this.provider){case"google.maps":if(!empty(this.bounds)){this.cmaps.fitBounds(this.bounds)}break;case"mapbox":if(!empty(this.bounds)){this.cmaps.fitBounds(this.bounds,{duration:0,padding:50})}break}}catch(e){}},setCenter(e,t){try{switch(this.provider){case"google.maps":this.cmaps.setCenter(new window.google.maps.LatLng(e,t));break;case"mapbox":this.cmaps.flyTo({center:[t,e],essential:true});break}}catch(a){console.error(a)}},setPlusZoom(){if(this.provider=="yandex"){}else{this.cmaps.setZoom(this.cmaps.getZoom()+2)}},setLessZoom(){if(this.provider=="yandex"){}else{this.cmaps.setZoom(this.cmaps.getZoom()-2)}}}};const qe={props:["label","modelValue","formatted_address","enabled_locate"],emits:["update:modelValue"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],hasSelected:false,loading:false,addressData:[],auto_locate:false,is_fullwidth:false,selectedData:[]}},created(){this.q=this.formatted_address;if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile){this.is_fullwidth=true}}},watch:{formatted_address(e,t){this.q=e}},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},setData(e){this.clearData();this.q=e.description;this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)},locateLocation(){this.loading=true;if(navigator.geolocation){navigator.geolocation.getCurrentPosition(e=>{this.reverseGeocoding(e.coords.latitude,e.coords.longitude)},e=>{this.loading=false;ElementPlus.ElNotification({title:"",message:e.message,position:"bottom-right",type:"warning"})})}else{this.loading=false;ElementPlus.ElNotification({title:"",message:"Your browser doesn't support geolocation.",position:"bottom-right",type:"warning"})}},reverseGeocoding(e,t){axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+e+"&lng="+t,timeout:c}).then(e=>{if(e.data.code==1){this.q=e.data.details.data.address.formatted_address;this.addressData=e.data.details.data;this.$emit("afterGetcurrentlocation",this.addressData)}else{this.addressData=[];ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false;this.auto_locate=false})},setAddressData(e){this.addressData=e},setLoading(e){this.loading=e},onSubmit(){if(Object.keys(this.addressData).length>0){console.log("selectedData",this.selectedData);if(this.selectedData.from_addressbook){this.$emit("afterPointaddress",this.selectedData)}else{this.$emit("afterGetcurrentlocation",this.addressData)}}else{this.auto_locate=true;this.locateLocation()}},searchLocation(e,t){let a=[];let s=1;if(typeof isGuest!=="undefined"&&isGuest!==null){s=isGuest}let i=empty(e)?"getRecentAddress":"getlocationAutocomplete";i=s==1?"getlocationAutocomplete":i;if(s==1&&empty(e)){t(a);return}axios({method:"POST",url:ajaxurl+"/"+i,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){a=e.data.details.data}else{a=[]}t(a)})["catch"](e=>{}).then(e=>{})},handleSelect(e){this.selectedData=e;this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)}},template:`	
496	<div class="d-flex flex-sm-row flex-column align-items-center justify-content-between">
497		<div class="position-relative search-geocomplete" v-loading="loading" :class="{width_87 : enabled_locate , 'w-100' : !enabled_locate}"  > 	
498			<div class="p-0">			
499				<el-autocomplete
500					v-model="q"				
501					:placeholder="label.enter_address"				
502					size="large"
503					class="w-100"
504					:trigger-on-focus="true"
505					value-key="description"
506					:fit-input-width="is_fullwidth"
507					clearable
508					:fetch-suggestions="searchLocation"				
509					@select="handleSelect"
510				>
511				<template #suffix>
512				<button v-if="enabled_locate" @click="locateLocation" type="button" class="btn btn-link">
513					<i class="zmdi zmdi-my-location font20" style="color:#000;"></i>
514				</button>
515				</template>			
516				</el-autocomplete>
517			</div>
518		</div>    
519		<div v-if="enabled_locate" class="flex-enabled-locate">
520		<button @click="onSubmit" type="button" class="btn btn-green pl-3 pr-3" :disabled="loading">
521		   <i class="zmdi zmdi-arrow-right font25"></i>
522		</button>
523		</div>	
524	</div>      			
525	`};const Ve={props:["data","keys","provider","zoom","center","label"],components:{"components-maps":ze,"component-auto-complete":qe},data(){return{markers:[],address_data:[],loading:false,drag:false,visible:false}},computed:{hasFormatAddress(){if(Object.keys(this.address_data).length>0){return true}return false},getFormatAddress(){return this.address_data},isMobileView(){if(typeof is_mobile!=="undefined"&&is_mobile!==null){if(is_mobile==1){return true}}return false}},watch:{data(e,t){console.debug("new data",e);this.address_data=e},address_data(e,t){u("watch address_data");u(e);this.dataMarkers(e.latitude,e.longitude)}},methods:{getFormatAddress(){return"test"},setInitialMarker(){console.debug("setInitialMarker",this.data);if(T){T.destroy();T=null}this.dataMarkers(this.data.latitude,this.data.longitude)},dataMarkers(e,t){this.markers=[{id:0,lat:parseFloat(e),lng:parseFloat(t),draggable:true}]}
525,setLoading(e){this.loading=e},show(e){if(e){this.address_data=this.data;p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}},afterChoose(e){this.getLocationDetails(e)},getLocationDetails(e){console.log("provider",this.provider);console.debug("getLocationDetails",e);let t=e.id;if(this.provider=="mapbox"){t=`${e?.longitude},${e?.latitude}`}axios({method:"POST",url:ajaxurl+"/getLocationDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&id="+t+"&saveplace=0"+"&description="+e.description,timeout:c}).then(e=>{if(e.data.code==1){this.dataMarkers(e.data.details.data.latitude,e.data.details.data.longitude);this.address_data=e.data.details.data}else{}})["catch"](e=>{}).then(e=>{})},afterSelectmap(t,a){this.loading=true;axios({method:"POST",url:ajaxurl+"/reverseGeocoding",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&lat="+t+"&lng="+a,timeout:c}).then(e=>{if(e.data.code==1){if(Object.keys(e.data.details.data).length>0){this.address_data=e.data.details.data;this.address_data.latitude=t;this.address_data.longitude=a}}else{}})["catch"](e=>{}).then(e=>{this.loading=false})},dragMarker(e){this.drag=e},setNewAdress(){i(StoreMapName,"selectedAddress",this.address_data);this.$emit("afterChangeaddress",this.address_data)},afterClosemodal(){this.$emit("afterClosemodal",this.provider)}},template:`                     
526    <el-dialog v-model="visible" :close-on-click-modal="false" :show-close="true" :title="label.exact_location"  width="55%" @closed="afterClosemodal" >	
527
528	  <div class="position-relative" >
529
530		<component-auto-complete
531		ref="auto_complete"
532		:label="{
533			enter_address : label.enter_address
534		}"
535		:formatted_address="hasFormatAddress?getFormatAddress.address.formatted_address:''"
536		@after-choose="afterChoose"
537		>
538		</component-auto-complete>
539
540		<div class="pt-2"></div>
541		
542		<components-maps
543			ref="cmaps"
544			:keys="keys"
545			:provider="provider"
546			:zoom="zoom"
547			size="map-lg-large"
548			:center="center"
549			:markers="markers"                        
550			@after-selectmap="afterSelectmap"
551			@drag-marker="dragMarker"
552			>
553		</components-maps>
554
555		<div v-if="!drag" class="w-100 position-absolute" style="bottom:20px;">                    
556			<div class="w-50  m-auto">
557			<button type="button" @click="setNewAdress" class="btn btn-green w-100" :class="{ loading: loading }" >
558				<span class="label">
559				{{label.submit}}
560				</span>
561				<div class="m-auto circle-loader" data-loader="circle-side"></div>
562			</button>
563			</div>
564		</div>					
565
566	  </div>
567
568	</el-dialog>
569    `};const Ue={props:["label"],data(){return{loading:false,data:[],address_data:""}},created(){this.getSavedAddress()},computed:{getData(){return this.data},totalCount(){return Object.keys(this.data).length-1},hasSelectAddress(){if(Object.keys(this.address_data).length>0){return false}return true}},methods:{show(e){if(e){p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}},getSavedAddress(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAddresses",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},setAddress(e){i(StoreMapName,"selectedAddress",e);this.show(false);this.$emit("afterSelectaddress",e)}},template:`      
570    <div class="modal" ref="modal" id="modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true" data-backdrop="static" data-keyboard="false"  >
571      <div class="modal-dialog modal-dialog-centered" role="document">
572          <div class="modal-content">		  
573              <div class="modal-header border-bottom-0" >
574                  <h5 class="modal-title" id="exampleModalLongTitle">{{label.save_address}}</h5>
575                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
576                    <span aria-hidden="true">&times;</span>
577                  </button>
578              </div>
579              <div class="modal-body">
580			  			  			  
581              <el-radio-group v-model="address_data" class="ml-4">
582			     <template v-for="(items,index) in getData" :keys="items" >
583			        <el-radio :label="items" size="large">
584					   <div class="text-dark font-weight-bold">{{items.attributes.address_label}}</div>
585					   <div class="text-truncatex max-width-addressx">
586					       {{items.address.formattedAddress}}
587					   </div>
588					</el-radio>		
589				 </template>		 
590			  </el-radio-group>
591
592              </div>
593              
594              <div class="modal-footer">                
595                <button type="button" class="btn btn-light" data-dismiss="modal">
596				   {{label.cancel}}
597				</button>
598                <button @click="setAddress(address_data)" type="button" class="btn btn-green pl-3 pr-3" 
599                :disabled="hasSelectAddress" 
600                >
601                  {{label.save}}
602                </button>
603              </div>
604
605          </div>
606      </div>
607    </div> 
608    `};let I=[];const Be={template:"#xtemplate_address_form",props:["location_data"],data(){return{error:[],cmaps_config:[],address1:"",formatted_address:"",location_name:"",delivery_options:"",delivery_options_data:[],delivery_instructions:"",address_label:"",address_label_data:[],cmaps_full:false,new_coordinates:[],is_loading:false,address2:"",postal_code:"",company:"",custom_field1:"",custom_field2:"",custom_field1_data:[],custom_field_enabled:false}},created(){this.getAddressAttributes()},watch:{location_data(e,t){if(empty(e)){return}if(typeof e.parsed_address!=="undefined"&&e.parsed_address!==null){if(!empty(e.parsed_address.street_name)){this.formatted_address=e.parsed_address.street_name;this.address1=e.parsed_address.street_number}else{this.formatted_address=e.address.formatted_address;this.address1=e.address.address1}}else{this.formatted_address=e.address.formatted_address;this.address1=e.address.address1}if(!empty(e.attributes)){this.location_name=e.attributes.location_name;this.delivery_options=e.attributes.delivery_options;this.delivery_instructions=e.attributes.delivery_instructions;this.address_label=e.attributes.address_label}else{this.location_name="";this.delivery_instructions="";this.delivery_options="Leave it at my door";this.address_label="Home"}this.show()}},computed:{hasLocationData(){if(typeof this.location_data!=="undefined"&&this.location_data!==null){var e=Object.keys(this.location_data).length;if(e>0){return true}}return false}
608,hasNewCoordinates(){var e=Object.keys(this.new_coordinates).length;if(e>0){return true}return false}},methods:{show(){this.cmaps_full=false;p(this.$refs.address_modal).modal("show");setTimeout(()=>{this.renderMap()},100)},hide(){this.error=[];p(this.$refs.address_modal).modal("hide")},close(){this.hide()},setLoading(e){this.is_loading=e},closeModal(){u("closeModal");this.hide();this.$emit("afterClosemodal")},getAddressAttributes(){axios({method:"POST",url:ajaxurl+"/getAddressAttributes",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.cmaps_config=e.data.details.maps_config;this.delivery_options_data=e.data.details.delivery_option;this.address_label_data=e.data.details.address_label;this.delivery_options=e.data.details.default_atts.delivery_options;this.address_label=e.data.details.default_atts.address_label;this.custom_field_enabled=e.data.details.custom_field_enabled;this.custom_field1_data=e.data.details.custom_field1_data;this.custom_field1=Object.keys(this.custom_field1_data)[0]}else{this.cmaps_config=[];this.delivery_options_data=[];this.address_label_data=[];this.custom_field1_data=[];this.custom_field_enabled=false}})["catch"](e=>{}).then(e=>{})},renderMap(){this.cmaps_provider=this.cmaps_config.provider;switch(this.cmaps_provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{this.cmaps=new google.maps.Map(this.$refs.ref_map,{center:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true})}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.ref_map,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break;case"yandex":this.initYandexDeliveryDetails();break}},async initYandexDeliveryDetails(){await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:t,YMapMarker:a,YMapDefaultFeaturesLayer:s,YMapListener:i,YMapControls:o}=ymaps3;const{YMapDefaultMarker:r}=await ymaps3["import"]("@yandex/[email protected]");const{YMapZoomControl:d,YMapGeolocationControl:l}=await ymaps3["import"]("@yandex/[email protected]");const n={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};if(!T){T=new e(this.$refs.ref_map,{location:n,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);I=new r({coordinates:n.center});T.addChild(I)}else{console.debug("here here")}},addMarker(t){switch(this.cmaps_provider){case"google.maps":I=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}I=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){switch(this.cmaps_provider){case"google.maps":I.setMap(null);break;case"mapbox":I.remove();break}},adjustPin(){this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}console.log("adjustPin",this.cmaps_provider);this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_provider=="google.maps"){I.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_provider=="mapbox"){I.on("dragend",e=>{const t=I.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}else if(this.cmaps_provider=="yandex"){const t={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};I.update({coordinates:t.center,draggable:true,onDragEnd:e=>{console.log("onDragEnd",e);
608this.new_coordinates={lat:e[1],lng:e[0]}}})}},cancelPin(){this.error=[];this.cmaps_full=false;if(this.cmaps_provider=="yandex"){const e={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};I.update({coordinates:e.center,draggable:false})}else{this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}},mapBoxResize(){if(this.cmaps_provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},setNewCoordinates(){let e="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content");e+="&cart_uuid="+getCookie("cart_uuid");e+="&lat="+this.location_data.latitude;e+="&lng="+this.location_data.longitude;e+="&new_lat="+this.new_coordinates.lat;e+="&new_lng="+this.new_coordinates.lng;axios({method:"POST",url:ajaxurl+"/checkoutValidateCoordinates",data:e,timeout:c}).then(e=>{if(e.data.code==1){this.location_data.latitude=this.new_coordinates.lat;this.location_data.longitude=this.new_coordinates.lng;this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}else{ElementPlus.ElNotification({title:"",message:e.data.msg[0],position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{})},save(){this.$emit("onSavelocation",this.location_data,{address1:this.address1,formatted_address:this.formatted_address,location_name:this.location_name,delivery_options:this.delivery_options,address_label:this.address_label,delivery_instructions:this.delivery_instructions,address2:this.address2,postal_code:this.postal_code,company:this.company,address_format_use:this.cmaps_config.address_format_use,custom_field1:this.custom_field1,custom_field2:this.custom_field2})}}};const Je=Vue.createApp({components:{"components-loading-box":Oe}}).mount("#vue-loading-box");const Ge=Vue.createApp({components:{"component-home-search":je}}).mount("#vue-home-search");const We=Vue.createApp({components:{"component-home-search":je}}).mount("#vue-home-search-mobile");const Ze={props:["title","featured_name","settings","responsive"],data(){return{is_loading:false,owl:undefined,data:[],services:[],estimation:[],location_details:[]}},mounted(){this.GetFeaturedLocation()},computed:{hasData(){if(this.data.length>0){return true}return false},classObject(){return{"w-100":this.settings.theme==="rounded","w-75":this.settings.theme==="rounded-circle"}}},methods:{GetFeaturedLocation(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),featured_name:this.featured_name};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/GetFeaturedLocation",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.location_details=e.details.location_details;this.data=e.details.data;this.services=e.details.services;this.estimation=e.details.estimation;setTimeout(()=>{this.RenderCarousel()},1)}else{this.location_details="";this.data="";this.services="";this.estimation=""}});n[t].always(e=>{this.is_loading=false})},RenderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.owl_carousel).owlCarousel({items:parseInt(this.settings.items),lazyLoad:this.settings.lazyLoad=="1"?true:false,loop:this.settings.loop=="1"?true:false,margin:parseInt(this.settings.margin),nav:this.settings.nav=="1"?true:false,dots:this.settings.dots=="1"?true:false,stagePadding:parseInt(this.settings.stagePadding),responsive:this.responsive,rtl:e})},SlideNext(){this.owl.trigger("next.owl.carousel")},SlidePrev(){this.owl.trigger("prev.owl.carousel",[300])}},template:`	
609	
610	<DIV class="mt-5 mb-5">
611	
612	<div class="row no-gutters mb-4 " v-if="hasData" >    
613	     <div class="col d-flex justify-content-start align-items-center ">       
614	       <h5 class="m-0 section-title">
615	       {{title}} <span>{{location_details.location_name}}</span>
616	       </h5>
617	     </div>
618	     <div class="col d-flex justify-content-end align-items-center ">        
619	        <a @click="SlidePrev" href="javascript:;" class="owl-carousel-nav prev mr-4">&nbsp;</a>
620	        <a @click="SlideNext" href="javascript:;" class="owl-carousel-nav next">&nbsp;</a>
621	     </div> <!--col-->        
622	</div> <!--row-->
623			 	
624	 <div ref="owl_carousel" class="owl-carousel restaurant-carousel" :class="settings.theme" v-if="hasData"  >	  
625	    
626	   <div v-for="item in data" class="row equal align-items-center position-relative"
627	   :class="classObject" 
628	   >  
629	   
630	      <template  v-for="(cuisine,index) in item.cuisine_name"  >
631	        <template v-if="index <= 0">
632	        
633	         <span class="badge mr-1 top-left" v-if="settings.theme==='rounded'" 
634             :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor"
635	          >{{cuisine.cuisine_name}}</span>	      
636	     
637	          <div class="rounded-pill badge top-right"  v-if="item.ratings.rating>0"
638	          :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor"
639	          >
640	           {{item.ratings.rating}}
641	          </div>     
642	          
643	         </template>
644	      </template>
645	     	     
646	   
647	     <div class="w-100 list-items p-0 " >   
648	        <a :href="item.merchant_url" ><img :class="settings.theme" :src="item.url_logo" /></a>
649	     </div>
650	     
651	    <!--ROUNDED TEMPLATE-->
652	    <template v-if="settings.theme==='rounded'">
653	    <div class="d-flex justify-content-between mt-2 w-100 pl-1 pr-1 ">
654	      <div class="flex-col ">
655	       <a :href="item.merchant_url" ><h6>{{item.restaurant_name}}</h6></a>
656	      </div>	      
657	    </div> <!--flex-->
658	    
659	    <div class="d-flex justify-content-between w-100 pl-1 pr-1">
660	      <div class="flex-col">
661	      <p class="m-0">	      
662	        <i class="zmdi zmdi-time mr-1"></i>
663	        
664	         <template v-if="estimation[item.merchant_id]">
665	           <template v-if="services[item.merchant_id]">
666	             <template v-for="(service_name,index_service) in services[item.merchant_id]"  >
667	               <template v-if="index_service<=0">
668	               
669				    <template v-if="estimation[item.merchant_id][service_name]"> 
670						<template v-if="estimation[item.merchant_id][service_name][item.charge_type] "> 
671						{{ estimation[item.merchant_id][service_name][item.charge_type].estimation }} <?php echo t("min")?>
672						</template>
673					</template>
674	                   
675	               </template>
676	             </template>
677	           </template>
678	         </template>
679	        
680	      </p>
681	      </div>
682	      <div class="flex-col"><p class="m-0" v-if="item.free_delivery==='1'" >{{ settings.free_delivery}}</p></div>
683	    </div> <!--flex-->
684	    </template>
685	    <!--END ROUNDED TEMPLATE-->
686	    
687	    <!-- ROUNDED CIRCLE TEMPLATE-->
688	    <template v-else >
689	      <div class="mt-3 text-center w-100">
690	         <a :href="item.merchant_url" ><h6 class="mb-1">{{item.restaurant_name}}</h6></a>
691	         
692	        <template  v-for="(cuisine,index) in item.cuisine_name"  >
693		        <template v-if="index <= 0">
694		        
695		         <span class="badge"
696	             :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor"
697		          >{{cuisine.cuisine_name}}</span>	      
698		     
699		          
700		         </template>
701		     </template>
702	         
703	      </div>
704	    </template>
705	    <!-- END ROUNDED CIRCLE TEMPLATE-->
706	     
707	   </div> <!-- row-->
708	   	  
709     </div><!-- owl-carousel-->
710    
711     </DIV>
712	`};const He={props:["data"],data(){return{owl:undefined}},mounted(){},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.cuisine_carousel).owlCarousel({loop:true,dots:false,nav:false,autoWidth:true,rtl:e})}},template:`			
713	<div ref="cuisine_carousel"  class="owl-carousel owl-theme cuisine_carousel">
714      <div v-for="(item, index) in data" class="mr-2">	   
715	   <a :href="item.url" class="d-block bg-light rounded-pill"
716	   :class="{active : index==0 }"
717	   >
718	    {{item.cuisine_name}}
719	   </a>
720	  </div>    
721   </div>
722	`};const Qe={props:["responsive","label"],data(){return{owl:undefined}},mounted(){this.renderCarousel()},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.carousel_three_steps).owlCarousel({rtl:e,loop:true,dots:true,nav:false,responsive:{0:{items:1,loop:false},320:{items:1,loop:false},480:{items:1,loop:false},600:{items:1,loop:false},700:{items:2,loop:false},1e3:{items:2,loop:false}}})}},template:"#three-steps-ordering"};const Xe={template:"#xtemplate_cuisine_list",props:["title"],data(){return{swiperCuisine:null,data:[],loading:false}},mounted(){this.getCuisine()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getCuisine(){this.loading=true;let e="language="+language;axios.get(ajaxurl+"/CuisineList2?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetcuisine",true)}else{this.data=[];this.$emit("afterGetcuisine",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperCuisine=new Swiper(this.$refs.swiperCuisineList,{lazy:true,slidesPerView:7.5,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:3,spaceBetween:0},320:{slidesPerView:3,spaceBetween:0},480:{slidesPerView:3.5,spaceBetween:0},640:{slidesPerView:4.5,spaceBetween:5},768:{slidesPerView:7,spaceBetween:10},1024:{slidesPerView:7.5,spaceBetween:15}}})},setUrl(e){window.location.href=e}}};const et={template:"#xtemplate_swiper_list",props:["title","query","filters_transactions","city_id","area_id","state_id","postal_id"],data(){return{swiperList:null,loading:true,data:[],available_vouchers:null,available_promos:null}},mounted(){this.getData()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getData(){this.loading=true;const e="query="+this.query;axios.get(ajaxurl+"/GetFeaturedLocation?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.available_vouchers=e.data.details.available_vouchers;this.available_promos=e.data.details.available_promos;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetfeatured",true)}else{this.data=[];this.$emit("afterGetfeatured",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperList=new Swiper(this.$refs.refSwiperList,{lazy:true,slidesPerView:3.5,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:1,spaceBetween:0}
722,320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:3,spaceBetween:10},1024:{slidesPerView:3.5,spaceBetween:15}}})},setUrl(e){window.location.href=e}}};const tt={template:"#xtemplate_join",props:["title"],data(){return{swiperList:null,loading:true,data:[]}},mounted(){this.getData()},computed:{hasData(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getData(){this.loading=true;let e="language="+language;axios.get(ajaxurl+"/getJoin?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;setTimeout(()=>{this.initSwiper()},1)}else{this.data=[]}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperList=new Swiper(this.$refs.refSwiperList,{lazy:true,slidesPerView:3,spaceBetween:15,autoHeight:true,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{310:{slidesPerView:1,spaceBetween:0},320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:3,spaceBetween:10},1024:{slidesPerView:3,spaceBetween:15}}})}}};let at=null;let st=null;if(typeof componentsFeaturedItemList!=="undefined"&&componentsFeaturedItemList!==null){at=componentsFeaturedItemList}if(typeof componentsItemDialog!=="undefined"&&componentsItemDialog!==null){st=componentsItemDialog}let it=null;if(typeof componentsFeaturedList!=="undefined"&&componentsFeaturedList!==null){it=componentsFeaturedList}const ot=Vue.createApp({components:{"components-swiper-list":et,"component-three-steps":Qe,"components-cuisine-list":Xe,"components-join":tt,"components-featured-list":at,"components-item-dialog":st,"components-featured-merchant":it},data(){return{data_cuisine:[],cuisine_url:""}},methods:{viewItem(e){const t=e?.is_eligible;if(!t){return}this.$refs.ref_item_dialog.viewItem({cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},afterAddtocart(){if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof rt!=="undefined"&&rt!==null){rt.$refs.ref_featured_list.getFeaturedItems()}}}});ot.use(ElementPlus);ot.component("infinite-loading",V3InfiniteLoading["default"]);const rt=ot.mount("#vue-home-widgets");const dt={props:["active","merchant_id","is_guest","please_login"],data(){return{data:[],loading:false}},methods:{SaveStore(){if(this.is_guest){ElementPlus.ElNotification({title:"",message:this.please_login,position:"bottom-right",type:"warning"});return}var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id};var t=500;e=JSON.stringify(e);this.loading=true;n[t]=p.ajax({url:ajaxurl+"/SaveStore",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.$emit("afterSave",true)}else{D.alert(e.msg,{})}});n[t].always(e=>{this.loading=false})}},template:`			 
723	  <div class="d-none d-lg-block" >
724		<a @click="SaveStore()"  href="javascript:;" class="btn bg-light btn-circle rounded-pill">
725			<i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i>
726		</a>
727	  </div>
728	  <div class="d-block d-lg-none">
729	    <a @click="SaveStore()"  href="javascript:;" class="btn bg-light btn-circle rounded-pill">
730			<i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i>
731		 </a>
732	  </div>
733	`};var lt=function(){var e=[];var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a=Object.keys(t).length;if(a>0){e={whento_deliver:t.whento_deliver};if(t.whento_deliver=="schedule"){e={whento_deliver:t.whento_deliver,delivery_date:t.delivery_date,delivery_time:t.delivery_time.start_time,delivery_time_raw:t.delivery_time}}return e}return false};const nt={components:{"star-rating":VueStarRating["default"]},props:["data_attributes","data_cuisine","label"],data(){return{sortby:"",cuisine:[],price_range:0,max_delivery_fee:0,rating:0}},computed:{hasFilter(){if(!empty(this.sortby)){return true}if(this.price_range>0){return true}if(this.max_delivery_fee>0){return true}if(this.cuisine.length>0){return true}if(this.rating>0){return true}return false}},methods:{show(e){p(this.$refs.filterFeed).modal("show")},close(){p(this.$refs.filterFeed).modal("hide")},clearFilter(){this.sortby="";this.price_range=0;this.max_delivery_fee=0;this.cuisine=[];this.rating=0},applyFilter(){this.close();this.$emit("afterFilter",{sortby:this.sortby,cuisine:this.cuisine,price_range:this.price_range,max_delivery_fee:this.max_delivery_fee,rating:this.rating})}},template:`   
734   <div class="modal" ref="filterFeed" tabindex="-1" role="dialog" 
735   aria-labelledby="filterFeed" aria-hidden="true"  >
736	  <div class="modal-dialog modal-full modal-dialog-scrollable" role="document">
737		<div class="modal-content"> 
738		  <div class="modal-body" >
739 
740		  <a href="javascript:;" @click="close" 
741		  class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
742		  
743		  <h5 class="mt-3">{{label.filters}}</h5>
744		  
745		  <div v-for="(sort_by, key) in data_attributes.sort_by" class="row m-0 ml-2 mb-2">
746		  <div class="custom-control custom-radio">
747			<input v-model="sortby" :value="key" type="radio" :id="key+1"  class="custom-control-input">
748			<label class="custom-control-label" :for="key+1">{{sort_by}}</label>
749		   </div>   		      
750		  </div><!--row-->  
751
752		  <h5 class="mt-3">{{label.price_range}}</h5>
753
754		  <div class="btn-group btn-group-toggle input-group-small mt-2 mb-2 w-100" >
755          <label  v-for="(price, key) in data_attributes.price_range" class="btn" :class="{ active: price_range==key }"   >
756             <input  type="radio" :value="key"  v-model="price_range"> 
757             <!-- {{price}} -->
758			 <span v-html="price"></span>
759           </label>                                               
760          </div>
761
762		  <h5 class="mt-3">{{label.cuisine}}</h5>
763		  
764		  <div class="row m-0">              
765            <template v-for="(item_cuisine, index) in data_cuisine" >         
766	        <div class="col-6 mb-1" >
767	         <div class="custom-control custom-checkbox">	          
768	          <input type="checkbox" class="custom-control-input cuisine" :id="'cuisine'+item_cuisine.cuisine_id+1" 
769              :value="item_cuisine.cuisine_id"
770              v-model="cuisine"
771	           >
772	          <label class="custom-control-label" :for="'cuisine'+item_cuisine.cuisine_id+1">
773	          {{item_cuisine.cuisine_name}}
774	          </label>
775	         </div>   		      
776	        </div> <!--col-->	         	       
777	        </template>	       	      	       
778	    </div><!-- row-->
779
780		<h5 class="mt-3">{{label.max_delivery_fee}}</h5>
781		 
782		<div class="form-group">
783	    <label for="formControlRange">{{label.delivery_fee}} <b><span class="min-selected-range"></span></b></label>
784	    <input v-model="max_delivery_fee" 
785	          id="min_range_slider" value="10" type="range" class="custom-range" id="formControlRange"  min="1" max="20" >
786	    </div>
787
788		<h5 class="mt-3">{{label.ratings}}</h5>
789		<p class="bold">{{label.over}} {{rating}}</p>
790		<star-rating  
791		v-model:rating="rating"
792		:star-size="30"
793		:show-rating="false" 
794		@update:rating="rating = $event"
795		>
796		</star-rating>
797       
798		</div> <!--content-->
799		
800		<div class="modal-footer border-top-0">
801			<template v-if="hasFilter">
802			<button @click="clearFilter" class="btn btn-light rounded-0 w-50" >  
803				{{label.clear_all}}
804			</button>
805			<button @click="applyFilter" class="btn btn-black rounded-0 w-50" >  
806			    {{label.done}}
807			</button>
808			</template>
809			<template v-else>
810			 <button @click="applyFilter" class="btn btn-black rounded-0 w-100" >  
811				{{label.done}}
812			 </button>
813			</template>
814		</div>
815		<!--- modal footer -->
816
817		</div> <!--dialog-->
818	</div> <!--modal-->		  
819   `};const ct={props:["ajax_url","tabs_suggestion","label"],data(){return{active_tab:"restaurant",data:[],q:"",awaitingSearch:false,is_loading:false}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){this.clearData();return false}this.show_list=true;this.is_loading=true;setTimeout(()=>{axios({method:"POST",url:ajaxurl+"/getSearchSuggestionV1",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+this.q+"&category="+this.active_tab,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false;this.is_loading=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{show(e){this.clearData();p(this.$refs.suggestion).modal("show");setTimeout(()=>{this.$refs.q.focus()},500)},close(){p(this.$refs.suggestion).modal("hide")},showList(){this.show_list=true},clearData(){this.data=[];this.q="";this.show_list=false},setTab(e){this.clearData();this.show_list=false;this.active_tab=e}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:`   
820	<div class="modal" ref="suggestion" tabindex="-1" role="dialog" 
821	aria-labelledby="suggestion" aria-hidden="true"  >
822	   <div class="modal-dialog modal-full modal-dialog-scrollable" role="document">
823		 <div class="modal-content"> 
824		   <div class="modal-body p-0" >
825  
826		   <div class="container-fluid mt-3 mb-2">
827		   <a href="javascript:;" @click="close" 
828		   class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
829
830		      <div class="position-relative inputs-box-wrap mt-3 ">
831		         <input @click="showList" ref="q" v-model="q" class="inputs-box-grey rounded  w-100" :placeholder="label.search">
832			     <div class="search_placeholder pos-right img-15"></div>       	
833				 <button @click="clearData" v-if="show_list" class="btn btn-sm icon-remove">{{label.clear}}</button>
834			  </div>
835
836			</div> 
837			<!-- container -->
838						
839			<ul class="suggestion-tab row no-gutters list-unstyled list-inline">
840			 <li v-for="(item, index) in tabs_suggestion" 
841			  class="col list-inline-item mr-0"
842			  :class="{active : active_tab==index }"
843			  @click="setTab(index)"
844			 >
845			  {{item}}
846			 </li>			 
847			</ul>
848
849			<div class="container-fluid ">
850									
851			<el-skeleton :count="9"  animated :loading="is_loading" >
852			   <template #template>
853			     <div class="row mb-2">
854                    <div class="col-2">					
855					<el-skeleton style="--el-skeleton-circle-size: 40px">
856						<template #template>
857						<el-skeleton-item variant="circle" />
858						</template>
859					</el-skeleton>
860					</div> <!-- col -->
861
862					<div class="col">
863					 <el-skeleton animated>
864						<template #template>			   
865						<div style="padding: 0px">
866							<el-skeleton-item variant="p" style="width: 50%" />
867							<div
868							style="
869								display: flex;
870								align-items: center;
871								justify-items: space-between;
872							"
873							>
874							<el-skeleton-item variant="text" style="margin-right: 16px" />
875							<el-skeleton-item variant="text" style="width: 30%" />
876							</div>
877						</div>
878						</template>
879					</el-skeleton>
880					</div> <!-- col -->
881				 </div> 
882				 <!-- row -->
883			   </template>
884
885			   <template #default>
886			        <template  v-if="hasData">
887					<ul class="list-unstyled m-0">
888					<li v-for="items in data">
889						<a :href="items.url">
890						<div class="row align-items-center no-gutters">
891							<div class="col-1 mr-3">
892							<img class="img-40 rounded-pill" :src="items.url_logo">
893							</div>
894							<div class="col text-truncate border-bottom p-2">
895							<h6 class="m-0 text-truncate">{{items.title}}</h6>
896							<p class="m-0 text-truncate text-grey ">  
897								<span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span>
898								</p>
899							</div>
900						</div>
901						</a>
902					</li>
903					</ul>
904					</template>
905					<template v-else>
906					    <template v-if="q"> 
907						<el-empty :description="label.no_results"></el-empty>
908						</template>
909					</template>
910
911			   </template>
912
913			</el-skeleton>
914									
915
916			</div>
917			<!-- container -->
918
919			
920
921
922		   </div> <!--content-->
923	    </div> <!--dialog-->
924	</div> <!--modal-->		  
925	`};const mt={template:"#xtemplate_banner",data(){return{loading:false,swiperBanner:null,data:null}},mounted(){this.getBanner()},computed:{hasBanner(){if(!this.loading&&Object.keys(this.data).length>0){return true}return false}},methods:{getBanner(){const e=getFromLocalStorageStore(StoreMapName,"selectedAddress");if(typeof e==="undefined"||e===null||e===""){return}let t="latitude="+e.latitude+"&longitude="+e.longitude;this.loading=true;axios.get(ajaxurl+"/getBanner?"+t).then(e=>{if(e.data.code==1){this.data=e.data.details.data;setTimeout(()=>{this.initSwiper()},1);this.$emit("afterGetbanner",true)}else{this.data=null;this.$emit("afterGetbanner",false)}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},initSwiper(){this.swiperBanner=new Swiper(this.$refs.refSwiper,{lazy:true,slidesPerView:3,spaceBetween:15,autoHeight:true,autoplay:{delay:2500,disableOnInteraction:false},pagination:{el:".swiper-pagination",clickable:true,dynamicBullets:true},breakpoints:{310:{slidesPerView:1,spaceBetween:0},320:{slidesPerView:1,spaceBetween:0},480:{slidesPerView:1,spaceBetween:0},640:{slidesPerView:2,spaceBetween:10},768:{slidesPerView:2,spaceBetween:10},1024:{slidesPerView:3,spaceBetween:15}}})},onBannerClick(e){window.location.href=e.url}}};const ut=Vue.createApp({components:{"component-save-store":dt,"star-rating":VueStarRating["default"],"component-filter-feed":nt,"component-mobile-search-suggestion":ct,"components-banner":mt},data(){return{is_loading:false,reload_loading:false,collapse:true,data_attributes:[],data_cuisine:[],cuisine:[],sortby:"",price_range:0,max_delivery_fee:0,page:0,show_next_page:false,datas:[],services:[],estimation:[],total_message:"",rating:0,transaction_type:"",whento_deliver:"",delivery_date:"",delivery_time:"",response_code:1,pause_reason_data:[],data_attributes_loading:false,enabled_review:true,has_banner:false,is_guest:true}},mounted(){this.getCuisineList();this.searchAttributes();this.pauseReasonList();if(typeof cuisine_filter!=="undefined"&&cuisine_filter!==null){let e=JSON.parse(cuisine_filter);this.cuisine=e}this.Search(false);if(typeof isGuest!=="undefined"&&isGuest!==null){this.is_guest=isGuest}},computed:{hasFilter(){if(!empty(this.sortby)){return true}if(this.price_range>0){return true}if(this.max_delivery_fee>0){this.AutoFeed();return true}if(this.cuisine.length>0){return true}if(this.rating>0){this.AutoFeed();return true}return false},hasMore(){if(this.show_next_page){return true}return false},hasData(){if(this.datas.length>0){return true}return false},hasFilter(){if(Object.keys(this.cuisine).length>0){return true}if(!empty(this.sortby)){return true}if(!empty(this.price_range)){return true}if(!empty(this.max_delivery_fee)){return true}if(!empty(this.rating)){return true}return false}},methods:{afterGetbanner(e){this.has_banner=e},clearFilter(){this.sortby="";this.price_range=0;this.max_delivery_fee=0;this.cuisine=[];this.rating=0;this.Search(false)},getCuisineList(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/CuisineList",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data_cuisine=e.details.data_cuisine}else{this.data_cuisine=[]}});n[t].always(e=>{})},searchAttributes(){let e=getCookie("currency_code");e=!empty(e)?e:"";var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),currency_code:e};var a=g();t=JSON.stringify(t);this.data_attributes_loading=true;n[a]=p.ajax({url:ajaxurl+"/searchAttributes",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data_attributes=e.details}else{this.data_attributes=[]}});n[a].always(e=>{this.data_attributes_loading=false})},ShowMore(){this.Search(this.show_next_page)},AutoFeed(){setTimeout(()=>{this.Search(false)},100)},Search(t){if(t){var a=11}else{var a=g();this.page=0}var e;if(e=lt()){if(empty(this.whento_deliver)){this.whento_deliver=e.whento_deliver;this.delivery_date=e.delivery_date;this.delivery_time=e.delivery_time}}let s=getCookie("currency_code");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),local_id:getCookie("kmrs_local_id"),cart_uuid:getCookie("cart_uuid"),page:this.page,currency_code:s,filters:{cuisine:this.cuisine,sortby:this.sortby,price_range:this.price_range,max_delivery_fee:this.max_delivery_fee,rating:this.rating,transaction_type:this.transaction_type,whento_deliver:this.whento_deliver,delivery_date:this.delivery_date,delivery_time:this.delivery_time}};i=JSON.stringify(i);n[a]=p.ajax({url:ajaxurl+"/getFeedV1",method:"PUT",dataType:"json",data:i,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{this.response_code=e.code;if(e.code==1){if(!t){this.datas=[];this.services=[];this.estimation=[]}this.datas=[...this.datas,...e.details.data];this.services=e.details.services;this.estimation=e.details.estimation;this.total_message=e.details.total_message;this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.transaction_type=e.details.transaction_type;this.enabled_review=e.details.enabled_review;this.updateImage()}else{this.datas=[];this.services=[];this.estimation=[];this.total_message="";this.show_next_page=false;this.page=0;this.transaction_type=""}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},pauseReasonList(){axios({method:"POST",url:ajaxurl+"/pauseReasonList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.pause_reason_data=e.data.details}else{this.pause_reason_data=[]}})["catch"](e=>{}).then(e=>{})},updateImage(){h()},afterSaveStore(e){e.saved_store=e.saved_store==1?false:true},showFilter(){this.$refs.filter_feed.show()},afterApplyFilter(e){this.sortby=e.sortby;this.cuisine=e.cuisine;this.price_range=e.price_range;this.max_delivery_fee=e.max_delivery_fee;this.rating=e.rating;this.AutoFeed()},showSearchSuggestion(){this.$refs.search_suggestion.show()}}});ut.use(ElementPlus);const a=ut.mount("#vue-feed");const ht={data(){return{data:[],transaction_type:"",is_loading:false}}
925,mounted(){this.getServices()},methods:{getServices(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid")};n[t]=p.ajax({url:ajaxurl+"/getServices",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.transaction_type=e.details.transaction_type;this.$emit("setTransaction",this.transaction_type,e.details.data)}else{this.data=[];this.transaction_type=""}});n[t].always(e=>{this.is_loading=false})},setTransactionType(e){var t=g();var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),transaction_type:e,cart_uuid:getCookie("cart_uuid")};n[t]=p.ajax({url:ajaxurl+"/setTransactionType",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);this.transaction_type=e.details.transaction_type;this.$emit("afterSettransaction",this.transaction_type)}else{this["this"].transaction_type=""}});n[t].always(e=>{})}},template:`    
926	   
927	    <template v-if="is_loading" >
928			<el-skeleton animated style="width:auto;" class="mr-2">
929				<template #template>
930				<el-skeleton-item variant="button"></el-skeleton-item>
931				</template>
932			</el-skeleton>
933		</template>
934
935	   <div v-else class="dropdown widget-dropdown mr-2" >         
936         <button class="" type="button" id="dropdownMenuButton" 
937           data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
938           <template v-if="data[transaction_type]">
939           {{data[transaction_type].service_name}}
940           </template>
941         </button>
942         
943         <div class="dropdown-menu" aria-labelledby="services">		    
944		    <a v-for="item in data" href="javascript:;" @click="setTransactionType(item.service_code)" >
945		    {{item.service_name}}
946		    </a>
947		  </div>
948			  
949       </div> <!--dropdown-->   	
950    `};const _t={props:["layout","transaction_type","label","transaction_list"],data(){return{address1:"",whento_deliver:"",formatted_address:"",loading:false,delivery_option:[],delivery_datetime:"",visible:false}},mounted(){this.TransactionInfo()},methods:{TransactionInfo(){var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a=g();var s={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),choosen_delivery:t,merchant_id:e};n[a]=p.ajax({url:ajaxurl+"/TransactionInfo",method:"PUT",dataType:"json",data:JSON.stringify(s),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.address1=e.details.address1;this.whento_deliver=e.details.whento_deliver;this.formatted_address=e.details.formatted_address;this.delivery_option=e.details.delivery_option;this.delivery_datetime=e.details.delivery_datetime;this.visible=true;if(e.details.time_already_passed){setCookie("choosen_delivery",[],30)}}else{this.address1="";this.whento_deliver="";this.formatted_address="";this.delivery_option=[];this.delivery_datetime="";this.visible=false}});n[a].always(e=>{this.loading=false})},setTransactionInfo(){this.$emit("afterClick",{address1:this.address1,delivery_option:this.delivery_option,whento_deliver:this.whento_deliver,formatted_address:this.formatted_address,delivery_datetime:this.delivery_datetime})}},template:` 			
951	<template v-if="loading" >
952		<el-skeleton animated style="width:auto;">
953			<template #template>
954			<el-skeleton-item variant="button"></el-skeleton-item>
955			</template>
956		</el-skeleton>
957	</template>	
958	<div v-else class="position-relative">		    	    
959	    <template v-if="layout=='widget-dropdown-address'">
960		    <p class="m-0">
961			
962			<template v-if="whento_deliver=='schedule'">
963		          {{delivery_datetime}}
964			  </template>
965			  <template v-else>			    
966			    <span class="text-capitalize">
967				<template v-if="transaction_list[transaction_type]">
968				{{transaction_list[transaction_type].service_name}}
969				</template>
970				<template v-else>
971				{{transaction_type}}
972				</template>				
973				</span> {{label.now}}
974			  </template>
975
976			</p>
977			<div class="dropdown">
978			<button  @click="setTransactionInfo()"  class="btn-text dropdown-toggle" type="button" >
979			   <span class="text-truncate">{{address1}}</span>
980			</button>
981		</template>
982
983		<template v-else>
984		   
985	       <div class="widget-dropdown" v-if="visible" > 
986	         <button class="no-icons d-flex align-items-center" @click="setTransactionInfo()" >
987	          <span class="d-inline text-truncate">
988			     <template v-if="address1">
989				   {{address1}} {{formatted_address}}
990				 </template>
991				 <template v-else>
992				    {{label.select_address}}
993				 </template>
994			  </span> 
995	          <span class="d-inline">&nbsp;&#8226;&nbsp; 
996	          	          
997	          <template v-if="whento_deliver=='schedule'">
998		          {{delivery_datetime}}
999			  </template>
1000			  <template v-else>
1001			    <template v-if="delivery_option[whento_deliver]">
1002					{{ delivery_option[whento_deliver].short_name }}
1003				  </template>
1004			  </template>
1005			  
1006	          </span>
1007	         </button>
1008	       </div>
1009	     </template>  
1010      </div>	
1011	`};const pt={props:["label"],data(){return{data:[],screen_size:{width:0,height:0}}},mounted(){this.handleResize();window.addEventListener("resize",this.handleResize)},computed:{isMobileView(){if(this.screen_size.width<=991){return true}return false}},methods:{show(e){this.data=e;p(this.$refs.ModalDeliveryDetails).modal("show")},close(){p(this.$refs.ModalDeliveryDetails).modal("hide")},handleResize(){this.screen_size.width=window.innerWidth;this.screen_size.height=window.innerHeight}},template:` 		
1012	  <div class="modal" ref="ModalDeliveryDetails" tabindex="-1" role="dialog" 
1013    aria-labelledby="ModalDeliveryDetails" aria-hidden="true"  data-backdrop="static" data-keyboard="false" >
1014	   <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
1015	     <div class="modal-content" :class="{ 'modal-mobile': isMobileView }" > 
1016
1017		  <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;">
1018		   <h5 class="modal-title">{{label.title}}</h5>        
1019		   <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>
1020  	      </div>
1021
1022	       <div class="modal-body" >		   
1023	       	          
1024           <a href="javascript:;" @click="$emit('showAddress')" 
1025          class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2">
1026 		    <div class="flexcol mr-2"><i class="zmdi zmdi-pin"></i></div>
1027 		    <div class="flexcol" > 		   
1028			    <template v-if="data.address1">  		     		      
1029					<span class="bold mr-1">{{data.address1}}</span>
1030					<p class="m-0 text-muted">{{data.formatted_address}}</p>	                	                
1031				</template>
1032				<template v-else>
1033				   <span class="bold mr-1">{{label.select_address}}</span>
1034				</template>
1035 		    </div> 		    		    		    
1036	 	   </a>	 		   
1037	 	  
1038	 	  <a v-if="data" href="javascript:;" @click="$emit('showTransOptions')" 
1039	 	  class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2">
1040 		    <div class="flexcol mr-2"><i class="zmdi zmdi-time"></i></div>
1041 		    <div class="flexcol" > 		 
1042 		        <template v-if="data.whento_deliver=='schedule'">    		     		                      
1043 		        {{data.delivery_datetime}}         
1044				</template>
1045				<template v-else>
1046				   <template v-if="data.delivery_option">
1047					{{ data.delivery_option[data.whento_deliver].short_name }}
1048					</template>
1049				</template>
1050 		    </div> 		    		    		    
1051	 	   </a>	
1052           
1053           </div> <!--modal-body-->
1054           
1055           <div class="modal-footer justify-content-start">
1056           
1057            <button class="btn btn-black w-100" @click="close();" >
1058		       {{label.done}}
1059		    </button>
1060           
1061           </div> <!--modal-footer-->
1062	    
1063	   </div> <!--content-->
1064	  </div> <!--dialog-->
1065	</div> <!--modal-->
1066	`};
1066const ft={props:["label"],data(){return{data:[],loading:false,delivery_option:[],whento_deliver:"",opening_hours_date:[],opening_hours_time:[],delivery_date:"",delivery_time:"",error:[]}},mounted(){},computed:{hasError(){if(this.error.length>0){return true}return false}},methods:{show(e){p(this.$refs.modalselecttime).modal("show");this.getDeliveryTimes()},close(){p(this.$refs.modalselecttime).modal("hide");this.$emit("afterClose")},getDeliveryTimes(){var t=g();var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),merchant_id:e};n[t]=p.ajax({url:ajaxurl+"/getDeliveryTimes",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.delivery_option=e.details.delivery_option;this.whento_deliver=e.details.whento_deliver;this.opening_hours_date=e.details.opening_hours.dates;this.opening_hours_time=e.details.opening_hours.time_ranges;var t=Object.keys(e.details.opening_hours.dates);this.delivery_date=t[0];var t=e.details.opening_hours.time_ranges[this.delivery_date][0];this.delivery_time=JSON.stringify(t);if(!empty(e.details.delivery_date)){this.delivery_date=e.details.delivery_date}if(!empty(e.details.delivery_time)){this.delivery_time=e.details.delivery_time}u("SELECTED=>");u(this.delivery_date);u(this.delivery_time);u(this.delivery_option)}else{this.delivery_option=[];this.whento_deliver="";this.error=e.msg}});n[t].always(e=>{this.loading=false})},save(){var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),delivery_date:this.delivery_date,whento_deliver:this.whento_deliver,delivery_time:!empty(this.delivery_time)?JSON.parse(this.delivery_time):""};n[t]=p.ajax({url:ajaxurl+"/saveTransactionInfo",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.$emit("afterSave",e.details);if(e.code==1){var t={whento_deliver:e.details.whento_deliver,delivery_date:e.details.delivery_date,delivery_time:e.details.delivery_time};setCookie("choosen_delivery",JSON.stringify(t),30)}});n[t].always(e=>{this.loading=false})},JsonValue(e){return JSON.stringify({start_time:e.start_time,end_time:e.end_time,pretty_time:e.pretty_time})}},template:` 	
1067	<div class="modal" ref="modalselecttime" id="ModalTRNOptions" tabindex="-1" role="dialog" 
1068    aria-labelledby="ModalTRNOptions" aria-hidden="true"  >
1069	   <div class="modal-dialog" role="document">
1070	     <div class="modal-content"> 
1071	       <div class="modal-body" >
1072	       	       
1073	       <a href="javascript:;" @click="close" 
1074           class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
1075           
1076           <h4 class="m-0 mb-3 mt-3">{{label.title}}</h4> 	 
1077           
1078           <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
1079			    <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
1080			 </div>   
1081		                                
1082          <div class="btn-group btn-group-toggle input-group-small mt-2 mb-3" >
1083           <label  v-for="(item, index) in delivery_option" class="btn" :class="{ active: whento_deliver==item.value }"    >
1084              <input type="radio" :value="item.value" name="whento_deliver" v-model="whento_deliver"> 
1085              {{item.name}}
1086            </label>                                               
1087          </div>
1088                             
1089           <template v-if="whento_deliver=='schedule'">
1090	       
1091            <select class="form-control custom-select mb-3" v-model="delivery_date">		
1092		     <option v-for="(item, index) in opening_hours_date" :value="item.value"  >
1093		     {{ item.name}}
1094		     </option> 
1095		    </select> 
1096		    		    				    
1097		    <select id="delivery_time" class="form-control custom-select" 
1098		    v-model="delivery_time" v-if="opening_hours_date[delivery_date]" >		
1099		     <option v-for="(item, index) in opening_hours_time[delivery_date]" 
1100		     :value="JsonValue(item)"    >
1101		     {{item.pretty_time}}
1102			 </option> 
1103			</select>
1104           
1105		   </template>
1106                   			         
1107          </div> <!--modal-body-->
1108           
1109           
1110           <div class="modal-footer justify-content-start">
1111                                  		  
1112		     <button @click="save" 
1113	           class="btn btn-green w-100" :class="{ loading: loading }"
1114	           :disabled="hasError"
1115	            >
1116		          <span class="label">{{label.save}}</span>
1117		          <div class="m-auto circle-loader" data-loader="circle-side"></div>
1118		     </button>
1119           
1120           </div> <!--modal-footer-->
1121	    
1122	   </div> <!--content-->
1123	  </div> <!--dialog-->
1124	</div> <!--modal-->
1125	`};const gt={props:["label"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[]}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){this.clearData();return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getSearchSuggestion",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""}},template:`	
1126	
1127	<div class="mr-2 position-relative inputs-box-wrap d-none d-md-block">
1128      <input @click="showList" v-model="q" class="inputs-box-grey " :placeholder="label.placeholder" />
1129      <div v-if="!awaitingSearch" class="search_placeholder pos-right img-15"></div>
1130      <div v-if="awaitingSearch" class="icon img-15" data-loader="circle"></div>    
1131            
1132      <div v-if="hasData" @click="clearData"  class="icon-remove"><i class="zmdi zmdi-close"></i></div>
1133
1134      <div class="results with-border" v-if="show_list" >
1135        <ul class="list-unstyled m-0">
1136	     <li v-for="items in data" >			      
1137	      <a :href="items.url" >
1138	       <div class="row align-items-center no-gutters">
1139	         <div class="col col-md-auto  mr-2">
1140	           <img class="img-30 rounded-pill" :src="items.url_logo" >
1141	         </div>
1142	         <div class="col text-truncate">
1143	           <h6 class="m-0 text-truncate">{{items.title}}</h6>
1144	           <p class="m-0 text-truncate text-grey ">  
1145	             <span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span>
1146	           </p>
1147	         </div>
1148	       </div>
1149	      </a>
1150	     </li>	     	    
1151	   </ul>
1152      </div>                
1153	</div>	
1154
1155	<!---
1156	<div class="d-block d-md-none mr-3	 mr-md-2">
1157	  <button class="btn btn-search rounded-circle bg-light"><i class="zmdi zmdi-search"></i></button>
1158	</div>
1159	--->
1160	`};const vt=Vue.createApp({components:{"component-search-suggestion":gt},methods:{closeSuggestion(){this.$refs.suggestion.show_list=false}}});vt.directive("click-outside",Fe);const yt=vt.mount("#vue-search-nav");const bt={template:"#xtemplate_location_current_address",data(){return{data:[],city_id:null,area_id:null,state_id:null,postal_id:null,loading:false,search_type:null}},created(){const e=new URLSearchParams(window.location.search);this.city_id=e.get("city_id");this.area_id=e.get("area_id");this.state_id=e.get("state_id");this.postal_id=e.get("postal_id");if(typeof location_searchtype!=="undefined"&&location_searchtype!==null){this.search_type=location_searchtype}if(!this.city_id&&this.search_type==1){const t=getLocation();if(t.city_id&&t.area_id){this.city_id=t.city_id;this.area_id=t.area_id}}else if(!this.state_id&&this.search_type==2){const t=getLocation();if(t.state_id&&t.city_id){this.city_id=t.city_id;this.state_id=t.state_id}}},mounted(){this.getLocationCurrentAddress()},computed:{hasLocation(){if(Object.keys(this.data).length>0){return true}return false}},methods:{getLocationCurrentAddress(){this.loading=true;if(!this.city_id&&this.search_type==1){const a=getLocation();if(a.city_id&&a.area_id){this.city_id=a.city_id;this.area_id=a.area_id}}else if(!this.state_id&&this.search_type==2){const a=getLocation();if(a.state_id&&a.city_id){this.city_id=a.city_id;this.state_id=a.state_id}}else if(!this.state_id&&this.search_type==3){const a=getLocation();if(a.postal_id){this.postal_id=a.postal_id}}else{const s=new URLSearchParams(window.location.search);if(s.size>0){if(this.search_type==1){this.city_id=s.get("city_id");this.area_id=s.get("area_id")}else if(this.search_type==2){this.city_id=s.get("city_id");this.state_id=s.get("state_id")}else if(this.search_type==3){this.postal_id=s.get("postal_id")}}}let e="city_id="+this.city_id;e+="&area_id="+this.area_id;e+="&state_id="+this.state_id;e+="&postal_id="+this.postal_id;let t=getFromLocalStorageStore(V,"SelectedtransactionType");if(t){e+="&transaction_type="+t}if(typeof merchant_id!=="undefined"&&merchant_id!==null){e+="&merchant_id="+merchant_id}axios.get(q+"/getLocationCurrentAddress?"+e).then(t=>{if(t.data.code==1){this.data=t.data.details.data}else{this.data=[]}if(!t.data.details.transaction_type_valid){let e=t.data.details.transaction_type;setCookie("cart_transaction_type",e,30);i(V,"SelectedtransactionType",e)}setTimeout(()=>{if(window.vm_location_feed){window.vm_location_feed.location_required=t.data.details.address_needed}},500)})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},showSelectLocation(){window.vm_location_feed.showCurrentaddress()}}};const wt=Vue.createApp({data(){return{data:[],addresses:[],deliveryAddress:[],location_data:[]}},components:{"component-services":ht,"component-transaction-info":_t,"component-delivery-details":pt,"component-change-address":Ee,"component-trans-options":ft,"components-select-address":Ve,"components-address-form":Be,"components-location-current-address":bt},mounted(){},methods:{setTransaction(e){this.transaction_type=e},reloadFeed(e){a.transaction_type=e;a.Search(false)},setTransactionInfo(e){this.data=e;this.$refs.transaction.show(this.data)},showAddress(){this.$refs.transaction.close();this.$refs.address.showModal();this.getClientAddresses()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.transaction.close();this.$refs.address_modal.visible=true}else{this.$refs.transaction.close();this.location_data=e}},onSavelocation(e,t){u("onSavelocation 1",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,formatted_address:t.formatted_address,address1:t.address1,address2:t.address2,postal_code:t.postal_code,company:t.company};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){this.refreshWidget();this.$refs.address_form.close()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},afterPointaddress(e){this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.refreshWidget();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},refreshWidget(e){if(typeof a!=="undefined"&&a!==null){a.Search(false);a.$refs.ref_banner.getBanner()}
1160if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo();this.$refs.transaction.close();if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterSetAddress(){u("afterSetAddress");this.$refs.address.close();this.refreshWidget()},afterCloseAddress(){this.$refs.transaction.show(this.data)},ShowTransOptions(){this.$refs.transaction.close();this.$refs.transaction_options.show()},afterSaveTransOptions(e){this.$refs.transaction_options.close();if(typeof a!=="undefined"&&a!==null){u("afterSaveTransOptions");u(e.delivery_time);a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time.start_time;a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.whento_deliver=e.whento_deliver;this.$refs.transaction_info.delivery_datetime=e.delivery_datetime;this.$refs.transaction.close()},editAddress(e){u("editAddress=>");u(e);this.$refs.address.close();this.location_data=e},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo()},afterDeleteAddress(){this.getClientAddresses()},afterDeleteAddForm(){},getClientAddresses(){axios({method:"POST",url:ajaxurl+"/getAddresses",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.addresses=e.data.details.data}else{this.addresses=[]}})["catch"](e=>{}).then(e=>{})}}});wt.use(ElementPlus);window.vm_widget_nav=wt.mount("#vue-widget-nav");const xt=Vue.createApp({components:{"components-location-current-address":bt}});xt.use(ElementPlus);window.VmWidgetNavMobile=xt.mount("#location-widget-subnav-mobile");const St=Vue.createApp({data(){return{data:[],addresses:[],transaction_type:"",transaction_list:[],deliveryAddress:[],location_data:[]}},components:{"component-services":ht,"component-transaction-info":_t,"component-delivery-details":pt,"component-change-address":Ee,"component-trans-options":ft,"component-address":Pe,"component-mobile-search-suggestion":ct,"components-select-address":Ve,"components-address-form":Be},mounted(){},methods:{setTransaction(e,t){this.transaction_type=e;this.transaction_list=t},reloadFeed(e){s;this.transaction_type=e;a.transaction_type=e;a.Search(false)},setTransactionInfo(e){this.data=e;this.$refs.transaction.show(this.data)},showAddress(){this.$refs.transaction.close();this.$refs.address.showModal();this.getClientAddresses()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{this.$refs.transaction.close();this.location_data=e}},afterPointaddress(e){this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.afterSetAddress();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},afterSetAddress(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo();this.$refs.address.close();this.$refs.transaction.close();if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterCloseAddress(){this.$refs.transaction.show(this.data)},ShowTransOptions(){this.$refs.transaction.close();this.$refs.transaction_options.show()},afterSaveTransOptions(e){this.$refs.transaction_options.close();if(typeof a!=="undefined"&&a!==null){u("afterSaveTransOptions");u(e.delivery_time);a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time.start_time;a.Search(false)}
1160if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.whento_deliver=e.whento_deliver;this.$refs.transaction_info.delivery_datetime=e.delivery_datetime;this.$refs.transaction.close()},editAddress(e){this.$refs.address.close();this.$refs.addressform.show(e.address_uuid)},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof a!=="undefined"&&a!==null){a.Search(false)}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.$refs.transaction_info.TransactionInfo()},afterDeleteAddress(){this.getClientAddresses()},afterDeleteAddForm(){},getClientAddresses(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.addresses=e.details.data}else{this.addresses=[]}})},showSearchSuggestion(){this.$refs.search_suggestion.show()},onSavelocation(e,t){u("onSavelocation here");this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,formatted_address:t.formatted_address,address1:t.address1};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){this.afterSetAddress();this.$refs.address_form.close()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},editAddress(e){this.$refs.address.close();this.location_data=e}}});St.use(ElementPlus);const Tt=St.mount("#vue-widget-nav-mobile");const kt={props:["merchant_id","label"],data(){return{loading:false,data:[],modal:false}},mounted(){this.getPromoDetails()},computed:{getData(){return this.data},hasData(){if(Object.keys(this.data).length>0){return true}return false}},methods:{getPromoDetails(){this.loading=true;let e;let t=getCookie("currency_code");t=!empty(t)?t:"";e="merchant_id="+this.merchant_id;e+="&currency_code="+t;e+=addValidationRequest();axios({method:"POST",url:ajaxurl+"/getPromoDetails",data:e,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`	
1161	<el-skeleton :rows="1" animated :loading="loading" ></el-skeleton>
1162	<div v-if="hasData" class="d-flex align-self-center">
1163		<div class="mr-1"><i style="transform: rotate(90deg);" class="fas fa-tag"></i></div>					  
1164		<p class="mr-1">{{label.enjoy}}</p>
1165		<p class="mr-1">
1166		<a href="javascript:;" class="text-green" @click="modal=true">
1167			{{label.see_details}}
1168		</a>
1169		</p>
1170	</div>	
1171
1172	<el-dialog
1173	v-model="modal"
1174	:title="label.title"
1175	width="40%"  	
1176	> 	
1177	<template v-for="items in getData" :key="items" >
1178	  <div class="d-flex align-items-center mb-2">		
1179		<div class="with-promo-icon"></div>
1180		<div class="text-truncatex">{{ items.discount_name }}</div>
1181	  </div>
1182	</template>
1183
1184	</el-dialog>
1185	`};const It={template:"#xtemplate_location_estimation",data(){return{data:[],loading:false,merchant_id:null,search_type:null,transaction_type:null}},created(){if(typeof merchant_id!=="undefined"&&merchant_id!==null){this.merchant_id=merchant_id}if(typeof location_searchtype!=="undefined"&&location_searchtype!==null){this.search_type=location_searchtype}},mounted(){this.getLocationEstimation()},methods:{getLocationEstimation(){this.loading=true;let e="search_type="+this.search_type;const t=getLocation();e+="&cart_uuid="+getCookie("cart_uuid");e+="&city_id="+t.city_id;e+="&area_id="+t.area_id;e+="&state_id="+t.state_id;e+="&postal_id="+t.postal_id;e+="&merchant_id="+this.merchant_id;axios.get(q+"/getLocationEstimation?"+e).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.transaction_type=e.data.details.transaction_type}else{this.data=[];this.transaction_type=null}})["catch"](e=>{console.error("Error:",e)}).then(e=>{this.loading=false})},setTransactionType(t){if(t!=this.transaction_type){axios({method:"POST",url:ajaxurl+"/updateService",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+t+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.transaction_type=t;setCookie("cart_transaction_type",this.transaction_type,30);
1185setCookie("cart_uuid",e.data.details.cart_uuid,30);i(V,"SelectedtransactionType",this.transaction_type);if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.$refs.ref_location_current_address.getLocationCurrentAddress()}if(typeof window.vm_location_feed!=="undefined"&&window.vm_location_feed!==null){window.vm_location_feed.$refs.ref_check_location.checkLocations()}}})["catch"](e=>{}).then(e=>{})}}}};const Ct=Vue.createApp({components:{"component-save-store":dt,"component-merchant-services":Ne,"component-promo-details":kt,"components-location-estimation":It},data(){return{found:false,is_loading:false,image_background:""}},mounted(){this.getSaveStore()},methods:{afterUpdateServices(e){if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}},getSaveStore(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:merchant_id};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getSaveStore",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.found=true}else{this.found=false}});n[t].always(e=>{this.is_loading=false})}}});Ct.use(ElementPlus);window.vm_merchant_details=Ct.mount("#vue-merchant-details");const Ot={props:["data","restaurant_name"],data(){return{owl:undefined,drawer:false}},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},mounted(){setTimeout(()=>{p(window).on("activate.bs.scrollspy",(e,t)=>{var a=p("a[href='"+t.relatedTarget+"']");var s=parseInt(a[1].dataset.id);this.SlideTo(s)})},500)},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.category_carousel).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})},nextSlide(){this.owl.trigger("next.owl.carousel")},prevSlide(){this.owl.trigger("prev.owl.carousel")},SlideTo(e){this.owl.trigger("to.owl.carousel",[e,500,true])}},template:`      
1186   <el-affix target=".section-menu" :offset="0" z-index="9" >   
1187   <div class="row no-gutters align-items-center category-carousel border-bottom">
1188        <div class="col-1 text-left">
1189		  <a @click="drawer=true" class="btn font-weight-bold"><i class="zmdi zmdi-menu"></i></a>
1190		</div>
1191        <div class="col-1 text-left">
1192		  <a @click="prevSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-left"></i></a>
1193		</div>
1194		<div class="col-9">
1195			<div ref="category_carousel" id="menu-category"  class="owl-carousel owl-theme">
1196				<template v-for="(item, index) in data" >	   
1197				<a :href="'#'+item.category_uiid" :data-id="index" :class="{active : index==0}" class="nav-link d-flex align-items-center font-weight-bolder mr-3">
1198					<p class="m-0">{{item.category_name}}</p>
1199				</a>
1200				</template>    
1201			</div>
1202		</div>
1203		<div class="col-1 text-right">
1204		   <a @click="nextSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-right"></i></a>
1205		</div>
1206   </div>   
1207   </el-affix>
1208      
1209   <el-drawer
1210    v-model="drawer"    
1211    direction="btt"    
1212	size="65%"
1213	append-to-body="true"
1214	:title="restaurant_name" 
1215	:with-header="true"
1216	custom-class="drawer-category"
1217   >    
1218    <div class="list-group list-group-modified">
1219	 <a @click="drawer=false"  v-for="(item, index) in data" :href="'#'+item.category_uiid" class="list-group-item d-flex justify-content-between">
1220	  <div class="">{{item.category_name}}</div>
1221	  <div class="">
1222	    <div class="bg-light btn-circle rounded-pill">{{item.items.length}}</div>
1223	  </div>
1224	 </a>
1225	</div>
1226  </el-drawer>   
1227   `};const jt={data(){return{awaitingSearch:false,q:"",some_words:[]}},created(){this.some_words=JSON.parse(some_words)},computed:{hasSearch(){if(this.q){return true}return false}},watch:{q(t,e){if(!this.awaitingSearch){if(empty(t)){return false}let e=getCookie("currency_code");e=!empty(e)?e:"";setTimeout(()=>{axios({method:"POST",url:ajaxurl+"/searchmenu",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+this.q+"&merchant_id="+merchant_id+"&currency_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.$emit("afterSearch",this.q,e.data.details.data)}else{this.$emit("afterSearch",this.q,[])}})["catch"](e=>{}).then(e=>{this.awaitingSearch=false})},1e3);this.awaitingSearch=true}}},methods:{clearSearch(){this.q="";this.$emit("clearSearch")}},template:`  
1228	<el-input
1229		v-model="q"
1230		class="w-100"
1231		size="large"
1232		:placeholder="some_words.search_in_menu" 					
1233	>
1234	<template #prefix>
1235		<i class="zmdi zmdi-search" class="font20"></i>				
1236	</template>
1237	<template #suffix>
1238		<div v-if="awaitingSearch" class="loading">
1239			<div class="circle-loader" data-loader="circle-side"></div>
1240		</div>
1241		<template v-else>
1242			<template v-if="hasSearch">
1243			<el-link type="primary" @click="clearSearch" >
1244			{{some_words.clear}}
1245			</el-link>
1246			</template>
1247		</template>
1248	</template>
1249	</el-input>
1250	`};const Et={props:["data"],components:{"component-search-menu":jt},data(){return{mySwiper:undefined,some_words:[]}},mounted(){setTimeout(()=>{p(window).on("activate.bs.scrollspy",(e,t)=>{let a=p("a[href='"+t.relatedTarget+"']");let s=parseInt(a[1].dataset.id);this.SlideTo(s)})},500);this.some_words=JSON.parse(some_words)},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.category_carousel).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})},SlideTo(e){this.owl.trigger("to.owl.carousel",[e,500,true])},afterSearch(e,t){this.$emit("afterSearch",e,t)},clearSearch(){this.$emit("clearSearch")}},template:`      		
1251	<el-affix target=".section-menu" :offset="0" z-index="9"  >                     
1252		<div class="bg-white p-1 mb-4 d-none d-lg-block category-owlcarousel">
1253		  <div class="row no-gutters">
1254		    <div class="col-3">
1255			
1256			 <component-search-menu
1257			 @after-search="afterSearch"
1258			 @clear-search="clearSearch"
1259			 >
1260			 </component-search-menu>
1261			
1262			</div>
1263			<div class="col-9">					  
1264				<div ref="category_carousel" id="menu-category"  class="owl-carousel owl-theme">
1265					<template v-for="(item, index) in data" >	   
1266					<a :href="'#'+item.category_uiid" :data-id="index" :class="{active : index==0}" class="nav-link d-flex align-items-center  mr-3">
1267						<div class="m-0">{{item.category_name}}</div>
1268					</a>
1269					</template>    
1270				</div>
1271
1272			</div>
1273		  </div>
1274		</div>           
1275	</el-affix>
1276	`};const Pt={template:"#xtemplate_menusearch",props:["q","data","promo"],computed:{hasSearch(){if(!empty(this.q)){return true}return false},getData(){if(Object.keys(this.data).length>0){return this.data}return false},hasResults(){if(Object.keys(this.data).length>0){return true}return false}},methods:{viewItem(e){if(typeof E!=="undefined"&&E!==null){E.viewItemBefore(e)}},getPromoMessage(e){return this.promo[e.item_id]?.message||e?.promo_data?.message},isEligible(e){return this.promo[e.item_id]?.is_eligible},isEligibleItem(e){if(!e.is_promo_free_item){return true}return this.promo[e.item_id]?.is_eligible||false}}};const Ft={components:{"component-search-menu":jt},methods:{afterSearch(e,t){this.$emit("afterSearch",e,t)},clearSearch(){this.$emit("clearSearch")}},template:`
1277	<div class="pt-2">
1278	<component-search-menu
1279		@after-search="afterSearch"
1280		@clear-search="clearSearch"
1281		>
1282    </component-search-menu>	
1283	</div>
1284	`};const Nt={props:["label","enabled","merchant_id"],data(){return{modal:false}},mounted(){const e=getFromLocalStorageStore(StoreMapName,"ageVerifications"+this.merchant_id);if(this.enabled&&!e){this.modal=true}},methods:{ConfirmAge(){i(StoreMapName,"ageVerifications"+this.merchant_id,this.merchant_id);this.modal=false},Cancel(){window.location.href=this.label.home_url}},template:"#xtemplate_age_verifications"};const Rt=Vue.createApp({components:{"components-category-carousel":Ot,"component-topcategory":Et,"component-menu-search-result":Pt,"components-search-menu-mobile":Ft,"components-age-verification":Nt},data(){return{category_loading:true,category_data:[],q:"",search_menu_data:[]}},mounted(){this.getCategory()},methods:{getCategory(){this.category_loading=true;let e="merchant_id="+merchant_id;e+=addValidationRequest();axios({method:"POST",url:ajaxurl+"/getCategory",data:e}).then(e=>{if(e.data.code==1){this.category_data=e.data.details.data.category}else{this.category_data=[]}})["catch"](e=>{}).then(e=>{this.category_loading=false})},afterSearch(e,t){this.q=e;this.search_menu_data=t;this.scrollToResults()},clearSearch(){this.q="";this.search_menu_data=[]},scrollToResults(){this.$refs["search_result"].scrollIntoView({behavior:"smooth"})}}});Rt.use(ElementPlus);const Dt=Rt.mount("#vue-merchant-category");const Mt=Vue.createApp({data(){return{transaction_list:[],transaction:""}},mounted(){this.getTransactionList()},updated(){u("=>"+this.transaction);this.updateService()},methods:{getTransactionList(){var e;var t=g();e="merchant_id="+merchant_id;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/servicesList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_list=e.details.data;this.transaction=e.details.transaction}else{this.transaction_list=[];this.transaction=""}})},updateService(){if(!empty(vue_cart.cart_uuid)){var e;var t=g();e="cart_uuid="+vue_cart.cart_uuid;e+="&transaction_type="+this.transaction;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/updateService",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{vue_cart.loadcart()})}}}}).mount("#vue-services-list");const At={props:["label","merchant_id"],data(){return{modal:false,loading:false,item_id:"",allergen:[],allergen_data:[]}},methods:{show(e){this.modal=true;this.item_id=e;this.getAllergenInfo()},getAllergenInfo(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAllergenInfo",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&item_id="+this.item_id+"&merchant_id="+this.merchant_id,timeout:c}).then(e=>{if(e.data.code==1){this.allergen=e.data.details.allergen;this.allergen_data=e.data.details.allergen_data}else{this.allergen=[];this.allergen_data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`  
1285  <el-dialog
1286  v-model="modal"
1287  :title="label.title"
1288  width="40%"  
1289  class="modal-allergens"
1290  > 
1291
1292  <template v-if="loading" >
1293  <div style="min-height:100px;" v-loading="loading">
1294  </div>
1295  </template>
1296  <template v-else >
1297  <h5>{{label.sub_title}}</h5>  
1298  <ul class="pl-3">
1299    <template v-for="item in allergen">
1300    <li v-if="allergen_data[item]">
1301	{{ allergen_data[item] }}
1302	</li>	
1303	</template>
1304  </ul>  
1305  </template>
1306    
1307  </el-dialog>
1308  `};const $t={props:["description","max_lenght","label"],data(){return{isExpanded:false}},computed:{truncatedDescription(){return this.description.length>this.max_lenght?this.description.slice(0,this.max_lenght)+"...":this.description},showReadMore(){return this.description.length>this.max_lenght}},methods:{toggleReadMore(){this.isExpanded=!this.isExpanded}},template:`	
1309     <p class="text-descriptions">
1310      <span v-html="isExpanded ? description : truncatedDescription" ></span>
1311      <span v-if="showReadMore" @click="toggleReadMore" class="read-more">
1312        {{ isExpanded ? label.read_less : label.read_more }}
1313      </span>
1314    </p>
1315    `};var C=[];var O=[];var j=[];var Yt=[];var Kt;const Lt=Vue.createApp({components:{"component-change-address":Ee,"money-format":Ke,"components-search-menu":Ft,"component-menu-search-result":Pt,"component-allergens":At,"text-description":$t},data(){return{merchant_id:0,menu_loading:true,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qty:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",view_data:[],item_loading:false,item_in_cart:0,merchant_data:[],items_not_available:[],category_not_available:[],menu_layout:"list",q:"",search_menu_data:[],allergen:[],allergen_data:[],item_gallery:[],image_featured:"",money_config:"",dish:[],show_points:null,promoEligibility:{}}},created(){this.geStoreMenu()},mounted(){let e=getCookie("menu_layout");if(!empty(e)){this.menu_layout=e}},updated(){if(this.item_addons_load==true){this.ItemSummary()}ce()},computed:{getAllergen(){return this.allergen},hasAllergen(){if(Object.keys(this.allergen).length>0){return true}return false},getItemGallery(){return this.item_gallery}},methods:{getPromoMessage(e){return this.promoEligibility[e.item_id]?.message||e?.promo_data?.message},isEligible(e){return this.promoEligibility[e.item_id]?.is_eligible},isEligibleItem(e){if(!e.is_promo_free_item){return true}return this.promoEligibility[e.item_id]?.is_eligible||false},geStoreMenu(){var e;let t=getCookie("currency_code");t=!empty(t)?t:"";e="merchant_id="+merchant_id;e+="&currency_code="+t;e+=addValidationRequest();var a=g();n[a]=p.ajax({url:ajaxurl+"/geStoreMenu",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}}).done(e=>{this.menu_loading=false;if(e.code==1){this.merchant_id=e.details.merchant_id;var t=e.details.data.category;var a=e.details.data.items;var s=[];var i=[];this.items_not_available=e.details.data.items_not_available;this.category_not_available=e.details.data.category_not_available;this.dish=e.details.data.dish;if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){if(!empty(a[t])){i.push(a[t])}});s.push({cat_id:t.cat_id,category_name:t.category_name,category_description:t.category_description,category_uiid:t.category_uiid,items:i});i=[]})}this.menu_data=s;this.updateImage()}})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false},updateImage(){h()},viewItemBefore(e){this.viewItem(e)},afterChangeAddress(){if(typeof M!=="undefined"&&M!==null){M.visible=false}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}var e=Object.keys(this.view_data).length;u("count=>"+e);u(this.view_data);if(e>0){this.viewItem(this.view_data);this.view_data=[]}},viewItem(e){this.special_instructions="";p(this.$refs.modal_item_details).modal("show");var t=e.item_uuid;var a=e.cat_id;var s;let i=getCookie("currency_code");i=!empty(i)?i:"";s="merchant_id="+merchant_id;s+="&item_uuid="+t;s+="&cat_id="+a;s+="&currency_code="+i;s+=addValidationRequest();var o=1;this.item_loading=true;NProgress.start();n[o]=p.ajax({url:ajaxurl+"/getMenuItem",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[o]!=null){n[o].abort()}}});n[o].done(e=>{if(e.code==2){p("#itemModal").modal("hide");return}this.show_points=e.details.show_points;C=e.details.data.items;O=e.details.data.addons;j=e.details.data.addon_items;Yt=e.details.data.items.item_addons;var t=e.details.data.meta;this.money_config=e.details.money_config;this.item_gallery=e.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var s=e.details.data.meta_details;var i={cooking_ref:[],ingredients:[],dish:[]};let o=e.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(s[a])){if(!empty(s[a][t])){let e=false;if(a=="ingredients"&&o){e=true}i[a].push({meta_id:s[a][t].meta_id,meta_name:s[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=i;
1315this.getSizeData(r);this.sold_out_options=e.details.sold_out_options;this.updateImage()});n[o].always(e=>{this.item_loading=false;NProgress.done()})},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({rtl:e,loop:false,margin:10,nav:false,dots:false,responsive:{0:{items:3},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},updateImage(){h()},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;this.getSizeData(t)},getSizeData(a){Kt=[];var s=[];if(!empty(Yt[a])){p.each(Yt[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){if(typeof j[t]!=="undefined"&&j[t]!==null){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})}});Kt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Kt;this.item_addons_load=true},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}var o=[];var r=[];a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},updateInlineQtyBefore(e,t,a){this.updateInlineQty(e,t,a)},updateInlineQty(t,a,s){if(!empty(vue_cart.cart_merchant.merchant_id)){if(this.merchant_id!=vue_cart.cart_merchant.merchant_id){var e=vue_cart.cart_merchant.confirm_add_item;Ut.show({content:e}).then(e=>{if(e){Ut.clearCart(vue_cart.cart_uuid).then(e=>{this.inlineQty(t,a,s)})}})}else this.inlineQty(t,a,s)}else this.inlineQty(t,a,s)},inlineQty(e,t,a){if(e=="add"){t.qty+=1}else t.qty-=1;var s=p(".active .item_size_id_"+t.item_uuid).val();if(empty(s)){s=t.price[0]?t.price[0].item_size_id:""}let i=getCookie("cart_transaction_type");try{if(empty(i)){if(typeof vm_merchant_details.$refs.ref_services!=="undefined"&&vm_merchant_details.$refs.ref_services!==null){i=vm_merchant_details.$refs.ref_services.transaction}else if(typeof vm_merchant_details.$refs.ref_location_services!=="undefined"&&vm_merchant_details.$refs.ref_location_services!==null){i=vm_merchant_details.$refs.ref_location_services.transaction_type}}}catch(l){}var o={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,cat_id:a,item_token:t.item_uuid,item_size_id:s,item_qty:t.qty,item_addons:[],special_instructions:"",meta:[],cart_uuid:getCookie("cart_uuid"),inl
1315ine_qty:1,transaction_type:i,if_sold_out:this.if_sold_out};var r;if(r=lt()){o.whento_deliver=r.whento_deliver;o.delivery_date=r.delivery_date;o.delivery_time=r.delivery_time;o.delivery_time_raw=r.delivery_time_raw}var d=1;o=JSON.stringify(o);n[d]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:o,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[d]!=null){n[d].abort()}}});n[d].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}})},CheckaddCartItems(){if(!empty(vue_cart.cart_merchant.merchant_id)){if(this.items.merchant_id!=vue_cart.cart_merchant.merchant_id){p("#itemModal").modal("hide");var e=vue_cart.cart_merchant.confirm_add_item;Ut.show({content:e}).then(e=>{if(e){Ut.clearCart(vue_cart.cart_uuid).then(e=>{u("resp:"+e);this.addCartItems()})}})}else this.addCartItems()}else this.addCartItems()},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;let t=getCookie("cart_transaction_type");try{if(empty(t)){if(typeof vm_merchant_details.$refs.ref_services!=="undefined"&&vm_merchant_details.$refs.ref_services!==null){t=vm_merchant_details.$refs.ref_services.transaction}else if(typeof vm_merchant_details.$refs.ref_location_services!=="undefined"&&vm_merchant_details.$refs.ref_location_services!==null){t=vm_merchant_details.$refs.ref_location_services.transaction_type}}}catch(i){}var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:this.item_qty,item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:t,if_sold_out:this.if_sold_out};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);p("#itemModal").modal("hide");if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}});n[s].always(e=>{u("always");this.add_to_cart=false})},hasItemInCart(e,t){this.item_in_cart=e;this.merchant_data=t},showDrawerCart(){if(typeof R!=="undefined"&&R!==null){R.showCartPreview()}},changeMenuLayout(e){this.menu_layout=e;setCookie("menu_layout",e,30)},afterSearch(e,t){this.q=e;this.search_menu_data=t;this.scrollToResults()},clearSearch(){this.q="";this.search_menu_data=[]},scrollToResults(){this.$refs["search_result"].scrollIntoView({behavior:"smooth"})},showAllergens(e){this.$refs.ref_allergens.show(e)},async promoCheck(e){try{let e=getCookie("currency_code");e=!empty(e)?e:"";const a=new URLSearchParams({cart_uuid:getCookie("cart_uuid"),merchant_id:merchant_id??0,currency_code:e??""}).toString();const s=await axios.get(ajaxurl+"/PromoCheck?"+a);if(s.data.code==1){this.promoEligibility=s.data.details.data}else{this.promoEligibility=[]}}catch(t){}}}});Lt.use(ElementPlus);const E=Lt.mount("#vue-merchant-menu");const zt=Vue.createApp({data(){return{back_url:""}}}).mount("#vue-checkout-back");const qt=Vue.createApp({data(){return{cart_loading:true,cart_uuid:"",cart_items:[],cart_summary:[],cart_merchant:[],cart_total:[],cart_subtotal:[],error:[],selected_payment_uuid:"default",error_payment:"",error_placeorder:[],is_submit:false,distance_pretty:"",points_data:[],some_words:[],use_digital_wallet:false,use_partial_payment:false,checkout_transaction_type:"",min_order_free_delivery:[],delivery_details:null}},mounted(){this.loadcart();this.hasSelectedPayment(this.selected_payment_uuid);if(typeof some_words!=="undefined"&&some_words!==null){this.some_words=JSON.parse(some_words)}},updated(){p(".section-cart .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})},computed:{hasError(){if(this.error.length>0){return true}return false},hasPayment(){if(!empty(this.error_payment)){me();return true}return false}
1315,showFreeDelivery(){if(this.min_order_free_delivery){if(this.min_order_free_delivery.amount_needed>0){return true}}return false},freeDeliveryPercentage(){if(this.min_order_free_delivery){return this.min_order_free_delivery.percentage}return 0}},watch:{selected_payment_uuid(e,t){this.hasSelectedPayment(e)},use_digital_wallet(e,t){if(e){this.error_payment=""}else{if(empty(this.selected_payment_uuid)){this.error_payment=this.some_words.please_select_valid_payment}}}},methods:{inArray:function(e,t){var a=t.length;for(var s=0;s<a;s++){if(t[s]==e)return true}return false},hasSelectedPayment(e){if(empty(e)){this.error_payment=this.some_words.please_select_valid_payment}else this.error_payment=""},loadcart(){var t=getCookie("cart_uuid");if(!empty(t)){var a="";if(typeof payload!=="undefined"&&payload!==null){a=JSON.parse(payload)}var s=g();let e=getCookie("currency_code");e=!empty(e)?e:"";const o=getLocation();const r=getFromLocalStorageStore(StoreMapName,"selectedAddress");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:t,currency_code:e,payload:a,location:o,latitude:r?r.latitude:"",longitude:r?r.longitude:""};NProgress.start();n[s]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.cart_merchant=e.details.data.merchant;this.cart_uuid=e.details.cart_uuid;this.cart_items=e.details.data.items;this.cart_summary=e.details.data.summary;this.cart_total=e.details.data.total;this.error=e.details.error;this.cart_subtotal=e.details.data.subtotal;this.distance_pretty=e.details.distance_pretty;this.points_data=e.details.points_data;this.min_order_free_delivery=e.details.data.min_order_free_delivery;this.delivery_details=e.details.delivery_details;var t=false;if(this.inArray("checkout",e.details.payload)){t=true;if(typeof ma!=="undefined"&&ma!==null){ma.setData(e.details.checkout_data)}}this.checkout_transaction_type=e.details.checkout_data.transaction_type;var a=e.details.checkout_data.transaction_type;if(typeof wa!=="undefined"&&wa!==null&&t==true){wa.transaction_type=a}if(typeof Sa!=="undefined"&&Sa!==null&&t==true){Sa.transaction_type=a}if(typeof F!=="undefined"&&F!==null&&t==true){F.transaction_type=a;F.amount_to_pay=this.cart_total.raw}if(typeof e.details.out_of_range!=="undefined"&&e.details.out_of_range!==null){if(typeof Ta!=="undefined"&&Ta!==null){Ta.out_of_range=e.details.out_of_range;Ta.address_component=e.details.address_component}if(typeof M!=="undefined"&&M!==null){M.out_of_range=e.details.out_of_range;M.address_component=e.details.address_component}}if(typeof R!=="undefined"&&R!==null){R.cartCount(e.details.items_count)}if(typeof zt!=="undefined"&&zt!==null){zt.back_url=e.details.data.merchant.restaurant_slug}if(typeof gs!=="undefined"&&gs!==null){gs.setTransaction(a)}if(typeof li!=="undefined"&&li!==null){li.transaction_type=a}if(typeof F!=="undefined"&&F!==null){F.refreshWallet({cart_total:this.cart_total.raw,use_digital_wallet:this.use_digital_wallet})}}else{this.cart_items=[];this.cart_summary=[];this.cart_total=[];this.error=[];this.cart_subtotal=[];this.min_order_free_delivery=[];if(typeof R!=="undefined"&&R!==null){R.cartCount(0)}}if(typeof fs!=="undefined"&&fs!==null){fs.checkStoreOpen();setTimeout(()=>{fs.storeAvailable()},1)}me();this.updateImage();setTimeout(()=>{this.updateMenuQty()},1);if(typeof E!=="undefined"&&E!==null){E.promoCheck(this.cart_subtotal?.raw||0)}if(typeof wi!=="undefined"&&wi!==null){wi.fetchWallet(this.cart_total.raw)}});n[s].always(e=>{NProgress.done();this.cart_loading=false;this.hasSelectedPayment(this.selected_payment_uuid)})}else this.cart_loading=false},updateImage(){h()},remove(e,t){var a;var s=1;a="row="+e+"&cart_uuid="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/removeCartItem",method:"POST",dataType:"json",data:a,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.loadcart();if(typeof Xs!=="undefined"&&Xs!==null){Xs.getAvailablePoints(0)}}})},updateCartQty(e,t,a,s){if(e==1){t++}else t--;if(t<=0){this.remove(a,s)}else{this.updateCartItems(t,a,s)}},updateCartItems(e,t,a){var s;var i=1;s="cart_uuid="+a;s+="&cart_row="+t;s+="&item_qty="+e;s+=addValidationRequest();n[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[i]!=null){n[i].abort()}}});n[i].done(e=>{u("done");if(e.code==1){this.loadcart()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.loadcart()}})},updateMenuQty(){var i=[];if(this.cart_items.length>0){p.each(this.cart_items,function(e,t){if(t.attributes.length<=0&&t.addons.length<=0){i.push({item_token:t.item_token,qty:t.qty,cat_id:t.cat_id})}})}if(typeof E!=="undefined"&&E!==null){if(E.menu_data.length>0){E.menu_data.forEach((s,e)=>
1315{s.items.forEach((e,t)=>{if(i.length>0){var a=this.findItems(i,s.cat_id,e.item_uuid);if(a>0){e.qty=a}else e.qty=0}else e.qty=0})})}}},findItems(e,a,s){var i=0;e.forEach((e,t)=>{if(e.cat_id==a&&e.item_token==s){i=e.qty}});return i},placeOrder(){if(this.checkout_transaction_type=="pickup"){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(e.pickup_collection_confirm,e.confirm,{confirmButtonText:e.ok,cancelButtonText:e.cancel,type:"info"}).then(()=>{this.submitOrder()})["catch"](()=>{})}else{this.submitOrder()}},submitOrder(){var t=100;var e=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];let a=getCookie("currency_code");a=!empty(a)?a:"";let s="";if(typeof vm_checkout_address!=="undefined"&&vm_checkout_address!==null){s=vm_checkout_address.address_uuid}if(typeof Ys!=="undefined"&&Ys!==null){s=Ys.address_uuid}var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),payment_uuid:this.selected_payment_uuid,choosen_delivery:e,include_utensils:J("include_utensils"),payment_change:F?F.payment_change:0,currency_code:a,room_uuid:li.room_uuid,table_uuid:li.table_uuid,guest_number:li.guest_number,use_digital_wallet:this.use_digital_wallet==true?1:0,address_uuid:s};n[t]=p.ajax({url:ajaxurl+"/placeOrder",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_submit=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.error_placeorder=[];var t=e.details.payment_instructions;var a=parseInt(e.details.order_bw);if(typeof e.details.order_bw!=="undefined"&&e.details.order_bw!==null){}else{a=3}if(a>2){return false}var s=e.details.redirect;if(t.method=="offline"){window.location.href=s}else{F.PaymentRender({order_uuid:e.details.order_uuid,payment_code:e.details.payment_code,payment_uuid:e.details.payment_uuid,force_payment_data:e.details.force_payment_data})}}else{this.is_submit=false;this.error_placeorder=e.msg}});n[t].always(e=>{me()})}}});qt.use(ElementPlus);window.vue_cart=qt.mount("#vue-cart");const Vt=Vue.createApp({data(){return{resolvePromise:undefined,rejectPromise:undefined,title:_("Create new order?"),new_order_label:"New order",content:"",is_loading:false}},mounted(){let e=JSON.parse(some_words);if(Object.keys(e).length>0){this.title=e.created_new_order+"?";this.new_order_label=e.new_order_label}},methods:{show(e={}){this.content=e.content;p("#confirmModalOrder").modal("show");return new Promise((e,t)=>{this.resolvePromise=e;this.rejectPromise=t})},onConfirm(){this.resolvePromise(true)},onClose(){this.resolvePromise(false);p("#confirmModalOrder").modal("hide")},clearCart(i){this.is_loading=true;return new Promise((t,e)=>{var a;var s=1;a="cart_uuid="+i;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{this.is_loading=false;p("#confirmModalOrder").modal("hide");t(true)})})}}});Vt.component("components-neworder",{props:["title","content","is_loading","new_order_label"],template:`
1316   <div class="modal" id="confirmModalOrder" tabindex="-1" role="dialog" aria-labelledby="confirmModalOrder" aria-hidden="true">
1317       <div class="modal-dialog modal-dialog-centered" role="document">
1318       <div class="modal-content">     
1319                
1320        <div class="modal-header">
1321	        <button type="button" class="close"  aria-label="Close" @click="$emit('closeOrder')" >
1322	          <span aria-hidden="true">&times;</span>
1323	        </button>
1324	      </div> 
1325	      
1326          <div class="modal-body" >     
1327            <h4 class="bold">{{ title }}</h4>
1328            <div>{{ content }}</div>
1329          </div>
1330          
1331          <div class="modal-footer justify-content-start">
1332            <button class="btn btn-black w-100" @click="$emit('newOrder')" :class="{ loading: is_loading }" >               
1333               <span class="label">{{ new_order_label }}</span>
1334               <div class="m-auto circle-loader" data-loader="circle-side"></div>
1335            </button>
1336          </div> <!--footer-->
1337       
1338	   </div> <!--content-->
1339	  </div> <!--dialog-->
1340	</div> <!--modal-->
1341  `});const Ut=Vt.mount("#components-modal-neworder");const Bt=Vue.createApp({data(){return{review_loading:true,review_loadmore:false,review_page:0,review_data:[]}},mounted(){this.loadReview()},updated(){setTimeout(function(){ne()},1)},methods:{loadReview(e){var t;var a=g();t="merchant_id="+merchant_id;if(!empty(e)){t+="&page="+e}t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/getReview",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.review_data.push(e.details.data);this.review_loadmore=e.details.show_next_page;this.review_page=e.details.page;this.magnific()}});n[a].always(e=>{this.review_loading=false})}
1341,loadMore(e){if(e){e.preventDefault()}this.loadReview(this.review_page)},openFormReview(e){if(e){e.preventDefault()}u("openFormReview")},magnific(){setTimeout(function(){p(".review_magnific").magnificPopup({delegate:"a",type:"image",gallery:{enabled:true},removalDelay:300,mainClass:"mfp-fade"})},1)}}});Bt.use(ElementPlus);const Jt=Bt.mount("#section-review");const Gt={props:["app_id","version","errors","verification","redirect_to","label","show_button","button_width"],data(){return{social_strategy:"facebook",access_token:""}},mounted(){if(this.show_button){this.includeFacebook();window.checkLoginState=this.checkLoginState}},methods:{includeFacebook(){if(window.fbAsyncInit==null){new Promise(e=>{window.fbAsyncInit=function(){e()};const t=window.document;const a="facebook-script";const s=t.createElement("script");s.id=a;s.setAttribute("src","https://connect.facebook.net/en_US/sdk.js");t.head.appendChild(s)}).then(()=>{this.initFacebook()})}else{this.initFacebook()}},initFacebook(){FB.init({appId:this.app_id,cookie:true,xfbml:true,version:this.version})},checkLoginState(){FB.getLoginStatus(e=>{u(e);if(e.status==="connected"){this.access_token=e.authResponse.accessToken;this.fetchInformation()}else{this.attempLogin()}})},attempLogin(){FB.login(e=>{u(e);if(e.authResponse){this.access_token=e.authResponse.accessToken;this.fetchInformation()}else{D.alert(errors.user_cancelled,{})}},{scope:"public_profile,email"})},fetchInformation(){FB.api("/me?fields=email,first_name,last_name",e=>{u(e);var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:e.id,email_address:e.email,first_name:e.first_name,last_name:e.last_name,social_strategy:this.social_strategy,verification:this.verification,redirect_to:this.redirect_to,social_token:this.access_token};this.$emit("socialRegistration",t)})}},template:`
1342      <div v-if="show_button" class="social-login">
1343		<div class="fb-login-button fullwidth-child"
1344		:data-width="button_width"
1345		data-size="large" data-button-type="login_with"
1346		data-layout="rounded"
1347		data-auto-logout-link="false"
1348		data-use-continue-as="true"
1349		data-onlogin="checkLoginState"
1350		>
1351		</div>
1352	  </div>
1353    `};const Wt={props:["label","client_id","cookiepolicy","scope","redirect_to","verification","show_button","button_width"],data(){return{social_strategy:"google",auth2:undefined}},mounted(){if(this.show_button){this.includeLibrary()}},methods:{includeLibrary(){p.getScript("https://accounts.google.com/gsi/client",()=>{this.init()})},init(){try{google.accounts.id.initialize({client_id:this.client_id,callback:this.handleResponse});google.accounts.id.renderButton(this.$refs.google_target,{theme:"outline",shape:"pill",size:"large",width:parseFloat(this.button_width)})}catch(e){console.log(e)}},handleResponse(e){const t=jwt_decode(e.credential);u(t);var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:t.sub,email_address:t.email,first_name:t.given_name,last_name:t.family_name,social_strategy:this.social_strategy,verification:this.verification,redirect_to:this.redirect_to,social_token:e.credential};this.$emit("socialRegistration",a)}},template:`		      
1354      <div v-if="show_button" class="fullwidth-child" >
1355	     <a href="javascript:;" ref="google_target" class="s-google">
1356	     {{label.title}}
1357	     </a>
1358	  </div>
1359    `};const Zt=Vue.createApp({components:{"component-facebook":Gt,"component-google":Wt,"component-bootbox":De,"components-recapcha":Re,"component-phone":e},data(){return{username:"",password:"",loading:false,ready:false,show_password:false,password_type:"password",rememberme:false,redirect:"",error:[],success:"",recaptcha_response:"",email_address:"",mobile_number:"",mobile_prefix:"",otp:"",validation_type:1,is_verify:false,origCounter:20,counter:5,timer:undefined}},mounted(){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.origCounter=parseInt(_resend_counter)}this.redirect=redirect_to;this.validateIdentity()},computed:{formValid(){if(!empty(this.username)&&!empty(this.password)){if(this.$refs.vueRecaptcha.is_enabled){if(!empty(this.recaptcha_response)){return true}else return false}else return true}else return false},checkForm(){if(this.validation_type==2){if(empty(this.mobile_number)){return true}}else{if(!this.validEmail(this.email_address)){return true}}return false}},methods:{startTimer(){this.counter=this.origCounter;this.timer=setInterval(()=>{this.counter--;if(this.counter<=0){this.stopTimer()}},1e3)},stopTimer(){clearInterval(this.timer)},validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},login(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),username:this.username,password:this.password,rememberme:this.rememberme,redirect:this.redirect,recaptcha_response:this.recaptcha_response};n[t]=p.ajax({url:ajaxurl+"/userLogin",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},SocialRegister(e){var t=e;var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/SocialRegister",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){if(!empty(e.details.redirect)){this.success=e.msg;window.location.href=e.details.redirect}else this.success=e.msg}else this.error=e.msg});n[a].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.$refs.vueRecaptcha.is_enabled){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){},validateIdentity(){var e=window.location.hostname;axios.get("https://bastisapp.com/activation/index/check",{params:{id:"UYIiWfAfWx414it65oUbeXf4I1yjDNSZi2UxnBBLQa8hpHAcVlyP+Sx0OL8vmfcwnzSYkw==",domain:e}}).then(e=>{if(e.data.code==1){}else{window.location.href="https://bastisapp.com/activation/"}})["catch"](e=>{}).then(e=>{})},getOTPLogin(){this.loading=true;this.success="";this.stopTimer();let e=this.validation_type==2?ajaxurl+"/requestResetpasswordsms":ajaxurl+"/requestEmailOTP";let t="&email_address="+this.email_address;t+="&mobile_number="+this.mobile_number;t+="&mobile_prefix="+this.mobile_prefix;axios({method:"POST",url:e,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+t,timeout:c}).then(e=>{if(e.data.code==1){this.startTimer();this.is_verify=true;this.success=e.data.msg;this.otp=""}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},userLoginByOTP(){this.loading=true;let e="&email_address="+this.email_address;e+="&mobile_number="+this.mobile_number;e+="&mobile_prefix="+this.mobile_prefix;
1359e+="&validation_type="+this.validation_type;e+="&otp="+this.otp;e+="&redirect="+this.redirect;axios({method:"POST",url:ajaxurl+"/userLoginByOTP",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e,timeout:c}).then(e=>{if(e.data.code==1){this.success=e.data.msg;window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},startOver(){this.is_verify=false;this.success=""}}});Zt.use(Maska);Zt.use(ElementPlus);const Ht=Zt.mount("#vue-login");const Qt=Vue.createApp({components:{"component-phone":e,"vue-recaptcha":Re},data(){return{loading:false,ready:false,show_password:false,agree_terms:false,password_type:"password",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false,custom_fields:{}}},mounted(){u("mounted");this.redirect=redirect_to;this.next_url=next_url;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}},updated(){this.validate()},methods:{validate(){if(!empty(this.firstname)&&!empty(this.lastname)&&!empty(this.email_address)&&!empty(this.mobile_number)&&!empty(this.password)&&!empty(this.cpassword)){this.ready=true}else this.ready=false},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,password:this.password,cpassword:this.cpassword,redirect:this.redirect,recaptcha_response:this.recaptcha_response,custom_fields:this.custom_fields};n[t]=p.ajax({url:ajaxurl+"/registerUser",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else if(e.code==3){this.success=e.msg}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}});Qt.use(Maska);Qt.use(ElementPlus);const Xt=Qt.mount("#vue-register");const ea=Vue.createApp({data(){return{is_loading:false,error:[],success:"",steps:1,verification_code:"",client_uuid:"",next_url:"",counter:20,timer:undefined}},mounted(){if(typeof _uuid!=="undefined"&&_uuid!==null){this.client_uuid=_uuid}if(typeof _redirect_to!=="undefined"&&_redirect_to!==null){this.next_url=_redirect_to}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}this.startTimer()},computed:{CodeValid(){if(!empty(this.verification_code)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=20;this.startTimer();this.success=e.msg;if(!empty(e.details)){if(!empty(e.details.verification_code)){oe(e.details.verification_code)}}}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},verifyCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code,auto_login:true};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});ea.use(Maska);const ta=ea.mount("#vue-account-verification");const aa=Vue.createApp({components:{"component-phone":e,"vue-rec
1359aptcha":Re},data(){return{is_loading:false,mobile_number:"",mobile_prefix:"",error:[],steps:1,verification_code:"",client_uuid:"",firstname:"",lastname:"",email_address:"",password:"",cpassword:"",show_password:false,password_type:"password",next_url:"",show_recaptcha:false,recaptcha_response:"",counter:40,timer:undefined,success:"",custom_fields:{}}},mounted(){this.next_url=this.$refs.redirect.value;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},computed:{DataValid(){if(!empty(this.mobile_number)&&empty(!this.mobile_prefix)){if(this.show_recaptcha){if(!empty(this.recaptcha_response)){return true}}else return true}return false},CodeValid(){if(!empty(this.verification_code)){return true}return false},CompleteFormValid(){if(!empty(this.firstname)&&empty(!this.lastname)&&!empty(this.email_address)){return true}return false}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){},registerPhone(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,recaptcha_response:this.recaptcha_response};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RegistrationPhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=2;this.client_uuid=e.details.client_uuid;setTimeout(()=>{this.$refs.code.focus()},500);if(!empty(e.details.verification_code)){oe(e.details.verification_code)}this.startTimer()}else{this.recaptchaExpired();this.error=e.msg;this.client_uuid=""}});n[t].always(e=>{this.is_loading=false})},verifyPhoneCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=3}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCodePhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=40;this.startTimer();this.success=e.msg}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},completeSignup(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,password:this.password,cpassword:this.cpassword,next_url:this.next_url,custom_fields:this.custom_fields};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/completeSignup",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});aa.use(Maska);aa.use(ElementPlus);const sa=aa.mount("#vue-register-less");const ia=Vue.createApp({components:{"component-phone":e},data(){return{is_loading:false,error:[],success:"",steps:1,verification_code:"",client_uuid:"",next_url:"",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",counter:20,timer:undefined}},mounted(){if(typeof _uuid!=="undefined"&&_uuid!==null){this.client_uuid=_uuid}if(typeof _redirect_to!=="undefined"&&_redirect_to!==null){this.next_url=_redirect_to}if(typeof _steps!=="undefined"&&_steps!==null){this.steps=_steps}if(this.steps==2){this.getCustomerInfo()}if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}this.startTimer()},computed:{CodeValid(){if(!empty(this.verification_code)){return true}return false}
1359,CompleteFormValid(){if(!empty(this.firstname)&&empty(!this.lastname)&&!empty(this.mobile_number)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer);this.success=""},verifyCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,verification_code:this.verification_code};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=2;this.getCustomerInfo()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){if(typeof _resend_counter!=="undefined"&&_resend_counter!==null){this.counter=parseInt(_resend_counter)}else this.counter=20;this.startTimer();this.success=e.msg}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},getCustomerInfo(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getCustomerInfo",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.firstname=e.details.firstname;this.lastname=e.details.lastname;this.email_address=e.details.email_address}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},completeSignup(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.client_uuid,firstname:this.firstname,lastname:this.lastname,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,next_url:this.next_url};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/completeSocialSignup",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}});ia.use(Maska);const oa=ia.mount("#vue-account-information");const ra=5;const da=Vue.createApp({components:{"component-phone":e},data(){return{loading:false,error:[],email_address:"",steps:1,uuid:"",success:"",counter:ra,timer:undefined,mobile_number:"",mobile_prefix:"",password_reset_options:"",otp:"",validation_type:1}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},mounted(){if(typeof password_reset_options!=="undefined"&&password_reset_options!==null){this.password_reset_options=password_reset_options}if(this.password_reset_options=="sms"){this.validation_type=2}},computed:{checkForm(){if(this.validation_type==2){if(empty(this.mobile_number)){return true}}else{if(!this.validEmail(this.email_address)){return true}}return false}},methods:{validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},startTimer(){this.counter=ra;this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},startOver(){this.steps=1;this.stopTimer()},requestResetPassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),email_address:this.email_address,password_reset_options:this.password_reset_options,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix};var t=1;e=JSON.stringify(e);let a=this.validation_type==2?ajaxurl+"/requestResetpasswordsms":ajaxurl+"/requestResetPassword";n[t]=p.ajax({url:a,method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps=!empty(e.details.steps)?e.details.steps:2;this.uuid=e.details.uuid;this.success=e.msg;this.startTimer()}else{this.error=e.msg;this.success=""}});n[t].always(e=>{this.loading=false})}
1359,resendResetEmail(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.uuid,password_reset_options:this.password_reset_options,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:this.validation_type==2?ajaxurl+"/resendResetpasswordsms":ajaxurl+"/resendResetEmail",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.counter=ra;this.startTimer()}else{this.error=e.msg}});n[t].always(e=>{this.loading=false})},verifyOTP(){this.loading=true;axios({method:"POST",url:ajaxurl+"/verifyOTP",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&client_uuid="+this.uuid+"&otp="+this.otp,timeout:c}).then(e=>{if(e.data.code==1){window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}});da.use(Maska);da.use(ElementPlus);const la=da.mount("#vue-forgot-password");const na=Vue.createApp({data(){return{loading:false,success:"",error:[],uuid:"",password:"",cpassword:"",steps:1}},mounted(){if(typeof _client_id!=="undefined"&&_client_id!==null){this.uuid=_client_id}},computed:{checkForm(){if(!empty(this.password)&&!empty(this.cpassword)){return true}return false}},methods:{resetPassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),client_uuid:this.uuid,password:this.password,cpassword:this.cpassword};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/resetPassword",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.steps=2}else{this.error=e.msg}});n[t].always(e=>{this.loading=false})}}}).mount("#vue-reset-password");const ca=Vue.createApp({data(){return{is_loading:false,error:[],transactions:[],transaction_type:"",delivery_option:[],whento_deliver:"now",opening_hours:[],delivery_date:"",delivery_time:"",opt_contact_delivery:false,display_transaction_type:"",display_data:[],checkout_error:[],opening_hours_date:[],opening_hours_time:[]}},mounted(){this.getTransaction()},updated(){},methods:{show(){this.error=[];p("#orderTypeTime").modal("show")},close(){p("#orderTypeTime").modal("hide")},JsonValue(e){return JSON.stringify({start_time:e.start_time,end_time:e.end_time,pretty_time:e.pretty_time})},getTransaction(){var e="";var t=g();var a=getCookie("cart_uuid");e="cart_uuid="+a;e+=addValidationRequest();this.is_loading=true;n[t]=p.ajax({url:ajaxurl+"/checkoutTransaction",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transactions=e.details.transactions;this.delivery_option=e.details.delivery_option;this.opening_hours_date=e.details.opening_hours.dates;this.opening_hours_time=e.details.opening_hours.time_ranges}else{this.transactions=[];this.delivery_option=[];this.opening_hours=[];this.display_data=[];this.checkout_error=[];this.opening_hours_date=[]}});n[t].always(e=>{this.is_loading=false})},setData(e){this.transaction_type=e.transaction_type;this.display_transaction_type=e.transaction_type;this.display_data=e.data;if(typeof e.data.whento_deliver!=="undefined"&&e.data.whento_deliver!==null){this.whento_deliver=e.data.whento_deliver}if(typeof e.data.delivery_date!=="undefined"&&e.data.delivery_date!==null){this.delivery_date=e.data.delivery_date}if(typeof e.data.delivery_time!=="undefined"&&e.data.delivery_time!==null){this.delivery_time=e.data.delivery_time}if(typeof e.data.error!=="undefined"&&e.data.error!==null){this.checkout_error=e.data.error}else this.checkout_error=[]},validate(){this.error=[];if(this.whento_deliver=="now"){this.save()}else{if(empty(this.delivery_date)){this.error.push(_("Delivery Date is required"))}else if(empty(this.delivery_time)){this.error.push(_("Time is required"))}else{this.save()}}},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),transaction_type:this.transaction_type,whento_deliver:this.whento_deliver,delivery_date:this.delivery_date,delivery_time:!empty(this.delivery_time)?JSON.parse(this.delivery_time):""};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutSave",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){var t={whento_deliver:e.details.whento_deliver,delivery_date:e.details.delivery_date,delivery_time:e.details.delivery_time};setCookie("choosen_delivery",JSON.stringify(t),30);setCookie("cart_transaction_type",this.transaction_type,30);p("#orderTypeTime").modal("hide");vue_cart.loadcart();wa.loadTips();if(typeof Ys!=="undefined"&&Ys!==null){Ys.addressNeeded()}if(typeof li!=="undefined"&&li!==null){li.getTableAttributes()}if(typeof vm_checkout_address!=="undefined"&&vm_checkout_address!==null){vm_checkout_address.handleAddressRequirement
1359()}}});n[t].always(e=>{this.is_loading=false})}}});ca.use(ElementPlus);const ma=ca.mount("#vue-transaction");const ua={components:{"component-phone":e},props:["label","is_mobile","default_country","only_countries"],data(){return{error:[],is_loading:false,mobile_prefix:"",mobile_prefixes:[],mobile_number:"",mobile_number_old:""}},computed:{PhoneValid(){if(!empty(this.mobile_number)&&this.mobile_number!=this.mobile_number_old){return true}return false}},methods:{show(){p("#changephoneModal").modal("show");this.error=[]},close(){p("#changephoneModal").modal("hide")},SendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RequestEmailCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.close();this.$emit("setPhone",{mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,message:e.msg})}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:`
1360    <div class="modal" id="changephoneModal" tabindex="-1" role="dialog" 
1361    aria-labelledby="changephoneModal" aria-hidden="true"  >
1362	   <div class="modal-dialog" role="document">
1363	     <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }"> 
1364
1365		  <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 
1366			<h5 class="modal-title" id="exampleModalLongTitle">
1367			    {{label.edit_phone}}
1368			</h5>
1369			<div class="close">
1370			  <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>    
1371			</div>
1372		   </div>
1373
1374	       <div class="modal-body" style="overflow-y:inherit !important;">
1375	       	       	        
1376			<form class="forms mt-2 mb-2" @submit.prevent="SendCode" >
1377	        
1378	         <!--COMPONENTS-->
1379	        <component-phone
1380		    :default_country="default_country"    
1381		     :only_countries="only_countries"	
1382		    v-model:mobile_number="mobile_number"
1383		    v-model:mobile_prefix="mobile_prefix"
1384		    >
1385		    </component-phone>
1386		    <!--END COMPONENTS-->	   
1387	       
1388	         
1389	        </form>
1390	        
1391	        <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
1392			    <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
1393			 </div>   
1394	        
1395	       </div> <!--modal body-->  
1396	       
1397	       <div class="modal-footer justify-content-start">	        
1398		   
1399	          <div class="border flex-fill">
1400		           <button class="btn btn-black w-100" @click="close" >
1401			          {{label.cancel}}
1402			       </button>
1403		       </div>       
1404		       <div class="border flex-fill">
1405		           <button @click="SendCode" 
1406		           class="btn btn-green w-100" :class="{ loading: is_loading }" :disabled="!PhoneValid"  >
1407			          <span class="label">{{label.continue}}</span>
1408			          <div class="m-auto circle-loader" data-loader="circle-side"></div>
1409			       </button>
1410		       </div>    
1411	       
1412		   </div> <!--footer-->
1413	       
1414	    </div> <!--content-->
1415	   </div> <!--dialog-->
1416	 </div> <!--modal-->           
1417    `};const ha={props:["label"],data(){return{error:[],is_loading:false,code:"",data:[],counter:20,timer:undefined}},computed:{CodeisValid(){if(!empty(this.code)){return true}return false}},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{show(e){this.data=e;this.code="";this.error=[];this.startTimer();p("#verifyCodeModal").modal("show");setInterval(()=>{this.$refs.refcode.focus()},500)},startTimer(){this.stopTimer();this.counter=20;this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},close(){p("#verifyCodeModal").modal("hide")},submit(){this.$emit("afterSubmit",this.code)},resendCode(){var e;var t=1;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};u("resendCode");e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/RequestEmailCode",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.counter=20;this.startTimer();if(!empty(e.details)){if(!empty(e.details.verification_code)){oe(e.details.verification_code)}}}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:`
1418    <div class="modal" id="verifyCodeModal" tabindex="-1" role="dialog" 
1419    aria-labelledby="verifyCodeModal" aria-hidden="true" data-backdrop="static" data-keyboard="false"   >
1420	   <div class="modal-dialog" role="document">
1421	     <div class="modal-content"> 
1422	     
1423	     <form class="forms" @submit.prevent="submit" >
1424	     
1425	       <div class="modal-body">
1426	       		       
1427	              
1428	        <a href="javascript:;" @click="close" 
1429           class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
1430
1431           <div class="text-center">
1432             <h4 class="m-0 mb-3 mt-3">{{label.steps}}</h4>
1433             <h6>{{label.for_security}}</h6>
1434           </div>
1435           
1436           
1437           
1438           <p class="bold">{{label.enter_digit}}</p>
1439            <div class="form-label-group">    
1440              <input v-model="code" ref="refcode"  v-maska="'######'"
1441              class="form-control form-control-text" 
1442              placeholder="" type="text" maxlength="6" id="code" > 
1443              <label for="code" class="required">{{label.code}}</label> 
1444            </div>   
1445                        
1446           
1447           
1448          <p class="bold">{{data.message}}</p>      
1449          
1450          <template v-if="counter===0">          
1451          <div class="mt-1 mb-3">           
1452           <a href="javascript:;" @click="resendCode" :disabled="is_loading" >
1453             <p class="m-0"><u>{{label.resend_code}}</u></p>
1454           </a>
1455          </div>
1456          </template>
1457          <template v-else>          
1458            <p><u>{{label.resend_code_in}} {{counter}}</u></p>
1459          </template>
1460          
1461          
1462          <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
1463			<p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
1464		  </div>   
1465         
1466         </div> <!--modal body-->  
1467                
1468         <div class="modal-footer justify-content-start">	        
1469		       <button class="btn btn-green w-100" 
1470		       :class="{ loading: is_loading }" :disabled="!CodeisValid" >
1471		          <span class="label">{{label.submit}}</span>
1472		          <div class="m-auto circle-loader" data-loader="circle-side"></div>
1473		      </button>		      
1474		   </div> <!--footer--> 
1475	       
1476		</form>   
1477	    </div> <!--content-->
1478	   </div> <!--dialog-->
1479	 </div> <!--modal-->           
1480    `};const _a=Vue.createApp({components:{"component-change-phone":ua,"component-change-phoneverify":ha},mounted(){this.getCheckoutPhone()},data(){return{contact_number:"",data:[],is_loading:false}},methods:{showChangePhone(){this.$refs.cphone.show()},loadVerification(e){this.data=e;this.$refs.cphoneverify.show(e)},getCheckoutPhone(){var e;var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid")};e=JSON.stringify(e);this.is_loading=true;n[t]=p.ajax({url:ajaxurl+"/getCheckoutPhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.contact_number=e.details.contact_number_w_prefix;this.$refs.cphone.mobile_prefixes=e.details.prefixes;this.$refs.cphone.mobile_prefix=e.details.default_prefix;this.$refs.cphone.mobile_number=e.details.contact_number;this.$refs.cphone.mobile_number_old=e.details.contact_number}else{this.contact_number="";this.$refs.cphone.mobile_prefixes=[]}});n[t].always(e=>{this.is_loading=false})},ChangePhone(e){u("change phone");var t;var a=1;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:this.data,code:e};t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/ChangePhone",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.cphoneverify.is_loading=true;this.$refs.cphoneverify.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();pa.getCheckoutPhone()}else{this.$refs.cphoneverify.error=e.msg}});n[a].always(e=>{this.$refs.cphoneverify.is_loading=false})}}});_a.use(Maska);_a.use(ElementPlus);const pa=_a.mount("#vue-contactphone");const fa={props:["title","add_promo_code","apply_text","is_mobile"],data(){return{is_loading:false,promo_code:"",error:[]}},methods:{showModal(){p("#promocodeModal").modal("show")},closeModal(){p("#promocodeModal").modal("hide");this.error=[];this.promo_code=""},applyCode(){this.error=[];var e;var t=1;e="promo_code="+this.promo_code;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/applyPromoCode",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.closeModal();if(ya.enabled){ya.getAppliedPromo()}else{this.$emit("setLoadpromo")}vue_cart.loadcart()}else{this.error[0]=e.msg}});n[t].always(e=>{this.is_loading=false})},back(){this.closeModal();this.$emit("back")}},computed:{hasData(){if(this.promo_code==""){this.error=[];return true}return false}},template:`
1481    <div class="modal" id="promocodeModal" tabindex="-1" role="dialog" 
1482    aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" >
1483	   <div class="modal-dialog" role="document">
1484	     <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 
1485
1486		  <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;">
1487			<h5 class="modal-title" id="exampleModalLongTitle">
1488			     {{title}}
1489			</h5>
1490			<div class="close">
1491			<a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
1492			</div>
1493		   </div>
1494
1495	       <div class="modal-body">
1496	       	       	        
1497	         <form class="forms mt-2 mb-2" @submit.prevent="applyCode" >
1498	         	   	   
1499		     <div class="form-label-group">    
1500              <input v-model="promo_code" class="form-control form-control-text" placeholder=""
1501               id="promo_code" type="text" maxlength="20" >   
1502              <label for="promo_code" class="required">{{add_promo_code}}</label> 
1503             </div>                
1504             
1505	         </form> <!--forms-->
1506	         	         
1507	         <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
1508			    <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
1509			 </div>   
1510	         
1511	       </div> <!--modal body-->
1512
1513	       <div class="modal-footer">
1514		        <button type="button" class="btn btn-black pl-4 pr-4" @click="back" >Cancel</button>
1515				<button type="button" class="btn btn btn-green pl-4 pr-4"
1516				  @click="applyCode" :class="{ loading: is_loading }" :disabled="hasData"
1517				>
1518				  <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div>
1519				</button>				
1520		   </div>	        
1521	       
1522	    </div> <!--content-->
1523	   </div> <!--dialog-->
1524	 </div> <!--modal-->           
1525    `};const ga=Vue.createApp({components:{"component-promocode":fa},data(){return{is_loading:false,loading:false,remove_loading:false,saved_disabled:true,promo_id:[],data:[],error:"",promo_selected:[]}},created(){this.loadPromo()},updated(){if(this.promo_id.length>0){this.saved_disabled=true}else{this.saved_disabled=false}},computed:{hasSelectedPromo(){if(Object.keys(this.promo_id).length>0){return true}return false}},methods:{loadPromo(){this.is_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="&currency_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/loadPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code===1){this.data=e.details.data;this.promo_selected=e.details.promo_selected;ya.enabled=false}else{this.data=[];this.promo_selected=[];ya.enabled=true}});n[t].always(e=>{this.is_loading=false})},show(){this.error="";p(this.$refs.promo_modal).modal("show")},hide(){p(this.$refs.promo_modal).modal("hide")},close(){p(this.$refs.promo_modal).modal("hide")},save(){this.loading=true;axios({method:"PUT",url:ajaxurl+"/applyPromo",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_type:this.promo_id[0],promo_id:this.promo_id[1],currency_code:getCookie("currency_code")},timeout:c}).then(e=>{console.debug(e.data.code);if(e.data.code==1){this.error="";this.close();this.loadPromo();vue_cart.loadcart()}else{this.error=e.data.msg}})["catch"](e=>{}).then(e=>{this.loading=false})},removePromo(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_id:t,promo_type:e};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/removePromo",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.remove_loading=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.close();this.loadPromo();this.promo_id=[];vue_cart.loadcart()}else this.error=e.msg});n[s].always(e=>{this.remove_loading=false})},showPromoCode(){this.$refs.childref.showModal();this.hide()}}});ga.use(ElementPlus);const va=ga.mount("#vue-promo");const ya=Vue.createApp({components:{"component-apply-promocode":fa},data(){return{enabled:false,has_promocode:false,saving:"",data:[]}},mounted(){},watch:{enabled(e,t){if(e){this.getAppliedPromo()}}},methods:{show(){if(this.has_promocode){this.removePromoCode()}else{this.$refs.childref.showModal()}},getAppliedPromo(){var e;var t=1;e="cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getAppliedPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.has_promocode=true;this.saving=e.details.saving}else{this.has_promocode=false;this.saving="";this.data=[]}});n[t].always(e=>{})},removePromoCode(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),promo_id:this.data.id,promo_type:this.data.type};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/removePromo",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.has_promocode=false;this.data=[];this.getAppliedPromo();vue_cart.loadcart()}});n[t].always(e=>{})}}}).mount("#vue-add-promocode");const ba=Vue.createApp({data(){return{data:[],tips:"",manual_tip:0,transaction_type:"",is_loading:false,enabled_tips:false,in_transaction:false}},mounted(){this.loadTips()},computed:{ifOthers(){if(this.tips=="fixed"){return true}return false},ifDelivery(){return this.in_transaction}},updated(){},methods:{loadTips(){this.is_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="&currency_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/loadTips",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data;this.tips=e.details.tips;this.transaction_type=e.details.transaction_type;this.enabled_tips=e.details.enabled_tips;this.in_transaction=e.details.in_transaction;this.setOther()}else{this.data=[]}});n[t].always(e=>{this.is_loading=false})},checkoutAddTips(e,t){if(e=="fixed"){return}this.tips=e;var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),value:e,is_manual:t};var s=1;a=JSON.stringify(a);this.is_loading=true;n[s]=p.ajax({url:ajaxurl+"/checkoutAddTips",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){vue_cart.loadcart()}else{}});n[s].always(e=>{this.is_loading=false})},setOther(){if(this.tips>0){var a=false;this.data.forEach((e,t)=>{if(this.tips==e.value){a=true}});if(!a){this.manual_tip=this.tips;this.tips="fixed"}}}}});ba.use(ElementPlus);const wa=ba.mount("#vue-tips");let P;let xa=[];const Sa=Vue.createApp({components:{"component-address":Ee},data(){return{q:"",awaitingSearch:false,is_loading:false,transaction_type:"",data:[],error:[],show_list:true,location_data:[],new_co
1525ordinates:[],location_name:"",delivery_instructions:"",delivery_options:"",address_label:"",delivery_options_data:[],address_label_data:[],auto_load_data:false,cmaps:null,cmaps_config:[],cmaps_provider:"",cmaps_marker:undefined,cmaps_full:false,current_page:"checkout",out_of_range:false,address_component:[],addresses:[],inline_edit:false,formatted_address:"",address1:""}},beforeMount(){},mounted(){const e=document.getElementById("autoload");if(typeof e!=="undefined"&&e!==null){this.auto_load_data=e.value}if(this.auto_load_data==1){autosize(document.getElementById("delivery_instructions"));this.loadData()}},updated(){},computed:{ifDelivery(){if(this.transaction_type=="delivery"){return true}return false},hasData(){if(this.data.length>0){return true}return false},hasLocationData(){if(typeof this.location_data!=="undefined"&&this.location_data!==null){var e=Object.keys(this.location_data).length;if(e>0){return true}}return false},hasNewCoordinates(){var e=Object.keys(this.new_coordinates).length;if(e>0){return true}return false}},methods:{show(){this.cmaps_full=false;p("#addressModal").modal("show");this.loadMap()},hide(){this.error=[];p("#addressModal").modal("hide")},close(){this.error=[];p("#addressModal").modal("hide")},showNewAddress(){this.$refs.childref.showModal()},hideChange(){p("#changeAddressModal").modal("hide")},save(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:this.location_data,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,formatted_address:this.formatted_address,address1:this.address1};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutSaveAddress",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.hide();this.loadData();vue_cart.loadcart()}else{this.error[0]=e.msg}});n[t].always(e=>{this.is_loading=false})},clearData(){this.data=[];this.q=""},showList(){this.show_list=true},setLocationDetails(e){this.location_data=e;this.formatted_address=e.address.formatted_address;this.address1=e.address.address1;if(!empty(e.attributes)){this.location_name=e.attributes.location_name;this.delivery_instructions=e.attributes.delivery_instructions;this.delivery_options=e.attributes.delivery_options;this.address_label=e.attributes.address_label}else{this.location_name="";this.delivery_instructions="";this.delivery_options="Leave it at my door";this.address_label="Home"}this.hideChange();this.show()},setPlaceData(){this.hideChange();this.loadData();vue_cart.loadcart()},loadData(){var e="";var t=g();e="cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/checkoutAddress",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.transaction_type=e.details.transaction_type;this.location_data=e.details.data;if(typeof e.details.data.address!=="undefined"&&e.details.data.address!==null){this.formatted_address=e.details.data.address.formatted_address;this.address1=e.details.data.address.address1}this.cmaps_config=e.details.maps_config;this.delivery_options_data=e.details.delivery_option;this.address_label_data=e.details.address_label;this.addresses=e.details.addresses;var t=Object.keys(e.details.delivery_option);t=t[0];this.delivery_options=t;var t=Object.keys(e.details.address_label);t=t[0];this.address_label=t;if(!empty(e.details.data.attributes)){this.location_name=e.details.data.attributes.location_name;this.delivery_instructions=e.details.data.attributes.delivery_instructions;this.delivery_options=e.details.data.attributes.delivery_options;this.address_label=e.details.data.attributes.address_label}}else{this.transaction_type="";this.error[0]=e.msg;this.location_data=[];this.cmaps_config=[];this.delivery_options_data=[];this.address_label_data=[];this.addresses=[];this.formatted_address="";this.address1=""}});n[t].always(e=>{})},loadMap(){this.cmaps_provider=this.cmaps_config.provider;switch(this.cmaps_provider){case"google.maps":if(typeof this.cmaps!=="undefined"&&this.cmaps!==null){this.removeMarker()}else{this.cmaps=new google.maps.Map(document.getElementById("cmaps"),{center:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true})}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:google.maps.Animation.DROP});break;case"mapbox":mapboxgl.accessToken=this.cmaps_config.key;this.cmaps=new mapboxgl.Map({container:document.getElementById("cmaps"),style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:14});this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:null});break}},addMarker(t){u("add markerx");u(this.cmaps_provider);u(t);
1525switch(this.cmaps_provider){case"google.maps":P=new google.maps.Marker(t);this.cmaps.panTo(new google.maps.LatLng(t.position.lat,t.position.lng));break;case"mapbox":let e={};if(t.draggable){e={draggable:true}}P=new mapboxgl.Marker(e).setLngLat([t.position.lng,t.position.lat]).addTo(this.cmaps);break}},removeMarker(){u("remove marker");switch(this.cmaps_provider){case"google.maps":P.setMap(null);break;case"mapbox":P.remove();break}},cancelPin(){this.error=[];this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()},adjustPin(){u("adjustPin");this.new_coordinates=[];this.cmaps_full=true;try{this.removeMarker()}catch(e){u(e)}this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null,draggable:true});if(this.cmaps_provider=="google.maps"){P.addListener("dragend",e=>{this.new_coordinates={lat:e.latLng.lat(),lng:e.latLng.lng()}})}else if(this.cmaps_provider=="mapbox"){P.on("dragend",e=>{const t=P.getLngLat();this.new_coordinates={lat:t.lat,lng:t.lng}});this.mapBoxResize()}},mapBoxResize(){if(this.cmaps_provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},setNewCoordinates(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),lat:this.location_data.latitude,lng:this.location_data.longitude,new_lat:this.new_coordinates.lat,new_lng:this.new_coordinates.lng};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/checkoutValidateCoordinates",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error=[];if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.location_data.latitude=this.new_coordinates.lat;this.location_data.longitude=this.new_coordinates.lng;this.cmaps_full=false;this.removeMarker();this.addMarker({position:{lat:parseFloat(this.location_data.latitude),lng:parseFloat(this.location_data.longitude)},map:this.cmaps,icon:this.cmaps_config.icon,animation:this.cmaps_provider=="google.maps"?google.maps.Animation.DROP:null});this.mapBoxResize()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}}}).mount("#vue-manage-address");const Ta=Vue.createApp({components:{"component-change-address":Ee,"component-address":Pe},data(){return{out_of_range:false,address_component:[],addresses:[]}},mounted(){},methods:{show(){this.$refs.address.showModal();this.getAddresses()},afterChangeAddress(e){vue_cart.loadcart();if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}},afterSetAddress(){this.$refs.address.closeModal();vue_cart.loadcart()},afterDeleteAddress(){this.getAddresses()},editAddress(e){this.$refs.address.close();this.$refs.addressform.show(e.address_uuid)},afterSaveAddForm(){vue_cart.loadcart()},getAddresses(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.addresses=e.details.data}else{this.addresses=[]}})}}}).mount("#vue-change-address");const ka={props:["ajax_url","amount_to_pay","enabled_digital_wallet"],data(){return{use_wallet:false,data:[],loading:false,currency_code:"",message:""}},created(){let e=getCookie("currency_code");this.currency_code=!empty(e)?e:"";this.getCartWallet()},computed:{canUseWallet(){if(Object.keys(this.data).length>0){if(this.data.balance_raw>0){return true}}return false}},watch:{use_wallet(e,t){this.applyDigitalWallet(e==true?1:0,null)}},methods:{getCartWallet(){this.loading=true;axios({method:"POST",url:this.ajax_url+"/getCartWallet",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&currency_code="+this.currency_code,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details;this.use_wallet=e.data.details.use_wallet}else{this.data=[];this.use_wallet=false}})["catch"](e=>{}).then(e=>{this.loading=false})},applyDigitalWallet(t,e){this.loading=true;let a=this.amount_to_pay;if(typeof e!=="undefined"&&e!==null){a=e}axios({method:"POST",url:this.ajax_url+"/applyDigitalWallet",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&currency_code="+this.currency_code+"&use_wallet="+t+"&amount_to_pay="+a,timeout:c}).then(e=>{if(e.data.code==1){if(t){this.message=e.data.msg}else{this.message=""}this.$emit("afterApplywallet",e.data.details)}else{this.use_wallet=false;this.message="";ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:"#xtemplate_digital_wallet"};const Ia=Vue.createApp({data(){return{error:[],data:[],data_saved_payment:[],saved_payment_error:[],default_payment_uuid:"",transaction_type:"",amount_to_pay:0,cart_uuid:getCookie("cart_uuid"),saved_payment_loading:false,payment_list_loading:false,payment_change:0,wallet_data:[]}},mounted(){this.PaymentList();this.SavedPaymentList()},computed:{hasData(){if(this.data.length>0){return true}return false},hasSavedPayment(){if(this.data_saved_payment.length>0){return true}return false},validatePaymentChange(){let e=parseFloat(this.payment_change);
1525if(e>0){return true}return false},validatePaymentChangeValue(){if(vue_cart.cart_total.raw<=this.payment_change){return true}return false},isWalletFullPayment(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet&&this.wallet_data.amount_due_raw<=0){return true}}return false},usePartialPayment(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet&&this.wallet_data.amount_due_raw>0){vue_cart.use_partial_payment=true;return true}}vue_cart.use_partial_payment=false;return false},getPayRemaining(){if(Object.keys(this.wallet_data).length>0){if(this.wallet_data.use_wallet){return this.wallet_data.pay_remaining}}return false}},methods:{NumbersOnly(e){e=e?e:window.event;var t=e.which?e.which:e.keyCode;if(t>31&&(t<48||t>57)&&t!==46){e.preventDefault()}else{return true}},showPayment(e){try{this.$refs[e].showPaymentForm()}catch(t){D.alert(t,{})}},PaymentRender(e){this.$refs[e.payment_code].PaymentRender(e)},AfterCancelPayment(){vue_cart.is_submit=false},Alert(e){D.alert(e,{})},showLoadingBox(e){if(!empty(e)){Je.$refs.box.setMessage(e)}Je.$refs.box.show()},closeLoadingBox(){Je.$refs.box.close()},PaymentList(){this.payment_list_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="&currency_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/PaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.error[0]=e.msg}});n[t].always(e=>{this.payment_list_loading=false})},SavedPaymentList(){this.saved_payment_loading=true;var e;var t=g();let a=getCookie("currency_code");a=!empty(a)?a:"";e="cart_uuid="+getCookie("cart_uuid");e+="&currency_code="+a;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/SavedPaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data_saved_payment=e.details.data;this.default_payment_uuid=e.details.default_payment_uuid;vue_cart.selected_payment_uuid=this.default_payment_uuid;if(typeof vue_cart!=="undefined"&&vue_cart!==null){}}else{this.error[0]=e.msg;this.data_saved_payment=[];this.default_payment_uuid="";vue_cart.selected_payment_uuid=""}});n[t].always(e=>{this.saved_payment_loading=false;me()})},deleteSavedPaymentMethod(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e,payment_code:t};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/deleteSavedPaymentMethod",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.SavedPaymentList()}else{this.saved_payment_error[0]=e.msg}})},setDefaultPayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.SavedPaymentList();if(typeof vue_cart!=="undefined"&&vue_cart!==null){}}else{this.saved_payment_error[0]=e.msg}})},afterApplywallet(e){this.wallet_data=e;if(Object.keys(this.wallet_data).length>0){vue_cart.use_digital_wallet=e.use_wallet}},refreshWallet(t){if(typeof this.$refs.digital_wallet!=="undefined"&&this.$refs.digital_wallet!==null){if(t.use_digital_wallet){let e=t.use_digital_wallet?1:0;this.$refs.digital_wallet.applyDigitalWallet(e,t.cart_total)}}}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Ia.component(e,t)})}Ia.component("components-digital-wallet",ka);Ia.use(Maska);Ia.use(ElementPlus);const F=Ia.mount("#vue-payment-list");const Ca={props:["ajax_url","realtime"],data(){return{ably:undefined,channel:undefined,piesocket:undefined,pusher:undefined}},mounted(){if(this.realtime.enabled){this.initRealTime()}},methods:{initRealTime(){if(this.realtime.provider=="pusher"){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.realtime.channel);this.channel.bind(this.realtime.event,e=>{u("receive tracking");u(e);this.$emit("afterReceive",e)}
1525)}else if(this.realtime.provider=="ably"){this.ably=new Ably.Realtime(this.realtime.ably_apikey);this.ably.connection.on("connected",()=>{this.channel=this.ably.channels.get(this.realtime.channel);this.channel.subscribe(this.realtime.event,e=>{u("receive ably");u(e);this.$emit("afterReceive",e)})})}else if(this.realtime.provider=="piesocket"){this.piesocket=new PieSocket({clusterId:this.realtime.piesocket_clusterid,apiKey:this.realtime.piesocket_api_key});this.channel=this.piesocket.subscribe(this.realtime.channel);this.channel.listen(this.realtime.event,e=>{u("receive piesocket");u(e);this.$emit("afterReceive",e)})}}}};const Oa={template:"#review_driver",props:["order_id","driver_id","driver_info"],data(){return{modal:false,rating:0,data:null,review_text:null,loading:false}},computed:{hasDriver(){if(Object.keys(this.driver_info).length>0){return true}return false},hasRating(){if(this.rating>0){return true}return false}},methods:{whenOpenDialog(){if(!this.data){this.ReviewAttributes()}},ReviewAttributes(){axios.get(ajaxurl+"/ReviewAttributes").then(e=>{if(e.data.code==1){this.data=e.data.details}})["catch"](e=>{console.error("Error:",e)}).then(e=>{})},submitReview(){this.loading=true;let e="&rating="+this.rating+"&review_text="+this.review_text+"&order_id="+this.order_id+"&driver_id="+this.driver_id;axios({method:"POST",url:ajaxurl+"/addRiderReview",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e}).then(e=>{if(e.data.code==1){this.modal=false;ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}};let N=[];let ja;let Ea,Pa;const Fa=Vue.createApp({components:{"component-order-tracking":Ca,"components-review":Ye,"components-reviewdriver":Oa},data(){return{order_uuid:php_order_uuid,merchant_info:[],items:[],meta:[],error:[],maps_config:[],maps_provider:"",cmaps:null,items_count:0,order_progress:-1,order_status:"",order_status_details:"",order_info:[],instructions:[],points_label:"",enabled_review:true,cancel_loading:false,estimated_time:"",is_order_need_cancellation:false,request_interval:5e4,timer:null,is_order_ongoing:false,driver_info:null,modal_chat:false,chat_link:null,isMobile:false,order_type:null,whatsapp_data:[]}},mounted(){this.getOrder();if(typeof request_interval!=="undefined"&&request_interval!==null){this.request_interval=request_interval}this.checkIfMobile();window.addEventListener("resize",this.checkIfMobile)},unmounted(){this.stopTimer();window.removeEventListener("resize",this.checkIfMobile)},watch:{order_progress(e,t){console.log("order_progress change",e);if(this.order_type=="delivery"){this.doFirebaseTrack();this.addDriverRoute(1e3);this.UpdateDriverMarker()}else{if(this.order_progress===3&&!this.driver_info){console.log("add route for pickup");this.addCustomerRoute(1e3)}}},is_order_ongoing(e,t){console.log("is_order_ongoing",e);if(!e){this.removeMap()}}},computed:{isActive(){return{active:true}},hasInstructions(){if(this.instructions){if(!empty(this.instructions.text)){if(this.order_progress>=3){return true}}}return false},getEstimatetime(){let e="";switch(this.order_progress){case 1:case 2:case 3:e=this.estimated_time;break;default:break}return e},showReview(){if(this.order_type=="delivery"){if(this.order_progress===4&&this.enabled_review){return true}}else{if(this.order_progress===3&&!this.driver_info){return true}}return false}},methods:{checkIfMobile(){this.isMobile=window.matchMedia("(max-width: 768px)").matches},callDriver(){const e=`tel:${this.driver_info.phone}`;window.location.href=e},openChatDriver(){const e=this.isMobile?"mobile":"desktop";this.chat_link=chat_driver_url+"/?id=ORD-"+this.order_info.order_uuid+"&view="+e;if(!this.isMobile){this.modal_chat=true}else{location.href=this.chat_link}},doFirebaseTrack(){console.log("doFirebaseTrack",this.driver_info);if(!window.vm_track_order.driver_uuid&&this.driver_info&&this.order_progress==3){window.vm_track_order.driver_uuid=this.driver_info.driver_uuid}},removeMap(){console.log("removeMap");switch(this.maps_provider){case"google.maps":document.getElementById("cmaps").innerHTML="";break;case"mapbox":this.cmaps.remove();this.cmaps=null;break}},updateImage(){h()},afterAddreview(){console.log("afterAddreview");if(this.driver_info){this.$refs.ref_driverreview.modal=true}},getOrder(){var e;var t=g();e="order_uuid="+this.order_uuid;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getOrder",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.merchant_info=e.details.merchant_info;this.order_info=e.details.order_info;this.order_type=this.order_info.service_code;this.items=e.details.items;this.meta=e.details.meta;this.updateImage();this.maps_config=e.details.maps_config;this.items_count=e.details.items_count;this.order_progress=e.details.progress.order_progress;this.order_status=e.details.progress.order_status;this.order_status_details=e.details.progress.order_status_details;this.driver_info=e.details.progress.driver_info;this.instructions=e.details.instructions;this.points_label=e.details.points_label;this.enabled_review=e.details.enabled_review;this.estimated_time=e.details.order_info.estimated_time;this.is_order_need_cancellation=e.details.order_info.is_order_need_cancellation;this.is_order_ongoing=e.details.order_info.is_order_ongoing;this.whatsapp_data=e.details.whatsapp_data;if(this.is_order_ongoing){this.timer=setInterval(()=>{this.trackOrder()},this.request_interval)}}else{this.error=e.msg;this.items_count=0;this.order_info=[];this.points_label=""}if(typeof this.maps_config.provider!=="undefined"&&this.maps_config.provider!==null&&this.is_order_ongoing){this.loadTrackMap()}});n[t].always(e=>{})},afterProgress(e){console.log("afterProgress",e);if(e.order_id!=this.order_info.order_id){return}this.driver_info=e.driver_info;this.is_order_ongoing=e.is_order_ongoing;if(e.order_progress==0){this.order_progress=e.order_progress;this.order_status=e.order_status;this.order_status_details=e.order_status_details}else if(e.order_progress==-1){}else{this.order_progress=e.order_progress;this.order_status=e.order_status;this.order_status_details=e.order_status_details;this.estimated_time=e.estimated_time;this.is_order_need_cancellation=e.is_order_need_cancellation}},writeReview(e){u("writeReview 123=>"+e);this.$refs.ReviewRef.order_uuid=e;this.$refs.ReviewRef.show()},loadTrackMap(){this.maps_provider=this.maps_config.provider;let e=this.order_info.address_label+" - "+this.order_info.complete_delivery_address+" "+this.order_info.location_name;switch(this.maps_provider){case"google.maps":ja=new google.maps.LatLngBounds;this.cmaps=new google.maps.Map(document.getElementById("cmaps"),{center:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},zoom:this.maps_config.zoom,disableDefaultUI:true});
1525Ea=new google.maps.DirectionsService;Pa=new google.maps.DirectionsRenderer({map:this.cmaps,suppressMarkers:true,polylineOptions:{strokeColor:"blue",strokeWeight:7,strokeOpacity:.8}});if(!empty(this.merchant_info.latitude)){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:{url:this.maps_config.icon_merchant,scaledSize:new google.maps.Size(45,45)},animation:google.maps.Animation.DROP,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}if(!empty(this.meta.latitude)){this.addMarker({position:{lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)},map:this.cmaps,icon:{url:this.maps_config.icon_destination,scaledSize:new google.maps.Size(45,45)},animation:google.maps.Animation.DROP,title:e},2)}this.FitBounds();break;case"mapbox":ja=new mapboxgl.LngLatBounds;mapboxgl.accessToken=this.maps_config.key;this.cmaps=new mapboxgl.Map({container:this.$refs.cmaps,style:"mapbox://styles/mapbox/streets-v12",center:[parseFloat(this.maps_config.default_lng),parseFloat(this.maps_config.default_lat)],zoom:14});this.cmaps.on("error",e=>{console.log("map error",e.error.message)});this.mapBoxResize();if(!empty(this.merchant_info.latitude&&this.order_progress<=2)){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:"marker_icon_merchant",animation:null,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}else if(this.order_progress>2&&!this.driver_info){this.addMarker({position:{lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)},map:this.cmaps,icon:"marker_icon_merchant",animation:null,title:this.merchant_info.restaurant_name+" - "+this.merchant_info.address},1)}if(!empty(this.meta.latitude)){this.addMarker({position:{lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)},map:this.cmaps,icon:"marker_icon_destination",animation:null,title:e},2)}if(this.driver_info&&this.order_progress>2){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:"marker_icon_rider",animation:null,title:this.driver_info.full_name},3)}this.FitBounds();break;case"yandex":this.initYandexTrackMap();break}},async initYandexTrackMap(){console.debug("initYandexTrackMap");await ymaps3.ready;const{YMap:e,YMapDefaultSchemeLayer:a,YMapMarker:s,YMapDefaultFeaturesLayer:i}=ymaps3;const o={center:[parseFloat(this.maps_config.default_lng),parseFloat(this.maps_config.default_lat)],zoom:k};if(T){T.destroy();T=null}if(!T){T=new e(this.$refs.cmaps,{location:o,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new a({}),new i({})]);let t=[];if(!empty(this.merchant_info.latitude)){let e=[parseFloat(this.merchant_info.longitude),parseFloat(this.merchant_info.latitude)];t.push(e);const d=document.createElement("img");d.className="icon-marker";d.src=this.maps_config.icon_merchant;T.addChild(new s({coordinates:e},d))}if(!empty(this.meta.latitude)){let e=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)];t.push(e);const d=document.createElement("img");d.className="icon-marker";d.src=this.maps_config.icon_destination;T.addChild(new s({coordinates:e},d))}const r={center:t[0],zoom:k};T.update({location:r})}},mapBoxResize(){if(this.maps_config.provider=="mapbox"){setTimeout(()=>{this.cmaps.resize()},500)}},addMarker(e,t){switch(this.maps_provider){case"google.maps":N[t]=new google.maps.Marker(e);const a=new google.maps.InfoWindow({content:e.title});N[t].addListener("click",()=>{a.open(this.cmaps,N[t])});ja.extend(N[t].position);break;case"mapbox":const s=document.createElement("div");s.className=e.icon;N[t]=new mapboxgl.Marker(s).setLngLat([e.position.lng,e.position.lat]).addTo(this.cmaps);const i=new mapboxgl.Popup({offset:25}).setText(e.title);N[t].setPopup(i);ja.extend(new mapboxgl.LngLat(e.position.lng,e.position.lat));break}},async addDriverRoute(e){if(!this.is_order_ongoing){return}setTimeout(async()=>
1525{if(this.driver_info&&this.order_progress>2){console.log("addDriverRoute");if(N[1]){if(this.maps_provider=="mapbox"){N[1].remove()}else if(this.maps_provider=="google.maps"){console.log("remove marker mapbox");N[1].setMap(null);N[1]=null}}let e,t;if(this.maps_provider=="mapbox"){e=[parseFloat(this.driver_info.lontitude),parseFloat(this.driver_info.latitude)];t=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)]}else if(this.maps_provider=="google.maps"){e={lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)};t={lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)}}this.addRoute(e,t)}},e)},addCustomerRoute(e){let t,a;if(this.maps_provider=="mapbox"){t=[parseFloat(this.meta.longitude),parseFloat(this.meta.latitude)];a=[parseFloat(this.merchant_info.longitude),parseFloat(this.merchant_info.latitude)]}else if(this.maps_provider=="google.maps"){t={lat:parseFloat(this.meta.latitude),lng:parseFloat(this.meta.longitude)};a={lat:parseFloat(this.merchant_info.latitude),lng:parseFloat(this.merchant_info.longitude)}}setTimeout(()=>{this.addRoute(t,a)},e)},async addRoute(e,t){console.log("start",e);console.log("end",t);if(this.maps_provider=="mapbox"){const a=await fetch(`https://api.mapbox.com/directions/v5/mapbox/driving/${e[0]},${e[1]};${t[0]},${t[1]}?geometries=geojson&access_token=${mapboxgl.accessToken}`,{method:"GET"});const s=await a.json();const i=s.routes[0];const o=i.geometry;if(this.cmaps.getSource("route")){this.cmaps.getSource("route").setData(o)}else{this.cmaps.addLayer({id:"route",type:"line",source:{type:"geojson",data:o},layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#76adeb","line-width":7}})}this.FitBounds()}else if(this.maps_provider=="google.maps"){Pa.setDirections({routes:[]});Ea.route({origin:e,destination:t,travelMode:"DRIVING"},(e,t)=>{console.log("status",t);if(t==="OK"){console.log("response",e);Pa.setDirections(e)}else{console.error("Directions request failed due to "+t)}})}},FitBounds(){switch(this.maps_provider){case"google.maps":this.cmaps.fitBounds(ja);break;case"mapbox":this.cmaps.fitBounds(ja,{padding:30});break}},CancelOrder(){console.log("CancelOrder",this.order_uuid);let e=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(e.cancel_order_descriptions,e.cancel_order,{confirmButtonText:e.confirm,cancelButtonText:e.cancel,type:"info"}).then(()=>{this.applyCancelOrder()})["catch"](()=>{})},applyCancelOrder(){this.cancel_loading=true;axios({method:"POST",url:ajaxurl+"/CancelOrder",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&order_uuid="+this.order_uuid}).then(e=>{if(e.data.code==1){ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});this.getOrder()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.cancel_loading=false})},trackOrder(){console.log("trackOrder");axios.get(ajaxurl+"/trackOrder?"+"order_uuid="+this.order_uuid).then(e=>{if(e.data.code==1){this.afterProgress(e.data.details.data);if(!e.data.details.data.is_order_ongoing){this.stopTimer()}}else{this.stopTimer()}})["catch"](e=>{console.error("Error:",e)}).then(e=>{})},stopTimer(){console.log("stopTimer");clearInterval(this.timer)},setDriverLocation(e){if(this.driver_info&&this.order_progress>2){console.log("setDriverLocation",e);this.driver_info.latitude=e.lat;this.driver_info.lontitude=e.lng;this.UpdateDriverMarker();this.addDriverRoute(0)}}
1525,UpdateDriverMarker(){if(!this.cmaps){return}if(!this.is_order_ongoing){return}if(!this.driver_info){return}if(this.driver_info&&this.order_progress>2){console.log("UpdateDriverMarker");if(N[3]){if(this.maps_provider=="mapbox"){const e=[parseFloat(this.driver_info.lontitude),parseFloat(this.driver_info.latitude)];N[3].setLngLat(e)}else if(this.maps_provider=="google.maps"){console.log("move google marker");const e={lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)};N[3].setPosition(e)}}else{if(this.maps_provider=="mapbox"){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:"marker_icon_rider",animation:null,title:this.driver_info.full_name},3)}else if(this.maps_provider=="google.maps"){this.addMarker({position:{lat:parseFloat(this.driver_info.latitude),lng:parseFloat(this.driver_info.lontitude)},map:this.cmaps,icon:{url:this.maps_config.icon_rider,scaledSize:new google.maps.Size(35,35)},animation:null,title:this.driver_info.full_name},3)}}}}}});Fa.use(ElementPlus);window.app_orders_track=Fa.mount("#vue-orders-track");const Na={props:["payload","label","cart_preview","drawer"],data(){return{cart_loading:true,cart_uuid:"",cart_items:[],cart_summary:[],cart_merchant:[],cart_total:[],error:[],go_checkout:[],subtotal:[],items_count:0,update_cart_loading:false}},computed:{hasError(){if(this.error.length>0){return true}return false}},methods:{getCartPreview(){if(!this.cart_preview){this.getCartCount();return}var t=g();let e=getCookie("currency_code");e=!empty(e)?e:"";const a=getLocation();const s=getFromLocalStorageStore(StoreMapName,"selectedAddress");var i={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),currency_code:e,payload:this.payload,location:a,latitude:s?s.latitude:"",longitude:s?s.longitude:""};n[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.cart_loading=false;if(e.code==1){this.cart_merchant=e.details.data.merchant;this.cart_uuid=e.details.cart_uuid;this.cart_items=e.details.data.items;this.cart_summary=e.details.data.summary;this.cart_total=e.details.data.total;this.error=e.details.error;this.go_checkout=e.details.go_checkout;this.subtotal=e.details.data.subtotal;this.items_count=e.details.items_count}else{this.cart_items=[];this.cart_summary=[];this.cart_total=[];this.error=[];this.subtotal=0;this.items_count=0}this.updateImage();this.$emit("setCartcount",this.items_count);if(typeof E!=="undefined"&&E!==null){E.hasItemInCart(this.items_count,this.cart_merchant)}})},getCartCount(){var t=g();let e=getCookie("currency_code");e=!empty(e)?e:"";var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),currency_code:e,payload:["items_count"]};n[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.items_count=e.details.items_count}else this.items_count=0;this.$emit("setCartcount",this.items_count)})},updateCartQty(e,t,a,s){if(e==1){t++}else t--;if(t<=0){this.remove(a,s)}else{this.updateCartItems(t,a,s)}},updateCartItems(e,t,a){var s;var i=1;s="cart_uuid="+a;s+="&cart_row="+t;s+="&item_qty="+e;this.update_cart_loading=true;s+=addValidationRequest();n[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[i]!=null){n[i].abort()}}});n[i].done(e=>{if(e.code==1){this.getCartPreview()}if(typeof rt!=="undefined"&&rt!==null){rt.$refs.ref_featured_list.getFeaturedItems()}});n[i].always(e=>{this.update_cart_loading=false})},remove(e,t){var a;var s=1;a="row="+e+"&cart_uuid="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/removeCartItem",method:"POST",dataType:"json",data:a,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:c,crossDomain:true,beforeSend:function(e){if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{u(e);
1525if(e.code==1){this.getCartPreview()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();n[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getCartPreview()}})},updateImage(){h()},beforeClose(e){this.$emit("afterDrawerclose",false);e()}},template:`
1526	
1527	<el-drawer
1528    v-model="drawer"    
1529    direction="rtl"    
1530	size="320px"
1531	append-to-body="true"	
1532	:with-header="true"	
1533	:before-close="beforeClose"
1534	custom-class="drawer-preview-cart"
1535    >    
1536	  	   	  	  	  
1537	  <template v-if="cart_loading==false">
1538	    <template v-if="cart_items.length>0">    	        
1539	    
1540	     <div class="mt-3 mb-0">
1541		    <p class="m-0 bold">{{label.your_cart}}</p>
1542		    <a :href="cart_merchant.restaurant_slug" class="m-0 p-0"><h5 class="m-0 chevron d-inline position-relative">{{cart_merchant.restaurant_name}}</h5></a>
1543		    <p class="m-0 text-muted">{{cart_merchant.merchant_address}}</p>
1544		  </div>	  	  	
1545	    
1546			  <div class="d-flex justify-content-between align-items-center mb-1">
1547			   <div><h6 class="m-0">{{label.summary}}</h6></div>
1548			   <div>
1549			     <a href="javascript:;" @click="clear(cart_uuid)" class="javascript:;">
1550			       <p class="m-0"><u>{{label.clear}}</u></p>
1551			     </a>
1552			   </div>
1553			</div>
1554	    </template>
1555	    
1556	    <template v-else>
1557	    <h5 class="mt-3 mb-0">{{label.cart}}</h5> 
1558	    <div class="cart-empty text-center" >
1559	      <div class="mt-5">
1560	        <div class="no-results m-auto"></div>
1561	        <h6 class="m-0 mt-3">{{label.no_order}}</h6>
1562	        <p>{{label.lets_change_that}}</p>
1563	      </div>
1564	    </div>
1565	    </template>
1566	    
1567	  </template>  
1568	  
1569	    <!--section-cart-->  
1570  <DIV class="section-cart">
1571  
1572  <div v-cloak class="items" v-for="(items, index) in cart_items" >
1573  
1574    <div class="line-items row mb-1">
1575      <div class="col-3">		               
1576		 <el-image
1577			style="width: 50px; height: 50px"
1578			:src="items.url_image"
1579			:fit="contain"
1580			lazy
1581		  ></el-image>
1582      </div> <!--col-->
1583      
1584      <div class="col-6 p-0 d-flex justify-content-start flex-column">
1585      
1586        <p class="mb-1">
1587          {{ items.item_name }}
1588          <template v-if=" items.price.size_name!='' "> 
1589          ({{items.price.size_name}})
1590          </template>
1591        </p>	     
1592		
1593		<template v-if="items.is_free">
1594         <div class="mb-1">
1595            <el-tag effect="plain" type="success" size="small" style="white-space: nowrap !important;" >
1596             {{ label.free }}
1597            </el-tag>
1598         </div>
1599        </template>
1600		<template v-else> 
1601			<template v-if="items.price.discount>0">         
1602			<p class="m-0 font11"><del>{{items.price.pretty_price}}</del> {{items.price.pretty_price_after_discount}}</p>
1603			</template>
1604			<template v-else>
1605			<p class="m-0 font11">{{items.price.pretty_price}}</p>
1606			</template>
1607		 </template>
1608               
1609         <!--quantity-->
1610		 <div class="quantity d-flex justify-content-between">
1611		 
1612			<div>
1613			 <a href="javascript:;" @click="updateCartQty(0,items.qty,items.cart_row,cart_uuid)"  class="rounded-pill qty-btn" data-id="less">
1614			  <i class="zmdi zmdi-minus"></i>
1615			  </a>
1616			</div>
1617			
1618			<div class="qty">{{  items.qty }}</div>
1619			
1620			<div>
1621			<a href="javascript:;" @click="updateCartQty(1,items.qty,items.cart_row,cart_uuid)" class="rounded-pill qty-btn" data-id="plus">
1622			 <i class="zmdi zmdi-plus"></i>
1623			 </a>
1624		    </div>
1625		    
1626		 </div>
1627		 <!--quantity-->		 
1628        
1629		<p class="mb-0" v-if=" items.special_instructions!='' ">{{ items.special_instructions }}</p>	               
1630		 
1631        <template v-if=" items.attributes!='' "> 
1632          <template v-for="(attributes, attributes_key) in items.attributes">                    
1633            <p class="mb-0">            
1634            <template v-for="(attributes_data, attributes_index) in attributes">            
1635              {{attributes_data}}<template v-if=" attributes_index<(attributes.length-1) ">, </template>
1636            </template>
1637            </p>
1638          </template>
1639        </template>
1640        
1641              
1642      </div> <!--col-->
1643      
1644      <div class="col-3  quantity d-flex justify-content-start flex-column  text-right">
1645        <a href="javascript:;" @click="remove(items.cart_row,cart_uuid)" class="rounded-pill ml-auto mb-1"><i class="zmdi zmdi-close"></i></a>
1646        <template v-if="items.price.discount<=0 ">
1647          <p class="mb-0">{{ items.price.pretty_total }}</p>
1648        </template>
1649        <template v-else>
1650           <p class="mb-0">{{ items.price.pretty_total_after_discount }}</p>
1651        </template>
1652      </div> <!--col-->
1653      
1654    </div><!-- line-items-->
1655    
1656    <!--addon-items-->
1657    <div class="addon-items row mb-1"  v-for="(addons, index_addon) in items.addons" >
1658      <div class="col-3"><!--empty--></div> <!--col-->		     
1659      <div class="col-9 pl-0 d-flex justify-content-start flex-column">
1660         <p class="m-0 bold">{{ addons.subcategory_name }}</p>		  
1661                
1662         <template v-cloak v-for="addon_items in addons.addon_items">
1663         <div class="d-flex justify-content-between mb-1">
1664           <div class="flexrow"><p class="m-0">{{addon_items.qty}} x {{addon_items.pretty_price}} {{addon_items.sub_item_name}}</p></div>
1665           <div class="flexrow"><p class="m-0">{{addon_items.pretty_addons_total}}</p></div>
1666         </div>	<!--flex-->                  
1667        </template>
1668         
1669      </div> <!--col-->		      		      
1670    </div>
1671    <!-- addon-items-->
1672    
1673  </div> <!--items-->
1674
1675  </DIV>
1676  
1677   <template v-if="cart_items.length>0">     
1678     <div class="divider"></div>   
1679	  <a class="btn btn-green w-100 pointer position-relative" :disabled="hasError" 
1680	  :href="hasError?'javascript:;':go_checkout.link"
1681	  :class="{ loading: update_cart_loading }"
1682	  >
1683	   <div class="d-flex justify-content-between">
1684	     <div>{{label.go_checkout}}</div>
1685	     <div v-if="!update_cart_loading">{{subtotal.value}}</div>
1686		 <div class="m-auto circle-loader" data-loader="circle-side"></div>
1687	   </div>	   
1688	  </a>
1689   </template> 
1690   
1691    <div v-cloak class="alert alert-warning m-0 mt-2" v-if="error.length>0">
1692      <p class="m-0" v-for="error_msg in error">
1693      {{ error_msg }}
1694      </p>
1695    </div>    
1696	  
1697	</el-drawer>		
1698	`};const Ra={props:["ajax_url","message"],data(){return{settings:[],beams:undefined}},mounted(){this.getWebpushSettings()},methods:{getWebpushSettings(){axios({method:"POST",url:this.ajax_url+"/getWebpushSettings",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.settings=e.data.details;
1698if(this.settings.enabled==1){this.webPushInit()}}else{this.settings=[]}})["catch"](e=>{}).then(e=>{})},webPushInit(){if(this.settings.provider=="pusher"&&this.settings.user_settings.enabled==1){this.beams=new PusherPushNotifications.Client({instanceId:this.settings.pusher_instance_id});this.beams.start().then(()=>{this.beams.setDeviceInterests(this.settings.user_settings.interest).then(()=>{console.log("Device interests have been set")}).then(()=>this.beams.getDeviceInterests()).then(e=>console.log("Current interests:",e))["catch"](e=>{var t={notification_type:"push",message:"Beams "+e,date:"",image_type:"icon",image:"zmdi zmdi-info-outline"};R.$refs.notification.addData(t)})})["catch"](e=>{var t={notification_type:"push",message:"Beams "+e,date:"",image_type:"icon",image:"zmdi zmdi-info-outline"};R.$refs.notification.addData(t)})}else if(this.settings.provider=="onesignal"){}}},template:`	   
1699	`};const Da={components:{"components-webpush":Ra},props:["ajax_url","label","realtime","view_url","avatar","image_background"],data(){return{data:[],count:0,new_message:false,player:undefined,ably:undefined,channel:undefined,piesocket:undefined,observer:undefined,pusher:undefined,sounds_order:null,sounds_chat:null}},mounted(){this.getAllNotification();if(this.realtime.enabled){this.initRealTime()}this.observer=lozad(".lozad",{loaded:function(e){e.classList.add("loaded")}});if(typeof sounds_order!=="undefined"&&sounds_order!==null){this.sounds_order=sounds_order}if(typeof sounds_chat!=="undefined"&&sounds_chat!==null){this.sounds_chat=sounds_chat}},updated(){this.observer.observe()},computed:{hasData(){if(this.data.length>0){return true}return false},ReceiveMessage(){if(this.new_message){return true}return false}},methods:{initRealTime(){u(this.realtime.event_tracking_order);if(this.realtime.provider=="pusher"){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.realtime.channel);this.channel.bind(this.realtime.event,e=>{u("receive pusher");u(e);if(e.notification_type=="silent"){}else if(e.notification_type=="order_update"){this.playAlert(this.sounds_order)}else if(e.notification_type=="chat-message"){this.playAlert(this.sounds_chat)}else{this.playAlert()}this.addData(e)})}else if(this.realtime.provider=="ably"){this.ably=new Ably.Realtime(this.realtime.ably_apikey);this.ably.connection.on("connected",()=>{this.channel=this.ably.channels.get(this.realtime.channel);this.channel.subscribe(this.realtime.event,e=>{u("receive ably");u(e.data);this.playAlert();this.addData(e.data)})})}else if(this.realtime.provider=="piesocket"){this.piesocket=new PieSocket({clusterId:this.realtime.piesocket_clusterid,apiKey:this.realtime.piesocket_api_key});
1699this.channel=this.piesocket.subscribe(this.realtime.channel);this.channel.listen(this.realtime.event,e=>{u("receive piesocket");u(e);this.playAlert();this.addData(e)})}},playAlert(e){let t=[site_url+"/assets/sound/notify.mp3",site_url+"/assets/sound/notify.ogg"];if(e){t=[e]}this.player=new Howl({src:t,html5:true});this.player.play()},getAllNotification(){axios({method:"POST",url:this.ajax_url+"/getNotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.count=e.data.details.count}else{this.data=[];this.count=0}})["catch"](e=>{}).then(e=>{})},addData(e){this.data.unshift(e);this.count++;this.new_message=true;setTimeout(()=>{this.new_message=false;this.player.stop()},1e3)},clearAll(){axios({method:"POST",url:this.ajax_url+"/clearNotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=[];this.count=0}else{f(e.data.msg,"error")}this.new_message=false})["catch"](e=>{}).then(e=>{})}},template:`
1700	
1701	<components-webpush
1702	 :ajax_url="ajax_url"
1703	 :message='label'
1704	/>
1705	</components-webpush>
1706		
1707	<div class="btn-group pull-right notification-dropdown">
1708	      <button type="button" class="btn p-0 btn-default" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
1709	        <img class="img-30 rounded-pill lozad" :src="avatar" :data-background-image="image_background" />
1710	        <span v-if="count>0" :class="{'shake-constant shake-chunk' : ReceiveMessage }" class="badge rounded-circle badge-danger count">{{count}}</span>
1711	      </button>
1712          <div class="dropdown-menu dropdown-menu-right">
1713            <div class="dropdown-header d-flex justify-content-between">
1714               <div class="flex-col">
1715                 <div class="d-flex align-items-center">
1716                  <h5 class="m-0 mr-2">{{label.title}}</h5>
1717                  <span class="badge rounded-circle badge-green badge-25">{{count}}</span>
1718                 </div>
1719               </div>
1720               <div class="flex-col" v-if="hasData">
1721                <a @click="clearAll">{{label.clear}}</a>
1722               </div>
1723            </div>
1724            <!--header-->
1725            
1726            <!--content-->            
1727            <ul v-if="hasData"  class="list-unstyled m-0">
1728             <li v-for="(item,index) in data">
1729              <a :class="{ active: index<=0 }" >
1730                <div class="d-flex">
1731                   <div v-if="item.image!=''" class="flex-col mr-3">  
1732                      <template v-if="item.image_type=='icon'">
1733                         <div class="notify-icon rounded-circle bg-soft-primary">
1734	                        <i :class="item.image"></i>
1735	                      </div>
1736                      </template>
1737                      <template v-else>
1738                       <div class="notify-icon">
1739                          <img class="img-40 rounded-circle" :src="item.image" />
1740                       </div>
1741                      </template>
1742                   </div>
1743                   <div class="flex-col">
1744                      <div class="text-heading" v-html="item.message"></div>
1745	                  <div class="dropdown-text-light">{{item.date}}</div>
1746                   </div>
1747                </div>
1748              </a>
1749             </li>		            		             
1750            </ul>
1751            <!--content-->
1752            
1753            <div v-if="!hasData" class="none-notification text-center">
1754              <div class="image-notification m-auto"></div>
1755              <h5 class="m-0 mb-1 mt-2">{{label.no_notification}}</h5>
1756              <p class="m-0 font11 text-muted">{{label.no_notification_content}}</p>
1757            </div>
1758            
1759            <div v-if="hasData" class="footer-dropdown text-center">
1760            <a :href="view_url" targe="_blank" class="text-primary">{{label.view}}</a>
1761            </div>
1762            
1763          </div> <!--dropdown-menu-->
1764      </div>
1765      <!--btn-group-->
1766	`};const Ma={props:["ajax_url"],data(){return{data:[],is_loading:false}},mounted(){this.getLanguage()},methods:{getLanguage(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getLanguage",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setLang(e){window.location.href=e}},template:`  
1767  <el-skeleton style="width: 150px" :loading="is_loading" animated>
1768  <template #template>
1769       <el-skeleton-item variant="image" style="width: 150px; height: 20px" />
1770  </template>	 
1771  <template #default>  
1772  
1773  <el-dropdown trigger="click" v-if="data.enabled">
1774    <span class="el-dropdown-link">
1775
1776	   <div class="d-flex align-items-center">
1777	     <div class="mr-2">
1778		 <el-image
1779			style="width: 30px; height: 25px"
1780			:src="data.default.flag"
1781			:fit="contain"
1782			lazy
1783		  ></el-image>
1784		 </div>
1785		 <div class="mr-2">{{data.default.title}}</div>
1786		 <div><i class="zmdi zmdi-chevron-down"></i></div>
1787	   </div>	         
1788    </span>
1789    <template #dropdown>
1790      <el-dropdown-menu>
1791        <el-dropdown-item v-for="item in data.data" >
1792		
1793		<el-dropdown-item @click="setLang(item.link)">
1794		<div class="row no-gutters align-items-center">
1795		  <div class="col mr-3">
1796			<el-image
1797			style="width: 30px; height: 25px"
1798			:src="item.flag"
1799			:fit="contain"			
1800			></el-image>		
1801		  </div>
1802		  <div class="col">{{item.title}}</div>
1803		</div>
1804		</el-dropdown-item> 
1805
1806		</el-dropdown-item>        
1807      </el-dropdown-menu>
1808    </template>
1809  </el-dropdown>
1810
1811  </template>	 
1812  </el-skeleton>
1813  `};const Aa={props:["ajax_url","realtime"],data(){return{merchant_uuid:""}},created(){this.getMerchantByCart()},methods:{getMerchantByCart(){axios({method:"POST",url:this.ajax_url+"/getMerchantByCart",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.merchant_uuid=e.data.details.merchant_uuid;this.initRealTime()}else{this.merchant_uuid=""}})["catch"](e=>{}).then(e=>{})},initRealTime(){if(this.realtime.provider=="pusher"&&this.realtime.enabled==1){Pusher.logToConsole=false;this.pusher=new Pusher(this.realtime.key,{cluster:this.realtime.cluster});this.channel=this.pusher.subscribe(this.merchant_uuid);this.channel.bind(this.realtime.event,e=>{let t=JSON.parse(e.message);this.$emit("afterReceiveitemupdate",t)})}}}};const $a={data(){return{data:[],loading:false,based_currency:""}},created(){this.getCurrencyList()},methods:{getCurrencyList(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getCurrencyList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&currency_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.based_currency=e.data.details.based_currency}else{this.data=[];this.based_currency=""}})["catch"](e=>{}).then(e=>{this.loading=false})},setCurrency(e){this.based_currency=e;this.$emit("afterSelectcurrency",e)}},template:`		
1814	<div class="dropdown language-bar d-inline" v-if="!loading"  >	      
1815		<a class="dropdown-toggle text-truncate" href="javascript:;" 
1816		role="button" id="currencySelection" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
1817		{{based_currency}}
1818		</a>		    
1819		<div class="dropdown-menu" aria-labelledby="currencySelection">			
1820		    <template v-for="(items,code) in data">
1821			<a @click="setCurrency(code)" class="dropdown-item" :class="{active : based_currency==code}" >			
1822			<div class="d-flex align-items-center">            
1823				<div class="text-truncate">{{items}}</div>
1824			</div>
1825			</a>	
1826			</template>	    		
1827		</div>		   
1828	</div> 
1829	`};const Ya=Vue.createApp({components:{"component-cart-preview":Na,"components-notification":Da,"components-language":Ma,"component-notification-cart":Aa,"component-currency-selection":$a},mounted(){this.getCartPreview()},data(){return{items_count:0,drawer:false,drawer_preview_cart:false}},methods:{getCartPreview(){this.$refs.childref.getCartPreview()},cartCount(e){this.items_count=e},showCartPreview(){this.drawer_preview_cart=true},afterDrawerclose(){this.drawer_preview_cart=false},afterReceiveitemupdate(e){axios({method:"POST",url:ajaxurl+"/validateCartItems",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&item_id="+e.item_id,timeout:c}).then(t=>{if(t.data.code==1){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.alert(t.data.msg,"",{confirmButtonText:e.ok,callback:e=>{if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}
1829if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof E!=="undefined"&&E!==null){E.geStoreMenu()}}})}})["catch"](e=>{}).then(e=>{})},afterSelectcurrency(e){setCookie("currency_code",e,30);if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof E!=="undefined"&&E!==null){E.geStoreMenu()}if(typeof ri!=="undefined"&&ri!==null){if(typeof ri.$refs.food_list_recommended!=="undefined"&&ri.$refs.food_list_recommended!==null){ri.$refs.food_list_recommended.getFoodList();ri.$refs.food_list.getFoodList()}}if(typeof rt!=="undefined"&&rt!==null){rt.$refs.ref_featured_list.getFeaturedItems()}if(typeof os!=="undefined"&&os!==null){os.getPlan()}}}});Ya.use(ElementPlus);const R=Ya.mount("#vue-cart-preview");const Ka={props:["title","button"],data(){return{data:[]}},methods:{show(){p("#ModalAlert").modal("show")},close(){p("#ModalAlert").modal("hide")},alert(e){this.data=e;u(this.data);this.show()}},template:`
1830	  <div class="modal" id="ModalAlert" tabindex="-1" role="dialog" aria-labelledby="ModalAlert" aria-hidden="true">
1831       <div class="modal-dialog modal-dialog-centered" role="document">
1832       <div class="modal-content">     
1833                
1834        <div class="modal-header">
1835             <h5 class="modal-title" id="exampleModalLabel">{{ title }}</h5>
1836	        <button type="button" class="close"  aria-label="Close" @click="close" >
1837	          <span aria-hidden="true">&times;</span>
1838	        </button>
1839	      </div> 
1840	      
1841          <div class="modal-body" >                      
1842            <div v-for="item in data.text" >
1843            {{ item }}
1844            </div>
1845          </div>
1846          
1847          <div class="modal-footer justify-content-center">
1848            <button class="btn btn-black w-25" @click="close" >               
1849               {{button}}
1850            </button>
1851          </div> <!--footer-->
1852       
1853	   </div> <!--content-->
1854	  </div> <!--dialog-->
1855	</div> <!--modal-->
1856	 `};const La=Vue.createApp({components:{"component-alert":Ka},methods:{alert(e){this.$refs.Alertref.alert({text:e})}}}).mount("#component_alert");const za={props:["label"],data(){return{data:[],loading:false,merchant_name:"",cancel_status:false,cancel_msg:"",order_uuid:"",error:[],is_loading:false,cancel_response:[]}},methods:{show(){p("#ModalCancelOrder").modal("show")},close(){p("#ModalCancelOrder").modal("hide");this.order_uuid=""},cancel(e){this.merchant_name=e.merchant_name;this.show();this.order_uuid=e.order_uuid;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/cancelOrderStatus",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.cancel_status=false;this.cancel_msg="";if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.cancel_status=e.details.cancel_status;this.cancel_msg=e.details.cancel_msg;this.cancel_response=e.details}else{this.cancel_status=false;this.cancel_response=[]}});n[a].always(e=>{this.loading=false})},applyCancelOrder(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:this.order_uuid};var t=1;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/applyCancelOrder",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.error=[];this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){f(e.msg,"success");this.close();Va.page=0;Va.data=[];Va.orderHistory()}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})}},template:`
1857	  <div class="modal" id="ModalCancelOrder" tabindex="-1" role="dialog" aria-labelledby="ModalCancelOrder" aria-hidden="true"  data-backdrop="static" data-keyboard="false" >
1858       <div class="modal-dialog modal-dialog-centered" role="document">
1859       <div class="modal-content">     
1860                
1861        <div class="modal-header">
1862             <h5 class="modal-title" id="exampleModalLabel">{{merchant_name}}</h5>
1863	        <button type="button" class="close"  aria-label="Close" @click="close" :disabled="is_loading" >
1864	          <span aria-hidden="true">&times;</span>
1865	        </button>
1866	      </div> 
1867	      
1868	      <DIV v-if="loading">
1869		      <div class="loading mt-5 mb-5">      
1870		        <div class="m-auto circle-loader" data-loader="circle-side"></div>
1871		      </div>
1872		  </DIV>  
1873		  
1874		   <DIV v-else>
1875	      
1876          <div class="modal-body" >                      
1877            
1878            <h5 v-if="cancel_response.refund_status==='full_refund'">{{label.are_you_sure}}</h5>
1879            <h5 v-else>{{label.how}}</h5>
1880            
1881            <div class="mt-3">
1882            <p>{{cancel_msg}}</p>
1883            </div>
1884            
1885            <div class="mt-3 mb-2" v-if="cancel_response.refund_msg">
1886             <p>{{cancel_response.refund_msg}}</p>
1887            </div>
1888            
1889            <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
1890			    <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
1891			 </div>   
1892            
1893          </div> <!--body-->
1894                    
1895          <div class="modal-footer justify-content-center">                      
1896            <button class="btn btn-black w-100" @click="close" :disabled="is_loading" >               
1897               {{label.dont}}
1898            </button>
1899            <button class="btn btn-green w-100" :disabled="!cancel_status" @click="applyCancelOrder()" 
1900            :class="{ loading: is_loading }" >               
1901               <span class="label">{{label.cancel}}</span>
1902               <div class="m-auto circle-loader" data-loader="circle-side"></div>
1903            </button>
1904          </div> <!--footer-->
1905          
1906          </DIV> <!--end if-->
1907       
1908	   </div> <!--content-->
1909	  </div> <!--dialog-->
1910	</div> <!--modal-->
1911	 `};const qa=Vue.createApp({components:{"component-cancel-order":za,"components-review":Ye,"components-reviewdriver":Oa},mounted(){this.orderHistory();this.orderSummary()},data(){return{show_next_page:false,loading:false,load_more:false,page:0,data:[],merchants:[],items:[],size:[],status:[],services:[],show_details:false,order_loading:false,order_merchant:[],order_items:[],order_summary:[],order_info:[],order_status:[],order_services:[],order_label:[],status_allowed_cancelled:[],status_allowed_review:[],q:"",awaitingSearch:false,search_found:false,summary_data:[],total_qty:0,animated_total_qty:0,total_order_raw:0,animated_total_order:0,refund_transaction:[],order_table_data:[],order_info_data:null}},watch:{q(e,t){if(!this.awaitingSearch){if(empty(e)){return false}setTimeout(()=>{var e;var t=g();e="page=0";e+="&q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=[];this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.data.push(e.details.data.data);this.merchants=e.details.data.merchants;this.items=e.details.data.items;this.size=e.details.data.size;this.status=e.details.data.status;this.services=e.details.data.services;this.status_allowed_cancelled=e.details.data.status_allowed_cancelled;this.status_allowed_review=e.details.data.status_allowed_review;this.search_found=true}else{this.data=[];this.search_found=true}});n[t].always(e=>{this.awaitingSearch=false})},1e3);this.awaitingSearch=true}},total_qty(e){gsap.to(this.$data,{duration:.6,animated_total_qty:e})},total_order_raw(e){gsap.to(this.$data,{duration:.6,animated_total_order:e})}},computed:{hasData(){if(this.search_found){return true}return false},hasResults(){if(this.data.length>0){return true}return false},hasRefund(){if(this.refund_transaction.length>0){return true}return false},animatedNumber(){return this.animated_total_qty.toFixed(0)},animatedTotal(){return this.animated_total_order.toFixed(2)},hasBooking(){if(Object.keys(this.order_table_data).length>0){return true}return false}},methods:{clearData(){this.search_found=false;this.q="";this.page=0;this.data=[];this.orderHistory()},orderHistory(){if(!this.load_more){this.loading=true}var e;var t=g();e="page="+this.page;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.show_next_page=e.details.show_next_page;this.page=e.details.page;this.data.push(e.details.data.data);this.merchants=this.addObjectToArray(this.merchants,e.details.data.merchants);this.items=this.addObjectToArray(this.items,e.details.data.items);this.status=e.details.data.status;this.services=e.details.data.services;this.status_allowed_cancelled=e.details.data.status_allowed_cancelled;this.status_allowed_review=e.details.data.status_allowed_review}else{}});n[t].always(e=>{this.loading=false;this.load_more=false})},addObjectToArray(e,t){var a={};Object.entries(e).forEach(([e,t])=>{a[e]=t});Object.entries(t).forEach(([e,t])=>{a[e]=t});return a},loadMoreOrders(e){this.page=e;this.load_more=true;this.orderHistory()},orderDetails(e){this.show_details=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/orderDetails",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.order_loading=true;this.order_merchant=[];this.order_items=[];this.order_summary=[];this.order_info=[];this.order_status=[];this.order_services=[];this.order_label=[];
1911if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.order_merchant=e.details.data.merchant;this.order_items=e.details.data.items;this.order_summary=e.details.data.summary;this.order_info=e.details.data.order.order_info;this.order_label=e.details.data.label;this.refund_transaction=e.details.data.refund_transaction;this.order_status=e.details.data.order.status;this.order_services=e.details.data.order.services;this.order_table_data=e.details.data.order_table_data;if(!empty(this.order_services[this.order_info.service_code])){this.order_services=this.order_services[this.order_info.service_code]}if(!empty(this.order_status[this.order_info.status])){this.order_status=this.order_status[this.order_info.status]}}});n[a].always(e=>{this.order_loading=false;this.updateImage()})},closeOrderDetails(){this.show_details=false},updateImage(){h()},buyAgain(e,t){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),order_uuid:e,cart_uuid:getCookie("cart_uuid")};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/orderBuyAgain",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);if(t==1){this.show_details=false}R.getCartPreview();if(typeof R!=="undefined"&&R!==null){R.showCartPreview()}}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}})},callCancel(e,t){this.$refs.orderCancelRef.cancel({merchant_name:t,order_uuid:e})},writeReview(e,t){this.order_info_data=t;this.$refs.ReviewRef.order_uuid=e;this.$refs.ReviewRef.show()},afterAddreview(){if(this.order_info_data.driver_id>0){this.$refs.ref_driverreview.modal=true}},orderSummary(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/orderSummary",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.summary_data=e.details.summary;this.total_qty=e.details.summary.total_qty;this.total_order_raw=e.details.summary.total_order_raw>0?e.details.summary.total_order_raw:0})}}});qa.use(ElementPlus);const Va=qa.mount("#vue-my-order");const D=Vue.createApp({components:{"component-bootbox":De},data(){return{resolvePromise:undefined,rejectPromise:undefined}},methods:{confirm(){return new Promise((e,t)=>{this.resolvePromise=e;this.rejectPromise=t;this.$refs.bootbox.confirm()})},Callback(e){this.resolvePromise(e)},alert(e,t){this.$refs.bootbox.alert(e,t)}}}).mount("#vue-bootbox");const Ua=Vue.createApp({components:{"component-new-address":Ee,"component-address":Pe},mounted(){this.getAddresses(false)},data(){return{data:[],error:[],is_loading:false,reload_loading:false,total_address:0,total_address_animated:0}},watch:{total_address(e){gsap.to(this.$data,{duration:.5,total_address_animated:e})}},computed:{animatedTotal(){return this.total_address_animated.toFixed(0)}},methods:{getAddresses(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.total_address=this.data.length}else{this.data=[];this.total_address=0}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},showNewAddress(){this.$refs.refnewaddress.autosaved_addres=false;this.$refs.refnewaddress.showModal()},ShowAddress(e){this.$refs.address.show(e)},setLocationDetails(e){this.$refs.address.showWithData(e)},ConfirmDelete(e){this.$refs.address.ConfirmDelete(e)}}});Ua.use(ElementPlus);const Ba=Ua.mount("#vue-my-address");const Ja={props:["label","payment_type","show_payment"],data(){return{data:[],display:false}},mounted(){this.getPaymentMethod();this.display=this.show_payment},methods:{getPaymentMethod(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_type:this.payment_type};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/PaymentMethod",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}})},showPayment(e){this.$emit("setPayment",e)}},template:`
1912	<!--PAYMENT METHODS-->
1913	<transition name="slide-fade">
1914	<div class="card mb-3" v-if="display" >
1915		<div class="card-body">
1916		
1917		<h5 class="mb-3">{{label.add_new_payment}}</h5>
1918		
1919		<a  v-for="payment in data" @click="showPayment(payment.payment_code)"
1920		href="javascript:;" class="d-block chevron-section medium d-flex align-items-center rounded mb-2">
1921		    <div class="flexcol mr-2 payment-logo-wrap">
1922		      <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i>
1923	 		  <img v-else class="img-35" :src="payment.logo_image" />  
1924		    </div>
1925		    
1926		    <div class="flexcol" > 		     		     		      
1927		       <span class="mr-1">{{payment.payment_name}}</span>          
1928		    </div> 		    		    		    
1929		 </a> 
1930		
1931		</div> <!--card body-->
1932	</div> <!--card-->
1933	</transition>
1934	<!--END PAYMENT METHODS-->
1935	`};const Ga=Vue.createApp({data(){return{data:[],default_payment_uuid:"",error:[],is_loading:false,reload_loading:false,payment_method:false}},mounted(){this.getMyPayments(false)},watch:{payment_method(e,t){this.$refs.payment_method.display=e}},methods:{getMyPayments(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/MyPayments",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.default_payment_uuid=e.details.default_payment_uuid}else{this.data=[];this.default_payment_uuid=""}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},ConfirmDelete(t){D.confirm().then(e=>{if(e){this.deletePayment(t)}})},deletePayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/deletePayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getMyPayments(true)}else{D.alert(e.msg,{})}});n[a].always(e=>{})},editPayment(e){this.$refs[e.payment_code].Get(e.reference_id)},SavedPaymentList(){this.getMyPayments(true)},showPayment(e){try{this.$refs[e].showPaymentForm()}catch(t){D.alert(t,{})}},setDefaultPayment(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),payment_uuid:e};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.getMyPayments(true)}else{D.alert(e.msg,{})}})}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Ga.component(e,t)})}Ga.component("components-payment-method",Ja);Ga.use(Maska);Ga.use(ElementPlus);const Wa=Ga.mount("#vue-my-payments");const Za=Vue.createApp({components:{"component-save-store":dt},data(){return{data:[],is_loading:false,reload_loading:false,services:[],estimation:[]}},mounted(){this.saveStoreList(false)},updated(){u("updated");p(".list-items .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})},methods:{saveStoreList(t){this.reload_loading=t;var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/saveStoreList",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!t){this.is_loading=true}else{this.reload_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.data=e.details.data;this.services=e.details.services;this.estimation=e.details.estimation}else{this.data=[];this.services=[];this.estimation=[]}});n[a].always(e=>{this.is_loading=false;this.reload_loading=false})},afterSaveStore(e){e.saved_store=e.saved_store==1?false:true}}});Za.use(ElementPlus);const Ha=Za.mount("#vue-saved-store");const Qa={props:["label","modelValue"],emits:["update:modelValue"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],hasSelected:false}},watch:{q(e,t){this.$emit("update:modelValue",e);if(!this.awaitingSearch){if(empty(e)){return false}if(this.q.length>20){return false}this.show_list=true;setTimeout(()=>{var e;var t=2;e="q="+this.q;e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});n[t].always(e=>{this.awaitingSearch=false})},1e3)}this.data=[];this.awaitingSearch=true}},methods:{showList(){this.show_list=true},clearData(){this.data=[];this.q=""},setData(e){this.clearData();this.q=e.description;
1935this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:`		
1936	<div class="position-relative search-geocomplete"> 	
1937	   <div v-if="!awaitingSearch" class="img-20 m-auto pin_placeholder icon"></div>
1938	   <div v-if="awaitingSearch" class="icon" data-loader="circle"></div>    
1939	   	   
1940	   <input @click="showList" v-model="q" class="form-control form-control-text" 
1941	   :placeholder="label.enter_address" >
1942	   
1943	   <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div>
1944	   
1945	  </div>
1946	
1947	   <div class="search-geocomplete-results" v-if="show_list">		      
1948	    <ul class="list-unstyled m-0 border">
1949	     <li v-for="items in data">			      
1950	      <a href="javascript:;" @click="setData(items)" >
1951	       <h6 class="m-0">{{items.description}}</h6>	       
1952	      </a>
1953	     </li>	     
1954	    </ul>
1955   </div>
1956	`};const Xa=Vue.createApp({components:{"component-auto-complete":Qa,"component-phone":e,"vue-recaptcha":Re},data(){return{data:[],loading:false,mobile_prefixes:[],restaurant_name:"",address:"",contact_email:"",mobile_prefix:"",mobile_number:"",membership_type:"",membership_list:[],response:[],recaptcha_response:"",show_recaptcha:true,membership_commission:[],services_list:[],services:[],currency_list:[],currency:""}},mounted(){this.getSignupAttributes()},computed:{checkForm(){if(empty(this.restaurant_name)){return true}if(empty(this.address)){return true}if(empty(this.contact_email)){return true}if(!this.validEmail(this.contact_email)){return true}if(empty(this.mobile_number)){return true}if(empty(this.mobile_prefix)){return true}if(empty(this.membership_type)){return true}return false}},methods:{getSignupAttributes(){var e;var t=g();e+=addValidationRequest();n[t]=p.ajax({url:ajaxurl+"/getSignupAttributes",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.mobile_prefixes=e.details.mobile_prefixes;this.membership_list=e.details.membership_list;this.show_recaptcha=e.details.capcha;this.membership_commission=e.details.membership_commission;this.services_list=e.details.services_list;this.currency_list=e.details.currency_list}else{this.mobile_prefixes=[];this.membership_list="";this.show_recaptcha=false;this.membership_commission=[];this.services_list=[];this.currency_list=[]}})},verifyForms(){if(this.show_recaptcha){this.verifyRecaptcha()}else{this.submit()}},verifyRecaptcha(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),recaptcha_response:this.recaptcha_response};var t=11;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/verifyRecaptcha",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.submit()}else if(e.code==3){this.recaptchaExpired();this.response.code=2;this.response.msg=e.msg}else{this.response=e}});n[t].always(e=>{this.loading=false})},submit(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),restaurant_name:this.restaurant_name,address:this.address,contact_email:this.contact_email,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,membership_type:this.membership_type,services:this.services,currency:this.currency};var t=22;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/CreateAccountMerchant",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{this.response=e;if(e.code==1){window.location.href=e.details.redirect}});n[t].always(e=>{this.loading=false})},validEmail:function(e){var t=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e)},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){this.$refs.vueRecaptcha.reset()},recaptchaFailed(){},replaceText(e,t,a){let s=e.replace("{transaction_type}",t);s=s.replace("{site_name}",a);return s}}});Xa.use(Maska);Xa.use(ElementPlus);const es=Xa.mount("#vue-merchant-signup");const ts=Vue.createApp({components:{"component-phone":e,"vue-rec
1956aptcha":Re},data(){return{is_loading:false,show_password:false,agree_terms:false,password_type:"password",first_name:"",last_name:"",contact_email:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false,merchant_uuid:"",username:""}},mounted(){this.merchant_uuid=_merchant_uuid},computed:{DataValid(){if(!empty(this.first_name)&&empty(!this.last_name)&&empty(!this.contact_email)&&empty(!this.mobile_number)&&empty(!this.password)&&empty(!this.cpassword)&&empty(!this.username)){return true}return false}},methods:{showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){this.is_loading=true;this.error=[];axios({method:"PUT",url:ajaxurl+"/createMerchantUser",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),username:this.username,password:this.password,cpassword:this.cpassword,first_name:this.first_name,last_name:this.last_name,contact_email:this.contact_email,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,merchant_uuid:this.merchant_uuid},timeout:c}).then(e=>{if(e.data.code==1){window.location.href=e.data.details.redirect}else{this.data=[];this.error=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});ts.use(Maska);const as=ts.mount("#vue-merchant-user");const ss={props:["label","payment_type","ajax_url","actions"],data(){return{is_loading:false,data:[],payment_code:""}},mounted(){this.getPaymentMethod()},methods:{getPaymentMethod(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/"+this.actions,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},isActive(e){return{"border-vertical-green":e.payment_code==this.payment_code}},setPayment(e){this.payment_code=e;this.$emit("setPayment",this.payment_code)}},template:`
1957	<!--PAYMENT METHODS-->	
1958	<div class="card mb-3" >
1959		<div class="card-body">
1960		
1961		<h4 class="mb-3">{{label.select_payment}}</h4>
1962				
1963		<a  v-for="payment in data" 
1964		@click="setPayment(payment.payment_code)"
1965		:class="isActive(payment)"
1966		class="d-block chevron-section medium d-flex align-items-center rounded mb-2">
1967		    <div class="flexcol mr-2 payment-logo-wrap">
1968		      <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i>
1969	 		  <img v-else class="img-35" :src="payment.logo_image" />  
1970		    </div>
1971		    
1972		    <div class="flexcol" > 		     		     		      
1973		       <span class="mr-1">{{payment.payment_name}}</span>          
1974		    </div> 		    		    		    
1975		 </a> 
1976		
1977		</div> <!--card body-->
1978	</div> <!--card-->	
1979	<!--END PAYMENT METHODS-->
1980	`};const is=Vue.createApp({data(){return{data:[],plan_details:[],is_loading:true}},mounted(){this.getPlan()},methods:{getPlan(){this.is_loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:site_url+"/apisubscriptions/getsubscriptionlist",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&currency_code="+e}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.plan_details=e.data.details.plan_details}else{this.data=[];this.plan_details=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setChoosePlan(e){this.is_loading=true;let t="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&subscriber_id="+subscriber_id+"&package_id="+e;t+="&subscription_type="+subscription_type;t+="&success_url="+success_url;t+="&failed_url="+failed_url;axios({method:"POST",url:site_url+"/apisubscriptions/createPaymentPlan",data:t}).then(e=>{if(e.data.code==1){window.location.href=payment_url+"?payment_id="+e.data.details.payment_id}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});is.use(ElementPlus);const os=is.mount("#vue-subscription");const rs=Vue.createApp({data(){return{data:[],loading:false,merchant_uuid:null,package_uuid:null,plan_details:[],payment_list:[],payment_code:"",subscriber_id:null,payment_id:null,
1980subscription_type:null}},mounted(){if(typeof payment_id!=="undefined"&&payment_id!==null){this.payment_id=payment_id}if(typeof subscription_type!=="undefined"&&subscription_type!==null){this.subscription_type=subscription_type}this.getSelectPaymentPlan()},computed:{hasPaymentSelected(){return empty(this.payment_code)?false:true}},methods:{isActive(e){return this.payment_code==e?true:false},getSelectPaymentPlan(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"GET",url:site_url+"/apisubscriptions/getCreatePayment?payment_id="+payment_id+"&currency_code="+e}).then(e=>{if(e.data.code==1){this.plan_details=e.data.details.plan_details;this.payment_list=e.data.details.payment_list}else{this.plan_details=[];this.payment_list=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},showPayment(){console.log("this.payment_code",this.payment_code);console.log("this.subscription_type",this.subscription_type);try{this.$refs[this.payment_code][this.subscription_type]()}catch(e){console.log("error",e);ElementPlus.ElNotification({title:"",message:"This payment is not available for plan",position:"bottom-right",type:"warning"})}},showLoader(){this.loading=true},closeLoader(){this.loading=false},errorMessage(e){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){rs.component(e,t)})}rs.use(ElementPlus);const ds=rs.mount("#payment-plan");const ls=Vue.createApp({components:{"component-phone":e,"component-change-phoneverify":ha},data(){return{is_loading:false,data:[],first_name:"",last_name:"",email_address:"",mobile_prefix:"",mobile_number:"",original_email_address:"",original_mobile_number:"",error:[],success:"",original_mobile_prefix:"",custom_fields:{}}},computed:{DataValid(){if(!empty(this.first_name)&&empty(!this.last_name)&&empty(!this.email_address)&&empty(!this.mobile_number)){return true}return false}},mounted(){this.getProfile()},methods:{getProfile(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=11;e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/getProfile",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.first_name=e.details.first_name;this.last_name=e.details.last_name;this.email_address=e.details.email_address;this.mobile_prefix=e.details.mobile_prefix;this.mobile_number=e.details.mobile_number;this.original_mobile_prefix=e.details.mobile_prefix;this.original_email_address=e.details.email_address;this.original_mobile_number=e.details.mobile_number;const a=e.details.custom_fields;if(a){Object.keys(a).forEach(e=>{const t=a[e];this.addCustomField(e,t)})}}else{this.msg=e.msg}});n[t].always(e=>{this.is_loading=false})},addCustomField(e,t){this.custom_fields[e]=t},checkForm(){var e=false;if(this.email_address!=this.original_email_address){e=true}if(this.mobile_number!=this.original_mobile_number){e=true}if(this.original_mobile_prefix!=this.mobile_prefix){e=true}this.success="";this.error=[];console.log("_change",e);if(e){this.$refs.cphoneverify.show({mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,message:_message});this.$refs.cphoneverify.resendCode()}else{this.saveProfile("")}},saveProfile(t){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:t,first_name:this.first_name,last_name:this.last_name,email_address:this.email_address,mobile_prefix:this.mobile_prefix,mobile_number:this.mobile_number,custom_fields:this.custom_fields};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/saveProfile",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(!empty(t)){this.$refs.cphoneverify.is_loading=true}else{this.is_loading=true}if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();this.success=e.msg;this.original_email_address=this.email_address;this.original_mobile_number=this.mobile_number}else{if(!empty(t)){this.$refs.cphoneverify.error=e.msg}else this.error=e.msg}});n[a].always(e=>{if(!empty(t)){this.$refs.cphoneverify.is_loading=false}else{this.is_loading=false}})}}});ls.use(Maska);ls.use(ElementPlus);const ns=ls.mount("#vue-update-profile");const cs=Vue.createApp({components:{"component-change-phoneverify":ha},data(){return{is_loading:false,data:[],error:[],success:"",old_password:"",new_password:"",confirm_password:""}},computed:{DataValid(){if(!empty(this.old_password)&&empty(!this.new_password)&&empty(!this.confirm_password)){return true}return false}},methods:{updatePassword(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),old_password:this.old_password,new_password:this.new_password,confirm_password:this.confirm_password};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/updatePassword",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error="";this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;this.old_password="";this.new_password="";this.confirm_password=""}else this.error=e.msg});n[t].always(e=>{this.is_loading=false})}}}).mount("#vue-update-password");const ms=Vue.createApp({components:{"component-change-phoneverify":ha},data(){return{is_loading:false,error:[],success:"",steps:1,steps_request_data:1}},methods:{requestArchive(){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};var t=g();e=JSON.stringify(e);n[t]=p.ajax({url:ajaxurl+"/requestData",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.steps_request_data=1;this.error="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.steps_request_data=2}else{this.error=e.msg}});n[t].always(e=>{this.is_loading=false})},confirm(){this.$refs.cphoneverify.show({mobile_prefix:_phone_prefix,mobile_number:_contact_phone,message:_message});this.$refs.cphoneverify.resendCode()},verifyAccountDelete(t){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:t};var a=g();e=JSON.stringify(e);n[a]=p.ajax({url:ajaxurl+"/verifyAccountDelete",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.cphoneverify.is_loading=true;this.$refs.cphoneverify.error=[];if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();D.confirm().then(e=>{if(e){this.deleteAccount(t)}})}else this.$refs.cphoneverify.error=e.msg});n[a].always(e=>{this.$refs.cphoneverify.is_loading=false})},deleteAccount(e){var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),code:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/deleteAccount",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;this.error="";this.success="";if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){this.steps=2;setTimeout(()=>{window.location.href=e.details.redirect},4e3)}else D.alert(e.msg,{})});n[a].always(e=>{this.is_loading=false})}}});ms.use(Maska);const us=ms.mount("#vue-manage-account");const hs={components:{Cropper:VueAdvancedCropper.Cropper},props:["label"],data(){return{upload_images:"",filename:"",required_message:[],is_loading:false,error:[],steps:1,photo:undefined}},mounted(){this.initDropZone(this.label,this)},methods:{show(){this.steps=1;p("#photoModal").modal("show")},close(){p("#photoModal").modal("hide")},closeReset(){this.reset();p("#photoModal").modal("hide")},reset(){Dropzone.forElement("#dropzone_multiple").removeAllFiles(true);this.removeUpload(this.filename);this.upload_images=[];this.filename="";this.error=[]},initDropZone(t,e){var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};Dropzone.autoDiscover=false;$e=p(this.$refs.profile_dropzone).dropzone({dictDefaultMessage:t.dictDefaultMessage,dictFallbackMessage:t.dictFallbackMessage,dictFallbackText:t.dictFallbackText,dictFileTooBig:t.dictFileTooBig,dictInvalidFileType:t.dictInvalidFileType,dictResponseError:t.dictResponseError,dictCancelUpload:t.dictCancelUpload,dictCancelUploadConfirmation:t.dictCancelUploadConfirmation,dictRemoveFile:t.dictRemoveFile,dictMaxFilesExceeded:t.dictMaxFilesExceeded,paramName:"file",url:ajaxurl+"/uploadProfilePhoto",maxFiles:20,params:a,addRemoveLinks:true,maxFiles:2,init:function(){this.on("maxfilesexceeded",function(e){D.alert(t.max_file_exceeded,{})});this.on("removedfile",function(e){})},success:(e,t)=>{var a=JSON.parse(t);if(a.code==1){this.upload_images=a.details.url_image;this.filename=a.details.filename;this.steps=2}else{D.alert(a.msg,{});this.reset()}}})},removeUpload(i){return new Promise((t,e)=>{var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),id:i};var s=g();n[s]=p.ajax({url:ajaxurl+"/removeProfilePhoto",method:"PUT",dataType:"json",data:JSON.stringify(a),c
1980ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[s]!=null){n[s].abort();this.is_loading=false}}});n[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});n[s].always(e=>{this.is_loading=false})})},change({coordinates:e,canvas:t}){this.photo=t.toDataURL("image/png")},save(){this.$emit("onSave",this.photo,this.filename)}},template:`	
1981    <div class="modal" id="photoModal" tabindex="-1" role="dialog" aria-labelledby="photoModal" aria-hidden="true" 
1982     data-backdrop="static" data-keyboard="false"  >
1983       <div class="modal-dialog modal-dialog-centered" role="document">
1984       <div class="modal-content">  
1985       
1986       <div class="modal-body" style="overflow-y:inherit !important;" > 
1987       
1988          <a href="javascript:;" @click="closeReset" 
1989          class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>        
1990       
1991         <template :class="{ 'd-block': steps==1 }">  
1992         <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5>      
1993	     <div class="mb-3">
1994	         <div class="dropzone dropzone_container" id="dropzone_multiple" ref="profile_dropzone" >
1995			   <div class="dz-default dz-message">
1996			    <i class="fas fa-cloud-upload-alt"></i>
1997			     <p>{{label.drop_files_here}}</p>
1998			    </div>
1999			</div> 
2000	     </div>	    
2001	    </template>
2002	    
2003	    <template v-if="steps==2">
2004	      <h5 class="m-0 mt-3 mb-2">{{label.crop_photo}}</h5>  
2005	      
2006	      <div class="crop-images-wrap">
2007	        <cropper 
2008		    :src="upload_images"		    
2009		    @change="change"
2010		    :stencil-props="{
2011				handlers: {},
2012				movable: false,
2013				scalable: false,
2014			}"
2015			:stencil-size="{
2016				width: 120,
2017				height: 120
2018			}"
2019			image-restriction="stencil"
2020		  ></cropper>
2021		  </div>
2022	      
2023	    </template>
2024              
2025       
2026       </div> <!--modal body-->
2027       
2028       <template v-if="steps==2">
2029       
2030       <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert">
2031		    <p v-cloak v-for="err in error" class="m-0">{{err}}</p>	    
2032	   </div> 
2033       
2034        <div class="modal-footer justify-content-start">
2035            <button class="btn btn-green w-100" @click="save" :class="{ loading: is_loading }" >               
2036               <span class="label">{{label.save_photo}}</span>
2037               <div class="m-auto circle-loader" data-loader="circle-side"></div>
2038            </button>
2039        </div> <!--footer-->
2040        </template>
2041       
2042       </div> <!--content-->
2043	  </div> <!--dialog-->
2044	</div> <!--modal-->     
2045  `};const _s=Vue.createApp({components:{"components-profile-photo":hs},data(){return{avatar:""}},methods:{showUpload(){this.$refs.profile_photo.show()},SavePhoto(e,t){var a;var s=1;a="photo="+e;a+="&filename="+t;a+=addValidationRequest();n[s]=p.ajax({url:ajaxurl+"/saveProfilePhoto",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{this.$refs.profile_photo.is_loading=true;if(n[s]!=null){n[s].abort()}}});n[s].done(e=>{if(e.code==1){this.$refs.profile_photo.close();this.avatar=e.details.url_image;this.updateImage()}else{this.$refs.profile_photo.error=e.msg}});n[s].always(e=>{this.$refs.profile_photo.is_loading=false})},updateImage(){var e=this.$refs.refavatar.getElementsByTagName("img");e[0].src=this.avatar}}});_s.use(ElementPlus);const ps=_s.mount("#vue-profile-photo");const fs=Vue.createApp({components:{"component-select-time":ft},data(){return{store_close:false,time_required:false,time_required_message:"",time_selection:1,store_open_data:null}},mounted(){},methods:{checkStoreOpen(){var e=0;if(typeof merchant_id!=="undefined"&&merchant_id!==null){e=merchant_id}var t=!empty(getCookie("choosen_delivery"))?JSON.parse(getCookie("choosen_delivery")):[];var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:e,cart_uuid:getCookie("cart_uuid"),choosen_delivery:t};var s=g();a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/checkStoreOpen",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}}).done(e=>{if(e.code==1){this.store_open_data=e.details;if(e.details.merchant_open_status<=0){this.store_close=true;vue_cart.error.push(e.msg)}else{this.store_close=false}this.time_required=e.details.time_required;this.time_selection=e.details.time_selection;if(this.time_required){vue_cart.error.push(e.details.time_required_message)}if(e.details.time_already_passed){setCookie("choosen_delivery",[],30)}}else{this.store_close=true;vue_cart.error.push(e.msg)}}).always(e=>{})},show(){this.$refs.select_time.show()},afterSaveTransOptions(e){this.$refs.select_time.close();if(typeof a!=="undefined"&&a!==null){a.whento_deliver=e.whento_deliver;a.delivery_date=e.delivery_date;a.delivery_time=e.delivery_time;a.Search(false)}
2045if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){if(vm_widget_nav.$refs.transaction_info){vm_widget_nav.$refs.transaction_info.whento_deliver=e.whento_deliver;vm_widget_nav.$refs.transaction_info.delivery_datetime=e.delivery_datetime}}},storeAvailable(){var e="";if(typeof merchant_uuid!=="undefined"&&merchant_uuid!==null){e=merchant_uuid}axios({method:"POST",url:ajaxurl+"/storeAvailable",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_uuid="+e,timeout:c}).then(e=>{if(e.data.code==1){}else{vue_cart.error.push(e.data.msg)}})["catch"](e=>{}).then(e=>{})}}}).mount("#vue-schedule-order");const gs=Vue.createApp({data(){return{visible:false,include_utensils:false,is_loading:false}},watch:{include_utensils(e,t){B("include_utensils",e);this.setUtensils(e)}},mounted(){this.setUtensils(J("include_utensils"))},methods:{setTransaction(e){if(e=="delivery"){this.visible=true}else this.visible=false},setUtensils(e){e=empty(e)?false:e;this.include_utensils=e}}}).mount("#vue-utensils");const vs={props:["title","merchant_id","settings","image_use","responsive"],components:{"money-format":Ke},data(){return{owl:undefined,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qty:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",transaction_type:"",item_loading:false,item_gallery:[],image_featured:"",money_config:""}},mounted(){this.itemSuggestion()},updated(){if(this.item_addons_load==true){this.ItemSummary();p(".item_s .lazy").each(function(e,t){if(!empty(p(this).attr("src"))&&!empty(p(this).attr("data-src"))){p(this).attr("src",p(this).attr("data-src"))}})}if(typeof ma!=="undefined"&&ma!==null){this.transaction_type=ma.transaction_type}},computed:{getItemGallery(){return this.item_gallery}},methods:{itemSuggestion(){let e=getCookie("currency_code");e=!empty(e)?e:"";var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,image_use:this.image_use,currency_code:e};var a=g();t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/geStoreMenu",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(n[a]!=null){n[a].abort()}}}).done(e=>{if(e.code==1){var t=e.details.data.category;var a=e.details.data.items;var s=[];var i=[];if(t.length>0){p.each(t,function(e,t){p.each(t.items,function(e,t){i.push(a[t])});s.push({cat_id:t.cat_id,category_name:t.category_name,category_uiid:t.category_uiid,items:i});i=[]})}this.menu_data=s;setTimeout(()=>{this.RenderCarousel()},10)}else this.menu_data=[]}).always(e=>{this.is_loading=false})},RenderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p("#item-suggestion-list").owlCarousel({items:parseInt(this.settings.items),lazyLoad:this.settings.lazyLoad=="1"?true:false,loop:this.settings.loop=="1"?true:false,margin:parseInt(this.settings.margin),nav:this.settings.nav=="1"?true:false,dots:this.settings.dots=="1"?true:false,stagePadding:parseInt(this.settings.stagePadding),autoWidth:true,rtl:e})},SlideNext(){this.owl.trigger("next.owl.carousel")},SlidePrev(){this.owl.trigger("prev.owl.carousel",[300])},viewItem(e){this.item_loading=true;NProgress.start();let t=getCookie("currency_code");t=!empty(t)?t:"";var a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.merchant_id,item_uuid:e.item_uuid,cat_id:e.cat_id,currency_code:t};var s=1;a=JSON.stringify(a);n[s]=p.ajax({url:ajaxurl+"/getMenuItem",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(n[s]!=null){n[s].abort()}}}).done(e=>{if(e.code==1){C=e.details.data.items;O=e.details.data.addons;j=e.details.data.addon_items;Yt=e.details.data.items.item_addons;this.money_config=e.details.money_config;this.item_gallery=e.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var t=e.details.data.meta;var i=e.details.data.meta_details;var o={cooking_ref:[],ingredients:[],dish:[]};let s=e.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(i[a])){if(!empty(i[a][t])){let e=false;if(a=="ingredients"&&s){e=true}o[a].push({meta_id:i[a][t].meta_id,meta_name:i[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=o;
2045this.getSizeData(r);this.sold_out_options=e.details.sold_out_options;p(this.$refs.modal_item_details).modal("show");this.updateImage()}}).always(e=>{this.item_loading=false;NProgress.done()})},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({loop:false,margin:10,nav:false,dots:false,rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},updateImage(){h()},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;this.getSizeData(t)},getSizeData(a){Kt=[];var s=[];if(!empty(Yt[a])){p.each(Yt[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})});Kt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Kt;this.item_addons_load=true},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}u("item_total=>"+w);this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;var o=[];var r=[];if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},CheckaddCartItems(){this.addCartItems()},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:this.item_qty,item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:this.transaction_type,if_sold_out:this.if_sold_out};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>{if(e.code==1){p(this.$refs.modal_item_details).modal("hide");vue_cart.loadcart()}});n[a].always(e=>{this.add_to_cart=false})}},template:"#item_suggestion"};const ys=Vue.createApp({components:{"components-item-suggestion":vs},data(){return{data:[]}}});ys.use(ElementPlus);const bs=ys.mount("#vue-item-suggestion");const ws=Vue.createApp({components:{"component-change-address":Ee,"components-address-form":Be,"components-select-address":Ve},data(){return{addresses:[],address_needed:false,out_of_range:false,location_data:[],deliveryAddress:[],address_component:[]}},created(){this.addressNeeded()},methods:{addressNeeded(){axios({method:"POST",url:ajaxurl+"/addressNeeded",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+merchant_id+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.address_needed=e.data.details.address_needed}else{this.address_needed=false}})["catch"](e=>{}).then(e=>{})},show(){this.$refs.address.showModal()},afterChangeAddress(e){if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{u("not guest");this.location_data=e}},onSavelocation(t,e){console.log("onSavelocation here1",t);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:t,location_name:e.location_name,delivery_instructions:e.delivery_instructions,delivery_options:e.delivery_options,address_label:e.address_label,formatted_address:e.formatted_address,address1:e.address1,address2:e.address2,postal_code:e.postal_code,company:e.company};axios({method:"PUT",url:ajaxurl+"/checkoutSaveAddress",data:a,timeout:c}).then(e=>{if(e.data.code==1){i(StoreMapName,"selectedAddress",t);this.address_needed=false;this.$refs.address_form.close();this.refreshWidget()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})},afterPointaddress(e){console.log("afterPointaddress",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_modal.setLoading(true);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{this.address_needed=false;this.refreshWidget();this.$refs.address_modal.visible=false})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},refreshWidget(){if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterSetAddress()}else{if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}}},afterChangeAddressOLD(e){this.location_data=e;this.visible=false;this.$refs.address.closeModal();if(typeof vm_widget_nav!=="undefined"&&vm_widget_nav!==null){vm_widget_nav.afterChangeAddress()}if(typeof vm_merchant_details!=="undefined"&&vm_merchant_details!==null){vm_merchant_details.$refs.ref_services.getMerchantServices()}}}});ws.use(ElementPlus);const M=ws.mount("#vue-address-needed");const xs={template:"#xtemplate_webpushsettings",props:["ajax_url","settings","iterest_list","message"],data(){return{beams:undefined,is_loading:false,is_submitted:false,webpush_enabled:"",interest:[],device_id:""}},mounted(){this.initBeam()},methods:{initBeam(){this.beams=new PusherPushNotifications.Client({instanceId:this.settings.instance_id});this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getwebnotifications",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.webpush_enabled=e.data.details.enabled==1?true:false;this.device_id=e.data.details.device_token;this.interest=e.data.details.interest}else{this.webpush_enabled=false;this.device_id="";this.interest=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})},enabledWebPush(){this.is_loading=true;if(this.webpush_enabled){this.beams.start().then(()=>{u("start");this.beams.getDeviceId().then(e=>{this.device_id=e})})["catch"](e=>{f(this.message.notification_start,"error")}).then(e=>{this.is_loading=false})}else{this.beams.stop().then(()=>{u("stop");this.device_id=""})["catch"](e=>{f(this.message.notification_stop,"error")}).then(e=>{this.is_loading=false})}},saveWebNotifications(){this.is_submitted=true;axios({method:"PUT",url:this.ajax_url+"/savewebnotifications",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),webpush_enabled:this.webpush_enabled,interest:this.interest,device_id:this.device_id},timeout:c}).then(e=>{if(e.data.code==1){f(e.data.msg)}
2045else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{this.is_submitted=false})}}};const Ss=Vue.createApp({components:{"components-web-pusher":xs}});const Ts=Ss.mount("#vue-webpush-settings");const ks=Vue.createApp({data(){return{is_loading:false,data:[],page:0,show_next_page:false}},mounted(){this.getData(this.page)},computed:{hasData(){if(this.data.length>0){return true}return false},isFirstLoad(){if(this.is_loading&&this.page<=0){return true}return false}},methods:{getData(e){this.is_loading=true;axios({method:"POST",url:ajaxurl+"/notificationList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data.push(e.data.details.data);this.show_next_page=e.data.details.show_next_page;this.page=e.data.details.page}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.is_loading=false})}}});ks.use(ElementPlus);const Is=ks.mount("#vue-notifications-list");const Cs={props:["ajax_url","label","payment_type"],data(){return{data:[],is_loading:true,error_message:""}},mounted(){this.getPaymentList()},computed:{hasData(){if(this.data.length>0){return true}return false}},methods:{getPaymentList(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/getPaymentList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_type="+this.payment_type,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.error_message=""}else{this.data=[];this.error_message=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})}},template:`	    
2046    <DIV class="position-relative">
2047     <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center">
2048	    <div>
2049	      <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 
2050	    </div>
2051	 </div>   
2052    
2053    <h5 class="mb-3 mt-4">Add New Payment Method</h5>
2054	
2055	<template v-if="!is_loading && hasData">
2056	    here
2057		<a v-for="items in data" @click="$emit('afterClickpayment',items.payment_code)" 
2058		class="d-block chevron-section medium d-flex align-items-center rounded mb-2">
2059		<div class="flexcol mr-2 payment-logo-wrap">
2060			<i v-if="items.logo_type=='icon'" :class="items.logo_class"></i>
2061			<img v-else class="img-35" :src="items.logo_image" /> 		      
2062		</div>
2063		<div class="flexcol">
2064			<span class="mr-1">{{items.payment_name}}</span>
2065		</div>
2066		</a>
2067	</template>	
2068
2069	<template v-if="!is_loading && !hasData">
2070	   <div class="alert alert-warning mb-2" role="alert">
2071		<p class="m-0">{{error_message}}</p>
2072	   </div>
2073	</template>	
2074	
2075	
2076	</DIV>
2077    `};const Os={props:["ajax_url","merchant_uuid"],data(){return{data:[],default_payment_uuid:"",is_loading:false,message:""}},computed:{hasData(){if(this.data.length>0){return true}return false}},mounted(){this.MerchantSavedPayment()},methods:{MerchantSavedPayment(){this.is_loading=true;axios({method:"POST",url:this.ajax_url+"/MerchantSavedPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_uuid="+this.merchant_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details.data;this.default_payment_uuid=e.data.details.default_payment_uuid;this.$emit("setDefaultpayment",e.data.details.default_payment)}else{this.data=[];this.message=e.data.msg}})["catch"](e=>{}).then(e=>{this.is_loading=false})},setDefaultPayment(e){axios({method:"POST",url:this.ajax_url+"/MerchantsetDefaultPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_uuid="+e.payment_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.MerchantSavedPayment()}else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{})},deleteSavedPaymentMethod(e){axios({method:"POST",url:this.ajax_url+"/MerchantDeleteSavedPaymentMethod",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&payment_uuid="+e.payment_uuid,timeout:c}).then(e=>{if(e.data.code==1){this.MerchantSavedPayment()}else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{})}},template:`	    
2078    <DIV class="position-relative">
2079    
2080     <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center">
2081	    <div>
2082	      <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 
2083	    </div>
2084	 </div>   
2085    
2086	     <template v-if="hasData">
2087	     <h5 class="mb-3">Saved Payment Methods</h5>
2088	          
2089	     <div v-for="saved_payment in data" class="row no-gutters align-items-center chevron-section medium rounded mb-2"  :class="{ selected: saved_payment.as_default==1 }" >
2090	             
2091		  <div class="col-md-8 d-flex align-items-center">
2092		    <div class="flexcol mr-2 payment-logo-wrap">
2093			      <i v-if="saved_payment.logo_type=='icon'" :class="saved_payment.logo_class"></i>
2094			      <img v-else class="img-35" :src="saved_payment.logo_image" /> 		      
2095			    </div> <!--flex-col-->
2096			    <div class="flexcol" > 		     		     		      
2097			       <span class=" mr-1">{{saved_payment.attr1}}</span>       
2098			       <p class="m-0 text-muted">{{saved_payment.attr2}}</p>   
2099			    </div> 		    		    		    
2100		  </div> <!--col-->
2101		  <div class="col-md-4 d-flex align-items-center justify-content-end">
2102		             
2103		     <template v-if="saved_payment.as_default==1">
2104		     <div class="mr-1"><i class="zmdi zmdi-check text-success"></i></div>
2105		     <div class="mr-3"><p class="m-0">Default</p></div>
2106		     </template>
2107		     
2108		     <div class="dropdown">
2109		     <a href="javascript:;" class="rounded-pill rounded-button-icon d-inline-block" 
2110		     id="dropdownMenuLink" data-toggle="dropdown" >
2111		       <i class="zmdi zmdi-more" style="font-size: inherit;"></i>
2112		     </a>
2113		         <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
2114				    <a  v-if="saved_payment.as_default!=1" 
2115		     @click="setDefaultPayment(saved_payment)"
2116		     class="dropdown-item a-12" href="javascript:;">Set Default</a>			    
2117				    <a @click="deleteSavedPaymentMethod(saved_payment)" class="dropdown-item a-12" href="javascript:;">
2118				    Delete
2119				    </a>				    
2120				  </div>
2121		     </div> <!--dropdown-->
2122		      
2123		  </div> <!--col-->
2124		 </div> <!--row-->	 	 
2125		 </template>	 
2126	 </DIV>
2127    `};const js={props:["ajax_url","amount","label","default_payment","merchant_uuid"],data(){return{data:[],is_loading:false}},computed:{ValidAmount(){if(this.amount<=0){return true}if(empty(this.default_payment.payment_uuid)){return true}return false}},mounted(){u(this.amount)},methods:{DoCashin(){bootbox.confirm({size:"small",title:this.label.confirm,message:this.label.are_you_sure,centerVertical:true,animate:false,buttons:{cancel:{label:this.label.cancel,className:"btn btn-black small pl-4 pr-4"},confirm:{label:this.label.yes,className:"btn btn-green small pl-4 pr-4"}},callback:e=>{if(e){var t={payment_uuid:this.default_payment.payment_uuid,payment_code:this.default_payment.payment_code,merchant_uuid:this.merchant_uuid,amount:this.amount};try{Ps.$refs[this.default_payment.payment_code].DoPaymentRender(t,"PaymentIntentCashin")}catch(a){f(a.message,"error")}}}})}},template:`	        
2128     <button class="btn btn-green w-100 pointer mt-3"    
2129     :disabled="ValidAmount"
2130     @click="DoCashin"
2131	 >
2132	   <span class="label">{{label.continue}}</span>
2133	   <div class="m-auto circle-loader" data-loader="circle-side"></div>
2134	</button>                     
2135    `};const Es=Vue.createApp({data(){return{data:[],default_payment:""}},mounted(){u(this.amount_cashin)},methods:{afterClickpayment(e){try{this.$refs[e].showPaymentForm()}catch(t){f(t.message,"error")}},SavedPaymentList(){this.$refs.merchant_saved_payment.MerchantSavedPayment()},setDefaultpayment(e){this.default_payment=e},showLoadingBox(e){if(!empty(e)){Je.$refs.box.setMessage(e)}Je.$refs.box.show()},closeLoadingBox(){Je.$refs.box.close()},Alert(e){f(e,"error")}}});Es.component("components-payment-list",Cs);Es.component("components-merchant-saved-payment",Os);Es.component("components-cashin-payment",js);if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Es.component(e,t)})}const Ps=Es.mount("#vue-cashin");const Fs=Vue.createApp({components:{"component-carousel":Ze}}).mount("#vue-carousel");const Ns={props:["data","index_selected"],data(){return{owl:undefined}},mounted(){setTimeout(()=>{this.renderCarousel()},1)},methods:{renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.menu).owlCarousel({loop:false,dots:false,nav:false,autoWidth:true,rtl:e})}},template:`
2136   <div ref="menu"  class="owl-carousel owl-theme menu-carousel">
2137      <div v-for="(item, index) in data" class="mr-2">	   
2138	   <a :href="item.url" class="d-block"
2139	   :class="{active : index==index_selected }"
2140	   >
2141	    {{item.label}}
2142	   </a>
2143	  </div>    
2144   </div>
2145   `};const Rs=Vue.createApp({components:{"component-profile-menu":Ns}}).mount("#vue-profile-menu");const Ds=Vue.createApp({data(){return{recaptcha_response:""}},components:{"components-recapcha":Re},methods:{recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.$refs.vueRecaptcha.is_enabled){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}}).mount("#vue-captcha");const Ms=Vue.createApp({components:{"component-phone":e,"vue-rec
2145aptcha":Re},data(){return{loading:false,ready:false,show_password:false,agree_terms:false,password_type:"password",firstname:"",lastname:"",email_address:"",mobile_number:"",mobile_prefix:"",password:"",cpassword:"",mobile_prefixes:[],error:[],success:"",redirect:"",next_url:"",recaptcha_response:"",show_recaptcha:false}},mounted(){u("mounted");this.redirect=redirect_to;this.next_url=next_url;if(typeof _capcha!=="undefined"&&_capcha!==null){this.show_recaptcha=_capcha==1?true:false}},updated(){this.validate()},methods:{validate(){if(!empty(this.firstname)&&!empty(this.lastname)&&!empty(this.mobile_number)){this.ready=true}else this.ready=false},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"},onRegister(){var t=g();var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),firstname:this.firstname,lastname:this.lastname,email_address:this.email_address,mobile_number:this.mobile_number,mobile_prefix:this.mobile_prefix,password:this.password,cpassword:this.cpassword,redirect:this.redirect,recaptcha_response:this.recaptcha_response};n[t]=p.ajax({url:ajaxurl+"/registerGuestUser",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;this.error=[];this.success="";if(n[t]!=null){n[t].abort()}}});n[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});n[t].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}});Ms.use(Maska);const As=Ms.mount("#vue-guest-register");const $s=Vue.createApp({components:{"components-maps":ze,"components-select-address":Ve,"components-saveaddress":Ue},data(){return{loading:false,loading_save:false,data:[],address1:"",location_name:"",delivery_options:"Leave it at my door",delivery_instructions:"",address_label:"Home",markers:[],address_data:[],address_found:false,address_uuid:"",isEdit:false,isAdd:false,formatted_address:"",save_address_data:[],default_address:[],count_address:0,address_needed:true,address_label_list:[],address2:"",postal_code:"",company:"",custom_field1:"",custom_field2:"",formattedAddress:""}},created(){this.addressNeeded()},computed:{hasDeliveryAddress(){if(Object.keys(this.address_data).length>0){return true}return false},deliveryAddress(){return this.address_data},hasSavedAddress(){return this.address_found},hasAddressList(){return this.count_address>0?true:false},isAddressNeeded(){return this.address_needed},getAddressLabel(){return this.address_label_list}},watch:{address_data(e,t){this.setMarker(e.latitude,e.longitude)}},methods:{addressNeeded(){this.loading=true;axios({method:"POST",url:ajaxurl+"/checkoutAddressNeeded",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+merchant_id+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.address_needed=e.data.details.address_needed;this.getAddress()}else{this.address_needed=false}})["catch"](e=>{}).then(e=>{this.loading=false})},setMarker(e,t){this.markers=[{id:0,lat:parseFloat(e),lng:parseFloat(t),draggable:false}]},afterClosemodal(e){console.debug("afterClosemodal xx",e);if(e=="yandex"){if(T){T.destroy();T=null}this.$refs.maps.renderMap()}},getAddress(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAddressDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details;this.address_found=e.data.details.address_found;this.address_data=e.data.details.data;this.default_address=this.address_data;this.save_address_data=this.address_data;this.address_uuid=e.data.details.data.address_uuid;this.count_address=e.data.details.count_address;this.address_label_list=e.data.details.address_label;this.formattedAddress=this.address_data?.address?.formattedAddress??this.address_data?.address?.formatted_address}else{this.data=e.data.details;this.address_data=e.data.details.data;this.default_address=this.address_data;this.save_address_data="";this.formatted_address=this.address_data?.parsed_address?.street_name;this.address1=this.address_data?.parsed_address?.street_number;this.formattedAddress=this.address_data?.parsed_address?.formatted_address??this.formatted_address;this.address_found=e.data.details.address_found;this.count_address=e.data.details.count_address;this.address_label_list=e.data.details.address_label}if(Object.keys(this.data).length>0){if(!empty(this.data.custom_field1_data)){this.custom_field1=Object.keys(this.data.custom_field1_data)[0]}}})["catch"](e=>{}).then(e=>{this.loading=false})},saveAddress(){this.loading_save=true;axios({method:"PUT",url:ajaxurl+"/SaveAddress",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:this.address_uuid,location_name:this.location_name,delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,latitude:this.address_data.latitude,longitude:this.address_data.longitude,address1:this.address1,formatted_address:this.formatted_address,formattedAddress:this.formattedAddress,set_place_id:this.address_data.place_id,data:this.address_data,address2:this.address2,postal_code:this.postal_code,company:this.company,custom_field1:this.custom_field1,custom_field2:this.custom_field2},timeout:c}).then(e=>{if(e.data.code==1){if(T){T.destroy();T=null}ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});if(typeof redirect_to!=="undefined"&&redirect_to!==null){window.location.href=redirect_to}else{this.isEdit=false;this.isAdd=false;this.getAddress();this.$refs.save_address.getSavedAddress();
2145if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}}}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading_save=false})},showSelectAddress(){u("showSelectAddress");this.$refs.address_modal.setInitialMarker();this.$refs.address_modal.visible=true},afterChangeaddress(e){console.debug("afterChangeaddress xx1",e);if(T){T.destroy();T=null}this.address_data=e;this.formatted_address=this.address_data?.parsed_address?.street_name??"";this.address1=this.address_data?.parsed_address?.street_number??"";this.formattedAddress=this.address_data?.parsed_address?.formatted_address??"";this.$refs.address_modal.visible=false},editSaveAddress(){this.isEdit=true;this.address_data=this.save_address_data;this.address_uuid=this.save_address_data.address_uuid;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.location_name=this.address_data.attributes.location_name;this.delivery_options=this.address_data.attributes.delivery_options;this.delivery_instructions=this.address_data.attributes.delivery_instructions;this.address_label=this.address_data.attributes.address_label;this.address2=this.address_data.address.address2;this.postal_code=this.address_data.address.postal_code;this.company=this.address_data.address.company;this.custom_field1=this.address_data.attributes.custom_field1;this.custom_field2=this.address_data.attributes.custom_field2},CancelEdit(){if(T){T.destroy();T=null}this.isEdit=false;this.address_data=this.default_address;this.formatted_address="";this.address1="";this.location_name="";this.delivery_options="";this.delivery_instructions="";this.address_label="";this.address2="";this.postal_code="";this.company=""},AddNewAddress(){this.isAdd=true;this.address_data=this.default_address;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.address_uuid="";this.location_name="";this.delivery_instructions="";this.address2="";this.postal_code="";this.company=""},CanceAdd(){console.log("CanceAdd");this.isAdd=false;this.address_data=this.default_address},afterSelectaddress(e){this.setPlaceID(e.place_id);this.address_found=true;this.save_address_data=e;this.address_data=this.save_address_data;this.address_uuid=this.save_address_data.address_uuid;this.formatted_address=this.address_data.address.formatted_address;this.address1=this.address_data.address.address1;this.location_name=this.address_data.attributes.location_name;this.delivery_options=this.address_data.attributes.delivery_options;this.delivery_instructions=this.address_data.attributes.delivery_instructions;this.address_label=this.address_data.attributes.address_label},setPlaceID(e){axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e,timeout:c}).then(e=>{if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}})["catch"](e=>{}).then(e=>{})},confirmDelete(e){let t=JSON.parse(some_words);ElementPlus.ElMessageBox.confirm(t.confirm_delete_address,t["delete"],{confirmButtonText:t.delete_adress,cancelButtonText:t.cancel,type:"info"}).then(()=>{this.deleteAddress(e)})["catch"](()=>{})},deleteAddress(e){axios({method:"POST",url:ajaxurl+"/deleteAddress",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&address_uuid="+e,timeout:c}).then(e=>{this.getAddress();this.$refs.save_address.getSavedAddress()})["catch"](e=>{}).then(e=>{})}}});$s.use(ElementPlus);const Ys=$s.mount("#vm_delivery_details");const Ks=Vue.createApp({components:{"component-auto-complete":qe,"components-select-address":Ve,"components-address-form":Be},data(){return{deliveryAddress:[],location_data:[]}},methods:{afterChoose(e){console.log("afterChoosexx",e);const t=e?.provider??null;console.log("provider",t);let a=e.id;if(t=="mapbox"){a=`${e?.longitude},${e?.latitude}`}this.$refs.auto_complete.setLoading(true);axios({method:"POST",url:ajaxurl+"/getLocationDetails",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&id="+a+"&saveplace=0"+"&description="+e.description,timeout:c}).then(e=>{if(e.data.code==1){this.$refs.auto_complete.setAddressData(e.data.details.data)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.$refs.auto_complete.setLoading(false)})},afterFormclose(){u("afterFormclose");this.location_data=[]},afterGetcurrentlocation(e){console.log("afterGetcurrentlocation",e);console.log("isGuest=>"+isGuest);if(isGuest==="1"){this.deliveryAddress=e;this.$refs.address_modal.visible=true}else{this.afterPointaddress(e)}},afterPointaddress(e){this.$refs.address_modal.setLoading(true);i(StoreMapName,"selectedAddress",e);axios({method:"POST",url:ajaxurl+"/setPlaceID",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&place_id="+e.place_id,timeout:c}).then(e=>{window.location.href=next_url})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_modal.setLoading(false)})},onSavelocation(e,t){console.log("onSavelocation",e);i(StoreMapName,"selectedAddress",e);this.$refs.address_form.setLoading(true);let a={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),data:e,location_name:t.location_name,delivery_instructions:t.delivery_instructions,delivery_options:t.delivery_options,address_label:t.address_label,latitude:e.latitude,longitude:e.longitude,formatted_address:t.formatted_address,address1:t.address1,address2:t.address2,postal_code:t.postal_code,company:t.company,address_format_use:t.address_format_use,custom_field1:t.custom_field1,custom_field2:t.custom_field2};axios({method:"PUT",url:ajaxurl+"/SaveAddress",data:a,timeout:c}).then(e=>
2145{if(e.data.code==1){ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=next_url}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}).then(e=>{this.$refs.address_form.setLoading(false)})}}});Ks.use(ElementPlus);const Ls=Ks.mount("#vm_home_search");const zs=Vue.createApp({components:{"component-notification-cart":Aa},methods:{afterReceiveitemupdate(e){axios({method:"POST",url:ajaxurl+"/validateCartItems",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&item_id="+e.item_id,timeout:c}).then(t=>{if(t.data.code==1){let e=JSON.parse(some_words);ElementPlus.ElMessageBox.alert(t.data.msg,"",{confirmButtonText:e.ok,callback:e=>{if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof bs!=="undefined"&&bs!==null){bs.$refs.ref_item_suggestion.itemSuggestion()}}})}})["catch"](e=>{}).then(e=>{})}}});zs.use(ElementPlus);const qs=zs.mount("#vue-notification-cart");const Vs={props:["resend_counter","uuid","label"],data(){return{loading:false,counter:0,timer:undefined}},created(){this.startTimer()},watch:{counter(e,t){if(e<=0){this.stopTimer()}}},methods:{startTimer(){this.counter=this.resend_counter;this.stopTimer();this.timer=setInterval(()=>{this.counter--},1e3)},stopTimer(){clearInterval(this.timer)},resendCode(){this.loading=true;axios({method:"POST",url:ajaxurl+"/ResendRiderverificationcode",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&uuid="+this.uuid,timeout:c}).then(e=>{if(e.data.code==1){this.startTimer();ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`     			
2146	<div class="d-flex justify-content-between align-items-center">
2147		<div><b>{{label.resend_code}} {{ counter }}</b></div>
2148		<div>
2149		   <el-button type="text" 
2150		   :loading="loading"
2151		   :disabled="counter != 0"
2152		   @click="resendCode"
2153		   >
2154		   {{label.resend}}
2155		   </el-button>		
2156		</div>
2157    </div>
2158    `};const Us=Vue.createApp({components:{"component-phone":e,"component-rider-verifycode":Vs},data(){return{loading:false,mobile_number:"",mobile_prefix:"",first_name:"",last_name:"",email:"",address:"",password:"",cpassword:"",show_password:false,password_type:"password"}},computed:{validForm(){if(empty(this.first_name)){return false}if(empty(this.last_name)){return false}if(empty(this.email)){return false}if(empty(this.password)){return false}if(empty(this.cpassword)){return false}if(empty(this.address)){return false}return true}},methods:{onRegister(){this.loading=true;let e="&mobile_prefix="+this.mobile_prefix;e+="&mobile_number="+this.mobile_number;e+="&first_name="+this.first_name;e+="&last_name="+this.last_name;e+="&email="+this.email;e+="&address="+this.address;e+="&password="+this.password;e+="&cpassword="+this.cpassword;axios({method:"POST",url:ajaxurl+"/riderRegistration",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+e,timeout:c}).then(e=>{if(e.data.code==1){this.loading=true;ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"});window.location.href=e.data.details.redirect}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})},showPassword(){this.show_password=this.show_password==true?false:true;if(this.show_password){this.password_type="text"}else this.password_type="password"}}});Us.use(Maska);Us.use(ElementPlus);const Bs=Us.mount("#vue-rider-registration");const Js={data(){return{total:0,total_animated:0,loading:true}},watch:{total(e){gsap.to(this.$data,{duration:.6,total_animated:e})}},computed:{animatedTotal(){return this.total_animated.toFixed(0)}},mounted(){this.getAvailablePoints()},methods:{getAvailablePoints(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getAvailablePoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{this.total=e.data.details.total})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`{{animatedTotal}}`};const Gs=Vue.createApp({components:{"component-available-points":Js},data(){return{loading:false,data:[],has_data:false,show_next:false,tab:"transaction",loading1:false,data1:[],show_next1:false,page:1,page2:1,loading_next:false,loading_next1:false}},created(){this.getPointsTransaction(false)},mounted(){this.getPointsTransactionMerchant(false)},computed:{hasData(){return this.has_data},getData(){return this.data},showNext(){return this.show_next},getData1(){return this.data1},showNext1(){return this.show_next1}},methods:{getPointsTransaction(e){this.has_data=false;if(e){this.loading_next=true}else this.loading=true;axios({method:"POST",url:ajaxurl+"/getPointsTransaction",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page,timeout:c}).then(e=>{this.data.push(e.data.details.data);this.has_data=true;this.show_next=e.data.details.show_next_page;this.page=e.data.details.page})["catch"](e=>{}).then(e=>{this.loading=false;this.loading_next=false})},getPointsTransactionMerchant(e){if(e){this.loading_next1=true}else this.loading1=true;axios({method:"POST",url:ajaxurl+"/getPointsTransactionMerchant",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page2,timeout:c}).then(e=>{this.data1.push(e.data.details.data);this.show_next1=e.data.details.show_next_page;this.page2=e.data.details.page})["catch"](e=>{}).then(e=>{this.loading1=false;this.loading_next1=false})},nextPage(e){this.getPointsTransaction(true)},nextPage2(e){this.getPointsTransactionMerchant(true)}}});Gs.use(ElementPlus);const Ws=Gs.mount("#vue-my-points");
2158const Zs=e=>e===100?"Full":`${e}%`;const Hs={props:["title","is_mobile","apply_text","enter_points","data","use_thresholds"],data(){return{points:0,is_submit:false,points_tab:undefined,data_points:[],balance:0,points_id:0,loading:false}},computed:{hasData(){if(this.points>0){return false}return true}},watch:{points_tab(e,t){u(this.balance+"=>"+e.points);if(this.balance>e.points){this.points=e.points;this.points_id=e.id}else{this.points=0;this.points_id=0}}},created(){},methods:{showModal(e){if(e){p(this.$refs.modal).modal("show")}else{p(this.$refs.modal).modal("hide")}if(this.use_thresholds&&e){this.getPointsthresholds()}},applyPoints(){this.is_submit=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/applyPoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&points="+this.points+"&cart_uuid="+getCookie("cart_uuid")+"&currency_code="+e+"&points_id="+this.points_id,timeout:c}).then(e=>{if(e.data.code==1){this.showModal(false);this.$emit("afterApplypoints")}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.is_submit=false})},getPointsthresholds(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getPointsthresholds",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&currency_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.data_points=e.data.details.data;this.balance=e.data.details.balance}})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`
2159	<div class="modal" ref="modal" tabindex="-1" role="dialog" 
2160    aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" >
2161	   <div class="modal-dialog" role="document">
2162	     <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 
2163
2164		  <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;">
2165			<h5 class="modal-title" id="exampleModalLongTitle">
2166			     {{title}}
2167			</h5>
2168			<div class="close">
2169			<a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a>   
2170			</div>
2171		   </div>
2172
2173	       <div class="modal-body">
2174		   	       	
2175		   <form class="forms mt-2 apply-points-form" @submit.prevent="applyCode" >
2176		   
2177		   
2178		   <template v-if="use_thresholds">
2179		   
2180		   <div v-loading="loading">		   
2181		   		   
2182			    <el-tabs
2183					v-model="points_tab"					
2184					stretch							
2185				>
2186				<template v-for="items in data_points" :keys="items">
2187					<el-tab-pane label="User" :name="items"  >
2188						<template #label>
2189						<Div v-if="balance < items.points" class="disabled-class"></Div>
2190						<span class="custom-tabs-label">					    
2191							<div class="font13 font-weight-light">{{ items.label }}</div>
2192							<div class="font-weight-bold font20">{{ items.amount }}</div>				
2193							<div>						
2194								<el-progress
2195								:text-inside="true"
2196								:stroke-width="20"
2197								:percentage=" ((balance / items.points)*100)>100?100: (balance / items.points)*100 "
2198								:status="balance >= items.points ? 'success' : 'primary'"
2199								>
2200								<span>
2201								<template v-if="balance >= items.points">
2202									REDEEM
2203								</template>
2204								</span>
2205								</el-progress>					
2206							</div>		
2207						</span>
2208						</template>
2209					</el-tab-pane>				
2210					</template>
2211				</el-tabs>
2212
2213			</div>
2214
2215		   </template>
2216	       <template v-else>
2217			<div class="form-label-group">    
2218				<input v-model="points" class="form-control form-control-text" placeholder=""
2219				id="points" type="text" maxlength="20" >   
2220				<label for="points" class="required">{{enter_points}}</label> 
2221			</div>           
2222		   </template>     
2223		   
2224		   </form> <!--forms-->
2225	         
2226	       </div> <!--modal body-->
2227
2228	       <div class="modal-footer">
2229		        <button type="button" class="btn btn-black pl-4 pr-4" @click="showModal(false)" >Cancel</button>				
2230				<button type="button" class="btn btn btn-green pl-4 pr-4"
2231				  @click="applyPoints" :class="{ loading: is_submit }" :disabled="hasData"
2232				>
2233				  <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div>
2234				</button>	
2235		   </div>	        
2236	       
2237	    </div> <!--content-->
2238	   </div> <!--dialog-->
2239	 </div> <!--modal-->           
2240	`};const Qs=Vue.createApp({components:{"components-apply-points":Hs},data(){return{loading:true,loading_remove:false,data:[]}},created(){this.getAvailablePoints()},methods:{getAvailablePoints(){this.loading=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/getCartpoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid")+"&currency_code="+e,timeout:c}).then(e=>{this.data=e.data.details})["catch"](e=>{}).then(e=>{this.loading=false})},showApplyPoints(){this.$refs.apply_points.showModal(true)},afterApplypoints(){if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.getAvailablePoints()},removePoints(){this.loading_remove=true;axios({method:"POST",url:ajaxurl+"/removePoints",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}this.getAvailablePoints()})["catch"](e=>{}).then(e=>{this.loading_remove=false})}}});Qs.use(ElementPlus);const Xs=Qs.mount("#vue-checkout-points");const ei={props:["label"],data(){return{q:"",data:[]}},computed:{hasSearch(){if(this.q==""){return false}return true}},methods:{async querySearch(e,t){axios({method:"POST",url:ajaxurl+"/SearchSuggestion",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e,timeout:c}).then(e=>{if(e.data.code==1){t(e.data.details)}else{t([])}})["catch"](e=>{t([])}).then(e=>{})},handleSelect(e){this.$emit("afterSuggestion",e.name)}},template:`			
2241	<el-autocomplete
2242    v-model="q"
2243    :fetch-suggestions="querySearch"
2244	@select="handleSelect"
2245    :placeholder="label.search"    
2246	:trigger-on-focus="false"
2247	:fit-input-width="false"
2248	class="w-100"
2249	size="large"
2250	value-key="name"
2251	:clearable="true"
2252	:select-when-unmatched="true"
2253	:highlight-first-item="true"
2254    >			
2255	<template #default="{ item }">	  
2256      <div class="value" v-html="item.name"></div>      
2257    </template>	
2258	</el-autocomplete>
2259	`};const ti={props:["data","items_not_available","category_not_available"],template:"#xtemplate_item_list",methods:{viewItem(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false}}};const ai={props:["q"],components:{"components-item-list":ti},data(){return{tabs:"searchFood",loading:false,food_list:[],merchant_list:[],total_food:0,merchant_data:[],total_merchant:0,cuisine:[],items_not_available:[],category_not_available:[]}},watch:{q(e,t){this.doSearch(e,this.tabs)}},computed:{hasDataFood(){if(Object.keys(this.food_list).length>0){return true}return false},getFood(){return this.food_list},getFoodCount(){return this.total_food},hasQ(){return!empty(this.q)?true:false},hasMerchant(){if(Object.keys(this.merchant_data).length>0){return true}return false},getMerchant(){return this.merchant_data},getMerchantCount(){return this.total_merchant}},methods:{tabClick(e,t){this.doSearch(this.q,e.paneName)},doSearch(e,t){let a=getCookie("currency_code");a=!empty(a)?a:"";this.loading=true;axios({method:"POST",url:ajaxurl+"/"+t,data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&q="+e+"&currency_code="+a,timeout:c}).then(e=>{if(e.data.code==1){if(t=="searchFood"){this.food_list=e.data.details.food_list;this.merchant_list=e.data.details.merchant_list;this.total_food=e.data.details.total;this.items_not_available=e.data.details.items_not_available;this.category_not_available=e.data.details.category_not_available}else{this.merchant_data=e.data.details.merchant_data;this.cuisine=e.data.details.cuisine;this.total_merchant=e.data.details.total}this.$emit("setSearch",true)}else{this.clearData()}})["catch"](e=>{this.clearData()}).then(e=>{this.loading=false})},clearData(){this.food_list=[];this.merchant_list=[];this.total_food=0},handleView(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})}},template:"#xtemplate_search_food_result"};const si={template:"#xtemplate_item_details",components:{"money-format":Ke},data(){return{merchant_id:0,menu_loading:true,menu_data:[],items:[],item_addons:[],item_addons_load:false,size_id:0,disabled_cart:true,item_qt
2259y:1,item_total:0,add_to_cart:false,meta:[],special_instructions:"",sold_out_options:[],if_sold_out:"substitute",view_data:[],item_loading:false,item_in_cart:0,merchant_data:[],items_not_available:[],category_not_available:[],menu_layout:"list",q:"",search_menu_data:[],allergen:[],allergen_data:[],item_gallery:[],image_featured:"",title:"",new_order_label:"",money_config:[]}},mounted(){let e=JSON.parse(some_words);if(Object.keys(e).length>0){this.title=e.created_new_order+"?";this.new_order_label=e.new_order_label}},updated(){if(this.item_addons_load==true){this.ItemSummary()}},computed:{getAllergen(){return this.allergen},hasAllergen(){if(Object.keys(this.allergen).length>0){return true}return false},getItemGallery(){return this.item_gallery}},methods:{getMenuItem(e){let t=getCookie("currency_code");t=!empty(t)?t:"";let a="YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&merchant_id="+e.merchant_id;a+="&cat_id="+e.cat_id;a+="&item_uuid="+e.item_uuid;a+="&currency_code="+t;this.item_loading=true;NProgress.start();axios({method:"POST",url:ajaxurl+"/getMenuItem",data:a,timeout:c}).then(e=>{if(e.data.code==1){p("#itemModal").modal("show");C=e.data.details.data.items;O=e.data.details.data.addons;j=e.data.details.data.addon_items;Yt=e.data.details.data.items.item_addons;var t=e.data.details.data.meta;this.money_config=e.data.details.money_config;this.item_gallery=e.data.details.data.meta.item_gallery;this.image_featured="";this.renderGallery();var i=e.data.details.data.meta_details;var o={cooking_ref:[],ingredients:[],dish:[]};let s=e.data.details.data.items.ingredients_preselected;if(!empty(t)){p.each(t,function(a,e){p.each(e,function(e,t){if(!empty(i[a])){if(!empty(i[a][t])){let e=false;if(a=="ingredients"&&s){e=true}o[a].push({meta_id:i[a][t].meta_id,meta_name:i[a][t].meta_name,checked:e})}}})})}var a=C.price;var r=Object.keys(a)[0];this.item_qty=1;this.items=C;this.size_id=r;this.meta=o;this.getSizeData(r);this.sold_out_options=e.data.details.sold_out_options}else{p("#itemModal").modal("hide")}})["catch"](e=>{}).then(e=>{this.item_loading=false;NProgress.done()})},setItemSize(e){var t=e.currentTarget.firstElementChild.value;this.size_id=t;
2259this.getSizeData(t)},getSizeData(a){Kt=[];var s=[];if(!empty(Yt[a])){p.each(Yt[a],function(e,t){if(!empty(O[a])){if(!empty(O[a][t])){O[a][t].subcat_id;p.each(O[a][t].sub_items,function(e,t){if(typeof j[t]!=="undefined"&&j[t]!==null){s.push({sub_item_id:j[t].sub_item_id,sub_item_name:j[t].sub_item_name,item_description:j[t].item_description,price:j[t].price,pretty_price:j[t].pretty_price,checked:false,disabled:false,qty:1})}});Kt.push({subcat_id:O[a][t].subcat_id,subcategory_name:O[a][t].subcategory_name,subcategory_description:O[a][t].subcategory_description,multi_option:O[a][t].multi_option,multi_option_min:O[a][t].multi_option_min,multi_option_value:O[a][t].multi_option_value,require_addon:O[a][t].require_addon,pre_selected:O[a][t].pre_selected,sub_items_checked:"",sub_items:s});s=[]}}})}this.item_addons=Kt;this.item_addons_load=true},renderGallery(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_gallery).owlCarousel({loop:false,margin:10,nav:false,dots:false,rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},setImage(e){this.image_featured=e},ItemSummary(e){w=0;var l=[];var n=[];let c=[];let m=[];if(!empty(this.items.price)){if(!empty(this.items.price[this.size_id])){var t=this.items.price[this.size_id];if(t.discount>0){w+=this.item_qty*parseFloat(t.price_after_discount)}else w+=this.item_qty*parseFloat(t.price)}}this.item_addons.forEach((a,s)=>{if(a.require_addon==1){l.push(a.subcat_id)}if(a.multi_option=="custom"){var i=0;let e=a.multi_option_min;var t=a.multi_option_value;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}var o=[];var r=[];a.sub_items.forEach((e,t)=>{if(e.checked==true){i++;w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}else o.push(t);if(e.disabled==true){r.push(t)}});m[a.subcat_id]={total:i};if(i>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{r.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}else if(a.multi_option=="one"){a.sub_items.forEach((e,t)=>{if(e.sub_item_id==a.sub_items_checked){w+=this.item_qty*parseFloat(e.price);n.push(a.subcat_id)}})}else if(a.multi_option=="multiple"){var o=[];let e=a.multi_option_min;var t=a.multi_option_value;var d=0;if(t>0){c.push({subcat_id:a.subcat_id,min:e,max:t})}a.sub_items.forEach((e,t)=>{if(e.checked==true){w+=e.qty*parseFloat(e.price);n.push(a.subcat_id);d+=e.qty}o.push(t)});m[a.subcat_id]={total:d};this.item_addons[s].qty_selected=d;if(this.item_addons[s].qty_selected>=t){o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=true})}else{o.forEach((e,t)=>{this.item_addons[s].sub_items[e].disabled=false})}}});this.item_total=w;var i=true;if(l.length>0){p.each(l,function(e,t){if(n.includes(t)===false){i=false;return false}})}if(this.items.cooking_ref_required){let a=false;if(Object.keys(this.meta.cooking_ref).length>0){Object.entries(this.meta.cooking_ref).forEach(([e,t])=>{if(t.checked){a=true}})}if(!a){i=false}}if(Object.keys(c).length>0){let a,s;Object.entries(c).forEach(([e,t])=>{a=parseInt(t.min);if(m[t.subcat_id]){s=parseInt(m[t.subcat_id].total)}if(s>0){if(a>s){i=false}}})}if(i){this.disabled_cart=false}else this.disabled_cart=true},CheckaddCartItems(){if(typeof R!=="undefined"&&R!==null){let e=R.$refs.childref.cart_merchant.merchant_id;if(typeof e!=="undefined"&&e!==null){if(this.items.merchant_id!=R.$refs.childref.cart_merchant.merchant_id){p("#itemModal").modal("hide");ElementPlus.ElMessageBox.confirm(R.$refs.childref.cart_merchant.confirm_add_item,this.title,{confirmButtonText:this.new_order_label,showCancelButton:false,type:"info",buttonSize:"large"}).then(()=>{this.clearCart(R.$refs.childref.cart_uuid)})["catch"](()=>{})}else this.addCartItems()}else this.addCartItems()}else this.addCartItems()},clearCart(e){NProgress.start();axios({method:"POST",url:ajaxurl+"/clearCart",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+e,timeout:c}).then(e=>{if(e.data.code==1){this.addCartItems()}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{NProgress.done()})},addCartItems(e){if(e){e.preventDefault()}this.add_to_cart=true;var t={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),merchant_id:this.items.merchant_id,cat_id:this.items.cat_id,item_token:this.items.item_token,item_size_id:this.size_id,item_qty:this.item_qty,item_addons:this.item_addons,special_instructions:this.special_instructions,meta:this.meta,cart_uuid:getCookie("cart_uuid"),transaction_type:"delivery",if_sold_out:this.if_sold_out};var a=1;t=JSON.stringify(t);n[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(n[a]!=null){n[a].abort()}}});n[a].done(e=>
2259{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);p("#itemModal").modal("hide");if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}});n[a].always(e=>{u("always");this.add_to_cart=false})}}};const ii={props:["meta_name","sub_title"],components:{"components-item-list":ti},data(){return{loading:false,food_list:[],merchant_list:[],items_not_available:[],category_not_available:[],title:""}},created(){this.getFoodList()},computed:{hasDataFood(){if(Object.keys(this.food_list).length>0){return true}return false},getFood(){return this.food_list}},methods:{getFoodList(){let e=getCookie("currency_code");e=!empty(e)?e:"";this.loading=true;axios({method:"POST",url:ajaxurl+"/getFoodList",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&meta_name="+this.meta_name+"&currency_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.title=e.data.details.title;this.food_list=e.data.details.food_list;this.merchant_list=e.data.details.merchant_list;this.total_food=e.data.details.total;this.items_not_available=e.data.details.items_not_available;this.category_not_available=e.data.details.category_not_available;this.renderSlide()}})["catch"](e=>{}).then(e=>{this.loading=false})},renderSlide(){setTimeout(()=>{let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}p(this.$refs.owl_item_slide).owlCarousel({loop:false,margin:10,nav:true,dots:false,navText:[p(this.$refs.owl_next),p(this.$refs.owl_previous)],rtl:e,responsive:{0:{items:1},600:{items:3},1e3:{items:5}}})},10)},viewItem(e){this.$emit("handleView",{cat_id:e.cat_id,item_uuid:e.item_uuid,merchant_id:e.merchant_id})},itemAvailable(e,t){if(this.items_not_available.includes(parseInt(e))===false){if(this.category_not_available.includes(parseInt(t))===false){return true}}return false}},template:"#xtemplate_food_carousel"};const oi=Vue.createApp({data(){return{searchString:"",isSearch:false}},components:{"components-search-food":ei,"components-search-food-result":ai,"components-item-details":si,"components-food-list":ii},computed:{getisSearch(){return this.isSearch}},methods:{afterSuggestion(e){this.searchString=e},handleView(e){this.$refs.item_details.getMenuItem(e)},setSearch(e){this.isSearch=e}}});oi.use(ElementPlus);const ri=oi.mount("#vue-search");const di=Vue.createApp({data(){return{loading:false,room_list:[],table_list:[],room_uuid:"",table_uuid:"",transaction_type:"",guest_number:1,booking_enabled:false}},created(){this.getTableAttributes()},methods:{getTableAttributes(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getTableAttributes",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&cart_uuid="+getCookie("cart_uuid"),timeout:c}).then(e=>{if(e.data.code==1){this.room_list=e.data.details.room_list;this.table_list=e.data.details.table_list;this.booking_enabled=e.data.details.booking_enabled;if(e.data.details.default_room_uuid){this.room_uuid=e.data.details.default_room_uuid}}})["catch"](e=>{}).then(e=>{this.loading=false})},clearTableList(){this.table_uuid=""}}});di.use(ElementPlus);const li=di.mount("#vue-checkout-booking");const ni={data(){return{total:0,total_animated:0,loading:true}},watch:{total(e){gsap.to(this.$data,{duration:.6,total_animated:e})}},computed:{animatedTotal(){return this.total_animated}},mounted(){this.getBalance()},methods:{getBalance(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getWalletBalance",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{this.total=e.data.details.total})["catch"](e=>{}).then(e=>{this.loading=false})}},template:`{{animatedTotal}}`};const ci={props:["data","has_data","loading","show_next"],template:"#xtemplate_wallet_transaction"};const mi={props:["label","topup_minimum","topup_maximum"],data(){return{modal:false,amount:1,loading:false,default_payment:[],loading_submit:false,loading_payment:false}},created(){this.getCustomerDefaultPayment()},computed:{getPayment(){return this.default_payment}},methods:{show(){this.modal=true},close(){this.modal=false},getCustomerDefaultPayment(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getCustomerDefaultPayment",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content"),timeout:c}).then(e=>{if(e.data.code==1){this.default_payment=e.data.details.data}})["catch"](e=>{}).then(e=>{this.loading=false})},onAddfunds(){this.loading_submit=true;let e=getCookie("currency_code");e=!empty(e)?e:"";axios({method:"POST",url:ajaxurl+"/prepareAddFunds",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&amount="+this.amount+"&payment_code="+this.default_payment.payment_code+"&payment_uuid="+this.default_payment.payment_uuid+"&currency_code="+e,timeout:c}).then(e=>{if(e.data.code==1){this.$emit("afterPreparepayment",e.data.details)}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading_submit=false})}},template:"#xtemplate_topupform"};const ui={props:["data"],data(){return{modal:false}},template:"#xtemplate_succesful_modal"};const hi={props:["transaction_type"],data(){return{owl:undefined,data:[],loading:false}},mounted(){this.bonusFunds()},computed:{hasData(){if(Object.keys(this.data).length>0){return true}return false}},watch:{data(e,t){setTimeout(()=>{this.renderCarousel()},1)}},methods:{bonusFunds(){this.loading=true;axios({method:"POST",url:ajaxurl+"/getDiscount",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&transaction_type="+this.transaction_type,timeout:c}).then(e=>{if(e.data.code==1){this.data=e.data.details}else{this.data=[]}})["catch"](e=>{}).then(e=>{this.loading=false})},renderCarousel(){let e=false;if(typeof is_rtl!=="undefined"&&is_rtl!==null){e=is_rtl=="1"?true:false}this.owl=p(this.$refs.carousel_bonusfunds).owlCarousel({loop:true,dots:false,nav:false,autoWidth:true,rtl:e})}},template:`				
2260	<div ref="carousel_bonusfunds"  class="owl-carousel owl-theme carousel_bonusfunds">
2261		<div v-for="(items, index) in data" class="mr-2">	   
2262			<el-card shadow="hover" class="gradient-yellow-bg" style="max-width:350px;">			    
2263				<h6>{{items.title}}</h6>				
2264				<div class="mb-1">{{items.discount_details}}</div>
2265				<div class="font-weight-bold">
2265{{items.valid_discount}}</div>
2266			</el-card>
2267		</div>
2268	</div>	
2269	`};const _i=Vue.createApp({components:{"component-wallet-balance":ni,"components-wallet-transaction":ci,"components-topup-form":mi,"components-succesful-modal":ui,"component-bonusfunds":hi},created(){this.getWalletTransaction()},data(){return{loading:false,tab:"all",data:[],page:1,show_next:false,loading:false,loading_next:false,payment_data:[]}},computed:{hasData(){if(Object.keys(this.data).length>0){return true}return false},getData(){return this.data},showNext(){return this.show_next}},methods:{showFundsForm(){this.$refs.topup.show()},tabChange(){this.data=[];this.page=1;this.getWalletTransaction(false)},nextPage(e){this.getWalletTransaction(true)},showLoadingBox(e){this.$refs.topup.loading_payment=true},closeLoadingBox(){this.$refs.topup.loading_payment=false},closeTopup(){this.$refs.topup.close()},getWalletTransaction(e){if(e){this.loading_next=true}else this.loading=true;axios({method:"POST",url:ajaxurl+"/getWalletTransaction",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&page="+this.page+"&transaction_type="+this.tab,timeout:c}).then(e=>{if(e.data.code==1){this.data.push(e.data.details.data);this.show_next=e.data.details.show_next_page;this.page=e.data.details.page}else{this.show_next=false}})["catch"](e=>{}).then(e=>{this.loading=false;this.loading_next=false})},afterPreparepayment(e){try{this.$refs[e.payment_code].Dopayment(e.data,e)}catch(t){ElementPlus.ElNotification({title:"",message:t,position:"bottom-right",type:"warning"})}},AfterCancelPayment(e){if(!empty(e)){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}},afterSuccessfulpayment(e){this.payment_data=e;this.$refs.topup.close();if(typeof this.$refs.wallet_balance!=="undefined"&&this.$refs.wallet_balance!==null){this.$refs.wallet_balance.getBalance()}if(typeof this.$refs.wallet_balance_mobile!=="undefined"&&this.$refs.wallet_balance_mobile!==null){this.$refs.wallet_balance_mobile.getBalance()}this.$refs.succesful_modal.modal=true;if(this.tab!="all"){this.tab="all"}else{this.tabChange()}}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){_i.component(e,t)})}_i.use(ElementPlus);_i.use(Maska);const pi=_i.mount("#vue-my-wallet");const fi=Vue.createApp({data(){return{email_address:"",loading:false}},methods:{submit(){this.loading=true;axios({method:"POST",url:ajaxurl+"/subscribetoemail",data:"YII_CSRF_TOKEN="+p("meta[name=YII_CSRF_TOKEN]").attr("content")+"&email_address="+this.email_address,timeout:c}).then(e=>{if(e.data.code==1){this.email_address="";ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.data.msg,position:"bottom-right",type:"warning"})}})["catch"](e=>{}).then(e=>{this.loading=false})}}});fi.use(ElementPlus);const gi=fi.mount("#vue-esubscription");const vi=Vue.createApp({data(){return{loading:false,imageUrl:null,upload_url:site_url+"/api/updateprofilephoto",data:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")}}},mounted(){if(typeof profileAvatar!=="undefined"&&profileAvatar!==null){this.imageUrl=profileAvatar}},methods:{beforeAvatarUpload(e){this.loading=true},handleAvatarSuccess(e){this.loading=false;if(e.code==1){this.imageUrl=e.details.url_image;ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"success"})}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}}}});vi.use(ElementPlus);const yi=vi.mount("#upload-profile");p(document).ready(function(){let t=JSON.parse(some_words);p(".read-more").on("click",function(){var e=p(this).prev(".description");if(e.hasClass("expanded")){e.removeClass("expanded");p(this).text(t.read_more)}else{e.addClass("expanded");p(this).text(t.read_less)}})});const bi=Vue.createApp({data(){return{amount:null,loading:false,loading_payment:false,loading_addfunds:false,data:null,modal_addfunds:false,payment_data:null,translation:null,is_redirect:false,cart_total:0,payment_processsing:false}},mounted(){this.translation=JSON.parse(some_words)},computed:{hasPayment(){return Object.keys(this.payment_data?.data).length>0},getPayment(){return this.payment_data?.data}},methods:{onInputNumber(e){this.amount=e.replace(/[^0-9.]/g,"").replace(/(\..*)\./g,"$1")},async fetchWallet(a){try{this.cart_total=a;this.loading=true;let e=getCookie("cart_uuid");let t=getCookie("currency_code");const s=new URLSearchParams({cart_total:a,cart_uuid:e,currency_code:t}).toString();const i=await axios.get(`${ajaxurl}/fetchWallet?${s}`);if(i.data.code==1){this.data=i.data.details}else{this.data=null}}catch(e){}finally{this.loading=false}},async fetchPayment(){this.amount=null;this.payment_processsing=false;if(this.payment_data){return}try{this.loading_payment=true;const t=await axios.get(`${ajaxurl}/getCustomerDefaultPayment`);this.payment_data=t.data.details}catch(e){}finally{this.loading_payment=false}},async ConfirmTopup(){if(!this.amount||this.amount<=0){ElementPlus.ElNotification({title:"",message:this.translation.amount_required,position:"bottom-right",type:"warning"});return}if(!this.hasPayment){ElementPlus.ElNotification({title:"",message:this.translation.select_payment_method,position:"bottom-right",type:"warning"});return}try{this.loading_addfunds=true;let e=getCookie("currency_code");e=!empty(e)?e:"";const t=this.getPayment;const a=new URLSearchParams({YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),is_checkout:true,amount:this.amount,currency_code:e,payment_code:t?.payment_code,payment_uuid:t?.payment_uuid}).toString();const s=await axios.post(`${ajaxurl}/prepareAddFunds`,a);if(s.data.code==1){this.afterPreparepayment(s.data.details)}else{ElementPlus.ElNotification({title:"",message:s.data.msg,position:"bottom-right",type:"warning"})}}catch(e){}finally{this.loading_addfunds=false}},afterPreparepayment(e){try{console.debug("afterPreparepayment",e.payment_instructions?.redirect);this.is_redirect=e.payment_instructions?.redirect=="redirect"?true:false;console.debug("is_redirect",this.is_redirect);this.payment_processsing=!this.is_redirect?true:false;const a=e?.payment_code??null;if(a=="paypal"){this.modal_addfunds=false}this.$refs[e.payment_code].Dopayment(e.data,e)}catch(t){ElementPlus.ElNotification({title:"",message:t,position:"bottom-right",type:"warning"})}},AfterCancelPayment(e){console.debug("AfterCancelPayment",e);if(!empty(e)){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}},afterSuccessfulpayment(e){console.debug("afterSuccessfulpayment",e);this.modal_addfunds=false;this.payment_processsing=false;this.fetchWallet(this.cart_total)}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){bi.component(e,t)})}bi.use(ElementPlus);const wi=bi.mount("#vue-wallet")})(jQuery);

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.