@genesislcap/design-system-configurator 14.343.1-alpha-e4337a8.0 → 14.343.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{106.106.dc3a6ce7c7e563e33548.js → 106.106.f0d95263b009079d642b.js} +1 -1
- package/dist/{151.151.b41dc347998e0575e337.js → 151.151.4d09638e145b9f4f969d.js} +1 -1
- package/dist/{826.b28418238f884e4a5b7772006a406104.js.map → 207.1599ba6261089c6ea0eed71e7fb0c549.js.map} +1 -1
- package/dist/{826.826.117e2d8d8da71c18415f.js → 207.207.2907b4046c18db77e8f5.js} +3 -3
- package/dist/{347.347.8630295669f86eef4f5a.js → 347.347.d385ad083242824ecc78.js} +1 -1
- package/dist/{417.417.dfb9381113db5fa671ae.js → 417.417.0b194f846f8c803314b2.js} +3 -3
- package/dist/{417.256f255bad245610cf6b285ebbc12b77.js.map → 417.6c3802027799a351825606c0299bf2e8.js.map} +1 -1
- package/dist/{445.445.35a6dbd3affb67581b36.js → 445.445.7a1f06496396afc534db.js} +4 -4
- package/dist/{445.850fad3ad97afce08e58ff1b4ea8a596.js.map → 445.fe951b981b2d12d1debe0fbf6bc57a21.js.map} +1 -1
- package/dist/{510.510.318ba94068e4134ad6ac.js → 510.510.65f7984f429284de1f70.js} +2 -2
- package/dist/{588.588.b954832e0228557f5751.js → 588.588.a6dbd27ee50266b771c1.js} +2 -2
- package/dist/{617.c2c19686f16c1f90c03aaa3a74b5ffab.js.map → 617.0b2c358a5d73e5cd5a023e90da30b637.js.map} +1 -1
- package/dist/{617.617.b81895dad86a07b00dfb.js → 617.617.da070454891270ff8ecf.js} +5 -5
- package/dist/{665.665.f8c0e44f3b2a64833c24.js → 665.665.8779d9230d21ea05025b.js} +1 -1
- package/dist/{72.72.f8c3fbf61683d8afe03b.js → 72.72.e221eac0ac4ac8de2ed5.js} +1 -1
- package/dist/{designSystemConfigurator.7ee87fd56ff3fcc5cd279970f3010807.js.map → designSystemConfigurator.cbfcd645f1932760e0037aac2bef3a41.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.1e30f9780d18df43b54f.js +2 -0
- package/dist/{main.86315f6aed5647a6448f8a5a5f4eb177.js.map → main.3dfef0e906b66244172bba626eb7438c.js.map} +1 -1
- package/dist/remoteEntry.js +2 -2
- package/package.json +13 -13
- package/dist/main.e63d3cb7cc29305133bb.js +0 -2
- /package/dist/{588.588.b954832e0228557f5751.js.LICENSE.txt → 207.207.2907b4046c18db77e8f5.js.LICENSE.txt} +0 -0
- /package/dist/{826.826.117e2d8d8da71c18415f.js.LICENSE.txt → 588.588.a6dbd27ee50266b771c1.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[106,792],{2106:(e,s,n)=>{Promise.all([n.e(681),n.e(
|
|
1
|
+
(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[106,792],{2106:(e,s,n)=>{Promise.all([n.e(681),n.e(137),n.e(826),n.e(506),n.e(72)]).then(n.bind(n,38072))}}]);
|
|
2
2
|
//# sourceMappingURL=106.108ffe1c0a21c8a151669c62c3841d79.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[61,151,204,823],{28745:(t,e,n)=>{n.d(e,{v:()=>o});var r=n(
|
|
1
|
+
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[61,151,204,823],{28745:(t,e,n)=>{n.d(e,{v:()=>o});var r=n(78464);const o=(0,r.createLogger)("foundation-utils")},52945:(t,e,n)=>{n.d(e,{O5:()=>o,fI:()=>a});var r=n(28745);const o=(t,e)=>{var n;let o=document.getElementById(e);if(o)return void r.v.debug(`\n An element with the id of '${e}' already exists and likely has the css rules applied.\n `);const a=null!==(n=document.head)&&void 0!==n?n:document.getElementsByTagName("head")[0];o=document.createElement("style"),o.id=e,a.appendChild(o);if((t.match(/}/g)||[]).length>1)return o.textContent=t,()=>{o&&a.removeChild(o)};{const e=o.sheet.insertRule(t);return()=>{o&&(o.sheet.deleteRule(e),a.removeChild(o))}}};function a(t){const e=[],n=new Set;return function t(r){const o=Array.from(r.querySelectorAll("*"));e.push(...o),o.forEach(e=>{e.shadowRoot&&!n.has(e.shadowRoot)&&(n.add(e.shadowRoot),t(e.shadowRoot))})}(t),e}},55823:(t,e,n)=>{n.d(e,{AQ:()=>d,C6:()=>o,Cg:()=>i,Cl:()=>a,GG:()=>v,Ju:()=>s,N3:()=>h,Qj:()=>u,Tt:()=>c,YH:()=>f,fX:()=>p,gn:()=>w,sH:()=>l,xN:()=>b,zs:()=>y});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)};function c(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function i(t,e,n,r){var o,a=arguments.length,c=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var i=t.length-1;i>=0;i--)(o=t[i])&&(c=(a<3?o(c):a>3?o(e,n,c):o(e,n))||c);return a>3&&c&&Object.defineProperty(e,n,c),c}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e,n,r){return new(n||(n=Promise))(function(o,a){function c(t){try{u(r.next(t))}catch(t){a(t)}}function i(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(c,i)}u((r=r.apply(t,e||[])).next())})}function f(t,e){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return c.next=i(0),c.throw=i(1),c.return=i(2),"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,i[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,a=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)c.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return c}function p(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function h(t){return this instanceof h?(this.v=t,this):new h(t)}function d(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function(t){return function(e){return Promise.resolve(e).then(t,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function c(t,e){o[t]&&(r[t]=function(e){return new Promise(function(n,r){a.push([t,e,n,r])>1||i(t,e)})},e&&(r[t]=e(r[t])))}function i(t,e){try{(n=o[t](e)).value instanceof h?Promise.resolve(n.value.v).then(u,l):f(a[0][2],n)}catch(t){f(a[0][3],t)}var n}function u(t){i("next",t)}function l(t){i("throw",t)}function f(t,e){t(e),a.shift(),a.length&&i(a[0][0],a[0][1])}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=s(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise(function(r,o){(function(t,e,n,r){Promise.resolve(r).then(function(e){t({value:e,done:n})},e)})(r,o,(e=t[n](e)).done,e.value)})}}}Object.create;function w(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function v(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError}}]);
|
|
2
2
|
//# sourceMappingURL=151.df7f6c518aba4dc761325e73decb24ee.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"826.826.xxxxxxxxxxxxxxxxxxxx.js","mappings":";sKAGO,SAASA,IACZ,QAA4B,oBAAXC,SAA0BA,OAAOC,WAAYD,OAAOC,SAASC,cAClF,C,6DCDA,IAAIC,EAAqB,CAAC,QAAS,SAAU,WAAY,UAAW,SAAU,uBAAwB,kBAAmB,kBAAmB,mDAAoD,gCAAiC,WAC7NC,EAAmCD,EAAmBE,KAAK,KAC3DC,EAA+B,oBAAZC,QACnBC,EAAUF,EAAY,WAAa,EAAIC,QAAQE,UAAUD,SAAWD,QAAQE,UAAUC,mBAAqBH,QAAQE,UAAUE,sBAC7HC,GAAeN,GAAaC,QAAQE,UAAUG,YAAc,SAAUC,GACxE,OAAOA,EAAQD,aACjB,EAAI,SAAUC,GACZ,OAAOA,EAAQC,aACjB,EAoHIC,EAAc,SAAqBC,EAAMC,GAC3C,OAAID,EAAKE,SAAW,IAYbD,GAAW,0BAA0BE,KAAKH,EAAKI,UAAYJ,EAAKK,oBAAsBC,MAAMC,SAASP,EAAKQ,aAAa,YAAa,KAChI,EAIJR,EAAKE,QACd,EAMIO,EAAU,SAAiBT,GAC7B,MAAwB,UAAjBA,EAAKI,OACd,EAsDIM,EAAqB,SAA4BV,GACnD,OALY,SAAiBA,GAC7B,OAAOS,EAAQT,IAAuB,UAAdA,EAAKW,IAC/B,CAGSC,CAAQZ,KAlCK,SAAyBA,GAC7C,IAAKA,EAAKa,KACR,OAAO,EAGT,IAMIC,EANAC,EAAaf,EAAKgB,MAAQpB,EAAYI,GAEtCiB,EAAc,SAAqBJ,GACrC,OAAOE,EAAWG,iBAAiB,6BAA+BL,EAAO,KAC3E,EAIA,GAAsB,oBAAX7B,aAAgD,IAAfA,OAAOmC,KAAoD,mBAAtBnC,OAAOmC,IAAIC,OAC1FN,EAAWG,EAAYjC,OAAOmC,IAAIC,OAAOpB,EAAKa,YAE9C,IACEC,EAAWG,EAAYjB,EAAKa,KAC9B,CAAE,MAAOQ,GAGP,OADAC,QAAQC,MAAM,2IAA4IF,EAAIG,UACvJ,CACT,CAGF,IAAIC,EAjCgB,SAAyBC,EAAOV,GACpD,IAAK,IAAIW,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAChC,GAAID,EAAMC,GAAGF,SAAWC,EAAMC,GAAGX,OAASA,EACxC,OAAOU,EAAMC,EAGnB,CA2BgBE,CAAgBf,EAAUd,EAAKgB,MAC7C,OAAQS,GAAWA,IAAYzB,CACjC,CAO2B8B,CAAgB9B,EAC3C,EAEI+B,EAAa,SAAoB/B,GACnC,IAAIgC,EAAwBhC,EAAKiC,wBAC7BC,EAAQF,EAAsBE,MAC9BC,EAASH,EAAsBG,OAEnC,OAAiB,IAAVD,GAA0B,IAAXC,CACxB,EAkJIC,EAAkC,SAAyCC,EAASrC,GACtF,QAAIA,EAAKsC,UAjNS,SAAuBtC,GACzC,OAAOS,EAAQT,IAAuB,WAAdA,EAAKW,IAC/B,CA+MuB4B,CAAcvC,IAjJtB,SAAkBA,EAAMwC,GACrC,IAAIC,EAAeD,EAAKC,aACpBC,EAAgBF,EAAKE,cAOzB,GAA0C,WAAtCC,iBAAiB3C,GAAM4C,WACzB,OAAO,EAGT,IACIC,EADkBrD,EAAQsD,KAAK9C,EAAM,iCACAA,EAAK+C,cAAgB/C,EAE9D,GAAIR,EAAQsD,KAAKD,EAAkB,yBACjC,OAAO,EAoBT,IAAIG,EAAepD,EAAYI,GAAMiD,KACjCC,GAAkBF,aAAmD,EAASA,EAAalD,cAAcqD,SAASH,KAAkBhD,EAAKF,cAAcqD,SAASnD,GAEpK,GAAKyC,GAAiC,SAAjBA,GA0Dd,GAAqB,kBAAjBA,EAMT,OAAOV,EAAW/B,OAhE0B,CAC5C,GAA6B,mBAAlB0C,EAA8B,CAKvC,IAFA,IAAIU,EAAepD,EAEZA,GAAM,CACX,IAAI+C,EAAgB/C,EAAK+C,cACrBM,EAAWzD,EAAYI,GAE3B,GAAI+C,IAAkBA,EAAcO,aAA+C,IAAjCZ,EAAcK,GAI9D,OAAOhB,EAAW/B,GAGlBA,EAFSA,EAAKuD,aAEPvD,EAAKuD,aACFR,GAAiBM,IAAarD,EAAKF,cAKtCiD,EAHAM,EAASJ,IAKpB,CAEAjD,EAAOoD,CACT,CAUA,GAAIF,EAKF,OAAQlD,EAAKwD,iBAAiB5B,MAelC,CAUA,OAAO,CACT,CAoC8C6B,CAASzD,EAAMqC,IA7MlC,SAA8BrC,GAIvD,MAHyB,YAAjBA,EAAKI,SAAyBsD,MAAMjE,UAAUkE,MAAMC,MAAM5D,EAAK6D,UAAUC,KAAK,SAAUC,GAC9F,MAAyB,YAAlBA,EAAM3D,OACf,EAEF,CAyME4D,CAAqBhE,IAhCM,SAAgCA,GAC3D,GAAI,mCAAmCG,KAAKH,EAAKI,SAG/C,IAFA,IAAI6D,EAAajE,EAAK+C,cAEfkB,GAAY,CACjB,GAA2B,aAAvBA,EAAW7D,SAA0B6D,EAAW3B,SAAU,CAE5D,IAAK,IAAIX,EAAI,EAAGA,EAAIsC,EAAWJ,SAASjC,OAAQD,IAAK,CACnD,IAAIoC,EAAQE,EAAWJ,SAASK,KAAKvC,GAErC,GAAsB,WAAlBoC,EAAM3D,QAGR,QAAOZ,EAAQsD,KAAKmB,EAAY,0BAAkCF,EAAMZ,SAASnD,EAErF,CAGA,OAAO,CACT,CAEAiE,EAAaA,EAAWlB,aAC1B,CAKF,OAAO,CACT,CAIgCoB,CAAuBnE,GAKvD,EAEIoE,EAAiC,SAAwC/B,EAASrC,GACpF,QAAIU,EAAmBV,IAASD,EAAYC,GAAQ,IAAMoC,EAAgCC,EAASrC,GAKrG,EAiFIqE,EAAa,SAAoBrE,EAAMqC,GAGzC,GAFAA,EAAUA,GAAW,CAAC,GAEjBrC,EACH,MAAM,IAAIsE,MAAM,oBAGlB,OAA8C,IAA1C9E,EAAQsD,KAAK9C,EAAMZ,IAIhBgF,EAA+B/B,EAASrC,EACjD,EAEIuE,EAA4CpF,EAAmBqF,OAAO,UAAUnF,KAAK,KAErFoF,EAAc,SAAqBzE,EAAMqC,GAG3C,GAFAA,EAAUA,GAAW,CAAC,GAEjBrC,EACH,MAAM,IAAIsE,MAAM,oBAGlB,OAAuD,IAAnD9E,EAAQsD,KAAK9C,EAAMuE,IAIhBnC,EAAgCC,EAASrC,EAClD,C","sources":["webpack://@genesislcap/design-system-configurator/../../../node_modules/exenv-es6/dist/can-use-dom.js","webpack://@genesislcap/design-system-configurator/../../../node_modules/tabbable/dist/index.esm.js"],"sourcesContent":["/**\n * Checks if the DOM is available to access and use\n */\nexport function canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}\n","/*!\n* tabbable 5.3.3\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\nvar candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])', 'details>summary:first-of-type', 'details'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n return element.getRootNode();\n} : function (element) {\n return element.ownerDocument;\n};\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\n\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n\n candidates = candidates.filter(filter);\n return candidates;\n};\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidatesScope\n * @property {Element} scope contains inner candidates\n * @property {Element[]} candidates\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidatesScope>}\n */\n\n\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n } // iterate over shadow content if possible\n\n\n var shadowRoot = element.shadowRoot || // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n\n return candidates;\n};\n\nvar getTabindex = function getTabindex(node, isScope) {\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n //\n // isScope is positive for custom element with shadow root or slot that by default\n // have tabIndex -1, but need to be sorted by document order in order for their\n // content to be inserted in the correct position\n if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {\n return 0;\n }\n }\n\n return node.tabIndex;\n};\n\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\n\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\n\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\n\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n\n var radioScope = node.form || getRootNode(node);\n\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n\n var radioSet;\n\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\n\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n\n return width === 0 && height === 0;\n};\n\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n } // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n\n\n var nodeRootHost = getRootNode(node).host;\n var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node);\n\n if (!displayCheck || displayCheck === 'full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n\n node = originalNode;\n } // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n\n if (nodeIsAttached) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n } // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n } // visible, as far as we can tell, or per current `displayCheck` mode\n\n\n return false;\n}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\n\n\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>\n\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i); // when the first <legend> (in document order) is found\n\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n } // the disabled <fieldset> containing `node` has no <legend>\n\n\n return true;\n }\n\n parentNode = parentNode.parentElement;\n }\n } // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n\n\n return false;\n};\n\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n\n return true;\n};\n\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n\n return true;\n};\n\nvar isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n } // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n\n\n return false;\n};\n/**\n * @param {Array.<Element|CandidatesScope>} candidates\n * @returns Element[]\n */\n\n\nvar sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scope;\n var element = isScope ? item.scope : item;\n var candidateTabindex = getTabindex(element, isScope);\n var elements = isScope ? sortByOrder(item.candidates) : element;\n\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\n\nvar tabbable = function tabbable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isValidShadowRootTabbable\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n\n return sortByOrder(candidates);\n};\n\nvar focusable = function focusable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n\n return candidates;\n};\n\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');\n\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n"],"names":["canUseDOM","window","document","createElement","candidateSelectors","candidateSelector","join","NoElement","Element","matches","prototype","msMatchesSelector","webkitMatchesSelector","getRootNode","element","ownerDocument","getTabindex","node","isScope","tabIndex","test","tagName","isContentEditable","isNaN","parseInt","getAttribute","isInput","isNonTabbableRadio","type","isRadio","name","radioSet","radioScope","form","queryRadios","querySelectorAll","CSS","escape","err","console","error","message","checked","nodes","i","length","getCheckedRadio","isTabbableRadio","isZeroArea","_node$getBoundingClie","getBoundingClientRect","width","height","isNodeMatchingSelectorFocusable","options","disabled","isHiddenInput","_ref","displayCheck","getShadowRoot","getComputedStyle","visibility","nodeUnderDetails","call","parentElement","nodeRootHost","host","nodeIsAttached","contains","originalNode","rootNode","shadowRoot","assignedSlot","getClientRects","isHidden","Array","slice","apply","children","some","child","isDetailsWithSummary","parentNode","item","isDisabledFromFieldset","isNodeMatchingSelectorTabbable","isTabbable","Error","focusableCandidateSelector","concat","isFocusable"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"207.207.xxxxxxxxxxxxxxxxxxxx.js","mappings":";sKAGO,SAASA,IACZ,QAA4B,oBAAXC,SAA0BA,OAAOC,WAAYD,OAAOC,SAASC,cAClF,C,6DCDA,IAAIC,EAAqB,CAAC,QAAS,SAAU,WAAY,UAAW,SAAU,uBAAwB,kBAAmB,kBAAmB,mDAAoD,gCAAiC,WAC7NC,EAAmCD,EAAmBE,KAAK,KAC3DC,EAA+B,oBAAZC,QACnBC,EAAUF,EAAY,WAAa,EAAIC,QAAQE,UAAUD,SAAWD,QAAQE,UAAUC,mBAAqBH,QAAQE,UAAUE,sBAC7HC,GAAeN,GAAaC,QAAQE,UAAUG,YAAc,SAAUC,GACxE,OAAOA,EAAQD,aACjB,EAAI,SAAUC,GACZ,OAAOA,EAAQC,aACjB,EAoHIC,EAAc,SAAqBC,EAAMC,GAC3C,OAAID,EAAKE,SAAW,IAYbD,GAAW,0BAA0BE,KAAKH,EAAKI,UAAYJ,EAAKK,oBAAsBC,MAAMC,SAASP,EAAKQ,aAAa,YAAa,KAChI,EAIJR,EAAKE,QACd,EAMIO,EAAU,SAAiBT,GAC7B,MAAwB,UAAjBA,EAAKI,OACd,EAsDIM,EAAqB,SAA4BV,GACnD,OALY,SAAiBA,GAC7B,OAAOS,EAAQT,IAAuB,UAAdA,EAAKW,IAC/B,CAGSC,CAAQZ,KAlCK,SAAyBA,GAC7C,IAAKA,EAAKa,KACR,OAAO,EAGT,IAMIC,EANAC,EAAaf,EAAKgB,MAAQpB,EAAYI,GAEtCiB,EAAc,SAAqBJ,GACrC,OAAOE,EAAWG,iBAAiB,6BAA+BL,EAAO,KAC3E,EAIA,GAAsB,oBAAX7B,aAAgD,IAAfA,OAAOmC,KAAoD,mBAAtBnC,OAAOmC,IAAIC,OAC1FN,EAAWG,EAAYjC,OAAOmC,IAAIC,OAAOpB,EAAKa,YAE9C,IACEC,EAAWG,EAAYjB,EAAKa,KAC9B,CAAE,MAAOQ,GAGP,OADAC,QAAQC,MAAM,2IAA4IF,EAAIG,UACvJ,CACT,CAGF,IAAIC,EAjCgB,SAAyBC,EAAOV,GACpD,IAAK,IAAIW,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAChC,GAAID,EAAMC,GAAGF,SAAWC,EAAMC,GAAGX,OAASA,EACxC,OAAOU,EAAMC,EAGnB,CA2BgBE,CAAgBf,EAAUd,EAAKgB,MAC7C,OAAQS,GAAWA,IAAYzB,CACjC,CAO2B8B,CAAgB9B,EAC3C,EAEI+B,EAAa,SAAoB/B,GACnC,IAAIgC,EAAwBhC,EAAKiC,wBAC7BC,EAAQF,EAAsBE,MAC9BC,EAASH,EAAsBG,OAEnC,OAAiB,IAAVD,GAA0B,IAAXC,CACxB,EAkJIC,EAAkC,SAAyCC,EAASrC,GACtF,QAAIA,EAAKsC,UAjNS,SAAuBtC,GACzC,OAAOS,EAAQT,IAAuB,WAAdA,EAAKW,IAC/B,CA+MuB4B,CAAcvC,IAjJtB,SAAkBA,EAAMwC,GACrC,IAAIC,EAAeD,EAAKC,aACpBC,EAAgBF,EAAKE,cAOzB,GAA0C,WAAtCC,iBAAiB3C,GAAM4C,WACzB,OAAO,EAGT,IACIC,EADkBrD,EAAQsD,KAAK9C,EAAM,iCACAA,EAAK+C,cAAgB/C,EAE9D,GAAIR,EAAQsD,KAAKD,EAAkB,yBACjC,OAAO,EAoBT,IAAIG,EAAepD,EAAYI,GAAMiD,KACjCC,GAAkBF,aAAmD,EAASA,EAAalD,cAAcqD,SAASH,KAAkBhD,EAAKF,cAAcqD,SAASnD,GAEpK,GAAKyC,GAAiC,SAAjBA,GA0Dd,GAAqB,kBAAjBA,EAMT,OAAOV,EAAW/B,OAhE0B,CAC5C,GAA6B,mBAAlB0C,EAA8B,CAKvC,IAFA,IAAIU,EAAepD,EAEZA,GAAM,CACX,IAAI+C,EAAgB/C,EAAK+C,cACrBM,EAAWzD,EAAYI,GAE3B,GAAI+C,IAAkBA,EAAcO,aAA+C,IAAjCZ,EAAcK,GAI9D,OAAOhB,EAAW/B,GAGlBA,EAFSA,EAAKuD,aAEPvD,EAAKuD,aACFR,GAAiBM,IAAarD,EAAKF,cAKtCiD,EAHAM,EAASJ,IAKpB,CAEAjD,EAAOoD,CACT,CAUA,GAAIF,EAKF,OAAQlD,EAAKwD,iBAAiB5B,MAelC,CAUA,OAAO,CACT,CAoC8C6B,CAASzD,EAAMqC,IA7MlC,SAA8BrC,GAIvD,MAHyB,YAAjBA,EAAKI,SAAyBsD,MAAMjE,UAAUkE,MAAMC,MAAM5D,EAAK6D,UAAUC,KAAK,SAAUC,GAC9F,MAAyB,YAAlBA,EAAM3D,OACf,EAEF,CAyME4D,CAAqBhE,IAhCM,SAAgCA,GAC3D,GAAI,mCAAmCG,KAAKH,EAAKI,SAG/C,IAFA,IAAI6D,EAAajE,EAAK+C,cAEfkB,GAAY,CACjB,GAA2B,aAAvBA,EAAW7D,SAA0B6D,EAAW3B,SAAU,CAE5D,IAAK,IAAIX,EAAI,EAAGA,EAAIsC,EAAWJ,SAASjC,OAAQD,IAAK,CACnD,IAAIoC,EAAQE,EAAWJ,SAASK,KAAKvC,GAErC,GAAsB,WAAlBoC,EAAM3D,QAGR,QAAOZ,EAAQsD,KAAKmB,EAAY,0BAAkCF,EAAMZ,SAASnD,EAErF,CAGA,OAAO,CACT,CAEAiE,EAAaA,EAAWlB,aAC1B,CAKF,OAAO,CACT,CAIgCoB,CAAuBnE,GAKvD,EAEIoE,EAAiC,SAAwC/B,EAASrC,GACpF,QAAIU,EAAmBV,IAASD,EAAYC,GAAQ,IAAMoC,EAAgCC,EAASrC,GAKrG,EAiFIqE,EAAa,SAAoBrE,EAAMqC,GAGzC,GAFAA,EAAUA,GAAW,CAAC,GAEjBrC,EACH,MAAM,IAAIsE,MAAM,oBAGlB,OAA8C,IAA1C9E,EAAQsD,KAAK9C,EAAMZ,IAIhBgF,EAA+B/B,EAASrC,EACjD,EAEIuE,EAA4CpF,EAAmBqF,OAAO,UAAUnF,KAAK,KAErFoF,EAAc,SAAqBzE,EAAMqC,GAG3C,GAFAA,EAAUA,GAAW,CAAC,GAEjBrC,EACH,MAAM,IAAIsE,MAAM,oBAGlB,OAAuD,IAAnD9E,EAAQsD,KAAK9C,EAAMuE,IAIhBnC,EAAgCC,EAASrC,EAClD,C","sources":["webpack://@genesislcap/design-system-configurator/../../../node_modules/exenv-es6/dist/can-use-dom.js","webpack://@genesislcap/design-system-configurator/../../../node_modules/tabbable/dist/index.esm.js"],"sourcesContent":["/**\n * Checks if the DOM is available to access and use\n */\nexport function canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}\n","/*!\n* tabbable 5.3.3\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\nvar candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])', 'details>summary:first-of-type', 'details'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n return element.getRootNode();\n} : function (element) {\n return element.ownerDocument;\n};\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\n\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n\n candidates = candidates.filter(filter);\n return candidates;\n};\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidatesScope\n * @property {Element} scope contains inner candidates\n * @property {Element[]} candidates\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidatesScope>}\n */\n\n\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n } // iterate over shadow content if possible\n\n\n var shadowRoot = element.shadowRoot || // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n\n return candidates;\n};\n\nvar getTabindex = function getTabindex(node, isScope) {\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n //\n // isScope is positive for custom element with shadow root or slot that by default\n // have tabIndex -1, but need to be sorted by document order in order for their\n // content to be inserted in the correct position\n if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {\n return 0;\n }\n }\n\n return node.tabIndex;\n};\n\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\n\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\n\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\n\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n\n var radioScope = node.form || getRootNode(node);\n\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n\n var radioSet;\n\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\n\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n\n return width === 0 && height === 0;\n};\n\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n } // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n\n\n var nodeRootHost = getRootNode(node).host;\n var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node);\n\n if (!displayCheck || displayCheck === 'full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n\n node = originalNode;\n } // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n\n if (nodeIsAttached) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n } // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n } // visible, as far as we can tell, or per current `displayCheck` mode\n\n\n return false;\n}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\n\n\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>\n\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i); // when the first <legend> (in document order) is found\n\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n } // the disabled <fieldset> containing `node` has no <legend>\n\n\n return true;\n }\n\n parentNode = parentNode.parentElement;\n }\n } // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n\n\n return false;\n};\n\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n\n return true;\n};\n\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n\n return true;\n};\n\nvar isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n } // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n\n\n return false;\n};\n/**\n * @param {Array.<Element|CandidatesScope>} candidates\n * @returns Element[]\n */\n\n\nvar sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scope;\n var element = isScope ? item.scope : item;\n var candidateTabindex = getTabindex(element, isScope);\n var elements = isScope ? sortByOrder(item.candidates) : element;\n\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\n\nvar tabbable = function tabbable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isValidShadowRootTabbable\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n\n return sortByOrder(candidates);\n};\n\nvar focusable = function focusable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n\n return candidates;\n};\n\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');\n\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n"],"names":["canUseDOM","window","document","createElement","candidateSelectors","candidateSelector","join","NoElement","Element","matches","prototype","msMatchesSelector","webkitMatchesSelector","getRootNode","element","ownerDocument","getTabindex","node","isScope","tabIndex","test","tagName","isContentEditable","isNaN","parseInt","getAttribute","isInput","isNonTabbableRadio","type","isRadio","name","radioSet","radioScope","form","queryRadios","querySelectorAll","CSS","escape","err","console","error","message","checked","nodes","i","length","getCheckedRadio","isTabbableRadio","isZeroArea","_node$getBoundingClie","getBoundingClientRect","width","height","isNodeMatchingSelectorFocusable","options","disabled","isHiddenInput","_ref","displayCheck","getShadowRoot","getComputedStyle","visibility","nodeUnderDetails","call","parentElement","nodeRootHost","host","nodeIsAttached","contains","originalNode","rootNode","shadowRoot","assignedSlot","getClientRects","isHidden","Array","slice","apply","children","some","child","isDetailsWithSummary","parentNode","item","isDisabledFromFieldset","isNodeMatchingSelectorTabbable","isTabbable","Error","focusableCandidateSelector","concat","isFocusable"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! For license information please see
|
|
2
|
-
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[588
|
|
3
|
-
//# sourceMappingURL=
|
|
1
|
+
/*! For license information please see 207.207.2907b4046c18db77e8f5.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[207,588],{27445:(e,t,n)=>{function r(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}n.d(t,{S:()=>r})},64660:(e,t,n)=>{n.d(t,{AO:()=>p,tp:()=>g});var r=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],o=r.join(","),i="undefined"==typeof Element,a=i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,u=!i&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},c=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},l=function(e){return"INPUT"===e.tagName},d=function(e){return function(e){return l(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||u(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},s=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},f=function(e,t){return!(t.disabled||function(e){return l(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=a.call(e,"details>summary:first-of-type")?e.parentElement:e;if(a.call(o,"details:not([open]) *"))return!0;var i=u(e).host,c=(null==i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return s(e)}else{if("function"==typeof r){for(var l=e;e;){var d=e.parentElement,f=u(e);if(d&&!d.shadowRoot&&!0===r(d))return s(e);e=e.assignedSlot?e.assignedSlot:d||f===e.ownerDocument?d:f.host}e=l}if(c)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!a.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},m=function(e,t){return!(d(t)||c(t)<0||!f(e,t))},p=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==a.call(e,o)&&m(t,e)},h=r.concat("iframe").join(","),g=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==a.call(e,h)&&f(t,e)}}}]);
|
|
3
|
+
//# sourceMappingURL=207.1599ba6261089c6ea0eed71e7fb0c549.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[347],{5709:(e,t,s)=>{s.d(t,{S5:()=>d});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156);class c{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.isConnectedSubject=new a.t(this.isConnected)}get hasValidSession(){return this.user.isAuthenticated}get isDisconnected(){return!this.isConnected}get isDisconnectedByServer(){return void 0!==this.closedClean&&!this.closedClean}isConnectedChanged(){var e;this.isConnected&&this.resetClosedState(),this.isConnecting=!1,this.isReconnecting=!1,null===(e=this.isConnectedSubject)||void 0===e||e.next(this.isConnected)}isReconnectingChanged(){this.isReconnecting&&(this.reconnectionLimitReached=!1)}resetClosedState(){this.closedCode=void 0,this.closedReason=void 0,this.closedClean=void 0}serialize(){return{isConfigured:this.isConfigured,isConnecting:this.isConnecting,isConnected:this.isConnected,isDisconnected:this.isDisconnected,isDisconnectedByServer:this.isDisconnectedByServer,isReconnecting:this.isReconnecting,reconnectionLimitReached:this.reconnectionLimitReached,hasValidSession:this.hasValidSession,closedCode:this.closedCode,closedReason:this.closedReason,closedClean:this.closedClean}}onClose(e){this.isConnected=!1,this.closedCode=e.code,this.closedReason=e.reason,this.closedClean=e.wasClean}}(0,i.Cg)([n.observable],c.prototype,"isConfigured",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnected",void 0),(0,i.Cg)([n.observable],c.prototype,"isReconnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"reconnectionLimitReached",void 0),(0,i.Cg)([n.observable],c.prototype,"closedCode",void 0),(0,i.Cg)([n.observable],c.prototype,"closedReason",void 0),(0,i.Cg)([n.observable],c.prototype,"closedClean",void 0),(0,i.Cg)([r.KJ],c.prototype,"user",void 0);const d=o.DI.createInterface(e=>e.singleton(c))},6884:(e,t,s)=>{s.d(t,{aB:()=>a,OD:()=>n});var i=s(84674);var r=s(34193);class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4,n.DATASERVER_ROW_ID="ROW_REF",n.REQUEST_SERVER_ROW_ID="RECORD_ID",n.DEFAULT_PAGINATION_PAGE_SIZE=25,n.DEFAULT_REQ_REP_OFFSET=0;const o={options:{criteria:"",isSnapshot:!1,maxRows:n.MAX_ROWS_250,maxView:n.MAX_VIEW_1000,pollingInterval:n.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1,pollTriggerEvents:[]},criteriaToFields:function(e){const t=e.split("&&").map(e=>e.trim()),s={};return t.forEach(e=>{if(e.startsWith("Expr"))switch(e.match(/Expr\.(\w+)\(/)[1]){case"dateIsToday":{const t=/Expr\.dateIsToday\((\w+)\)/,[,i]=e.match(t),r=new Date;s[`${i}_FROM`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,r.setDate(r.getDate()+1),s[`${i}_TO`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break;case"dateTimeIsGreaterEqual":{const t=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateTimeIsLessEqual":{const t=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"dateIsGreaterEqual":{const t=/Expr\.dateIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateIsLessEqual":{const t=/Expr\.dateIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"containsIgnoreCase":{const t=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[i]=`*${r}*`}}else{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=i}}),s},dataServerResultFilter:r.d},a=i.DI.createInterface(e=>e.instance(o))},9033:(e,t,s)=>{s.d(t,{yW:()=>M});var i=s(55823),r=s(33681),n=s(84674),o=s(50049),a=s(8790),c=s(1762),d=s(51046),h=s(66640),l=s(84190),u=s(65052),E=s(40113),g=s(26347),S=s(24669),v=s(48707),R=s(17465),m=s(79780);const p={throwWhenUnavailable:!0,throwWhenUnknown:!1},T=n.DI.createInterface(e=>e.instance(p)),_=(0,m.Es)("genesis-resources");let O=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!(e=null==e?void 0:e.trim()))return!1;yield this.fetchResources();return!!this.resources.find(t=>t.RESOURCE_NAME===e)})}getResourceTypeFor(e){return(0,i.sH)(this,void 0,void 0,function*(){yield this.fetchResources();const t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;const s=`${e} resource does not exist.`;if(R.v.error(s),this.config.throwWhenUnknown)throw new Error(s)})}getAllResources(){return(0,i.sH)(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return(0,i.sH)(this,void 0,void 0,function*(){var e;if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();const t=yield this.resourcesPromise;if(this.resources=null==t?void 0:t.RESOURCES,!(null===(e=this.resources)||void 0===e?void 0:e.length)){const e="Genesis resources unavailable.";if(R.v.error(e),this.config.throwWhenUnavailable)throw new Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){const e=n.DI.getOrCreateDOMContainer().get(_);e.postMessage("resources-loaded",this.resources),e.close()}};O=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,T)],O);const A=n.DI.createInterface(e=>e.singleton(O));var f=s(6884),I=s(39087);let C=class{get initialized(){var e;return!!(null===(e=this.status)||void 0===e?void 0:e.isInitialized)}constructor(e,t,s,i,r){this.connect=e,this.auth=t,this.resources=s,this.config=i,this.connectEvents=r,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new o.B}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return R.v.deprecated("Datasource.validResourceName","Use `GenesisResources.isValidResource` instead."),!!e&&!!e.trim().length}init(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,s=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();const i=this.options.resourceName;if(!(this.connect.isConnected||(yield this.connect.connect())))return R.v.error(`Unable to connect to ${this.connect.host} to get ${i} datasource`),this.reportStatus(),!1;return(yield this.resources.isValidResource(i))?(this.resourceType=yield this.resources.getResourceTypeFor(i),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),R.v.debug(`Initializing ${i} datasource from ${this.connect.host}`),!this.options.isSnapshot&&s&&(this.stream=yield this.createStream()),R.v.debug(`${i} datasource initialization ${this.initialized?"was successful.":"has failed."}`),this.reportStatus(),this.initialized):(R.v.error(`Unable to get the resource type for ${i} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(R.v.error(`${i} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1)})}startStream(){return(0,i.sH)(this,void 0,void 0,function*(){this.options.isSnapshot||void 0!==this.stream||(this.stream=yield this.createStream())})}destroy(){var e,t;R.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),null===(t=this.pollTrigger$)||void 0===t||t.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){var e;if(this._allParams)return this._allParams;let t;if(this.options.orderBy)if(this.criteriaOnlyRequest||(null===(e=this.availableIndexes)||void 0===e?void 0:e.findIndex(e=>e.NAME===this.options.orderBy))>-1)t=this.options.orderBy;else{const e=this.availableIndexes.map(e=>e.NAME);R.v.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:t,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},R.v.debug("Getting configured params:",this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){const e=this.allResourceParams,{REQUEST:t}=e,s=(0,i.Tt)(e,["REQUEST"]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:s.CRITERIA_MATCH,MAX_ROWS:s.MAX_ROWS,OFFSET:s.OFFSET,ORDER_BY:s.ORDER_BY,VIEW_NUMBER:s.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:null!=t?t:this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};const e=Object.assign({},Object.fromEntries(this.requestFields.map(e=>[e.NAME,"*"]))),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return(0,i.sH)(this,void 0,void 0,function*(){switch(R.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case I.v.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case I.v.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return(0,i.sH)(this,arguments,void 0,function*(e="ROW_REF"){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0})}createStream(){return(0,i.sH)(this,void 0,void 0,function*(){if(![I.v.DATASERVER,I.v.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===I.v.DATASERVER?this.createDataserverStream():(R.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return(0,i.sH)(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>R.v.error(e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:s,response:i}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(s)&&(null===(t=i.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(R.v.debug(`Received commit response for ${s}, triggering poll.`),this.triggerPoll())});const e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{const e=this.requestOnlyParams;if(this.resourceType===I.v.REQUEST_SERVER&&this.loadMoreCount>0){const t=25,s=(this.options.maxRows||t)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=s}return(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)(()=>this.connect.isConnected&&this.auth.isLoggedIn),(0,l.n)(()=>(0,c.H)(this.snapshot(e))))};return e?this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(()=>(0,d.O)(0,e).pipe((0,l.n)(t)))):this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(t))}fetchAndApplyMetadata(e){return(0,i.sH)(this,void 0,void 0,function*(){var t,s;try{R.v.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);const e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=null!==(t=e.INDEXES)&&void 0!==t?t:[],this.originalFieldDef=(0,v.a)(e),this.fieldMetadata=(0,v.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:(null===(s=this.fieldMetadata)||void 0===s?void 0:s.length)>0})}catch(t){R.v.error(`Metadata Fetch failed for ${e}:`,t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){var t;const s=null!==(t=this.config.eventEmitter)&&void 0!==t?t:document;this.status=this.normaliseStatus(e),R.v.debug(`Dispatching '${I.w}'`,this.status),null==s||s.dispatchEvent(new CustomEvent(I.w,{detail:this.status,bubbles:s!==document,composed:!0}))}normaliseStatus(e){var t,s,i,r,n;const o=null!==(t=e.isInitialized)&&void 0!==t?t:this.initialized,a=null!==(s=e.metadataRequired)&&void 0!==s?s:this.fetchMetadataRequired,c=null!==(i=e.hasMetadata)&&void 0!==i?i:(null===(r=this.fieldMetadata)||void 0===r?void 0:r.length)>0;return{name:null===(n=this.options)||void 0===n?void 0:n.resourceName,type:this.resourceType,isInitialized:o,metadataRequired:a,hasMetadata:c}}invalidateCache(){this._allParams=null}};(0,i.Cg)([r.observable],C.prototype,"status",void 0),(0,i.Cg)([r.observable],C.prototype,"fetchMetadataRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"startStreamRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"originalFieldDef",void 0),(0,i.Cg)([r.observable],C.prototype,"fieldMetadata",void 0),(0,i.Cg)([r.observable],C.prototype,"requestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"customRequestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"availableIndexes",void 0),(0,i.Cg)([r.observable],C.prototype,"criteriaOnlyRequest",void 0),(0,i.Cg)([r.observable],C.prototype,"loadMoreCount",void 0),(0,i.Cg)([r.observable],C.prototype,"readOnly",void 0),(0,i.Cg)([r.observable],C.prototype,"stream",void 0),C=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,E.N),(0,i.Qj)(2,A),(0,i.Qj)(3,f.aB),(0,i.Qj)(4,S.a4)],C);const M=n.DI.createInterface(e=>e.transient(C))},12066:(e,t,s)=>{s.d(t,{CL:()=>r,Ey:()=>a,zT:()=>o});const i=10;function r(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,i)}const n=19;function o(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,n).replace("T"," ")}function a(e,t){return t?o(e):r(e)}},17190:(e,t,s)=>{s.d(t,{j:()=>r,r:()=>i});const i=()=>{let e=[];return{subscribe:t=>(e.push(t),()=>e=e.filter(e=>e!==t)),publish(t){e.forEach(e=>e(t))}}},r=(e,t)=>{const s={root:document.documentElement};new IntersectionObserver(e=>{e.forEach(e=>{t(e.intersectionRatio>0)})},s).observe(e)}},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(48265);const r=(0,i.createLogger)("foundation-comms")},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(55823),a=s(32808),c=s(84674),d=s(56653),h=s(98316);!function(e){e.LOGON_ACK="LOGON_ACK",e.LOGON_NACK="LOGON_NACK",e.LOGOFF_ACK="LOGOFF_ACK",e.LOGOFF_NACK="LOGOFF_NACK",e.HEARTBEAT_PING="HEARTBEAT_PING",e.HEARTBEAT_PONG="HEARTBEAT_PONG",e.MORE_ROWS="MORE_ROWS",e.MORE_COLUMNS="MORE_COLUMNS",e.MORE_COLUMNS_ACK="MORE_COLUMNS_ACK",e.MSG_ACK="MSG_ACK",e.MSG_NACK="MSG_NACK",e.LOGOUT_ACK="LOGOUT_ACK",e.LOGOUT_NACK="LOGOUT_NACK",e.QUERY_UPDATE="QUERY_UPDATE"}(i||(i={})),function(e){e.EVENT_LOGIN_AUTH="EVENT_LOGIN_AUTH",e.EVENT_LOGIN_AUTH_ACK="EVENT_LOGIN_AUTH_ACK",e.EVENT_LOGIN_AUTH_NACK="EVENT_LOGIN_AUTH_NACK",e.EVENT_LOGOUT="EVENT_LOGOUT",e.DATA_LOGON="DATA_LOGON",e.DATA_LOGOFF="DATA_LOGOFF",e.META_REQUEST="META_REQUEST",e.JSON_SCHEMA_REQUEST="JSON_SCHEMA_REQUEST",e.RESOURCES_REQUEST="RESOURCES_REQUEST",e.RESOURCES_REQUEST_ACK="RESOURCES_REQUEST_ACK",e.RESOURCES_REQUEST_NACK="RESOURCES_REQUEST_NACK",e.EVENT_CHANGE_USER_PASSWORD="EVENT_CHANGE_USER_PASSWORD",e.EVENT_SELF_SERVICE_PASSWORD_RESET="EVENT_SELF_SERVICE_PASSWORD_RESET",e.EVENT_PASSWORD_RESET_ACTION="EVENT_PASSWORD_RESET_ACTION"}(r||(r={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));const l=(e,t)=>!!Array.isArray(null==e?void 0:e.ERROR)&&(null==e?void 0:e.ERROR.some(e=>{var s,i;return(null===(s=e.CODE)||void 0===s?void 0:s.includes(`${t}`))||(null===(i=e.STATUS_CODE)||void 0===i?void 0:i.includes(`${t}`))}));let u=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case d.h.BASIC:t={USER_NAME:e.username,PASSWORD:e.password,MFA_CODE:e.mfaToken};break;case d.h.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken,MFA_CODE:e.mfaToken};break;case d.h.SSO:t={SSO_TOKEN:e.ssoToken};break;case d.h.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:r.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createResourcesMessage(e){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.RESOURCES_REQUEST},e)}createMetaRequestMessage(e,t=r.META_REQUEST){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:t,DETAILS:{FEATURE:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createCommitMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken"),MFA_CODE:this.session.getSessionStorageItem("mfaToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,i=e){return{USER_NAME:i,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e,VIEW_NUMBER:t},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createMoreColumnsMessage(e){return Object.assign(Object.assign({},this.createMoreRowsMessage(e)),{MESSAGE_TYPE:i.MORE_COLUMNS})}createHTTPHeadersFromMessage(e,t="application/json; charset=UTF-8"){const s={"Content-type":t};return e.SOURCE_REF&&(s["source-ref"]=e.SOURCE_REF,s.SOURCE_REF=e.SOURCE_REF),e.SESSION_AUTH_TOKEN&&(s["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===r.EVENT_LOGOUT&&(s["SESSION-ID"]=e.SESSION_ID),s}createHeartbeatPingMessage(e=!1){return{MESSAGE_TYPE:i.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId(),VERBOSE:e,DETAILS:{},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};u=(0,o.Cg)([(0,o.Qj)(0,h.N),(0,o.Qj)(1,a.k)],u);const E=c.DI.createInterface(e=>e.singleton(u))},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(84674);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.streamErrorListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)(),this.commitResponseListeners=(0,i.r)()}addStreamListener(e,t,s){var i,r,n;const o=null===(i=this.streamListeners)||void 0===i?void 0:i.subscribe(e),a=null===(r=this.streamCompleteListeners)||void 0===r?void 0:r.subscribe(t),c=null===(n=this.streamErrorListeners)||void 0===n?void 0:n.subscribe(s);return()=>{o(),a(),c()}}onStreamEvent(e,t,s,i){var r;null===(r=this.streamListeners)||void 0===r||r.publish(new CustomEvent("connect-stream-event",{detail:{functions:i,message:t,resourceName:e,stream:s}}))}onStreamErrorEvent(e,t,s){var i;null===(i=this.streamErrorListeners)||void 0===i||i.publish(new CustomEvent("connect-stream-error-event",{detail:{resourceName:e,stream:t,error:s}}))}onStreamCompleteEvent(e,t){var s;null===(s=this.streamCompleteListeners)||void 0===s||s.publish(new CustomEvent("connect-stream-complete-event",{detail:{resourceName:e,stream:t}}))}addCommitListener(e){var t;return null===(t=this.commitListeners)||void 0===t?void 0:t.subscribe(e)}onCommitEvent(e,t){var s;null===(s=this.commitListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-event",{detail:{eventName:e,message:t}}))}addMetadataListener(e){var t;return null===(t=this.metadataListeners)||void 0===t?void 0:t.subscribe(e)}onMetadataEvent(e,t,s){var i;null===(i=this.metadataListeners)||void 0===i||i.publish(new CustomEvent("connect-metadata-event",{detail:{resourceName:e,message:t,error:s}}))}addCommitResponseListener(e){var t;return null===(t=this.commitResponseListeners)||void 0===t?void 0:t.subscribe(e)}onCommitResponseEvent(e,t){var s;null===(s=this.commitResponseListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-response-event",{detail:{eventName:e,response:t}}))}}const o=r.DI.createInterface(e=>e.singleton(n)),a=r.DI.createInterface(e=>e.aliasTo(o))},26347:(e,t,s)=>{s.d(t,{dm:()=>D,tn:()=>w});var i=s(55823),r=s(84686),n=s(33681),o=s(84674),a=s(77909);class c{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const d=o.DI.createInterface(e=>e.singleton(c));var h=s(17465),l=s(24669),u=s(49587),E=s(49229),g=s(97156),S=s(7827),v=s(1762),R=s(84190),m=s(78213),p=s(66640),T=s(16220),_=s(98316),O=s(32748);const A={polling:Object.assign({POLLING_MAP:{EVENT_AMEND_USER:{TEMP_FREQUENCY:500,AMOUNT_OF_POLLS:5,QUERIES:["ALL_USERS"]}},POLLING_INTERVAL_MAP:{ALL_TRADES:5e3,ALL_USERS:5e3,ALL_PROCESSES_STATUS:1e4},POLLING_FREQUENCY:5e3},{})},f=o.DI.createInterface(e=>e.instance(A));var I=s(21281);const C=(e,t)=>((null==t?void 0:t.ROW)&&e&&e.length>0?t.ROW.forEach(t=>{const s=t;if(s&&s.DETAILS){const i=s.DETAILS.ROW_REF,r=s.DETAILS.OPERATION;"INSERT"===r&&(e.find(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i})||e.unshift(s)),"DELETE"===r&&(e=e.filter(e=>{var s,i;return(null===(s=t.DETAILS)||void 0===s?void 0:s.ROW_REF)!==(null===(i=e.DETAILS)||void 0===i?void 0:i.ROW_REF)})),"MODIFY"===r&&(e=e.map(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i?Object.assign(Object.assign({},e),s):e}))}}):!t||e&&0!==e.length||(e=[...new Set(t.ROW)]),e);var M;let b=M=class{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n){var o;this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=i,this.serializer=r,this.config=n,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new g.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,i.sH)(this,void 0,void 0,function*(){try{return this.getMessage({MESSAGE_TYPE:I.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then(e=>e.MESSAGE_TYPE===I.Go.HEARTBEAT_PONG)}catch(e){return h.v.error(e),!1}})}send(e,t){return this.http.post(M.getUrl(this.host,e),{body:M.getBody(e),headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})}httpMode(){return!0}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}connect(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then(e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e))})}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then(e=>(this.dataLogoff(s.SOURCE_REF).catch(e=>h.v.error(e)),e))})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=r.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new g.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,S.x)((0,v.H)(this.send(r)),o.pipe((0,R.n)(e=>(0,m.Y)(e))).pipe((0,R.n)(()=>(0,v.H)(this.getMessage(r))))).pipe((0,p.v)(()=>this.streams.has(n)),(0,T.j)(()=>{h.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)}));return this.streams.get(n).STREAM=a,a}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){return h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0"),this.stream(e,t,s,i)}getMessage(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.http.get(M.getUrl(this.host,e),{headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}getMoreRows(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return h.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then(t=>(this.streams.has(e)&&(h.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t))})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){const s=this.messageBuilder.createMetaRequestMessage(e);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (metadata) message created -> `,s),this.send(s).then(e=>e.DETAILS)})}getJSONSchema(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then(t=>(this.maybeTurbo(e,t),t))})}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void h.v.debug(`${e} polling frequency is already accelerated.`);const i=this.config.polling.POLLING_MAP[e];if(!(null==i?void 0:i.TEMP_FREQUENCY)||!i.AMOUNT_OF_POLLS)return;const r=i.TEMP_FREQUENCY,n=r*i.AMOUNT_OF_POLLS,o=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP)),a=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP));for(const e of i.QUERIES)a[e]=r,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);h.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout(()=>{h.v.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1},n)}updateIntervals(e){const{POLLING_INTERVAL_MAP:t}=e.polling;t&&(this.config.polling.POLLING_INTERVAL_MAP=t,this.handlePollingIntervalMapUpdate(t))}handlePollingIntervalMapUpdate(e){if(e)for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,h.v.debug(`Setting polling frequency for ${t} = ${s}`),[...this.streams.values()].filter(e=>e.RESOURCE_NAME===t).forEach(e=>{var t;return null===(t=null==e?void 0:e.POLLING_FREQUENCY)||void 0===t?void 0:t.next(s)})}}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let i=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===I.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};(0,i.Cg)([n.observable],b.prototype,"host",void 0),(0,i.Cg)([n.observable],b.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],b.prototype,"_isConnected",void 0),(0,i.Cg)([n.volatile],b.prototype,"isConnected",null),b=M=(0,i.Cg)([(0,i.Qj)(0,O.l),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,_.N),(0,i.Qj)(3,d),(0,i.Qj)(4,E.b_),(0,i.Qj)(5,f)],b);const N=o.DI.createInterface(e=>e.singleton(b));var L=s(45230);let U=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}get isConnected$(){var e;return null===(e=this.socket.isConnectedSubject)||void 0===e?void 0:e.asObservable()}get host(){return this.socket.host}constructor(e,t,s,i,r){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}send(e,t){return this.socket.send(e,t)}connect(){return(0,i.sH)(this,arguments,void 0,function*(e=r.vN){return this.socket.reset(),this.socket.connect(e,this.config.connect,this.config.reconnect)})}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)},()=>{this.events.onStreamCompleteEvent(e,n)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0");const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream without auto-teardown) message created -> `,r);const n=this.socket.sendForStreamWithoutTeardown(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createMoreRowsMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} message created -> `,s),this.socket.send(s,!1)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasMetadataFor(e))return h.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;h.v.debug(`${i.MESSAGE_TYPE} (metadata) message created -> `,i);try{this.isWorking=!0;const t=yield this.socket.send(i);r=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setMetadataFor(e,r)}catch(e){throw n=e,h.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r})}getJSONSchema(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasJsonSchemaFor(e))return h.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);let r;h.v.debug(`${i.MESSAGE_TYPE} (json schema) message created -> `,i);try{this.isWorking=!0,r=null!==(s=yield this.socket.send(i))&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setJsonSchemaFor(e,r)}catch(e){h.v.error(e)}finally{this.isWorking=!1}return r})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);h.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i.then(t=>(this.events.onCommitResponseEvent(e,t),t))})}};(0,i.Cg)([n.observable],U.prototype,"isWorking",void 0),U=(0,i.Cg)([(0,i.Qj)(0,L.yQ),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,d),(0,i.Qj)(3,l.EQ),(0,i.Qj)(4,u.R)],U);const y="true"===r.PF||!1,P=o.DI.createInterface(e=>e.singleton(U)),D=o.DI.createInterface(e=>y?e.aliasTo(N):e.aliasTo(P));function w(){return o.DI.getOrCreateDOMContainer().get(D)}},32748:(e,t,s)=>{s.d(t,{l:()=>a});var i=s(55823),r=s(49229),n=s(84674);let o=class{constructor(e){this.serializer=e}get(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)})}post(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)})}};o=(0,i.Cg)([(0,i.Qj)(0,r.b_)],o);const a=n.DI.createInterface(e=>e.singleton(o))},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(55823),r=s(84674),n=s(31261),o=s(28745);class a{constructor(){}createId(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createID ${t}`),t}createRemoteId(){return(0,i.sH)(this,arguments,void 0,function*(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t})}}const c=r.DI.createInterface(e=>e.singleton(a))},34193:(e,t,s)=>{s.d(t,{d:()=>r});var i=s(17465);function r(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},r=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":r.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:i.v.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},39087:(e,t,s)=>{var i;s.d(t,{v:()=>i,w:()=>r}),function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));const r="datasource-status-changed"},40113:(e,t,s)=>{s.d(t,{N:()=>L});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156),c=s(26347),d=s(21281),h=s(10447),l=s(56653),u=s(98316),E=s(17465);const g=o.DI.createInterface();function S(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(E.v.warn("PasswordCredential not available in this browser."),!1):(E.v.warn("CredentialsContainer not available in this browser."),!1)}const v=":";function R(e="",t=v,s){return e.split(t,s).map(e=>e.trim()).filter(e=>""!==e)}function m(e,t=v){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function p(e,t=v){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function T(e,t=v){for(const s of e)if(m(s,t))return s;return e.find(e=>"string"==typeof e&&!!e.trim())}function _(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||p(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function O(e="credential"){E.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const A={password:!0,mediation:"optional"},f={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=f){this.session=e,this.config=t}createBasicCredentials(e){return{type:l.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:l.h.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken(),mfaToken:null!==(i=null==e?void 0:e.mfaToken)&&void 0!==i?i:this.getMFAToken()}}createSSOCredentials(e){var t;return{type:l.h.SSO,ssoToken:null!==(t=null==e?void 0:e.ssoToken)&&void 0!==t?t:this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(v)&&p(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=R(t.name||t.id),[i,r]=R(T([t.id,t.name]));return[{id:_(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){O("PasswordCredential")}if(t)try{const e=t,[s]=R(e.name||e.username||e.organisation),[i,r]=R(T([e.organisation||e.username||e.name]));return[{id:_(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){O("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!S())return;const t=new PasswordCredential(e);return E.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)})}getCredentialsFromContainer(){return(0,i.sH)(this,arguments,void 0,function*(e=A){if(S())return E.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.Tt)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return E.v.debug("Storing credentials in cookie"),!!h.A.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){E.v.debug("Getting credentials from cookie");const e=h.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){if(S()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){return S()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")||this.session.getLocalStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")||this.session.getLocalStorageItem("refreshToken")}getMFAToken(){return this.session.getSessionStorageItem("mfaToken")}removeCookie(){h.A.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username"),this.session.removeLocalStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken"),this.session.removeLocalStorageItem("refreshToken")}removeMFAToken(){this.session.removeSessionStorageItem("mfaToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return S()&&navigator.credentials.preventSilentAccess()}};I=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,(0,o.optional)(g))],I);const C=o.DI.createInterface(e=>e.singleton(I)),M=e=>Array.isArray(e)?e.map(e=>null!=e?e:""):[],b=e=>{try{if("EVENT_LOGIN_AUTH_ACK"===(null==e?void 0:e.MESSAGE_TYPE)){const{DETAILS:i}=e;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:e.UPDATE_QUEUE,zeroMqProxyModeEnabled:e.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:e.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:e.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:i?{system:(s=i.SYSTEM,s?{date:s.DATE}:null),heartbeatIntervalSecs:i.HEARTBEAT_INTERVAL_SECS,failedLoginAttempts:i.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:i.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:i.LAST_LOGIN_DATETIME,daysToPasswordExpiry:i.DAYS_TO_PASSWORD_EXPIRY,product:(t=i.PRODUCT,t?t.map(e=>({name:e.NAME,version:e.VERSION})):[])}:null,permission:M(e.PERMISSION),profile:M(e.PROFILE)}}throw new Error("No Entity mapping implementation for provided DTO")}catch(e){throw E.v.error(e),e}var t,s};let N=class{loggedUserResultChanged(){var e;null===(e=this.isLoggedInSubject)||void 0===e||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,s,i,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.currentUser=r,this.isWorking=!1,this.isLoggedInSubject=new a.t(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;null===(t=this.isLoggedInSubject)||void 0===t||t.next(e.detail)})}login(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),i=yield this.connect.send(s);if(!i||i.ERROR||(null===(t=i.DETAILS)||void 0===t?void 0:t.ERROR))throw new l.l(s,i);this.applyAuthResults({authToken:i.SESSION_AUTH_TOKEN,refreshToken:i.REFRESH_AUTH_TOKEN,profiles:i.PROFILE,username:i.USER_NAME,permissions:i.PERMISSION,sessionId:i.SESSION_ID}),this.currentUser.set(b(i)),this.session.setAuthResult(i),E.v.debug("Login Authentication Result:",i)}catch(e){if(E.v.error("Login Authentication Error:",e),!(e instanceof l.l&&e.isIgnorableError()))throw this.removeAuthResults(),this.currentUser.unset(),e;E.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return(0,i.sH)(this,void 0,void 0,function*(){var e;this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),c=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===d.Go.LOGOUT_NACK;h&&E.v.warn("Unexpected Logout NACK received during logout.",c),t={success:o===d.Go.LOGOUT_ACK||i===d.x6.SESSION_NOT_FOUND||!h,error:c},a&&window.open(a,"_self")}catch(e){const s=new l.l(e.sentMessage,e.receivedMessage);if(E.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;E.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return t})}reAuthFromSession(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===d.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(b(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)})}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,i=e.REFRESH_AUTH_TOKEN;return t&&s&&i?{username:t,authToken:s,refreshToken:i,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}:null}applyAuthResults(e){e?this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId}:this.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null}};(0,i.Cg)([n.observable],N.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],N.prototype,"loggedUserResult",void 0),N=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,c.dm),(0,i.Qj)(2,d.lT),(0,i.Qj)(3,C),(0,i.Qj)(4,r.KJ)],N);const L=o.DI.createInterface(e=>e.singleton(N))},40370:(e,t,s)=>{s.d(t,{C:()=>a});var i=s(55823),r=s(33681),n=s(17465),o=s(39087);const a=e=>{class t extends e{constructor(){super(),this.hasOwnProperty("onDatasourceStatusChanged")||(this.onDatasourceStatusChanged=e=>{var t;this.resourceName||n.v.warn("Target classes must have a resourceName property to use the DatasourceEventHandler mixin.");const s=e.detail;if(s.name===this.resourceName){const e=null!==(t=this.datasourceStatus)&&void 0!==t?t:{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==s.isInitialized||s.metadataRequired&&e.hasMetadata!==s.hasMetadata)&&(this.datasourceStatus=s)}})}datasourceStatusChanged(e,t){n.v.debug("Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.")}connectedCallback(){super.connectedCallback(),document.addEventListener(o.w,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(o.w,this.onDatasourceStatusChanged,{capture:!0})}}return(0,i.Cg)([r.observable],t.prototype,"datasourceStatus",void 0),t}},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(33681);const r=new Map([["FAST-TEXT-AREA","input"],["FAST-TEXT-FIELD","input"],["FOUNDATION-TEXT-AREA","input"],["FOUNDATION-TEXT-FIELD","input"],["INPUT","input"],["ZERO-TEXT-FIELD","input"]]);function n(e){this.keyAttr||(this.target[this.targetName]=e)}function o(e,t){this.keyAttr&&(this.updateTarget=n),this.originalBind.call(this,e,t),this.target.addEventListener(this.changeEvent,this.changeHandler)}function a(){this.originalUnbind.call(this),this.target.removeEventListener(this.changeEvent,this.changeHandler)}class c extends i.HTMLBindingDirective{constructor(e,t,s,i){super(e),this.keyAttr=i,this.conversionType=t,this.eventName=s}createBehavior(e){const t=super.createBehavior(e);return t.originalBind=t.bind,t.originalUnbind=t.unbind,t.keyAttr=this.keyAttr,t.bind=o,t.unbind=a,t.changeEvent=function(e,t){var s;const i=e.tagName;return"default"===t?null!==(s=r.get(i))&&void 0!==s?s:"change":t}(e,this.eventName),t.changeHandler=()=>{const e="boolean"===this.conversionType?t.target.checked:t.target.value;if(this.keyAttr){const s=t.bindingObserver.last,i=t.target[this.keyAttr];s.propertySource[s.propertyName][i]=this.convert(e)}else{const s=t.bindingObserver.last;s.propertySource[s.propertyName]=this.convert(e)}},t}convert(e){if(null==e)return e;switch(this.conversionType){case"time":const t=new Date(e).getTime();return isNaN(t)?void 0:t;case"number":return e.length?Number(e):void 0;case"string":return String(e);case"boolean":return Boolean(e);default:return e}}}function d(e,t="string",s="default",i){return new c(e,t,s,i)}},41119:(e,t,s)=>{var i;s.d(t,{v:()=>r,w:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM",e.NANO_TIMESTAMP="NANO_TIMESTAMP"}(i||(i={}));const r={STRING:i.STRING,ENUM:i.ENUM,BOOLEAN:i.BOOLEAN,INT:i.NUMBER,LONG:i.NUMBER,DOUBLE:i.NUMBER,BIGDECIMAL:i.NUMBER,DATE:i.DATE,DATETIME:i.DATETIME,NANO_TIMESTAMP:i.NANO_TIMESTAMP}},45230:(e,t,s)=>{s.d(t,{yQ:()=>G,Ol:()=>F});var i=s(55823),r=s(92277),n=s(84686),o=s(49229),a=s(32808),c=s(33681),d=s(84674),h=s(50049),l=s(37970),u=s(75841),E=s(26274),g=s(53193),S=s(84190),v=s(82834),R=s(66640),m=s(53940),p=s(48653),T=s(98316),_=s(17465),O=s(49587),A=s(32748),f=s(21281);const I=1e4,C=6e4;var M;!function(e){e.Linear="linear",e.Exponential="exponential"}(M||(M={}));const b=(e,t)=>{const{reconnectInterval:s=I}=e,i=s>C?C:s,r=Math.round(Math.log2(C/i));return i*Math.pow(2,t%r)},N=e=>{const{reconnectInterval:t=I}=e;return t>C?C:t};var L,U=s(5709);class y{constructor(e){this.interval=e}get workerScript(){return`\n const startTime = Date.now();\n setInterval(function() {\n self.postMessage(Date.now() - startTime);\n }, ${this.interval});\n `}start(e){this.stop(),this.runWorker(e)}stop(){this.worker&&(this.worker.terminate(),delete this.worker)}runWorker(e){this.worker||(this.worker=new Worker(URL.createObjectURL(new Blob([this.workerScript],{type:"text/javascript"}))),this.worker.onmessage=t=>e(t.data))}}class P extends h.B{constructor(){super()}}l.c;class D{constructor(e,t,s,i){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=i}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let w=L=class{get isConfigured(){return this.status.isConfigured}get isConnecting(){return this.status.isConnecting}get isConnected(){return this.status.isConnected}get isConnectedSubject(){return this.status.isConnectedSubject}get isDisconnected(){return this.status.isDisconnected}get isDisconnectedByServer(){return this.status.isDisconnectedByServer}get isReconnecting(){return this.status.isReconnecting}get hasValidSession(){return _.v.deprecated("get hasValidSession","Use `User.isAuthenticated` from `@genesislcap/foundation-user` instead.","15.0.0"),this.user.isAuthenticated}set hasValidSession(e){_.v.deprecated("set hasValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}get host(){var e;return null!==(e=this.url)&&void 0!==e?e:n.vN}constructor(e,t,s,i,r,n,o){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,this.user=n,this.config=o,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,this.socketMessages=()=>this.wsMessages}get heartbeatLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeatLogging)&&void 0!==t&&t}get messageLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableMessageLogging)&&void 0!==t&&t}connect(e=n.vN,t,s){var r;return this.url=e,this.connectOptions=null!=t?t:this.config.connect,this.reconnectOptions=null!=s?s:this.config.reconnect,(null===(r=this.config.isWebSocketExpression)||void 0===r?void 0:r.test(this.host))?new Promise(e=>{var t,s,r,n;_.v.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`),this.status.isConnecting=!this.isReconnecting;(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new p.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),_.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&_.v.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:e=>this.serializer.serialize(e),deserializer:e=>this.serializer.deserialize(e)});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.connectObserver)&&void 0!==n?n:{next:e=>(0,i.sH)(this,void 0,void 0,function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===f.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach(t=>{_.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)}));let o=!1;switch(e.MESSAGE_TYPE){case f.Gp.EVENT_LOGIN_AUTH_ACK:{const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Go.LOGOUT_ACK:return n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Go.LOGON_ACK:return;case f.Go.LOGOFF_ACK:break;case f.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case f.Go.MSG_NACK:case f.Go.LOGON_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(i)}),error:e=>{_.v.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.isDisconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():_.v.info("Connection is now closed")}}),this.status.isConfigured=!0}):(_.v.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}handleExpiredSession(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.session.getSessionStorageItem("refreshToken")){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);this.session.setAuthResult(t),this.updateSessionAndSubscriptions(t)}else yield this.handleCookieBasedReauth()})}handleCookieBasedReauth(){return(0,i.sH)(this,void 0,void 0,function*(){const e=parseInt(localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY)||"0");if(Date.now()-e>3e4&&localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY))window.addEventListener("storage",this.onStorageEvent.bind(this));else{localStorage.setItem(L.REAUTH_ACTION_LOCK_KEY,Date.now().toString());const e=yield fetch(n.Be,{credentials:"include"});if("EVENT_LOGIN_DETAILS_ACK"!==(yield e.json()).MESSAGE_TYPE){(yield fetch(n.aW,{credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"},method:"POST",body:JSON.stringify({DETAILS:{},MESSAGE_TYPE:"EVENT_LOGIN_AUTH"})})).ok||window.location.reload()}localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),yield this.connect()}})}onStorageEvent(e){e.key===L.REAUTH_ACTION_LOCK_KEY&&null===e.newValue&&(this.connect(),window.removeEventListener("storage",this.onStorageEvent))}updateSessionAndSubscriptions(e){(null==e?void 0:e.MESSAGE_TYPE)===f.Gp.EVENT_LOGIN_AUTH_ACK&&this.wsMessageHandlers.forEach(t=>{t.isSubscription&&(t.sentMessage.SESSION_AUTH_TOKEN=e.SESSION_AUTH_TOKEN,this.websocket.next(t.sentMessage))})}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.sH)(this,void 0,void 0,function*(){var e,t,s;if(!this.isConnected)return;const i=this.messageBuilder.createHeartbeatPingMessage(null===(e=this.connectOptions)||void 0===e?void 0:e.verboseHeartbeat);(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatPingCallback)&&this.connectOptions.heartbeatPingCallback(i);const r=yield this.send(i);this.user.isAuthenticated&&!r.IS_AUTHENTICATED&&this.handleExpiredSession(),(null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatPongCallback)&&this.connectOptions.heartbeatPongCallback(r),this.heartbeatIsEnabled=r.MESSAGE_TYPE===f.Go.HEARTBEAT_PONG&&r.SOURCE_REF===i.SOURCE_REF});if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new y(e),this.heartbeatTicker.start(()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&_.v.debug(`Sending a heartbeat ping every ${e} ms`))})}}reconnect(){var e,t,s,i,r;const n=!(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)&&!1===(null===(t=this.connectOptions)||void 0===t?void 0:t.enableHeartbeat);if(this.isReconnecting||n)return;this.status.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===M.Exponential?b:N,a=this.isConnectedSubject.asObservable().pipe((0,S.n)(e=>e?(0,u.of)(-1):((e,t)=>new l.c(s=>{let i,r=0;return function n(){s.next(r),clearTimeout(i),i=setTimeout(n,t(e,r)),r+=1}(),()=>{clearTimeout(i)}}))(this.reconnectOptions,o).pipe((0,v.Z)(e=>{var t,s,i;let r;return r=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(i=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==i?i:10,e<r?(0,u.of)(e):(this.status.reconnectionLimitReached=!0,(0,E.$)(()=>new Error(`Max reconnect attempts ${r} reached.`)))}))),(0,R.v)(()=>this.websocket&&!this.isConnected));a.subscribe(null!==(r=null===(i=this.reconnectOptions)||void 0===i?void 0:i.reconnectObserver)&&void 0!==r?r:{next:e=>{_.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;_.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{_.v.info(this.isConnected?"Reconnected":"Disconnected"),this.status.isReconnecting=!1,this.wsMessageHandlers.forEach(e=>{e.isSubscription&&this.websocket.next(e.sentMessage)})}})}reset(){this.status.isConnected=!1,this.status.isConfigured=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new P,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s),new Promise((s,i)=>{const r=e=>{s(e)},n=e=>{i(e)};t&&this.setMessageHandler(e,r,n),this.websocket.next(e)})}sendForStream(e,t,s,i){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,r),this.setMessageHandler(e,t,s,!0),c.DOM.queueUpdate(()=>this.websocket.next(e)),new l.c(t=>{const s=new h.B;return this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF),(0,g.Q)(s)).subscribe({next:e=>{t.next(e)},error:e=>{t.error(e)},complete:()=>{t.complete()}}),()=>{s.complete(),this.sendDataLogoff(e.SOURCE_REF),this.removeMessageHandler(e.SOURCE_REF),i&&i()}})}sendForStreamWithoutTeardown(e,t,s){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const i=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,i),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF))}setMessageHandler(e,t,s,i=!1){const r=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new D(e,t,s,i))}sendDataLogoff(e){this.send(this.messageBuilder.createDataLogoffMessage(e),!1)}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,_.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Gp.DATA_LOGOFF:t(s);break;case f.Go.HEARTBEAT_PING:case f.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};w.REAUTH_ACTION_LOCK_KEY="reauthActionLock",(0,i.Cg)([c.observable],w.prototype,"websocket",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessages",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessageHandlers",void 0),(0,i.Cg)([A.l],w.prototype,"http",void 0),(0,i.Cg)([c.observable],w.prototype,"heartbeatIsEnabled",void 0),w=L=(0,i.Cg)([(0,i.Qj)(0,f.lT),(0,i.Qj)(1,T.N),(0,i.Qj)(2,o.b_),(0,i.Qj)(3,a.k),(0,i.Qj)(4,U.S5),(0,i.Qj)(5,r.KJ),(0,i.Qj)(6,O.R)],w);const G=d.DI.createInterface(e=>e.singleton(w));function F(){return d.DI.getOrCreateDOMContainer().get(G)}},48707:(e,t,s)=>{s.d(t,{X:()=>o,a:()=>a});var i=s(39087),r=s(17465),n=s(41119);const o=e=>e?e.map(e=>{const t={name:e.NAME,type:n.v[e.TYPE]||n.w.STRING};if(e.TYPE===n.w.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){r.v.error(e),t.enumOptions=[]}return t}):null,a=e=>{var t;const s=null==e?void 0:e.TYPE;if(s===i.v.DATASERVER)return e.FIELD||[];if(s===i.v.REQUEST_SERVER)return e.REPLY_FIELD||(null===(t=e.REPLY)||void 0===t?void 0:t.FIELD)||[];throw new Error(`Unsupported resource type: ${s}`)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(55823),r=s(84674),n=s(61455);const o=r.DI.createInterface();function a(e){return Number.isSafeInteger(+e)?Number(e):(0,n.Fq)(e)?BigInt.asIntN(64,e):parseFloat(e)}const c={parse:e=>(0,n.qg)(e,null,a),stringify:e=>(0,n.As)(e)};let d=class{constructor(e=c){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?"string"==typeof e?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};d=(0,i.Cg)([(0,i.Qj)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface(e=>e.singleton(d))},49587:(e,t,s)=>{s.d(t,{R:()=>n});var i=s(84674);const r={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,verboseHeartbeat:!1,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0},isWebSocketExpression:new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i")},n=i.DI.createInterface(e=>e.instance(r))},56653:(e,t,s)=>{var i;s.d(t,{h:()=>i,l:()=>r}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(i||(i={}));class r extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,r.prototype)}isIgnorableError(){var e,t,s,i,r,n,o,a;return!!(null===(i=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===i?void 0:i.includes("request needs the user to be logged"))||!!(null===(a=null===(o=null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR)||void 0===o?void 0:o.toLowerCase())||void 0===a?void 0:a.includes("is not logged in"))}getMessageError(){var e,t;return Array.isArray(null===(e=this.received)||void 0===e?void 0:e.ERROR)?null===(t=this.received)||void 0===t?void 0:t.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}getDetailsError(){var e,t,s,i;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(i=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===i?void 0:i.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasMFAError(){return this.hasErrorCode("MFA_REQUIRED")||this.hasErrorCode("MFA_FAILED")}requiresTermsAndConditions(){return this.hasErrorCode("TERMS_ACCEPTANCE_REQUIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some(t=>t.CODE===e))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},68424:(e,t,s)=>{s.d(t,{DW:()=>n,JH:()=>o});var i=s(52945),r=s(28745);function n(e,t){let s=e;for(;s;){const e=s.tagName.toLowerCase();if(e.endsWith("-design-system-provider")){const t=e.split("-design-system-provider")[0];if(t)return r.v.debug(`Found provider by ancestor search: ${e}, prefix: ${t}`),{element:s,prefix:t}}s=s.parentElement?s.parentElement:s.getRootNode&&s.getRootNode()instanceof ShadowRoot?s.getRootNode().host:null}const n=document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]'),o=Array.from(n),a=(0,i.fI)(document).filter(e=>{var t;const s=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return(null==s?void 0:s.endsWith("-design-system-provider"))||!1});if(o.push(...a),o.length>0){const e=o[0],t=e.tagName.toLowerCase(),s=t.split("-design-system-provider")[0];if(s)return r.v.debug(`Found provider by document search: ${t}, prefix: ${s}`),{element:e,prefix:s}}return r.v.debug(`No provider found. Falling back to ${t}.`),{element:null,prefix:t}}function o(e,t){return n(e,t).prefix}},79780:(e,t,s)=>{s.d(t,{Es:()=>n});var i=s(84674);class r extends BroadcastChannel{constructor(){super(...arguments),this.postMessage=(...e)=>{const[t,s]=e;super.postMessage({type:t,detail:s})},this.isMessageType=(e,t)=>{var s;return(null===(s=t.data)||void 0===s?void 0:s.type)===e}}}const n=e=>{class t extends r{constructor(){super(e)}}return i.DI.createInterface(e=>e.transient(t))}},84686:(e,t,s)=>{s.d(t,{Be:()=>S,H6:()=>O,OB:()=>r,PF:()=>n,aW:()=>E,vN:()=>a});let i="webpack";try{i="webpack"}catch(e){}let r="/";try{r="auto".replace(/\/$/,"")}catch(e){}let n,o="gwf";try{"undefined"!=typeof SOCKET_EXT&&(o=SOCKET_EXT)}catch(e){}try{n=FORCE_HTTP}catch(e){}const a=`${location.protocol.replace("http","ws")}//${location.host}${r}/${o}/`;"true"===n?location.protocol:location.protocol.replace("http","ws");let c,d,h,l,u=null;try{"undefined"!=typeof API_HOST&&(u=API_HOST)}catch(e){}try{c=""}catch(e){}try{d=DEFAULT_ORGANISATION}catch(e){}try{h=DEFAULT_PASSWORD}catch(e){}try{l=DEFAULT_USER}catch(e){}let E="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_URL&&(E=GENX_LOGIN_URL);let g="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_REFRESH_URL&&(g=GENX_LOGIN_REFRESH_URL);let S="gwf/event-login-details";"undefined"!=typeof GENX_LOGIN_DETAILS_URL&&(S=GENX_LOGIN_DETAILS_URL);let v="gwf/event-logout";"undefined"!=typeof GENX_LOGOUT_URL&&(v=GENX_LOGOUT_URL);let R="gwf/event-change-user-password";"undefined"!=typeof GENX_CHANGE_PASSWORD_URL&&(R=GENX_CHANGE_PASSWORD_URL);let m="gwf/event-self-service-password-reset";"undefined"!=typeof GENX_FORGOT_PASSWORD_URL&&(m=GENX_FORGOT_PASSWORD_URL);let p="gwf/event-password-reset-action";"undefined"!=typeof GENX_RESET_PASSWORD_URL&&(p=GENX_RESET_PASSWORD_URL);let T="gwf/sso/list";"undefined"!=typeof GENX_SSO_LIST_URL&&(T=GENX_SSO_LIST_URL);let _="gwf/{type}/login?idp={id}";"undefined"!=typeof GENX_SSO_LOGIN_URL&&(_=GENX_SSO_LOGIN_URL);let O="default";"undefined"!=typeof GENX_ENVIRONMENT_LEVEL&&(O=GENX_ENVIRONMENT_LEVEL);let A="gwf/auth/accept-terms";"undefined"!=typeof GENX_ACCEPT_TERMS_URL&&(A=GENX_ACCEPT_TERMS_URL)},92277:(e,t,s)=>{s.d(t,{KJ:()=>E});var i=s(55823),r=s(17190),n=s(33681),o=s(84674),a=s(79780);const c=(0,s(48265).createLogger)("foundation-user"),d={trackActionExclusions:[],trackPathExclusions:[""],setUser(e,t){if(e.isAuthenticated)throw new Error("User already set. If this is intentional, please call User.unset first.");return c.debug("setUser",t),e.rawProperties=structuredClone(t),e.userKVs=t.userKVs,e.details=t.details,e.permission=t.permission,e.profile=t.profile,e.sourceRef=t.sourceRef,e.userName=t.userName,e.isAuthenticated=!0,e},unsetUser:e=>(c.debug("unsetUser"),e.rawProperties=void 0,e.userKVs=void 0,e.details=void 0,e.permission=void 0,e.profile=void 0,e.sourceRef=void 0,e.userName=void 0,e.isAuthenticated=!1,e)},h=o.DI.createInterface(e=>e.instance(d)),l=(0,a.Es)("genesis-user");class u{constructor(){this.pathHistory=[],this.actionHistory=[],this.isAuthenticated=!1,this.authenticationChangeListeners=(0,r.r)()}set(e){return this.config.setUser(this,e)}unset(){return this.config.unsetUser(this)}get isAnonymous(){return!this.isAuthenticated}isAdmin(){return this.hasProfile("ADMIN")}isBanned(){return this.hasProfile("BANNED")}hasPermission(e){return this.hasKey(this.permission,e)}hasProfile(e){return this.hasKey(this.profile,e)}trackPath(){const{pathname:e,search:t,hash:s}=location,i=`${`${"/"!==e?e:""}`}${t}${s}`;if(!this.config.trackPathExclusions.includes(i))return this.pathHistory.push(i),i}clearPaths(){this.pathHistory=[]}lastPath(){const e=this.pathHistory.length;return e>0?this.pathHistory[e-1]:void 0}trackAction(e){this.config.trackActionExclusions.includes(e)||this.actionHistory.push(e)}clearActions(){this.actionHistory=[]}lastAction(){const e=this.actionHistory.length;return e>0?this.actionHistory[e-1]:void 0}clearTrackingHistory(){this.clearPaths(),this.clearActions()}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some(t=>e.includes(t)))}addAuthenticationChangeListener(e){var t;return null===(t=this.authenticationChangeListeners)||void 0===t?void 0:t.subscribe(e)}isAuthenticatedChanged(){var e;null===(e=this.authenticationChangeListeners)||void 0===e||e.publish(new CustomEvent("user-authentication-change",{detail:this.isAuthenticated}));const t=o.DI.getOrCreateDOMContainer().get(l);t.postMessage("user-authentication-change",this.isAuthenticated),t.close()}userNameChanged(){n.Observable.notify(this,"username")}get username(){return n.Observable.track(this,"username"),this.userName}permissionChanged(){n.Observable.notify(this,"permissions")}get permissions(){return n.Observable.track(this,"permissions"),this.permission}profileChanged(){n.Observable.notify(this,"profiles")}get profiles(){return n.Observable.track(this,"profiles"),this.profile}hasAdminProfile(){return this.isAdmin()}}(0,i.Cg)([h],u.prototype,"config",void 0),(0,i.Cg)([n.observable],u.prototype,"pathHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"actionHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"isAuthenticated",void 0),(0,i.Cg)([n.observable],u.prototype,"userKVs",void 0),(0,i.Cg)([n.observable],u.prototype,"details",void 0),(0,i.Cg)([n.observable],u.prototype,"permission",void 0),(0,i.Cg)([n.observable],u.prototype,"profile",void 0),(0,i.Cg)([n.observable],u.prototype,"sourceRef",void 0),(0,i.Cg)([n.observable],u.prototype,"userName",void 0),(0,i.Cg)([n.observable],u.prototype,"rawProperties",void 0);const E=o.DI.createInterface(e=>e.singleton(u))},96730:(e,t,s)=>{function i(e,t=";"){return e?e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t):e}s.d(t,{Q:()=>i})},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(84674);class r{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach(e=>this.removeSessionStorageItem(e)),this.removeLocalStorageItem("refreshToken")}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){var t;this.setSessionStorageItem("authToken",e.SESSION_AUTH_TOKEN),this.setSessionStorageItem("refreshToken",e.REFRESH_AUTH_TOKEN),this.setSessionStorageItem("username",e.USER_NAME),this.setSessionStorageItem("sessionId",e.SESSION_ID),(null===(t=e.DETAILS)||void 0===t?void 0:t.MFA_CODE)&&this.setSessionStorageItem("mfaToken",e.DETAILS.MFA_CODE)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if(e&&(e.includes("/login")||e.includes("/auth")))return;const i=`${"/"!==e?e:""}`;this.returnUrl=`${i}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?localStorage.setItem(this.storageKeyPrefix+e,t):sessionStorage.setItem(this.storageKeyPrefix+e,t)}getItem(e,t){return"local"===t?localStorage.getItem(this.storageKeyPrefix+e):sessionStorage.getItem(this.storageKeyPrefix+e)}removeItem(e,t){"local"===t?localStorage.removeItem(this.storageKeyPrefix+e):sessionStorage.removeItem(this.storageKeyPrefix+e)}setLocalStorageItem(e,t){this.setItem(e,t,"local")}setSessionStorageItem(e,t){this.setItem(e,t,"session")}getLocalStorageItem(e){return this.getItem(e,"local")}getSessionStorageItem(e){return this.getItem(e,"session")}removeLocalStorageItem(e){this.removeItem(e,"local")}removeSessionStorageItem(e){this.removeItem(e,"session")}}const n=i.DI.createInterface(e=>e.singleton(r))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_genesislcap_design_system_configurator=self.webpackChunk_genesislcap_design_system_configurator||[]).push([[347],{5709:(e,t,s)=>{s.d(t,{S5:()=>d});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156);class c{constructor(){this.isConfigured=!1,this.isConnecting=!1,this.isConnected=!1,this.isReconnecting=!1,this.reconnectionLimitReached=!1,this.isConnectedSubject=new a.t(this.isConnected)}get hasValidSession(){return this.user.isAuthenticated}get isDisconnected(){return!this.isConnected}get isDisconnectedByServer(){return void 0!==this.closedClean&&!this.closedClean}isConnectedChanged(){var e;this.isConnected&&this.resetClosedState(),this.isConnecting=!1,this.isReconnecting=!1,null===(e=this.isConnectedSubject)||void 0===e||e.next(this.isConnected)}isReconnectingChanged(){this.isReconnecting&&(this.reconnectionLimitReached=!1)}resetClosedState(){this.closedCode=void 0,this.closedReason=void 0,this.closedClean=void 0}serialize(){return{isConfigured:this.isConfigured,isConnecting:this.isConnecting,isConnected:this.isConnected,isDisconnected:this.isDisconnected,isDisconnectedByServer:this.isDisconnectedByServer,isReconnecting:this.isReconnecting,reconnectionLimitReached:this.reconnectionLimitReached,hasValidSession:this.hasValidSession,closedCode:this.closedCode,closedReason:this.closedReason,closedClean:this.closedClean}}onClose(e){this.isConnected=!1,this.closedCode=e.code,this.closedReason=e.reason,this.closedClean=e.wasClean}}(0,i.Cg)([n.observable],c.prototype,"isConfigured",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"isConnected",void 0),(0,i.Cg)([n.observable],c.prototype,"isReconnecting",void 0),(0,i.Cg)([n.observable],c.prototype,"reconnectionLimitReached",void 0),(0,i.Cg)([n.observable],c.prototype,"closedCode",void 0),(0,i.Cg)([n.observable],c.prototype,"closedReason",void 0),(0,i.Cg)([n.observable],c.prototype,"closedClean",void 0),(0,i.Cg)([r.KJ],c.prototype,"user",void 0);const d=o.DI.createInterface(e=>e.singleton(c))},6884:(e,t,s)=>{s.d(t,{aB:()=>a,OD:()=>n});var i=s(84674);var r=s(34193);class n{}n.MAX_ROWS_250=250,n.MAX_VIEW_1000=1e3,n.REQ_REP_POLLING_INTERVAL_MS=1e4,n.DATASERVER_ROW_ID="ROW_REF",n.REQUEST_SERVER_ROW_ID="RECORD_ID",n.DEFAULT_PAGINATION_PAGE_SIZE=25,n.DEFAULT_REQ_REP_OFFSET=0;const o={options:{criteria:"",isSnapshot:!1,maxRows:n.MAX_ROWS_250,maxView:n.MAX_VIEW_1000,pollingInterval:n.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:"",resourceName:"",reverse:!1,pollTriggerEvents:[]},criteriaToFields:function(e){const t=e.split("&&").map(e=>e.trim()),s={};return t.forEach(e=>{if(e.startsWith("Expr"))switch(e.match(/Expr\.(\w+)\(/)[1]){case"dateIsToday":{const t=/Expr\.dateIsToday\((\w+)\)/,[,i]=e.match(t),r=new Date;s[`${i}_FROM`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`,r.setDate(r.getDate()+1),s[`${i}_TO`]=`${r.toISOString().replace(/-/g,"").split("T")[0]}-00:00`}break;case"dateTimeIsGreaterEqual":{const t=/Expr\.dateTimeIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateTimeIsLessEqual":{const t=/Expr\.dateTimeIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"dateIsGreaterEqual":{const t=/Expr\.dateIsGreaterEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_FROM`]=r}break;case"dateIsLessEqual":{const t=/Expr\.dateIsLessEqual\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[`${i}_TO`]=r}break;case"containsIgnoreCase":{const t=/Expr\.containsIgnoreCase\((\w+), ?['"](.+)['"]\)/,[,i,r]=e.match(t);s[i]=`*${r}*`}}else{const t=e.substr(0,e.indexOf("=")).trim().replace(/["']/g,""),i=e.substr(e.lastIndexOf("=")+1,e.length).trim().replace(/["']/g,"");s[t]=i}}),s},dataServerResultFilter:r.d},a=i.DI.createInterface(e=>e.instance(o))},9033:(e,t,s)=>{s.d(t,{yW:()=>M});var i=s(55823),r=s(33681),n=s(84674),o=s(50049),a=s(8790),c=s(1762),d=s(51046),h=s(66640),l=s(84190),u=s(65052),E=s(40113),g=s(26347),S=s(24669),v=s(48707),R=s(17465),m=s(79780);const p={throwWhenUnavailable:!0,throwWhenUnknown:!1},T=n.DI.createInterface(e=>e.instance(p)),_=(0,m.Es)("genesis-resources");let O=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!(e=null==e?void 0:e.trim()))return!1;yield this.fetchResources();return!!this.resources.find(t=>t.RESOURCE_NAME===e)})}getResourceTypeFor(e){return(0,i.sH)(this,void 0,void 0,function*(){yield this.fetchResources();const t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;const s=`${e} resource does not exist.`;if(R.v.error(s),this.config.throwWhenUnknown)throw new Error(s)})}getAllResources(){return(0,i.sH)(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return(0,i.sH)(this,void 0,void 0,function*(){var e;if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();const t=yield this.resourcesPromise;if(this.resources=null==t?void 0:t.RESOURCES,!(null===(e=this.resources)||void 0===e?void 0:e.length)){const e="Genesis resources unavailable.";if(R.v.error(e),this.config.throwWhenUnavailable)throw new Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){const e=n.DI.getOrCreateDOMContainer().get(_);e.postMessage("resources-loaded",this.resources),e.close()}};O=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,T)],O);const A=n.DI.createInterface(e=>e.singleton(O));var f=s(6884),I=s(39087);let C=class{get initialized(){var e;return!!(null===(e=this.status)||void 0===e?void 0:e.isInitialized)}constructor(e,t,s,i,r){this.connect=e,this.auth=t,this.resources=s,this.config=i,this.connectEvents=r,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new o.B}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return R.v.deprecated("Datasource.validResourceName","Use `GenesisResources.isValidResource` instead."),!!e&&!!e.trim().length}init(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,s=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();const i=this.options.resourceName;if(!(this.connect.isConnected||(yield this.connect.connect())))return R.v.error(`Unable to connect to ${this.connect.host} to get ${i} datasource`),this.reportStatus(),!1;return(yield this.resources.isValidResource(i))?(this.resourceType=yield this.resources.getResourceTypeFor(i),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),R.v.debug(`Initializing ${i} datasource from ${this.connect.host}`),!this.options.isSnapshot&&s&&(this.stream=yield this.createStream()),R.v.debug(`${i} datasource initialization ${this.initialized?"was successful.":"has failed."}`),this.reportStatus(),this.initialized):(R.v.error(`Unable to get the resource type for ${i} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(R.v.error(`${i} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1)})}startStream(){return(0,i.sH)(this,void 0,void 0,function*(){this.options.isSnapshot||void 0!==this.stream||(this.stream=yield this.createStream())})}destroy(){var e,t;R.v.debug("Datasource.destroy",null===(e=this.options)||void 0===e?void 0:e.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),null===(t=this.pollTrigger$)||void 0===t||t.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){var e;if(this._allParams)return this._allParams;let t;if(this.options.orderBy)if(this.criteriaOnlyRequest||(null===(e=this.availableIndexes)||void 0===e?void 0:e.findIndex(e=>e.NAME===this.options.orderBy))>-1)t=this.options.orderBy;else{const e=this.availableIndexes.map(e=>e.NAME);R.v.warn("Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:",e)}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:t,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},R.v.debug("Getting configured params:",this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){const e=this.allResourceParams,{REQUEST:t}=e,s=(0,i.Tt)(e,["REQUEST"]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:s.CRITERIA_MATCH,MAX_ROWS:s.MAX_ROWS,OFFSET:s.OFFSET,ORDER_BY:s.ORDER_BY,VIEW_NUMBER:s.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:null!=t?t:this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};const e=Object.assign({},Object.fromEntries(this.requestFields.map(e=>[e.NAME,"*"]))),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return(0,i.sH)(this,void 0,void 0,function*(){switch(R.v.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case I.v.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case I.v.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw new Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return(0,i.sH)(this,arguments,void 0,function*(e="ROW_REF"){const t=yield this.snapshot();return Array.isArray(t)?t:t.REPLY?t.REPLY:t.ROW?this.config.dataServerResultFilter(t,e).inserts:void 0})}createStream(){return(0,i.sH)(this,void 0,void 0,function*(){if(![I.v.DATASERVER,I.v.REQUEST_SERVER].includes(this.resourceType))throw new Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===I.v.DATASERVER?this.createDataserverStream():(R.v.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return(0,i.sH)(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>R.v.error(e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{var t;const{eventName:s,response:i}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(s)&&(null===(t=i.MESSAGE_TYPE)||void 0===t?void 0:t.endsWith("_ACK"))&&(R.v.debug(`Received commit response for ${s}, triggering poll.`),this.triggerPoll())});const e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{const e=this.requestOnlyParams;if(this.resourceType===I.v.REQUEST_SERVER&&this.loadMoreCount>0){const t=25,s=(this.options.maxRows||t)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=s}return(0,a.z)([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe((0,h.v)(()=>this.connect.isConnected&&this.auth.isLoggedIn),(0,l.n)(()=>(0,c.H)(this.snapshot(e))))};return e?this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(()=>(0,d.O)(0,e).pipe((0,l.n)(t)))):this.pollTrigger$.pipe((0,u.Z)(0),(0,l.n)(t))}fetchAndApplyMetadata(e){return(0,i.sH)(this,void 0,void 0,function*(){var t,s;try{R.v.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);const e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=null!==(t=e.INDEXES)&&void 0!==t?t:[],this.originalFieldDef=(0,v.a)(e),this.fieldMetadata=(0,v.X)(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:(null===(s=this.fieldMetadata)||void 0===s?void 0:s.length)>0})}catch(t){R.v.error(`Metadata Fetch failed for ${e}:`,t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){var t;const s=null!==(t=this.config.eventEmitter)&&void 0!==t?t:document;this.status=this.normaliseStatus(e),R.v.debug(`Dispatching '${I.w}'`,this.status),null==s||s.dispatchEvent(new CustomEvent(I.w,{detail:this.status,bubbles:s!==document,composed:!0}))}normaliseStatus(e){var t,s,i,r,n;const o=null!==(t=e.isInitialized)&&void 0!==t?t:this.initialized,a=null!==(s=e.metadataRequired)&&void 0!==s?s:this.fetchMetadataRequired,c=null!==(i=e.hasMetadata)&&void 0!==i?i:(null===(r=this.fieldMetadata)||void 0===r?void 0:r.length)>0;return{name:null===(n=this.options)||void 0===n?void 0:n.resourceName,type:this.resourceType,isInitialized:o,metadataRequired:a,hasMetadata:c}}invalidateCache(){this._allParams=null}};(0,i.Cg)([r.observable],C.prototype,"status",void 0),(0,i.Cg)([r.observable],C.prototype,"fetchMetadataRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"startStreamRequired",void 0),(0,i.Cg)([r.observable],C.prototype,"originalFieldDef",void 0),(0,i.Cg)([r.observable],C.prototype,"fieldMetadata",void 0),(0,i.Cg)([r.observable],C.prototype,"requestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"customRequestFields",void 0),(0,i.Cg)([r.observable],C.prototype,"availableIndexes",void 0),(0,i.Cg)([r.observable],C.prototype,"criteriaOnlyRequest",void 0),(0,i.Cg)([r.observable],C.prototype,"loadMoreCount",void 0),(0,i.Cg)([r.observable],C.prototype,"readOnly",void 0),(0,i.Cg)([r.observable],C.prototype,"stream",void 0),C=(0,i.Cg)([(0,i.Qj)(0,g.dm),(0,i.Qj)(1,E.N),(0,i.Qj)(2,A),(0,i.Qj)(3,f.aB),(0,i.Qj)(4,S.a4)],C);const M=n.DI.createInterface(e=>e.transient(C))},12066:(e,t,s)=>{s.d(t,{CL:()=>r,Ey:()=>a,zT:()=>o});const i=10;function r(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,i)}const n=19;function o(e){return!e||isNaN(e)?null:new Date(e).toISOString().slice(0,n).replace("T"," ")}function a(e,t){return t?o(e):r(e)}},17190:(e,t,s)=>{s.d(t,{j:()=>r,r:()=>i});const i=()=>{let e=[];return{subscribe:t=>(e.push(t),()=>e=e.filter(e=>e!==t)),publish(t){e.forEach(e=>e(t))}}},r=(e,t)=>{const s={root:document.documentElement};new IntersectionObserver(e=>{e.forEach(e=>{t(e.intersectionRatio>0)})},s).observe(e)}},17465:(e,t,s)=>{s.d(t,{v:()=>r});var i=s(78464);const r=(0,i.createLogger)("foundation-comms")},21281:(e,t,s)=>{s.d(t,{Go:()=>i,Gp:()=>r,lT:()=>E,x6:()=>n,z2:()=>l});var i,r,n,o=s(55823),a=s(32808),c=s(84674),d=s(56653),h=s(98316);!function(e){e.LOGON_ACK="LOGON_ACK",e.LOGON_NACK="LOGON_NACK",e.LOGOFF_ACK="LOGOFF_ACK",e.LOGOFF_NACK="LOGOFF_NACK",e.HEARTBEAT_PING="HEARTBEAT_PING",e.HEARTBEAT_PONG="HEARTBEAT_PONG",e.MORE_ROWS="MORE_ROWS",e.MORE_COLUMNS="MORE_COLUMNS",e.MORE_COLUMNS_ACK="MORE_COLUMNS_ACK",e.MSG_ACK="MSG_ACK",e.MSG_NACK="MSG_NACK",e.LOGOUT_ACK="LOGOUT_ACK",e.LOGOUT_NACK="LOGOUT_NACK",e.QUERY_UPDATE="QUERY_UPDATE"}(i||(i={})),function(e){e.EVENT_LOGIN_AUTH="EVENT_LOGIN_AUTH",e.EVENT_LOGIN_AUTH_ACK="EVENT_LOGIN_AUTH_ACK",e.EVENT_LOGIN_AUTH_NACK="EVENT_LOGIN_AUTH_NACK",e.EVENT_LOGOUT="EVENT_LOGOUT",e.DATA_LOGON="DATA_LOGON",e.DATA_LOGOFF="DATA_LOGOFF",e.META_REQUEST="META_REQUEST",e.JSON_SCHEMA_REQUEST="JSON_SCHEMA_REQUEST",e.RESOURCES_REQUEST="RESOURCES_REQUEST",e.RESOURCES_REQUEST_ACK="RESOURCES_REQUEST_ACK",e.RESOURCES_REQUEST_NACK="RESOURCES_REQUEST_NACK",e.EVENT_CHANGE_USER_PASSWORD="EVENT_CHANGE_USER_PASSWORD",e.EVENT_SELF_SERVICE_PASSWORD_RESET="EVENT_SELF_SERVICE_PASSWORD_RESET",e.EVENT_PASSWORD_RESET_ACTION="EVENT_PASSWORD_RESET_ACTION"}(r||(r={})),function(e){e.SESSION_NOT_FOUND="SESSION_NOT_FOUND",e.UNKNOWN_MESSAGE_TYPE="UNKNOWN_MESSAGE_TYPE"}(n||(n={}));const l=(e,t)=>!!Array.isArray(null==e?void 0:e.ERROR)&&(null==e?void 0:e.ERROR.some(e=>{var s,i;return(null===(s=e.CODE)||void 0===s?void 0:s.includes(`${t}`))||(null===(i=e.STATUS_CODE)||void 0===i?void 0:i.includes(`${t}`))}));let u=class{constructor(e,t){this.session=e,this.uuid=t}createLoginMessage(e){let t;switch(e.type){case d.h.BASIC:t={USER_NAME:e.username,PASSWORD:e.password,MFA_CODE:e.mfaToken};break;case d.h.REFRESH:t={USER_NAME:e.username,REFRESH_AUTH_TOKEN:e.refreshToken,MFA_CODE:e.mfaToken};break;case d.h.SSO:t={SSO_TOKEN:e.ssoToken};break;case d.h.JWT:t={JWT:e.jwt,DOMAIN:e.domain}}return{DETAILS:t,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH}}createLogoutMessage(e){var t,s;return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_LOGOUT,SESSION_AUTH_TOKEN:null!==(t=e.authToken)&&void 0!==t?t:this.session.getSessionStorageItem("authToken"),SESSION_ID:null!==(s=e.sessionId)&&void 0!==s?s:this.session.getSessionStorageItem("sessionId")}}createDataLogonMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.DATA_LOGON,DETAILS:Object.assign({DATASOURCE_NAME:e},t),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createDataLogoffMessage(e){return{SOURCE_REF:e,MESSAGE_TYPE:r.DATA_LOGOFF,SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createRequestMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e.startsWith("REQ_")?e:`REQ_${e}`},t)}createResourcesMessage(e){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.RESOURCES_REQUEST},e)}createMetaRequestMessage(e,t=r.META_REQUEST){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:t,DETAILS:{FEATURE:e},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createCommitMessage(e,t){return Object.assign({SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:e},t)}createRefreshTokenMessage(){return{SOURCE_REF:this.uuid.createId(),SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken"),MESSAGE_TYPE:r.EVENT_LOGIN_AUTH,DETAILS:{REFRESH_AUTH_TOKEN:this.session.getSessionStorageItem("refreshToken"),MFA_CODE:this.session.getSessionStorageItem("mfaToken")}}}createChangePasswordMessage(e,t,s){return{USER_NAME:e,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_CHANGE_USER_PASSWORD,DETAILS:{OLD_PASSWORD:t,NEW_PASSWORD:s}}}createForgotPasswordMessage(e,t,s=e){return{USER_NAME:s,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_SELF_SERVICE_PASSWORD_RESET,DETAILS:{USER_NAME:e,RETURN_URL:t}}}createForgotPasswordTokenMessage(e,t,s,i=e){return{USER_NAME:i,SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:r.EVENT_PASSWORD_RESET_ACTION,DETAILS:{USER_NAME:e,RESET_TOKEN:t,NEW_PASSWORD:s}}}createMoreRowsMessage(e,t){return{SOURCE_REF:this.uuid.createId(),MESSAGE_TYPE:i.MORE_ROWS,DETAILS:{SOURCE_REF:e,VIEW_NUMBER:t},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}createMoreColumnsMessage(e){return Object.assign(Object.assign({},this.createMoreRowsMessage(e)),{MESSAGE_TYPE:i.MORE_COLUMNS})}createHTTPHeadersFromMessage(e,t="application/json; charset=UTF-8"){const s={"Content-type":t};return e.SOURCE_REF&&(s["source-ref"]=e.SOURCE_REF,s.SOURCE_REF=e.SOURCE_REF),e.SESSION_AUTH_TOKEN&&(s["SESSION-AUTH-TOKEN"]=e.SESSION_AUTH_TOKEN),e.MESSAGE_TYPE===r.EVENT_LOGOUT&&(s["SESSION-ID"]=e.SESSION_ID),s}createHeartbeatPingMessage(e=!1){return{MESSAGE_TYPE:i.HEARTBEAT_PING,SOURCE_REF:this.uuid.createId(),VERBOSE:e,DETAILS:{},SESSION_AUTH_TOKEN:this.session.getSessionStorageItem("authToken")}}};u=(0,o.Cg)([(0,o.Qj)(0,h.N),(0,o.Qj)(1,a.k)],u);const E=c.DI.createInterface(e=>e.singleton(u))},24669:(e,t,s)=>{s.d(t,{EQ:()=>a,a4:()=>o});var i=s(17190),r=s(84674);class n{constructor(){this.streamListeners=(0,i.r)(),this.streamCompleteListeners=(0,i.r)(),this.streamErrorListeners=(0,i.r)(),this.commitListeners=(0,i.r)(),this.metadataListeners=(0,i.r)(),this.commitResponseListeners=(0,i.r)()}addStreamListener(e,t,s){var i,r,n;const o=null===(i=this.streamListeners)||void 0===i?void 0:i.subscribe(e),a=null===(r=this.streamCompleteListeners)||void 0===r?void 0:r.subscribe(t),c=null===(n=this.streamErrorListeners)||void 0===n?void 0:n.subscribe(s);return()=>{o(),a(),c()}}onStreamEvent(e,t,s,i){var r;null===(r=this.streamListeners)||void 0===r||r.publish(new CustomEvent("connect-stream-event",{detail:{functions:i,message:t,resourceName:e,stream:s}}))}onStreamErrorEvent(e,t,s){var i;null===(i=this.streamErrorListeners)||void 0===i||i.publish(new CustomEvent("connect-stream-error-event",{detail:{resourceName:e,stream:t,error:s}}))}onStreamCompleteEvent(e,t){var s;null===(s=this.streamCompleteListeners)||void 0===s||s.publish(new CustomEvent("connect-stream-complete-event",{detail:{resourceName:e,stream:t}}))}addCommitListener(e){var t;return null===(t=this.commitListeners)||void 0===t?void 0:t.subscribe(e)}onCommitEvent(e,t){var s;null===(s=this.commitListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-event",{detail:{eventName:e,message:t}}))}addMetadataListener(e){var t;return null===(t=this.metadataListeners)||void 0===t?void 0:t.subscribe(e)}onMetadataEvent(e,t,s){var i;null===(i=this.metadataListeners)||void 0===i||i.publish(new CustomEvent("connect-metadata-event",{detail:{resourceName:e,message:t,error:s}}))}addCommitResponseListener(e){var t;return null===(t=this.commitResponseListeners)||void 0===t?void 0:t.subscribe(e)}onCommitResponseEvent(e,t){var s;null===(s=this.commitResponseListeners)||void 0===s||s.publish(new CustomEvent("connect-commit-response-event",{detail:{eventName:e,response:t}}))}}const o=r.DI.createInterface(e=>e.singleton(n)),a=r.DI.createInterface(e=>e.aliasTo(o))},26347:(e,t,s)=>{s.d(t,{dm:()=>D,tn:()=>w});var i=s(55823),r=s(84686),n=s(33681),o=s(84674),a=s(77909);class c{constructor(){this.cachedMetadata=new Map,this.cachedJsonSchema=new Map}getMetadataFor(e){return this.cachedMetadata.get(e)}getJsonSchemaFor(e){return this.cachedJsonSchema.get(e)}hasMetadataFor(e){return this.cachedMetadata.has(e)}hasJsonSchemaFor(e){return this.cachedJsonSchema.has(e)}setMetadataFor(e,t){this.cachedMetadata.set(e,t)}setJsonSchemaFor(e,t){this.cachedJsonSchema.set(e,t)}}const d=o.DI.createInterface(e=>e.singleton(c));var h=s(17465),l=s(24669),u=s(49587),E=s(49229),g=s(97156),S=s(7827),v=s(1762),R=s(84190),m=s(78213),p=s(66640),T=s(16220),_=s(98316),O=s(32748);const A={polling:Object.assign({POLLING_MAP:{EVENT_AMEND_USER:{TEMP_FREQUENCY:500,AMOUNT_OF_POLLS:5,QUERIES:["ALL_USERS"]}},POLLING_INTERVAL_MAP:{ALL_TRADES:5e3,ALL_USERS:5e3,ALL_PROCESSES_STATUS:1e4},POLLING_FREQUENCY:5e3},{})},f=o.DI.createInterface(e=>e.instance(A));var I=s(21281);const C=(e,t)=>((null==t?void 0:t.ROW)&&e&&e.length>0?t.ROW.forEach(t=>{const s=t;if(s&&s.DETAILS){const i=s.DETAILS.ROW_REF,r=s.DETAILS.OPERATION;"INSERT"===r&&(e.find(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i})||e.unshift(s)),"DELETE"===r&&(e=e.filter(e=>{var s,i;return(null===(s=t.DETAILS)||void 0===s?void 0:s.ROW_REF)!==(null===(i=e.DETAILS)||void 0===i?void 0:i.ROW_REF)})),"MODIFY"===r&&(e=e.map(e=>{var t;return(null===(t=e.DETAILS)||void 0===t?void 0:t.ROW_REF)===i?Object.assign(Object.assign({},e),s):e}))}}):!t||e&&0!==e.length||(e=[...new Set(t.ROW)]),e);var M;let b=M=class{get isConnected(){return this._isConnected}set isConnected(e){this._isConnected=e,this.isConnectedSubject.next(this._isConnected)}constructor(e,t,s,i,r,n){var o;this.http=e,this.messageBuilder=t,this.session=s,this.metaCache=i,this.serializer=r,this.config=n,this.isWorking=!1,this._isConnected=!1,this.isConnectedSubject=new g.t(this._isConnected),this.isConnected$=null===(o=this.isConnectedSubject)||void 0===o?void 0:o.asObservable(),this.ongoingTurbo={},this.streams=new Map}checkHost(){return(0,i.sH)(this,void 0,void 0,function*(){try{return this.getMessage({MESSAGE_TYPE:I.Go.HEARTBEAT_PING,SOURCE_REF:"host check"}).then(e=>e.MESSAGE_TYPE===I.Go.HEARTBEAT_PONG)}catch(e){return h.v.error(e),!1}})}send(e,t){return this.http.post(M.getUrl(this.host,e),{body:M.getBody(e),headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})}httpMode(){return!0}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}connect(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.host=e,this.host.endsWith("/")||(this.host=this.host.concat("/")),this.checkHost().then(e=>(this.isConnected=e,this.session.setSessionStorageItem("hostUrl",this.host),e))})}disconnect(){this.isConnected=!1,this.streams.clear(),this.ongoingTurbo={},this.host=void 0}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.send(s).then(e=>(this.dataLogoff(s.SOURCE_REF).catch(e=>h.v.error(e)),e))})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`HTTP MODE - ${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=r.SOURCE_REF;this.streams.set(n,{SOURCE_REF:n,POLLING_FREQUENCY:new g.t(this.config.polling.POLLING_FREQUENCY),RESOURCE_NAME:e});const o=this.streams.get(n).POLLING_FREQUENCY,a=(0,S.x)((0,v.H)(this.send(r)),o.pipe((0,R.n)(e=>(0,m.Y)(e))).pipe((0,R.n)(()=>(0,v.H)(this.getMessage(r))))).pipe((0,p.v)(()=>this.streams.has(n)),(0,T.j)(()=>{h.v.debug(`Terminating stream for ${e} - ${n}`),this.dataLogoff(n)}));return this.streams.get(n).STREAM=a,a}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){return h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0"),this.stream(e,t,s,i)}getMessage(e){return(0,i.sH)(this,void 0,void 0,function*(){return this.http.get(M.getUrl(this.host,e),{headers:this.messageBuilder.createHTTPHeadersFromMessage(e)})})}getMoreRows(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreRowsMessage(e);return h.v.debug(`HTTP MODE - ${t.MESSAGE_TYPE} message created -> `,t),this.send(t)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return this.send(t).then(t=>(this.streams.has(e)&&(h.v.debug(`Removing stream ${e}`),this.streams.delete(e)),t))})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){const s=this.messageBuilder.createMetaRequestMessage(e);return h.v.debug(`HTTP MODE - ${s.MESSAGE_TYPE} (metadata) message created -> `,s),this.send(s).then(e=>e.DETAILS)})}getJSONSchema(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (json schema) message created -> `,t),this.send(t)})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (request server) message created -> `,s),this.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`HTTP MODE! - ${t.MESSAGE_TYPE} (getResources) message created -> `,t),this.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);return h.v.debug(`HTTP MODE! - ${s.MESSAGE_TYPE} (commit) message created -> `,s),this.send(s).then(t=>(this.maybeTurbo(e,t),t))})}maybeTurbo(e,t){var s;if(!(null===(s=null==t?void 0:t.MESSAGE_TYPE)||void 0===s?void 0:s.endsWith("_ACK")))return;if(this.ongoingTurbo[e])return void h.v.debug(`${e} polling frequency is already accelerated.`);const i=this.config.polling.POLLING_MAP[e];if(!(null==i?void 0:i.TEMP_FREQUENCY)||!i.AMOUNT_OF_POLLS)return;const r=i.TEMP_FREQUENCY,n=r*i.AMOUNT_OF_POLLS,o=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP)),a=JSON.parse(JSON.stringify(this.config.polling.POLLING_INTERVAL_MAP));for(const e of i.QUERIES)a[e]=r,o[e]||(o[e]=this.config.polling.POLLING_FREQUENCY);h.v.debug(`${e} TRIGGERED -> ENFORCING TURBO | FREQUENCY=${r}ms DURATION=${n}`),this.ongoingTurbo[e]=!0,this.updateIntervals({polling:{POLLING_INTERVAL_MAP:a}}),setTimeout(()=>{h.v.debug(`RESTORED ORIGINAL POLLING INTERVALS FOR ${e}`),this.updateIntervals({polling:{POLLING_INTERVAL_MAP:o}}),this.ongoingTurbo[e]=!1},n)}updateIntervals(e){const{POLLING_INTERVAL_MAP:t}=e.polling;t&&(this.config.polling.POLLING_INTERVAL_MAP=t,this.handlePollingIntervalMapUpdate(t))}handlePollingIntervalMapUpdate(e){if(e)for(const t in e){if(!e.hasOwnProperty(t))continue;const s=e[t];this.config.polling.POLLING_INTERVAL_MAP[t]=s,h.v.debug(`Setting polling frequency for ${t} = ${s}`),[...this.streams.values()].filter(e=>e.RESOURCE_NAME===t).forEach(e=>{var t;return null===(t=null==e?void 0:e.POLLING_FREQUENCY)||void 0===t?void 0:t.next(s)})}}static getBody(e){return JSON.stringify(e)}static getUrl(e,t){const s=t.MESSAGE_TYPE;let i=t.MESSAGE_TYPE.replace(/_/g,"-").toLowerCase();return s===I.Gp.DATA_LOGON&&(i=t.DETAILS.DATASOURCE_NAME.replace(/_/g,"-").toLowerCase()),`${e}${i}`}};(0,i.Cg)([n.observable],b.prototype,"host",void 0),(0,i.Cg)([n.observable],b.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],b.prototype,"_isConnected",void 0),(0,i.Cg)([n.volatile],b.prototype,"isConnected",null),b=M=(0,i.Cg)([(0,i.Qj)(0,O.l),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,_.N),(0,i.Qj)(3,d),(0,i.Qj)(4,E.b_),(0,i.Qj)(5,f)],b);const N=o.DI.createInterface(e=>e.singleton(b));var L=s(45230);let U=class{get isConnected(){return this.socket.isConnected}get isConnectedSubject(){return this.socket.isConnectedSubject}get isConnected$(){var e;return null===(e=this.socket.isConnectedSubject)||void 0===e?void 0:e.asObservable()}get host(){return this.socket.host}constructor(e,t,s,i,r){this.socket=e,this.messageBuilder=t,this.metaCache=s,this.events=i,this.config=r,this.isWorking=!1}httpMode(){return!1}setValidSession(e){h.v.deprecated("setValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}send(e,t){return this.socket.send(e,t)}connect(){return(0,i.sH)(this,arguments,void 0,function*(e=r.vN){return this.socket.reset(),this.socket.connect(e,this.config.connect,this.config.reconnect)})}disconnect(){this.socket.reset()}snapshot(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createDataLogonMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (snapshot) message created -> `,s),this.socket.send(s)})}stream(e,t,s,i){const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream) message created -> `,r);const n=this.socket.sendForStream(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)},()=>{this.events.onStreamCompleteEvent(e,n)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}streamState(e,t=()=>{},s=()=>{},i,r=[]){return this.stream(e,t,s,i).pipe((0,a.S)(C,r))}streamWithoutAutoTeardown(e,t,s,i){h.v.deprecated("streamWithoutAutoTeardown","Please use 'stream' api instead.","15.0.0");const r=this.messageBuilder.createDataLogonMessage(e,i);h.v.debug(`${r.MESSAGE_TYPE} (stream without auto-teardown) message created -> `,r);const n=this.socket.sendForStreamWithoutTeardown(r,t,t=>{s(t),this.events.onStreamErrorEvent(e,n,t)});return this.events.onStreamEvent(e,r,n,{onMessage:t,onError:s}),n}getMoreRows(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createMoreRowsMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} message created -> `,s),this.socket.send(s,!1)})}getMoreColumns(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createMoreColumnsMessage(e);return this.socket.send(t)})}dataLogoff(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createDataLogoffMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} message created -> `,t),this.socket.send(t)})}getMetadata(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasMetadataFor(e))return h.v.debug(`Cached metadata retrieved for ${e}`),this.metaCache.getMetadataFor(e);const i=this.messageBuilder.createMetaRequestMessage(e);let r,n;h.v.debug(`${i.MESSAGE_TYPE} (metadata) message created -> `,i);try{this.isWorking=!0;const t=yield this.socket.send(i);r=null!==(s=null==t?void 0:t.DETAILS)&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setMetadataFor(e,r)}catch(e){throw n=e,h.v.error(e),n}finally{this.events.onMetadataEvent(e,i,n),this.isWorking=!1}return r})}getJSONSchema(e){return(0,i.sH)(this,arguments,void 0,function*(e,t=!0){var s;if(t&&this.metaCache.hasJsonSchemaFor(e))return h.v.debug(`Cached JsonSchema retrieved for ${e}`),this.metaCache.getJsonSchemaFor(e);const i=this.messageBuilder.createMetaRequestMessage(e,I.Gp.JSON_SCHEMA_REQUEST);let r;h.v.debug(`${i.MESSAGE_TYPE} (json schema) message created -> `,i);try{this.isWorking=!0,r=null!==(s=yield this.socket.send(i))&&void 0!==s?s:{},Object.keys(r).length&&this.metaCache.setJsonSchemaFor(e,r)}catch(e){h.v.error(e)}finally{this.isWorking=!1}return r})}request(e,t){const s=this.messageBuilder.createRequestMessage(e,t);return h.v.debug(`${s.MESSAGE_TYPE} (request server) message created -> `,s),this.socket.send(s)}getAvailableResources(e){return(0,i.sH)(this,void 0,void 0,function*(){const t=this.messageBuilder.createResourcesMessage(e);return h.v.debug(`${t.MESSAGE_TYPE} (resources) message created -> `,t),this.socket.send(t)})}commitEvent(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=this.messageBuilder.createCommitMessage(e,t);h.v.debug(`${s.MESSAGE_TYPE} (commit) message created -> `,s);const i=this.socket.send(s);return this.events.onCommitEvent(e,s),i.then(t=>(this.events.onCommitResponseEvent(e,t),t))})}};(0,i.Cg)([n.observable],U.prototype,"isWorking",void 0),U=(0,i.Cg)([(0,i.Qj)(0,L.yQ),(0,i.Qj)(1,I.lT),(0,i.Qj)(2,d),(0,i.Qj)(3,l.EQ),(0,i.Qj)(4,u.R)],U);const y="true"===r.PF||!1,P=o.DI.createInterface(e=>e.singleton(U)),D=o.DI.createInterface(e=>y?e.aliasTo(N):e.aliasTo(P));function w(){return o.DI.getOrCreateDOMContainer().get(D)}},32748:(e,t,s)=>{s.d(t,{l:()=>a});var i=s(55823),r=s(49229),n=s(84674);let o=class{constructor(e){this.serializer=e}get(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"GET"}));return(t.serializer||this.serializer).deserialize(s)})}post(e,t){return(0,i.sH)(this,void 0,void 0,function*(){const s=yield fetch(e,Object.assign(Object.assign({credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"}},t),{method:"POST"}));return(t.serializer||this.serializer).deserialize(s)})}};o=(0,i.Cg)([(0,i.Qj)(0,r.b_)],o);const a=n.DI.createInterface(e=>e.singleton(o))},32808:(e,t,s)=>{s.d(t,{k:()=>c});var i=s(55823),r=s(84674),n=s(31261),o=s(28745);class a{constructor(){}createId(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createID ${t}`),t}createRemoteId(){return(0,i.sH)(this,arguments,void 0,function*(e=!1){const t=(0,n.A)();return e&&o.v.debug(`UUID.createRemoteID ${t}`),t})}}const c=r.DI.createInterface(e=>e.singleton(a))},34193:(e,t,s)=>{s.d(t,{d:()=>r});var i=s(17465);function r(e,t="ROW_REF"){const s=e=>{const s=Object.assign(Object.assign({},e),{[t]:e.DETAILS[t]});return delete s.DETAILS,s},r=[],n=[],o=[];for(const t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case"INSERT":r.push(s(t));break;case"MODIFY":o.push(s(t));break;case"DELETE":n.push(s(t));break;default:i.v.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:n,updates:o,SOURCE_REF:e.SOURCE_REF}}},39087:(e,t,s)=>{var i;s.d(t,{v:()=>i,w:()=>r}),function(e){e.DATASERVER="DATASERVER",e.EVENT_HANDLER="EVENT_HANDLER",e.REQUEST_SERVER="REQUEST_SERVER"}(i||(i={}));const r="datasource-status-changed"},40113:(e,t,s)=>{s.d(t,{N:()=>L});var i=s(55823),r=s(92277),n=s(33681),o=s(84674),a=s(97156),c=s(26347),d=s(21281),h=s(10447),l=s(56653),u=s(98316),E=s(17465);const g=o.DI.createInterface();function S(){return(null===navigator||void 0===navigator?void 0:navigator.credentials)?"PasswordCredential"in window||(E.v.warn("PasswordCredential not available in this browser."),!1):(E.v.warn("CredentialsContainer not available in this browser."),!1)}const v=":";function R(e="",t=v,s){return e.split(t,s).map(e=>e.trim()).filter(e=>""!==e)}function m(e,t=v){const s="string"==typeof e&&e.trim();return!!s&&s.includes(t)}function p(e,t=v){return"string"==typeof e&&e.trim()?(e.match(new RegExp(t,"g"))||[]).length:0}function T(e,t=v){for(const s of e)if(m(s,t))return s;return e.find(e=>"string"==typeof e&&!!e.trim())}function _(e,t,s){const i="string"==typeof e&&e.trim();return!i||s&&!i.includes(s)||p(i)>1?s&&t&&s!==t?`${t}:${s}`:t||s:i}function O(e="credential"){E.v.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}const A={password:!0,mediation:"optional"},f={cookie:{path:"/",name:"credentials",expires:7300,storePasswords:!1}};let I=class{constructor(e,t=f){this.session=e,this.config=t}createBasicCredentials(e){return{type:l.h.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){var t,s,i;return{type:l.h.REFRESH,username:null!==(t=null==e?void 0:e.username)&&void 0!==t?t:this.getUsername(),refreshToken:null!==(s=null==e?void 0:e.refreshToken)&&void 0!==s?s:this.getRefreshToken(),mfaToken:null!==(i=null==e?void 0:e.mfaToken)&&void 0!==i?i:this.getMFAToken()}}createSSOCredentials(e){var t;return{type:l.h.SSO,ssoToken:null!==(t=null==e?void 0:e.ssoToken)&&void 0!==t?t:this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}validateUserCredentialData(e,t){const s=e&&!!e.id&&!!e.name&&!e.name.includes(v)&&p(e.id)<=1;return t?s&&!!e.password:s}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{const t=e,[s]=R(t.name||t.id),[i,r]=R(T([t.id,t.name]));return[{id:_(t.id||t.name,s,r),name:s,password:t.password||""},!0]}catch(e){O("PasswordCredential")}if(t)try{const e=t,[s]=R(e.name||e.username||e.organisation),[i,r]=R(T([e.organisation||e.username||e.name]));return[{id:_(e.id||e.username||e.name,s,r),name:s,password:e.password||""},!1]}catch(e){O("cookie")}return[void 0,!1]}storeCredentialsInContainer(e){return(0,i.sH)(this,void 0,void 0,function*(){if(!S())return;const t=new PasswordCredential(e);return E.v.debug("Storing credentials in CredentialsContainer"),navigator.credentials.store(t)})}getCredentialsFromContainer(){return(0,i.sH)(this,arguments,void 0,function*(e=A){if(S())return E.v.debug("Getting credentials from CredentialsContainer"),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){const{password:t}=e,s=(0,i.Tt)(e,["password"]),r=this.config.cookie.storePasswords?e:s;return E.v.debug("Storing credentials in cookie"),!!h.A.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){E.v.debug("Getting credentials from cookie");const e=h.A.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){if(S()){const t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return(0,i.sH)(this,void 0,void 0,function*(){return S()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem("ssoToken")}getUsername(){return this.session.getSessionStorageItem("username")||this.session.getLocalStorageItem("username")}getRefreshToken(){return this.session.getSessionStorageItem("refreshToken")||this.session.getLocalStorageItem("refreshToken")}getMFAToken(){return this.session.getSessionStorageItem("mfaToken")}removeCookie(){h.A.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem("ssoToken")}removeUsername(){this.session.removeSessionStorageItem("username"),this.session.removeLocalStorageItem("username")}removeRefreshToken(){this.session.removeSessionStorageItem("refreshToken"),this.session.removeLocalStorageItem("refreshToken")}removeMFAToken(){this.session.removeSessionStorageItem("mfaToken")}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return S()&&navigator.credentials.preventSilentAccess()}};I=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,(0,o.optional)(g))],I);const C=o.DI.createInterface(e=>e.singleton(I)),M=e=>Array.isArray(e)?e.map(e=>null!=e?e:""):[],b=e=>{try{if("EVENT_LOGIN_AUTH_ACK"===(null==e?void 0:e.MESSAGE_TYPE)){const{DETAILS:i}=e;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:e.UPDATE_QUEUE,zeroMqProxyModeEnabled:e.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:e.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:e.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:i?{system:(s=i.SYSTEM,s?{date:s.DATE}:null),heartbeatIntervalSecs:i.HEARTBEAT_INTERVAL_SECS,failedLoginAttempts:i.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:i.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:i.LAST_LOGIN_DATETIME,daysToPasswordExpiry:i.DAYS_TO_PASSWORD_EXPIRY,product:(t=i.PRODUCT,t?t.map(e=>({name:e.NAME,version:e.VERSION})):[])}:null,permission:M(e.PERMISSION),profile:M(e.PROFILE)}}throw new Error("No Entity mapping implementation for provided DTO")}catch(e){throw E.v.error(e),e}var t,s};let N=class{loggedUserResultChanged(){var e;null===(e=this.isLoggedInSubject)||void 0===e||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,s,i,r){this.session=e,this.connect=t,this.messageBuilder=s,this.credentialManager=i,this.currentUser=r,this.isWorking=!1,this.isLoggedInSubject=new a.t(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;null===(t=this.isLoggedInSubject)||void 0===t||t.next(e.detail)})}login(e){return(0,i.sH)(this,void 0,void 0,function*(){var t;this.isWorking=!0;try{const s=this.messageBuilder.createLoginMessage(e),i=yield this.connect.send(s);if(!i||i.ERROR||(null===(t=i.DETAILS)||void 0===t?void 0:t.ERROR))throw new l.l(s,i);this.applyAuthResults({authToken:i.SESSION_AUTH_TOKEN,refreshToken:i.REFRESH_AUTH_TOKEN,profiles:i.PROFILE,username:i.USER_NAME,permissions:i.PERMISSION,sessionId:i.SESSION_ID}),this.currentUser.set(b(i)),this.session.setAuthResult(i),E.v.debug("Login Authentication Result:",i)}catch(e){if(E.v.error("Login Authentication Error:",e),!(e instanceof l.l&&e.isIgnorableError()))throw this.removeAuthResults(),this.currentUser.unset(),e;E.v.warn("Ignoring authentication error as it is a known edge case.")}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return(0,i.sH)(this,void 0,void 0,function*(){var e;this.isWorking=!0;let t={success:!1};try{const s=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();const{CODE:i,DETAILS:r,ERROR:n,MESSAGE_TYPE:o,OIDC_LOGOUT_URL:a}=yield this.connect.send(s),c=null!==(e=null==r?void 0:r.ERROR)&&void 0!==e?e:n,h=o===d.Go.LOGOUT_NACK;h&&E.v.warn("Unexpected Logout NACK received during logout.",c),t={success:o===d.Go.LOGOUT_ACK||i===d.x6.SESSION_NOT_FOUND||!h,error:c},a&&window.open(a,"_self")}catch(e){const s=new l.l(e.sentMessage,e.receivedMessage);if(E.v.error("Logout Authentication Error:",s),!s.isIgnorableError())throw e;E.v.warn("Ignoring authentication error as it is a known edge case."),t.success=!0}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return t})}reAuthFromSession(){return(0,i.sH)(this,void 0,void 0,function*(){const e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if((null==t?void 0:t.MESSAGE_TYPE)===d.Gp.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(b(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;const e=this.session.getSessionStorageItem("hostUrl");return!!e&&this.connect.connect(e)})}getLoggedUserFromMessage(e){const t=e.USER_NAME,s=e.SESSION_AUTH_TOKEN,i=e.REFRESH_AUTH_TOKEN;return t&&s&&i?{username:t,authToken:s,refreshToken:i,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}:null}applyAuthResults(e){e?this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId}:this.removeAuthResults()}removeAuthResults(){this.loggedUserResult=null}};(0,i.Cg)([n.observable],N.prototype,"isWorking",void 0),(0,i.Cg)([n.observable],N.prototype,"loggedUserResult",void 0),N=(0,i.Cg)([(0,i.Qj)(0,u.N),(0,i.Qj)(1,c.dm),(0,i.Qj)(2,d.lT),(0,i.Qj)(3,C),(0,i.Qj)(4,r.KJ)],N);const L=o.DI.createInterface(e=>e.singleton(N))},40370:(e,t,s)=>{s.d(t,{C:()=>a});var i=s(55823),r=s(33681),n=s(17465),o=s(39087);const a=e=>{class t extends e{constructor(){super(),this.hasOwnProperty("onDatasourceStatusChanged")||(this.onDatasourceStatusChanged=e=>{var t;this.resourceName||n.v.warn("Target classes must have a resourceName property to use the DatasourceEventHandler mixin.");const s=e.detail;if(s.name===this.resourceName){const e=null!==(t=this.datasourceStatus)&&void 0!==t?t:{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==s.isInitialized||s.metadataRequired&&e.hasMetadata!==s.hasMetadata)&&(this.datasourceStatus=s)}})}datasourceStatusChanged(e,t){n.v.debug("Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.")}connectedCallback(){super.connectedCallback(),document.addEventListener(o.w,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(o.w,this.onDatasourceStatusChanged,{capture:!0})}}return(0,i.Cg)([r.observable],t.prototype,"datasourceStatus",void 0),t}},40729:(e,t,s)=>{s.d(t,{O:()=>d});var i=s(33681);const r=new Map([["FAST-TEXT-AREA","input"],["FAST-TEXT-FIELD","input"],["FOUNDATION-TEXT-AREA","input"],["FOUNDATION-TEXT-FIELD","input"],["INPUT","input"],["ZERO-TEXT-FIELD","input"]]);function n(e){this.keyAttr||(this.target[this.targetName]=e)}function o(e,t){this.keyAttr&&(this.updateTarget=n),this.originalBind.call(this,e,t),this.target.addEventListener(this.changeEvent,this.changeHandler)}function a(){this.originalUnbind.call(this),this.target.removeEventListener(this.changeEvent,this.changeHandler)}class c extends i.HTMLBindingDirective{constructor(e,t,s,i){super(e),this.keyAttr=i,this.conversionType=t,this.eventName=s}createBehavior(e){const t=super.createBehavior(e);return t.originalBind=t.bind,t.originalUnbind=t.unbind,t.keyAttr=this.keyAttr,t.bind=o,t.unbind=a,t.changeEvent=function(e,t){var s;const i=e.tagName;return"default"===t?null!==(s=r.get(i))&&void 0!==s?s:"change":t}(e,this.eventName),t.changeHandler=()=>{const e="boolean"===this.conversionType?t.target.checked:t.target.value;if(this.keyAttr){const s=t.bindingObserver.last,i=t.target[this.keyAttr];s.propertySource[s.propertyName][i]=this.convert(e)}else{const s=t.bindingObserver.last;s.propertySource[s.propertyName]=this.convert(e)}},t}convert(e){if(null==e)return e;switch(this.conversionType){case"time":const t=new Date(e).getTime();return isNaN(t)?void 0:t;case"number":return e.length?Number(e):void 0;case"string":return String(e);case"boolean":return Boolean(e);default:return e}}}function d(e,t="string",s="default",i){return new c(e,t,s,i)}},41119:(e,t,s)=>{var i;s.d(t,{v:()=>r,w:()=>i}),function(e){e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.ENUM="ENUM",e.DATE="DATE",e.DATETIME="DATETIME",e.CUSTOM="CUSTOM",e.NANO_TIMESTAMP="NANO_TIMESTAMP"}(i||(i={}));const r={STRING:i.STRING,ENUM:i.ENUM,BOOLEAN:i.BOOLEAN,INT:i.NUMBER,LONG:i.NUMBER,DOUBLE:i.NUMBER,BIGDECIMAL:i.NUMBER,DATE:i.DATE,DATETIME:i.DATETIME,NANO_TIMESTAMP:i.NANO_TIMESTAMP}},45230:(e,t,s)=>{s.d(t,{yQ:()=>G,Ol:()=>F});var i=s(55823),r=s(92277),n=s(84686),o=s(49229),a=s(32808),c=s(33681),d=s(84674),h=s(50049),l=s(37970),u=s(75841),E=s(26274),g=s(53193),S=s(84190),v=s(82834),R=s(66640),m=s(53940),p=s(48653),T=s(98316),_=s(17465),O=s(49587),A=s(32748),f=s(21281);const I=1e4,C=6e4;var M;!function(e){e.Linear="linear",e.Exponential="exponential"}(M||(M={}));const b=(e,t)=>{const{reconnectInterval:s=I}=e,i=s>C?C:s,r=Math.round(Math.log2(C/i));return i*Math.pow(2,t%r)},N=e=>{const{reconnectInterval:t=I}=e;return t>C?C:t};var L,U=s(5709);class y{constructor(e){this.interval=e}get workerScript(){return`\n const startTime = Date.now();\n setInterval(function() {\n self.postMessage(Date.now() - startTime);\n }, ${this.interval});\n `}start(e){this.stop(),this.runWorker(e)}stop(){this.worker&&(this.worker.terminate(),delete this.worker)}runWorker(e){this.worker||(this.worker=new Worker(URL.createObjectURL(new Blob([this.workerScript],{type:"text/javascript"}))),this.worker.onmessage=t=>e(t.data))}}class P extends h.B{constructor(){super()}}l.c;class D{constructor(e,t,s,i){this._message=e,this._onMessage=t,this._onError=s,this._isSubscription=i}get sentMessage(){return this._message}get onReceivedMessage(){return this._onMessage}get onReceivedError(){return this._onError}get isSubscription(){return this._isSubscription}}let w=L=class{get isConfigured(){return this.status.isConfigured}get isConnecting(){return this.status.isConnecting}get isConnected(){return this.status.isConnected}get isConnectedSubject(){return this.status.isConnectedSubject}get isDisconnected(){return this.status.isDisconnected}get isDisconnectedByServer(){return this.status.isDisconnectedByServer}get isReconnecting(){return this.status.isReconnecting}get hasValidSession(){return _.v.deprecated("get hasValidSession","Use `User.isAuthenticated` from `@genesislcap/foundation-user` instead.","15.0.0"),this.user.isAuthenticated}set hasValidSession(e){_.v.deprecated("set hasValidSession","Please refrain from calling this API as this state is managed internally.","15.0.0")}get host(){var e;return null!==(e=this.url)&&void 0!==e?e:n.vN}constructor(e,t,s,i,r,n,o){this.messageBuilder=e,this.session=t,this.serializer=s,this.uuid=i,this.status=r,this.user=n,this.config=o,this.defaultInterval=1e4,this.secondsMultiplier=1e3,this.heartbeatIsEnabled=!0,this.heartbeatInterval=this.defaultInterval,this.socketMessages=()=>this.wsMessages}get heartbeatLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeatLogging)&&void 0!==t&&t}get messageLoggingIsEnabled(){var e,t;return null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableMessageLogging)&&void 0!==t&&t}connect(e=n.vN,t,s){var r;return this.url=e,this.connectOptions=null!=t?t:this.config.connect,this.reconnectOptions=null!=s?s:this.config.reconnect,(null===(r=this.config.isWebSocketExpression)||void 0===r?void 0:r.test(this.host))?new Promise(e=>{var t,s,r,n;_.v.info(`${this.isReconnecting?"Reconnecting":"Connecting"} to ${this.url}`),this.status.isConnecting=!this.isReconnecting;(!this.isReconnecting||!(null===(t=this.reconnectOptions)||void 0===t?void 0:t.reconnectStreams))&&this.cleanMessages(),null===(s=this.socketSubscription)||void 0===s||s.unsubscribe(),this.websocket=new p.Q({url:this.url,openObserver:{next:()=>{this.session.setSessionStorageItem("hostUrl",this.url),this.status.isConnected=!0,this.prepareHeartbeat(),_.v.info("WebSocket connection is now open"),e(this.isConnected)}},closeObserver:{next:t=>{this.status.onClose(t),this.isDisconnectedByServer&&_.v.info(`WebSocket connection was closed due an error - Code: ${t.code} ${t.reason?" | Reason: "+t.reason:""}`),e(this.isConnected)}},serializer:e=>this.serializer.serialize(e),deserializer:e=>this.serializer.deserialize(e)});this.socketSubscription=this.websocket.subscribe(null!==(n=null===(r=this.connectOptions)||void 0===r?void 0:r.connectObserver)&&void 0!==n?n:{next:e=>(0,i.sH)(this,void 0,void 0,function*(){var t;const s=`Response Message received for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s);const{SOURCE_REF:i,MESSAGE_TYPE:r}=e,n=this.getMessageHandler(i,r);if(!n)return void(e.MESSAGE_TYPE===f.Go.MSG_NACK&&e.ERROR&&e.ERROR.forEach(t=>{_.v.error(`MessageType: ${e.MESSAGE_TYPE} | Error Details:`,t)}));let o=!1;switch(e.MESSAGE_TYPE){case f.Gp.EVENT_LOGIN_AUTH_ACK:{const s=e.DETAILS;s.HEARTBEAT_INTERVAL_SECS&&void 0===(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatInterval)&&(this.heartbeatInterval=s.HEARTBEAT_INTERVAL_SECS*this.secondsMultiplier,this.prepareHeartbeat());break}case f.Go.LOGOUT_ACK:return n.onReceivedMessage.call(this,e),void this.cleanMessages();case f.Go.LOGON_ACK:return;case f.Go.LOGOFF_ACK:break;case f.Go.QUERY_UPDATE:n.isSubscription||this.sendDataLogoff(i);break;case f.Go.MSG_NACK:case f.Go.LOGON_NACK:o=!0}o?n.onReceivedError.call(this,{receivedMessage:e,sentMessage:n.sentMessage}):n.onReceivedMessage.call(this,e),this.wsMessages.next(e),n.isSubscription||this.removeMessageHandler(i)}),error:e=>{_.v.debug("Error found: ",e),this.reconnect()},complete:()=>{var e;this.isDisconnectedByServer&&(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)?this.reconnect():_.v.info("Connection is now closed")}}),this.status.isConfigured=!0}):(_.v.error(`Specified host (${this.host}) is not valid WebSocket url. Connection will not proceed.`),void _.v.warn("Make sure the host url starts with wss:// or ws://"))}handleExpiredSession(){return(0,i.sH)(this,void 0,void 0,function*(){if(this.session.getSessionStorageItem("refreshToken")){const e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.send(e);this.session.setAuthResult(t),this.updateSessionAndSubscriptions(t)}else yield this.handleCookieBasedReauth()})}handleCookieBasedReauth(){return(0,i.sH)(this,void 0,void 0,function*(){const e=parseInt(localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY)||"0");if(Date.now()-e>3e4&&localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),localStorage.getItem(L.REAUTH_ACTION_LOCK_KEY))window.addEventListener("storage",this.onStorageEvent.bind(this));else{localStorage.setItem(L.REAUTH_ACTION_LOCK_KEY,Date.now().toString());const e=yield fetch(n.Be,{credentials:"include"});if("EVENT_LOGIN_DETAILS_ACK"!==(yield e.json()).MESSAGE_TYPE){(yield fetch(n.aW,{credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"},method:"POST",body:JSON.stringify({DETAILS:{},MESSAGE_TYPE:"EVENT_LOGIN_AUTH"})})).ok||window.location.reload()}localStorage.removeItem(L.REAUTH_ACTION_LOCK_KEY),yield this.connect()}})}onStorageEvent(e){e.key===L.REAUTH_ACTION_LOCK_KEY&&null===e.newValue&&(this.connect(),window.removeEventListener("storage",this.onStorageEvent))}updateSessionAndSubscriptions(e){(null==e?void 0:e.MESSAGE_TYPE)===f.Gp.EVENT_LOGIN_AUTH_ACK&&this.wsMessageHandlers.forEach(t=>{t.isSubscription&&(t.sentMessage.SESSION_AUTH_TOKEN=e.SESSION_AUTH_TOKEN,this.websocket.next(t.sentMessage))})}prepareHeartbeat(){var e,t,s,r;this.heartbeatTicker&&this.heartbeatTicker.stop();const n=()=>(0,i.sH)(this,void 0,void 0,function*(){var e,t,s;if(!this.isConnected)return;const i=this.messageBuilder.createHeartbeatPingMessage(null===(e=this.connectOptions)||void 0===e?void 0:e.verboseHeartbeat);(null===(t=this.connectOptions)||void 0===t?void 0:t.heartbeatPingCallback)&&this.connectOptions.heartbeatPingCallback(i);const r=yield this.send(i);this.user.isAuthenticated&&!r.IS_AUTHENTICATED&&this.handleExpiredSession(),(null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatPongCallback)&&this.connectOptions.heartbeatPongCallback(r),this.heartbeatIsEnabled=r.MESSAGE_TYPE===f.Go.HEARTBEAT_PONG&&r.SOURCE_REF===i.SOURCE_REF});if(null!==(t=null===(e=this.connectOptions)||void 0===e?void 0:e.enableHeartbeat)&&void 0!==t?t:this.heartbeatIsEnabled){const e=null!==(r=null===(s=this.connectOptions)||void 0===s?void 0:s.heartbeatInterval)&&void 0!==r?r:this.heartbeatInterval;this.heartbeatTicker=new y(e),this.heartbeatTicker.start(()=>{this.websocket&&this.isConnected&&(n(),this.heartbeatLoggingIsEnabled&&_.v.debug(`Sending a heartbeat ping every ${e} ms`))})}}reconnect(){var e,t,s,i,r;const n=!(null===(e=this.connectOptions)||void 0===e?void 0:e.alwaysOn)&&!1===(null===(t=this.connectOptions)||void 0===t?void 0:t.enableHeartbeat);if(this.isReconnecting||n)return;this.status.isReconnecting=!0;const o=(null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectStrategy)===M.Exponential?b:N,a=this.isConnectedSubject.asObservable().pipe((0,S.n)(e=>e?(0,u.of)(-1):((e,t)=>new l.c(s=>{let i,r=0;return function n(){s.next(r),clearTimeout(i),i=setTimeout(n,t(e,r)),r+=1}(),()=>{clearTimeout(i)}}))(this.reconnectOptions,o).pipe((0,v.Z)(e=>{var t,s,i;let r;return r=(null===(t=this.connectOptions)||void 0===t?void 0:t.alwaysOn)?e+1:null!==(i=null===(s=this.reconnectOptions)||void 0===s?void 0:s.reconnectAttempts)&&void 0!==i?i:10,e<r?(0,u.of)(e):(this.status.reconnectionLimitReached=!0,(0,E.$)(()=>new Error(`Max reconnect attempts ${r} reached.`)))}))),(0,R.v)(()=>this.websocket&&!this.isConnected));a.subscribe(null!==(r=null===(i=this.reconnectOptions)||void 0===i?void 0:i.reconnectObserver)&&void 0!==r?r:{next:e=>{_.v.debug(`Attempt no. ${e+1} to reconnect`),this.websocket.complete(),this.connect(this.url,this.connectOptions,this.reconnectOptions)},error:e=>{var t;_.v.debug(e),null===(t=this.socketSubscription)||void 0===t||t.unsubscribe(),this.status.isReconnecting=!1},complete:()=>{_.v.info(this.isConnected?"Reconnected":"Disconnected"),this.status.isReconnecting=!1,this.wsMessageHandlers.forEach(e=>{e.isSubscription&&this.websocket.next(e.sentMessage)})}})}reset(){this.status.isConnected=!1,this.status.isConfigured=!1,this.websocket&&this.websocket.complete(),this.websocket=null,this.cleanMessages()}cleanMessages(){this.wsMessages&&this.wsMessages.complete(),this.wsMessages=new P,this.wsMessageHandlers=new Map}send(e,t=!0){if(!this.isConnected)return Promise.reject(new Error("WebSocket connection is closed"));const s=`Sending Message for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,s),new Promise((s,i)=>{const r=e=>{s(e)},n=e=>{i(e)};t&&this.setMessageHandler(e,r,n),this.websocket.next(e)})}sendForStream(e,t,s,i){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const r=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,r),this.setMessageHandler(e,t,s,!0),c.DOM.queueUpdate(()=>this.websocket.next(e)),new l.c(t=>{const s=new h.B;return this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF),(0,g.Q)(s)).subscribe({next:e=>{t.next(e)},error:e=>{t.error(e)},complete:()=>{t.complete()}}),()=>{s.complete(),this.sendDataLogoff(e.SOURCE_REF),this.removeMessageHandler(e.SOURCE_REF),i&&i()}})}sendForStreamWithoutTeardown(e,t,s){if(!this.isConnected)return(0,E.$)(()=>new Error("WebSocket connection is closed"));const i=`Sending Message (stream) for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;return this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.info,i),this.setMessageHandler(e,t,s,!0),this.websocket.next(e),this.wsMessages.pipe((0,m.p)(t=>t.SOURCE_REF===e.SOURCE_REF))}setMessageHandler(e,t,s,i=!1){const r=`Setting Message Handler for SourceRef: ${e.SOURCE_REF} | MessageType: ${e.MESSAGE_TYPE}`;this.logMessageTypeFlow(e.MESSAGE_TYPE,_.v.debug,r),this.wsMessageHandlers.set(e.SOURCE_REF,new D(e,t,s,i))}sendDataLogoff(e){this.send(this.messageBuilder.createDataLogoffMessage(e),!1)}removeMessageHandler(e){this.wsMessageHandlers.delete(e)}getMessageHandler(e,t){const s=`Getting Message Handler for SourceRef: ${e} | MessageType: ${t}`;return this.logMessageTypeFlow(t,_.v.debug,s),this.wsMessageHandlers.get(e)}logMessageTypeFlow(e,t,s){switch(e){case f.Gp.DATA_LOGOFF:t(s);break;case f.Go.HEARTBEAT_PING:case f.Go.HEARTBEAT_PONG:this.heartbeatLoggingIsEnabled&&t(s);break;default:this.messageLoggingIsEnabled&&t(s)}}};w.REAUTH_ACTION_LOCK_KEY="reauthActionLock",(0,i.Cg)([c.observable],w.prototype,"websocket",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessages",void 0),(0,i.Cg)([c.observable],w.prototype,"wsMessageHandlers",void 0),(0,i.Cg)([A.l],w.prototype,"http",void 0),(0,i.Cg)([c.observable],w.prototype,"heartbeatIsEnabled",void 0),w=L=(0,i.Cg)([(0,i.Qj)(0,f.lT),(0,i.Qj)(1,T.N),(0,i.Qj)(2,o.b_),(0,i.Qj)(3,a.k),(0,i.Qj)(4,U.S5),(0,i.Qj)(5,r.KJ),(0,i.Qj)(6,O.R)],w);const G=d.DI.createInterface(e=>e.singleton(w));function F(){return d.DI.getOrCreateDOMContainer().get(G)}},48707:(e,t,s)=>{s.d(t,{X:()=>o,a:()=>a});var i=s(39087),r=s(17465),n=s(41119);const o=e=>e?e.map(e=>{const t={name:e.NAME,type:n.v[e.TYPE]||n.w.STRING};if(e.TYPE===n.w.ENUM&&e.VALID_VALUES)try{t.enumOptions=Array.isArray(e.VALID_VALUES)?e.VALID_VALUES:e.VALID_VALUES.split("|")}catch(e){r.v.error(e),t.enumOptions=[]}return t}):null,a=e=>{var t;const s=null==e?void 0:e.TYPE;if(s===i.v.DATASERVER)return e.FIELD||[];if(s===i.v.REQUEST_SERVER)return e.REPLY_FIELD||(null===(t=e.REPLY)||void 0===t?void 0:t.FIELD)||[];throw new Error(`Unsupported resource type: ${s}`)}},49229:(e,t,s)=>{s.d(t,{b_:()=>h});var i=s(55823),r=s(84674),n=s(61455);const o=r.DI.createInterface();function a(e){return Number.isSafeInteger(+e)?Number(e):(0,n.Fq)(e)?BigInt.asIntN(64,e):parseFloat(e)}const c={parse:e=>(0,n.qg)(e,null,a),stringify:e=>(0,n.As)(e)};let d=class{constructor(e=c){this.config=e,this.serialize=e=>this.config.stringify(e)}deserialize(e){return e?"string"==typeof e?this.config.parse(e):e&&e.ok?e.text().then(e=>this.config.parse(e)):(e&&e.data&&(e=e.data),this.config.parse(e)):Promise.resolve({})}};d=(0,i.Cg)([(0,i.Qj)(0,(0,r.optional)(o))],d);const h=r.DI.createInterface(e=>e.singleton(d))},49587:(e,t,s)=>{s.d(t,{R:()=>n});var i=s(84674);const r={connect:{alwaysOn:!1,enableHeartbeat:!0,enableHeartbeatLogging:!1,heartbeatInterval:1e4,verboseHeartbeat:!1,enableMessageLogging:!1},reconnect:{reconnectAttempts:10,reconnectInterval:1e4,reconnectStreams:!0},isWebSocketExpression:new RegExp(/wss?:\/\/[-a-zA-Z0-9@:%._\+~#=]{1,256}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\b\/*$/,"i")},n=i.DI.createInterface(e=>e.instance(r))},56653:(e,t,s)=>{var i;s.d(t,{h:()=>i,l:()=>r}),function(e){e.BASIC="BASIC",e.SSO="SSO",e.JWT="JWT",e.REFRESH="REFRESH"}(i||(i={}));class r extends Error{constructor(e,t,s="Auth Failed \n"){super(s),this.sent=e,this.received=t,Object.setPrototypeOf(this,r.prototype)}isIgnorableError(){var e,t,s,i,r,n,o,a;return!!(null===(i=null===(s=null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)||void 0===s?void 0:s.toLowerCase())||void 0===i?void 0:i.includes("request needs the user to be logged"))||!!(null===(a=null===(o=null===(n=null===(r=this.received)||void 0===r?void 0:r.DETAILS)||void 0===n?void 0:n.ERROR)||void 0===o?void 0:o.toLowerCase())||void 0===a?void 0:a.includes("is not logged in"))}getMessageError(){var e,t;return Array.isArray(null===(e=this.received)||void 0===e?void 0:e.ERROR)?null===(t=this.received)||void 0===t?void 0:t.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}getDetailsError(){var e,t,s,i;return Array.isArray(null===(t=null===(e=this.received)||void 0===e?void 0:e.DETAILS)||void 0===t?void 0:t.ERROR)?null===(i=null===(s=this.received)||void 0===s?void 0:s.DETAILS)||void 0===i?void 0:i.ERROR.map(e=>this.errorDetailFormatter(e)).join("\n"):""}hasPasswordExpiredError(){return this.hasErrorCode("PASSWORD_EXPIRED")}hasMFAError(){return this.hasErrorCode("MFA_REQUIRED")||this.hasErrorCode("MFA_FAILED")}requiresTermsAndConditions(){return this.hasErrorCode("TERMS_ACCEPTANCE_REQUIRED")}hasErrorCode(e){var t,s;return!!Array.isArray(null===(t=this.received)||void 0===t?void 0:t.ERROR)&&(null===(s=this.received)||void 0===s?void 0:s.ERROR.some(t=>t.CODE===e))}errorDetailFormatter(e){return`\n ${e.CODE}: \n ${e.TEXT}`}}},68424:(e,t,s)=>{s.d(t,{DW:()=>n,JH:()=>o});var i=s(52945),r=s(28745);function n(e,t){let s=e;for(;s;){const e=s.tagName.toLowerCase();if(e.endsWith("-design-system-provider")){const t=e.split("-design-system-provider")[0];if(t)return r.v.debug(`Found provider by ancestor search: ${e}, prefix: ${t}`),{element:s,prefix:t}}s=s.parentElement?s.parentElement:s.getRootNode&&s.getRootNode()instanceof ShadowRoot?s.getRootNode().host:null}const n=document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]'),o=Array.from(n),a=(0,i.fI)(document).filter(e=>{var t;const s=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return(null==s?void 0:s.endsWith("-design-system-provider"))||!1});if(o.push(...a),o.length>0){const e=o[0],t=e.tagName.toLowerCase(),s=t.split("-design-system-provider")[0];if(s)return r.v.debug(`Found provider by document search: ${t}, prefix: ${s}`),{element:e,prefix:s}}return r.v.debug(`No provider found. Falling back to ${t}.`),{element:null,prefix:t}}function o(e,t){return n(e,t).prefix}},79780:(e,t,s)=>{s.d(t,{Es:()=>n});var i=s(84674);class r extends BroadcastChannel{constructor(){super(...arguments),this.postMessage=(...e)=>{const[t,s]=e;super.postMessage({type:t,detail:s})},this.isMessageType=(e,t)=>{var s;return(null===(s=t.data)||void 0===s?void 0:s.type)===e}}}const n=e=>{class t extends r{constructor(){super(e)}}return i.DI.createInterface(e=>e.transient(t))}},84686:(e,t,s)=>{s.d(t,{Be:()=>S,H6:()=>O,OB:()=>r,PF:()=>n,aW:()=>E,vN:()=>a});let i="webpack";try{i="webpack"}catch(e){}let r="/";try{r="auto".replace(/\/$/,"")}catch(e){}let n,o="gwf";try{"undefined"!=typeof SOCKET_EXT&&(o=SOCKET_EXT)}catch(e){}try{n=FORCE_HTTP}catch(e){}const a=`${location.protocol.replace("http","ws")}//${location.host}${r}/${o}/`;"true"===n?location.protocol:location.protocol.replace("http","ws");let c,d,h,l,u=null;try{"undefined"!=typeof API_HOST&&(u=API_HOST)}catch(e){}try{c=""}catch(e){}try{d=DEFAULT_ORGANISATION}catch(e){}try{h=DEFAULT_PASSWORD}catch(e){}try{l=DEFAULT_USER}catch(e){}let E="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_URL&&(E=GENX_LOGIN_URL);let g="gwf/event-login-auth";"undefined"!=typeof GENX_LOGIN_REFRESH_URL&&(g=GENX_LOGIN_REFRESH_URL);let S="gwf/event-login-details";"undefined"!=typeof GENX_LOGIN_DETAILS_URL&&(S=GENX_LOGIN_DETAILS_URL);let v="gwf/event-logout";"undefined"!=typeof GENX_LOGOUT_URL&&(v=GENX_LOGOUT_URL);let R="gwf/event-change-user-password";"undefined"!=typeof GENX_CHANGE_PASSWORD_URL&&(R=GENX_CHANGE_PASSWORD_URL);let m="gwf/event-self-service-password-reset";"undefined"!=typeof GENX_FORGOT_PASSWORD_URL&&(m=GENX_FORGOT_PASSWORD_URL);let p="gwf/event-password-reset-action";"undefined"!=typeof GENX_RESET_PASSWORD_URL&&(p=GENX_RESET_PASSWORD_URL);let T="gwf/sso/list";"undefined"!=typeof GENX_SSO_LIST_URL&&(T=GENX_SSO_LIST_URL);let _="gwf/{type}/login?idp={id}";"undefined"!=typeof GENX_SSO_LOGIN_URL&&(_=GENX_SSO_LOGIN_URL);let O="default";"undefined"!=typeof GENX_ENVIRONMENT_LEVEL&&(O=GENX_ENVIRONMENT_LEVEL);let A="gwf/auth/accept-terms";"undefined"!=typeof GENX_ACCEPT_TERMS_URL&&(A=GENX_ACCEPT_TERMS_URL)},92277:(e,t,s)=>{s.d(t,{KJ:()=>E});var i=s(55823),r=s(17190),n=s(33681),o=s(84674),a=s(79780);const c=(0,s(78464).createLogger)("foundation-user"),d={trackActionExclusions:[],trackPathExclusions:[""],setUser(e,t){if(e.isAuthenticated)throw new Error("User already set. If this is intentional, please call User.unset first.");return c.debug("setUser",t),e.rawProperties=structuredClone(t),e.userKVs=t.userKVs,e.details=t.details,e.permission=t.permission,e.profile=t.profile,e.sourceRef=t.sourceRef,e.userName=t.userName,e.isAuthenticated=!0,e},unsetUser:e=>(c.debug("unsetUser"),e.rawProperties=void 0,e.userKVs=void 0,e.details=void 0,e.permission=void 0,e.profile=void 0,e.sourceRef=void 0,e.userName=void 0,e.isAuthenticated=!1,e)},h=o.DI.createInterface(e=>e.instance(d)),l=(0,a.Es)("genesis-user");class u{constructor(){this.pathHistory=[],this.actionHistory=[],this.isAuthenticated=!1,this.authenticationChangeListeners=(0,r.r)()}set(e){return this.config.setUser(this,e)}unset(){return this.config.unsetUser(this)}get isAnonymous(){return!this.isAuthenticated}isAdmin(){return this.hasProfile("ADMIN")}isBanned(){return this.hasProfile("BANNED")}hasPermission(e){return this.hasKey(this.permission,e)}hasProfile(e){return this.hasKey(this.profile,e)}trackPath(){const{pathname:e,search:t,hash:s}=location,i=`${`${"/"!==e?e:""}`}${t}${s}`;if(!this.config.trackPathExclusions.includes(i))return this.pathHistory.push(i),i}clearPaths(){this.pathHistory=[]}lastPath(){const e=this.pathHistory.length;return e>0?this.pathHistory[e-1]:void 0}trackAction(e){this.config.trackActionExclusions.includes(e)||this.actionHistory.push(e)}clearActions(){this.actionHistory=[]}lastAction(){const e=this.actionHistory.length;return e>0?this.actionHistory[e-1]:void 0}clearTrackingHistory(){this.clearPaths(),this.clearActions()}hasKey(e,t){return!!(e&&e.length&&t)&&(Array.isArray(t)||(t=[t]),t.some(t=>e.includes(t)))}addAuthenticationChangeListener(e){var t;return null===(t=this.authenticationChangeListeners)||void 0===t?void 0:t.subscribe(e)}isAuthenticatedChanged(){var e;null===(e=this.authenticationChangeListeners)||void 0===e||e.publish(new CustomEvent("user-authentication-change",{detail:this.isAuthenticated}));const t=o.DI.getOrCreateDOMContainer().get(l);t.postMessage("user-authentication-change",this.isAuthenticated),t.close()}userNameChanged(){n.Observable.notify(this,"username")}get username(){return n.Observable.track(this,"username"),this.userName}permissionChanged(){n.Observable.notify(this,"permissions")}get permissions(){return n.Observable.track(this,"permissions"),this.permission}profileChanged(){n.Observable.notify(this,"profiles")}get profiles(){return n.Observable.track(this,"profiles"),this.profile}hasAdminProfile(){return this.isAdmin()}}(0,i.Cg)([h],u.prototype,"config",void 0),(0,i.Cg)([n.observable],u.prototype,"pathHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"actionHistory",void 0),(0,i.Cg)([n.observable],u.prototype,"isAuthenticated",void 0),(0,i.Cg)([n.observable],u.prototype,"userKVs",void 0),(0,i.Cg)([n.observable],u.prototype,"details",void 0),(0,i.Cg)([n.observable],u.prototype,"permission",void 0),(0,i.Cg)([n.observable],u.prototype,"profile",void 0),(0,i.Cg)([n.observable],u.prototype,"sourceRef",void 0),(0,i.Cg)([n.observable],u.prototype,"userName",void 0),(0,i.Cg)([n.observable],u.prototype,"rawProperties",void 0);const E=o.DI.createInterface(e=>e.singleton(u))},96730:(e,t,s)=>{function i(e,t=";"){return e?e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t):e}s.d(t,{Q:()=>i})},98316:(e,t,s)=>{s.d(t,{N:()=>n});var i=s(84674);class r{constructor(){this.storageKeyPrefix="",this.returnUrl=this.getSessionStorageItem("returnUrl")||""}deleteUserFromSessionStorage(){["authToken","refreshToken","sessionId","ssoToken"].forEach(e=>this.removeSessionStorageItem(e)),this.removeLocalStorageItem("refreshToken")}setStorageKeyPrefix(e){this.storageKeyPrefix=`${e.replace(/\s/g,"")}/`}setAuthResult(e){var t;this.setSessionStorageItem("authToken",e.SESSION_AUTH_TOKEN),this.setSessionStorageItem("refreshToken",e.REFRESH_AUTH_TOKEN),this.setSessionStorageItem("username",e.USER_NAME),this.setSessionStorageItem("sessionId",e.SESSION_ID),(null===(t=e.DETAILS)||void 0===t?void 0:t.MFA_CODE)&&this.setSessionStorageItem("mfaToken",e.DETAILS.MFA_CODE)}captureReturnUrl(){const{pathname:e,search:t,hash:s}=location;if(e&&(e.includes("/login")||e.includes("/auth")))return;const i=`${"/"!==e?e:""}`;this.returnUrl=`${i}${t}${s}`,this.setSessionStorageItem("returnUrl",this.returnUrl)}setItem(e,t,s){"local"===s?localStorage.setItem(this.storageKeyPrefix+e,t):sessionStorage.setItem(this.storageKeyPrefix+e,t)}getItem(e,t){return"local"===t?localStorage.getItem(this.storageKeyPrefix+e):sessionStorage.getItem(this.storageKeyPrefix+e)}removeItem(e,t){"local"===t?localStorage.removeItem(this.storageKeyPrefix+e):sessionStorage.removeItem(this.storageKeyPrefix+e)}setLocalStorageItem(e,t){this.setItem(e,t,"local")}setSessionStorageItem(e,t){this.setItem(e,t,"session")}getLocalStorageItem(e){return this.getItem(e,"local")}getSessionStorageItem(e){return this.getItem(e,"session")}removeLocalStorageItem(e){this.removeItem(e,"local")}removeSessionStorageItem(e){this.removeItem(e,"session")}}const n=i.DI.createInterface(e=>e.singleton(r))}}]);
|
|
2
2
|
//# sourceMappingURL=347.ce7d37ed743704b61b89a37e6a239b4e.js.map
|