@infineon/infineon-design-system-stencil 35.4.3--canary.1904.dd7d0b778450bc713aec754a10b39edd5d76243c.0 → 35.4.3--canary.1935.5a72dcb40558a8813d95215c02b19960db8e29a1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/cjs/{ifx-template.cjs.entry.js → ifx-alert_2.cjs.entry.js} +40 -1
  2. package/dist/cjs/ifx-alert_2.cjs.entry.js.map +1 -0
  3. package/dist/cjs/ifx-badge.cjs.entry.js +22 -0
  4. package/dist/cjs/ifx-badge.cjs.entry.js.map +1 -0
  5. package/dist/cjs/ifx-button.cjs.entry.js +139 -0
  6. package/dist/cjs/ifx-button.cjs.entry.js.map +1 -0
  7. package/dist/cjs/ifx-icon.cjs.entry.js +97 -0
  8. package/dist/cjs/ifx-icon.cjs.entry.js.map +1 -0
  9. package/dist/cjs/index-7f4df11a.js +14 -6
  10. package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/components/alert/alert.js +0 -32
  13. package/dist/collection/components/alert/alert.js.map +1 -1
  14. package/dist/collection/components/badge/badge.js +1 -35
  15. package/dist/collection/components/badge/badge.js.map +1 -1
  16. package/dist/collection/components/button/button.js +1 -33
  17. package/dist/collection/components/button/button.js.map +1 -1
  18. package/dist/collection/components/icon/infineonIconStencil.js +1 -33
  19. package/dist/collection/components/icon/infineonIconStencil.js.map +1 -1
  20. package/dist/components/ifx-accordion-item.js +1 -1
  21. package/dist/components/ifx-alert.js +1 -1
  22. package/dist/components/ifx-badge.js +1 -35
  23. package/dist/components/ifx-badge.js.map +1 -1
  24. package/dist/components/ifx-breadcrumb-item-label.js +1 -1
  25. package/dist/components/ifx-button.js +1 -1
  26. package/dist/components/ifx-checkbox-group.js +1 -1
  27. package/dist/components/ifx-checkbox.js +1 -1
  28. package/dist/components/ifx-chip-item.js +1 -1
  29. package/dist/components/ifx-chip.js +1 -1
  30. package/dist/components/ifx-date-picker.js +1 -1
  31. package/dist/components/ifx-dropdown-item.js +1 -1
  32. package/dist/components/ifx-dropdown-trigger-button.js +2 -2
  33. package/dist/components/ifx-faq.js +2 -2
  34. package/dist/components/ifx-file-upload.js +3 -3
  35. package/dist/components/ifx-filter-accordion.js +1 -1
  36. package/dist/components/ifx-filter-bar.js +2 -2
  37. package/dist/components/ifx-filter-search.js +2 -2
  38. package/dist/components/ifx-icon-button.js +1 -1
  39. package/dist/components/ifx-icon.js +1 -1
  40. package/dist/components/ifx-icons-preview.js +3 -3
  41. package/dist/components/ifx-list-entry.js +2 -2
  42. package/dist/components/ifx-list.js +1 -1
  43. package/dist/components/ifx-modal.js +2 -2
  44. package/dist/components/ifx-multiselect.js +1 -1
  45. package/dist/components/ifx-navbar-item.js +1 -1
  46. package/dist/components/ifx-navbar.js +1 -1
  47. package/dist/components/ifx-notification.js +1 -1
  48. package/dist/components/ifx-overview-table.js +1 -1
  49. package/dist/components/ifx-pagination.js +1 -1
  50. package/dist/components/ifx-radio-button-group.js +1 -1
  51. package/dist/components/ifx-search-bar.js +2 -2
  52. package/dist/components/ifx-search-field.js +1 -1
  53. package/dist/components/ifx-segment.js +1 -1
  54. package/dist/components/ifx-segmented-control.js +1 -1
  55. package/dist/components/ifx-select.js +1 -1
  56. package/dist/components/ifx-set-filter.js +5 -5
  57. package/dist/components/ifx-sidebar-item.js +1 -1
  58. package/dist/components/ifx-slider.js +1 -1
  59. package/dist/components/ifx-step.js +1 -1
  60. package/dist/components/ifx-table.js +8 -8
  61. package/dist/components/ifx-tabs.js +1 -1
  62. package/dist/components/ifx-tag.js +1 -1
  63. package/dist/components/ifx-template.js +1 -1
  64. package/dist/components/ifx-templates-ui.js +6 -6
  65. package/dist/components/ifx-text-field.js +1 -1
  66. package/dist/components/ifx-tooltip.js +1 -1
  67. package/dist/components/ifx-tree-view-item.js +2 -2
  68. package/dist/components/{p-98e17d75.js → p-12e75dad.js} +2 -34
  69. package/dist/components/p-12e75dad.js.map +1 -0
  70. package/dist/components/{p-7a680ebb.js → p-17df0350.js} +2 -34
  71. package/dist/components/p-17df0350.js.map +1 -0
  72. package/dist/components/{p-613c4d86.js → p-20d6a006.js} +2 -2
  73. package/dist/components/{p-613c4d86.js.map → p-20d6a006.js.map} +1 -1
  74. package/dist/components/{p-87a839f0.js → p-2a500ed7.js} +3 -3
  75. package/dist/components/{p-87a839f0.js.map → p-2a500ed7.js.map} +1 -1
  76. package/dist/components/{p-6b4c8097.js → p-36e092f8.js} +2 -2
  77. package/dist/components/{p-6b4c8097.js.map → p-36e092f8.js.map} +1 -1
  78. package/dist/components/{p-d1a5bfd2.js → p-5c96860f.js} +2 -2
  79. package/dist/components/{p-d1a5bfd2.js.map → p-5c96860f.js.map} +1 -1
  80. package/dist/components/{p-4e7857ff.js → p-6c0ec65a.js} +2 -34
  81. package/dist/components/p-6c0ec65a.js.map +1 -0
  82. package/dist/components/{p-329a7500.js → p-80006961.js} +3 -3
  83. package/dist/components/{p-329a7500.js.map → p-80006961.js.map} +1 -1
  84. package/dist/components/{p-e2b248ca.js → p-8713a366.js} +2 -2
  85. package/dist/components/{p-e2b248ca.js.map → p-8713a366.js.map} +1 -1
  86. package/dist/components/{p-cb4b6b39.js → p-afd6d4f5.js} +2 -2
  87. package/dist/components/{p-cb4b6b39.js.map → p-afd6d4f5.js.map} +1 -1
  88. package/dist/components/{p-d4b7df30.js → p-b293963f.js} +2 -2
  89. package/dist/components/{p-d4b7df30.js.map → p-b293963f.js.map} +1 -1
  90. package/dist/components/{p-57dd8b77.js → p-b6b0d09b.js} +2 -2
  91. package/dist/components/{p-57dd8b77.js.map → p-b6b0d09b.js.map} +1 -1
  92. package/dist/components/{p-9b5dec46.js → p-ca125a72.js} +4 -4
  93. package/dist/components/{p-9b5dec46.js.map → p-ca125a72.js.map} +1 -1
  94. package/dist/components/{p-ce281e7f.js → p-e68ff1c7.js} +4 -4
  95. package/dist/components/{p-ce281e7f.js.map → p-e68ff1c7.js.map} +1 -1
  96. package/dist/components/{p-310364fe.js → p-f2f58eb1.js} +2 -2
  97. package/dist/components/{p-310364fe.js.map → p-f2f58eb1.js.map} +1 -1
  98. package/dist/esm/{ifx-template.entry.js → ifx-alert_2.entry.js} +40 -2
  99. package/dist/esm/ifx-alert_2.entry.js.map +1 -0
  100. package/dist/esm/ifx-badge.entry.js +18 -0
  101. package/dist/esm/ifx-badge.entry.js.map +1 -0
  102. package/dist/esm/ifx-button.entry.js +135 -0
  103. package/dist/esm/ifx-button.entry.js.map +1 -0
  104. package/dist/esm/ifx-icon.entry.js +93 -0
  105. package/dist/esm/ifx-icon.entry.js.map +1 -0
  106. package/dist/esm/index-6c9eba32.js +14 -6
  107. package/dist/esm/infineon-design-system-stencil.js +1 -1
  108. package/dist/esm/loader.js +1 -1
  109. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  110. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
  111. package/dist/infineon-design-system-stencil/p-17f3f2f5.entry.js +2 -0
  112. package/dist/infineon-design-system-stencil/p-17f3f2f5.entry.js.map +1 -0
  113. package/dist/infineon-design-system-stencil/p-3d23deba.entry.js +2 -0
  114. package/dist/infineon-design-system-stencil/p-3d23deba.entry.js.map +1 -0
  115. package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js +2 -0
  116. package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js.map +1 -0
  117. package/dist/infineon-design-system-stencil/p-959285a7.entry.js +2 -0
  118. package/dist/infineon-design-system-stencil/p-959285a7.entry.js.map +1 -0
  119. package/dist/types/components/alert/alert.d.ts +0 -8
  120. package/dist/types/components/badge/badge.d.ts +0 -2
  121. package/dist/types/components/button/button.d.ts +0 -1
  122. package/dist/types/components/icon/infineonIconStencil.d.ts +0 -1
  123. package/package.json +1 -1
  124. package/dist/cjs/ifx-alert_4.cjs.entry.js +0 -411
  125. package/dist/cjs/ifx-alert_4.cjs.entry.js.map +0 -1
  126. package/dist/cjs/ifx-template.cjs.entry.js.map +0 -1
  127. package/dist/components/p-4e7857ff.js.map +0 -1
  128. package/dist/components/p-7a680ebb.js.map +0 -1
  129. package/dist/components/p-98e17d75.js.map +0 -1
  130. package/dist/esm/ifx-alert_4.entry.js +0 -404
  131. package/dist/esm/ifx-alert_4.entry.js.map +0 -1
  132. package/dist/esm/ifx-template.entry.js.map +0 -1
  133. package/dist/infineon-design-system-stencil/p-baea374a.entry.js +0 -2
  134. package/dist/infineon-design-system-stencil/p-baea374a.entry.js.map +0 -1
  135. package/dist/infineon-design-system-stencil/p-db11ab78.entry.js +0 -2
  136. package/dist/infineon-design-system-stencil/p-db11ab78.entry.js.map +0 -1
