@htmlguyllc/jpack
Advanced tools
Comparing version 9.0.3 to 9.0.4
@@ -1,2 +0,2 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";var r=n(11),o=n(24),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(5),o=n.n(r),i=n(0),s=n(6),a={setData:function(t){if("object"!=typeof t)throw"".concat(t," is not an object");return this._data=t,this},setDataItem:function(t,e){return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this_.data[t]:null},clearData:function(){return this.setData({}),this},getData:function(t){return this._data},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,s){var a=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:a.getIncomingElement(),r=void 0!==r&&r?r:a.getReplaceElement(),s=void 0===s||s,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var u=a.getData(),c=this.getRouteFromMeta();a.showLoader(),o.a.get(t).then(function(o){a.hideLoader(),a._replacePageContent(o.data,t,n,r,s,c,u),"function"==typeof e&&window.setTimeout(function(){e(i.a.getElement(r),n,r,c,u)},105)}).catch(function(e){a.hideLoader();var n="object"==typeof e&&e.isAxiosError?e:null;throw e="object"==typeof e&&e.isAxiosError?e.response.statusText:e,a._triggerFail(e,t,u,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,o,s,a){if(o=void 0===o||o,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(i.a.getElement(r),r,s,a);var u=this._parseHTML(t,n);if(u.html.length){i.a.remove("meta"),document.head.append(u.metas),i.a.remove('[rel="canonical"]'),Array.from(u.links).forEach(function(t){document.head.append(t)}),document.body.classList=u.body_classes,o&&history.pushState({url:e},u.title,e),this._setTitle(u.title);var c=i.a.replaceElWithHTML(r,u.html);this._triggerOnload(c,n,r,u.route,a),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(l=null,"object"==typeof t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(i){i(t,e,n,r,o)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,o){o=void 0!==o&&o,n=void 0!==n&&n;var i=JSON.stringify(t),s="".concat(i," is not an object");if(void 0===t){if(o)throw s;return!1}if(!("object"==typeof t)||null===t||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var a=!1,u=[],c=Object.keys(t);if(e.forEach(function(t){c.includes(t)?a=!0:u.push(t)}),!a){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(o)throw"".concat(i," is missing data: ")+u.join(", ");return!1}if(r){var l=[];if(c.forEach(function(t){e.includes(t)||l.push(t)}),l.length){if(o)throw"".concat(i," contains invalid data: ")+l.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e,n,o){var i=r.a.getElements(t);return i.length?(n=void 0===n?null:n,(o=void 0===o?{}:o).detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(23)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(40);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(3),o=n(8);class i{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(5),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(41);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a.parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw o.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(1);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(1),o=n(30),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(15):"undefined"!=typeof XMLHttpRequest&&(a=n(15)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(29))},function(t,e,n){"use strict";var r=n(1),o=n(31),i=n(12),s=n(33),a=n(34),u=n(16);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(35),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(32);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(0);class i{constructor(t,e,n,r){this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return g});var r=n(0),o=n(4),i=n(10),s=n(2),a=n(6),u=n(19),c=n(8),l=n(3),f=n(20),h=n(21);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a},g=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){p(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=g}.call(this,n(9))},function(t,e,n){"use strict";var r=n(1),o=n(11),i=n(25),s=n(17);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(14));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(18),u.CancelToken=n(38),u.isCancel=n(13),u.all=function(t){return Promise.all(t)},u.spread=n(39),t.exports=u,t.exports.default=u},function(t,e){ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";var r=n(11),o=n(24),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(5),o=n.n(r),i=n(0),s=n(6),a={setData:function(t){if("object"!=typeof t)throw"".concat(t," is not an object");return this._data=t,this},setDataItem:function(t,e){return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this_.data[t]:null},clearData:function(){return this.setData({}),this},getData:function(){return this._data},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,s){var a=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:a.getIncomingElement(),r=void 0!==r&&r?r:a.getReplaceElement(),s=void 0===s||s,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var u=a.getData(),c=this.getRouteFromMeta();a.showLoader(),o.a.get(t).then(function(o){a.hideLoader(),a._replacePageContent(o.data,t,n,r,s,c,u),"function"==typeof e&&window.setTimeout(function(){e(i.a.getElement(r),n,r,c,u)},105)}).catch(function(e){a.hideLoader();var n="object"==typeof e&&e.isAxiosError?e:null;throw e="object"==typeof e&&e.isAxiosError?e.response.statusText:e,a._triggerFail(e,t,u,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,o,s,a){if(o=void 0===o||o,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(i.a.getElement(r),r,s,a);var u=this._parseHTML(t,n);if(u.html.length){i.a.remove("meta"),document.head.append(u.metas),i.a.remove('[rel="canonical"]'),Array.from(u.links).forEach(function(t){document.head.append(t)}),document.body.classList=u.body_classes,o&&history.pushState({url:e},u.title,e),this._setTitle(u.title);var c=i.a.replaceElWithHTML(r,u.html);this._triggerOnload(c,n,r,u.route,a),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(l=null,"object"==typeof t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(i){i(t,e,n,r,o)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,o){o=void 0!==o&&o,n=void 0!==n&&n;var i=JSON.stringify(t),s="".concat(i," is not an object");if(void 0===t){if(o)throw s;return!1}if(!("object"==typeof t)||null===t||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var a=!1,u=[],c=Object.keys(t);if(e.forEach(function(t){c.includes(t)?a=!0:u.push(t)}),!a){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(o)throw"".concat(i," is missing data: ")+u.join(", ");return!1}if(r){var l=[];if(c.forEach(function(t){e.includes(t)||l.push(t)}),l.length){if(o)throw"".concat(i," contains invalid data: ")+l.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e,n,o){var i=r.a.getElements(t);return i.length?(n=void 0===n?null:n,(o=void 0===o?{}:o).detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(23)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(40);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(3),o=n(8);class i{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(5),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(41);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a.parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw o.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(1);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(1),o=n(30),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(15):"undefined"!=typeof XMLHttpRequest&&(a=n(15)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(29))},function(t,e,n){"use strict";var r=n(1),o=n(31),i=n(12),s=n(33),a=n(34),u=n(16);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(35),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(32);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),o=n(7);function i(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends o.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(0);class i{constructor(t,e,n,r){this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return g});var r=n(0),o=n(4),i=n(10),s=n(2),a=n(6),u=n(19),c=n(8),l=n(3),f=n(20),h=n(21);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a},g=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){p(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=g}.call(this,n(9))},function(t,e,n){"use strict";var r=n(1),o=n(11),i=n(25),s=n(17);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(14));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(18),u.CancelToken=n(38),u.isCancel=n(13),u.all=function(t){return Promise.all(t)},u.spread=n(39),t.exports=u,t.exports.default=u},function(t,e){ | ||
/*! | ||
@@ -3,0 +3,0 @@ * Determine if an object is a Buffer |
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(4),i=n.n(r),o=n(0),s=n(5),a={setData:function(t){if("object"!=typeof t)throw"".concat(t," is not an object");return this._data=t,this},setDataItem:function(t,e){return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this_.data[t]:null},clearData:function(){return this.setData({}),this},getData:function(t){return this._data},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,s){var a=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:a.getIncomingElement(),r=void 0!==r&&r?r:a.getReplaceElement(),s=void 0===s||s,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var c=a.getData(),l=this.getRouteFromMeta();a.showLoader(),i.a.get(t).then(function(i){a.hideLoader(),a._replacePageContent(i.data,t,n,r,s,l,c),"function"==typeof e&&window.setTimeout(function(){e(o.a.getElement(r),n,r,l,c)},105)}).catch(function(e){a.hideLoader();var n="object"==typeof e&&e.isAxiosError?e:null;throw e="object"==typeof e&&e.isAxiosError?e.response.statusText:e,a._triggerFail(e,t,c,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,i,s,a){if(i=void 0===i||i,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(o.a.getElement(r),r,s,a);var c=this._parseHTML(t,n);if(c.html.length){o.a.remove("meta"),document.head.append(c.metas),o.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,i&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var l=o.a.replaceElWithHTML(r,c.html);this._triggerOnload(l,n,r,c.route,a),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(u=null,"object"==typeof t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(u=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,c=t;if(e){var l=r.querySelector(e);if(!l)throw"Could not find parent selector ".concat(e);c=l.outerHTML}var u=u||this.getRouteFromMeta(r);return n=r=null,{title:i,route:u,metas:o,links:s,body_classes:a,html:c}},_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(o){o(t,e,n,r,i)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,i){i=void 0!==i&&i,n=void 0!==n&&n;var o=JSON.stringify(t),s="".concat(o," is not an object");if(void 0===t){if(i)throw s;return!1}if(!("object"==typeof t)||null===t||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var a=!1,c=[],l=Object.keys(t);if(e.forEach(function(t){l.includes(t)?a=!0:c.push(t)}),!a){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(i)throw"".concat(o," is missing data: ")+c.join(", ");return!1}if(r){var u=[];if(l.forEach(function(t){e.includes(t)||u.push(t)}),u.length){if(i)throw"".concat(o," contains invalid data: ")+u.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e,n,i){var o=r.a.getElements(t);return o.length?(n=void 0===n?null:n,(i=void 0===i?{}:i).detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(14);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(2),i=n(7);class o{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(4),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(15);var l={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class u{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a.parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw i.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends u{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return u}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(0);class o{constructor(t,e,n,r){this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return p});var r=n(0),i=n(3),o=n(8),s=n(1),a=n(5),c=n(9),l=n(7),u=n(2),h=n(10),f=n(11);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:c.a,strings:l.a,type_checks:u.a,User:h.a,ToggleOnMobile:f.a},p=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){g(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=p}.call(this,n(13))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]); | ||
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t,e,n){var r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t,e){e=void 0!==e&&e;var n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t,e){var n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e,n){if("string"!=typeof e)throw"".concat(e," is not a string");var r=this.getElement(t);if(!t){if(n)throw'Could not find "'.concat(t,'"');return null}var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t,e,n){if(null===(t=this.getElement(t,e,n))){if(e)throw'Could not find "'.concat(t,'"');return!1}var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(4),i=n.n(r),o=n(0),s=n(5),a={setData:function(t){if("object"!=typeof t)throw"".concat(t," is not an object");return this._data=t,this},setDataItem:function(t,e){return this._data[t]=e,this},getDataItem:function(t){return void 0!==this._data[t]?this_.data[t]:null},clearData:function(){return this.setData({}),this},getData:function(){return this._data},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._incomingElementSelector=t},_incomingElementSelector:"body",getIncomingElement:function(){return this._incomingElementSelector},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," is not a string");this._replaceElementSelector=t},_replaceElementSelector:"body",getReplaceElement:function(){return this._replaceElementSelector},load:function(t,e,n,r,s){var a=this;if("string"!=typeof t)throw"Provided URL (".concat(t,") is not a string");if(n=void 0!==n&&n?n:a.getIncomingElement(),r=void 0!==r&&r?r:a.getReplaceElement(),s=void 0===s||s,"string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");var c=a.getData(),l=this.getRouteFromMeta();a.showLoader(),i.a.get(t).then(function(i){a.hideLoader(),a._replacePageContent(i.data,t,n,r,s,l,c),"function"==typeof e&&window.setTimeout(function(){e(o.a.getElement(r),n,r,l,c)},105)}).catch(function(e){a.hideLoader();var n="object"==typeof e&&e.isAxiosError?e:null;throw e="object"==typeof e&&e.isAxiosError?e.response.statusText:e,a._triggerFail(e,t,c,n),e})},loaderEnabled:!0,setLoaderDelay:function(t){if("number"!=typeof t)throw"".concat(t," is not an integer");return this._loaderDelay=t,this},_loaderDelay:300,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:"progress page-navigation-loader",_loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated",_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(t){var e=(t=void 0===t?document.head:t).querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){return this._onloadCallbacks.push(t),this},removeOnload:function(t){this._onloadCallbacks.filter(function(e){return e!==t})},_onUnloadCallbacks:[],onUnload:function(t){return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){this._onUnloadCallbacks.filter(function(e){return e!==t})},_onFailCallbacks:[],onFail:function(t){return this._onFailCallbacks.push(t),this},removeOnFail:function(t){this._onFailCallbacks.filter(function(e){return e!==t})},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),null,null,null,!1)},this},_replacePageContent(t,e,n,r,i,s,a){if(i=void 0===i||i,n=void 0!==n&&n?n:this.getIncomingElement(),r=void 0!==r&&r?r:this.getReplaceElement(),"string"!=typeof e)throw"Provided url (".concat(e,") is not a string");if("string"!=typeof n)throw"Provided incoming_el (".concat(n,") is not a string");if("string"!=typeof r)throw"Provided replace_el (".concat(r,") is not a string");this._triggerUnload(o.a.getElement(r),r,s,a);var c=this._parseHTML(t,n);if(c.html.length){o.a.remove("meta"),document.head.append(c.metas),o.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,i&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var l=o.a.replaceElWithHTML(r,c.html);this._triggerOnload(l,n,r,c.route,a),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t,e){if("string"!=typeof(e=void 0===e?null:e)&&null!==e)throw"Provided parent_el (".concat(e,") is not a string or null");if(u=null,"object"==typeof t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(u=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList,c=t;if(e){var l=r.querySelector(e);if(!l)throw"Could not find parent selector ".concat(e);c=l.outerHTML}var u=u||this.getRouteFromMeta(r);return n=r=null,{title:i,route:u,metas:o,links:s,body_classes:a,html:c}},_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(o){o(t,e,n,r,i)}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e,n,r,i){i=void 0!==i&&i,n=void 0!==n&&n;var o=JSON.stringify(t),s="".concat(o," is not an object");if(void 0===t){if(i)throw s;return!1}if(!("object"==typeof t)||null===t||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var a=!1,c=[],l=Object.keys(t);if(e.forEach(function(t){l.includes(t)?a=!0:c.push(t)}),!a){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(i)throw"".concat(o," is missing data: ")+c.join(", ");return!1}if(r){var u=[];if(l.forEach(function(t){e.includes(t)||u.push(t)}),u.length){if(i)throw"".concat(o," contains invalid data: ")+u.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e,n,i){var o=r.a.getElements(t);return o.length?(n=void 0===n?null:n,(i=void 0===i?{}:i).detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(14);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return"https:"===window.location.protocol},getDomain:function(){return window.location.hostname||window.location.host},getDomainWithProtocol:function(){return window.location.origin},getURI:function(){return window.location.pathname},getURIWithQueryString:function(){return window.location.pathname+window.location.search},getFullURL:function(){return window.location.href},appendSlash:function(t){return"/"!==t[t.length-1]?t+"/":t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(2),i=n(7);class o{constructor(){}populate(t){var e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(t){return"get"+this.ucfirst(t)},setter:function(t){return"set"+this.ucfirst(t)},ucfirst:function(t){return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(4),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(15);var l={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class u{constructor(t,e){if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," is not a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," is not a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," is not a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a.parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw i.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends u{constructor(t,e){if(super(null,e),"string"!=typeof t)throw"".concat(t," is not a string");if("object"!=typeof(e=void 0===e?{}:e))throw"".concat(e," is not an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," is not a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," is not a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a.parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," is not a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return u}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,name:null,config:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","name","config"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}getId(){return this._id}setId(t){return this._id=t,this}getName(){return this._name}setName(t){return this._name=t,this}getConfig(){return this._config}setConfig(t){return r.a.isDataObject(t,null,!1,!1,!0),this._config=t,this}getConfigItem(t){return void 0===this._config[t]?null:this._config[t]}setConfigItem(t,e){return this._config[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(2),i=n(6);function o(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends i.a{constructor(t){if(super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],void 0===t)return this;t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},a,{},t),this.populate(t)}setId(t){return this._id=t,this}getId(){return this._id}setIsGuest(t){return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(t){return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(t){return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(t){return this._fname=t,this}getLname(){return this._lname}setLname(t){return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(t){return this._email=t,this}getPhone(){return this._phone}setPhone(t){return this._phone=t,this}getPermissions(){return this._permissions}setPermissions(t){if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=t,this}addPermission(t){return this._permissions.push(t),this}removePermission(t){return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){return this.getPermissions().includes(t)}getAdditionalData(){return this._additionalData}setAdditionalData(t){return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=t,this}getDataItem(t){return void 0===this._additionalData[t]?null:this._additionalData[t]}setDataItem(t,e){return this._additionalData[t]=e,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(0);class o{constructor(t,e,n,r){this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0),this.hide_on_outside_click="boolean"!=typeof r||r,this.toggle_class="string"!=typeof n?"visible":n}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return p});var r=n(0),i=n(3),o=n(8),s=n(1),a=n(5),c=n(9),l=n(7),u=n(2),h=n(10),f=n(11);function d(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:c.a,strings:l.a,type_checks:u.a,User:h.a,ToggleOnMobile:f.a},p=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach(function(e){g(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},m,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,m)t?(void 0===window[t]&&(window[t]={}),window[t][e]=m[e]):window[e]=m[e]}});t.jpack=p}.call(this,n(13))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]); |
@@ -59,6 +59,5 @@ import axios from 'axios'; | ||
* | ||
* @param data | ||
* @returns {null} | ||
*/ | ||
getData: function (data) { | ||
getData: function () { | ||
return this._data; | ||
@@ -65,0 +64,0 @@ }, |
{ | ||
"name": "@htmlguyllc/jpack", | ||
"version": "9.0.3", | ||
"version": "9.0.4", | ||
"description": "Core Javascript Library of Everyday Objects, Events, and Utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -188,4 +188,11 @@ Build Status | ||
//things to do when leaving a page | ||
navigation.onUnload(function(){ | ||
/** | ||
* Just before content is swapped for a new page, the unload callbacks are executed | ||
* | ||
* el is the current element on the page that will be replaced | ||
* el_selector is the selector used to grab that element | ||
* route is the current route | ||
* data is any data you set to pass on (for the new request, not when this page was originally loaded) | ||
*/ | ||
navigation.onUnload(function(el, el_selector, route, data){ | ||
//.. do something...like remove generic event handlers or destroy plugins | ||
@@ -192,0 +199,0 @@ }); |
@@ -188,4 +188,11 @@ Build Status | ||
//things to do when leaving a page | ||
navigation.onUnload(function(){ | ||
/** | ||
* Just before content is swapped for a new page, the unload callbacks are executed | ||
* | ||
* el is the current element on the page that will be replaced | ||
* el_selector is the selector used to grab that element | ||
* route is the current route | ||
* data is any data you set to pass on (for the new request, not when this page was originally loaded) | ||
*/ | ||
navigation.onUnload(function(el, el_selector, route, data){ | ||
//.. do something...like remove generic event handlers or destroy plugins | ||
@@ -192,0 +199,0 @@ }); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
627568
720
6869