if (img.tagName.toLowerCase() === 'img') {
// If it's an img tag, just get the src attribute
bi = img.src;
} else {
// If it's a div, extract the URL from the background-image style
var style = img.currentStyle || window.getComputedStyle(img, false);
bi = style.backgroundImage.slice(4, -1).replace(/"/g, "").replace(/['"]/g, "");
}
console.log(bi);
var imageCaption = img.getAttribute('caption');
$(".woo-dialogBox").remove();
var form = document.createElement('div');
form.id = "image_parent";
var imageFileDiv = document.createElement('img');
imageFileDiv.className = "image_File_Div_modal";
imageFileDiv.src = bi;
form.appendChild(imageFileDiv);
var caption = document.createElement('span');
caption.className = "image_caption";
caption.textContent = imageCaption;
form.appendChild(caption);
var formLeft = document.createElement('div');
formLeft.className = "imageGallery_left";
var formRight = document.createElement('div');
formRight.className = "imageGallery_right";
form.appendChild(formLeft);
form.appendChild(formRight);
var nextImage = parseInt(imageIndex) + 1;
var previousImage = parseInt(imageIndex) - 1;
if (nextImage > divCount){
nextImage = 0;
}
if (previousImage < 0){
previousImage = divCount;
}
formLeft.addEventListener('click', openImage.bind(this, previousImage));
formRight.addEventListener('click', openImage.bind(this, nextImage));
makeModal(form, "woo-dialogContent_gallery");
}
function makeModal(content, extraClass){
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose';
closeBox.classList.add('material-symbols-outlined');
closeBox.addEventListener('click', closeButtonPressed);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
if (extraClass){
dialogContent.classList.add(extraClass);
}
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
}
function closeButtonPressed(){
$(".woo-dialogBox").remove();
}
function updateValues(values){
var saveLevel = property_toolbar.getSaveLevel;
switch (saveLevel){
case "instance":
typeDB = woo.instanceDB;
break;
case "page":
typeDB = woo.pageDB;
break;
case "user":
typeDB = woo.pageDB;
break;
default:
typeDB = woo.pageDB;
}
woo.updateGadgetProperty("gkxwvsqf_202631311501__577_176", typeDB, "imageFileData", values, woo.getCurrentPage()).then(() => {
loadImages();
}).catch((err) => {
console.log(err);
alert("Images not saved!");
});
}
function updateCaptions(captionNo, valueField){
imageFileData[captionNo]["caption"] = valueField.value;
console.log(imageFileData);
var saveLevel = property_toolbar.getSaveLevel;
switch (saveLevel){
case "instance":
typeDB = woo.instanceDB;
break;
case "page":
typeDB = woo.pageDB;
break;
case "user":
typeDB = woo.userDB;
break;
default:
typeDB = woo.pageDB;
}
woo.updateGadgetProperty("gkxwvsqf_202631311501__577_176", typeDB, "imageFileData", imageFileData, woo.getCurrentPage()).then(() => {
loadImages();
}).catch((err) => {
console.log(err);
alert("Images not saved!");
});
}
function editCaptions(){
$(".woo-dialogBox").remove();
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Edit Captions";
form.appendChild(title);
if (imageFileData != ""){
Object.entries(imageFileData).map((imageFile) => {
var span1 = document.createElement('span');
form.appendChild(span1);
var label1 = document.createElement('label');
label1.className = "image_caption_input_label";
label1.textContent = "Image " + imageFile[0] + " Caption:";
span1.appendChild(label1);
var idInput = document.createElement('input');
idInput.className = "image_caption_input";
idInput.type = "text";
idInput.value = imageFile[1].caption;
span1.appendChild(idInput);
var imageName = document.createElement('span');
imageName.className = "image_name_label";
imageName.append("Image: " + imageFile[1].name);
span1.appendChild(imageName);
idInput.addEventListener('focusout', updateCaptions.bind(this, imageFile[0], idInput));
idInput.addEventListener('keypress', function (e) {
if (e.key === 'Enter') {
updateCaptions(imageFile[0], idInput);
}
});
});
} else {
var Error = document.createElement('span');
Error.className = "dialog_title";
Error.textContent = "Please upload image first!";
form.appendChild(Error);
}
makeModal(form);
}
function imageFileManager(){
$(".woo-dialogBox").remove();
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Upload Image";
form.appendChild(title);;
var span1 = document.createElement('span');
form.appendChild(span1);
var label1 = document.createElement('label');
label1.textContent = "Select Image:";
span1.appendChild(label1);
var idInput = document.createElement('input');
idInput.className = "file_upload_input";
idInput.type = "file";
idInput.setAttribute("multiple","");
idInput.required = "true";
span1.appendChild(idInput);
var span2 = document.createElement('span');
form.appendChild(span2);
var submitInput = document.createElement('input');
submitInput.type = "button";
submitInput.value = "Upload";
submitInput.addEventListener('click', uploadImage.bind(this, form, idInput));
form.appendChild(submitInput);
makeModal(form);
}
function uploadImage(form, idInput){
var formData = new FormData();
formData.append("name", "Images");
var fileLength = 0;
if (imageFileData != "") {
fileLength = Object.keys(imageFileData).length;
} else {
imageFileData = {};
}
for(let i = fileLength; i < (idInput.files.length + fileLength); i++) {
formData.append("files", idInput.files[i - fileLength]);
imageFileData[i] = {};
imageFileData[i]["name"] = idInput.files[i - fileLength].name;
imageFileData[i]["caption"] = "";
}
uploadFiles(formData).then((response) => {
console.log(response);
updateValues(imageFileData);
alert(response);
$(".woo-dialogBox").remove();
}).catch((error) => {
console.log(error);
alert("Something went wrong");
});
}
function uploadFiles(formData) {
console.log(formData);
return $.ajax({
type: "POST",
url: woo.getAuthServer() + "/app/upload_Files",
headers: {
//"Content-Type": "multipart/form-data",
"Authorization": "Bearer " + woo.sessionData.token + ":" + woo.sessionData.password
},
xhrFields: {
withCredentials: true
},
processData: false,
contentType: false,
crossDomain: true,
cache: false,
data: formData,
timeout: 10000
});
}
loadImages();
gkxwvsqf_202631311501__577_176_Global.imageFileManager = () => {
imageFileManager();
}
gkxwvsqf_202631311501__577_176_Global.editCaptions = () => {
editCaptions();
}
return gkxwvsqf_202631311501__577_176_Global;
})();
var login_734v0t = (function() {
var login_734v0t_Global = {};
var loginDom = document.getElementById('login-text_login_734v0t');
var loginDomMob = document.getElementById('mob_icon_login_734v0t');
var loggedIn = false;
var loggingInOrOut = false;
var openModal = false;
var whatIs = document.querySelector(".woo_whatIsWooID_login_734v0t");
var forgotPass = document.querySelector(".forgot_pass_login_734v0t");
function getAppData(){
return new Promise((resolve) => {
var url = woo.getRemoteCouch() + "/licious$public/licious-invoice-settings";
var data = {}
resolve(woo.queryCouch(url, "GET", data));
}).catch((error) => {
return null;
});
}
getAppData().then((data) => {
if (data){
$("#login_734v0t .website_name").html(data.brandName);
$("#login_734v0t #fullLogoImage").attr("src", "/resources/licious/uploads/" + data.logoImage);
}
})
function forgotPass_login_734v0t(){
woo.updateCurrentPage("forgot-password");
}
function whatIsClick_login_734v0t(){
var note = "What is the Woo ID? With a growing awareness of on-line privacy and security issues, further tightening of the spam laws worldwide and the need for businesses to have more robust collection of data systems in place, Woo has risen to the challenge by creating a universal ID for users on the platform - called a Woo ID.
The Woo ID provides you with the security that Woo is dedicated, and bound by law, to ensure your information is kept private and that all anti-spam laws are adhered to. Every user added to a Woo website gets to verify their email address. This ensures issues with data entry and out-of-date email accounts are spotted early.
The Woo ID universal ID is the market leader: creating a safe and spam free environment for you.
Read more about Woo and their Privacy Policy
";
var message = $("" + note + "
OK
")
.appendTo("body").slideDown('normal');
$(message).click(function(){
$(this).slideUp('normal', function(){
$(this).remove();
});
});
}
function closeButtonPressed_login_734v0t(){
$(".woo-dialogBox").hide();
loggingInOrOut = false;
openModal = false;
}
function makeModal_login_734v0t(content){
openModal = true;
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose';
closeBox.classList.add('material-symbols-outlined');
closeBox.addEventListener('click', closeButtonPressed_login_734v0t);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
}
function login_login_734v0t(usernameElem, passwordElem){
woo.execLogin(usernameElem.value, passwordElem.value).then(() => {
$(".woo-dialogBox").hide();
openModal = false;
}).catch((error) => {
loggingInOrOut = false;
//alert("User name or password is incorrect. Please try again.");
$(".wooMainContent #woo_loginErrorMessage").css("display", "block");
});
}
function register_login_734v0t(){
woo.updateCurrentPage("register");
}
function loginOnClick_login_734v0t(){
if (loggingInOrOut == false) {
loggingInOrOut = true;
if (!loggedIn){
if ($(".woo-dialogBox").length){
$(".woo-dialogBox").show();
} else {
var signinModal = document.querySelector("#signinModal_login_734v0t");
var usernameInput = document.querySelector("#wooUsername_login_734v0t");
var passwordInput = document.querySelector("#wooPassword_login_734v0t");
document.querySelector(".woo_logIn_login_734v0t").addEventListener('click', login_login_734v0t.bind(this, usernameInput, passwordInput));
document.querySelector(".woo_signUp_login_734v0t").addEventListener('click', register_login_734v0t.bind(this));
makeModal_login_734v0t(signinModal);
}
} else {
woo.execLogout();
}
}
}
function changeLoginState_login_734v0t(loginState){
if(!loginState){
loggedIn = false;
loginDom.innerHTML = "login";
loginDomMob.innerHTML = "lock";
}
else {
loggedIn = true;
loginDom.innerHTML = "logout";
loginDomMob.innerHTML = "lock_open";
}
}
function addEventListeners_login_734v0t() {
if (woo.sessionData != null){
changeLoginState_login_734v0t(true);
}
else {
changeLoginState_login_734v0t(false);
}
loginDomMob.addEventListener('click', loginOnClick_login_734v0t, false);
loginDom.addEventListener('click', loginOnClick_login_734v0t, false);
whatIs.addEventListener('click', whatIsClick_login_734v0t, false);
forgotPass.addEventListener('click', forgotPass_login_734v0t, false);
}
addEventListeners_login_734v0t();
login_734v0t_Global.unload = () => {
//Unload callbacks here
loginDomMob.removeEventListener('click', loginOnClick_login_734v0t, false);
loginDom.removeEventListener('click', loginOnClick_login_734v0t, false);
whatIs.removeEventListener('click', whatIsClick_login_734v0t, false);
forgotPass.removeEventListener('click', forgotPass_login_734v0t, false);
//document.querySelector(".woo_logIn_login_734v0t").removeEventListener('click', login_login_734v0t);
//document.querySelector(".woo_signUp_login_734v0t").removeEventListener('click', register_login_734v0t);
console.log("Unloaded login_734v0t");
}
return login_734v0t_Global;
})(); var gkxwvsqf_202382802446_7342kp = (function() {
var self = document.getElementById('gkxwvsqf_202382802446_7342kp');
var gkxwvsqf_202382802446_7342kp_Global = {};
var unloadPromise;
gkxwvsqf_202382802446_7342kp_Global.unload = () => {
return new Promise((resolve, reject) => {
//Unload callbacks here
if (unloadPromise){
unloadPromise.then(() => {
resolve("done");
}).catch((error) => {
reject(error);
});
} else {
resolve("done");
}
woo.events.off("Page Added", recreate);
woo.events.off("Page Deleted", recreate);
woo.events.off("Page Hidden", recreate);
woo.events.off("Page Unhidden", recreate);
woo.events.off("Page Linked", recreate);
woo.events.off("Page Unlinked", recreate);
woo.events.off("Page Order Updated", recreate);
woo.events.off("Page Parent Updated", recreate);
woo.events.off("Page pageName Updated", recreate);
console.log("Unloaded gkxwvsqf_202382802446_7342kp");
});
}
woo.events.on("Page Added", recreate);
woo.events.on("Page Deleted", recreate);
woo.events.on("Page Hidden", recreate);
woo.events.on("Page Unhidden", recreate);
woo.events.on("Page Linked", recreate);
woo.events.on("Page Unlinked", recreate);
woo.events.on("Page Order Updated", recreate);
woo.events.on("Page Parent Updated", recreate);
woo.events.on("Page pageName Updated", recreate);
function recreate(){
unloadPromise = createFullULMenu().then(() => {
console.log("boy oh boy a lincoln toy!");
createFullULMenu();
}).catch((error) => {
console.log("Menu not created! " + error);
});
}
$("#mob_icon_gkxwvsqf_202382802446_7342kp").on("click", function(){
$("#mainMenuContent_gkxwvsqf_202382802446_7342kp").toggle();
});
checkBuild();
gkxwvsqf_202382802446_7342kp_Global.createMenu = () => {
createFullULMenu().then(() => {
}).catch((error) => {
console.error(error);
});
}
function checkBuild(){
return new Promise((resolve, reject) => {
woo.getGadgetProperty("gkxwvsqf_202382802446_7342kp", woo.instanceDB, "toolbarBuild").then((propValue) => {
if (!propValue){
createFullULMenu();
}
resolve("done");
}).catch((error) => {
reject(error);
});
}).catch((error) => {
console.error(error);
});
}
var showPage ='home';
var pageCount = 0;
function getChildrenByKey(obj, key) {
if (obj[key]) {
return obj[key].children || {};
}
for (let k in obj) {
if (obj[k] && typeof obj[k] === 'object') {
const result = getChildrenByKey(obj[k].children || {}, key);
if (result) {
return result;
}
}
}
return null; // Key not found
}
function createFullULMenu(){
return new Promise((resolve, reject) => {
$("#mainMenuContent_gkxwvsqf_202382802446_7342kp").empty();
var form = document.querySelector("#mainMenuContent_gkxwvsqf_202382802446_7342kp");
var allHtml = {};
var pages = {};
var rootPage = "";
woo.getFullPageStructure().then((response) => {
//console.log(response);
if ("home" == "home"){
rootPage = Object.keys(response)[0];
pages = response[rootPage].children;
} else {
rootPage = Object.keys(response)[0];
pages = getChildrenByKey(response, "home");
//pages = response[rootPage].children["home"].children;
}
//console.log(pages);
var promises = Object.entries(pages).map((node) => {
if (node[1]["props"].hidden == false){
return createPageNode(node, 1).then((gadgetHtml) => {
allHtml[node[0]] = gadgetHtml;
});
}
});
return Promise.all(promises);
}).then(() => {
var pageListUL = document.createElement('ul');
pageListUL.className = "menuUl1";
if (Object.keys(allHtml).length != 0) {
Object.entries(pages).forEach((entry) => {
if (allHtml[entry[0]]){
pageListUL.appendChild(allHtml[entry[0]]);
}
});
}
form.appendChild(pageListUL);
var str = form.innerHTML;
woo.updateGadgetProperty("gkxwvsqf_202382802446_7342kp", woo.instanceDB, "toolbarBuild", str, woo.getCurrentPage()).then(() => {
$(".menuClick_gkxwvsqf_202382802446_7342kp").unbind();
$(".menuClick_gkxwvsqf_202382802446_7342kp").on("click", function(){
if ($(this).attr("linked") == "true"){
if ($(this).attr("linkID") != ""){
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("linkID");
setTimeout(animatePageIn, 0);
} else {
window.location = $(this).attr("linkURL");
}
} else {
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("showPage");
setTimeout(animatePageIn, 0);
}
});
resolve("done");
}).catch((err) => {
//alert("Gadget value not saved! " + err);
reject(error);
});
}).catch((error) => {
console.error(error);
reject(error);
});
});
}
function createPageNode(page, level){
return new Promise((resolve) => {
//create li
var pageLI = document.createElement('li');
if (level == 1){
pageLI.className = "menuLi1";
} else if (level == 2){
pageLI.className = "menuLi2";
} else {
pageLI.className = "menuLi3";
}
pageLI.classList.add("menuLlX");
var menuMouseOverID = page[0];
pageLI.id = menuMouseOverID;
if (level == 1){
var nameSpanOuter = document.createElement('span');
nameSpanOuter.className = "woo_menuName_outer";
var nameUnderLineSpan = document.createElement('span');
nameUnderLineSpan.className = "woo_menuName_underline";
nameUnderLineSpan.id = "woo_menuName_underline_" + page[0];
}
var nameSpan = document.createElement('button');
if (level == 1){
nameSpan.className = "woo_menuName";
} else {
nameSpan.className = "woo_subMenuName";
}
nameSpan.classList.add("menuClick_gkxwvsqf_202382802446_7342kp");
console.log("pageCount: " + pageCount + ", odd/even: " + (pageCount % 2));
if ((pageCount % 2) != 1) {
nameSpan.classList.add("oddPage");
}
pageCount++;
nameSpan.innerText = page[1]["props"].name;
console.log(page[1]["props"].name + " : " + page[1]["props"].linked);
if (page[1]["props"].linked == "true" || page[1]["props"].linked == true){
nameSpan.setAttribute("linked", page[1]["props"].linked);
nameSpan.setAttribute("linkID", page[1]["props"].linkID);
nameSpan.setAttribute("linkURL", page[1]["props"].linkURL);
} else {
nameSpan.setAttribute("showPage", page[0]);
}
nameSpan.setAttribute("menuid", page[0]);
if (level == 1){
nameSpanOuter.appendChild(nameSpan);
nameSpanOuter.appendChild(nameUnderLineSpan);
pageLI.appendChild(nameSpanOuter);
} else {
pageLI.appendChild(nameSpan);
}
var childPagesHtml = {};
var children = page[1].children;
var subLevel = level + 1;
var promises = Object.entries(children).map((childNode) => {
if (subLevel <= 10){
if (childNode[1]["props"].hidden == false){
return createPageNode(childNode, subLevel).then((childHtml) => {
childPagesHtml[childNode[0]] = childHtml;
});
}
}
});
Promise.all(promises).then(() => {
if (Object.keys(page[1]["children"]).length != 0){
var pageListULNext = document.createElement('ul');
if (level == 1){
pageListULNext.className = "menuUl2";
} else {
pageListULNext.className = "menuUl3";
}
pageListULNext.classList.add("menuUlX");
var childCount = 0;
Object.entries(children).forEach((entry) => {
if (childPagesHtml[entry[0]]){
childCount++;
pageListULNext.appendChild(childPagesHtml[entry[0]]);
}
});
if (childCount > 0){
pageLI.appendChild(pageListULNext);
}
}
resolve(pageLI);
});
});
}
function cleanPageNameForUrl(pageName) {
// Convert to lowercase
let url = pageName.toLowerCase();
// Replace spaces with dashes
url = url.replace(/\s+/g, '-');
// Remove all special characters except dashes and alphanumeric characters
url = url.replace(/[^a-z0-9-]/g, '');
// Remove multiple consecutive dashes
url = url.replace(/-+/g, '-');
// Remove leading and trailing dashes
url = url.replace(/^-|-$/g, '');
return url;
}
var currentPageId = woo.getCurrentPage();
$("#gkxwvsqf_202382802446_7342kp .woo_menuName").each(function(){
if (currentPageId == cleanPageNameForUrl($(this).text())){
$(this).css({"background-color": "#ed1c24", "color" : "#ffffff"});
}
});
$(".menuClick_gkxwvsqf_202382802446_7342kp").on("click", function(){
if ($(this).attr("linked")){
if ($(this).attr("linkID") != ""){
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("linkID");
setTimeout(animatePageIn, 0);
} else {
window.location = $(this).attr("linkURL");
}
} else {
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("showPage");
setTimeout(animatePageIn, 0);
}
});
$("#gkxwvsqf_202382802446_7342kp .parentPage_gkxwvsqf_202382802446_7342kp .menuClick_gkxwvsqf_202382802446_7342kp").unbind();
$("#gkxwvsqf_202382802446_7342kp .parentPage_gkxwvsqf_202382802446_7342kp").on("click", function(){
var burgerMenuId = $("#gkxwvsqf_202382802446_7342kp").parents(".burger_menu").attr("id");
//var subMenuNode = $(this).children("li > ul");
var subMenu = this.querySelector("li > ul").cloneNode(true);
//var subMenu = subMenuNode.cloneNode(true);
console.log(burgerMenuId);
window[burgerMenuId].changeSubPage($(this).attr("id"), 'gkxwvsqf_202382802446_7342kp', subMenu, 0, 0);
});
function animatePageIn() {
Promise.all([woo.updateCurrentPage(showPage)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
$('body').removeClass("pageAnimateIn").addClass("pageAnimateOut");
});
}
gkxwvsqf_202382802446_7342kp_Global.animateMenuIn = () => {
animateMenuIn();
};
function animateMenuIn(){
$("#gkxwvsqf_202382802446_7342kp .woo_menuName").removeClass("animateMenuOut").addClass("animateMenuIn");
}
gkxwvsqf_202382802446_7342kp_Global.animateMenuOut = () => {
animateMenuOut();
};
function animateMenuOut(){
$("#gkxwvsqf_202382802446_7342kp .woo_menuName").removeClass("animateMenuIn").addClass("animateMenuOut");
}
return gkxwvsqf_202382802446_7342kp_Global;
})(); var gkxwvsqf_202392093827_735263 = (function() {
var self = document.getElementById('gkxwvsqf_202392093827_735263');
var gkxwvsqf_202392093827_735263_Global = {};
gkxwvsqf_202392093827_735263_Global.unload = () => {
//Unload callbacks here
window.removeEventListener("scroll", gkxwvsqf_202392093827_735263Reveal);
console.log("Unloaded gkxwvsqf_202392093827_735263");
}
function gkxwvsqf_202392093827_735263Reveal() {
var reveals = document.querySelector("#gkxwvsqf_202392093827_735263 .reveal");
var windowHeight = window.innerHeight;
var elementTop = reveals.getBoundingClientRect().top;
var elementVisible = 150;
if (elementTop < windowHeight - elementVisible) {
reveals.classList.add("active");
self.classList.add("gkxwvsqf_202392093827_735263ShadowReveal");
self.classList.remove("gkxwvsqf_202392093827_735263ShadowRevealOff");
} else {
reveals.classList.remove("active");
self.classList.remove("gkxwvsqf_202392093827_735263ShadowReveal");
self.classList.add("gkxwvsqf_202392093827_735263ShadowRevealOff");
}
}
if ("home" != "" || "Change_Page" == "Open_Image_in_New_Window"){
$("#gkxwvsqf_202392093827_735263 .mainImage").css("cursor", "pointer");
$("#gkxwvsqf_202392093827_735263 .mainImage").on("click", function(){
switch ("Change_Page"){
case "Change_Page":
woo.updateCurrentPage("home");
break;
case "External_Link":
window.location("home");
break;
case "Open_Image_in_New_Window":
window.open("/resources/licious/uploads/licious-full-logo-white-back.png");
break;
default:
console.error("No link option selected");
}
});
}
gkxwvsqf_202392093827_735263_Global.animateMenuIn = () => {
animateMenuIn();
};
function animateMenuIn(){
$("#gkxwvsqf_202392093827_735263 .imageWrapper").removeClass("animateMenuOut").addClass("animateMenuIn");
}
gkxwvsqf_202392093827_735263_Global.animateMenuOut = () => {
animateMenuOut();
};
function animateMenuOut(){
$("#gkxwvsqf_202392093827_735263 .imageWrapper").removeClass("animateMenuIn").addClass("animateMenuOut");
}
return gkxwvsqf_202392093827_735263_Global;
})(); var gkxwvsqf_202548114144_147 = (function() {
var self = document.getElementById('gkxwvsqf_202548114144_147');
var gkxwvsqf_202548114144_147_Global = {};
function closeButtonPressed(){
$(".woo-dialogBox").remove();
openModal = false;
}
function makeModal(content, modalWidth){
return new Promise((resolve) => {
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose material-symbols-outlined';
closeBox.addEventListener('click', closeButtonPressed);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
if (modalWidth) dialogContent.style.width = modalWidth;
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
resolve("Modal Made");
});
}
function setCookie(name, value, days) {
var expires = days ? "; expires=" + new Date(Date.now() + days * 24 * 60 * 60 * 1000).toUTCString() : "";
var safeValue = JSON.parse(JSON.stringify(value)); // deep clone
document.cookie = name + "=" + encodeURIComponent(JSON.stringify(safeValue)) + expires + "; path=/";
console.log("✅ COOKIE SAVED —", safeValue.items.length, "items");
}
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length === 2) {
var parsed = JSON.parse(decodeURIComponent(parts.pop().split(";").shift()));
console.log("📥 COOKIE LOADED —", parsed.items.length, "items");
return parsed;
}
console.log("📥 COOKIE empty");
return { items: [] };
}
var invoiceSettingsData;
function formatDollar(value) {
if (value === -2 || value == "-2" || value === "POA") return "POA";
var tlS = invoiceSettingsData ? invoiceSettingsData.defaultCurrencyTLS : "en-NZ";
var code = invoiceSettingsData ? invoiceSettingsData.defaultCurrencyType : "NZD";
return parseFloat(value).toLocaleString(tlS, {
style: 'currency',
currency: code,
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
}
function getInvoiceSettings(){
return new Promise((resolve) => {
var url = woo.getRemoteCouch() + "/" + woo.getAppID() + "$public/" + woo.getAppID() + "-invoice-settings";
resolve(woo.queryCouch(url, "GET", {}));
});
}
async function showCart(cart) {
invoiceSettingsData = await getInvoiceSettings();
$(".woo-dialogBox").remove();
console.log("=== SHOW CART — rendering", cart.items.length, "items ===");
var form = document.createElement('div');
var title = document.createElement('span');
title.className = "dialog_title";
title.textContent = "Shopping Cart";
title.style.textAlign = "center";
form.appendChild(title);
var spanAbout = document.createElement('span');
spanAbout.className = "woo_shoppingCart";
var html = ' ';
html += '';
html += 'Name ';
html += 'Price ';
html += 'Qty ';
html += 'Total ';
html += ' ';
html += ' ';
var grandTotal = 0;
if (!cart.items || cart.items.length === 0) {
html += 'Your cart is empty ';
} else {
for (var i = 0; i < cart.items.length; i++) {
var item = cart.items[i];
var price = parseFloat(item.productPrice) || 0;
var qty = parseInt(item.productQty, 10) || 1;
var total = (price === -2) ? "POA" : (price * qty);
if (price !== -2) grandTotal += parseFloat(total);
var description = "" + escapeHtml(item.productName || 'Unknown') + " ";
if (item.forVariation) description += " " + escapeHtml(item.forVariation);
html += '';
html += '' + description + ' ';
html += '' + formatDollar(price) + ' ';
html += '' + qty + ' ';
html += '' + (price === -2 ? "POA" : formatDollar(total)) + ' ';
html += '';
html += 'delete ';
html += ' ';
html += ' ';
}
}
if ("false" == "false"){
html += 'Sub Total ';
html += '' + formatDollar(grandTotal) + ' ';
html += '' + invoiceSettingsData.salesTaxName + ' ';
html += '' + formatDollar(grandTotal * (parseFloat(invoiceSettingsData.salesTaxPercent)/100)) + ' ';
html += 'Total ';
html += '' + formatDollar(grandTotal + (grandTotal * (parseFloat(invoiceSettingsData.salesTaxPercent)/100))) + ' ';
} else{
html += 'Total ';
html += '' + formatDollar(grandTotal) + ' ';
}
html += '
';
html += '
Clear Cart Checkout ';
spanAbout.innerHTML = html;
form.appendChild(spanAbout);
makeModal(form);
}
function escapeHtml(str) {
var div = document.createElement('div');
div.textContent = str;
return div.innerHTML;
}
function getCart(showCartFlag = false) {
var cart = getCookie("shoppingCart");
if (!cart) cart = { items: [] };
if (showCartFlag) showCart(cart);
return cart;
}
function clearCart() {
const cart = { items: [] };
setCookie('shoppingCart', cart, 7);
getTotalItems();
showCart(cart);
return cart;
}
function getTotalItems() {
var cart = getCookie("shoppingCart") || { items: [] };
const totalItems = cart.items.reduce((sum, item) => sum + parseInt(item.productQty || 0, 10), 0);
$(".totalCartItems").text(totalItems);
console.log("Badge updated to", totalItems);
}
function removeFromCart(uniqueKey) {
const cart = getCart();
cart.items = cart.items.filter(item => (item.uniqueKey || item.stockCode) !== uniqueKey);
setCookie('shoppingCart', cart, 7);
getTotalItems();
showCart(cart);
return cart;
}
function addToCart(items) {
if (!Array.isArray(items)) items = [items];
console.log("=== ADD TO CART STARTED ===");
let cart = getCart(false); // always fresh
items.forEach((item, idx) => {
if (!item || !item.stockCode) return;
const searchKey = item.uniqueKey || item.stockCode;
console.log(`Processing item ${idx} - key:`, searchKey);
const existingIndex = cart.items.findIndex(i => (i.uniqueKey || i.stockCode) === searchKey);
if (existingIndex !== -1) {
console.log("→ Found existing - incrementing");
const existing = cart.items[existingIndex];
const newQty = parseInt(existing.productQty, 10) + parseInt(item.productQty, 10);
existing.productQty = String(newQty);
existing.productTotal = (parseFloat(existing.productPrice) * newQty).toFixed(2);
} else {
console.log("→ New item - pushing");
const qty = parseInt(item.productQty, 10) || 1;
const price = parseFloat(item.productPrice) || 0;
const newItem = {
uniqueKey: item.uniqueKey || item.stockCode,
stockCode: item.stockCode,
productName: item.productName || "Unknown",
productPrice: item.productPrice || "0",
appId: item.appId || "",
//longDescription: item.longDescription || "",
forVariation: item.forVariation || null,
productQty: String(qty),
productTotal: (price * qty).toFixed(2),
subscriptionId: item.subscriptionId || null
};
cart.items.push(newItem);
}
});
console.log("Final cart before save:", JSON.stringify(cart, null, 2));
setCookie('shoppingCart', cart, 7);
// Force refresh everything
getTotalItems();
showCart(getCart(false));
console.log("=== ADD TO CART FINISHED ===");
}
$(document).on("click", "#checkout", function(){
console.log("=== CHECKOUT CLICKED ===");
const currentCart = getCart(false);
setCookie('shoppingCart', currentCart, 7);
woo.updateCurrentPage("checkout");
});
$(document).on("click", ".delete-item", function(){
var uniqueKey = $(this).attr("data-unique-key");
removeFromCart(uniqueKey);
});
$(".totalCartItems, #cartIcon").on("click", function() {
getCart(true);
});
$(document).on("click", "#clearCart", clearCart);
gkxwvsqf_202548114144_147_Global.addToCart = (item) => addToCart(item);
gkxwvsqf_202548114144_147_Global.removeFromCart = (key) => removeFromCart(key);
gkxwvsqf_202548114144_147_Global.clearCart = clearCart;
gkxwvsqf_202548114144_147_Global.updateTotal = getTotalItems;
gkxwvsqf_202548114144_147_Global.unload = () => {
$(document).off("click", "#checkout");
$(document).off("click", ".delete-item");
$(".totalCartItems, #cartIcon").off("click");
$(document).off("click", "#clearCart");
console.log("Unloaded gkxwvsqf_202548114144_147");
};
getTotalItems();
return gkxwvsqf_202548114144_147_Global;
})();
var login_73863g = (function() {
var login_73863g_Global = {};
var loginDom = document.getElementById('login-text_login_73863g');
var loginDomMob = document.getElementById('mob_icon_login_73863g');
var loggedIn = false;
var loggingInOrOut = false;
var openModal = false;
var whatIs = document.querySelector(".woo_whatIsWooID_login_73863g");
var forgotPass = document.querySelector(".forgot_pass_login_73863g");
function getAppData(){
return new Promise((resolve) => {
var url = woo.getRemoteCouch() + "/licious$public/licious-invoice-settings";
var data = {}
resolve(woo.queryCouch(url, "GET", data));
}).catch((error) => {
return null;
});
}
getAppData().then((data) => {
if (data){
$("#login_73863g .website_name").html(data.brandName);
$("#login_73863g #fullLogoImage").attr("src", "/resources/licious/uploads/" + data.logoImage);
}
})
function forgotPass_login_73863g(){
woo.updateCurrentPage("forgot-password");
}
function whatIsClick_login_73863g(){
var note = "What is the Woo ID? With a growing awareness of on-line privacy and security issues, further tightening of the spam laws worldwide and the need for businesses to have more robust collection of data systems in place, Woo has risen to the challenge by creating a universal ID for users on the platform - called a Woo ID.
The Woo ID provides you with the security that Woo is dedicated, and bound by law, to ensure your information is kept private and that all anti-spam laws are adhered to. Every user added to a Woo website gets to verify their email address. This ensures issues with data entry and out-of-date email accounts are spotted early.
The Woo ID universal ID is the market leader: creating a safe and spam free environment for you.
Read more about Woo and their Privacy Policy
";
var message = $("" + note + "
OK
")
.appendTo("body").slideDown('normal');
$(message).click(function(){
$(this).slideUp('normal', function(){
$(this).remove();
});
});
}
function closeButtonPressed_login_73863g(){
$(".woo-dialogBox").hide();
loggingInOrOut = false;
openModal = false;
}
function makeModal_login_73863g(content){
openModal = true;
var dialogBox = document.createElement('div');
dialogBox.className = "woo-dialogBox";
document.getElementsByClassName("wooMainContent")[0].appendChild(dialogBox);
var closeBox = document.createElement('button');
closeBox.className = 'woo-dialogClose';
closeBox.classList.add('material-symbols-outlined');
closeBox.addEventListener('click', closeButtonPressed_login_73863g);
var dialogContent = document.createElement('div');
dialogContent.className = "woo-dialogContent";
dialogContent.appendChild(closeBox);
dialogContent.appendChild(content);
dialogBox.appendChild(dialogContent);
}
function login_login_73863g(usernameElem, passwordElem){
woo.execLogin(usernameElem.value, passwordElem.value).then(() => {
$(".woo-dialogBox").hide();
openModal = false;
}).catch((error) => {
loggingInOrOut = false;
//alert("User name or password is incorrect. Please try again.");
$(".wooMainContent #woo_loginErrorMessage").css("display", "block");
});
}
function register_login_73863g(){
woo.updateCurrentPage("register");
}
function loginOnClick_login_73863g(){
if (loggingInOrOut == false) {
loggingInOrOut = true;
if (!loggedIn){
if ($(".woo-dialogBox").length){
$(".woo-dialogBox").show();
} else {
var signinModal = document.querySelector("#signinModal_login_73863g");
var usernameInput = document.querySelector("#wooUsername_login_73863g");
var passwordInput = document.querySelector("#wooPassword_login_73863g");
document.querySelector(".woo_logIn_login_73863g").addEventListener('click', login_login_73863g.bind(this, usernameInput, passwordInput));
document.querySelector(".woo_signUp_login_73863g").addEventListener('click', register_login_73863g.bind(this));
makeModal_login_73863g(signinModal);
}
} else {
woo.execLogout();
}
}
}
function changeLoginState_login_73863g(loginState){
if(!loginState){
loggedIn = false;
loginDom.innerHTML = "login";
loginDomMob.innerHTML = "lock";
}
else {
loggedIn = true;
loginDom.innerHTML = "logout";
loginDomMob.innerHTML = "lock_open";
}
}
function addEventListeners_login_73863g() {
if (woo.sessionData != null){
changeLoginState_login_73863g(true);
}
else {
changeLoginState_login_73863g(false);
}
loginDomMob.addEventListener('click', loginOnClick_login_73863g, false);
loginDom.addEventListener('click', loginOnClick_login_73863g, false);
whatIs.addEventListener('click', whatIsClick_login_73863g, false);
forgotPass.addEventListener('click', forgotPass_login_73863g, false);
}
addEventListeners_login_73863g();
login_73863g_Global.unload = () => {
//Unload callbacks here
loginDomMob.removeEventListener('click', loginOnClick_login_73863g, false);
loginDom.removeEventListener('click', loginOnClick_login_73863g, false);
whatIs.removeEventListener('click', whatIsClick_login_73863g, false);
forgotPass.removeEventListener('click', forgotPass_login_73863g, false);
//document.querySelector(".woo_logIn_login_73863g").removeEventListener('click', login_login_73863g);
//document.querySelector(".woo_signUp_login_73863g").removeEventListener('click', register_login_73863g);
console.log("Unloaded login_73863g");
}
return login_73863g_Global;
})(); var gkxwvsqf_202382802446_738z2r = (function() {
var self = document.getElementById('gkxwvsqf_202382802446_738z2r');
var gkxwvsqf_202382802446_738z2r_Global = {};
var unloadPromise;
gkxwvsqf_202382802446_738z2r_Global.unload = () => {
return new Promise((resolve, reject) => {
//Unload callbacks here
if (unloadPromise){
unloadPromise.then(() => {
resolve("done");
}).catch((error) => {
reject(error);
});
} else {
resolve("done");
}
woo.events.off("Page Added", recreate);
woo.events.off("Page Deleted", recreate);
woo.events.off("Page Hidden", recreate);
woo.events.off("Page Unhidden", recreate);
woo.events.off("Page Linked", recreate);
woo.events.off("Page Unlinked", recreate);
woo.events.off("Page Order Updated", recreate);
woo.events.off("Page Parent Updated", recreate);
woo.events.off("Page pageName Updated", recreate);
console.log("Unloaded gkxwvsqf_202382802446_738z2r");
});
}
woo.events.on("Page Added", recreate);
woo.events.on("Page Deleted", recreate);
woo.events.on("Page Hidden", recreate);
woo.events.on("Page Unhidden", recreate);
woo.events.on("Page Linked", recreate);
woo.events.on("Page Unlinked", recreate);
woo.events.on("Page Order Updated", recreate);
woo.events.on("Page Parent Updated", recreate);
woo.events.on("Page pageName Updated", recreate);
function recreate(){
unloadPromise = createFullULMenu().then(() => {
console.log("boy oh boy a lincoln toy!");
createFullULMenu();
}).catch((error) => {
console.log("Menu not created! " + error);
});
}
$("#mob_icon_gkxwvsqf_202382802446_738z2r").on("click", function(){
$("#mainMenuContent_gkxwvsqf_202382802446_738z2r").toggle();
});
checkBuild();
gkxwvsqf_202382802446_738z2r_Global.createMenu = () => {
createFullULMenu().then(() => {
}).catch((error) => {
console.error(error);
});
}
function checkBuild(){
return new Promise((resolve, reject) => {
woo.getGadgetProperty("gkxwvsqf_202382802446_738z2r", woo.instanceDB, "toolbarBuild").then((propValue) => {
if (!propValue){
createFullULMenu();
}
resolve("done");
}).catch((error) => {
reject(error);
});
}).catch((error) => {
console.error(error);
});
}
var showPage ='home';
var pageCount = 0;
function getChildrenByKey(obj, key) {
if (obj[key]) {
return obj[key].children || {};
}
for (let k in obj) {
if (obj[k] && typeof obj[k] === 'object') {
const result = getChildrenByKey(obj[k].children || {}, key);
if (result) {
return result;
}
}
}
return null; // Key not found
}
function createFullULMenu(){
return new Promise((resolve, reject) => {
$("#mainMenuContent_gkxwvsqf_202382802446_738z2r").empty();
var form = document.querySelector("#mainMenuContent_gkxwvsqf_202382802446_738z2r");
var allHtml = {};
var pages = {};
var rootPage = "";
woo.getFullPageStructure().then((response) => {
//console.log(response);
if ("home" == "home"){
rootPage = Object.keys(response)[0];
pages = response[rootPage].children;
} else {
rootPage = Object.keys(response)[0];
pages = getChildrenByKey(response, "home");
//pages = response[rootPage].children["home"].children;
}
//console.log(pages);
var promises = Object.entries(pages).map((node) => {
if (node[1]["props"].hidden == false){
return createPageNode(node, 1).then((gadgetHtml) => {
allHtml[node[0]] = gadgetHtml;
});
}
});
return Promise.all(promises);
}).then(() => {
var pageListUL = document.createElement('ul');
pageListUL.className = "menuUl1";
if (Object.keys(allHtml).length != 0) {
Object.entries(pages).forEach((entry) => {
if (allHtml[entry[0]]){
pageListUL.appendChild(allHtml[entry[0]]);
}
});
}
form.appendChild(pageListUL);
var str = form.innerHTML;
woo.updateGadgetProperty("gkxwvsqf_202382802446_738z2r", woo.instanceDB, "toolbarBuild", str, woo.getCurrentPage()).then(() => {
$(".menuClick_gkxwvsqf_202382802446_738z2r").unbind();
$(".menuClick_gkxwvsqf_202382802446_738z2r").on("click", function(){
if ($(this).attr("linked") == "true"){
if ($(this).attr("linkID") != ""){
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("linkID");
setTimeout(animatePageIn, 0);
} else {
window.location = $(this).attr("linkURL");
}
} else {
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("showPage");
setTimeout(animatePageIn, 0);
}
});
resolve("done");
}).catch((err) => {
//alert("Gadget value not saved! " + err);
reject(error);
});
}).catch((error) => {
console.error(error);
reject(error);
});
});
}
function createPageNode(page, level){
return new Promise((resolve) => {
//create li
var pageLI = document.createElement('li');
if (level == 1){
pageLI.className = "menuLi1";
} else if (level == 2){
pageLI.className = "menuLi2";
} else {
pageLI.className = "menuLi3";
}
pageLI.classList.add("menuLlX");
var menuMouseOverID = page[0];
pageLI.id = menuMouseOverID;
if (level == 1){
var nameSpanOuter = document.createElement('span');
nameSpanOuter.className = "woo_menuName_outer";
var nameUnderLineSpan = document.createElement('span');
nameUnderLineSpan.className = "woo_menuName_underline";
nameUnderLineSpan.id = "woo_menuName_underline_" + page[0];
}
var nameSpan = document.createElement('button');
if (level == 1){
nameSpan.className = "woo_menuName";
} else {
nameSpan.className = "woo_subMenuName";
}
nameSpan.classList.add("menuClick_gkxwvsqf_202382802446_738z2r");
console.log("pageCount: " + pageCount + ", odd/even: " + (pageCount % 2));
if ((pageCount % 2) != 1) {
nameSpan.classList.add("oddPage");
}
pageCount++;
nameSpan.innerText = page[1]["props"].name;
console.log(page[1]["props"].name + " : " + page[1]["props"].linked);
if (page[1]["props"].linked == "true" || page[1]["props"].linked == true){
nameSpan.setAttribute("linked", page[1]["props"].linked);
nameSpan.setAttribute("linkID", page[1]["props"].linkID);
nameSpan.setAttribute("linkURL", page[1]["props"].linkURL);
} else {
nameSpan.setAttribute("showPage", page[0]);
}
nameSpan.setAttribute("menuid", page[0]);
if (level == 1){
nameSpanOuter.appendChild(nameSpan);
nameSpanOuter.appendChild(nameUnderLineSpan);
pageLI.appendChild(nameSpanOuter);
} else {
pageLI.appendChild(nameSpan);
}
var childPagesHtml = {};
var children = page[1].children;
var subLevel = level + 1;
var promises = Object.entries(children).map((childNode) => {
if (subLevel <= 10){
if (childNode[1]["props"].hidden == false){
return createPageNode(childNode, subLevel).then((childHtml) => {
childPagesHtml[childNode[0]] = childHtml;
});
}
}
});
Promise.all(promises).then(() => {
if (Object.keys(page[1]["children"]).length != 0){
var pageListULNext = document.createElement('ul');
if (level == 1){
pageListULNext.className = "menuUl2";
} else {
pageListULNext.className = "menuUl3";
}
pageListULNext.classList.add("menuUlX");
var childCount = 0;
Object.entries(children).forEach((entry) => {
if (childPagesHtml[entry[0]]){
childCount++;
pageListULNext.appendChild(childPagesHtml[entry[0]]);
}
});
if (childCount > 0){
pageLI.appendChild(pageListULNext);
}
}
resolve(pageLI);
});
});
}
function cleanPageNameForUrl(pageName) {
// Convert to lowercase
let url = pageName.toLowerCase();
// Replace spaces with dashes
url = url.replace(/\s+/g, '-');
// Remove all special characters except dashes and alphanumeric characters
url = url.replace(/[^a-z0-9-]/g, '');
// Remove multiple consecutive dashes
url = url.replace(/-+/g, '-');
// Remove leading and trailing dashes
url = url.replace(/^-|-$/g, '');
return url;
}
var currentPageId = woo.getCurrentPage();
$("#gkxwvsqf_202382802446_738z2r .woo_menuName").each(function(){
if (currentPageId == cleanPageNameForUrl($(this).text())){
$(this).css({"background-color": "#ed1c24", "color" : "#ffffff"});
}
});
$(".menuClick_gkxwvsqf_202382802446_738z2r").on("click", function(){
if ($(this).attr("linked")){
if ($(this).attr("linkID") != ""){
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("linkID");
setTimeout(animatePageIn, 0);
} else {
window.location = $(this).attr("linkURL");
}
} else {
$('body').removeClass("pageAnimateOut").addClass("pageAnimateIn");
showPage = $(this).attr("showPage");
setTimeout(animatePageIn, 0);
}
});
$("#gkxwvsqf_202382802446_738z2r .parentPage_gkxwvsqf_202382802446_738z2r .menuClick_gkxwvsqf_202382802446_738z2r").unbind();
$("#gkxwvsqf_202382802446_738z2r .parentPage_gkxwvsqf_202382802446_738z2r").on("click", function(){
var burgerMenuId = $("#gkxwvsqf_202382802446_738z2r").parents(".burger_menu").attr("id");
//var subMenuNode = $(this).children("li > ul");
var subMenu = this.querySelector("li > ul").cloneNode(true);
//var subMenu = subMenuNode.cloneNode(true);
console.log(burgerMenuId);
window[burgerMenuId].changeSubPage($(this).attr("id"), 'gkxwvsqf_202382802446_738z2r', subMenu, 0, 0);
});
function animatePageIn() {
Promise.all([woo.updateCurrentPage(showPage)]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
$('body').removeClass("pageAnimateIn").addClass("pageAnimateOut");
});
}
gkxwvsqf_202382802446_738z2r_Global.animateMenuIn = () => {
animateMenuIn();
};
function animateMenuIn(){
$("#gkxwvsqf_202382802446_738z2r .woo_menuName").removeClass("animateMenuOut").addClass("animateMenuIn");
}
gkxwvsqf_202382802446_738z2r_Global.animateMenuOut = () => {
animateMenuOut();
};
function animateMenuOut(){
$("#gkxwvsqf_202382802446_738z2r .woo_menuName").removeClass("animateMenuIn").addClass("animateMenuOut");
}
return gkxwvsqf_202382802446_738z2r_Global;
})(); var gkxwvsqf_202392093827_7396u2 = (function() {
var self = document.getElementById('gkxwvsqf_202392093827_7396u2');
var gkxwvsqf_202392093827_7396u2_Global = {};
gkxwvsqf_202392093827_7396u2_Global.unload = () => {
//Unload callbacks here
window.removeEventListener("scroll", gkxwvsqf_202392093827_7396u2Reveal);
console.log("Unloaded gkxwvsqf_202392093827_7396u2");
}
function gkxwvsqf_202392093827_7396u2Reveal() {
var reveals = document.querySelector("#gkxwvsqf_202392093827_7396u2 .reveal");
var windowHeight = window.innerHeight;
var elementTop = reveals.getBoundingClientRect().top;
var elementVisible = 150;
if (elementTop < windowHeight - elementVisible) {
reveals.classList.add("active");
self.classList.add("gkxwvsqf_202392093827_7396u2ShadowReveal");
self.classList.remove("gkxwvsqf_202392093827_7396u2ShadowRevealOff");
} else {
reveals.classList.remove("active");
self.classList.remove("gkxwvsqf_202392093827_7396u2ShadowReveal");
self.classList.add("gkxwvsqf_202392093827_7396u2ShadowRevealOff");
}
}
if ("home" != "" || "Change_Page" == "Open_Image_in_New_Window"){
$("#gkxwvsqf_202392093827_7396u2 .mainImage").css("cursor", "pointer");
$("#gkxwvsqf_202392093827_7396u2 .mainImage").on("click", function(){
switch ("Change_Page"){
case "Change_Page":
woo.updateCurrentPage("home");
break;
case "External_Link":
window.location("home");
break;
case "Open_Image_in_New_Window":
window.open("/resources/licious/uploads/licious-full-logo-white-back.png");
break;
default:
console.error("No link option selected");
}
});
}
gkxwvsqf_202392093827_7396u2_Global.animateMenuIn = () => {
animateMenuIn();
};
function animateMenuIn(){
$("#gkxwvsqf_202392093827_7396u2 .imageWrapper").removeClass("animateMenuOut").addClass("animateMenuIn");
}
gkxwvsqf_202392093827_7396u2_Global.animateMenuOut = () => {
animateMenuOut();
};
function animateMenuOut(){
$("#gkxwvsqf_202392093827_7396u2 .imageWrapper").removeClass("animateMenuIn").addClass("animateMenuOut");
}
return gkxwvsqf_202392093827_7396u2_Global;
})(); var gkxwvsqf_2024616151042_6805yf = (function() {
var self = document.getElementById('gkxwvsqf_2024616151042_6805yf');
var gkxwvsqf_2024616151042_6805yf_Global = {};
gkxwvsqf_2024616151042_6805yf_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_2024616151042_6805yf");
}
return gkxwvsqf_2024616151042_6805yf_Global;
})(); var gkxwvsqf_202382815548_806fs8 = (function() {
var self = document.getElementById('gkxwvsqf_202382815548_806fs8');
//self.classList.add("sun_editor_content");
var gkxwvsqf_202382815548_806fs8_Global = {};
gkxwvsqf_202382815548_806fs8_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_202382815548_806fs8");
}
return gkxwvsqf_202382815548_806fs8_Global;
})(); var gkxwvsqf_202552417155__890_594 = (function() {
var gkxwvsqf_202552417155__890_594_Global = {};
var self = $("#gkxwvsqf_202552417155__890_594");
gkxwvsqf_202552417155__890_594_Global.unload = () => {
//Unload callbacks here
window.removeEventListener("resize", setLeftOnPercent);
console.log("Unloaded gkxwvsqf_202552417155__890_594");
}
setLeftOnPercent();
window.addEventListener("resize", setLeftOnPercent);
var currentTop = parseInt($(self).css("top"));
function fixDiv() {
var scrollTop = parseInt($(window).scrollTop());
var newTop = currentTop;
if ($("#property_toolbar").length > 0) {
var elemToolBar = $("#property_toolbar");
var elemHeight = window.getComputedStyle(elemToolBar[0]).height;
var elemPosition = elemToolBar.position();
var elemTop = elemPosition.top;
var elemBottom = parseInt(elemTop) + parseInt(elemHeight);
newTop = elemBottom + currentTop;
}
var currentPosition = ((parseInt($(self).css("top")) - newTop) + parseInt($(self).css("min-height")));
if (!isNaN(currentPosition) && !isNaN(scrollTop) && (newTop => 0)){
//console.log("scrollTop: " + scrollTop);
//console.log("currentPosition: " + currentPosition);
//console.log("newTop: " + newTop);
if (scrollTop > (currentPosition + 100)) {
$(self).css({'position': 'fixed', 'top': newTop}).slideDown('slow');
} else {
$(self).css({'position': 'absolute', 'top': '0px'});
}
}
}
//$(window).scroll(fixDiv);
function setLeftOnPercent(){
var container = $(self).parent();
var containerWidth = container.css("width");
var boxWidth = "100%";
var mainWrapper = document.querySelector("#woo_ui_wrapper");
if (mainWrapper){
var docWidth = $("#woo_ui_wrapper").width();
}else{
var docWidth = $(window).width();
}
if (boxWidth.indexOf("%") > -1){
if ((parseInt(containerWidth) < docWidth) && (containerWidth != "100%")){
//if ((parseInt(containerWidth) < docWidth)){
var intWidth = parseInt(boxWidth);
var newWidth = parseInt((docWidth * (intWidth/100)));
var leftSide1 =((docWidth - newWidth)/2);
var leftSide2 = ((docWidth - parseInt(container.css("width")))/2);
leftValue = leftSide2 - leftSide1;
$(self).css({"width": newWidth + "px", "margin-left": "0px", "margin-right": "0px", "left": -leftValue + "px"});
}
}
}
return gkxwvsqf_202552417155__890_594_Global;
})(); var gkxwvsqf_2023913213116_73027m = (function() {
var self = document.getElementById('gkxwvsqf_2023913213116_73027m');
var gkxwvsqf_2023913213116_73027m_Global = {};
gkxwvsqf_2023913213116_73027m_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_2023913213116_73027m");
}
return gkxwvsqf_2023913213116_73027m_Global;
})(); var gkxwvsqf_2023913213116_732ikd = (function() {
var self = document.getElementById('gkxwvsqf_2023913213116_732ikd');
var gkxwvsqf_2023913213116_732ikd_Global = {};
gkxwvsqf_2023913213116_732ikd_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_2023913213116_732ikd");
}
return gkxwvsqf_2023913213116_732ikd_Global;
})(); var box_container_732r6f = (function() {
var box_container_732r6f_Global = {};
var self = $("#box_container_732r6f");
box_container_732r6f_Global.unload = () => {
//Unload callbacks here
window.removeEventListener("resize", setLeftOnPercent);
console.log("Unloaded box_container_732r6f");
}
setLeftOnPercent();
window.addEventListener("resize", setLeftOnPercent);
var currentTop = parseInt($(self).css("top"));
function fixDiv() {
var scrollTop = parseInt($(window).scrollTop());
var newTop = currentTop;
if ($("#property_toolbar").length > 0) {
var elemToolBar = $("#property_toolbar");
var elemHeight = window.getComputedStyle(elemToolBar[0]).height;
var elemPosition = elemToolBar.position();
var elemTop = elemPosition.top;
var elemBottom = parseInt(elemTop) + parseInt(elemHeight);
newTop = elemBottom + currentTop;
}
var currentPosition = ((parseInt($(self).css("top")) - newTop) + parseInt($(self).css("min-height")));
if (!isNaN(currentPosition) && !isNaN(scrollTop) && (newTop => 0)){
//console.log("scrollTop: " + scrollTop);
//console.log("currentPosition: " + currentPosition);
//console.log("newTop: " + newTop);
if (scrollTop > (currentPosition + 100)) {
$(self).css({'position': 'fixed', 'top': newTop}).slideDown('slow');
} else {
$(self).css({'position': 'absolute', 'top': '0px'});
}
}
}
//$(window).scroll(fixDiv);
function setLeftOnPercent(){
var container = $(self).parent();
var containerWidth = container.css("width");
var boxWidth = "100%";
var mainWrapper = document.querySelector("#woo_ui_wrapper");
if (mainWrapper){
var docWidth = $("#woo_ui_wrapper").width();
}else{
var docWidth = $(window).width();
}
if (boxWidth.indexOf("%") > -1){
if ((parseInt(containerWidth) < docWidth) && (containerWidth != "100%")){
//if ((parseInt(containerWidth) < docWidth)){
var intWidth = parseInt(boxWidth);
var newWidth = parseInt((docWidth * (intWidth/100)));
var leftSide1 =((docWidth - newWidth)/2);
var leftSide2 = ((docWidth - parseInt(container.css("width")))/2);
leftValue = leftSide2 - leftSide1;
$(self).css({"width": newWidth + "px", "margin-left": "0px", "margin-right": "0px", "left": -leftValue + "px"});
}
}
}
return box_container_732r6f_Global;
})(); var gkxwvsqf_202391320119_677vac = (function() {
var self = document.getElementById('gkxwvsqf_202391320119_677vac');
var gkxwvsqf_202391320119_677vac_Global = {};
function gkxwvsqf_202391320119_677vacReveal() {
if (document.querySelector("#gkxwvsqf_202391320119_677vac .reveal")){
var reveals = document.querySelector("#gkxwvsqf_202391320119_677vac .reveal");
var windowHeight = window.innerHeight;
var elementTop = reveals.getBoundingClientRect().top;
var elementVisible = 150;
if (elementTop < windowHeight - elementVisible) {
reveals.classList.add("active");
self.classList.add("gkxwvsqf_202391320119_677vacShadowReveal");
self.classList.remove("gkxwvsqf_202391320119_677vacShadowRevealOff");
} else {
reveals.classList.remove("active");
self.classList.remove("gkxwvsqf_202391320119_677vacShadowReveal");
self.classList.add("gkxwvsqf_202391320119_677vacShadowRevealOff");
}
}
}
gkxwvsqf_202391320119_677vac_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_202391320119_677vac");
}
$("#gkxwvsqf_202391320119_677vac .buttonWysiwygText").on("click", function(){
if ("Page_ID" == "Page_ID") {
/*woo.updateCurrentPage("home").then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});*/
Promise.all([woo.updateCurrentPage("home")]).then(() => {
document.body.scrollTop = document.documentElement.scrollTop = 0;
});
} else {
window.location = "home";
}
});
return gkxwvsqf_202391320119_677vac_Global;
})(); var gkxwvsqf_2024612192844_677wfu = (function() {
var self = document.getElementById('gkxwvsqf_2024612192844_677wfu');
var email = document.getElementById('contactEmailAddress');
var number = document.getElementById('contactNumber');
var firstName = document.getElementById('enquiryFirstName');
var lastName = document.getElementById('enquiryLastName');
var formSubmit = document.getElementById('contactSubmit');
var gkxwvsqf_2024612192844_677wfu_Global = {};
function getExtraData() {
return new Promise((resolve, reject) => {
var inputs = $('#gkxwvsqf_2024612192844_677wfu input, #gkxwvsqf_2024612192844_677wfu textarea, #gkxwvsqf_2024612192844_677wfu select')
.not(':input[type=button], :input[type=submit], :input[type=reset], #contactEmailAddress, #contactNumber, #enquiryFirstName, #enquiryLastName, #enquiryLastName');
var enquiryText = "";
$(inputs).each(function() {
if (this.type == "text" || this.type == "textarea" || this.type == "select-one"){
if ( this.type == "select-one" && this.value == "none"){
alert("Please choose an option for '" + this.name + "'!");
resolve("select option issue");
}
enquiryText = enquiryText + "\n" + this.name + ": " + this.value + "\n";
} else if (this.checked) {
enquiryText = enquiryText + "\n" + this.name + ": " + this.value + "\n";
}
});
resolve(enquiryText);
}).catch((error) => {
console.error("Error in content method:", error);
reject("");
});
}
function submitButtonPressed() {
var emailAddress = email.value.trim();
var numberVal = number.value.trim();
var firstNameVal = firstName.value.trim();
var lastNameVal = lastName.value.trim();
// Remove everything that's not a digit
var cleanNumber = numberVal.replace(/[^0-9]/g, '');
// Basic checks
if (emailAddress === "" ||
cleanNumber === "" ||
firstNameVal === "" ||
lastNameVal === "") {
alert("Oops! Please fill in all required fields:\n\n" +
"- First Name\n" +
"- Last Name\n" +
"- Phone number\n" +
"- Email address");
return;
}
// Check if we actually have a valid phone number (at least 7-8 digits usually)
if (cleanNumber.length < 7) {
alert("Please enter a valid phone number\n\n" +
"(Must contain at least 7 digits after removing spaces, dashes, dots, etc.)");
number.focus(); // Put cursor back in phone field
return;
}
// Show loading
$("#contactLoadWait").css({"zIndex": "10000000", "display": "flex"});
getExtraData().then((enquiryText) => {
if (enquiryText !== "select option issue") {
// Use the original number (with formatting) for submission/display
// or use cleanNumber if your backend prefers it
contact(firstNameVal, lastNameVal, numberVal, emailAddress, enquiryText)
.then((response) => {
console.log(response);
$("form").hide();
$("#contactLoadWait").hide();
var responseDiv = document.createElement('div');
responseDiv.innerHTML = it.responseWysiwygContent; // fixed syntax
self.appendChild(responseDiv);
return woo.checkEmail(emailAddress);
})
.then((response) => {
console.log(response);
if (response && response.ok === true) {
var registerData = {
"name": firstNameVal,
"lastName": lastNameVal,
"number": numberVal, // keeping original format
// "number": cleanNumber, // alternative: send clean version
"email": emailAddress,
"password": "",
"confirmPassword": ""
};
return woo.register(registerData);
} else {
return false;
}
})
.then((response) => {
console.log(response);
if (response === false) {
console.log("Not Registered");
}
})
.catch((error) => {
console.log(error);
$("#contactLoadWait").hide().css("zIndex", "1");
// alert("Something went wrong");
});
} else {
$("#contactLoadWait").hide().css("zIndex", "1");
}
});
}
function contact(firstNameVal, lastNameVal, numberVal, emailAddress, enquiryText) {
return $.ajax({
type: "POST",
url: woo.getAuthServer() + "/mailer/enquiry",
headers: {
"Content-Type": "application/json"
},
crossDomain: true,
cache: false,
data: JSON.stringify({
"firstName": firstNameVal,
"lastName": lastNameVal,
"number": numberVal,
"emailAddress": emailAddress,
"enquiryString": enquiryText
}),
timeout: 10000
});
}
function addEventListeners() {
formSubmit.addEventListener('click', submitButtonPressed);
}
addEventListeners();
gkxwvsqf_2024612192844_677wfu_Global.unload = () => {
//Unload callbacks here
formSubmit.removeEventListener('click', submitButtonPressed);
console.log("Unloaded gkxwvsqf_2024612192844_677wfu");
}
return gkxwvsqf_2024612192844_677wfu_Global;
})(); var gkxwvsqf_20248511725__146_511 = (function() {
var gkxwvsqf_20248511725__146_511_Global = {};
var self = $("#gkxwvsqf_20248511725__146_511");
gkxwvsqf_20248511725__146_511_Global.unload = () => {
//Unload callbacks here
window.removeEventListener("resize", setLeftOnPercent);
console.log("Unloaded gkxwvsqf_20248511725__146_511");
}
setLeftOnPercent();
window.addEventListener("resize", setLeftOnPercent);
var currentTop = parseInt($(self).css("top"));
function fixDiv() {
var scrollTop = parseInt($(window).scrollTop());
var newTop = currentTop;
if ($("#property_toolbar").length > 0) {
var elemToolBar = $("#property_toolbar");
var elemHeight = window.getComputedStyle(elemToolBar[0]).height;
var elemPosition = elemToolBar.position();
var elemTop = elemPosition.top;
var elemBottom = parseInt(elemTop) + parseInt(elemHeight);
newTop = elemBottom + currentTop;
}
var currentPosition = ((parseInt($(self).css("top")) - newTop) + parseInt($(self).css("min-height")));
if (!isNaN(currentPosition) && !isNaN(scrollTop) && (newTop => 0)){
//console.log("scrollTop: " + scrollTop);
//console.log("currentPosition: " + currentPosition);
//console.log("newTop: " + newTop);
if (scrollTop > (currentPosition + 100)) {
$(self).css({'position': 'fixed', 'top': newTop}).slideDown('slow');
} else {
$(self).css({'position': 'absolute', 'top': '0px'});
}
}
}
//$(window).scroll(fixDiv);
function setLeftOnPercent(){
var container = $(self).parent();
var containerWidth = container.css("width");
var boxWidth = "100%";
var mainWrapper = document.querySelector("#woo_ui_wrapper");
if (mainWrapper){
var docWidth = $("#woo_ui_wrapper").width();
}else{
var docWidth = $(window).width();
}
if (boxWidth.indexOf("%") > -1){
if ((parseInt(containerWidth) < docWidth) && (containerWidth != "100%")){
//if ((parseInt(containerWidth) < docWidth)){
var intWidth = parseInt(boxWidth);
var newWidth = parseInt((docWidth * (intWidth/100)));
var leftSide1 =((docWidth - newWidth)/2);
var leftSide2 = ((docWidth - parseInt(container.css("width")))/2);
leftValue = leftSide2 - leftSide1;
$(self).css({"width": newWidth + "px", "margin-left": "0px", "margin-right": "0px", "left": -leftValue + "px"});
}
}
}
return gkxwvsqf_20248511725__146_511_Global;
})(); var gkxwvsqf_20231115182211_728ms9 = (function() {
var self = document.getElementById('gkxwvsqf_20231115182211_728ms9');
$(self).addClass("shortHeader");
var gkxwvsqf_20231115182211_728ms9_Global = {};
gkxwvsqf_20231115182211_728ms9_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_20231115182211_728ms9");
}
return gkxwvsqf_20231115182211_728ms9_Global;
})(); var gkxwvsqf_20231115182449_728spl = (function() {
var self = document.getElementById('gkxwvsqf_20231115182449_728spl');
$(self).addClass("tallHeader");
var gkxwvsqf_20231115182449_728spl_Global = {};
gkxwvsqf_20231115182449_728spl_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_20231115182449_728spl");
}
return gkxwvsqf_20231115182449_728spl_Global;
})(); var gkxwvsqf_20231115161244_494_623_129_84_550 = (function() {
var self = document.getElementById('gkxwvsqf_20231115161244_494_623_129_84_550');
var gkxwvsqf_20231115161244_494_623_129_84_550_Global = {};
gkxwvsqf_20231115161244_494_623_129_84_550_Global.unload = () => {
//Unload callbacks here
console.log("Unloaded gkxwvsqf_20231115161244_494_623_129_84_550");
}
if ($('.tallHeader').length > 0){
$(window).scroll(function() {
checkY();
});
}
function setShort(){
var newTop = 0;
if ($("#property_toolbar").length > 0) {
var elemToolBar = $("#property_toolbar");
var elemHeight = window.getComputedStyle(elemToolBar[0]).height;
var elemPosition = elemToolBar.position();
var elemTop = elemPosition.top;
var elemBottom = parseInt(elemTop) + parseInt(elemHeight);
var elemGadgetPanel = $(".gadget-panel");
var elemWidth = parseInt(window.getComputedStyle(elemGadgetPanel[0]).width);
var elemRight = parseInt(window.getComputedStyle(elemGadgetPanel[0]).right);
//console.log("elemWidth: " + elemWidth + ", elemRight: " + elemRight);
var gadgetPanelWidth = elemWidth + elemRight;
var thisWidth = parseInt($(window).width()) - gadgetPanelWidth;
$('.shortHeader').css({"width": thisWidth + "px"});
newTop = elemBottom;
}
//console.log("newTop: " + newTop);
$(self).height($('.shortHeader').height());
$('.shortHeader').removeClass("unslide").css({"top": newTop, "position": "fixed", "visibility": "visible", "transition": "none"});
//console.log("Short Heqader Top: " + $('.shortHeader').css("top"));
}
function checkY() {
var newTop = 0;
if ($("#property_toolbar").length > 0) {
var elemToolBar = $("#property_toolbar");
var elemHeight = window.getComputedStyle(elemToolBar[0]).height;
var elemPosition = elemToolBar.position();
var elemTop = elemPosition.top;
var elemBottom = parseInt(elemTop) + parseInt(elemHeight);
var elemGadgetPanel = $(".gadget-panel");
var elemWidth = parseInt(window.getComputedStyle(elemGadgetPanel[0]).width);
var elemRight = parseInt(window.getComputedStyle(elemGadgetPanel[0]).right);
//console.log("elemWidth: " + elemWidth + ", elemRight: " + elemRight);
var gadgetPanelWidth = elemWidth + elemRight;
var thisWidth = parseInt($(window).width()) - gadgetPanelWidth;
$('.shortHeader').css({"width": thisWidth + "px"});
newTop = elemBottom;
}
if ($('.tallHeader').length > 0){
//var tallHeaderHeight = $('.tallHeader').height();
var elemTallHeader = $(".tallHeader");
var tallHeaderHeight = window.getComputedStyle(elemTallHeader[0]).height;
//console.log(tallHeaderHeight);
$(self).css('min-height', tallHeaderHeight);
$(self).height("fit-content");
if ($(window).scrollTop() > parseInt(tallHeaderHeight)) {
$('.shortHeader').removeClass("unslide").css("top", newTop).addClass("slide");
} else {
$('.shortHeader').css("top", "").removeClass("slide").addClass("unslide");
}
} else {
$(self).height($('.shortHeader').height());
$('.shortHeader').removeClass("unslide").css("top", newTop).addClass("slide");
}
}
// Do this on load just in case the user starts half way down the page
$(window).ready(function() {
setTimeout(function () {
if ($('.tallHeader').length > 0){
checkY();
} else {
setShort();
}
}, 200);
});
window.onresize = function(event) {
if ($('.tallHeader').length > 0){
checkY();
} else {
setShort();
}
};
return gkxwvsqf_20231115161244_494_623_129_84_550_Global;
})();