mp-front-cli 2.3.1 → 2.3.2-next.0

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.
Files changed (38) hide show
  1. package/dist/AuthEngine-CATazTYM.cjs +1 -0
  2. package/dist/{AuthEngine-Gl4gv5KD.js → AuthEngine-CQfKuww8.js} +175 -172
  3. package/dist/core/middleware/index.d.ts +1 -1
  4. package/dist/core/middleware/index.d.ts.map +1 -1
  5. package/dist/core/services/service-token.d.ts +2 -1
  6. package/dist/core/services/service-token.d.ts.map +1 -1
  7. package/dist/core/utils/api-request/fetch-service-parent-be.d.ts +3 -1
  8. package/dist/core/utils/api-request/fetch-service-parent-be.d.ts.map +1 -1
  9. package/dist/core/utils/custom-encoder.d.ts.map +1 -1
  10. package/dist/core/utils/custom-encrypter.d.ts +11 -4
  11. package/dist/core/utils/custom-encrypter.d.ts.map +1 -1
  12. package/dist/core/utils/custom-header.d.ts +6 -2
  13. package/dist/core/utils/custom-header.d.ts.map +1 -1
  14. package/dist/core/utils/functions/index.d.ts +3 -0
  15. package/dist/core/utils/functions/index.d.ts.map +1 -0
  16. package/dist/core/utils/functions/isEmpty.d.ts +2 -0
  17. package/dist/core/utils/functions/isEmpty.d.ts.map +1 -0
  18. package/dist/core/utils/functions/isString.d.ts +2 -0
  19. package/dist/core/utils/functions/isString.d.ts.map +1 -0
  20. package/dist/mp-front-cli-all.cjs +1 -1
  21. package/dist/mp-front-cli-all.js +2 -2
  22. package/dist/mp-front-cli-core.cjs +1 -1
  23. package/dist/mp-front-cli-core.js +2 -2
  24. package/dist/mp-front-cli-encoder.cjs +1 -1
  25. package/dist/mp-front-cli-encoder.js +29 -3
  26. package/dist/mp-front-cli-encrypter.cjs +1 -1
  27. package/dist/mp-front-cli-encrypter.js +56 -30
  28. package/dist/mp-front-cli-header.cjs +1 -1
  29. package/dist/mp-front-cli-header.js +18 -17
  30. package/dist/mp-front-cli-services.cjs +1 -1
  31. package/dist/mp-front-cli-services.js +1 -1
  32. package/dist/{service-token-DUKgd-pZ.js → service-token-DrUMHiYQ.js} +181 -173
  33. package/dist/service-token-g-Zt_ctQ.cjs +3 -0
  34. package/package.json +3 -5
  35. package/dist/AuthEngine-D65_iNdB.cjs +0 -1
  36. package/dist/custom-encoder-Cfd7FFMe.js +0 -3705
  37. package/dist/custom-encoder-d7rw7W8X.cjs +0 -27
  38. package/dist/service-token-Bv3BAiQd.cjs +0 -3
