@kiva/kv-components 3.106.0 → 3.107.1

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 (179) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/CHANGELOG.md +22 -0
  3. package/dist/components/.storybook/main.js +85 -0
  4. package/dist/components/.storybook/package.json +3 -0
  5. package/dist/components/.storybook/preview.js +61 -0
  6. package/dist/components/.storybook/tailwind.css +5 -0
  7. package/dist/components/KvAccordionItem.vue +130 -0
  8. package/dist/components/KvActivityRow.vue +33 -0
  9. package/dist/components/KvBorrowerImage.vue +179 -0
  10. package/dist/components/KvButton.vue +287 -0
  11. package/dist/components/KvCarousel.vue +297 -0
  12. package/dist/components/KvCartModal.vue +365 -0
  13. package/dist/components/KvCheckbox.vue +203 -0
  14. package/dist/components/KvChip.vue +54 -0
  15. package/dist/components/KvClassicLoanCard.vue +527 -0
  16. package/dist/components/KvCommentsAdd.vue +135 -0
  17. package/dist/components/KvCommentsContainer.vue +84 -0
  18. package/dist/components/KvCommentsHeartButton.vue +70 -0
  19. package/dist/components/KvCommentsList.vue +68 -0
  20. package/dist/components/KvCommentsListItem.vue +241 -0
  21. package/dist/components/KvCommentsReplyButton.vue +52 -0
  22. package/dist/components/KvContentfulImg.vue +273 -0
  23. package/dist/components/KvCountdownTimer.vue +59 -0
  24. package/dist/components/KvExpandable.vue +84 -0
  25. package/dist/components/KvExpandableQuestion.vue +120 -0
  26. package/dist/components/KvFlag.vue +120 -0
  27. package/dist/components/KvGrid.vue +28 -0
  28. package/dist/components/KvImpactDashboardHeader.vue +40 -0
  29. package/dist/components/KvInlineActivityCard.vue +55 -0
  30. package/dist/components/KvInlineActivityFeed.vue +38 -0
  31. package/dist/components/KvIntroductionLoanCard.vue +446 -0
  32. package/dist/components/KvLendAmountButton.vue +65 -0
  33. package/dist/components/KvLendCta.vue +451 -0
  34. package/dist/components/KvLightbox.vue +334 -0
  35. package/dist/components/KvLineGraph.vue +128 -0
  36. package/dist/components/KvLoadingPlaceholder.vue +38 -0
  37. package/dist/components/KvLoadingSpinner.vue +81 -0
  38. package/dist/components/KvLoanActivities.vue +268 -0
  39. package/dist/components/KvLoanBookmark.vue +39 -0
  40. package/dist/components/KvLoanCallouts.vue +53 -0
  41. package/dist/components/KvLoanProgressGroup.vue +76 -0
  42. package/dist/components/KvLoanTag.vue +88 -0
  43. package/dist/components/KvLoanTeamPick.vue +44 -0
  44. package/dist/components/KvLoanUse.vue +92 -0
  45. package/dist/components/KvMap.vue +599 -0
  46. package/dist/components/KvMaterialIcon.vue +47 -0
  47. package/dist/components/KvPageContainer.vue +15 -0
  48. package/dist/components/KvPagination.vue +198 -0
  49. package/dist/components/KvPieChart.vue +257 -0
  50. package/dist/components/KvPopper.vue +178 -0
  51. package/dist/components/KvProgressBar.vue +149 -0
  52. package/dist/components/KvRadio.vue +198 -0
  53. package/dist/components/KvSelect.vue +114 -0
  54. package/dist/components/KvSideSheet.vue +134 -0
  55. package/dist/components/KvSwitch.vue +143 -0
  56. package/dist/components/KvTab.vue +90 -0
  57. package/dist/components/KvTabPanel.vue +64 -0
  58. package/dist/components/KvTabs.vue +182 -0
  59. package/dist/components/KvTextInput.vue +247 -0
  60. package/dist/components/KvTextLink.vue +138 -0
  61. package/dist/components/KvThemeProvider.vue +122 -0
  62. package/dist/components/KvToast.vue +221 -0
  63. package/dist/components/KvTooltip.vue +168 -0
  64. package/dist/components/KvTreeMapChart.vue +229 -0
  65. package/dist/components/KvUserAvatar.vue +132 -0
  66. package/dist/components/KvVerticalCarousel.vue +156 -0
  67. package/dist/components/KvVotingCard.vue +160 -0
  68. package/dist/components/KvVotingCardV2.vue +154 -0
  69. package/dist/components/KvWideLoanCard.vue +432 -0
  70. package/dist/components/stories/Forms.stories.js +62 -0
  71. package/dist/components/stories/KvAccordionItem.stories.js +24 -0
  72. package/dist/components/stories/KvActivityRow.stories.js +25 -0
  73. package/dist/components/stories/KvBorrowerImage.stories.js +68 -0
  74. package/dist/components/stories/KvButton.stories.js +144 -0
  75. package/dist/components/stories/KvCarousel.stories.js +426 -0
  76. package/dist/components/stories/KvCartModal.stories.js +54 -0
  77. package/dist/components/stories/KvCheckbox.stories.js +163 -0
  78. package/dist/components/stories/KvChip.stories.js +43 -0
  79. package/dist/components/stories/KvClassicLoanCard.stories.js +480 -0
  80. package/dist/components/stories/KvCommentsAdd.stories.js +32 -0
  81. package/dist/components/stories/KvCommentsContainer.stories.js +42 -0
  82. package/dist/components/stories/KvCommentsHeartButton.stories.js +25 -0
  83. package/dist/components/stories/KvCommentsList.stories.js +39 -0
  84. package/dist/components/stories/KvCommentsListItem.stories.js +45 -0
  85. package/dist/components/stories/KvCommentsReplyButton.stories.js +21 -0
  86. package/dist/components/stories/KvContentfulImg.stories.js +196 -0
  87. package/dist/components/stories/KvCountdownTimer.stories.js +30 -0
  88. package/dist/components/stories/KvExpandableQuestion.stories.js +129 -0
  89. package/dist/components/stories/KvFlag.stories.js +36 -0
  90. package/dist/components/stories/KvGrid.stories.js +97 -0
  91. package/dist/components/stories/KvImpactDashboardHeader.stories.js +22 -0
  92. package/dist/components/stories/KvInlineActivityCard.stories.js +69 -0
  93. package/dist/components/stories/KvInlineActivityFeed.stories.js +76 -0
  94. package/dist/components/stories/KvIntroductionLoanCard.stories.js +208 -0
  95. package/dist/components/stories/KvLendAmountButton.stories.js +31 -0
  96. package/dist/components/stories/KvLendCta.stories.js +177 -0
  97. package/dist/components/stories/KvLightbox.stories.js +304 -0
  98. package/dist/components/stories/KvLineGraph.stories.js +52 -0
  99. package/dist/components/stories/KvLoadingPlaceholder.stories.js +17 -0
  100. package/dist/components/stories/KvLoadingSpinner.stories.js +52 -0
  101. package/dist/components/stories/KvLoanActivities.stories.js +104 -0
  102. package/dist/components/stories/KvLoanBookmark.stories.js +22 -0
  103. package/dist/components/stories/KvLoanCallouts.stories.js +22 -0
  104. package/dist/components/stories/KvLoanProgressGroup.stories.js +29 -0
  105. package/dist/components/stories/KvLoanTag.stories.js +61 -0
  106. package/dist/components/stories/KvLoanTeamPick.stories.js +20 -0
  107. package/dist/components/stories/KvLoanUse.stories.js +60 -0
  108. package/dist/components/stories/KvMap.stories.js +121 -0
  109. package/dist/components/stories/KvMaterialIcon.stories.js +201 -0
  110. package/dist/components/stories/KvPageContainer.stories.js +50 -0
  111. package/dist/components/stories/KvPagination.stories.js +70 -0
  112. package/dist/components/stories/KvPieChart.stories.js +47 -0
  113. package/dist/components/stories/KvProgressBar.stories.js +53 -0
  114. package/dist/components/stories/KvRadio.stories.js +140 -0
  115. package/dist/components/stories/KvSelect.stories.js +125 -0
  116. package/dist/components/stories/KvSideSheet.stories.js +50 -0
  117. package/dist/components/stories/KvSwitch.stories.js +66 -0
  118. package/dist/components/stories/KvTabs.stories.js +106 -0
  119. package/dist/components/stories/KvTextInput.stories.js +194 -0
  120. package/dist/components/stories/KvTextLink.stories.js +55 -0
  121. package/dist/components/stories/KvThemeProvider.stories.js +178 -0
  122. package/dist/components/stories/KvToast.stories.js +117 -0
  123. package/dist/components/stories/KvTooltip.stories.js +26 -0
  124. package/dist/components/stories/KvTreeMapChart.stories.js +42 -0
  125. package/dist/components/stories/KvUserAvatar.stories.js +47 -0
  126. package/dist/components/stories/KvVerticalCarousel.stories.js +168 -0
  127. package/dist/components/stories/KvVotingCard.stories.js +33 -0
  128. package/dist/components/stories/KvVotingCardV2.stories.js +89 -0
  129. package/dist/components/stories/KvWideLoanCard.stories.js +292 -0
  130. package/dist/components/stories/StyleguidePrimitives.stories.js +499 -0
  131. package/dist/components/stories/StyleguideProse.stories.js +215 -0
  132. package/dist/data/countries-borders.json +1 -0
  133. package/dist/data/ne_110m_admin_0_countries.json +1 -0
  134. package/dist/utils/Alea.cjs +87 -0
  135. package/dist/utils/Alea.js +9 -0
  136. package/dist/utils/attrs.cjs +50 -0
  137. package/dist/utils/attrs.js +7 -0
  138. package/dist/utils/carousels.cjs +184 -0
  139. package/dist/utils/carousels.js +8 -0
  140. package/dist/utils/chunk-3HK4G4NT.js +27 -0
  141. package/dist/utils/chunk-55HF2ORX.js +201 -0
  142. package/dist/utils/chunk-AY3PR5S4.js +54 -0
  143. package/dist/utils/chunk-AZPWOFD5.js +148 -0
  144. package/dist/utils/chunk-B5J5WLAH.js +18 -0
  145. package/dist/utils/chunk-GPSH6OPA.js +64 -0
  146. package/dist/utils/chunk-HIY5IW65.js +28 -0
  147. package/dist/utils/chunk-HV3AUBFT.js +15 -0
  148. package/dist/utils/chunk-MSMZIN54.js +110 -0
  149. package/dist/utils/chunk-OXJCCNNW.js +30 -0
  150. package/dist/utils/chunk-S3MABILA.js +22 -0
  151. package/dist/utils/chunk-VIGEMAKO.js +249 -0
  152. package/dist/utils/chunk-YCNMJ4YV.js +37 -0
  153. package/dist/utils/chunk-YFEC5ODJ.js +129 -0
  154. package/dist/utils/expander.cjs +78 -0
  155. package/dist/utils/expander.js +9 -0
  156. package/dist/utils/imageUtils.cjs +54 -0
  157. package/dist/utils/imageUtils.js +9 -0
  158. package/dist/utils/index.cjs +1118 -0
  159. package/dist/utils/index.js +166 -0
  160. package/dist/utils/loanCard.cjs +222 -0
  161. package/dist/utils/loanCard.js +9 -0
  162. package/dist/utils/loanUtils.cjs +170 -0
  163. package/dist/utils/loanUtils.js +23 -0
  164. package/dist/utils/mapUtils.cjs +276 -0
  165. package/dist/utils/mapUtils.js +15 -0
  166. package/dist/utils/printing.cjs +42 -0
  167. package/dist/utils/printing.js +9 -0
  168. package/dist/utils/scrollLock.cjs +54 -0
  169. package/dist/utils/scrollLock.js +13 -0
  170. package/dist/utils/throttle.cjs +38 -0
  171. package/dist/utils/throttle.js +7 -0
  172. package/dist/utils/touchEvents.cjs +47 -0
  173. package/dist/utils/touchEvents.js +11 -0
  174. package/dist/utils/treemap.cjs +133 -0
  175. package/dist/utils/treemap.js +7 -0
  176. package/package.json +12 -4
  177. package/utils/index.js +14 -0
  178. package/vue/KvVerticalCarousel.vue +1 -1
  179. package/index.js +0 -3
