@flarehr/cars-calculator 2.3.49 → 2.3.57
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/lib/cars-calculator/cars-calculator.esm.js +1 -1
- package/dist/lib/cars-calculator/cars-calculator.js +1 -1
- package/dist/lib/cars-calculator/{p-b7e7dc0f.system.entry.js → p-08f08988.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-0b08c63c.system.js → p-19b00569.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-92efd97a.system.entry.js → p-2f318de8.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-cc24e248.js → p-34be9e94.js} +1 -1
- package/dist/lib/cars-calculator/{p-9e42ba48.system.entry.js → p-3986811b.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-69382409.entry.js → p-40adf333.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-45d6fbc2.system.js +1 -0
- package/dist/lib/cars-calculator/{p-82b4b9ca.entry.js → p-5feb27ac.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5e27b626.js → p-628050dd.js} +1 -1
- package/dist/lib/cars-calculator/{p-f91aa986.system.js → p-6339bd49.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-a0ed3a75.system.js → p-63ad215f.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-03836e14.entry.js → p-6a379ac2.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-7062880e.js +1 -0
- package/dist/lib/cars-calculator/{p-20a242dc.entry.js → p-7141bc11.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-ac38cb9d.system.entry.js → p-7234d34c.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-9cc8b374.system.entry.js → p-7fed1bfc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-192dd4a3.system.js → p-8d4bb973.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-25e24da6.system.entry.js → p-94ba6def.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5efd0fbd.entry.js → p-a54b8d09.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-50451ff0.entry.js → p-aa6eeef5.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-98bd1117.system.entry.js → p-aa7dc5dc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-819cfa63.js → p-ab3a7737.js} +1 -1
- package/dist/lib/cars-calculator/{p-821b5928.entry.js → p-af1b58b9.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-78c4dce3.system.js → p-b41f72c8.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-598f4a0b.system.js → p-b51215ae.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-69960bb6.system.js → p-bdb3fb61.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-5c2cc99d.js → p-bf086b51.js} +1 -1
- package/dist/lib/cars-calculator/p-c39a8fe9.entry.js +1 -0
- package/dist/lib/cars-calculator/p-c3b6466e.js +1 -0
- package/dist/lib/cars-calculator/{p-3126f655.system.entry.js → p-c3d37683.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-c49546ea.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-88c232fe.system.entry.js → p-c77c24a6.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-1bc2b206.system.js → p-c9562e73.system.js} +1 -1
- package/dist/lib/cars-calculator/p-cbc447c7.system.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-2e1b766b.system.entry.js → p-cd0073f4.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-c35d387e.js → p-d14b00d9.js} +1 -1
- package/dist/lib/cars-calculator/{p-c4cda1ba.entry.js → p-e385dbe0.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-066d8e7b.js → p-f3effa5d.js} +1 -1
- package/dist/lib/cars-calculator/{p-4b3e246f.js → p-fa160c9f.js} +1 -1
- package/dist/lib/cars-calculator/{p-8ec3baa9.system.js → p-fa7a5280.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-e45ce69c.entry.js → p-ffa283e3.entry.js} +1 -1
- package/dist/lib/cjs/ap-ben-asset_15.cjs.entry.js +1 -1
- package/dist/lib/cjs/ap-ben-benefit-card.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-list-item.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-url_10.cjs.entry.js +6 -6
- package/dist/lib/cjs/ap-ben-benefits-list_3.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefits-page.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-confirm-dialog_4.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-edit-benefit-page_5.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-loading-page_2.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-oidc-callback-page.cjs.entry.js +2 -2
- package/dist/lib/cjs/api-client-00edc9b6.js +107 -0
- package/dist/lib/cjs/{app-globals-086f9d49.js → app-globals-dec360ac.js} +1 -1
- package/dist/lib/cjs/{authentication.service-11c30071.js → authentication.service-12f9ead3.js} +1 -1
- package/dist/lib/cjs/benefits-app-host.cjs.entry.js +2 -2
- package/dist/lib/cjs/{benefits-app.query-97410065.js → benefits-app.query-98898e4c.js} +2 -2
- package/dist/lib/cjs/{benefits.api-053c4334.js → benefits.api-a4bd9804.js} +1 -1
- package/dist/lib/cjs/cars-calculator.cjs.js +2 -2
- package/dist/lib/cjs/{datorama-akita-792b4d1d.js → datorama-akita-bb801820.js} +15 -5
- package/dist/lib/cjs/{event-tracking.service-6ae64142.js → event-tracking.service-fcc820f1.js} +1 -1
- package/dist/lib/cjs/loader.cjs.js +2 -2
- package/dist/lib/cjs/{manage-benefits.service-04883c9b.js → manage-benefits.service-f45b4602.js} +3 -3
- package/dist/lib/cjs/{role-management.service-120cb99a.js → role-management.service-2109723c.js} +2 -2
- package/dist/lib/esm/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm/ap-ben-benefit-card.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-list-item.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-url_10.entry.js +6 -6
- package/dist/lib/esm/ap-ben-benefits-list_3.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefits-page.entry.js +4 -4
- package/dist/lib/esm/ap-ben-confirm-dialog_4.entry.js +3 -3
- package/dist/lib/esm/ap-ben-edit-benefit-page_5.entry.js +4 -4
- package/dist/lib/esm/ap-ben-loading-page_2.entry.js +4 -4
- package/dist/lib/esm/ap-ben-oidc-callback-page.entry.js +2 -2
- package/dist/lib/esm/api-client-a68152b8.js +99 -0
- package/dist/lib/esm/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm/benefits-app-host.entry.js +2 -2
- package/dist/lib/esm/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +2 -2
- package/dist/lib/esm/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm/cars-calculator.js +2 -2
- package/dist/lib/esm/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +15 -5
- package/dist/lib/esm/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm/loader.js +2 -2
- package/dist/lib/esm/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +3 -3
- package/dist/lib/esm/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +2 -2
- package/dist/lib/esm-es5/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-card.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-list-item.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-url_10.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-list_3.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-page.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-confirm-dialog_4.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-edit-benefit-page_5.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-loading-page_2.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-oidc-callback-page.entry.js +1 -1
- package/dist/lib/esm-es5/api-client-a68152b8.js +1 -0
- package/dist/lib/esm-es5/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm-es5/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm-es5/benefits-app-host.entry.js +1 -1
- package/dist/lib/esm-es5/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +1 -1
- package/dist/lib/esm-es5/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm-es5/cars-calculator.js +1 -1
- package/dist/lib/esm-es5/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +1 -1
- package/dist/lib/esm-es5/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +1 -1
- package/dist/lib/esm-es5/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +1 -1
- package/package.json +7 -3
- package/dist/lib/cars-calculator/p-1bdb5093.entry.js +0 -1
- package/dist/lib/cars-calculator/p-307f91bf.system.entry.js +0 -1
- package/dist/lib/cars-calculator/p-56fb974f.entry.js +0 -1
- package/dist/lib/cars-calculator/p-69cf2679.system.js +0 -1
- package/dist/lib/cars-calculator/p-dc58dd5c.js +0 -1
- package/dist/lib/cars-calculator/p-df0a267a.js +0 -1
- package/dist/lib/cjs/api-client-a3c12426.js +0 -107
- package/dist/lib/esm/api-client-8974d2bd.js +0 -99
- package/dist/lib/esm-es5/api-client-8974d2bd.js +0 -1
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-4f00f593.js');
|
|
4
|
-
const index$1 = require('./index-889ce6c6.js');
|
|
5
|
-
const datoramaAkita = require('./datorama-akita-792b4d1d.js');
|
|
6
|
-
|
|
7
|
-
class UserApi {
|
|
8
|
-
async getUserProfile() {
|
|
9
|
-
return (await BackendApiClient.instance.url(`users/self`).get().json());
|
|
10
|
-
}
|
|
11
|
-
async getBasicProfileByEmail(email) {
|
|
12
|
-
const res = await BackendApiClient.instance
|
|
13
|
-
.url(`users?email=${email}`)
|
|
14
|
-
.get()
|
|
15
|
-
.notFound(() => null)
|
|
16
|
-
.json();
|
|
17
|
-
return index.fromNullable(res);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const userApi = new UserApi();
|
|
21
|
-
|
|
22
|
-
class UserProfileDto {
|
|
23
|
-
static toDomain(dto) {
|
|
24
|
-
return {
|
|
25
|
-
basicProfile: dto.basicProfile,
|
|
26
|
-
benefitsProfile: dto.benefitsProfile
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return "function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q],r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return en.deleteProperty.call(this,r[0],t)},on.set=function(r,t,e){return en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if((f=i(r))===H)return;return void 0===f&&(f=r),e.F&&d(f,!0),f}n(21,r);},this.produceWithPatches=function(n,r){return "function"==typeof n?function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))}:[e.produce(n,r,(function(n,r){t=n,i=r;})),t,i];var t,i;},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t.slice(e+1))}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
32
|
-
|
|
33
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
34
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
35
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
36
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
37
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
38
|
-
};
|
|
39
|
-
function createInitialState() {
|
|
40
|
-
return {
|
|
41
|
-
user: index.none
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
let BenefitsAppStore = class BenefitsAppStore extends datoramaAkita.Store {
|
|
45
|
-
constructor() {
|
|
46
|
-
super(createInitialState());
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
BenefitsAppStore = __decorate([
|
|
50
|
-
datoramaAkita.StoreConfig({ name: 'benefits-app', resettable: true, producerFn: fn })
|
|
51
|
-
], BenefitsAppStore);
|
|
52
|
-
const benefitsAppStore = new BenefitsAppStore();
|
|
53
|
-
|
|
54
|
-
class BenefitsAppService {
|
|
55
|
-
static set profileId(profileId) {
|
|
56
|
-
this._profileId = index.fromNullable(profileId);
|
|
57
|
-
}
|
|
58
|
-
static get profileId() {
|
|
59
|
-
if (index.isNone(this._profileId)) {
|
|
60
|
-
throw Error(`ProfileId is missing.`);
|
|
61
|
-
}
|
|
62
|
-
return this._profileId.value;
|
|
63
|
-
}
|
|
64
|
-
static set accountId(accountId) {
|
|
65
|
-
this._accountId = index.fromNullable(accountId);
|
|
66
|
-
}
|
|
67
|
-
static get accountIdOrDefault() {
|
|
68
|
-
return index$1.getOrDefault(this._accountId, '');
|
|
69
|
-
}
|
|
70
|
-
async loadSignedInUserProfileAsync() {
|
|
71
|
-
const user = UserProfileDto.toDomain(await userApi.getUserProfile());
|
|
72
|
-
BenefitsAppService.accountId = user.basicProfile.accountId;
|
|
73
|
-
benefitsAppStore.update((state) => {
|
|
74
|
-
state.user = index.fromNullable(user);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
static get partnerIdOrDefault() {
|
|
78
|
-
return index$1.getOrDefault(this._partnerId, '');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
BenefitsAppService._profileId = index.none;
|
|
82
|
-
BenefitsAppService._accountId = index.none;
|
|
83
|
-
BenefitsAppService._partnerId = index.none;
|
|
84
|
-
const benefitsAppService = new BenefitsAppService();
|
|
85
|
-
|
|
86
|
-
class BackendApiClient {
|
|
87
|
-
static setParameters(apiBaseUrl, jwt) {
|
|
88
|
-
this._apiBaseUrl = apiBaseUrl;
|
|
89
|
-
this._jwt = jwt;
|
|
90
|
-
}
|
|
91
|
-
static get instance() {
|
|
92
|
-
return index.factory(this._apiBaseUrl).headers({
|
|
93
|
-
Authorization: `Bearer ${this._jwt}`,
|
|
94
|
-
'X-PROFILE-ID': BenefitsAppService.profileId,
|
|
95
|
-
'X-ACCOUNT-ID': BenefitsAppService.accountIdOrDefault,
|
|
96
|
-
'X-PARTNER-ID': BenefitsAppService.partnerIdOrDefault
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
exports.BackendApiClient = BackendApiClient;
|
|
102
|
-
exports.BenefitsAppService = BenefitsAppService;
|
|
103
|
-
exports.UserProfileDto = UserProfileDto;
|
|
104
|
-
exports.benefitsAppService = benefitsAppService;
|
|
105
|
-
exports.benefitsAppStore = benefitsAppStore;
|
|
106
|
-
exports.fn = fn;
|
|
107
|
-
exports.userApi = userApi;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { b as fromNullable, n as none, i as isNone, f as factory } from './index-6869168f.js';
|
|
2
|
-
import { g as getOrDefault } from './index-8f0ba0c8.js';
|
|
3
|
-
import { S as StoreConfig, a as Store } from './datorama-akita-e42d9911.js';
|
|
4
|
-
|
|
5
|
-
class UserApi {
|
|
6
|
-
async getUserProfile() {
|
|
7
|
-
return (await BackendApiClient.instance.url(`users/self`).get().json());
|
|
8
|
-
}
|
|
9
|
-
async getBasicProfileByEmail(email) {
|
|
10
|
-
const res = await BackendApiClient.instance
|
|
11
|
-
.url(`users?email=${email}`)
|
|
12
|
-
.get()
|
|
13
|
-
.notFound(() => null)
|
|
14
|
-
.json();
|
|
15
|
-
return fromNullable(res);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const userApi = new UserApi();
|
|
19
|
-
|
|
20
|
-
class UserProfileDto {
|
|
21
|
-
static toDomain(dto) {
|
|
22
|
-
return {
|
|
23
|
-
basicProfile: dto.basicProfile,
|
|
24
|
-
benefitsProfile: dto.benefitsProfile
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return "function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q],r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return en.deleteProperty.call(this,r[0],t)},on.set=function(r,t,e){return en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if((f=i(r))===H)return;return void 0===f&&(f=r),e.F&&d(f,!0),f}n(21,r);},this.produceWithPatches=function(n,r){return "function"==typeof n?function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))}:[e.produce(n,r,(function(n,r){t=n,i=r;})),t,i];var t,i;},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t.slice(e+1))}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
30
|
-
|
|
31
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
32
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
33
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
34
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
35
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
36
|
-
};
|
|
37
|
-
function createInitialState() {
|
|
38
|
-
return {
|
|
39
|
-
user: none
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
let BenefitsAppStore = class BenefitsAppStore extends Store {
|
|
43
|
-
constructor() {
|
|
44
|
-
super(createInitialState());
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
BenefitsAppStore = __decorate([
|
|
48
|
-
StoreConfig({ name: 'benefits-app', resettable: true, producerFn: fn })
|
|
49
|
-
], BenefitsAppStore);
|
|
50
|
-
const benefitsAppStore = new BenefitsAppStore();
|
|
51
|
-
|
|
52
|
-
class BenefitsAppService {
|
|
53
|
-
static set profileId(profileId) {
|
|
54
|
-
this._profileId = fromNullable(profileId);
|
|
55
|
-
}
|
|
56
|
-
static get profileId() {
|
|
57
|
-
if (isNone(this._profileId)) {
|
|
58
|
-
throw Error(`ProfileId is missing.`);
|
|
59
|
-
}
|
|
60
|
-
return this._profileId.value;
|
|
61
|
-
}
|
|
62
|
-
static set accountId(accountId) {
|
|
63
|
-
this._accountId = fromNullable(accountId);
|
|
64
|
-
}
|
|
65
|
-
static get accountIdOrDefault() {
|
|
66
|
-
return getOrDefault(this._accountId, '');
|
|
67
|
-
}
|
|
68
|
-
async loadSignedInUserProfileAsync() {
|
|
69
|
-
const user = UserProfileDto.toDomain(await userApi.getUserProfile());
|
|
70
|
-
BenefitsAppService.accountId = user.basicProfile.accountId;
|
|
71
|
-
benefitsAppStore.update((state) => {
|
|
72
|
-
state.user = fromNullable(user);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
static get partnerIdOrDefault() {
|
|
76
|
-
return getOrDefault(this._partnerId, '');
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
BenefitsAppService._profileId = none;
|
|
80
|
-
BenefitsAppService._accountId = none;
|
|
81
|
-
BenefitsAppService._partnerId = none;
|
|
82
|
-
const benefitsAppService = new BenefitsAppService();
|
|
83
|
-
|
|
84
|
-
class BackendApiClient {
|
|
85
|
-
static setParameters(apiBaseUrl, jwt) {
|
|
86
|
-
this._apiBaseUrl = apiBaseUrl;
|
|
87
|
-
this._jwt = jwt;
|
|
88
|
-
}
|
|
89
|
-
static get instance() {
|
|
90
|
-
return factory(this._apiBaseUrl).headers({
|
|
91
|
-
Authorization: `Bearer ${this._jwt}`,
|
|
92
|
-
'X-PROFILE-ID': BenefitsAppService.profileId,
|
|
93
|
-
'X-ACCOUNT-ID': BenefitsAppService.accountIdOrDefault,
|
|
94
|
-
'X-PARTNER-ID': BenefitsAppService.partnerIdOrDefault
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { BackendApiClient as B, UserProfileDto as U, BenefitsAppService as a, benefitsAppService as b, benefitsAppStore as c, fn as f, userApi as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function u(e){try{f(r.next(e))}catch(e){i(e)}}function a(e){try{f(r["throw"](e))}catch(e){i(e)}}function f(e){e.done?n(e.value):o(e.value).then(u,a)}f((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(e){return function(t){return f([e,t])}}function f(u){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;o=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1];i=u;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(u);break}if(i[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{b as fromNullable,n as none,i as isNone,f as factory}from"./index-6869168f.js";import{g as getOrDefault}from"./index-8f0ba0c8.js";import{S as StoreConfig,a as Store}from"./datorama-akita-e42d9911.js";var UserApi=function(){function e(){}e.prototype.getUserProfile=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,BackendApiClient.instance.url("users/self").get().json()];case 1:return[2,e.sent()]}}))}))};e.prototype.getBasicProfileByEmail=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,BackendApiClient.instance.url("users?email="+e).get().notFound((function(){return null})).json()];case 1:t=n.sent();return[2,fromNullable(t)]}}))}))};return e}();var userApi=new UserApi;var UserProfileDto=function(){function e(){}e.toDomain=function(e){return{basicProfile:e.basicProfile,benefitsProfile:e.benefitsProfile}};return e}();function n(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(e){return!!e&&!!e[Q]}function t(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&Function.toString.call(n)===Z}(e)||Array.isArray(e)||!!e[L]||!!e.constructor[L]||s(e)||v(e))}function i(e,t,n){void 0===n&&(n=!1),0===o(e)?(n?Object.keys:nn)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function o(e){var t=e[Q];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:s(e)?2:v(e)?3:0}function u(e,t){return 2===o(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){return 2===o(e)?e.get(t):e[t]}function f(e,t,n){var r=o(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function s(e){return X&&e instanceof Map}function v(e){return q&&e instanceof Set}function p(e){return e.o||e.t}function l(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=rn(e);delete t[Q];for(var n=nn(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function d(e,n){return void 0===n&&(n=!1),y(e)||r(e)||!t(e)?e:(o(e)>1&&(e.set=e.add=e.clear=e.delete=h),Object.freeze(e),n&&i(e,(function(e,t){return d(t,!0)}),!0),e)}function h(){n(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(e){var t=tn[e];return t||n(18,e),t}function _(){return U}function j(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function g(e){O(e),e.p.forEach(S),e.p=null}function O(e){e===U&&(U=e.l)}function w(e){return U={p:[],l:U,h:e,m:!0,_:0}}function S(e){var t=e[Q];0===t.i||1===t.i?t.j():t.g=!0}function P(e,r){r._=r.p.length;var o=r.p[0],i=void 0!==e&&e!==o;return r.h.O||b("ES5").S(r,e,i),i?(o[Q].P&&(g(r),n(4)),t(e)&&(e=M(r,e),r.l||x(r,e)),r.u&&b("Patches").M(o[Q],e,r.u,r.s)):e=M(r,o,[]),g(r),r.u&&r.v(r.u,r.s),e!==H?e:void 0}function M(e,t,n){if(y(t))return t;var r=t[Q];if(!r)return i(t,(function(o,i){return A(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return x(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=l(r.k):r.o;i(3===r.i?new Set(o):o,(function(t,i){return A(e,r,o,t,i,n)})),x(e,o,!1),n&&e.u&&b("Patches").R(r,n,e.u,e.s)}return r.o}function A(e,n,o,i,a,c){if(r(a)){var s=M(e,a,c&&n&&3!==n.i&&!u(n.D,i)?c.concat(i):void 0);if(f(o,i,s),!r(s))return;e.m=!1}if(t(a)&&!y(a)){if(!e.h.F&&e._<1)return;M(e,a),n&&n.A.l||x(e,a)}}function x(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&d(t,n)}function z(e,t){var n=e[Q];return(n?p(n):e)[t]}function I(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function k(e){e.P||(e.P=!0,e.l&&k(e.l))}function E(e){e.o||(e.o=l(e.t))}function R(e,t,n){var r=s(t)?b("MapSet").N(t,n):v(t)?b("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=en;n&&(o=[r],i=on);var u=Proxy.revocable(o,i),a=u.revoke,f=u.proxy;return r.k=f,r.j=a,f}(t,n):b("ES5").J(t,n);return(n?n.A:_()).p.push(r),r}function D(e){return r(e)||n(22,e),function e(n){if(!t(n))return n;var r,u=n[Q],c=o(n);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,r=F(n,c),u.I=!1}else r=F(n,c);return i(r,(function(t,n){u&&a(u.t,t)===n||f(r,t,e(n))})),3===c?new Set(r):r}(e)}function F(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return l(e)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(e){var t={};return nn(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},tn={},en={get:function(e,n){if(n===Q)return e;var r=p(e);if(!u(r,n))return function(e,t,n){var r,o=I(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,r,n);var o=r[n];return e.I||!t(o)?o:o===z(e.t,n)?(E(e),e.o[n]=R(e.A.h,o,e)):o},has:function(e,t){return t in p(e)},ownKeys:function(e){return Reflect.ownKeys(p(e))},set:function(e,t,n){var r=I(p(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=z(p(e),t),i=null==o?void 0:o[Q];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(c(n,o)&&(void 0!==n||u(e.t,t)))return!0;E(e),k(e)}return e.o[t]===n&&"number"!=typeof n||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==z(e.t,t)||t in e.t?(e.D[t]=!1,E(e),k(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=p(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(e,t){on[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),on.deleteProperty=function(e,t){return en.deleteProperty.call(this,e[0],t)},on.set=function(e,t,n){return en.set.call(this,e[0],t,n,e[0])};var un=function(){function e(e){var r=this;this.O=B,this.F=!0,this.produce=function(e,o,i){if("function"==typeof e&&"function"!=typeof o){var u=o;o=e;var a=r;return function(e){var t=this;void 0===e&&(e=u);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return a.produce(e,(function(e){var n;return(n=o).call.apply(n,[t,e].concat(r))}))}}var f;if("function"!=typeof o&&n(6),void 0!==i&&"function"!=typeof i&&n(7),t(e)){var c=w(r),s=R(r,e,void 0),l=!0;try{f=o(s),l=!1}finally{l?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(e){return j(c,i),P(e,c)}),(function(e){throw g(c),e})):(j(c,i),P(f,c))}if(!e||"object"!=typeof e){if((f=o(e))===H)return;return void 0===f&&(f=e),r.F&&d(f,!0),f}n(21,e)},this.produceWithPatches=function(e,t){return"function"==typeof e?function(t){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(o))}))}:[r.produce(e,t,(function(e,t){n=e,o=t})),n,o];var n,o},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var o=e.prototype;return o.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var o=w(this),i=R(this,e,void 0);return i[Q].C=!0,O(o),i},o.finishDraft=function(e,t){var n=e&&e[Q];var r=n.A;return j(r,t),P(void 0,r)},o.setAutoFreeze=function(e){this.F=e},o.setUseProxies=function(e){e&&!B&&n(20),this.O=e},o.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}var i=b("Patches").$;return r(e)?i(e,t):this.produce(e,(function(e){return i(e,t.slice(n+1))}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var __decorate=undefined&&undefined.__decorate||function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,u;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(u=e[a])i=(o<3?u(i):o>3?u(t,n,i):u(t,n))||i;return o>3&&i&&Object.defineProperty(t,n,i),i};function createInitialState(){return{user:none}}var BenefitsAppStore=function(e){__extends(t,e);function t(){return e.call(this,createInitialState())||this}return t}(Store);BenefitsAppStore=__decorate([StoreConfig({name:"benefits-app",resettable:true,producerFn:fn})],BenefitsAppStore);var benefitsAppStore=new BenefitsAppStore;var BenefitsAppService=function(){function e(){}Object.defineProperty(e,"profileId",{get:function(){if(isNone(this._profileId)){throw Error("ProfileId is missing.")}return this._profileId.value},set:function(e){this._profileId=fromNullable(e)},enumerable:false,configurable:true});Object.defineProperty(e,"accountId",{set:function(e){this._accountId=fromNullable(e)},enumerable:false,configurable:true});Object.defineProperty(e,"accountIdOrDefault",{get:function(){return getOrDefault(this._accountId,"")},enumerable:false,configurable:true});e.prototype.loadSignedInUserProfileAsync=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(o){switch(o.label){case 0:r=(n=UserProfileDto).toDomain;return[4,userApi.getUserProfile()];case 1:t=r.apply(n,[o.sent()]);e.accountId=t.basicProfile.accountId;benefitsAppStore.update((function(e){e.user=fromNullable(t)}));return[2]}}))}))};Object.defineProperty(e,"partnerIdOrDefault",{get:function(){return getOrDefault(this._partnerId,"")},enumerable:false,configurable:true});return e}();BenefitsAppService._profileId=none;BenefitsAppService._accountId=none;BenefitsAppService._partnerId=none;var benefitsAppService=new BenefitsAppService;var BackendApiClient=function(){function e(){}e.setParameters=function(e,t){this._apiBaseUrl=e;this._jwt=t};Object.defineProperty(e,"instance",{get:function(){return factory(this._apiBaseUrl).headers({Authorization:"Bearer "+this._jwt,"X-PROFILE-ID":BenefitsAppService.profileId,"X-ACCOUNT-ID":BenefitsAppService.accountIdOrDefault,"X-PARTNER-ID":BenefitsAppService.partnerIdOrDefault})},enumerable:false,configurable:true});return e}();export{BackendApiClient as B,UserProfileDto as U,BenefitsAppService as a,benefitsAppService as b,benefitsAppStore as c,fn as f,userApi as u};
|