1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[623],{243:(t,e,o)=>{o.d(e,{v:()=>s});var n=o(595),i=o(143),a=o(402);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function u(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}var s=function(){function t(){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.title=titlePageCurrent,this.constructor===t)throw new Error("Cannot instantiate abstract class");if(!this.constructor.hash)throw new Error("Class ".concat(this.constructor.name," must have a static hash attribute."))}return e=t,o=[{key:"initialize",value:function(){throw new Error("Method 'initialize()' must be implemented.")}},{key:"sharedInitialize",value:function(){this.logInitialisation(),this.hookupCommonElements()}},{key:"logInitialisation",value:function(){console.log("Initializing "+this.title+" page")}},{key:"hookupCommonElements",value:function(){this.hookupNavigation(),this.hookupImagesLogo()}},{key:"hookupNavigation",value:function(){console.log("hooking up navigation");var t=document.querySelector(idOverlayHamburger).querySelectorAll("div."+flagRow).length;console.log("count nav options: ",t),initialiseEventHandler(idButtonHamburger,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation();var e=document.querySelector(idOverlayHamburger);e.classList.contains(flagCollapsed)?(e.classList.remove(flagCollapsed),e.classList.add(flagExpanded)):(e.classList.remove(flagExpanded),e.classList.add(flagCollapsed))}))})),this.hookupButtonNavHome(),this.hookupButtonNavServices(),this.hookupButtonNavContact(),this.hookupButtonNavUserAccount(),this.hookupButtonNavUserLogout(),this.hookupButtonNavUserLogin(),this.hookupButtonNavStoreHome(),this.hookupButtonNavStoreProductPermutations(),this.hookupButtonNavStoreStockItems(),this.hookupButtonNavAdminHome()}},{key:"hookupButtonNavHome",value:function(){initialiseEventHandler("."+flagNavHome,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageHome)}))}))}},{key:"hookupButtonNavServices",value:function(){initialiseEventHandler("."+flagNavServices,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),console.log("going to services page"),a.Q.navigateToHash(hashPageServices)}))}))}},{key:"hookupButtonNavContact",value:function(){initialiseEventHandler("."+flagNavContact,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageContact)}))}))}},{key:"hookupButtonNavUserAccount",value:function(){initialiseEventHandler("."+flagNavUserAccount,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageUserAccount)}))}))}},{key:"hookupButtonNavUserLogout",value:function(){initialiseEventHandler("."+flagNavUserLogout,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageUserLogout)}))}))}},{key:"hookupButtonNavUserLogin",value:function(){initialiseEventHandler("."+flagNavUserLogin,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),n.A.loginUser().then((function(t){t.Success?window.app.router.navigateToUrl(t[keyCallback],null,!1):alertError("Error",t.Message)}))}))}))}},{key:"hookupButtonNavStoreHome",value:function(){initialiseEventHandler("."+flagNavStoreHome,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreHome)}))}))}},{key:"hookupButtonNavStoreProductCategories",value:function(){initialiseEventHandler("."+flagNavStoreProductCategories,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreProductCategories)}))}))}},{key:"hookupButtonNavStoreProducts",value:function(){initialiseEventHandler("."+flagNavStoreProducts,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreProducts)}))}))}},{key:"hookupButtonNavStoreProductPermutations",value:function(){initialiseEventHandler("."+flagNavStoreProductPermutations,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreProductPermutations)}))}))}},{key:"hookupButtonNavStoreProductPrices",value:function(){initialiseEventHandler("."+flagNavStoreProductPrices,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreProductPrices)}))}))}},{key:"hookupButtonNavStoreProductVariations",value:function(){initialiseEventHandler("."+flagNavStoreProductVariations,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreProductVariations)}))}))}},{key:"hookupButtonNavStoreStockItems",value:function(){initialiseEventHandler("."+flagNavStoreStockItems,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageStoreStockItems)}))}))}},{key:"hookupButtonNavAdminHome",value:function(){initialiseEventHandler("."+flagNavAdminHome,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageAdminHome)}))}))}},{key:"hookupImagesLogo",value:function(){var t="img."+flagImageLogo;initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),a.Q.navigateToHash(hashPageHome)}))}))}},{key:"hookupOverlayFromId",value:function(t){initialiseEventHandler(t,flagInitialised,(function(t){t.querySelector("button."+flagClose).addEventListener("click",(function(e){e.stopPropagation(),t.css("display","none")}))}))}},{key:"hookupButtonSave",value:function(){initialiseEventHandler("form."+flagFilter+" button."+flagSave,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),showOverlayConfirm()})),t.classList.add(flagCollapsed)}))}},{key:"hookupVideos",value:function(){initialiseEventHandler("video",flagInitialised,(function(t){t.addEventListener("mouseover",videoPlay(t)),t.addEventListener("mouseout",videoPause(t))}))}},{key:"leave",value:function(){if(console.log("Leaving "+this.title+" page"),_pageCurrent=null,this.constructor===t)throw new Error("Must implement leave() method.")}},{key:"setLocalStoragePage",value:function(t){setLocalStorage(this.constructor.hash,t)}},{key:"getLocalStoragePage",value:function(){return getLocalStorage(this.constructor.hash)}},{key:"toggleShowButtonsSaveCancel",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==e&&(e=document.querySelector("form."+flagFilter+" button."+flagSave)),null==o&&(o=document.querySelector("form."+flagFilter+" button."+flagCancel)),t?(o.classList.remove(flagCollapsed),e.classList.remove(flagCollapsed)):(o.classList.add(flagCollapsed),e.classList.add(flagCollapsed))}}],r=[{key:"isDirtyFilter",value:function(t){var e=i.A.isElementDirty(t);return e&&document.querySelectorAll(idTableMain+" tbody tr").remove(),e}}],o&&u(e.prototype,o),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,o,r}()},623:(t,e,o)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,e,o){return e=l(e),function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,r()?Reflect.construct(e,o||[],l(t).constructor):e.apply(t,o))}function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(r=function(){return!!t})()}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,o){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:o):i.value}},u.apply(null,arguments)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function c(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}o.r(e),o.d(e,{PageAdminHome:()=>p});var f,v,d,p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(e,t),o=e,n=[{key:"initialize",value:function(){this.sharedInitialize(),this.hookupAdminStore()}},{key:"hookupAdminStore",value:function(){this.hookupButtonNavStoreProductCategories(),this.hookupButtonNavStoreProducts(),this.hookupButtonNavStoreProductPermutations(),this.hookupButtonNavStoreProductPrices(),this.hookupButtonNavStoreStockItems(),this.hookupButtonNavStoreProductVariations(),this.hookupButtonNavAdminStoreStripeProducts(),this.hookupButtonNavAdminStoreStripePrices()}},{key:"hookupButtonNavAdminStoreStripeProducts",value:function(){initialiseEventHandler("."+flagNavAdminStoreStripeProducts,flagInitialised,(function(t){t.addEventListener("click",(function(t){router.navigateToHash(hashPageAdminStoreStripeProducts)}))}))}},{key:"hookupButtonNavAdminStoreStripePrices",value:function(){initialiseEventHandler("."+flagNavAdminStoreStripePrices,flagInitialised,(function(t){t.addEventListener("click",(function(t){router.navigateToHash(hashPageAdminStoreStripePrices)}))}))}},{key:"leave",value:function(){var t,o,n;(t=e,o=this,"function"==typeof(n=u(l(1&3?t.prototype:t),"leave",o))?function(t){return n.apply(o,t)}:n)([])}}],n&&i(o.prototype,n),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,n}(o(243).v);f=p,v="hash",d=hashPageAdminHome,(v=c(v))in f?Object.defineProperty(f,v,{value:d,enumerable:!0,configurable:!0,writable:!0}):f[v]=d}}]); |