
/* Smart UI v9.1.74 (2021-03-16) 
Copyright (c) 2011-2021 jQWidgets. 
License: https://htmlelements.com/license/ */ //

!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=95)}({95:function(e,t){Smart.Utilities.Assign("Router",class{constructor(e,t="/"){const n=this,i=document.createElement("a");if(e instanceof HTMLElement)n.view=e;else if("string"==typeof e){if(!(e=document.getElementById(e)))throw new Error("smartRouter: Provided view does not exist in the DOM.");n.view=e}"/"!==t.charAt(t.length-1)&&(t+="/"),n.base=t,i.href=t,n._resolvedBase=i.pathname,n.cache=!1,n.routes=[],n._visited={},n._titleElement=document.querySelector("title"),n._addWindowEventListeners()}setRoutes(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];i.path&&i.template&&t.push(i)}this.routes=t}route(e,t,n=!0){const i=this,o=i.routes.find(t=>t.path===e);if(!o)return;const r=o.template,s=document.createElement("div");if(-1!==r.indexOf("/")||-1!==r.indexOf("."))new Smart.Ajax({url:r,type:"GET",dataType:"text/html"},(function(e,t){t>=200&&t<=299&&(s.innerHTML=e,i._templateLoadComplete(o,s))}));else{const e=document.getElementById(r);if(!r)return;const t=document.importNode(e.content,!0);s.appendChild(t),i._templateLoadComplete(o,s)}t&&(window.history.pushState({},"",i.base+e.slice(1)),t.preventDefault()),n&&window.history.replaceState({},"",i.base+e.slice(1))}_templateLoadComplete(e,t){const n=this,i=document.createElement("div"),o=e.styleUrls,r=e.style,s=e.scriptUrls,l=e.script,a=[];let c=!1,d=0;function p(){t.style.opacity=1,t.style.visibility="visible",n._visited[e.path]=!0,n.templateApplied&&"function"==typeof n.templateApplied&&n.templateApplied(e)}if(e.title&&n._titleElement&&(n._titleElement.innerHTML=e.title),(!n.cache||!n._visited[e.path])&&s&&Array.isArray(s)&&s.length>0&&(c=!0,d+=s.length,function e(t){const n=document.createElement("script"),o=s[t];"string"==typeof o?(n.src=o,n.type="module"):"object"==typeof o&&o.src&&(n.src=o.src,n.type=o.type||"module"),n.onload=function(){-1===a.indexOf(n)&&(a.push(n),d===a.length?p():t<s.length-1&&e(t+1))},i.appendChild(n)}(0)),l&&"string"==typeof l){const e=document.createElement("script");e.type="text/javascript",e.innerHTML=l,i.appendChild(e),c=!0}if(o&&Array.isArray(o)&&o.length>0){c=!0;for(let e=0;e<=o.length-1;e++){const t=document.createElement("link");d++,t.rel="stylesheet",t.type="text/css",t.href=o[e],t.onload=function(){-1===a.indexOf(t)&&(a.push(t),d===a.length&&p())},i.appendChild(t)}}if(r&&"string"==typeof r){const e=document.createElement("style");e.innerHTML=r,i.appendChild(e),c=!0}function u(e){e&&(this.ontransitionend=null),n.view.innerHTML="",t.classList.add("view-content"),t.style.opacity=0,t.style.visibility="hidden",t.style.transition="opacity 0.3s ease-out, visibility 0.3s ease-out",c?(n.view.appendChild(i),n.view.appendChild(t),0===d&&p()):(n.view.appendChild(t),p())}const h=n.view.querySelector(".view-content");h?(h.ontransitionend=u,h.style.opacity=0,h.style.visibility="hidden"):u()}_addWindowEventListeners(){this._actualClickHandler=this._clickHandler.bind(this),this._actualPopstateHandler=this._popstateHandler.bind(this),document.body.addEventListener("click",this._actualClickHandler),window.addEventListener("popstate",this._actualPopstateHandler)}_clickHandler(e){const t=e.target.closest("a");if(!t)return;const n=t.pathname;t.origin===window.location.origin&&(n!==window.location.pathname||""===t.hash&&"#"!==t.href.charAt(t.href.length-1))&&0===n.indexOf(this._resolvedBase)&&this.route(this._resolvePath(n),e,!1)}_resolvePath(e){return-1!==(e=e.split("/"))[e.length-1].indexOf(".")&&(e.pop(),e.push("")),e="/"+(e=e.join("/")).replace(this._resolvedBase,"")}_popstateHandler(e){null!==e.state&&this._routeToCurrentLocation(!1)}_routeToCurrentLocation(e){this.route(this._resolvePath(window.location.pathname),void 0,e)}_removeWindowEventListeners(){document.body.removeEventListener("click",this._actualClickHandler),window.removeEventListener("popstate",this._actualPopstateHandler)}}),Smart.Router=Smart.Utilities.Router}});