@lanaco/lnc-react-ui 4.0.141 → 4.0.143
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.
- package/dist/DetailedProductsSection.cjs +2 -2
- package/dist/DetailedProductsSection.js +11 -11
- package/dist/SalesCampaignsSection.cjs +102 -51
- package/dist/SalesCampaignsSection.js +430 -403
- package/dist/SwipeableDrawer.cjs +7 -7
- package/dist/SwipeableDrawer.js +72 -69
- package/dist/UrgentSaleProductsSection.cjs +1 -1
- package/dist/UrgentSaleProductsSection.js +1 -1
- package/dist/{suspense-product-card-detailed-BA06QK8a.cjs → suspense-product-card-detailed-B7gioG73.cjs} +1 -1
- package/dist/{suspense-product-card-detailed-CUd-EI3U.js → suspense-product-card-detailed-FUKF_Pyc.js} +1 -1
- package/package.json +1 -1
package/dist/SwipeableDrawer.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),u=require("react"),t=require("./index-BpbMKBf_.cjs"),$=require("./emotion-styled.browser.esm-BtEseadx.cjs"),y=require("./utils-Dl9xPH4c.cjs"),X=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),Y=(e,o,n,c,a)=>{if(e==="right"||e==="left"||o&&n)return"height: 100%;";if(!(o&&a===!0))return o?"height: "+c+";":"height: 0;"},A=(e,o,n,c,a)=>{if(e==="top"||e==="bottom"||o&&n)return"width: 100%;";if(!(o&&a===!0))return o?"width: "+c+";":"width: 0;"},B=$.styled.div`
|
|
2
2
|
touch-action: none;
|
|
3
3
|
overflow: auto;
|
|
4
4
|
max-height: ${e=>e.isOpen||e.unsetHeight===!1?"100dvh":0};
|
|
5
|
-
${e=>
|
|
5
|
+
${e=>Y(e.direction,e.isOpen,e.isFullPage,e.drawerSize,e.unsetHeight)}
|
|
6
6
|
max-width: ${e=>e.isOpen||e.unsetWidth===!1?"100vw":0};
|
|
7
|
-
${e=>
|
|
8
|
-
position:
|
|
7
|
+
${e=>A(e.direction,e.isOpen,e.isFullPage,e.drawerSize,e.unsetWidth)}
|
|
8
|
+
position: ${e=>e.position};
|
|
9
9
|
z-index: ${e=>e.zIndex};
|
|
10
10
|
${e=>e.direction==="bottom"?"bottom: 0":"top: 0"};
|
|
11
11
|
${e=>e.direction==="right"?"right: 0":"left: 0"};
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
background-color: ${e=>y.getColorRgbaValue(e.theme,"Drawer",e.color,"enabled","background")};
|
|
22
22
|
color: ${e=>y.getColorRgbaValue(e.theme,"Drawer",e.color,"enabled","text")};
|
|
23
23
|
${e=>y.getComponentTypographyCss(e.theme,"Drawer",e.size,"enabled")};
|
|
24
|
-
`,
|
|
24
|
+
`,G=$.styled.div`
|
|
25
25
|
z-index: ${e=>e.zIndex};
|
|
26
|
-
position:
|
|
26
|
+
position: ${e=>e.position};
|
|
27
27
|
top: 0;
|
|
28
28
|
left: 0;
|
|
29
29
|
|
|
30
30
|
height: ${e=>e.isOpen===!0&&e.enableOverlay===!0?"100dvh":0};
|
|
31
31
|
width: ${e=>e.isOpen===!0&&e.enableOverlay===!0?"100vw":0};
|
|
32
32
|
background-color: ${e=>e.overlayColor};
|
|
33
|
-
|
|
33
|
+
`,v=u.forwardRef((e,o)=>{const{direction:n="right",open:c=!1,duration:a=.8,enableOverlay:x=!0,zIndex:m=100,position:O="fixed",closeOnClickOutside:P=!0,closeOnSwipe:d=!0,isFullPage:z=!1,unsetHeight:S=!1,unsetWidth:C=!1,onClose:D=()=>{},onOpen:k=()=>{},className:q="",style:F={},color:H="neutral",overlayColor:I="rgba(123, 123, 123, 0.5)",size:j="small",drawerSize:E="12.5rem",children:W,...M}=e,_=X.useTheme(),i=u.useRef(),[g,b]=u.useState(!1);var h=null,p=null;function R(r){return r.touches||r.originalEvent.touches}function L(r){const l=R(r)[0];h=l.clientX,p=l.clientY}function N(r){if(!(!h||!p)){var l=r.touches[0].clientX,V=r.touches[0].clientY,w=h-l,T=p-V;Math.abs(w)>Math.abs(T)?w>0?d==!0&&n=="left"&&s():d==!0&&n=="right"&&s():T>0?d==!0&&n=="top"&&s():d==!0&&n=="bottom"&&s(),h=null,p=null}}u.useImperativeHandle(o,()=>({open(){U()},close(){s()},isOpen(){return g}}));const U=r=>{b(!0),k(r)},s=r=>{b(!1),D(r)};return u.useEffect(()=>{const r=l=>{i!=null&&i.current&&!(i!=null&&i.current.contains(l.target))&&P==!0&&s()};return document.addEventListener("click",r,!0),()=>{document.removeEventListener("click",r,!0)}},[]),f.jsx(f.Fragment,{children:f.jsx(G,{enableOverlay:x,overlayColor:I,isOpen:g,zIndex:m,position:O,children:f.jsx(B,{ref:i,zIndex:m,isOpen:g,direction:n,isFullPage:z,unsetHeight:S,unsetWidth:C,duration:a,color:H,theme:_,className:q,style:F,size:j,drawerSize:E,onTouchStart:L,onTouchMove:N,...M,children:W})})})});v.propTypes={direction:t.PropTypes.oneOf(["top","right","left","bottom"]),open:t.PropTypes.bool,duration:t.PropTypes.number,enableOverlay:t.PropTypes.bool,zIndex:t.PropTypes.number,position:t.PropTypes.string,closeOnClickOutside:t.PropTypes.bool,closeOnSwipe:t.PropTypes.bool,isFullPage:t.PropTypes.bool,unsetHeight:t.PropTypes.bool,unsetWidth:t.PropTypes.bool,onClose:t.PropTypes.func,onOpen:t.PropTypes.func,className:t.PropTypes.string,style:t.PropTypes.object,overlayColor:t.PropTypes.string,drawerSize:t.PropTypes.string,size:t.PropTypes.oneOf(["small","medium","large"]),color:t.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};module.exports=v;
|
package/dist/SwipeableDrawer.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as g, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as g, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as q, useRef as A, useState as B, useImperativeHandle as G, useEffect as J } from "react";
|
|
3
3
|
import { P as t } from "./index-CblbdqjE.js";
|
|
4
4
|
import { s as y } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
5
|
-
import { b as
|
|
6
|
-
import { u as
|
|
7
|
-
const
|
|
8
|
-
if (e === "right" || e === "left" ||
|
|
9
|
-
if (!(
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
if (e === "top" || e === "bottom" ||
|
|
13
|
-
if (!(
|
|
14
|
-
return
|
|
15
|
-
},
|
|
5
|
+
import { b as w, c as K } from "./utils-BdsZgOUE.js";
|
|
6
|
+
import { u as Q } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
|
|
7
|
+
const R = (e, o, r, u, s) => {
|
|
8
|
+
if (e === "right" || e === "left" || o && r) return "height: 100%;";
|
|
9
|
+
if (!(o && s === !0))
|
|
10
|
+
return o ? "height: " + u + ";" : "height: 0;";
|
|
11
|
+
}, Z = (e, o, r, u, s) => {
|
|
12
|
+
if (e === "top" || e === "bottom" || o && r) return "width: 100%;";
|
|
13
|
+
if (!(o && s === !0))
|
|
14
|
+
return o ? "width: " + u + ";" : "width: 0;";
|
|
15
|
+
}, _ = y.div`
|
|
16
16
|
touch-action: none;
|
|
17
17
|
overflow: auto;
|
|
18
18
|
max-height: ${(e) => e.isOpen || e.unsetHeight === !1 ? "100dvh" : 0};
|
|
19
|
-
${(e) =>
|
|
19
|
+
${(e) => R(
|
|
20
20
|
e.direction,
|
|
21
21
|
e.isOpen,
|
|
22
22
|
e.isFullPage,
|
|
@@ -24,14 +24,14 @@ const Q = (e, r, o, u, s) => {
|
|
|
24
24
|
e.unsetHeight
|
|
25
25
|
)}
|
|
26
26
|
max-width: ${(e) => e.isOpen || e.unsetWidth === !1 ? "100vw" : 0};
|
|
27
|
-
${(e) =>
|
|
27
|
+
${(e) => Z(
|
|
28
28
|
e.direction,
|
|
29
29
|
e.isOpen,
|
|
30
30
|
e.isFullPage,
|
|
31
31
|
e.drawerSize,
|
|
32
32
|
e.unsetWidth
|
|
33
33
|
)}
|
|
34
|
-
position:
|
|
34
|
+
position: ${(e) => e.position};
|
|
35
35
|
z-index: ${(e) => e.zIndex};
|
|
36
36
|
${(e) => e.direction === "bottom" ? "bottom: 0" : "top: 0"};
|
|
37
37
|
${(e) => e.direction === "right" ? "right: 0" : "left: 0"};
|
|
@@ -44,68 +44,69 @@ const Q = (e, r, o, u, s) => {
|
|
|
44
44
|
|
|
45
45
|
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
|
|
46
46
|
|
|
47
|
-
background-color: ${(e) =>
|
|
47
|
+
background-color: ${(e) => w(
|
|
48
48
|
e.theme,
|
|
49
49
|
"Drawer",
|
|
50
50
|
e.color,
|
|
51
51
|
"enabled",
|
|
52
52
|
"background"
|
|
53
53
|
)};
|
|
54
|
-
color: ${(e) =>
|
|
55
|
-
${(e) =>
|
|
56
|
-
`,
|
|
54
|
+
color: ${(e) => w(e.theme, "Drawer", e.color, "enabled", "text")};
|
|
55
|
+
${(e) => K(e.theme, "Drawer", e.size, "enabled")};
|
|
56
|
+
`, ee = y.div`
|
|
57
57
|
z-index: ${(e) => e.zIndex};
|
|
58
|
-
position:
|
|
58
|
+
position: ${(e) => e.position};
|
|
59
59
|
top: 0;
|
|
60
60
|
left: 0;
|
|
61
61
|
|
|
62
62
|
height: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100dvh" : 0};
|
|
63
63
|
width: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100vw" : 0};
|
|
64
64
|
background-color: ${(e) => e.overlayColor};
|
|
65
|
-
`,
|
|
65
|
+
`, te = q((e, o) => {
|
|
66
66
|
const {
|
|
67
|
-
direction:
|
|
67
|
+
direction: r = "right",
|
|
68
68
|
open: u = !1,
|
|
69
69
|
duration: s = 0.8,
|
|
70
70
|
enableOverlay: O = !0,
|
|
71
71
|
zIndex: m = 100,
|
|
72
|
+
position: p = "fixed",
|
|
72
73
|
closeOnClickOutside: x = !0,
|
|
73
74
|
closeOnSwipe: c = !0,
|
|
74
|
-
isFullPage:
|
|
75
|
-
unsetHeight:
|
|
76
|
-
unsetWidth:
|
|
75
|
+
isFullPage: z = !1,
|
|
76
|
+
unsetHeight: S = !1,
|
|
77
|
+
unsetWidth: C = !1,
|
|
77
78
|
//----------------
|
|
78
|
-
onClose:
|
|
79
|
+
onClose: D = () => {
|
|
79
80
|
},
|
|
80
|
-
onOpen:
|
|
81
|
+
onOpen: T = () => {
|
|
81
82
|
},
|
|
82
83
|
//----------------
|
|
83
|
-
className:
|
|
84
|
-
style:
|
|
85
|
-
color:
|
|
86
|
-
overlayColor:
|
|
87
|
-
size:
|
|
88
|
-
drawerSize:
|
|
89
|
-
children:
|
|
90
|
-
...
|
|
91
|
-
} = e,
|
|
84
|
+
className: k = "",
|
|
85
|
+
style: H = {},
|
|
86
|
+
color: I = "neutral",
|
|
87
|
+
overlayColor: P = "rgba(123, 123, 123, 0.5)",
|
|
88
|
+
size: F = "small",
|
|
89
|
+
drawerSize: W = "12.5rem",
|
|
90
|
+
children: E,
|
|
91
|
+
...M
|
|
92
|
+
} = e, j = Q(), i = A(), [f, b] = B(!1);
|
|
92
93
|
var d = null, h = null;
|
|
93
|
-
function
|
|
94
|
+
function L(n) {
|
|
94
95
|
return n.touches || n.originalEvent.touches;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
-
const a =
|
|
97
|
+
function N(n) {
|
|
98
|
+
const a = L(n)[0];
|
|
98
99
|
d = a.clientX, h = a.clientY;
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
+
function U(n) {
|
|
101
102
|
if (!(!d || !h)) {
|
|
102
|
-
var a = n.touches[0].clientX,
|
|
103
|
-
Math.abs(
|
|
103
|
+
var a = n.touches[0].clientX, Y = n.touches[0].clientY, $ = d - a, v = h - Y;
|
|
104
|
+
Math.abs($) > Math.abs(v) ? $ > 0 ? c == !0 && r == "left" && l() : c == !0 && r == "right" && l() : v > 0 ? c == !0 && r == "top" && l() : c == !0 && r == "bottom" && l(), d = null, h = null;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
G(o, () => ({
|
|
107
108
|
open() {
|
|
108
|
-
|
|
109
|
+
X();
|
|
109
110
|
},
|
|
110
111
|
close() {
|
|
111
112
|
l();
|
|
@@ -114,52 +115,53 @@ const Q = (e, r, o, u, s) => {
|
|
|
114
115
|
return f;
|
|
115
116
|
}
|
|
116
117
|
}));
|
|
117
|
-
const
|
|
118
|
-
b(!0),
|
|
118
|
+
const X = (n) => {
|
|
119
|
+
b(!0), T(n);
|
|
119
120
|
}, l = (n) => {
|
|
120
|
-
b(!1),
|
|
121
|
+
b(!1), D(n);
|
|
121
122
|
};
|
|
122
|
-
return
|
|
123
|
+
return J(() => {
|
|
123
124
|
const n = (a) => {
|
|
124
125
|
i != null && i.current && !(i != null && i.current.contains(a.target)) && x == !0 && l();
|
|
125
126
|
};
|
|
126
127
|
return document.addEventListener("click", n, !0), () => {
|
|
127
128
|
document.removeEventListener("click", n, !0);
|
|
128
129
|
};
|
|
129
|
-
}, []), /* @__PURE__ */ g(
|
|
130
|
-
|
|
130
|
+
}, []), /* @__PURE__ */ g(V, { children: /* @__PURE__ */ g(
|
|
131
|
+
ee,
|
|
131
132
|
{
|
|
132
133
|
enableOverlay: O,
|
|
133
|
-
overlayColor:
|
|
134
|
+
overlayColor: P,
|
|
134
135
|
isOpen: f,
|
|
135
136
|
zIndex: m,
|
|
137
|
+
position: p,
|
|
136
138
|
children: /* @__PURE__ */ g(
|
|
137
|
-
|
|
139
|
+
_,
|
|
138
140
|
{
|
|
139
141
|
ref: i,
|
|
140
142
|
zIndex: m,
|
|
141
143
|
isOpen: f,
|
|
142
|
-
direction:
|
|
143
|
-
isFullPage:
|
|
144
|
-
unsetHeight:
|
|
145
|
-
unsetWidth:
|
|
144
|
+
direction: r,
|
|
145
|
+
isFullPage: z,
|
|
146
|
+
unsetHeight: S,
|
|
147
|
+
unsetWidth: C,
|
|
146
148
|
duration: s,
|
|
147
|
-
color:
|
|
148
|
-
theme:
|
|
149
|
-
className:
|
|
150
|
-
style:
|
|
151
|
-
size:
|
|
152
|
-
drawerSize:
|
|
153
|
-
onTouchStart:
|
|
154
|
-
onTouchMove:
|
|
155
|
-
...
|
|
156
|
-
children:
|
|
149
|
+
color: I,
|
|
150
|
+
theme: j,
|
|
151
|
+
className: k,
|
|
152
|
+
style: H,
|
|
153
|
+
size: F,
|
|
154
|
+
drawerSize: W,
|
|
155
|
+
onTouchStart: N,
|
|
156
|
+
onTouchMove: U,
|
|
157
|
+
...M,
|
|
158
|
+
children: E
|
|
157
159
|
}
|
|
158
160
|
)
|
|
159
161
|
}
|
|
160
162
|
) });
|
|
161
163
|
});
|
|
162
|
-
|
|
164
|
+
te.propTypes = {
|
|
163
165
|
direction: t.oneOf(["top", "right", "left", "bottom"]),
|
|
164
166
|
open: t.bool,
|
|
165
167
|
/**
|
|
@@ -174,6 +176,7 @@ ee.propTypes = {
|
|
|
174
176
|
* z-index of Drawer
|
|
175
177
|
*/
|
|
176
178
|
zIndex: t.number,
|
|
179
|
+
position: t.string,
|
|
177
180
|
closeOnClickOutside: t.bool,
|
|
178
181
|
closeOnSwipe: t.bool,
|
|
179
182
|
/**
|
|
@@ -209,5 +212,5 @@ ee.propTypes = {
|
|
|
209
212
|
])
|
|
210
213
|
};
|
|
211
214
|
export {
|
|
212
|
-
|
|
215
|
+
te as default
|
|
213
216
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-B7gioG73.cjs"),N=v.styled.div`
|
|
2
2
|
padding: 1.75rem 3rem;
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: ${o=>`repeat(${o.limit||5}, minmax(0, 1fr))`};
|
|
@@ -4,7 +4,7 @@ import { s as F } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
|
4
4
|
import { M as I, S as T } from "./consts-BuFChS64.js";
|
|
5
5
|
import { u as _ } from "./useDetectMobile-Bkvj0VMa.js";
|
|
6
6
|
import B from "./Button.js";
|
|
7
|
-
import { D, S as E } from "./suspense-product-card-detailed-
|
|
7
|
+
import { D, S as E } from "./suspense-product-card-detailed-FUKF_Pyc.js";
|
|
8
8
|
const j = F.div`
|
|
9
9
|
padding: 1.75rem 3rem;
|
|
10
10
|
display: grid;
|
|
@@ -262,4 +262,4 @@
|
|
|
262
262
|
font-size: 1rem;
|
|
263
263
|
color: var(--warning-500, #F59E0B);
|
|
264
264
|
}
|
|
265
|
-
`,ve=l.forwardRef(({sponsoredText:m="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="RealEstates_",i={Mileage:{icon:"mng-lnc-road",measure:"km"},YearOfProduction:{icon:"mng-lnc-calendar",measure:""},Fuel:{icon:"mng-lnc-gas-station",measure:""},EnginePowerKW:{icon:"mng-lnc-engine",measure:"kW"},Transmission:{icon:"mng-lnc-transmission",measure:""},Model:{icon:"mng-lnc-application",measure:""},Brand:{icon:"mng-lnc-car--front",measure:""},SurfaceArea:{icon:"mng-lnc-right-angle",measure:""},Floor:{icon:"mng-lnc-elevator",measure:""},FurnishedCondition:{icon:"mng-lnc-sofa-01",measure:""},AdType:{icon:"mng-lnc-notes",measure:""},NumberOfRooms:{icon:"mng-lnc-meeting-room",measure:""},HeatingType:{icon:"mng-lnc-heat",measure:""},AirConditioning:{icon:"mng-lnc-air-conditioner",measure:""},Type:{icon:"mng-lnc-house-building",measure:""},Parking:{icon:"mng-lnc-parking-area-circle",measure:""},Internet:{icon:"mng-lnc-wifi-02",measure:""},State:{icon:"mng-lnc-settings-1",measure:""},NumberOfPremises:{icon:"mng-lnc-meeting-room",measure:""},Pool:{icon:"mng-lnc-pool",measure:""},Approach:{icon:"mng-lnc-driveway",measure:""},NumberOfBeds:{icon:"mng-lnc-bed",measure:""},Kitchen:{icon:"mng-lnc-fridge",measure:""},BathroomToilet:{icon:"mng-lnc-bath",measure:""},default:{icon:" mng-lnc-clock--filled",measure:""}},Ce=l.forwardRef((m,w)=>{const{uuid:p,
|
|
265
|
+
`,ve=l.forwardRef(({sponsoredText:m="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="RealEstates_",i={Mileage:{icon:"mng-lnc-road",measure:"km"},YearOfProduction:{icon:"mng-lnc-calendar",measure:""},Fuel:{icon:"mng-lnc-gas-station",measure:""},EnginePowerKW:{icon:"mng-lnc-engine",measure:"kW"},Transmission:{icon:"mng-lnc-transmission",measure:""},Model:{icon:"mng-lnc-application",measure:""},Brand:{icon:"mng-lnc-car--front",measure:""},SurfaceArea:{icon:"mng-lnc-right-angle",measure:""},Floor:{icon:"mng-lnc-elevator",measure:""},FurnishedCondition:{icon:"mng-lnc-sofa-01",measure:""},AdType:{icon:"mng-lnc-notes",measure:""},NumberOfRooms:{icon:"mng-lnc-meeting-room",measure:""},HeatingType:{icon:"mng-lnc-heat",measure:""},AirConditioning:{icon:"mng-lnc-air-conditioner",measure:""},Type:{icon:"mng-lnc-house-building",measure:""},Parking:{icon:"mng-lnc-parking-area-circle",measure:""},Internet:{icon:"mng-lnc-wifi-02",measure:""},State:{icon:"mng-lnc-settings-1",measure:""},NumberOfPremises:{icon:"mng-lnc-meeting-room",measure:""},Pool:{icon:"mng-lnc-pool",measure:""},Approach:{icon:"mng-lnc-driveway",measure:""},NumberOfBeds:{icon:"mng-lnc-bed",measure:""},Kitchen:{icon:"mng-lnc-fridge",measure:""},BathroomToilet:{icon:"mng-lnc-bath",measure:""},default:{icon:" mng-lnc-clock--filled",measure:""}},Ce=l.forwardRef((m,w)=>{const{uuid:p,name:y,price:u=0,sellingPrice:k,currency:j,isNegotiable:N,isFree:C,imageUrl:L,location:U,sponsored:O,imageComponent:V,onSelectCard:Y=()=>{},freeText:K="Free",negotiableText:Z="Negotiable",tags:t=[],categoryCode:P,condition:$,quantity:S,trade:E,sponsoredText:H,onBookmark:B=()=>{},bookmarkComponent:z,bookmarked:M,bookmarkLists:J}=m,T=ge.useDetectMobile(),Q=()=>o.isDefined(z)?l.cloneElement(z,{key:`bookmark_pr__${M}`,bookmarked:M,productUuid:p,onAddToBookmark:()=>B(!0,p),onRemoveFromBookmark:()=>B(!1,p),bookmarkedUuidList:J}):e.jsx(e.Fragment,{}),q=[we,be,ye,ke,je,_e,xe,Ne].some(r=>P==null?void 0:P.includes(r)),[ee,F]=l.useState(!1),re=()=>{F(!0)},ne=()=>{F(!1)},a=l.useRef(null),h=l.useRef([]),[W,oe]=l.useState(t==null?void 0:t.length),te=()=>{var f,c,b;if(!(a!=null&&a.current)||((f=h==null?void 0:h.current)==null?void 0:f.length)===0)return;const r=(c=a==null?void 0:a.current)==null?void 0:c.offsetWidth;let n=0,s=0;for(let d=0;d<(t==null?void 0:t.length);d++){const v=((b=h==null?void 0:h.current[d])==null?void 0:b.offsetWidth)||0,g=n+v+4;if(g<=r)n+=g,s++;else break}oe(s)};l.useEffect(()=>{const r=a==null?void 0:a.current;if(!r)return;const n=new ResizeObserver(()=>{te()});return n.observe(r),()=>{n.disconnect()}},[t]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=t==null?void 0:t.slice(0,W))==null?void 0:r.map((n,s)=>{var v,g,I,R,G;const f=((v=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:v.icon)??((g=i==null?void 0:i.default)==null?void 0:g.icon)??"",c=((I=n==null?void 0:n.measurementUnit)==null?void 0:I.symbol)??((R=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:R.measure)??"",d=[(n==null?void 0:n.value)??((G=n==null?void 0:n.multiOptions)==null?void 0:G[0])??"",c].filter(Boolean).join(" ");return T?e.jsxs("div",{className:"tag-mobile",children:[d,s<W-1?" · ":""]}):e.jsxs(_,{ref:ce=>h.current[s]=ce,className:`tag ${O?"tag-sponsored":""}`,children:[e.jsx("i",{className:f}),d]},`detailed-products-section-tag__${s+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:t==null?void 0:t.map((r,n)=>{var d,v,g;const s=((d=r==null?void 0:r.measurementUnit)==null?void 0:d.symbol)??((v=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:v.measure)??"",c=[(r==null?void 0:r.value)??((g=r==null?void 0:r.multiOptions)==null?void 0:g[0])??"",s].filter(Boolean).join(" "),b=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${b}: `}),e.jsx("span",{className:"tags-popover__value",children:c})]},`detailed-products-section-tag-dropdown__${n+1}`)})}),ae=()=>{var r;if(T){const n=[$,S,E];return(r=n==null?void 0:n.filter(s=>o.isDefinedNotEmptyString(s)))==null?void 0:r.map((s,f,c)=>e.jsxs("div",{className:"tag-mobile",children:[s,f<(c==null?void 0:c.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[$&&e.jsx(_,{className:"tag",children:$},"detailed-products-section-tag__condition"),S&&e.jsx(_,{className:"tag",children:S},"detailed-products-section-tag__quantity"),E&&e.jsx(_,{className:"tag",children:E},"detailed-products-section-tag__trade")]})},D=u>0&&j&&N!==!0&&C!==!0&&u!==k;return e.jsxs(X,{ref:a,className:"product-card",onClick:Y,children:[e.jsxs(ue,{className:"product-image-wrapper",children:[e.jsx(Q,{}),o.isDefined(V)?V:e.jsx(le.ProductImageWrapper,{src:L})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:y})}),e.jsxs("div",{className:"wrapper-card-3",children:[q&&e.jsx("div",{...T?{}:{onMouseEnter:re,onMouseLeave:ne},children:e.jsxs(de,{placement:"bottom",open:ee,children:[e.jsx(me,{children:se()}),e.jsx(pe,{style:{all:"unset"},children:e.jsx(he,{children:ie()})})]})}),!q&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${D?"new-price":""}`,children:[k>0&&j&&N!==!0&&C!==!0&&e.jsx("div",{children:`${o.formatPrice(k)} ${o.GetCurrencySymbol(j)}`}),D&&e.jsx("div",{className:`${k>0?"full-price":""}`,children:`${o.formatPrice(u)} ${o.GetCurrencySymbol(j)}`}),N&&Z,C&&K]}),e.jsx("div",{className:"location-text",children:U})]}),O===!0&&e.jsx(ve,{sponsoredText:H})]})}),Pe=l.forwardRef(({},m)=>e.jsxs(X,{className:"product-card",children:[e.jsx("img",{className:"skeleton-img"}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-title"}),e.jsx("div",{className:"skeleton-tags"})]}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-price"}),e.jsx("div",{className:"skeleton-sponsored"})]})]})),$e=({limit:m=5,isLoading:w=!1,keyPrefix:p})=>e.jsx(e.Fragment,{children:Array.from({length:m},(y,u)=>e.jsx(Pe,{isLoading:w},`${p}-skeleton-product-card-${u}`))}),Se=({children:m,fallbackComponent:w=e.jsx(e.Fragment,{}),isLoading:p=!1,limit:y,keyPrefix:u})=>e.jsx(l.Suspense,{fallbackComponent:w,children:p===!0?e.jsx($e,{isLoading:p,limit:y,keyPrefix:u}):m});exports.DetailedProductCard=Ce;exports.SuspenseDetailedProductCard=Se;
|