@@ -1,404 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-6c9eba32.js';
2
- import { c as classNames } from './index-72ac5051.js';
3
- import { g as getIcon } from './icons-75858876.js';
4
-
5
- const alertCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:block}.alert__info-wrapper{display:flex;padding:16px 24px;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert__info-wrapper .info__text-wrapper{display:flex;flex-direction:column;gap:8px;width:100%}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper{display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper,.alert__info-wrapper .info__text-wrapper .info__description-wrapper{color:#1D1D1D;font-size:16px;font-style:normal;font-weight:600;line-height:24px}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper ::slotted(p),.alert__info-wrapper .info__text-wrapper .info__description-wrapper ::slotted(p){padding:0;margin:0}.alert__info-wrapper .info__text-wrapper .info__description-wrapper{font-weight:400}.alert__info-wrapper .close-icon-wrapper{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.alert__info-wrapper .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert__info-wrapper .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert{display:flex;border:1px solid #0A8276;border-radius:1px;color:#1D1D1D;background-color:#FFFFFF;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert .close-icon-wrapper{display:flex;align-items:center;justify-content:center;min-width:40px}.alert .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert .icon-wrapper{position:relative;min-width:48px;display:flex;justify-content:center;align-items:center;background-color:#0A8276}.alert .alert-text{font-size:16px;width:100%;padding:12px 0px 12px 12px;color:#1D1D1D;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;}.alert.primary{border:1px solid #0A8276}.alert.primary .icon-wrapper{background-color:#0A8276;color:#FFFFFF}.alert.success{border:1px solid #4CA460}.alert.success .icon-wrapper{background-color:#4CA460;color:#FFFFFF}.alert.danger{border:1px solid #CD002F}.alert.danger .icon-wrapper{background-color:#CD002F;color:#FFFFFF}.alert.warning{border:1px solid #E16B25}.alert.warning .icon-wrapper{background-color:#E16B25;color:#FFFFFF}.close-icon-wrapper ifx-icon:hover{cursor:pointer}";
6
- const IfxAlertStyle0 = alertCss;
7
-
8
- const Alert = class {
9
- constructor(hostRef) {
10
- registerInstance(this, hostRef);
11
- this.ifxClose = createEvent(this, "ifxClose", 7);
12
- this.variant = 'primary';
13
- this.closable = true;
14
- this.AriaLive = 'assertive';
15
- this.alertTypeDescription = {
16
- "primary": 'Neutral alert',
17
- "success": 'Success Alert',
18
- "danger": 'Error Alert',
19
- "warning": 'Warning Alert',
20
- "info": 'Neutral alert',
21
- };
22
- }
23
- handleClose() {
24
- this.ifxClose.emit();
25
- }
26
- renderCloseButton() {
27
- return (h("div", { class: "close-icon-wrapper" }, h("button", { onClick: this.handleClose.bind(this), "aria-label": "Dismiss alert" }, h("ifx-icon", { icon: "cross-16" }))));
28
- }
29
- generateUniqueId(prefix = 'id') {
30
- return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;
31
- }
32
- componentWillLoad() {
33
- if (!this.uniqueId) {
34
- this.uniqueId = this.generateUniqueId('alert');
35
- }
36
- this.initalizeTracking();
37
- }
38
- initalizeTracking() {
39
- (function (t, r, kk, n, pp) {
40
- if (typeof window.btntConfig !== "object") {
41
- window.btntConfig = {
42
- domain: "https://ssgtm.infineon.com",
43
- withCookies: true,
44
- maxBatchSize: 10
45
- };
46
- }
47
- if (window["btnt"])
48
- return;
49
- window["btnt"] = function (z) {
50
- if (typeof z !== "object") {
51
- z = {};
52
- }
53
- if (typeof window.btntQueue !== "object") {
54
- window.btntQueue = [];
55
- }
56
- window.btntQueue.push(z);
57
- };
58
- n = t.createElement(r);
59
- pp = t.getElementsByTagName(r)[0];
60
- n.async = 1;
61
- n.src = window.btntConfig.domain + "/btnt.js";
62
- pp.parentNode.insertBefore(n, pp);
63
- })(document, "script");
64
- window.btnt({
65
- event_name: "component_initialized",
66
- component_name: 'ifx-alert',
67
- });
68
- }
69
- render() {
70
- return this.variant === 'info' ? (h("div", { class: "alert__info-wrapper", role: "alert", "aria-live": this.AriaLive, "aria-describedby": this.alertTypeDescription[this.variant], "aria-labelledby": "alert-text alert-description" }, h("div", { class: "info__text-wrapper" }, h("div", { class: "info__headline-wrapper" }, h("slot", { name: "headline" })), h("div", { id: `alert-description-${this.uniqueId}`, class: "info__description-wrapper" }, h("slot", { name: "desc" }))), this.closable ? this.renderCloseButton() : null)) : (h("div", { class: `alert ${this.variant}`, role: "alert" }, this.icon && (h("div", { class: "icon-wrapper" }, h("ifx-icon", { icon: this.icon }))), h("div", { class: "alert-text", id: `alert-text-${this.uniqueId}` }, h("slot", null)), this.closable ? this.renderCloseButton() : null));
71
- }
72
- };
73
- Alert.style = IfxAlertStyle0;
74
-
75
- const badgeCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:inline-flex}.badge__container{display:inline-flex;justify-content:center;align-items:center;padding:4px 8px;gap:8px;border:1px solid #EEEDED;background-color:#EEEDED;border-radius:100px;font-family:var(--ifx-font-family);font-size:0.875rem;line-height:1.25rem;font-weight:400;color:#1D1D1D}";
76
- const IfxBadgeStyle0 = badgeCss;
77
-
78
- const Badge = class {
79
- constructor(hostRef) {
80
- registerInstance(this, hostRef);
81
- }
82
- componentWillLoad() {
83
- this.initalizeTracking();
84
- }
85
- initalizeTracking() {
86
- (function (t, r, kk, n, pp) {
87
- if (typeof window.btntConfig !== "object") {
88
- window.btntConfig = {
89
- domain: "https://ssgtm.infineon.com",
90
- withCookies: true,
91
- maxBatchSize: 10
92
- };
93
- }
94
- if (window["btnt"])
95
- return;
96
- window["btnt"] = function (z) {
97
- if (typeof z !== "object") {
98
- z = {};
99
- }
100
- if (typeof window.btntQueue !== "object") {
101
- window.btntQueue = [];
102
- }
103
- window.btntQueue.push(z);
104
- };
105
- n = t.createElement(r);
106
- pp = t.getElementsByTagName(r)[0];
107
- n.async = 1;
108
- n.src = window.btntConfig.domain + "/btnt.js";
109
- pp.parentNode.insertBefore(n, pp);
110
- })(document, "script");
111
- window.btnt({
112
- event_name: "component_initialized",
113
- component_name: 'ifx-badge',
114
- });
115
- }
116
- render() {
117
- return (h("div", { key: '33d86090a07544f1948ed7cb0f8333797e3dc906', class: "badge__container" }, h("slot", { key: 'ff850dd8ca84d733e48e6b8ba64bf9a6906fa65f' })));
118
- }
119
- };
120
- Badge.style = IfxBadgeStyle0;
121
-
122
- const buttonCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{vertical-align:bottom;display:inline-flex;width:var(--bw, fit-content)}.btn{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0px 16px;gap:8px;color:#FFFFFF;font-weight:600;border-radius:1px;line-height:1.5rem;font-family:var(--ifx-font-family);font-style:normal;text-decoration:none;user-select:none;font-size:1rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;width:var(--bw, fit-content)}.btn:not(.disabled){cursor:pointer}.btn.disabled{pointer-events:none}.btn-default{color:#FFFFFF;background-color:#0A8276}.btn-default:disabled,.btn-default.disabled{background-color:#BFBBBB;color:#FFFFFF;pointer-events:none}.btn-secondary-default{background-color:#FFFFFF;color:#0A8276;border:1px solid #0A8276}.btn-secondary-default:disabled,.btn-secondary-default.disabled{background-color:#FFFFFF;border:1px solid #BFBBBB;color:#BFBBBB;pointer-events:none}.btn-tertiary-default{background-color:transparent;color:#0A8276}.btn-tertiary-default:disabled,.btn-tertiary-default.disabled{color:#BFBBBB;pointer-events:none}.btn-danger{color:#FFFFFF;background-color:#CD002F;border-color:#CD002F}.btn-danger:disabled,.btn-danger.disabled{background-color:#BFBBBB;color:#FFFFFF;pointer-events:none}.btn-secondary-danger{background-color:#FFFFFF;color:#CD002F;border:1px solid #CD002F}.btn-secondary-danger:disabled,.btn-secondary-danger.disabled{background-color:#FFFFFF;border:1px solid #BFBBBB;color:#BFBBBB;pointer-events:none}.btn-tertiary-danger{background-color:transparent;color:#CD002F}.btn-tertiary-danger:disabled,.btn-tertiary-danger.disabled{background-color:#FFFFFF;color:#BFBBBB;pointer-events:none}.btn-inverse{color:#0A8276;background-color:#FFFFFF}.btn-inverse:disabled,.btn-inverse.disabled{opacity:1;background-color:#FFFFFF;color:#0A8276;pointer-events:none}.btn-secondary-inverse{color:#FFFFFF;border:1px solid #FFFFFF}.btn-secondary-inverse:disabled,.btn-secondary-inverse.disabled{border:1px solid #FFFFFF;color:#FFFFFF;pointer-events:none}.btn-tertiary-inverse{color:#FFFFFF}.btn-tertiary-inverse:disabled,.btn-tertiary-inverse.disabled{color:#FFFFFF;opacity:1;pointer-events:none}.btn ifx-icon:empty{display:none}.btn.btn-xs{font-size:0.875rem;height:32px;line-height:1rem}.btn.btn-s{font-size:0.875rem;height:36px;line-height:1.25rem}.btn.btn-l{font-size:1.25rem;height:48px;line-height:1.75rem}.btn.btn-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-default:not(:disabled,.disabled):hover{background-color:#08665C}.btn.btn-default:not(:disabled,.disabled):active,.btn.btn-default:not(:disabled,.disabled).active{background-color:#06534B}.btn.btn-secondary-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-secondary-default:not(:disabled,.disabled):hover{color:#FFFFFF;background-color:#08665C}.btn.btn-secondary-default:not(:disabled,.disabled):active,.btn.btn-secondary-default:not(:disabled,.disabled).active{background-color:#06534B}.btn.btn-secondary:not(:disabled,.disabled):hover{background-color:#9C216E}.btn.btn-secondary:not(:disabled,.disabled):active,.btn.btn-secondary:not(:disabled,.disabled).active{background-color:#9C216E}.btn.btn-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-danger:not(:disabled,.disabled):hover{background-color:#A2001E}.btn.btn-danger:not(:disabled,.disabled):active,.btn.btn-danger:not(:disabled,.disabled).active{background-color:#900021}.btn.btn-secondary-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-secondary-danger:not(:disabled,.disabled):hover{color:#FFFFFF;background-color:#A2001E}.btn.btn-secondary-danger:not(:disabled,.disabled):active,.btn.btn-secondary-danger:not(:disabled,.disabled).active{background-color:#900021}.btn.btn-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-inverse:not(:disabled,.disabled):hover{background-color:#EEEDED}.btn.btn-inverse:not(:disabled,.disabled):active,.btn.btn-inverse:not(:disabled,.disabled).active{background-color:#BFBBBB}.btn.btn-secondary-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-secondary-inverse:not(:disabled,.disabled):hover{color:#0A8276;background-color:#EEEDED}.btn.btn-secondary-inverse:not(:disabled,.disabled):active,.btn.btn-secondary-inverse:not(:disabled,.disabled).active{color:#0A8276;background-color:#BFBBBB}.btn.btn-tertiary-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #08665C}.btn.btn-tertiary-default:not(:disabled,.disabled):hover{color:#08665C}.btn.btn-tertiary-default:not(:disabled,.disabled):active,.btn.btn-tertiary-default:not(:disabled,.disabled).active{color:#06534B}.btn.btn-tertiary-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #A2001E}.btn.btn-tertiary-danger:not(:disabled,.disabled):hover{color:#A2001E}.btn.btn-tertiary-danger:not(:disabled,.disabled):active,.btn.btn-tertiary-danger:not(:disabled,.disabled).active{color:#900021}.btn.btn-tertiary-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-tertiary-inverse:not(:disabled,.disabled):hover{color:#EEEDED}.btn.btn-tertiary-inverse:not(:disabled,.disabled):active,.btn.btn-tertiary-inverse:not(:disabled,.disabled).active{color:#BFBBBB}";
123
- const IfxButtonStyle0 = buttonCss;
124
-
125
- const Button = class {
126
- constructor(hostRef) {
127
- registerInstance(this, hostRef);
128
- this.variant = 'primary';
129
- this.theme = 'default';
130
- this.size = 'm';
131
- this.disabled = false;
132
- this.target = '_self';
133
- this.type = "button";
134
- this.fullWidth = false;
135
- this.handleClick = (ev) => {
136
- if (this.el.shadowRoot) {
137
- const parentForm = this.el.closest('form');
138
- if (parentForm) {
139
- ev.preventDefault();
140
- if (this.type === 'reset') {
141
- // If the button type is 'reset', manually reset all custom form fields
142
- this.resetClickHandler(); //this will reset all ifx-text-fields within a form
143
- }
144
- else {
145
- const fakeButton = document.createElement('button');
146
- if (this.type) {
147
- fakeButton.type = this.type;
148
- }
149
- fakeButton.style.display = 'none';
150
- parentForm.appendChild(fakeButton);
151
- fakeButton.click();
152
- fakeButton.remove();
153
- }
154
- }
155
- }
156
- };
157
- }
158
- setInternalHref(newValue) {
159
- this.internalHref = newValue;
160
- }
161
- async setFocus() {
162
- this.focusableElement.focus();
163
- }
164
- initalizeTracking() {
165
- (function (t, r, kk, n, pp) {
166
- if (typeof window.btntConfig !== "object") {
167
- window.btntConfig = {
168
- domain: "https://ssgtm.infineon.com",
169
- withCookies: true,
170
- maxBatchSize: 10
171
- };
172
- }
173
- if (window["btnt"])
174
- return;
175
- window["btnt"] = function (z) {
176
- if (typeof z !== "object") {
177
- z = {};
178
- }
179
- if (typeof window.btntQueue !== "object") {
180
- window.btntQueue = [];
181
- }
182
- window.btntQueue.push(z);
183
- };
184
- n = t.createElement(r);
185
- pp = t.getElementsByTagName(r)[0];
186
- n.async = 1;
187
- n.src = window.btntConfig.domain + "/btnt.js";
188
- pp.parentNode.insertBefore(n, pp);
189
- })(document, "script");
190
- window.btnt({
191
- event_name: "component_initialized",
192
- component_name: 'ifx-button',
193
- });
194
- }
195
- insertNativeButton() {
196
- this.nativeButton = document.createElement('button');
197
- this.nativeButton.type = this.type;
198
- this.nativeButton.style.display = 'none';
199
- this.el.closest('form').appendChild(this.nativeButton);
200
- }
201
- handleFormAndInternalHref() {
202
- if (this.el.closest('form')) {
203
- if (this.el.href) {
204
- this.el.internalHref = undefined;
205
- }
206
- this.insertNativeButton();
207
- }
208
- else {
209
- this.internalHref = this.href;
210
- }
211
- }
212
- handleButtonWidth() {
213
- if (this.fullWidth) {
214
- this.el.style.setProperty('--bw', '100%');
215
- }
216
- else {
217
- this.el.style.setProperty('--bw', 'fit-content');
218
- }
219
- }
220
- componentWillLoad() {
221
- this.handleFormAndInternalHref();
222
- this.initalizeTracking();
223
- }
224
- componentWillRender() {
225
- this.handleButtonWidth();
226
- }
227
- resetClickHandler() {
228
- const formElement = this.el.closest('form');
229
- const customElements = formElement.querySelectorAll('ifx-text-field, ifx-textarea');
230
- customElements.forEach(element => {
231
- element.reset();
232
- });
233
- }
234
- handleKeyDown(ev) {
235
- if (ev.key === " " || ev.key === 'Enter' && !this.disabled) {
236
- this.focusableElement.click();
237
- }
238
- }
239
- handleHostClick(event) {
240
- if (this.disabled === true) {
241
- event.stopImmediatePropagation();
242
- }
243
- }
244
- handleFocus(event) {
245
- if (this.disabled) {
246
- event.preventDefault();
247
- this.focusableElement.blur();
248
- }
249
- }
250
- render() {
251
- return (h(Host, { key: '35119e058b606986485a2791ac639a9d3281fab2' }, h("a", { key: '026da4c0ce3c1b5bfc6cd25b4157d3b770796982', role: this.href ? 'link' : 'button', tabIndex: this.disabled ? -1 : 0, ref: (el) => (this.focusableElement = el), class: this.getClassNames(), href: !this.disabled ? this.internalHref : undefined, target: this.target, onClick: this.handleClick, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined, onFocus: (event) => this.handleFocus(event), "aria-disabled": this.disabled ? 'true' : null, "aria-describedby": this.theme === 'danger' ? 'Dangerous action' : undefined, "aria-label": this.ariaLabel || undefined }, h("slot", { key: '163281db6953552956521e744e3c0cac7d278639' }))));
252
- }
253
- getVariantClass() {
254
- return `${this.variant}` === "secondary"
255
- ? `secondary-${this.theme}`
256
- : `${this.variant}` === 'tertiary'
257
- ? `tertiary-${this.theme}`
258
- : `${this.theme}`;
259
- }
260
- getSizeClass() {
261
- if (`${this.size}` === "xs") {
262
- return "xs";
263
- }
264
- else if (`${this.size}` === "s") {
265
- return "s";
266
- }
267
- else if (`${this.size}` === "l") {
268
- return "l";
269
- }
270
- else
271
- return "";
272
- }
273
- getClassNames() {
274
- return classNames('btn', this.size && `btn-${this.getSizeClass()}`, `btn-${this.getVariantClass()}`, this.disabled ? 'disabled' : '');
275
- }
276
- get el() { return getElement(this); }
277
- static get watchers() { return {
278
- "href": ["setInternalHref"]
279
- }; }
280
- };
281
- Button.style = IfxButtonStyle0;
282
-
283
- const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
284
- const IfxIconStyle0 = infineonIconStencilCss;
285
-
286
- const InfineonIconStencil = class {
287
- constructor(hostRef) {
288
- registerInstance(this, hostRef);
289
- this.consoleError = createEvent(this, "consoleError", 7);
290
- this.icon = "";
291
- }
292
- updateIcon(newIcon) {
293
- this.internalIcon = newIcon;
294
- this.setIcon();
295
- }
296
- convertStringToHtml(htmlString) {
297
- const div = document.createElement('div');
298
- div.innerHTML = htmlString;
299
- return div.firstChild;
300
- }
301
- convertHtmlToObject(htmlElement) {
302
- let pathToObject = Array
303
- .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
304
- .reduce((acc, current) => {
305
- acc[current.name] = current.value;
306
- return acc;
307
- }, {});
308
- return pathToObject;
309
- }
310
- convertPathsToVnode(htmlPath) {
311
- let svgPaths = [];
312
- const parentPath = this.convertHtmlToObject(htmlPath);
313
- const parentPathToVnode = h("path", parentPath);
314
- svgPaths.push(parentPathToVnode);
315
- if (htmlPath.firstChild) {
316
- const paths = htmlPath.querySelectorAll('path');
317
- const pathLength = htmlPath.querySelectorAll('path').length;
318
- for (let i = 0; i < pathLength; i++) {
319
- let pathToObject = this.convertHtmlToObject(paths[i]);
320
- let objToVnode = h("path", pathToObject);
321
- svgPaths.push(objToVnode);
322
- }
323
- }
324
- return svgPaths;
325
- }
326
- getSVG(svgPath) {
327
- const htmlPath = this.convertStringToHtml(this.ifxIcon);
328
- const width = htmlPath.getAttribute('width');
329
- const height = htmlPath.getAttribute('height');
330
- const fill = htmlPath.getAttribute('fill');
331
- const viewBox = htmlPath.getAttribute('viewBox');
332
- return h("svg", { class: "inline-svg", width: width, height: height, xmlns: "http://www.w3.org/2000/svg", fill: fill, viewBox: viewBox }, ...svgPath);
333
- }
334
- constructIcon() {
335
- if (this.ifxIcon) {
336
- const htmlPath = this.convertStringToHtml(this.ifxIcon);
337
- const svgPath = this.convertPathsToVnode(htmlPath);
338
- const SVG = this.getSVG(svgPath);
339
- return SVG;
340
- }
341
- else if (this.icon !== "") {
342
- console.error('Icon not found!');
343
- this.consoleError.emit(true);
344
- return;
345
- }
346
- else {
347
- return;
348
- }
349
- }
350
- setIcon() {
351
- const toCamelCase = str => str
352
- .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase
353
- .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase
354
- const iconName = toCamelCase(this.internalIcon);
355
- this.ifxIcon = getIcon(iconName);
356
- }
357
- initalizeTracking() {
358
- (function (t, r, kk, n, pp) {
359
- if (typeof window.btntConfig !== "object") {
360
- window.btntConfig = {
361
- domain: "https://ssgtm.infineon.com",
362
- withCookies: true,
363
- maxBatchSize: 10
364
- };
365
- }
366
- if (window["btnt"])
367
- return;
368
- window["btnt"] = function (z) {
369
- if (typeof z !== "object") {
370
- z = {};
371
- }
372
- if (typeof window.btntQueue !== "object") {
373
- window.btntQueue = [];
374
- }
375
- window.btntQueue.push(z);
376
- };
377
- n = t.createElement(r);
378
- pp = t.getElementsByTagName(r)[0];
379
- n.async = 1;
380
- n.src = window.btntConfig.domain + "/btnt.js";
381
- pp.parentNode.insertBefore(n, pp);
382
- })(document, "script");
383
- window.btnt({
384
- event_name: "component_initialized",
385
- component_name: 'ifx-icon',
386
- });
387
- }
388
- componentWillLoad() {
389
- this.internalIcon = this.icon;
390
- this.setIcon();
391
- this.initalizeTracking();
392
- }
393
- render() {
394
- return (h(Host, { key: 'f0a6089e9bb17666f4f69940dca6b55612016fb3' }, this.constructIcon()));
395
- }
396
- static get watchers() { return {
397
- "icon": ["updateIcon"]
398
- }; }
399
- };
400
- InfineonIconStencil.style = IfxIconStyle0;
401
-
402
- export { Alert as ifx_alert, Badge as ifx_badge, Button as ifx_button, InfineonIconStencil as ifx_icon };
403
-
404
- //# sourceMappingURL=ifx-alert_4.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"ifx-alert.ifx-badge.ifx-button.ifx-icon.entry.js","mappings":";;;;AAAA,MAAM,QAAQ,GAAG,8mFAA8mF,CAAC;AAChoF,uBAAe,QAAQ;;MCcV,KAAK;IALlB;;;QAMU,YAAO,GAA0D,SAAS,CAAC;QAG3E,aAAQ,GAAY,IAAI,CAAC;QACzB,aAAQ,GAAG,WAAW,CAAC;QAG/B,yBAAoB,GAAG;YACrB,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,eAAe;SACxB,CAAC;KA6FH;IA3FC,WAAW;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACtB;IAED,iBAAiB;QACf,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,cAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAa,eAAe,IACtE,gBAAU,IAAI,EAAC,UAAU,GAAG,CACrB,CACL,EACN;KACH;IAED,gBAAgB,CAAC,MAAM,GAAG,IAAI;QAC5B,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;KAClE;IAED,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;SAChD;QAED,IAAI,CAAC,iBAAiB,EAAE,CAAA;KAGzB;IAED,iBAAiB;QACf,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;YACxB,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AAC;iBACR;gBACD,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,EAAE;oBACxC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;iBACvB;gBACD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC1B,CAAC;YAEF,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YACvB,EAAE,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;YACZ,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC;YAC9C,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SAEnC,EAAE,QAAQ,EAAE,QAAQ,CAAG,CAAC;QAEzB,MAAM,CAAC,IAAI,CAAC;YACZ,UAAU,EAAE,uBAAuB;YACnC,cAAc,EAAE,UAAU;SACzB,CAAC,CAAA;KACH;IAED,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QACd,IAAI,CAAC,iBAAiB,EAAE,CAAA;KACzB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACJ,IAAI,CAAC,aAAa,EAAE,CACd,EACP;KACH;;;;;;;;;","names":[],"sources":["src/components/alert/alert.scss?tag=ifx-alert&encapsulation=shadow","src/components/alert/alert.tsx","src/components/badge/badge.scss?tag=ifx-badge&encapsulation=shadow","src/components/badge/badge.tsx","src/components/button/button.scss?tag=ifx-button&encapsulation=shadow","src/components/button/button.tsx","src/components/icon/infineonIconStencil.scss?tag=ifx-icon","src/components/icon/infineonIconStencil.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.alert__info-wrapper {\n display: flex;\n padding: 16px 24px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n & .info__text-wrapper {\n display: flex;\n flex-direction: column;\n gap: tokens.$ifxSpace100;\n width: 100%;\n\n & .info__headline-wrapper {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .info__headline-wrapper,\n .info__description-wrapper {\n color: #1D1D1D;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n\n ::slotted(p) {\n padding: 0;\n margin: 0;\n }\n }\n\n & .info__description-wrapper {\n font-weight: 400;\n }\n }\n\n & .close-icon-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n //min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n}\n\n.alert {\n display: flex;\n border: 1px solid tokens.$ifxColorOcean500;\n border-radius: tokens.$ifxBorderRadius12;\n color: tokens.$ifxColorBaseBlack;\n background-color: tokens.$ifxColorBaseWhite;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n\n & .close-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n\n & .icon-wrapper {\n position: relative;\n min-width: tokens.$ifxSize600;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: tokens.$ifxColorOcean500;\n }\n\n & .alert-text {\n font-size: 16px;\n width: 100%;\n padding: 12px 0px 12px 12px;\n color: tokens.$ifxColorBaseBlack;\n\n white-space: pre-wrap;\n /* wraps text at spaces and within words */\n word-wrap: break-word;\n /* breaks text within a word if necessary */\n overflow-wrap: anywhere;\n /* breaks text at arbitrary points when needed */\n }\n\n &.primary {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOcean500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.success {\n border: 1px solid tokens.$ifxColorGreen500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorGreen500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.danger {\n border: 1px solid tokens.$ifxColorRed500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorRed500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.warning {\n border: 1px solid tokens.$ifxColorOrange500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOrange500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n}\n\n.close-icon-wrapper {\n & ifx-icon {\n &:hover {\n cursor: pointer;\n }\n }\n}","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\ndeclare global {\n interface Window {\n btntConfig?: any;\n btntQueue?: any;\n btnt?: any;\n }\n}\n\n@Component({\n tag: 'ifx-alert',\n styleUrl: 'alert.scss',\n shadow: true,\n})\nexport class Alert {\n @Prop() variant: 'primary' | 'success' | 'danger' | 'warning' | 'info' = 'primary';\n @Prop() icon: string;\n @Event() ifxClose: EventEmitter;\n @Prop() closable: boolean = true;\n @Prop() AriaLive = 'assertive';\n @State() uniqueId: string;\n\n alertTypeDescription = {\n \"primary\": 'Neutral alert',\n \"success\": 'Success Alert',\n \"danger\": 'Error Alert',\n \"warning\": 'Warning Alert',\n \"info\": 'Neutral alert',\n };\n\n handleClose() {\n this.ifxClose.emit();\n }\n\n renderCloseButton() {\n return (\n <div class=\"close-icon-wrapper\">\n <button onClick={this.handleClose.bind(this)} aria-label=\"Dismiss alert\">\n <ifx-icon icon=\"cross-16\" />\n </button>\n </div>\n );\n }\n\n generateUniqueId(prefix = 'id') {\n return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n }\n\n componentWillLoad() { \n if (!this.uniqueId) {\n this.uniqueId = this.generateUniqueId('alert');\n }\n\n this.initalizeTracking()\n \n\n }\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-alert',\n })\n }\n\n render() {\n return this.variant === 'info' ? (\n <div class=\"alert__info-wrapper\" role=\"alert\" aria-live={this.AriaLive} aria-describedby={this.alertTypeDescription[this.variant]} aria-labelledby=\"alert-text alert-description\">\n <div class=\"info__text-wrapper\">\n <div class=\"info__headline-wrapper\">\n <slot name=\"headline\" />\n </div>\n <div id={`alert-description-${this.uniqueId}`} class=\"info__description-wrapper\">\n <slot name=\"desc\" />\n </div>\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n ) : (\n <div class={`alert ${this.variant}`} role=\"alert\">\n {this.icon && (\n <div class=\"icon-wrapper\">\n <ifx-icon icon={this.icon} />\n </div>\n )}\n <div class=\"alert-text\" id={`alert-text-${this.uniqueId}`}>\n <slot />\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n );\n }\n}\n","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: inline-flex;\n}\n\n.badge__container {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 4px 8px;\n gap: tokens.$ifxSpace100;\n border: 1px solid tokens.$ifxColorEngineering200;\n background-color: tokens.$ifxColorEngineering200;\n border-radius: 100px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n font-size: tokens.$ifxFontSizeS;\n line-height: tokens.$ifxLineHeightS;\n font-weight: 400;\n color: tokens.$ifxColorBaseBlack;\n}","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'ifx-badge',\n styleUrl: 'badge.scss',\n shadow: true\n})\nexport class Badge {\n\n componentWillLoad() { \n this.initalizeTracking()\n }\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-badge',\n })\n }\n\n render() {\n return (\n <div class=\"badge__container\">\n <slot />\n </div>\n );\n }\n}","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n vertical-align: bottom;\n display: inline-flex;\n width: var(--bw, fit-content);\n}\n\n.btn {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: tokens.$ifxSize500;\n padding: 0px tokens.$ifxSpace200;\n gap: tokens.$ifxSpace100;\n color: tokens.$ifxColorBaseWhite;\n font-weight: tokens.$ifxFontWeightSemibold;\n border-radius: tokens.$ifxBorderRadius12;\n line-height: tokens.$ifxLineHeightM;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n font-style: normal;\n text-decoration: none;\n user-select: none;\n font-size: tokens.$ifxFontSizeM;\n transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;\n width: var(--bw, fit-content);\n}\n\n.btn:not(.disabled) {\n cursor: pointer;\n}\n\n.btn.disabled {\n pointer-events: none;\n}\n\n.btn-default {\n //default variant=primary; default color=default\n color: tokens.$ifxColorBaseWhite;\n background-color: tokens.$ifxColorOcean500;\n\n &:disabled,\n &.disabled {\n background-color: tokens.$ifxColorEngineering300;\n color: tokens.$ifxColorBaseWhite;\n pointer-events: none;\n\n }\n}\n\n.btn-secondary-default {\n background-color: tokens.$ifxColorBaseWhite;\n color: tokens.$ifxColorOcean500;\n border: 1px solid tokens.$ifxColorOcean500;\n\n &:disabled,\n &.disabled {\n background-color: tokens.$ifxColorBaseWhite;\n border: 1px solid tokens.$ifxColorEngineering300;\n color: tokens.$ifxColorEngineering300;\n pointer-events: none;\n\n }\n}\n\n.btn-tertiary-default {\n background-color: tokens.$ifxColorBaseTransparent;\n color: tokens.$ifxColorOcean500;\n\n &:disabled,\n &.disabled {\n color: tokens.$ifxColorEngineering300;\n pointer-events: none;\n\n }\n}\n\n\n.btn-danger {\n color: tokens.$ifxColorBaseWhite;\n background-color: tokens.$ifxColorRed500;\n border-color: tokens.$ifxColorRed500;\n\n &:disabled,\n &.disabled {\n background-color: tokens.$ifxColorEngineering300;\n color: tokens.$ifxColorBaseWhite;\n pointer-events: none;\n\n }\n}\n\n.btn-secondary-danger {\n background-color: tokens.$ifxColorBaseWhite;\n color: tokens.$ifxColorRed500;\n border: 1px solid tokens.$ifxColorRed500;\n\n &:disabled,\n &.disabled {\n background-color: tokens.$ifxColorBaseWhite;\n border: 1px solid tokens.$ifxColorEngineering300;\n color: tokens.$ifxColorEngineering300;\n pointer-events: none;\n\n }\n}\n\n.btn-tertiary-danger {\n //combination tertiary + danger not in design\n background-color: tokens.$ifxColorBaseTransparent;\n color: tokens.$ifxColorRed500;\n\n &:disabled,\n &.disabled {\n background-color: tokens.$ifxColorBaseWhite;\n color: tokens.$ifxColorEngineering300;\n pointer-events: none;\n\n }\n}\n\n.btn-inverse {\n color: tokens.$ifxColorOcean500;\n background-color: tokens.$ifxColorBaseWhite;\n\n &:disabled,\n &.disabled {\n opacity: tokens.$ifxOpacity100;\n background-color: tokens.$ifxColorBaseWhite;\n color: tokens.$ifxColorOcean500;\n pointer-events: none;\n }\n}\n\n.btn-secondary-inverse {\n color: tokens.$ifxColorBaseWhite;\n border: 1px solid tokens.$ifxColorBaseWhite;\n\n &:disabled,\n &.disabled {\n border: 1px solid tokens.$ifxColorBaseWhite;\n color: tokens.$ifxColorBaseWhite;\n pointer-events: none;\n\n }\n}\n\n\n.btn-tertiary-inverse {\n color: tokens.$ifxColorBaseWhite;\n\n &:disabled,\n &.disabled {\n color: tokens.$ifxColorBaseWhite;\n opacity: tokens.$ifxOpacity100;\n pointer-events: none;\n\n }\n}\n\n.btn {\n & ifx-icon:empty {\n display: none;\n }\n\n &.btn-xs {\n font-size: tokens.$ifxFontSizeS;\n height: tokens.$ifxSize400;\n line-height: tokens.$ifxLineHeightXs;\n }\n\n &.btn-s {\n font-size: tokens.$ifxFontSizeS;\n height: tokens.$ifxSize450;\n line-height: tokens.$ifxLineHeightS;\n }\n\n // &.btn-m { //default\n // font-size: tokens.$ifxFontSizeM;\n // height: tokens.$ifxSize400;\n // line-height: tokens.$ifxLineHeightM;\n // }\n\n\n &.btn-l {\n font-size: tokens.$ifxFontSizeXl;\n height: tokens.$ifxSize600;\n line-height: tokens.$ifxLineHeightXl;\n }\n\n\n\n &.btn-default:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorOcean500;\n }\n\n &:hover {\n background-color: tokens.$ifxColorOcean600;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorOcean700;\n }\n }\n\n &.btn-secondary-default:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorOcean500;\n }\n\n &:hover {\n color: tokens.$ifxColorBaseWhite;\n background-color: tokens.$ifxColorOcean600;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorOcean700;\n }\n }\n\n &.btn-secondary:not(:disabled, .disabled) {\n\n &:hover {\n background-color: tokens.$ifxColorBerry500;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorBerry500;\n }\n }\n\n\n\n &.btn-danger:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorOcean500;\n }\n\n &:hover {\n background-color: tokens.$ifxColorRed600;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorRed700;\n }\n }\n\n &.btn-secondary-danger:not(:disabled, .disabled) {\n\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorOcean500;\n }\n\n &:hover {\n color: tokens.$ifxColorBaseWhite;\n background-color: tokens.$ifxColorRed600;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorRed700;\n }\n }\n\n\n &.btn-inverse:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorOcean500, 0 0 0 4px tokens.$ifxColorBaseWhite;\n }\n\n &:hover {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &:active,\n &.active {\n background-color: tokens.$ifxColorEngineering300;\n }\n }\n\n &.btn-secondary-inverse:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorOcean500, 0 0 0 4px tokens.$ifxColorBaseWhite;\n }\n\n &:hover {\n color: tokens.$ifxColorOcean500;\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &:active,\n &.active {\n color: tokens.$ifxColorOcean500;\n background-color: tokens.$ifxColorEngineering300;\n }\n }\n\n\n\n &.btn-tertiary-default:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorOcean600;\n }\n\n &:hover {\n color: tokens.$ifxColorOcean600;\n }\n\n &:active,\n &.active {\n color: tokens.$ifxColorOcean700;\n }\n\n\n }\n\n\n\n\n\n &.btn-tertiary-danger:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorBaseWhite, 0 0 0 4px tokens.$ifxColorRed600;\n }\n\n &:hover {\n color: tokens.$ifxColorRed600;\n }\n\n &:active,\n &.active {\n color: tokens.$ifxColorRed700;\n }\n\n }\n\n\n &.btn-tertiary-inverse:not(:disabled, .disabled) {\n &:focus:not(:active, .active) {\n outline: none;\n box-shadow: 0 0 0 2px tokens.$ifxColorOcean500, 0 0 0 4px tokens.$ifxColorBaseWhite;\n }\n\n &:hover {\n color: tokens.$ifxColorEngineering200;\n\n }\n\n &:active,\n &.active {\n color: tokens.$ifxColorEngineering300;\n }\n }\n}","import { Component, Prop, h, Host, Method, Element, Listen, State, Watch } from '@stencil/core';\nimport classNames from 'classnames';\n \n\n@Component({\n tag: 'ifx-button',\n styleUrl: 'button.scss',\n shadow: true,\n})\nexport class Button {\n @Prop() variant: 'primary' | 'secondary' | 'tertiary' = 'primary';\n @Prop() theme: 'default' | 'danger' | 'inverse' = 'default';\n @Prop() size: string = 'm';\n @Prop() disabled: boolean = false;\n @State() internalHref: string;\n @Prop() href: string;\n @Prop() target: string = '_self';\n @Prop() type: \"button\" | \"submit\" | \"reset\" = \"button\";\n @Prop() fullWidth: boolean = false;\n @Prop() ariaLabel: string | null;\n @Element() el;\n\n private focusableElement: HTMLElement;\n private nativeButton: HTMLButtonElement | HTMLInputElement;\n\n @Watch('href')\n setInternalHref(newValue: string) {\n this.internalHref = newValue;\n }\n\n @Method()\n async setFocus() {\n this.focusableElement.focus();\n }\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-button',\n })\n }\n\n insertNativeButton() {\n this.nativeButton = document.createElement('button');\n this.nativeButton.type = this.type;\n this.nativeButton.style.display = 'none';\n this.el.closest('form').appendChild(this.nativeButton);\n }\n\n handleFormAndInternalHref() {\n if (this.el.closest('form')) {\n if (this.el.href) {\n this.el.internalHref = undefined;\n }\n this.insertNativeButton()\n } else {\n this.internalHref = this.href;\n }\n }\n\n handleButtonWidth() {\n if (this.fullWidth) {\n this.el.style.setProperty('--bw', '100%');\n } else {\n this.el.style.setProperty('--bw', 'fit-content');\n }\n }\n\n componentWillLoad() {\n this.handleFormAndInternalHref()\n this.initalizeTracking()\n }\n\n componentWillRender() {\n this.handleButtonWidth()\n }\n\n\n\n handleClick = (ev: Event) => {\n if (this.el.shadowRoot) {\n const parentForm = this.el.closest('form');\n if (parentForm) {\n ev.preventDefault();\n\n if (this.type === 'reset') {\n // If the button type is 'reset', manually reset all custom form fields\n this.resetClickHandler(); //this will reset all ifx-text-fields within a form\n } else {\n const fakeButton = document.createElement('button');\n if (this.type) {\n fakeButton.type = this.type;\n }\n fakeButton.style.display = 'none';\n parentForm.appendChild(fakeButton);\n fakeButton.click();\n fakeButton.remove();\n }\n }\n }\n }\n\n resetClickHandler() {\n const formElement = this.el.closest('form');\n const customElements = formElement.querySelectorAll('ifx-text-field, ifx-textarea');\n customElements.forEach(element => {\n element.reset();\n });\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if ( ev.key === \" \" || ev.key === 'Enter' && !this.disabled) {\n this.focusableElement.click();\n }\n }\n\n @Listen('click', { capture: true })\n handleHostClick(event: Event) {\n if (this.disabled === true) {\n event.stopImmediatePropagation();\n }\n }\n\n handleFocus(event: FocusEvent) {\n if (this.disabled) {\n event.preventDefault();\n this.focusableElement.blur();\n }\n }\n\n render() {\n return (\n <Host>\n <a\n role={this.href ? 'link' : 'button'}\n tabIndex={this.disabled ? -1 : 0}\n ref={(el) => (this.focusableElement = el)}\n class={this.getClassNames()}\n href={!this.disabled ? this.internalHref : undefined}\n target={this.target}\n onClick={this.handleClick}\n rel={this.target === '_blank' ? 'noopener noreferrer' : undefined}\n onFocus={(event) => this.handleFocus(event)}\n aria-disabled={this.disabled ? 'true' : null}\n aria-describedby={this.theme === 'danger' ? 'Dangerous action' : undefined}\n aria-label={this.ariaLabel || undefined}\n >\n <slot></slot>\n </a>\n </Host>\n );\n }\n\n\n getVariantClass() {\n return `${this.variant}` === \"secondary\"\n ? `secondary-${this.theme}`\n : `${this.variant}` === 'tertiary'\n ? `tertiary-${this.theme}`\n : `${this.theme}`;\n }\n\n getSizeClass() {\n if (`${this.size}` === \"xs\") {\n return \"xs\"\n }\n else if (`${this.size}` === \"s\") {\n return \"s\"\n }\n else if (`${this.size}` === \"l\") {\n return \"l\"\n }\n else return \"\";\n }\n\n getClassNames() {\n return classNames(\n 'btn',\n this.size && `btn-${this.getSizeClass()}`,\n `btn-${this.getVariantClass()}`,\n this.disabled ? 'disabled' : ''\n );\n }\n}","ifx-icon {\n display: inline-flex;\n justify-content: center;\n\n &:empty {\n display: none;\n }\n}","import { Component, Prop, h, Host, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { getIcon } from '@infineon/infineon-icons'\n \n\n\n@Component({\n tag: 'ifx-icon',\n styleUrl: './infineonIconStencil.scss'\n})\n\nexport class InfineonIconStencil {\n @Prop({ mutable: true }) icon: string = \"\"\n @Prop({ mutable: true }) ifxIcon: any;\n @State() internalIcon: string;\n @Event() consoleError: EventEmitter<boolean>;\n\n @Watch('icon')\n updateIcon(newIcon: string) { \n this.internalIcon = newIcon;\n this.setIcon()\n }\n\n convertStringToHtml(htmlString) { \n const div = document.createElement('div')\n div.innerHTML = htmlString\n return div.firstChild\n }\n\n convertHtmlToObject(htmlElement) { \n let pathToObject = Array\n .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))\n .reduce((acc, current) => {\n acc[current.name] = current.value\n return acc\n }, {})\n\n return pathToObject\n }\n\n convertPathsToVnode(htmlPath) { \n let svgPaths = []\n const parentPath = this.convertHtmlToObject(htmlPath);\n const parentPathToVnode = h(\"path\", parentPath);\n svgPaths.push(parentPathToVnode)\n if(htmlPath.firstChild) { \n const paths = htmlPath.querySelectorAll('path');\n const pathLength = htmlPath.querySelectorAll('path').length;\n for(let i = 0; i < pathLength; i++) { \n let pathToObject = this.convertHtmlToObject(paths[i])\n let objToVnode = h(\"path\", pathToObject)\n svgPaths.push(objToVnode)\n } \n }\n return svgPaths\n }\n\n getSVG(svgPath) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon) as SVGElement;\n const width = htmlPath.getAttribute('width');\n const height = htmlPath.getAttribute('height');\n const fill = htmlPath.getAttribute('fill');\n const viewBox = htmlPath.getAttribute('viewBox');\n \n return <svg class=\"inline-svg\" width={width} height={height} xmlns=\"http://www.w3.org/2000/svg\" fill={fill} viewBox={viewBox}>{...svgPath}</svg>\n }\n\n constructIcon() {\n if(this.ifxIcon) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon)\n const svgPath = this.convertPathsToVnode(htmlPath)\n const SVG = this.getSVG(svgPath)\n return SVG;\n } else if(this.icon !== \"\") {\n console.error('Icon not found!')\n this.consoleError.emit(true)\n return;\n } else { \n return;\n }\n }\n\nsetIcon() { \n const toCamelCase = str =>\n str\n .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase\n .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase\n\n const iconName = toCamelCase(this.internalIcon);\n this.ifxIcon = getIcon(iconName);\n}\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-icon',\n })\n }\n\n componentWillLoad() {\n this.internalIcon = this.icon;\n this.setIcon()\n this.initalizeTracking()\n }\n\n render() {\n return (\n <Host>\n {this.constructIcon()}\n </Host>\n );\n }\n}"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"ifx-template.entry.js","mappings":";;AAAA,MAAM,WAAW,GAAG,4oCAA4oC,CAAC;AACjqC,0BAAe,WAAW;;MCMb,QAAQ;IALrB;;;;QAOW,gBAAW,GAAsD,E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AE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,EACpJ,aAAO,KAAK,EAAC,YAAY,EAAC,OAAO,EAAC,KAAK,UAAY,YAC/C,CACF,EAGN,WAAK,KAAK,EAAC,uBAAuB,IAChC,sBAAgB,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,WAAW,EAAC,sBAAsB,sBAAiC,EAE9K,sBAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,EAAC,6BAA6B,6BAAwC,EAE5L,kBAAY,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAC,SAAS,wBAA+B,CAC/G,CAEF,CACF,CACF,EACN;KACL;;;;;;;","names":[],"sources":["src/components/templates/template/template.scss?tag=ifx-template&encapsulation=shadow","src/components/templates/template/template.tsx"],"sourcesContent":["\n.react__template-wrapper { \n display: flex;\n width: 300px;\n height: 200px;\n border-radius: 3px;\n border: 1px solid #ccc;\n\n &.hide { \n display: none;\n }\n \n &:hover { \n cursor: pointer;\n }\n}\n\n.template__page-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n & .repository__url { \n text-decoration: none;\n }\n}\n\n.input__fields-wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n\n}\n\n.details__wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.selection__buttons-wrapper { \n display: flex;\n gap: 10px;\n padding-top: 10px;\n align-items: center;\n & .vue__label { \n color: #ccc;\n }\n\n & label:not(.vue__label) { \n &:hover { \n cursor: pointer;\n }\n }\n\n & .selection__input { \n display: flex;\n align-items: center;\n gap: 5px;\n & input { \n margin: 0;\n height: 20px;\n width: 20px;\n &:hover:not(.vue__input) { \n cursor: pointer;\n }\n }\n }\n}\n\n.image__wrapper { \n img { \n position: relative;\n width: 300px;\n height: 100%;\n border-radius: 3px;\n object-fit: contain;\n transition: transform .2s;\n &:hover { \n transform: scale(2);\n top: 50px;\n z-index: 100;\n }\n }\n}","import { Component, h, Element, State, Prop, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-template',\n styleUrl: 'template.scss',\n shadow: true,\n})\nexport class Template {\n @Element() el: HTMLElement;\n @State() repoDetails: { name: string, desc: string, framework: string } = { name: \"\", desc: \"\", framework: \"\" };\n @State() repoUrl: string;\n @State() showDetails: boolean = false;\n @State() isTemplatePage: boolean = false;\n @State() isLoading: boolean = true;\n @State() repoError: string;\n @Prop() name: string;\n @Event() toggleTemplates: EventEmitter;\n @Event() fieldError: EventEmitter;\n @Prop() thumbnail: string;\n \n private clientId = 'Ov23lixmXiNTTNb6V5W6'\n private redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';\n private scope = 'repo workflow'\n private state = 'template123'\n\n authUser() { \n const authorizationUrl = `https://github.com/login/oauth/authorize?` +\n `client_id=${this.clientId}&` +\n `redirect_uri=${this.redirectUri}&` +\n `scope=${this.scope}&` +\n `state=${this.state}`;\n \n window.open(authorizationUrl, '_blank'); \n }\n\n componentDidLoad() { \n const url = new URL(window.location.href);\n const code = url.searchParams.get('code');\n const { templateName } = this.getLocalStorageValues()\n if(code && this.name === templateName) { \n this.isTemplatePage = true;\n this.toggleTemplates.emit('details')\n this.getUserToken(code)\n } \n }\n\n getLocalStorageValues() { \n const repoName = localStorage.getItem('repo_name');\n const repoDesc = localStorage.getItem('repo_desc');\n const repoFramework = localStorage.getItem('repo_framework');\n const templateName = localStorage.getItem('selectedTemplate');\n return { repoName, repoDesc, repoFramework, templateName }\n }\n\n async getUserToken(authCode) {\n const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();\n\n fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)\n .then(response => {\n if (response.ok) {\n return response.text();\n } else {\n return response.text().then(errorMessage => {\n throw new Error(errorMessage);\n });\n }\n })\n .then(data => { \n if(data) { \n this.isLoading = false;\n this.repoUrl = data;\n localStorage.clear();\n } \n })\n .catch(error => {\n this.repoError = error.message;\n console.error('Error:', error.message)\n });\n }\n\n handleUserInput(e, type) { \n if (type === 'name') {\n this.repoDetails = { ...this.repoDetails, name: e.target.value };\n } else if (type === 'desc') {\n this.repoDetails = { ...this.repoDetails, desc: e.target.value };\n } else if(type === 'framework') { \n this.repoDetails = { ...this.repoDetails, framework: e.target.value };\n }\n }\n\n submitUserData() { \n if(this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) { \n localStorage.setItem('repo_name', this.repoDetails.name);\n localStorage.setItem('repo_desc', this.repoDetails.desc);\n localStorage.setItem('repo_framework', this.repoDetails.framework);\n localStorage.setItem('selectedTemplate', this.name);\n this.fieldError.emit(false)\n this.authUser()\n } else { \n this.fieldError.emit('All fields are mandatory')\n }\n }\n\n togglePadding(action) { \n let parent = this.el.parentElement;\n if (parent) {\n const rootNode = parent.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n parent = rootNode.host.parentElement;\n } else {\n parent = parent.parentElement;\n }\n if(action === 'remove') { \n parent.parentElement.style.padding = '0px';\n } else if(action === 'add') { \n parent.parentElement.style.padding = '4rem 20px';\n }\n }\n }\n\n handleCurrentTemplate(e) { \n if(e && !this.showDetails) { \n this.togglePadding('remove')\n const targetTemplate = e.currentTarget;\n this.toggleTemplates.emit(targetTemplate)\n this.showDetails = true;\n } \n }\n\n @Method()\n async toggleTemplate(currTemp) { \n const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');\n if(templateWrapper) { \n if(!templateWrapper.classList.contains('hide') && currTemp ) { \n if(templateWrapper !== currTemp) {\n templateWrapper.classList.add('hide')\n }\n } else { \n if(this.showDetails) { \n this.showDetails = false;\n }\n this.togglePadding('add')\n templateWrapper.classList.remove('hide')\n }\n }\n }\n\n \n render() {\n return (\n <div>\n {this.isTemplatePage \n ? \n <div class=\"template__page-wrapper\">\n {!this.repoUrl && !this.repoError && \n <div>\n <h3>Your repository is getting ready..</h3>\n <p>This will only take a minute.</p>\n </div>}\n {this.isLoading && !this.repoError && <div><ifx-spinner variant='default' size='s' /></div>}\n {this.repoUrl && <ifx-link href={this.repoUrl} target=\"_parent\" size=\"m\" variant=\"underlined\">Your repository</ifx-link>}\n {this.repoError && <div>{this.repoError}</div>}\n </div> \n : \n <div class=\"react__template-container\">\n <div class=\"react__template-wrapper\" onClick={(e) => this.handleCurrentTemplate(e)}>\n <div class=\"image__wrapper\">\n <img src={this.thumbnail} />\n </div>\n </div>\n {this.showDetails && \n <div class=\"details__wrapper\">\n <div class=\"selection__buttons-wrapper\">\n <div class=\"selection__input\">\n <input type=\"radio\" id=\"react\" name=\"chosen_framework\" value=\"react\" onInput={(e) => this.handleUserInput(e, 'framework')} />\n <label htmlFor=\"react\">React</label>\n </div>\n <div class=\"selection__input vue\">\n <input class=\"vue__input\" disabled type=\"radio\" id=\"vue\" name=\"chosen_framework\" value=\"vue\" onInput={(e) => this.handleUserInput(e, 'framework')}/>\n <label class=\"vue__label\" htmlFor=\"vue\">Vue</label> (Soon)\n </div>\n </div>\n \n\n <div class=\"input__fields-wrapper\">\n <ifx-text-field required={true} onInput={(e) => this.handleUserInput(e, 'name')} size=\"m\" icon=\"c-info-16\" placeholder=\"Your repository name\">Repository Name</ifx-text-field>\n\n <ifx-text-field required={true} size=\"m\" icon=\"c-info-16\" onInput={(e) => this.handleUserInput(e, 'desc')} placeholder=\"Your repository description\">Repository Description</ifx-text-field>\n\n <ifx-button fullWidth={true} onClick={() => this.submitUserData()} variant='primary'>Generate template</ifx-button>\n </div>\n \n </div>}\n </div>}\n </div>\n );\n }\n}"],"version":3}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as i,g as r}from"./p-b7a462e5.js";const s=".react__template-wrapper{display:flex;width:300px;height:200px;border-radius:3px;border:1px solid #ccc}.react__template-wrapper.hide{display:none}.react__template-wrapper:hover{cursor:pointer}.template__page-wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.template__page-wrapper .repository__url{text-decoration:none}.input__fields-wrapper{display:flex;flex-direction:column;gap:10px}.details__wrapper{display:flex;flex-direction:column;gap:10px}.selection__buttons-wrapper{display:flex;gap:10px;padding-top:10px;align-items:center}.selection__buttons-wrapper .vue__label{color:#ccc}.selection__buttons-wrapper label:not(.vue__label):hover{cursor:pointer}.selection__buttons-wrapper .selection__input{display:flex;align-items:center;gap:5px}.selection__buttons-wrapper .selection__input input{margin:0;height:20px;width:20px}.selection__buttons-wrapper .selection__input input:hover:not(.vue__input){cursor:pointer}.image__wrapper img{position:relative;width:300px;height:100%;border-radius:3px;object-fit:contain;transition:transform 0.2s}.image__wrapper img:hover{transform:scale(2);top:50px;z-index:100}";const a=s;const o=class{constructor(i){e(this,i);this.toggleTemplates=t(this,"toggleTemplates",7);this.fieldError=t(this,"fieldError",7);this.repoDetails={name:"",desc:"",framework:""};this.showDetails=false;this.isTemplatePage=false;this.isLoading=true;this.clientId="Ov23lixmXiNTTNb6V5W6";this.redirectUri="https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development";this.scope="repo workflow";this.state="template123"}authUser(){const e=`https://github.com/login/oauth/authorize?`+`client_id=${this.clientId}&`+`redirect_uri=${this.redirectUri}&`+`scope=${this.scope}&`+`state=${this.state}`;window.open(e,"_blank")}componentDidLoad(){const e=new URL(window.location.href);const t=e.searchParams.get("code");const{templateName:i}=this.getLocalStorageValues();if(t&&this.name===i){this.isTemplatePage=true;this.toggleTemplates.emit("details");this.getUserToken(t)}}getLocalStorageValues(){const e=localStorage.getItem("repo_name");const t=localStorage.getItem("repo_desc");const i=localStorage.getItem("repo_framework");const r=localStorage.getItem("selectedTemplate");return{repoName:e,repoDesc:t,repoFramework:i,templateName:r}}async getUserToken(e){const{repoName:t,repoDesc:i,repoFramework:r,templateName:s}=this.getLocalStorageValues();fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${e}/${t}/${i}/${r}/${s}`).then((e=>{if(e.ok){return e.text()}else{return e.text().then((e=>{throw new Error(e)}))}})).then((e=>{if(e){this.isLoading=false;this.repoUrl=e;localStorage.clear()}})).catch((e=>{this.repoError=e.message;console.error("Error:",e.message)}))}handleUserInput(e,t){if(t==="name"){this.repoDetails=Object.assign(Object.assign({},this.repoDetails),{name:e.target.value})}else if(t==="desc"){this.repoDetails=Object.assign(Object.assign({},this.repoDetails),{desc:e.target.value})}else if(t==="framework"){this.repoDetails=Object.assign(Object.assign({},this.repoDetails),{framework:e.target.value})}}submitUserData(){if(this.repoDetails.name&&this.repoDetails.desc&&this.repoDetails.framework){localStorage.setItem("repo_name",this.repoDetails.name);localStorage.setItem("repo_desc",this.repoDetails.desc);localStorage.setItem("repo_framework",this.repoDetails.framework);localStorage.setItem("selectedTemplate",this.name);this.fieldError.emit(false);this.authUser()}else{this.fieldError.emit("All fields are mandatory")}}togglePadding(e){let t=this.el.parentElement;if(t){const i=t.getRootNode();if(i instanceof ShadowRoot){t=i.host.parentElement}else{t=t.parentElement}if(e==="remove"){t.parentElement.style.padding="0px"}else if(e==="add"){t.parentElement.style.padding="4rem 20px"}}}handleCurrentTemplate(e){if(e&&!this.showDetails){this.togglePadding("remove");const t=e.currentTarget;this.toggleTemplates.emit(t);this.showDetails=true}}async toggleTemplate(e){const t=this.el.shadowRoot.querySelector(".react__template-wrapper");if(t){if(!t.classList.contains("hide")&&e){if(t!==e){t.classList.add("hide")}}else{if(this.showDetails){this.showDetails=false}this.togglePadding("add");t.classList.remove("hide")}}}render(){return i("div",{key:"993f20bb1a7970d938d09ea001ee77b777d2a817"},this.isTemplatePage?i("div",{class:"template__page-wrapper"},!this.repoUrl&&!this.repoError&&i("div",null,i("h3",null,"Your repository is getting ready.."),i("p",null,"This will only take a minute.")),this.isLoading&&!this.repoError&&i("div",null,i("ifx-spinner",{variant:"default",size:"s"})),this.repoUrl&&i("ifx-link",{href:this.repoUrl,target:"_parent",size:"m",variant:"underlined"},"Your repository"),this.repoError&&i("div",null,this.repoError)):i("div",{class:"react__template-container"},i("div",{class:"react__template-wrapper",onClick:e=>this.handleCurrentTemplate(e)},i("div",{class:"image__wrapper"},i("img",{src:this.thumbnail}))),this.showDetails&&i("div",{class:"details__wrapper"},i("div",{class:"selection__buttons-wrapper"},i("div",{class:"selection__input"},i("input",{type:"radio",id:"react",name:"chosen_framework",value:"react",onInput:e=>this.handleUserInput(e,"framework")}),i("label",{htmlFor:"react"},"React")),i("div",{class:"selection__input vue"},i("input",{class:"vue__input",disabled:true,type:"radio",id:"vue",name:"chosen_framework",value:"vue",onInput:e=>this.handleUserInput(e,"framework")}),i("label",{class:"vue__label",htmlFor:"vue"},"Vue")," (Soon)")),i("div",{class:"input__fields-wrapper"},i("ifx-text-field",{required:true,onInput:e=>this.handleUserInput(e,"name"),size:"m",icon:"c-info-16",placeholder:"Your repository name"},"Repository Name"),i("ifx-text-field",{required:true,size:"m",icon:"c-info-16",onInput:e=>this.handleUserInput(e,"desc"),placeholder:"Your repository description"},"Repository Description"),i("ifx-button",{fullWidth:true,onClick:()=>this.submitUserData(),variant:"primary"},"Generate template")))))}get el(){return r(this)}};o.style=a;export{o as ifx_template};
2
- //# sourceMappingURL=p-baea374a.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["templateCss","IfxTemplateStyle0","Template","constructor","hostRef","this","repoDetails","name","desc","framework","showDetails","isTemplatePage","isLoading","clientId","redirectUri","scope","state","authUser","authorizationUrl","window","open","componentDidLoad","url","URL","location","href","code","searchParams","get","templateName","getLocalStorageValues","toggleTemplates","emit","getUserToken","repoName","localStorage","getItem","repoDesc","repoFramework","authCode","fetch","then","response","ok","text","errorMessage","Error","data","repoUrl","clear","catch","error","repoError","message","console","handleUserInput","e","type","Object","assign","target","value","submitUserData","setItem","fieldError","togglePadding","action","parent","el","parentElement","rootNode","getRootNode","ShadowRoot","host","style","padding","handleCurrentTemplate","targetTemplate","currentTarget","toggleTemplate","currTemp","templateWrapper","shadowRoot","querySelector","classList","contains","add","remove","render","h","key","class","variant","size","onClick","src","thumbnail","id","onInput","htmlFor","disabled","required","icon","placeholder","fullWidth"],"sources":["src/components/templates/template/template.scss?tag=ifx-template&encapsulation=shadow","src/components/templates/template/template.tsx"],"sourcesContent":["\n.react__template-wrapper { \n display: flex;\n width: 300px;\n height: 200px;\n border-radius: 3px;\n border: 1px solid #ccc;\n\n &.hide { \n display: none;\n }\n \n &:hover { \n cursor: pointer;\n }\n}\n\n.template__page-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n & .repository__url { \n text-decoration: none;\n }\n}\n\n.input__fields-wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n\n}\n\n.details__wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.selection__buttons-wrapper { \n display: flex;\n gap: 10px;\n padding-top: 10px;\n align-items: center;\n & .vue__label { \n color: #ccc;\n }\n\n & label:not(.vue__label) { \n &:hover { \n cursor: pointer;\n }\n }\n\n & .selection__input { \n display: flex;\n align-items: center;\n gap: 5px;\n & input { \n margin: 0;\n height: 20px;\n width: 20px;\n &:hover:not(.vue__input) { \n cursor: pointer;\n }\n }\n }\n}\n\n.image__wrapper { \n img { \n position: relative;\n width: 300px;\n height: 100%;\n border-radius: 3px;\n object-fit: contain;\n transition: transform .2s;\n &:hover { \n transform: scale(2);\n top: 50px;\n z-index: 100;\n }\n }\n}","import { Component, h, Element, State, Prop, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-template',\n styleUrl: 'template.scss',\n shadow: true,\n})\nexport class Template {\n @Element() el: HTMLElement;\n @State() repoDetails: { name: string, desc: string, framework: string } = { name: \"\", desc: \"\", framework: \"\" };\n @State() repoUrl: string;\n @State() showDetails: boolean = false;\n @State() isTemplatePage: boolean = false;\n @State() isLoading: boolean = true;\n @State() repoError: string;\n @Prop() name: string;\n @Event() toggleTemplates: EventEmitter;\n @Event() fieldError: EventEmitter;\n @Prop() thumbnail: string;\n \n private clientId = 'Ov23lixmXiNTTNb6V5W6'\n private redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';\n private scope = 'repo workflow'\n private state = 'template123'\n\n authUser() { \n const authorizationUrl = `https://github.com/login/oauth/authorize?` +\n `client_id=${this.clientId}&` +\n `redirect_uri=${this.redirectUri}&` +\n `scope=${this.scope}&` +\n `state=${this.state}`;\n \n window.open(authorizationUrl, '_blank'); \n }\n\n componentDidLoad() { \n const url = new URL(window.location.href);\n const code = url.searchParams.get('code');\n const { templateName } = this.getLocalStorageValues()\n if(code && this.name === templateName) { \n this.isTemplatePage = true;\n this.toggleTemplates.emit('details')\n this.getUserToken(code)\n } \n }\n\n getLocalStorageValues() { \n const repoName = localStorage.getItem('repo_name');\n const repoDesc = localStorage.getItem('repo_desc');\n const repoFramework = localStorage.getItem('repo_framework');\n const templateName = localStorage.getItem('selectedTemplate');\n return { repoName, repoDesc, repoFramework, templateName }\n }\n\n async getUserToken(authCode) {\n const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();\n\n fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)\n .then(response => {\n if (response.ok) {\n return response.text();\n } else {\n return response.text().then(errorMessage => {\n throw new Error(errorMessage);\n });\n }\n })\n .then(data => { \n if(data) { \n this.isLoading = false;\n this.repoUrl = data;\n localStorage.clear();\n } \n })\n .catch(error => {\n this.repoError = error.message;\n console.error('Error:', error.message)\n });\n }\n\n handleUserInput(e, type) { \n if (type === 'name') {\n this.repoDetails = { ...this.repoDetails, name: e.target.value };\n } else if (type === 'desc') {\n this.repoDetails = { ...this.repoDetails, desc: e.target.value };\n } else if(type === 'framework') { \n this.repoDetails = { ...this.repoDetails, framework: e.target.value };\n }\n }\n\n submitUserData() { \n if(this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) { \n localStorage.setItem('repo_name', this.repoDetails.name);\n localStorage.setItem('repo_desc', this.repoDetails.desc);\n localStorage.setItem('repo_framework', this.repoDetails.framework);\n localStorage.setItem('selectedTemplate', this.name);\n this.fieldError.emit(false)\n this.authUser()\n } else { \n this.fieldError.emit('All fields are mandatory')\n }\n }\n\n togglePadding(action) { \n let parent = this.el.parentElement;\n if (parent) {\n const rootNode = parent.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n parent = rootNode.host.parentElement;\n } else {\n parent = parent.parentElement;\n }\n if(action === 'remove') { \n parent.parentElement.style.padding = '0px';\n } else if(action === 'add') { \n parent.parentElement.style.padding = '4rem 20px';\n }\n }\n }\n\n handleCurrentTemplate(e) { \n if(e && !this.showDetails) { \n this.togglePadding('remove')\n const targetTemplate = e.currentTarget;\n this.toggleTemplates.emit(targetTemplate)\n this.showDetails = true;\n } \n }\n\n @Method()\n async toggleTemplate(currTemp) { \n const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');\n if(templateWrapper) { \n if(!templateWrapper.classList.contains('hide') && currTemp ) { \n if(templateWrapper !== currTemp) {\n templateWrapper.classList.add('hide')\n }\n } else { \n if(this.showDetails) { \n this.showDetails = false;\n }\n this.togglePadding('add')\n templateWrapper.classList.remove('hide')\n }\n }\n }\n\n \n render() {\n return (\n <div>\n {this.isTemplatePage \n ? \n <div class=\"template__page-wrapper\">\n {!this.repoUrl && !this.repoError && \n <div>\n <h3>Your repository is getting ready..</h3>\n <p>This will only take a minute.</p>\n </div>}\n {this.isLoading && !this.repoError && <div><ifx-spinner variant='default' size='s' /></div>}\n {this.repoUrl && <ifx-link href={this.repoUrl} target=\"_parent\" size=\"m\" variant=\"underlined\">Your repository</ifx-link>}\n {this.repoError && <div>{this.repoError}</div>}\n </div> \n : \n <div class=\"react__template-container\">\n <div class=\"react__template-wrapper\" onClick={(e) => this.handleCurrentTemplate(e)}>\n <div class=\"image__wrapper\">\n <img src={this.thumbnail} />\n </div>\n </div>\n {this.showDetails && \n <div class=\"details__wrapper\">\n <div class=\"selection__buttons-wrapper\">\n <div class=\"selection__input\">\n <input type=\"radio\" id=\"react\" name=\"chosen_framework\" value=\"react\" onInput={(e) => this.handleUserInput(e, 'framework')} />\n <label htmlFor=\"react\">React</label>\n </div>\n <div class=\"selection__input vue\">\n <input class=\"vue__input\" disabled type=\"radio\" id=\"vue\" name=\"chosen_framework\" value=\"vue\" onInput={(e) => this.handleUserInput(e, 'framework')}/>\n <label class=\"vue__label\" htmlFor=\"vue\">Vue</label> (Soon)\n </div>\n </div>\n \n\n <div class=\"input__fields-wrapper\">\n <ifx-text-field required={true} onInput={(e) => this.handleUserInput(e, 'name')} size=\"m\" icon=\"c-info-16\" placeholder=\"Your repository name\">Repository Name</ifx-text-field>\n\n <ifx-text-field required={true} size=\"m\" icon=\"c-info-16\" onInput={(e) => this.handleUserInput(e, 'desc')} placeholder=\"Your repository description\">Repository Description</ifx-text-field>\n\n <ifx-button fullWidth={true} onClick={() => this.submitUserData()} variant='primary'>Generate template</ifx-button>\n </div>\n \n </div>}\n </div>}\n </div>\n );\n }\n}"],"mappings":"yDAAA,MAAMA,EAAc,6oCACpB,MAAAC,EAAeD,E,MCMFE,EAAQ,MALrB,WAAAC,CAAAC,G,kGAOWC,KAAAC,YAAiE,CAAEC,KAAM,GAAIC,KAAM,GAAIC,UAAW,IAElGJ,KAAAK,YAAuB,MACvBL,KAAAM,eAA0B,MAC1BN,KAAAO,UAAqB,KAOtBP,KAAAQ,SAAW,uBACXR,KAAAS,YAAc,mGACdT,KAAAU,MAAQ,gBACRV,KAAAW,MAAQ,a,CAEhB,QA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