1(function(p){"use strict";var a=[];var l={};var $={};var Y;var K;const c=8e4;const m={form:"application/x-www-form-urlencoded; charset=UTF-8",json:"application/json"};var L;if(typeof map_style!=="undefined"&&map_style!==null){map_style=map_style?JSON.parse(map_style):""}const z=site_url+"/apilocations";const q="store";window.StoreMapName="Mapstore";var u=function(e){console.debug(e)};var V=function(e){alert(JSON.stringify(e))};var U=function(e,t){localStorage.setItem(e,t)};var B=function(e){return localStorage.getItem(e)};var J=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 G(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(q,"selectedCityId");const t=getFromLocalStorageStore(q,"selectedAreaId");const a=getFromLocalStorageStore(q,"selectedStateId");const s=getFromLocalStorageStore(q,"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(){X(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(){ee(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=Q(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=Z();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 n=p(t).data("content_type");var l=Q(s);if(n=="json"){if(a=="getFeed"){var c=l.services;s={local_id:l.local_id,target:l.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,n)})}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=Q(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 n=[];var l=[];p(".services:checked").each(function(){n.push(p(this).val())});p(".cuisine:checked").each(function(){l.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:n,cuisine:l,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(){te()});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){_e(e)}});p(document).on("click",".addon-items",function(e){})});var W=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){de("typeahead_loader",1);navigator.geolocation.getCurrentPosition(function(e){var t=Z();v("reverseGeocoding","lat="+e.coords.latitude+"&lng="+e.coords.longitude+"&services="+t+"&next_steps="+a,"typeahead_loader",1)},function(e){de("typeahead_loader",false);f(e.message)},e)}else{f(_("Error: Your browser doesn't support geolocation."));de("typeahead_loader",false)}};var Z=function(){var e="";if(p("#services").exists()){p("#services option:selected").each(function(){e+=p(this).val()+","})}return e};function Q(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 X=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 ee=function(e){p("#"+e).modal("hide")};var te=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(()=>{te()},500)};var _=function(e){return e};const ae=new Notyf({duration:1e3*4});var f=function(e,t){switch(t){case"error":ae.error(e);break;default:ae.success(e);break}};const se=new Notyf({duration:1e4*6,dismissible:true,icon:""});var ie=function(e){se.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 n="";if(empty(o)){o="POST"}if(empty(r)){n="application/x-www-form-urlencoded; charset=UTF-8";t+=addValidationRequest()}else{n="application/json"}l[d]=p.ajax({url:ajaxurl+"/"+e,method:o,data:t,dataType:"json",contentType:n,timeout:c,crossDomain:true,beforeSend:function(e){if(i==null){}else{de(a,true)}if(l[d]!=null){l[d].abort();clearTimeout($[d])}else{$[d]=setTimeout(function(){l[d].abort()},c)}}});l[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":oe({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");ue(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}}});l[d].always(function(){de(a,false);l[d]=null;clearTimeout($[d])});l[d].fail(function(e,t){clearTimeout($[d])})};var oe=function(e){var t="";var a="";var s;var i;var o="";var r=parseInt(e.append);var d=e.target;var n=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(n==true){u("SHOW NEXT");p.each(e.next_page_data,function(e,t){if(e=="filters"){o+="&filters="+re(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 re=function(e){return(e+"").replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0")};var de=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){W(p(".list-loader"))}else{}break;case"restaurants_filter":if(t){W(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 n=parseInt(p(this).data("starsize"));var l=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(n)?n:"";_["readOnly"]=!empty(l)?l:"";_["disableAfterRate"]=m;_["useFullStars"]=!empty(u)?u:"";_["callback"]=function(e,t){t.parent().find(".ratings_selected").val(e);Ua.$refs.ReviewRef.rating_value=e};p(this).starRating(_)})};var le=function(){setTimeout(function(){Y.updateSticky()}
1,1)};var ce=function(){setTimeout(function(){if(typeof K!=="undefined"&&K!==null){K.updateSticky()}},1)};var me=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");le()};var r;var d;var n;var ue=function(e){r=e.items;d=e.addons;n=e.addon_items;var t={items:r};if(typeof j!=="undefined"&&j!==null){j.$data.items=r;p("#item-details .lazy").attr("src",r.url_image)}else{j=Vue.createApp({data(){return t},created(){}}).mount("#item-details")}};var he=function(e){var t=p("#itemModal .modal-body");r=e.items;d=e.addons;n=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();_e(s)};var _e=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">'+fe(s)+"</p>";i+="</div>";i+='<div class="flexcol">';i+='<h6 class="m-0">'+ge(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 n[t]!=="undefined"&&n[t]!==null){i+=pe(n[t],a,s)}});i+="</ul>"}i+="</DIV>"}})}}t.html(i);ItemSummary()};var pe=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 fe=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 ge=function(e){if(e>0){return _("Required")}else return _("Optional")};var y=0;var b=0;var ve=0;var ye=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;ve=0;b=0;ye=j.size_id;we=0;r=C;n=E;if(!empty(r.price[ye])){if(r.price[ye].discount>0){we=!empty(r.price[ye])?parseFloat(r.price[ye].price_after_discount):0}else we=!empty(r.price[ye])?parseFloat(r.price[ye].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());ve=!empty(n[y])?parseFloat(n[y].price):0;w+=b*ve;if(b>0){i.push(xe)}}else{y=p(t).val();ve=!empty(n[y])?parseFloat(n[y].price):0;w+=ve;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(){ye=p('input[name="size_uuid"]:checked').val();be=p(".item_s").attr("data-item_token");y=0;b=0;ve=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());ve=!empty(E[y])?parseFloat(E[y].price):0}else{y=p(t).val();ve=!empty(E[y])?parseFloat(E[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:ye,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""};async function Oe(){function e(){const e=document.createElement("canvas");const t=e.getContext("2d");t.textBaseline="top";t.font="14px Arial";t.fillText("karenderia_fingerprint",2,2);return e.toDataURL()}const t=[navigator.userAgent,navigator.language,screen.width+"x"+screen.height,screen.colorDepth,(new Date).getTimezoneOffset(),navigator.platform,navigator.hardwareConcurrency||"",navigator.deviceMemory||"",e()].join("|");const a=new TextEncoder;const s=await crypto.subtle.digest("SHA-256",a.encode(t));const i=Array.from(new Uint8Array(s));const o=i.map(e=>e.toString(16).padStart(2,"0")).join("");return o}const Ee={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":Ee},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();l[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});l[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=>{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();l[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(l[a]!=null){l[a].abort()}}});l[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}});l[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:;
36" @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 Pe={props:["label","addresses","location_data","saveplace"],data(){return{q:"",awaitingSearch:false,show_list:false,data:[],error:[],autosaved_addres:true,is_fullwidth:false,visible:false,loading_delete: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();l[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(l[s]!=null){l[s].abort()}}});l[s].done(e=>{if(e.code==1){this.q="";this.closeModal();this.$emit("setLocation",e.details.data)}else{this.error[0]=e.msg}});
43l[s].always(e=>{this.awaitingSearch=false})},setPlaceID(t){var e;var a=4;e="place_id="+t?.place_id;e+=addValidationRequest();l[a]=p.ajax({url:ajaxurl+"/setPlaceID",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){console.debug("setInLocalStorageStore11",t);i(StoreMapName,"selectedAddress",t);this.$emit("setPlaceid")}else{this.error[0]=e.msg}});l[a].always(e=>{})},editAddress(e){this.$emit("setEdit",e)},async deleteAddress(e){try{this.loading_delete=true;const a=await axios.post(`${ajaxurl}/deleteAddress`,new URLSearchParams({YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),address_uuid:e}).toString());const s=a.data;if(s.code==1){this.$emit("loadData");this.$emit("afterDelete",s)}else{ElementPlus.ElNotification({title:"",message:s.msg,position:"bottom-right",type:"warning"})}}catch(t){console.debug("error",t)}finally{this.loading_delete=false}},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" v-loading="loading_delete"> 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)" ><i class="zmdi zmdi-pin icon-25"></i></div> 78 <div class="col-9" @click="setPlaceID(valadd)" > 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 Fe={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,address_line1:"",address_line2:"",city:"",state:"",postal_code:"",country_code:"",address_format_use:null}},mounted(){autosize(document.getElementById("delivery_instructions"));this.getAddressAttributes();if(typeof address_format_use!=="undefined"&&address_format_use!==null){this.address_format_use=address_format_use}},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},hasLocationData(){return Object.keys(this.data).length>0}},methods:{show(e){this.cmaps_full=false;this.getAdddress(e);p(this.$refs.address_modal).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="";this.address_line1="";this.address_line2="";this.city="";this.state="";this.postal_code="";this.country_code=""},showWithData(e){console.debug("showWithData",e);console.debug("address_format_use",this.address_format_use);this.clearForms();p(this.$refs.address_modal).modal("show");this.data=e;if(this.address_format_use==2||this.address_format_use=="2"){this.formatted_address=e?.parsed_address?.formatted_address;this.formattedAddress=e?.parsed_address?.formatted_address;this.address_line1=e?.parsed_address?.street_number;this.address_line2=e?.parsed_address?.street_name;this.city=e?.parsed_address?.city;this.state=e?.parsed_address?.state;this.postal_code=e?.parsed_address?.postal_code;this.country_code=e?.parsed_address?.country_code}else{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??""}this.loadMap()},close(){p(this.$refs.address_modal).modal("hide")},closeModal(){p(this.$refs.address_modal).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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[t].always(e=>{this.is_loading=false})},async getAdddress(e){console.debug("getAdddress",e);this.clearForms();this.data=e;if(this.data.address.address_format_use==2){this.address_line1=this.data.address.address1;this.address_line2=this.data.address.address2;this.city=this.data.address.city;this.state=this.data.address.state;this.postal_code=this.data.address.postal_code;this.country_code=this.data.address.country_code;this.formatted_address=this.data.address.formatted_address}else{this.formatted_address=this.data.address.formatted_address;this.address1=this.data.address.address1}this.location_name=this.data.attributes.location_name;this.delivery_options=this.data.attributes.delivery_options;this.address_label=this.data.attributes.address_label;this.delivery_instructions=this.data.attributes.delivery_instructions;this.formattedAddress=this.data?.address?.formattedAddress??this.formatted_address;this.postal_code=this.data.address.postal_code;this.renderMap()},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");
101this.cmaps=new google.maps.Map(this.$refs.ref_map,{center:{lat:parseFloat(this.data.latitude),lng:parseFloat(this.data.longitude)},zoom:parseInt(this.cmaps_config.zoom),disableDefaultUI:true,styles:map_style})}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.ref_map,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});this.mapBoxResize();break;case"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:n}=await ymaps3["import"]("@yandex/[email protected]");const l={center:[parseFloat(this.data.longitude),parseFloat(this.data.latitude)],zoom:k};if(T){T.destroy();T=null}if(!T){T=new e(this.$refs.ref_map,{location:l,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);P=new r({coordinates:l.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"){console.debug("mapBoxResize");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);l[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(l[t]!=null){l[t].abort()}}});l[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}
101)}}else{this.error=e.msg;setTimeout(function(){location.href="#error_message"},1)}});l[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,postal_code:this.postal_code,data:this.data,custom_field1:this.custom_field1,custom_field2:this.custom_field2,address_line1:this.address_line1,address_line2:this.address_line2,city:this.city,state:this.state,country_code:this.country_code};var t=1;e=JSON.stringify(e);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){i(StoreMapName,"selectedAddress",this.data);this.close();this.$emit("afterSave",true)}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}});l[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();l[a]=p.ajax({url:ajaxurl+"/deleteAddress",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.close();this.$emit("afterDelete",true)}else{this.error[0]=e.msg}});l[a].always(e=>{})}},template:"#xtemplate_address_form"};const Ne={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 Re={props:["title","label"],data(){return{transaction_list:[],transaction:"",loading:false,charge_type:"",estimation:[]}},mounted(){this.getMerchantServices()},methods:{getMerchantServices(){var e;var t=g();const a=getFromLocalStorageStore(StoreMapName,"selectedAddress");const s=a?a.latitude:"";const i=a?a.longitude:"";e="merchant_id="+merchant_id;e+="&cart_uuid="+getCookie("cart_uuid");e+="&latitude="+s;e+="&longitude="+i;e+=addValidationRequest();l[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(l[t]!=null){l[t].abort()}}});l[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=[]}});l[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);setCookie("cart_uuid",e.data.details.cart_uuid,30)}if(typeof A!=="undefined"&&A!==null){A.addressNeeded()}})["catch"](e=>{}).then(e=>{this.$emit("afterUpdate",this.transaction)})}},template:` 102 <div class="btn-group-rounded btn-group btn-group-toggle" > 103 <label class="btn d-flex" 104 v-for="trans in transaction_list" :class="{ active: transaction==trans.service_code }" > 105 <input type="radio" :value="trans.service_code" v-model="transaction" @click="doUpdateService(trans.service_code)" > 106 <div class="align-self-center"> 107 <div class="bold">{{ trans.service_name }}</div> 108 109 <template v-if="estimation[trans.service_code]"> 110 <template v-for="(item,index) in estimation[trans.service_code] "> 111 112 <template v-if="trans.service_code=='delivery'"> 113 <template v-if="item.charge_type==charge_type"> 114 <p class="m-0">{{item.estimation}} {{label.min}}</p> 115 </template> 116 </template> 117 <template v-else> 118 <template v-if="item.charge_type=='fixed'"> 119 <p class="m-0">{{item.estimation}} {{label.min}}</p> 120 </template> 121 </template> 122 123 </template> 124 </template> 125 126 </div> 127 </label> 128 </div> 129 `};const De={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";
129const 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:` 130 <div class="mb-2 mt-2" ref="recaptcha_target"></div> 131 `};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);l[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(l[t]!=null){l[t].abort()}}});l[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=""}});l[t].always(e=>{})},setValue(e){this.country_flag=e.flag;this.$emit("update:mobile_prefix",e.phonecode);this.$refs.ref_mobile_number.focus()}},template:` 132 <div class="inputs-with-dropdown d-flex align-items-center mb-3" > 133 <div class="dropdown"> 134 <button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 135 <img v-if="country_flag" :src="country_flag"> 136 </button> 137 <div class="dropdown-menu" > 138 <a v-for="item in data" @click="setValue(item)" 139 href="javascript:;" class="dropdown-item d-flex align-items-center"> 140 <div class="mr-2"> 141 <img :src="item.flag"> 142 </div> 143 <div>{{item.country_name}}</div> 144 </a> 145 </div> 146 </div> <!--dropdown--> 147 148 <div class="mr-0 ml-1" v-if="mobile_prefix">+{{mobile_prefix}}</div> 149 <input type="text" v-maska="'###################'" ref="ref_mobile_number" 150 :value="mobile_number" @input="$emit('update:mobile_number', $event.target.value)" > 151 152 </div> <!--inputs--> 153 `};const Ae={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,$e,Ye;const Ke={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"));$e=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();$e.removeAllTags()},initDropZone(t,i){var e={YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")};Dropzone.autoDiscover=false;Ye=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();l[s]=p.ajax({url:ajaxurl+"/removeReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(a),c
153ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(l[s]!=null){l[s].abort();this.is_loading=false}}});l[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});l[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($e.value),upload_images:this.upload_images};var t=1;l[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(l[t]!=null){l[t].abort();this.is_loading=false}}});l[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)}});l[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();l[t]=p.ajax({url:ajaxurl+"/removeAllReviewImage",method:"PUT",dataType:"json",data:JSON.stringify(e),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.upload_images=[];Dropzone.forElement("#dropzone_multiple").removeAllFiles(true)}})}},template:` 154 <div class="modal" ref="review_modal" id="reviewModal" tabindex="-1" role="dialog" aria-labelledby="reviewModal" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 155 <div class="modal-dialog modal-dialog-centered" role="document"> 156 <div class="modal-content"> 157 158 159 <div class="modal-body" > 160 161 <a href="javascript:;" @click="close" 162 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 163 164 <h4 class="bold m-0 mb-3 mt-3">{{label.write_review}}</h4> 165 166 <star-rating 167 v-model:rating="rating_value" 168 :star-size="30" 169 :show-rating="false" 170 @update:rating="rating_value = $event" 171 > 172 </star-rating> 173 174 <h5 class="m-0 mt-3 mb-2">{{label.what_did_you_like}}</h5> 175 <input type="text" name="tags_like" class="tags_like" id="tags_like" :placeholder="label.search_tag"> 176 177 <h5 class="m-0 mt-2 mb-2">{{label.what_did_you_not_like}}</h5> 178 <input type="text" name="tags_not_like" class="tags_not_like" id="tags_not_like" :placeholder="label.search_tag"> 179 180 <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5> 181 <div class="mb-3"> 182 <div class="dropzone dropzone_container" id="dropzone_multiple" data-action="gallery_create"> 183 <div class="dz-default dz-message"> 184 <i class="fas fa-cloud-upload-alt"></i> 185 <p>{{label.drop_files_here}}</p> 186 </div> 187 </div> 188 </div> 189 190 <!-- <div v-if="upload_images.length>0" class="row gallery m-0"> 191 <div v-for="images in upload_images" class="col-lg-4 col-md-4 col-sm-12 mb-0 mb-lg-0 p-1"> 192 <div class="position-relative"> 193 <img :src="images.url_image"> 194 <a href="javascript:;" 195 @click="removeUpload(images.id)" data-dz-remove 196 class="remove btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-plus"></i></a> 197 </div> 198 </div> 199 </div>--> 200 201 <h5 class="m-0 mt-2 mb-2">{{label.write_your_review}}</h5> 202 <div class="form-label-group"> 203 <textarea id="review_content" class="form-control form-control-text font13" 204 :placeholder="label.review_helps" 205 v-model="review_content" 206 style="max-height:150px;" 207 > 208 </textarea> 209 </div> 210 211 <div class="custom-control custom-checkbox flex-grow-1"> 212 <input type="checkbox" class="custom-control-input" 213 name="as_anonymous" value="1" 214 id="as_anonymous" 215 v-model="as_anonymous" 216 > 217 <label class="custom-control-label font14 bold" for="as_anonymous" > 218 {{label.post_review_anonymous}} 219 </label> 220 </div> 221 222 223 <div id="error_message" v-cloak v-if="error.length>0" class="alert alert-warning mb-2 mt-2" role="alert"> 224 <p v-cloak v-for="message in error" class="m-0">{{message}}</p> 225 </div> 226 227 </div> <!--modal body--> 228 229 <div class="modal-footer justify-content-start"> 230 <button class="btn btn-black w-100" @click="addReview" :class="{ loading: is_loading }" >
231 <span class="label">{{label.add_review}}</span> 232 <div class="m-auto circle-loader" data-loader="circle-side"></div> 233 </button> 234 </div> <!--footer--> 235 236 </div> <!--content--> 237 </div> <!--dialog--> 238 </div> <!--modal--> 239 `};const Le={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:` 240 {{data}} 241 `};var ze=function(e){return window["v-money3"].format(e,JSON.parse(money_config))};let T;let k=16.6;const qe={props:["keys","provider","zoom","center","markers","size"],template:` 242 <div ref="cmaps" class="map border" :class="size"></div> 243 244 <div class="position-absolute map-buttons-wrap" v-if="size=='map-lg-large'" > 245 <div class="btn-group-vertical" v-loading="loading" v-if="provider!='yandex'" > 246 <div class="mb-2"> 247 <button @click="locateLocation" type="button" class="btn btn-white rounded-circle"> 248 <i class="zmdi zmdi-gps-dot font25"></i> 249 </button> 250 </div> 251 <button @click="setPlusZoom()" type="button" class="btn btn-white"> 252 <i class="zmdi zmdi-plus font25"></i> 253 </button> 254 <div class="divider py-1 bg-dark"></div> 255 <button @click="setLessZoom()" type="button" class="btn btn-white"> 256 <i class="zmdi zmdi-minus font25"></i> 257 </button> 258 </div> 259 </div> 260 `,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:map_style});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,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:n}
260=await ymaps3["import"]("@yandex/[email protected]");const l={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:l,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 n({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>0){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>
2600){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 Ve={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:` 261 <div class="d-flex flex-sm-row flex-column align-items-center justify-content-between"> 262 <div class="position-relative search-geocomplete" v-loading="loading" :class="{width_87 : enabled_locate , 'w-100' : !enabled_locate}" > 263 <div class="p-0"> 264 <el-autocomplete 265 v-model="q" 266 :placeholder="label.enter_address" 267 size="large" 268 class="w-100" 269 :trigger-on-focus="true" 270 value-key="description" 271 :fit-input-width="is_fullwidth" 272 clearable 273 :fetch-suggestions="searchLocation" 274 @select="handleSelect" 275 > 276 <template #suffix> 277 <button v-if="enabled_locate" @click="locateLocation" type="button" class="btn btn-link"> 278 <i class="zmdi zmdi-my-location font20" style="color:#000;"></i> 279 </button> 280 </template> 281 </el-autocomplete> 282 </div> 283 </div> 284 <div v-if="enabled_locate" class="flex-enabled-locate"> 285 <button @click="onSubmit" type="button" class="btn btn-green pl-3 pr-3" :disabled="loading"> 286 <i class="zmdi zmdi-arrow-right font25"></i> 287 </button> 288 </div> 289 </div> 290 `};const Ue={props:["data","keys","provider","zoom","center","label"],components:{"components-maps":qe,"component-auto-complete":Ve},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("setInitialMarkerx",this.data);if(T){T.destroy();T=null}if(this.data?.latitude){this.dataMarkers(this.data.latitude,this.data.longitude)}else{console.debug("fxx",this.center);this.dataMarkers(this.center?.lat,this.center?.lng)}},dataMarkers(e,t){this.markers=[{id:0,lat:parseFloat(e),lng:parseFloat(t),draggable:true}]}
290,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(){console.debug("setInLocalStorageStore1",this.address_data);i(StoreMapName,"selectedAddress",this.address_data);this.$emit("afterChangeaddress",this.address_data)},afterClosemodal(){this.$emit("afterClosemodal",this.provider)}},template:` 291 <el-dialog v-model="visible" :close-on-click-modal="false" :show-close="true" :title="label.exact_location" width="55%" @closed="afterClosemodal" > 292 293 <div class="position-relative" > 294 295 <component-auto-complete 296 ref="auto_complete" 297 :label="{ 298 enter_address : label.enter_address 299 }" 300 :formatted_address="hasFormatAddress?getFormatAddress.address.formatted_address:''" 301 @after-choose="afterChoose" 302 > 303 </component-auto-complete> 304 305 <div class="pt-2"></div> 306 307 <components-maps 308 ref="cmaps" 309 :keys="keys" 310 :provider="provider" 311 :zoom="zoom" 312 size="map-lg-large" 313 :center="center" 314 :markers="markers" 315 @after-selectmap="afterSelectmap" 316 @drag-marker="dragMarker" 317 > 318 </components-maps> 319 320 <div v-if="!drag" class="w-100 position-absolute" style="bottom:20px;"> 321 <div class="w-50 m-auto"> 322 <button type="button" @click="setNewAdress" :disabled="!hasFormatAddress" class="btn btn-green w-100" :class="{ loading: loading }" > 323 <span class="label"> 324 {{label.submit}} 325 </span> 326 <div class="m-auto circle-loader" data-loader="circle-side"></div> 327 </button> 328 </div> 329 </div> 330 331 </div> 332 333 </el-dialog> 334 `};const Be={props:["label"],data(){return{loading:false,data:null,address_data:null,dialog:false}},computed:{totalCount(){if(!this.data){return 0}return Object.keys(this.data).length-1},hasSelectAddress(){return this.address_data?true:false},hasData(){if(!this.data){return false}if(Object.keys(this.data).length>0){return true}return false}},methods:{show(e){this.dialog=e},getSavedAddress(){this.address_data=null;if(this.data){return}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=null}})["catch"](e=>{}).then(e=>{this.loading=false})},setAddress(e){console.debug("setAddress",e);console.debug("setInLocalStorageStore2");i(StoreMapName,"selectedAddress",e);this.show(false);this.$emit("afterSelectaddress",e)}},template:"#xtemplate_address_list"};let I=[];const Je={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,formattedAddress:null,data:[],address_line1:"",address_line2:"",city:"",state:"",postal_code:"",country_code:"",address_format_use:null,address_uuid:null}},mounted(){this.getAddressAttributes();if(typeof address_format_use!=="undefined"&&address_format_use!==null){this.address_format_use=address_format_use}},watch:{location_data(e,t){if(empty(e)){return}this.clearForms();this.data=e;if(e?.parsed_address){console.debug("new address",e);if(this.address_format_use==2||this.address_format_use=="2"){this.formatted_address=e?.parsed_address?.formatted_address;this.formattedAddress=this.formatted_address;this.address_line1=e?.parsed_address?.street_number;this.address_line2=e?.parsed_address?.street_name;this.city=e?.parsed_address?.city;this.state=e?.parsed_address?.state;this.postal_code=e?.parsed_address?.postal_code;this.country_code=e?.parsed_address?.country_code}else{this.formatted_address=e?.address?.formatted_address;this.formattedAddress=this.formatted_address;this.address1=e?.address?.address1}}else{console.debug("edit address",e);if(this.address_format_use==2||this.address_format_use=="2"){this.formattedAddress=e?.address?.formattedAddress;this.formatted_address=e?.address?.formatted_address;this.address_line1=e?.address?.address1;this.address_line2=e?.address?.address2;this.city=e?.address?.city;this.state=e?.address?.state;this.postal_code=e?.address?.postal_code;this.country_code=e?.address?.country_code}else{this.formatted_address=e?.address?.formatted_address;this.formattedAddress=e?.address?.formattedAddress;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}
334,hasNewCoordinates(){var e=Object.keys(this.new_coordinates).length;if(e>0){return true}return false}},methods:{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="";this.address_line1="";this.address_line2="";this.city="";this.state="";this.postal_code="";this.country_code=""},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,styles:map_style})}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:n}=await ymaps3["import"]("@yandex/[email protected]");const l={center:[parseFloat(this.location_data.longitude),parseFloat(this.location_data.latitude)],zoom:k};if(!T){T=new e(this.$refs.ref_map,{location:l,showScaleInCopyrights:false,behaviors:["drag","scrollZoom"]},[new t({}),new s({})]);I=new r({coordinates:l.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=>
334{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);this.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=>{})},async save(){try{this.is_loading=true;const t=await axios.put(ajaxurl+"/SaveAddress",{YII_CSRF_TOKEN:document.querySelector('meta[name="YII_CSRF_TOKEN"]')?.getAttribute("content"),address_uuid:this.address_uuid?this.address_uuid:"",delivery_instructions:this.delivery_instructions,delivery_options:this.delivery_options,address_label:this.address_label,latitude:this.location_data?.latitude,longitude:this.location_data?.longitude,formattedAddress:this.formattedAddress,set_place_id:this.location_data?.place_id,data:this.location_data,postal_code:this.postal_code,address1:this.address1,formatted_address:this.formatted_address,location_name:this.location_name,address_line1:this.address_line1,address_line2:this.address_line2,city:this.city,state:this.state,country_code:this.country_code});const a=t.data;if(a.code==1){console.debug("setInLocalStorageStore33");i(StoreMapName,"selectedAddress",this.location_data);ElementPlus.ElNotification({title:"",message:a.msg,position:"bottom-right",type:"success"});this.close();this.$emit("onSavelocation")}else{ElementPlus.ElNotification({title:"",message:a.msg,position:"bottom-right",type:"warning"})}}catch(e){ElementPlus.ElNotification({title:"",message:e,position:"bottom-right",type:"warning"})}finally{this.is_loading=false}}}};const Ge=Vue.createApp({components:{"components-loading-box":Ee}}).mount("#vue-loading-box");const We=Vue.createApp({components:{"component-home-search":je}}).mount("#vue-home-search");const He=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);l[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(l[t]!=null){l[t].abort()}}});l[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=""}});l[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:`
335 336 <DIV class="mt-5 mb-5"> 337 338 <div class="row no-gutters mb-4 " v-if="hasData" > 339 <div class="col d-flex justify-content-start align-items-center "> 340 <h5 class="m-0 section-title"> 341 {{title}} <span>{{location_details.location_name}}</span> 342 </h5> 343 </div> 344 <div class="col d-flex justify-content-end align-items-center "> 345 <a @click="SlidePrev" href="javascript:;" class="owl-carousel-nav prev mr-4"> </a> 346 <a @click="SlideNext" href="javascript:;" class="owl-carousel-nav next"> </a> 347 </div> <!--col--> 348 </div> <!--row--> 349 350 <div ref="owl_carousel" class="owl-carousel restaurant-carousel" :class="settings.theme" v-if="hasData" > 351 352 <div v-for="item in data" class="row equal align-items-center position-relative" 353 :class="classObject" 354 > 355 356 <template v-for="(cuisine,index) in item.cuisine_name" > 357 <template v-if="index <= 0"> 358 359 <span class="badge mr-1 top-left" v-if="settings.theme==='rounded'" 360 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 361 >{{cuisine.cuisine_name}}</span> 362 363 <div class="rounded-pill badge top-right" v-if="item.ratings.rating>0" 364 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 365 > 366 {{item.ratings.rating}} 367 </div> 368 369 </template> 370 </template> 371 372 373 <div class="w-100 list-items p-0 " > 374 <a :href="item.merchant_url" ><img :class="settings.theme" :src="item.url_logo" /></a> 375 </div> 376 377 <!--ROUNDED TEMPLATE--> 378 <template v-if="settings.theme==='rounded'"> 379 <div class="d-flex justify-content-between mt-2 w-100 pl-1 pr-1 "> 380 <div class="flex-col "> 381 <a :href="item.merchant_url" ><h6>{{item.restaurant_name}}</h6></a> 382 </div> 383 </div> <!--flex--> 384 385 <div class="d-flex justify-content-between w-100 pl-1 pr-1"> 386 <div class="flex-col"> 387 <p class="m-0"> 388 <i class="zmdi zmdi-time mr-1"></i> 389 390 <template v-if="estimation[item.merchant_id]"> 391 <template v-if="services[item.merchant_id]"> 392 <template v-for="(service_name,index_service) in services[item.merchant_id]" > 393 <template v-if="index_service<=0"> 394 395 <template v-if="estimation[item.merchant_id][service_name]"> 396 <template v-if="estimation[item.merchant_id][service_name][item.charge_type] "> 397 {{ estimation[item.merchant_id][service_name][item.charge_type].estimation }} <?php echo t("min")?> 398 </template> 399 </template> 400 401 </template> 402 </template> 403 </template> 404 </template> 405 406 </p> 407 </div> 408 <div class="flex-col"><p class="m-0" v-if="item.free_delivery==='1'" >{{ settings.free_delivery}}</p></div>
409 </div> <!--flex--> 410 </template> 411 <!--END ROUNDED TEMPLATE--> 412 413 <!-- ROUNDED CIRCLE TEMPLATE--> 414 <template v-else > 415 <div class="mt-3 text-center w-100"> 416 <a :href="item.merchant_url" ><h6 class="mb-1">{{item.restaurant_name}}</h6></a> 417 418 <template v-for="(cuisine,index) in item.cuisine_name" > 419 <template v-if="index <= 0"> 420 421 <span class="badge" 422 :style="'background:'+cuisine.bgcolor+';font-color:'+cuisine.fncolor" 423 >{{cuisine.cuisine_name}}</span> 424 425 426 </template> 427 </template> 428 429 </div> 430 </template> 431 <!-- END ROUNDED CIRCLE TEMPLATE--> 432 433 </div> <!-- row--> 434 435 </div><!-- owl-carousel--> 436 437 </DIV> 438 `};const Qe={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:` 439 <div ref="cuisine_carousel" class="owl-carousel owl-theme cuisine_carousel"> 440 <div v-for="(item, index) in data" class="mr-2"> 441 <a :href="item.url" class="d-block bg-light rounded-pill" 442 :class="{active : index==0 }" 443 > 444 {{item.cuisine_name}} 445 </a> 446 </div> 447 </div> 448 `};const Xe={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 et={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 tt={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}
448,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 at={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 st=null;let it=null;if(typeof componentsFeaturedItemList!=="undefined"&&componentsFeaturedItemList!==null){st=componentsFeaturedItemList}if(typeof componentsItemDialog!=="undefined"&&componentsItemDialog!==null){it=componentsItemDialog}let ot=null;if(typeof componentsFeaturedList!=="undefined"&&componentsFeaturedList!==null){ot=componentsFeaturedList}const rt=Vue.createApp({components:{"components-swiper-list":tt,"component-three-steps":Xe,"components-cuisine-list":et,"components-join":at,"components-featured-list":st,"components-item-dialog":it,"components-featured-merchant":ot},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 dt!=="undefined"&&dt!==null){dt.$refs.ref_featured_list.getFeaturedItems()}}}});rt.use(ElementPlus);rt.component("infinite-loading",V3InfiniteLoading["default"]);const dt=rt.mount("#vue-home-widgets");const nt={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;l[t]=p.ajax({url:ajaxurl+"/SaveStore",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.$emit("afterSave",true)}else{D.alert(e.msg,{})}});l[t].always(e=>{this.loading=false})}},template:` 449 <div class="d-none d-lg-block" > 450 <a @click="SaveStore()" href="javascript:;" class="btn bg-light btn-circle rounded-pill"> 451 <i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i> 452 </a> 453 </div> 454 <div class="d-block d-lg-none"> 455 <a @click="SaveStore()" href="javascript:;" class="btn bg-light btn-circle rounded-pill"> 456 <i class="zmdi" :class="{'zmdi-favorite text-green': active, 'zmdi-favorite-outline': !active }"></i> 457 </a> 458 </div> 459 `};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 ct={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:` 460 <div class="modal" ref="filterFeed" tabindex="-1" role="dialog" 461 aria-labelledby="filterFeed" aria-hidden="true" > 462 <div class="modal-dialog modal-full modal-dialog-scrollable" role="document"> 463 <div class="modal-content"> 464 <div class="modal-body" > 465 466 <a href="javascript:;" @click="close" 467 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 468 469 <h5 class="mt-3">{{label.filters}}</h5> 470 471 <div v-for="(sort_by, key) in data_attributes.sort_by" class="row m-0 ml-2 mb-2"> 472 <div class="custom-control custom-radio"> 473 <input v-model="sortby" :value="key" type="radio" :id="key+1" class="custom-control-input"> 474 <label class="custom-control-label" :for="key+1">{{sort_by}}</label>
475 </div> 476 </div><!--row--> 477 478 <h5 class="mt-3">{{label.price_range}}</h5> 479 480 <div class="btn-group btn-group-toggle input-group-small mt-2 mb-2 w-100" > 481 <label v-for="(price, key) in data_attributes.price_range" class="btn" :class="{ active: price_range==key }" > 482 <input type="radio" :value="key" v-model="price_range"> 483 <!-- {{price}} --> 484 <span v-html="price"></span> 485 </label> 486 </div> 487 488 <h5 class="mt-3">{{label.cuisine}}</h5> 489 490 <div class="row m-0"> 491 <template v-for="(item_cuisine, index) in data_cuisine" > 492 <div class="col-6 mb-1" > 493 <div class="custom-control custom-checkbox"> 494 <input type="checkbox" class="custom-control-input cuisine" :id="'cuisine'+item_cuisine.cuisine_id+1" 495 :value="item_cuisine.cuisine_id" 496 v-model="cuisine" 497 > 498 <label class="custom-control-label" :for="'cuisine'+item_cuisine.cuisine_id+1"> 499 {{item_cuisine.cuisine_name}} 500 </label> 501 </div> 502 </div> <!--col--> 503 </template> 504 </div><!-- row--> 505 506 <h5 class="mt-3">{{label.max_delivery_fee}}</h5> 507 508 <div class="form-group"> 509 <label for="formControlRange">{{label.delivery_fee}} <b><span class="min-selected-range"></span></b></label> 510 <input v-model="max_delivery_fee" 511 id="min_range_slider" value="10" type="range" class="custom-range" id="formControlRange" min="1" max="20" > 512 </div> 513 514 <h5 class="mt-3">{{label.ratings}}</h5> 515 <p class="bold">{{label.over}} {{rating}}</p> 516 <star-rating 517 v-model:rating="rating" 518 :star-size="30" 519 :show-rating="false" 520 @update:rating="rating = $event" 521 > 522 </star-rating> 523 524 </div> <!--content--> 525 526 <div class="modal-footer border-top-0"> 527 <template v-if="hasFilter"> 528 <button @click="clearFilter" class="btn btn-light rounded-0 w-50" > 529 {{label.clear_all}} 530 </button> 531 <button @click="applyFilter" class="btn btn-black rounded-0 w-50" > 532 {{label.done}} 533 </button> 534 </template> 535 <template v-else> 536 <button @click="applyFilter" class="btn btn-black rounded-0 w-100" > 537 {{label.done}} 538 </button> 539 </template> 540 </div> 541 <!--- modal footer --> 542 543 </div> <!--dialog--> 544 </div> <!--modal--> 545 `};const mt={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:` 546 <div class="modal" ref="suggestion" tabindex="-1" role="dialog" 547 aria-labelledby="suggestion" aria-hidden="true" > 548 <div class="modal-dialog modal-full modal-dialog-scrollable" role="document"> 549 <div class="modal-content"> 550 <div class="modal-body p-0" > 551 552 <div class="container-fluid mt-3 mb-2"> 553 <a href="javascript:;" @click="close" 554 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 555 556 <div class="position-relative inputs-box-wrap mt-3 "> 557 <input @click="showList" ref="q" v-model="q" class="inputs-box-grey rounded w-100" :placeholder="label.search"> 558 <div class="search_placeholder pos-right img-15"></div> 559 <button @click="clearData" v-if="show_list" class="btn btn-sm icon-remove">{{label.clear}}</button> 560 </div> 561 562 </div> 563 <!-- container --> 564 565 <ul class="suggestion-tab row no-gutters list-unstyled list-inline"> 566 <li v-for="(item, index) in tabs_suggestion" 567 class="col list-inline-item mr-0" 568 :class="{active : active_tab==index }" 569 @click="setTab(index)" 570 > 571 {{item}} 572 </li> 573 </ul> 574 575 <div class="container-fluid "> 576 577 <el-skeleton :count="9" animated :loading="is_loading" > 578 <template #template> 579 <div class="row mb-2"> 580 <div class="col-2">
581 <el-skeleton style="--el-skeleton-circle-size: 40px"> 582 <template #template> 583 <el-skeleton-item variant="circle" /> 584 </template> 585 </el-skeleton> 586 </div> <!-- col --> 587 588 <div class="col"> 589 <el-skeleton animated> 590 <template #template> 591 <div style="padding: 0px"> 592 <el-skeleton-item variant="p" style="width: 50%" /> 593 <div 594 style=" 595 display: flex; 596 align-items: center; 597 justify-items: space-between; 598 " 599 > 600 <el-skeleton-item variant="text" style="margin-right: 16px" /> 601 <el-skeleton-item variant="text" style="width: 30%" /> 602 </div> 603 </div> 604 </template> 605 </el-skeleton> 606 </div> <!-- col --> 607 </div> 608 <!-- row --> 609 </template> 610 611 <template #default> 612 <template v-if="hasData"> 613 <ul class="list-unstyled m-0"> 614 <li v-for="items in data"> 615 <a :href="items.url"> 616 <div class="row align-items-center no-gutters"> 617 <div class="col-1 mr-3"> 618 <img class="img-40 rounded-pill" :src="items.url_logo"> 619 </div> 620 <div class="col text-truncate border-bottom p-2"> 621 <h6 class="m-0 text-truncate">{{items.title}}</h6> 622 <p class="m-0 text-truncate text-grey "> 623 <span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span> 624 </p> 625 </div> 626 </div> 627 </a> 628 </li> 629 </ul> 630 </template> 631 <template v-else> 632 <template v-if="q"> 633 <el-empty :description="label.no_results"></el-empty> 634 </template> 635 </template> 636 637 </template> 638 639 </el-skeleton> 640 641 642 </div> 643 <!-- container --> 644 645 646 647 648 </div> <!--content--> 649 </div> <!--dialog--> 650 </div> <!--modal--> 651 `};const ut={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 ht=Vue.createApp({components:{"component-save-store":nt,"star-rating":VueStarRating["default"],"component-filter-feed":ct,"component-mobile-search-suggestion":mt,"components-banner":ut},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);l[t]=p.ajax({url:ajaxurl+"/CuisineList",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data_cuisine=e.details.data_cuisine}else{this.data_cuisine=[]}});l[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;l[a]=p.ajax({url:ajaxurl+"/searchAttributes",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.data_attributes=e.details}else{this.data_attributes=[]}});l[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);l[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(l[a]!=null){l[a].abort()}}});l[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=""}});l[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()}}});ht.use(ElementPlus);const t=ht.mount("#vue-feed");const _t={data(){return{data:[],transaction_type:"",is_loading:false}}
651,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")};l[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(l[t]!=null){l[t].abort()}}});l[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=""}});l[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")};l[t]=p.ajax({url:ajaxurl+"/setTransactionType",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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=""}});l[t].always(e=>{})}},template:` 652 653 <template v-if="is_loading" > 654 <el-skeleton animated style="width:auto;" class="mr-2"> 655 <template #template> 656 <el-skeleton-item variant="button"></el-skeleton-item> 657 </template> 658 </el-skeleton> 659 </template> 660 661 <div v-else class="dropdown widget-dropdown mr-2" > 662 <button class="" type="button" id="dropdownMenuButton" 663 data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 664 <template v-if="data[transaction_type]"> 665 {{data[transaction_type].service_name}} 666 </template> 667 </button> 668 669 <div class="dropdown-menu" aria-labelledby="services"> 670 <a v-for="item in data" href="javascript:;" @click="setTransactionType(item.service_code)" > 671 {{item.service_name}} 672 </a> 673 </div> 674 675 </div> <!--dropdown--> 676 `};const pt={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};l[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(l[a]!=null){l[a].abort()}}});l[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}});l[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:` 677 <template v-if="loading" > 678 <el-skeleton animated style="width:auto;"> 679 <template #template> 680 <el-skeleton-item variant="button"></el-skeleton-item> 681 </template> 682 </el-skeleton> 683 </template> 684 <div v-else class="position-relative"> 685 <template v-if="layout=='widget-dropdown-address'"> 686 <p class="m-0"> 687 688 <template v-if="whento_deliver=='schedule'"> 689 {{delivery_datetime}} 690 </template> 691 <template v-else>
692 <span class="text-capitalize"> 693 <template v-if="transaction_list[transaction_type]"> 694 {{transaction_list[transaction_type].service_name}} 695 </template> 696 <template v-else> 697 {{transaction_type}} 698 </template> 699 </span> {{label.now}} 700 </template> 701 702 </p> 703 <div class="dropdown"> 704 <button @click="setTransactionInfo()" class="btn-text dropdown-toggle" type="button" > 705 <span class="text-truncate">{{address1}}</span> 706 </button> 707 </template> 708 709 <template v-else> 710 711 <div class="widget-dropdown" v-if="visible" > 712 <button class="no-icons d-flex align-items-center" @click="setTransactionInfo()" > 713 <span class="d-inline text-truncate"> 714 <template v-if="address1"> 715 {{address1}} {{formatted_address}} 716 </template> 717 <template v-else> 718 {{label.select_address}} 719 </template> 720 </span> 721 <span class="d-inline"> • 722 723 <template v-if="whento_deliver=='schedule'"> 724 {{delivery_datetime}} 725 </template> 726 <template v-else> 727 <template v-if="delivery_option[whento_deliver]"> 728 {{ delivery_option[whento_deliver].short_name }} 729 </template> 730 </template> 731 732 </span> 733 </button> 734 </div> 735 </template> 736 </div> 737 `};const ft={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:` 738 <div class="modal" ref="ModalDeliveryDetails" tabindex="-1" role="dialog" 739 aria-labelledby="ModalDeliveryDetails" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 740 <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> 741 <div class="modal-content" :class="{ 'modal-mobile': isMobileView }" > 742 743 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 744 <h5 class="modal-title">{{label.title}}</h5> 745 <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 746 </div> 747 748 <div class="modal-body" > 749 750 <a href="javascript:;" @click="$emit('showAddress')" 751 class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2"> 752 <div class="flexcol mr-2"><i class="zmdi zmdi-pin"></i></div> 753 <div class="flexcol" > 754 <template v-if="data.address1"> 755 <span class="bold mr-1">{{data.address1}}</span> 756 <p class="m-0 text-muted">{{data.formatted_address}}</p> 757 </template> 758 <template v-else> 759 <span class="bold mr-1">{{label.select_address}}</span> 760 </template> 761 </div> 762 </a> 763 764 <a v-if="data" href="javascript:;" @click="$emit('showTransOptions')" 765 class="d-block chevron-section promo-section d-flex align-items-center rounded mb-2"> 766 <div class="flexcol mr-2"><i class="zmdi zmdi-time"></i></div> 767 <div class="flexcol" > 768 <template v-if="data.whento_deliver=='schedule'"> 769 {{data.delivery_datetime}} 770 </template> 771 <template v-else> 772 <template v-if="data.delivery_option"> 773 {{ data.delivery_option[data.whento_deliver].short_name }} 774 </template> 775 </template> 776 </div> 777 </a> 778 779 </div> <!--modal-body--> 780 781 <div class="modal-footer justify-content-start"> 782 783 <button class="btn btn-black w-100" @click="close();" > 784 {{label.done}} 785 </button> 786 787 </div> <!--modal-footer--> 788 789 </div> <!--content--> 790 </div> <!--dialog--> 791 </div> <!--modal--> 792 `};const gt={props:["label"],data(){return{data:[],loading:false,delivery_option:[],whento_deliver:"",opening_hours_date:[],opening_hours_time:[],delivery_date:"",delivery_time:"",deliveryTime:null,error:[],store_opening_timings:"regular_hours",every_day_hours:[],some_words:null}},mounted(){this.some_words=JSON.parse(some_words)},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(){this.deliveryTime=null;this.delivery_time="";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};l[t]=p.ajax({url:ajaxurl+"/getDeliveryTimes",method:"POST",data:a,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(l[t]!=null){l[t].abort()}}});l[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}this.store_opening_timings=e.details?.store_opening_timings;this.every_day_hours=e.details?.every_day_hours;if(this.store_opening_timings=="advance_timing"&&this.whento_deliver=="now"&&!empty(e.details.delivery_time)){if(this.every_day_hours&&Object.keys(this.every_day_hours).length>0){this.deliveryTime=e.details.delivery_time}}}else{this.delivery_option=[];this.whento_deliver="";this.error=e.msg}});l[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):"",store_opening_timings:this.store_opening_timings,deliveryTime:!empty(this.deliveryTime)?JSON.parse(this.deliveryTime):""};l[t]=p.ajax({url:ajaxurl+"/saveTransactionInfo",method:"POST",data:e,timeout:c,crossDomain:true,beforeSend:e=>{this.loading=true;if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{console.debug("data",e);if(e.code==1){this.$emit("afterSave",e.details);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)}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}});l[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})},onClickTab(){}},template:` 793 <div class="modal" ref="modalselecttime" id="ModalTRNOptions" tabindex="-1" role="dialog" 794 aria-labelledby="ModalTRNOptions" aria-hidden="true" > 795 <div class="modal-dialog" role="document"> 796 <div class="modal-content"> 797 <div class="modal-body" > 798 799 <a href="javascript:;" @click="close" 800 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 801 802 <h4 class="m-0 mb-3 mt-3">{{label.title}}</h4> 803 804 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 805 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 806 </div> 807 808 <div @click="onClickTab" class="btn-group btn-group-toggle input-group-small mt-2 mb-3" > 809 <label v-for="(item, index) in delivery_option" class="btn" :class="{ active: whento_deliver==item.value }" > 810 <input type="radio" :value="item.value" name="whento_deliver" v-model="whento_deliver"> 811 {{item.name}} 812 </label> 813 </div> 814 815 816 <div v-if="store_opening_timings=='advance_timing' &&whento_deliver=='now' "> 817 <template v-if="Object.keys(this.every_day_hours).length > 0"> 818 <el-radio-group v-model="deliveryTime" fill="#6cf"> 819 <el-radio-button v-for="items in every_day_hours" :key="items" :label="items.pretty_time" :value="JsonValue(items)" ></el-radio-button>
819 820 </el-radio-group> 821 </template> 822 <template v-else> 823 <div>{{ some_words?.no_avaialble_time }}</div> 824 </template> 825 </div> 826 827 <template v-if="whento_deliver=='schedule'"> 828 829 <select class="form-control custom-select mb-3" v-model="delivery_date"> 830 <option v-for="(item, index) in opening_hours_date" :value="item.value" > 831 {{ item.name}} 832 </option> 833 </select> 834 835 <select id="delivery_time" class="form-control custom-select" 836 v-model="delivery_time" v-if="opening_hours_date[delivery_date]" > 837 <option v-for="(item, index) in opening_hours_time[delivery_date]" 838 :value="JsonValue(item)" > 839 {{item.pretty_time}} 840 </option> 841 </select> 842 843 </template> 844 845 </div> <!--modal-body--> 846 847 848 <div class="modal-footer justify-content-start"> 849 850 <button @click="save" 851 class="btn btn-green w-100" :class="{ loading: loading }" 852 :disabled="hasError" 853 > 854 <span class="label">{{label.save}}</span> 855 <div class="m-auto circle-loader" data-loader="circle-side"></div> 856 </button> 857 858 </div> <!--modal-footer--> 859 860 </div> <!--content--> 861 </div> <!--dialog--> 862 </div> <!--modal--> 863 `};const vt={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();l[t]=p.ajax({url:ajaxurl+"/getSearchSuggestion",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});l[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:` 864 865 <div class="mr-2 position-relative inputs-box-wrap d-none d-md-block"> 866 <input @click="showList" v-model="q" class="inputs-box-grey " :placeholder="label.placeholder" /> 867 <div v-if="!awaitingSearch" class="search_placeholder pos-right img-15"></div> 868 <div v-if="awaitingSearch" class="icon img-15" data-loader="circle"></div> 869 870 <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div> 871 872 <div class="results with-border" v-if="show_list" > 873 <ul class="list-unstyled m-0"> 874 <li v-for="items in data" > 875 <a :href="items.url" > 876 <div class="row align-items-center no-gutters"> 877 <div class="col col-md-auto mr-2"> 878 <img class="img-30 rounded-pill" :src="items.url_logo" > 879 </div> 880 <div class="col text-truncate"> 881 <h6 class="m-0 text-truncate">{{items.title}}</h6> 882 <p class="m-0 text-truncate text-grey "> 883 <span class="mr-1" v-for="cuisine in items.cuisine_name" >{{cuisine.cuisine_name}},</span> 884 </p> 885 </div> 886 </div> 887 </a> 888 </li> 889 </ul> 890 </div> 891 </div> 892 893 <!--- 894 <div class="d-block d-md-none mr-3 mr-md-2"> 895 <button class="btn btn-search rounded-circle bg-light"><i class="zmdi zmdi-search"></i></button> 896 </div> 897 ---> 898 `};const yt=Vue.createApp({components:{"component-search-suggestion":vt},methods:{closeSuggestion(){this.$refs.suggestion.show_list=false}}});yt.directive("click-outside",Ne);const bt=yt.mount("#vue-search-nav");const wt={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;
898this.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(q,"SelectedtransactionType");if(t){e+="&transaction_type="+t}if(typeof merchant_id!=="undefined"&&merchant_id!==null){e+="&merchant_id="+merchant_id}axios.get(z+"/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);console.debug("setInLocalStorageStore3");i(q,"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 xt=Vue.createApp({data(){return{data:[],addresses:[],deliveryAddress:[],location_data:[]}},components:{"component-services":_t,"component-transaction-info":pt,"component-delivery-details":ft,"component-change-address":Pe,"component-trans-options":gt,"components-select-address":Ue,"components-address-form":Je,"components-location-current-address":wt},mounted(){},methods:{setTransaction(e){this.transaction_type=e},reloadFeed(e){t.transaction_type=e;t.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(){console.debug("onSavelocation");this.refreshWidget()},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 t!=="undefined"&&t!==null){t.Search(false);t.$refs.ref_banner.getBanner()}if(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 t!=="undefined"&&t!==null){u("afterSaveTransOptions");u(e.delivery_time);t.whento_deliver=e.whento_deliver;t.delivery_date=e.delivery_date;t.delivery_time=e.delivery_time.start_time;t.Search(false)}
898if(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){console.debug("editAddress=>",e);this.$refs.address.close();this.location_data=e},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof t!=="undefined"&&t!==null){t.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=>{})}}});xt.use(ElementPlus);window.vm_widget_nav=xt.mount("#vue-widget-nav");const St=Vue.createApp({components:{"components-location-current-address":wt}});St.use(ElementPlus);window.VmWidgetNavMobile=St.mount("#location-widget-subnav-mobile");const Tt=Vue.createApp({data(){return{data:[],addresses:[],transaction_type:"",transaction_list:[],deliveryAddress:[],location_data:[]}},components:{"component-services":_t,"component-transaction-info":pt,"component-delivery-details":ft,"component-change-address":Pe,"component-trans-options":gt,"component-address":Fe,"component-mobile-search-suggestion":mt,"components-select-address":Ue,"components-address-form":Je},mounted(){},methods:{setTransaction(e,t){this.transaction_type=e;this.transaction_list=t},reloadFeed(e){s;this.transaction_type=e;t.transaction_type=e;t.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 t!=="undefined"&&t!==null){t.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 t!=="undefined"&&t!==null){u("afterSaveTransOptions");u(e.delivery_time);t.whento_deliver=e.whento_deliver;t.delivery_date=e.delivery_date;t.delivery_time=e.delivery_time.start_time;t.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){this.$refs.address.close();this.$refs.addressform.show(e.address_uuid)},afterCloseAddForm(){this.$refs.address.showModal()},afterSaveAddForm(){if(typeof t!=="undefined"&&t!==null){t.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);l[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[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}}});Tt.use(ElementPlus);const kt=Tt.mount("#vue-widget-nav-mobile");const It={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+="¤cy_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:`
899 <el-skeleton :rows="1" animated :loading="loading" ></el-skeleton> 900 <div v-if="hasData" class="d-flex align-self-center"> 901 <div class="mr-1"><i style="transform: rotate(90deg);" class="fas fa-tag"></i></div> 902 <p class="mr-1">{{label.enjoy}}</p> 903 <p class="mr-1"> 904 <a href="javascript:;" class="text-green" @click="modal=true"> 905 {{label.see_details}} 906 </a> 907 </p> 908 </div> 909 910 <el-dialog 911 v-model="modal" 912 :title="label.title" 913 width="40%" 914 > 915 <template v-for="items in getData" :key="items" > 916 <div class="d-flex align-items-center mb-2"> 917 <div class="with-promo-icon"></div> 918 <div class="text-truncatex">{{ items.discount_name }}</div> 919 </div> 920 </template> 921 922 </el-dialog> 923 `};const Ct={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(z+"/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);setCookie("cart_uuid",e.data.details.cart_uuid,30);console.debug("setInLocalStorageStore5");i(q,"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 Ot=Vue.createApp({components:{"component-save-store":nt,"component-merchant-services":Re,"component-promo-details":It,"components-location-estimation":Ct},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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.found=true}else{this.found=false}});l[t].always(e=>{this.is_loading=false})}}});Ot.use(ElementPlus);window.vm_merchant_details=Ot.mount("#vue-merchant-details");const Et={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:true,navText:['<i class="zmdi zmdi-chevron-left"></i>','<i class="zmdi zmdi-chevron-right"></i>'],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:` 924 <el-affix target=".section-menu" :offset="0" z-index="9" > 925 <div class="row no-gutters align-items-center category-carousel border-bottom"> 926 <div class="col-1 text-left"> 927 <a @click="drawer=true" class="btn font-weight-bold"><i class="zmdi zmdi-menu"></i></a> 928 </div> 929 <div class="col-1 text-left"> 930 <a @click="prevSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-left"></i></a> 931 </div> 932 <div class="col-9"> 933 <div ref="category_carousel" id="menu-category" class="owl-carousel owl-theme"> 934 <template v-for="(item, index) in data" > 935 <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"> 936 <p class="m-0">{{item.category_name}}</p> 937 </a> 938 </template> 939 </div> 940 </div> 941 <div class="col-1 text-right">
942 <a @click="nextSlide" class="btn font-weight-bold"><i class="zmdi zmdi-chevron-right"></i></a> 943 </div> 944 </div> 945 </el-affix> 946 947 <el-drawer 948 v-model="drawer" 949 direction="btt" 950 size="65%" 951 append-to-body="true" 952 :title="restaurant_name" 953 :with-header="true" 954 custom-class="drawer-category" 955 > 956 <div class="list-group list-group-modified"> 957 <a @click="drawer=false" v-for="(item, index) in data" :href="'#'+item.category_uiid" class="list-group-item d-flex justify-content-between"> 958 <div class="">{{item.category_name}}</div> 959 <div class=""> 960 <div class="bg-light btn-circle rounded-pill">{{item.items.length}}</div> 961 </div> 962 </a> 963 </div> 964 </el-drawer> 965 `};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+"¤cy_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:` 966 <el-input 967 v-model="q" 968 class="w-100" 969 size="large" 970 :placeholder="some_words.search_in_menu" 971 > 972 <template #prefix> 973 <i class="zmdi zmdi-search" class="font20"></i> 974 </template> 975 <template #suffix> 976 <div v-if="awaitingSearch" class="loading"> 977 <div class="circle-loader" data-loader="circle-side"></div> 978 </div> 979 <template v-else> 980 <template v-if="hasSearch"> 981 <el-link type="primary" @click="clearSearch" > 982 {{some_words.clear}} 983 </el-link> 984 </template> 985 </template> 986 </template> 987 </el-input> 988 `};const Pt={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:true,navText:['<i class="zmdi zmdi-chevron-left"></i>','<i class="zmdi zmdi-chevron-right"></i>'],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:` 989 <el-affix target=".section-menu" :offset="0" z-index="9" > 990 <div class="bg-white p-1 mb-4 d-none d-lg-block category-owlcarousel"> 991 <div class="row no-gutters"> 992 <div class="col-3"> 993 994 <component-search-menu 995 @after-search="afterSearch" 996 @clear-search="clearSearch" 997 > 998 </component-search-menu> 999 1000 </div> 1001 <div class="col-9"> 1002 <div ref="category_carousel" id="menu-category" class="owl-carousel owl-theme"> 1003 <template v-for="(item, index) in data" > 1004 <a :href="'#'+item.category_uiid" :data-id="index" :class="{active : index==0}" class="nav-link d-flex align-items-center mr-3"> 1005 <div class="m-0">{{item.category_name}}</div><small v-if="item.items && item.items.length" class="alo-kat-adet">{{item.items.length}}</small> 1006 </a> 1007 </template> 1008 </div> 1009 1010 </div> 1011 </div> 1012 </div> 1013 </el-affix> 1014 `};const Ft={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 j!=="undefined"&&j!==null){j.viewItemBefore(e)}},getPromoMessage(e){if(!this.promo){return e?.promo_data?.message}return this.promo[e.item_id]?.message||e?.promo_data?.message},isEligible(e){if(!this.promo){return true}return this.promo[e.item_id]?.is_eligible},isEligibleItem(e){if(!e.is_promo_free_item){return true}if(!this.promo){return false}return this.promo[e.item_id]?.is_eligible||false}}};const Nt={components:{"component-search-menu":jt},methods:{afterSearch(e,t){this.$emit("afterSearch",e,t)},clearSearch(){this.$emit("clearSearch")}},template:` 1015 <div class="pt-2"> 1016 <component-search-menu 1017 @after-search="afterSearch" 1018 @clear-search="clearSearch" 1019 > 1020 </component-search-menu> 1021 </div> 1022 `};const Rt={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(){console.debug("setInLocalStorageStore6");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 Dt=Vue.createApp({components:{"components-category-carousel":Et,"component-topcategory":Pt,"component-menu-search-result":Ft,"components-search-menu-mobile":Nt,"components-age-verification":Rt},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"})}}});Dt.use(ElementPlus);const At=Dt.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();l[t]=p.ajax({url:ajaxurl+"/servicesList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[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();l[t]=p.ajax({url:ajaxurl+"/updateService",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{vue_cart.loadcart()})}}}}).mount("#vue-services-list");const $t={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:` 1023 <el-dialog 1024 v-model="modal" 1025 :title="label.title" 1026 width="40%" 1027 class="modal-allergens" 1028 > 1029 1030 <template v-if="loading" > 1031 <div style="min-height:100px;" v-loading="loading"> 1032 </div> 1033 </template> 1034 <template v-else > 1035 <h5>{{label.sub_title}}</h5> 1036 <ul class="pl-3"> 1037 <template v-for="item in allergen"> 1038 <li v-if="allergen_data[item]"> 1039 {{ allergen_data[item] }} 1040 </li> 1041 </template> 1042 </ul> 1043 </template> 1044 1045 </el-dialog> 1046 `};const Yt={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:`
1047 <p class="text-descriptions"> 1048 <span v-html="isExpanded ? description : truncatedDescription" ></span> 1049 <span v-if="showReadMore" @click="toggleReadMore" class="read-more"> 1050 {{ isExpanded ? label.read_less : label.read_more }} 1051 </span> 1052 </p> 1053 `};var C=[];var O=[];var E=[];var Kt=[];var Lt;const zt=Vue.createApp({components:{"component-change-address":Pe,"money-format":Le,"components-search-menu":Nt,"component-menu-search-result":Ft,"component-allergens":$t,"text-description":Yt},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()}le()},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+="¤cy_code="+t;e+="&cart_uuid="+getCookie("cart_uuid");e+=addValidationRequest();var a=g();l[a]=p.ajax({url:ajaxurl+"/geStoreMenu",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[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 A!=="undefined"&&A!==null){A.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+="¤cy_code="+i;s+="&cart_uuid="+getCookie("cart_uuid");s+=addValidationRequest();var o=1;this.item_loading=true;NProgress.start();l[o]=p.ajax({url:ajaxurl+"/getMenuItem",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[o]!=null){l[o].abort()}}});l[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;E=e.details.data.addon_items;Kt=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;
1053this.getSizeData(r);this.sold_out_options=e.details.sold_out_options;this.updateImage()});l[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){Lt=[];var s=[];if(!empty(Kt[a])){p.each(Kt[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 E[t]!=="undefined"&&E[t]!==null){s.push({sub_item_id:E[t].sub_item_id,sub_item_name:E[t].sub_item_name,item_description:E[t].item_description,price:E[t].price,pretty_price:E[t].pretty_price,checked:false,disabled:false,qty:1})}});Lt.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=Lt;this.item_addons_load=true},ItemSummary(e){w=0;var n=[];var l=[];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){n.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);l.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);l.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);l.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(n.length>0){p.each(n,function(e,t){if(l.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;Bt.show({content:e}).then(e=>{if(e){Bt.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(n){}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
1053ine_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);l[d]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:o,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[d]!=null){l[d].abort()}}});l[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;Bt.show({content:e}).then(e=>{if(e){Bt.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);l[s]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[s]!=null){l[s].abort()}}});l[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()}}else{ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"})}});l[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){}}}});zt.use(ElementPlus);const j=zt.mount("#vue-merchant-menu");const qt=Vue.createApp({data(){return{back_url:""}}}).mount("#vue-checkout-back");const Vt=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,bring_own_bag:false,show_bring_bag:false}},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)){ce();return true}return false}
1053,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();l[s]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[s]!=null){l[s].abort()}}});l[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;this.bring_own_bag=e.details.bring_own_bag;this.show_bring_bag=e.details.show_bring_bag;var t=false;if(this.inArray("checkout",e.details.payload)){t=true;if(typeof ua!=="undefined"&&ua!==null){ua.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 xa!=="undefined"&&xa!==null&&t==true){xa.transaction_type=a}if(typeof Ta!=="undefined"&&Ta!==null&&t==true){Ta.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 ka!=="undefined"&&ka!==null){ka.out_of_range=e.details.out_of_range;ka.address_component=e.details.address_component}if(typeof A!=="undefined"&&A!==null){A.out_of_range=e.details.out_of_range;A.address_component=e.details.address_component}}if(typeof R!=="undefined"&&R!==null){R.cartCount(e.details.items_count)}if(typeof qt!=="undefined"&&qt!==null){qt.back_url=e.details.data.merchant.restaurant_slug}if(typeof vs!=="undefined"&&vs!==null){vs.setTransaction(a)}if(typeof ni!=="undefined"&&ni!==null){ni.transaction_type=a}if(typeof F!=="undefined"&&F!==null){F.refreshWallet({cart_total:this.cart_total.raw,use_digital_wallet:this.use_digital_wallet})}if(typeof M!=="undefined"&&M!==null){M.transactionType=a;M.address_needed=e.details.data?.address_needed}}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 gs!=="undefined"&&gs!==null){gs.checkStoreOpen();setTimeout(()=>{gs.storeAvailable()},1)}ce();this.updateImage();setTimeout(()=>{this.updateMenuQty()},1);if(typeof j!=="undefined"&&j!==null){j.promoCheck(this.cart_subtotal?.raw||0)}if(typeof wi!=="undefined"&&wi!==null){wi.fetchWallet(this.cart_total.raw)}});l[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();l[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(l[s]!=null){l[s].abort()}}});l[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();l[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[i]!=null){l[i].abort()}}});l[i].done(e=>{u("done");if(e.code==1){this.loadcart()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();l[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[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 j!=="undefined"&&j!==null){if(j.menu_data.length>0){j.menu_data.forEach((s,e)=>
1053{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()}},async 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 M!=="undefined"&&M!==null){s=M.address_uuid}const i=await Oe();var o={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:B("include_utensils"),payment_change:F?F.payment_change:0,currency_code:a,room_uuid:ni.room_uuid,table_uuid:ni.table_uuid,guest_number:ni.guest_number,use_digital_wallet:this.use_digital_wallet==true?1:0,address_uuid:s,uploaded_bank_receipt:F?.uploaded_bank_receipt,device_finger_print:i,custom_field:typeof window.customCheckoutFields!=="undefined"?window.customCheckoutFields.getFormsData():""};l[t]=p.ajax({url:ajaxurl+"/placeOrder",method:"PUT",dataType:"json",data:JSON.stringify(o),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_submit=true;if(l[t]!=null){l[t].abort()}}});l[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}});l[t].always(e=>{ce()})},async setBringBag(e){try{const a=new URLSearchParams({YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),cart_uuid:getCookie("cart_uuid"),bring_own_bag:e?1:0}).toString();const s=await axios.post(ajaxurl+"/setBringBag",a);console.debug("response",s.data);if(s.data.code==1){this.loadcart()}else{ElementPlus.ElNotification({title:"",message:s.data.msg,position:"bottom-right",type:"warning"})}}catch(t){console.debug("error",t)}}}});Vt.use(ElementPlus);window.vue_cart=Vt.mount("#vue-cart");const Ut=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();l[s]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:a,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[s]!=null){l[s].abort()}}});l[s].done(e=>{this.is_loading=false;p("#confirmModalOrder").modal("hide");t(true)})})}}});Ut.component("components-neworder",{props:["title","content","is_loading","new_order_label"],template:` 1054 <div class="modal" id="confirmModalOrder" tabindex="-1" role="dialog" aria-labelledby="confirmModalOrder" aria-hidden="true"> 1055 <div class="modal-dialog modal-dialog-centered" role="document"> 1056 <div class="modal-content"> 1057 1058 <div class="modal-header"> 1059 <button type="button" class="close" aria-label="Close" @click="$emit('closeOrder')" >
1060 <span aria-hidden="true">×</span> 1061 </button> 1062 </div> 1063 1064 <div class="modal-body" > 1065 <h4 class="bold">{{ title }}</h4> 1066 <div>{{ content }}</div> 1067 </div> 1068 1069 <div class="modal-footer justify-content-start"> 1070 <button class="btn btn-black w-100" @click="$emit('newOrder')" :class="{ loading: is_loading }" > 1071 <span class="label">{{ new_order_label }}</span> 1072 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1073 </button> 1074 </div> <!--footer--> 1075 1076 </div> <!--content--> 1077 </div> <!--dialog--> 1078 </div> <!--modal--> 1079 `});const Bt=Ut.mount("#components-modal-neworder");const Jt=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();l[a]=p.ajax({url:ajaxurl+"/getReview",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[a]!=null){l[a].abort()}}});l[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()}});l[a].always(e=>{this.review_loading=false})},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)}}});Jt.use(ElementPlus);const Gt=Jt.mount("#section-review");const Wt={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",auth_type:"reauthenticate"})},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:` 1080 <div v-if="show_button" class="social-login"> 1081 <div class="fb-login-button fullwidth-child" 1082 :data-width="button_width" 1083 data-size="large" data-button-type="login_with" 1084 data-layout="rounded" 1085 data-auto-logout-link="false" 1086 data-use-continue-as="true" 1087 data-onlogin="checkLoginState" 1088 > 1089 </div> 1090 </div> 1091 `};const Ht={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:` 1092 <div v-if="show_button" class="fullwidth-child" > 1093 <a href="javascript:;" ref="google_target" class="s-google"> 1094 {{label.title}} 1095 </a> 1096 </div> 1097 `};const Zt=Vue.createApp({components:{"component-facebook":Wt,"component-google":Ht,"component-bootbox":Ae,"components-recapcha":De,"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},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};l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});l[t].always(e=>{this.loading=false})},SocialRegister(e){var t=e;var a=1;t=JSON.stringify(t);l[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(l[a]!=null){l[a].abort()}}});l[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});l[a].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.$refs.vueRecaptcha.is_enabled){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){},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;
1097e+="&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 Qt=Zt.mount("#vue-login");const Xt=Vue.createApp({components:{"component-phone":e,"vue-recaptcha":De},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};l[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(l[t]!=null){l[t].abort()}}});l[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()}});l[t].always(e=>{this.loading=false})},recaptchaVerified(e){this.recaptcha_response=e},recaptchaExpired(){if(this.show_recaptcha){this.$refs.vueRecaptcha.reset()}},recaptchaFailed(){}}});Xt.use(Maska);Xt.use(ElementPlus);const ea=Xt.mount("#vue-register");const ta=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);l[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(l[t]!=null){l[t].abort()}}});l[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)){ie(e.details.verification_code)}}}else{this.error=e.msg}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect}else{this.error=e.msg}});l[t].always(e=>{this.is_loading=false})}}});ta.use(Maska);const aa=ta.mount("#vue-account-verification");const sa=Vue.createApp({components:{"component-phone":e,"vue-rec
1097aptcha":De},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);l[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(l[t]!=null){l[t].abort()}}});l[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)){ie(e.details.verification_code)}this.startTimer()}else{this.recaptchaExpired();this.error=e.msg;this.client_uuid=""}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.steps=3}else{this.error=e.msg}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});l[t].always(e=>{this.is_loading=false})}}});sa.use(Maska);sa.use(ElementPlus);const ia=sa.mount("#vue-register-less");const oa=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}
1097,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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.steps=2;this.getCustomerInfo()}else{this.error=e.msg}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){window.location.href=e.details.redirect_url}else{this.error=e.msg}});l[t].always(e=>{this.is_loading=false})}}});oa.use(Maska);const ra=oa.mount("#vue-account-information");const da=5;const na=Vue.createApp({components:{"component-phone":e},data(){return{loading:false,error:[],email_address:"",steps:1,uuid:"",success:"",counter:da,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=da;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";l[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(l[t]!=null){l[t].abort()}}});l[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=""}});l[t].always(e=>{this.loading=false})}
1097,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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.success=e.msg;this.counter=da;this.startTimer()}else{this.error=e.msg}});l[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})}}});na.use(Maska);na.use(ElementPlus);const la=na.mount("#vue-forgot-password");const ca=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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.success=e.msg;this.steps=2}else{this.error=e.msg}});l[t].always(e=>{this.loading=false})}}}).mount("#vue-reset-password");const ma=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:[],store_opening_timings:"regular_hours",every_day_hours:[],deliveryTime:null,dataResults:null}},mounted(){if(!this.dataResults){this.getTransaction()}},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;l[t]=p.ajax({url:ajaxurl+"/checkoutTransaction",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.dataResults=e.details;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;this.whento_deliver=e.details.whento_deliver;this.store_opening_timings=e.details?.store_opening_timings;this.every_day_hours=e.details?.every_day_hours;if(this.store_opening_timings=="advance_timing"&&this.whento_deliver=="now"&&!empty(e.details.delivery_time)){if(this.every_day_hours&&Object.keys(this.every_day_hours).length>0){this.deliveryTime=e.details.delivery_time}}}else{this.transactions=[];this.delivery_option=[];this.opening_hours=[];this.display_data=[];this.checkout_error=[];this.opening_hours_date=[];this.every_day_hours=[];this.deliveryTime=null}});l[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):"",store_opening_timings:this.store_opening_timings,deliveryTime:!empty(this.deliveryTime)?JSON.parse(this.deliveryTime):""};var t=1;e=JSON.stringify(e);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==2){ElementPlus.ElNotification({title:"",message:e.msg,position:"bottom-right",type:"warning"});return}if(e.code==1){if(this.whento_deliver=="schedule"){this.deliveryTime=null}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();xa.loadTips();if(typeof M!=="undefined"&&M!==null){M.addressNeeded()}if(typeof ni!=="undefined"&&ni!==null){ni.getTableAttributes()}if(typeof vm_checkout_address!=="undefined"&&vm_checkout_address!==null){vm_checkout_address.handleAddressRequirement
1097()}if(typeof window.customCheckoutFields!=="undefined"&&window.customCheckoutFields!==null){customCheckoutFields.getCustomeFields()}}});l[t].always(e=>{this.is_loading=false})}}});ma.use(ElementPlus);const ua=ma.mount("#vue-transaction");const ha={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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[t].always(e=>{this.is_loading=false})}},template:` 1098 <div class="modal" id="changephoneModal" tabindex="-1" role="dialog" 1099 aria-labelledby="changephoneModal" aria-hidden="true" > 1100 <div class="modal-dialog" role="document"> 1101 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }"> 1102 1103 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1104 <h5 class="modal-title" id="exampleModalLongTitle"> 1105 {{label.edit_phone}} 1106 </h5> 1107 <div class="close"> 1108 <a href="javascript:;" @click="close" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1109 </div> 1110 </div> 1111 1112 <div class="modal-body" style="overflow-y:inherit !important;"> 1113 1114 <form class="forms mt-2 mb-2" @submit.prevent="SendCode" > 1115 1116 <!--COMPONENTS--> 1117 <component-phone 1118 :default_country="default_country" 1119 :only_countries="only_countries" 1120 v-model:mobile_number="mobile_number" 1121 v-model:mobile_prefix="mobile_prefix" 1122 > 1123 </component-phone> 1124 <!--END COMPONENTS--> 1125 1126 1127 </form> 1128 1129 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1130 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1131 </div> 1132 1133 </div> <!--modal body--> 1134 1135 <div class="modal-footer justify-content-start"> 1136 1137 <div class="border flex-fill"> 1138 <button class="btn btn-black w-100" @click="close" > 1139 {{label.cancel}} 1140 </button> 1141 </div> 1142 <div class="border flex-fill"> 1143 <button @click="SendCode" 1144 class="btn btn-green w-100" :class="{ loading: is_loading }" :disabled="!PhoneValid" > 1145 <span class="label">{{label.continue}}</span> 1146 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1147 </button> 1148 </div> 1149 1150 </div> <!--footer--> 1151 1152 </div> <!--content--> 1153 </div> <!--dialog--> 1154 </div> <!--modal--> 1155 `};const _a={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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.counter=20;this.startTimer();if(!empty(e.details)){if(!empty(e.details.verification_code)){ie(e.details.verification_code)}}}else{this.error=e.msg}});l[t].always(e=>{this.is_loading=false})}},template:` 1156 <div class="modal" id="verifyCodeModal" tabindex="-1" role="dialog" 1157 aria-labelledby="verifyCodeModal" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 1158 <div class="modal-dialog" role="document"> 1159 <div class="modal-content"> 1160 1161 <form class="forms" @submit.prevent="submit" > 1162 1163 <div class="modal-body"> 1164 1165 1166 <a href="javascript:;" @click="close" 1167 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1168 1169 <div class="text-center"> 1170 <h4 class="m-0 mb-3 mt-3">{{label.steps}}</h4> 1171 <h6>{{label.for_security}}</h6> 1172 </div> 1173 1174 1175 1176 <p class="bold">{{label.enter_digit}}</p> 1177 <div class="form-label-group"> 1178 <input v-model="code" ref="refcode" v-maska="'######'" 1179 class="form-control form-control-text" 1180 placeholder="" type="text" maxlength="6" id="code" > 1181 <label for="code" class="required">{{label.code}}</label> 1182 </div> 1183 1184 1185 1186 <p class="bold">{{data.message}}</p> 1187 1188 <template v-if="counter===0"> 1189 <div class="mt-1 mb-3"> 1190 <a href="javascript:;" @click="resendCode" :disabled="is_loading" > 1191 <p class="m-0"><u>{{label.resend_code}}</u></p> 1192 </a> 1193 </div> 1194 </template> 1195 <template v-else> 1196 <p><u>{{label.resend_code_in}} {{counter}}</u></p> 1197 </template> 1198 1199 1200 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1201 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1202 </div> 1203 1204 </div> <!--modal body--> 1205 1206 <div class="modal-footer justify-content-start"> 1207 <button class="btn btn-green w-100" 1208 :class="{ loading: is_loading }" :disabled="!CodeisValid" >
1209 <span class="label">{{label.submit}}</span> 1210 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1211 </button> 1212 </div> <!--footer--> 1213 1214 </form> 1215 </div> <!--content--> 1216 </div> <!--dialog--> 1217 </div> <!--modal--> 1218 `};const pa=Vue.createApp({components:{"component-change-phone":ha,"component-change-phoneverify":_a},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;l[t]=p.ajax({url:ajaxurl+"/getCheckoutPhone",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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=[]}});l[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);l[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(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.$refs.cphoneverify.close();fa.getCheckoutPhone()}else{this.$refs.cphoneverify.error=e.msg}});l[a].always(e=>{this.$refs.cphoneverify.is_loading=false})}}});pa.use(Maska);pa.use(ElementPlus);const fa=pa.mount("#vue-contactphone");const ga={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=""},async applyCode(){this.error=[];var e;var t=1;const a=await Oe();e="promo_code="+this.promo_code;e+="&cart_uuid="+getCookie("cart_uuid");e+="&device_finger_print="+a;e+=addValidationRequest();l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.closeModal();if(ba.enabled){ba.getAppliedPromo()}else{this.$emit("setLoadpromo")}vue_cart.loadcart()}else{this.error[0]=e.msg}});l[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:` 1219 <div class="modal" id="promocodeModal" tabindex="-1" role="dialog" 1220 aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" > 1221 <div class="modal-dialog" role="document"> 1222 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 1223 1224 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1225 <h5 class="modal-title" id="exampleModalLongTitle"> 1226 {{title}} 1227 </h5> 1228 <div class="close"> 1229 <a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1230 </div> 1231 </div> 1232 1233 <div class="modal-body"> 1234 1235 <form class="forms mt-2 mb-2" @submit.prevent="applyCode" > 1236 1237 <div class="form-label-group"> 1238 <input v-model="promo_code" class="form-control form-control-text" placeholder="" 1239 id="promo_code" type="text" maxlength="20" > 1240 <label for="promo_code" class="required">{{add_promo_code}}</label> 1241 </div> 1242 1243 </form> <!--forms--> 1244 1245 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1246 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1247 </div> 1248 1249 </div> <!--modal body--> 1250 1251 <div class="modal-footer"> 1252 <button type="button" class="btn btn-black pl-4 pr-4" @click="back" >Cancel</button> 1253 <button type="button" class="btn btn btn-green pl-4 pr-4" 1254 @click="applyCode" :class="{ loading: is_loading }" :disabled="hasData" 1255 >
1256 <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div> 1257 </button> 1258 </div> 1259 1260 </div> <!--content--> 1261 </div> <!--dialog--> 1262 </div> <!--modal--> 1263 `};const va=Vue.createApp({components:{"component-promocode":ga},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+="¤cy_code="+a;e+=addValidationRequest();l[t]=p.ajax({url:ajaxurl+"/loadPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code===1){this.data=e.details.data;this.promo_selected=e.details.promo_selected;ba.enabled=false}else{this.data=[];this.promo_selected=[];ba.enabled=true}});l[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")},async save(){this.loading=true;const e=await Oe();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"),device_finger_print:e},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);l[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(l[s]!=null){l[s].abort()}}});l[s].done(e=>{if(e.code==1){this.close();this.loadPromo();this.promo_id=[];vue_cart.loadcart()}else this.error=e.msg});l[s].always(e=>{this.remove_loading=false})},showPromoCode(){this.$refs.childref.showModal();this.hide()}}});va.use(ElementPlus);const ya=va.mount("#vue-promo");const ba=Vue.createApp({components:{"component-apply-promocode":ga},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();l[t]=p.ajax({url:ajaxurl+"/getAppliedPromo",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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=[]}});l[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);l[t]=p.ajax({url:ajaxurl+"/removePromo",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.has_promocode=false;this.data=[];this.getAppliedPromo();vue_cart.loadcart()}});l[t].always(e=>{})}}}).mount("#vue-add-promocode");const wa=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+="¤cy_code="+a;e+=addValidationRequest();l[t]=p.ajax({url:ajaxurl+"/loadTips",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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=[]}});l[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;l[s]=p.ajax({url:ajaxurl+"/checkoutAddTips",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[s]!=null){l[s].abort()}}});l[s].done(e=>{if(e.code==1){vue_cart.loadcart()}else{}});
1263l[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"}}}}});wa.use(ElementPlus);const xa=wa.mount("#vue-tips");let P;let Sa=[];const Ta=Vue.createApp({components:{"component-address":Pe},data(){return{q:"",awaitingSearch:false,is_loading:false,transaction_type:"",data:[],error:[],show_list:true,location_data:[],new_coordinates:[],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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.hide();this.loadData();vue_cart.loadcart()}else{this.error[0]=e.msg}});l[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();l[t]=p.ajax({url:ajaxurl+"/checkoutAddress",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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=""}});l[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,styles:map_style})}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);
1263switch(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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[t].always(e=>{this.is_loading=false})}}}).mount("#vue-manage-address");const ka=Vue.createApp({components:{"component-change-address":Pe,"component-address":Fe},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);l[t]=p.ajax({url:ajaxurl+"/getAddresses",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.addresses=e.details.data}else{this.addresses=[]}})}}}).mount("#vue-change-address");const Ia={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")+"¤cy_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")+"¤cy_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 Ca=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:[],default_payment:[],merchant_type:null,uploaded_bank_receipt:null,fileList:[],uploadHeaders:{YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content")}}},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);
1263if(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)){Ge.$refs.box.setMessage(e)}Ge.$refs.box.show()},closeLoadingBox(){Ge.$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+="¤cy_code="+a;e+=addValidationRequest();l[t]=p.ajax({url:ajaxurl+"/PaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.error[0]=e.msg}});l[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+="¤cy_code="+a;e+=addValidationRequest();l[t]=p.ajax({url:ajaxurl+"/SavedPaymentList",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data_saved_payment=e.details.data;this.default_payment_uuid=e.details.default_payment_uuid;this.default_payment=e.details?.default_payment;this.merchant_type=e.details?.merchant_type;vue_cart.selected_payment_uuid=this.default_payment_uuid;if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}}else{this.error[0]=e.msg;this.data_saved_payment=[];this.default_payment_uuid="";vue_cart.selected_payment_uuid=""}});l[t].always(e=>{this.saved_payment_loading=false;ce()})},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);l[s]=p.ajax({url:ajaxurl+"/deleteSavedPaymentMethod",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[s]!=null){l[s].abort()}}});l[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);l[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.SavedPaymentList();if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}}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)}}},handleBankReceiptSuccess(e){console.debug("handleBankReceiptSuccess",e);if(e.code==1){this.uploaded_bank_receipt=e?.details;this.fileList=[{name:e?.details?.filename,url:e?.details?.url_image,uid:e?.details?.id}]}else{ElementPlus.ElNotification({title:"",message:e?.msg,position:"bottom-right",type:"warning"})}},async handleBankReceiptRemove(e){try{const a=new URLSearchParams({YII_CSRF_TOKEN:p("meta[name=YII_CSRF_TOKEN]").attr("content"),name:e?.name}).toString();axios.post(`${ajaxurl}/handleBankReceiptRemove`,a);this.uploaded_bank_receipt=null}catch(t){console.debug("error",t)}}}});if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Ca.component(e,t)})}Ca.component("components-digital-wallet",Ia);Ca.use(Maska);Ca.use(ElementPlus);const F=Ca.mount("#vue-payment-list");const Oa={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)}
1263)}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 Ea={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 Pa,Fa;const Na=Vue.createApp({components:{"component-order-tracking":Oa,"components-review":Ke,"components-reviewdriver":Ea},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.request_interval=5e3;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},callDriverProvider(){const e=`tel:${this.order_info?.provider_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){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();l[t]=p.ajax({url:ajaxurl+"/getOrder",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[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){if(this.order_info?.provider_code_raw=="internal"){setTimeout(()=>{this.loadTrackMap()},600)}}});l[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}this.order_info.provider_code=e?.provider_code;this.order_info.provider_code_raw=e?.provider_code_raw;this.order_info.provider_status=e?.provider_status;this.order_info.provider_status_raw=e?.provider_status_raw;this.order_info.provider_assigned_type=e?.provider_assigned_type;this.order_info.provider_assigned_at_raw=e?.provider_assigned_at_raw;this.order_info.provider_assigned_at=e?.provider_assigned_at;this.order_info.provider_job_id=e?.provider_job_id;this.order_info.provider_tracking_link=e?.provider_tracking_link;this.order_info.provider_driver_info=e?.provider_driver_info;this.order_info.provider_find_driver=e?.provider_find_driver;this.order_info.provider_reassign=e?.provider_reassign;this.order_info.provider_order_ongoing=e?.provider_order_ongoing;this.order_info.provider_is_cancel_jobs=e?.provider_is_cancel_jobs},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,styles:map_style});Pa=new google.maps.DirectionsService;Fa=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;
1263case"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()=>{if(this.driver_info&&this.order_progress>2){console.log("addDriverRoute");
1263if(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"){Fa.setDirections({routes:[]});Pa.route({origin:e,destination:t,travelMode:"DRIVING"},(e,t)=>{console.log("status",t);if(t==="OK"){console.log("response",e);Fa.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)}}
1263,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)}}}}}});Na.use(ElementPlus);window.app_orders_track=Na.mount("#vue-orders-track");const Ra={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:""};l[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(i),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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 j!=="undefined"&&j!==null){j.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"]};l[t]=p.ajax({url:ajaxurl+"/getCart",method:"PUT",dataType:"json",data:JSON.stringify(a),contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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();l[i]=p.ajax({url:ajaxurl+"/updateCartItems",method:"POST",dataType:"json",data:s,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[i]!=null){l[i].abort()}}});l[i].done(e=>{if(e.code==1){this.getCartPreview()}if(typeof dt!=="undefined"&&dt!==null){dt.$refs.ref_featured_list.getFeaturedItems()}});l[i].always(e=>{this.update_cart_loading=false})},remove(e,t){var a;var s=1;a="row="+e+"&cart_uuid="+t;a+=addValidationRequest();l[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(l[s]!=null){l[s].abort()}}});l[s].done(e=>{u(e);
1263if(e.code==1){this.getCartPreview()}})},clear(e){var t;var a=1;t="cart_uuid="+e;t+=addValidationRequest();l[a]=p.ajax({url:ajaxurl+"/clearCart",method:"POST",dataType:"json",data:t,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.getCartPreview()}})},updateImage(){h()},beforeClose(e){this.$emit("afterDrawerclose",false);e()}},template:` 1264 1265 <el-drawer 1266 v-model="drawer" 1267 direction="rtl" 1268 size="320px" 1269 append-to-body="true" 1270 :with-header="true" 1271 :before-close="beforeClose" 1272 custom-class="drawer-preview-cart" 1273 > 1274 1275 <template v-if="cart_loading==false"> 1276 <template v-if="cart_items.length>0"> 1277 1278 <div class="mt-3 mb-0"> 1279 <p class="m-0 bold">{{label.your_cart}}</p> 1280 <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> 1281 <p class="m-0 text-muted">{{cart_merchant.merchant_address}}</p> 1282 </div> 1283 1284 <div class="d-flex justify-content-between align-items-center mb-1"> 1285 <div><h6 class="m-0">{{label.summary}}</h6></div> 1286 <div> 1287 <a href="javascript:;" @click="clear(cart_uuid)" class="javascript:;"> 1288 <p class="m-0"><u>{{label.clear}}</u></p> 1289 </a> 1290 </div> 1291 </div> 1292 </template> 1293 1294 <template v-else> 1295 <h5 class="mt-3 mb-0">{{label.cart}}</h5> 1296 <div class="cart-empty text-center" > 1297 <div class="mt-5"> 1298 <div class="no-results m-auto"></div> 1299 <h6 class="m-0 mt-3">{{label.no_order}}</h6> 1300 <p>{{label.lets_change_that}}</p> 1301 </div>
1302 </div> 1303 </template> 1304 1305 </template> 1306 1307 <!--section-cart--> 1308 <DIV class="section-cart"> 1309 1310 <div v-cloak class="items" v-for="(items, index) in cart_items" > 1311 1312 <div class="line-items row mb-1"> 1313 <div class="col-3"> 1314 <el-image 1315 style="width: 50px; height: 50px" 1316 :src="items.url_image" 1317 :fit="contain" 1318 lazy 1319 ></el-image> 1320 </div> <!--col--> 1321 1322 <div class="col-6 p-0 d-flex justify-content-start flex-column"> 1323 1324 <p class="mb-1"> 1325 {{ items.item_name }} 1326 <template v-if=" items.price.size_name!='' "> 1327 ({{items.price.size_name}}) 1328 </template> 1329 </p> 1330 1331 <template v-if="items.is_free"> 1332 <div class="mb-1"> 1333 <el-tag effect="plain" type="success" size="small" style="white-space: nowrap !important;" > 1334 {{ label.free }} 1335 </el-tag> 1336 </div> 1337 </template> 1338 <template v-else> 1339 <template v-if="items.price.discount>0"> 1340 <p class="m-0 font11"><del>{{items.price.pretty_price}}</del> {{items.price.pretty_price_after_discount}}</p> 1341 </template> 1342 <template v-else> 1343 <p class="m-0 font11">{{items.price.pretty_price}}</p> 1344 </template> 1345 </template> 1346 1347 <!--quantity--> 1348 <div class="quantity d-flex justify-content-between"> 1349 1350 <div> 1351 <a href="javascript:;" @click="updateCartQty(0,items.qty,items.cart_row,cart_uuid)" class="rounded-pill qty-btn" data-id="less"> 1352 <i class="zmdi zmdi-minus"></i> 1353 </a> 1354 </div> 1355 1356 <div class="qty">{{ items.qty }}</div> 1357 1358 <div> 1359 <a href="javascript:;" @click="updateCartQty(1,items.qty,items.cart_row,cart_uuid)" class="rounded-pill qty-btn" data-id="plus"> 1360 <i class="zmdi zmdi-plus"></i> 1361 </a> 1362 </div> 1363 1364 </div> 1365 <!--quantity--> 1366 1367 <p class="mb-0" v-if=" items.special_instructions!='' ">{{ items.special_instructions }}</p> 1368 1369 <template v-if=" items.attributes!='' "> 1370 <template v-for="(attributes, attributes_key) in items.attributes"> 1371 <p class="mb-0"> 1372 <template v-for="(attributes_data, attributes_index) in attributes"> 1373 {{attributes_data}}<template v-if=" attributes_index<(attributes.length-1) ">, </template> 1374 </template> 1375 </p> 1376 </template> 1377 </template> 1378 1379 1380 </div> <!--col--> 1381 1382 <div class="col-3 quantity d-flex justify-content-start flex-column text-right"> 1383 <a href="javascript:;" @click="remove(items.cart_row,cart_uuid)" class="rounded-pill ml-auto mb-1"><i class="zmdi zmdi-close"></i></a> 1384 <template v-if="items.price.discount<=0 "> 1385 <p class="mb-0">{{ items.price.pretty_total }}</p> 1386 </template> 1387 <template v-else> 1388 <p class="mb-0">{{ items.price.pretty_total_after_discount }}</p> 1389 </template> 1390 </div> <!--col--> 1391 1392 </div><!-- line-items--> 1393 1394 <!--addon-items--> 1395 <div class="addon-items row mb-1" v-for="(addons, index_addon) in items.addons" > 1396 <div class="col-3"><!--empty--></div> <!--col--> 1397 <div class="col-9 pl-0 d-flex justify-content-start flex-column"> 1398 <p class="m-0 bold">{{ addons.subcategory_name }}</p> 1399 1400 <template v-cloak v-for="addon_items in addons.addon_items"> 1401 <div class="d-flex justify-content-between mb-1"> 1402 <div class="flexrow"><p class="m-0">{{addon_items.qty}} x {{addon_items.pretty_price}} {{addon_items.sub_item_name}}</p></div> 1403 <div class="flexrow"><p class="m-0">{{addon_items.pretty_addons_total}}</p></div> 1404 </div> <!--flex--> 1405 </template> 1406 1407 </div> <!--col--> 1408 </div> 1409 <!-- addon-items--> 1410 1411 </div> <!--items--> 1412 1413 </DIV> 1414 1415 <template v-if="cart_items.length>0"> 1416 <div class="divider"></div> 1417 <a class="btn btn-green w-100 pointer position-relative" :disabled="hasError" 1418 :href="hasError?'javascript:;':go_checkout.link" 1419 :class="{ loading: update_cart_loading }" 1420 > 1421 <div class="d-flex justify-content-between"> 1422 <div>{{label.go_checkout}}</div> 1423 <div v-if="!update_cart_loading">{{subtotal.value}}</div> 1424 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1425 </div> 1426 </a> 1427 </template> 1428 1429 <div v-cloak class="alert alert-warning m-0 mt-2" v-if="error.length>0"> 1430 <p class="m-0" v-for="error_msg in error"> 1431 {{ error_msg }} 1432 </p> 1433 </div> 1434 1435 </el-drawer> 1436 `};const Da={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;
1436if(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:` 1437 `};const Aa={components:{"components-webpush":Da},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});
1437this.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;if(this.player){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:` 1438 1439 <components-webpush 1440 :ajax_url="ajax_url" 1441 :message='label' 1442 /> 1443 </components-webpush> 1444 1445 <div class="btn-group pull-right notification-dropdown"> 1446 <button type="button" class="btn p-0 btn-default" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 1447 <img class="img-30 rounded-pill lozad" :src="avatar" :data-background-image="image_background" /> 1448 <span v-if="count>0" :class="{'shake-constant shake-chunk' : ReceiveMessage }" class="badge rounded-circle badge-danger count">{{count}}</span> 1449 </button> 1450 <div class="dropdown-menu dropdown-menu-right"> 1451 <div class="dropdown-header d-flex justify-content-between"> 1452 <div class="flex-col"> 1453 <div class="d-flex align-items-center"> 1454 <h5 class="m-0 mr-2">{{label.title}}</h5> 1455 <span class="badge rounded-circle badge-green badge-25">{{count}}</span> 1456 </div> 1457 </div> 1458 <div class="flex-col" v-if="hasData"> 1459 <a @click="clearAll">{{label.clear}}</a> 1460 </div> 1461 </div> 1462 <!--header--> 1463 1464 <!--content--> 1465 <ul v-if="hasData" class="list-unstyled m-0"> 1466 <li v-for="(item,index) in data"> 1467 <a :class="{ active: index<=0 }" > 1468 <div class="d-flex"> 1469 <div v-if="item.image!=''" class="flex-col mr-3"> 1470 <template v-if="item.image_type=='icon'"> 1471 <div class="notify-icon rounded-circle bg-soft-primary"> 1472 <i :class="item.image"></i> 1473 </div> 1474 </template> 1475 <template v-else> 1476 <div class="notify-icon"> 1477 <img class="img-40 rounded-circle" :src="item.image" /> 1478 </div> 1479 </template> 1480 </div> 1481 <div class="flex-col"> 1482 <div class="text-heading" v-html="item.message"></div> 1483 <div class="dropdown-text-light">{{item.date}}</div> 1484 </div> 1485 </div> 1486 </a> 1487 </li> 1488 </ul> 1489 <!--content--> 1490 1491 <div v-if="!hasData" class="none-notification text-center"> 1492 <div class="image-notification m-auto"></div> 1493 <h5 class="m-0 mb-1 mt-2">{{label.no_notification}}</h5> 1494 <p class="m-0 font11 text-muted">{{label.no_notification_content}}</p> 1495 </div> 1496 1497 <div v-if="hasData" class="footer-dropdown text-center"> 1498 <a :href="view_url" targe="_blank" class="text-primary">{{label.view}}</a> 1499 </div> 1500 1501 </div> <!--dropdown-menu--> 1502 </div> 1503 <!--btn-group--> 1504 `};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:`
1505 <el-skeleton style="width: 150px" :loading="is_loading" animated> 1506 <template #template> 1507 <el-skeleton-item variant="image" style="width: 150px; height: 20px" /> 1508 </template> 1509 <template #default> 1510 1511 <el-dropdown trigger="click" v-if="data.enabled"> 1512 <span class="el-dropdown-link"> 1513 1514 <div class="d-flex align-items-center"> 1515 <div class="mr-2"> 1516 <el-image 1517 style="width: 30px; height: 25px" 1518 :src="data.default.flag" 1519 :fit="contain" 1520 lazy 1521 ></el-image> 1522 </div> 1523 <div class="mr-2">{{data.default.title}}</div> 1524 <div><i class="zmdi zmdi-chevron-down"></i></div> 1525 </div> 1526 </span> 1527 <template #dropdown> 1528 <el-dropdown-menu> 1529 <el-dropdown-item v-for="item in data.data" > 1530 1531 <el-dropdown-item @click="setLang(item.link)"> 1532 <div class="row no-gutters align-items-center"> 1533 <div class="col mr-3"> 1534 <el-image 1535 style="width: 30px; height: 25px" 1536 :src="item.flag" 1537 :fit="contain" 1538 ></el-image> 1539 </div> 1540 <div class="col">{{item.title}}</div> 1541 </div> 1542 </el-dropdown-item> 1543 1544 </el-dropdown-item> 1545 </el-dropdown-menu> 1546 </template> 1547 </el-dropdown> 1548 1549 </template> 1550 </el-skeleton> 1551 `};const $a={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 Ya={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")+"¤cy_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:` 1552 <div class="dropdown language-bar d-inline" v-if="!loading" > 1553 <a class="dropdown-toggle text-truncate" href="javascript:;" 1554 role="button" id="currencySelection" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 1555 {{based_currency}} 1556 </a> 1557 <div class="dropdown-menu" aria-labelledby="currencySelection"> 1558 <template v-for="(items,code) in data"> 1559 <a @click="setCurrency(code)" class="dropdown-item" :class="{active : based_currency==code}" > 1560 <div class="d-flex align-items-center"> 1561 <div class="text-truncate">{{items}}</div> 1562 </div> 1563 </a> 1564 </template> 1565 </div> 1566 </div> 1567 `};const Ka=Vue.createApp({components:{"component-cart-preview":Ra,"components-notification":Aa,"components-language":Ma,"component-notification-cart":$a,"component-currency-selection":Ya},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()}
1567if(typeof vue_cart!=="undefined"&&vue_cart!==null){vue_cart.loadcart()}if(typeof j!=="undefined"&&j!==null){j.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 j!=="undefined"&&j!==null){j.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 dt!=="undefined"&&dt!==null){dt.$refs.ref_featured_list.getFeaturedItems()}if(typeof rs!=="undefined"&&rs!==null){rs.getPlan()}}}});Ka.use(ElementPlus);const R=Ka.mount("#vue-cart-preview");const La={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:` 1568 <div class="modal" id="ModalAlert" tabindex="-1" role="dialog" aria-labelledby="ModalAlert" aria-hidden="true"> 1569 <div class="modal-dialog modal-dialog-centered" role="document"> 1570 <div class="modal-content"> 1571 1572 <div class="modal-header"> 1573 <h5 class="modal-title" id="exampleModalLabel">{{ title }}</h5> 1574 <button type="button" class="close" aria-label="Close" @click="close" > 1575 <span aria-hidden="true">×</span> 1576 </button> 1577 </div> 1578 1579 <div class="modal-body" > 1580 <div v-for="item in data.text" > 1581 {{ item }} 1582 </div> 1583 </div> 1584 1585 <div class="modal-footer justify-content-center"> 1586 <button class="btn btn-black w-25" @click="close" > 1587 {{button}} 1588 </button> 1589 </div> <!--footer--> 1590 1591 </div> <!--content--> 1592 </div> <!--dialog--> 1593 </div> <!--modal--> 1594 `};const za=Vue.createApp({components:{"component-alert":La},methods:{alert(e){this.$refs.Alertref.alert({text:e})}}}).mount("#component_alert");const qa={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);l[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(l[a]!=null){l[a].abort()}}});l[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=[]}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){f(e.msg,"success");this.close();Ua.page=0;Ua.data=[];Ua.orderHistory()}else{this.error=e.msg}});l[t].always(e=>{this.is_loading=false})}},template:` 1595 <div class="modal" id="ModalCancelOrder" tabindex="-1" role="dialog" aria-labelledby="ModalCancelOrder" aria-hidden="true" data-backdrop="static" data-keyboard="false" > 1596 <div class="modal-dialog modal-dialog-centered" role="document"> 1597 <div class="modal-content"> 1598 1599 <div class="modal-header"> 1600 <h5 class="modal-title" id="exampleModalLabel">{{merchant_name}}</h5> 1601 <button type="button" class="close" aria-label="Close" @click="close" :disabled="is_loading" >
1602 <span aria-hidden="true">×</span> 1603 </button> 1604 </div> 1605 1606 <DIV v-if="loading"> 1607 <div class="loading mt-5 mb-5"> 1608 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1609 </div> 1610 </DIV> 1611 1612 <DIV v-else> 1613 1614 <div class="modal-body" > 1615 1616 <h5 v-if="cancel_response.refund_status==='full_refund'">{{label.are_you_sure}}</h5> 1617 <h5 v-else>{{label.how}}</h5> 1618 1619 <div class="mt-3"> 1620 <p>{{cancel_msg}}</p> 1621 </div> 1622 1623 <div class="mt-3 mb-2" v-if="cancel_response.refund_msg"> 1624 <p>{{cancel_response.refund_msg}}</p> 1625 </div> 1626 1627 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1628 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1629 </div> 1630 1631 </div> <!--body--> 1632 1633 <div class="modal-footer justify-content-center"> 1634 <button class="btn btn-black w-100" @click="close" :disabled="is_loading" > 1635 {{label.dont}} 1636 </button> 1637 <button class="btn btn-green w-100" :disabled="!cancel_status" @click="applyCancelOrder()" 1638 :class="{ loading: is_loading }" > 1639 <span class="label">{{label.cancel}}</span> 1640 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1641 </button> 1642 </div> <!--footer--> 1643 1644 </DIV> <!--end if--> 1645 1646 </div> <!--content--> 1647 </div> <!--dialog--> 1648 </div> <!--modal--> 1649 `};const Va=Vue.createApp({components:{"component-cancel-order":qa,"components-review":Ke,"components-reviewdriver":Ea},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();l[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[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}});l[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();l[t]=p.ajax({url:ajaxurl+"/orderHistory",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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{}});l[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);l[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=[];
1649if(l[a]!=null){l[a].abort()}}});l[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]}}});l[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);l[s]=p.ajax({url:ajaxurl+"/orderBuyAgain",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[s]!=null){l[s].abort()}}});l[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);l[t]=p.ajax({url:ajaxurl+"/orderSummary",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[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})}}});Va.use(ElementPlus);const Ua=Va.mount("#vue-my-order");const D=Vue.createApp({components:{"component-bootbox":Ae},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 Ba=Vue.createApp({components:{"component-new-address":Pe,"component-address":Fe},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);l[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(l[a]!=null){l[a].abort()}}});l[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}});l[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)}}});Ba.use(ElementPlus);const Ja=Ba.mount("#vue-my-address");const Ga={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);l[t]=p.ajax({url:ajaxurl+"/PaymentMethod",method:"PUT",dataType:"json",data:e,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}})},showPayment(e){this.$emit("setPayment",e)}},template:` 1650 <!--PAYMENT METHODS--> 1651 <transition name="slide-fade"> 1652 <div class="card mb-3" v-if="display" > 1653 <div class="card-body"> 1654 1655 <h5 class="mb-3">{{label.add_new_payment}}</h5> 1656 1657 <a v-for="payment in data" @click="showPayment(payment.payment_code)" 1658 href="javascript:;" class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 1659 <div class="flexcol mr-2 payment-logo-wrap"> 1660 <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i> 1661 <img v-else class="img-35" :src="payment.logo_image" /> 1662 </div> 1663 1664 <div class="flexcol" >
1665 <span class="mr-1">{{payment.payment_name}}</span> 1666 </div> 1667 </a> 1668 1669 </div> <!--card body--> 1670 </div> <!--card--> 1671 </transition> 1672 <!--END PAYMENT METHODS--> 1673 `};const Wa=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);l[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(l[a]!=null){l[a].abort()}}});l[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=""}});l[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);l[a]=p.ajax({url:ajaxurl+"/deletePayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.getMyPayments(true)}else{D.alert(e.msg,{})}});l[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);l[a]=p.ajax({url:ajaxurl+"/setDefaultPayment",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[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){Wa.component(e,t)})}Wa.component("components-payment-method",Ga);Wa.use(Maska);Wa.use(ElementPlus);const Ha=Wa.mount("#vue-my-payments");const Za=Vue.createApp({components:{"component-save-store":nt},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);l[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(l[a]!=null){l[a].abort()}}});l[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=[]}});l[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 Qa=Za.mount("#vue-saved-store");const Xa={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();l[t]=p.ajax({url:ajaxurl+"/getlocation_autocomplete",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:e=>{if(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.data=e.details.data}else{this.data=[]}});l[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;
1673this.$emit("update:modelValue",e.description);this.$emit("afterChoose",e)}},computed:{hasData(){if(this.data.length>0){return true}return false}},template:` 1674 <div class="position-relative search-geocomplete"> 1675 <div v-if="!awaitingSearch" class="img-20 m-auto pin_placeholder icon"></div> 1676 <div v-if="awaitingSearch" class="icon" data-loader="circle"></div> 1677 1678 <input @click="showList" v-model="q" class="form-control form-control-text" 1679 :placeholder="label.enter_address" > 1680 1681 <div v-if="hasData" @click="clearData" class="icon-remove"><i class="zmdi zmdi-close"></i></div> 1682 1683 </div> 1684 1685 <div class="search-geocomplete-results" v-if="show_list"> 1686 <ul class="list-unstyled m-0 border"> 1687 <li v-for="items in data"> 1688 <a href="javascript:;" @click="setData(items)" > 1689 <h6 class="m-0">{{items.description}}</h6> 1690 </a> 1691 </li> 1692 </ul> 1693 </div> 1694 `};const es=Vue.createApp({components:{"component-auto-complete":Xa,"component-phone":e,"vue-recaptcha":De},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();l[t]=p.ajax({url:ajaxurl+"/getSignupAttributes",method:"POST",dataType:"json",data:e,contentType:m.form,timeout:c,crossDomain:true,beforeSend:function(e){if(l[t]!=null){l[t].abort()}}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{this.response=e;if(e.code==1){window.location.href=e.details.redirect}});l[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}}});es.use(Maska);es.use(ElementPlus);const ts=es.mount("#vue-merchant-signup");const as=Vue.createApp({components:{"component-phone":e,"vue-rec
1694aptcha":De},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})}}});as.use(Maska);const ss=as.mount("#vue-merchant-user");const is={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:` 1695 <!--PAYMENT METHODS--> 1696 <div class="card mb-3" > 1697 <div class="card-body"> 1698 1699 <h4 class="mb-3">{{label.select_payment}}</h4> 1700 1701 <a v-for="payment in data" 1702 @click="setPayment(payment.payment_code)" 1703 :class="isActive(payment)" 1704 class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 1705 <div class="flexcol mr-2 payment-logo-wrap"> 1706 <i v-if="payment.logo_type=='icon'" :class="payment.logo_class"></i> 1707 <img v-else class="img-35" :src="payment.logo_image" /> 1708 </div> 1709 1710 <div class="flexcol" > 1711 <span class="mr-1">{{payment.payment_name}}</span> 1712 </div> 1713 </a> 1714 1715 </div> <!--card body--> 1716 </div> <!--card--> 1717 <!--END PAYMENT METHODS--> 1718 `};const os=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")+"¤cy_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})}}});os.use(ElementPlus);const rs=os.mount("#vue-subscription");const ds=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,
1718subscription_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+"¤cy_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){ds.component(e,t)})}ds.use(ElementPlus);const ns=ds.mount("#payment-plan");const ls=Vue.createApp({components:{"component-phone":e,"component-change-phoneverify":_a},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);l[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(l[t]!=null){l[t].abort()}}});l[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}});l[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);l[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(l[a]!=null){l[a].abort()}}});l[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}});l[a].always(e=>{if(!empty(t)){this.$refs.cphoneverify.is_loading=false}else{this.is_loading=false}})}}});ls.use(Maska);ls.use(ElementPlus);const cs=ls.mount("#vue-update-profile");const ms=Vue.createApp({components:{"component-change-phoneverify":_a},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);l[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(l[t]!=null){l[t].abort()}}});l[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});l[t].always(e=>{this.is_loading=false})}}}).mount("#vue-update-password");const us=Vue.createApp({components:{"component-change-phoneverify":_a},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);l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.steps_request_data=2}else{this.error=e.msg}});l[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);l[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(l[a]!=null){l[a].abort()}}});l[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});l[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);l[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(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){this.steps=2;setTimeout(()=>{window.location.href=e.details.redirect},4e3)}else D.alert(e.msg,{})});l[a].always(e=>{this.is_loading=false})}}});us.use(Maska);const hs=us.mount("#vue-manage-account");const _s={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;Ye=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();l[s]=p.ajax({url:ajaxurl+"/removeProfilePhoto",method:"PUT",dataType:"json",data:JSON.stringify(a),c
1718ontentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{this.is_loading=true;if(l[s]!=null){l[s].abort();this.is_loading=false}}});l[s].done(e=>{this.is_loading=false;t(true);if(e.code==1){}});l[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:` 1719 <div class="modal" id="photoModal" tabindex="-1" role="dialog" aria-labelledby="photoModal" aria-hidden="true" 1720 data-backdrop="static" data-keyboard="false" > 1721 <div class="modal-dialog modal-dialog-centered" role="document"> 1722 <div class="modal-content"> 1723 1724 <div class="modal-body" style="overflow-y:inherit !important;" > 1725 1726 <a href="javascript:;" @click="closeReset" 1727 class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1728 1729 <template :class="{ 'd-block': steps==1 }"> 1730 <h5 class="m-0 mt-3 mb-2">{{label.add_photo}}</h5> 1731 <div class="mb-3"> 1732 <div class="dropzone dropzone_container" id="dropzone_multiple" ref="profile_dropzone" > 1733 <div class="dz-default dz-message"> 1734 <i class="fas fa-cloud-upload-alt"></i> 1735 <p>{{label.drop_files_here}}</p> 1736 </div> 1737 </div> 1738 </div> 1739 </template> 1740 1741 <template v-if="steps==2"> 1742 <h5 class="m-0 mt-3 mb-2">{{label.crop_photo}}</h5> 1743 1744 <div class="crop-images-wrap"> 1745 <cropper 1746 :src="upload_images" 1747 @change="change" 1748 :stencil-props="{ 1749 handlers: {}, 1750 movable: false, 1751 scalable: false, 1752 }" 1753 :stencil-size="{ 1754 width: 120, 1755 height: 120 1756 }" 1757 image-restriction="stencil" 1758 ></cropper> 1759 </div> 1760 1761 </template> 1762 1763 1764 </div> <!--modal body--> 1765 1766 <template v-if="steps==2"> 1767 1768 <div v-cloak v-if="error.length>0" class="alert alert-warning mb-2" role="alert"> 1769 <p v-cloak v-for="err in error" class="m-0">{{err}}</p> 1770 </div> 1771 1772 <div class="modal-footer justify-content-start"> 1773 <button class="btn btn-green w-100" @click="save" :class="{ loading: is_loading }" > 1774 <span class="label">{{label.save_photo}}</span> 1775 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1776 </button> 1777 </div> <!--footer--> 1778 </template> 1779 1780 </div> <!--content--> 1781 </div> <!--dialog--> 1782 </div> <!--modal--> 1783 `};const ps=Vue.createApp({components:{"components-profile-photo":_s},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();l[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(l[s]!=null){l[s].abort()}}});l[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}});
1783l[s].always(e=>{this.$refs.profile_photo.is_loading=false})},updateImage(){var e=this.$refs.refavatar.getElementsByTagName("img");e[0].src=this.avatar}}});ps.use(ElementPlus);const fs=ps.mount("#vue-profile-photo");const gs=Vue.createApp({components:{"component-select-time":gt},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);l[s]=p.ajax({url:ajaxurl+"/checkStoreOpen",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[s]!=null){l[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 t!=="undefined"&&t!==null){t.whento_deliver=e.whento_deliver;t.delivery_date=e.delivery_date;t.delivery_time=e.delivery_time;t.Search(false)}if(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 vs=Vue.createApp({data(){return{visible:false,include_utensils:false,is_loading:false}},watch:{include_utensils(e,t){U("include_utensils",e);this.setUtensils(e)}},mounted(){this.setUtensils(B("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 ys={props:["title","merchant_id","settings","image_use","responsive"],components:{"money-format":Le},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 ua!=="undefined"&&ua!==null){this.transaction_type=ua.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);l[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(l[a]!=null){l[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);l[s]=p.ajax({url:ajaxurl+"/getMenuItem",method:"PUT",dataType:"json",data:a,contentType:m.json,timeout:c,crossDomain:true,beforeSend:e=>{if(l[s]!=null){l[s].abort()}}}).done(e=>{if(e.code==1){C=e.details.data.items;O=e.details.data.addons;E=e.details.data.addon_items;Kt=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;
1783this.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){Lt=[];var s=[];if(!empty(Kt[a])){p.each(Kt[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:E[t].sub_item_id,sub_item_name:E[t].sub_item_name,item_description:E[t].item_description,price:E[t].price,pretty_price:E[t].pretty_price,checked:false,disabled:false,qty:1})});Lt.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=Lt;this.item_addons_load=true},ItemSummary(e){w=0;var n=[];var l=[];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){n.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);l.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);l.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);l.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(n.length>0){p.each(n,function(e,t){if(l.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);l[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[a].done(e=>{if(e.code==1){p(this.$refs.modal_item_details).modal("hide");vue_cart.loadcart()}});l[a].always(e=>{this.add_to_cart=false})}},template:"#item_suggestion"};const bs=Vue.createApp({components:{"components-item-suggestion":ys},data(){return{data:[]}}});bs.use(ElementPlus);const ws=bs.mount("#vue-item-suggestion");const xs=Vue.createApp({components:{"component-change-address":Pe,"components-address-form":Je,"components-select-address":Ue},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(){if(window.vm_widget_nav){window.vm_widget_nav.showAddress()}},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){console.debug("setInLocalStorageStore8");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);console.debug("setInLocalStorageStore9");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()}}}});xs.use(ElementPlus);const A=xs.mount("#vue-address-needed");const Ss={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)}
1783else{f(e.data.msg,"error")}})["catch"](e=>{}).then(e=>{this.is_submitted=false})}}};const Ts=Vue.createApp({components:{"components-web-pusher":Ss}});const ks=Ts.mount("#vue-webpush-settings");const Is=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})}}});Is.use(ElementPlus);const Cs=Is.mount("#vue-notifications-list");const Os={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:` 1784 <DIV class="position-relative"> 1785 <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center"> 1786 <div> 1787 <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 1788 </div> 1789 </div> 1790 1791 <h5 class="mb-3 mt-4">Add New Payment Method</h5> 1792 1793 <template v-if="!is_loading && hasData"> 1794 here 1795 <a v-for="items in data" @click="$emit('afterClickpayment',items.payment_code)" 1796 class="d-block chevron-section medium d-flex align-items-center rounded mb-2"> 1797 <div class="flexcol mr-2 payment-logo-wrap"> 1798 <i v-if="items.logo_type=='icon'" :class="items.logo_class"></i> 1799 <img v-else class="img-35" :src="items.logo_image" /> 1800 </div> 1801 <div class="flexcol"> 1802 <span class="mr-1">{{items.payment_name}}</span> 1803 </div> 1804 </a> 1805 </template> 1806 1807 <template v-if="!is_loading && !hasData"> 1808 <div class="alert alert-warning mb-2" role="alert"> 1809 <p class="m-0">{{error_message}}</p> 1810 </div> 1811 </template> 1812 1813 1814 </DIV> 1815 `};const Es={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:` 1816 <DIV class="position-relative"> 1817 1818 <div v-if="is_loading" class="loading cover-loader d-flex align-items-center justify-content-center"> 1819 <div> 1820 <div class="m-auto circle-loader medium" data-loader="circle-side"></div> 1821 </div> 1822 </div> 1823 1824 <template v-if="hasData"> 1825 <h5 class="mb-3">Saved Payment Methods</h5> 1826 1827 <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 }" > 1828 1829 <div class="col-md-8 d-flex align-items-center"> 1830 <div class="flexcol mr-2 payment-logo-wrap"> 1831 <i v-if="saved_payment.logo_type=='icon'" :class="saved_payment.logo_class"></i> 1832 <img v-else class="img-35" :src="saved_payment.logo_image" /> 1833 </div> <!--flex-col--> 1834 <div class="flexcol" >
1835 <span class=" mr-1">{{saved_payment.attr1}}</span> 1836 <p class="m-0 text-muted">{{saved_payment.attr2}}</p> 1837 </div> 1838 </div> <!--col--> 1839 <div class="col-md-4 d-flex align-items-center justify-content-end"> 1840 1841 <template v-if="saved_payment.as_default==1"> 1842 <div class="mr-1"><i class="zmdi zmdi-check text-success"></i></div> 1843 <div class="mr-3"><p class="m-0">Default</p></div> 1844 </template> 1845 1846 <div class="dropdown"> 1847 <a href="javascript:;" class="rounded-pill rounded-button-icon d-inline-block" 1848 id="dropdownMenuLink" data-toggle="dropdown" > 1849 <i class="zmdi zmdi-more" style="font-size: inherit;"></i> 1850 </a> 1851 <div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> 1852 <a v-if="saved_payment.as_default!=1" 1853 @click="setDefaultPayment(saved_payment)" 1854 class="dropdown-item a-12" href="javascript:;">Set Default</a> 1855 <a @click="deleteSavedPaymentMethod(saved_payment)" class="dropdown-item a-12" href="javascript:;"> 1856 Delete 1857 </a> 1858 </div> 1859 </div> <!--dropdown--> 1860 1861 </div> <!--col--> 1862 </div> <!--row--> 1863 </template> 1864 </DIV> 1865 `};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{Fs.$refs[this.default_payment.payment_code].DoPaymentRender(t,"PaymentIntentCashin")}catch(a){f(a.message,"error")}}}})}},template:` 1866 <button class="btn btn-green w-100 pointer mt-3" 1867 :disabled="ValidAmount" 1868 @click="DoCashin" 1869 > 1870 <span class="label">{{label.continue}}</span> 1871 <div class="m-auto circle-loader" data-loader="circle-side"></div> 1872 </button> 1873 `};const Ps=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)){Ge.$refs.box.setMessage(e)}Ge.$refs.box.show()},closeLoadingBox(){Ge.$refs.box.close()},Alert(e){f(e,"error")}}});Ps.component("components-payment-list",Os);Ps.component("components-merchant-saved-payment",Es);Ps.component("components-cashin-payment",js);if(typeof components_bundle!=="undefined"&&components_bundle!==null){p.each(components_bundle,function(e,t){Ps.component(e,t)})}const Fs=Ps.mount("#vue-cashin");const Ns=Vue.createApp({components:{"component-carousel":Ze}}).mount("#vue-carousel");const Rs={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:` 1874 <div ref="menu" class="owl-carousel owl-theme menu-carousel"> 1875 <div v-for="(item, index) in data" class="mr-2"> 1876 <a :href="item.url" class="d-block" 1877 :class="{active : index==index_selected }" 1878 > 1879 {{item.label}} 1880 </a> 1881 </div> 1882 </div> 1883 `};const Ds=Vue.createApp({components:{"component-profile-menu":Rs}}).mount("#vue-profile-menu");const As=Vue.createApp({data(){return{recaptcha_response:""}},components:{"components-recapcha":De},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
1883aptcha":De},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};l[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(l[t]!=null){l[t].abort()}}});l[t].done(e=>{if(e.code==1){this.success=e.msg;window.location.href=e.details.redirect}else{this.error=e.msg;this.recaptchaExpired()}});l[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 $s=Ms.mount("#vue-guest-register");const Ys=Vue.createApp({components:{"components-maps":qe,"components-select-address":Ue,"components-saveaddress":Be},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:false,address_label_list:[],address2:"",postal_code:"",company:"",custom_field1:"",custom_field2:"",formattedAddress:"",address_line1:"",address_line2:"",city:"",state:"",country_code:"",address_format_use:null,transactionType:null}},mounted(){if(typeof address_format_use!=="undefined"&&address_format_use!==null){this.address_format_use=address_format_use}},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)},transactionType(e,t){if(e=="delivery"){this.getAddress()}}},methods:{addressNeeded(){return;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;setTimeout(()=>{this.showSelectAddress()},1e3)}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,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,formattedAddress:this.formattedAddress,set_place_id:this.address_data.place_id,data:this.address_data,postal_code:this.postal_code,custom_field1:this.custom_field1,custom_field2:this.custom_field2,address1:this.address1,formatted_address:this.formatted_address,location_name:this.location_name,address_line1:this.address_line1,address_line2:this.address_line2,city:this.city,state:this.state,country_code:this.country_code},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.data=null;
1883if(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;if(this.address_format_use=="2"||this.address_format_use==2){this.address_line1=e?.parsed_address?.street_number;this.address_line2=e?.parsed_address?.street_name;this.city=e?.parsed_address?.city;this.state=e?.parsed_address?.state;this.postal_code=e?.parsed_address?.postal_code;this.country_code=e?.parsed_address?.country_code}else{this.formatted_address=this.address_data?.parsed_address?.street_name??"";this.address1=this.address_data?.parsed_address?.country_code??""}this.formattedAddress=this.address_data?.parsed_address?.formatted_address??"";this.$refs.address_modal.visible=false},editSaveAddress(){console.debug("editSaveAddress",this.save_address_data);this.isEdit=true;this.address_data=this.save_address_data;this.address_uuid=this.save_address_data.address_uuid;if(this.address_data?.address?.address_format_use==2){this.address_line1=this.address_data?.address?.address1;this.address_line2=this.address_data?.address?.address2;this.city=this.address_data?.address?.city;this.state=this.address_data?.address?.state;this.postal_code=this.address_data?.address?.postal_code;this.country_code=this.address_data?.address?.country_code}else{this.address1=this.address_data.address.address1;this.formatted_address=this.address_data.address.formatted_address}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){console.debug("afterSelectaddressx",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.data=null})["catch"](e=>{}).then(e=>{})}}});Ys.use(ElementPlus);const M=Ys.mount("#vm_delivery_details");const Ks=Vue.createApp({components:{"component-auto-complete":Ve,"components-select-address":Ue,"components-address-form":Je},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);
1883axios({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);console.debug("setInLocalStorageStore9");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);console.debug("setInLocalStorageStore10");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=>{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":$a},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 ws!=="undefined"&&ws!==null){ws.$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:` 1884 <div class="d-flex justify-content-between align-items-center"> 1885 <div><b>{{label.resend_code}} {{ counter }}</b></div> 1886 <div> 1887 <el-button type="text" 1888 :loading="loading" 1889 :disabled="counter != 0" 1890 @click="resendCode" 1891 > 1892 {{label.resend}} 1893 </el-button> 1894 </div> 1895 </div> 1896 `};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");const Hs=e=>e===100?"Full":`${e}%`;const Zs={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")+"¤cy_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")+"¤cy_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:` 1897 <div class="modal" ref="modal" tabindex="-1" role="dialog" 1898 aria-labelledby="promocodeModal" aria-hidden="true" data-backdrop="static" > 1899 <div class="modal-dialog" role="document"> 1900 <div class="modal-content" :class="{ 'modal-mobile' : is_mobile==1 }" > 1901 1902 <div class="modal-header border-bottom-0" style="padding-bottom:0px !important;"> 1903 <h5 class="modal-title" id="exampleModalLongTitle"> 1904 {{title}} 1905 </h5> 1906 <div class="close"> 1907 <a href="javascript:;" data-dismiss="modal" class="btn btn-black btn-circle rounded-pill"><i class="zmdi zmdi-close font20"></i></a> 1908 </div>
1909 </div> 1910 1911 <div class="modal-body"> 1912 1913 <form class="forms mt-2 apply-points-form" @submit.prevent="applyCode" > 1914 1915 1916 <template v-if="use_thresholds"> 1917 1918 <div v-loading="loading"> 1919 1920 <el-tabs 1921 v-model="points_tab" 1922 stretch 1923 > 1924 <template v-for="items in data_points" :keys="items"> 1925 <el-tab-pane label="User" :name="items" > 1926 <template #label> 1927 <Div v-if="balance < items.points" class="disabled-class"></Div> 1928 <span class="custom-tabs-label"> 1929 <div class="font13 font-weight-light">{{ items.label }}</div> 1930 <div class="font-weight-bold font20">{{ items.amount }}</div> 1931 <div> 1932 <el-progress 1933 :text-inside="true" 1934 :stroke-width="20" 1935 :percentage=" ((balance / items.points)*100)>100?100: (balance / items.points)*100 " 1936 :status="balance >= items.points ? 'success' : 'primary'" 1937 > 1938 <span> 1939 <template v-if="balance >= items.points"> 1940 REDEEM 1941 </template> 1942 </span> 1943 </el-progress> 1944 </div> 1945 </span> 1946 </template> 1947 </el-tab-pane> 1948 </template> 1949 </el-tabs> 1950 1951 </div> 1952 1953 </template> 1954 <template v-else> 1955 <div class="form-label-group"> 1956 <input v-model="points" class="form-control form-control-text" placeholder="" 1957 id="points" type="text" maxlength="20" > 1958 <label for="points" class="required">{{enter_points}}</label> 1959 </div> 1960 </template> 1961 1962 </form> <!--forms--> 1963 1964 </div> <!--modal body--> 1965 1966 <div class="modal-footer"> 1967 <button type="button" class="btn btn-black pl-4 pr-4" @click="showModal(false)" >Cancel</button> 1968 <button type="button" class="btn btn btn-green pl-4 pr-4" 1969 @click="applyPoints" :class="{ loading: is_submit }" :disabled="hasData" 1970 > 1971 <span class="label">{{apply_text}}</span><div class="m-auto circle-loader" data-loader="circle-side"></div> 1972 </button> 1973 </div> 1974 1975 </div> <!--content--> 1976 </div> <!--dialog--> 1977 </div> <!--modal--> 1978 `};const Qs=Vue.createApp({components:{"components-apply-points":Zs},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")+"¤cy_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:` 1979 <el-autocomplete 1980 v-model="q" 1981 :fetch-suggestions="querySearch" 1982 @select="handleSelect" 1983 :placeholder="label.search" 1984 :trigger-on-focus="false" 1985 :fit-input-width="false" 1986 class="w-100" 1987 size="large" 1988 value-key="name" 1989 :clearable="true" 1990 :select-when-unmatched="true" 1991 :highlight-first-item="true" 1992 > 1993 <template #default="{ item }"> 1994 <div class="value" v-html="item.name"></div> 1995 </template> 1996 </el-autocomplete> 1997 `};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)}}
1997,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+"¤cy_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":Le},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:"",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+="¤cy_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;E=e.data.details.data.addon_items;Kt=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;
1997this.getSizeData(t)},getSizeData(a){Lt=[];var s=[];if(!empty(Kt[a])){p.each(Kt[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 E[t]!=="undefined"&&E[t]!==null){s.push({sub_item_id:E[t].sub_item_id,sub_item_name:E[t].sub_item_name,item_description:E[t].item_description,price:E[t].price,pretty_price:E[t].pretty_price,checked:false,disabled:false,qty:1})}});Lt.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=Lt;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 n=[];var l=[];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){n.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);l.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);l.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);l.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(n.length>0){p.each(n,function(e,t){if(l.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);l[a]=p.ajax({url:ajaxurl+"/addCartItems",method:"PUT",dataType:"json",data:t,contentType:m.json,timeout:c,crossDomain:true,beforeSend:function(e){if(l[a]!=null){l[a].abort()}}});l[a].done(e=>
1997{if(e.code==1){setCookie("cart_uuid",e.details.cart_uuid,30);p("#itemModal").modal("hide");if(typeof R!=="undefined"&&R!==null){R.getCartPreview()}}});l[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+"¤cy_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 ni=di.mount("#vue-checkout-booking");const li={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+"¤cy_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:` 1998 <div ref="carousel_bonusfunds" class="owl-carousel owl-theme carousel_bonusfunds"> 1999 <div v-for="(items, index) in data" class="mr-2"> 2000 <el-card shadow="hover" class="gradient-yellow-bg" style="max-width:350px;"> 2001 <h6>{{items.title}}</h6> 2002 <div class="mb-1">{{items.discount_details}}</div> 2003 <div class="font-weight-bold">
2003{{items.valid_discount}}</div> 2004 </el-card> 2005 </div> 2006 </div> 2007 `};const _i=Vue.createApp({components:{"component-wallet-balance":li,"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.