@wix/members 1.0.542 → 1.0.544

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/build/cjs/context-account-details.d.ts +9 -6
  2. package/build/cjs/context-account-details.js +94 -89
  3. package/build/cjs/context-account-details.js.map +1 -1
  4. package/build/cjs/context-addresses.js +2 -2
  5. package/build/cjs/context-addresses.js.map +1 -1
  6. package/build/es/context-account-details.d.mts +9 -6
  7. package/build/es/context-account-details.mjs +94 -89
  8. package/build/es/context-account-details.mjs.map +1 -1
  9. package/build/es/context-addresses.mjs +2 -2
  10. package/build/es/context-addresses.mjs.map +1 -1
  11. package/build/internal/cjs/context-account-details.d.ts +9 -6
  12. package/build/internal/es/context-account-details.d.mts +9 -6
  13. package/context-runtime/context-account-details/runtime.d.ts +9 -6
  14. package/context-runtime/context-account-details/runtime.js +3 -3
  15. package/context-runtime/context-addresses/runtime.js +3 -3
  16. package/package.json +2 -14
  17. package/account-home-context-provider/package.json +0 -3
  18. package/build/cjs/context-account-home.d.ts +0 -54
  19. package/build/cjs/context-account-home.js +0 -719
  20. package/build/cjs/context-account-home.js.map +0 -1
  21. package/build/es/context-account-home.d.mts +0 -54
  22. package/build/es/context-account-home.mjs +0 -690
  23. package/build/es/context-account-home.mjs.map +0 -1
  24. package/build/internal/cjs/context-account-home.d.ts +0 -54
  25. package/build/internal/es/context-account-home.d.mts +0 -54
  26. package/context/account-home/package.json +0 -3
  27. package/context-runtime/context-account-home/runtime.d.ts +0 -54
  28. package/context-runtime/context-account-home/runtime.js +0 -2
