@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.8

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 (202) hide show
  1. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  2. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  3. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +2 -4
  5. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
  6. package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
  7. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +2 -5
  8. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
  9. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs} +1 -2
  11. package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
  12. package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
  13. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +1 -5
  14. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
  15. package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
  16. package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
  17. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs} +32 -189
  18. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
  19. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -31
  21. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +4 -7
  22. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
  23. package/dist/adyenLoader-CEH4A2b2.js +1 -0
  24. package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
  25. package/dist/component-C2Gc-wsE.js +1 -0
  26. package/dist/component-CM9g6tbD.mjs +804 -0
  27. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  28. package/dist/components/BillingInformation/BillingInformation.es.js +3 -7
  29. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  30. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +9 -17
  31. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  32. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -7
  33. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  34. package/dist/components/Invoice/Invoice.es.js +42 -2659
  35. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  36. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -7
  37. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  38. package/dist/components/InvoicesList/InvoicesList.es.js +2 -6
  39. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  40. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -7
  41. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  42. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -33
  43. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  44. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +8 -4824
  45. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  46. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -8
  47. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  48. package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
  49. package/dist/core/index.cjs.js +1 -1
  50. package/dist/core/index.es.js +1 -1
  51. package/dist/core/types.d.ts +2 -0
  52. package/dist/{customer-CcQR-JIm.js → customer-C_Hz_npf.js} +1 -1
  53. package/dist/{customer-CJrpbGX4.mjs → customer-TIi7iZFw.mjs} +1 -1
  54. package/dist/en-US-CBoPxQwX.mjs +199 -0
  55. package/dist/en-US-DJq-9dD8.js +1 -0
  56. package/dist/index-CzL1ZcGi.mjs +85 -0
  57. package/dist/index-DRdBmZ2-.js +1 -0
  58. package/dist/index.cjs.js +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.es.js +4 -1
  61. package/dist/{invoices-CNK1Ushv.mjs → invoices-BuVOuTOm.mjs} +2 -15
  62. package/dist/invoices-DbvwXAsm.js +1 -0
  63. package/dist/nl-NL-BB7KbK-h.mjs +181 -0
  64. package/dist/nl-NL-CtU1Lg2F.js +1 -0
  65. package/dist/paymentMethods-B4AYGf0K.js +1 -0
  66. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-Di32oJ39.mjs} +2 -2
  67. package/dist/{payments-CE9U7aKK.mjs → payments-C5fD1PXB.mjs} +1 -1
  68. package/dist/{payments-CLt0SExf.js → payments-DeutKq9x.js} +1 -1
  69. package/dist/{registry-B99ZnfEn.mjs → registry-BLwMl1bK.mjs} +6 -4
  70. package/dist/registry-CMSmkLcy.js +1 -0
  71. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  72. package/dist/screens/Checkout/Checkout.es.js +420 -2388
  73. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  74. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -14
  75. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  76. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  77. package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
  78. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  79. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +79 -61
  80. package/dist/solvimon-web.css +1 -1
  81. package/dist/source-DKDKBlUm.mjs +179 -0
  82. package/dist/source-dkMNFWDc.js +1 -0
  83. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-mOgjjzUi.mjs} +2 -2
  84. package/dist/subscriptions-wdMADcQZ.js +1 -0
  85. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
  86. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
  87. package/dist/{useCustomer-PthyTFLl.js → useCustomer-DanZzn-l.js} +1 -1
  88. package/dist/{useCustomer--jycAz--.mjs → useCustomer-cbhDyWJL.mjs} +2 -2
  89. package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
  90. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -8
  91. package/dist/useInvoiceData-CxxHa5R2.js +1 -0
  92. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
  93. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-BQQxcPdz.mjs} +23 -260
  94. package/dist/useInvoicesList-CtJqmblZ.js +1 -0
  95. package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
  96. package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
  97. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
  98. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
  99. package/dist/usePayments-B13S_yai.js +1 -0
  100. package/dist/usePayments-D4uGKBsV.mjs +36 -0
  101. package/dist/usePortal-DJDJNLbo.mjs +12 -0
  102. package/dist/usePortal-DWJEVkTj.js +1 -0
  103. package/dist/useService-9fCKPTmu.js +1 -0
  104. package/dist/useService-BuWWE5ND.mjs +68 -0
  105. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  106. package/dist/useViewport-CKRY1CKR.js +1 -0
  107. package/dist/useWalletBalanceItems-B53Gkjro.mjs +106 -0
  108. package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
  109. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  110. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  111. package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
  112. package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
  113. package/package.json +17 -10
  114. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  115. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  116. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  117. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  118. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  119. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  120. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  121. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  122. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  123. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  124. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  125. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  126. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  127. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  128. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  129. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  130. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  131. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  132. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  133. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  134. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  135. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  136. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  137. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  138. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  139. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  140. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  141. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  142. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  143. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  144. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  145. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  146. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  147. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  148. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  149. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  150. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  151. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  152. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  153. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  154. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  155. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  156. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  157. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  158. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  159. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  160. package/dist/api.es-B4qAAJKr.js +0 -1
  161. package/dist/api.es-UkfpLiLL.mjs +0 -83
  162. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  163. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  164. package/dist/cn.es-C7xoIs3C.js +0 -1
  165. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  166. package/dist/component-ZRZIt3ZW.js +0 -1
  167. package/dist/component-dpA83LIN.mjs +0 -6569
  168. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  169. package/dist/countryData.es-D3MFzU92.js +0 -1
  170. package/dist/customer.es-D42Md24r.js +0 -1
  171. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  172. package/dist/formatting.es-9hM8aHSg.js +0 -1
  173. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  174. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  175. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  176. package/dist/index-2jo9BSPM.js +0 -1
  177. package/dist/index-BFZ0dPh9.mjs +0 -179
  178. package/dist/index-CI71bVGE.mjs +0 -2521
  179. package/dist/index-CWSXne1Q.js +0 -1
  180. package/dist/index-D3v7hAtc.mjs +0 -253
  181. package/dist/index-WLSPwi90.js +0 -1
  182. package/dist/index.es-BBJF2O2l.js +0 -1
  183. package/dist/index.es-LCAKs4tH.mjs +0 -438
  184. package/dist/invoices-3kVHsAXr.js +0 -1
  185. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  186. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  187. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  188. package/dist/pick.es-BgDAfhAl.js +0 -1
  189. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  190. package/dist/registry-ClZ43bQn.js +0 -1
  191. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  192. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  193. package/dist/subscriptions-CS8HTxzC.js +0 -1
  194. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  195. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  196. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  197. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  198. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  199. package/dist/useService-B67YWAcN.js +0 -1
  200. package/dist/useService-DG_zedHV.mjs +0 -282
  201. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  202. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1,1576 +0,0 @@
