@syncfy/authentication-widget 2.1.2 → 2.2.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.
- package/README.md +26 -0
- package/dist/syncfy-authentication-widget.cjs.js +529 -190
- package/dist/syncfy-authentication-widget.css +125 -35
- package/dist/syncfy-authentication-widget.esm.js +531 -192
- package/dist/syncfy-authentication-widget.umd.js +121 -136
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ import { object, boolean, string, number, lazy, array, mixed, ValidationError }
|
|
|
7
7
|
import { JWE, JWS, JWK } from "node-jose";
|
|
8
8
|
import Rollbar from "rollbar";
|
|
9
9
|
import Money from "v-money3";
|
|
10
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, onMounted, normalizeClass, createBlock, toDisplayString, inject, ref, reactive, unref, withCtx, createVNode, Fragment, renderList, createTextVNode, computed, watch, withDirectives, vShow, withModifiers, onBeforeUnmount, createSlots,
|
|
10
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, onMounted, normalizeClass, createBlock, toDisplayString, inject, ref, reactive, unref, withCtx, createVNode, Fragment, renderList, createTextVNode, computed, watch, withDirectives, vShow, nextTick, withModifiers, onBeforeUnmount, createSlots, renderSlot, toRaw, normalizeStyle, isRef, provide, h, onUpdated, mergeProps, createApp } from "vue";
|
|
11
11
|
import { useI18n, createI18n } from "vue-i18n";
|
|
12
|
-
import { ElForm, ElFormItem, ElCheckboxGroup, ElCheckbox, ElStatistic, ElSelect, ElOption,
|
|
12
|
+
import { ElForm, ElFormItem, ElCheckboxGroup, ElCheckbox, ElStatistic, ElInput, ElSelect, ElOption, ElAlert, ElMenu, ElMenuItem, ElSwitch, ElDatePicker, ElButton, ElLink, vLoading, ElNotification, ElConfigProvider } from "element-plus";
|
|
13
13
|
import en from "element-plus/dist/locale/en.mjs";
|
|
14
14
|
import es from "element-plus/dist/locale/es.mjs";
|
|
15
15
|
import "element-plus/es/components/checkbox-group/style/css";
|
|
@@ -2464,6 +2464,7 @@ const configValidator = object().noUnknown().shape({
|
|
|
2464
2464
|
displayBusinessSites: boolean(),
|
|
2465
2465
|
displayCredentialInModal: boolean(),
|
|
2466
2466
|
displayErrorsInToast: boolean(),
|
|
2467
|
+
displayFullSiteList: boolean(),
|
|
2467
2468
|
displayLogoImages: boolean(),
|
|
2468
2469
|
displayLongDescription: boolean(),
|
|
2469
2470
|
displayPersonalSites: boolean(),
|
|
@@ -2584,9 +2585,9 @@ const paramsValidator = object().shape({
|
|
|
2584
2585
|
}).strict().noUnknown();
|
|
2585
2586
|
let __VERSION__ = {
|
|
2586
2587
|
"git": {
|
|
2587
|
-
"hash": "
|
|
2588
|
+
"hash": "g94d4e81",
|
|
2588
2589
|
"distance": 0,
|
|
2589
|
-
"tag": "v2.
|
|
2590
|
+
"tag": "v2.2.0"
|
|
2590
2591
|
}
|
|
2591
2592
|
};
|
|
2592
2593
|
function getVersion() {
|
|
@@ -3678,21 +3679,21 @@ function getSantanderWebSocketScript() {
|
|
|
3678
3679
|
};
|
|
3679
3680
|
});
|
|
3680
3681
|
}
|
|
3681
|
-
const _hoisted_1$
|
|
3682
|
+
const _hoisted_1$d = {
|
|
3682
3683
|
key: 0,
|
|
3683
3684
|
width: "30",
|
|
3684
3685
|
height: "28",
|
|
3685
3686
|
fill: "none",
|
|
3686
3687
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3687
3688
|
};
|
|
3688
|
-
const _hoisted_2$
|
|
3689
|
+
const _hoisted_2$b = {
|
|
3689
3690
|
key: 1,
|
|
3690
3691
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3691
3692
|
width: "23",
|
|
3692
3693
|
height: "23",
|
|
3693
3694
|
fill: "none"
|
|
3694
3695
|
};
|
|
3695
|
-
const _hoisted_3$
|
|
3696
|
+
const _hoisted_3$8 = {
|
|
3696
3697
|
key: 2,
|
|
3697
3698
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3698
3699
|
viewBox: "0 0 50 50"
|
|
@@ -3770,7 +3771,7 @@ const _hoisted_11 = {
|
|
|
3770
3771
|
"stroke-width": "1.5",
|
|
3771
3772
|
"xmlns:v": "https://vecta.io/nano"
|
|
3772
3773
|
};
|
|
3773
|
-
const _sfc_main$
|
|
3774
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
3774
3775
|
__name: "CustomIcon",
|
|
3775
3776
|
props: {
|
|
3776
3777
|
icon: {}
|
|
@@ -3778,7 +3779,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3778
3779
|
setup(__props) {
|
|
3779
3780
|
const props = __props;
|
|
3780
3781
|
return (_ctx, _cache) => {
|
|
3781
|
-
return props.icon === "back" ? (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
3782
|
+
return props.icon === "back" ? (openBlock(), createElementBlock("svg", _hoisted_1$d, _cache[0] || (_cache[0] = [
|
|
3782
3783
|
createElementVNode("path", {
|
|
3783
3784
|
d: "M2 14.219h26.5M2 13.781 13.781 2M2 14.219 13.781 26",
|
|
3784
3785
|
stroke: "#000",
|
|
@@ -3786,7 +3787,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3786
3787
|
"stroke-linecap": "round",
|
|
3787
3788
|
"stroke-linejoin": "round"
|
|
3788
3789
|
}, null, -1)
|
|
3789
|
-
]))) : props.icon === "close" ? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
3790
|
+
]))) : props.icon === "close" ? (openBlock(), createElementBlock("svg", _hoisted_2$b, _cache[1] || (_cache[1] = [
|
|
3790
3791
|
createElementVNode("path", {
|
|
3791
3792
|
d: "m2 2 18.738 18.738M2.12 21.107 20.857 2.37",
|
|
3792
3793
|
stroke: "#000",
|
|
@@ -3794,7 +3795,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3794
3795
|
"stroke-linecap": "round",
|
|
3795
3796
|
"stroke-linejoin": "round"
|
|
3796
3797
|
}, null, -1)
|
|
3797
|
-
]))) : props.icon === "error" ? (openBlock(), createElementBlock("svg", _hoisted_3$
|
|
3798
|
+
]))) : props.icon === "error" ? (openBlock(), createElementBlock("svg", _hoisted_3$8, _cache[2] || (_cache[2] = [
|
|
3798
3799
|
createElementVNode("circle", {
|
|
3799
3800
|
cx: "25",
|
|
3800
3801
|
cy: "25",
|
|
@@ -3865,8 +3866,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
3865
3866
|
};
|
|
3866
3867
|
}
|
|
3867
3868
|
});
|
|
3868
|
-
const _hoisted_1$
|
|
3869
|
-
const _sfc_main$
|
|
3869
|
+
const _hoisted_1$c = ["src"];
|
|
3870
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
3870
3871
|
__name: "AppLoader",
|
|
3871
3872
|
props: {
|
|
3872
3873
|
avatar: { default: void 0 },
|
|
@@ -3913,8 +3914,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3913
3914
|
width: "1",
|
|
3914
3915
|
height: "1",
|
|
3915
3916
|
onLoad: _cache[0] || (_cache[0] = () => emit("imagesLoaded"))
|
|
3916
|
-
}, null, 40, _hoisted_1$
|
|
3917
|
-
_ctx.icon ? (openBlock(), createBlock(_sfc_main$
|
|
3917
|
+
}, null, 40, _hoisted_1$c)) : createCommentVNode("", true),
|
|
3918
|
+
_ctx.icon ? (openBlock(), createBlock(_sfc_main$j, {
|
|
3918
3919
|
key: 1,
|
|
3919
3920
|
icon: _ctx.icon
|
|
3920
3921
|
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
@@ -3939,7 +3940,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
3939
3940
|
}
|
|
3940
3941
|
});
|
|
3941
3942
|
const loader = "pb-w-sync_loader";
|
|
3942
|
-
const style0$
|
|
3943
|
+
const style0$h = {
|
|
3943
3944
|
loader,
|
|
3944
3945
|
"loader-container-animation": "pb-w-sync_loader-container-animation",
|
|
3945
3946
|
"loader-clip-animation": "pb-w-sync_loader-clip-animation",
|
|
@@ -3964,12 +3965,12 @@ const _export_sfc = (sfc, props) => {
|
|
|
3964
3965
|
}
|
|
3965
3966
|
return target;
|
|
3966
3967
|
};
|
|
3967
|
-
const cssModules$
|
|
3968
|
-
"$style": style0$
|
|
3968
|
+
const cssModules$h = {
|
|
3969
|
+
"$style": style0$h
|
|
3969
3970
|
};
|
|
3970
|
-
const AppLoader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3971
|
-
const _hoisted_1$
|
|
3972
|
-
const _sfc_main$
|
|
3971
|
+
const AppLoader = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__cssModules", cssModules$h]]);
|
|
3972
|
+
const _hoisted_1$b = ["disabled"];
|
|
3973
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
3973
3974
|
__name: "AccountsSelection",
|
|
3974
3975
|
props: {
|
|
3975
3976
|
avatar: { default: void 0 },
|
|
@@ -4163,7 +4164,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4163
4164
|
"data-testid": "accounts-button",
|
|
4164
4165
|
disabled: _ctx.buttonDisabledStyle && isInvalid.value,
|
|
4165
4166
|
type: "submit"
|
|
4166
|
-
}, toDisplayString(unref(t)("accounts_selection.done")), 9, _hoisted_1$
|
|
4167
|
+
}, toDisplayString(unref(t)("accounts_selection.done")), 9, _hoisted_1$b)
|
|
4167
4168
|
]),
|
|
4168
4169
|
_: 1
|
|
4169
4170
|
}, 8, ["class", "autocomplete", "disabled", "model", "rules"])),
|
|
@@ -4182,7 +4183,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4182
4183
|
};
|
|
4183
4184
|
}
|
|
4184
4185
|
});
|
|
4185
|
-
const style0$
|
|
4186
|
+
const style0$g = {
|
|
4186
4187
|
"accounts-balance": "pb-w-sync_accounts-balance",
|
|
4187
4188
|
"accounts-checkbox": "pb-w-sync_accounts-checkbox",
|
|
4188
4189
|
"accounts-checkbox-content": "pb-w-sync_accounts-checkbox-content",
|
|
@@ -4193,11 +4194,11 @@ const style0$f = {
|
|
|
4193
4194
|
"accounts-selection": "pb-w-sync_accounts-selection",
|
|
4194
4195
|
"accounts-api-error": "pb-w-sync_accounts-api-error"
|
|
4195
4196
|
};
|
|
4196
|
-
const cssModules$
|
|
4197
|
-
"$style": style0$
|
|
4197
|
+
const cssModules$g = {
|
|
4198
|
+
"$style": style0$g
|
|
4198
4199
|
};
|
|
4199
|
-
const AccountsSelection = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4200
|
-
const _sfc_main$
|
|
4200
|
+
const AccountsSelection = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__cssModules", cssModules$g]]);
|
|
4201
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
4201
4202
|
__name: "FinalResponse",
|
|
4202
4203
|
props: {
|
|
4203
4204
|
avatar: {},
|
|
@@ -4243,127 +4244,21 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4243
4244
|
};
|
|
4244
4245
|
}
|
|
4245
4246
|
});
|
|
4246
|
-
const style0$
|
|
4247
|
+
const style0$f = {
|
|
4247
4248
|
"final-response-container": "pb-w-sync_final-response-container"
|
|
4248
4249
|
};
|
|
4249
|
-
const cssModules$
|
|
4250
|
-
"$style": style0$
|
|
4251
|
-
};
|
|
4252
|
-
const FinalResponse = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__cssModules", cssModules$e]]);
|
|
4253
|
-
const _hoisted_1$9 = ["src"];
|
|
4254
|
-
const _hoisted_2$9 = ["src"];
|
|
4255
|
-
const _hoisted_3$6 = ["onClick"];
|
|
4256
|
-
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
4257
|
-
__name: "InstitutionFilters",
|
|
4258
|
-
props: {
|
|
4259
|
-
countryId: {},
|
|
4260
|
-
filteredCountries: {},
|
|
4261
|
-
filteredOrganizationTypes: {},
|
|
4262
|
-
showCountries: { type: Boolean },
|
|
4263
|
-
organizationTypeId: {},
|
|
4264
|
-
selectClass: {}
|
|
4265
|
-
},
|
|
4266
|
-
emits: ["update:countryId", "update:organizationTypeId"],
|
|
4267
|
-
setup(__props, { emit: __emit }) {
|
|
4268
|
-
const props = __props;
|
|
4269
|
-
const emit = __emit;
|
|
4270
|
-
const { t } = useI18n();
|
|
4271
|
-
const selectedCountryFlag = computed(
|
|
4272
|
-
() => countryFlag(
|
|
4273
|
-
props.filteredCountries.find(
|
|
4274
|
-
(country) => country.id_country === props.countryId
|
|
4275
|
-
)
|
|
4276
|
-
)
|
|
4277
|
-
);
|
|
4278
|
-
function countryChanged(id_country) {
|
|
4279
|
-
measureEvent("open_country", {
|
|
4280
|
-
id_country
|
|
4281
|
-
});
|
|
4282
|
-
emit("update:countryId", id_country);
|
|
4283
|
-
}
|
|
4284
|
-
function countryFlag(country) {
|
|
4285
|
-
return `https://hatscripts.github.io/circle-flags/flags/${country.code.toLocaleLowerCase()}.svg`;
|
|
4286
|
-
}
|
|
4287
|
-
function selectOrganizationType(id) {
|
|
4288
|
-
measureEvent("open_site_organization_type", {
|
|
4289
|
-
id_site_organization_type: id
|
|
4290
|
-
});
|
|
4291
|
-
emit("update:organizationTypeId", id);
|
|
4292
|
-
}
|
|
4293
|
-
return (_ctx, _cache) => {
|
|
4294
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
4295
|
-
createElementVNode("p", {
|
|
4296
|
-
class: normalizeClass(_ctx.$style["institution-filters-intro"])
|
|
4297
|
-
}, toDisplayString(unref(t)("common.intro")), 3),
|
|
4298
|
-
_ctx.showCountries ? (openBlock(), createBlock(unref(ElSelect), {
|
|
4299
|
-
key: 0,
|
|
4300
|
-
class: normalizeClass(_ctx.$style["widget-country"]),
|
|
4301
|
-
"model-value": props.countryId,
|
|
4302
|
-
"popper-class": props.selectClass,
|
|
4303
|
-
onChange: countryChanged
|
|
4304
|
-
}, {
|
|
4305
|
-
prefix: withCtx(() => [
|
|
4306
|
-
createElementVNode("img", {
|
|
4307
|
-
src: selectedCountryFlag.value,
|
|
4308
|
-
width: "44",
|
|
4309
|
-
height: "44",
|
|
4310
|
-
alt: ""
|
|
4311
|
-
}, null, 8, _hoisted_1$9)
|
|
4312
|
-
]),
|
|
4313
|
-
default: withCtx(() => [
|
|
4314
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filteredCountries, (country) => {
|
|
4315
|
-
return openBlock(), createBlock(unref(ElOption), {
|
|
4316
|
-
key: country.id_country,
|
|
4317
|
-
class: normalizeClass(_ctx.$style["widget-country-option"]),
|
|
4318
|
-
value: country.id_country,
|
|
4319
|
-
label: country.name
|
|
4320
|
-
}, {
|
|
4321
|
-
default: withCtx(() => [
|
|
4322
|
-
createElementVNode("img", {
|
|
4323
|
-
src: countryFlag(country),
|
|
4324
|
-
width: "44",
|
|
4325
|
-
height: "44",
|
|
4326
|
-
alt: ""
|
|
4327
|
-
}, null, 8, _hoisted_2$9),
|
|
4328
|
-
createElementVNode("span", null, toDisplayString(country.name), 1)
|
|
4329
|
-
]),
|
|
4330
|
-
_: 2
|
|
4331
|
-
}, 1032, ["class", "value", "label"]);
|
|
4332
|
-
}), 128))
|
|
4333
|
-
]),
|
|
4334
|
-
_: 1
|
|
4335
|
-
}, 8, ["class", "model-value", "popper-class"])) : createCommentVNode("", true),
|
|
4336
|
-
createElementVNode("div", {
|
|
4337
|
-
class: normalizeClass(_ctx.$style["organization-types-list"])
|
|
4338
|
-
}, [
|
|
4339
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filteredOrganizationTypes, (organizationType) => {
|
|
4340
|
-
return openBlock(), createElementBlock("button", {
|
|
4341
|
-
key: organizationType.id_site_organization_type,
|
|
4342
|
-
onClick: () => selectOrganizationType(organizationType.id_site_organization_type)
|
|
4343
|
-
}, toDisplayString(unref(t)(`common.${organizationType.label}`)), 9, _hoisted_3$6);
|
|
4344
|
-
}), 128))
|
|
4345
|
-
], 2)
|
|
4346
|
-
], 64);
|
|
4347
|
-
};
|
|
4348
|
-
}
|
|
4349
|
-
});
|
|
4350
|
-
const style0$d = {
|
|
4351
|
-
"institution-filters-intro": "pb-w-sync_institution-filters-intro",
|
|
4352
|
-
"organization-types-list": "pb-w-sync_organization-types-list",
|
|
4353
|
-
"widget-country": "pb-w-sync_widget-country",
|
|
4354
|
-
"widget-country-option": "pb-w-sync_widget-country-option"
|
|
4355
|
-
};
|
|
4356
|
-
const cssModules$d = {
|
|
4357
|
-
"$style": style0$d
|
|
4250
|
+
const cssModules$f = {
|
|
4251
|
+
"$style": style0$f
|
|
4358
4252
|
};
|
|
4359
|
-
const
|
|
4360
|
-
const _hoisted_1$
|
|
4361
|
-
const _hoisted_2$
|
|
4362
|
-
const _hoisted_3$
|
|
4363
|
-
const _sfc_main$
|
|
4253
|
+
const FinalResponse = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__cssModules", cssModules$f]]);
|
|
4254
|
+
const _hoisted_1$a = ["onClick"];
|
|
4255
|
+
const _hoisted_2$a = ["alt", "src"];
|
|
4256
|
+
const _hoisted_3$7 = { key: 1 };
|
|
4257
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
4364
4258
|
__name: "OrganizationSitesList",
|
|
4365
4259
|
props: {
|
|
4366
4260
|
assetsPath: { default: "https://s.paybook.com" },
|
|
4261
|
+
embedded: { type: Boolean, default: false },
|
|
4367
4262
|
items: { default: () => [] },
|
|
4368
4263
|
showLogo: { type: Boolean, default: true },
|
|
4369
4264
|
showPlaidSitesButton: { type: Boolean, default: false }
|
|
@@ -4386,7 +4281,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4386
4281
|
});
|
|
4387
4282
|
});
|
|
4388
4283
|
onMounted(() => {
|
|
4389
|
-
if (props.items.length > 0 && props.showLogo) {
|
|
4284
|
+
if (!props.embedded && props.items.length > 0 && props.showLogo) {
|
|
4390
4285
|
imagesLoaded = 0;
|
|
4391
4286
|
rootEmit("images-loading");
|
|
4392
4287
|
}
|
|
@@ -4394,7 +4289,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4394
4289
|
watch(
|
|
4395
4290
|
() => props.items,
|
|
4396
4291
|
(val) => {
|
|
4397
|
-
if (val.length > 0 && props.showLogo) {
|
|
4292
|
+
if (!props.embedded && val.length > 0 && props.showLogo) {
|
|
4398
4293
|
imagesLoaded = 0;
|
|
4399
4294
|
rootEmit("images-loading");
|
|
4400
4295
|
}
|
|
@@ -4402,7 +4297,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4402
4297
|
);
|
|
4403
4298
|
function imageLoaded() {
|
|
4404
4299
|
imagesLoaded++;
|
|
4405
|
-
if (imagesLoaded === props.items.length) {
|
|
4300
|
+
if (!props.embedded && imagesLoaded === props.items.length) {
|
|
4406
4301
|
rootEmit("images-loaded");
|
|
4407
4302
|
}
|
|
4408
4303
|
}
|
|
@@ -4419,17 +4314,18 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4419
4314
|
onClick: _cache[0] || (_cache[0] = () => unref(rootEmit)("__internal__.plaid-sites-clicked"))
|
|
4420
4315
|
}, toDisplayString(unref(t)("common.find_your_institution")), 1)
|
|
4421
4316
|
], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4422
|
-
|
|
4317
|
+
!_ctx.embedded ? (openBlock(), createBlock(unref(ElInput), {
|
|
4318
|
+
key: 0,
|
|
4423
4319
|
modelValue: searchQuery.value,
|
|
4424
4320
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
|
|
4425
4321
|
"data-testid": "search-organization",
|
|
4426
4322
|
placeholder: unref(t)("common.search")
|
|
4427
4323
|
}, {
|
|
4428
4324
|
prefix: withCtx(() => [
|
|
4429
|
-
createVNode(_sfc_main$
|
|
4325
|
+
createVNode(_sfc_main$j, { icon: "search" })
|
|
4430
4326
|
]),
|
|
4431
4327
|
_: 1
|
|
4432
|
-
}, 8, ["modelValue", "placeholder"]),
|
|
4328
|
+
}, 8, ["modelValue", "placeholder"])) : createCommentVNode("", true),
|
|
4433
4329
|
createElementVNode("div", {
|
|
4434
4330
|
class: normalizeClass(_ctx.$style["organization-sites"])
|
|
4435
4331
|
}, [
|
|
@@ -4448,8 +4344,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4448
4344
|
height: "66",
|
|
4449
4345
|
width: "220",
|
|
4450
4346
|
onLoad: imageLoaded
|
|
4451
|
-
}, null, 40, _hoisted_2$
|
|
4452
|
-
], 10, _hoisted_1$
|
|
4347
|
+
}, null, 40, _hoisted_2$a)) : (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(item.name), 1))
|
|
4348
|
+
], 10, _hoisted_1$a)), [
|
|
4453
4349
|
[vShow, item.show]
|
|
4454
4350
|
]);
|
|
4455
4351
|
}), 128))
|
|
@@ -4458,15 +4354,333 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4458
4354
|
};
|
|
4459
4355
|
}
|
|
4460
4356
|
});
|
|
4461
|
-
const style0$
|
|
4357
|
+
const style0$e = {
|
|
4462
4358
|
"widget-plaid-container": "pb-w-sync_widget-plaid-container",
|
|
4463
4359
|
"organization-sites": "pb-w-sync_organization-sites",
|
|
4464
4360
|
"organization-button": "pb-w-sync_organization-button"
|
|
4465
4361
|
};
|
|
4362
|
+
const cssModules$e = {
|
|
4363
|
+
"$style": style0$e
|
|
4364
|
+
};
|
|
4365
|
+
const OrganizationSitesList = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__cssModules", cssModules$e]]);
|
|
4366
|
+
function countryFlagUrl(country2) {
|
|
4367
|
+
return `https://hatscripts.github.io/circle-flags/flags/${country2.code.toLocaleLowerCase()}.svg`;
|
|
4368
|
+
}
|
|
4369
|
+
function orderCountries(countries, requestedCountry) {
|
|
4370
|
+
const first = requestedCountry ? countries.find(
|
|
4371
|
+
(country2) => country2.code === requestedCountry || country2.id_country === requestedCountry
|
|
4372
|
+
) : void 0;
|
|
4373
|
+
return first ? [first, ...countries.filter((country2) => country2 !== first)] : countries;
|
|
4374
|
+
}
|
|
4375
|
+
function buildSiteCatalog(countries, organizationTypesOf, organizationSitesOf, categoryLabel) {
|
|
4376
|
+
return countries.map((country2) => ({
|
|
4377
|
+
country: country2,
|
|
4378
|
+
categories: organizationTypesOf(country2.id_country).map((organizationType) => ({
|
|
4379
|
+
organizationType,
|
|
4380
|
+
organizationSites: organizationSitesOf(
|
|
4381
|
+
country2.id_country,
|
|
4382
|
+
organizationType.id_site_organization_type
|
|
4383
|
+
)
|
|
4384
|
+
})).filter((category) => category.organizationSites.length).sort(
|
|
4385
|
+
(a, b) => categoryLabel(a.organizationType).localeCompare(
|
|
4386
|
+
categoryLabel(b.organizationType)
|
|
4387
|
+
)
|
|
4388
|
+
)
|
|
4389
|
+
})).filter((entry) => entry.categories.length);
|
|
4390
|
+
}
|
|
4391
|
+
function searchSiteCatalog(catalog, search2) {
|
|
4392
|
+
const query = search2.toLocaleLowerCase();
|
|
4393
|
+
if (!query) {
|
|
4394
|
+
return catalog;
|
|
4395
|
+
}
|
|
4396
|
+
return catalog.map((entry) => ({
|
|
4397
|
+
...entry,
|
|
4398
|
+
categories: entry.categories.map((category) => ({
|
|
4399
|
+
...category,
|
|
4400
|
+
organizationSites: category.organizationSites.filter(
|
|
4401
|
+
(item) => item.name.toLocaleLowerCase().includes(query)
|
|
4402
|
+
)
|
|
4403
|
+
})).filter((category) => category.organizationSites.length)
|
|
4404
|
+
})).filter((entry) => entry.categories.length);
|
|
4405
|
+
}
|
|
4406
|
+
const _hoisted_1$9 = ["aria-expanded", "disabled", "onClick"];
|
|
4407
|
+
const _hoisted_2$9 = ["src"];
|
|
4408
|
+
const _hoisted_3$6 = ["aria-expanded", "disabled", "onClick"];
|
|
4409
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
4410
|
+
__name: "FullSiteList",
|
|
4411
|
+
props: {
|
|
4412
|
+
assetsPath: {},
|
|
4413
|
+
catalog: {},
|
|
4414
|
+
search: { default: "" },
|
|
4415
|
+
showLogo: { type: Boolean, default: true }
|
|
4416
|
+
},
|
|
4417
|
+
emits: ["select", "update:search"],
|
|
4418
|
+
setup(__props, { emit: __emit }) {
|
|
4419
|
+
const props = __props;
|
|
4420
|
+
const emit = __emit;
|
|
4421
|
+
const { t } = useI18n();
|
|
4422
|
+
const visibleCatalog = computed(
|
|
4423
|
+
() => searchSiteCatalog(props.catalog, props.search)
|
|
4424
|
+
);
|
|
4425
|
+
const collapsed = reactive(/* @__PURE__ */ new Set());
|
|
4426
|
+
const searching = computed(() => !!props.search);
|
|
4427
|
+
function categoryKey(entry, category) {
|
|
4428
|
+
return `${entry.country.id_country}:${category.organizationType.id_site_organization_type}`;
|
|
4429
|
+
}
|
|
4430
|
+
function isOpen(key) {
|
|
4431
|
+
return searching.value || !collapsed.has(key);
|
|
4432
|
+
}
|
|
4433
|
+
function scrollParent(element) {
|
|
4434
|
+
let node = element.parentElement;
|
|
4435
|
+
while (node && !["auto", "scroll"].includes(getComputedStyle(node).overflowY)) {
|
|
4436
|
+
node = node.parentElement;
|
|
4437
|
+
}
|
|
4438
|
+
return node;
|
|
4439
|
+
}
|
|
4440
|
+
async function toggle2(key, event2) {
|
|
4441
|
+
if (!collapsed.has(key)) {
|
|
4442
|
+
const heading = event2.currentTarget.parentElement;
|
|
4443
|
+
const section = heading.parentElement;
|
|
4444
|
+
const scroller = scrollParent(section);
|
|
4445
|
+
const offset = heading.getBoundingClientRect().top - section.getBoundingClientRect().top;
|
|
4446
|
+
collapsed.add(key);
|
|
4447
|
+
if (scroller && offset > 0) {
|
|
4448
|
+
const scrollTop = scroller.scrollTop;
|
|
4449
|
+
await nextTick();
|
|
4450
|
+
scroller.scrollTop = scrollTop - offset;
|
|
4451
|
+
}
|
|
4452
|
+
return;
|
|
4453
|
+
}
|
|
4454
|
+
collapsed.delete(key);
|
|
4455
|
+
}
|
|
4456
|
+
return (_ctx, _cache) => {
|
|
4457
|
+
return openBlock(), createElementBlock("div", null, [
|
|
4458
|
+
createElementVNode("div", {
|
|
4459
|
+
class: normalizeClass(_ctx.$style["search"])
|
|
4460
|
+
}, [
|
|
4461
|
+
createVNode(unref(ElInput), {
|
|
4462
|
+
"data-testid": "search-organization",
|
|
4463
|
+
"model-value": props.search,
|
|
4464
|
+
placeholder: unref(t)("common.search"),
|
|
4465
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => emit("update:search", value))
|
|
4466
|
+
}, {
|
|
4467
|
+
prefix: withCtx(() => [
|
|
4468
|
+
createVNode(_sfc_main$j, { icon: "search" })
|
|
4469
|
+
]),
|
|
4470
|
+
_: 1
|
|
4471
|
+
}, 8, ["model-value", "placeholder"])
|
|
4472
|
+
], 2),
|
|
4473
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleCatalog.value, (entry) => {
|
|
4474
|
+
return openBlock(), createElementBlock("section", {
|
|
4475
|
+
key: entry.country.id_country,
|
|
4476
|
+
"data-testid": "full-site-list-country"
|
|
4477
|
+
}, [
|
|
4478
|
+
createElementVNode("h2", {
|
|
4479
|
+
class: normalizeClass(_ctx.$style["country"])
|
|
4480
|
+
}, [
|
|
4481
|
+
createElementVNode("button", {
|
|
4482
|
+
type: "button",
|
|
4483
|
+
class: normalizeClass(_ctx.$style["toggle"]),
|
|
4484
|
+
"aria-expanded": isOpen(entry.country.id_country),
|
|
4485
|
+
disabled: searching.value,
|
|
4486
|
+
"data-testid": "full-site-list-toggle",
|
|
4487
|
+
onClick: (event2) => toggle2(entry.country.id_country, event2)
|
|
4488
|
+
}, [
|
|
4489
|
+
createElementVNode("img", {
|
|
4490
|
+
class: normalizeClass(_ctx.$style["flag"]),
|
|
4491
|
+
src: unref(countryFlagUrl)(entry.country),
|
|
4492
|
+
width: "20",
|
|
4493
|
+
height: "20",
|
|
4494
|
+
alt: ""
|
|
4495
|
+
}, null, 10, _hoisted_2$9),
|
|
4496
|
+
createElementVNode("span", null, toDisplayString(entry.country.name), 1),
|
|
4497
|
+
!searching.value ? (openBlock(), createElementBlock("svg", {
|
|
4498
|
+
key: 0,
|
|
4499
|
+
class: normalizeClass(_ctx.$style["caret"]),
|
|
4500
|
+
viewBox: "0 0 10 10",
|
|
4501
|
+
"aria-hidden": "true"
|
|
4502
|
+
}, _cache[2] || (_cache[2] = [
|
|
4503
|
+
createElementVNode("path", { d: "M1 3h8L5 8z" }, null, -1)
|
|
4504
|
+
]), 2)) : createCommentVNode("", true)
|
|
4505
|
+
], 10, _hoisted_1$9)
|
|
4506
|
+
], 2),
|
|
4507
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(entry.categories, (category) => {
|
|
4508
|
+
return withDirectives((openBlock(), createElementBlock("section", {
|
|
4509
|
+
key: category.organizationType.id_site_organization_type,
|
|
4510
|
+
"data-testid": "full-site-list-category"
|
|
4511
|
+
}, [
|
|
4512
|
+
createElementVNode("h3", {
|
|
4513
|
+
class: normalizeClass(_ctx.$style["category-title"])
|
|
4514
|
+
}, [
|
|
4515
|
+
createElementVNode("button", {
|
|
4516
|
+
type: "button",
|
|
4517
|
+
class: normalizeClass(_ctx.$style["toggle"]),
|
|
4518
|
+
"aria-expanded": isOpen(categoryKey(entry, category)),
|
|
4519
|
+
disabled: searching.value,
|
|
4520
|
+
"data-testid": "full-site-list-toggle",
|
|
4521
|
+
onClick: (event2) => toggle2(categoryKey(entry, category), event2)
|
|
4522
|
+
}, [
|
|
4523
|
+
createElementVNode("span", null, toDisplayString(unref(t)(`common.${category.organizationType.label}`)), 1),
|
|
4524
|
+
!searching.value ? (openBlock(), createElementBlock("svg", {
|
|
4525
|
+
key: 0,
|
|
4526
|
+
class: normalizeClass(_ctx.$style["caret"]),
|
|
4527
|
+
viewBox: "0 0 10 10",
|
|
4528
|
+
"aria-hidden": "true"
|
|
4529
|
+
}, _cache[3] || (_cache[3] = [
|
|
4530
|
+
createElementVNode("path", { d: "M1 3h8L5 8z" }, null, -1)
|
|
4531
|
+
]), 2)) : createCommentVNode("", true)
|
|
4532
|
+
], 10, _hoisted_3$6)
|
|
4533
|
+
], 2),
|
|
4534
|
+
withDirectives(createElementVNode("div", {
|
|
4535
|
+
class: normalizeClass(_ctx.$style["category-sites"])
|
|
4536
|
+
}, [
|
|
4537
|
+
createVNode(OrganizationSitesList, {
|
|
4538
|
+
"assets-path": props.assetsPath,
|
|
4539
|
+
embedded: "",
|
|
4540
|
+
items: category.organizationSites,
|
|
4541
|
+
"show-logo": props.showLogo,
|
|
4542
|
+
onSelect: _cache[1] || (_cache[1] = (item) => emit("select", item))
|
|
4543
|
+
}, null, 8, ["assets-path", "items", "show-logo"])
|
|
4544
|
+
], 2), [
|
|
4545
|
+
[vShow, isOpen(categoryKey(entry, category))]
|
|
4546
|
+
])
|
|
4547
|
+
])), [
|
|
4548
|
+
[vShow, isOpen(entry.country.id_country)]
|
|
4549
|
+
]);
|
|
4550
|
+
}), 128))
|
|
4551
|
+
]);
|
|
4552
|
+
}), 128)),
|
|
4553
|
+
!visibleCatalog.value.length ? (openBlock(), createElementBlock("p", {
|
|
4554
|
+
key: 0,
|
|
4555
|
+
class: normalizeClass(_ctx.$style["no-results"])
|
|
4556
|
+
}, toDisplayString(unref(t)("common.no_filtered_data")), 3)) : createCommentVNode("", true)
|
|
4557
|
+
]);
|
|
4558
|
+
};
|
|
4559
|
+
}
|
|
4560
|
+
});
|
|
4561
|
+
const search = "pb-w-sync_search";
|
|
4562
|
+
const country = "pb-w-sync_country";
|
|
4563
|
+
const toggle = "pb-w-sync_toggle";
|
|
4564
|
+
const caret = "pb-w-sync_caret";
|
|
4565
|
+
const flag = "pb-w-sync_flag";
|
|
4566
|
+
const style0$d = {
|
|
4567
|
+
search,
|
|
4568
|
+
country,
|
|
4569
|
+
"category-title": "pb-w-sync_category-title",
|
|
4570
|
+
toggle,
|
|
4571
|
+
caret,
|
|
4572
|
+
flag,
|
|
4573
|
+
"category-sites": "pb-w-sync_category-sites",
|
|
4574
|
+
"no-results": "pb-w-sync_no-results"
|
|
4575
|
+
};
|
|
4576
|
+
const cssModules$d = {
|
|
4577
|
+
"$style": style0$d
|
|
4578
|
+
};
|
|
4579
|
+
const FullSiteList = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__cssModules", cssModules$d]]);
|
|
4580
|
+
const _hoisted_1$8 = ["src"];
|
|
4581
|
+
const _hoisted_2$8 = ["src"];
|
|
4582
|
+
const _hoisted_3$5 = ["onClick"];
|
|
4583
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
4584
|
+
__name: "InstitutionFilters",
|
|
4585
|
+
props: {
|
|
4586
|
+
countryId: {},
|
|
4587
|
+
filteredCountries: {},
|
|
4588
|
+
filteredOrganizationTypes: {},
|
|
4589
|
+
showCountries: { type: Boolean },
|
|
4590
|
+
organizationTypeId: {},
|
|
4591
|
+
selectClass: {}
|
|
4592
|
+
},
|
|
4593
|
+
emits: ["update:countryId", "update:organizationTypeId"],
|
|
4594
|
+
setup(__props, { emit: __emit }) {
|
|
4595
|
+
const props = __props;
|
|
4596
|
+
const emit = __emit;
|
|
4597
|
+
const { t } = useI18n();
|
|
4598
|
+
const selectedCountryFlag = computed(
|
|
4599
|
+
() => countryFlagUrl(
|
|
4600
|
+
props.filteredCountries.find(
|
|
4601
|
+
(country2) => country2.id_country === props.countryId
|
|
4602
|
+
)
|
|
4603
|
+
)
|
|
4604
|
+
);
|
|
4605
|
+
function countryChanged(id_country) {
|
|
4606
|
+
measureEvent("open_country", {
|
|
4607
|
+
id_country
|
|
4608
|
+
});
|
|
4609
|
+
emit("update:countryId", id_country);
|
|
4610
|
+
}
|
|
4611
|
+
function selectOrganizationType(id) {
|
|
4612
|
+
measureEvent("open_site_organization_type", {
|
|
4613
|
+
id_site_organization_type: id
|
|
4614
|
+
});
|
|
4615
|
+
emit("update:organizationTypeId", id);
|
|
4616
|
+
}
|
|
4617
|
+
return (_ctx, _cache) => {
|
|
4618
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
4619
|
+
createElementVNode("p", {
|
|
4620
|
+
class: normalizeClass(_ctx.$style["institution-filters-intro"])
|
|
4621
|
+
}, toDisplayString(unref(t)("common.intro")), 3),
|
|
4622
|
+
_ctx.showCountries ? (openBlock(), createBlock(unref(ElSelect), {
|
|
4623
|
+
key: 0,
|
|
4624
|
+
class: normalizeClass(_ctx.$style["widget-country"]),
|
|
4625
|
+
"model-value": props.countryId,
|
|
4626
|
+
"popper-class": props.selectClass,
|
|
4627
|
+
onChange: countryChanged
|
|
4628
|
+
}, {
|
|
4629
|
+
prefix: withCtx(() => [
|
|
4630
|
+
createElementVNode("img", {
|
|
4631
|
+
src: selectedCountryFlag.value,
|
|
4632
|
+
width: "44",
|
|
4633
|
+
height: "44",
|
|
4634
|
+
alt: ""
|
|
4635
|
+
}, null, 8, _hoisted_1$8)
|
|
4636
|
+
]),
|
|
4637
|
+
default: withCtx(() => [
|
|
4638
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filteredCountries, (country2) => {
|
|
4639
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
4640
|
+
key: country2.id_country,
|
|
4641
|
+
class: normalizeClass(_ctx.$style["widget-country-option"]),
|
|
4642
|
+
value: country2.id_country,
|
|
4643
|
+
label: country2.name
|
|
4644
|
+
}, {
|
|
4645
|
+
default: withCtx(() => [
|
|
4646
|
+
createElementVNode("img", {
|
|
4647
|
+
src: unref(countryFlagUrl)(country2),
|
|
4648
|
+
width: "44",
|
|
4649
|
+
height: "44",
|
|
4650
|
+
alt: ""
|
|
4651
|
+
}, null, 8, _hoisted_2$8),
|
|
4652
|
+
createElementVNode("span", null, toDisplayString(country2.name), 1)
|
|
4653
|
+
]),
|
|
4654
|
+
_: 2
|
|
4655
|
+
}, 1032, ["class", "value", "label"]);
|
|
4656
|
+
}), 128))
|
|
4657
|
+
]),
|
|
4658
|
+
_: 1
|
|
4659
|
+
}, 8, ["class", "model-value", "popper-class"])) : createCommentVNode("", true),
|
|
4660
|
+
createElementVNode("div", {
|
|
4661
|
+
class: normalizeClass(_ctx.$style["organization-types-list"])
|
|
4662
|
+
}, [
|
|
4663
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filteredOrganizationTypes, (organizationType) => {
|
|
4664
|
+
return openBlock(), createElementBlock("button", {
|
|
4665
|
+
key: organizationType.id_site_organization_type,
|
|
4666
|
+
onClick: () => selectOrganizationType(organizationType.id_site_organization_type)
|
|
4667
|
+
}, toDisplayString(unref(t)(`common.${organizationType.label}`)), 9, _hoisted_3$5);
|
|
4668
|
+
}), 128))
|
|
4669
|
+
], 2)
|
|
4670
|
+
], 64);
|
|
4671
|
+
};
|
|
4672
|
+
}
|
|
4673
|
+
});
|
|
4674
|
+
const style0$c = {
|
|
4675
|
+
"institution-filters-intro": "pb-w-sync_institution-filters-intro",
|
|
4676
|
+
"organization-types-list": "pb-w-sync_organization-types-list",
|
|
4677
|
+
"widget-country": "pb-w-sync_widget-country",
|
|
4678
|
+
"widget-country-option": "pb-w-sync_widget-country-option"
|
|
4679
|
+
};
|
|
4466
4680
|
const cssModules$c = {
|
|
4467
4681
|
"$style": style0$c
|
|
4468
4682
|
};
|
|
4469
|
-
const
|
|
4683
|
+
const InstitutionFilters = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__cssModules", cssModules$c]]);
|
|
4470
4684
|
const _hoisted_1$7 = { key: 0 };
|
|
4471
4685
|
const _hoisted_2$7 = ["src"];
|
|
4472
4686
|
const _hoisted_3$4 = ["src"];
|
|
@@ -4531,15 +4745,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
4531
4745
|
createElementVNode("h1", null, toDisplayString(props.client.name ? unref(t)("privacy.title_client", { client: props.client.name }) : unref(t)("privacy.title")), 1),
|
|
4532
4746
|
createElementVNode("ul", null, [
|
|
4533
4747
|
createElementVNode("li", null, [
|
|
4534
|
-
createVNode(_sfc_main$
|
|
4748
|
+
createVNode(_sfc_main$j, { icon: "files" }),
|
|
4535
4749
|
createTextVNode(" " + toDisplayString(unref(t)("privacy.list.first")), 1)
|
|
4536
4750
|
]),
|
|
4537
4751
|
createElementVNode("li", null, [
|
|
4538
|
-
createVNode(_sfc_main$
|
|
4752
|
+
createVNode(_sfc_main$j, { icon: "lock" }),
|
|
4539
4753
|
createTextVNode(" " + toDisplayString(unref(t)("privacy.list.second")), 1)
|
|
4540
4754
|
]),
|
|
4541
4755
|
createElementVNode("li", null, [
|
|
4542
|
-
createVNode(_sfc_main$
|
|
4756
|
+
createVNode(_sfc_main$j, { icon: "users" }),
|
|
4543
4757
|
createTextVNode(" " + toDisplayString(unref(t)("privacy.list.third")), 1)
|
|
4544
4758
|
])
|
|
4545
4759
|
]),
|
|
@@ -4588,7 +4802,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
4588
4802
|
const emit = __emit;
|
|
4589
4803
|
const { t } = useI18n();
|
|
4590
4804
|
const segments = computed(() => parseConsentText(props.consent));
|
|
4591
|
-
function
|
|
4805
|
+
function toggle2(event2) {
|
|
4592
4806
|
emit("update:modelValue", event2.target.checked);
|
|
4593
4807
|
}
|
|
4594
4808
|
return (_ctx, _cache) => {
|
|
@@ -4604,7 +4818,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
4604
4818
|
checked: props.modelValue,
|
|
4605
4819
|
"data-testid": "consent-checkbox",
|
|
4606
4820
|
type: "checkbox",
|
|
4607
|
-
onChange:
|
|
4821
|
+
onChange: toggle2
|
|
4608
4822
|
}, null, 40, _hoisted_1$6),
|
|
4609
4823
|
createElementVNode("span", {
|
|
4610
4824
|
class: normalizeClass(_ctx.$style["consent-text"]),
|
|
@@ -4777,7 +4991,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
4777
4991
|
class: normalizeClass(_ctx.$style["widget-back-button"]),
|
|
4778
4992
|
onClick: _cache[0] || (_cache[0] = ($event) => remove($event))
|
|
4779
4993
|
}, [
|
|
4780
|
-
createVNode(_sfc_main$
|
|
4994
|
+
createVNode(_sfc_main$j, { icon: "x-circle" })
|
|
4781
4995
|
], 10, _hoisted_2$5)
|
|
4782
4996
|
], 2)) : (openBlock(), createElementBlock("button", {
|
|
4783
4997
|
key: 1,
|
|
@@ -5211,10 +5425,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5211
5425
|
showPassword.value = !showPassword.value;
|
|
5212
5426
|
})
|
|
5213
5427
|
}, [
|
|
5214
|
-
showPassword.value ? (openBlock(), createBlock(_sfc_main$
|
|
5428
|
+
showPassword.value ? (openBlock(), createBlock(_sfc_main$j, {
|
|
5215
5429
|
key: 0,
|
|
5216
5430
|
icon: "eye-slash"
|
|
5217
|
-
})) : (openBlock(), createBlock(_sfc_main$
|
|
5431
|
+
})) : (openBlock(), createBlock(_sfc_main$j, {
|
|
5218
5432
|
key: 1,
|
|
5219
5433
|
icon: "eye"
|
|
5220
5434
|
}))
|
|
@@ -5821,10 +6035,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
5821
6035
|
isRef(showPassword) ? showPassword.value = !unref(showPassword) : showPassword = !unref(showPassword);
|
|
5822
6036
|
})
|
|
5823
6037
|
}, [
|
|
5824
|
-
!unref(showPassword) ? (openBlock(), createBlock(_sfc_main$
|
|
6038
|
+
!unref(showPassword) ? (openBlock(), createBlock(_sfc_main$j, {
|
|
5825
6039
|
key: 0,
|
|
5826
6040
|
icon: "eye"
|
|
5827
|
-
})) : (openBlock(), createBlock(_sfc_main$
|
|
6041
|
+
})) : (openBlock(), createBlock(_sfc_main$j, {
|
|
5828
6042
|
key: 1,
|
|
5829
6043
|
icon: "eye-slash"
|
|
5830
6044
|
}))
|
|
@@ -8254,6 +8468,7 @@ class SiteBase extends EventEmitter {
|
|
|
8254
8468
|
__publicField(this, "socketOpened", false);
|
|
8255
8469
|
__publicField(this, "socketTimeoutAfterError");
|
|
8256
8470
|
__publicField(this, "timer", null);
|
|
8471
|
+
__publicField(this, "disposed", false);
|
|
8257
8472
|
this.httpService = httpService;
|
|
8258
8473
|
this.userConfig = userConfig;
|
|
8259
8474
|
this.config = site;
|
|
@@ -8312,6 +8527,16 @@ class SiteBase extends EventEmitter {
|
|
|
8312
8527
|
toggleTestMode() {
|
|
8313
8528
|
this.testMode = !this.testMode;
|
|
8314
8529
|
}
|
|
8530
|
+
// Called when the widget drops this connection, so a stale timer or socket cannot act on a later login.
|
|
8531
|
+
dispose() {
|
|
8532
|
+
this.disposed = true;
|
|
8533
|
+
this.clearTimer();
|
|
8534
|
+
this.removeAllListeners();
|
|
8535
|
+
if (this.socket) {
|
|
8536
|
+
this.socket.onclose = this.socket.onerror = this.socket.onmessage = null;
|
|
8537
|
+
this.socket.close();
|
|
8538
|
+
}
|
|
8539
|
+
}
|
|
8315
8540
|
configuredMeasureEvent(eventAction, params) {
|
|
8316
8541
|
if (!this.userConfig.isHeadless) {
|
|
8317
8542
|
measureEvent(eventAction, params);
|
|
@@ -8373,6 +8598,9 @@ class SiteBase extends EventEmitter {
|
|
|
8373
8598
|
return _rules;
|
|
8374
8599
|
}
|
|
8375
8600
|
setSocket(url) {
|
|
8601
|
+
if (this.disposed) {
|
|
8602
|
+
return;
|
|
8603
|
+
}
|
|
8376
8604
|
this.socket = new WebSocket(url);
|
|
8377
8605
|
this.socket.onclose = (event2) => this.reopenSocket(event2);
|
|
8378
8606
|
this.socket.onerror = () => this.socketError();
|
|
@@ -8389,6 +8617,9 @@ class SiteBase extends EventEmitter {
|
|
|
8389
8617
|
return Object.keys(cleanOptions).length ? { options: { ...cleanOptions } } : {};
|
|
8390
8618
|
}
|
|
8391
8619
|
startTimer() {
|
|
8620
|
+
if (this.disposed) {
|
|
8621
|
+
return;
|
|
8622
|
+
}
|
|
8392
8623
|
this.timer = setTimeout(() => {
|
|
8393
8624
|
this.socketTimeout();
|
|
8394
8625
|
}, this.userConfig.socketTimeoutTime);
|
|
@@ -8406,7 +8637,9 @@ class SiteBase extends EventEmitter {
|
|
|
8406
8637
|
this.socketTimeoutAfterError = (/* @__PURE__ */ new Date()).getTime() + 12e4;
|
|
8407
8638
|
this.setSocket(this.response.ws);
|
|
8408
8639
|
const intervalHandler = setInterval(() => {
|
|
8409
|
-
if (
|
|
8640
|
+
if (this.disposed) {
|
|
8641
|
+
clearInterval(intervalHandler);
|
|
8642
|
+
} else if (!this.isSocketOpen) {
|
|
8410
8643
|
if ((/* @__PURE__ */ new Date()).getTime() < this.socketTimeoutAfterError) {
|
|
8411
8644
|
this.socket.close();
|
|
8412
8645
|
this.setSocket(this.response.ws);
|
|
@@ -8725,6 +8958,7 @@ class Credential extends EventEmitter {
|
|
|
8725
8958
|
__publicField(this, "socketOpened", false);
|
|
8726
8959
|
__publicField(this, "socketTimeoutAfterError");
|
|
8727
8960
|
__publicField(this, "timer", null);
|
|
8961
|
+
__publicField(this, "disposed", false);
|
|
8728
8962
|
this.syncService = syncService;
|
|
8729
8963
|
this.httpService = httpService;
|
|
8730
8964
|
this.socketTimeoutTime = socketTimeoutTime;
|
|
@@ -8821,6 +9055,16 @@ class Credential extends EventEmitter {
|
|
|
8821
9055
|
setOption(name, value) {
|
|
8822
9056
|
this.options[name] = value;
|
|
8823
9057
|
}
|
|
9058
|
+
// Called when the widget drops this credential, so a stale timer or socket cannot act on a later flow.
|
|
9059
|
+
dispose() {
|
|
9060
|
+
this.disposed = true;
|
|
9061
|
+
this.clearTimer();
|
|
9062
|
+
this.removeAllListeners();
|
|
9063
|
+
if (this.socket) {
|
|
9064
|
+
this.socket.onclose = this.socket.onerror = this.socket.onmessage = null;
|
|
9065
|
+
this.socket.close();
|
|
9066
|
+
}
|
|
9067
|
+
}
|
|
8824
9068
|
sync() {
|
|
8825
9069
|
this.configuredMeasureEvent("sync_credential", {
|
|
8826
9070
|
id_credential: this.config.id_credential,
|
|
@@ -8938,7 +9182,9 @@ class Credential extends EventEmitter {
|
|
|
8938
9182
|
this.socketTimeoutAfterError = (/* @__PURE__ */ new Date()).getTime() + 12e4;
|
|
8939
9183
|
this.setSocket(this.response.ws);
|
|
8940
9184
|
const intervalHandler = setInterval(() => {
|
|
8941
|
-
if (
|
|
9185
|
+
if (this.disposed) {
|
|
9186
|
+
clearInterval(intervalHandler);
|
|
9187
|
+
} else if (!this.isSocketOpen) {
|
|
8942
9188
|
if ((/* @__PURE__ */ new Date()).getTime() < this.socketTimeoutAfterError) {
|
|
8943
9189
|
this.socket.close();
|
|
8944
9190
|
this.setSocket(this.response.ws);
|
|
@@ -8955,6 +9201,9 @@ class Credential extends EventEmitter {
|
|
|
8955
9201
|
}
|
|
8956
9202
|
}
|
|
8957
9203
|
setSocket(url) {
|
|
9204
|
+
if (this.disposed) {
|
|
9205
|
+
return;
|
|
9206
|
+
}
|
|
8958
9207
|
this.socket = new WebSocket(url);
|
|
8959
9208
|
this.socket.onclose = (event2) => this.reopenSocket(event2);
|
|
8960
9209
|
this.socket.onerror = () => this.socketError();
|
|
@@ -9067,6 +9316,9 @@ class Credential extends EventEmitter {
|
|
|
9067
9316
|
return Object.keys(cleanOptions).length ? { options: { ...cleanOptions } } : {};
|
|
9068
9317
|
}
|
|
9069
9318
|
startTimer() {
|
|
9319
|
+
if (this.disposed) {
|
|
9320
|
+
return;
|
|
9321
|
+
}
|
|
9070
9322
|
this.timer = setTimeout(() => {
|
|
9071
9323
|
this.socketTimeout();
|
|
9072
9324
|
}, this.socketTimeoutTime);
|
|
@@ -9712,6 +9964,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9712
9964
|
locale: {},
|
|
9713
9965
|
navigation: {},
|
|
9714
9966
|
refreshTokenFunction: { type: Function },
|
|
9967
|
+
requestedCountry: {},
|
|
9715
9968
|
strict: {},
|
|
9716
9969
|
token: {}
|
|
9717
9970
|
},
|
|
@@ -9722,9 +9975,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9722
9975
|
const rootEmit = inject(rootEmitter);
|
|
9723
9976
|
const { t, locale } = useI18n({ useScope: "global" });
|
|
9724
9977
|
const { mobile } = useMobile();
|
|
9725
|
-
const countries = ref([]), countryId = ref(null), credentialFlow = ref(null), consent = ref(null), consentLoading = ref(false), dataError = ref(false), displayBackUpConnection = ref(false), finalLongMessage = ref(null), finalMessage = ref(null), fromBackUpConnection = ref(null), infoLongMessage = ref(""), infoMessage = ref(""), inPrivacyPolicy = ref(props.navigation.displayPrivacyScreen), loading = ref(true), noFilteredData = ref(false), organizationSiteId = ref(null), organizationSites = ref([]), organizationTypeId = ref(null), selectingAccounts = ref(false), siteStatus = ref(null), siteFormError = ref(null), updatingCredential = ref(false), visible = ref(false);
|
|
9978
|
+
const countries = ref([]), countryId = ref(null), credentialFlow = ref(null), consent = ref(null), consentLoading = ref(false), dataError = ref(false), displayBackUpConnection = ref(false), finalLongMessage = ref(null), finalMessage = ref(null), fullSiteListSearch = ref(""), fromBackUpConnection = ref(null), infoLongMessage = ref(""), infoMessage = ref(""), inPrivacyPolicy = ref(props.navigation.displayPrivacyScreen), loading = ref(true), noFilteredData = ref(false), organizationSiteId = ref(null), organizationSites = ref([]), organizationTypeId = ref(null), selectingAccounts = ref(false), siteStatus = ref(null), siteFormError = ref(null), updatingCredential = ref(false), visible = ref(false), widgetContent = ref(null);
|
|
9726
9979
|
const consentCache = /* @__PURE__ */ new Map();
|
|
9727
|
-
let assetsPath = "https://s.paybook.com", credential = null, gitVersion = `${getVersion()}${props.strict ? "-strict" : ""}`, infoNotification = null, notificationUpdater, openCredentialToast = null, organizationTypes = [], site = null, siteRaw = null, sync = null;
|
|
9980
|
+
let assetsPath = "https://s.paybook.com", credential = null, fullSiteListScrollTop = 0, gitVersion = `${getVersion()}${props.strict ? "-strict" : ""}`, infoNotification = null, notificationUpdater, openCredentialToast = null, organizationTypes = [], site = null, siteRaw = null, sync = null;
|
|
9728
9981
|
const backUpSite = computed(() => {
|
|
9729
9982
|
var _a;
|
|
9730
9983
|
return ((_a = credentialFlow.value) == null ? void 0 : _a.displayBackUpConnection) || displayBackUpConnection.value ? site : null;
|
|
@@ -9749,8 +10002,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9749
10002
|
}
|
|
9750
10003
|
return props.navigation.enableBackNavigation && siteStatus.value === "start";
|
|
9751
10004
|
}), filteredCountries = computed(() => {
|
|
9752
|
-
return countries.value.filter((
|
|
9753
|
-
return (
|
|
10005
|
+
return countries.value.filter((country2) => {
|
|
10006
|
+
return (country2.id_country === "51ad44db3b8e77631200047d" || country2.id_country === "51ad44793b8e77631200027a") && props.internal.plaidSites || filterOrganizationTypes(country2.id_country).length;
|
|
9754
10007
|
}).sort((a, b) => {
|
|
9755
10008
|
return a.name.localeCompare(b.name);
|
|
9756
10009
|
});
|
|
@@ -9764,6 +10017,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9764
10017
|
organizationTypeId.value,
|
|
9765
10018
|
organizationSiteId.value
|
|
9766
10019
|
);
|
|
10020
|
+
}), fullSiteCatalog = computed(() => {
|
|
10021
|
+
if (!props.navigation.displayFullSiteList) {
|
|
10022
|
+
return [];
|
|
10023
|
+
}
|
|
10024
|
+
return buildSiteCatalog(
|
|
10025
|
+
props.navigation.hideSelectCountry ? filteredCountries.value.filter(
|
|
10026
|
+
(country2) => country2.id_country === countryId.value
|
|
10027
|
+
) : orderCountries(filteredCountries.value, props.requestedCountry),
|
|
10028
|
+
filterOrganizationTypes,
|
|
10029
|
+
filterOrganizationSites,
|
|
10030
|
+
(organizationType) => t(`common.${organizationType.label}`)
|
|
10031
|
+
);
|
|
10032
|
+
}), fullSiteListOnScreen = computed(() => {
|
|
10033
|
+
return visible.value && !inPrivacyPolicy.value && !loading.value && !credentialFlow.value && !siteStatus.value && !organizationSiteId.value && props.navigation.displayFullSiteList;
|
|
9767
10034
|
}), loaderMessage = computed(() => {
|
|
9768
10035
|
return { short: infoMessage.value, long: infoLongMessage.value };
|
|
9769
10036
|
}), sitesMap = computed(() => {
|
|
@@ -9803,6 +10070,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9803
10070
|
}
|
|
9804
10071
|
return "";
|
|
9805
10072
|
} else {
|
|
10073
|
+
if (props.navigation.displayFullSiteList) {
|
|
10074
|
+
return t("common.header.select");
|
|
10075
|
+
}
|
|
9806
10076
|
if (!organizationTypeId.value) {
|
|
9807
10077
|
return t("common.header.link");
|
|
9808
10078
|
}
|
|
@@ -9860,6 +10130,29 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9860
10130
|
loadData();
|
|
9861
10131
|
}
|
|
9862
10132
|
);
|
|
10133
|
+
watch(
|
|
10134
|
+
() => props.navigation.displayFullSiteList,
|
|
10135
|
+
() => {
|
|
10136
|
+
if (!siteStatus.value) {
|
|
10137
|
+
organizationTypeId.value = organizationSiteId.value = null;
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
);
|
|
10141
|
+
watch(fullSiteListOnScreen, (onScreen) => {
|
|
10142
|
+
if (!onScreen && widgetContent.value) {
|
|
10143
|
+
fullSiteListScrollTop = widgetContent.value.scrollTop;
|
|
10144
|
+
}
|
|
10145
|
+
nextTick(() => {
|
|
10146
|
+
if (widgetContent.value) {
|
|
10147
|
+
widgetContent.value.scrollTop = onScreen ? fullSiteListScrollTop : 0;
|
|
10148
|
+
}
|
|
10149
|
+
});
|
|
10150
|
+
});
|
|
10151
|
+
watch(fullSiteListSearch, () => {
|
|
10152
|
+
if (widgetContent.value) {
|
|
10153
|
+
widgetContent.value.scrollTop = 0;
|
|
10154
|
+
}
|
|
10155
|
+
});
|
|
9863
10156
|
watch(infoMessage, (short) => {
|
|
9864
10157
|
if (infoNotification) {
|
|
9865
10158
|
notificationUpdater.updateMessages({ short });
|
|
@@ -9899,7 +10192,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9899
10192
|
onBack: () => {
|
|
9900
10193
|
rootEmit("back");
|
|
9901
10194
|
closeInfoNotification();
|
|
9902
|
-
|
|
10195
|
+
dropSite();
|
|
9903
10196
|
selectSite(siteRaw, false);
|
|
9904
10197
|
visible.value = true;
|
|
9905
10198
|
},
|
|
@@ -9943,6 +10236,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9943
10236
|
rootEmit("dom-updated");
|
|
9944
10237
|
});
|
|
9945
10238
|
});
|
|
10239
|
+
onBeforeUnmount(() => {
|
|
10240
|
+
dropSite();
|
|
10241
|
+
credential == null ? void 0 : credential.dispose();
|
|
10242
|
+
});
|
|
9946
10243
|
onUpdated(() => {
|
|
9947
10244
|
nextTick(() => {
|
|
9948
10245
|
rootEmit("dom-updated");
|
|
@@ -9976,7 +10273,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9976
10273
|
measureEvent("close");
|
|
9977
10274
|
visible.value = false;
|
|
9978
10275
|
if (siteStatus.value === "start" || siteStatus.value === "finish") {
|
|
9979
|
-
|
|
10276
|
+
dropSite();
|
|
9980
10277
|
}
|
|
9981
10278
|
rootEmit("closed");
|
|
9982
10279
|
}
|
|
@@ -10102,6 +10399,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10102
10399
|
});
|
|
10103
10400
|
}
|
|
10104
10401
|
});
|
|
10402
|
+
function dropSite() {
|
|
10403
|
+
site == null ? void 0 : site.dispose();
|
|
10404
|
+
siteStatus.value = site = null;
|
|
10405
|
+
}
|
|
10105
10406
|
function emitApiError(error2, errorTranslationCore) {
|
|
10106
10407
|
rootEmit("api-error", error2.response ? error2.response.status : 500, {
|
|
10107
10408
|
longMessage: t(`${errorTranslationCore}real.long_description`),
|
|
@@ -10261,6 +10562,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10261
10562
|
rootEmit("back");
|
|
10262
10563
|
}
|
|
10263
10564
|
organizationSiteId.value = null;
|
|
10565
|
+
if (props.navigation.displayFullSiteList) {
|
|
10566
|
+
organizationTypeId.value = null;
|
|
10567
|
+
return;
|
|
10568
|
+
}
|
|
10264
10569
|
if (filteredOrganizationSites.value.length === 1) {
|
|
10265
10570
|
organizationTypeBack(false);
|
|
10266
10571
|
}
|
|
@@ -10276,13 +10581,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10276
10581
|
}
|
|
10277
10582
|
function privacyPolicyAccepted() {
|
|
10278
10583
|
inPrivacyPolicy.value = false;
|
|
10279
|
-
if ((filteredCountries.value.length === 1 || props.navigation.hideSelectCountry) && filteredOrganizationTypes.value.length === 1) {
|
|
10584
|
+
if (!props.navigation.displayFullSiteList && (filteredCountries.value.length === 1 || props.navigation.hideSelectCountry) && filteredOrganizationTypes.value.length === 1) {
|
|
10280
10585
|
organizationTypeId.value = filteredOrganizationTypes.value[0].id_site_organization_type;
|
|
10281
10586
|
}
|
|
10282
10587
|
}
|
|
10283
10588
|
function resetSites() {
|
|
10284
10589
|
organizationTypeId.value = fromBackUpConnection.value = siteStatus.value = organizationSiteId.value = site = null;
|
|
10285
10590
|
}
|
|
10591
|
+
function selectFullSiteListOrganization(item) {
|
|
10592
|
+
countryId.value = item.id_country;
|
|
10593
|
+
organizationTypeId.value = item.id_site_organization_type;
|
|
10594
|
+
selectOrganizationSite(item);
|
|
10595
|
+
}
|
|
10286
10596
|
function selectOrganizationSite(item) {
|
|
10287
10597
|
rootEmit("organization-selected", item);
|
|
10288
10598
|
measureEvent("open_site_organization", {
|
|
@@ -10355,6 +10665,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10355
10665
|
});
|
|
10356
10666
|
}
|
|
10357
10667
|
if (!site || !site.loading) {
|
|
10668
|
+
site == null ? void 0 : site.dispose();
|
|
10358
10669
|
siteRaw = item;
|
|
10359
10670
|
thisSite = site = sync.siteConnection(item);
|
|
10360
10671
|
siteStatus.value = "start";
|
|
@@ -10447,7 +10758,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10447
10758
|
} else if (props.navigation.returnToSiteFormOnUserError !== false && (props.navigation.returnToSiteFormOnUserError === true && [401, 403, 411].includes(data.code) || props.navigation.returnToSiteFormOnUserError !== true && props.navigation.returnToSiteFormOnUserError.includes(
|
|
10448
10759
|
data.code
|
|
10449
10760
|
))) {
|
|
10450
|
-
|
|
10761
|
+
dropSite();
|
|
10451
10762
|
selectSite(siteRaw, false);
|
|
10452
10763
|
siteFormError.value = {
|
|
10453
10764
|
short: shortMessage,
|
|
@@ -10667,6 +10978,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10667
10978
|
}
|
|
10668
10979
|
openCredentialToast();
|
|
10669
10980
|
}
|
|
10981
|
+
credential == null ? void 0 : credential.dispose();
|
|
10670
10982
|
credential = sync.syncCredential(idCredential, update);
|
|
10671
10983
|
credential.on("error", () => {
|
|
10672
10984
|
const { code } = credential.error, messageCore = credential.error.response ? getApiErrorTranslationCore(credential.error) : `socket.message.${code ? code : 500}.`, shortMessage = t(`${messageCore}short_description`), longMessage = t(`${messageCore}long_description`);
|
|
@@ -11127,14 +11439,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11127
11439
|
if (dataError.value) {
|
|
11128
11440
|
return;
|
|
11129
11441
|
}
|
|
11130
|
-
let
|
|
11442
|
+
let country2;
|
|
11131
11443
|
if (props.entrypoint.country) {
|
|
11132
|
-
|
|
11133
|
-
return
|
|
11444
|
+
country2 = filteredCountries.value.find((country22) => {
|
|
11445
|
+
return country22.code === props.entrypoint.country || country22.id_country === props.entrypoint.country;
|
|
11134
11446
|
});
|
|
11135
11447
|
}
|
|
11136
11448
|
if (filteredCountries.value.length) {
|
|
11137
|
-
countryId.value =
|
|
11449
|
+
countryId.value = country2 ? country2.id_country : filteredCountries.value[0].id_country;
|
|
11138
11450
|
measureEvent("open_country", {
|
|
11139
11451
|
id_country: countryId.value
|
|
11140
11452
|
});
|
|
@@ -11145,7 +11457,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11145
11457
|
}
|
|
11146
11458
|
}
|
|
11147
11459
|
function setOrganizationTypeEntrypoint() {
|
|
11148
|
-
if (props.entrypoint.siteOrganizationType) {
|
|
11460
|
+
if (props.entrypoint.siteOrganizationType && !props.navigation.displayFullSiteList) {
|
|
11149
11461
|
const siteOrganizationType = filteredOrganizationTypes.value.find(
|
|
11150
11462
|
(organizationType) => {
|
|
11151
11463
|
return organizationType.id_site_organization_type === props.entrypoint.siteOrganizationType;
|
|
@@ -11264,7 +11576,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11264
11576
|
measureEvent("close_site", {
|
|
11265
11577
|
id_site: site.config.id_site
|
|
11266
11578
|
});
|
|
11267
|
-
|
|
11579
|
+
dropSite();
|
|
11268
11580
|
siteFormError.value = null;
|
|
11269
11581
|
if (filteredSites.value.length === 1) {
|
|
11270
11582
|
organizationSiteBack(false);
|
|
@@ -11295,7 +11607,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11295
11607
|
if (emit2) {
|
|
11296
11608
|
rootEmit("back");
|
|
11297
11609
|
}
|
|
11298
|
-
|
|
11610
|
+
dropSite();
|
|
11299
11611
|
selectSite(siteRaw, false);
|
|
11300
11612
|
}
|
|
11301
11613
|
function updateCredential2(idCredential, emitLoaded = false) {
|
|
@@ -11339,7 +11651,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11339
11651
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
11340
11652
|
createVNode(TheModal, {
|
|
11341
11653
|
visible: visible.value,
|
|
11342
|
-
"onUpdate:visible": _cache[
|
|
11654
|
+
"onUpdate:visible": _cache[6] || (_cache[6] = ($event) => visible.value = $event),
|
|
11343
11655
|
mobile: unref(mobile)
|
|
11344
11656
|
}, {
|
|
11345
11657
|
default: withCtx(() => [
|
|
@@ -11366,7 +11678,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11366
11678
|
class: normalizeClass(_ctx.$style["widget-back-button"]),
|
|
11367
11679
|
onClick: headerBack
|
|
11368
11680
|
}, [
|
|
11369
|
-
createVNode(_sfc_main$
|
|
11681
|
+
createVNode(_sfc_main$j, { icon: "back" })
|
|
11370
11682
|
], 10, _hoisted_1)) : (openBlock(), createElementBlock("span", _hoisted_2)),
|
|
11371
11683
|
createElementVNode("h1", null, toDisplayString(siteStatus.value && props.entrypoint.site ? unref(t)("common.update_title") : title.value), 1),
|
|
11372
11684
|
createElementVNode("button", {
|
|
@@ -11374,10 +11686,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11374
11686
|
"aria-label": unref(t)("common.close"),
|
|
11375
11687
|
onClick: close
|
|
11376
11688
|
}, [
|
|
11377
|
-
createVNode(_sfc_main$
|
|
11689
|
+
createVNode(_sfc_main$j, { icon: "close" })
|
|
11378
11690
|
], 10, _hoisted_3)
|
|
11379
11691
|
], 2),
|
|
11380
11692
|
createElementVNode("div", {
|
|
11693
|
+
ref_key: "widgetContent",
|
|
11694
|
+
ref: widgetContent,
|
|
11381
11695
|
class: normalizeClass(_ctx.$style["widget-content"])
|
|
11382
11696
|
}, [
|
|
11383
11697
|
credentialFlow.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -11456,19 +11770,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11456
11770
|
loading.value ? (openBlock(), createBlock(AppLoader, { key: 0 })) : createCommentVNode("", true),
|
|
11457
11771
|
!loading.value && !dataError.value && !noFilteredData.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
11458
11772
|
!siteStatus.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
11459
|
-
|
|
11773
|
+
props.navigation.displayFullSiteList && !organizationSiteId.value ? (openBlock(), createBlock(FullSiteList, {
|
|
11460
11774
|
key: 0,
|
|
11775
|
+
search: fullSiteListSearch.value,
|
|
11776
|
+
"onUpdate:search": _cache[1] || (_cache[1] = ($event) => fullSiteListSearch.value = $event),
|
|
11777
|
+
"assets-path": unref(assetsPath),
|
|
11778
|
+
catalog: fullSiteCatalog.value,
|
|
11779
|
+
"show-logo": props.navigation.displayLogoImages,
|
|
11780
|
+
onSelect: selectFullSiteListOrganization
|
|
11781
|
+
}, null, 8, ["search", "assets-path", "catalog", "show-logo"])) : createCommentVNode("", true),
|
|
11782
|
+
!props.navigation.displayFullSiteList && countryId.value && !organizationTypeId.value ? (openBlock(), createBlock(InstitutionFilters, {
|
|
11783
|
+
key: 1,
|
|
11461
11784
|
"country-id": countryId.value,
|
|
11462
|
-
"onUpdate:countryId": _cache[
|
|
11785
|
+
"onUpdate:countryId": _cache[2] || (_cache[2] = ($event) => countryId.value = $event),
|
|
11463
11786
|
"organization-type-id": organizationTypeId.value,
|
|
11464
|
-
"onUpdate:organizationTypeId": _cache[
|
|
11787
|
+
"onUpdate:organizationTypeId": _cache[3] || (_cache[3] = ($event) => organizationTypeId.value = $event),
|
|
11465
11788
|
"filtered-countries": filteredCountries.value,
|
|
11466
11789
|
"filtered-organization-types": filteredOrganizationTypes.value,
|
|
11467
11790
|
"select-class": props.navigation.selectClass,
|
|
11468
11791
|
"show-countries": !props.navigation.hideSelectCountry
|
|
11469
11792
|
}, null, 8, ["country-id", "organization-type-id", "filtered-countries", "filtered-organization-types", "select-class", "show-countries"])) : createCommentVNode("", true),
|
|
11470
11793
|
countryId.value && organizationTypeId.value && !organizationSiteId.value ? (openBlock(), createBlock(OrganizationSitesList, {
|
|
11471
|
-
key:
|
|
11794
|
+
key: 2,
|
|
11472
11795
|
"assets-path": unref(assetsPath),
|
|
11473
11796
|
items: filteredOrganizationSites.value,
|
|
11474
11797
|
"show-logo": props.navigation.displayLogoImages,
|
|
@@ -11476,7 +11799,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11476
11799
|
onSelect: selectOrganizationSite
|
|
11477
11800
|
}, null, 8, ["assets-path", "items", "show-logo", "show-plaid-sites-button"])) : createCommentVNode("", true),
|
|
11478
11801
|
countryId.value && organizationTypeId.value && organizationSiteId.value ? (openBlock(), createBlock(SitesList, {
|
|
11479
|
-
key:
|
|
11802
|
+
key: 3,
|
|
11480
11803
|
"assets-path": unref(assetsPath),
|
|
11481
11804
|
items: filteredSites.value,
|
|
11482
11805
|
organization: filteredOrganizationSites.value.find(
|
|
@@ -11507,7 +11830,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11507
11830
|
onConsentRejected: consentRejected,
|
|
11508
11831
|
onError: connectError,
|
|
11509
11832
|
onSuccess: siteSucess,
|
|
11510
|
-
onValid: _cache[
|
|
11833
|
+
onValid: _cache[4] || (_cache[4] = () => siteSubmitted(true))
|
|
11511
11834
|
}, null, 8, ["assets-path", "button-disabled-style", "consent", "consent-loading", "disable-form-autocomplete", "display-back-button", "error-message", "loader-message", "require-consent", "select-class", "show-logo", "show-password-style", "site", "test-mode"])) : siteStatus.value === "start" || siteStatus.value === "loading" ? (openBlock(), createBlock(SiteForm, {
|
|
11512
11835
|
key: 1,
|
|
11513
11836
|
"assets-path": unref(assetsPath),
|
|
@@ -11567,7 +11890,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11567
11890
|
"show-logo": props.navigation.displayLogoImages,
|
|
11568
11891
|
type: unref(site).finalResponse,
|
|
11569
11892
|
onAddOther: resetSites,
|
|
11570
|
-
onSelectAccounts: _cache[
|
|
11893
|
+
onSelectAccounts: _cache[5] || (_cache[5] = () => {
|
|
11571
11894
|
selectingAccounts.value = true;
|
|
11572
11895
|
})
|
|
11573
11896
|
}, null, 8, ["avatar", "display-accounts-selection", "display-add-another-button", "long-message", "message", "show-logo", "type"]))
|
|
@@ -11578,7 +11901,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11578
11901
|
key: 2,
|
|
11579
11902
|
class: normalizeClass(_ctx.$style["widget-data-error"])
|
|
11580
11903
|
}, [
|
|
11581
|
-
createVNode(_sfc_main$
|
|
11904
|
+
createVNode(_sfc_main$j, { icon: "x-circle" }),
|
|
11582
11905
|
createElementVNode("h2", null, toDisplayString(unref(t)(`${dataError.value}short_description`)), 1),
|
|
11583
11906
|
createElementVNode("p", null, toDisplayString(unref(t)(`${dataError.value}long_description`)), 1),
|
|
11584
11907
|
createElementVNode("button", {
|
|
@@ -11590,7 +11913,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
11590
11913
|
key: 3,
|
|
11591
11914
|
class: normalizeClass(_ctx.$style["widget-data-error"])
|
|
11592
11915
|
}, [
|
|
11593
|
-
createVNode(_sfc_main$
|
|
11916
|
+
createVNode(_sfc_main$j, { icon: "x-circle" }),
|
|
11594
11917
|
createElementVNode("p", null, toDisplayString(unref(t)("common.no_filtered_data")), 1),
|
|
11595
11918
|
createElementVNode("button", {
|
|
11596
11919
|
class: "pb-w-sync_primary-button",
|
|
@@ -11647,6 +11970,7 @@ const defaultConfig = {
|
|
|
11647
11970
|
displayBusinessSites: true,
|
|
11648
11971
|
displayCredentialInModal: false,
|
|
11649
11972
|
displayErrorsInToast: true,
|
|
11973
|
+
displayFullSiteList: false,
|
|
11650
11974
|
displayLogoImages: true,
|
|
11651
11975
|
displayLongDescription: false,
|
|
11652
11976
|
displayPersonalSites: true,
|
|
@@ -11694,6 +12018,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11694
12018
|
token: {}
|
|
11695
12019
|
},
|
|
11696
12020
|
setup(__props, { expose: __expose }) {
|
|
12021
|
+
var _a;
|
|
11697
12022
|
const props = __props;
|
|
11698
12023
|
const widgetComponent = ref(null);
|
|
11699
12024
|
const { t } = useI18n();
|
|
@@ -11718,6 +12043,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11718
12043
|
...removeUndefineds(props.config.navigation)
|
|
11719
12044
|
},
|
|
11720
12045
|
refreshTokenFunction: props.refreshTokenFunction,
|
|
12046
|
+
requestedCountry: (_a = props.config.entrypoint) == null ? void 0 : _a.country,
|
|
11721
12047
|
strict: props.strict,
|
|
11722
12048
|
token: props.token,
|
|
11723
12049
|
onTokenRefreshed: (newToken) => {
|
|
@@ -11736,6 +12062,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11736
12062
|
});
|
|
11737
12063
|
}
|
|
11738
12064
|
function setConfig(config = {}) {
|
|
12065
|
+
var _a2;
|
|
11739
12066
|
try {
|
|
11740
12067
|
configValidator.validateSync(config);
|
|
11741
12068
|
} catch (error2) {
|
|
@@ -11751,6 +12078,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11751
12078
|
...defaultConfig.entrypoint,
|
|
11752
12079
|
...removeUndefineds(config.entrypoint)
|
|
11753
12080
|
};
|
|
12081
|
+
childProperties.requestedCountry = (_a2 = config.entrypoint) == null ? void 0 : _a2.country;
|
|
11754
12082
|
childProperties.internal = {
|
|
11755
12083
|
...defaultConfig.__internal__,
|
|
11756
12084
|
...removeUndefineds(config.__internal__)
|
|
@@ -11775,6 +12103,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11775
12103
|
return widgetComponent.value.setToken(token, strict);
|
|
11776
12104
|
}
|
|
11777
12105
|
function upsertConfig(config = {}) {
|
|
12106
|
+
var _a2;
|
|
11778
12107
|
try {
|
|
11779
12108
|
configValidator.validateSync(config);
|
|
11780
12109
|
} catch (error2) {
|
|
@@ -11790,6 +12119,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11790
12119
|
...childProperties.entrypoint,
|
|
11791
12120
|
...removeUndefineds(config.entrypoint)
|
|
11792
12121
|
};
|
|
12122
|
+
childProperties.requestedCountry = ((_a2 = config.entrypoint) == null ? void 0 : _a2.country) ?? childProperties.requestedCountry;
|
|
11793
12123
|
childProperties.internal = {
|
|
11794
12124
|
...childProperties.internal,
|
|
11795
12125
|
...removeUndefineds(config.__internal__)
|
|
@@ -12014,6 +12344,7 @@ const staticMethods = {
|
|
|
12014
12344
|
updateCredential
|
|
12015
12345
|
};
|
|
12016
12346
|
initFirebase();
|
|
12347
|
+
const mountedApps = /* @__PURE__ */ new WeakMap();
|
|
12017
12348
|
class SyncfyWidget {
|
|
12018
12349
|
/**
|
|
12019
12350
|
*
|
|
@@ -12048,6 +12379,7 @@ class SyncfyWidget {
|
|
|
12048
12379
|
* @param {Boolean} params.config.navigation.displayBusinessSites
|
|
12049
12380
|
* @param {Boolean} params.config.navigation.displayCredentialInModal
|
|
12050
12381
|
* @param {Boolean} params.config.navigation.displayErrorsInToast
|
|
12382
|
+
* @param {Boolean} params.config.navigation.displayFullSiteList Lists every site by country and category instead of asking for filters.
|
|
12051
12383
|
* @param {Boolean} params.config.navigation.displayLogoImages Indicates if widget should show organizations logo.
|
|
12052
12384
|
* @param {Boolean} params.config.navigation.displayLongDescription
|
|
12053
12385
|
* @param {Boolean} params.config.navigation.displayPersonalSites
|
|
@@ -12085,6 +12417,7 @@ class SyncfyWidget {
|
|
|
12085
12417
|
*
|
|
12086
12418
|
*/
|
|
12087
12419
|
constructor(params) {
|
|
12420
|
+
var _a;
|
|
12088
12421
|
const rollbar = new Rollbar({
|
|
12089
12422
|
accessToken: "2d928ea9aa674c6ea84dbf6f3901a403",
|
|
12090
12423
|
captureUncaught: false,
|
|
@@ -12145,7 +12478,13 @@ class SyncfyWidget {
|
|
|
12145
12478
|
});
|
|
12146
12479
|
}
|
|
12147
12480
|
app.provide(rootEmitter, emitter);
|
|
12148
|
-
const
|
|
12481
|
+
const element = _params.element || "#widget";
|
|
12482
|
+
const container2 = typeof element === "string" ? document.querySelector(element) : element;
|
|
12483
|
+
if (container2) {
|
|
12484
|
+
(_a = mountedApps.get(container2)) == null ? void 0 : _a.unmount();
|
|
12485
|
+
mountedApps.set(container2, app);
|
|
12486
|
+
}
|
|
12487
|
+
const rootComponent = app.mount(element);
|
|
12149
12488
|
return {
|
|
12150
12489
|
on,
|
|
12151
12490
|
close: rootComponent.close,
|