@@ -113,9 +113,9 @@ interface NamedFieldBinding {
113
113
  //#endregion
114
114
  //#region src/extensions/account-settings/context-providers/account-named-fields.d.ts
115
115
  /**
116
- * The platform's own field vocabulary, named as the Members SDK names each value. A `SYSTEM` or
117
- * `CONTACT` field exists on every site, so each one is addressable by name. Site-specific fields are
118
- * excluded from Phase 0. The contact email is absent on purpose: the API refuses a write to it.
116
+ * The platform's own field vocabulary, each named as the site names it. A `SYSTEM` or `CONTACT` field
117
+ * exists on every site, so each one is addressable by name. Site-specific fields are excluded from
118
+ * Phase 0. The contact email is absent on purpose: the API refuses a write to it.
119
119
  */
120
120
  declare const NAMED_FIELD_KEYS: {
121
121
  readonly firstName: "customfields.system.firstname";
@@ -124,12 +124,15 @@ declare const NAMED_FIELD_KEYS: {
124
124
  readonly title: "customfields.system.title";
125
125
  readonly birthdate: "customfields.contact.birthdate";
126
126
  readonly company: "customfields.contact.company";
127
- readonly jobTitle: "customfields.contact.position";
127
+ readonly position: "customfields.contact.position";
128
128
  };
129
129
  type NamedFieldName = keyof typeof NAMED_FIELD_KEYS;
130
- type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null>;
130
+ type NamedValidationErrors = Record<NamedFieldName, MemberFieldValidationError | null> & {
131
+ /** @internal `position`'s, under the name pages saved before it still bind. */jobTitle: MemberFieldValidationError | null;
132
+ };
131
133
  type NamedAccountFields = Record<NamedFieldName, NamedFieldBinding> & {
132
- /** Every named field's fault, grouped so the binding picker lists them under one heading. */validationErrors: NamedValidationErrors;
134
+ /** @internal `position`, under the name pages saved before it still bind. */jobTitle: NamedFieldBinding; /** Every named field's fault, grouped so the binding picker lists them under one heading. */
135
+ validationErrors: NamedValidationErrors;
133
136
  };
134
137
  //#endregion
135
138
  //#region src/extensions/account-settings/login-info/credential-restriction.d.ts
@@ -30,15 +30,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // context-account-details.ts
31
31
  var context_account_details_exports = {};
32
32
  __export(context_account_details_exports, {
33
- AccountDetailsContextProvider: () => Lx,
33
+ AccountDetailsContextProvider: () => Rx,
34
34
  AccountSettingsContext: () => a_,
35
- CREDENTIAL_DIALOG: () => ax,
35
+ CREDENTIAL_DIALOG: () => ox,
36
36
  CREDENTIAL_ERROR: () => Q,
37
37
  FIELD_KIND: () => r_,
38
38
  NAMED_FIELD_KEYS: () => Ub,
39
39
  SECTION_KIND: () => n_,
40
- default: () => Lx,
41
- injectAccessTokenGetter: () => Rx,
40
+ default: () => Rx,
41
+ injectAccessTokenGetter: () => zx,
42
42
  useAccountSettings: () => o_
43
43
  });
44
44
  module.exports = __toCommonJS(context_account_details_exports);
@@ -3334,7 +3334,7 @@ var no = (e11) => {
3334
3334
  }
3335
3335
  return n2;
3336
3336
  };
3337
- var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
3337
+ var ro = [...`--wst-button-primary-background-color.--wst-button-primary-background-image.--wst-button-primary-padding-top.--wst-button-primary-border-top-color.--wst-button-primary-border-top-width.--wst-button-primary-border-top-style.--wst-button-primary-padding-right.--wst-button-primary-border-right-color.--wst-button-primary-border-right-width.--wst-button-primary-border-right-style.--wst-button-primary-padding-bottom.--wst-button-primary-border-bottom-color.--wst-button-primary-border-bottom-width.--wst-button-primary-border-bottom-style.--wst-button-primary-padding-left.--wst-button-primary-border-left-color.--wst-button-primary-border-left-width.--wst-button-primary-border-left-style.--wst-button-primary-border-top-left-radius.--wst-button-primary-border-top-right-radius.--wst-button-primary-border-bottom-right-radius.--wst-button-primary-border-bottom-left-radius.--wst-button-primary-box-shadow.--wst-button-primary-column-gap.--wst-button-primary-row-gap.--wst-button-primary-letter-spacing.--wst-button-primary-text-decoration.--wst-button-primary-text-transform.--wst-button-primary-text-shadow.--wst-button-secondary-background-color.--wst-button-secondary-background-image.--wst-button-secondary-padding-top.--wst-button-secondary-border-top-color.--wst-button-secondary-border-top-width.--wst-button-secondary-border-top-style.--wst-button-secondary-padding-right.--wst-button-secondary-border-right-color.--wst-button-secondary-border-right-width.--wst-button-secondary-border-right-style.--wst-button-secondary-padding-bottom.--wst-button-secondary-border-bottom-color.--wst-button-secondary-border-bottom-width.--wst-button-secondary-border-bottom-style.--wst-button-secondary-padding-left.--wst-button-secondary-border-left-color.--wst-button-secondary-border-left-width.--wst-button-secondary-border-left-style.--wst-button-secondary-border-top-left-radius.--wst-button-secondary-border-top-right-radius.--wst-button-secondary-border-bottom-right-radius.--wst-button-secondary-border-bottom-left-radius.--wst-button-secondary-box-shadow.--wst-button-secondary-column-gap.--wst-button-secondary-row-gap.--wst-button-secondary-letter-spacing.--wst-button-secondary-text-decoration.--wst-button-secondary-text-transform.--wst-button-secondary-text-shadow`.split(`.`), `--wst-graphics-1-color`, `--wst-system-line-1-color`, `--wst-system-line-1-width`, `--wst-system-disabled-color`, `--wst-primary-background-color`, `--wst-secondary-background-color`, `--wst-shade-2-color`, `--wst-shade-3-color`, `--wst-paragraph-1-color`, `--wst-paragraph-1-font`, `--wst-paragraph-2-color`, `--wst-paragraph-2-font`, `--wst-paragraph-2-letter-spacing`, `--wst-paragraph-2-text-decoration`, `--wst-paragraph-3-color`, `--wst-paragraph-3-font`, `--wst-paragraph-3-letter-spacing`, `--wst-paragraph-3-text-decoration`, `--wst-heading-2-font`, `--wst-heading-2-letter-spacing`, `--wst-heading-2-text-decoration`, `--wst-heading-5-color`, `--wst-heading-5-font`, `--wst-heading-6-color`, `--wst-heading-6-font`, `--wst-button-primary-color`, `--wst-button-primary-font`, `--wst-button-secondary-color`, `--wst-button-secondary-font`, `--wst-button-tertiary-color`, `--wst-button-tertiary-font`, `--wst-button-tertiary-letter-spacing`, `--wst-button-tertiary-text-decoration`, `--wst-links-and-actions-color`, `--wst-system-alert-color`, `--wst-system-error-color`, `--wst-system-success-color`, `--wst-system-default-light-color`, `--wst-system-default-dark-color`];
3338
3338
  var io = `--builder-base`;
3339
3339
  var ao = (e11) => {
3340
3340
  let [, t2] = (0, import_react.useState)(false);
@@ -9187,13 +9187,17 @@ var Bb = (e11) => {
9187
9187
  };
9188
9188
  var Vb = (e11) => ({ name: e11.label, value: e11.value });
9189
9189
  var Hb = (e11, t2) => t2.validity[e11.id] ?? null;
9190
- var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`, jobTitle: `customfields.contact.position` };
9191
- var Wb = new Set(Object.values(Ub));
9192
- var Gb = Object.keys(Ub);
9193
- var Kb = (e11) => Object.fromEntries(Gb.map((t2) => [t2, e11(t2)]));
9194
- var qb = { ...Kb(() => ({ name: void 0, value: `` })), validationErrors: Kb(() => null) };
9195
- var Jb = { name: null, value: `` };
9196
- var Yb = (e11) => {
9190
+ var Ub = { firstName: `customfields.system.firstname`, lastName: `customfields.system.lastname`, phone: `customfields.system.phone`, title: `customfields.system.title`, birthdate: `customfields.contact.birthdate`, company: `customfields.contact.company`, position: `customfields.contact.position` };
9191
+ var Wb = { jobTitle: `position` };
9192
+ var Gb = new Set(Object.values(Ub));
9193
+ var Kb = Object.keys(Ub);
9194
+ var qb = (e11) => {
9195
+ let t2 = Object.fromEntries(Kb.map((t3) => [t3, e11(t3)]));
9196
+ return { ...t2, ...Object.fromEntries(Object.entries(Wb).map(([e12, n2]) => [e12, t2[n2]])) };
9197
+ };
9198
+ var Jb = { ...qb(() => ({ name: void 0, value: `` })), validationErrors: qb(() => null) };
9199
+ var Yb = { name: null, value: `` };
9200
+ var Xb = (e11) => {
9197
9201
  let t2 = /* @__PURE__ */ new Map();
9198
9202
  return e11.forEach((e12) => {
9199
9203
  e12.fields.forEach((e13) => {
@@ -9201,130 +9205,131 @@ var Yb = (e11) => {
9201
9205
  });
9202
9206
  }), t2;
9203
9207
  };
9204
- var Xb = (e11, t2) => {
9205
- let n2 = Yb(e11), r2 = (e12) => n2.get(Ub[e12]);
9206
- return { ...Kb((e12) => {
9208
+ var Zb = (e11, t2) => {
9209
+ let n2 = Xb(e11), r2 = (e12) => n2.get(Ub[e12]);
9210
+ return { ...qb((e12) => {
9207
9211
  let t3 = r2(e12);
9208
- return t3 ? Vb(t3) : Jb;
9209
- }), validationErrors: Kb((e12) => {
9212
+ return t3 ? Vb(t3) : Yb;
9213
+ }), validationErrors: qb((e12) => {
9210
9214
  let n3 = r2(e12);
9211
9215
  return n3 ? Hb(n3, t2) : null;
9212
9216
  }) };
9213
9217
  };
9214
- var Zb = (e11, t2) => {
9215
- if (!Object.hasOwn(Ub, t2)) return null;
9216
- let n2 = Yb(e11).get(Ub[t2]);
9217
- return n2 && !n2.isReadOnly ? n2.id : null;
9218
- };
9219
- var Qb = t_;
9220
- var $b = /^\d{4}-\d{2}-\d{2}$/;
9221
- var ex = (e11) => {
9222
- if (!$b.test(e11)) return false;
9218
+ var Qb = (e11, t2) => {
9219
+ let n2 = Object.hasOwn(Wb, t2) ? Wb[t2] : t2;
9220
+ if (!Object.hasOwn(Ub, n2)) return null;
9221
+ let r2 = Xb(e11).get(Ub[n2]);
9222
+ return r2 && !r2.isReadOnly ? r2.id : null;
9223
+ };
9224
+ var $b = t_;
9225
+ var ex = /^\d{4}-\d{2}-\d{2}$/;
9226
+ var tx = (e11) => {
9227
+ if (!ex.test(e11)) return false;
9223
9228
  let [t2, n2, r2] = e11.split(`-`).map(Number), i2 = new Date(Date.UTC(t2, n2 - 1, r2));
9224
9229
  return i2.getUTCFullYear() === t2 && i2.getUTCMonth() === n2 - 1 && i2.getUTCDate() === r2;
9225
9230
  };
9226
- var tx = (e11) => {
9231
+ var nx = (e11) => {
9227
9232
  try {
9228
9233
  return new URL(e11.includes(`://`) ? e11 : `https://${e11}`).hostname.includes(`.`);
9229
9234
  } catch {
9230
9235
  return false;
9231
9236
  }
9232
9237
  };