1
- import { computed, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, unref, defineComponent, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, createCommentVNode } from "vue";
2
- import { a as _sfc_main$1 } from "./Button.vue.es-6sBk5tBL.mjs";
3
- const _export_sfc = (sfc, props) => {
4
- const target = sfc.__vccOpts || sfc;
5
- for (const [key, val] of props) {
6
- target[key] = val;
7
- }
8
- return target;
9
- };
10
- const min = Math.min;
11
- const max = Math.max;
12
- const round = Math.round;
13
- const floor = Math.floor;
14
- const createCoords = (v) => ({
15
- x: v,
16
- y: v
17
- });
18
- const oppositeSideMap = {
19
- left: "right",
20
- right: "left",
21
- bottom: "top",
22
- top: "bottom"
23
- };
24
- const oppositeAlignmentMap = {
25
- start: "end",
26
- end: "start"
27
- };
28
- function evaluate(value, param) {
29
- return typeof value === "function" ? value(param) : value;
30
- }
31
- function getSide(placement) {
32
- return placement.split("-")[0];
33
- }
34
- function getAlignment(placement) {
35
- return placement.split("-")[1];
36
- }
37
- function getOppositeAxis(axis) {
38
- return axis === "x" ? "y" : "x";
39
- }
40
- function getAxisLength(axis) {
41
- return axis === "y" ? "height" : "width";
42
- }
43
- const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
44
- function getSideAxis(placement) {
45
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
46
- }
47
- function getAlignmentAxis(placement) {
48
- return getOppositeAxis(getSideAxis(placement));
49
- }
50
- function getAlignmentSides(placement, rects, rtl) {
51
- if (rtl === void 0) {
52
- rtl = false;
53
- }
54
- const alignment = getAlignment(placement);
55
- const alignmentAxis = getAlignmentAxis(placement);
56
- const length = getAxisLength(alignmentAxis);
57
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
58
- if (rects.reference[length] > rects.floating[length]) {
59
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
60
- }
61
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
62
- }
63
- function getExpandedPlacements(placement) {
64
- const oppositePlacement = getOppositePlacement(placement);
65
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
66
- }
67
- function getOppositeAlignmentPlacement(placement) {
68
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
69
- }
70
- const lrPlacement = ["left", "right"];
71
- const rlPlacement = ["right", "left"];
72
- const tbPlacement = ["top", "bottom"];
73
- const btPlacement = ["bottom", "top"];
74
- function getSideList(side, isStart, rtl) {
75
- switch (side) {
76
- case "top":
77
- case "bottom":
78
- if (rtl) return isStart ? rlPlacement : lrPlacement;
79
- return isStart ? lrPlacement : rlPlacement;
80
- case "left":
81
- case "right":
82
- return isStart ? tbPlacement : btPlacement;
83
- default:
84
- return [];
85
- }
86
- }
87
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
88
- const alignment = getAlignment(placement);
89
- let list = getSideList(getSide(placement), direction === "start", rtl);
90
- if (alignment) {
91
- list = list.map((side) => side + "-" + alignment);
92
- if (flipAlignment) {
93
- list = list.concat(list.map(getOppositeAlignmentPlacement));
94
- }
95
- }
96
- return list;
97
- }
98
- function getOppositePlacement(placement) {
99
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
100
- }
101
- function expandPaddingObject(padding) {
102
- return {
103
- top: 0,
104
- right: 0,
105
- bottom: 0,
106
- left: 0,
107
- ...padding
108
- };
109
- }
110
- function getPaddingObject(padding) {
111
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
112
- top: padding,
113
- right: padding,
114
- bottom: padding,
115
- left: padding
116
- };
117
- }
118
- function rectToClientRect(rect) {
119
- const {
120
- x,
121
- y,
122
- width,
123
- height
124
- } = rect;
125
- return {
126
- width,
127
- height,
128
- top: y,
129
- left: x,
130
- right: x + width,
131
- bottom: y + height,
132
- x,
133
- y
134
- };
135
- }
136
- function computeCoordsFromPlacement(_ref, placement, rtl) {
137
- let {
138
- reference,
139
- floating
140
- } = _ref;
141
- const sideAxis = getSideAxis(placement);
142
- const alignmentAxis = getAlignmentAxis(placement);
143
- const alignLength = getAxisLength(alignmentAxis);
144
- const side = getSide(placement);
145
- const isVertical = sideAxis === "y";
146
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
147
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
148
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
149
- let coords;
150
- switch (side) {
151
- case "top":
152
- coords = {
153
- x: commonX,
154
- y: reference.y - floating.height
155
- };
156
- break;
157
- case "bottom":
158
- coords = {
159
- x: commonX,
160
- y: reference.y + reference.height
161
- };
162
- break;
163
- case "right":
164
- coords = {
165
- x: reference.x + reference.width,
166
- y: commonY
167
- };
168
- break;
169
- case "left":
170
- coords = {
171
- x: reference.x - floating.width,
172
- y: commonY
173
- };
174
- break;
175
- default:
176
- coords = {
177
- x: reference.x,
178
- y: reference.y
179
- };
180
- }
181
- switch (getAlignment(placement)) {
182
- case "start":
183
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
184
- break;
185
- case "end":
186
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
187
- break;
188
- }
189
- return coords;
190
- }
191
- async function detectOverflow(state, options) {
192
- var _await$platform$isEle;
193
- if (options === void 0) {
194
- options = {};
195
- }
196
- const {
197
- x,
198
- y,
199
- platform: platform2,
200
- rects,
201
- elements,
202
- strategy
203
- } = state;
204
- const {
205
- boundary = "clippingAncestors",
206
- rootBoundary = "viewport",
207
- elementContext = "floating",
208
- altBoundary = false,
209
- padding = 0
210
- } = evaluate(options, state);
211
- const paddingObject = getPaddingObject(padding);
212
- const altContext = elementContext === "floating" ? "reference" : "floating";
213
- const element = elements[altBoundary ? altContext : elementContext];
214
- const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
215
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
216
- boundary,
217
- rootBoundary,
218
- strategy
219
- }));
220
- const rect = elementContext === "floating" ? {
221
- x,
222
- y,
223
- width: rects.floating.width,
224
- height: rects.floating.height
225
- } : rects.reference;
226
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
227
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
228
- x: 1,
229
- y: 1
230
- } : {
231
- x: 1,
232
- y: 1
233
- };
234
- const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
235
- elements,
236
- rect,
237
- offsetParent,
238
- strategy
239
- }) : rect);
240
- return {
241
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
242
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
243
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
244
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
245
- };
246
- }
247
- const computePosition$1 = async (reference, floating, config) => {
248
- const {
249
- placement = "bottom",
250
- strategy = "absolute",
251
- middleware = [],
252
- platform: platform2
253
- } = config;
254
- const validMiddleware = middleware.filter(Boolean);
255
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
256
- let rects = await platform2.getElementRects({
257
- reference,
258
- floating,
259
- strategy
260
- });
261
- let {
262
- x,
263
- y
264
- } = computeCoordsFromPlacement(rects, placement, rtl);
265
- let statefulPlacement = placement;
266
- let middlewareData = {};
267
- let resetCount = 0;
268
- for (let i = 0; i < validMiddleware.length; i++) {
269
- var _platform$detectOverf;
270
- const {
271
- name,
272
- fn
273
- } = validMiddleware[i];
274
- const {
275
- x: nextX,
276
- y: nextY,
277
- data,
278
- reset
279
- } = await fn({
280
- x,
281
- y,
282
- initialPlacement: placement,
283
- placement: statefulPlacement,
284
- strategy,
285
- middlewareData,
286
- rects,
287
- platform: {
288
- ...platform2,
289
- detectOverflow: (_platform$detectOverf = platform2.detectOverflow) != null ? _platform$detectOverf : detectOverflow
290
- },
291
- elements: {
292
- reference,
293
- floating
294
- }
295
- });
296
- x = nextX != null ? nextX : x;
297
- y = nextY != null ? nextY : y;
298
- middlewareData = {
299
- ...middlewareData,
300
- [name]: {
301
- ...middlewareData[name],
302
- ...data
303
- }
304
- };
305
- if (reset && resetCount <= 50) {
306
- resetCount++;
307
- if (typeof reset === "object") {
308
- if (reset.placement) {
309
- statefulPlacement = reset.placement;
310
- }
311
- if (reset.rects) {
312
- rects = reset.rects === true ? await platform2.getElementRects({
313
- reference,
314
- floating,
315
- strategy
316
- }) : reset.rects;
317
- }
318
- ({
319
- x,
320
- y
321
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
322
- }
323
- i = -1;
324
- }
325
- }
326
- return {
327
- x,
328
- y,
329
- placement: statefulPlacement,
330
- strategy,
331
- middlewareData
332
- };
333
- };
334
- const flip$1 = function(options) {
335
- if (options === void 0) {
336
- options = {};
337
- }
338
- return {
339
- name: "flip",
340
- options,
341
- async fn(state) {
342
- var _middlewareData$arrow, _middlewareData$flip;
343
- const {
344
- placement,
345
- middlewareData,
346
- rects,
347
- initialPlacement,
348
- platform: platform2,
349
- elements
350
- } = state;
351
- const {
352
- mainAxis: checkMainAxis = true,
353
- crossAxis: checkCrossAxis = true,
354
- fallbackPlacements: specifiedFallbackPlacements,
355
- fallbackStrategy = "bestFit",
356
- fallbackAxisSideDirection = "none",
357
- flipAlignment = true,
358
- ...detectOverflowOptions
359
- } = evaluate(options, state);
360
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
361
- return {};
362
- }
363
- const side = getSide(placement);
364
- const initialSideAxis = getSideAxis(initialPlacement);
365
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
366
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
367
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
368
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
369
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
370
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
371
- }
372
- const placements = [initialPlacement, ...fallbackPlacements];
373
- const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
374
- const overflows = [];
375
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
376
- if (checkMainAxis) {
377
- overflows.push(overflow[side]);
378
- }
379
- if (checkCrossAxis) {
380
- const sides = getAlignmentSides(placement, rects, rtl);
381
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
382
- }
383
- overflowsData = [...overflowsData, {
384
- placement,
385
- overflows
386
- }];
387
- if (!overflows.every((side2) => side2 <= 0)) {
388
- var _middlewareData$flip2, _overflowsData$filter;
389
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
390
- const nextPlacement = placements[nextIndex];
391
- if (nextPlacement) {
392
- const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
393
- if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
394
- // overflows the main axis.
395
- overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
396
- return {
397
- data: {
398
- index: nextIndex,
399
- overflows: overflowsData
400
- },
401
- reset: {
402
- placement: nextPlacement
403
- }
404
- };
405
- }
406
- }
407
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
408
- if (!resetPlacement) {
409
- switch (fallbackStrategy) {
410
- case "bestFit": {
411
- var _overflowsData$filter2;
412
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
413
- if (hasFallbackAxisSideDirection) {
414
- const currentSideAxis = getSideAxis(d.placement);
415
- return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
416
- // reading directions favoring greater width.
417
- currentSideAxis === "y";
418
- }
419
- return true;
420
- }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
421
- if (placement2) {
422
- resetPlacement = placement2;
423
- }
424
- break;
425
- }
426
- case "initialPlacement":
427
- resetPlacement = initialPlacement;
428
- break;
429
- }
430
- }
431
- if (placement !== resetPlacement) {
432
- return {
433
- reset: {
434
- placement: resetPlacement
435
- }
436
- };
437
- }
438
- }
439
- return {};
440
- }
441
- };
442
- };
443
- const originSides = /* @__PURE__ */ new Set(["left", "top"]);
444
- async function convertValueToCoords(state, options) {
445
- const {
446
- placement,
447
- platform: platform2,
448
- elements
449
- } = state;
450
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
451
- const side = getSide(placement);
452
- const alignment = getAlignment(placement);
453
- const isVertical = getSideAxis(placement) === "y";
454
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
455
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
456
- const rawValue = evaluate(options, state);
457
- let {
458
- mainAxis,
459
- crossAxis,
460
- alignmentAxis
461
- } = typeof rawValue === "number" ? {
462
- mainAxis: rawValue,
463
- crossAxis: 0,
464
- alignmentAxis: null
465
- } : {
466
- mainAxis: rawValue.mainAxis || 0,
467
- crossAxis: rawValue.crossAxis || 0,
468
- alignmentAxis: rawValue.alignmentAxis
469
- };
470
- if (alignment && typeof alignmentAxis === "number") {
471
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
472
- }
473
- return isVertical ? {
474
- x: crossAxis * crossAxisMulti,
475
- y: mainAxis * mainAxisMulti
476
- } : {
477
- x: mainAxis * mainAxisMulti,
478
- y: crossAxis * crossAxisMulti
479
- };
480
- }
481
- const offset$1 = function(options) {
482
- if (options === void 0) {
483
- options = 0;
484
- }
485
- return {
486
- name: "offset",
487
- options,
488
- async fn(state) {
489
- var _middlewareData$offse, _middlewareData$arrow;
490
- const {
491
- x,
492
- y,
493
- placement,
494
- middlewareData
495
- } = state;
496
- const diffCoords = await convertValueToCoords(state, options);
497
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
498
- return {};
499
- }
500
- return {
501
- x: x + diffCoords.x,
502
- y: y + diffCoords.y,
503
- data: {
504
- ...diffCoords,
505
- placement
506
- }
507
- };
508
- }
509
- };
510
- };
511
- function hasWindow() {
512
- return typeof window !== "undefined";
513
- }
514
- function getNodeName(node) {
515
- if (isNode(node)) {
516
- return (node.nodeName || "").toLowerCase();
517
- }
518
- return "#document";
519
- }
520
- function getWindow(node) {
521
- var _node$ownerDocument;
522
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
523
- }
524
- function getDocumentElement(node) {
525
- var _ref;
526
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
527
- }
528
- function isNode(value) {
529
- if (!hasWindow()) {
530
- return false;
531
- }
532
- return value instanceof Node || value instanceof getWindow(value).Node;
533
- }
534
- function isElement(value) {
535
- if (!hasWindow()) {
536
- return false;
537
- }
538
- return value instanceof Element || value instanceof getWindow(value).Element;
539
- }
540
- function isHTMLElement(value) {
541
- if (!hasWindow()) {
542
- return false;
543
- }
544
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
545
- }
546
- function isShadowRoot(value) {
547
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
548
- return false;
549
- }
550
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
551
- }
552
- const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
553
- function isOverflowElement(element) {
554
- const {
555
- overflow,
556
- overflowX,
557
- overflowY,
558
- display
559
- } = getComputedStyle$1(element);
560
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
561
- }
562
- const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
563
- function isTableElement(element) {
564
- return tableElements.has(getNodeName(element));
565
- }
566
- const topLayerSelectors = [":popover-open", ":modal"];
567
- function isTopLayer(element) {
568
- return topLayerSelectors.some((selector) => {
569
- try {
570
- return element.matches(selector);
571
- } catch (_e) {
572
- return false;
573
- }
574
- });
575
- }
576
- const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
577
- const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
578
- const containValues = ["paint", "layout", "strict", "content"];
579
- function isContainingBlock(elementOrCss) {
580
- const webkit = isWebKit();
581
- const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
582
- return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
583
- }
584
- function getContainingBlock(element) {
585
- let currentNode = getParentNode(element);
586
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
587
- if (isContainingBlock(currentNode)) {
588
- return currentNode;
589
- } else if (isTopLayer(currentNode)) {
590
- return null;
591
- }
592
- currentNode = getParentNode(currentNode);
593
- }
594
- return null;
595
- }
596
- function isWebKit() {
597
- if (typeof CSS === "undefined" || !CSS.supports) return false;
598
- return CSS.supports("-webkit-backdrop-filter", "none");
599
- }
600
- const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
601
- function isLastTraversableNode(node) {
602
- return lastTraversableNodeNames.has(getNodeName(node));
603
- }
604
- function getComputedStyle$1(element) {
605
- return getWindow(element).getComputedStyle(element);
606
- }
607
- function getNodeScroll(element) {
608
- if (isElement(element)) {
609
- return {
610
- scrollLeft: element.scrollLeft,
611
- scrollTop: element.scrollTop
612
- };
613
- }
614
- return {
615
- scrollLeft: element.scrollX,
616
- scrollTop: element.scrollY
617
- };
618
- }
619
- function getParentNode(node) {
620
- if (getNodeName(node) === "html") {
621
- return node;
622
- }
623
- const result = (
624
- // Step into the shadow DOM of the parent of a slotted node.
625
- node.assignedSlot || // DOM Element detected.
626
- node.parentNode || // ShadowRoot detected.
627
- isShadowRoot(node) && node.host || // Fallback.
628
- getDocumentElement(node)
629
- );
630
- return isShadowRoot(result) ? result.host : result;
631
- }
632
- function getNearestOverflowAncestor(node) {
633
- const parentNode = getParentNode(node);
634
- if (isLastTraversableNode(parentNode)) {
635
- return node.ownerDocument ? node.ownerDocument.body : node.body;
636
- }
637
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
638
- return parentNode;
639
- }
640
- return getNearestOverflowAncestor(parentNode);
641
- }
642
- function getOverflowAncestors(node, list, traverseIframes) {
643
- var _node$ownerDocument2;
644
- if (list === void 0) {
645
- list = [];
646
- }
647
- if (traverseIframes === void 0) {
648
- traverseIframes = true;
649
- }
650
- const scrollableAncestor = getNearestOverflowAncestor(node);
651
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
652
- const win = getWindow(scrollableAncestor);
653
- if (isBody) {
654
- const frameElement = getFrameElement(win);
655
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
656
- }
657
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
658
- }
659
- function getFrameElement(win) {
660
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
661
- }
662
- function getCssDimensions(element) {
663
- const css = getComputedStyle$1(element);
664
- let width = parseFloat(css.width) || 0;
665
- let height = parseFloat(css.height) || 0;
666
- const hasOffset = isHTMLElement(element);
667
- const offsetWidth = hasOffset ? element.offsetWidth : width;
668
- const offsetHeight = hasOffset ? element.offsetHeight : height;
669
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
670
- if (shouldFallback) {
671
- width = offsetWidth;
672
- height = offsetHeight;
673
- }
674
- return {
675
- width,
676
- height,
677
- $: shouldFallback
678
- };
679
- }
680
- function unwrapElement$1(element) {
681
- return !isElement(element) ? element.contextElement : element;
682
- }
683
- function getScale(element) {
684
- const domElement = unwrapElement$1(element);
685
- if (!isHTMLElement(domElement)) {
686
- return createCoords(1);
687
- }
688
- const rect = domElement.getBoundingClientRect();
689
- const {
690
- width,
691
- height,
692
- $
693
- } = getCssDimensions(domElement);
694
- let x = ($ ? round(rect.width) : rect.width) / width;
695
- let y = ($ ? round(rect.height) : rect.height) / height;
696
- if (!x || !Number.isFinite(x)) {
697
- x = 1;
698
- }
699
- if (!y || !Number.isFinite(y)) {
700
- y = 1;
701
- }
702
- return {
703
- x,
704
- y
705
- };
706
- }
707
- const noOffsets = /* @__PURE__ */ createCoords(0);
708
- function getVisualOffsets(element) {
709
- const win = getWindow(element);
710
- if (!isWebKit() || !win.visualViewport) {
711
- return noOffsets;
712
- }
713
- return {
714
- x: win.visualViewport.offsetLeft,
715
- y: win.visualViewport.offsetTop
716
- };
717
- }
718
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
719
- if (isFixed === void 0) {
720
- isFixed = false;
721
- }
722
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
723
- return false;
724
- }
725
- return isFixed;
726
- }
727
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
728
- if (includeScale === void 0) {
729
- includeScale = false;
730
- }
731
- if (isFixedStrategy === void 0) {
732
- isFixedStrategy = false;
733
- }
734
- const clientRect = element.getBoundingClientRect();
735
- const domElement = unwrapElement$1(element);
736
- let scale = createCoords(1);
737
- if (includeScale) {
738
- if (offsetParent) {
739
- if (isElement(offsetParent)) {
740
- scale = getScale(offsetParent);
741
- }
742
- } else {
743
- scale = getScale(element);
744
- }
745
- }
746
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
747
- let x = (clientRect.left + visualOffsets.x) / scale.x;
748
- let y = (clientRect.top + visualOffsets.y) / scale.y;
749
- let width = clientRect.width / scale.x;
750
- let height = clientRect.height / scale.y;
751
- if (domElement) {
752
- const win = getWindow(domElement);
753
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
754
- let currentWin = win;
755
- let currentIFrame = getFrameElement(currentWin);
756
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
757
- const iframeScale = getScale(currentIFrame);
758
- const iframeRect = currentIFrame.getBoundingClientRect();
759
- const css = getComputedStyle$1(currentIFrame);
760
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
761
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
762
- x *= iframeScale.x;
763
- y *= iframeScale.y;
764
- width *= iframeScale.x;
765
- height *= iframeScale.y;
766
- x += left;
767
- y += top;
768
- currentWin = getWindow(currentIFrame);
769
- currentIFrame = getFrameElement(currentWin);
770
- }
771
- }
772
- return rectToClientRect({
773
- width,
774
- height,
775
- x,
776
- y
777
- });
778
- }
779
- function getWindowScrollBarX(element, rect) {
780
- const leftScroll = getNodeScroll(element).scrollLeft;
781
- if (!rect) {
782
- return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
783
- }
784
- return rect.left + leftScroll;
785
- }
786
- function getHTMLOffset(documentElement, scroll) {
787
- const htmlRect = documentElement.getBoundingClientRect();
788
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
789
- const y = htmlRect.top + scroll.scrollTop;
790
- return {
791
- x,
792
- y
793
- };
794
- }
795
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
796
- let {
797
- elements,
798
- rect,
799
- offsetParent,
800
- strategy
801
- } = _ref;
802
- const isFixed = strategy === "fixed";
803
- const documentElement = getDocumentElement(offsetParent);
804
- const topLayer = elements ? isTopLayer(elements.floating) : false;
805
- if (offsetParent === documentElement || topLayer && isFixed) {
806
- return rect;
807
- }
808
- let scroll = {
809
- scrollLeft: 0,
810
- scrollTop: 0
811
- };
812
- let scale = createCoords(1);
813
- const offsets = createCoords(0);
814
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
815
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
816
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
817
- scroll = getNodeScroll(offsetParent);
818
- }
819
- if (isHTMLElement(offsetParent)) {
820
- const offsetRect = getBoundingClientRect(offsetParent);
821
- scale = getScale(offsetParent);
822
- offsets.x = offsetRect.x + offsetParent.clientLeft;
823
- offsets.y = offsetRect.y + offsetParent.clientTop;
824
- }
825
- }
826
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
827
- return {
828
- width: rect.width * scale.x,
829
- height: rect.height * scale.y,
830
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
831
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
832
- };
833
- }
834
- function getClientRects(element) {
835
- return Array.from(element.getClientRects());
836
- }
837
- function getDocumentRect(element) {
838
- const html = getDocumentElement(element);
839
- const scroll = getNodeScroll(element);
840
- const body = element.ownerDocument.body;
841
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
842
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
843
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
844
- const y = -scroll.scrollTop;
845
- if (getComputedStyle$1(body).direction === "rtl") {
846
- x += max(html.clientWidth, body.clientWidth) - width;
847
- }
848
- return {
849
- width,
850
- height,
851
- x,
852
- y
853
- };
854
- }
855
- const SCROLLBAR_MAX = 25;
856
- function getViewportRect(element, strategy) {
857
- const win = getWindow(element);
858
- const html = getDocumentElement(element);
859
- const visualViewport = win.visualViewport;
860
- let width = html.clientWidth;
861
- let height = html.clientHeight;
862
- let x = 0;
863
- let y = 0;
864
- if (visualViewport) {
865
- width = visualViewport.width;
866
- height = visualViewport.height;
867
- const visualViewportBased = isWebKit();
868
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
869
- x = visualViewport.offsetLeft;
870
- y = visualViewport.offsetTop;
871
- }
872
- }
873
- const windowScrollbarX = getWindowScrollBarX(html);
874
- if (windowScrollbarX <= 0) {
875
- const doc = html.ownerDocument;
876
- const body = doc.body;
877
- const bodyStyles = getComputedStyle(body);
878
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
879
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
880
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
881
- width -= clippingStableScrollbarWidth;
882
- }
883
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
884
- width += windowScrollbarX;
885
- }
886
- return {
887
- width,
888
- height,
889
- x,
890
- y
891
- };
892
- }
893
- const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
894
- function getInnerBoundingClientRect(element, strategy) {
895
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
896
- const top = clientRect.top + element.clientTop;
897
- const left = clientRect.left + element.clientLeft;
898
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
899
- const width = element.clientWidth * scale.x;
900
- const height = element.clientHeight * scale.y;
901
- const x = left * scale.x;
902
- const y = top * scale.y;
903
- return {
904
- width,
905
- height,
906
- x,
907
- y
908
- };
909
- }
910
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
911
- let rect;
912
- if (clippingAncestor === "viewport") {
913
- rect = getViewportRect(element, strategy);
914
- } else if (clippingAncestor === "document") {
915
- rect = getDocumentRect(getDocumentElement(element));
916
- } else if (isElement(clippingAncestor)) {
917
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
918
- } else {
919
- const visualOffsets = getVisualOffsets(element);
920
- rect = {
921
- x: clippingAncestor.x - visualOffsets.x,
922
- y: clippingAncestor.y - visualOffsets.y,
923
- width: clippingAncestor.width,
924
- height: clippingAncestor.height
925
- };
926
- }
927
- return rectToClientRect(rect);
928
- }
929
- function hasFixedPositionAncestor(element, stopNode) {
930
- const parentNode = getParentNode(element);
931
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
932
- return false;
933
- }
934
- return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
935
- }
936
- function getClippingElementAncestors(element, cache) {
937
- const cachedResult = cache.get(element);
938
- if (cachedResult) {
939
- return cachedResult;
940
- }
941
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
942
- let currentContainingBlockComputedStyle = null;
943
- const elementIsFixed = getComputedStyle$1(element).position === "fixed";
944
- let currentNode = elementIsFixed ? getParentNode(element) : element;
945
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
946
- const computedStyle = getComputedStyle$1(currentNode);
947
- const currentNodeIsContaining = isContainingBlock(currentNode);
948
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
949
- currentContainingBlockComputedStyle = null;
950
- }
951
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
952
- if (shouldDropCurrentNode) {
953
- result = result.filter((ancestor) => ancestor !== currentNode);
954
- } else {
955
- currentContainingBlockComputedStyle = computedStyle;
956
- }
957
- currentNode = getParentNode(currentNode);
958
- }
959
- cache.set(element, result);
960
- return result;
961
- }
962
- function getClippingRect(_ref) {
963
- let {
964
- element,
965
- boundary,
966
- rootBoundary,
967
- strategy
968
- } = _ref;
969
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
970
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
971
- const firstClippingAncestor = clippingAncestors[0];
972
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
973
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
974
- accRect.top = max(rect.top, accRect.top);
975
- accRect.right = min(rect.right, accRect.right);
976
- accRect.bottom = min(rect.bottom, accRect.bottom);
977
- accRect.left = max(rect.left, accRect.left);
978
- return accRect;
979
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
980
- return {
981
- width: clippingRect.right - clippingRect.left,
982
- height: clippingRect.bottom - clippingRect.top,
983
- x: clippingRect.left,
984
- y: clippingRect.top
985
- };
986
- }
987
- function getDimensions(element) {
988
- const {
989
- width,
990
- height
991
- } = getCssDimensions(element);
992
- return {
993
- width,
994
- height
995
- };
996
- }
997
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
998
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
999
- const documentElement = getDocumentElement(offsetParent);
1000
- const isFixed = strategy === "fixed";
1001
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1002
- let scroll = {
1003
- scrollLeft: 0,
1004
- scrollTop: 0
1005
- };
1006
- const offsets = createCoords(0);
1007
- function setLeftRTLScrollbarOffset() {
1008
- offsets.x = getWindowScrollBarX(documentElement);
1009
- }
1010
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1011
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
1012
- scroll = getNodeScroll(offsetParent);
1013
- }
1014
- if (isOffsetParentAnElement) {
1015
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1016
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1017
- offsets.y = offsetRect.y + offsetParent.clientTop;
1018
- } else if (documentElement) {
1019
- setLeftRTLScrollbarOffset();
1020
- }
1021
- }
1022
- if (isFixed && !isOffsetParentAnElement && documentElement) {
1023
- setLeftRTLScrollbarOffset();
1024
- }
1025
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1026
- const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1027
- const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1028
- return {
1029
- x,
1030
- y,
1031
- width: rect.width,
1032
- height: rect.height
1033
- };
1034
- }
1035
- function isStaticPositioned(element) {
1036
- return getComputedStyle$1(element).position === "static";
1037
- }
1038
- function getTrueOffsetParent(element, polyfill) {
1039
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
1040
- return null;
1041
- }
1042
- if (polyfill) {
1043
- return polyfill(element);
1044
- }
1045
- let rawOffsetParent = element.offsetParent;
1046
- if (getDocumentElement(element) === rawOffsetParent) {
1047
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
1048
- }
1049
- return rawOffsetParent;
1050
- }
1051
- function getOffsetParent(element, polyfill) {
1052
- const win = getWindow(element);
1053
- if (isTopLayer(element)) {
1054
- return win;
1055
- }
1056
- if (!isHTMLElement(element)) {
1057
- let svgOffsetParent = getParentNode(element);
1058
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1059
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1060
- return svgOffsetParent;
1061
- }
1062
- svgOffsetParent = getParentNode(svgOffsetParent);
1063
- }
1064
- return win;
1065
- }
1066
- let offsetParent = getTrueOffsetParent(element, polyfill);
1067
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1068
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1069
- }
1070
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1071
- return win;
1072
- }
1073
- return offsetParent || getContainingBlock(element) || win;
1074
- }
1075
- const getElementRects = async function(data) {
1076
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1077
- const getDimensionsFn = this.getDimensions;
1078
- const floatingDimensions = await getDimensionsFn(data.floating);
1079
- return {
1080
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1081
- floating: {
1082
- x: 0,
1083
- y: 0,
1084
- width: floatingDimensions.width,
1085
- height: floatingDimensions.height
1086
- }
1087
- };
1088
- };
1089
- function isRTL(element) {
1090
- return getComputedStyle$1(element).direction === "rtl";
1091
- }
1092
- const platform = {
1093
- convertOffsetParentRelativeRectToViewportRelativeRect,
1094
- getDocumentElement,
1095
- getClippingRect,
1096
- getOffsetParent,
1097
- getElementRects,
1098
- getClientRects,
1099
- getDimensions,
1100
- getScale,
1101
- isElement,
1102
- isRTL
1103
- };
1104
- function rectsAreEqual(a, b) {
1105
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1106
- }
1107
- function observeMove(element, onMove) {
1108
- let io = null;
1109
- let timeoutId;
1110
- const root = getDocumentElement(element);
1111
- function cleanup() {
1112
- var _io;
1113
- clearTimeout(timeoutId);
1114
- (_io = io) == null || _io.disconnect();
1115
- io = null;
1116
- }
1117
- function refresh(skip, threshold) {
1118
- if (skip === void 0) {
1119
- skip = false;
1120
- }
1121
- if (threshold === void 0) {
1122
- threshold = 1;
1123
- }
1124
- cleanup();
1125
- const elementRectForRootMargin = element.getBoundingClientRect();
1126
- const {
1127
- left,
1128
- top,
1129
- width,
1130
- height
1131
- } = elementRectForRootMargin;
1132
- if (!skip) {
1133
- onMove();
1134
- }
1135
- if (!width || !height) {
1136
- return;
1137
- }
1138
- const insetTop = floor(top);
1139
- const insetRight = floor(root.clientWidth - (left + width));
1140
- const insetBottom = floor(root.clientHeight - (top + height));
1141
- const insetLeft = floor(left);
1142
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1143
- const options = {
1144
- rootMargin,
1145
- threshold: max(0, min(1, threshold)) || 1
1146
- };
1147
- let isFirstUpdate = true;
1148
- function handleObserve(entries) {
1149
- const ratio = entries[0].intersectionRatio;
1150
- if (ratio !== threshold) {
1151
- if (!isFirstUpdate) {
1152
- return refresh();
1153
- }
1154
- if (!ratio) {
1155
- timeoutId = setTimeout(() => {
1156
- refresh(false, 1e-7);
1157
- }, 1e3);
1158
- } else {
1159
- refresh(false, ratio);
1160
- }
1161
- }
1162
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1163
- refresh();
1164
- }
1165
- isFirstUpdate = false;
1166
- }
1167
- try {
1168
- io = new IntersectionObserver(handleObserve, {
1169
- ...options,
1170
- // Handle <iframe>s
1171
- root: root.ownerDocument
1172
- });
1173
- } catch (_e) {
1174
- io = new IntersectionObserver(handleObserve, options);
1175
- }
1176
- io.observe(element);
1177
- }
1178
- refresh(true);
1179
- return cleanup;
1180
- }
1181
- function autoUpdate(reference, floating, update, options) {
1182
- if (options === void 0) {
1183
- options = {};
1184
- }
1185
- const {
1186
- ancestorScroll = true,
1187
- ancestorResize = true,
1188
- elementResize = typeof ResizeObserver === "function",
1189
- layoutShift = typeof IntersectionObserver === "function",
1190
- animationFrame = false
1191
- } = options;
1192
- const referenceEl = unwrapElement$1(reference);
1193
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
1194
- ancestors.forEach((ancestor) => {
1195
- ancestorScroll && ancestor.addEventListener("scroll", update, {
1196
- passive: true
1197
- });
1198
- ancestorResize && ancestor.addEventListener("resize", update);
1199
- });
1200
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1201
- let reobserveFrame = -1;
1202
- let resizeObserver = null;
1203
- if (elementResize) {
1204
- resizeObserver = new ResizeObserver((_ref) => {
1205
- let [firstEntry] = _ref;
1206
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1207
- resizeObserver.unobserve(floating);
1208
- cancelAnimationFrame(reobserveFrame);
1209
- reobserveFrame = requestAnimationFrame(() => {
1210
- var _resizeObserver;
1211
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1212
- });
1213
- }
1214
- update();
1215
- });
1216
- if (referenceEl && !animationFrame) {
1217
- resizeObserver.observe(referenceEl);
1218
- }
1219
- resizeObserver.observe(floating);
1220
- }
1221
- let frameId;
1222
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1223
- if (animationFrame) {
1224
- frameLoop();
1225
- }
1226
- function frameLoop() {
1227
- const nextRefRect = getBoundingClientRect(reference);
1228
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1229
- update();
1230
- }
1231
- prevRefRect = nextRefRect;
1232
- frameId = requestAnimationFrame(frameLoop);
1233
- }
1234
- update();
1235
- return () => {
1236
- var _resizeObserver2;
1237
- ancestors.forEach((ancestor) => {
1238
- ancestorScroll && ancestor.removeEventListener("scroll", update);
1239
- ancestorResize && ancestor.removeEventListener("resize", update);
1240
- });
1241
- cleanupIo == null || cleanupIo();
1242
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1243
- resizeObserver = null;
1244
- if (animationFrame) {
1245
- cancelAnimationFrame(frameId);
1246
- }
1247
- };
1248
- }
1249
- const offset = offset$1;
1250
- const flip = flip$1;
1251
- const computePosition = (reference, floating, options) => {
1252
- const cache = /* @__PURE__ */ new Map();
1253
- const mergedOptions = {
1254
- platform,
1255
- ...options
1256
- };
1257
- const platformWithCache = {
1258
- ...mergedOptions.platform,
1259
- _c: cache
1260
- };
1261
- return computePosition$1(reference, floating, {
1262
- ...mergedOptions,
1263
- platform: platformWithCache
1264
- });
1265
- };
1266
- function isComponentPublicInstance(target) {
1267
- return target != null && typeof target === "object" && "$el" in target;
1268
- }
1269
- function unwrapElement(target) {
1270
- if (isComponentPublicInstance(target)) {
1271
- const element = target.$el;
1272
- return isNode(element) && getNodeName(element) === "#comment" ? null : element;
1273
- }
1274
- return target;
1275
- }
1276
- function toValue(source) {
1277
- return typeof source === "function" ? source() : unref(source);
1278
- }
1279
- function getDPR(element) {
1280
- if (typeof window === "undefined") {
1281
- return 1;
1282
- }
1283
- const win = element.ownerDocument.defaultView || window;
1284
- return win.devicePixelRatio || 1;
1285
- }
1286
- function roundByDPR(element, value) {
1287
- const dpr = getDPR(element);
1288
- return Math.round(value * dpr) / dpr;
1289
- }
1290
- function useFloating(reference, floating, options) {
1291
- if (options === void 0) {
1292
- options = {};
1293
- }
1294
- const whileElementsMountedOption = options.whileElementsMounted;
1295
- const openOption = computed(() => {
1296
- var _toValue;
1297
- return (_toValue = toValue(options.open)) != null ? _toValue : true;
1298
- });
1299
- const middlewareOption = computed(() => toValue(options.middleware));
1300
- const placementOption = computed(() => {
1301
- var _toValue2;
1302
- return (_toValue2 = toValue(options.placement)) != null ? _toValue2 : "bottom";
1303
- });
1304
- const strategyOption = computed(() => {
1305
- var _toValue3;
1306
- return (_toValue3 = toValue(options.strategy)) != null ? _toValue3 : "absolute";
1307
- });
1308
- const transformOption = computed(() => {
1309
- var _toValue4;
1310
- return (_toValue4 = toValue(options.transform)) != null ? _toValue4 : true;
1311
- });
1312
- const referenceElement = computed(() => unwrapElement(reference.value));
1313
- const floatingElement = computed(() => unwrapElement(floating.value));
1314
- const x = ref(0);
1315
- const y = ref(0);
1316
- const strategy = ref(strategyOption.value);
1317
- const placement = ref(placementOption.value);
1318
- const middlewareData = shallowRef({});
1319
- const isPositioned = ref(false);
1320
- const floatingStyles = computed(() => {
1321
- const initialStyles = {
1322
- position: strategy.value,
1323
- left: "0",
1324
- top: "0"
1325
- };
1326
- if (!floatingElement.value) {
1327
- return initialStyles;
1328
- }
1329
- const xVal = roundByDPR(floatingElement.value, x.value);
1330
- const yVal = roundByDPR(floatingElement.value, y.value);
1331
- if (transformOption.value) {
1332
- return {
1333
- ...initialStyles,
1334
- transform: "translate(" + xVal + "px, " + yVal + "px)",
1335
- ...getDPR(floatingElement.value) >= 1.5 && {
1336
- willChange: "transform"
1337
- }
1338
- };
1339
- }
1340
- return {
1341
- position: strategy.value,
1342
- left: xVal + "px",
1343
- top: yVal + "px"
1344
- };
1345
- });
1346
- let whileElementsMountedCleanup;
1347
- function update() {
1348
- if (referenceElement.value == null || floatingElement.value == null) {
1349
- return;
1350
- }
1351
- const open = openOption.value;
1352
- computePosition(referenceElement.value, floatingElement.value, {
1353
- middleware: middlewareOption.value,
1354
- placement: placementOption.value,
1355
- strategy: strategyOption.value
1356
- }).then((position) => {
1357
- x.value = position.x;
1358
- y.value = position.y;
1359
- strategy.value = position.strategy;
1360
- placement.value = position.placement;
1361
- middlewareData.value = position.middlewareData;
1362
- isPositioned.value = open !== false;
1363
- });
1364
- }
1365
- function cleanup() {
1366
- if (typeof whileElementsMountedCleanup === "function") {
1367
- whileElementsMountedCleanup();
1368
- whileElementsMountedCleanup = void 0;
1369
- }
1370
- }
1371
- function attach() {
1372
- cleanup();
1373
- if (whileElementsMountedOption === void 0) {
1374
- update();
1375
- return;
1376
- }
1377
- if (referenceElement.value != null && floatingElement.value != null) {
1378
- whileElementsMountedCleanup = whileElementsMountedOption(referenceElement.value, floatingElement.value, update);
1379
- return;
1380
- }
1381
- }
1382
- function reset() {
1383
- if (!openOption.value) {
1384
- isPositioned.value = false;
1385
- }
1386
- }
1387
- watch([middlewareOption, placementOption, strategyOption, openOption], update, {
1388
- flush: "sync"
1389
- });
1390
- watch([referenceElement, floatingElement], attach, {
1391
- flush: "sync"
1392
- });
1393
- watch(openOption, reset, {
1394
- flush: "sync"
1395
- });
1396
- if (getCurrentScope()) {
1397
- onScopeDispose(cleanup);
1398
- }
1399
- return {
1400
- x: shallowReadonly(x),
1401
- y: shallowReadonly(y),
1402
- strategy: shallowReadonly(strategy),
1403
- placement: shallowReadonly(placement),
1404
- middlewareData: shallowReadonly(middlewareData),
1405
- isPositioned: shallowReadonly(isPositioned),
1406
- floatingStyles,
1407
- update
1408
- };
1409
- }
1410
- const colors = {
1411
- "primary-light": {
1412
- base: "bg-primary-50",
1413
- baseDark: "bg-primary-100",
1414
- text: "text-primary-800",
1415
- border: "border-primary-800/70"
1416
- },
1417
- primary: {
1418
- base: "bg-primary-100",
1419
- baseDark: "bg-primary-200",
1420
- text: "text-primary-800",
1421
- border: "border-primary-800/70"
1422
- },
1423
- secondary: {
1424
- base: "bg-secondary-100",
1425
- baseDark: "bg-secondary-200",
1426
- text: "text-secondary-800",
1427
- border: "border-secondary-800/70"
1428
- },
1429
- dark: {
1430
- base: "bg-gray-100",
1431
- baseDark: "bg-gray-200",
1432
- text: "text-gray-800",
1433
- border: "border-gray-800/70"
1434
- },
1435
- red: {
1436
- base: "bg-red-100",
1437
- baseDark: "bg-red-200",
1438
- text: "text-red-800",
1439
- border: "border-red-800/70"
1440
- },
1441
- green: {
1442
- base: "bg-green-100",
1443
- baseDark: "bg-green-200",
1444
- text: "text-green-800",
1445
- border: "border-green-800/70"
1446
- },
1447
- blue: {
1448
- base: "bg-blue-100",
1449
- baseDark: "bg-blue-200",
1450
- text: "text-blue-800",
1451
- border: "border-blue-800/70"
1452
- },
1453
- teal: {
1454
- base: "bg-teal-100",
1455
- baseDark: "bg-teal-200",
1456
- text: "text-teal-800",
1457
- border: "border-teal-800/70"
1458
- },
1459
- "teal-light": {
1460
- base: "bg-teal-50",
1461
- baseDark: "bg-teal-200",
1462
- text: "text-teal-800",
1463
- border: "border-teal-800/70"
1464
- },
1465
- yellow: {
1466
- base: "bg-yellow-100",
1467
- baseDark: "bg-yellow-200",
1468
- text: "text-yellow-800",
1469
- border: "border-yellow-800/70"
1470
- },
1471
- indigo: {
1472
- base: "bg-indigo-100",
1473
- baseDark: "bg-indigo-200",
1474
- text: "text-indigo-800",
1475
- border: "border-indigo-800/70"
1476
- },
1477
- purple: {
1478
- base: "bg-purple-100",
1479
- baseDark: "bg-purple-200",
1480
- text: "text-purple-800",
1481
- border: "border-purple-800/70"
1482
- },
1483
- pink: {
1484
- base: "bg-pink-100",
1485
- baseDark: "bg-pink-200",
1486
- text: "text-pink-800",
1487
- border: "border-pink-800/70"
1488
- },
1489
- orange: {
1490
- base: "bg-orange-100",
1491
- baseDark: "bg-orange-200",
1492
- text: "text-orange-800",
1493
- border: "border-orange-800/70"
1494
- },
1495
- black: {
1496
- base: "bg-black",
1497
- baseDark: "bg-gray-900",
1498
- text: "text-white",
1499
- border: "bg-gray-900/70"
1500
- }
1501
- };
1502
- const _sfc_main = /* @__PURE__ */ defineComponent({
1503
- __name: "Chip",
1504
- props: {
1505
- color: { default: "primary" },
1506
- content: {},
1507
- dark: { type: Boolean, default: false },
1508
- removable: { type: Boolean, default: false },
1509
- size: { default: "md" },
1510
- variant: { default: "default" },
1511
- textClass: {},
1512
- tag: { default: "span" },
1513
- hasChipBefore: { type: Boolean },
1514
- hasChipAfter: { type: Boolean }
1515
- },
1516
- emits: ["removed"],
1517
- setup(__props) {
1518
- const props = __props;
1519
- const computedBaseColor = computed(() => colors[props.color][props.dark ? "baseDark" : "base"]);
1520
- const computedTextColor = computed(() => colors[props.color].text);
1521
- const computedBorderColor = computed(() => colors[props.color].border);
1522
- return (_ctx, _cache) => {
1523
- return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps(_ctx.$attrs, {
1524
- class: ["inline-flex items-center gap-1 whitespace-nowrap rounded pl-2", {
1525
- "pr-2": !__props.removable,
1526
- "h-4 px-2": __props.size === "xs",
1527
- "h-4": __props.size === "sm",
1528
- "h-5": __props.size === "md",
1529
- "h-6": __props.size === "lg",
1530
- "rounded-r-none": __props.hasChipAfter,
1531
- "rounded-l-none": __props.hasChipBefore,
1532
- [computedBaseColor.value]: !!computedBaseColor.value && __props.variant !== "outline",
1533
- "border bg-transparent": __props.variant === "outline",
1534
- [computedBorderColor.value]: __props.variant === "outline" && !!computedBorderColor.value
1535
- }]
1536
- }), {
1537
- default: withCtx(() => [
1538
- createElementVNode("span", {
1539
- class: normalizeClass([[computedTextColor.value, __props.textClass, __props.size === "xs" ? "text-[11px]" : "text-xs"], "flex-grow text-center"])
1540
- }, [
1541
- renderSlot(_ctx.$slots, "default", {}, () => [
1542
- createTextVNode(toDisplayString(__props.content), 1)
1543
- ])
1544
- ], 2),
1545
- __props.removable ? (openBlock(), createElementBlock("button", {
1546
- key: 0,
1547
- class: normalizeClass([{
1548
- "h-5 w-4": __props.size === "sm",
1549
- "h-5 w-5": __props.size === "md",
1550
- "h-5 w-6": __props.size === "lg",
1551
- [computedBaseColor.value]: !!computedBaseColor.value
1552
- }, "flex aspect-square h-full items-center justify-center rounded"]),
1553
- type: "button",
1554
- title: "Remove",
1555
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("removed"))
1556
- }, [
1557
- createVNode(unref(_sfc_main$1), {
1558
- class: normalizeClass(computedTextColor.value),
1559
- icon: "close",
1560
- size: "xs"
1561
- }, null, 8, ["class"])
1562
- ], 2)) : createCommentVNode("", true)
1563
- ]),
1564
- _: 3
1565
- }, 16, ["class"]);
1566
- };
1567
- }
1568
- });
1569
- export {
1570
- _sfc_main as _,
1571
- autoUpdate as a,
1572
- _export_sfc as b,
1573
- flip as f,
1574
- offset as o,
1575
- useFloating as u
1576
- };