@@ -0,0 +1,3 @@
1
+ "use strict";var q=Object.defineProperty;var G=(r,t,e)=>t in r?q(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var b=(r,t,e)=>G(r,typeof t!="symbol"?t+"":t,e);const A=require("rxjs"),J=require("./mp-front-cli-logger.cjs"),V=require("./mp-front-cli-encrypter.cjs");var O=function(r,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},O(r,t)};function x(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");O(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var g=function(){return g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},g.apply(this,arguments)};function N(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function W(r,t,e,n){function i(o){return o instanceof e?o:new e(function(c){c(o)})}return new(e||(e=Promise))(function(o,c){function a(l){try{u(n.next(l))}catch(p){c(p)}}function s(l){try{u(n.throw(l))}catch(p){c(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,s)}u((n=n.apply(r,t||[])).next())})}function C(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=a(0),c.throw=a(1),c.return=a(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(u){return function(l){return s([u,l])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(e=0)),e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(l){u=[6,l],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,o=[],c;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){c={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(c)throw c.error}}return o}function P(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))}function S(r){return this instanceof S?(this.v=r,this):new S(r)}function Q(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",c),i[Symbol.asyncIterator]=function(){return this},i;function c(f){return function(d){return Promise.resolve(d).then(f,p)}}function a(f,d){n[f]&&(i[f]=function(h){return new Promise(function(Y,$){o.push([f,h,Y,$])>1||s(f,h)})},d&&(i[f]=d(i[f])))}function s(f,d){try{u(n[f](d))}catch(h){v(o[0][3],h)}}function u(f){f.value instanceof S?Promise.resolve(f.value.v).then(l,p):v(o[0][2],f)}function l(f){s("next",f)}function p(f){s("throw",f)}function v(f,d){f(d),o.shift(),o.length&&s(o[0][0],o[0][1])}}function X(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof _=="function"?_(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(o){e[o]=r[o]&&function(c){return new Promise(function(a,s){c=r[o](c),i(a,s,c.done,c.value)})}}function i(o,c,a,s){Promise.resolve(s).then(function(u){o({value:u,done:a})},c)}}function y(r){return typeof r=="function"}function Z(r){var t=function(n){Error.call(n),n.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var T=Z(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
2
+ `+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function H(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var U=(function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,n,i,o;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var a=_(c),s=a.next();!s.done;s=a.next()){var u=s.value;u.remove(this)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else c.remove(this);var l=this.initialTeardown;if(y(l))try{l()}catch(h){o=h instanceof T?h.errors:[h]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var v=_(p),f=v.next();!f.done;f=v.next()){var d=f.value;try{j(d)}catch(h){o=o??[],h instanceof T?o=P(P([],E(o)),E(h.errors)):o.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}if(o)throw new T(o)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)j(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&H(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&H(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=(function(){var t=new r;return t.closed=!0,t})(),r})();U.EMPTY;function K(r){return r instanceof U||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function j(r){y(r)?r():r.unsubscribe()}var z={Promise:void 0},rr={setTimeout:function(r,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,P([r,t],E(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function D(r){rr.setTimeout(function(){throw r})}function k(){}function er(r){r()}var R=(function(r){x(t,r);function t(e){var n=r.call(this)||this;return n.isStopped=!1,e?(n.destination=e,K(e)&&e.add(n)):n.destination=or,n}return t.create=function(e,n,i){return new I(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(U),tr=(function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){w(n)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){w(n)}else w(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){w(e)}},r})(),I=(function(r){x(t,r);function t(e,n,i){var o=r.call(this)||this,c;return y(e)||!e?c={next:e??void 0,error:n??void 0,complete:i??void 0}:c=e,o.destination=new tr(c),o}return t})(R);function w(r){D(r)}function nr(r){throw r}var or={closed:!0,next:k,error:nr,complete:k};function ir(r,t,e,n,i){return new cr(r,t,e,n,i)}var cr=(function(r){x(t,r);function t(e,n,i,o,c,a){var s=r.call(this,e)||this;return s.onFinalize=c,s.shouldUnsubscribe=a,s._next=n?function(u){try{n(u)}catch(l){e.error(l)}}:r.prototype._next,s._error=o?function(u){try{o(u)}catch(l){e.error(l)}finally{this.unsubscribe()}}:r.prototype._error,s._complete=i?function(){try{i()}catch(u){e.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,s}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(R),B=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ur(r){return r}function sr(r){return r.length===0?ur:r.length===1?r[0]:function(e){return r.reduce(function(n,i){return i(n)},e)}}var m=(function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,n){var i=this,o=fr(t)?t:new I(t,e,n);return er(function(){var c=i,a=c.operator,s=c.source;o.add(a?a.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var n=this;return e=L(e),new e(function(i,o){var c=new I({next:function(a){try{t(a)}catch(s){o(s),c.unsubscribe()}},error:o,complete:i});n.subscribe(c)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[B]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return sr(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=L(t),new t(function(n,i){var o;e.subscribe(function(c){return o=c},function(c){return i(c)},function(){return n(o)})})},r.create=function(t){return new r(t)},r})();function L(r){var t;return(t=r??z.Promise)!==null&&t!==void 0?t:Promise}function ar(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function fr(r){return r&&r instanceof R||ar(r)&&K(r)}var lr=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function hr(r){return y(r==null?void 0:r.then)}function yr(r){return y(r[B])}function pr(r){return Symbol.asyncIterator&&y(r==null?void 0:r[Symbol.asyncIterator])}function vr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function dr(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var br=dr();function mr(r){return y(r==null?void 0:r[br])}function Ar(r){return Q(this,arguments,function(){var e,n,i,o;return C(this,function(c){switch(c.label){case 0:e=r.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,S(e.read())];case 3:return n=c.sent(),i=n.value,o=n.done,o?[4,S(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,S(i)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Sr(r){return y(r==null?void 0:r.getReader)}function _r(r){if(r instanceof m)return r;if(r!=null){if(yr(r))return wr(r);if(lr(r))return gr(r);if(hr(r))return Tr(r);if(pr(r))return F(r);if(mr(r))return Or(r);if(Sr(r))return Er(r)}throw vr(r)}function wr(r){return new m(function(t){var e=r[B]();if(y(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function gr(r){return new m(function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()})}function Tr(r){return new m(function(t){r.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,D)})}function Or(r){return new m(function(t){var e,n;try{for(var i=_(r),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function F(r){return new m(function(t){Pr(r,t).catch(function(e){return t.error(e)})})}function Er(r){return F(Ar(r))}function Pr(r,t){var e,n,i,o;return W(this,void 0,void 0,function(){var c,a;return C(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),e=X(r),s.label=1;case 1:return[4,e.next()];case 2:if(n=s.sent(),!!n.done)return[3,4];if(c=n.value,t.next(c),t.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=s.sent(),i={error:a},[3,11];case 6:return s.trys.push([6,,9,10]),n&&!n.done&&(o=e.return)?[4,o.call(e)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function M(r,t){t===void 0&&(t={});var e=t.selector,n=N(t,["selector"]);return new m(function(i){var o=new AbortController,c=o.signal,a=!0,s=n.signal;if(s)if(s.aborted)o.abort();else{var u=function(){c.aborted||o.abort()};s.addEventListener("abort",u),i.add(function(){return s.removeEventListener("abort",u)})}var l=g(g({},n),{signal:c}),p=function(v){a=!1,i.error(v)};return fetch(r,l).then(function(v){e?_r(e(v)).subscribe(ir(i,void 0,function(){a=!1,i.complete()},p)):(a=!1,i.next(v),i.complete())}).catch(p),function(){a&&o.abort()}})}class Ir extends J.CustomLogger{constructor(){super();b(this,"customEncrypter",new V.CustomEncrypter("aes"));b(this,"API_AUTH_BACK_URL");b(this,"API_AUTH_BACK_USERNAME_AUTH");b(this,"API_AUTH_BACK_PASSWORD_AUTH");b(this,"headers");b(this,"ID",process.env.ID_FRONT??"NOT_AVAILABLE");this.API_AUTH_BACK_URL=process.env.API_AUTH_BACK_URL,this.API_AUTH_BACK_USERNAME_AUTH=process.env.API_AUTH_BACK_USERNAME_AUTH,this.API_AUTH_BACK_PASSWORD_AUTH=process.env.API_AUTH_BACK_PASSWORD_AUTH,this.headers={Accept:"application/json","Content-Type":"application/vnd.api+json"}}get(e=!1){this.logDebug("get ServiceToken");const n={username:this.API_AUTH_BACK_USERNAME_AUTH,password:this.API_AUTH_BACK_PASSWORD_AUTH};return M(this.API_AUTH_BACK_URL,{method:"POST",headers:this.headers,body:JSON.stringify({data:{id:this.ID,type:"AuthUser",attributes:e?{encrypted:this.customEncrypter.encrypt(n)}:n}})}).pipe(A.switchMap(i=>i.json()),A.switchMap(i=>{var o,c;return this.logDebug(`ServiceToken <URL>: \x1B[33m ${this.API_AUTH_BACK_URL} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(this.headers)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(i)} \x1B[37m`),e?A.of(((o=i==null?void 0:i.data.attributes)==null?void 0:o.token)||""):A.of(this.customEncrypter.decrypt(((c=i==null?void 0:i.data.attributes)==null?void 0:c.encrypted)||""))}),A.catchError(i=>(this.logError(`ServiceToken ${i}`),A.of(""))))}}exports.ServiceToken=Ir;exports.fromFetch=M;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "2.3.1",
3
+ "version": "2.3.2-next.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/mp-front-cli-all.cjs",
@@ -87,14 +87,12 @@
87
87
  "rxjs": "7.8.1"
88
88
  },
89
89
  "dependencies": {
90
- "lodash": "4.17.21",
91
90
  "uuid": "9.0.1"
92
91
  },
93
92
  "devDependencies": {
94
93
  "@eslint/eslintrc": "3.2.0",
95
94
  "@eslint/js": "9.19.0",
96
- "@types/lodash": "4.14.202",
97
- "@types/node": "20.10.6",
95
+ "@types/node": "22.12.0",
98
96
  "@types/node-jose": "1.1.13",
99
97
  "@types/uuid": "10.0.0",
100
98
  "@typescript-eslint/eslint-plugin": "8.22.0",
@@ -108,4 +106,4 @@
108
106
  "vite-plugin-dts": "4.5.0",
109
107
  "vite-tsconfig-paths": "5.1.4"
110
108
  }
111
- }
109
+ }
@@ -1 +0,0 @@
1
- "use strict";var Q=Object.defineProperty;var G=(a,t,e)=>t in a?Q(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var N=(a,t,e)=>G(a,typeof t!="symbol"?t+"":t,e);const E=require("rxjs"),J=require("./mp-front-cli-encrypter.cjs"),h=require("i18next"),F=require("./mp-front-cli-header.cjs"),v=require("querystring"),m=require("./service-token-Bv3BAiQd.cjs"),I=require("./loading-handler-CVkAHN_A.cjs"),C=require("./custom-encoder-d7rw7W8X.cjs"),P=require("./mp-front-cli-logger.cjs"),V=require("./stringify-BN6t_WDt.cjs"),H=require("./index-D-Gvi_du.cjs"),S=a=>(h.init({resources:{es:{translation:{errors:{...H.translation.errors,...(a==null?void 0:a.es)??{}}}}},lng:"es",supportedLngs:["es"],interpolation:{escapeValue:!1},debug:!1}),h),$={"SKIPFINGERPRINT-WITHOUT-PERMISSIONS-01":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-WITHOUT-PERMISSIONS-01.message",title:"errors.helpdesk.SKIPFINGERPRINT-WITHOUT-PERMISSIONS-01.title",level:"error"},"SKIPFINGERPRINT-WITHOUT-IDJOURNEY-01":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-WITHOUT-IDJOURNEY-01.message",title:"errors.helpdesk.SKIPFINGERPRINT-WITHOUT-IDJOURNEY-01.title",level:"error"},"SKIPFINGERPRINT-JOURNEY-UPDATE-ERROR-01":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-JOURNEY-UPDATE-ERROR-01.message",title:"errors.helpdesk.SKIPFINGERPRINT-JOURNEY-UPDATE-ERROR-01.title",level:"error"},"SKIPFINGERPRINT-UNEXCEPTED-ERROR-01":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-UNEXCEPTED-ERROR-01.message",title:"errors.helpdesk.SKIPFINGERPRINT-UNEXCEPTED-ERROR-01.title",level:"error"},"SKIPFINGERPRINT-JOURNEY-DATANOTFOUND-02":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-JOURNEY-DATANOTFOUND-02.message",title:"errors.helpdesk.SKIPFINGERPRINT-JOURNEY-DATANOTFOUND-02.title",level:"error"},"SKIPFINGERPRINT-CLIENT-NOT-FOUND":{code:400,type:"modal",message:"errors.helpdesk.SKIPFINGERPRINT-CLIENT-NOT-FOUND.message",title:"errors.helpdesk.SKIPFINGERPRINT-CLIENT-NOT-FOUND.title",level:"error"},"DUPLICATE-KEY-DATABASE-POSTGRES":{code:400,type:"modal",message:"errors.helpdesk.DUPLICATE-KEY-DATABASE-POSTGRES.message",title:"errors.helpdesk.DUPLICATE-KEY-DATABASE-POSTGRES.title",level:"error"},"UNEXCEPTED-ERROR":{code:400,type:"modal",message:"errors.helpdesk.UNEXCEPTED-ERROR.message",title:"errors.helpdesk.UNEXCEPTED-ERROR.title",level:"error"}},Y={"PF-CANCEL-APPLICATION-GENERIC-ERROR-001":{code:400,type:"modal",message:"errors.PF-CANCEL-APPLICATION-GENERIC-ERROR-001.message",title:"errors.PF-CANCEL-APPLICATION-GENERIC-ERROR-001.title",level:"error"}},X={...Y,...$},M={UNAUTHORIZED:{level:"warning",type:"modal",message:"errors.UnAuthorized.message",title:"errors.UnAuthorized.title",code:310},"ERR-GENERAL-01":{level:"warning",type:"modal",message:"errors.ERR-GENERAL-01.message",title:"errors.ERR-GENERAL-01.title",code:400},internalError:{level:"warning",type:"modal",message:"errors.internalError.message",title:"errors.internalError.title",code:420},default:{code:420,type:"modal",message:"errors.default.message",title:"errors.default.title",level:"warning"},"PF-BIOMETRIC-001":{title:"errors.PF-BIOMETRIC-001.title",message:"errors.PF-BIOMETRIC-001.message",level:"warning",code:420,type:"modal"},"PF-BIOMETRIC-002":{title:"errors.PF-BIOMETRIC-002.title",message:"errors.PF-BIOMETRIC-002.message",level:"warning",code:420,type:"modal"},"PF-BIOMETRIC-003":{title:"errors.PF-BIOMETRIC-003.title",message:"errors.PF-BIOMETRIC-003.message",level:"warning",code:420,type:"modal"},"PF-BIOMETRIC-004":{code:421,type:"modal",message:"errors.PF-BIOMETRIC-004.message",title:"errors.PF-BIOMETRIC-004.title",level:"warning"},"PF-BIOMETRIC-007":{title:"errors.PF-BIOMETRIC-007.title",message:"errors.PF-BIOMETRIC-007.message",level:"warning",code:420,type:"modal"},"PF-VALIDATE-CLIENTTYPE-003":{title:"errors.PF-VALIDATE-CLIENTTYPE-003.title",message:"errors.PF-VALIDATE-CLIENTTYPE-003.message",level:"warning",code:310,type:"modal"},"PF-VALIDATE-CLIENTTYPE-006":{title:"errors.PF-VALIDATE-CLIENTTYPE-006.title",message:"errors.PF-VALIDATE-CLIENTTYPE-006.message",level:"warning",code:310,type:"modal"},ERROR_LOCATION:{title:"errors.ERROR_LOCATION.title",message:"errors.ERROR_LOCATION.message",level:"warning",code:310,type:"modal"},"COMMUNICATIONS-INVALIDCODEEXCEPTION-001":{title:"errors.COMMUNICATIONS-INVALIDCODEEXCEPTION-001.title",message:"errors.COMMUNICATIONS-INVALIDCODEEXCEPTION-001.message",code:400,type:"modal",level:"warning"},"COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-001":{title:"errors.COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-001.title",message:"errors.COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-001.message",code:310,type:"modal",level:"warning"},"COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-002":{title:"errors.COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-002.title",message:"errors.COMMUNICATIONS-PREAPPLICATIONNOTFOUNDEXCEPTION-002.message",code:310,type:"modal",level:"warning"},"COMMUNICATIONS-INVALIDEXPIRATIONDATEEXCEPTION-001":{title:"errors.COMMUNICATIONS-INVALIDEXPIRATIONDATEEXCEPTION-001.title",message:"errors.COMMUNICATIONS-INVALIDEXPIRATIONDATEEXCEPTION-001.message",code:400,type:"modal",level:"warning"},"COMMUNICATIONS-INVALIDCODEEXCEPTION-002":{title:"errors.COMMUNICATIONS-INVALIDCODEEXCEPTION-002.title",message:"errors.COMMUNICATIONS-INVALIDCODEEXCEPTION-002.message",code:400,type:"modal",level:"warning"},"COMMUNICATIONS-BLACKLISTEXCEPTION-001":{title:"errors.COMMUNICATIONS-BLACKLISTEXCEPTION-001.title",message:"errors.COMMUNICATIONS-BLACKLISTEXCEPTION-001.message",code:403,type:"modal",level:"warning"},"COMMUNICATIONS-INVALIDNUMBEREXCEPTION-003":{title:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-003.title",message:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-003.message",code:400,type:"modal",level:"warning"},"COMMUNICATIONS-INVALIDNUMBEREXCEPTION-004":{title:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-004.title",message:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-004.message",code:400,type:"modal",level:"warning"},"COMMUNICATIONS-INVALIDNUMBEREXCEPTION-005":{title:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-005.title",message:"errors.COMMUNICATIONS-INVALIDNUMBEREXCEPTION-005.message",code:400,type:"modal",level:"warning"},"SCORE-CLIENTREJECTED-01":{title:"errors.calculator.SCORE-CLIENTREJECTED-01.title",message:"errors.calculator.SCORE-CLIENTREJECTED-01.message",code:310,type:"modal",level:"info"},"SCORE-CLIENTREJECTED-02":{title:"errors.calculator.SCORE-CLIENTREJECTED-02.title",message:"errors.calculator.SCORE-CLIENTREJECTED-02.message",code:310,type:"modal",level:"info"},"CALCULATOR-MAPPING-01":{title:"errors.calculator.CALCULATOR-MAPPING-01.title",message:"errors.calculator.CALCULATOR-MAPPING-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-MAPPING-02":{title:"errors.calculator.CALCULATOR-MAPPING-02.title",message:"errors.calculator.CALCULATOR-MAPPING-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-MAPPING-03":{title:"errors.calculator.CALCULATOR-MAPPING-03.title",message:"errors.calculator.CALCULATOR-MAPPING-03.message",code:420,type:"modal",level:"warning"},"CALCULATOR-MAPPING-04":{title:"errors.calculator.CALCULATOR-MAPPING-04.title",message:"errors.calculator.CALCULATOR-MAPPING-04.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-01":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-01.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-02":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-02.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-03":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-03.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-03.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-04":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-04.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-04.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-05":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-05.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-05.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-06":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-06.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-06.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-07":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-07.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-07.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-08":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-08.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-08.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-09":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-09.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-09.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-10":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-10.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-10.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-11":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-11.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-11.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-12":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-12.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-12.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-13":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-13.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-13.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-14":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-14.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-14.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-15":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-15.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-15.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-16":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-16.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-16.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-17":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-17.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-17.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-18":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-18.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-18.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-19":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-19.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-19.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-20":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-20.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-20.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-21":{code:420,type:"modal",message:"errors.default.message",title:"errors.default.title",level:"warning"},"CALCULATOR-BAD-REQUEST-22":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-22.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-22.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-23":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-23.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-23.message",code:420,type:"modal",level:"info"},"CALCULATOR-BAD-REQUEST-24":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-24.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-24.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-25":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-25.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-25.message",code:420,type:"modal",level:"warning"},"CALCULATOR-UNAUTHORIZED-01":{title:"errors.calculator.CALCULATOR-UNAUTHORIZED-01.title",message:"errors.calculator.CALCULATOR-UNAUTHORIZED-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-UNAUTHORIZED-02":{title:"errors.calculator.CALCULATOR-UNAUTHORIZED-02.title",message:"errors.calculator.CALCULATOR-UNAUTHORIZED-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SERVICE-UNAVAILABLE-01":{title:"errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-01.title",message:"errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SERVICE-UNAVAILABLE-02":{title:"errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-02.title",message:"errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-NOT-FOUND-01":{title:"errors.calculator.CALCULATOR-NOT-FOUND-01.title",message:"errors.calculator.CALCULATOR-NOT-FOUND-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-NOT-FOUND-02":{title:"errors.calculator.CALCULATOR-NOT-FOUND-02.title",message:"errors.calculator.CALCULATOR-NOT-FOUND-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SAP-ERROR-01":{title:"errors.calculator.CALCULATOR-SAP-ERROR-01.title",message:"errors.calculator.CALCULATOR-SAP-ERROR-01.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SAP-ERROR-02":{title:"errors.calculator.CALCULATOR-SAP-ERROR-02.title",message:"errors.calculator.CALCULATOR-SAP-ERROR-02.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SAP-ERROR-03":{title:"errors.calculator.CALCULATOR-SAP-ERROR-03.title",message:"errors.calculator.CALCULATOR-SAP-ERROR-03.message",code:420,type:"modal",level:"warning"},"CALCULATOR-SAP-ERROR-04":{title:"errors.calculator.CALCULATOR-SAP-ERROR-04.title",message:"errors.calculator.CALCULATOR-SAP-ERROR-04.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-26":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-26.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-26.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-27":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-27.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-27.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-28":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-28.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-28.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-29":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-29.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-29.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-30":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-30.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-30.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-31":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-31.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-31.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-34":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-34.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-34.message",code:420,type:"modal",level:"warning"},"CALCULATOR-BAD-REQUEST-35":{title:"errors.calculator.CALCULATOR-BAD-REQUEST-35.title",message:"errors.calculator.CALCULATOR-BAD-REQUEST-35.message",code:420,type:"modal",level:"warning"},"SAVING_NOT_FOUND-01":{title:"errors.calculator.SAVING_NOT_FOUND-01.title",message:"errors.calculator.SAVING_NOT_FOUND-01.message",code:420,type:"modal",level:"warning"},"SAVING-BAD-REQUEST-01":{title:"errors.calculator.SAVING-BAD-REQUEST-01.title",message:"errors.calculator.SAVING-BAD-REQUEST-01.message",code:420,type:"modal",level:"warning"},"SAVING-BAD-REQUEST-02":{title:"errors.calculator.SAVING-BAD-REQUEST-02.title",message:"errors.calculator.SAVING-BAD-REQUEST-02.message",code:420,type:"modal",level:"warning"},"SAVING-BAD-REQUEST-03":{title:"errors.calculator.SAVING-BAD-REQUEST-03.title",message:"errors.calculator.SAVING-BAD-REQUEST-03.message",code:420,type:"modal",level:"warning"},"SAVING-GENERIC-01":{title:"errors.calculator.SAVING-GENERIC-01.title",message:"errors.calculator.SAVING-GENERIC-01.message",code:420,type:"modal",level:"warning"},"JOURNEY-CANCEL-01":{title:"errors.JOURNEY-CANCEL-01.title",message:"errors.JOURNEY-CANCEL-01.message",code:310,type:"modal",level:"info"},"JOURNEY-INVALIDATEDATA-01":{title:"errors.JOURNEY-INVALIDATEDATA-01.title",message:"errors.JOURNEY-INVALIDATEDATA-01.message",code:420,type:"modal",level:"warning"},"JOURNEY-DATANOTFOUND-02":{title:"errors.JOURNEY-DATANOTFOUND-02.title",message:"errors.JOURNEY-DATANOTFOUND-02.message",code:420,type:"modal",level:"warning"},"JOURNEY-FLOWEND-03":{title:"errors.JOURNEY-FLOWEND-03.title",message:"errors.JOURNEY-FLOWEND-03.message",code:420,type:"modal",level:"warning"},"PF-ERROR-GENERIC":{title:"errors.PF-ERROR-GENERIC.title",message:"errors.PF-ERROR-GENERIC.message",code:420,type:"modal",level:"warning"},"JOURNEY-IDSTATEINCORRECT-04":{title:"errors.JOURNEY-IDSTATEINCORRECT-04.title",message:"errors.JOURNEY-IDSTATEINCORRECT-04.message",code:420,type:"modal",level:"warning"},"JOURNEY-HEADERS-05":{title:"errors.JOURNEY-HEADERS-05.title",message:"errors.JOURNEY-HEADERS-05.message",code:420,type:"modal",level:"warning"},"INITIAL-INVALIDATEDATA-01":{title:"errors.INITIAL-INVALIDATEDATA-01.title",message:"errors.INITIAL-INVALIDATEDATA-01.message",code:420,type:"modal",level:"warning"},"INITIAL-DATANOTFOUND-02":{title:"errors.INITIAL-DATANOTFOUND-02.title",message:"errors.INITIAL-DATANOTFOUND-02.message",code:420,type:"modal",level:"warning"},"INITIAL-HEADERS-03":{title:"errors.INITIAL-HEADERS-03.title",message:"errors.INITIAL-HEADERS-03.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-INVALID-MEDIA-TYPE":{title:"errors.PERSONALDATA-INVALID-MEDIA-TYPE.title",message:"errors.PERSONALDATA-INVALID-MEDIA-TYPE.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-INVALID-CONTENT-TYPE":{title:"errors.PERSONALDATA-INVALID-CONTENT-TYPE.title",message:"errors.PERSONALDATA-INVALID-CONTENT-TYPE.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-INVALID-DATA-TYPE":{title:"errors.PERSONALDATA-INVALID-DATA-TYPE.title",message:"errors.PERSONALDATA-INVALID-DATA-TYPE.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-UNKNOWN-REGISTER-01":{title:"errors.PERSONALDATA-UNKNOWN-REGISTER-01.title",message:"errors.PERSONALDATA-UNKNOWN-REGISTER-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-UNKNOWN-REGISTER-02":{title:"errors.PERSONALDATA-UNKNOWN-REGISTER-02.title",message:"errors.PERSONALDATA-UNKNOWN-REGISTER-02.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-01":{title:"errors.PERSONALDATA-BAD-REQUEST-01.title",message:"errors.PERSONALDATA-BAD-REQUEST-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-02":{title:"errors.PERSONALDATA-BAD-REQUEST-02.title",message:"errors.PERSONALDATA-BAD-REQUEST-02.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-03":{title:"errors.PERSONALDATA-BAD-REQUEST-03.title",message:"errors.PERSONALDATA-BAD-REQUEST-03.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-04":{title:"errors.PERSONALDATA-BAD-REQUEST-04.title",message:"errors.PERSONALDATA-BAD-REQUEST-04.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-05":{title:"errors.PERSONALDATA-BAD-REQUEST-05.title",message:"errors.PERSONALDATA-BAD-REQUEST-05.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-06":{title:"errors.PERSONALDATA-BAD-REQUEST-06.title",message:"errors.PERSONALDATA-BAD-REQUEST-06.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-07":{title:"errors.PERSONALDATA-BAD-REQUEST-07.title",message:"errors.PERSONALDATA-BAD-REQUEST-07.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-08":{title:"errors.PERSONALDATA-BAD-REQUEST-08.title",message:"errors.PERSONALDATA-BAD-REQUEST-08.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-GENERIC-ERROR":{title:"errors.PERSONALDATA-GENERIC-ERROR.title",message:"errors.PERSONALDATA-GENERIC-ERROR.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-ODATA-ERROR-01":{title:"errors.PERSONALDATA-ODATA-ERROR-01.title",message:"errors.PERSONALDATA-ODATA-ERROR-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-UNKNOWN-FG-01":{title:"errors.PERSONALDATA-UNKNOWN-FG-01.title",message:"errors.PERSONALDATA-UNKNOWN-FG-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-CU-ERROR-01":{title:"errors.PERSONALDATA-CU-ERROR-01.title",message:"errors.PERSONALDATA-CU-ERROR-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-INVALID-RFC-01":{title:"errors.PERSONALDATA-INVALID-RFC-01.title",message:"errors.PERSONALDATA-INVALID-RFC-01.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-09":{title:"errors.PERSONALDATA-BAD-REQUEST-09.title",message:"errors.PERSONALDATA-BAD-REQUEST-09.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-10":{title:"errors.PERSONALDATA-BAD-REQUEST-10.title",message:"errors.PERSONALDATA-BAD-REQUEST-10.message",code:420,type:"modal",level:"warning"},"PERSONALDATA-BAD-REQUEST-WHITE-LIST-11":{title:"errors.PERSONALDATA-BAD-REQUEST-WHITE-LIST-11.title",message:"errors.PERSONALDATA-BAD-REQUEST-WHITE-LIST-11.message",code:420,type:"modal",level:"warning"},"PERSONALREFERENCE-ACTIVECREDITSEXCEPTION-01":{title:"errors.PERSONALREFERENCE-ACTIVECREDITSEXCEPTION-01.title",message:"errors.PERSONALREFERENCE-ACTIVECREDITSEXCEPTION-01.message",code:422,type:"modal",level:"warning"},"PERSONALREFERENCE-REFERENCESEXCEPTION-01":{title:"errors.PERSONALREFERENCE-REFERENCESEXCEPTION-01.title",message:"errors.PERSONALREFERENCE-REFERENCESEXCEPTION-01.message",code:422,type:"modal",level:"warning"},"PERSONALREFERENCE-BLACKLISTEXCEPTION-01":{title:"errors.PERSONALREFERENCE-BLACKLISTEXCEPTION-01.title",message:"errors.PERSONALREFERENCE-BLACKLISTEXCEPTION-01.message",code:403,type:"modal",level:"warning"},"PERSONALREFERENCE-INVALIDPHONENUMBEREXCEPTION-01":{title:"errors.PERSONALREFERENCE-INVALIDPHONENUMBEREXCEPTION-01.title",message:"errors.PERSONALREFERENCE-INVALIDPHONENUMBEREXCEPTION-01.message",code:400,type:"modal",level:"warning"},"PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001":{title:"errors.PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001.title",message:"errors.PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001.message",code:400,type:"modal",level:"warning"},"PERSONALREFERENCE-INVALIDREFERENCESRELATIONSHIPSCOUNTEXCEPTION-001":{title:"errors.PERSONALREFERENCE-INVALIDREFERENCESRELATIONSHIPSCOUNTEXCEPTION-001.title",message:"errors.PERSONALREFERENCE-INVALIDREFERENCESRELATIONSHIPSCOUNTEXCEPTION-001.message",code:420,type:"modal",level:"warning"},"PERSONALREFERENCE-INVALIDREFERENCESPARENTCOUNTEXCEPTION-001":{title:"errors.PERSONALREFERENCE-INVALIDREFERENCESPARENTCOUNTEXCEPTION-001.title",message:"errors.PERSONALREFERENCE-INVALIDREFERENCESPARENTCOUNTEXCEPTION-001.message",code:422,type:"modal",level:"warning"},"PERSONALREFERENCE-SELFREFERENCEEXCEPTION-001":{title:"errors.PERSONALREFERENCE-SELFREFERENCEEXCEPTION-001.title",message:"errors.PERSONALREFERENCE-SELFREFERENCEEXCEPTION-001.message",code:422,type:"modal",level:"warning"},"SALES-SUMMARY-GENERIC-ERROR-001":{title:"errors.SALES-SUMMARY-GENERIC-ERROR-001.title",message:"errors.SALES-SUMMARY-GENERIC-ERROR-001.message",code:420,type:"modal",level:"warning"},"PF-SALES-SUMMARY-GENERIC-ERROR-001":{title:"errors.PF-SALES-SUMMARY-GENERIC-ERROR-001.title",message:"errors.PF-SALES-SUMMARY-GENERIC-ERROR-001.message",code:420,type:"modal",level:"warning"},"SALES-SUMMARY-ERROR-005":{title:"errors.SALES-SUMMARY-ERROR-005.title",message:"errors.SALES-SUMMARY-ERROR-005.message",code:420,type:"modal",level:"warning"},"PF-CANCEL-APPLICATIONS-INVALIDCATALOGUEIDEXCEPTION-001":{title:"errors.PF-CANCEL-APPLICATIONS-INVALIDCATALOGUEIDEXCEPTION-001.title",message:"errors.PF-CANCEL-APPLICATIONS-INVALIDCATALOGUEIDEXCEPTION-001.message",code:420,type:"modal",level:"warning"},"PF-CANCEL-APPLICATION-GENERIC-ERROR-001":{title:"errors.PF-CANCEL-APPLICATION-GENERIC-ERROR-001.title",message:"errors.PF-CANCEL-APPLICATION-GENERIC-ERROR-001.message",code:420,type:"modal",level:"warning"},...X};class U extends P.CustomLogger{constructor(){super(...arguments);N(this,"errorCatalog",{...M});N(this,"i18Next")}get(e="default",r="NOT_FOUND"){var i,o;const{errorCatalog:s}=this;if(e instanceof Error)return this.logError(e.message),{...s.internalError,title:this.translate(s.internalError.title),message:this.translate(s.internalError.message),uuid:r};const l=typeof e=="string"?e:e.code??e.errorType;this.logDebug("statusCode",l);const A=typeof e=="string"?{}:{...e};return{...s[l]??s.default,title:this.translate(((i=s[l])==null?void 0:i.title)??s.default.title,A),message:this.translate(((o=s[l])==null?void 0:o.message)??s.default.message,A),payload:typeof e!="string"?{errorCode:e.code}:{},uuid:r}}setErrors(e){this.errorCatalog={...this.errorCatalog,...e}}setI18nResources(e){this.i18Next=S(e)}translate(e,r={}){return this.i18Next||(this.i18Next=S()),this.i18Next.t(e,{payload:r})}}const c=class c{constructor(){N(this,"customLogger",new P.CustomLogger);N(this,"exceptions",{...M})}static getInstance(){return c.instance||(c.instance=new c),c.instance}init(t,e){this.exceptions={...this.exceptions,...t},c.i18n=S(e)}get(t,e="NOT_FOUND"){var l,A;if(c.i18n||(c.i18n=S()),t instanceof Error){this.customLogger.logError(t.message);const i=this.exceptions.internalError;return{...i,title:this.translate(i.title),message:this.translate(i.message),uuid:e}}const r=typeof t=="string"?t:t.code??t.errorType;this.customLogger.logDebug("statusCode",r);const s=typeof t=="string"?{}:{...t};return{...this.exceptions[r]??this.exceptions.default,title:this.translate(((l=this.exceptions[r])==null?void 0:l.title)??this.exceptions.default.title,s),message:this.translate(((A=this.exceptions[r])==null?void 0:A.message)??this.exceptions.default.message,s),payload:typeof t!="string"?{errorCode:t.code}:{},uuid:e}}translate(t,e={}){return c.i18n.t(t,{payload:e})}};N(c,"instance"),N(c,"i18n");let L=c;class b extends J.CustomEncrypter{constructor(){super(...arguments);N(this,"uuid","");N(this,"session",null)}setSession(e){this.session=e}getSession(){if(!this.session)throw L.getInstance().get("SESSION_NOT_FOUND");return this.session}returnData(e,r,s){const l=this.encode(r,s);e.status(200).json(l)}returnError(e,r){return r!=null&&r.uuid?e.status(520).json(r):e.status(520).json(L.getInstance().get(r,this.uuid))}get(e){return this.logDebug("get ApiMiddleware"),(r,s)=>{var l;this.logDebug("return ApiMiddleware"),this.uuid=(l=r==null?void 0:r.body)==null?void 0:l.uuid,E.of(r).pipe(E.switchMap(A=>E.forkJoin({params:E.of(this.decode(A.body)),headers:E.of(A.headers)})),E.switchMap(({params:A,headers:i})=>E.forkJoin({response:e(A,this.uuid,i),headers:E.of(i),params:E.of(A)})),E.switchMap(({params:A,response:i,headers:o})=>(this.logDebug(`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(o)} \x1B[37m <UUID> \x1B[33m ${r.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(A)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)}`),E.of(i))),E.catchError(A=>{var i;return this.logError(`ApiMiddleware <URL>: ${r==null?void 0:r.url} <HEADERS>: ${JSON.stringify(r==null?void 0:r.headers)} <UUID> ${(i=r==null?void 0:r.body)==null?void 0:i.uuid} <PARAMS> ${JSON.stringify(r==null?void 0:r.body)} <ERROR>: ${JSON.stringify(A)}`),this.returnError(s,A),E.EMPTY})).subscribe({next:A=>{this.logDebug("ApiMiddleware subscribe next",JSON.stringify(A)),this.returnData(s,A,this.uuid)}})}}}const K=process.env.ID_FRONT??"NOT_AVAILABLE";class Z extends F.CustomHeader{constructor(e,r,s={}){super(s);N(this,"apiUrl");N(this,"method");this.apiUrl=e,this.method=r??"POST"}errorHandler(e,r){if(e!=null&&e.errors)throw L.getInstance().get(e.errors[0],r);return!(e!=null&&e.errors)}formatParams(e){return JSON.stringify({data:{type:K,attributes:e}})}fetchData(e={},r){return this.getHeaders().pipe(E.switchMap(s=>m.fromFetch(this.apiUrl,{method:"POST",headers:s,body:this.formatParams(e),selector:l=>l.json()}).pipe(E.catchError(l=>{throw this.logError(JSON.stringify(l)),this.logError(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(s)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)} \x1B[33m`),L.getInstance().get("default",r)}),E.switchMap(l=>(this.logDebug(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(s)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)} \x1B[33m`),E.of(l))))),E.filter(s=>this.errorHandler(s,r)))}fetchCustomData(e={},r,s){const l={"Content-Type":"application/json"},A=v.stringify(e),i=`${this.apiUrl}?${A}`,o=this.method==="GET"?i:this.apiUrl;return this.getHeaders(l,s).pipe(E.switchMap(T=>m.fromFetch(o,{method:this.method,headers:T,body:this.method==="GET"?null:JSON.stringify(e),selector:n=>n.json()}).pipe(E.catchError(n=>{throw this.logError(JSON.stringify(n)),this.logError(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${o} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(T)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(n)} \x1B[33m`),L.getInstance().get("default",r)}),E.switchMap(n=>(this.logDebug(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${o} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(T)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(e)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(n)} \x1B[33m`),E.of(n))))))}}const k=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function j(a){return typeof a=="string"&&k.test(a)}function W(a){if(!j(a))throw TypeError("Invalid UUID");let t;const e=new Uint8Array(16);return e[0]=(t=parseInt(a.slice(0,8),16))>>>24,e[1]=t>>>16&255,e[2]=t>>>8&255,e[3]=t&255,e[4]=(t=parseInt(a.slice(9,13),16))>>>8,e[5]=t&255,e[6]=(t=parseInt(a.slice(14,18),16))>>>8,e[7]=t&255,e[8]=(t=parseInt(a.slice(19,23),16))>>>8,e[9]=t&255,e[10]=(t=parseInt(a.slice(24,36),16))/1099511627776&255,e[11]=t/4294967296&255,e[12]=t>>>24&255,e[13]=t>>>16&255,e[14]=t>>>8&255,e[15]=t&255,e}function z(a){a=unescape(encodeURIComponent(a));const t=[];for(let e=0;e<a.length;++e)t.push(a.charCodeAt(e));return t}const q="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ee="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function re(a,t,e){function r(s,l,A,i){var o;if(typeof s=="string"&&(s=z(s)),typeof l=="string"&&(l=W(l)),((o=l)===null||o===void 0?void 0:o.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let T=new Uint8Array(16+s.length);if(T.set(l),T.set(s,l.length),T=e(T),T[6]=T[6]&15|t,T[8]=T[8]&63|128,A){i=i||0;for(let n=0;n<16;++n)A[i+n]=T[n];return A}return V.unsafeStringify(T)}try{r.name=a}catch{}return r.DNS=q,r.URL=ee,r}function te(a,t,e,r){switch(a){case 0:return t&e^~t&r;case 1:return t^e^r;case 2:return t&e^t&r^e&r;case 3:return t^e^r}}function D(a,t){return a<<t|a>>>32-t}function se(a){const t=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof a=="string"){const A=unescape(encodeURIComponent(a));a=[];for(let i=0;i<A.length;++i)a.push(A.charCodeAt(i))}else Array.isArray(a)||(a=Array.prototype.slice.call(a));a.push(128);const r=a.length/4+2,s=Math.ceil(r/16),l=new Array(s);for(let A=0;A<s;++A){const i=new Uint32Array(16);for(let o=0;o<16;++o)i[o]=a[A*64+o*4]<<24|a[A*64+o*4+1]<<16|a[A*64+o*4+2]<<8|a[A*64+o*4+3];l[A]=i}l[s-1][14]=(a.length-1)*8/Math.pow(2,32),l[s-1][14]=Math.floor(l[s-1][14]),l[s-1][15]=(a.length-1)*8&4294967295;for(let A=0;A<s;++A){const i=new Uint32Array(80);for(let O=0;O<16;++O)i[O]=l[A][O];for(let O=16;O<80;++O)i[O]=D(i[O-3]^i[O-8]^i[O-14]^i[O-16],1);let o=e[0],T=e[1],n=e[2],g=e[3],R=e[4];for(let O=0;O<80;++O){const p=Math.floor(O/20),_=D(o,5)+te(p,T,n,g)+R+t[p]+i[O]>>>0;R=g,g=n,n=D(T,30)>>>0,T=o,o=_}e[0]=e[0]+o>>>0,e[1]=e[1]+T>>>0,e[2]=e[2]+n>>>0,e[3]=e[3]+g>>>0,e[4]=e[4]+R>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,e[0]&255,e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,e[1]&255,e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,e[2]&255,e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,e[3]&255,e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,e[4]&255]}const B=re("v5",80,se);class Ee extends C.CustomEncoder{constructor(e,r="POST",s={}){super();N(this,"apiUrl");N(this,"method");N(this,"headers");N(this,"isLoadingEnabled",!0);N(this,"errorResponse");this.apiUrl=e,this.method=r,this.headers={"Content-Type":"application/json",...s}}setIsLoadingEnabled(e){this.isLoadingEnabled=e}setErrorResponse(e){this.errorResponse=e}fetchData(e={}){const r=new Date().toISOString(),s=B(r,B.URL),l=this.encode({...e},s);I.LoadingHandler.getInstance().setSubject(this.isLoadingEnabled);const i=new URLSearchParams(window.location.search).get("flow")??"N/A";return m.fromFetch(this.apiUrl,{method:this.method,headers:{...this.headers,flow:i},body:l,selector:o=>o.json()}).pipe(E.switchMap(o=>E.of(this.decode(o))),E.switchMap(o=>o.code&&(o.type==="modal"||o.type==="message")?(this.logError(`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(o)}`),I.LoadingHandler.getInstance().setSubject(!1),I.MessageHandler.getInstance().setSubject(o),this.errorResponse?E.of(this.errorResponse):E.EMPTY):E.of(o)),E.switchMap(o=>(I.LoadingHandler.getInstance().setSubject(!1),this.logDebug(`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(o)}`),E.of(o))),E.catchError(o=>(this.logError(`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(o)}`),I.LoadingHandler.getInstance().setSubject(!1),I.MessageHandler.getInstance().setSubject(L.getInstance().get(o,s)),this.errorResponse?E.of(this.errorResponse):E.EMPTY)))}}const le=process.env.ID_FRONT??"NOT_AVAILABLE";class oe extends F.CustomHeader{constructor(e,r,s={}){super(s);N(this,"apiUrl");N(this,"method");N(this,"errorCatalog",new U);this.apiUrl=e,this.method=r??"POST"}errorHandler(e,r){if(e!=null&&e.errors)throw this.errorCatalog.get(e.errors[0],r);return!(e!=null&&e.errors)}formatParams(e){return JSON.stringify({data:{type:le,attributes:e}})}fetchData(e={},r){const{resources:s,errors:l}=this.onInit();return this.errorCatalog.setErrors(l),this.errorCatalog.setI18nResources(s),this.getHeaders().pipe(E.switchMap(A=>m.fromFetch(this.apiUrl,{method:"POST",headers:A,body:this.formatParams(e),selector:i=>i.json()}).pipe(E.catchError(i=>{throw this.logError(JSON.stringify(i)),this.logError(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(A)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`),new U().get("default",r)}),E.switchMap(i=>(this.logDebug(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(A)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`),E.of(i))))),E.filter(A=>this.errorHandler(A,r)))}fetchCustomData(e={},r,s){const{resources:l,errors:A}=this.onInit();this.errorCatalog.setErrors(A),this.errorCatalog.setI18nResources(l);const i={"Content-Type":"application/json"},o=v.stringify(e),T=`${this.apiUrl}?${o}`,n=this.method==="GET"?T:this.apiUrl;return this.getHeaders(i,s).pipe(E.switchMap(g=>m.fromFetch(n,{method:this.method,headers:g,body:this.method==="GET"?null:JSON.stringify(e),selector:R=>R.json()}).pipe(E.catchError(R=>{throw this.logError(JSON.stringify(R)),this.logError(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${n} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(g)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(this.formatParams(e))} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(R)} \x1B[33m`),new U().get("default",r)}),E.switchMap(R=>(this.logDebug(`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${n} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(g)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(e)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(R)} \x1B[33m`),E.of(R))))))}}const d={client_id:process.env.AZURE_AD_CLIENT_ID,client_secret:process.env.AZURE_AD_CLIENT_SECRET,resource:process.env.AZURE_AD_CLIENT_RESOURCE,grant_type:process.env.AZURE_AD_CLIENT_GRANT_TYPE},f=process.env.AZURE_AD_GRAPH_URL_TOKEN,u=process.env.AZURE_AD_TENANT_ID;class ae extends P.CustomLogger{getHeaders(){const t=Object.keys(d).some(r=>C.lodashExports.isEmpty(d[r]));if(C.lodashExports.isEmpty(f)||C.lodashExports.isEmpty(u))throw this.logError("AZURE_AD_GRAPH_URL_TOKEN or AZURE_AD_TENANT_ID are empty or missing"),new Error("AZURE_AD_GRAPH_URL_TOKEN or AZURE_AD_TENANT_ID are empty or missing");if(t)throw this.logError("Some variables are empty or missing, check AZURE_AD_CLIENT_ID, AZURE_AD_CLIENT_SECRET, AZURE_AD_CLIENT_RESOURCE, AZURE_AD_CLIENT_GRANT_TYPE"),new Error("some variables are empty or missing");const e=f.replace("AZURE_AD_TENANT_ID",u);return m.fromFetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(d),selector:r=>r.json()}).pipe(E.switchMap(r=>(this.logDebug("response from API new_url_365_graph_token",JSON.stringify(r)),E.of({headers:{Authorization:`Bearer ${r==null?void 0:r.access_token}`,responseType:"json"}}))))}}const y=process.env.AZURE_AD_GRAPH_GET_APP_ROLES,w=process.env.AZURE_AD_GRAPH_GET_USER_BY_EMAIL,x=process.env.AZURE_AD_GRAPH_GROUPS;class Ae extends ae{getAppRoles(t){if(C.lodashExports.isEmpty(y))throw this.logError("AZURE_AD_GRAPH_GET_APP_ROLES URL is empty or missing"),new Error("AZURE_AD_GRAPH_GET_APP_ROLES URL is empty or missing");const e=y.replace("{id-obj}",`${t}`);return this.getHeaders().pipe(E.switchMap(r=>m.fromFetch(e,{method:"GET",headers:r==null?void 0:r.headers,selector:s=>s.json()}).pipe(E.switchMap(s=>E.of({roles:s==null?void 0:s.value})))))}getAppRoleAssignments(t){if(C.lodashExports.isEmpty(w))throw this.logError("AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"),new Error("AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing");const r=`${w.replace("{user-mail}",`${t}/appRoleAssignments`)}?$select=appRoleId,resourceDisplayName`;return this.getHeaders().pipe(E.switchMap(s=>m.fromFetch(r,{method:"GET",headers:s==null?void 0:s.headers,selector:l=>l.json()})))}userRolesByApp(t,e){return E.forkJoin({appRoles:this.getAppRoles(e),appRoleAssignments:this.getAppRoleAssignments(t)}).pipe(E.switchMap(({appRoles:r,appRoleAssignments:s})=>{var i;const l=(i=s==null?void 0:s.value)==null?void 0:i.map(o=>{var T,n,g;return(g=(n=(T=r==null?void 0:r.roles)==null?void 0:T.filter(R=>(R==null?void 0:R.id)===(o==null?void 0:o.appRoleId)))==null?void 0:n.filter(R=>R==null?void 0:R.isEnabled))==null?void 0:g.map(R=>({appRoleId:o==null?void 0:o.appRoleId,displayName:R==null?void 0:R.displayName,value:R==null?void 0:R.value}))}).flat(),A=l==null?void 0:l.map(o=>o==null?void 0:o.appRoleId);return E.of({roles:A})}))}getRolesFromApi(t,e){return this.userRolesByApp(t,e).pipe(E.switchMap(r=>E.of(r)))}getRoles(t,e){return this.getRolesFromApi(t,e)}getGroupsFromApi(t){if(this.logDebug("getGroupsFromApi by email: ",JSON.stringify(t)),C.lodashExports.isEmpty(x))throw this.logError("AZURE_AD_GRAPH_GROUPS URL is empty or missing"),new Error("AZURE_AD_GRAPH_GROUPS URL is empty or missing");const e=`${x.replace("idUser",t)}?$select=id,description,displayName`;return this.logDebug("URL base: ",e),this.getHeaders().pipe(E.switchMap(r=>m.fromFetch(e,{method:"GET",headers:r==null?void 0:r.headers,selector:s=>s.json()}).pipe(E.switchMap(s=>(this.logDebug("response from API: ",JSON.stringify(s)),E.of(s))))))}getUserGroups(t){return this.getGroupsFromApi(t)}inGroup(t,e){return this.logDebug("Check inGroup params: ",JSON.stringify({email:t,idGroup:e})),C.lodashExports.isEmpty(t)||C.lodashExports.isEmpty(e)?(this.logError("inGroup method error"),this.logError("email or idGroup are empty or missing"),E.of(!1)):this.getUserGroups(t).pipe(E.switchMap(r=>{var s;return E.of((s=r==null?void 0:r.value)==null?void 0:s.some(l=>(l==null?void 0:l.id)===e))}))}inRole(t,e,r){return this.logDebug("Check inRole params: ",JSON.stringify({email:t,idRole:e,idObjApp:r})),C.lodashExports.isEmpty(t)||C.lodashExports.isEmpty(e)||C.lodashExports.isEmpty(r)?(this.logError("inRole method error"),this.logError("email or idRole or idObjApp are empty or missing"),E.of(!1)):this.getRoles(t,r).pipe(E.switchMap(s=>{var l;return E.of((l=s==null?void 0:s.roles)==null?void 0:l.includes(e))}))}}exports.ApiMiddleware=b;exports.AuthEngine=Ae;exports.ErrorCatalog=U;exports.Exception=L;exports.FetchServiceBE=Z;exports.FetchServiceFE=Ee;exports.FetchServiceParentBE=oe;