9233
- var nx = (e11) => {
9238
+ var rx = (e11) => {
9234
9239
  let t2 = e11.value.trim();
9235
- if (!t2) return e11.isRequired ? Qb.REQUIRED : null;
9236
- if (e11.key === Ub.phone) return Bb(t2) ? null : Qb.PHONE;
9240
+ if (!t2) return e11.isRequired ? $b.REQUIRED : null;
9241
+ if (e11.key === Ub.phone) return Bb(t2) ? null : $b.PHONE;
9237
9242
  switch (e11.kind) {
9238
9243
  case r_.NUMBER:
9239
- return Number.isFinite(Number(t2)) ? null : Qb.NUMBER;
9244
+ return Number.isFinite(Number(t2)) ? null : $b.NUMBER;
9240
9245
  case r_.DATE:
9241
- return ex(t2) ? null : Qb.DATE;
9246
+ return tx(t2) ? null : $b.DATE;
9242
9247
  case r_.URL:
9243
9248
  case r_.SOCIAL:
9244
- return tx(t2) ? null : Qb.URL;
9249
+ return nx(t2) ? null : $b.URL;
9245
9250
  case r_.CHOICE:
9246
- return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null : Qb.CHOICE;
9251
+ return !e11.options?.length || e11.options.some((e12) => e12.value === t2) ? null : $b.CHOICE;
9247
9252
  default:
9248
9253
  return null;
9249
9254
  }
9250
9255
  };
9251
- var rx = (e11) => {
9256
+ var ix = (e11) => {
9252
9257
  let t2 = {};
9253
9258
  return e11.forEach((e12) => {
9254
9259
  e12.fields.forEach((e13) => {
9255
9260
  if (e13.isReadOnly) return;
9256
- let n2 = nx(e13);
9261
+ let n2 = rx(e13);
9257
9262
  n2 && (t2[e13.id] = n2);
9258
9263
  });
9259
9264
  }), t2;
9260
9265
  };
9261
- var ix = (e11) => e11.flatMap((e12) => e12.fields.filter((e13) => !e13.isReadOnly && nx(e13) !== null).map((e13) => e13.id));
9262
- var ax = { LOGIN_EMAIL: `LOGIN_EMAIL`, PASSWORD: `PASSWORD` };
9263
- function ox(e11) {
9266
+ var ax = (e11) => e11.flatMap((e12) => e12.fields.filter((e13) => !e13.isReadOnly && rx(e13) !== null).map((e13) => e13.id));
9267
+ var ox = { LOGIN_EMAIL: `LOGIN_EMAIL`, PASSWORD: `PASSWORD` };
9268
+ function sx(e11) {
9264
9269
  return e11;
9265
9270
  }
9266
- var sx = ox(`@wix/site-service-business-logger`);
9267
- function cx() {
9268
- let { reportBi: e11 } = (0, import_services_manager_react.useService)(sx);
9271
+ var cx = sx(`@wix/site-service-business-logger`);
9272
+ function lx() {
9273
+ let { reportBi: e11 } = (0, import_services_manager_react.useService)(cx);
9269
9274
  return (0, import_react.useCallback)(({ src: t2, evid: n2, endpoint: r2, params: i2 }) => e11({ src: t2, evid: n2, ...i2 }, { endpoint: r2 }), [e11]);
9270
9275
  }
9271
- function lx(e11) {
9276
+ function ux(e11) {
9272
9277
  return { evid: 815, src: 69, endpoint: `members-app-uou`, params: e11 };
9273
9278
  }
9274
- function ux(e11) {
9279
+ function dx(e11) {
9275
9280
  return { evid: 5001, src: 5, endpoint: ``, params: e11 };
9276
9281
  }
9277
- function dx(e11) {
9282
+ function fx(e11) {
9278
9283
  return { evid: 5002, src: 5, endpoint: ``, params: e11 };
9279
9284
  }
9280
- function fx(e11) {
9285
+ function px(e11) {
9281
9286
  return { evid: 5003, src: 5, endpoint: ``, params: e11 };
9282
9287
  }
9283
- function px(e11) {
9288
+ function mx(e11) {
9284
9289
  return { evid: 5005, src: 5, endpoint: ``, params: e11 };
9285
9290
  }
9286
- function mx(e11) {
9291
+ function hx(e11) {
9287
9292
  return { evid: 5006, src: 5, endpoint: ``, params: e11 };
9288
9293
  }
9289
- function hx(e11) {
9294
+ function gx(e11) {
9290
9295
  return { evid: 5007, src: 5, endpoint: ``, params: e11 };
9291
9296
  }
9292
- function gx(e11) {
9297
+ function _x(e11) {
9293
9298
  return { evid: 5008, src: 5, endpoint: ``, params: e11 };
9294
9299
  }
9295
- var _x = { EXIT: `exit`, CANCEL: `cancel`, RESET_OR_CREATE_PASSWORD: `reset_or_create_password` };
9296
- var vx = `my_account`;
9297
- var yx = ({ role: e11, isProfilePublic: t2 }) => ({ ...e11 ? { role: e11 } : {}, is_social: t2 });
9298
- var bx = (e11, t2) => e11 ? `${e11}, ${t2}` : t2;
9299
- var xx = (e11) => e11.reduce((e12, t2) => t2.key === Ub.title ? { ...e12, titleChanged: true } : t2.origin === `SYSTEM` ? { ...e12, systemFieldsChanged: bx(e12.systemFieldsChanged, t2.label) } : t2.origin === `CONTACT` ? { ...e12, contactsFieldsChanges: bx(e12.contactsFieldsChanges, t2.label) } : e12, {});
9300
- var Sx = (e11, t2) => lx({ ...yx(e11), saveOrigin: vx, componentType: `builder`, privacyChanged: false, urlChanged: false, ...xx(t2) });
9301
- var Cx = () => ux({});
9300
+ var vx = { EXIT: `exit`, CANCEL: `cancel`, RESET_OR_CREATE_PASSWORD: `reset_or_create_password` };
9301
+ var yx = `my_account`;
9302
+ var bx = ({ role: e11, isProfilePublic: t2 }) => ({ ...e11 ? { role: e11 } : {}, is_social: t2 });
9303
+ var xx = (e11, t2) => e11 ? `${e11}, ${t2}` : t2;
9304
+ var Sx = (e11) => e11.reduce((e12, t2) => t2.key === Ub.title ? { ...e12, titleChanged: true } : t2.origin === `SYSTEM` ? { ...e12, systemFieldsChanged: xx(e12.systemFieldsChanged, t2.label) } : t2.origin === `CONTACT` ? { ...e12, contactsFieldsChanges: xx(e12.contactsFieldsChanges, t2.label) } : e12, {});
9305
+ var Cx = (e11, t2) => ux({ ...bx(e11), saveOrigin: yx, componentType: `builder`, privacyChanged: false, urlChanged: false, ...Sx(t2) });
9302
9306
  var wx = () => dx({});
9303
9307
  var Tx = () => fx({});
9304
- var Ex = () => mx({});
9305
- var Dx = (e11) => hx({ button_click: e11 });
9306
- var Ox = (e11, t2) => px({ is_success: e11, failure_reason: t2 });
9307
- var kx = (e11, t2) => gx({ is_success: e11, failure_reason: t2 });
9308
- var Ax = { NONE: `NONE`, SITE_OWNER: `SITE_OWNER`, SITE_COLLABORATOR: `SITE_COLLABORATOR` };
9309
- var jx = (e11) => e11?.owner === true || e11?.role === `OWNER` ? Ax.SITE_OWNER : e11?.role === `CONTRIBUTOR` ? Ax.SITE_COLLABORATOR : Ax.NONE;
9310
- var Mx = { memberId: ``, rawMember: {}, loginEmail: ``, credentialRestriction: Ax.NONE, definitions: [], fieldSections: [], fieldOrigins: {}, biMember: { role: ``, isProfilePublic: false } };
9311
- var Nx = { [ax.LOGIN_EMAIL]: () => [Cx(), Tx()], [ax.PASSWORD]: () => [wx(), Ex()] };
9312
- var Px = (e11, t2) => ({ ...e11, rawMember: t2, loginEmail: t2.loginEmail || e11.loginEmail, fieldSections: m_({ member: t2, definitions: e11.definitions }), biMember: { ...e11.biMember, isProfilePublic: t2.privacyStatus === `PUBLIC` } });
9313
- var Fx = async (e11, t2) => {
9308
+ var Ex = () => px({});
9309
+ var Dx = () => hx({});
9310
+ var Ox = (e11) => gx({ button_click: e11 });
9311
+ var kx = (e11, t2) => mx({ is_success: e11, failure_reason: t2 });
9312
+ var Ax = (e11, t2) => _x({ is_success: e11, failure_reason: t2 });
9313
+ var jx = { NONE: `NONE`, SITE_OWNER: `SITE_OWNER`, SITE_COLLABORATOR: `SITE_COLLABORATOR` };
9314
+ var Mx = (e11) => e11?.owner === true || e11?.role === `OWNER` ? jx.SITE_OWNER : e11?.role === `CONTRIBUTOR` ? jx.SITE_COLLABORATOR : jx.NONE;
9315
+ var Nx = { memberId: ``, rawMember: {}, loginEmail: ``, credentialRestriction: jx.NONE, definitions: [], fieldSections: [], fieldOrigins: {}, biMember: { role: ``, isProfilePublic: false } };
9316
+ var Px = { [ox.LOGIN_EMAIL]: () => [wx(), Ex()], [ox.PASSWORD]: () => [Tx(), Dx()] };
9317
+ var Fx = (e11, t2) => ({ ...e11, rawMember: t2, loginEmail: t2.loginEmail || e11.loginEmail, fieldSections: m_({ member: t2, definitions: e11.definitions }), biMember: { ...e11.biMember, isProfilePublic: t2.privacyStatus === `PUBLIC` } });
9318
+ var Ix = async (e11, t2) => {
9314
9319
  try {
9315
9320
  let n2 = await t2.getMemberDetails?.(), r2 = (await e11.getCurrentMember().catch((e12) => {
9316
9321
  if (Jg(e12)) return null;
9317
9322
  throw e12;
9318
9323
  }))?.member, i2 = r2?._id;
9319
- if (!r2 || !i2) return { ok: true, data: Mx };
9320
- let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` && Wb.has(e12.key ?? ``)), l2 = c2.map((e12) => ({ id: e12._id ?? e12.key ?? ``, key: e12.key ?? ``, name: e12.name ?? ``, fieldType: String(e12.fieldType ?? ``), socialType: e12.socialType, section: String(e12.section ?? ``) }));
9321
- return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction: jx(n2), definitions: l2, fieldSections: m_({ member: r2, definitions: l2 }), fieldOrigins: Object.fromEntries(c2.map((e12) => [e12._id ?? e12.key ?? ``, String(e12.fieldOrigin ?? ``)])), biMember: { role: n2?.role ?? ``, isProfilePublic: r2.privacyStatus === `PUBLIC` } } };
9324
+ if (!r2 || !i2) return { ok: true, data: Nx };
9325
+ let [{ fields: a2 }, { results: o2 }] = await Promise.all([e11.listCustomFields(), e11.getMemberCustomFieldApplications(i2)]), s2 = new Set((o2?.[0]?.applications ?? []).filter((e12) => e12.applies).map((e12) => e12.customFieldKey)), c2 = (a2 ?? []).filter((e12) => s2.has(e12.key) && e12.fieldOrigin !== `CUSTOM` && Gb.has(e12.key ?? ``)), l2 = c2.map((e12) => ({ id: e12._id ?? e12.key ?? ``, key: e12.key ?? ``, name: e12.name ?? ``, fieldType: String(e12.fieldType ?? ``), socialType: e12.socialType, section: String(e12.section ?? ``) }));
9326
+ return { ok: true, data: { memberId: i2, rawMember: r2, loginEmail: r2.loginEmail ?? ``, credentialRestriction: Mx(n2), definitions: l2, fieldSections: m_({ member: r2, definitions: l2 }), fieldOrigins: Object.fromEntries(c2.map((e12) => [e12._id ?? e12.key ?? ``, String(e12.fieldOrigin ?? ``)])), biMember: { role: n2?.role ?? ``, isProfilePublic: r2.privacyStatus === `PUBLIC` } } };
9322
9327
  } catch (e12) {
9323
9328
  return { ok: false, error: kh(e12).message, cause: e12 };
9324
9329
  }
9325
9330
  };
9326
- var Ix = ({ children: e11 }) => {
9327
- let t2 = (0, import_services_manager_react.useService)(Ba), n2 = cx(), r2 = (0, import_react.useMemo)(() => $g(t2), [t2]), a2 = dl(), d2 = no(Ah.toasts), f2 = (0, import_react.useCallback)(() => Fx(r2, t2), [r2, t2]), [p2, h2] = (0, import_react.useState)(null), g2 = (0, import_react.useRef)(null), [_2, v2] = (0, import_react.useState)(false), [y2, b2] = (0, import_react.useState)(false), [x2, S2] = (0, import_react.useState)({}), [C2, ee2] = (0, import_react.useState)(0), [w2, T2] = (0, import_react.useState)(i_), [te2, ne2] = (0, import_react.useState)(null), [re2, ie2] = (0, import_react.useState)(null), ae2 = (0, import_react.useRef)(f2), oe2 = (0, import_react.useRef)(t2), [E2, se2] = (0, import_react.useState)(0), D2 = (0, import_react.useRef)(0), ce2 = (0, import_react.useRef)(null), le2 = (0, import_react.useRef)(0), O2 = (0, import_react.useRef)(null), [k2, ue2] = (0, import_react.useState)(false), de2 = (0, import_react.useRef)(null), A2 = (0, import_react.useRef)(null), j2 = (0, import_react.useCallback)(() => {
9331
+ var Lx = ({ children: e11 }) => {
9332
+ let t2 = (0, import_services_manager_react.useService)(Ba), n2 = lx(), r2 = (0, import_react.useMemo)(() => $g(t2), [t2]), a2 = dl(), d2 = no(Ah.toasts), f2 = (0, import_react.useCallback)(() => Ix(r2, t2), [r2, t2]), [p2, h2] = (0, import_react.useState)(null), g2 = (0, import_react.useRef)(null), [_2, v2] = (0, import_react.useState)(false), [y2, b2] = (0, import_react.useState)(false), [x2, S2] = (0, import_react.useState)({}), [C2, ee2] = (0, import_react.useState)(0), [w2, T2] = (0, import_react.useState)(i_), [te2, ne2] = (0, import_react.useState)(null), [re2, ie2] = (0, import_react.useState)(null), ae2 = (0, import_react.useRef)(f2), oe2 = (0, import_react.useRef)(t2), [E2, se2] = (0, import_react.useState)(0), D2 = (0, import_react.useRef)(0), ce2 = (0, import_react.useRef)(null), le2 = (0, import_react.useRef)(0), O2 = (0, import_react.useRef)(null), [k2, ue2] = (0, import_react.useState)(false), de2 = (0, import_react.useRef)(null), A2 = (0, import_react.useRef)(null), j2 = (0, import_react.useCallback)(() => {
9328
9333
  le2.current += 1;
9329
9334
  let e12 = le2.current, t3 = D2.current;
9330
9335
  return b2(true), () => le2.current === e12 && D2.current === t3;
@@ -9371,9 +9376,9 @@ var Ix = ({ children: e11 }) => {
9371
9376
  }, [E2, j2, M2]);
9372
9377
  let fe2 = (0, import_react.useCallback)((e12, t3) => {
9373
9378
  S2((n3) => ({ ...n3, [e12]: t3 }));
9374
- }, []), P2 = p2 ?? Mx, F2 = !!P2.memberId && P2.credentialRestriction === Ax.NONE, pe2 = (0, import_react.useCallback)((e12) => {
9375
- F2 && te2 !== e12 && (ne2(e12), Nx[e12]().forEach(n2));
9376
- }, [F2, te2, n2]), me2 = (0, import_react.useCallback)(() => pe2(ax.LOGIN_EMAIL), [pe2]), he2 = (0, import_react.useCallback)(() => pe2(ax.PASSWORD), [pe2]), ge2 = (0, import_react.useCallback)(() => ne2(null), []), I2 = (0, import_react.useMemo)(() => h_(P2.fieldSections, x2), [P2.fieldSections, x2]), _e2 = (0, import_react.useMemo)(() => ({ validity: rx(I2) }), [I2]), ve2 = (0, import_react.useMemo)(() => p2 === null ? qb : Xb(I2, _e2), [p2, I2, _e2]), ye2 = __(I2).length > 0 || k2;
9379
+ }, []), P2 = p2 ?? Nx, F2 = !!P2.memberId && P2.credentialRestriction === jx.NONE, pe2 = (0, import_react.useCallback)((e12) => {
9380
+ F2 && te2 !== e12 && (ne2(e12), Px[e12]().forEach(n2));
9381
+ }, [F2, te2, n2]), me2 = (0, import_react.useCallback)(() => pe2(ox.LOGIN_EMAIL), [pe2]), he2 = (0, import_react.useCallback)(() => pe2(ox.PASSWORD), [pe2]), ge2 = (0, import_react.useCallback)(() => ne2(null), []), I2 = (0, import_react.useMemo)(() => h_(P2.fieldSections, x2), [P2.fieldSections, x2]), _e2 = (0, import_react.useMemo)(() => ({ validity: ix(I2) }), [I2]), ve2 = (0, import_react.useMemo)(() => p2 === null ? Jb : Zb(I2, _e2), [p2, I2, _e2]), ye2 = __(I2).length > 0 || k2;
9377
9382
  (0, import_react.useEffect)(() => {
9378
9383
  if (!ye2) return;
9379
9384
  let e12 = (e13) => {
@@ -9386,14 +9391,14 @@ var Ix = ({ children: e11 }) => {
9386
9391
  let be2 = (0, import_react.useCallback)(async () => {
9387
9392
  let e12 = D2.current;
9388
9393
  if (!P2.memberId) return false;
9389
- if (ix(I2).length) return ee2((e13) => e13 + 1), false;
9394
+ if (ax(I2).length) return ee2((e13) => e13 + 1), false;
9390
9395
  let t3 = __(I2);
9391
9396
  if (O2.current === e12) return !t3.length && de2.current ? de2.current : new Promise((t4) => {
9392
9397
  let n3 = A2.current ?? { session: e12, drafts: x2, resolvers: [] };
9393
9398
  n3.drafts = x2, n3.resolvers.push(t4), A2.current = n3;
9394
9399
  });
9395
9400
  if (!t3.length) return a2.success(d2.personalInfoSaved), true;
9396
- n2(Sx(P2.biMember, t3.map((e13) => ({ key: e13.key, label: e13.label, origin: P2.fieldOrigins[e13.id] ?? `` }))));
9401
+ n2(Cx(P2.biMember, t3.map((e13) => ({ key: e13.key, label: e13.label, origin: P2.fieldOrigins[e13.id] ?? `` }))));
9397
9402
  let i2 = N2(), o2 = () => {
9398
9403
  O2.current === e12 && (O2.current = null, ue2(false));
9399
9404
  }, s2 = g2.current ?? P2, c2 = x2, { member: l2, cleared: u2 } = v_(P2.rawMember, I2);
@@ -9407,7 +9412,7 @@ var Ix = ({ children: e11 }) => {
9407
9412
  }
9408
9413
  if (!i2()) return false;
9409
9414
  let t4 = false, n3 = g2.current ?? P2;
9410
- return M2({ ok: true, data: Px(n3, { ...e13, loginEmail: n3.loginEmail }) }, { isCurrent: j2(), always: o2, onCommitted: () => {
9415
+ return M2({ ok: true, data: Fx(n3, { ...e13, loginEmail: n3.loginEmail }) }, { isCurrent: j2(), always: o2, onCommitted: () => {
9411
9416
  t4 = true, a2.success(d2.personalInfoSaved);
9412
9417
  } }), t4;
9413
9418
  } catch (e13) {
@@ -9438,15 +9443,15 @@ var Ix = ({ children: e11 }) => {
9438
9443
  if (await r2.verifyPassword(P2.loginEmail, t3), !i2()) return false;
9439
9444
  let { member: o2 } = await r2.changeLoginEmail(P2.memberId, e12);
9440
9445
  if (!i2()) return false;
9441
- n2(Ox(true));
9446
+ n2(kx(true));
9442
9447
  let s2 = g2.current ?? P2, c2 = false;
9443
- return M2({ ok: true, data: { ...Px(s2, { ...s2.rawMember, loginEmail: o2?.loginEmail || e12 }), fieldSections: s2.fieldSections } }, { isCurrent: j2(), always: () => T2((e13) => ({ ...e13, isSaving: false })), onCommitted: () => {
9448
+ return M2({ ok: true, data: { ...Fx(s2, { ...s2.rawMember, loginEmail: o2?.loginEmail || e12 }), fieldSections: s2.fieldSections } }, { isCurrent: j2(), always: () => T2((e13) => ({ ...e13, isSaving: false })), onCommitted: () => {
9444
9449
  T2(i_), c2 = true, a2.success(d2.loginEmailChanged);
9445
9450
  } }), c2;
9446
9451
  } catch (e13) {
9447
9452
  if (!i2()) return false;
9448
9453
  let t4 = qg(e13);
9449
- return n2(Ox(false, t4)), T2({ isSaving: false, error: t4 }), t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9454
+ return n2(kx(false, t4)), T2({ isSaving: false, error: t4 }), t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9450
9455
  }
9451
9456
  }, [F2, P2, N2, j2, n2, r2, M2, d2.loginEmailChanged, a2]), Se2 = (0, import_react.useCallback)(async (e12, t3) => {
9452
9457
  if (!F2) return false;
@@ -9459,15 +9464,15 @@ var Ix = ({ children: e11 }) => {
9459
9464
  } finally {
9460
9465
  ce2.current = null;
9461
9466
  }
9462
- return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(kx(true)), T2(i_), a2.success(d2.passwordChanged), true);
9467
+ return !i2() || (await r2.changePassword(t3), !i2()) ? false : (n2(Ax(true)), T2(i_), a2.success(d2.passwordChanged), true);
9463
9468
  } catch (e13) {
9464
9469
  if (!i2()) return false;
9465
9470
  let t4 = qg(e13);
9466
- return n2(kx(false, t4)), T2({ isSaving: false, error: t4 }), e13 instanceof Qg ? a2.error(d2.passwordSignInUnconfirmed) : t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9471
+ return n2(Ax(false, t4)), T2({ isSaving: false, error: t4 }), e13 instanceof Qg ? a2.error(d2.passwordSignInUnconfirmed) : t4 === Q.UNKNOWN && a2.error(kh(e13).message), false;
9467
9472
  }
9468
9473
  }, [F2, P2, N2, n2, r2, d2.passwordChanged, d2.passwordSignInUnconfirmed, a2]), Ce2 = (0, import_react.useCallback)(async () => {
9469
9474
  if (!F2) return false;
9470
- n2(Dx(_x.RESET_OR_CREATE_PASSWORD));
9475
+ n2(Ox(vx.RESET_OR_CREATE_PASSWORD));
9471
9476
  let e12 = N2();
9472
9477
  T2({ isSaving: true, error: null });
9473
9478
  try {
@@ -9480,19 +9485,19 @@ var Ix = ({ children: e11 }) => {
9480
9485
  }, [F2, P2, N2, n2, r2, d2.setPasswordEmailSent, a2]), we2 = (0, import_react.useMemo)(() => {
9481
9486
  let e12 = !!P2.memberId, t3 = (t4) => p2 === null ? void 0 : e12 ? t4 : null;
9482
9487
  return { isLoading: !_2 || y2, ...ve2, focusRequest: C2, updateNamedField: (e13, t4) => {
9483
- let n3 = Zb(I2, e13);
9488
+ let n3 = Qb(I2, e13);
9484
9489
  n3 && fe2(n3, String(t4.target.value ?? ``));
9485
9490
  }, loginEmail: t3(P2.loginEmail || null), credentialRestriction: t3(P2.credentialRestriction), credentialSaving: w2.isSaving, credentialError: w2.error, credentialDialog: te2, openChangeLoginEmailDialog: me2, openChangePasswordDialog: he2, closeCredentialDialog: ge2, savePersonalInfo: be2, changeLoginEmail: xe2, changePassword: Se2, sendSetPasswordEmail: Ce2 };
9486
9491
  }, [p2, _2, P2, I2, ve2, C2, fe2, y2, w2, te2, me2, he2, ge2, be2, xe2, Se2, Ce2]);
9487
9492
  if (re2) throw re2.cause;
9488
9493
  return (0, import_jsx_runtime.jsxs)(a_.Provider, { value: we2, children: [e11, a2.themeAnchor] });
9489
9494
  };
9490
- Ix.displayName = `AccountSettingsProviderBody`;
9491
- var Lx = ({ children: e11 }) => {
9495
+ Lx.displayName = `AccountSettingsProviderBody`;
9496
+ var Rx = ({ children: e11 }) => {
9492
9497
  let t2 = Qa($a);
9493
- return (0, import_jsx_runtime.jsx)(Ra, { i18n: t2, children: (0, import_jsx_runtime.jsx)(Ix, { children: e11 }) });
9498
+ return (0, import_jsx_runtime.jsx)(Ra, { i18n: t2, children: (0, import_jsx_runtime.jsx)(Lx, { children: e11 }) });
9494
9499
  };
9495
- var Rx = On(`f8f3ae80-3fdf-4c8f-a197-d3bb73f04444`);
9500
+ var zx = On(`f8f3ae80-3fdf-4c8f-a197-d3bb73f04444`);
9496
9501
  // Annotate the CommonJS export names for ESM import in node:
9497
9502
  0 && (module.exports = {
9498
9503
  AccountDetailsContextProvider,