@everymatrix/general-registration-multistep 1.90.7 → 1.90.9

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2b1397e1.js');
5
+ const index = require('./index-67740284.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE$1 = 'en';
8
8
  const TRANSLATIONS$1 = {
@@ -378,6 +378,124 @@ const validateID = (id) => {
378
378
 
379
379
  const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
380
380
 
381
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
382
+
383
+ /**
384
+ * @name setClientStyling
385
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
386
+ * @param {HTMLElement} stylingContainer The reference element of the widget
387
+ * @param {string} clientStyling The style content
388
+ */
389
+ function setClientStyling(stylingContainer, clientStyling) {
390
+ if (stylingContainer) {
391
+ const sheet = document.createElement('style');
392
+ sheet.innerHTML = clientStyling;
393
+ stylingContainer.appendChild(sheet);
394
+ }
395
+ }
396
+
397
+ /**
398
+ * @name setClientStylingURL
399
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
400
+ * @param {HTMLElement} stylingContainer The reference element of the widget
401
+ * @param {string} clientStylingUrl The URL of the style content
402
+ */
403
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
404
+ if (!stylingContainer || !clientStylingUrl) return;
405
+
406
+ const url = new URL(clientStylingUrl);
407
+
408
+ fetch(url.href)
409
+ .then((res) => res.text())
410
+ .then((data) => {
411
+ const cssFile = document.createElement('style');
412
+ cssFile.innerHTML = data;
413
+ if (stylingContainer) {
414
+ stylingContainer.appendChild(cssFile);
415
+ }
416
+ })
417
+ .catch((err) => {
418
+ console.error('There was an error while trying to load client styling from URL', err);
419
+ });
420
+ }
421
+
422
+ /**
423
+ * @name setStreamLibrary
424
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
425
+ * @param {HTMLElement} stylingContainer The highest element of the widget
426
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
427
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
428
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
429
+ */
430
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
431
+ if (!window.emMessageBus) return;
432
+
433
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
434
+
435
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
436
+ subscription = getStyleTagSubscription(stylingContainer, domain);
437
+
438
+ return subscription;
439
+ }
440
+
441
+ if (!window[StyleCacheKey]) {
442
+ window[StyleCacheKey] = {};
443
+ }
444
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
445
+
446
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
447
+ const wrappedUnsubscribe = () => {
448
+ if (window[StyleCacheKey][domain]) {
449
+ const cachedObject = window[StyleCacheKey][domain];
450
+ cachedObject.refCount > 1
451
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
452
+ : delete window[StyleCacheKey][domain];
453
+ }
454
+
455
+ originalUnsubscribe();
456
+ };
457
+ subscription.unsubscribe = wrappedUnsubscribe;
458
+
459
+ return subscription;
460
+ }
461
+
462
+ function getStyleTagSubscription(stylingContainer, domain) {
463
+ const sheet = document.createElement('style');
464
+
465
+ return window.emMessageBus.subscribe(domain, (data) => {
466
+ if (stylingContainer) {
467
+ sheet.innerHTML = data;
468
+ stylingContainer.appendChild(sheet);
469
+ }
470
+ });
471
+ }
472
+
473
+ function getAdoptStyleSubscription(stylingContainer, domain) {
474
+ return window.emMessageBus.subscribe(domain, (data) => {
475
+ if (!stylingContainer) return;
476
+
477
+ const shadowRoot = stylingContainer.getRootNode();
478
+ const cacheStyleObject = window[StyleCacheKey];
479
+ let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
480
+
481
+ if (!cachedStyle) {
482
+ cachedStyle = new CSSStyleSheet();
483
+ cachedStyle.replaceSync(data);
484
+ cacheStyleObject[domain] = {
485
+ sheet: cachedStyle,
486
+ refCount: 1
487
+ };
488
+ } else {
489
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
490
+ }
491
+
492
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
493
+ if (!currentSheets.includes(cachedStyle)) {
494
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
495
+ }
496
+ });
497
+ }
498
+
381
499
  const checkboxGroupInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}vaadin-checkbox-group{margin-top:5px;margin-left:40px}.checkboxgroup{font-family:\"Roboto\";font-style:normal;font-size:15px}.checkboxgroup__wrapper{position:relative}.checkboxgroup__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.checkboxgroup__wrapper--relative{position:relative;display:inline}.checkboxgroup__input{vertical-align:baseline}.checkboxgroup__input[indeterminate]::part(checkbox)::after,.checkboxgroup__input[indeterminate]::part(checkbox),.checkboxgroup__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;padding-left:10px;vertical-align:baseline}.checkboxgroup__label-text{font-size:16px}.checkboxgroup__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkboxgroup__tooltip-icon{width:16px;height:auto}.checkboxgroup__tooltip{position:absolute;top:0;right:0;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkboxgroup__tooltip.visible{opacity:1}.checkbox__input::part(checkbox){background-color:var(--emw--color-white, #FFFFFF);transform:scale(0.8, 0.8);border-radius:var(--emw--border-radius-small, 2px);box-shadow:0 0px 0px 2px var(--emw--color-gray, #7a7a7a)}.checkbox__input[indeterminate]::part(checkbox),.checkbox__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));box-shadow:none}";
382
500
  const CheckboxGroupInputStyle0 = checkboxGroupInputCss;
383
501
 
@@ -387,11 +505,6 @@ const CheckboxGroupInput = class {
387
505
  this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
388
506
  this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
389
507
  this.value = null;
390
- this.setClientStyling = () => {
391
- let sheet = document.createElement('style');
392
- sheet.innerHTML = this.clientStyling;
393
- this.stylingContainer.prepend(sheet);
394
- };
395
508
  this.name = undefined;
396
509
  this.displayName = undefined;
397
510
  this.defaultValue = '';
@@ -402,16 +515,17 @@ const CheckboxGroupInput = class {
402
515
  this.language = undefined;
403
516
  this.emitValue = undefined;
404
517
  this.clientStyling = '';
518
+ this.mbSource = undefined;
405
519
  this.errorMessage = undefined;
406
520
  this.isValid = undefined;
407
- this.limitStylingAppends = false;
408
521
  this.showTooltip = false;
409
522
  this.selectedValues = [];
410
523
  this.showCheckboxes = false;
411
524
  }
412
- handleStylingChange(newValue, oldValue) {
413
- if (newValue !== oldValue)
414
- this.setClientStyling();
525
+ handleClientStylingChange(newValue, oldValue) {
526
+ if (newValue !== oldValue) {
527
+ setClientStyling(this.stylingContainer, this.clientStyling);
528
+ }
415
529
  }
416
530
  validityChanged() {
417
531
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -443,16 +557,17 @@ const CheckboxGroupInput = class {
443
557
  this.showTooltip = false;
444
558
  }
445
559
  }
446
- componentDidRender() {
447
- // start custom styling area
448
- if (!this.limitStylingAppends && this.stylingContainer) {
449
- if (this.clientStyling)
450
- this.setClientStyling();
451
- this.limitStylingAppends = true;
560
+ handleClientStyling() {
561
+ if (window.emMessageBus !== undefined) {
562
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
563
+ return;
564
+ }
565
+ if (this.clientStyling) {
566
+ setClientStyling(this.stylingContainer, this.clientStyling);
452
567
  }
453
- // end custom styling area
454
568
  }
455
569
  componentDidLoad() {
570
+ this.handleClientStyling();
456
571
  this.inputReference = this.element.shadowRoot.querySelector('input');
457
572
  // For now this input has no validation. Send isValid as true immediately.
458
573
  //@TODO: add validation logic to it, if business reason arises.
@@ -489,14 +604,14 @@ const CheckboxGroupInput = class {
489
604
  return (index.h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, index.h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
490
605
  }
491
606
  render() {
492
- return index.h("div", { key: '9985f4050655bc2233090f63abb0e22f2fe0b556', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '9922e45ae7ee74b137ffc8552b3d714b7e3b1f59', class: 'checkboxgroup__wrapper--flex' }, index.h("vaadin-checkbox", { key: 'f18bae7c3ee6df76edcde75924eb1ad51a227443', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
493
- index.h("img", { key: '3dc2ce07e4d5f8de7ed4707b5e140fb4752ca86b', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("small", { key: 'd55f25f75aa20007ff58cf45b6632517f49b6c00', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (index.h("vaadin-checkbox-group", { key: '210c3cc2868a07a403494e04336c4f3091eea0e4', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
607
+ return index.h("div", { key: '342900ae923094f2746fd43917743d01efba942e', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '8f3b470274047b355741b438a4e15c7c46504f5a', class: 'checkboxgroup__wrapper--flex' }, index.h("vaadin-checkbox", { key: 'c7a74f9da877304f4d71607d58eba90dd0a29de7', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
608
+ index.h("img", { key: '75d807ad544e043a2e3beed46bf0c7dfa2125324', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("small", { key: '4b17e1e613c7561fb3c99f334926544ef2ba787a', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (index.h("vaadin-checkbox-group", { key: '9a8d573a7cb48bb2d68cceec5f39f1e0886ea05f', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
494
609
  this.selectedValues = event.detail.value;
495
610
  } }, this.options.map((checkbox) => index.h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
496
611
  }
497
612
  get element() { return index.getElement(this); }
498
613
  static get watchers() { return {
499
- "clientStyling": ["handleStylingChange"],
614
+ "clientStyling": ["handleClientStylingChange"],
500
615
  "isValid": ["validityChanged"],
501
616
  "selectedValues": ["setValue"],
502
617
  "emitValue": ["emitValueHandler"]
@@ -513,11 +628,6 @@ const CheckboxInput = class {
513
628
  this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
514
629
  this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
515
630
  this.value = '';
516
- this.setClientStyling = () => {
517
- let sheet = document.createElement('style');
518
- sheet.innerHTML = this.clientStyling;
519
- this.stylingContainer.prepend(sheet);
520
- };
521
631
  this.name = undefined;
522
632
  this.displayName = undefined;
523
633
  this.defaultValue = '';
@@ -527,14 +637,15 @@ const CheckboxInput = class {
527
637
  this.language = undefined;
528
638
  this.emitValue = undefined;
529
639
  this.clientStyling = '';
640
+ this.mbSource = undefined;
530
641
  this.errorMessage = undefined;
531
642
  this.isValid = undefined;
532
- this.limitStylingAppends = false;
533
643
  this.showTooltip = false;
534
644
  }
535
- handleStylingChange(newValue, oldValue) {
536
- if (newValue !== oldValue)
537
- this.setClientStyling();
645
+ handleClientStylingChange(newValue, oldValue) {
646
+ if (newValue !== oldValue) {
647
+ setClientStyling(this.stylingContainer, this.clientStyling);
648
+ }
538
649
  }
539
650
  validityChanged() {
540
651
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -559,16 +670,17 @@ const CheckboxInput = class {
559
670
  this.showTooltip = false;
560
671
  }
561
672
  }
562
- componentDidRender() {
563
- // start custom styling area
564
- if (!this.limitStylingAppends && this.stylingContainer) {
565
- if (this.clientStyling)
566
- this.setClientStyling();
567
- this.limitStylingAppends = true;
673
+ handleClientStyling() {
674
+ if (window.emMessageBus !== undefined) {
675
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
676
+ return;
677
+ }
678
+ if (this.clientStyling) {
679
+ setClientStyling(this.stylingContainer, this.clientStyling);
568
680
  }
569
- // end custom styling area
570
681
  }
571
682
  componentDidLoad() {
683
+ this.handleClientStyling();
572
684
  this.inputReference = this.vaadinCheckbox.querySelector('input');
573
685
  if (this.defaultValue) {
574
686
  this.value = this.defaultValue;
@@ -603,10 +715,10 @@ const CheckboxInput = class {
603
715
  return null;
604
716
  }
605
717
  render() {
606
- return (index.h("div", { key: '80ed581cec5bb009ea5ea009f11c6453fe24ef7b', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, index.h("vaadin-checkbox", { key: '42d793f607af77435f629218f9bdac7736522bc3', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (index.h("img", { key: 'ce3870810ede8f3905fd8c07c0892ab0d909bab5', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
718
+ return (index.h("div", { key: 'a8d8bf6aa2001b6aee44d728a198244819ae169e', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, index.h("vaadin-checkbox", { key: '13a5589a78bef4277922535e59c5718d36b1f318', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (index.h("img", { key: '008bb9a318c914b4b40e80b15080f7f174cc1262', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
607
719
  }
608
720
  static get watchers() { return {
609
- "clientStyling": ["handleStylingChange"],
721
+ "clientStyling": ["handleClientStylingChange"],
610
722
  "isValid": ["validityChanged"],
611
723
  "emitValue": ["emitValueHandler"]
612
724
  }; }
@@ -5997,11 +6109,6 @@ const DateInput = class {
5997
6109
  const date = parse(inputValue, this.dateFormat, new Date());
5998
6110
  return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
5999
6111
  };
6000
- this.setClientStyling = () => {
6001
- let sheet = document.createElement('style');
6002
- sheet.innerHTML = this.clientStyling;
6003
- this.stylingContainer.prepend(sheet);
6004
- };
6005
6112
  this.handleDocumentIdUpdate = (e) => {
6006
6113
  if (this.name !== CONSTANTS$1.BIRTHDATE) {
6007
6114
  return;
@@ -6088,9 +6195,9 @@ const DateInput = class {
6088
6195
  this.emitOnClick = false;
6089
6196
  this.enableSouthAfricanMode = undefined;
6090
6197
  this.enableManualDateInput = false;
6198
+ this.mbSource = undefined;
6091
6199
  this.errorMessage = undefined;
6092
6200
  this.isValid = undefined;
6093
- this.limitStylingAppends = false;
6094
6201
  this.showTooltip = false;
6095
6202
  }
6096
6203
  get formattedValue() {
@@ -6099,9 +6206,10 @@ const DateInput = class {
6099
6206
  const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
6100
6207
  return format(parsedDate, this.dateFormat);
6101
6208
  }
6102
- handleStylingChange(newValue, oldValue) {
6103
- if (newValue !== oldValue)
6104
- this.setClientStyling();
6209
+ handleClientStylingChange(newValue, oldValue) {
6210
+ if (newValue !== oldValue) {
6211
+ setClientStyling(this.stylingContainer, this.clientStyling);
6212
+ }
6105
6213
  }
6106
6214
  validityChanged() {
6107
6215
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6139,17 +6247,18 @@ const DateInput = class {
6139
6247
  this.minDate = parse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
6140
6248
  this.maxDate = parse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
6141
6249
  }
6142
- componentDidRender() {
6143
- // start custom styling area
6144
- if (!this.limitStylingAppends && this.stylingContainer) {
6145
- if (this.clientStyling)
6146
- this.setClientStyling();
6147
- this.limitStylingAppends = true;
6250
+ handleClientStyling() {
6251
+ if (window.emMessageBus !== undefined) {
6252
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6253
+ return;
6254
+ }
6255
+ if (this.clientStyling) {
6256
+ setClientStyling(this.stylingContainer, this.clientStyling);
6148
6257
  }
6149
- // end custom styling area
6150
6258
  }
6151
6259
  componentDidLoad() {
6152
6260
  var _a;
6261
+ this.handleClientStyling();
6153
6262
  this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
6154
6263
  this.inputReference = this.element.shadowRoot.querySelector('input');
6155
6264
  if (this.datePicker) {
@@ -6304,12 +6413,12 @@ const DateInput = class {
6304
6413
  if (this.touched) {
6305
6414
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6306
6415
  }
6307
- return index.h("div", { key: 'f8011520dee6f11203da18cc27a6f278283daace', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("label", { key: 'e1e21a234b5f20f05a5c2d6eb38095bb50748ad6', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: '8dbd7ecb2e8fc686afc02a15a247f5f78484ec22', class: this.validation.mandatory ? 'date__label--required' : '' })), index.h("vaadin-date-picker", { key: '40b5106d0b80799cd81b154889461fa5378264b8', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), index.h("small", { key: 'cd96dd3bb68896ea44d5071d783a7a2e2d75738f', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6308
- index.h("img", { key: '971aeba271d68264bb9ff23b86bed878699d81b1', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6416
+ return index.h("div", { key: 'ffff8be16fb22a41ea8c5168a79e40b9f410c63b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("label", { key: '60da1ad0bc4cc7757e6f1096866667a97bd146b5', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: '450b4638efa34f4490035b0d99b0b186f053a2d0', class: this.validation.mandatory ? 'date__label--required' : '' })), index.h("vaadin-date-picker", { key: '421875a710bb4508e3218d28bf2c28dcd0e9793b', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), index.h("small", { key: '33a6fed8057a84cb648f94a318c3ec0b1e495fff', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6417
+ index.h("img", { key: 'd91fcd13e1ae384b67b6d478834b65136ab77b77', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6309
6418
  }
6310
6419
  get element() { return index.getElement(this); }
6311
6420
  static get watchers() { return {
6312
- "clientStyling": ["handleStylingChange"],
6421
+ "clientStyling": ["handleClientStylingChange"],
6313
6422
  "isValid": ["validityChanged"],
6314
6423
  "emitValue": ["emitValueHandler"],
6315
6424
  "enableSouthAfricanMode": ["handleCustomRegistrationChange"]
@@ -6344,11 +6453,6 @@ const EmailInput = class {
6344
6453
  this.errorMessage = this.setErrorMessage();
6345
6454
  this.touched = true;
6346
6455
  };
6347
- this.setClientStyling = () => {
6348
- let sheet = document.createElement('style');
6349
- sheet.innerHTML = this.clientStyling;
6350
- this.stylingContainer.prepend(sheet);
6351
- };
6352
6456
  this.name = undefined;
6353
6457
  this.displayName = undefined;
6354
6458
  this.placeholder = undefined;
@@ -6360,14 +6464,15 @@ const EmailInput = class {
6360
6464
  this.emitValue = undefined;
6361
6465
  this.isDuplicateInput = undefined;
6362
6466
  this.clientStyling = '';
6467
+ this.mbSource = undefined;
6363
6468
  this.errorMessage = undefined;
6364
6469
  this.isValid = undefined;
6365
- this.limitStylingAppends = false;
6366
6470
  this.showTooltip = false;
6367
6471
  }
6368
- handleStylingChange(newValue, oldValue) {
6369
- if (newValue !== oldValue)
6370
- this.setClientStyling();
6472
+ handleClientStylingChange(newValue, oldValue) {
6473
+ if (newValue !== oldValue) {
6474
+ setClientStyling(this.stylingContainer, this.clientStyling);
6475
+ }
6371
6476
  }
6372
6477
  validityChanged() {
6373
6478
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6402,16 +6507,17 @@ const EmailInput = class {
6402
6507
  connectedCallback() {
6403
6508
  this.validationPattern = this.setPattern();
6404
6509
  }
6405
- componentDidRender() {
6406
- // start custom styling area
6407
- if (!this.limitStylingAppends && this.stylingContainer) {
6408
- if (this.clientStyling)
6409
- this.setClientStyling();
6410
- this.limitStylingAppends = true;
6510
+ handleClientStyling() {
6511
+ if (window.emMessageBus !== undefined) {
6512
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6513
+ return;
6514
+ }
6515
+ if (this.clientStyling) {
6516
+ setClientStyling(this.stylingContainer, this.clientStyling);
6411
6517
  }
6412
- // end custom styling area
6413
6518
  }
6414
6519
  componentDidLoad() {
6520
+ this.handleClientStyling();
6415
6521
  this.isValid = this.setValidity();
6416
6522
  if (this.defaultValue) {
6417
6523
  this.value = this.defaultValue;
@@ -6457,11 +6563,11 @@ const EmailInput = class {
6457
6563
  if (this.touched) {
6458
6564
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6459
6565
  }
6460
- return index.h("div", { key: '723df8f3a6e8c57fe19082400971daf50f5c981d', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '581d6e02b63d1c659ae44424518f64db450d5365', class: 'email__wrapper--flex' }, index.h("label", { key: '11e6a848f6f04903989b3ab2075865f6e279c087', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '73e11520cffbddda1a2aeb4b560e7f4cf456e2fb', class: 'email__wrapper--relative' }, this.tooltip &&
6461
- index.h("img", { key: 'e8571ce14b9b98311daf1712ebde7d6da9b5a6a6', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: 'dd05ef0b4d906598c6d5775a78ccbdc9ea81cb8c', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '0d2d41207f8274d8c6f69143131265ef5b458689', class: 'email__error-message' }, this.errorMessage));
6566
+ return index.h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, index.h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
6567
+ index.h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '08754b178e395f26c1d8a61ff667b91df3fb0ec7', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
6462
6568
  }
6463
6569
  static get watchers() { return {
6464
- "clientStyling": ["handleStylingChange"],
6570
+ "clientStyling": ["handleClientStylingChange"],
6465
6571
  "isValid": ["validityChanged"],
6466
6572
  "emitValue": ["emitValueHandler"]
6467
6573
  }; }
@@ -13135,32 +13241,6 @@ const GeneralInput = class {
13135
13241
  constructor(hostRef) {
13136
13242
  index.registerInstance(this, hostRef);
13137
13243
  this.registrationWidgetLoaded = index.createEvent(this, "registrationWidgetLoaded", 7);
13138
- this.setClientStyling = () => {
13139
- let sheet = document.createElement('style');
13140
- sheet.innerHTML = this.clientStyling;
13141
- this.host.shadowRoot.prepend(sheet);
13142
- };
13143
- this.setStreamStyling = (domain) => {
13144
- if (window.emMessageBus) {
13145
- const sheet = document.createElement('style');
13146
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
13147
- sheet.innerHTML = data;
13148
- this.clientStyling = data;
13149
- this.host.shadowRoot.prepend(sheet);
13150
- });
13151
- }
13152
- };
13153
- this.setClientStylingURL = () => {
13154
- let url = new URL(this.clientStylingUrl);
13155
- let cssFile = document.createElement('style');
13156
- fetch(url.href)
13157
- .then((res) => res.text())
13158
- .then((data) => {
13159
- cssFile.innerHTML = data;
13160
- this.clientStyling = data;
13161
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
13162
- });
13163
- };
13164
13244
  this.handleClick = (event) => {
13165
13245
  if (this.emitOnClick) {
13166
13246
  event.stopPropagation();
@@ -13197,15 +13277,17 @@ const GeneralInput = class {
13197
13277
  this.enableManualDateInput = false;
13198
13278
  this.pinAttemptsExceeded = undefined;
13199
13279
  this.mbSource = undefined;
13200
- this.limitStylingAppends = false;
13201
13280
  }
13202
- handleStylingChange(newValue, oldValue) {
13203
- if (newValue !== oldValue)
13204
- this.setClientStyling();
13281
+ handleClientStylingChange(newValue, oldValue) {
13282
+ if (newValue !== oldValue) {
13283
+ setClientStyling(this.stylingContainer, this.clientStyling);
13284
+ }
13205
13285
  }
13206
- handleStylingUrlChange(newValue, oldValue) {
13207
- if (newValue !== oldValue)
13208
- this.setClientStylingURL();
13286
+ handleClientStylingChangeURL(newValue, oldValue) {
13287
+ if (newValue !== oldValue) {
13288
+ if (this.clientStylingUrl)
13289
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13290
+ }
13209
13291
  }
13210
13292
  connectedCallback() {
13211
13293
  if (this.translationUrl) {
@@ -13216,51 +13298,50 @@ const GeneralInput = class {
13216
13298
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
13217
13299
  }
13218
13300
  componentDidLoad() {
13301
+ this.handleClientStyling();
13219
13302
  this.registrationWidgetLoaded.emit();
13220
13303
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
13221
- if (!this.limitStylingAppends && this.host) {
13222
- if (window.emMessageBus != undefined) {
13223
- this.setStreamStyling(`${this.mbSource}.Style`);
13224
- }
13225
- else {
13226
- if (this.clientStyling)
13227
- this.setClientStyling();
13228
- if (this.clientStylingUrl)
13229
- this.setClientStylingURL();
13230
- this.limitStylingAppends = true;
13231
- }
13304
+ }
13305
+ handleClientStyling() {
13306
+ if (window.emMessageBus !== undefined) {
13307
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
13308
+ return;
13232
13309
  }
13310
+ if (this.clientStyling)
13311
+ setClientStyling(this.stylingContainer, this.clientStyling);
13312
+ if (this.clientStylingUrl)
13313
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13233
13314
  }
13234
13315
  renderInput() {
13235
13316
  var _a;
13236
13317
  switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
13237
13318
  case 'text':
13238
13319
  if (this.haspostalcodelookup && this.name === 'PostalCode') {
13239
- return index.h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry });
13320
+ return index.h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry, "mb-source": this.mbSource });
13240
13321
  }
13241
13322
  else {
13242
- return index.h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode });
13323
+ return index.h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13243
13324
  }
13244
13325
  case 'email':
13245
- return index.h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13326
+ return index.h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13246
13327
  case 'number':
13247
- return index.h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13328
+ return index.h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13248
13329
  case 'checkbox':
13249
- return index.h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
13330
+ return index.h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, "mb-source": this.mbSource });
13250
13331
  case 'checkboxgroup':
13251
- return index.h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
13332
+ return index.h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "mb-source": this.mbSource });
13252
13333
  case 'togglecheckbox':
13253
- return index.h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick });
13334
+ return index.h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick, "mb-source": this.mbSource });
13254
13335
  case 'datetime':
13255
- return index.h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput });
13336
+ return index.h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput, "mb-source": this.mbSource });
13256
13337
  case 'password':
13257
- return index.h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode });
13338
+ return index.h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13258
13339
  case 'radio':
13259
- return index.h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
13340
+ return index.h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource });
13260
13341
  case 'tel':
13261
- return index.h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13342
+ return index.h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13262
13343
  case 'dropdown':
13263
- return index.h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13344
+ return index.h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13264
13345
  case 'twofa':
13265
13346
  return index.h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds, "enable-south-african-mode": this.enableSouthAfricanMode, "pin-attempts-exceeded": this.pinAttemptsExceeded, "mb-source": this.mbSource });
13266
13347
  case 'label':
@@ -13275,12 +13356,12 @@ const GeneralInput = class {
13275
13356
  }
13276
13357
  }
13277
13358
  render() {
13278
- return (index.h(index.Host, { key: '7a7805c641082de9c5da4859187765002ab6f32d', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13359
+ return (index.h(index.Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13279
13360
  }
13280
13361
  get host() { return index.getElement(this); }
13281
13362
  static get watchers() { return {
13282
- "clientStyling": ["handleStylingChange"],
13283
- "clientStylingUrl": ["handleStylingUrlChange"]
13363
+ "clientStyling": ["handleClientStylingChange"],
13364
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
13284
13365
  }; }
13285
13366
  };
13286
13367
  GeneralInput.style = GeneralInputStyle0;
@@ -14482,32 +14563,6 @@ const GeneralRegistrationMultistep = class {
14482
14563
  return "bullet checked";
14483
14564
  return "bullet";
14484
14565
  };
14485
- this.setClientStyling = () => {
14486
- let sheet = document.createElement('style');
14487
- sheet.innerHTML = this.clientStyling;
14488
- this.host.shadowRoot.prepend(sheet);
14489
- };
14490
- this.setClientStylingURL = () => {
14491
- let url = new URL(this.clientStylingUrl);
14492
- let cssFile = document.createElement('style');
14493
- fetch(url.href)
14494
- .then((res) => res.text())
14495
- .then((data) => {
14496
- cssFile.innerHTML = data;
14497
- this.clientStyling = data;
14498
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
14499
- });
14500
- };
14501
- this.setStreamStyling = (domain) => {
14502
- if (window.emMessageBus) {
14503
- const sheet = document.createElement('style');
14504
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
14505
- sheet.innerHTML = data;
14506
- this.clientStyling = data;
14507
- this.host.shadowRoot.prepend(sheet);
14508
- });
14509
- }
14510
- };
14511
14566
  // handles sending a custom event for initial interaction with the registration form
14512
14567
  this.handleInitialClick = (e) => {
14513
14568
  if (!this.isInitalInteraction)
@@ -14536,7 +14591,6 @@ const GeneralRegistrationMultistep = class {
14536
14591
  this.isLoadingPOST = false;
14537
14592
  this.registrationStep = '';
14538
14593
  this.forms = {};
14539
- this.limitStylingAppends = false;
14540
14594
  this.autofilled = false;
14541
14595
  this.isInitalInteraction = true;
14542
14596
  this.addresses = [];
@@ -14549,13 +14603,16 @@ const GeneralRegistrationMultistep = class {
14549
14603
  const stepNum = Number(this.registrationStep.replace('Step', ''));
14550
14604
  this.currentStep = stepNum;
14551
14605
  }
14552
- handleStylingChange(newValue, oldValue) {
14553
- if (newValue !== oldValue)
14554
- this.setClientStyling();
14606
+ handleClientStylingChange(newValue, oldValue) {
14607
+ if (newValue !== oldValue) {
14608
+ setClientStyling(this.stylingContainer, this.clientStyling);
14609
+ }
14555
14610
  }
14556
- handleStylingUrlChange(newValue, oldValue) {
14557
- if (newValue !== oldValue)
14558
- this.setClientStylingURL();
14611
+ handleClientStylingChangeURL(newValue, oldValue) {
14612
+ if (newValue !== oldValue) {
14613
+ if (this.clientStylingUrl)
14614
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
14615
+ }
14559
14616
  }
14560
14617
  setFormValidity() {
14561
14618
  this.errorMessage = '';
@@ -14814,21 +14871,20 @@ const GeneralRegistrationMultistep = class {
14814
14871
  this.setupConditionalValidationMap();
14815
14872
  this.isLoading = false;
14816
14873
  }
14874
+ handleClientStyling() {
14875
+ if (window.emMessageBus !== undefined) {
14876
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14877
+ return;
14878
+ }
14879
+ if (this.clientStyling)
14880
+ setClientStyling(this.stylingContainer, this.clientStyling);
14881
+ if (this.clientStylingUrl)
14882
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
14883
+ }
14817
14884
  componentDidLoad() {
14818
14885
  this.registrationWidgetLoaded.emit();
14819
14886
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
14820
- if (!this.limitStylingAppends && this.host) {
14821
- if (window.emMessageBus != undefined) {
14822
- this.setStreamStyling(`${this.mbSource}.Style`);
14823
- }
14824
- else {
14825
- if (this.clientStyling)
14826
- this.setClientStyling();
14827
- if (this.clientStylingUrl)
14828
- this.setClientStylingURL();
14829
- this.limitStylingAppends = true;
14830
- }
14831
- }
14887
+ this.handleClientStyling();
14832
14888
  }
14833
14889
  disconnectedCallback() {
14834
14890
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
@@ -15696,8 +15752,8 @@ const GeneralRegistrationMultistep = class {
15696
15752
  get host() { return index.getElement(this); }
15697
15753
  static get watchers() { return {
15698
15754
  "registrationStep": ["sendStep"],
15699
- "clientStyling": ["handleStylingChange"],
15700
- "clientStylingUrl": ["handleStylingUrlChange"],
15755
+ "clientStyling": ["handleClientStylingChange"],
15756
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
15701
15757
  "forms": ["setFormValidity"],
15702
15758
  "btag": ["addBtag"]
15703
15759
  }; }
@@ -15731,11 +15787,6 @@ const NumberInput = class {
15731
15787
  this.errorMessage = this.setErrorMessage();
15732
15788
  this.touched = true;
15733
15789
  };
15734
- this.setClientStyling = () => {
15735
- let sheet = document.createElement('style');
15736
- sheet.innerHTML = this.clientStyling;
15737
- this.stylingContainer.prepend(sheet);
15738
- };
15739
15790
  this.name = undefined;
15740
15791
  this.displayName = undefined;
15741
15792
  this.placeholder = undefined;
@@ -15746,14 +15797,15 @@ const NumberInput = class {
15746
15797
  this.language = undefined;
15747
15798
  this.emitValue = undefined;
15748
15799
  this.clientStyling = '';
15800
+ this.mbSource = undefined;
15749
15801
  this.errorMessage = undefined;
15750
15802
  this.isValid = undefined;
15751
- this.limitStylingAppends = false;
15752
15803
  this.showTooltip = false;
15753
15804
  }
15754
- handleStylingChange(newValue, oldValue) {
15755
- if (newValue !== oldValue)
15756
- this.setClientStyling();
15805
+ handleClientStylingChange(newValue, oldValue) {
15806
+ if (newValue !== oldValue) {
15807
+ setClientStyling(this.stylingContainer, this.clientStyling);
15808
+ }
15757
15809
  }
15758
15810
  validityChanged() {
15759
15811
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -15781,16 +15833,17 @@ const NumberInput = class {
15781
15833
  connectedCallback() {
15782
15834
  this.validationPattern = this.setPattern();
15783
15835
  }
15784
- componentDidRender() {
15785
- // start custom styling area
15786
- if (!this.limitStylingAppends && this.stylingContainer) {
15787
- if (this.clientStyling)
15788
- this.setClientStyling();
15789
- this.limitStylingAppends = true;
15836
+ handleClientStyling() {
15837
+ if (window.emMessageBus !== undefined) {
15838
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
15839
+ return;
15840
+ }
15841
+ if (this.clientStyling) {
15842
+ setClientStyling(this.stylingContainer, this.clientStyling);
15790
15843
  }
15791
- // end custom styling area
15792
15844
  }
15793
15845
  componentDidLoad() {
15846
+ this.handleClientStyling();
15794
15847
  this.isValid = this.setValidity();
15795
15848
  if (this.defaultValue) {
15796
15849
  this.value = this.defaultValue;
@@ -15831,11 +15884,11 @@ const NumberInput = class {
15831
15884
  if (this.touched) {
15832
15885
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
15833
15886
  }
15834
- return index.h("div", { key: 'aea370172d0e55d32dc665a1c340c734334e1caf', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '10e16d10b956c5a647bc68ecffbc2eb0b06fa92a', class: 'number__wrapper--flex' }, index.h("label", { key: '0827d47c7278c6fdf8ebdd1dff03b91c39be6812', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'cb868d01e8555f5e3333240f54d86f0a56641d0f', class: 'number__wrapper--relative' }, this.tooltip &&
15835
- index.h("img", { key: '1aa2b16b59f4bfd4b1dadf2641ec6cb4cfc251bf', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '365b70a2eb333878d367d1d414ee0e296c91b3ec', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: 'a8639df7ef1e98807a7daffc9da4afd347b1c292', class: 'number__error-message' }, this.errorMessage));
15887
+ return index.h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, index.h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
15888
+ index.h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: 'f1f563567cde4a744c68e27ab91a3d795f596be6', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
15836
15889
  }
15837
15890
  static get watchers() { return {
15838
- "clientStyling": ["handleStylingChange"],
15891
+ "clientStyling": ["handleClientStylingChange"],
15839
15892
  "isValid": ["validityChanged"],
15840
15893
  "emitValue": ["emitValueHandler"]
15841
15894
  }; }
@@ -15884,11 +15937,6 @@ const PasswordInput = class {
15884
15937
  this.showPopup = true;
15885
15938
  this.calculateComplexity(this.value);
15886
15939
  };
15887
- this.setClientStyling = () => {
15888
- let sheet = document.createElement('style');
15889
- sheet.innerHTML = this.clientStyling;
15890
- this.stylingContainer.prepend(sheet);
15891
- };
15892
15940
  this.name = undefined;
15893
15941
  this.displayName = undefined;
15894
15942
  this.placeholder = undefined;
@@ -15903,17 +15951,18 @@ const PasswordInput = class {
15903
15951
  this.hidePasswordComplexity = false;
15904
15952
  this.clientStyling = '';
15905
15953
  this.enableSouthAfricanMode = undefined;
15954
+ this.mbSource = undefined;
15906
15955
  this.isValid = undefined;
15907
15956
  this.errorMessage = undefined;
15908
- this.limitStylingAppends = false;
15909
15957
  this.showTooltip = false;
15910
15958
  this.passwordComplexity = undefined;
15911
15959
  this.showPopup = undefined;
15912
15960
  this.value = '';
15913
15961
  }
15914
- handleStylingChange(newValue, oldValue) {
15915
- if (newValue !== oldValue)
15916
- this.setClientStyling();
15962
+ handleClientStylingChange(newValue, oldValue) {
15963
+ if (newValue !== oldValue) {
15964
+ setClientStyling(this.stylingContainer, this.clientStyling);
15965
+ }
15917
15966
  }
15918
15967
  validityChanged() {
15919
15968
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -15974,16 +16023,17 @@ const PasswordInput = class {
15974
16023
  this.showTooltip = false;
15975
16024
  }
15976
16025
  }
15977
- componentDidRender() {
15978
- // start custom styling area
15979
- if (!this.limitStylingAppends && this.stylingContainer) {
15980
- if (this.clientStyling)
15981
- this.setClientStyling();
15982
- this.limitStylingAppends = true;
16026
+ handleClientStyling() {
16027
+ if (window.emMessageBus !== undefined) {
16028
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16029
+ return;
16030
+ }
16031
+ if (this.clientStyling) {
16032
+ setClientStyling(this.stylingContainer, this.clientStyling);
15983
16033
  }
15984
- // end custom styling area
15985
16034
  }
15986
16035
  componentDidLoad() {
16036
+ this.handleClientStyling();
15987
16037
  this.inputReference = this.element.shadowRoot.querySelector('input');
15988
16038
  this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
15989
16039
  this.passwordButton.tabIndex = -1;
@@ -16090,8 +16140,8 @@ const PasswordInput = class {
16090
16140
  if (this.touched) {
16091
16141
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16092
16142
  }
16093
- return index.h("div", { key: 'fe895585dd908f75eee4ba797dc9c02b237bed7f', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '844bdb3dab98e62cc5d92a761b85adcdc44831d0', class: 'password__wrapper--flex' }, index.h("label", { key: '28041267a6df666e7df3660a907f995eff092ae1', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '79c300643134802f04d8f909fe7bb3895911c88a', class: 'password__wrapper--relative' }, this.tooltip &&
16094
- index.h("img", { key: '43ae58549e42ba59054162c25887ec36eb826aaa', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("vaadin-password-field", { key: '0edcfed0ea65666537240f531e5239bd5b11181e', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && index.h("small", { key: 'c8aeba074e66b771d745194fec535aa0b82de6d8', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
16143
+ return index.h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, index.h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
16144
+ index.h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("vaadin-password-field", { key: 'bf85dde83305233c566b1c50d0286548ba0f48a5', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && index.h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
16095
16145
  this.showPopup &&
16096
16146
  !this.hidePasswordComplexity &&
16097
16147
  !this.isDuplicateInput &&
@@ -16101,7 +16151,7 @@ const PasswordInput = class {
16101
16151
  }
16102
16152
  get element() { return index.getElement(this); }
16103
16153
  static get watchers() { return {
16104
- "clientStyling": ["handleStylingChange"],
16154
+ "clientStyling": ["handleClientStylingChange"],
16105
16155
  "isValid": ["validityChanged"],
16106
16156
  "value": ["valueChanged"],
16107
16157
  "emitValue": ["emitValueHandler"]
@@ -16251,11 +16301,6 @@ const PostalCodeInput = class {
16251
16301
  targetInput.focus();
16252
16302
  }
16253
16303
  };
16254
- this.setClientStyling = () => {
16255
- let sheet = document.createElement('style');
16256
- sheet.innerHTML = this.clientStyling;
16257
- this.stylingContainer.prepend(sheet);
16258
- };
16259
16304
  this.handleOutsideClick = (event) => {
16260
16305
  if (!this.openAddressDropdown)
16261
16306
  return;
@@ -16281,9 +16326,9 @@ const PostalCodeInput = class {
16281
16326
  this.postalcodelength = undefined;
16282
16327
  this.addresses = undefined;
16283
16328
  this.ignoreCountry = false;
16329
+ this.mbSource = undefined;
16284
16330
  this.isValid = undefined;
16285
16331
  this.errorMessage = '';
16286
- this.limitStylingAppends = false;
16287
16332
  this.showTooltip = false;
16288
16333
  this.selectedCountryCode = '';
16289
16334
  this.currentPostalCode = '';
@@ -16292,9 +16337,10 @@ const PostalCodeInput = class {
16292
16337
  this.refreshTrigger = 0;
16293
16338
  this.isFetchingAddresses = false;
16294
16339
  }
16295
- handleStylingChange(newValue, oldValue) {
16296
- if (newValue !== oldValue)
16297
- this.setClientStyling();
16340
+ handleClientStylingChange(newValue, oldValue) {
16341
+ if (newValue !== oldValue) {
16342
+ setClientStyling(this.stylingContainer, this.clientStyling);
16343
+ }
16298
16344
  }
16299
16345
  validityChanged() {
16300
16346
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16355,19 +16401,22 @@ const PostalCodeInput = class {
16355
16401
  connectedCallback() {
16356
16402
  this.validationPattern = this.setPattern();
16357
16403
  }
16358
- componentDidRender() {
16359
- if (!this.limitStylingAppends && this.stylingContainer) {
16360
- if (this.clientStyling)
16361
- this.setClientStyling();
16362
- this.limitStylingAppends = true;
16363
- }
16364
- }
16365
16404
  componentWillLoad() {
16366
16405
  if (this.defaultValue) {
16367
16406
  this.value = this.defaultValue;
16368
16407
  }
16369
16408
  }
16409
+ handleClientStyling() {
16410
+ if (window.emMessageBus !== undefined) {
16411
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16412
+ return;
16413
+ }
16414
+ if (this.clientStyling) {
16415
+ setClientStyling(this.stylingContainer, this.clientStyling);
16416
+ }
16417
+ }
16370
16418
  componentDidLoad() {
16419
+ this.handleClientStyling();
16371
16420
  if (this.defaultValue) {
16372
16421
  this.valueHandler({ name: this.name, value: this.value });
16373
16422
  }
@@ -16459,10 +16508,10 @@ const PostalCodeInput = class {
16459
16508
  let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
16460
16509
  this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
16461
16510
  let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
16462
- return (index.h("div", { key: 'e358dddfc4b20b0847d03e3f12ff637922470105', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'b806cac9ad62480a1be6bf802528c60c79804e94', class: 'text__wrapper--flex' }, index.h("label", { key: '4fb327989e8b828559c01601eea47bdd58da4bd3', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '6c293495a8935db477cbcac2eb9102bffeb85ddb', class: 'text__wrapper--relative' }, this.tooltip && (index.h("img", { key: '848bb5b44d834c4f0e4a78cfebef0ecf1b88fd2e', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), index.h("div", { key: '7f6195e5cfc5bfabc9854ec6acc19c1e52e70f1b', class: 'input__text-wrapper' }, index.h("input", { key: '4369b4a99016a7aebbb396bdda35c31d92e4d557', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (index.h("p", { key: '0e3c0fcb974d2f3dae76f9afdbf173fcc25d258f', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate$1('enterIEAddressManually', this.language))), showAddressesDropdown && (index.h("div", { key: '1c644f87f2617180e6356c724d72b6d3fc8e472e', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, index.h("div", { key: 'f2a7b8133908441a3cf67eb48928a2d61d17e32f', class: "options" }, this.addresses.map((addr, index$1) => (index.h("div", { key: index$1, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (index.h("div", { key: 'c0cb29f7d174ca8981c8b9dfd2ee9b972b0fd1ea', class: "postalcode__loading-spinner" }, index.h("div", { key: '76f17cb0a440f7ed9cc8de3620b55136549586e6', class: "loading-spinner" }), index.h("span", { key: 'e10c4177fb0f21f142fd3120177e450413687cf3' }, translate$1('searchingForAddresses', this.language)))), shouldShowNoResults && (index.h("div", { key: 'f729f6206cc900a2c94e3df0e8b08cc3dc5b751f', class: "postalcode__no-results-message" }, translate$1('postalLookUpNoAddressFound', this.language)))), index.h("small", { key: 'c8a79e601f22444b34dc7d037c94f92875f51aad', class: 'text__error-message' }, this.errorMessage)));
16511
+ return (index.h("div", { key: 'f0dda39cf9a02d53213848926908c0cb39d1cd3f', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '5e1c51af264392d2be986e305e6526310f55f40b', class: 'text__wrapper--flex' }, index.h("label", { key: 'c12c45d88bdf42aeb6be505d473ab0f55da2be87', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '7b93a75f19590b445227fa1a64c90fd20c0afd5d', class: 'text__wrapper--relative' }, this.tooltip && (index.h("img", { key: '504004a13595694307c1e3450b69982150dc55fd', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), index.h("div", { key: '19de66fd72fd0a6befe3bbaebb6c8f99ec5f850b', class: 'input__text-wrapper' }, index.h("input", { key: '78cd4229ed5104518b991df0bc6bf527df2ec3e2', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (index.h("p", { key: '6b9e307d59fb9fed93f4df6c07a091d299844c62', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate$1('enterIEAddressManually', this.language))), showAddressesDropdown && (index.h("div", { key: 'ecb7892a9a8d967540d8fd013518ae19498fcd48', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, index.h("div", { key: 'a5ef3f81a85207a821964e23b21aaf783be807cc', class: "options" }, this.addresses.map((addr, index$1) => (index.h("div", { key: index$1, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (index.h("div", { key: '338c17e484721efb387e608f3ce4416a0e47b8af', class: "postalcode__loading-spinner" }, index.h("div", { key: '7638cea4fba975e3a27d4cb00bce217129bd0750', class: "loading-spinner" }), index.h("span", { key: 'b59a8a9c3d7ecf209a68717346d1d29062994f79' }, translate$1('searchingForAddresses', this.language)))), shouldShowNoResults && (index.h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate$1('postalLookUpNoAddressFound', this.language)))), index.h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
16463
16512
  }
16464
16513
  static get watchers() { return {
16465
- "clientStyling": ["handleStylingChange"],
16514
+ "clientStyling": ["handleClientStylingChange"],
16466
16515
  "isValid": ["validityChanged"],
16467
16516
  "emitValue": ["emitValueHandler"],
16468
16517
  "addresses": ["handleAddresses"]
@@ -16478,11 +16527,6 @@ const RadioInput = class {
16478
16527
  index.registerInstance(this, hostRef);
16479
16528
  this.sendInputValue = index.createEvent(this, "sendInputValue", 7);
16480
16529
  this.sendValidityState = index.createEvent(this, "sendValidityState", 7);
16481
- this.setClientStyling = () => {
16482
- let sheet = document.createElement('style');
16483
- sheet.innerHTML = this.clientStyling;
16484
- this.stylingContainer.prepend(sheet);
16485
- };
16486
16530
  this.name = undefined;
16487
16531
  this.displayName = undefined;
16488
16532
  this.optionsGroup = undefined;
@@ -16491,14 +16535,15 @@ const RadioInput = class {
16491
16535
  this.language = undefined;
16492
16536
  this.emitValue = undefined;
16493
16537
  this.clientStyling = '';
16538
+ this.mbSource = undefined;
16494
16539
  this.errorMessage = undefined;
16495
16540
  this.isValid = undefined;
16496
- this.limitStylingAppends = false;
16497
16541
  this.showTooltip = false;
16498
16542
  }
16499
- handleStylingChange(newValue, oldValue) {
16500
- if (newValue !== oldValue)
16501
- this.setClientStyling();
16543
+ handleClientStylingChange(newValue, oldValue) {
16544
+ if (newValue !== oldValue) {
16545
+ setClientStyling(this.stylingContainer, this.clientStyling);
16546
+ }
16502
16547
  }
16503
16548
  validityChanged() {
16504
16549
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16523,14 +16568,17 @@ const RadioInput = class {
16523
16568
  this.showTooltip = false;
16524
16569
  }
16525
16570
  }
16526
- componentDidRender() {
16527
- // start custom styling area
16528
- if (!this.limitStylingAppends && this.stylingContainer) {
16529
- if (this.clientStyling)
16530
- this.setClientStyling();
16531
- this.limitStylingAppends = true;
16571
+ handleClientStyling() {
16572
+ if (window.emMessageBus !== undefined) {
16573
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16574
+ return;
16532
16575
  }
16533
- // end custom styling area
16576
+ if (this.clientStyling) {
16577
+ setClientStyling(this.stylingContainer, this.clientStyling);
16578
+ }
16579
+ }
16580
+ componentDidLoad() {
16581
+ this.handleClientStyling();
16534
16582
  }
16535
16583
  handleClick(event) {
16536
16584
  this.value = event.target.value;
@@ -16553,11 +16601,11 @@ const RadioInput = class {
16553
16601
  return null;
16554
16602
  }
16555
16603
  render() {
16556
- return index.h("fieldset", { key: '33493de460303a32a37d253a0fd5f9da59676542', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("legend", { key: '8aef7aa84a119742e05d72d976c936a560154b3f', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => index.h("div", { class: 'radio__wrapper' }, index.h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), index.h("label", { htmlFor: `${option.label}__input` }, option.label))), index.h("small", { key: 'bec44ed4007e408ddeb0b0293b82e034c8e165f2', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
16557
- index.h("img", { key: 'a3b0a041beabe3f14661c0af8cd970040d060435', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
16604
+ return index.h("fieldset", { key: '7048de0e37c9541af1c9788e8b46c789ca788c31', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("legend", { key: '403b739c966d510740ca59621c094872b93e2cba', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => index.h("div", { class: 'radio__wrapper' }, index.h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), index.h("label", { htmlFor: `${option.label}__input` }, option.label))), index.h("small", { key: '46dce1082a6aa9f2a5bdc3e3654c924fcd2a8357', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
16605
+ index.h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
16558
16606
  }
16559
16607
  static get watchers() { return {
16560
- "clientStyling": ["handleStylingChange"],
16608
+ "clientStyling": ["handleClientStylingChange"],
16561
16609
  "isValid": ["validityChanged"],
16562
16610
  "emitValue": ["emitValueHandler"]
16563
16611
  }; }
@@ -16606,11 +16654,6 @@ const SelectInput = class {
16606
16654
  this.validityStateHandler({ valid: this.isValid, name: this.name });
16607
16655
  this.emitValueHandler(true);
16608
16656
  };
16609
- this.setClientStyling = () => {
16610
- let sheet = document.createElement('style');
16611
- sheet.innerHTML = this.clientStyling;
16612
- this.stylingContainer.prepend(sheet);
16613
- };
16614
16657
  this.name = undefined;
16615
16658
  this.displayName = undefined;
16616
16659
  this.placeholder = undefined;
@@ -16623,14 +16666,15 @@ const SelectInput = class {
16623
16666
  this.language = undefined;
16624
16667
  this.emitValue = undefined;
16625
16668
  this.clientStyling = '';
16669
+ this.mbSource = undefined;
16626
16670
  this.errorMessage = undefined;
16627
16671
  this.isValid = undefined;
16628
- this.limitStylingAppends = false;
16629
16672
  this.showTooltip = false;
16630
16673
  }
16631
- handleStylingChange(newValue, oldValue) {
16632
- if (newValue !== oldValue)
16633
- this.setClientStyling();
16674
+ handleClientStylingChange(newValue, oldValue) {
16675
+ if (newValue !== oldValue) {
16676
+ setClientStyling(this.stylingContainer, this.clientStyling);
16677
+ }
16634
16678
  }
16635
16679
  validityChanged() {
16636
16680
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16680,16 +16724,17 @@ const SelectInput = class {
16680
16724
  }
16681
16725
  }
16682
16726
  }
16683
- componentDidRender() {
16684
- // start custom styling area
16685
- if (!this.limitStylingAppends && this.stylingContainer) {
16686
- if (this.clientStyling)
16687
- this.setClientStyling();
16688
- this.limitStylingAppends = true;
16727
+ handleClientStyling() {
16728
+ if (window.emMessageBus !== undefined) {
16729
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16730
+ return;
16731
+ }
16732
+ if (this.clientStyling) {
16733
+ setClientStyling(this.stylingContainer, this.clientStyling);
16689
16734
  }
16690
- // end custom styling area
16691
16735
  }
16692
16736
  componentDidLoad() {
16737
+ this.handleClientStyling();
16693
16738
  this.inputReference = this.vaadinCombo.querySelector('input');
16694
16739
  if (this.defaultValue) {
16695
16740
  this.value = this.defaultValue;
@@ -16754,13 +16799,13 @@ const SelectInput = class {
16754
16799
  if (this.touched) {
16755
16800
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16756
16801
  }
16757
- return index.h("div", { key: 'b0ed504667761e5fd77e0ac13382b467448a1944', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'b48d38dc4c2cb3442ff6773a1b1d13191ec4d0e6', class: 'select__wrapper--flex' }, index.h("label", { key: 'ad592c8c98ecbec1961d22cdfeb8cec910291ea8', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: 'b3c0f2fe9a2d26ade1626878ed9bc1f0b86a23ad', class: this.validation.mandatory ? 'select__label--required' : '' })), index.h("div", { key: '29d0f504d0f51175818dffffb882ac4e6e9c3bde', class: 'select__wrapper--relative' }, this.tooltip &&
16758
- index.h("img", { key: '66e524ffebc43f9418e90b3bd2d7ae62eba47da3', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? index.h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
16802
+ return index.h("div", { key: 'eb6c9d7d85546159d44d06a0635f173263edd7d1', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '0fd71c528870966fdb23049b1806a267e9e6ca5c', class: 'select__wrapper--flex' }, index.h("label", { key: '44aeb4e50ab2f79df06741ff07ac03131c987447', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, index.h("span", { key: '796a83aeadd480a571b6bae035a46138d7b10b24', class: this.validation.mandatory ? 'select__label--required' : '' })), index.h("div", { key: '6d7b2d785c6b0bdd05c7444f563b21cedf26ff7c', class: 'select__wrapper--relative' }, this.tooltip &&
16803
+ index.h("img", { key: 'f33e43a9d42e8b8d1cf136374505eeaedcbede26', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? index.h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
16759
16804
  :
16760
- index.h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), index.h("small", { key: '0143b538740c3a8e9bfcab6bbb44660355c40cf7', class: 'select__error-message' }, this.errorMessage));
16805
+ index.h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), index.h("small", { key: '261b3c4abc9b360e6b937d851f8bfc810280a8c6', class: 'select__error-message' }, this.errorMessage));
16761
16806
  }
16762
16807
  static get watchers() { return {
16763
- "clientStyling": ["handleStylingChange"],
16808
+ "clientStyling": ["handleClientStylingChange"],
16764
16809
  "isValid": ["validityChanged"],
16765
16810
  "emitValue": ["emitValueHandler"]
16766
16811
  }; }
@@ -16795,11 +16840,6 @@ const TelInput = class {
16795
16840
  this.isValid = this.isValidValue();
16796
16841
  this.errorMessage = this.setErrorMessage();
16797
16842
  };
16798
- this.setClientStyling = () => {
16799
- let sheet = document.createElement('style');
16800
- sheet.innerHTML = this.clientStyling;
16801
- this.stylingContainer.prepend(sheet);
16802
- };
16803
16843
  this.name = undefined;
16804
16844
  this.displayName = undefined;
16805
16845
  this.placeholder = undefined;
@@ -16812,9 +16852,9 @@ const TelInput = class {
16812
16852
  this.language = undefined;
16813
16853
  this.emitValue = undefined;
16814
16854
  this.clientStyling = '';
16855
+ this.mbSource = undefined;
16815
16856
  this.isValid = undefined;
16816
16857
  this.errorMessage = undefined;
16817
- this.limitStylingAppends = false;
16818
16858
  this.showTooltip = false;
16819
16859
  this.disablePhonePrefix = false;
16820
16860
  this.phoneValue = '';
@@ -16826,9 +16866,10 @@ const TelInput = class {
16826
16866
  if (this.inputReference)
16827
16867
  this.inputReference.value = this.phoneValue;
16828
16868
  }
16829
- handleStylingChange(newValue, oldValue) {
16830
- if (newValue !== oldValue)
16831
- this.setClientStyling();
16869
+ handleClientStylingChange(newValue, oldValue) {
16870
+ if (newValue !== oldValue) {
16871
+ setClientStyling(this.stylingContainer, this.clientStyling);
16872
+ }
16832
16873
  }
16833
16874
  validityChanged() {
16834
16875
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16879,16 +16920,17 @@ const TelInput = class {
16879
16920
  }
16880
16921
  }
16881
16922
  }
16882
- componentDidRender() {
16883
- // start custom styling area
16884
- if (!this.limitStylingAppends && this.stylingContainer) {
16885
- if (this.clientStyling)
16886
- this.setClientStyling();
16887
- this.limitStylingAppends = true;
16923
+ handleClientStyling() {
16924
+ if (window.emMessageBus !== undefined) {
16925
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16926
+ return;
16927
+ }
16928
+ if (this.clientStyling) {
16929
+ setClientStyling(this.stylingContainer, this.clientStyling);
16888
16930
  }
16889
- // end custom styling area
16890
16931
  }
16891
16932
  componentDidLoad() {
16933
+ this.handleClientStyling();
16892
16934
  this.isValid = this.isValidValue();
16893
16935
  if (this.defaultValue) {
16894
16936
  this.value = this.defaultValue;
@@ -16980,11 +17022,11 @@ const TelInput = class {
16980
17022
  if (this.touched) {
16981
17023
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16982
17024
  }
16983
- return index.h("div", { key: 'bf824bf310bec50746fb6b82cd8f7decbcfc284b', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '0b6c42e7aca5686f310ffdcecb96cf909e83521f', class: 'tel__wrapper--flex-label' }, index.h("label", { key: 'ddf2fa885ac53e7f337525357a7dce52f911213d', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'e21a84509b32f379bb3ce92137255caf99a86dc5', class: 'tel__wrapper--relative' }, this.tooltip &&
16984
- index.h("img", { key: '9ff0a8c19aa067c1e7799227617405e373b344e4', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: '5db13af7e421480b89253970a5f2470f999c922d', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: '164fe2bd2940bd5a251fda48b28f1af1bc3e78be', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.h("input", { key: '90ae038a383645d6579fb68bc5adbe8a2b1d676c', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), index.h("small", { key: 'a68f95384965384a67d042b89264dbda03f25b7a', class: 'tel__error-message' }, this.errorMessage));
17025
+ return index.h("div", { key: '9cf9eb751bca1978d8554fffc912ef2039c42e41', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'cc88d6e9aa7a0f3801fad75e3ca509fbd01b0538', class: 'tel__wrapper--flex-label' }, index.h("label", { key: 'c8a35af4ddd2d4f9751d7f60c9e075ae8eccb441', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '73fcdcc25dde1be087ee60062dc5eee2d1e5d29e', class: 'tel__wrapper--relative' }, this.tooltip &&
17026
+ index.h("img", { key: '56df66fddf599fbafb179c7cd90ea7d58b008ea6', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: '20eb5689932c2f71322102229cc7346d18e9bc87', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: '9ec4142dc84e0022ced7e34248d5f4f8f59c34af', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.h("input", { key: 'c083b17f71de36b84892a8080f776debf1fe7351', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), index.h("small", { key: '2201c2d7b968731042624b265cf535c656c86933', class: 'tel__error-message' }, this.errorMessage));
16985
17027
  }
16986
17028
  static get watchers() { return {
16987
- "clientStyling": ["handleStylingChange"],
17029
+ "clientStyling": ["handleClientStylingChange"],
16988
17030
  "isValid": ["validityChanged"],
16989
17031
  "emitValue": ["emitValueHandler"]
16990
17032
  }; }
@@ -17028,11 +17070,6 @@ const TextInput = class {
17028
17070
  this.touched = true;
17029
17071
  this.updateValidationState();
17030
17072
  };
17031
- this.setClientStyling = () => {
17032
- let sheet = document.createElement('style');
17033
- sheet.innerHTML = this.clientStyling;
17034
- this.stylingContainer.prepend(sheet);
17035
- };
17036
17073
  this.name = undefined;
17037
17074
  this.displayName = undefined;
17038
17075
  this.placeholder = undefined;
@@ -17047,15 +17084,16 @@ const TextInput = class {
17047
17084
  this.clientStyling = '';
17048
17085
  this.haspostalcodelookup = undefined;
17049
17086
  this.enableSouthAfricanMode = undefined;
17087
+ this.mbSource = undefined;
17050
17088
  this.isValid = undefined;
17051
17089
  this.errorMessage = '';
17052
- this.limitStylingAppends = false;
17053
17090
  this.showTooltip = false;
17054
17091
  this.selectedCountryCode = '';
17055
17092
  }
17056
- handleStylingChange(newValue, oldValue) {
17057
- if (newValue !== oldValue)
17058
- this.setClientStyling();
17093
+ handleClientStylingChange(newValue, oldValue) {
17094
+ if (newValue !== oldValue) {
17095
+ setClientStyling(this.stylingContainer, this.clientStyling);
17096
+ }
17059
17097
  }
17060
17098
  validityChanged() {
17061
17099
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -17167,21 +17205,22 @@ const TextInput = class {
17167
17205
  }
17168
17206
  this.validityStateHandler({ valid: false, name: this.name });
17169
17207
  }
17170
- componentDidRender() {
17171
- // start custom styling area
17172
- if (!this.limitStylingAppends && this.stylingContainer) {
17173
- if (this.clientStyling)
17174
- this.setClientStyling();
17175
- this.limitStylingAppends = true;
17176
- }
17177
- // end custom styling area
17178
- }
17179
17208
  componentWillLoad() {
17180
17209
  if (this.defaultValue) {
17181
17210
  this.value = this.defaultValue;
17182
17211
  }
17183
17212
  }
17213
+ handleClientStyling() {
17214
+ if (window.emMessageBus !== undefined) {
17215
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
17216
+ return;
17217
+ }
17218
+ if (this.clientStyling) {
17219
+ setClientStyling(this.stylingContainer, this.clientStyling);
17220
+ }
17221
+ }
17184
17222
  componentDidLoad() {
17223
+ this.handleClientStyling();
17185
17224
  if (this.defaultValue) {
17186
17225
  this.value = this.defaultValue;
17187
17226
  this.valueHandler({ name: this.name, value: this.value });
@@ -17293,11 +17332,11 @@ const TextInput = class {
17293
17332
  if (this.touched) {
17294
17333
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
17295
17334
  }
17296
- return index.h("div", { key: 'aacb35e1808720cfdb24708254c01cb5be0fe6b6', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: '14a292cc7661d663698384d989d57d21786210b9', class: 'text__wrapper--flex' }, index.h("label", { key: 'c04b29364c4b54e9aad3036264044177e4a2dc51', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'eb8aee30e47241b533c7ca8fcb354c782b4e2be1', class: 'text__wrapper--relative' }, this.tooltip &&
17297
- index.h("img", { key: '23d4b70d93910f43ce0ea54c1bcffd81dfc54ebc', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '3f901d85111256370811f4abe51bcd5b2971b60c', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: '1661215687f1eecd622b2610c3e056f45944fee3', class: 'text__error-message' }, this.errorMessage));
17335
+ return index.h("div", { key: 'f48e592bac049022b283bac917c095772b1508f5', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'fe3626ead38dd18dfa14795ee2332e93f5f09652', class: 'text__wrapper--flex' }, index.h("label", { key: '6b2854b460e0ac7d4ae0ebccc06dbe64770581d5', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: 'f29d266973bd700a4270495bc4eb6e8296b6eeaf', class: 'text__wrapper--relative' }, this.tooltip &&
17336
+ index.h("img", { key: '68e69abbb78250e763822608e963bc16d702f099', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("input", { key: '99b8eab15ab32656f86fedd3f36a09a5bbe108d3', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), index.h("small", { key: 'cc28c1c19370faa94fa1f738066042dce8d694ce', class: 'text__error-message' }, this.errorMessage));
17298
17337
  }
17299
17338
  static get watchers() { return {
17300
- "clientStyling": ["handleStylingChange"],
17339
+ "clientStyling": ["handleClientStylingChange"],
17301
17340
  "isValid": ["validityChanged"],
17302
17341
  "emitValue": ["emitValueHandler"]
17303
17342
  }; }
@@ -17319,11 +17358,6 @@ const ToggleCheckboxInput = class {
17319
17358
  event.stopPropagation();
17320
17359
  window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
17321
17360
  };
17322
- this.setClientStyling = () => {
17323
- let sheet = document.createElement('style');
17324
- sheet.innerHTML = this.clientStyling;
17325
- this.stylingContainer.prepend(sheet);
17326
- };
17327
17361
  this.name = undefined;
17328
17362
  this.displayName = undefined;
17329
17363
  this.defaultValue = '';
@@ -17334,15 +17368,16 @@ const ToggleCheckboxInput = class {
17334
17368
  this.language = undefined;
17335
17369
  this.emitValue = undefined;
17336
17370
  this.clientStyling = '';
17371
+ this.mbSource = undefined;
17337
17372
  this.errorMessage = undefined;
17338
17373
  this.isValid = undefined;
17339
- this.limitStylingAppends = false;
17340
17374
  this.showTooltip = false;
17341
17375
  this.showFields = this.defaultValue === 'true';
17342
17376
  }
17343
- handleStylingChange(newValue, oldValue) {
17344
- if (newValue !== oldValue)
17345
- this.setClientStyling();
17377
+ handleClientStylingChange(newValue, oldValue) {
17378
+ if (newValue !== oldValue) {
17379
+ setClientStyling(this.stylingContainer, this.clientStyling);
17380
+ }
17346
17381
  }
17347
17382
  validityStateHandler(inputStateEvent) {
17348
17383
  this.sendValidityState.emit(inputStateEvent);
@@ -17356,16 +17391,17 @@ const ToggleCheckboxInput = class {
17356
17391
  this.showTooltip = false;
17357
17392
  }
17358
17393
  }
17359
- componentDidRender() {
17360
- // start custom styling area
17361
- if (!this.limitStylingAppends && this.stylingContainer) {
17362
- if (this.clientStyling)
17363
- this.setClientStyling();
17364
- this.limitStylingAppends = true;
17394
+ handleClientStyling() {
17395
+ if (window.emMessageBus !== undefined) {
17396
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
17397
+ return;
17398
+ }
17399
+ if (this.clientStyling) {
17400
+ setClientStyling(this.stylingContainer, this.clientStyling);
17365
17401
  }
17366
- // end custom styling area
17367
17402
  }
17368
17403
  componentDidLoad() {
17404
+ this.handleClientStyling();
17369
17405
  if (this.options.length === 0)
17370
17406
  return;
17371
17407
  this.options.forEach((subField) => {
@@ -17402,13 +17438,13 @@ const ToggleCheckboxInput = class {
17402
17438
  return null;
17403
17439
  }
17404
17440
  render() {
17405
- return index.h("div", { key: '828751327e59e9649afc04c6c9f7a02ef7dcae8d', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'd02a2a6ef595aaf7142cbc6e9681394ee4db8fee', class: 'togglecheckbox__wrapper--flex' }, index.h("input", { key: 'fca6401ef6eb178f53471362444d54ed69086429', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), index.h("small", { key: '3781a8fdfeb719422693bcd541a4a3fe708e705a', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '27a4c6b047cd332407ee40c82cf7be1914ed34c9', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
17406
- index.h("img", { key: 'f1367d7e061d20ad68c24dfbe3147e6b67df746f', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: '98d42103554de4d14a65eafd1722bf9d587a27f1', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
17441
+ return index.h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, index.h("input", { key: '0237f06c99b8b2ed7de80433f5b93b9eae7c25f5', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), index.h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
17442
+ index.h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
17407
17443
  return index.h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
17408
17444
  })));
17409
17445
  }
17410
17446
  static get watchers() { return {
17411
- "clientStyling": ["handleStylingChange"]
17447
+ "clientStyling": ["handleClientStylingChange"]
17412
17448
  }; }
17413
17449
  };
17414
17450
  ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
@@ -17434,17 +17470,6 @@ const TwofaInput = class {
17434
17470
  this.triggerResendInterval();
17435
17471
  this.resendCode.emit();
17436
17472
  };
17437
- this.setClientStylingURL = () => {
17438
- let url = new URL(this.clientStylingUrl);
17439
- let cssFile = document.createElement('style');
17440
- fetch(url.href)
17441
- .then((res) => res.text())
17442
- .then((data) => {
17443
- cssFile.innerHTML = data;
17444
- this.clientStyling = data;
17445
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
17446
- });
17447
- };
17448
17473
  this.setInputRef = (el, idx) => {
17449
17474
  if (el) {
17450
17475
  this.inputRefs[idx] = el;
@@ -17500,21 +17525,6 @@ const TwofaInput = class {
17500
17525
  this.setValidity();
17501
17526
  this.setErrorMessage();
17502
17527
  };
17503
- this.setClientStyling = () => {
17504
- let sheet = document.createElement('style');
17505
- sheet.innerHTML = this.clientStyling;
17506
- this.stylingContainer.prepend(sheet);
17507
- };
17508
- this.setStreamStyling = (domain) => {
17509
- if (window.emMessageBus) {
17510
- const sheet = document.createElement('style');
17511
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
17512
- sheet.innerHTML = data;
17513
- this.clientStyling = data;
17514
- this.host.shadowRoot.prepend(sheet);
17515
- });
17516
- }
17517
- };
17518
17528
  this.name = '';
17519
17529
  this.displayName = '';
17520
17530
  this.placeholder = '';
@@ -17529,7 +17539,6 @@ const TwofaInput = class {
17529
17539
  this.pinAttemptsExceeded = undefined;
17530
17540
  this.clientStylingUrl = '';
17531
17541
  this.mbSource = undefined;
17532
- this.limitStylingAppends = false;
17533
17542
  this.isValid = false;
17534
17543
  this.isResendButtonAvailable = true;
17535
17544
  this.showTooltip = false;
@@ -17549,9 +17558,16 @@ const TwofaInput = class {
17549
17558
  this.valueHandler({ name: this.name, value: this.code.join('') });
17550
17559
  }
17551
17560
  }
17552
- handleStylingUrlChange(newValue, oldValue) {
17553
- if (newValue !== oldValue)
17554
- this.setClientStylingURL();
17561
+ handleClientStylingChange(newValue, oldValue) {
17562
+ if (newValue !== oldValue) {
17563
+ setClientStyling(this.stylingContainer, this.clientStyling);
17564
+ }
17565
+ }
17566
+ handleClientStylingChangeURL(newValue, oldValue) {
17567
+ if (newValue !== oldValue) {
17568
+ if (this.clientStylingUrl)
17569
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
17570
+ }
17555
17571
  }
17556
17572
  validityStateHandler(inputStateEvent) {
17557
17573
  this.sendValidityState.emit(inputStateEvent);
@@ -17565,10 +17581,6 @@ const TwofaInput = class {
17565
17581
  this.showTooltip = false;
17566
17582
  }
17567
17583
  }
17568
- handleStylingChange(newValue, oldValue) {
17569
- if (newValue !== oldValue)
17570
- this.setClientStyling();
17571
- }
17572
17584
  connectedCallback() {
17573
17585
  this.validationPattern = this.setPattern();
17574
17586
  this.code = new Array(this.validation.maxLength).fill('');
@@ -17576,30 +17588,21 @@ const TwofaInput = class {
17576
17588
  disconnectedCallback() {
17577
17589
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
17578
17590
  }
17579
- componentDidRender() {
17580
- if (!this.limitStylingAppends && this.stylingContainer) {
17581
- if (this.clientStyling) {
17582
- this.setClientStyling();
17583
- }
17584
- this.limitStylingAppends = true;
17591
+ handleClientStyling() {
17592
+ if (window.emMessageBus !== undefined) {
17593
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
17594
+ return;
17585
17595
  }
17596
+ if (this.clientStyling)
17597
+ setClientStyling(this.stylingContainer, this.clientStyling);
17598
+ if (this.clientStylingUrl)
17599
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
17586
17600
  }
17587
17601
  componentDidLoad() {
17588
17602
  this.setValidity();
17589
17603
  this.registrationWidgetLoaded.emit();
17590
17604
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
17591
- if (!this.limitStylingAppends && this.host) {
17592
- if (window.emMessageBus != undefined) {
17593
- this.setStreamStyling(`${this.mbSource}.Style`);
17594
- }
17595
- else {
17596
- if (this.clientStyling)
17597
- this.setClientStyling();
17598
- if (this.clientStylingUrl)
17599
- this.setClientStylingURL();
17600
- this.limitStylingAppends = true;
17601
- }
17602
- }
17605
+ this.handleClientStyling();
17603
17606
  }
17604
17607
  handleKeyDown(e, idx) {
17605
17608
  if (e.key === 'Backspace') {
@@ -17690,9 +17693,9 @@ const TwofaInput = class {
17690
17693
  return current;
17691
17694
  }
17692
17695
  render() {
17693
- return (index.h("div", { key: '08b9139f1c2236dd40a045517a9623ad966f29d3', class: "twofa", ref: el => this.stylingContainer = el }, index.h("div", { key: '7528885100be3d450ec52aafd6085a4c852710c8', class: 'twofa__error-message' }, index.h("p", { key: '51dab3f02156b5eb3b7408f06f2d359cfbda11a7' }, this.errorMessage)), index.h("div", { key: 'f336f89ecee0724663b1bbb4d443bb834336b5c1', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: '5127127ccc8e50428f8319fddc9e21606f3b4148', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
17696
+ return (index.h("div", { key: 'cd5396afccaf4016201281f5cc53898c0a2052ed', class: "twofa", ref: el => this.stylingContainer = el }, index.h("div", { key: '008dd54682a0d93190e9e5b2b49673262ed01763', class: 'twofa__error-message' }, index.h("p", { key: '41db51d6b396ccd1f3149e4473e96960e92d05ca' }, this.errorMessage)), index.h("div", { key: '67e9e4ac90cf95f2269e75b121ed220a02c5f139', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), index.h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
17694
17697
  return (index.h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: this.getInputDisplayValue(idx), onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
17695
- })), index.h("div", { key: 'be82ae1192129d571275b78c8097c3023468cf3e', class: "twofa__button-wrapper" }, index.h("p", { key: '11de61d738ffa74bfd44f0d7c88fc4e456647d0c', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), index.h("button", { key: '84d5c55c4d9bf024164ec52e2100cfcc8c236ac2', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
17698
+ })), index.h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, index.h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), index.h("button", { key: '12b7b4bc3ea165994f2c50107f406c64e708cf4d', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
17696
17699
  ? translate$1('twofaResendButton', this.language)
17697
17700
  : this.formatTime()))));
17698
17701
  }
@@ -17700,8 +17703,8 @@ const TwofaInput = class {
17700
17703
  static get watchers() { return {
17701
17704
  "isValid": ["validityChanged"],
17702
17705
  "emitValue": ["emitValueHandler"],
17703
- "clientStylingUrl": ["handleStylingUrlChange"],
17704
- "clientStyling": ["handleStylingChange"]
17706
+ "clientStyling": ["handleClientStylingChange"],
17707
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
17705
17708
  }; }
17706
17709
  };
17707
17710
  TwofaInput.style = TwofaInputStyle0;