PageSourceSearch

https://turk3.org/js/product_detail_handler.min.js

js turk3.org collected 2026-09-29 21:35:26 UTC 8,785 bytes, 36 lines download raw bytes

1require(['jquery','jquery-ui','Magento_Ui/js/modal/alert','mage/validation',"mage/calendar",],function($,alerts){'use strict';$(document).ready(function(){if($("body").hasClass("catalog-product-view")){$('.main-popup-box.popup-box-2 .search-input input').on('keyup',function(){let searchValue=$(this).val();if(searchValue===""){$(document).find('.address-boxes .addres-loc').each((index,item)=>{$(item).show();$(item).addClass('on-store');$(item).removeClass('off-store');});if($(document).find('.address-boxes #nostore-text').length>0){$(document).find('.address-boxes #nostore-text').remove();}
2return;}
3$(document).find('.address-boxes .addres-loc').each((index,item)=>{let storeCode=$(item).attr('data-filter');let selectedDate=$('#select-date-booking').val();if(storeCode.toLowerCase().includes(searchValue.toLowerCase())){if(!selectedDate&&!$(item).attr('data-holiday').includes(selectedDate)){$(item).show();$(item).addClass('on-store');$(item).removeClass('off-store');}}else{$(item).hide();$(item).addClass('off-store');$(item).removeClass('on-store');}});if($(document).find('.address-boxes .addres-loc.on-store').length===0){$(document).find('.address-boxes #nostore-text').remove();$(document).find('.address-boxes').append("<p id='nostore-text'>The store you’re looking for isn’t available. Please search for another location.</p>");}else{if($(document).find('.address-boxes #nostore-text').length>
30){$(document).find('.address-boxes #nostore-text').remove();}}});$(document).on('click','.address-boxes .addres-loc',function(){$(document).find('.address-boxes .addres-loc').removeClass('active');$(this).addClass('active');$('.main-popup-box.popup-box-2 .address-area .store_code').val($(this).attr('data-code'));$('.main-popup-box.popup-box-2 .address-area .store_name').val($(this).attr('data-name'));let date={store_code:$(this).attr('data-code')}
4$('input[name=store_code]').val($('.main-popup-box.popup-box-2 .address-area .store_code').val());$('#store-name').val($('.addres-loc.active').attr('data-name'))})
5$(document).on('change','#select-date-booking',function(){let selectedDate=$(this).val()
6let storeCode=$('.main-popup-box.popup-box-2 .address-area .store_code').val();if(selectedDate){$(document).find('.address-boxes .addres-loc.on-store').each((index,item)=>{let storeCodeHoliday=$(item).attr('data-holiday');if(storeCodeHoliday.includes(selectedDate)&&$(item).hasClass('active')){alert('The store not available on selected date');$('#select-date-booking').val('')}else if(storeCodeHoliday.includes(selectedDate)){$(item).hide()}else{$(item).show()}})
7let data={store_code:storeCode,selected_date:selectedDate};ajaxStart();$.ajax({type:'POST',url:window.location.origin+'/bookingappointments/customer/getstoreopentime',data:data,showLoader:true,success:function(data){let timeselectHtml="<option value=''>Select a time range</option>";$('input[name=reservation_date]').val(selectedDate);if(data.status==200){for(var i=0;i<data.storesOpenTime.length;i++){timeselectHtml+="<option value='"+data.storesOpenTime[i]+"'>"+data.storesOpenTime[i]+"</option>"}
8$('#time-range').html(timeselectHtml);}else if(data.status==="fail"&&data.code=="500"){$.cookieStorage.set('timingValue',data.otp_timing);showAlert(data.message);}
9ajaxDone()}})}else{$(document).find('.address-boxes .addres-loc.on-store').each((index,item)=>{$(item).show()})}})
10$(document).on('change','#time-range',function(){let selectedTime=$(this).val()
11$('input[name=reservation_time]').val(selectedTime);let selectedDate=$('#select-date-booking').val();selectedDate=formatDate(selectedDate)
12$('#appointment-date').val(`${selectedDate}, ${selectedTime}`);})
13$(document).on('click','.next-button.continue',function(e){var isValid=true;if(!$('#select-date-booking').val()){$('#select-date-error').show();isValid=false;return false;}else{$('#select-date-error').hide();}
14if(!$('#time-range').val()){$('#time-range-error').show();isValid=false;return false;}else{$('#time-range-error').hide();}
15if(!isValid){event.preventDefault();}else if($('.address-boxes .addres-loc.active').length==0){alert('Please select the store');return false;}
16ajaxStart();$.ajax({type:'POST',url:window.location.origin+'/bookingappointments/customer/getcustomerinfo',data:{},showLoader:true,success:function(response){if(response.status==200){$('#name').val(response.customer.name);$('#email').val(response.customer.email);$('input[name=cap_id]').val(response.customer.cap_id).prop('readonly',true);const phone=response.customer.phone.substring(2);$('#phone').val(phone);$('#popup-step-1').removeClass('active').fadeOut();$('#popup-step-2').addClass('active').fadeIn();}else{$('#popup-step-1').removeClass('active').fadeOut();$('#popup-step-2').addClass('active').fadeIn();console.log(response.message);}
17ajaxDone();}});});$(document).ready(function(){$('.continue-button.booking.submit-button').click(function(e){e.preventDefault();let form=$('#product_addtocart_form');if($('#booking-form').length>0){form=$('#booking-form');}
18let isValid=true;const name=$("#name").val().trim();const nameError=$("#name").siblings(".error-message");if(!name){nameError.text("Name is required.").show();isValid=false;}else if(!/^[a-zA-Z ]{1,50}$/.test(name)){nameError.text("Invalid name. Only alphabetical characters allowed.").show();isValid=false;}else{nameError.text("").hide();}
19const storeName=$("#store-name").val().trim();const storeNameError=$("#store-name").siblings(".error-message");if(!storeName){storeNameError.text("Store name is required.").show();isValid=false;}else if(!/^[a-zA-Z ]{1,80}$/.test(storeName)){storeNameError.text("Invalid store name. Only alphabetical characters allowed.").show();isValid=false;}else{storeNameError.text("").hide();}
20const email=$("#email").val().trim();const emailError=$("#email").siblings(".error-message");if(!email){emailError.text("Email is required.").show();isValid=false;}else if(!/^\S+@\S+\.\S+$/.test(email)){emailError.text("Please enter a valid email address (Ex: [email protected]).").show();isValid=false;}else{emailError.text("").hide();}
21const phone=$('#phone').val().trim();const phoneError=$('#phone').siblings(".error-message");if(!/^8\d{8,12}
21$/.test(phone)){phoneError.text("Phone number must start with 8 and be 9 to 13 digits longs.").show();isValid=false;}else{phoneError.text("").hide();}
22const additionalInfo=$("#additional-info").val().trim();const infoError=$("#additional-info").siblings(".error-message");if(additionalInfo&&!/^[a-zA-Z0-9 ]{1,100}$/.test(additionalInfo)){infoError.text("Invalid additional info. Only alphanumeric characters allowed").show();isValid=false;}else{infoError.text("").hide();}
23var consentValue=$('#consent').is(':checked')?'1':'0';$('input[name="consent"]').val(consentValue);if(!isValid){return false;}
24$(".mc-loading").css({'bottom':'-75px'});const data=form.serialize();$('.continue-button.booking.submit-button').prop('disabled',true);ajaxStart();$.ajax({type:'POST',url:window.location.origin+'/bookingappointments/customer/save',data:data,dataType:'json',showLoader:true,success:function(response){if(response.status===200){$('#custom-popup-modal').fadeOut();$('#popup-step-1').addClass('active').fadeIn();$('#popup-step-2').removeClass('active').hide();showSuccessPopup();}else if(response.status==="fail"&&response.code==500){alert(response.message);}},error:function(xhr,status,error){alert("An error occurred: "+error);},complete:function(){ajaxDone();$(".mc-loading").css({'bottom':'-70px'});$('.continue-button.booking.submit-button').prop('disabled',false);}});});});function reloadfunc(){location.reload(true);}
25function showSuccessPopup(){const successPopup=$(`
26                <div id="success-popup" class="confirmation-popup">
27                    <div class="popup-content">
28                        <p>Your appointment has been successfully booked! Please check your email for confirmation and further details.</p>
29                        <input type="button" id="close-success-popup" value="Close" class="action primary">
30                    </div>
31                </div>
32            `);$('.success-popup').append(successPopup);successPopup.fadeIn();$('#close-success-popup').click(function(){successPopup.fadeOut(function(){successPopup.remove();});reloadfunc();});}
33const ajaxStart=()=>$('#privilege_loading').show();const ajaxDone=()=>$('#privilege_loading').hide();function formatDate(inputDate){var dateObj=new Date(inputDate);var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var months=["January","February","March","April","May","June","July","August","September","October","November","December"];var formattedDate=days[dateObj.getDay()]+", "+
34("0"+dateObj.getDate()).slice(-2)+" "+
35months[dateObj.getMonth()]+" "+
36dateObj.getFullYear();return formattedDate;}}});});

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.