@@ -0,0 +1,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+
32
+ export {
33
+ __commonJS,
34
+ __export,
35
+ __reExport,
36
+ __toESM
37
+ };
@@ -0,0 +1,129 @@
1
+ // utils/loanUtils.js
2
+ import numeral from "numeral";
3
+ var ERL_COOKIE_NAME = "kverlfivedollarnotes";
4
+ var TOP_UP_CAMPAIGN = "TOPUP-VB-BALANCE-MPV1";
5
+ var BASE_CAMPAIGN = "BASE-VB_BALANCE_MPV1";
6
+ var BALANCE_CAMPAIGN = "REPAYMENT-NOTIFICATION_BALANCE_MPV1";
7
+ var NO_BALANCE_CAMPAIGN = "REPAYMENT-NOTIFICATION_NO-BALANCE_MPV1";
8
+ function balanceCampaignOptions(val) {
9
+ if (val > 20)
10
+ return 25;
11
+ if (val > 15)
12
+ return 20;
13
+ if (val > 10)
14
+ return 15;
15
+ if (val > 5)
16
+ return 10;
17
+ return 5;
18
+ }
19
+ function isBetween25And50(unreservedAmount) {
20
+ return unreservedAmount <= 50 && unreservedAmount > 25;
21
+ }
22
+ function isLessThan25(unreservedAmount) {
23
+ return unreservedAmount < 25 && unreservedAmount > 0;
24
+ }
25
+ function getLendCtaSelectedOption(getCookie, setCookie, enableFiveDollarsNotes, campaign, unreservedAmount, userBalance, fiveDollarsSelected) {
26
+ if (enableFiveDollarsNotes && fiveDollarsSelected) {
27
+ return "5";
28
+ }
29
+ if (enableFiveDollarsNotes && typeof userBalance !== "undefined") {
30
+ let currentCampaign = getCookie == null ? void 0 : getCookie(ERL_COOKIE_NAME);
31
+ if (campaign && typeof campaign === "string" && !currentCampaign) {
32
+ const expires = /* @__PURE__ */ new Date();
33
+ expires.setHours(expires.getHours() + 24);
34
+ const campaignToCheck = campaign.toUpperCase();
35
+ currentCampaign = campaignToCheck.includes(TOP_UP_CAMPAIGN) ? TOP_UP_CAMPAIGN : campaignToCheck.includes(BASE_CAMPAIGN) ? BASE_CAMPAIGN : campaignToCheck.includes(BALANCE_CAMPAIGN) ? BALANCE_CAMPAIGN : campaignToCheck.includes(NO_BALANCE_CAMPAIGN) ? NO_BALANCE_CAMPAIGN : "";
36
+ if (currentCampaign && setCookie) {
37
+ setCookie(ERL_COOKIE_NAME, currentCampaign, { expires });
38
+ }
39
+ }
40
+ if (currentCampaign) {
41
+ let val = Math.floor(userBalance / 5) * 5;
42
+ if (currentCampaign === BASE_CAMPAIGN) {
43
+ val = val === 0 ? 5 : val > 25 ? 25 : val;
44
+ return Number(val <= unreservedAmount ? val : unreservedAmount).toFixed();
45
+ }
46
+ if (currentCampaign === BALANCE_CAMPAIGN) {
47
+ val = balanceCampaignOptions(val);
48
+ return Number(val).toFixed();
49
+ }
50
+ return Number(unreservedAmount > 5 ? 5 : unreservedAmount).toFixed();
51
+ }
52
+ }
53
+ if (isBetween25And50(unreservedAmount) || isLessThan25(unreservedAmount)) {
54
+ return Number(unreservedAmount).toFixed();
55
+ }
56
+ return "25";
57
+ }
58
+ function buildHugePriceArray(amountLeft) {
59
+ const priceArray = [];
60
+ let minAmount = 100;
61
+ let limitAmount = amountLeft > 1e3 ? 1e3 : amountLeft;
62
+ let optionCount = limitAmount / minAmount;
63
+ for (let i = 1; i <= optionCount; i += 1) {
64
+ const price = minAmount * i + 500;
65
+ if (price > limitAmount)
66
+ break;
67
+ priceArray.push(numeral(price).format("0,0"));
68
+ }
69
+ minAmount = 1e3;
70
+ limitAmount = amountLeft > 1e4 ? 1e4 : amountLeft;
71
+ optionCount = limitAmount / minAmount;
72
+ for (let i = 1; i <= optionCount; i += 1) {
73
+ const price = minAmount * i + 1e3;
74
+ if (price > limitAmount)
75
+ break;
76
+ priceArray.push(numeral(price).format("0,0"));
77
+ }
78
+ if (!priceArray.includes(numeral(limitAmount).format("0,0"))) {
79
+ priceArray.push(numeral(limitAmount).format("0,0"));
80
+ }
81
+ return priceArray;
82
+ }
83
+ function build5DollarsPriceArray(amountLeft) {
84
+ const limit5Notes = amountLeft < 50 ? amountLeft : 50;
85
+ const numberOf5 = limit5Notes / 5;
86
+ const numberOf25 = Math.ceil((amountLeft - limit5Notes) / 25) + 1;
87
+ const priceArray = [];
88
+ for (let i = 1; i <= numberOf5; i += 1) {
89
+ priceArray.push(numeral(5 * i).format("0,0"));
90
+ }
91
+ if (amountLeft > limit5Notes) {
92
+ for (let i = 3; i <= numberOf25; i += 1) {
93
+ priceArray.push(numeral(25 * i).format("0,0"));
94
+ }
95
+ }
96
+ return priceArray;
97
+ }
98
+ function buildPriceArray(amountLeft, minAmount) {
99
+ const optionCount = amountLeft / minAmount;
100
+ const priceArray = [];
101
+ for (let i = 1; i <= optionCount; i += 1) {
102
+ priceArray.push(numeral(minAmount * i).format("0,0"));
103
+ }
104
+ return priceArray;
105
+ }
106
+ function getDropdownPriceArray(unreservedAmount, isCompleteLoanActive = false, minAmount = 25, enableFiveDollarsNotes = false, enableHugeAmount = false, isVisitor = true, inPfp = false) {
107
+ const parsedAmountLeft = parseFloat(unreservedAmount);
108
+ let priceArray = enableFiveDollarsNotes && !inPfp ? build5DollarsPriceArray(parsedAmountLeft).slice(0, 28) : buildPriceArray(parsedAmountLeft, minAmount).slice(0, 20);
109
+ if (enableHugeAmount && parsedAmountLeft > 500 && !isVisitor) {
110
+ const hugePriceArray = buildHugePriceArray(parsedAmountLeft);
111
+ priceArray = priceArray.concat(hugePriceArray);
112
+ }
113
+ if (isCompleteLoanActive && !priceArray.includes(Number(unreservedAmount).toFixed())) {
114
+ priceArray.push(Number(unreservedAmount).toFixed());
115
+ }
116
+ return priceArray;
117
+ }
118
+
119
+ export {
120
+ ERL_COOKIE_NAME,
121
+ TOP_UP_CAMPAIGN,
122
+ BASE_CAMPAIGN,
123
+ BALANCE_CAMPAIGN,
124
+ NO_BALANCE_CAMPAIGN,
125
+ isBetween25And50,
126
+ isLessThan25,
127
+ getLendCtaSelectedOption,
128
+ getDropdownPriceArray
129
+ };
@@ -0,0 +1,78 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // utils/expander.js
20
+ var expander_exports = {};
21
+ __export(expander_exports, {
22
+ collapse: () => collapse,
23
+ expand: () => expand
24
+ });
25
+ module.exports = __toCommonJS(expander_exports);
26
+ function setInitialStyle(el, { property, delay, easing }) {
27
+ el.style.overflow = "hidden";
28
+ el.style.transition = `${property} ${delay}ms ${easing}`;
29
+ }
30
+ function unsetStyles(el, { property }) {
31
+ el.style[property] = null;
32
+ el.style.overflow = null;
33
+ el.style.transition = null;
34
+ }
35
+ function expand(el, {
36
+ easing = "ease",
37
+ delay = 500,
38
+ done = () => {
39
+ },
40
+ from = 0,
41
+ property = "height"
42
+ }) {
43
+ setInitialStyle(el, { property, delay, easing });
44
+ el.style[property] = "auto";
45
+ el.style.display = null;
46
+ const propValue = window.getComputedStyle(el).getPropertyValue(property);
47
+ el.style[property] = from;
48
+ el.addEventListener("transitionend", function listener() {
49
+ unsetStyles(el, { property });
50
+ done();
51
+ el.removeEventListener("transitionend", listener, true);
52
+ }, true);
53
+ void el.offsetWidth;
54
+ el.style[property] = propValue;
55
+ }
56
+ function collapse(el, {
57
+ easing = "ease",
58
+ delay = 500,
59
+ done = () => {
60
+ },
61
+ to = 0,
62
+ property = "height"
63
+ }) {
64
+ setInitialStyle(el, { property, delay, easing });
65
+ el.style[property] = window.getComputedStyle(el).getPropertyValue(property);
66
+ el.addEventListener("transitionend", function listener() {
67
+ unsetStyles(el, { property });
68
+ done();
69
+ el.removeEventListener("transitionend", listener, true);
70
+ }, true);
71
+ void el.offsetWidth;
72
+ el.style[property] = to;
73
+ }
74
+ // Annotate the CommonJS export names for ESM import in node:
75
+ 0 && (module.exports = {
76
+ collapse,
77
+ expand
78
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ collapse,
3
+ expand
4
+ } from "./chunk-AY3PR5S4.js";
5
+ import "./chunk-YCNMJ4YV.js";
6
+ export {
7
+ collapse,
8
+ expand
9
+ };
@@ -0,0 +1,54 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // utils/imageUtils.js
20
+ var imageUtils_exports = {};
21
+ __export(imageUtils_exports, {
22
+ isLegacyPlaceholderAvatar: () => isLegacyPlaceholderAvatar,
23
+ randomizedUserAvatarClass: () => randomizedUserAvatarClass
24
+ });
25
+ module.exports = __toCommonJS(imageUtils_exports);
26
+ function isLegacyPlaceholderAvatar(filename) {
27
+ if (!filename) {
28
+ return false;
29
+ }
30
+ let filenameCleaned = filename.toString();
31
+ if (filenameCleaned.includes(".")) {
32
+ [filenameCleaned] = filenameCleaned.split(".");
33
+ }
34
+ const defaultProfileIds = ["726677", "315726", "4d844ac2c0b77a8a522741b908ea5c32"];
35
+ return defaultProfileIds.includes(filenameCleaned);
36
+ }
37
+ function randomizedUserAvatarClass() {
38
+ const userCardStyleOptions = [
39
+ { color: "tw-text-action", bg: "tw-bg-brand-100" },
40
+ { color: "tw-text-black", bg: "tw-bg-brand-100" },
41
+ { color: "tw-text-white", bg: "tw-bg-action" },
42
+ { color: "tw-text-brand-100", bg: "tw-bg-action" },
43
+ { color: "tw-text-primary-inverse", bg: "tw-bg-action" },
44
+ { color: "tw-text-white", bg: "tw-bg-black" },
45
+ { color: "tw-text-action", bg: "tw-bg-black" }
46
+ ];
47
+ const randomStyle = userCardStyleOptions[Math.floor(Math.random() * userCardStyleOptions.length)];
48
+ return `${randomStyle.color} ${randomStyle.bg}`;
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ isLegacyPlaceholderAvatar,
53
+ randomizedUserAvatarClass
54
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ isLegacyPlaceholderAvatar,
3
+ randomizedUserAvatarClass
4
+ } from "./chunk-OXJCCNNW.js";
5
+ import "./chunk-YCNMJ4YV.js";
6
+ export {
7
+ isLegacyPlaceholderAvatar,
8
+ randomizedUserAvatarClass
9
+ };