UNPKG

qcobjects-sdk

Version:

QCObjects SDK is a set of Controllers, Views and Components that are elementary and useful to assist developers to build applications under MVC patterns using QCObjects, Cross Browser Javascript Framework for MVC Patterns

1 lines 146 kB
"use strict";var global=(()=>{var Wt=Object.defineProperty;var Zn=(w,r,f)=>r in w?Wt(w,r,{enumerable:!0,configurable:!0,writable:!0,value:f}):w[r]=f;var c=(w,r)=>Wt(w,"name",{value:r,configurable:!0}),It=(w=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(w,{get:(r,f)=>(typeof require<"u"?require:r)[f]}):w)(function(w){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+w+'" is not supported')});var V=(w,r)=>()=>(r||w((r={exports:{}}).exports,r),r.exports);var S=(w,r,f)=>(Zn(w,typeof r!="symbol"?r+"":r,f),f);var zt=V((Go,We)=>{c(function w(r){"use strict";if(typeof Object.defineProperty<"u"&&typeof r<"u")try{Object.defineProperty(r,"__qcobjects_sdk__",{enumerable:!0,configurable:!1,writable:!1,value:w})}catch{typeof r.__qcobjects_sdk__<"u"&&(r.__qcobjects_sdk__.__loaded__=!0)}if(typeof r.__qcobjects_sdk__.__loaded__>"u"){if(r.__qcobjects_sdk__.__loaded__=!0,typeof r>"u")throw Error("Top context empty: It should either global, module or window");var f=r;r.global=f;var p=typeof window<"u"&&typeof window.self<"u"&&window===window.self,u=typeof We<"u",v=CONFIG.get("remoteImportsPath"),g=CONFIG.get("relativeImportPath"),b=!CONFIG.get("useLocalSDK");b&&!u?CONFIG.set("remoteImportsPath","https://sdk.qcobjects.dev/v2.4/src/js/"):CONFIG.set("relativeImportPath","qcobjects-sdk/src/js/"),typeof r._DOMCreateElement>"u"&&(r._DOMCreateElement=function(y){var T;return p?T=document.createElement(y):T={},T});var O;if(p&&!u)O=[Import("org.qcobjects.i18n_messages",function(){},b),Import("org.qcobjects.models",function(){},b),Import("org.qcobjects.components",function(){},b),Import("org.qcobjects.components.grid",function(){},b),Import("org.qcobjects.components.list",function(){},b),Import("org.qcobjects.components.slider",function(){},b),Import("org.qcobjects.components.notifications",function(){},b),Import("org.qcobjects.components.splashscreen",function(){},b),Import("org.qcobjects.controllers",function(){},b),Import("org.qcobjects.controllers.grid",function(){},b),Import("org.qcobjects.controllers.list",function(){},b),Import("org.qcobjects.controllers.slider",function(){},b),Import("org.qcobjects.controllers.form",function(){},b),Import("org.qcobjects.controllers.swagger",function(){},b),Import("org.qcobjects.effects",function(){},b),Import("org.qcobjects.modal.controllers",function(){},b),Import("org.qcobjects.views",function(){},b),Import("org.qcobjects.tools.canvas",function(){},b),Import("org.qcobjects.tools.layouts",function(){},b),Import("org.qcobjects.cloud.auth.session.usertoken",function(){},b),Import("org.qcobjects.cloud.auth.session.data",function(){},b)];else{u&&CONFIG.set("remoteImportsPath",CONFIG.get("basePath",""));var G="qcobjects-sdk/src/js/";O=[Import(G+"org.qcobjects.models",function(){},b),Import(G+"org.qcobjects.components",function(){},b),Import(G+"org.qcobjects.controllers",function(){},b),Import(G+"org.qcobjects.views",function(){},b),Import(G+"org.qcobjects.effects",function(){},b),Import(G+"org.qcobjects.tools.canvas",function(){},b),Import(G+"org.qcobjects.tools.layouts",function(){},b),Import(G+"org.qcobjects.cloud.auth.session.usertoken",function(){},b),Import(G+"org.qcobjects.cloud.auth.session.data",function(){},b)]}let P=GlobalSettings.__start__.bind(r);r._sdk_=Promise.all(O).then(()=>{CONFIG.set("useSDK",!0),CONFIG.set("remoteImportsPath",v),CONFIG.set("relativeImportPath",g),P()})}},"__qcobjects_sdk__").call(null,typeof We=="object"&&typeof We.exports=="object"?We.exports=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}:typeof global=="object"?global:typeof window=="object"?window:{})});var Xt=V((Ho,Bt)=>{var Vn=zt();Bt.exports=Vn});var Zt=V((er,Pe)=>{c(function w(r){"use strict";if(typeof Object.defineProperty<"u"&&typeof r<"u")try{Object.defineProperty(r,"__qcobjects__",{enumerable:!0,configurable:!1,writable:!1,value:w})}catch{typeof r.__qcobjects__<"u"&&(r.__qcobjects__.loaded=!0)}if(typeof r.__qcobjects__.loaded>"u"){let $e=function(t){u?Ge.push(t.bind(window)):typeof f<"u"&&Ge.push(t.bind(f))};c($e,"Ready"),r.__qcobjects__.loaded=!0;var f=r;r.global=f;var p=typeof window<"u"&&"Deno"in window,u=typeof window<"u"&&typeof window.self<"u"&&window===window.self&&!p,v=typeof Pe<"u",g=c(function(){},"deno_require"),b=c(function(){return p?g(...arguments):It(...arguments)},"_require_"),O=c(function(t){var n=typeof t.prototype<"u"?t.prototype.toString:function(){return""};typeof t.prototype<"u"&&(t.prototype.toString=function(){var e=["__qcobjects__","__qcobjects_sdk__","__loaded__","ComplexStorageCache","css","append","attachIn","debug","info","warn","QC_Append","set","get","done","componentDone","_new_","__new__","Class","ClassFactory","New","Export","Package","Import","subelements","componentLoader","buildComponents","Controller","View","VO","Service","serviceLoader","JSONService","ConfigService","SourceJS","SourceCSS","ArrayList","ArrayCollection","Effect","Timer","sum","avg","table","max","min","range","matrix","matrix2d","matrix3d","unique","uniqueId","shortCode","NamespaceRef"],o;return e.includes(this.name)?o=this.name+"{ [QCObjects native code] }":o=n.call(this),o})},"_protected_code_");O(Function);var G=c(function(t){var n=[];for(var e in t)(typeof t[e]).toLowerCase()==="function"&&n.push(t[e]);return n},"_methods_");String.prototype.__mAll__=function(t){var n=[];return this.replace(t,function(){var e=Array.prototype.slice.call(arguments,0,-2);e.input=arguments[arguments.length-1],e.index=arguments[arguments.length-2],n.push(e)}),n},typeof String.prototype.matchAll>"u"&&(String.prototype.matchAll=String.prototype.__mAll__);var P=c(function(t){var n;return u?n=document.createElement(t):n={},n},"_DOMCreateElement");if(!u){let t=b("fs")}var y=c(function(t){var n=c(function(){var e=new WeakSet,o=0;return function(s,a){if(typeof a=="object"&&a!==null){if(e.has(a))return o+=1,o<=3?ct(a):null;e.add(a)}return a}},"getCircularReplacer");return JSON.stringify(t,n())},"_DataStringify");if(u){var T=c(function(n){return[...this.querySelectorAll(n)]},"subelements");Element.prototype.subelements=T,HTMLDocument.prototype.subelements=T,HTMLElement.prototype.subelements=T,typeof ShadowRoot<"u"&&(ShadowRoot.prototype.subelements=T)}if(u)try{r=typeof window.top<"u"?window.top:window,r._allowed_=!0}catch{try{r=document,r._allowed_=!0}catch{try{r=f,r._allowed_=!0}catch{r={},r._allowed_=!0}}}else typeof f<"u"&&(r=f);var L,D,ae="quick-component:not([loaded]),component:not([loaded])";if(D=function(){var t="";if(u){var n=r.document.baseURI.split("?")[0].split("/");n.pop(),t=n.join("/")+"/"}else{var e;try{e=b("process")}catch{}typeof e<"u"?t=`${e.cwd()}/`:t=""}return t}(),u){"Promise"in r||(r.Promise=function(t){var n={then(){},catch(){},_then(e){this.then.call(n,e)},_catch(e){this.catch.call(n,e)}};return t.call(n,n._then,n._catch),n}),typeof r.console>"u"&&(r.console=function(){},r.console.prototype.log=function(t){}),L=function(){return typeof document<"u"&&document.domain!==""?document.domain:"localhost"}();var le=function(){var t=r[(![]+[])[+!+[]+ +!+[]]+(typeof![])[+!+[]]+(typeof[])[(+!+[]+ +!+[])*(+!+[]+ +!+[])]+(![]+[])[+!+[]]+(!![]+[])[+[]]+([]+[]+[][[]])[+[+!+[]+[+[]]]/(+!+[]+ +!+[])]+(typeof![])[+!+[]]+([]+[]+[][[]])[+!+[]]]["h"+(typeof![])[+!+[]]+(![]+[])[+!+[]+(+!+[]+ +!+[])]+(!![]+[])[+[]]].toLowerCase();return t}(),he=function(){return typeof cordova<"u"}()}else{var le="secret";L="localhost"}r._asyncLoad=[];var be=c(function(t,n){var e={func:t,args:n,dispatch(){this.func.apply(null,this.args)}};return r._asyncLoad.push(e),e},"asyncLoad");if(u){var ee=c(function(){document.readyState==="complete"&&r._asyncLoad.map(function(t){t.dispatch.call(t)})},"_fireAsyncLoad");document.onreadystatechange=ee}else typeof r.global<"u"&&(r.global._fireAsyncLoad=function(){r._asyncLoad.map(function(t){t.dispatch.call(t)})});r.asyncLoad=be;var E=c(function(){return{debugEnabled:!0,infoEnabled:!0,warnEnabled:!0,debug(t){this.debugEnabled&&console.log("\x1B[35m%s\x1B[0m",`[DEBUG][${performance.now().toLocaleString()}] ${t}`)},info(t){var n;this.infoEnabled&&(u?n="\x1B[103m%s\x1B[0m":n="\x1B[33m%s\x1B[0m",console.info(n,`[INFO][${performance.now().toLocaleString()}] ${t}`))},warn(t){this.warnEnabled&&console.warn("\x1B[31m%s\x1B[0m",`[WARN][${performance.now().toLocaleString()}] ${t}`)}}},"Logger"),l=new E;l.debugEnabled=!1,l.infoEnabled=!0,r.logger=l;var U={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode(t){var n="",e,o,s,a,i,d,h,m=0;for(t=U._utf8_encode(t);m<t.length;)e=t.charCodeAt(m++),o=t.charCodeAt(m++),s=t.charCodeAt(m++),a=e>>2,i=(e&3)<<4|o>>4,d=(o&15)<<2|s>>6,h=s&63,isNaN(o)?d=h=64:isNaN(s)&&(h=64),n=n+this._keyStr.charAt(a)+this._keyStr.charAt(i)+this._keyStr.charAt(d)+this._keyStr.charAt(h);return n},decode(t){var n="",e,o,s,a,i,d,h,m=0;for(t=t.replace(/[^A-Za-z0-9+/=]/g,"");m<t.length;)a=this._keyStr.indexOf(t.charAt(m++)),i=this._keyStr.indexOf(t.charAt(m++)),d=this._keyStr.indexOf(t.charAt(m++)),h=this._keyStr.indexOf(t.charAt(m++)),e=a<<2|i>>4,o=(i&15)<<4|d>>2,s=(d&3)<<6|h,n=n+String.fromCharCode(e),d!==64&&(n=n+String.fromCharCode(o)),h!==64&&(n=n+String.fromCharCode(s));return n=U._utf8_decode(n),n},_utf8_encode(t){t=t.replace(/rn/g,"n");for(var n="",e=0;e<t.length;e++){var o=t.charCodeAt(e);o<128?n+=String.fromCharCode(o):o>127&&o<2048?(n+=String.fromCharCode(o>>6|192),n+=String.fromCharCode(o&63|128)):(n+=String.fromCharCode(o>>12|224),n+=String.fromCharCode(o>>6&63|128),n+=String.fromCharCode(o&63|128))}return n},_utf8_decode(t){for(var n="",e=0,o=0,s=0,a=0,i;e<t.length;)o=t.charCodeAt(e),o<128?(n+=String.fromCharCode(o),e++):o>191&&o<224?(a=t.charCodeAt(e+1),n+=String.fromCharCode((o&31)<<6|a&63),e+=2):(a=t.charCodeAt(e+1),i=t.charCodeAt(e+2),n+=String.fromCharCode((o&15)<<12|(a&63)<<6|i&63),e+=3);return n}},Y=c(function(t,n){var e=c(function(o,s){var a=2e3,i=0,d=setInterval(function(){s.call()?(clearInterval(d),o.call(),l.debug("Ejecuting "+o.name+" after wait")):i<a?(i+=1,l.debug("WAIT UNTIL "+o.name+" is true, "+i.toString()+" cycles")):(l.debug("Max execution time for "+o.name+" expression until true"),clearInterval(d))},1)},"_waitUntil");setTimeout(function(){e(t,n)},1)},"waitUntil");if(typeof x>"u")var x={getItem(t){return Object.hasOwnProperty.call(this,t)?this[t]:null},setItem(t,n){this[t]=n},removeItem(t){delete this[t]}};var A=c(function(t){var n,e,o;if(n=t.index,typeof n<"u"){e=t.load,o=t.alternate;var s=this.getID(n),a=x.getItem(s);if(this.isEmpty(a)){var i=e.call(null,{cachedObjectID:s,cachedResponse:a,cache:this});this.save(n,i),l.debug("RESPONSE OF {{cachedObjectID}} CACHED".replace("{{cachedObjectID}}",s))}else{var d=o.call(null,{cachedObjectID:s,cachedResponse:a,cache:this});l.debug("RESPONSE OF {{cachedObjectID}} IS ALREADY CACHED ".replace("{{cachedObjectID}}",s))}}else throw new Error("ComplexStorageCache: index is undefined");return this},"ComplexStorageCache");if(A.prototype.getItem=function(t){var n=x.getItem(t);return this.isEmpty(n)?null:JSON.parse(n)},A.prototype.setItem=function(t,n){x.setItem(t,y(n))},A.prototype.isEmpty=function(t){var n=!1;switch(!0){case typeof t>"u":case(typeof t=="string"&&t===""):case(typeof t=="string"&&t==="undefined"):case(typeof t=="number"&&t===0):case t===null:n=!0;break;default:n=!1}return n},A.prototype.getID=function(t){var n;return typeof t<"u"&&(n="cachedObject_"+U.encode(y(t).replace(/\{|\}|,/g,"_"))),n},A.prototype.save=function(t,n){var e=this.getID(t);l.debug("CACHING THE RESPONSE OF {{cachedObjectID}} ".replace("{{cachedObjectID}}",e)),this.setItem(e,n)},A.prototype.getCached=function(t){var n=this.getID(t);return this.getItem(n)},A.prototype.clear=function(){Object.keys(x).filter(function(t){return t.startsWith("cachedObject_")}).map(function(t){x.removeItem(t)})},u){var Fe=!1;try{var Oe=Object.defineProperty({},"passive",{get(){return Fe=!0,Fe}});window.addEventListener("testPassive",null,Oe),window.removeEventListener("testPassive",null,Oe)}catch{}var ze=c(function(){return Fe?{passive:!0}:!1},"captureFalse")}u&&(Element.prototype.find=function(t){var n=[],e=document.subelements(t);return e.map(function(o,s){typeof e[s]<"u"&&e[s].parentNode.tagName===this.parentNode.tagName&&n.push(De(o,new Object))}),n});var _e,ko=function(){var t=Object.prototype.hasOwnProperty;return function(n){if(typeof n!="object")throw TypeError("Object prototype may only be an Object or null. The type is "+typeof n);var e=c(function(){},"QCObjects");e.prototype=n;var o=new e;if(arguments.length>1){var s=Object(arguments[1]);for(var a in s)t.call(s,a)&&(o[a]=s[a])}return o}}();typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:c(function(n,e){"use strict";if(n===null)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(n),s=1;s<arguments.length;s++){var a=arguments[s];if(a!==null)for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(o[i]=a[i])}return o},"assign"),writable:!0,configurable:!0});var Rt=c(function(t){return!!(typeof t=="function"&&t.toString().startsWith("class"))},"__is_raw_class__"),ct=c(function(t){var n;switch(!0){case typeof t=="string":n=t;break;case typeof t=="number":n=t;break;case typeof t=="object":n=Object.assign({},t);break;case typeof t=="function":n=t.bind({});break;case Rt(t):n=c(class extends t{},"_value_");break;default:break}return n},"_LegacyCopy"),pe={},de={},ut=[],Ge=[],Be=c(function(t){var n="";return typeof t=="function"&&Object.hasOwnProperty.call(t,"name")&&t.name!==""?n=t.name:typeof t<"u"&&typeof t.constructor=="function"&&t.constructor.name!==""?n=t.constructor.name:typeof t<"u"&&typeof t.constructor=="object"&&(n=t.constructor.toString().replace(/\[(.*?)\]/g,"$1").split(" ").slice(1).join("")),n},"ObjectName"),De=c(function(t,n){for(var e in t)if(typeof t[e]<"u")try{n[e]=t[e]}catch{}return n},"_Cast"),Te=c(function(t,n){for(var e in t)if(typeof t[e]<"u"&&typeof t[e]!="function")try{n[e]=t[e]}catch{}else if(typeof t[e]=="function")try{n[e]=t[e].bind(n)}catch(o){l.warn(o)}return n},"_CastProps"),Dn=c(function(){return["__proto__","prototype","Object","Map","defineProperty","indexOf","toString","__instanceID"].indexOf(arguments[0])!==-1},"__is__forbidden_name__"),ye=c(function(n){var e="";switch(!0){case(Rt(n)&&!!n.name):e=n.name;break;case(typeof n=="object"&&!!n.constructor&&!!n.constructor.name&&n.constructor.name!==""):e=n.constructor.name;break;case(!!n&&!!n.__classType&&n.__classType!==""):e=n.__classType;break;case(!!n&&!!n.__definition&&!!n.__definition.__classType&&n.__definition.__classType!==""):e=n.__definition.__classType;break;case(typeof n=="function"&&!!n.name):e=n.name;break;default:e=Be(n);break}return e},"__getType__"),Ae=c(function(n,e){return!!(typeof n<"u"&&n!==null&&((Ie(n)||He(n))&&n.hierarchy().includes(e)||ye(n)===e||Be(n)===e||typeof n===e))},"is_a"),ft=c(function(t){if(typeof t<"u")if(u)try{r[t.name]=t,window[t.name]=t}catch{}else typeof f<"u"&&(Object.hasOwnProperty.call(f,t.name)||(f[t.name]=t))},"__make_global__"),kt=c(function(t,n){var e=t.name||ye(t);return t.__definition.__classType=e,typeof n<"u"&&(t.__definition.__namespace=n),pe[e]=t,r[e]=pe[e],r[e]},"__register_class__"),pt=c(function(t,n){return kt(t,n)},"RegisterClass");ft(pt);var me=c(function(){var t={},n,e,o;switch(arguments.length){case 0:return class{};case 1:n=arguments[0],e=c(class{},"type"),o={};break;case 2:n=arguments[0],e=c(class{},"type"),o=arguments[1];break;case 3:n=arguments[0],e=arguments[1],o=arguments[2];break;default:break}if(typeof e!="function")throw new Error("Class type must be a function or class");if(Dn.call(this,n))throw new Error(`${n} is not an allowed word in the name of a class`);return typeof e.__definition<"u"&&(o.__definition=Object.assign(ct(e.__definition),e)),t[e.name]=e,typeof o>"u"||o===null?o={}:o=ct(o),typeof o.__instanceID<"u"&&delete o.__instanceID,pe[n]=class extends t[e.name]{constructor(){var a;arguments.length>0?a={...arguments[0]}:a={};super(a);S(this,"__classType",n);S(this,"__definition",{...o});let i=this;if(_e=typeof _e>"u"||_e===null?0:_e+1,i.__instanceID||Object.defineProperty(i,"__instanceID",{value:_e,writable:!1}),typeof i.__definition<"u"&&Object.keys(i.__definition).filter(function(d){return isNaN(d)&&!["name","__instanceID","__classType","__definition"].includes(d)}).forEach(function(d){typeof i.__definition[d]=="function"?i[d]=i.__definition[d].bind(i):i[d]=i.__definition[d]}),G(pe[i.__classType]).map(function(d){i[d.name]=d.bind(i)}),G(i.__definition).map(function(d){i[d.name]=d.bind(i)}),i.body)if(typeof i.__definition>"u"||!Object.hasOwnProperty.call(i.__definition,"body")||typeof i.__definition.body>"u")try{u?i.body=P(i.__definition.__classType):i.body={}}catch{i.body={}}else Object.hasOwnProperty.call(i.__definition,"body")&&(i.body=i.__definition.body);try{if(typeof i.__new__=="function"?i.__new__.call(i,a):typeof super.__new__=="function"&&(i.__new__=super.__new__.bind(i),i.__new__.call(i,a)),typeof i=="object"&&Object.hasOwnProperty.call(i,"_new_")&&typeof i._new_.isCalled>"u")try{i._new_.call(i,a),i._new_.isCalled=!0}catch(d){l.warn(`${i.__classType}._new_() failed with error: ${d}`)}}catch(d){l.warn(d)}}static hierarchy(a){var i=c(function(m){return Object.hasOwnProperty.call(m,"__classType")?m.__classType:ye.call(a,m)},"__classType"),d=c(m=>typeof m<"u"&&typeof m.__proto__<"u"&&m.__proto__!==null?(i(m)!==""?[i(m)]:[]).concat(d(m.__proto__)):[],"__hierarchy__proto__");(typeof a>"u"||a===null)&&(a=this);var h=[];return h.push(i(a)),h=h.concat(d(a.__proto__)),h}static getParentClass(){return Object.getPrototypeOf(this.prototype.constructor)}__new__(a){Te(a,this)}_new_(){}getClass(){return Object.getPrototypeOf(this.constructor)}css(a){return typeof this.body<"u"&&this.body.style!=="undefined"&&(l.debug("body style"),this.body.style=De(a,this.body.style)),this.body.style}hierarchy(){var a=this;return this.getClass().hierarchy(a)}append(i){l.debug("append: start"),Ae(i,"Component")&&(l.debug("append: child is a Component"),l.debug(`appending the body of ${i.name}`));var i=arguments.length>0?arguments[0]:this.body;typeof this.body<"u"&&(l.debug("append element"),arguments.lenght>0?(l.debug("append to element"),this.body.append(i),typeof this.childs>"u"&&(this.childs=[]),this.childs.push(i)):u&&(l.debug("append to body"),document.body.append(i)))}attachIn(a){if(u)for(var i=document.subelements(a),d=0,h=i.length;d<h;d++)i[d].append(this);else throw new Error("attachIn not yet implemented for non browser platforms")}},pe[n]=Te(o,pe[n]),pe[n].__definition=o,pe[n].__definition.__classType=n,pe[n].__definition.__new__=c(function(a){Te(a,this)},"__new__"),r[n]=pe[n],r[n]},"Class");me.prototype.toString=function(){return"Class(name, type, definition) { [QCObjects native code] }"};var C=c(function(t){var n;if(t!==null&&t.indexOf(".")>-1){var e=t.split(".").slice(0,t.split(".").length-1).join("."),o=t.split(".").slice(-1).join(""),s=ne(e),a=typeof s<"u"?s.filter(i=>Ie(i)&&(i.__definition.__classType===o||typeof i=="function"&&!!i.name)).reverse():[];if(a.length>0)n=a[0];else throw Error(`Class ${t} not found.`)}else t!==null&&Object.hasOwnProperty.call(pe,t)&&(n=pe[t]);return n},"ClassFactory");u&&(Element.prototype.append=c(function(n){He(n)||typeof n.body<"u"?this.appendChild(n.body):this.appendChild(n)},"QC_Append"),Element.prototype.render=c(function(n){var e=this,o=c(function(s,a){if(typeof document.implementation.createHTMLDocument<"u"){var i=document.implementation.createHTMLDocument("");i.innerHTML=a,i.body.subelements("*").map(function(d){return s.append(d)})}},"_appendVDOM");if(typeof this.innerHTML<"u")try{this.innerHTML+=n}catch{o(e,n)}else o(e,n)},"QC_Render"));var qt=c(function(t,n,e){return C(t)[n]},"_super_");qt.prototype.toString=function(){return"_super_(className,classMethodName,params) { [QCObjects native code] }"};var te=c(function(t,n){return n=arguments.length>1?n:{},typeof t>"u"?new Object:new t(n)},"New");te.prototype.toString=function(){return"New(QCObjectsClassName, args) { [QCObjects native code] }"};var F=c(function(t){return ft(t)},"Export");if(F.prototype.toString=function(){return"Export(function or symbol) { [QCObjects native code] }"},!u){var Xe=c(function(t){let n=b("fs");var e=null;try{var o=[`${r.CONFIG.get("projectPath")}${r.CONFIG.get("relativeImportPath")}`,`${r.CONFIG.get("basePath")}${r.CONFIG.get("relativeImportPath")}`,`${r.CONFIG.get("projectPath")}`,`${r.CONFIG.get("basePath")}`,`${r.CONFIG.get("relativeImportPath")}`,`${process.cwd()}${r.CONFIG.get("relativeImportPath")}`,`${process.cwd()}/node_modules/`+t,`${process.cwd()}/node_modules`,`${process.cwd()}`,"node_modules","./",""].concat(Pe.paths);o=o.filter(s=>n.existsSync(s+"/"+t)),o.length>0&&(e=o[0],l.info(t+" is Installed."))}catch(s){console.log(s)}return e},"findPackageNodePath");F(Xe)}me("_Crypt",Object,{last_string:"",last_key:"",construct:!1,_new_(t){var n=t.string,e=t.hasOwnProperty.call(t,"key")?t.key:null;this.__new__(t),e=e===null?this.__instanceID:e,this.last_key=e,this.last_string=n,this.construct=!0},_encrypt(){for(var t=this.string,n=this.key,e="",o,s,a=0;a<t.length;a++)o=t.substr(a,1),s=n.substr(a%n.length-1,1),o=String.fromCharCode(o.charCodeAt(0)+s.charCodeAt(0)),e+=o;return this.last_string=U.encode(e),this.last_string},_decrypt(){var t=this.string,n=this.key,e="",o,s;t=U.decode(t);for(var a=0;a<t.length;a++)o=t.substr(a,1),s=n.substr(a%n.length-1,1),o=String.fromCharCode(o.charCodeAt(0)-s.charCodeAt(0)),e+=o;return this.last_string=e,this.last_string},encrypt(t,n){var e=te(C("_Crypt"),{string:t,key:n!==""?n:"12345678ABC"});return e._encrypt()},decrypt(t,n){var e=te(C("_Crypt"),{string:t,key:n!==""?n:"12345678ABC"});return e._decrypt()}});var Hn=c(function(t){return C("_Crypt").encrypt(y(t),le)},"_CryptObject"),Lt=c(function(t){return t===""?{}:JSON.parse(C("_Crypt").decrypt(t,le))},"_DecryptObject"),Ft=c(function(){var t=1e3,n=C("_Crypt").encrypt((Math.random()*t).toString().replace(".",""),new Date().getTime().toString()),e=C("_Crypt").encrypt((Math.random()*t).toString().replace(".",""),new Date(new Date().getTime()-1e3*1e3).getTime().toString()),o=e.list().map((s,a)=>n.list()[a]===s?null:s).filter(s=>s!==null).join("");return o},"shortCode"),qo=Ft;me("InheritClass",class{},{});let we=class extends C("InheritClass"){constructor(){super(...arguments);S(this,"component",null);S(this,"__definition",{});S(this,"__classType","Processor");this.processors=we.processors,this.process=we.process.bind(this),this.processObject=we.processObject.bind(this),this.setProcessor=we.setProcessor.bind(this),this.execute=we.execute.bind(this)}static setProcessor(e){typeof e=="function"&&e.name!==""&&(this.processors[e.name]=e)}static execute(e,o,s){var a=typeof e<"u"&&e!==null?e.processorHandler:this;return a.processors[o].bind(a).apply(a,[e,...s.split(",")])}static process(e,o=null){var s=o!==null?o.processorHandler:te(we,{component:null});return typeof e=="string"&&Object.keys(s.processors).map(function(a){[...e.matchAll(new RegExp("\\$"+a+"\\((.*)\\).*","g"))].map(function(i){var d=`$${a}(${i[1]})`;e=e.replace(d,s.execute.bind(s).call(s,o,a,i[1]))})}),e}static processObject(e,o=null){var s=o===null?this:o.processorHandler;return typeof s>"u"&&(s=new we({component:o})),typeof e=="object"?Object.keys(e).map(function(a){typeof e[a]=="object"&&!e[a].hasOwnProperty.call(e[a],"call")?e[a]=s.processObject.bind(s)(e[a],o):typeof e[a]=="string"&&(e[a]=s.process.bind(s)(e[a],o))}):typeof e=="string"&&(e=s.process.bind(s)(e,o)),e}},oe=we;c(oe,"Processor"),S(oe,"processors",{config(e,o){return r.CONFIG.get(o,"")},ENV(e,o){return typeof process<"u"?process.env[o]:""},global(e,o){return typeof f<"u"?f[o]:""}}),oe.__definition={},oe.__classType="Processor",pt(oe,"com.qcobjects"),ft(oe);let Ot=class{static get instance(){if(this._instance===null){var n=new Ot;n._CONFIG={relativeImportPath:"",remoteImportsPath:"",remoteSDKPath:"https://sdk.qcobjects.dev/v2.4/",asynchronousImportsLoad:!1,removePackageScriptAfterLoading:!0,componentsBasePath:"",delayForReady:0,preserveComponentBodyTag:!1,useConfigService:!1,routingWay:"hash",useSDK:!0,useLocalSDK:!1,basePath:D},n._CONFIG_ENC=null,this._instance=n}return this._instance}static set instance(n){this._instance=n}},je=Ot;c(je,"ConfigSettings"),S(je,"_instance",null),S(je,"_CONFIG_ENC",null),pe.ConfigSettings=je,me("CONFIG",Object,{get _CONFIG_ENC(){return C("ConfigSettings").instance._CONFIG_ENC},get _CONFIG(){return C("ConfigSettings").instance._CONFIG},set(t,n){l.debug(`CONFIG.set ${t}: ${n}`),t==="basePath"&&(D=n);var e;try{e=function(o){o._CONFIG_ENC===null&&(o._CONFIG_ENC=C("_Crypt").encrypt(y({}),le));var s=o._CONFIG_ENC.valueOf(),a=o._CONFIG.valueOf();return Te(a,Lt(s))}(C("ConfigSettings").instance)}catch(o){e={},console.error(o),l.debug("failed to encrypt config")}e[t]=n,C("ConfigSettings").instance._CONFIG_ENC=Hn(e),Object.hasOwnProperty.call(C("ConfigSettings").instance,"_CONFIG")&&Object.hasOwnProperty.call(C("ConfigSettings").instance._CONFIG,t)&&(C("ConfigSettings").instance._CONFIG[t]=n)},get(t,n){var e;try{var o=function(s){s._CONFIG_ENC===null&&(s._CONFIG_ENC=C("_Crypt").encrypt(y({}),le));var a=s._CONFIG_ENC.valueOf(),i=s._CONFIG.valueOf();return Te(i,Lt(a))}(C("ConfigSettings").instance);typeof o[t]<"u"?e=o[t]:typeof n<"u"&&(e=n)}catch(s){console.error(s),l.debug("Something wrong when trying to get CONFIG values"),l.debug("No config value for: "+t),e=n}return oe.processObject.call(oe,e)}}),F(Y),F(qt),F(A),F(C),F(P),F(Ft),F(ye),F(Ae);var He=c(function(t){return!!(typeof t=="object"&&Object.hasOwnProperty.call(t,"__classType")&&t.__instanceID&&Object.hasOwnProperty.call(t,"__definition")&&typeof t.__definition<"u")},"isQCObjects_Object"),Ie=c(function(t){return!!(typeof t=="function"&&!t.__instanceID&&t.__definition&&typeof t.__definition<"u"&&t.__definition.__classType)},"isQCObjects_Class"),ne=c(function(t,n){return de.hasOwnProperty.call(de,t)&&typeof de[t]<"u"&&de[t].hasOwnProperty.call(de[t],"length")&&de[t].length>0&&typeof n<"u"&&n.hasOwnProperty.call(n,"length")&&n.length>0?(n.filter(function(e){return Ie(e)}).map(function(e){e.__definition.__namespace=t,e.__namespace=t}),de[t]=de[t].concat(n)):typeof n<"u"&&(typeof n=="object"&&n.hasOwnProperty.call(n,"length")?n.filter(function(e){return Ie(e)}).map(function(e){e.__definition.__namespace=t,e.__namespace=t}):Ie(n)&&(n.__definition.__namespace=t,n.__namespace=t),de[t]=n),Object.hasOwnProperty.call(de,t)&&de[t].map(function(e){kt(e,t)}),Object.hasOwnProperty.call(de,t)?de[t]:void 0},"Package");ne.prototype.toString=function(){return"Package(namespace, classes) { [QCObjects native code] }"},ne("com.qcobjects",[oe]);var $n=c(function(t){let e=ne(t).filter(o=>Ie(o)).map(o=>({[o.__definition.__classType]:o})).reduce((o,s)=>Object.assign(o,s));return t.split(".").map(o=>({[o]:e})).reverse().reduce((o,s)=>(s[Object.keys(s)]=o,s))},"NamespaceRef"),ht=c(function(){var t,n=c(function(){},"ready"),e=!1;if(!(arguments.length<1)){arguments.length===1?t=arguments[0]:arguments.length===2?(t=arguments[0],n=arguments[1]):arguments.length>2&&(t=arguments[0],n=arguments[1],e=arguments[2],l.debug("[Import] Setting external="+e.toString()+" resource to import: "+t)),e?l.debug("[Import] Registering external resource to import: "+t):l.debug("[Import] Registering local resource to import: "+t);var o;return u?(o=new Promise(function(s,a){var i=c(function(){var m=!1,_=0;for(var I in de)_++;return _<ut.length?m=!1:m=!0,m},"allPackagesImported"),d=c(function(m){ut.push(n),i()&&ut.map(function(_){Ge.push(_)}),u&&r.CONFIG.get("removePackageScriptAfterLoading")&&m.target.remove(),s.call(o,{_imported_:m.target,_package_name_:t})},"readyImported");if(!de.hasOwnProperty.call(de,t)){var h=P("script");h.type=r.CONFIG.get("sourceType","text/javascript"),h.async=!!r.CONFIG.get("asynchronousImportsLoad"),h.onreadystatechange=function(){h.readyState==="complete"&&d.call()},h.onload=d,h.onerror=function(m){a.call(o,{_imported_:h,_package_name_:t})},h.src=e?r.CONFIG.get("remoteImportsPath")+t+".js":D+r.CONFIG.get("relativeImportPath")+t+".js",document.getElementsByTagName("head")[0].appendChild(h)}}),o.catch(function(){l.debug("Import: Error loading a package ")})):o=new Promise(function(s,a){try{var i=Xe(t),d="";if(i!==null)d=i+"/"+t;else{var h=Xe(t+".js");h!==null?d=h+"/"+t+".js":d=D+r.CONFIG.get("relativeImportPath")+t}try{s.call(o,{_imported_:b(`${d}`),_package_name_:t})}catch(m){a.call(o,{_imported_:null,_package_name_:t,error:m})}}catch(m){a.call(o,{_imported_:null,_package_name_:t,error:m})}}).catch(function(s){l.debug("Something happened when importing "+t),console.warn(s)}),o.catch(function(s){l.warn(y(s))}),o}},"Import");ht.prototype.toString=function(){return"Import(packagename,ready,external) { [QCObjects native code] }"},u&&(Element.prototype.Cast=c(function(e){e.__definition.body=this;var e=te(e);return e},"QC_Object")),me("TagElements",Array,{show(){this.map(function(t){return t.style.opacity=1})},hide(){this.map(function(t){return t.style.opacity=0})},effect(){var t=[...arguments].slice(1),n=arguments[0];(typeof n).toLowerCase()==="string"&&(n=C(n)),this.map(function(e){return n.apply.apply(n,[e].concat(t))})},findElements(t){var n=te(C("TagElements"));if(u)for(var e in this)typeof e=="number"&&typeof this[e]!="function"&&this[e].hasOwnProperty.call(this[e],"subelements")&&n.push(this[e].subelements(t));return n}});var Un=c(function(t,n){var e=te(C("TagElements"));if(u)for(var o=document.subelements(t),s=[],a=0;a<o.length;a++)typeof n<"u"&&o[a].hasOwnProperty.call(o[a],"innerHTML")&&(o[a].innerHTML=n),s.indexOf(a)<0&&(e.push(o[a]),s.push(a));return e},"Tag"),Wn=$e,mt=c(function(t){var n=c(function(){Ge.map(function(e,o){typeof e=="function"&&(e.call(),delete Ge[o])})},"_execReady");r.CONFIG.get("delayForReady")>0?u?setTimeout(n.bind(window),r.CONFIG.get("delayForReady")):typeof f<"u"&&setTimeout(n.bind(f),r.CONFIG.get("delayForReady")):n.call(r)},"_Ready");u?(window.onload=mt,he&&document.addEventListener("deviceready",mt,ze)):f.onload=mt;class Ut extends C("InheritClass"){constructor({instance:n,name:e,fget:o,fset:s,value:a}){super({instance:n,name:e,fget:o,fset:s,value:a}),this._new_({instance:n,name:e,fget:o,fset:s,value:a})}_new_({instance:n,name:d,fget:o,fset:s,value:a}){var i=this,d=typeof d>"u"?Be(i):d;Object.defineProperty(n,d,{set(h){let m=h;l.debug("value changed "+d);var _;typeof s<"u"&&typeof s=="function"?_=s(m):_=m,n["_"+d]=_},get(){let h=n["_"+d];l.debug("returning value "+d);var m=c(function(I){return typeof I=="object"&&Object.hasOwnProperty.call(I,"value")?I.value:I},"is_ddo"),_;return typeof o<"u"&&typeof o=="function"?_=o(m(h)):_=m(h),_}})}}c(Ut,"DDO"),F(Ut);class wt{constructor({component:n,template:e}){S(this,"template","");S(this,"__definition",{});this.component=n,this.template=e}assign(n){var e=this;if(typeof e.component>"u")throw new Error("DefaultTemplateHandler.assign: component is undefined");if(typeof e.component.processorHandler>"u")throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined");var o=e.component.processorHandler;o.component=e.component;var s=typeof e.template<"u"?e.template:"";typeof n=="object"?[...Object.keys(n)].map(function(a){var i=n[a];if(typeof i=="string"||typeof i=="number"||!isNaN(i))try{i=oe.processObject.bind(o).call(o,i,e.component),s=s.replace(new RegExp(`{{${a}}}`,"g"),i)}catch(d){throw l.warn(`${e.component.name} could not parse processors.`),Error(`${e.component.name} could not parse processors. Reason: ${d.message}`)}}):l.debug(`${e.component.name}.data is not an object`);try{s=oe.processObject.call(o,s,e.component)}catch(a){throw l.warn(`${e.component.name} could not parse processors.`),Error(`${e.component.name} could not parse processors. Reason: ${a.message}`)}return s}}c(wt,"DefaultTemplateHandler"),wt.__definition={},pt(wt,"com.qcobjects");var zn=c(function(t,n){let e=t.path.replace(/{(.*?)}/g,"(?<$1>.*)");return{...[...n.matchAll(new RegExp(e,"g"))][0].groups}},"__routing_params__"),Bn=c(function(t,n){return t.filter(function(e){var o=e.path.replace(/{(.*?)}/g,"(?<$1>.*)");return new RegExp(o,"g").test(n)}).reverse()},"__valid_routings__"),Gt=c(function(t,n){return t.includes(n)},"__valid_routing_way__"),Xn=c(function(t,n){var e=t.getAttribute("shadowed")===null,o=t.getAttribute("template-source")===null,s=t.getAttribute("shadowed")==="true",a=t.getAttribute("cached")===null,i=t.getAttribute("cached")==="true",d=typeof r.CONFIG.get("tplextension")<"u"?r.CONFIG.get("tplextension"):"html";d=t.getAttribute("tplextension")!==null?t.getAttribute("tplextension"):d;var h=t.getAttribute("name"),m=t.getAttribute("componentClass")!==null?t.getAttribute("componentClass"):"Component";let _=r.CONFIG.get("preserveComponentBodyTag")?h!==null?"com.qcobjects.components."+h+".ComponentBody":"com.qcobjects.components.ComponentBody":m;h=h!==null?h:C(_)&&typeof C(_).name<"u"?C(_).name:"";var I=C(_),N=_!=="Component"&&typeof I<"u"&&typeof I.tplsource=="string"&&I.tplsource!=="",H=o&&N?I.tplsource:o?"default":t.getAttribute("template-source");l.debug(`template source for ${h} is ${H} `),l.debug(`type for ${h} is ${ye(I)} `);var M;M=gt({COMPONENTS_BASE_PATH:r.CONFIG.get("componentsBasePath"),COMPONENT_NAME:h,TPLEXTENSION:d,TPL_SOURCE:H}),r.CONFIG.get("preserveComponentBodyTag")&&ne(h!==""?"com.qcobjects.components."+h:"com.qcobjects.components",[me("ComponentBody",C("Component"),{name:h,tplsource:H,tplextension:d,reload:!0})]);var j=c(function(){var B=e?I&&I.shadowed||C("Component").shadowed:s,K={__parent__:n,name:h,cached:a?C("Component").cached:i,shadowed:B,tplextension:d,body:r.CONFIG.get("preserveComponentBodyTag")?P("componentBody"):t,templateURI:M,tplsource:H};(typeof h>"u"||h===""||h===null)&&delete K.name,M===""&&delete K.templateURI;var Q=te(I,K);return r.CONFIG.get("preserveComponentBodyTag")&&t.append(Q),Q},"__create_component_instance_"),X=j.call(this);return X},"_buildComponentFromElement_"),Dt=c(function(t,n){var e=[];return u?e=t.map(function(o){return Xn(o,n)}):l.debug("[_buildComponentsFromElements_] not implemented for Non-Browser environments"),e},"_buildComponentsFromElements_");ne("com.qcobjects",[c(class extends C("InheritClass"){constructor({templateURI:e="",template:o,tplsource:s="default",url:a="",name:i="",method:d="GET",data:h={},reload:m=!1,shadowed:_=!1,cached:I=!0,_body:N=P("div"),__promise__:H=null,__shadowRoot:M,body:j,shadowRoot:X,splashScreenComponent:B,controller:K,view:Q}){super(...arguments);S(this,"validRoutingWays",["pathname","hash","search"]);S(this,"basePath",D);S(this,"domain",L);S(this,"templateHandler","DefaultTemplateHandler");S(this,"processorHandler",null);S(this,"routingWay",null);S(this,"routingNodes",[]);S(this,"routings",[]);S(this,"routingPath","");S(this,"routingPaths",[]);S(this,"_componentHelpers",[]);S(this,"subcomponents",[]);S(this,"splashScreenComponent");S(this,"controller");S(this,"view");S(this,"effect");S(this,"method","GET");S(this,"cached",!0);S(this,"__promise__",null);S(this,"__namespace");var W=this;typeof W.name>"u"&&l.warn("A name is not defined for "+ye(W)),W.routingWay=r.CONFIG.get("routingWay"),W.processorHandler=te(oe,{component:W}),W.data=typeof W.data>"u"||W.data===null?{}:W.data,W.data=Object.assign(W.data,W.dataAttributes),W.createServiceInstance().then(function(Ze){typeof W.__new__=="function"&&W.__new__.call(W,W),W._generateRoutingPaths(W.body).then(function(){W._reroute_().then(function(){return W.rebuild().then(function(){l.info(`Component._new_ The component ${W.name} was built successfully!`)}).catch(function(Ve){l.warn(`Component._new_ Something went wrong building the component ${W.name}`),console.error(Ve)})})})})}set body(e){var o=this;o._body=e}get body(){var e=this;return e._body}set cacheIndex(e){l.debug("[cacheIndex] This property is readonly")}get cacheIndex(){var e=this,o=y(e.routingPath);return U.encode(e.name+o)}set parsedAssignmentText(e){l.debug("[parsedAssignmentText] This property is readonly")}get parsedAssignmentText(){var e=this;if(e._parsedAssignmentText=e.parseTemplate(e.template),typeof e._parsedAssignmentText>"u")throw Error(`[Component][${this.name}][parsedAssignmentText] Could not generate content!`);return e._parsedAssignmentText}set shadowRoot(e){var o=this;typeof o.__shadowRoot>"u"?o.__shadowRoot=e:l.debug("[shadowRoot] This property can only be assigned once!")}get shadowRoot(){var e=this;return e.__shadowRoot}set routingSelected(e){l.debug("[routingSelected] This is a read-only property of the component")}get routingSelected(){var e=this;return Bn(e.routings,e.routingPath)}set routingParams(e){l.debug("[routingParams] This is a read-only property of the component")}get routingParams(){var e=this;return[{}].concat(e.routingSelected.map(function(o){return zn(o,e.routingPath)})).reduce(function(o,s,a){return Object.assign(o,s)})}createServiceInstance(){var e=this,o=e.body,s=this.data,a,i=e.getClass().__definition,d=u&&o.getAttribute("serviceClass")!==null?o.getAttribute("serviceClass"):null;return new Promise(function(h,m){var _=!!(Object.hasOwnProperty.call(o,"enableServiceClass")&&o.enableServiceClass||!Object.hasOwnProperty.call(o,"enableServiceClass")),I=!!(u&&o.getAttribute("response-to")!==null&&o.getAttribute("response-to")==="data"),N=!!(u&&o.getAttribute("response-to")!==null&&o.getAttribute("response-to")==="template");if(_&&d!==null&&(a=C(d)),!I&&i&&Object.hasOwnProperty.call(i,"responseTo")?I=i.responseTo==="data":!I&&Object.hasOwnProperty.call(C("Component"),"responseTo")&&(I=C("Component").responseTo==="data"),!N&&i&&Object.hasOwnProperty.call(i,"responseTo")?N=i.responseTo==="template":!N&&Object.hasOwnProperty.call(C("Component"),"responseTo")&&(N=C("Component").responseTo==="template"),typeof a<"u"&&typeof _<"u"&&_===!0&&(I||N)){l.info("Loading service "+d);var H=te(a,{data:s});yt(H).then(function({request:M,service:j}){var X;typeof j.JSONresponse<"u"&&j.JSONresponse!==null?X=j.JSONresponse:X=j.template,I&&(typeof s=="object"&&typeof X=="object"?s=Object.assign(s,X):s=X,e.data=s),e.serviceInstance=H,e.serviceData=s,N&&(e.template=X),h(X)},function(M){l.debug(`Service loading rejected for ${d} in ${e.name}`),m(M)}).catch(function(M){throw l.debug("Something went wroing while trying to load the service "+d),Error(`Error loading ${d} for ${e.name}. Detail: ${M}`)})}else h(null)})}_bindroute_(){var e=this;e._bindroute_.loaded?l.debug(`Routes already bound to popstate events for ${e.name}`):(u&&e.hostElements("a").map(function(o){return o.oldclick=o.onclick,o.onclick=function(s){var a=!0;r.global.get("routingPaths")||r.global.set("routingPaths",[]);var i=r.CONFIG.get("routingWay"),d=s.target[i];return r.global.get("routingPaths").includes(d)&&s.target[i]!==document.location[i]&&s.target.href!==document.location.href?(l.debug("A ROUTING WAS FOUND: "+d),window.history.pushState({href:s.target.href},s.target.href,s.target.href),C("Component").route(),a=!1):l.debug("NO ROUTING FOUND FOR: "+d),typeof s.target.oldclick<"u"&&typeof s.target.oldclick=="function"&&s.target.oldclick.call(s.target,s),a},null}),this._bindroute_.loaded=!0)}done(e){var o;if(typeof e<"u"){var{request:s,component:a}=e;o=Promise.resolve({request:s,component:a})}return o}createControllerInstance(){var e;if(u){if(typeof this.body>"u")throw new Error("The component has no body");var o=this.body.getAttribute("controllerClass");o||(o="Controller"),e=C(o),typeof e<"u"&&(this.controller=te(e,{component:this}))}return new Promise((s,a)=>{if(u&&typeof e<"u"&&typeof this.controller<"u"){if(typeof this.controller.done=="function")try{this.controller.done.call(this.controller)}catch(i){throw Error(i)}else l.debug(`${o} does not have a done() method.`),a(`${o} does not have a done() method.`);typeof this.controller.createRoutingController=="function"?this.controller.createRoutingController.call(this.controller):l.debug(`${o} does not have a createRoutingController() method.`)}s({component:this,controller:this.controller})})}createEffectInstance(){var e=this;return new Promise(function(o,s){if(u){var a=e.body.getAttribute("effectClass"),i=e.body.getAttribute("apply-effect-to");i=i!==null?i:"load",a!==null&&i==="observe"?e.applyObserveTransitionEffect(a):a!==null&&i==="load"&&e.applyTransitionEffect(a)}o({component:e,effect:e.effect})})}createViewInstance(){var e=this;return new Promise(function(o,s){var a=u?e.body.getAttribute("viewClass"):null;if(a!==null){var i=C(a);typeof i<"u"&&(e.view=te(i,{component:e}),Object.hasOwnProperty.call(e.view,"done")&&typeof e.view.done=="function"&&e.view.done.call(e.view))}o({component:e,view:e.view})})}__done__(){var e=this,o=c(function(){if(typeof e>"u")throw new Error("componentDone() has lost its context");if(typeof e.body>"u")throw new Error("The component has no body");e.createViewInstance(),e.createControllerInstance(),e.createEffectInstance(),l.debug(`Trying to run component helpers for ${e.name}...`);try{e.runComponentHelpers(),l.debug(`Component helpers for ${e.name} executed.`)}catch(s){throw l.debug(`Component helpers for ${e.name} could not be executed.`),Error(s)}e.subcomponents=e.__buildSubComponents__(),e._bindroute_(),e.body.setAttribute("loaded",!0)},"componentDone");return new Promise(function(s,a){try{Promise.resolve(o.call(e))}catch(i){a(i)}})}hostElements(e){var o=this,s=o.shadowed&&typeof o.shadowRoot<"u"?o.shadowRoot.subelements(e):o.body.subelements(e);return s}get subtags(){var e=this,o=ae;return e.hostElements(o)}get bodyAttributes(){var e=this,o=e.body;return u?[...o.getAttributeNames()].map(s=>({[s]:o.getAttribute(s)})).reduce((s,a,i)=>Object.assign(s,a)):{}}get dataAttributes(){var e=this,o=e.body;return u?[{}].concat([...o.getAttributeNames()].filter(s=>s.startsWith("data-")).map(s=>({[s.split("-")[1]]:o.getAttribute(s)}))).reduce((s,a,i)=>Object.assign(s,a)):{}}__buildSubComponents__(e=!1){var o=this,s=o.subtags;return e||(s=s.filter(a=>a.getAttribute("loaded")!=="true")),(typeof o<"u"||o.subcomponents.length<1)&&(o.subcomponents=Dt(s,o)),o.subcomponents}fail(e){var o;if(typeof e<"u"){var{error:s,component:a}=e;o=Promise.resolve({error:s,component:a})}return o}set(e,o){this[e]=o}get(e){return this[e]}feedComponent(){var e=this;l.debug(`[Component][${this.name}][feedComponent] start feeding component...`);var o=c(function(i){if(typeof i.container>"u"&&typeof i.body>"u"){l.warn("COMPONENT {{NAME}} has an undefined container and body".replace("{{NAME}}",i.name));return}var d=typeof i.container>"u"||i.container===null?i.body:i.container,h=i.parsedAssignmentText;if(i.innerHTML=h,i.shadowed){l.debug("COMPONENT {{NAME}} is shadowed".replace("{{NAME}}",i.name)),l.debug("Preparing slots for Shadowed COMPONENT {{NAME}}".replace("{{NAME}}",i.name));var m=P("div");d.subelements("[slot]").map(function(N){N.parentElement===d&&m.appendChild(N)}),l.debug("Creating shadowedContainer for COMPONENT {{NAME}}".replace("{{NAME}}",i.name));var _=P("div");_.classList.add("shadowHost");try{i.shadowRoot=_.attachShadow({mode:"open"})}catch{try{l.debug("Shadowed COMPONENT {{NAME}} is repeated".replace("{{NAME}}",i.name)),i.shadowRoot=_.shadowRoot}catch{l.warn("Shadowed COMPONENT {{NAME}} is not allowed on this browser".replace("{{NAME}}",i.name))}}if(typeof i.shadowRoot<"u"&&i.shadowRoot!==null){i.reload?(l.debug("FORCED RELOADING OF CONTAINER FOR Shadowed COMPONENT {{NAME}}".replace("{{NAME}}",i.name)),_.shadowRoot.innerHTML=i.innerHTML):(m.innerHTML=i.parseTemplate(m.innerHTML),l.debug("ADDING Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}",i.name)),_.shadowRoot.innerHTML+=i.innerHTML),l.debug("ADDING Slots to Shadowed COMPONENT {{NAME}} ".replace("{{NAME}}",i.name)),_.innerHTML+=m.innerHTML,l.debug("APPENDING Shadowed COMPONENT {{NAME}} to Container ".replace("{{NAME}}",i.name));var I=d.querySelector(".shadowHost");typeof I<"u"&&I!==null?(l.debug("Shadowed Container for COMPONENT {{NAME}} is already present in the tree ".replace("{{NAME}}",i.name)),i.shadowRoot.innerHTML=_.shadowRoot.innerHTML):d.appendChild(_)}else l.warn("Shadowed COMPONENT {{NAME}} is bad configured".replace("{{NAME}}",i.name))}else i.reload?(l.debug("FORCED RELOADING OF CONTAINER FOR COMPONENT {{NAME}}".replace("{{NAME}}",i.name)),d.innerHTML=i.innerHTML):d&&i?(l.debug("ADDING COMPONENT {{NAME}} ".replace("{{NAME}}",i.name)),d.innerHTML+=i.innerHTML):l.warn("COMPONENT {{NAME}} is not added to the DOM".replace("{{NAME}}",i.name))},"_feedComponent_InBrowser"),s=c(function(i){var d=i.parsedAssignmentText;i.innerHTML=d},"_feedComponent_InNode"),a;if(!Ae(e,"Component")){l.warn("Trying to feed a non component object");return}return u?a=o(e):a=s(e),a}rebuild(){var e=this,o=new Promise(function(s,a){if((typeof e>"u"||e===null)&&a("Component is undefined"),He(e)&&Ae(e,"Component"))switch(!0){case e.get("tplsource")==="none":l.debug("Component "+e.name+" has specified template-source=none, so no template load was done");var i={request:null,component:e};e.__done__().then(function(){typeof e.done=="function"&&e.done.call(e,i),s.call(o,i)},function(){a.call(o,i)});break;case e.get("tplsource")==="inline":l.debug("Component "+e.name+" has specified template-source=inline, so it is assumed that template is already declared"),async function(d){d.feedComponent.bind(d)()}(e);var i={request:null,component:e};e.__done__().then(function(){typeof e.done=="function"&&e.done.call(e,i),s.call(o,i)},function(){a.call(o,i)});break;case(e.get("tplsource")==="default"&&e.get("templateURI")!==""):e.set("url",e.get("basePath")+e.get("templateURI")),bt(e,!1).then(function(d){s.call(o,d)},function(d){a.call(o,d)});break;case(e.get("tplsource")==="external"&&e.get("templateURI")!==""):e.set("url",e.get("templateURI")),bt(e,!1).then(function(d){s.call(o,d)},function(d){a.call(o,d)});break;case(e.get("tplsource")==="default"&&e.get("templateURI","")===""):l.debug(`Component ${e.name} template-source is ${e.get("tplsource")} and no templateURI is present`),a.call(o,`Component ${e.name} template-source is ${e.get("tplsource")} and no templateURI is present`);break;default:l.debug("Component "+e.name+" will not be rebuilt because no templateURI is present"),a.call(o,{request:null,component:e});break}});return o}Cast(e){let o=G(e).map(s=>s.name.replace(/bound /g,"")).map(s=>({[s]:e[s].bind(this)})).reduce((s,a)=>Object.assign(s,a),{});return De(this,o)}static route(){var e=this,o,s=!!(He(e)&&Ae(e,"Component")),a=c(function(i){var d=[],h=i.filter(function(m){return typeof m<"u"}).map(function(m){if(typeof m.name<"u")d.push(m.name);else throw new Error(ye(m)+" does not have a name");return new Promise(function(_,I){var N;return typeof m<"u"&&m._reroute_?N=m._reroute_().then(function(){return m.reload=!0,m.rebuild()}).then(function(H){if(Object.hasOwnProperty.call(m,"subcomponents")&&typeof m.subcomponents<"u"&&m.subcomponents.length>0)return l.debug("LOOKING FOR ROUTINGS IN SUBCOMPONENTS FOR: "+m.name),a.call(m,m.subcomponents);l.debug("No subcomponents to look for routings in: "+m.name),m.subtags.length>0&&(m.subcomponents=m.__buildSubComponents__(!0)),_(m)}):typeof m<"u"&&I("Component "+m.name+" is not an instance of Component"),N})});return Promise.all(h).then(function(){l.debug("ROUTING COMPLETED FOR "+d.join(", "))}).catch(function(m){l.warn("ROUTING FAILED FOR "+d.join(", ")+": "+m)})},"__route__");if(s||r.componentsStack)s&&l.debug("loading routings for instance "+e.name),o=a.call(e,s?e.subcomponents:r.componentsStack);else throw l.debug("An undetermined result expected if load routings. So will not be loaded this time."),Error("There is no valid instance and no components stack available to apply rountings");return o}fullscreen(){if(u){var e=this.body;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}}closefullscreen(){u&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())}_generateRoutingPaths(e){var o=this;return new Promise(function(s,a){u&&Gt(o.validRoutingWays,o.routingWay)&&typeof e<"u"&&(o.innerHTML=e.innerHTML,o.routingNodes=e.subelements("routing"),o.routings=[],o.routingNodes.map(function(i,d){var h=i.getAttributeNames(),m={};h.map(function(_,I){m[h[I]]=i.getAttribute(h[I])}),o.routings.push(m),o.routingPaths||(o.routingPaths=[]),o.routingPaths.includes(m.path)||o.routingPaths.push(m.path),r.global.get("routingPaths")||r.global.set("routingPaths",[]),r.global.get("routingPaths").includes(m.path)||r.global.get("routingPaths").push(m.path)})),s()})}parseTemplate(e){var o=this,s,a=e;if(Object.hasOwnProperty.call(o,"templateHandler")){var i=o.templateHandler;l.debug(`[Component][${this.name}][parseTemplate] Attempting to use ${i} ...`);var d=C(i),h=te(d,{component:o,template:a});h.component=o;var m=o.data;if(Object.hasOwnProperty.call(o,"assignRoutingParams")&&o.assignRoutingParams)try{m=Object.assign(m,o.routingParams)}catch{l.debug("[parseTemplate] it was not possible to assign the routing params to the template")}s=h.assign(m)}else l.debug(`[Component][${this.name}][parseTemplate] No value for templateHandler. Using raw content...`),s=a;return s}_reroute_(){var e=this;return new Promise(function(o,s){u&&Gt(e.validRoutingWays,e.routingWay)&&(e.routingPath=document.location[e.routingWay],e.routingSelected.map(function(a,i){var d=gt({COMPONENTS_BASE_PATH:r.CONFIG.get("componentsBasePath"),COMPONENT_NAME:a.name.toString(),TPLEXTENSION:Object.hasOwnProperty.call(a,"tplextension")?a.tplextension:e.tplextension,TPL_SOURCE:"default"});e.templateURI=d}),e.routingSelected.length>0&&(e.template="",e.body.innerHTML="")),o(e)})}lazyLoadImages(){if(u){var e=this,o=e.shadowed?e.shadowRoot:e.body,s=[...o.subelements("img[lazy-src]")],a=c(function(d){d.setAttribute("src",d.getAttribute("lazy-src")),d.onload=()=>{d.removeAttribute("lazy-src")}},"_lazyLoadImages");if("Inters