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;let a='
';a+='',a+='
Customer
',a+='
'+e.firstName+" "+e.lastName+"
",a+='
'+e.email+"
",a+="
",$("#global-search-results").append(a)}),e.orders.forEach(e=>{t=!0;let a='';a+='',a+='
Order
',a+='
'+e.orderFirstname+" "+e.orderLastname+"
",a+='
'+e.orderEmail+"
",a+="
",$("#global-search-results").append(a)}),e.products.forEach(e=>{t=!0;let a='';a+='',a+='
Product
',a+='
'+e.productTitle+"
",a+='
'+numeral(e.productPrice).format("0.00")+"
",a+="
",$("#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(),s=$("#product_optOptions").val(),i={};""!==$("#productOptions").val()&&'"{}"'!==$("#productOptions").val()&&(i=JSON.parse($("#productOptions").val()));var n='