function globalSearch(){$("#global-search-results").empty(),$.ajax({type:"POST",url:"/admin/searchall",data:{searchValue:$("#global-search-value").val()}}).done(e=>{$("#global-search").html('');let t=!1;e.customers.forEach(e=>{t=!0;const a=`\n
\n \n
Customer
\n
${e.firstName} ${e.lastName}
\n
${e.email}
\n
\n `;$("#global-search-results").append(a)}),e.orders.forEach(e=>{t=!0;const a=`\n \n \n
Order
\n
${e.orderFirstname} ${e.orderLastname}
\n
${e.orderEmail}
\n
\n `;$("#global-search-results").append(a)}),e.products.forEach(e=>{t=!0;const a=`\n \n
Product
\n
${e.productTitle}
\n
${$("#currencySymbol").val()}${numeral(e.productPrice).format("0.00")}
\n
\n `;$("#global-search-results").append(a)}),!0===t&&$("#global-search-results").removeClass("invisible")})}$(document).ready(function(){if($(document).on("click","#btnGenerateAPIkey",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/createApiKey"}).done(function(e){$("#apiKey").val(e.apiKey),showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click",".product_opt_remove",function(e){e.preventDefault();var t=$(this).closest("li").find(".opt-name").html();$.ajax({method:"POST",url:"/admin/product/removeoption",data:{productId:$("#productId").val(),optName:t}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#product_opt_add",function(e){e.preventDefault();var t=$("#product_optName").val(),a=$("#product_optLabel").val(),o=$("#product_optType").val(),i=$("#product_optOptions").val(),s={};""!==$("#productOptions").val()&&'"{}"'!==$("#productOptions").val()&&(s=JSON.parse($("#productOptions").val()));var n='