@wayke-se/components-react 3.0.0-beta.6 → 3.0.0-beta.7
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/index.js +1958 -928
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1926 -896
- package/dist/index.mjs.map +4 -4
- package/esbuild/common.js +1 -1
- package/esbuild/lib.js +0 -1
- package/esbuild/start.js +1 -0
- package/package.json +1 -1
- package/src/components/Gallery/index.tsx +2 -6
- package/src/utils/formats.ts +1 -1
- package/www/index.html +1 -1
package/dist/index.js
CHANGED
|
@@ -2131,7 +2131,7 @@
|
|
|
2131
2131
|
|
|
2132
2132
|
// src/utils/formats.ts
|
|
2133
2133
|
var import_date_fns = __require("date-fns");
|
|
2134
|
-
var
|
|
2134
|
+
var import_sv = __toESM(__require("date-fns/locale/sv"));
|
|
2135
2135
|
|
|
2136
2136
|
// src/utils/constants.ts
|
|
2137
2137
|
var MANUFACTURER = "manufacturer";
|
|
@@ -2210,11 +2210,11 @@
|
|
|
2210
2210
|
const date = new Date(value);
|
|
2211
2211
|
switch (format) {
|
|
2212
2212
|
case dateTimeFormat.YearMonth:
|
|
2213
|
-
return (0, import_date_fns.format)(date, "MMMM yyyy", { locale:
|
|
2213
|
+
return (0, import_date_fns.format)(date, "MMMM yyyy", { locale: import_sv.default });
|
|
2214
2214
|
case dateTimeFormat.DayMonth:
|
|
2215
|
-
return (0, import_date_fns.format)(date, "d MMMM yyyy", { locale:
|
|
2215
|
+
return (0, import_date_fns.format)(date, "d MMMM yyyy", { locale: import_sv.default });
|
|
2216
2216
|
default:
|
|
2217
|
-
return (0, import_date_fns.format)(date, "yyyy-MM-dd HH:mm", { locale:
|
|
2217
|
+
return (0, import_date_fns.format)(date, "yyyy-MM-dd HH:mm", { locale: import_sv.default });
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
2220
|
};
|
|
@@ -2335,6 +2335,12 @@
|
|
|
2335
2335
|
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2336
2336
|
d: "M13 17.7L4.3 9 13 .3l.7.7-8 8 8 8-.7.7z"
|
|
2337
2337
|
}));
|
|
2338
|
+
var IconChevronRight = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2339
|
+
viewBox: "0 0 18 18",
|
|
2340
|
+
block
|
|
2341
|
+
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2342
|
+
d: "M5 .3L13.7 9 5 17.7l-.7-.7 8-8-8-8L5 .3z"
|
|
2343
|
+
}));
|
|
2338
2344
|
var IconCheck = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2339
2345
|
viewBox: "0 0 16 16",
|
|
2340
2346
|
block
|
|
@@ -4541,7 +4547,7 @@
|
|
|
4541
4547
|
var search_default = WaykeSearch;
|
|
4542
4548
|
|
|
4543
4549
|
// src/layouts/searchItem/index.tsx
|
|
4544
|
-
var
|
|
4550
|
+
var import_react98 = __toESM(__require("react"));
|
|
4545
4551
|
var import_ecom_web = __toESM(__require("@wayke-se/ecom-web"));
|
|
4546
4552
|
|
|
4547
4553
|
// src/components/PriceTable/index.tsx
|
|
@@ -4820,220 +4826,1442 @@
|
|
|
4820
4826
|
var ExtendContent_default = ExtendContent;
|
|
4821
4827
|
|
|
4822
4828
|
// src/components/Gallery/index.tsx
|
|
4823
|
-
var
|
|
4829
|
+
var import_react52 = __toESM(__require("react"));
|
|
4830
|
+
var import_react_slick = __toESM(__require("react-slick"));
|
|
4824
4831
|
var import_scroll_into_view_if_needed = __toESM(__require("scroll-into-view-if-needed"));
|
|
4825
|
-
var Gallery = ({ media, placeholderImage }) => {
|
|
4826
|
-
const slider = (0, import_react38.useRef)(null);
|
|
4827
|
-
const quickNavRef = (0, import_react38.useRef)(null);
|
|
4828
|
-
const isDragging = (0, import_react38.useRef)(false);
|
|
4829
|
-
const [index2, setIndex] = (0, import_react38.useState)(0);
|
|
4830
|
-
const [lightbox, setLightbox] = (0, import_react38.useState)(false);
|
|
4831
|
-
const [navigationDisabled, setNavigationDisabled] = (0, import_react38.useState)(false);
|
|
4832
|
-
const beforeChange = (0, import_react38.useCallback)((_, newIndex) => {
|
|
4833
|
-
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
4834
|
-
if (element) {
|
|
4835
|
-
(0, import_scroll_into_view_if_needed.default)(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
4836
|
-
}
|
|
4837
|
-
setIndex(newIndex);
|
|
4838
|
-
}, []);
|
|
4839
|
-
const onMouseDown = (0, import_react38.useCallback)(() => {
|
|
4840
|
-
if (isDragging.current) {
|
|
4841
|
-
isDragging.current = false;
|
|
4842
|
-
}
|
|
4843
|
-
}, []);
|
|
4844
|
-
const onMouseMove = (0, import_react38.useCallback)(() => {
|
|
4845
|
-
if (!isDragging.current) {
|
|
4846
|
-
isDragging.current = true;
|
|
4847
|
-
}
|
|
4848
|
-
}, []);
|
|
4849
|
-
const onClick = (0, import_react38.useCallback)(() => {
|
|
4850
|
-
pubsub_default.publish("ImagesClick");
|
|
4851
|
-
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
4852
|
-
setLightbox(true);
|
|
4853
|
-
}
|
|
4854
|
-
}, [lightbox, media]);
|
|
4855
|
-
const nextImage = (0, import_react38.useCallback)(() => {
|
|
4856
|
-
if (!slider || !slider.current) {
|
|
4857
|
-
return;
|
|
4858
|
-
}
|
|
4859
|
-
slider.current.slickNext();
|
|
4860
|
-
}, [slider]);
|
|
4861
|
-
const prevImage = (0, import_react38.useCallback)(() => {
|
|
4862
|
-
if (!slider || !slider.current) {
|
|
4863
|
-
return;
|
|
4864
|
-
}
|
|
4865
|
-
slider.current.slickPrev();
|
|
4866
|
-
}, [slider]);
|
|
4867
|
-
const goTo = (target) => {
|
|
4868
|
-
if (!slider || !slider.current) {
|
|
4869
|
-
return;
|
|
4870
|
-
}
|
|
4871
|
-
if (slider.current) {
|
|
4872
|
-
setIndex(target);
|
|
4873
|
-
slider.current.slickGoTo(target);
|
|
4874
|
-
}
|
|
4875
|
-
};
|
|
4876
|
-
const onDisableNavigation = () => {
|
|
4877
|
-
if (!isDragging.current)
|
|
4878
|
-
setNavigationDisabled(true);
|
|
4879
|
-
};
|
|
4880
|
-
const onEnableNavigation = (e) => {
|
|
4881
|
-
e.stopPropagation();
|
|
4882
|
-
isDragging.current = false;
|
|
4883
|
-
setNavigationDisabled(false);
|
|
4884
|
-
};
|
|
4885
|
-
const onToggleLightbox = (0, import_react38.useCallback)(() => setLightbox(!lightbox), [lightbox]);
|
|
4886
|
-
const mediaLength = media?.length || 0;
|
|
4887
|
-
const placeholder = (0, import_react38.useMemo)(
|
|
4888
|
-
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
4889
|
-
[placeholderImage]
|
|
4890
|
-
);
|
|
4891
|
-
return /* @__PURE__ */ import_react38.default.createElement("p", null, "heheh");
|
|
4892
|
-
};
|
|
4893
|
-
var Gallery_default = Gallery;
|
|
4894
4832
|
|
|
4895
|
-
// src/components/
|
|
4833
|
+
// src/components/Gallery/wrapper.tsx
|
|
4896
4834
|
var import_styled_components34 = __toESM(__require("styled-components"));
|
|
4897
|
-
var
|
|
4898
|
-
|
|
4899
|
-
|
|
4835
|
+
var quickNavWidth = 83;
|
|
4836
|
+
var Wrapper17 = import_styled_components34.default.div`
|
|
4837
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
4838
|
+
${Wrapper} & {
|
|
4839
|
+
margin-left: ${size(-3)};
|
|
4840
|
+
margin-right: ${size(-3)};
|
|
4841
|
+
}
|
|
4842
|
+
}
|
|
4843
|
+
|
|
4844
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
4845
|
+
${Wrapper} & {
|
|
4846
|
+
margin-left: ${size(-2)};
|
|
4847
|
+
margin-right: ${size(-2)};
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4900
4850
|
|
|
4901
4851
|
${(props) => props.theme.breakpoint.Md} {
|
|
4902
|
-
|
|
4852
|
+
position: relative;
|
|
4853
|
+
padding-right: ${quickNavWidth}px;
|
|
4903
4854
|
}
|
|
4904
4855
|
`;
|
|
4905
|
-
var
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4856
|
+
var Main = import_styled_components34.default.div`
|
|
4857
|
+
position: relative;
|
|
4858
|
+
height: 0;
|
|
4859
|
+
padding-bottom: 66.66666667%;
|
|
4909
4860
|
|
|
4910
4861
|
${(props) => props.theme.breakpoint.Md} {
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4862
|
+
//background-color: ${(props) => props.theme.color.accent};
|
|
4863
|
+
}
|
|
4864
|
+
|
|
4865
|
+
.slick-slider,
|
|
4866
|
+
.slick-list,
|
|
4867
|
+
.slick-track,
|
|
4868
|
+
.slick-slide,
|
|
4869
|
+
.slick-slide > * {
|
|
4870
|
+
height: 100%;
|
|
4871
|
+
}
|
|
4872
|
+
|
|
4873
|
+
.slick-slide > * {
|
|
4874
|
+
font-size: 0;
|
|
4875
|
+
|
|
4876
|
+
> * {
|
|
4877
|
+
font-size: 1rem;
|
|
4878
|
+
}
|
|
4914
4879
|
}
|
|
4915
4880
|
`;
|
|
4916
|
-
var
|
|
4881
|
+
var Alt = import_styled_components34.default.div`
|
|
4882
|
+
position: absolute;
|
|
4883
|
+
top: 0;
|
|
4884
|
+
bottom: 0;
|
|
4885
|
+
right: 0;
|
|
4886
|
+
width: ${quickNavWidth}px;
|
|
4887
|
+
padding-left: ${size(1)};
|
|
4888
|
+
|
|
4917
4889
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4918
|
-
display:
|
|
4890
|
+
display: none;
|
|
4919
4891
|
}
|
|
4920
4892
|
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4893
|
+
:after {
|
|
4894
|
+
content: '';
|
|
4895
|
+
position: absolute;
|
|
4896
|
+
bottom: 0;
|
|
4897
|
+
left: 0;
|
|
4898
|
+
right: 0;
|
|
4899
|
+
height: ${size(2.5)};
|
|
4900
|
+
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
|
4901
|
+
pointer-events: none;
|
|
4925
4902
|
}
|
|
4926
4903
|
`;
|
|
4927
|
-
var
|
|
4904
|
+
var Item8 = import_styled_components34.default.div`
|
|
4905
|
+
position: relative;
|
|
4906
|
+
width: 100%;
|
|
4907
|
+
height: 100%;
|
|
4908
|
+
overflow: hidden;
|
|
4909
|
+
|
|
4910
|
+
:focus {
|
|
4911
|
+
outline: none;
|
|
4912
|
+
}
|
|
4913
|
+
|
|
4928
4914
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4929
|
-
|
|
4915
|
+
//background-color: ${(props) => props.theme.color.textDark};
|
|
4916
|
+
transition: border-radius 150ms ease;
|
|
4917
|
+
}
|
|
4918
|
+
`;
|
|
4919
|
+
var SliderWrapper = import_styled_components34.default.div`
|
|
4920
|
+
position: absolute;
|
|
4921
|
+
top: 0;
|
|
4922
|
+
bottom: 0;
|
|
4923
|
+
left: 0;
|
|
4924
|
+
right: 0;
|
|
4930
4925
|
|
|
4931
|
-
|
|
4932
|
-
|
|
4926
|
+
.slick-slider {
|
|
4927
|
+
position: absolute;
|
|
4928
|
+
top: 0;
|
|
4929
|
+
bottom: 0;
|
|
4930
|
+
left: 0;
|
|
4931
|
+
right: 0;
|
|
4932
|
+
user-select: none;
|
|
4933
|
+
touch-action: pan-y;
|
|
4934
|
+
-webkit-tap-highlight-color: transparent;
|
|
4935
|
+
|
|
4936
|
+
.slick-list,
|
|
4937
|
+
.slick-track {
|
|
4938
|
+
transform: translate3d(0, 0, 0);
|
|
4933
4939
|
}
|
|
4940
|
+
}
|
|
4934
4941
|
|
|
4935
|
-
|
|
4936
|
-
|
|
4942
|
+
.slick-list {
|
|
4943
|
+
position: relative;
|
|
4944
|
+
display: block;
|
|
4945
|
+
margin: 0;
|
|
4946
|
+
padding: 0;
|
|
4947
|
+
overflow: hidden;
|
|
4948
|
+
|
|
4949
|
+
&:focus {
|
|
4950
|
+
outline: none;
|
|
4937
4951
|
}
|
|
4938
4952
|
|
|
4939
|
-
|
|
4940
|
-
|
|
4953
|
+
&.dragging {
|
|
4954
|
+
cursor: pointer;
|
|
4955
|
+
cursor: hand;
|
|
4941
4956
|
}
|
|
4942
4957
|
}
|
|
4943
4958
|
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4959
|
+
.slick-track {
|
|
4960
|
+
position: relative;
|
|
4961
|
+
top: 0;
|
|
4962
|
+
left: 0;
|
|
4963
|
+
display: block;
|
|
4964
|
+
margin-left: auto;
|
|
4965
|
+
margin-right: auto;
|
|
4966
|
+
|
|
4967
|
+
&::before,
|
|
4968
|
+
&::after {
|
|
4969
|
+
content: '';
|
|
4970
|
+
display: table;
|
|
4947
4971
|
}
|
|
4948
4972
|
|
|
4949
|
-
|
|
4950
|
-
|
|
4973
|
+
&::after {
|
|
4974
|
+
clear: both;
|
|
4951
4975
|
}
|
|
4952
4976
|
}
|
|
4953
|
-
`;
|
|
4954
|
-
var ProductPageMainSection = import_styled_components34.default.div`
|
|
4955
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
4956
|
-
order: 99;
|
|
4957
|
-
padding: ${size(4)} 0;
|
|
4958
|
-
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
4959
4977
|
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4978
|
+
.slick-slide {
|
|
4979
|
+
display: none;
|
|
4980
|
+
float: left;
|
|
4981
|
+
min-height: 1px;
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4984
|
+
.slick-loading {
|
|
4985
|
+
.slick-track {
|
|
4986
|
+
visibility: hidden;
|
|
4987
|
+
}
|
|
4988
|
+
|
|
4989
|
+
img {
|
|
4990
|
+
display: none;
|
|
4965
4991
|
}
|
|
4966
4992
|
}
|
|
4967
4993
|
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
padding-top: ${size(8)};
|
|
4972
|
-
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
4994
|
+
.slick-initialized {
|
|
4995
|
+
.slick-slide {
|
|
4996
|
+
display: block;
|
|
4973
4997
|
}
|
|
4974
4998
|
}
|
|
4975
|
-
`;
|
|
4976
|
-
var ProductPageContentLimit = import_styled_components34.default.div`
|
|
4977
|
-
max-width: 420px;
|
|
4978
|
-
`;
|
|
4979
4999
|
|
|
4980
|
-
|
|
4981
|
-
|
|
5000
|
+
.slick-slide.dragging img {
|
|
5001
|
+
pointer-events: none;
|
|
5002
|
+
}
|
|
4982
5003
|
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
5004
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
5005
|
+
overflow: hidden;
|
|
5006
|
+
|
|
5007
|
+
.slick-list {
|
|
5008
|
+
overflow: visible;
|
|
5009
|
+
width: 95%;
|
|
5010
|
+
}
|
|
5011
|
+
|
|
5012
|
+
.slick-slide {
|
|
5013
|
+
border-right: ${size(1)} solid ${(props) => props.theme.color.bg};
|
|
5014
|
+
//transform: scale(0.95);
|
|
5015
|
+
transform-origin: 0 50%;
|
|
5016
|
+
transition: transform 150ms ease;
|
|
5017
|
+
}
|
|
5018
|
+
|
|
5019
|
+
.slick-slide.slick-active {
|
|
5020
|
+
transform: none;
|
|
5021
|
+
|
|
5022
|
+
${Item8} {
|
|
5023
|
+
border-top-left-radius: 0;
|
|
5024
|
+
border-bottom-left-radius: 0;
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
4992
5027
|
}
|
|
4993
5028
|
`;
|
|
4994
|
-
var
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
5029
|
+
var Image2 = import_styled_components34.default.img`
|
|
5030
|
+
display: block;
|
|
5031
|
+
position: absolute;
|
|
5032
|
+
left: 0;
|
|
5033
|
+
top: 0;
|
|
5034
|
+
right: 0;
|
|
5035
|
+
bottom: 0;
|
|
5036
|
+
margin: auto;
|
|
5037
|
+
max-width: 100%;
|
|
5038
|
+
max-height: 100%;
|
|
5039
|
+
object-fit: cover;
|
|
5040
|
+
cursor: pointer;
|
|
4999
5041
|
`;
|
|
5000
|
-
var
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5042
|
+
var ImageFull = import_styled_components34.default.img`
|
|
5043
|
+
display: block;
|
|
5044
|
+
position: absolute;
|
|
5045
|
+
top: 0;
|
|
5046
|
+
left: 0;
|
|
5047
|
+
width: 100%;
|
|
5048
|
+
height: 100%;
|
|
5049
|
+
object-fit: cover;
|
|
5050
|
+
`;
|
|
5051
|
+
var Arrow = (0, import_styled_components34.default)(ButtonReset)`
|
|
5052
|
+
position: absolute;
|
|
5053
|
+
top: 50%;
|
|
5054
|
+
transform: translateY(-50%);
|
|
5055
|
+
display: flex;
|
|
5056
|
+
align-items: center;
|
|
5057
|
+
justify-content: center;
|
|
5058
|
+
width: ${size(4)};
|
|
5059
|
+
height: ${size(4)};
|
|
5060
|
+
border-radius: 50%;
|
|
5061
|
+
font-size: 1rem;
|
|
5062
|
+
line-height: 1;
|
|
5063
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
5064
|
+
backdrop-filter: blur(5px);
|
|
5065
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5066
|
+
color: ${(props) => props.theme.color.textDark};
|
|
5067
|
+
transform-origin: 50% 50%;
|
|
5068
|
+
transition: transform 200ms ease;
|
|
5069
|
+
|
|
5070
|
+
:before {
|
|
5071
|
+
content: '';
|
|
5072
|
+
position: absolute;
|
|
5073
|
+
top: 0;
|
|
5074
|
+
bottom: 0;
|
|
5075
|
+
left: 0;
|
|
5076
|
+
right: 0;
|
|
5077
|
+
border-radius: 50%;
|
|
5078
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
5079
|
+
opacity: 0;
|
|
5080
|
+
transition: opacity 200ms ease;
|
|
5081
|
+
}
|
|
5082
|
+
|
|
5083
|
+
:hover {
|
|
5084
|
+
:before {
|
|
5085
|
+
opacity: 1;
|
|
5086
|
+
}
|
|
5087
|
+
}
|
|
5088
|
+
|
|
5089
|
+
:active {
|
|
5090
|
+
transform: translateY(-50%) scale(0.95);
|
|
5091
|
+
}
|
|
5092
|
+
|
|
5093
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5094
|
+
display: none;
|
|
5095
|
+
}
|
|
5096
|
+
`;
|
|
5097
|
+
var ArrowLeft = (0, import_styled_components34.default)(Arrow)`
|
|
5098
|
+
left: ${size(2)};
|
|
5099
|
+
`;
|
|
5100
|
+
var ArrowRight = (0, import_styled_components34.default)(Arrow)`
|
|
5101
|
+
right: ${size(2)};
|
|
5102
|
+
`;
|
|
5103
|
+
var QuickNav = import_styled_components34.default.ul`
|
|
5104
|
+
position: relative;
|
|
5105
|
+
max-height: 100%;
|
|
5106
|
+
list-style: none;
|
|
5107
|
+
padding: 0;
|
|
5108
|
+
margin: 0;
|
|
5109
|
+
overflow: auto;
|
|
5110
|
+
-webkit-overflow-scrolling: touch;
|
|
5111
|
+
`;
|
|
5112
|
+
var QuickNavItem = import_styled_components34.default.li.attrs(() => ({
|
|
5113
|
+
className: "wayke__theme wayke__color--primary-text"
|
|
5114
|
+
}))`
|
|
5115
|
+
position: relative;
|
|
5116
|
+
|
|
5117
|
+
& + & {
|
|
5118
|
+
margin-top: ${size(1)};
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
${({ active }) => active && import_styled_components34.css`
|
|
5122
|
+
:before {
|
|
5123
|
+
content: '';
|
|
5124
|
+
position: absolute;
|
|
5125
|
+
top: 0;
|
|
5126
|
+
left: 0;
|
|
5127
|
+
width: 100%;
|
|
5128
|
+
height: 100%;
|
|
5129
|
+
border: 3px solid currentColor;
|
|
5130
|
+
z-index: 2;
|
|
5131
|
+
}
|
|
5132
|
+
`}
|
|
5133
|
+
`;
|
|
5134
|
+
var QuickNavBtn = (0, import_styled_components34.default)(ButtonReset)`
|
|
5135
|
+
position: relative;
|
|
5136
|
+
display: block;
|
|
5137
|
+
width: 100%;
|
|
5138
|
+
height: 0;
|
|
5139
|
+
padding-bottom: 66.66666667%; // 3:2
|
|
5140
|
+
transform-origin: 50% 50%;
|
|
5141
|
+
transition: transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5142
|
+
|
|
5143
|
+
:before {
|
|
5144
|
+
content: '';
|
|
5145
|
+
position: absolute;
|
|
5146
|
+
top: 0;
|
|
5147
|
+
left: 0;
|
|
5148
|
+
width: 100%;
|
|
5149
|
+
height: 100%;
|
|
5150
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
5151
|
+
opacity: 0;
|
|
5152
|
+
z-index: 1;
|
|
5153
|
+
transition: opacity 150ms ease;
|
|
5154
|
+
}
|
|
5155
|
+
|
|
5156
|
+
:hover {
|
|
5157
|
+
:before {
|
|
5158
|
+
opacity: 1;
|
|
5159
|
+
}
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
:active {
|
|
5163
|
+
transform: scale(0.95);
|
|
5164
|
+
}
|
|
5165
|
+
`;
|
|
5166
|
+
var QuickNavImg = import_styled_components34.default.img`
|
|
5167
|
+
display: block;
|
|
5168
|
+
position: absolute;
|
|
5169
|
+
top: 0;
|
|
5170
|
+
left: 0;
|
|
5171
|
+
width: 100%;
|
|
5172
|
+
height: 100%;
|
|
5173
|
+
object-fit: cover;
|
|
5174
|
+
`;
|
|
5175
|
+
var MediaButtonWrapper = import_styled_components34.default.div`
|
|
5176
|
+
position: absolute;
|
|
5177
|
+
bottom: ${size(2)};
|
|
5178
|
+
left: 50%;
|
|
5179
|
+
transform: translateX(-50%);
|
|
5180
|
+
z-index: 1;
|
|
5181
|
+
`;
|
|
5182
|
+
var EnableNavigationButton = import_styled_components34.default.div`
|
|
5183
|
+
position: absolute;
|
|
5184
|
+
bottom: ${size(2)};
|
|
5185
|
+
left: 50%;
|
|
5186
|
+
transform: translateX(-50%);
|
|
5187
|
+
z-index: 1;
|
|
5188
|
+
`;
|
|
5189
|
+
|
|
5190
|
+
// src/components/Lightbox/index.tsx
|
|
5191
|
+
var import_react45 = __toESM(__require("react"));
|
|
5192
|
+
|
|
5193
|
+
// src/components/Lightbox/wrapper.tsx
|
|
5194
|
+
var import_styled_components35 = __toESM(__require("styled-components"));
|
|
5195
|
+
var Wrapper18 = import_styled_components35.default.div`
|
|
5196
|
+
position: fixed;
|
|
5197
|
+
top: 0;
|
|
5198
|
+
bottom: 0;
|
|
5199
|
+
left: 0;
|
|
5200
|
+
right: 0;
|
|
5201
|
+
padding: ${size(3)};
|
|
5202
|
+
z-index: 90;
|
|
5203
|
+
overflow: auto;
|
|
5204
|
+
|
|
5205
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5206
|
+
padding: ${size(2)};
|
|
5207
|
+
}
|
|
5208
|
+
`;
|
|
5209
|
+
var UiBlock2 = import_styled_components35.default.div.attrs(() => ({
|
|
5210
|
+
role: "button"
|
|
5211
|
+
}))`
|
|
5212
|
+
position: fixed;
|
|
5213
|
+
top: 0;
|
|
5214
|
+
bottom: 0;
|
|
5215
|
+
left: 0;
|
|
5216
|
+
right: 0;
|
|
5217
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
5218
|
+
z-index: -1;
|
|
5219
|
+
`;
|
|
5220
|
+
var Item9 = import_styled_components35.default.div`
|
|
5221
|
+
position: relative;
|
|
5222
|
+
|
|
5223
|
+
& + & {
|
|
5224
|
+
margin-top: ${size(1)};
|
|
5225
|
+
}
|
|
5226
|
+
`;
|
|
5227
|
+
var Img2 = import_styled_components35.default.img`
|
|
5228
|
+
position: relative;
|
|
5229
|
+
display: block;
|
|
5230
|
+
max-width: 100%;
|
|
5231
|
+
max-height: calc(100vh - ${size(6)});
|
|
5232
|
+
margin: 0 auto;
|
|
5233
|
+
z-index: 1;
|
|
5234
|
+
|
|
5235
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5236
|
+
max-height: calc(100vh - ${size(4)});
|
|
5237
|
+
}
|
|
5238
|
+
`;
|
|
5239
|
+
var CloseBtn2 = (0, import_styled_components35.default)(ButtonReset)`
|
|
5240
|
+
display: flex;
|
|
5241
|
+
align-items: center;
|
|
5242
|
+
justify-content: center;
|
|
5243
|
+
position: fixed;
|
|
5244
|
+
top: ${size(2)};
|
|
5245
|
+
right: ${size(2)};
|
|
5246
|
+
width: ${size(5)};
|
|
5247
|
+
height: ${size(5)};
|
|
5248
|
+
border-radius: 50%;
|
|
5249
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
5250
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5251
|
+
transform-origin: 50% 50%;
|
|
5252
|
+
transition: 200ms ease, transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5253
|
+
z-index: 1;
|
|
5254
|
+
|
|
5255
|
+
:before {
|
|
5256
|
+
content: '';
|
|
5257
|
+
position: absolute;
|
|
5258
|
+
top: 0;
|
|
5259
|
+
left: 0;
|
|
5260
|
+
width: 100%;
|
|
5261
|
+
height: 100%;
|
|
5262
|
+
background-color: ${(props) => props.theme.color.hoverOverlay};
|
|
5263
|
+
border-radius: 50%;
|
|
5264
|
+
opacity: 0;
|
|
5265
|
+
transition: opacity 150ms ease;
|
|
5266
|
+
}
|
|
5267
|
+
|
|
5268
|
+
:hover {
|
|
5269
|
+
:before {
|
|
5270
|
+
opacity: 1;
|
|
5271
|
+
}
|
|
5272
|
+
}
|
|
5273
|
+
|
|
5274
|
+
:active {
|
|
5275
|
+
transform: scale(0.97);
|
|
5276
|
+
}
|
|
5277
|
+
|
|
5278
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5279
|
+
top: ${size(1)};
|
|
5280
|
+
right: ${size(1)};
|
|
5281
|
+
}
|
|
5282
|
+
`;
|
|
5283
|
+
|
|
5284
|
+
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5285
|
+
var import_react41 = __toESM(__require("react"));
|
|
5286
|
+
|
|
5287
|
+
// src/components/Video/YoutubePlayer.tsx
|
|
5288
|
+
var import_react38 = __toESM(__require("react"));
|
|
5289
|
+
|
|
5290
|
+
// src/components/Video/utils.ts
|
|
5291
|
+
var getVimeoId = (url) => {
|
|
5292
|
+
const regExp = /\/(\d+)/;
|
|
5293
|
+
const match = url.match(regExp);
|
|
5294
|
+
return match && match[1].length > 3 ? match[1] : "";
|
|
5295
|
+
};
|
|
5296
|
+
var getYouTubeId = (url) => {
|
|
5297
|
+
const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
|
5298
|
+
const match = url.match(regExp);
|
|
5299
|
+
return match && match[7].length === 11 ? match[7] : "";
|
|
5300
|
+
};
|
|
5301
|
+
var youtubeBase = "https://img.youtube.com/vi/";
|
|
5302
|
+
var getYoutubeThumbnail = (url) => {
|
|
5303
|
+
const id = getYouTubeId(url);
|
|
5304
|
+
if (!id) {
|
|
5305
|
+
return void 0;
|
|
5306
|
+
}
|
|
5307
|
+
return {
|
|
5308
|
+
maxresdefault: `${youtubeBase}${id}/maxresdefault.jpg`,
|
|
5309
|
+
hqdefault: `${youtubeBase}${id}/hqdefault.jpg`,
|
|
5310
|
+
mqdefault: `${youtubeBase}${id}/mqdefault.jpg`
|
|
5311
|
+
};
|
|
5312
|
+
};
|
|
5313
|
+
var onImageLoad = (e, thumbnail) => {
|
|
5314
|
+
if (thumbnail?.length === 2 && e.currentTarget.src === thumbnail[0] && e.currentTarget.naturalWidth === 120 && e.currentTarget.naturalHeight === 90) {
|
|
5315
|
+
e.currentTarget.src = thumbnail[1];
|
|
5316
|
+
}
|
|
5317
|
+
};
|
|
5318
|
+
var onImageError = (e, thumbnail) => {
|
|
5319
|
+
if (thumbnail?.length === 2) {
|
|
5320
|
+
e.currentTarget.src = thumbnail[1];
|
|
5321
|
+
}
|
|
5322
|
+
};
|
|
5323
|
+
|
|
5324
|
+
// src/components/Video/wrapper.tsx
|
|
5325
|
+
var import_styled_components36 = __toESM(__require("styled-components"));
|
|
5326
|
+
var Wrapper19 = import_styled_components36.default.div`
|
|
5327
|
+
position: relative;
|
|
5328
|
+
width: 100%;
|
|
5329
|
+
height: ${(props) => props.isPreview ? "100%" : 0};
|
|
5330
|
+
padding-bottom: ${(props) => props.ratio ? props.ratio : "56.25%"};
|
|
5331
|
+
`;
|
|
5332
|
+
var Iframe = import_styled_components36.default.iframe.attrs(() => ({
|
|
5333
|
+
width: "100%",
|
|
5334
|
+
height: "100%",
|
|
5335
|
+
allowFullScreen: true,
|
|
5336
|
+
frameBorder: "0"
|
|
5337
|
+
}))`
|
|
5338
|
+
position: absolute;
|
|
5339
|
+
top: 0;
|
|
5340
|
+
left: 0;
|
|
5341
|
+
width: 100%;
|
|
5342
|
+
height: 100%;
|
|
5343
|
+
`;
|
|
5344
|
+
|
|
5345
|
+
// src/components/Video/YoutubePlayer.tsx
|
|
5346
|
+
var YouTubePlayer = ({ url, autoplay }) => /* @__PURE__ */ import_react38.default.createElement(Wrapper19, null, /* @__PURE__ */ import_react38.default.createElement(Iframe, {
|
|
5347
|
+
src: `https://www.youtube.com/embed/${getYouTubeId(url)}?&enablejsapi=1&?rel=0${autoplay ? "&autoplay=1" : ""}`
|
|
5348
|
+
}));
|
|
5349
|
+
var YoutubePlayer_default = YouTubePlayer;
|
|
5350
|
+
|
|
5351
|
+
// src/components/Video/VimeoPlayer.tsx
|
|
5352
|
+
var import_react39 = __toESM(__require("react"));
|
|
5353
|
+
var VimeoPlayer = ({ url, autoplay }) => /* @__PURE__ */ import_react39.default.createElement(Wrapper19, null, /* @__PURE__ */ import_react39.default.createElement(Iframe, {
|
|
5354
|
+
src: `https://player.vimeo.com/video/${getVimeoId(url)}?${autoplay ? "&autoplay=1" : ""}&loop=0&autopause=0`
|
|
5355
|
+
}));
|
|
5356
|
+
var VimeoPlayer_default = VimeoPlayer;
|
|
5357
|
+
|
|
5358
|
+
// src/components/Video/CustomPlayer.tsx
|
|
5359
|
+
var import_react40 = __toESM(__require("react"));
|
|
5360
|
+
|
|
5361
|
+
// src/components/Video/Video.tsx
|
|
5362
|
+
var import_styled_components37 = __toESM(__require("styled-components"));
|
|
5363
|
+
var Video = import_styled_components37.default.video`
|
|
5364
|
+
position: absolute;
|
|
5365
|
+
top: 0;
|
|
5366
|
+
left: 0;
|
|
5367
|
+
object-fit: ${({ modal }) => modal ? "contain" : "cover"};
|
|
5368
|
+
`;
|
|
5369
|
+
var Video_default = Video;
|
|
5370
|
+
|
|
5371
|
+
// src/components/Video/CustomPlayer.tsx
|
|
5372
|
+
var CustomPlayer = ({ url, controls, modal, ratio = "56.25%", isPreview }) => {
|
|
5373
|
+
return /* @__PURE__ */ import_react40.default.createElement(Wrapper19, {
|
|
5374
|
+
ratio,
|
|
5375
|
+
isPreview
|
|
5376
|
+
}, /* @__PURE__ */ import_react40.default.createElement(Video_default, {
|
|
5377
|
+
key: url,
|
|
5378
|
+
modal,
|
|
5379
|
+
preload: "metadata",
|
|
5380
|
+
controls,
|
|
5381
|
+
width: "100%",
|
|
5382
|
+
height: "100%",
|
|
5383
|
+
src: url
|
|
5384
|
+
}));
|
|
5385
|
+
};
|
|
5386
|
+
var CustomPlayer_default = CustomPlayer;
|
|
5387
|
+
|
|
5388
|
+
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5389
|
+
var ytNames = ["youtube.com", "youtu.be"];
|
|
5390
|
+
var isYouTubeVideo = (url) => ytNames.some((host) => url.indexOf(host) >= 0);
|
|
5391
|
+
var vNames = ["vimeo.com"];
|
|
5392
|
+
var isVimeoVideo = (url) => vNames.some((host) => url.indexOf(host) >= 0);
|
|
5393
|
+
var VideoPlayer = ({ url, autoplay = false, controls = true }) => {
|
|
5394
|
+
if (!url)
|
|
5395
|
+
return null;
|
|
5396
|
+
if (isYouTubeVideo(url))
|
|
5397
|
+
return /* @__PURE__ */ import_react41.default.createElement(YoutubePlayer_default, {
|
|
5398
|
+
url,
|
|
5399
|
+
autoplay
|
|
5400
|
+
});
|
|
5401
|
+
if (isVimeoVideo(url))
|
|
5402
|
+
return /* @__PURE__ */ import_react41.default.createElement(VimeoPlayer_default, {
|
|
5403
|
+
url,
|
|
5404
|
+
autoplay
|
|
5405
|
+
});
|
|
5406
|
+
return /* @__PURE__ */ import_react41.default.createElement(CustomPlayer_default, {
|
|
5407
|
+
ratio: "56.25%",
|
|
5408
|
+
controls,
|
|
5409
|
+
url
|
|
5410
|
+
});
|
|
5411
|
+
};
|
|
5412
|
+
var EmbeddedVideoLightbox_default = VideoPlayer;
|
|
5413
|
+
|
|
5414
|
+
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5415
|
+
var import_react44 = __toESM(__require("react"));
|
|
5416
|
+
|
|
5417
|
+
// src/components/Gallery/MediaButton.tsx
|
|
5418
|
+
var import_react42 = __toESM(__require("react"));
|
|
5419
|
+
var MediaButton = ({ text, onClick }) => /* @__PURE__ */ import_react42.default.createElement(MediaButtonWrapper, null, /* @__PURE__ */ import_react42.default.createElement(ButtonSecondary, {
|
|
5420
|
+
onClick,
|
|
5421
|
+
title: text
|
|
5422
|
+
}, /* @__PURE__ */ import_react42.default.createElement(ButtonContent, null, text)));
|
|
5423
|
+
var MediaButton_default = MediaButton;
|
|
5424
|
+
|
|
5425
|
+
// src/components/ThreeSixty/Rotation.tsx
|
|
5426
|
+
var import_react43 = __toESM(__require("react"));
|
|
5427
|
+
var calculateCurrentFrame = (startFrame, delta, length) => {
|
|
5428
|
+
const frame = (startFrame + delta) % length;
|
|
5429
|
+
if (frame < 0) {
|
|
5430
|
+
return frame + length;
|
|
5431
|
+
}
|
|
5432
|
+
return frame;
|
|
5433
|
+
};
|
|
5434
|
+
var Rotation = ({ children }) => {
|
|
5435
|
+
const startFrame = (0, import_react43.useRef)(0);
|
|
5436
|
+
const pointerPosition = (0, import_react43.useRef)();
|
|
5437
|
+
const max = (0, import_react43.useRef)(0);
|
|
5438
|
+
const [state, setState] = (0, import_react43.useState)({
|
|
5439
|
+
current: 0,
|
|
5440
|
+
outsideMouseMove: false
|
|
5441
|
+
});
|
|
5442
|
+
(0, import_react43.useEffect)(() => {
|
|
5443
|
+
document.addEventListener("mouseup", touchEnd);
|
|
5444
|
+
return () => {
|
|
5445
|
+
window.document.removeEventListener("mouseup", touchEnd);
|
|
5446
|
+
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5447
|
+
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5448
|
+
};
|
|
5449
|
+
}, []);
|
|
5450
|
+
const touchMove = (event) => {
|
|
5451
|
+
const notTouched = typeof pointerPosition.current !== "number";
|
|
5452
|
+
event.preventDefault();
|
|
5453
|
+
if (notTouched) {
|
|
5454
|
+
return;
|
|
5455
|
+
}
|
|
5456
|
+
const childCount = import_react43.Children.count(children);
|
|
5457
|
+
const { offsetWidth } = event.currentTarget;
|
|
5458
|
+
const pointer = calculatePointerPosition(event);
|
|
5459
|
+
const max2 = offsetWidth;
|
|
5460
|
+
const offset = pointer - (pointerPosition.current || 0);
|
|
5461
|
+
const delta = Math.floor(offset / max2 * childCount);
|
|
5462
|
+
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5463
|
+
};
|
|
5464
|
+
const mouseMove = (event) => {
|
|
5465
|
+
const notTouched = typeof pointerPosition.current !== "number";
|
|
5466
|
+
event.preventDefault();
|
|
5467
|
+
if (notTouched || !state.outsideMouseMove)
|
|
5468
|
+
return;
|
|
5469
|
+
const childCount = import_react43.Children.count(children);
|
|
5470
|
+
const pointer = calculatePointerPosition(event);
|
|
5471
|
+
const offset = pointer - (pointerPosition.current || 0);
|
|
5472
|
+
const delta = Math.floor(offset / max.current * childCount);
|
|
5473
|
+
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5474
|
+
};
|
|
5475
|
+
const mouseUp = () => {
|
|
5476
|
+
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5477
|
+
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5478
|
+
pointerPosition.current = void 0;
|
|
5479
|
+
startFrame.current = 0;
|
|
5480
|
+
};
|
|
5481
|
+
const touchStart = (event) => {
|
|
5482
|
+
event.preventDefault();
|
|
5483
|
+
pointerPosition.current = calculatePointerPosition(event);
|
|
5484
|
+
startFrame.current = state.current;
|
|
5485
|
+
const { offsetWidth } = event.currentTarget;
|
|
5486
|
+
max.current = offsetWidth;
|
|
5487
|
+
window.document.body.addEventListener("mousemove", mouseMove);
|
|
5488
|
+
window.document.body.addEventListener("mouseup", mouseUp);
|
|
5489
|
+
};
|
|
5490
|
+
const touchEnd = (event) => {
|
|
5491
|
+
event.preventDefault();
|
|
5492
|
+
pointerPosition.current = void 0;
|
|
5493
|
+
startFrame.current = 0;
|
|
5494
|
+
};
|
|
5495
|
+
const onMouseEnter = () => {
|
|
5496
|
+
if (state.outsideMouseMove)
|
|
5497
|
+
setState({ ...state, outsideMouseMove: false });
|
|
5498
|
+
};
|
|
5499
|
+
const onMouseLeave = () => {
|
|
5500
|
+
if (!state.outsideMouseMove)
|
|
5501
|
+
setState({ ...state, outsideMouseMove: true });
|
|
5502
|
+
};
|
|
5503
|
+
const setCurrentFrame = (current) => {
|
|
5504
|
+
if (current !== state.current) {
|
|
5505
|
+
setState({ ...state, current });
|
|
5506
|
+
}
|
|
5507
|
+
};
|
|
5508
|
+
const calculatePointerPosition = (event) => {
|
|
5509
|
+
const { clientX } = event.type.indexOf("touch") === 0 ? event.changedTouches[0] : event;
|
|
5510
|
+
const { offsetLeft } = event.currentTarget;
|
|
5511
|
+
return clientX - offsetLeft;
|
|
5512
|
+
};
|
|
5513
|
+
return /* @__PURE__ */ import_react43.default.createElement("div", {
|
|
5514
|
+
onTouchStart: touchStart,
|
|
5515
|
+
onTouchMove: touchMove,
|
|
5516
|
+
onTouchEnd: touchEnd,
|
|
5517
|
+
onMouseDown: touchStart,
|
|
5518
|
+
onMouseMove: touchMove,
|
|
5519
|
+
onMouseEnter,
|
|
5520
|
+
onMouseLeave
|
|
5521
|
+
}, import_react43.Children.map(
|
|
5522
|
+
children,
|
|
5523
|
+
(child, i) => (0, import_react43.cloneElement)(child, {
|
|
5524
|
+
style: {
|
|
5525
|
+
width: "100%",
|
|
5526
|
+
display: state.current === i ? "block" : "none"
|
|
5527
|
+
}
|
|
5528
|
+
})
|
|
5529
|
+
));
|
|
5530
|
+
};
|
|
5531
|
+
var Rotation_default = Rotation;
|
|
5532
|
+
|
|
5533
|
+
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5534
|
+
var ThreeSixtyLightbox = ({ urls }) => {
|
|
5535
|
+
const [started2, setStarted] = (0, import_react44.useState)(false);
|
|
5536
|
+
const onStart = (0, import_react44.useCallback)(() => setStarted(true), []);
|
|
5537
|
+
if (!started2) {
|
|
5538
|
+
return /* @__PURE__ */ import_react44.default.createElement(Item9, null, /* @__PURE__ */ import_react44.default.createElement(Img2, {
|
|
5539
|
+
src: urls[0],
|
|
5540
|
+
alt: "alt"
|
|
5541
|
+
}), /* @__PURE__ */ import_react44.default.createElement(MediaButton_default, {
|
|
5542
|
+
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5543
|
+
onClick: onStart
|
|
5544
|
+
}));
|
|
5545
|
+
}
|
|
5546
|
+
return /* @__PURE__ */ import_react44.default.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ import_react44.default.createElement(Img2, {
|
|
5547
|
+
key: image,
|
|
5548
|
+
src: image,
|
|
5549
|
+
alt: `Bild ${i + 1}`
|
|
5550
|
+
})));
|
|
5551
|
+
};
|
|
5552
|
+
var ThreeSixtLightbox_default = ThreeSixtyLightbox;
|
|
5553
|
+
|
|
5554
|
+
// src/components/Lightbox/index.tsx
|
|
5555
|
+
var Lightbox = ({ index: index2, media, onClose }) => {
|
|
5556
|
+
const onRef = (ref) => {
|
|
5557
|
+
if (ref) {
|
|
5558
|
+
setTimeout(() => {
|
|
5559
|
+
ref.scrollIntoView();
|
|
5560
|
+
}, 300);
|
|
5561
|
+
}
|
|
5562
|
+
};
|
|
5563
|
+
const onKeyDown = (e) => {
|
|
5564
|
+
if (e.keyCode === 27) {
|
|
5565
|
+
onClose();
|
|
5566
|
+
}
|
|
5567
|
+
};
|
|
5568
|
+
return /* @__PURE__ */ import_react45.default.createElement(Wrapper18, {
|
|
5569
|
+
ref: (ref) => ref?.focus(),
|
|
5570
|
+
onKeyDown,
|
|
5571
|
+
tabIndex: 0
|
|
5572
|
+
}, /* @__PURE__ */ import_react45.default.createElement(UiBlock2, {
|
|
5573
|
+
onClick: onClose,
|
|
5574
|
+
"aria-hidden": true
|
|
5575
|
+
}), media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ import_react45.default.createElement(Item9, {
|
|
5576
|
+
key: i,
|
|
5577
|
+
ref: index2 === i ? onRef : void 0
|
|
5578
|
+
}, m.type === "image" && /* @__PURE__ */ import_react45.default.createElement(Img2, {
|
|
5579
|
+
id: `lightbox-image-${i}`,
|
|
5580
|
+
src: m.files[0].url,
|
|
5581
|
+
alt: `Bild ${i + 1}`
|
|
5582
|
+
}), m.type === "threesixty" && /* @__PURE__ */ import_react45.default.createElement(ThreeSixtLightbox_default, {
|
|
5583
|
+
urls: m.files.map((x) => x.url)
|
|
5584
|
+
}), m.type === "embedded" && /* @__PURE__ */ import_react45.default.createElement(EmbeddedVideoLightbox_default, {
|
|
5585
|
+
url: m.files[0].url
|
|
5586
|
+
}))), /* @__PURE__ */ import_react45.default.createElement(CloseBtn2, {
|
|
5587
|
+
onClick: onClose,
|
|
5588
|
+
title: "St\xE4ng"
|
|
5589
|
+
}, /* @__PURE__ */ import_react45.default.createElement(IconCancel, {
|
|
5590
|
+
block: true
|
|
5591
|
+
})));
|
|
5592
|
+
};
|
|
5593
|
+
var Lightbox_default = Lightbox;
|
|
5594
|
+
|
|
5595
|
+
// src/components/Video/EmbededVideo.tsx
|
|
5596
|
+
var import_react49 = __toESM(__require("react"));
|
|
5597
|
+
|
|
5598
|
+
// src/components/Video/useThumbnail.ts
|
|
5599
|
+
var import_react48 = __require("react");
|
|
5600
|
+
|
|
5601
|
+
// src/hooks/useVimeoThumbnail.ts
|
|
5602
|
+
var import_react47 = __require("react");
|
|
5603
|
+
|
|
5604
|
+
// src/hooks/useFetch.ts
|
|
5605
|
+
var import_react46 = __require("react");
|
|
5606
|
+
var cache = {};
|
|
5607
|
+
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
5608
|
+
var setCachedResult = (key, value) => {
|
|
5609
|
+
cache[key] = value;
|
|
5610
|
+
};
|
|
5611
|
+
var pendingPromise = {};
|
|
5612
|
+
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
5613
|
+
var setPendingPromise = (url, promise) => {
|
|
5614
|
+
pendingPromise = {
|
|
5615
|
+
...pendingPromise,
|
|
5616
|
+
[url]: promise
|
|
5617
|
+
};
|
|
5618
|
+
};
|
|
5619
|
+
var clearPendingPromise = (url) => {
|
|
5620
|
+
delete pendingPromise[url];
|
|
5621
|
+
};
|
|
5622
|
+
var useFetch = (path, options, skip, promiseCache) => {
|
|
5623
|
+
const [data, setData] = (0, import_react46.useState)();
|
|
5624
|
+
const [loading, setLoading] = (0, import_react46.useState)(false);
|
|
5625
|
+
const [error, setError] = (0, import_react46.useState)(false);
|
|
5626
|
+
const doFetch = (0, import_react46.useCallback)(async () => {
|
|
5627
|
+
const key = path.toString();
|
|
5628
|
+
const cached = getCachedResult(key);
|
|
5629
|
+
setError(false);
|
|
5630
|
+
if (cached) {
|
|
5631
|
+
setData(cached);
|
|
5632
|
+
return;
|
|
5633
|
+
}
|
|
5634
|
+
setLoading(true);
|
|
5635
|
+
try {
|
|
5636
|
+
const reusePromise = promiseCache && isPendingPromise(key);
|
|
5637
|
+
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
5638
|
+
if (promiseCache) {
|
|
5639
|
+
setPendingPromise(key, request);
|
|
5640
|
+
}
|
|
5641
|
+
const result = await request;
|
|
5642
|
+
if (result.ok) {
|
|
5643
|
+
const json2 = await result.clone().json();
|
|
5644
|
+
setCachedResult(key, json2);
|
|
5645
|
+
setData(json2);
|
|
5646
|
+
}
|
|
5647
|
+
} catch (e) {
|
|
5648
|
+
setError(true);
|
|
5649
|
+
} finally {
|
|
5650
|
+
setLoading(false);
|
|
5651
|
+
clearPendingPromise(key);
|
|
5652
|
+
}
|
|
5653
|
+
return;
|
|
5654
|
+
}, [path, options]);
|
|
5655
|
+
(0, import_react46.useEffect)(() => {
|
|
5656
|
+
if (!skip) {
|
|
5657
|
+
doFetch();
|
|
5658
|
+
}
|
|
5659
|
+
}, [path, skip]);
|
|
5660
|
+
return {
|
|
5661
|
+
loading,
|
|
5662
|
+
data,
|
|
5663
|
+
error
|
|
5664
|
+
};
|
|
5665
|
+
};
|
|
5666
|
+
var useFetch_default = useFetch;
|
|
5667
|
+
|
|
5668
|
+
// src/hooks/useVimeoThumbnail.ts
|
|
5669
|
+
var useVimeoThumbnail = (id, small) => {
|
|
5670
|
+
const [thumbnail, setThumbnail] = (0, import_react47.useState)();
|
|
5671
|
+
const { data } = useFetch_default(
|
|
5672
|
+
`http://vimeo.com/api/v2/video/${id}.json`,
|
|
5673
|
+
{},
|
|
5674
|
+
!id || !!thumbnail,
|
|
5675
|
+
true
|
|
5676
|
+
);
|
|
5677
|
+
(0, import_react47.useEffect)(() => {
|
|
5678
|
+
if (data?.[0]) {
|
|
5679
|
+
if (small && data[0].thumbnail_small) {
|
|
5680
|
+
setThumbnail(data[0].thumbnail_small);
|
|
5681
|
+
} else if (data[0].thumbnail_large) {
|
|
5682
|
+
setThumbnail(data[0].thumbnail_large);
|
|
5683
|
+
}
|
|
5684
|
+
}
|
|
5685
|
+
}, [data]);
|
|
5686
|
+
return thumbnail;
|
|
5687
|
+
};
|
|
5688
|
+
var useVimeoThumbnail_default = useVimeoThumbnail;
|
|
5689
|
+
|
|
5690
|
+
// src/components/Video/useThumbnail.ts
|
|
5691
|
+
var useThumbnail = (url, small) => {
|
|
5692
|
+
if (url?.toLowerCase().endsWith(".mp4"))
|
|
5693
|
+
return;
|
|
5694
|
+
const [thumbnail, setThumbnail] = (0, import_react48.useState)();
|
|
5695
|
+
const vimeoId = url ? getVimeoId(url) : void 0;
|
|
5696
|
+
const vimeoThumbnail = useVimeoThumbnail_default(vimeoId, small);
|
|
5697
|
+
(0, import_react48.useEffect)(() => {
|
|
5698
|
+
if (url) {
|
|
5699
|
+
const youtubeThumbnail = getYoutubeThumbnail(url);
|
|
5700
|
+
if (youtubeThumbnail) {
|
|
5701
|
+
if (small) {
|
|
5702
|
+
setThumbnail([youtubeThumbnail.mqdefault]);
|
|
5703
|
+
} else {
|
|
5704
|
+
setThumbnail([youtubeThumbnail.maxresdefault, youtubeThumbnail.hqdefault]);
|
|
5705
|
+
}
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
}, [url]);
|
|
5709
|
+
return vimeoThumbnail ? [vimeoThumbnail] : thumbnail;
|
|
5710
|
+
};
|
|
5711
|
+
var useThumbnail_default = useThumbnail;
|
|
5712
|
+
|
|
5713
|
+
// src/components/Modal/index.tsx
|
|
5714
|
+
var React46 = __toESM(__require("react"));
|
|
5715
|
+
|
|
5716
|
+
// src/components/Modal/wrapper.tsx
|
|
5717
|
+
var import_styled_components38 = __toESM(__require("styled-components"));
|
|
5718
|
+
var Wrapper20 = import_styled_components38.default.div.attrs(() => ({
|
|
5719
|
+
role: "dialog"
|
|
5720
|
+
}))`
|
|
5721
|
+
position: fixed;
|
|
5722
|
+
top: 0;
|
|
5723
|
+
bottom: 0;
|
|
5724
|
+
left: 0;
|
|
5725
|
+
right: 0;
|
|
5726
|
+
width: 100%;
|
|
5727
|
+
white-space: normal;
|
|
5728
|
+
text-align: left;
|
|
5729
|
+
z-index: 90;
|
|
5730
|
+
display: flex;
|
|
5731
|
+
align-items: center;
|
|
5732
|
+
justify-content: center;
|
|
5733
|
+
|
|
5734
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5735
|
+
padding: ${size(2)};
|
|
5736
|
+
}
|
|
5737
|
+
`;
|
|
5738
|
+
var UiBlock3 = import_styled_components38.default.div.attrs(() => ({
|
|
5739
|
+
"aria-hidden": "true",
|
|
5740
|
+
role: "button"
|
|
5741
|
+
}))`
|
|
5742
|
+
position: fixed;
|
|
5743
|
+
top: 0;
|
|
5744
|
+
bottom: 0;
|
|
5745
|
+
left: 0;
|
|
5746
|
+
right: 0;
|
|
5747
|
+
background-color: rgba(0, 0, 0, 0.35);
|
|
5748
|
+
z-index: -1;
|
|
5749
|
+
|
|
5750
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
5751
|
+
animation: ${fadeIn} 300ms ease forwards;
|
|
5752
|
+
}
|
|
5753
|
+
|
|
5754
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
5755
|
+
animation: ${fadeIn} 400ms ease forwards;
|
|
5756
|
+
}
|
|
5757
|
+
`;
|
|
5758
|
+
var Dialog = import_styled_components38.default.article.attrs(() => ({
|
|
5759
|
+
className: "wayke__theme wayke__font--regular"
|
|
5760
|
+
}))`
|
|
5761
|
+
display: flex;
|
|
5762
|
+
flex-direction: column;
|
|
5763
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
5764
|
+
z-index: 1;
|
|
5765
|
+
width: 100%;
|
|
5766
|
+
max-width: 680px;
|
|
5767
|
+
max-height: 100%;
|
|
5768
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
5769
|
+
overflow: hidden;
|
|
5770
|
+
|
|
5771
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5772
|
+
align-self: flex-end;
|
|
5773
|
+
transform: translateY(100%);
|
|
5774
|
+
animation: ${noTransform} 300ms ease forwards;
|
|
5775
|
+
}
|
|
5776
|
+
|
|
5777
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5778
|
+
transform: translateY(${size(2)});
|
|
5779
|
+
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
5780
|
+
}
|
|
5781
|
+
`;
|
|
5782
|
+
var Content4 = import_styled_components38.default.div`
|
|
5783
|
+
flex: 1 1 auto;
|
|
5784
|
+
overflow: auto;
|
|
5785
|
+
-webkit-overflow-scrolling: touch;
|
|
5786
|
+
`;
|
|
5787
|
+
var Header4 = import_styled_components38.default.header`
|
|
5788
|
+
display: flex;
|
|
5789
|
+
align-items: center;
|
|
5790
|
+
min-height: 60px;
|
|
5791
|
+
padding: ${size(3)};
|
|
5792
|
+
padding-bottom: 0;
|
|
5793
|
+
`;
|
|
5794
|
+
var Heading5 = import_styled_components38.default.div`
|
|
5795
|
+
flex: 1 1 auto;
|
|
5796
|
+
|
|
5797
|
+
${H1} {
|
|
5798
|
+
font-size: 1.5rem;
|
|
5799
|
+
}
|
|
5800
|
+
`;
|
|
5801
|
+
var Close2 = import_styled_components38.default.div`
|
|
5802
|
+
flex-shrink: 0;
|
|
5803
|
+
margin: ${size(-2)};
|
|
5804
|
+
padding-left: ${size(3)};
|
|
5805
|
+
`;
|
|
5806
|
+
var CloseBtn3 = (0, import_styled_components38.default)(ButtonReset)`
|
|
5807
|
+
display: block;
|
|
5808
|
+
padding: ${size(2)};
|
|
5809
|
+
`;
|
|
5810
|
+
var Body4 = import_styled_components38.default.div`
|
|
5811
|
+
padding: ${size(3)};
|
|
5812
|
+
`;
|
|
5813
|
+
var Image3 = import_styled_components38.default.img`
|
|
5814
|
+
display: block;
|
|
5815
|
+
width: calc(100% + ${size(6)});
|
|
5816
|
+
margin-left: ${size(-3)};
|
|
5817
|
+
margin-bottom: ${size(3)};
|
|
5818
|
+
`;
|
|
5819
|
+
var ModalFoldout = import_styled_components38.default.div`
|
|
5820
|
+
background-color: ${(props) => props.theme.color.accent};
|
|
5821
|
+
margin: ${size(-3)};
|
|
5822
|
+
margin-top: ${size(3)};
|
|
5823
|
+
padding: ${size(3)};
|
|
5824
|
+
`;
|
|
5825
|
+
var ModalFoldoutBody = import_styled_components38.default.div``;
|
|
5826
|
+
|
|
5827
|
+
// src/components/Modal/index.tsx
|
|
5828
|
+
var Modal = ({ id, title, onClose, children }) => {
|
|
5829
|
+
return /* @__PURE__ */ React46.createElement(portal_default, {
|
|
5830
|
+
id: id || portal_namespace_exports.DefaultPortal
|
|
5831
|
+
}, /* @__PURE__ */ React46.createElement(Wrapper20, {
|
|
5832
|
+
onClick: (e) => e.stopPropagation()
|
|
5833
|
+
}, /* @__PURE__ */ React46.createElement(UiBlock3, {
|
|
5834
|
+
onClick: onClose,
|
|
5835
|
+
title: "St\xE4ng modal"
|
|
5836
|
+
}), /* @__PURE__ */ React46.createElement(Dialog, null, /* @__PURE__ */ React46.createElement(Content4, null, /* @__PURE__ */ React46.createElement(Header4, null, /* @__PURE__ */ React46.createElement(Heading5, null, /* @__PURE__ */ React46.createElement(H1, {
|
|
5837
|
+
noMargin: true
|
|
5838
|
+
}, title)), /* @__PURE__ */ React46.createElement(Close2, null, /* @__PURE__ */ React46.createElement(CloseBtn3, {
|
|
5839
|
+
onClick: onClose,
|
|
5840
|
+
title: "St\xE4ng modal"
|
|
5841
|
+
}, /* @__PURE__ */ React46.createElement(IconCancel, {
|
|
5842
|
+
block: true
|
|
5843
|
+
})))), /* @__PURE__ */ React46.createElement(Body4, null, children)))));
|
|
5844
|
+
};
|
|
5845
|
+
var Modal_default = Modal;
|
|
5846
|
+
|
|
5847
|
+
// src/components/Video/EmbededVideo.tsx
|
|
5848
|
+
var GalleryEmbed = ({ src, index: index2 }) => {
|
|
5849
|
+
const [modal, setModal] = (0, import_react49.useState)();
|
|
5850
|
+
const thumbnail = useThumbnail_default(src);
|
|
5851
|
+
const onClick = (e) => {
|
|
5852
|
+
e.stopPropagation();
|
|
5853
|
+
setModal(src);
|
|
5854
|
+
};
|
|
5855
|
+
const onCloseModal = (e) => {
|
|
5856
|
+
e.stopPropagation();
|
|
5857
|
+
setModal(void 0);
|
|
5858
|
+
};
|
|
5859
|
+
const onError = (0, import_react49.useCallback)(
|
|
5860
|
+
(e) => onImageError(e, thumbnail),
|
|
5861
|
+
[thumbnail]
|
|
5862
|
+
);
|
|
5863
|
+
const onLoad = (0, import_react49.useCallback)(
|
|
5864
|
+
(e) => onImageLoad(e, thumbnail),
|
|
5865
|
+
[thumbnail]
|
|
5866
|
+
);
|
|
5867
|
+
const customVideo = src.toLowerCase().endsWith(".mp4");
|
|
5868
|
+
if (thumbnail?.length && !customVideo) {
|
|
5869
|
+
return /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(ImageFull, {
|
|
5870
|
+
onLoad,
|
|
5871
|
+
src: thumbnail[0],
|
|
5872
|
+
onError,
|
|
5873
|
+
alt: `Bild ${index2 + 1}`
|
|
5874
|
+
}), /* @__PURE__ */ import_react49.default.createElement(MediaButton_default, {
|
|
5875
|
+
text: "Spela video",
|
|
5876
|
+
onClick
|
|
5877
|
+
}), modal && /* @__PURE__ */ import_react49.default.createElement(Modal_default, {
|
|
5878
|
+
title: "Video",
|
|
5879
|
+
onClose: onCloseModal
|
|
5880
|
+
}, /* @__PURE__ */ import_react49.default.createElement(EmbeddedVideoLightbox_default, {
|
|
5881
|
+
url: modal
|
|
5882
|
+
})));
|
|
5883
|
+
}
|
|
5884
|
+
if (customVideo)
|
|
5885
|
+
return /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(CustomPlayer_default, {
|
|
5886
|
+
ratio: "66.66%",
|
|
5887
|
+
isPreview: true,
|
|
5888
|
+
controls: false,
|
|
5889
|
+
url: src
|
|
5890
|
+
}), /* @__PURE__ */ import_react49.default.createElement(MediaButton_default, {
|
|
5891
|
+
text: "Spela video",
|
|
5892
|
+
onClick
|
|
5893
|
+
}), modal && /* @__PURE__ */ import_react49.default.createElement(Modal_default, {
|
|
5894
|
+
title: "Video",
|
|
5895
|
+
onClose: onCloseModal
|
|
5896
|
+
}, /* @__PURE__ */ import_react49.default.createElement(EmbeddedVideoLightbox_default, {
|
|
5897
|
+
url: modal
|
|
5898
|
+
})));
|
|
5899
|
+
return null;
|
|
5900
|
+
};
|
|
5901
|
+
var EmbededVideo_default = GalleryEmbed;
|
|
5902
|
+
|
|
5903
|
+
// src/components/Video/QuickNavEmbeded.tsx
|
|
5904
|
+
var import_react50 = __toESM(__require("react"));
|
|
5905
|
+
var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
5906
|
+
const thumbnail = useThumbnail_default(src);
|
|
5907
|
+
const onError = (0, import_react50.useCallback)(
|
|
5908
|
+
(e) => onImageError(e, thumbnail),
|
|
5909
|
+
[thumbnail]
|
|
5910
|
+
);
|
|
5911
|
+
const onLoad = (0, import_react50.useCallback)(
|
|
5912
|
+
(e) => onImageLoad(e, thumbnail),
|
|
5913
|
+
[thumbnail]
|
|
5914
|
+
);
|
|
5915
|
+
const customVideo = src?.toLowerCase().endsWith(".mp4");
|
|
5916
|
+
if (thumbnail?.length && !customVideo)
|
|
5917
|
+
return /* @__PURE__ */ import_react50.default.createElement(QuickNavImg, {
|
|
5918
|
+
onLoad,
|
|
5919
|
+
src: thumbnail[0],
|
|
5920
|
+
onError,
|
|
5921
|
+
alt: `Bild ${index2 + 1}`
|
|
5922
|
+
});
|
|
5923
|
+
if (customVideo)
|
|
5924
|
+
return /* @__PURE__ */ import_react50.default.createElement(CustomPlayer_default, {
|
|
5925
|
+
key: index2,
|
|
5926
|
+
url: src,
|
|
5927
|
+
ratio: "66.66%"
|
|
5928
|
+
});
|
|
5929
|
+
return null;
|
|
5930
|
+
};
|
|
5931
|
+
var QuickNavEmbeded_default = QuickNavEmbeded;
|
|
5932
|
+
|
|
5933
|
+
// src/components/ThreeSixty/ThreeSixty.tsx
|
|
5934
|
+
var import_react51 = __toESM(__require("react"));
|
|
5935
|
+
var onMediaClick = (e, func) => {
|
|
5936
|
+
e.stopPropagation();
|
|
5937
|
+
e.preventDefault();
|
|
5938
|
+
func();
|
|
5939
|
+
};
|
|
5940
|
+
var ThreeSixty = ({ urls, visible, onDisableNavigation, navigationDisabled }) => {
|
|
5941
|
+
if (!visible || !navigationDisabled && visible) {
|
|
5942
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_react51.default.Fragment, null, /* @__PURE__ */ import_react51.default.createElement(Image2, {
|
|
5943
|
+
src: urls[0],
|
|
5944
|
+
alt: "alt"
|
|
5945
|
+
}), /* @__PURE__ */ import_react51.default.createElement(MediaButton_default, {
|
|
5946
|
+
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5947
|
+
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
5948
|
+
}));
|
|
5949
|
+
}
|
|
5950
|
+
if (navigationDisabled && visible) {
|
|
5951
|
+
return /* @__PURE__ */ import_react51.default.createElement("div", {
|
|
5952
|
+
onClick: (e) => {
|
|
5953
|
+
e.stopPropagation();
|
|
5954
|
+
e.preventDefault();
|
|
5955
|
+
}
|
|
5956
|
+
}, /* @__PURE__ */ import_react51.default.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ import_react51.default.createElement(Image2, {
|
|
5957
|
+
key: image,
|
|
5958
|
+
src: image,
|
|
5959
|
+
alt: `Bild ${i + 1}`
|
|
5960
|
+
}))));
|
|
5961
|
+
}
|
|
5962
|
+
return null;
|
|
5963
|
+
};
|
|
5964
|
+
var ThreeSixty_default = ThreeSixty;
|
|
5965
|
+
|
|
5966
|
+
// src/components/Gallery/index.tsx
|
|
5967
|
+
var sliderSettings = {
|
|
5968
|
+
dots: false,
|
|
5969
|
+
arrows: false,
|
|
5970
|
+
infinite: true,
|
|
5971
|
+
speed: 300,
|
|
5972
|
+
slidesToShow: 1,
|
|
5973
|
+
slidesToScroll: 1
|
|
5974
|
+
};
|
|
5975
|
+
var Gallery = ({ media, placeholderImage }) => {
|
|
5976
|
+
const slider = (0, import_react52.useRef)(null);
|
|
5977
|
+
const quickNavRef = (0, import_react52.useRef)(null);
|
|
5978
|
+
const isDragging = (0, import_react52.useRef)(false);
|
|
5979
|
+
const [index2, setIndex] = (0, import_react52.useState)(0);
|
|
5980
|
+
const [lightbox, setLightbox] = (0, import_react52.useState)(false);
|
|
5981
|
+
const [navigationDisabled, setNavigationDisabled] = (0, import_react52.useState)(false);
|
|
5982
|
+
const beforeChange = (0, import_react52.useCallback)((_, newIndex) => {
|
|
5983
|
+
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
5984
|
+
if (element) {
|
|
5985
|
+
(0, import_scroll_into_view_if_needed.default)(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
5986
|
+
}
|
|
5987
|
+
setIndex(newIndex);
|
|
5988
|
+
}, []);
|
|
5989
|
+
const onMouseDown = (0, import_react52.useCallback)(() => {
|
|
5990
|
+
if (isDragging.current) {
|
|
5991
|
+
isDragging.current = false;
|
|
5992
|
+
}
|
|
5993
|
+
}, []);
|
|
5994
|
+
const onMouseMove = (0, import_react52.useCallback)(() => {
|
|
5995
|
+
if (!isDragging.current) {
|
|
5996
|
+
isDragging.current = true;
|
|
5997
|
+
}
|
|
5998
|
+
}, []);
|
|
5999
|
+
const onClick = (0, import_react52.useCallback)(() => {
|
|
6000
|
+
pubsub_default.publish("ImagesClick");
|
|
6001
|
+
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
6002
|
+
setLightbox(true);
|
|
6003
|
+
}
|
|
6004
|
+
}, [lightbox, media]);
|
|
6005
|
+
const nextImage = (0, import_react52.useCallback)(() => {
|
|
6006
|
+
if (!slider || !slider.current) {
|
|
6007
|
+
return;
|
|
6008
|
+
}
|
|
6009
|
+
slider.current.slickNext();
|
|
6010
|
+
}, [slider]);
|
|
6011
|
+
const prevImage = (0, import_react52.useCallback)(() => {
|
|
6012
|
+
if (!slider || !slider.current) {
|
|
6013
|
+
return;
|
|
6014
|
+
}
|
|
6015
|
+
slider.current.slickPrev();
|
|
6016
|
+
}, [slider]);
|
|
6017
|
+
const goTo = (target) => {
|
|
6018
|
+
if (!slider || !slider.current) {
|
|
6019
|
+
return;
|
|
6020
|
+
}
|
|
6021
|
+
if (slider.current) {
|
|
6022
|
+
setIndex(target);
|
|
6023
|
+
slider.current.slickGoTo(target);
|
|
6024
|
+
}
|
|
6025
|
+
};
|
|
6026
|
+
const onDisableNavigation = () => {
|
|
6027
|
+
if (!isDragging.current)
|
|
6028
|
+
setNavigationDisabled(true);
|
|
6029
|
+
};
|
|
6030
|
+
const onEnableNavigation = (e) => {
|
|
6031
|
+
e.stopPropagation();
|
|
6032
|
+
isDragging.current = false;
|
|
6033
|
+
setNavigationDisabled(false);
|
|
6034
|
+
};
|
|
6035
|
+
const onToggleLightbox = (0, import_react52.useCallback)(() => setLightbox(!lightbox), [lightbox]);
|
|
6036
|
+
const mediaLength = media?.length || 0;
|
|
6037
|
+
const placeholder = (0, import_react52.useMemo)(
|
|
6038
|
+
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
6039
|
+
[placeholderImage]
|
|
6040
|
+
);
|
|
6041
|
+
return /* @__PURE__ */ import_react52.default.createElement(import_react52.default.Fragment, null, /* @__PURE__ */ import_react52.default.createElement(Wrapper17, null, /* @__PURE__ */ import_react52.default.createElement(Main, null, /* @__PURE__ */ import_react52.default.createElement(SliderWrapper, {
|
|
6042
|
+
onMouseDown,
|
|
6043
|
+
onMouseMove,
|
|
6044
|
+
onClick
|
|
6045
|
+
}, /* @__PURE__ */ import_react52.default.createElement(import_react_slick.default, {
|
|
6046
|
+
...sliderSettings,
|
|
6047
|
+
swipe: !navigationDisabled,
|
|
6048
|
+
touchMove: !navigationDisabled,
|
|
6049
|
+
swipeToSlide: !navigationDisabled,
|
|
6050
|
+
ref: slider,
|
|
6051
|
+
beforeChange
|
|
6052
|
+
}, !!media?.length ? media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ import_react52.default.createElement(Item8, {
|
|
6053
|
+
key: m.files[0].url || i
|
|
6054
|
+
}, m.type === "image" && /* @__PURE__ */ import_react52.default.createElement(Image2, {
|
|
6055
|
+
src: m.files[0].formats.filter(notEmpty).find((x) => x.format === "1170x")?.url,
|
|
6056
|
+
alt: `Bild ${i + 1}`
|
|
6057
|
+
}), m.type === "threesixty" && /* @__PURE__ */ import_react52.default.createElement(ThreeSixty_default, {
|
|
6058
|
+
urls: m.files.map((x) => x.url),
|
|
6059
|
+
visible: i === index2,
|
|
6060
|
+
onDisableNavigation,
|
|
6061
|
+
navigationDisabled
|
|
6062
|
+
}), m.type === "embedded" && /* @__PURE__ */ import_react52.default.createElement(EmbededVideo_default, {
|
|
6063
|
+
src: m.files[0].url,
|
|
6064
|
+
index: i + 1
|
|
6065
|
+
}))) : /* @__PURE__ */ import_react52.default.createElement(Item8, {
|
|
6066
|
+
key: placeholder
|
|
6067
|
+
}, /* @__PURE__ */ import_react52.default.createElement(Image2, {
|
|
6068
|
+
src: placeholder,
|
|
6069
|
+
alt: `Bild 1`
|
|
6070
|
+
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */ import_react52.default.createElement(EnableNavigationButton, null, /* @__PURE__ */ import_react52.default.createElement(ButtonSecondary, {
|
|
6071
|
+
onClick: onEnableNavigation,
|
|
6072
|
+
title: "St\xE4ng"
|
|
6073
|
+
}, /* @__PURE__ */ import_react52.default.createElement(ButtonContent, null, "St\xE4ng")))), !navigationDisabled && mediaLength > 1 && /* @__PURE__ */ import_react52.default.createElement(import_react52.default.Fragment, null, /* @__PURE__ */ import_react52.default.createElement(ArrowLeft, {
|
|
6074
|
+
onClick: prevImage,
|
|
6075
|
+
title: "F\xF6reg\xE5ende bild"
|
|
6076
|
+
}, /* @__PURE__ */ import_react52.default.createElement(IconChevronLeft, {
|
|
6077
|
+
block: true
|
|
6078
|
+
})), /* @__PURE__ */ import_react52.default.createElement(ArrowRight, {
|
|
6079
|
+
onClick: nextImage,
|
|
6080
|
+
title: "N\xE4sta bild"
|
|
6081
|
+
}, /* @__PURE__ */ import_react52.default.createElement(IconChevronRight, {
|
|
6082
|
+
block: true
|
|
6083
|
+
})))), /* @__PURE__ */ import_react52.default.createElement(Alt, null, /* @__PURE__ */ import_react52.default.createElement(QuickNav, {
|
|
6084
|
+
ref: quickNavRef
|
|
6085
|
+
}, !!media?.length ? media.map((m, i) => {
|
|
6086
|
+
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === "225x150")?.url || m.files[0].url;
|
|
6087
|
+
return /* @__PURE__ */ import_react52.default.createElement(QuickNavItem, {
|
|
6088
|
+
key: src || i,
|
|
6089
|
+
active: index2 === i
|
|
6090
|
+
}, /* @__PURE__ */ import_react52.default.createElement(QuickNavBtn, {
|
|
6091
|
+
onClick: () => goTo(i),
|
|
6092
|
+
title: `G\xE5 till bild ${i + 1}`
|
|
6093
|
+
}, m.type === "image" && /* @__PURE__ */ import_react52.default.createElement(QuickNavImg, {
|
|
6094
|
+
src,
|
|
6095
|
+
alt: `Bild ${i + 1}`
|
|
6096
|
+
}), m.type === "threesixty" && /* @__PURE__ */ import_react52.default.createElement(QuickNavImg, {
|
|
6097
|
+
src,
|
|
6098
|
+
alt: `Bild ${i + 1}`
|
|
6099
|
+
}), m.type === "embedded" && /* @__PURE__ */ import_react52.default.createElement(QuickNavEmbeded_default, {
|
|
6100
|
+
src,
|
|
6101
|
+
index: i
|
|
6102
|
+
}), m.type === "sphere" && /* @__PURE__ */ import_react52.default.createElement(QuickNavImg, {
|
|
6103
|
+
src: m.files[0].url,
|
|
6104
|
+
alt: `Bild ${i + 1}`
|
|
6105
|
+
})));
|
|
6106
|
+
}) : /* @__PURE__ */ import_react52.default.createElement(QuickNavItem, {
|
|
6107
|
+
key: placeholder,
|
|
6108
|
+
active: true
|
|
6109
|
+
}, /* @__PURE__ */ import_react52.default.createElement(QuickNavBtn, {
|
|
6110
|
+
onClick: () => goTo(0),
|
|
6111
|
+
title: `G\xE5 till bild 0`
|
|
6112
|
+
}, /* @__PURE__ */ import_react52.default.createElement(QuickNavImg, {
|
|
6113
|
+
src: placeholder,
|
|
6114
|
+
alt: `Bild 1`
|
|
6115
|
+
})))))), lightbox && !!media?.length && /* @__PURE__ */ import_react52.default.createElement(Lightbox_default, {
|
|
6116
|
+
media,
|
|
6117
|
+
index: index2,
|
|
6118
|
+
onClose: onToggleLightbox
|
|
6119
|
+
}));
|
|
6120
|
+
};
|
|
6121
|
+
var Gallery_default = Gallery;
|
|
6122
|
+
|
|
6123
|
+
// src/components/ProductPage/index.tsx
|
|
6124
|
+
var import_styled_components39 = __toESM(__require("styled-components"));
|
|
6125
|
+
var ProductPage = import_styled_components39.default.div`
|
|
6126
|
+
display: flex;
|
|
6127
|
+
flex-direction: column;
|
|
6128
|
+
|
|
6129
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6130
|
+
flex-direction: row;
|
|
6131
|
+
}
|
|
6132
|
+
`;
|
|
6133
|
+
var ProductPageAside = import_styled_components39.default.div`
|
|
6134
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6135
|
+
display: contents;
|
|
6136
|
+
}
|
|
6137
|
+
|
|
6138
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6139
|
+
flex-shrink: 0;
|
|
6140
|
+
width: calc(375px + ${size(2)});
|
|
6141
|
+
padding-right: ${size(2)};
|
|
6142
|
+
}
|
|
6143
|
+
`;
|
|
6144
|
+
var ProductPageMain = import_styled_components39.default.div`
|
|
6145
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6146
|
+
display: contents;
|
|
6147
|
+
}
|
|
6148
|
+
|
|
6149
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6150
|
+
flex: 1 1 100%;
|
|
6151
|
+
min-width: 0;
|
|
6152
|
+
padding-left: ${size(2)};
|
|
6153
|
+
}
|
|
6154
|
+
`;
|
|
6155
|
+
var ProductPageAsideSection = import_styled_components39.default.div`
|
|
6156
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6157
|
+
order: ${(props) => props.mobileOrder};
|
|
6158
|
+
|
|
6159
|
+
& + & {
|
|
6160
|
+
margin-top: ${size(2)};
|
|
6161
|
+
}
|
|
6162
|
+
|
|
6163
|
+
:last-child {
|
|
6164
|
+
margin-bottom: ${size(4)};
|
|
6165
|
+
}
|
|
6166
|
+
|
|
6167
|
+
${ProductPageMain} & {
|
|
6168
|
+
margin-top: ${size(2)};
|
|
6169
|
+
}
|
|
6170
|
+
}
|
|
6171
|
+
|
|
6172
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6173
|
+
& + & {
|
|
6174
|
+
margin-top: ${size(4)};
|
|
6175
|
+
}
|
|
6176
|
+
|
|
6177
|
+
${ProductPageMain} & {
|
|
6178
|
+
margin-bottom: ${size(8)};
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
`;
|
|
6182
|
+
var ProductPageMainSection = import_styled_components39.default.div`
|
|
6183
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6184
|
+
order: 99;
|
|
6185
|
+
padding: ${size(4)} 0;
|
|
6186
|
+
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
6187
|
+
|
|
6188
|
+
${Wrapper} & {
|
|
6189
|
+
margin-left: ${size(-2)};
|
|
6190
|
+
margin-right: ${size(-2)};
|
|
6191
|
+
padding-left: ${size(2)};
|
|
6192
|
+
padding-right: ${size(2)};
|
|
6193
|
+
}
|
|
6194
|
+
}
|
|
6195
|
+
|
|
6196
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6197
|
+
& + & {
|
|
6198
|
+
margin-top: ${size(8)};
|
|
6199
|
+
padding-top: ${size(8)};
|
|
6200
|
+
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
6201
|
+
}
|
|
6202
|
+
}
|
|
6203
|
+
`;
|
|
6204
|
+
var ProductPageContentLimit = import_styled_components39.default.div`
|
|
6205
|
+
max-width: 420px;
|
|
6206
|
+
`;
|
|
6207
|
+
|
|
6208
|
+
// src/hooks/useSearchItem.ts
|
|
6209
|
+
var import_client2 = __require("@apollo/client");
|
|
6210
|
+
|
|
6211
|
+
// src/queries/SEARCH_ITEM_QUERY.ts
|
|
6212
|
+
var import_client = __require("@apollo/client");
|
|
6213
|
+
var FinancialOptionDetail = import_client.gql`
|
|
6214
|
+
fragment FinancialOptionDetail on FinancialOptionDetail {
|
|
6215
|
+
current
|
|
6216
|
+
default
|
|
6217
|
+
max
|
|
6218
|
+
min
|
|
6219
|
+
step
|
|
6220
|
+
}
|
|
6221
|
+
`;
|
|
6222
|
+
var HoursOpen = import_client.gql`
|
|
6223
|
+
fragment HoursOpen on HoursOpen {
|
|
6224
|
+
from
|
|
6225
|
+
until
|
|
6226
|
+
}
|
|
6227
|
+
`;
|
|
6228
|
+
var SEARCH_ITEM_QUERY = import_client.gql`
|
|
6229
|
+
query SearchItem($id: ID!) {
|
|
6230
|
+
vehicle(id: $id) {
|
|
6231
|
+
id
|
|
6232
|
+
documents
|
|
6233
|
+
contact {
|
|
6234
|
+
name
|
|
6235
|
+
email
|
|
6236
|
+
phonenumber
|
|
6237
|
+
avatar
|
|
6238
|
+
}
|
|
6239
|
+
manufacturer {
|
|
6240
|
+
description
|
|
6241
|
+
logotype
|
|
6242
|
+
name
|
|
6243
|
+
packageOption {
|
|
6244
|
+
description
|
|
6245
|
+
image
|
|
6246
|
+
link {
|
|
6247
|
+
title
|
|
6248
|
+
url
|
|
6249
|
+
}
|
|
6250
|
+
title
|
|
6251
|
+
}
|
|
6252
|
+
}
|
|
6253
|
+
packageOptions {
|
|
6254
|
+
description
|
|
6255
|
+
image
|
|
6256
|
+
link {
|
|
6257
|
+
title
|
|
6258
|
+
url
|
|
6259
|
+
}
|
|
6260
|
+
title
|
|
6261
|
+
}
|
|
6262
|
+
publishedAt
|
|
6263
|
+
branch {
|
|
6264
|
+
connections {
|
|
5037
6265
|
id
|
|
5038
6266
|
name
|
|
5039
6267
|
location {
|
|
@@ -5170,204 +6398,70 @@
|
|
|
5170
6398
|
interest
|
|
5171
6399
|
link {
|
|
5172
6400
|
title
|
|
5173
|
-
url
|
|
5174
|
-
}
|
|
5175
|
-
loanAmount
|
|
5176
|
-
logotype
|
|
5177
|
-
mileage {
|
|
5178
|
-
...FinancialOptionDetail
|
|
5179
|
-
}
|
|
5180
|
-
monthlyCost
|
|
5181
|
-
name
|
|
5182
|
-
residual {
|
|
5183
|
-
...FinancialOptionDetail
|
|
5184
|
-
}
|
|
5185
|
-
setupFee
|
|
5186
|
-
terms
|
|
5187
|
-
totalCreditCost
|
|
5188
|
-
totalResidualValue
|
|
5189
|
-
type
|
|
5190
|
-
url
|
|
5191
|
-
}
|
|
5192
|
-
media {
|
|
5193
|
-
type
|
|
5194
|
-
files {
|
|
5195
|
-
formats {
|
|
5196
|
-
format
|
|
5197
|
-
url
|
|
5198
|
-
}
|
|
5199
|
-
url
|
|
5200
|
-
}
|
|
5201
|
-
}
|
|
5202
|
-
location {
|
|
5203
|
-
city
|
|
5204
|
-
county
|
|
5205
|
-
streetAddress
|
|
5206
|
-
postalCode
|
|
5207
|
-
}
|
|
5208
|
-
price
|
|
5209
|
-
shortDescription
|
|
5210
|
-
title
|
|
5211
|
-
}
|
|
5212
|
-
}
|
|
5213
|
-
${HoursOpen}
|
|
5214
|
-
${FinancialOptionDetail}
|
|
5215
|
-
`;
|
|
5216
|
-
var SEARCH_ITEM_QUERY_default = SEARCH_ITEM_QUERY;
|
|
5217
|
-
|
|
5218
|
-
// src/hooks/useSearchItem.ts
|
|
5219
|
-
var useSearchItem = (id) => (0, import_client2.useQuery)(SEARCH_ITEM_QUERY_default, {
|
|
5220
|
-
variables: { id },
|
|
5221
|
-
skip: !id
|
|
5222
|
-
});
|
|
5223
|
-
var useSearchItem_default = useSearchItem;
|
|
5224
|
-
|
|
5225
|
-
// src/components/Modal/index.tsx
|
|
5226
|
-
var React39 = __toESM(__require("react"));
|
|
5227
|
-
|
|
5228
|
-
// src/components/Modal/wrapper.tsx
|
|
5229
|
-
var import_styled_components35 = __toESM(__require("styled-components"));
|
|
5230
|
-
var Wrapper17 = import_styled_components35.default.div.attrs(() => ({
|
|
5231
|
-
role: "dialog"
|
|
5232
|
-
}))`
|
|
5233
|
-
position: fixed;
|
|
5234
|
-
top: 0;
|
|
5235
|
-
bottom: 0;
|
|
5236
|
-
left: 0;
|
|
5237
|
-
right: 0;
|
|
5238
|
-
width: 100%;
|
|
5239
|
-
white-space: normal;
|
|
5240
|
-
text-align: left;
|
|
5241
|
-
z-index: 90;
|
|
5242
|
-
display: flex;
|
|
5243
|
-
align-items: center;
|
|
5244
|
-
justify-content: center;
|
|
5245
|
-
|
|
5246
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
5247
|
-
padding: ${size(2)};
|
|
5248
|
-
}
|
|
5249
|
-
`;
|
|
5250
|
-
var UiBlock2 = import_styled_components35.default.div.attrs(() => ({
|
|
5251
|
-
"aria-hidden": "true",
|
|
5252
|
-
role: "button"
|
|
5253
|
-
}))`
|
|
5254
|
-
position: fixed;
|
|
5255
|
-
top: 0;
|
|
5256
|
-
bottom: 0;
|
|
5257
|
-
left: 0;
|
|
5258
|
-
right: 0;
|
|
5259
|
-
background-color: rgba(0, 0, 0, 0.35);
|
|
5260
|
-
z-index: -1;
|
|
5261
|
-
|
|
5262
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
5263
|
-
animation: ${fadeIn} 300ms ease forwards;
|
|
5264
|
-
}
|
|
5265
|
-
|
|
5266
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
5267
|
-
animation: ${fadeIn} 400ms ease forwards;
|
|
5268
|
-
}
|
|
5269
|
-
`;
|
|
5270
|
-
var Dialog = import_styled_components35.default.article.attrs(() => ({
|
|
5271
|
-
className: "wayke__theme wayke__font--regular"
|
|
5272
|
-
}))`
|
|
5273
|
-
display: flex;
|
|
5274
|
-
flex-direction: column;
|
|
5275
|
-
background-color: ${(props) => props.theme.color.bg};
|
|
5276
|
-
z-index: 1;
|
|
5277
|
-
width: 100%;
|
|
5278
|
-
max-width: 680px;
|
|
5279
|
-
max-height: 100%;
|
|
5280
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
5281
|
-
overflow: hidden;
|
|
5282
|
-
|
|
5283
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
5284
|
-
align-self: flex-end;
|
|
5285
|
-
transform: translateY(100%);
|
|
5286
|
-
animation: ${noTransform} 300ms ease forwards;
|
|
5287
|
-
}
|
|
5288
|
-
|
|
5289
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
5290
|
-
transform: translateY(${size(2)});
|
|
5291
|
-
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
5292
|
-
}
|
|
5293
|
-
`;
|
|
5294
|
-
var Content4 = import_styled_components35.default.div`
|
|
5295
|
-
flex: 1 1 auto;
|
|
5296
|
-
overflow: auto;
|
|
5297
|
-
-webkit-overflow-scrolling: touch;
|
|
5298
|
-
`;
|
|
5299
|
-
var Header4 = import_styled_components35.default.header`
|
|
5300
|
-
display: flex;
|
|
5301
|
-
align-items: center;
|
|
5302
|
-
min-height: 60px;
|
|
5303
|
-
padding: ${size(3)};
|
|
5304
|
-
padding-bottom: 0;
|
|
5305
|
-
`;
|
|
5306
|
-
var Heading5 = import_styled_components35.default.div`
|
|
5307
|
-
flex: 1 1 auto;
|
|
5308
|
-
|
|
5309
|
-
${H1} {
|
|
5310
|
-
font-size: 1.5rem;
|
|
6401
|
+
url
|
|
6402
|
+
}
|
|
6403
|
+
loanAmount
|
|
6404
|
+
logotype
|
|
6405
|
+
mileage {
|
|
6406
|
+
...FinancialOptionDetail
|
|
6407
|
+
}
|
|
6408
|
+
monthlyCost
|
|
6409
|
+
name
|
|
6410
|
+
residual {
|
|
6411
|
+
...FinancialOptionDetail
|
|
6412
|
+
}
|
|
6413
|
+
setupFee
|
|
6414
|
+
terms
|
|
6415
|
+
totalCreditCost
|
|
6416
|
+
totalResidualValue
|
|
6417
|
+
type
|
|
6418
|
+
url
|
|
6419
|
+
}
|
|
6420
|
+
media {
|
|
6421
|
+
type
|
|
6422
|
+
files {
|
|
6423
|
+
formats {
|
|
6424
|
+
format
|
|
6425
|
+
url
|
|
6426
|
+
}
|
|
6427
|
+
url
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6430
|
+
location {
|
|
6431
|
+
city
|
|
6432
|
+
county
|
|
6433
|
+
streetAddress
|
|
6434
|
+
postalCode
|
|
6435
|
+
}
|
|
6436
|
+
price
|
|
6437
|
+
shortDescription
|
|
6438
|
+
title
|
|
6439
|
+
}
|
|
5311
6440
|
}
|
|
6441
|
+
${HoursOpen}
|
|
6442
|
+
${FinancialOptionDetail}
|
|
5312
6443
|
`;
|
|
5313
|
-
var
|
|
5314
|
-
flex-shrink: 0;
|
|
5315
|
-
margin: ${size(-2)};
|
|
5316
|
-
padding-left: ${size(3)};
|
|
5317
|
-
`;
|
|
5318
|
-
var CloseBtn2 = (0, import_styled_components35.default)(ButtonReset)`
|
|
5319
|
-
display: block;
|
|
5320
|
-
padding: ${size(2)};
|
|
5321
|
-
`;
|
|
5322
|
-
var Body4 = import_styled_components35.default.div`
|
|
5323
|
-
padding: ${size(3)};
|
|
5324
|
-
`;
|
|
5325
|
-
var Image2 = import_styled_components35.default.img`
|
|
5326
|
-
display: block;
|
|
5327
|
-
width: calc(100% + ${size(6)});
|
|
5328
|
-
margin-left: ${size(-3)};
|
|
5329
|
-
margin-bottom: ${size(3)};
|
|
5330
|
-
`;
|
|
5331
|
-
var ModalFoldout = import_styled_components35.default.div`
|
|
5332
|
-
background-color: ${(props) => props.theme.color.accent};
|
|
5333
|
-
margin: ${size(-3)};
|
|
5334
|
-
margin-top: ${size(3)};
|
|
5335
|
-
padding: ${size(3)};
|
|
5336
|
-
`;
|
|
5337
|
-
var ModalFoldoutBody = import_styled_components35.default.div``;
|
|
6444
|
+
var SEARCH_ITEM_QUERY_default = SEARCH_ITEM_QUERY;
|
|
5338
6445
|
|
|
5339
|
-
// src/
|
|
5340
|
-
var
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
}, /* @__PURE__ */ React39.createElement(UiBlock2, {
|
|
5346
|
-
onClick: onClose,
|
|
5347
|
-
title: "St\xE4ng modal"
|
|
5348
|
-
}), /* @__PURE__ */ React39.createElement(Dialog, null, /* @__PURE__ */ React39.createElement(Content4, null, /* @__PURE__ */ React39.createElement(Header4, null, /* @__PURE__ */ React39.createElement(Heading5, null, /* @__PURE__ */ React39.createElement(H1, {
|
|
5349
|
-
noMargin: true
|
|
5350
|
-
}, title)), /* @__PURE__ */ React39.createElement(Close2, null, /* @__PURE__ */ React39.createElement(CloseBtn2, {
|
|
5351
|
-
onClick: onClose,
|
|
5352
|
-
title: "St\xE4ng modal"
|
|
5353
|
-
}, /* @__PURE__ */ React39.createElement(IconCancel, {
|
|
5354
|
-
block: true
|
|
5355
|
-
})))), /* @__PURE__ */ React39.createElement(Body4, null, children)))));
|
|
5356
|
-
};
|
|
5357
|
-
var Modal_default = Modal;
|
|
6446
|
+
// src/hooks/useSearchItem.ts
|
|
6447
|
+
var useSearchItem = (id) => (0, import_client2.useQuery)(SEARCH_ITEM_QUERY_default, {
|
|
6448
|
+
variables: { id },
|
|
6449
|
+
skip: !id
|
|
6450
|
+
});
|
|
6451
|
+
var useSearchItem_default = useSearchItem;
|
|
5358
6452
|
|
|
5359
6453
|
// src/components/FinancialOptions/index.tsx
|
|
5360
|
-
var
|
|
6454
|
+
var import_react60 = __toESM(__require("react"));
|
|
5361
6455
|
|
|
5362
6456
|
// src/components/FinancialOptions/leasing.tsx
|
|
5363
|
-
var
|
|
6457
|
+
var import_react54 = __toESM(__require("react"));
|
|
5364
6458
|
|
|
5365
6459
|
// src/components/OptionBox/index.tsx
|
|
5366
|
-
var
|
|
6460
|
+
var React51 = __toESM(__require("react"));
|
|
5367
6461
|
|
|
5368
6462
|
// src/components/OptionBox/wrapper.tsx
|
|
5369
|
-
var
|
|
5370
|
-
var
|
|
6463
|
+
var import_styled_components40 = __toESM(__require("styled-components"));
|
|
6464
|
+
var Wrapper21 = import_styled_components40.default.div`
|
|
5371
6465
|
display: flex;
|
|
5372
6466
|
align-items: center;
|
|
5373
6467
|
padding: ${size(1)};
|
|
@@ -5378,14 +6472,14 @@
|
|
|
5378
6472
|
margin-top: ${size(1)};
|
|
5379
6473
|
}
|
|
5380
6474
|
`;
|
|
5381
|
-
var Logo2 =
|
|
6475
|
+
var Logo2 = import_styled_components40.default.div`
|
|
5382
6476
|
position: relative;
|
|
5383
6477
|
flex-shrink: 0;
|
|
5384
6478
|
margin-right: ${size(1)};
|
|
5385
6479
|
width: ${size(9.5)};
|
|
5386
6480
|
height: ${size(6)};
|
|
5387
6481
|
`;
|
|
5388
|
-
var LogoImg =
|
|
6482
|
+
var LogoImg = import_styled_components40.default.img`
|
|
5389
6483
|
display: block;
|
|
5390
6484
|
position: absolute;
|
|
5391
6485
|
left: 0;
|
|
@@ -5396,17 +6490,17 @@
|
|
|
5396
6490
|
max-width: 100%;
|
|
5397
6491
|
max-height: 100%;
|
|
5398
6492
|
`;
|
|
5399
|
-
var Content5 =
|
|
6493
|
+
var Content5 = import_styled_components40.default.div`
|
|
5400
6494
|
flex: 1 1 auto;
|
|
5401
6495
|
text-align: right;
|
|
5402
6496
|
line-height: 1.4;
|
|
5403
6497
|
`;
|
|
5404
|
-
var OptionBoxHeading =
|
|
6498
|
+
var OptionBoxHeading = import_styled_components40.default.div.attrs(() => ({
|
|
5405
6499
|
className: "wayke__theme wayke__font--bold"
|
|
5406
6500
|
}))`
|
|
5407
6501
|
font-size: 1rem;
|
|
5408
6502
|
`;
|
|
5409
|
-
var OptionBoxContent =
|
|
6503
|
+
var OptionBoxContent = import_styled_components40.default.div`
|
|
5410
6504
|
margin-top: ${size(0.5)};
|
|
5411
6505
|
font-size: 0.875rem;
|
|
5412
6506
|
|
|
@@ -5416,24 +6510,24 @@
|
|
|
5416
6510
|
`;
|
|
5417
6511
|
|
|
5418
6512
|
// src/components/OptionBox/index.tsx
|
|
5419
|
-
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */
|
|
6513
|
+
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */ React51.createElement(Wrapper21, null, logo && /* @__PURE__ */ React51.createElement(Logo2, null, /* @__PURE__ */ React51.createElement(LogoImg, {
|
|
5420
6514
|
src: logo,
|
|
5421
6515
|
srcSet: logo2x,
|
|
5422
6516
|
alt: logoAlt
|
|
5423
|
-
})), /* @__PURE__ */
|
|
6517
|
+
})), /* @__PURE__ */ React51.createElement(Content5, null, children));
|
|
5424
6518
|
var OptionBox_default = OptionBox;
|
|
5425
6519
|
|
|
5426
6520
|
// src/components/DataList/index.tsx
|
|
5427
|
-
var
|
|
6521
|
+
var import_react53 = __toESM(__require("react"));
|
|
5428
6522
|
|
|
5429
6523
|
// src/components/DataList/wrapper.tsx
|
|
5430
|
-
var
|
|
5431
|
-
var List8 =
|
|
6524
|
+
var import_styled_components41 = __toESM(__require("styled-components"));
|
|
6525
|
+
var List8 = import_styled_components41.default.ul`
|
|
5432
6526
|
list-style: none;
|
|
5433
6527
|
padding: 0;
|
|
5434
6528
|
margin: 0;
|
|
5435
6529
|
`;
|
|
5436
|
-
var
|
|
6530
|
+
var Item10 = import_styled_components41.default.li`
|
|
5437
6531
|
display: flex;
|
|
5438
6532
|
align-items: flex-start;
|
|
5439
6533
|
|
|
@@ -5441,10 +6535,10 @@
|
|
|
5441
6535
|
margin-top: ${size(1)};
|
|
5442
6536
|
}
|
|
5443
6537
|
`;
|
|
5444
|
-
var Label7 =
|
|
6538
|
+
var Label7 = import_styled_components41.default.div`
|
|
5445
6539
|
flex: 1 1 auto;
|
|
5446
6540
|
`;
|
|
5447
|
-
var Value2 =
|
|
6541
|
+
var Value2 = import_styled_components41.default.div.attrs(() => ({
|
|
5448
6542
|
className: "wayke__theme wayke__font--bold"
|
|
5449
6543
|
}))`
|
|
5450
6544
|
flex-shrink: 0;
|
|
@@ -5452,25 +6546,25 @@
|
|
|
5452
6546
|
`;
|
|
5453
6547
|
|
|
5454
6548
|
// src/components/DataList/index.tsx
|
|
5455
|
-
var DataList = ({ items }) => /* @__PURE__ */
|
|
6549
|
+
var DataList = ({ items }) => /* @__PURE__ */ import_react53.default.createElement(List8, null, items.map((item) => /* @__PURE__ */ import_react53.default.createElement(Item10, {
|
|
5456
6550
|
key: item.label
|
|
5457
|
-
}, /* @__PURE__ */
|
|
6551
|
+
}, /* @__PURE__ */ import_react53.default.createElement(Label7, null, item.label), /* @__PURE__ */ import_react53.default.createElement(Value2, null, item.value))));
|
|
5458
6552
|
var DataList_default = DataList;
|
|
5459
6553
|
|
|
5460
6554
|
// src/components/FinancialOptions/leasing.tsx
|
|
5461
6555
|
var Leasing = ({ financialOption }) => {
|
|
5462
|
-
const [modal, setModal] = (0,
|
|
5463
|
-
const toggleModal = (0,
|
|
6556
|
+
const [modal, setModal] = (0, import_react54.useState)(false);
|
|
6557
|
+
const toggleModal = (0, import_react54.useCallback)(() => setModal(!modal), [modal]);
|
|
5464
6558
|
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
5465
|
-
return /* @__PURE__ */
|
|
6559
|
+
return /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, modal && /* @__PURE__ */ import_react54.default.createElement(Modal_default, {
|
|
5466
6560
|
title: "Privatleasing",
|
|
5467
6561
|
onClose: toggleModal
|
|
5468
|
-
}, image && /* @__PURE__ */
|
|
6562
|
+
}, image && /* @__PURE__ */ import_react54.default.createElement(Image3, {
|
|
5469
6563
|
src: image,
|
|
5470
6564
|
alt: "Privatleasing"
|
|
5471
|
-
}), description && /* @__PURE__ */
|
|
6565
|
+
}), description && /* @__PURE__ */ import_react54.default.createElement(Content_default, {
|
|
5472
6566
|
dangerouslySetInnerHTML: { __html: description }
|
|
5473
|
-
}), /* @__PURE__ */
|
|
6567
|
+
}), /* @__PURE__ */ import_react54.default.createElement(ModalFoldout, null, /* @__PURE__ */ import_react54.default.createElement(ModalFoldoutBody, null, /* @__PURE__ */ import_react54.default.createElement(DataList_default, {
|
|
5474
6568
|
items: [
|
|
5475
6569
|
{
|
|
5476
6570
|
label: "M\xE5nadskostnad",
|
|
@@ -5485,14 +6579,14 @@
|
|
|
5485
6579
|
value: `${numberSeparator(mileage?.current || 0)} mil/\xE5r`
|
|
5486
6580
|
}
|
|
5487
6581
|
]
|
|
5488
|
-
})))), /* @__PURE__ */
|
|
6582
|
+
})))), /* @__PURE__ */ import_react54.default.createElement(OptionBox_default, null, /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, monthlyCost !== null && monthlyCost !== void 0 && /* @__PURE__ */ import_react54.default.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/m\xE5n`)), /* @__PURE__ */ import_react54.default.createElement(OptionBoxContent, null, /* @__PURE__ */ import_react54.default.createElement("p", null, "Privatleasing", " ", mileage?.current && duration?.current && /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, /* @__PURE__ */ import_react54.default.createElement(UtilityTextPrimary, null, numberSeparator(mileage?.current), " mil/\xE5r"), " ", "i ", /* @__PURE__ */ import_react54.default.createElement(UtilityTextPrimary, null, duration?.current, " m\xE5n"), ".", " ")), /* @__PURE__ */ import_react54.default.createElement("p", null, /* @__PURE__ */ import_react54.default.createElement(ButtonInline, {
|
|
5489
6583
|
onClick: toggleModal
|
|
5490
6584
|
}, "L\xE4s mer")))));
|
|
5491
6585
|
};
|
|
5492
6586
|
var leasing_default = Leasing;
|
|
5493
6587
|
|
|
5494
6588
|
// src/components/FinancialOptions/loan.tsx
|
|
5495
|
-
var
|
|
6589
|
+
var import_react59 = __toESM(__require("react"));
|
|
5496
6590
|
|
|
5497
6591
|
// src/hooks/useLoan.ts
|
|
5498
6592
|
var import_client4 = __require("@apollo/client");
|
|
@@ -5548,22 +6642,22 @@
|
|
|
5548
6642
|
var useLoan_default = useLoanCalculation;
|
|
5549
6643
|
|
|
5550
6644
|
// src/components/FinancialOptions/LoanModal.tsx
|
|
5551
|
-
var
|
|
6645
|
+
var import_react58 = __toESM(__require("react"));
|
|
5552
6646
|
|
|
5553
6647
|
// src/components/ContentLogo/index.tsx
|
|
5554
|
-
var
|
|
5555
|
-
var ContentLogo =
|
|
6648
|
+
var import_styled_components42 = __toESM(__require("styled-components"));
|
|
6649
|
+
var ContentLogo = import_styled_components42.default.div`
|
|
5556
6650
|
${(props) => props.theme.breakpoint.Sm} {
|
|
5557
6651
|
display: flex;
|
|
5558
6652
|
align-items: flex-start;
|
|
5559
6653
|
}
|
|
5560
6654
|
`;
|
|
5561
|
-
var ContentLogoText =
|
|
6655
|
+
var ContentLogoText = import_styled_components42.default.div`
|
|
5562
6656
|
${(props) => props.theme.breakpoint.Sm} {
|
|
5563
6657
|
flex: 1 1 auto;
|
|
5564
6658
|
}
|
|
5565
6659
|
`;
|
|
5566
|
-
var ContentLogoMedia =
|
|
6660
|
+
var ContentLogoMedia = import_styled_components42.default.div`
|
|
5567
6661
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
5568
6662
|
margin-top: ${size(2)};
|
|
5569
6663
|
}
|
|
@@ -5575,43 +6669,43 @@
|
|
|
5575
6669
|
`;
|
|
5576
6670
|
|
|
5577
6671
|
// src/components/RangeSlider/SliderWithLabel.tsx
|
|
5578
|
-
var
|
|
6672
|
+
var import_react57 = __toESM(__require("react"));
|
|
5579
6673
|
|
|
5580
6674
|
// src/components/RangeSliderLabel/index.tsx
|
|
5581
|
-
var
|
|
6675
|
+
var import_react55 = __toESM(__require("react"));
|
|
5582
6676
|
|
|
5583
6677
|
// src/components/RangeSliderLabel/wrapper.tsx
|
|
5584
|
-
var
|
|
5585
|
-
var
|
|
6678
|
+
var import_styled_components43 = __toESM(__require("styled-components"));
|
|
6679
|
+
var Wrapper22 = import_styled_components43.default.div`
|
|
5586
6680
|
display: flex;
|
|
5587
6681
|
align-items: flex-end;
|
|
5588
6682
|
`;
|
|
5589
|
-
var Label8 =
|
|
6683
|
+
var Label8 = import_styled_components43.default.div.attrs(() => ({
|
|
5590
6684
|
className: "wayke__theme wayke__font--bold"
|
|
5591
6685
|
}))`
|
|
5592
6686
|
flex: 1 1 auto;
|
|
5593
6687
|
`;
|
|
5594
|
-
var Value3 =
|
|
6688
|
+
var Value3 = import_styled_components43.default.div.attrs(() => ({
|
|
5595
6689
|
className: "wayke__theme wayke__font--bold wayke__color--primary-text"
|
|
5596
6690
|
}))`
|
|
5597
6691
|
flex-shrink: 0;
|
|
5598
6692
|
padding-left: ${size(2)};
|
|
5599
6693
|
font-size: 1.125rem;
|
|
5600
6694
|
|
|
5601
|
-
${({ isHighlighted }) => isHighlighted &&
|
|
6695
|
+
${({ isHighlighted }) => isHighlighted && import_styled_components43.css`
|
|
5602
6696
|
font-size: 1.375rem;
|
|
5603
6697
|
color: ${(props) => props.theme.color.textDark} !important;
|
|
5604
6698
|
`}
|
|
5605
6699
|
`;
|
|
5606
6700
|
|
|
5607
6701
|
// src/components/RangeSliderLabel/index.tsx
|
|
5608
|
-
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */
|
|
6702
|
+
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */ import_react55.default.createElement(Wrapper22, null, /* @__PURE__ */ import_react55.default.createElement(Label8, null, label), value && /* @__PURE__ */ import_react55.default.createElement(Value3, {
|
|
5609
6703
|
isHighlighted: highlight
|
|
5610
6704
|
}, value));
|
|
5611
6705
|
var RangeSliderLabel_default = RangeSliderLabel;
|
|
5612
6706
|
|
|
5613
6707
|
// src/components/RangeSlider/RangeSliderSimple.tsx
|
|
5614
|
-
var
|
|
6708
|
+
var import_react56 = __toESM(__require("react"));
|
|
5615
6709
|
var import_react_compound_slider2 = __require("react-compound-slider");
|
|
5616
6710
|
var RangeSliderSimple = ({
|
|
5617
6711
|
loading,
|
|
@@ -5631,7 +6725,7 @@
|
|
|
5631
6725
|
if (steps.length < 2) {
|
|
5632
6726
|
return null;
|
|
5633
6727
|
}
|
|
5634
|
-
return /* @__PURE__ */
|
|
6728
|
+
return /* @__PURE__ */ import_react56.default.createElement(import_react56.default.Fragment, null, /* @__PURE__ */ import_react56.default.createElement(Slider, null, /* @__PURE__ */ import_react56.default.createElement(import_react_compound_slider2.Slider, {
|
|
5635
6729
|
disabled: loading,
|
|
5636
6730
|
mode: 1,
|
|
5637
6731
|
step,
|
|
@@ -5640,20 +6734,20 @@
|
|
|
5640
6734
|
onUpdate,
|
|
5641
6735
|
values,
|
|
5642
6736
|
rootStyle: { position: "relative" }
|
|
5643
|
-
}, /* @__PURE__ */
|
|
6737
|
+
}, /* @__PURE__ */ import_react56.default.createElement(import_react_compound_slider2.Rail, null, ({ getRailProps }) => /* @__PURE__ */ import_react56.default.createElement(Bar2, {
|
|
5644
6738
|
...getRailProps()
|
|
5645
|
-
})), /* @__PURE__ */
|
|
6739
|
+
})), /* @__PURE__ */ import_react56.default.createElement(import_react_compound_slider2.Handles, null, ({ handles, getHandleProps }) => /* @__PURE__ */ import_react56.default.createElement("div", {
|
|
5646
6740
|
className: "slider-handles"
|
|
5647
|
-
}, handles.map((handle) => /* @__PURE__ */
|
|
6741
|
+
}, handles.map((handle) => /* @__PURE__ */ import_react56.default.createElement(Handle2, {
|
|
5648
6742
|
key: handle.id,
|
|
5649
6743
|
handle,
|
|
5650
6744
|
domain,
|
|
5651
6745
|
getHandleProps
|
|
5652
|
-
})))), /* @__PURE__ */
|
|
6746
|
+
})))), /* @__PURE__ */ import_react56.default.createElement(import_react_compound_slider2.Tracks, {
|
|
5653
6747
|
right: false
|
|
5654
|
-
}, ({ tracks, getTrackProps }) => /* @__PURE__ */
|
|
6748
|
+
}, ({ tracks, getTrackProps }) => /* @__PURE__ */ import_react56.default.createElement("div", {
|
|
5655
6749
|
className: "slider-tracks"
|
|
5656
|
-
}, tracks.map(({ id, source, target }) => /* @__PURE__ */
|
|
6750
|
+
}, tracks.map(({ id, source, target }) => /* @__PURE__ */ import_react56.default.createElement(Track2, {
|
|
5657
6751
|
key: id,
|
|
5658
6752
|
source,
|
|
5659
6753
|
target,
|
|
@@ -5673,18 +6767,18 @@
|
|
|
5673
6767
|
formatValues,
|
|
5674
6768
|
onChange
|
|
5675
6769
|
}) => {
|
|
5676
|
-
const [local, setLocal] = (0,
|
|
5677
|
-
const onUpdate = (0,
|
|
6770
|
+
const [local, setLocal] = (0, import_react57.useState)(steps);
|
|
6771
|
+
const onUpdate = (0, import_react57.useCallback)((nextValues) => {
|
|
5678
6772
|
setLocal([...nextValues]);
|
|
5679
6773
|
}, []);
|
|
5680
|
-
(0,
|
|
6774
|
+
(0, import_react57.useEffect)(() => {
|
|
5681
6775
|
if (!loading)
|
|
5682
6776
|
setLocal(void 0);
|
|
5683
6777
|
}, [loading]);
|
|
5684
|
-
return /* @__PURE__ */
|
|
6778
|
+
return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react57.default.createElement(RangeSliderLabel_default, {
|
|
5685
6779
|
label,
|
|
5686
6780
|
value: `${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ""}`
|
|
5687
|
-
})), /* @__PURE__ */
|
|
6781
|
+
})), /* @__PURE__ */ import_react57.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react57.default.createElement(RangeSliderSimple_default, {
|
|
5688
6782
|
loading,
|
|
5689
6783
|
values,
|
|
5690
6784
|
domain,
|
|
@@ -5709,22 +6803,22 @@
|
|
|
5709
6803
|
return stepGenerator(step, max, steps, nextCurrent);
|
|
5710
6804
|
};
|
|
5711
6805
|
var LoanModal = ({ id, financialOption, onClose }) => {
|
|
5712
|
-
const [tmp, setTmp] = (0,
|
|
5713
|
-
const [extend, setExtend] =
|
|
5714
|
-
const onToggleExtend =
|
|
6806
|
+
const [tmp, setTmp] = (0, import_react58.useState)();
|
|
6807
|
+
const [extend, setExtend] = import_react58.default.useState(false);
|
|
6808
|
+
const onToggleExtend = import_react58.default.useCallback(() => {
|
|
5715
6809
|
if (!extend) {
|
|
5716
6810
|
pubsub_default.publish("FinanceInterest");
|
|
5717
6811
|
}
|
|
5718
6812
|
setExtend(!extend);
|
|
5719
6813
|
}, [extend]);
|
|
5720
|
-
const [variables, setVariables] = (0,
|
|
6814
|
+
const [variables, setVariables] = (0, import_react58.useState)({
|
|
5721
6815
|
duration: financialOption.duration?.current,
|
|
5722
6816
|
downPayment: financialOption.downPayment?.current,
|
|
5723
6817
|
residual: financialOption.residual?.current
|
|
5724
6818
|
});
|
|
5725
6819
|
const { duration, downPayment, residual } = variables;
|
|
5726
6820
|
const { loading, data } = useLoan_default(id, duration, downPayment, residual);
|
|
5727
|
-
(0,
|
|
6821
|
+
(0, import_react58.useEffect)(() => {
|
|
5728
6822
|
if (data) {
|
|
5729
6823
|
setTmp(data);
|
|
5730
6824
|
setVariables({
|
|
@@ -5740,7 +6834,7 @@
|
|
|
5740
6834
|
const downPaymentMax = loan?.downPayment?.max || 0;
|
|
5741
6835
|
const downPaymentStep = loan?.downPayment?.step || 0;
|
|
5742
6836
|
const downPaymentSteps = stepGenerator(downPaymentStep, downPaymentMax);
|
|
5743
|
-
const onDownPaymentChange = (0,
|
|
6837
|
+
const onDownPaymentChange = (0, import_react58.useCallback)(
|
|
5744
6838
|
(values) => {
|
|
5745
6839
|
pubsub_default.publish("FinanceInterest");
|
|
5746
6840
|
setVariables({ ...variables, downPayment: values[0] });
|
|
@@ -5752,7 +6846,7 @@
|
|
|
5752
6846
|
const durationMax = loan?.duration?.max || 0;
|
|
5753
6847
|
const durationStep = loan?.duration?.step || 0;
|
|
5754
6848
|
const durationSteps = stepGenerator(durationStep, durationMax);
|
|
5755
|
-
const onDurationChange = (0,
|
|
6849
|
+
const onDurationChange = (0, import_react58.useCallback)(
|
|
5756
6850
|
(values) => {
|
|
5757
6851
|
pubsub_default.publish("FinanceInterest");
|
|
5758
6852
|
setVariables({ ...variables, duration: values[0] });
|
|
@@ -5764,7 +6858,7 @@
|
|
|
5764
6858
|
const residualMax = (loan?.residual?.max || 0) * 100 || 0;
|
|
5765
6859
|
const residualStep = (loan?.residual?.step || 0) * 100 || 0;
|
|
5766
6860
|
const residualSteps = stepGenerator(residualStep, residualMax);
|
|
5767
|
-
const onResidualChange = (0,
|
|
6861
|
+
const onResidualChange = (0, import_react58.useCallback)(
|
|
5768
6862
|
(values) => {
|
|
5769
6863
|
pubsub_default.publish("FinanceInterest");
|
|
5770
6864
|
setVariables({ ...variables, residual: values[0] / 100 });
|
|
@@ -5773,14 +6867,14 @@
|
|
|
5773
6867
|
);
|
|
5774
6868
|
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
5775
6869
|
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
5776
|
-
return /* @__PURE__ */
|
|
6870
|
+
return /* @__PURE__ */ import_react58.default.createElement(Modal_default, {
|
|
5777
6871
|
title: "L\xE5nealternativ",
|
|
5778
6872
|
onClose
|
|
5779
|
-
}, /* @__PURE__ */
|
|
6873
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Repeat, null, /* @__PURE__ */ import_react58.default.createElement(ContentLogo, null, financialOption?.description && /* @__PURE__ */ import_react58.default.createElement(ContentLogoText, null, /* @__PURE__ */ import_react58.default.createElement(Content_default, null, /* @__PURE__ */ import_react58.default.createElement("p", null, financialOption.description))), financialOption?.image && /* @__PURE__ */ import_react58.default.createElement(ContentLogoMedia, null, /* @__PURE__ */ import_react58.default.createElement(LogoBox_default, {
|
|
5780
6874
|
logo: financialOption.image,
|
|
5781
6875
|
alt: financialOption.name || "Logotyp",
|
|
5782
6876
|
wide: true
|
|
5783
|
-
})))), /* @__PURE__ */
|
|
6877
|
+
})))), /* @__PURE__ */ import_react58.default.createElement(Repeat, null, /* @__PURE__ */ import_react58.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react58.default.createElement(SliderWithLabel_default, {
|
|
5784
6878
|
label: "Kontantinsatts",
|
|
5785
6879
|
values: [downPaymentCurrent],
|
|
5786
6880
|
domain: [downPaymentMin, downPaymentMax],
|
|
@@ -5789,7 +6883,7 @@
|
|
|
5789
6883
|
formatValues: true,
|
|
5790
6884
|
loading,
|
|
5791
6885
|
onChange: onDownPaymentChange
|
|
5792
|
-
})), /* @__PURE__ */
|
|
6886
|
+
})), /* @__PURE__ */ import_react58.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react58.default.createElement(SliderWithLabel_default, {
|
|
5793
6887
|
label: "Avbetalning",
|
|
5794
6888
|
values: [durationCurrent],
|
|
5795
6889
|
domain: [durationMin, durationMax],
|
|
@@ -5797,7 +6891,7 @@
|
|
|
5797
6891
|
unit: "m\xE5n",
|
|
5798
6892
|
loading,
|
|
5799
6893
|
onChange: onDurationChange
|
|
5800
|
-
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */
|
|
6894
|
+
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */ import_react58.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react58.default.createElement(SliderWithLabel_default, {
|
|
5801
6895
|
label: "Restskuld",
|
|
5802
6896
|
values: [residualCurrent],
|
|
5803
6897
|
domain: [residualMin, residualMax],
|
|
@@ -5805,12 +6899,12 @@
|
|
|
5805
6899
|
unit: "%",
|
|
5806
6900
|
loading,
|
|
5807
6901
|
onChange: onResidualChange
|
|
5808
|
-
})), /* @__PURE__ */
|
|
6902
|
+
})), /* @__PURE__ */ import_react58.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react58.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react58.default.createElement(Content_default, {
|
|
5809
6903
|
small: true
|
|
5810
|
-
}, /* @__PURE__ */
|
|
6904
|
+
}, /* @__PURE__ */ import_react58.default.createElement("p", null, `*Ber\xE4knat p\xE5 ${interestText} % r\xE4nta (effektivt ${effectiveInterestText} %)${loan?.mileage !== null ? `och en \xE5rlig k\xF6rstr\xE4cka om ${loan?.mileage} mil.` : ""}`)))), /* @__PURE__ */ import_react58.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react58.default.createElement(ButtonClear, {
|
|
5811
6905
|
onClick: onToggleExtend,
|
|
5812
6906
|
title: extend ? "Visa mindre information" : "Visa mer information"
|
|
5813
|
-
}, /* @__PURE__ */
|
|
6907
|
+
}, /* @__PURE__ */ import_react58.default.createElement(ButtonContent, null, extend ? "Mindre information" : "Mer information"))), /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, extend && /* @__PURE__ */ import_react58.default.createElement(ModalFoldout, null, /* @__PURE__ */ import_react58.default.createElement(ModalFoldoutBody, null, /* @__PURE__ */ import_react58.default.createElement(DataList_default, {
|
|
5814
6908
|
items: [
|
|
5815
6909
|
{
|
|
5816
6910
|
label: "R\xE4nta",
|
|
@@ -5839,8 +6933,8 @@
|
|
|
5839
6933
|
|
|
5840
6934
|
// src/components/FinancialOptions/loan.tsx
|
|
5841
6935
|
var Loan = ({ id, financialOption }) => {
|
|
5842
|
-
const [modal, setModal] = (0,
|
|
5843
|
-
const toggleModal = (0,
|
|
6936
|
+
const [modal, setModal] = (0, import_react59.useState)(false);
|
|
6937
|
+
const toggleModal = (0, import_react59.useCallback)(() => setModal(!modal), [modal]);
|
|
5844
6938
|
const { data } = useLoan_default(
|
|
5845
6939
|
id,
|
|
5846
6940
|
financialOption.duration?.current,
|
|
@@ -5852,100 +6946,100 @@
|
|
|
5852
6946
|
const monthlyCost = data?.loan?.monthlyCost;
|
|
5853
6947
|
const logo = financialOption?.logotype || "https://placehold.it/67x10";
|
|
5854
6948
|
if (financialOption.loanAmount === void 0 || financialOption.loanAmount === null || interest === void 0 || duration === void 0 || monthlyCost === void 0 || interest === null || duration === null || monthlyCost === null) {
|
|
5855
|
-
return /* @__PURE__ */
|
|
6949
|
+
return /* @__PURE__ */ import_react59.default.createElement(OptionBox_default, {
|
|
5856
6950
|
logo,
|
|
5857
6951
|
logoAlt: "Logotyp"
|
|
5858
|
-
}, /* @__PURE__ */
|
|
6952
|
+
}, /* @__PURE__ */ import_react59.default.createElement(OptionBoxHeading, null, "Laddar..."), /* @__PURE__ */ import_react59.default.createElement(OptionBoxContent, null, /* @__PURE__ */ import_react59.default.createElement("p", null, "Laddar...")));
|
|
5859
6953
|
}
|
|
5860
|
-
return /* @__PURE__ */
|
|
6954
|
+
return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, modal && /* @__PURE__ */ import_react59.default.createElement(LoanModal_default, {
|
|
5861
6955
|
id,
|
|
5862
6956
|
financialOption,
|
|
5863
6957
|
onClose: toggleModal
|
|
5864
|
-
}), /* @__PURE__ */
|
|
6958
|
+
}), /* @__PURE__ */ import_react59.default.createElement(OptionBox_default, {
|
|
5865
6959
|
logo,
|
|
5866
6960
|
logoAlt: "Logotyp"
|
|
5867
|
-
}, /* @__PURE__ */
|
|
6961
|
+
}, /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(OptionBoxHeading, null, `${numberSeparator(monthlyCost)} kr/m\xE5n*`), /* @__PURE__ */ import_react59.default.createElement(OptionBoxContent, null, /* @__PURE__ */ import_react59.default.createElement("p", null, "Delbetala", " ", financialOption.loanAmount && duration && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(UtilityTextPrimary, null, numberSeparator(financialOption.loanAmount), " kr"), " ", "i ", /* @__PURE__ */ import_react59.default.createElement(UtilityTextPrimary, null, duration, " m\xE5n"), ".")), /* @__PURE__ */ import_react59.default.createElement("p", null, `*Ber\xE4knat p\xE5 ${(interest * 100).toFixed(2)}% r\xE4nta. `, /* @__PURE__ */ import_react59.default.createElement(ButtonInline, {
|
|
5868
6962
|
onClick: toggleModal
|
|
5869
6963
|
}, "L\xE4s mer"))))));
|
|
5870
6964
|
};
|
|
5871
6965
|
var loan_default = Loan;
|
|
5872
6966
|
|
|
5873
6967
|
// src/components/FinancialOptions/index.tsx
|
|
5874
|
-
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */
|
|
6968
|
+
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */ import_react60.default.createElement(Repeat, null, /* @__PURE__ */ import_react60.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react60.default.createElement(VisualHeading, null, "Andra finansieringsalternativ")), /* @__PURE__ */ import_react60.default.createElement(RepeatTiny, null, financialOptions.map((financialOption, index2) => /* @__PURE__ */ import_react60.default.createElement(import_react60.Fragment, {
|
|
5875
6969
|
key: index2
|
|
5876
|
-
}, financialOption.type === "leasing" && /* @__PURE__ */
|
|
6970
|
+
}, financialOption.type === "leasing" && /* @__PURE__ */ import_react60.default.createElement(leasing_default, {
|
|
5877
6971
|
financialOption
|
|
5878
|
-
}), financialOption.type === "loan" && /* @__PURE__ */
|
|
6972
|
+
}), financialOption.type === "loan" && /* @__PURE__ */ import_react60.default.createElement(loan_default, {
|
|
5879
6973
|
id,
|
|
5880
6974
|
financialOption
|
|
5881
6975
|
})))));
|
|
5882
6976
|
var FinancialOptions_default = FinancialOptions;
|
|
5883
6977
|
|
|
5884
6978
|
// src/components/InsuranceOptions/index.tsx
|
|
5885
|
-
var
|
|
6979
|
+
var import_react70 = __toESM(__require("react"));
|
|
5886
6980
|
|
|
5887
6981
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
5888
|
-
var
|
|
6982
|
+
var import_react67 = __toESM(__require("react"));
|
|
5889
6983
|
|
|
5890
6984
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
5891
|
-
var
|
|
6985
|
+
var import_react66 = __toESM(__require("react"));
|
|
5892
6986
|
|
|
5893
6987
|
// src/components/DetailBox/index.tsx
|
|
5894
|
-
var
|
|
6988
|
+
var import_react61 = __toESM(__require("react"));
|
|
5895
6989
|
|
|
5896
6990
|
// src/components/DetailBox/wrapper.tsx
|
|
5897
|
-
var
|
|
5898
|
-
var
|
|
6991
|
+
var import_styled_components44 = __toESM(__require("styled-components"));
|
|
6992
|
+
var Wrapper23 = import_styled_components44.default.article`
|
|
5899
6993
|
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
|
5900
6994
|
border-radius: 3px;
|
|
5901
6995
|
overflow: hidden;
|
|
5902
6996
|
`;
|
|
5903
|
-
var
|
|
6997
|
+
var Main2 = import_styled_components44.default.div`
|
|
5904
6998
|
padding: ${size(2.5)};
|
|
5905
6999
|
`;
|
|
5906
|
-
var Heading6 = (0,
|
|
7000
|
+
var Heading6 = (0, import_styled_components44.default)(H2).attrs(() => ({
|
|
5907
7001
|
as: "h1"
|
|
5908
7002
|
}))`
|
|
5909
7003
|
margin-bottom: 0;
|
|
5910
7004
|
`;
|
|
5911
|
-
var Description3 =
|
|
7005
|
+
var Description3 = import_styled_components44.default.div`
|
|
5912
7006
|
margin-top: ${size(1)};
|
|
5913
7007
|
`;
|
|
5914
|
-
var Footer3 =
|
|
7008
|
+
var Footer3 = import_styled_components44.default.div`
|
|
5915
7009
|
margin-top: ${size(1)};
|
|
5916
7010
|
color: red;
|
|
5917
7011
|
`;
|
|
5918
|
-
var Foldout =
|
|
7012
|
+
var Foldout = import_styled_components44.default.div`
|
|
5919
7013
|
background-color: ${(props) => props.theme.color.accent};
|
|
5920
7014
|
padding: ${size(2.5)};
|
|
5921
7015
|
`;
|
|
5922
7016
|
|
|
5923
7017
|
// src/components/DetailBox/index.tsx
|
|
5924
7018
|
var DetailBox = ({ heading, description, children }) => {
|
|
5925
|
-
const [extend, setExtend] =
|
|
5926
|
-
const onToggleExtend =
|
|
7019
|
+
const [extend, setExtend] = import_react61.default.useState(false);
|
|
7020
|
+
const onToggleExtend = import_react61.default.useCallback(() => setExtend(!extend), [extend]);
|
|
5927
7021
|
const extendBtnText = extend ? "Mindre information" : "Mer information";
|
|
5928
|
-
return /* @__PURE__ */
|
|
7022
|
+
return /* @__PURE__ */ import_react61.default.createElement(Wrapper23, null, /* @__PURE__ */ import_react61.default.createElement(Main2, null, /* @__PURE__ */ import_react61.default.createElement(Heading6, null, heading), description && /* @__PURE__ */ import_react61.default.createElement(Description3, null, description), /* @__PURE__ */ import_react61.default.createElement(Footer3, null, /* @__PURE__ */ import_react61.default.createElement(ButtonClear, {
|
|
5929
7023
|
onClick: onToggleExtend
|
|
5930
|
-
}, /* @__PURE__ */
|
|
7024
|
+
}, /* @__PURE__ */ import_react61.default.createElement(ButtonContent, null, extendBtnText)))), extend && /* @__PURE__ */ import_react61.default.createElement(Foldout, null, children));
|
|
5931
7025
|
};
|
|
5932
7026
|
var DetailBox_default = DetailBox;
|
|
5933
7027
|
|
|
5934
7028
|
// src/components/ExtendInfo/index.tsx
|
|
5935
|
-
var
|
|
7029
|
+
var import_react62 = __toESM(__require("react"));
|
|
5936
7030
|
|
|
5937
7031
|
// src/components/ExtendInfo/wrapper.tsx
|
|
5938
|
-
var
|
|
5939
|
-
var
|
|
5940
|
-
var Header5 =
|
|
7032
|
+
var import_styled_components45 = __toESM(__require("styled-components"));
|
|
7033
|
+
var Wrapper24 = import_styled_components45.default.div``;
|
|
7034
|
+
var Header5 = import_styled_components45.default.div`
|
|
5941
7035
|
display: flex;
|
|
5942
7036
|
align-items: center;
|
|
5943
7037
|
`;
|
|
5944
|
-
var Title =
|
|
5945
|
-
var Info2 =
|
|
7038
|
+
var Title = import_styled_components45.default.div``;
|
|
7039
|
+
var Info2 = import_styled_components45.default.div`
|
|
5946
7040
|
margin-left: ${size(1)};
|
|
5947
7041
|
`;
|
|
5948
|
-
var InfoBtn = (0,
|
|
7042
|
+
var InfoBtn = (0, import_styled_components45.default)(ButtonReset).attrs(() => ({
|
|
5949
7043
|
className: "wayke__theme wayke__color--primary-text"
|
|
5950
7044
|
}))`
|
|
5951
7045
|
position: relative;
|
|
@@ -5983,7 +7077,7 @@
|
|
|
5983
7077
|
transform: scale(0.95);
|
|
5984
7078
|
}
|
|
5985
7079
|
`;
|
|
5986
|
-
var Extend2 =
|
|
7080
|
+
var Extend2 = import_styled_components45.default.div`
|
|
5987
7081
|
padding-top: ${size(1)};
|
|
5988
7082
|
margin-top: ${size(1)};
|
|
5989
7083
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
@@ -5992,23 +7086,23 @@
|
|
|
5992
7086
|
|
|
5993
7087
|
// src/components/ExtendInfo/index.tsx
|
|
5994
7088
|
var ExtendInfo = ({ title, children }) => {
|
|
5995
|
-
const [extend, setExtend] = (0,
|
|
5996
|
-
const onToggleExtend = (0,
|
|
5997
|
-
return /* @__PURE__ */
|
|
7089
|
+
const [extend, setExtend] = (0, import_react62.useState)(false);
|
|
7090
|
+
const onToggleExtend = (0, import_react62.useCallback)(() => setExtend(!extend), [extend]);
|
|
7091
|
+
return /* @__PURE__ */ import_react62.default.createElement(Wrapper24, null, /* @__PURE__ */ import_react62.default.createElement(Header5, null, /* @__PURE__ */ import_react62.default.createElement(Title, null, title), children && /* @__PURE__ */ import_react62.default.createElement(Info2, null, /* @__PURE__ */ import_react62.default.createElement(InfoBtn, {
|
|
5998
7092
|
onClick: onToggleExtend,
|
|
5999
7093
|
title: "Mer information"
|
|
6000
|
-
}, /* @__PURE__ */
|
|
7094
|
+
}, /* @__PURE__ */ import_react62.default.createElement(IconInfo, {
|
|
6001
7095
|
block: true
|
|
6002
|
-
})))), extend && /* @__PURE__ */
|
|
7096
|
+
})))), extend && /* @__PURE__ */ import_react62.default.createElement(Extend2, null, children));
|
|
6003
7097
|
};
|
|
6004
7098
|
var ExtendInfo_default = ExtendInfo;
|
|
6005
7099
|
|
|
6006
7100
|
// src/components/InputLabel/index.tsx
|
|
6007
|
-
var
|
|
7101
|
+
var import_react63 = __toESM(__require("react"));
|
|
6008
7102
|
|
|
6009
7103
|
// src/components/InputLabel/wrapper.tsx
|
|
6010
|
-
var
|
|
6011
|
-
var
|
|
7104
|
+
var import_styled_components46 = __toESM(__require("styled-components"));
|
|
7105
|
+
var Wrapper25 = import_styled_components46.default.label.attrs(() => ({
|
|
6012
7106
|
className: "wayke__theme wayke__font--bold"
|
|
6013
7107
|
}))`
|
|
6014
7108
|
margin-bottom: ${size(0.5)};
|
|
@@ -6016,24 +7110,24 @@
|
|
|
6016
7110
|
`;
|
|
6017
7111
|
|
|
6018
7112
|
// src/components/InputLabel/index.tsx
|
|
6019
|
-
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */
|
|
7113
|
+
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */ import_react63.default.createElement(Wrapper25, {
|
|
6020
7114
|
htmlFor
|
|
6021
7115
|
}, children);
|
|
6022
7116
|
var InputLabel_default = InputLabel;
|
|
6023
7117
|
|
|
6024
7118
|
// src/components/InputText/index.tsx
|
|
6025
|
-
var
|
|
7119
|
+
var import_react64 = __toESM(__require("react"));
|
|
6026
7120
|
|
|
6027
7121
|
// src/components/InputText/wrapper.tsx
|
|
6028
|
-
var
|
|
6029
|
-
var
|
|
7122
|
+
var import_styled_components47 = __toESM(__require("styled-components"));
|
|
7123
|
+
var Wrapper26 = import_styled_components47.default.div`
|
|
6030
7124
|
position: relative;
|
|
6031
7125
|
display: flex;
|
|
6032
7126
|
align-items: stretch;
|
|
6033
7127
|
background-color: ${(props) => props.theme.color.accent};
|
|
6034
7128
|
border-radius: 3px;
|
|
6035
7129
|
`;
|
|
6036
|
-
var Input2 =
|
|
7130
|
+
var Input2 = import_styled_components47.default.input.attrs(() => ({
|
|
6037
7131
|
type: "text",
|
|
6038
7132
|
className: "wayke__theme wayke__font--regular"
|
|
6039
7133
|
}))`
|
|
@@ -6080,7 +7174,7 @@
|
|
|
6080
7174
|
`;
|
|
6081
7175
|
|
|
6082
7176
|
// src/components/InputText/index.tsx
|
|
6083
|
-
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */
|
|
7177
|
+
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */ import_react64.default.createElement(Wrapper26, null, /* @__PURE__ */ import_react64.default.createElement(Input2, {
|
|
6084
7178
|
placeholder,
|
|
6085
7179
|
value,
|
|
6086
7180
|
id,
|
|
@@ -6091,12 +7185,12 @@
|
|
|
6091
7185
|
var InputText_default = InputText;
|
|
6092
7186
|
|
|
6093
7187
|
// src/components/InputCheckbox/index.tsx
|
|
6094
|
-
var
|
|
7188
|
+
var React65 = __toESM(__require("react"));
|
|
6095
7189
|
|
|
6096
7190
|
// src/components/InputCheckbox/wrapper.tsx
|
|
6097
|
-
var
|
|
6098
|
-
var
|
|
6099
|
-
var Label9 =
|
|
7191
|
+
var React64 = __toESM(__require("react"));
|
|
7192
|
+
var import_styled_components48 = __toESM(__require("styled-components"));
|
|
7193
|
+
var Label9 = import_styled_components48.default.label.attrs(() => ({
|
|
6100
7194
|
className: "wayke__theme wayke__color--primary-text"
|
|
6101
7195
|
}))`
|
|
6102
7196
|
position: relative;
|
|
@@ -6126,13 +7220,13 @@
|
|
|
6126
7220
|
margin-top: -2px;
|
|
6127
7221
|
}
|
|
6128
7222
|
`;
|
|
6129
|
-
var
|
|
7223
|
+
var Wrapper27 = (0, import_styled_components48.default)((props) => /* @__PURE__ */ React64.createElement("div", {
|
|
6130
7224
|
...props
|
|
6131
7225
|
})).attrs(({ type, checked }) => ({
|
|
6132
7226
|
role: type || "checkbox",
|
|
6133
7227
|
"aria-checked": checked
|
|
6134
7228
|
}))`
|
|
6135
|
-
${({ error }) => error &&
|
|
7229
|
+
${({ error }) => error && import_styled_components48.css`
|
|
6136
7230
|
${Label9} {
|
|
6137
7231
|
color: ${(props) => props.theme.color.ui.negative};
|
|
6138
7232
|
|
|
@@ -6142,7 +7236,7 @@
|
|
|
6142
7236
|
}
|
|
6143
7237
|
`}
|
|
6144
7238
|
`;
|
|
6145
|
-
var Input3 = (0,
|
|
7239
|
+
var Input3 = (0, import_styled_components48.default)((props) => /* @__PURE__ */ React64.createElement("input", {
|
|
6146
7240
|
...props,
|
|
6147
7241
|
className: `${props.checked ? "checked" : void 0} ${props.className}`
|
|
6148
7242
|
})).attrs(({ type, checked }) => ({
|
|
@@ -6173,23 +7267,23 @@
|
|
|
6173
7267
|
}
|
|
6174
7268
|
}
|
|
6175
7269
|
`;
|
|
6176
|
-
var LabelText =
|
|
7270
|
+
var LabelText = import_styled_components48.default.div`
|
|
6177
7271
|
color: ${(props) => props.theme.color.textDark};
|
|
6178
7272
|
`;
|
|
6179
7273
|
|
|
6180
7274
|
// src/components/InputSelect/index.tsx
|
|
6181
|
-
var
|
|
7275
|
+
var import_react65 = __toESM(__require("react"));
|
|
6182
7276
|
|
|
6183
7277
|
// src/components/InputSelect/wrapper.tsx
|
|
6184
|
-
var
|
|
7278
|
+
var import_styled_components49 = __toESM(__require("styled-components"));
|
|
6185
7279
|
var iconSize2 = "0.875rem";
|
|
6186
7280
|
var selectPadding = size(2);
|
|
6187
|
-
var
|
|
7281
|
+
var Wrapper28 = import_styled_components49.default.div`
|
|
6188
7282
|
position: relative;
|
|
6189
7283
|
background-color: ${(props) => props.theme.color.accent};
|
|
6190
7284
|
border-radius: 3px;
|
|
6191
7285
|
`;
|
|
6192
|
-
var Select2 =
|
|
7286
|
+
var Select2 = import_styled_components49.default.select.attrs(() => ({
|
|
6193
7287
|
className: "wayke__theme wayke__font--regular"
|
|
6194
7288
|
}))`
|
|
6195
7289
|
position: relative;
|
|
@@ -6223,10 +7317,10 @@
|
|
|
6223
7317
|
border: 0;
|
|
6224
7318
|
}
|
|
6225
7319
|
`;
|
|
6226
|
-
var Option2 =
|
|
7320
|
+
var Option2 = import_styled_components49.default.option`
|
|
6227
7321
|
color: ${(props) => props.theme.color.textDark};
|
|
6228
7322
|
`;
|
|
6229
|
-
var Icon5 =
|
|
7323
|
+
var Icon5 = import_styled_components49.default.div`
|
|
6230
7324
|
position: absolute;
|
|
6231
7325
|
top: 50%;
|
|
6232
7326
|
right: ${selectPadding};
|
|
@@ -6235,29 +7329,29 @@
|
|
|
6235
7329
|
`;
|
|
6236
7330
|
|
|
6237
7331
|
// src/components/InputSelect/index.tsx
|
|
6238
|
-
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */
|
|
7332
|
+
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */ import_react65.default.createElement(Wrapper28, null, /* @__PURE__ */ import_react65.default.createElement(Select2, {
|
|
6239
7333
|
value,
|
|
6240
7334
|
onChange,
|
|
6241
7335
|
title,
|
|
6242
7336
|
"aria-label": title
|
|
6243
|
-
}, options?.map((option) => /* @__PURE__ */
|
|
7337
|
+
}, options?.map((option) => /* @__PURE__ */ import_react65.default.createElement(Option2, {
|
|
6244
7338
|
key: option.value,
|
|
6245
7339
|
value: option.value
|
|
6246
|
-
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */
|
|
7340
|
+
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */ import_react65.default.createElement(Icon5, null, /* @__PURE__ */ import_react65.default.createElement(IconChevronDown, {
|
|
6247
7341
|
block: true
|
|
6248
7342
|
})));
|
|
6249
7343
|
var InputSelect_default = InputSelect;
|
|
6250
7344
|
|
|
6251
7345
|
// src/components/InputGroup/index.tsx
|
|
6252
|
-
var
|
|
6253
|
-
var InputGroup =
|
|
7346
|
+
var import_styled_components50 = __toESM(__require("styled-components"));
|
|
7347
|
+
var InputGroup = import_styled_components50.default.div`
|
|
6254
7348
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6255
7349
|
display: flex;
|
|
6256
7350
|
align-items: flex-start;
|
|
6257
7351
|
margin: ${size(-0.5)};
|
|
6258
7352
|
}
|
|
6259
7353
|
`;
|
|
6260
|
-
var InputGroupColumn =
|
|
7354
|
+
var InputGroupColumn = import_styled_components50.default.div`
|
|
6261
7355
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
6262
7356
|
& + & {
|
|
6263
7357
|
margin-top: ${size(1)};
|
|
@@ -6271,12 +7365,12 @@
|
|
|
6271
7365
|
`;
|
|
6272
7366
|
|
|
6273
7367
|
// src/components/ColumnRow/index.tsx
|
|
6274
|
-
var
|
|
6275
|
-
var ColumnRow =
|
|
7368
|
+
var import_styled_components51 = __toESM(__require("styled-components"));
|
|
7369
|
+
var ColumnRow = import_styled_components51.default.div`
|
|
6276
7370
|
display: flex;
|
|
6277
7371
|
align-items: flex-start;
|
|
6278
7372
|
`;
|
|
6279
|
-
var ColumnRowItem =
|
|
7373
|
+
var ColumnRowItem = import_styled_components51.default.div`
|
|
6280
7374
|
flex: 1 1 auto;
|
|
6281
7375
|
|
|
6282
7376
|
:last-child:not(:only-child) {
|
|
@@ -6351,30 +7445,30 @@
|
|
|
6351
7445
|
|
|
6352
7446
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
6353
7447
|
var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
6354
|
-
const [form, setForm] = (0,
|
|
7448
|
+
const [form, setForm] = (0, import_react66.useState)({
|
|
6355
7449
|
ssn: "",
|
|
6356
7450
|
drivingDistance: "BETWEEN0AND1000" /* Between0And1000 */
|
|
6357
7451
|
});
|
|
6358
|
-
const [payload, setPayload] = (0,
|
|
7452
|
+
const [payload, setPayload] = (0, import_react66.useState)();
|
|
6359
7453
|
const { loading, data, error } = useInsurance_default(
|
|
6360
7454
|
id,
|
|
6361
7455
|
branch?.id ? branch?.id : void 0,
|
|
6362
7456
|
ssnIsValid(payload?.ssn) ? payload?.ssn : void 0,
|
|
6363
7457
|
payload?.drivingDistance
|
|
6364
7458
|
);
|
|
6365
|
-
const onChangeSsn = (0,
|
|
7459
|
+
const onChangeSsn = (0, import_react66.useCallback)(
|
|
6366
7460
|
(e) => setForm({ ...form, ssn: e.currentTarget.value }),
|
|
6367
7461
|
[form]
|
|
6368
7462
|
);
|
|
6369
|
-
const onChangeDrivingDistance = (0,
|
|
7463
|
+
const onChangeDrivingDistance = (0, import_react66.useCallback)(
|
|
6370
7464
|
(e) => setForm({ ...form, drivingDistance: e.currentTarget.value }),
|
|
6371
7465
|
[form]
|
|
6372
7466
|
);
|
|
6373
|
-
const onShowInsurances = (0,
|
|
7467
|
+
const onShowInsurances = (0, import_react66.useCallback)(() => {
|
|
6374
7468
|
pubsub_default.publish("InsuranceInterest");
|
|
6375
7469
|
setPayload(form);
|
|
6376
7470
|
}, [form]);
|
|
6377
|
-
const onKeyDown = (0,
|
|
7471
|
+
const onKeyDown = (0, import_react66.useCallback)(
|
|
6378
7472
|
(e) => {
|
|
6379
7473
|
if (e.keyCode === 13 && ssnIsValid(form.ssn) && !loading) {
|
|
6380
7474
|
onShowInsurances();
|
|
@@ -6389,105 +7483,105 @@
|
|
|
6389
7483
|
{ value: "BETWEEN2000AND2500" /* Between2000And2500 */, displayName: "2000 - 2500" },
|
|
6390
7484
|
{ value: "OVER2500" /* Over2500 */, displayName: "2500+" }
|
|
6391
7485
|
];
|
|
6392
|
-
return /* @__PURE__ */
|
|
7486
|
+
return /* @__PURE__ */ import_react66.default.createElement(Modal_default, {
|
|
6393
7487
|
title: "F\xF6rs\xE4kring",
|
|
6394
7488
|
onClose
|
|
6395
|
-
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */
|
|
7489
|
+
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(ContentLogo, null, insuranceOptions.description && /* @__PURE__ */ import_react66.default.createElement(ContentLogoText, null, /* @__PURE__ */ import_react66.default.createElement(Content_default, null, /* @__PURE__ */ import_react66.default.createElement("p", null, insuranceOptions.description))), insuranceOptions.logotype && /* @__PURE__ */ import_react66.default.createElement(ContentLogoMedia, null, /* @__PURE__ */ import_react66.default.createElement(LogoBox_default, {
|
|
6396
7490
|
logo: insuranceOptions.logotype,
|
|
6397
7491
|
alt: insuranceOptions.name || "Logotyp",
|
|
6398
7492
|
wide: true
|
|
6399
|
-
})))), /* @__PURE__ */
|
|
7493
|
+
})))), /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react66.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react66.default.createElement(InputGroup, null, /* @__PURE__ */ import_react66.default.createElement(InputGroupColumn, null, /* @__PURE__ */ import_react66.default.createElement(InputLabel_default, {
|
|
6400
7494
|
htmlFor: "input-insurance-personalnumber"
|
|
6401
|
-
}, "Personnummer"), /* @__PURE__ */
|
|
7495
|
+
}, "Personnummer"), /* @__PURE__ */ import_react66.default.createElement(InputText_default, {
|
|
6402
7496
|
placeholder: "\xC5\xC5\xC5\xC5MMDD-XXXX",
|
|
6403
7497
|
label: "Personnummer",
|
|
6404
7498
|
value: form.ssn,
|
|
6405
7499
|
onChange: onChangeSsn,
|
|
6406
7500
|
onKeyDown,
|
|
6407
7501
|
id: "input-insurance-personalnumber"
|
|
6408
|
-
})), /* @__PURE__ */
|
|
7502
|
+
})), /* @__PURE__ */ import_react66.default.createElement(InputGroupColumn, null, /* @__PURE__ */ import_react66.default.createElement(InputLabel_default, {
|
|
6409
7503
|
htmlFor: "input-insurance-mileage"
|
|
6410
|
-
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */
|
|
7504
|
+
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */ import_react66.default.createElement(InputSelect_default, {
|
|
6411
7505
|
value: form.drivingDistance,
|
|
6412
7506
|
onChange: onChangeDrivingDistance,
|
|
6413
7507
|
options,
|
|
6414
7508
|
unit: "mil",
|
|
6415
7509
|
title: "Uppskattad k\xF6rstr\xE4cka per \xE5r"
|
|
6416
|
-
})))), /* @__PURE__ */
|
|
7510
|
+
})))), /* @__PURE__ */ import_react66.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react66.default.createElement(ButtonPrimary, {
|
|
6417
7511
|
fullWidth: true,
|
|
6418
7512
|
disabled: !ssnIsValid(form.ssn) || loading,
|
|
6419
7513
|
onClick: onShowInsurances
|
|
6420
|
-
}, /* @__PURE__ */
|
|
7514
|
+
}, /* @__PURE__ */ import_react66.default.createElement(ButtonContent, null, "Visa f\xF6rs\xE4kringar")))), false, /* @__PURE__ */ import_react66.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react66.default.createElement(Content_default, {
|
|
6421
7515
|
small: true
|
|
6422
|
-
}, /* @__PURE__ */
|
|
7516
|
+
}, /* @__PURE__ */ import_react66.default.createElement("p", null, "Spara personnummer p\xE5 denna dator f\xF6r att direkt visa f\xF6rs\xE4kringskostnaderna i Wayke. Personnumret lagras inte hos Wayke utan finns bara sparad i din webbl\xE4sare.")))), loading && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(Loader_default, null)), error && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(Snackbar_default, {
|
|
6423
7517
|
severity: "error",
|
|
6424
7518
|
icon: true,
|
|
6425
7519
|
heading: "Ett fel har intr\xE4ffat"
|
|
6426
|
-
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */
|
|
7520
|
+
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, data?.insurances && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, data?.insurances.map((insurance) => /* @__PURE__ */ import_react66.default.createElement(Repeat, {
|
|
6427
7521
|
key: insurance.name
|
|
6428
|
-
}, /* @__PURE__ */
|
|
7522
|
+
}, /* @__PURE__ */ import_react66.default.createElement(DetailBox_default, {
|
|
6429
7523
|
heading: `${numberSeparator(insurance.price)} ${insurance.unit}`,
|
|
6430
7524
|
description: insurance.name
|
|
6431
|
-
}, /* @__PURE__ */
|
|
7525
|
+
}, /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, insurance.description && /* @__PURE__ */ import_react66.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react66.default.createElement(Content_default, null, /* @__PURE__ */ import_react66.default.createElement("p", null, insurance.description)))), /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, insurance.url && /* @__PURE__ */ import_react66.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react66.default.createElement(ButtonInline, {
|
|
6432
7526
|
as: "a",
|
|
6433
7527
|
href: insurance.url || "",
|
|
6434
7528
|
target: "_blank",
|
|
6435
7529
|
rel: "noopener noreferrer nofollow"
|
|
6436
|
-
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */
|
|
7530
|
+
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(H4, null, "F\xF6rs\xE4kringen inneh\xE5ller"), insurance.items.map((item) => /* @__PURE__ */ import_react66.default.createElement(RepeatSmall, {
|
|
6437
7531
|
key: item.name || ""
|
|
6438
|
-
}, /* @__PURE__ */
|
|
7532
|
+
}, /* @__PURE__ */ import_react66.default.createElement(ExtendInfo_default, {
|
|
6439
7533
|
title: item.name || ""
|
|
6440
|
-
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */
|
|
7534
|
+
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */ import_react66.default.createElement(Repeat, null, /* @__PURE__ */ import_react66.default.createElement(H4, null, "V\xE4lj till"), insurance.addons.map((addon) => /* @__PURE__ */ import_react66.default.createElement(RepeatSmall, {
|
|
6441
7535
|
key: addon.title || ""
|
|
6442
|
-
}, /* @__PURE__ */
|
|
7536
|
+
}, /* @__PURE__ */ import_react66.default.createElement(ColumnRow, null, /* @__PURE__ */ import_react66.default.createElement(ColumnRowItem, null, /* @__PURE__ */ import_react66.default.createElement(ExtendInfo_default, {
|
|
6443
7537
|
title: addon.title || ""
|
|
6444
|
-
}, addon.description)), /* @__PURE__ */
|
|
7538
|
+
}, addon.description)), /* @__PURE__ */ import_react66.default.createElement(ColumnRowItem, null, /* @__PURE__ */ import_react66.default.createElement(UtilityTextBold, null, "+", addon.price, " ", addon.unit))))))))))));
|
|
6445
7539
|
};
|
|
6446
7540
|
var InsuranceModal_default = InsuranceModal;
|
|
6447
7541
|
|
|
6448
7542
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
6449
7543
|
var Insurance = ({ id, branch, insuranceOptions }) => {
|
|
6450
|
-
const [modal, setModal] = (0,
|
|
6451
|
-
const toggleModal = (0,
|
|
7544
|
+
const [modal, setModal] = (0, import_react67.useState)(false);
|
|
7545
|
+
const toggleModal = (0, import_react67.useCallback)(() => setModal(!modal), [modal]);
|
|
6452
7546
|
if (!insuranceOptions.length) {
|
|
6453
7547
|
return null;
|
|
6454
7548
|
}
|
|
6455
|
-
return /* @__PURE__ */
|
|
7549
|
+
return /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, modal && /* @__PURE__ */ import_react67.default.createElement(InsuranceModal_default, {
|
|
6456
7550
|
id,
|
|
6457
7551
|
branch,
|
|
6458
7552
|
onClose: toggleModal,
|
|
6459
7553
|
insuranceOptions: insuranceOptions[0]
|
|
6460
|
-
}), /* @__PURE__ */
|
|
7554
|
+
}), /* @__PURE__ */ import_react67.default.createElement(Repeat, null, /* @__PURE__ */ import_react67.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react67.default.createElement(VisualHeading, null, "V\xE4lj till f\xF6rs\xE4kring")), /* @__PURE__ */ import_react67.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react67.default.createElement(import_react67.default.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ import_react67.default.createElement(OptionBox_default, {
|
|
6461
7555
|
key: `${insuranceOption.url}-${index2}`,
|
|
6462
7556
|
logo: insuranceOption.logotype || void 0,
|
|
6463
7557
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
6464
|
-
}, /* @__PURE__ */
|
|
7558
|
+
}, /* @__PURE__ */ import_react67.default.createElement(OptionBoxHeading, null, "F\xE5 prisf\xF6rslag"), /* @__PURE__ */ import_react67.default.createElement(OptionBoxContent, null, /* @__PURE__ */ import_react67.default.createElement("p", null, /* @__PURE__ */ import_react67.default.createElement(ButtonInline, {
|
|
6465
7559
|
onClick: toggleModal
|
|
6466
7560
|
}, "Mer information")))))))));
|
|
6467
7561
|
};
|
|
6468
7562
|
var Insurance_default = Insurance;
|
|
6469
7563
|
|
|
6470
7564
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
6471
|
-
var
|
|
7565
|
+
var import_react69 = __toESM(__require("react"));
|
|
6472
7566
|
var import_marked2 = __require("marked");
|
|
6473
7567
|
|
|
6474
7568
|
// src/components/InsuranceOptions/InsuranceFreeModal.tsx
|
|
6475
|
-
var
|
|
7569
|
+
var import_react68 = __toESM(__require("react"));
|
|
6476
7570
|
var import_marked = __require("marked");
|
|
6477
7571
|
var InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
|
|
6478
|
-
return /* @__PURE__ */
|
|
7572
|
+
return /* @__PURE__ */ import_react68.default.createElement(Modal_default, {
|
|
6479
7573
|
title: insuranceOptions?.insuranceHeader ?? "F\xF6rs\xE4kring",
|
|
6480
7574
|
onClose
|
|
6481
|
-
}, insuranceOptions?.longDescription && /* @__PURE__ */
|
|
7575
|
+
}, insuranceOptions?.longDescription && /* @__PURE__ */ import_react68.default.createElement(Repeat, null, /* @__PURE__ */ import_react68.default.createElement(Content_default, {
|
|
6482
7576
|
dangerouslySetInnerHTML: {
|
|
6483
7577
|
__html: (0, import_marked.marked)(insuranceOptions.longDescription)
|
|
6484
7578
|
}
|
|
6485
|
-
})), insuranceOptions?.url && /* @__PURE__ */
|
|
7579
|
+
})), insuranceOptions?.url && /* @__PURE__ */ import_react68.default.createElement(Repeat, null, /* @__PURE__ */ import_react68.default.createElement(ButtonInline, {
|
|
6486
7580
|
as: "a",
|
|
6487
7581
|
href: insuranceOptions.url,
|
|
6488
7582
|
target: "_blank",
|
|
6489
7583
|
rel: "noopener noreferrer"
|
|
6490
|
-
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */
|
|
7584
|
+
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */ import_react68.default.createElement(Repeat, null, /* @__PURE__ */ import_react68.default.createElement(LogoBox_default, {
|
|
6491
7585
|
logo: insuranceOptions.logotype,
|
|
6492
7586
|
alt: insuranceOptions.name || "Logotyp",
|
|
6493
7587
|
wide: true
|
|
@@ -6497,23 +7591,23 @@
|
|
|
6497
7591
|
|
|
6498
7592
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
6499
7593
|
var Insurance2 = ({ insuranceOptions }) => {
|
|
6500
|
-
const [modal, setModal] = (0,
|
|
6501
|
-
const toggleModal = (0,
|
|
7594
|
+
const [modal, setModal] = (0, import_react69.useState)(false);
|
|
7595
|
+
const toggleModal = (0, import_react69.useCallback)(() => setModal(!modal), [modal]);
|
|
6502
7596
|
if (!insuranceOptions.length) {
|
|
6503
7597
|
return null;
|
|
6504
7598
|
}
|
|
6505
|
-
return /* @__PURE__ */
|
|
7599
|
+
return /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, modal && /* @__PURE__ */ import_react69.default.createElement(InsuranceFreeModal_default, {
|
|
6506
7600
|
onClose: toggleModal,
|
|
6507
7601
|
insuranceOptions: insuranceOptions[0]
|
|
6508
|
-
}), /* @__PURE__ */
|
|
7602
|
+
}), /* @__PURE__ */ import_react69.default.createElement(Repeat, null, /* @__PURE__ */ import_react69.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react69.default.createElement(VisualHeading, null, insuranceOptions[0]?.insuranceHeader ?? "F\xF6rs\xE4kring")), /* @__PURE__ */ import_react69.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ import_react69.default.createElement(OptionBox_default, {
|
|
6509
7603
|
key: `${insuranceOption.url}-${index2}`,
|
|
6510
7604
|
logo: insuranceOption.logotype || void 0,
|
|
6511
7605
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
6512
|
-
}, insuranceOption.description && /* @__PURE__ */
|
|
7606
|
+
}, insuranceOption.description && /* @__PURE__ */ import_react69.default.createElement(Content_default, {
|
|
6513
7607
|
dangerouslySetInnerHTML: {
|
|
6514
7608
|
__html: (0, import_marked2.marked)(insuranceOption.description)
|
|
6515
7609
|
}
|
|
6516
|
-
}), /* @__PURE__ */
|
|
7610
|
+
}), /* @__PURE__ */ import_react69.default.createElement(OptionBoxContent, null, /* @__PURE__ */ import_react69.default.createElement("p", null, /* @__PURE__ */ import_react69.default.createElement(ButtonInline, {
|
|
6517
7611
|
onClick: toggleModal
|
|
6518
7612
|
}, "Mer information")))))))));
|
|
6519
7613
|
};
|
|
@@ -6526,12 +7620,12 @@
|
|
|
6526
7620
|
}
|
|
6527
7621
|
if (insuranceOptions.length > 0) {
|
|
6528
7622
|
if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
|
|
6529
|
-
return /* @__PURE__ */
|
|
7623
|
+
return /* @__PURE__ */ import_react70.default.createElement(Insurance_default, {
|
|
6530
7624
|
id,
|
|
6531
7625
|
branch,
|
|
6532
7626
|
insuranceOptions
|
|
6533
7627
|
});
|
|
6534
|
-
return /* @__PURE__ */
|
|
7628
|
+
return /* @__PURE__ */ import_react70.default.createElement(InsuranceFree_default, {
|
|
6535
7629
|
insuranceOptions
|
|
6536
7630
|
});
|
|
6537
7631
|
}
|
|
@@ -6540,22 +7634,22 @@
|
|
|
6540
7634
|
var InsuranceOptions_default = InsuranceOptions;
|
|
6541
7635
|
|
|
6542
7636
|
// src/layouts/searchItem/ManufacturerPackagesOption.tsx
|
|
6543
|
-
var
|
|
7637
|
+
var import_react71 = __toESM(__require("react"));
|
|
6544
7638
|
var import_marked3 = __require("marked");
|
|
6545
7639
|
var ManufacturerPackageOption = ({ packageOption }) => {
|
|
6546
7640
|
if (!packageOption) {
|
|
6547
7641
|
return null;
|
|
6548
7642
|
}
|
|
6549
|
-
return /* @__PURE__ */
|
|
7643
|
+
return /* @__PURE__ */ import_react71.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react71.default.createElement(Repeat, null, /* @__PURE__ */ import_react71.default.createElement(H2, {
|
|
6550
7644
|
noMargin: true
|
|
6551
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
7645
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ import_react71.default.createElement(Repeat, null, /* @__PURE__ */ import_react71.default.createElement(Content_default, {
|
|
6552
7646
|
dangerouslySetInnerHTML: { __html: (0, import_marked3.marked)(packageOption.description) }
|
|
6553
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
7647
|
+
})), packageOption.link?.url && /* @__PURE__ */ import_react71.default.createElement(Repeat, null, /* @__PURE__ */ import_react71.default.createElement(ButtonInline, {
|
|
6554
7648
|
as: "a",
|
|
6555
7649
|
href: packageOption.link.url,
|
|
6556
7650
|
target: "_blank",
|
|
6557
7651
|
rel: "noopener noreferrer"
|
|
6558
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
7652
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ import_react71.default.createElement(Repeat, null, /* @__PURE__ */ import_react71.default.createElement(LogoBox_default, {
|
|
6559
7653
|
logo: packageOption.image,
|
|
6560
7654
|
alt: "Logotyp",
|
|
6561
7655
|
wide: true
|
|
@@ -6564,23 +7658,23 @@
|
|
|
6564
7658
|
var ManufacturerPackagesOption_default = ManufacturerPackageOption;
|
|
6565
7659
|
|
|
6566
7660
|
// src/layouts/searchItem/CheckList.tsx
|
|
6567
|
-
var
|
|
7661
|
+
var import_react79 = __toESM(__require("react"));
|
|
6568
7662
|
|
|
6569
7663
|
// src/components/ActionList/index.tsx
|
|
6570
|
-
var
|
|
7664
|
+
var import_react73 = __toESM(__require("react"));
|
|
6571
7665
|
|
|
6572
7666
|
// src/components/ActionList/toggle-item.tsx
|
|
6573
|
-
var
|
|
7667
|
+
var import_react72 = __toESM(__require("react"));
|
|
6574
7668
|
var initialValue = {};
|
|
6575
7669
|
var getInitialValue = (title) => title && !!initialValue[title];
|
|
6576
7670
|
var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
6577
|
-
const [visible, setVisible] = (0,
|
|
6578
|
-
const _onClickValue = (0,
|
|
7671
|
+
const [visible, setVisible] = (0, import_react72.useState)(() => getInitialValue(type));
|
|
7672
|
+
const _onClickValue = (0, import_react72.useCallback)(() => {
|
|
6579
7673
|
if (onClickValue) {
|
|
6580
7674
|
onClickValue();
|
|
6581
7675
|
}
|
|
6582
7676
|
}, []);
|
|
6583
|
-
const onClick = (0,
|
|
7677
|
+
const onClick = (0, import_react72.useCallback)(() => {
|
|
6584
7678
|
if (!visible) {
|
|
6585
7679
|
initialValue[type] = true;
|
|
6586
7680
|
setVisible(true);
|
|
@@ -6590,17 +7684,17 @@
|
|
|
6590
7684
|
}
|
|
6591
7685
|
}, [visible]);
|
|
6592
7686
|
const visibleTitle = type === "tel" ? "Ring" : type === "mailto" ? "Skicka ett mail till" : "";
|
|
6593
|
-
return /* @__PURE__ */
|
|
7687
|
+
return /* @__PURE__ */ import_react72.default.createElement(RepeatTiny, null, visible ? /* @__PURE__ */ import_react72.default.createElement(ButtonSecondary, {
|
|
6594
7688
|
onClick: _onClickValue,
|
|
6595
7689
|
as: "a",
|
|
6596
7690
|
href: `${type}:${value}`,
|
|
6597
7691
|
title: `${visibleTitle} ${value}`,
|
|
6598
7692
|
fullWidth: true
|
|
6599
|
-
}, /* @__PURE__ */
|
|
7693
|
+
}, /* @__PURE__ */ import_react72.default.createElement(ButtonContent, null, value)) : /* @__PURE__ */ import_react72.default.createElement(ButtonSecondary, {
|
|
6600
7694
|
onClick,
|
|
6601
7695
|
title,
|
|
6602
7696
|
fullWidth: true
|
|
6603
|
-
}, /* @__PURE__ */
|
|
7697
|
+
}, /* @__PURE__ */ import_react72.default.createElement(ButtonContent, null, title)));
|
|
6604
7698
|
};
|
|
6605
7699
|
var toggle_item_default = ToggleItem;
|
|
6606
7700
|
|
|
@@ -6713,18 +7807,18 @@
|
|
|
6713
7807
|
var ActionList = ({ contact, branch }) => {
|
|
6714
7808
|
const email = contact?.email || branch?.contact?.email;
|
|
6715
7809
|
const phonenumber = contact?.phonenumber || branch?.contact?.phonenumber;
|
|
6716
|
-
const onClickMailVisible = (0,
|
|
6717
|
-
const onClickPhoneVisible = (0,
|
|
6718
|
-
const onClickPhoneValue = (0,
|
|
7810
|
+
const onClickMailVisible = (0, import_react73.useCallback)(() => pubsub_default.publish("MailVisible"), []);
|
|
7811
|
+
const onClickPhoneVisible = (0, import_react73.useCallback)(() => pubsub_default.publish("PhonenumberVisible"), []);
|
|
7812
|
+
const onClickPhoneValue = (0, import_react73.useCallback)(() => pubsub_default.publish("PhonenumberCall"), []);
|
|
6719
7813
|
if (!email && !phonenumber) {
|
|
6720
7814
|
return null;
|
|
6721
7815
|
}
|
|
6722
|
-
return /* @__PURE__ */
|
|
7816
|
+
return /* @__PURE__ */ import_react73.default.createElement(import_react73.default.Fragment, null, email && /* @__PURE__ */ import_react73.default.createElement(toggle_item_default, {
|
|
6723
7817
|
onClickVisible: onClickMailVisible,
|
|
6724
7818
|
title: "Visa mailadress",
|
|
6725
7819
|
value: email,
|
|
6726
7820
|
type: "mailto"
|
|
6727
|
-
}), phonenumber && /* @__PURE__ */
|
|
7821
|
+
}), phonenumber && /* @__PURE__ */ import_react73.default.createElement(toggle_item_default, {
|
|
6728
7822
|
title: "Visa telefonnummer",
|
|
6729
7823
|
value: formatPhonenumber(phonenumber),
|
|
6730
7824
|
type: "tel",
|
|
@@ -6735,16 +7829,16 @@
|
|
|
6735
7829
|
var ActionList_default = ActionList;
|
|
6736
7830
|
|
|
6737
7831
|
// src/components/CheckMarkList/index.tsx
|
|
6738
|
-
var
|
|
7832
|
+
var import_react74 = __toESM(__require("react"));
|
|
6739
7833
|
|
|
6740
7834
|
// src/components/CheckMarkList/wrapper.tsx
|
|
6741
|
-
var
|
|
6742
|
-
var List9 =
|
|
7835
|
+
var import_styled_components52 = __toESM(__require("styled-components"));
|
|
7836
|
+
var List9 = import_styled_components52.default.ul`
|
|
6743
7837
|
list-style: none;
|
|
6744
7838
|
padding: 0;
|
|
6745
7839
|
margin: 0;
|
|
6746
7840
|
`;
|
|
6747
|
-
var
|
|
7841
|
+
var Item11 = import_styled_components52.default.li`
|
|
6748
7842
|
position: relative;
|
|
6749
7843
|
font-size: 0.875rem;
|
|
6750
7844
|
|
|
@@ -6752,7 +7846,7 @@
|
|
|
6752
7846
|
margin-top: ${size(0.5)};
|
|
6753
7847
|
}
|
|
6754
7848
|
`;
|
|
6755
|
-
var Icon6 =
|
|
7849
|
+
var Icon6 = import_styled_components52.default.div.attrs(() => ({
|
|
6756
7850
|
className: "wayke__theme wayke__color--primary-text"
|
|
6757
7851
|
}))`
|
|
6758
7852
|
position: absolute;
|
|
@@ -6760,52 +7854,52 @@
|
|
|
6760
7854
|
top: 4px; // Magic number
|
|
6761
7855
|
font-size: 0.875em;
|
|
6762
7856
|
`;
|
|
6763
|
-
var Label10 =
|
|
7857
|
+
var Label10 = import_styled_components52.default.div`
|
|
6764
7858
|
padding-left: calc(1em + ${size(1)});
|
|
6765
7859
|
`;
|
|
6766
7860
|
|
|
6767
7861
|
// src/components/CheckMarkList/index.tsx
|
|
6768
|
-
var CheckMarkListItem = ({ children }) => /* @__PURE__ */
|
|
7862
|
+
var CheckMarkListItem = ({ children }) => /* @__PURE__ */ import_react74.default.createElement(Item11, null, /* @__PURE__ */ import_react74.default.createElement(Icon6, null, /* @__PURE__ */ import_react74.default.createElement(IconCheck, {
|
|
6769
7863
|
block: true
|
|
6770
|
-
})), /* @__PURE__ */
|
|
6771
|
-
var CheckMarkList = ({ children }) => /* @__PURE__ */
|
|
7864
|
+
})), /* @__PURE__ */ import_react74.default.createElement(Label10, null, children));
|
|
7865
|
+
var CheckMarkList = ({ children }) => /* @__PURE__ */ import_react74.default.createElement(List9, null, children);
|
|
6772
7866
|
var CheckMarkList_default = CheckMarkList;
|
|
6773
7867
|
|
|
6774
7868
|
// src/components/SwitchBar/index.tsx
|
|
6775
|
-
var
|
|
7869
|
+
var import_react75 = __toESM(__require("react"));
|
|
6776
7870
|
|
|
6777
7871
|
// src/components/SwitchBar/wrapper.tsx
|
|
6778
|
-
var
|
|
6779
|
-
var
|
|
7872
|
+
var import_styled_components53 = __toESM(__require("styled-components"));
|
|
7873
|
+
var Wrapper29 = import_styled_components53.default.div`
|
|
6780
7874
|
padding: ${size(1.5)} ${size(2)};
|
|
6781
7875
|
background-color: ${(props) => props.theme.color.accentDark};
|
|
6782
7876
|
border-radius: 3px;
|
|
6783
7877
|
font-size: 0.875rem;
|
|
6784
7878
|
`;
|
|
6785
|
-
var Header6 =
|
|
7879
|
+
var Header6 = import_styled_components53.default.div`
|
|
6786
7880
|
display: flex;
|
|
6787
7881
|
align-items: center;
|
|
6788
7882
|
`;
|
|
6789
|
-
var Body5 =
|
|
7883
|
+
var Body5 = import_styled_components53.default.div`
|
|
6790
7884
|
font-size: 0.875rem;
|
|
6791
7885
|
margin-top: ${size(1)};
|
|
6792
7886
|
`;
|
|
6793
|
-
var Info3 =
|
|
7887
|
+
var Info3 = import_styled_components53.default.div`
|
|
6794
7888
|
flex: 1 1 auto;
|
|
6795
7889
|
display: flex;
|
|
6796
7890
|
align-items: center;
|
|
6797
7891
|
`;
|
|
6798
|
-
var Action7 =
|
|
7892
|
+
var Action7 = import_styled_components53.default.div`
|
|
6799
7893
|
flex-shrink: 0;
|
|
6800
7894
|
padding-left: ${size(1.5)};
|
|
6801
7895
|
font-size: 0.875rem;
|
|
6802
7896
|
`;
|
|
6803
|
-
var InfoContent =
|
|
7897
|
+
var InfoContent = import_styled_components53.default.div`
|
|
6804
7898
|
& + & {
|
|
6805
7899
|
margin-left: ${size(0.75)};
|
|
6806
7900
|
}
|
|
6807
7901
|
`;
|
|
6808
|
-
var InfoBtn2 = (0,
|
|
7902
|
+
var InfoBtn2 = (0, import_styled_components53.default)(ButtonReset).attrs(() => ({
|
|
6809
7903
|
className: "wayke__theme wayke__color--primary-text"
|
|
6810
7904
|
}))`
|
|
6811
7905
|
position: relative;
|
|
@@ -6839,7 +7933,7 @@
|
|
|
6839
7933
|
transform: scale(0.95);
|
|
6840
7934
|
}
|
|
6841
7935
|
`;
|
|
6842
|
-
var Title2 =
|
|
7936
|
+
var Title2 = import_styled_components53.default.div.attrs(() => ({
|
|
6843
7937
|
className: "wayke__theme wayke__font--bold"
|
|
6844
7938
|
}))`
|
|
6845
7939
|
font-size: 1rem;
|
|
@@ -6847,17 +7941,17 @@
|
|
|
6847
7941
|
|
|
6848
7942
|
// src/components/SwitchBar/index.tsx
|
|
6849
7943
|
var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
6850
|
-
const [info, setInfo] = (0,
|
|
6851
|
-
const onToggleInfo = (0,
|
|
6852
|
-
return /* @__PURE__ */
|
|
7944
|
+
const [info, setInfo] = (0, import_react75.useState)(false);
|
|
7945
|
+
const onToggleInfo = (0, import_react75.useCallback)(() => setInfo(!info), [info]);
|
|
7946
|
+
return /* @__PURE__ */ import_react75.default.createElement(import_react75.default.Fragment, null, /* @__PURE__ */ import_react75.default.createElement(Wrapper29, null, /* @__PURE__ */ import_react75.default.createElement(Header6, null, /* @__PURE__ */ import_react75.default.createElement(Info3, null, /* @__PURE__ */ import_react75.default.createElement(InfoContent, null, /* @__PURE__ */ import_react75.default.createElement(Title2, null, title)), children && /* @__PURE__ */ import_react75.default.createElement(InfoContent, null, /* @__PURE__ */ import_react75.default.createElement(InfoBtn2, {
|
|
6853
7947
|
onClick: onToggleInfo,
|
|
6854
7948
|
title: "Mer information"
|
|
6855
|
-
}, /* @__PURE__ */
|
|
7949
|
+
}, /* @__PURE__ */ import_react75.default.createElement(IconInfo, {
|
|
6856
7950
|
block: true
|
|
6857
|
-
})))), actionTitle && /* @__PURE__ */
|
|
7951
|
+
})))), actionTitle && /* @__PURE__ */ import_react75.default.createElement(Action7, null, /* @__PURE__ */ import_react75.default.createElement(ButtonInline, {
|
|
6858
7952
|
onClick,
|
|
6859
7953
|
title: actionTitle
|
|
6860
|
-
}, actionTitle))), body && /* @__PURE__ */
|
|
7954
|
+
}, actionTitle))), body && /* @__PURE__ */ import_react75.default.createElement(Body5, null, body)), info && /* @__PURE__ */ import_react75.default.createElement(Modal_default, {
|
|
6861
7955
|
title,
|
|
6862
7956
|
onClose: onToggleInfo
|
|
6863
7957
|
}, children));
|
|
@@ -6865,35 +7959,35 @@
|
|
|
6865
7959
|
var SwitchBar_default = SwitchBar;
|
|
6866
7960
|
|
|
6867
7961
|
// src/layouts/searchItem/BranchModal.tsx
|
|
6868
|
-
var
|
|
7962
|
+
var import_react77 = __toESM(__require("react"));
|
|
6869
7963
|
|
|
6870
7964
|
// src/State/CentralStorage/CentralStorageContext.ts
|
|
6871
|
-
var
|
|
6872
|
-
var CentralStorageContext = (0,
|
|
7965
|
+
var import_react76 = __require("react");
|
|
7966
|
+
var CentralStorageContext = (0, import_react76.createContext)({
|
|
6873
7967
|
setCentralStorageId: (_) => {
|
|
6874
7968
|
}
|
|
6875
7969
|
});
|
|
6876
7970
|
|
|
6877
7971
|
// src/layouts/searchItem/BranchModal.tsx
|
|
6878
7972
|
var BranchModal = ({ loading, connections, onClose }) => {
|
|
6879
|
-
const { centralStorageId, setCentralStorageId } = (0,
|
|
6880
|
-
const [localValue, setLocalValue] = (0,
|
|
6881
|
-
const onConfirm = (0,
|
|
7973
|
+
const { centralStorageId, setCentralStorageId } = (0, import_react77.useContext)(CentralStorageContext);
|
|
7974
|
+
const [localValue, setLocalValue] = (0, import_react77.useState)(centralStorageId);
|
|
7975
|
+
const onConfirm = (0, import_react77.useCallback)((id) => {
|
|
6882
7976
|
if (id) {
|
|
6883
7977
|
setCentralStorageId(id);
|
|
6884
7978
|
}
|
|
6885
7979
|
}, []);
|
|
6886
|
-
const onChange = (0,
|
|
7980
|
+
const onChange = (0, import_react77.useCallback)(
|
|
6887
7981
|
(e) => setLocalValue(e.currentTarget.value),
|
|
6888
7982
|
[]
|
|
6889
7983
|
);
|
|
6890
7984
|
if (!localValue) {
|
|
6891
7985
|
return null;
|
|
6892
7986
|
}
|
|
6893
|
-
return /* @__PURE__ */
|
|
7987
|
+
return /* @__PURE__ */ import_react77.default.createElement(Modal_default, {
|
|
6894
7988
|
title: "Byt anl\xE4ggning",
|
|
6895
7989
|
onClose
|
|
6896
|
-
}, /* @__PURE__ */
|
|
7990
|
+
}, /* @__PURE__ */ import_react77.default.createElement(Repeat, null, /* @__PURE__ */ import_react77.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react77.default.createElement(Content_default, null, /* @__PURE__ */ import_react77.default.createElement("p", null, "V\xE4lj den anl\xE4ggning du vill visa kontaktuppgifter f\xF6r."))), /* @__PURE__ */ import_react77.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react77.default.createElement(InputLabel_default, null, "V\xE4lj anl\xE4ggning"), /* @__PURE__ */ import_react77.default.createElement(InputSelect_default, {
|
|
6897
7991
|
value: localValue,
|
|
6898
7992
|
onChange,
|
|
6899
7993
|
options: connections?.map((x) => ({
|
|
@@ -6901,27 +7995,27 @@
|
|
|
6901
7995
|
displayName: x.name
|
|
6902
7996
|
})),
|
|
6903
7997
|
title: "V\xE4lj anl\xE4ggning"
|
|
6904
|
-
}))), /* @__PURE__ */
|
|
7998
|
+
}))), /* @__PURE__ */ import_react77.default.createElement(Repeat, null, /* @__PURE__ */ import_react77.default.createElement(ButtonPrimary, {
|
|
6905
7999
|
disabled: loading,
|
|
6906
8000
|
fullWidth: true,
|
|
6907
8001
|
onClick: () => onConfirm(localValue)
|
|
6908
|
-
}, /* @__PURE__ */
|
|
8002
|
+
}, /* @__PURE__ */ import_react77.default.createElement(ButtonContent, null, "V\xE4lj"))));
|
|
6909
8003
|
};
|
|
6910
8004
|
var BranchModal_default = BranchModal;
|
|
6911
8005
|
|
|
6912
8006
|
// src/layouts/searchItem/PackageOptionModal.tsx
|
|
6913
|
-
var
|
|
8007
|
+
var import_react78 = __toESM(__require("react"));
|
|
6914
8008
|
var import_marked4 = __require("marked");
|
|
6915
|
-
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */
|
|
8009
|
+
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */ import_react78.default.createElement(Modal_default, {
|
|
6916
8010
|
title: packageOption.title || "",
|
|
6917
8011
|
onClose
|
|
6918
|
-
}, packageOption.image && /* @__PURE__ */
|
|
8012
|
+
}, packageOption.image && /* @__PURE__ */ import_react78.default.createElement(Repeat, null, /* @__PURE__ */ import_react78.default.createElement(LogoBox_default, {
|
|
6919
8013
|
logo: packageOption.image,
|
|
6920
8014
|
alt: packageOption.title || void 0,
|
|
6921
8015
|
wide: true
|
|
6922
|
-
})), packageOption.description && /* @__PURE__ */
|
|
8016
|
+
})), packageOption.description && /* @__PURE__ */ import_react78.default.createElement(Repeat, null, /* @__PURE__ */ import_react78.default.createElement(Content_default, {
|
|
6923
8017
|
dangerouslySetInnerHTML: { __html: (0, import_marked4.marked)(packageOption.description) }
|
|
6924
|
-
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */
|
|
8018
|
+
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */ import_react78.default.createElement(Repeat, null, /* @__PURE__ */ import_react78.default.createElement(ButtonInline, {
|
|
6925
8019
|
as: "a",
|
|
6926
8020
|
href: packageOption.link.href,
|
|
6927
8021
|
target: "_blank",
|
|
@@ -6939,90 +8033,90 @@
|
|
|
6939
8033
|
toggleEcomModal,
|
|
6940
8034
|
loadingCentralStorageVehicle
|
|
6941
8035
|
}) => {
|
|
6942
|
-
const [modalBranch, setModalBranch] = (0,
|
|
6943
|
-
const openModalBranch = (0,
|
|
6944
|
-
const closeModalBranch = (0,
|
|
6945
|
-
const [modal, setModal] = (0,
|
|
6946
|
-
const onOpen = (0,
|
|
6947
|
-
const onClose = (0,
|
|
6948
|
-
(0,
|
|
8036
|
+
const [modalBranch, setModalBranch] = (0, import_react79.useState)(false);
|
|
8037
|
+
const openModalBranch = (0, import_react79.useCallback)(() => setModalBranch(true), []);
|
|
8038
|
+
const closeModalBranch = (0, import_react79.useCallback)(() => setModalBranch(false), []);
|
|
8039
|
+
const [modal, setModal] = (0, import_react79.useState)();
|
|
8040
|
+
const onOpen = (0, import_react79.useCallback)((nextModal) => setModal(nextModal), []);
|
|
8041
|
+
const onClose = (0, import_react79.useCallback)(() => setModal(void 0), []);
|
|
8042
|
+
(0, import_react79.useEffect)(() => {
|
|
6949
8043
|
if ((branch || contact) && modalBranch) {
|
|
6950
8044
|
setModalBranch(false);
|
|
6951
8045
|
}
|
|
6952
8046
|
}, [branch, contact]);
|
|
6953
8047
|
const packageOption = manufacturer?.packageOption;
|
|
6954
|
-
return /* @__PURE__ */
|
|
8048
|
+
return /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, modalBranch && /* @__PURE__ */ import_react79.default.createElement(BranchModal_default, {
|
|
6955
8049
|
loading: loadingCentralStorageVehicle,
|
|
6956
8050
|
connections: branch?.connections,
|
|
6957
8051
|
onClose: closeModalBranch
|
|
6958
|
-
}), modal && /* @__PURE__ */
|
|
8052
|
+
}), modal && /* @__PURE__ */ import_react79.default.createElement(PackageOptionModal_default, {
|
|
6959
8053
|
packageOption: modal,
|
|
6960
8054
|
onClose
|
|
6961
|
-
}), /* @__PURE__ */
|
|
8055
|
+
}), /* @__PURE__ */ import_react79.default.createElement(Repeat, null, /* @__PURE__ */ import_react79.default.createElement(CheckMarkList_default, null, packageOption?.title && /* @__PURE__ */ import_react79.default.createElement(CheckMarkListItem, null, /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, "Inkl.", " ", /* @__PURE__ */ import_react79.default.createElement(ButtonInline, {
|
|
6962
8056
|
onClick: () => onOpen({
|
|
6963
8057
|
title: packageOption?.title,
|
|
6964
8058
|
image: packageOption?.image,
|
|
6965
8059
|
description: packageOption?.description,
|
|
6966
8060
|
link: packageOption?.link
|
|
6967
8061
|
})
|
|
6968
|
-
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */
|
|
8062
|
+
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */ import_react79.default.createElement(CheckMarkListItem, {
|
|
6969
8063
|
key: packageOption2.title || index2
|
|
6970
|
-
}, /* @__PURE__ */
|
|
8064
|
+
}, /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, "Inkl.", " ", /* @__PURE__ */ import_react79.default.createElement(ButtonInline, {
|
|
6971
8065
|
onClick: () => onOpen({
|
|
6972
8066
|
title: packageOption2?.title,
|
|
6973
8067
|
image: packageOption2?.image,
|
|
6974
8068
|
description: packageOption2?.description,
|
|
6975
8069
|
link: packageOption2?.link
|
|
6976
8070
|
})
|
|
6977
|
-
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */
|
|
8071
|
+
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */ import_react79.default.createElement(CheckMarkListItem, null, "Hemleverans"))), /* @__PURE__ */ import_react79.default.createElement(Repeat, null, ecommerce && ecommerce.enabled && /* @__PURE__ */ import_react79.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react79.default.createElement(ButtonPrimary, {
|
|
6978
8072
|
disabled: !!ecommerce.reserved,
|
|
6979
8073
|
fullWidth: true,
|
|
6980
8074
|
onClick: toggleEcomModal
|
|
6981
|
-
}, /* @__PURE__ */
|
|
8075
|
+
}, /* @__PURE__ */ import_react79.default.createElement(ButtonContent, null, "K\xF6p bilen online"))), ecommerce?.reserved && /* @__PURE__ */ import_react79.default.createElement(RepeatTiny, null, /* @__PURE__ */ import_react79.default.createElement(SwitchBar_default, {
|
|
6982
8076
|
title: "Bilen \xE4r reserverad",
|
|
6983
8077
|
body: "Denna bil \xE4r reserverad av en annan k\xF6pare."
|
|
6984
|
-
}, /* @__PURE__ */
|
|
8078
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Content_default, null, /* @__PURE__ */ import_react79.default.createElement("p", null, "Denna bil \xE4r reserverad av en annan k\xF6pare.")))), /* @__PURE__ */ import_react79.default.createElement(ActionList_default, {
|
|
6985
8079
|
branch,
|
|
6986
8080
|
contact
|
|
6987
|
-
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */
|
|
8081
|
+
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */ import_react79.default.createElement(Repeat, null, /* @__PURE__ */ import_react79.default.createElement(SwitchBar_default, {
|
|
6988
8082
|
title: "Centrallagerbil",
|
|
6989
8083
|
actionTitle: "Byt anl\xE4ggning",
|
|
6990
8084
|
onClick: openModalBranch
|
|
6991
|
-
}, /* @__PURE__ */
|
|
8085
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Content_default, null, /* @__PURE__ */ import_react79.default.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar. Byt anl\xE4ggning f\xF6r att visa kontaktuppgifter till just den anl\xE4ggningen.")))));
|
|
6992
8086
|
};
|
|
6993
8087
|
var CheckList_default = CheckList;
|
|
6994
8088
|
|
|
6995
8089
|
// src/layouts/searchItem/Related.tsx
|
|
6996
|
-
var
|
|
8090
|
+
var import_react83 = __toESM(__require("react"));
|
|
6997
8091
|
|
|
6998
8092
|
// src/components/SectionHeader/index.tsx
|
|
6999
|
-
var
|
|
8093
|
+
var import_react80 = __toESM(__require("react"));
|
|
7000
8094
|
|
|
7001
8095
|
// src/components/SectionHeader/wrapper.tsx
|
|
7002
|
-
var
|
|
7003
|
-
var
|
|
8096
|
+
var import_styled_components54 = __toESM(__require("styled-components"));
|
|
8097
|
+
var Wrapper30 = import_styled_components54.default.div`
|
|
7004
8098
|
display: flex;
|
|
7005
8099
|
align-items: center;
|
|
7006
8100
|
`;
|
|
7007
|
-
var Heading7 =
|
|
8101
|
+
var Heading7 = import_styled_components54.default.div`
|
|
7008
8102
|
flex: 1 1 auto;
|
|
7009
8103
|
`;
|
|
7010
|
-
var Action8 =
|
|
8104
|
+
var Action8 = import_styled_components54.default.div`
|
|
7011
8105
|
flex-shrink: 0;
|
|
7012
8106
|
padding-left: ${size(2)};
|
|
7013
8107
|
`;
|
|
7014
8108
|
|
|
7015
8109
|
// src/components/SectionHeader/index.tsx
|
|
7016
|
-
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */
|
|
8110
|
+
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */ import_react80.default.createElement(Wrapper30, null, /* @__PURE__ */ import_react80.default.createElement(Heading7, null, children), onClick && actionTitle && /* @__PURE__ */ import_react80.default.createElement(Action8, null, /* @__PURE__ */ import_react80.default.createElement(ButtonClear, {
|
|
7017
8111
|
as: "a",
|
|
7018
8112
|
href: "#",
|
|
7019
8113
|
onClick
|
|
7020
|
-
}, /* @__PURE__ */
|
|
8114
|
+
}, /* @__PURE__ */ import_react80.default.createElement(ButtonContent, null, actionTitle))));
|
|
7021
8115
|
var SectionHeader_default = SectionHeader;
|
|
7022
8116
|
|
|
7023
8117
|
// src/components/OverflowGrid/index.tsx
|
|
7024
|
-
var
|
|
7025
|
-
var OverflowGrid =
|
|
8118
|
+
var import_styled_components55 = __toESM(__require("styled-components"));
|
|
8119
|
+
var OverflowGrid = import_styled_components55.default.div`
|
|
7026
8120
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
7027
8121
|
${Wrapper} & {
|
|
7028
8122
|
margin-left: ${size(-3)};
|
|
@@ -7037,7 +8131,7 @@
|
|
|
7037
8131
|
}
|
|
7038
8132
|
}
|
|
7039
8133
|
`;
|
|
7040
|
-
var OverflowGridList =
|
|
8134
|
+
var OverflowGridList = import_styled_components55.default.ul`
|
|
7041
8135
|
display: flex;
|
|
7042
8136
|
align-items: flex-start;
|
|
7043
8137
|
list-style: none;
|
|
@@ -7069,7 +8163,7 @@
|
|
|
7069
8163
|
}
|
|
7070
8164
|
}
|
|
7071
8165
|
`;
|
|
7072
|
-
var OverflowGridItem =
|
|
8166
|
+
var OverflowGridItem = import_styled_components55.default.li`
|
|
7073
8167
|
flex: 1 0 auto;
|
|
7074
8168
|
width: calc(100% - ${size(2)});
|
|
7075
8169
|
max-width: calc(100% - ${size(2)});
|
|
@@ -7087,11 +8181,11 @@
|
|
|
7087
8181
|
`;
|
|
7088
8182
|
|
|
7089
8183
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
7090
|
-
var
|
|
8184
|
+
var import_react82 = __require("react");
|
|
7091
8185
|
|
|
7092
8186
|
// src/State/RelatedSearch/RelatedSearchContext.ts
|
|
7093
|
-
var
|
|
7094
|
-
var RelatedSearchContext = (0,
|
|
8187
|
+
var import_react81 = __require("react");
|
|
8188
|
+
var RelatedSearchContext = (0, import_react81.createContext)({
|
|
7095
8189
|
moreLikeThisUrl: false,
|
|
7096
8190
|
loading: false,
|
|
7097
8191
|
error: false,
|
|
@@ -7102,8 +8196,8 @@
|
|
|
7102
8196
|
|
|
7103
8197
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
7104
8198
|
var useRelatedSearch = (id) => {
|
|
7105
|
-
const data = (0,
|
|
7106
|
-
(0,
|
|
8199
|
+
const data = (0, import_react82.useContext)(RelatedSearchContext);
|
|
8200
|
+
(0, import_react82.useEffect)(() => {
|
|
7107
8201
|
const searchParams = new URLSearchParams();
|
|
7108
8202
|
searchParams.set("hits", "3");
|
|
7109
8203
|
if (data.moreLikeThisUrl && id) {
|
|
@@ -7129,7 +8223,7 @@
|
|
|
7129
8223
|
// src/layouts/searchItem/Related.tsx
|
|
7130
8224
|
var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
7131
8225
|
const { loading, response, moreLikeThisUrl } = useRelatedSearch_default(id);
|
|
7132
|
-
const onItemClicked = (0,
|
|
8226
|
+
const onItemClicked = (0, import_react83.useCallback)((id2) => {
|
|
7133
8227
|
pubsub_default.publish("ItemClicked", id2);
|
|
7134
8228
|
if (onClickSearchItem) {
|
|
7135
8229
|
onClickSearchItem(id2);
|
|
@@ -7139,30 +8233,30 @@
|
|
|
7139
8233
|
return null;
|
|
7140
8234
|
}
|
|
7141
8235
|
if (loading) {
|
|
7142
|
-
return /* @__PURE__ */
|
|
8236
|
+
return /* @__PURE__ */ import_react83.default.createElement(Loader_default, null);
|
|
7143
8237
|
}
|
|
7144
|
-
return /* @__PURE__ */
|
|
8238
|
+
return /* @__PURE__ */ import_react83.default.createElement(PageSection, {
|
|
7145
8239
|
accent: true,
|
|
7146
8240
|
large: true,
|
|
7147
8241
|
className: "wayke__theme wayke__color--accent-bg"
|
|
7148
|
-
}, /* @__PURE__ */
|
|
8242
|
+
}, /* @__PURE__ */ import_react83.default.createElement(Container_default, null, moreLikeThisUrl ? /* @__PURE__ */ import_react83.default.createElement(Repeat, null, /* @__PURE__ */ import_react83.default.createElement(SectionHeader_default, {
|
|
7149
8243
|
onClick: () => {
|
|
7150
8244
|
}
|
|
7151
|
-
}, /* @__PURE__ */
|
|
8245
|
+
}, /* @__PURE__ */ import_react83.default.createElement(H2, {
|
|
7152
8246
|
noMargin: true
|
|
7153
|
-
}, "Relaterade fordon"))) : /* @__PURE__ */
|
|
8247
|
+
}, "Relaterade fordon"))) : /* @__PURE__ */ import_react83.default.createElement(Repeat, null, /* @__PURE__ */ import_react83.default.createElement(SectionHeader_default, {
|
|
7154
8248
|
onClick: () => {
|
|
7155
8249
|
},
|
|
7156
8250
|
actionTitle: "Visa alla"
|
|
7157
|
-
}, /* @__PURE__ */
|
|
8251
|
+
}, /* @__PURE__ */ import_react83.default.createElement(H2, {
|
|
7158
8252
|
noMargin: true
|
|
7159
|
-
}, "Senast inkomna"))), /* @__PURE__ */
|
|
8253
|
+
}, "Senast inkomna"))), /* @__PURE__ */ import_react83.default.createElement(Repeat, null, /* @__PURE__ */ import_react83.default.createElement(OverflowGrid, null, /* @__PURE__ */ import_react83.default.createElement(OverflowGridList, null, response?.documentList.documents.map((document2) => {
|
|
7160
8254
|
const prefix = pathRoute ? `/${pathRoute}` : "/";
|
|
7161
8255
|
const r = regexPathGuid(pathRoute);
|
|
7162
8256
|
const pathRouteUrl = window.location.pathname === "/" ? `${prefix}${document2._id}` : r.test(`${pathRoute}${id}`) ? window.location.pathname.replace(r, `${pathRoute}${document2._id}`) : `${window.location.pathname}${prefix}${document2._id}`;
|
|
7163
|
-
return /* @__PURE__ */
|
|
8257
|
+
return /* @__PURE__ */ import_react83.default.createElement(OverflowGridItem, {
|
|
7164
8258
|
key: document2._id
|
|
7165
|
-
}, /* @__PURE__ */
|
|
8259
|
+
}, /* @__PURE__ */ import_react83.default.createElement(ProductCard_default, {
|
|
7166
8260
|
id: document2._id,
|
|
7167
8261
|
onClick: onItemClicked,
|
|
7168
8262
|
title: document2.title,
|
|
@@ -7192,24 +8286,24 @@
|
|
|
7192
8286
|
var Related_default = Related;
|
|
7193
8287
|
|
|
7194
8288
|
// src/layouts/searchItem/PackageOptions.tsx
|
|
7195
|
-
var
|
|
8289
|
+
var import_react84 = __toESM(__require("react"));
|
|
7196
8290
|
var import_marked5 = __require("marked");
|
|
7197
8291
|
var PackageOptions = ({ packageOptions }) => {
|
|
7198
8292
|
if (!packageOptions) {
|
|
7199
8293
|
return null;
|
|
7200
8294
|
}
|
|
7201
|
-
return /* @__PURE__ */
|
|
8295
|
+
return /* @__PURE__ */ import_react84.default.createElement(import_react84.default.Fragment, null, packageOptions.map((packageOption, index2) => /* @__PURE__ */ import_react84.default.createElement(ProductPageMainSection, {
|
|
7202
8296
|
key: packageOption.title || index2
|
|
7203
|
-
}, /* @__PURE__ */
|
|
8297
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Repeat, null, /* @__PURE__ */ import_react84.default.createElement(H2, {
|
|
7204
8298
|
noMargin: true
|
|
7205
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
8299
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ import_react84.default.createElement(Repeat, null, /* @__PURE__ */ import_react84.default.createElement(Content_default, {
|
|
7206
8300
|
dangerouslySetInnerHTML: { __html: (0, import_marked5.marked)(packageOption.description) }
|
|
7207
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
8301
|
+
})), packageOption.link?.url && /* @__PURE__ */ import_react84.default.createElement(Repeat, null, /* @__PURE__ */ import_react84.default.createElement(ButtonInline, {
|
|
7208
8302
|
as: "a",
|
|
7209
8303
|
href: packageOption.link.url,
|
|
7210
8304
|
target: "_blank",
|
|
7211
8305
|
rel: "noopener noreferrer"
|
|
7212
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
8306
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ import_react84.default.createElement(Repeat, null, /* @__PURE__ */ import_react84.default.createElement(LogoBox_default, {
|
|
7213
8307
|
logo: packageOption.image,
|
|
7214
8308
|
alt: "Logotyp",
|
|
7215
8309
|
wide: true
|
|
@@ -7218,31 +8312,31 @@
|
|
|
7218
8312
|
var PackageOptions_default = PackageOptions;
|
|
7219
8313
|
|
|
7220
8314
|
// src/layouts/searchItem/Branch.tsx
|
|
7221
|
-
var
|
|
8315
|
+
var import_react91 = __toESM(__require("react"));
|
|
7222
8316
|
|
|
7223
8317
|
// src/components/TableColumn/index.tsx
|
|
7224
|
-
var
|
|
7225
|
-
var TableColumn =
|
|
8318
|
+
var import_styled_components56 = __toESM(__require("styled-components"));
|
|
8319
|
+
var TableColumn = import_styled_components56.default.div`
|
|
7226
8320
|
line-height: 1.2;
|
|
7227
8321
|
`;
|
|
7228
|
-
var TableColumnRow =
|
|
8322
|
+
var TableColumnRow = import_styled_components56.default.div`
|
|
7229
8323
|
display: flex;
|
|
7230
8324
|
align-items: flex-start;
|
|
7231
8325
|
margin: ${size(-1)};
|
|
7232
8326
|
`;
|
|
7233
|
-
var TableColumnCell =
|
|
8327
|
+
var TableColumnCell = import_styled_components56.default.div`
|
|
7234
8328
|
flex: 1 0 50%;
|
|
7235
8329
|
padding: ${size(1)};
|
|
7236
8330
|
`;
|
|
7237
8331
|
|
|
7238
8332
|
// src/components/OpeningHours/index.tsx
|
|
7239
|
-
var
|
|
8333
|
+
var import_react86 = __toESM(__require("react"));
|
|
7240
8334
|
|
|
7241
8335
|
// src/components/Badge/index.tsx
|
|
7242
|
-
var
|
|
8336
|
+
var import_react85 = __toESM(__require("react"));
|
|
7243
8337
|
|
|
7244
8338
|
// src/components/Badge/wrapper.tsx
|
|
7245
|
-
var
|
|
8339
|
+
var import_styled_components57 = __toESM(__require("styled-components"));
|
|
7246
8340
|
var getBg = (severity) => {
|
|
7247
8341
|
let bg = theme_default.color.textDark;
|
|
7248
8342
|
if (severity === "positive") {
|
|
@@ -7252,7 +8346,7 @@
|
|
|
7252
8346
|
}
|
|
7253
8347
|
return bg;
|
|
7254
8348
|
};
|
|
7255
|
-
var
|
|
8349
|
+
var Wrapper31 = import_styled_components57.default.div.attrs(() => ({
|
|
7256
8350
|
className: "wayke__theme wayke__font--bold"
|
|
7257
8351
|
}))`
|
|
7258
8352
|
display: inline-block;
|
|
@@ -7265,7 +8359,7 @@
|
|
|
7265
8359
|
`;
|
|
7266
8360
|
|
|
7267
8361
|
// src/components/Badge/index.tsx
|
|
7268
|
-
var Badge = ({ label, severity }) => /* @__PURE__ */
|
|
8362
|
+
var Badge = ({ label, severity }) => /* @__PURE__ */ import_react85.default.createElement(Wrapper31, {
|
|
7269
8363
|
severity
|
|
7270
8364
|
}, label);
|
|
7271
8365
|
var Badge_default = Badge;
|
|
@@ -7329,11 +8423,11 @@
|
|
|
7329
8423
|
return new Date().setHours(splitted[0], splitted[1]).valueOf();
|
|
7330
8424
|
};
|
|
7331
8425
|
var OpeningHours = ({ openingHours }) => {
|
|
7332
|
-
const today = (0,
|
|
8426
|
+
const today = (0, import_react86.useMemo)(
|
|
7333
8427
|
() => openingHours ? GetOpeningHoursToday(openingHours) : null,
|
|
7334
8428
|
[openingHours]
|
|
7335
8429
|
);
|
|
7336
|
-
const currentlyOpen = (0,
|
|
8430
|
+
const currentlyOpen = (0, import_react86.useMemo)(() => {
|
|
7337
8431
|
try {
|
|
7338
8432
|
if (today?.from && today?.until) {
|
|
7339
8433
|
const currentDate = new Date().valueOf();
|
|
@@ -7345,60 +8439,60 @@
|
|
|
7345
8439
|
return false;
|
|
7346
8440
|
}
|
|
7347
8441
|
}, [today]);
|
|
7348
|
-
const oh = (0,
|
|
8442
|
+
const oh = (0, import_react86.useMemo)(() => openingHours ? GetOpeningHours(openingHours) : null, [openingHours]);
|
|
7349
8443
|
if (!oh) {
|
|
7350
8444
|
return null;
|
|
7351
8445
|
}
|
|
7352
|
-
return /* @__PURE__ */
|
|
8446
|
+
return /* @__PURE__ */ import_react86.default.createElement(import_react86.default.Fragment, null, /* @__PURE__ */ import_react86.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react86.default.createElement(Badge_default, {
|
|
7353
8447
|
label: currentlyOpen ? "\xD6ppet" : "St\xE4ngt",
|
|
7354
8448
|
severity: currentlyOpen ? "positive" : "negative"
|
|
7355
|
-
})), /* @__PURE__ */
|
|
8449
|
+
})), /* @__PURE__ */ import_react86.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react86.default.createElement(TableColumn, null, /* @__PURE__ */ import_react86.default.createElement(TableColumnRow, null, /* @__PURE__ */ import_react86.default.createElement(TableColumnCell, null, /* @__PURE__ */ import_react86.default.createElement(UtilityTextBold, null, today?.title)), /* @__PURE__ */ import_react86.default.createElement(TableColumnCell, null, /* @__PURE__ */ import_react86.default.createElement(UtilityTextBold, null, today?.from ? `${today.from}-${today.until}` : "St\xE4ngt"))), oh.map((o) => /* @__PURE__ */ import_react86.default.createElement(TableColumnRow, {
|
|
7356
8450
|
key: o.titleFrom
|
|
7357
|
-
}, /* @__PURE__ */
|
|
8451
|
+
}, /* @__PURE__ */ import_react86.default.createElement(TableColumnCell, null, o.titleTo ? `${o.titleFrom}-${o.titleTo}` : o.titleFrom), /* @__PURE__ */ import_react86.default.createElement(TableColumnCell, null, o.from ? `${o.from}-${o.until}` : "St\xE4ngt"))))));
|
|
7358
8452
|
};
|
|
7359
8453
|
var OpeningHours_default = OpeningHours;
|
|
7360
8454
|
|
|
7361
8455
|
// src/components/PhoneNumber/index.tsx
|
|
7362
|
-
var
|
|
8456
|
+
var import_react87 = __toESM(__require("react"));
|
|
7363
8457
|
var PhoneNumber = ({ phoneNumber }) => {
|
|
7364
|
-
const [visible, setVisible] = (0,
|
|
7365
|
-
const onClick = (0,
|
|
7366
|
-
return /* @__PURE__ */
|
|
8458
|
+
const [visible, setVisible] = (0, import_react87.useState)(false);
|
|
8459
|
+
const onClick = (0, import_react87.useCallback)(() => !visible && setVisible(true), [visible]);
|
|
8460
|
+
return /* @__PURE__ */ import_react87.default.createElement(TableColumnRow, null, /* @__PURE__ */ import_react87.default.createElement(TableColumnCell, null, "Telefonnummer"), /* @__PURE__ */ import_react87.default.createElement(TableColumnCell, null, visible ? /* @__PURE__ */ import_react87.default.createElement(ButtonInlineBold, {
|
|
7367
8461
|
as: "a",
|
|
7368
8462
|
href: `tel:${phoneNumber}`,
|
|
7369
8463
|
title: `Ring ${phoneNumber}`
|
|
7370
|
-
}, /* @__PURE__ */
|
|
8464
|
+
}, /* @__PURE__ */ import_react87.default.createElement(ButtonContent, null, phoneNumber)) : /* @__PURE__ */ import_react87.default.createElement(ButtonInlineBold, {
|
|
7371
8465
|
onClick,
|
|
7372
8466
|
title: "Visa telefonnummer"
|
|
7373
|
-
}, /* @__PURE__ */
|
|
8467
|
+
}, /* @__PURE__ */ import_react87.default.createElement(ButtonContent, null, "Visa telefonnummer"))));
|
|
7374
8468
|
};
|
|
7375
8469
|
var PhoneNumber_default = PhoneNumber;
|
|
7376
8470
|
|
|
7377
8471
|
// src/components/Map/index.tsx
|
|
7378
|
-
var
|
|
8472
|
+
var import_react90 = __toESM(__require("react"));
|
|
7379
8473
|
|
|
7380
8474
|
// src/State/Settings/useSettings.ts
|
|
7381
|
-
var
|
|
8475
|
+
var import_react89 = __require("react");
|
|
7382
8476
|
|
|
7383
8477
|
// src/State/Settings/SettingsContext.ts
|
|
7384
|
-
var
|
|
7385
|
-
var SettingsContext = (0,
|
|
8478
|
+
var import_react88 = __require("react");
|
|
8479
|
+
var SettingsContext = (0, import_react88.createContext)({});
|
|
7386
8480
|
|
|
7387
8481
|
// src/State/Settings/useSettings.ts
|
|
7388
|
-
var useSettings = () => (0,
|
|
8482
|
+
var useSettings = () => (0, import_react89.useContext)(SettingsContext);
|
|
7389
8483
|
var useSettings_default = useSettings;
|
|
7390
8484
|
|
|
7391
8485
|
// src/components/Map/wrapper.tsx
|
|
7392
|
-
var
|
|
7393
|
-
var
|
|
8486
|
+
var import_styled_components58 = __toESM(__require("styled-components"));
|
|
8487
|
+
var Wrapper32 = import_styled_components58.default.a`
|
|
7394
8488
|
display: block;
|
|
7395
8489
|
`;
|
|
7396
|
-
var
|
|
8490
|
+
var Image4 = import_styled_components58.default.img`
|
|
7397
8491
|
display: block;
|
|
7398
8492
|
width: 100%;
|
|
7399
8493
|
border-radius: 3px;
|
|
7400
8494
|
`;
|
|
7401
|
-
var Placeholder =
|
|
8495
|
+
var Placeholder = import_styled_components58.default.a`
|
|
7402
8496
|
display: block;
|
|
7403
8497
|
position: relative;
|
|
7404
8498
|
width: 100%;
|
|
@@ -7408,7 +8502,7 @@
|
|
|
7408
8502
|
border-radius: 3px;
|
|
7409
8503
|
color: ${(props) => props.theme.color.textDark};
|
|
7410
8504
|
`;
|
|
7411
|
-
var PlaceholderAction =
|
|
8505
|
+
var PlaceholderAction = import_styled_components58.default.div`
|
|
7412
8506
|
position: absolute;
|
|
7413
8507
|
top: 50%;
|
|
7414
8508
|
left: 50%;
|
|
@@ -7418,8 +8512,8 @@
|
|
|
7418
8512
|
// src/components/Map/index.tsx
|
|
7419
8513
|
var StaticMap = ({ position }) => {
|
|
7420
8514
|
const { googleMapsApiKey, googleMapsMarker } = useSettings_default();
|
|
7421
|
-
const [visible, setVisible] = (0,
|
|
7422
|
-
const onShowMap = (0,
|
|
8515
|
+
const [visible, setVisible] = (0, import_react90.useState)(false);
|
|
8516
|
+
const onShowMap = (0, import_react90.useCallback)((e) => {
|
|
7423
8517
|
if (googleMapsApiKey) {
|
|
7424
8518
|
e.preventDefault();
|
|
7425
8519
|
setVisible(true);
|
|
@@ -7430,33 +8524,33 @@
|
|
|
7430
8524
|
}
|
|
7431
8525
|
const { latitude, longitude } = position;
|
|
7432
8526
|
if (visible && googleMapsApiKey) {
|
|
7433
|
-
return /* @__PURE__ */
|
|
8527
|
+
return /* @__PURE__ */ import_react90.default.createElement(Wrapper32, {
|
|
7434
8528
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
7435
8529
|
title: "Visa p\xE5 Google Maps",
|
|
7436
8530
|
target: "_blank",
|
|
7437
8531
|
rel: "nofollow noopener noreferrer"
|
|
7438
|
-
}, /* @__PURE__ */
|
|
8532
|
+
}, /* @__PURE__ */ import_react90.default.createElement(Image4, {
|
|
7439
8533
|
src: `https://maps.googleapis.com/maps/api/staticmap?center=${latitude},${longitude}&zoom=10&size=640x280&maptype=roadmap&markers=${googleMapsMarker ? `icon:${encodeURIComponent(googleMapsMarker)}` : ""}%7C${latitude},${longitude}&key=${googleMapsApiKey}`,
|
|
7440
8534
|
alt: "Karta"
|
|
7441
8535
|
}));
|
|
7442
8536
|
}
|
|
7443
|
-
return /* @__PURE__ */
|
|
8537
|
+
return /* @__PURE__ */ import_react90.default.createElement(Placeholder, {
|
|
7444
8538
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
7445
8539
|
target: "_blank",
|
|
7446
8540
|
rel: "noopener noreferrer nofollow",
|
|
7447
8541
|
onClick: onShowMap
|
|
7448
|
-
}, /* @__PURE__ */
|
|
8542
|
+
}, /* @__PURE__ */ import_react90.default.createElement(PlaceholderAction, null, /* @__PURE__ */ import_react90.default.createElement(ButtonSecondary, {
|
|
7449
8543
|
as: "div"
|
|
7450
|
-
}, /* @__PURE__ */
|
|
8544
|
+
}, /* @__PURE__ */ import_react90.default.createElement(ButtonContent, null, "Visa karta"))));
|
|
7451
8545
|
};
|
|
7452
8546
|
var Map_default = StaticMap;
|
|
7453
8547
|
|
|
7454
8548
|
// src/layouts/searchItem/Branch.tsx
|
|
7455
8549
|
var Branch2 = ({ branch, loading }) => {
|
|
7456
|
-
const [modal, setModal] = (0,
|
|
7457
|
-
const openModal = (0,
|
|
7458
|
-
const closeModal = (0,
|
|
7459
|
-
(0,
|
|
8550
|
+
const [modal, setModal] = (0, import_react91.useState)(false);
|
|
8551
|
+
const openModal = (0, import_react91.useCallback)(() => setModal(true), []);
|
|
8552
|
+
const closeModal = (0, import_react91.useCallback)(() => setModal(false), []);
|
|
8553
|
+
(0, import_react91.useEffect)(() => {
|
|
7460
8554
|
if (branch && modal) {
|
|
7461
8555
|
setModal(false);
|
|
7462
8556
|
}
|
|
@@ -7464,29 +8558,29 @@
|
|
|
7464
8558
|
if (!branch) {
|
|
7465
8559
|
return null;
|
|
7466
8560
|
}
|
|
7467
|
-
return /* @__PURE__ */
|
|
8561
|
+
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, modal && /* @__PURE__ */ import_react91.default.createElement(BranchModal_default, {
|
|
7468
8562
|
loading,
|
|
7469
8563
|
connections: branch?.connections,
|
|
7470
8564
|
onClose: closeModal
|
|
7471
|
-
}), /* @__PURE__ */
|
|
8565
|
+
}), /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(H2, {
|
|
7472
8566
|
noMargin: true
|
|
7473
|
-
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */
|
|
8567
|
+
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(Map_default, {
|
|
7474
8568
|
position: branch?.location?.position
|
|
7475
|
-
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */
|
|
8569
|
+
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(Content_default, null, /* @__PURE__ */ import_react91.default.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar.", " ", /* @__PURE__ */ import_react91.default.createElement(ButtonInline, {
|
|
7476
8570
|
as: "span",
|
|
7477
8571
|
role: "button",
|
|
7478
8572
|
onClick: openModal,
|
|
7479
8573
|
inline: true
|
|
7480
|
-
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */
|
|
8574
|
+
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(ProductPageContentLimit, null, /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(TableColumn, null, branch?.location?.streetAddress && branch?.location?.city && /* @__PURE__ */ import_react91.default.createElement(TableColumnRow, null, /* @__PURE__ */ import_react91.default.createElement(TableColumnCell, null, "Adress"), /* @__PURE__ */ import_react91.default.createElement(TableColumnCell, null, /* @__PURE__ */ import_react91.default.createElement(ButtonInlineBold, null, /* @__PURE__ */ import_react91.default.createElement(ButtonContent, null, `${branch?.location?.streetAddress}, ${branch?.location?.city}`)))), branch?.contact?.phonenumber && /* @__PURE__ */ import_react91.default.createElement(PhoneNumber_default, {
|
|
7481
8575
|
phoneNumber: formatPhonenumber(branch.contact.phonenumber)
|
|
7482
|
-
}))), branch?.openingHours && /* @__PURE__ */
|
|
8576
|
+
}))), branch?.openingHours && /* @__PURE__ */ import_react91.default.createElement(Repeat, null, /* @__PURE__ */ import_react91.default.createElement(OpeningHours_default, {
|
|
7483
8577
|
openingHours: branch.openingHours
|
|
7484
8578
|
})))));
|
|
7485
8579
|
};
|
|
7486
8580
|
var Branch_default = Branch2;
|
|
7487
8581
|
|
|
7488
8582
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
7489
|
-
var
|
|
8583
|
+
var import_react92 = __require("react");
|
|
7490
8584
|
|
|
7491
8585
|
// src/hooks/useSearchItemBranch.ts
|
|
7492
8586
|
var import_client8 = __require("@apollo/client");
|
|
@@ -7619,11 +8713,11 @@
|
|
|
7619
8713
|
|
|
7620
8714
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
7621
8715
|
var useCentralStorage = (vehicle) => {
|
|
7622
|
-
const { centralStorageId, setCentralStorageId } = (0,
|
|
8716
|
+
const { centralStorageId, setCentralStorageId } = (0, import_react92.useContext)(CentralStorageContext);
|
|
7623
8717
|
const connections = vehicle?.branch?.connections;
|
|
7624
8718
|
const branchId = centralStorageId ? connections?.find((x) => x.id === centralStorageId)?.id : void 0;
|
|
7625
8719
|
const { data, loading } = useSearchItemBranch_default(vehicle?.id, branchId);
|
|
7626
|
-
(0,
|
|
8720
|
+
(0, import_react92.useEffect)(() => {
|
|
7627
8721
|
if ((connections?.length || 0) > 0) {
|
|
7628
8722
|
const match = centralStorageId ? connections?.find((x) => x.id === centralStorageId) : void 0;
|
|
7629
8723
|
if (!match) {
|
|
@@ -7642,23 +8736,23 @@
|
|
|
7642
8736
|
var useCentralStorage_default = useCentralStorage;
|
|
7643
8737
|
|
|
7644
8738
|
// src/layouts/searchItem/Page404.tsx
|
|
7645
|
-
var
|
|
7646
|
-
var Page404 = () => /* @__PURE__ */
|
|
8739
|
+
var import_react93 = __toESM(__require("react"));
|
|
8740
|
+
var Page404 = () => /* @__PURE__ */ import_react93.default.createElement(Page, null, /* @__PURE__ */ import_react93.default.createElement(PageSection, {
|
|
7647
8741
|
large: true
|
|
7648
|
-
}, /* @__PURE__ */
|
|
8742
|
+
}, /* @__PURE__ */ import_react93.default.createElement(Container_default, null, /* @__PURE__ */ import_react93.default.createElement(H1, {
|
|
7649
8743
|
noMargin: true
|
|
7650
8744
|
}, "404"))));
|
|
7651
8745
|
var Page404_default = Page404;
|
|
7652
8746
|
|
|
7653
8747
|
// src/layouts/searchItem/PageLoading.tsx
|
|
7654
|
-
var
|
|
7655
|
-
var PageLoading = () => /* @__PURE__ */
|
|
8748
|
+
var import_react94 = __toESM(__require("react"));
|
|
8749
|
+
var PageLoading = () => /* @__PURE__ */ import_react94.default.createElement(Page, null, /* @__PURE__ */ import_react94.default.createElement(PageSection, {
|
|
7656
8750
|
large: true
|
|
7657
|
-
}, /* @__PURE__ */
|
|
8751
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Container_default, null, /* @__PURE__ */ import_react94.default.createElement(Loader_default, null))));
|
|
7658
8752
|
var PageLoading_default = PageLoading;
|
|
7659
8753
|
|
|
7660
8754
|
// src/layouts/searchItem/Property.tsx
|
|
7661
|
-
var
|
|
8755
|
+
var import_react96 = __toESM(__require("react"));
|
|
7662
8756
|
|
|
7663
8757
|
// src/utils/vehicle-properties/property-tree-creator.ts
|
|
7664
8758
|
var _PropertyTreeCreator = class {
|
|
@@ -8151,11 +9245,11 @@
|
|
|
8151
9245
|
};
|
|
8152
9246
|
|
|
8153
9247
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
8154
|
-
var
|
|
9248
|
+
var import_react95 = __toESM(__require("react"));
|
|
8155
9249
|
|
|
8156
9250
|
// src/components/TableList/index.tsx
|
|
8157
|
-
var
|
|
8158
|
-
var TableList =
|
|
9251
|
+
var import_styled_components59 = __toESM(__require("styled-components"));
|
|
9252
|
+
var TableList = import_styled_components59.default.ul`
|
|
8159
9253
|
list-style: none;
|
|
8160
9254
|
padding: 0;
|
|
8161
9255
|
margin: 0;
|
|
@@ -8163,7 +9257,7 @@
|
|
|
8163
9257
|
border-bottom: 1px solid ${(props) => props.theme.color.border};
|
|
8164
9258
|
font-size: 0.875rem;
|
|
8165
9259
|
`;
|
|
8166
|
-
var TableListItem =
|
|
9260
|
+
var TableListItem = import_styled_components59.default.li`
|
|
8167
9261
|
display: flex;
|
|
8168
9262
|
align-items: center;
|
|
8169
9263
|
padding: ${size(1)} 0;
|
|
@@ -8172,30 +9266,30 @@
|
|
|
8172
9266
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
8173
9267
|
}
|
|
8174
9268
|
`;
|
|
8175
|
-
var TableListKey =
|
|
9269
|
+
var TableListKey = import_styled_components59.default.div`
|
|
8176
9270
|
flex: 1 1 auto;
|
|
8177
9271
|
`;
|
|
8178
|
-
var TableListValue =
|
|
9272
|
+
var TableListValue = import_styled_components59.default.div`
|
|
8179
9273
|
flex-shrink: 0;
|
|
8180
9274
|
padding-left: ${size(1)};
|
|
8181
9275
|
`;
|
|
8182
|
-
var TableListBooleanPos =
|
|
9276
|
+
var TableListBooleanPos = import_styled_components59.default.div`
|
|
8183
9277
|
color: ${(props) => props.theme.color.ui.positive};
|
|
8184
9278
|
`;
|
|
8185
|
-
var TableListBooleanNeg =
|
|
9279
|
+
var TableListBooleanNeg = import_styled_components59.default.div`
|
|
8186
9280
|
color: ${(props) => props.theme.color.ui.negative};
|
|
8187
9281
|
`;
|
|
8188
9282
|
|
|
8189
9283
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
8190
9284
|
var formatValue = (value, unit) => {
|
|
8191
9285
|
if (typeof value === "boolean") {
|
|
8192
|
-
return value ? /* @__PURE__ */
|
|
9286
|
+
return value ? /* @__PURE__ */ import_react95.default.createElement(TableListBooleanPos, {
|
|
8193
9287
|
title: "Ja"
|
|
8194
|
-
}, /* @__PURE__ */
|
|
9288
|
+
}, /* @__PURE__ */ import_react95.default.createElement(SrOnly, null, "Ja"), /* @__PURE__ */ import_react95.default.createElement(IconCheck, {
|
|
8195
9289
|
block: true
|
|
8196
|
-
})) : /* @__PURE__ */
|
|
9290
|
+
})) : /* @__PURE__ */ import_react95.default.createElement(TableListBooleanNeg, {
|
|
8197
9291
|
title: "Nej"
|
|
8198
|
-
}, /* @__PURE__ */
|
|
9292
|
+
}, /* @__PURE__ */ import_react95.default.createElement(SrOnly, null, "Nej"), /* @__PURE__ */ import_react95.default.createElement(IconCancel, {
|
|
8199
9293
|
block: true
|
|
8200
9294
|
}));
|
|
8201
9295
|
}
|
|
@@ -8208,27 +9302,27 @@
|
|
|
8208
9302
|
return value;
|
|
8209
9303
|
};
|
|
8210
9304
|
var MetadataItem = ({ name, hint, value, unit }) => {
|
|
8211
|
-
const [foldout, setFoldout] = (0,
|
|
8212
|
-
const onToggleFoldout = (0,
|
|
9305
|
+
const [foldout, setFoldout] = (0, import_react95.useState)(false);
|
|
9306
|
+
const onToggleFoldout = (0, import_react95.useCallback)(() => setFoldout(!foldout), [foldout]);
|
|
8213
9307
|
const presentedValue = formatValue(value, unit);
|
|
8214
|
-
return /* @__PURE__ */
|
|
9308
|
+
return /* @__PURE__ */ import_react95.default.createElement(TableListItem, null, /* @__PURE__ */ import_react95.default.createElement(TableListKey, null, hint ? /* @__PURE__ */ import_react95.default.createElement(ButtonInline, {
|
|
8215
9309
|
onClick: onToggleFoldout,
|
|
8216
9310
|
title: `Mer information om ${name}`
|
|
8217
|
-
}, name) : name), /* @__PURE__ */
|
|
9311
|
+
}, name) : name), /* @__PURE__ */ import_react95.default.createElement(TableListValue, null, value !== void 0 ? presentedValue : "Uppgift saknas"), hint && foldout && /* @__PURE__ */ import_react95.default.createElement(Modal_default, {
|
|
8218
9312
|
title: name,
|
|
8219
9313
|
onClose: onToggleFoldout
|
|
8220
|
-
}, /* @__PURE__ */
|
|
9314
|
+
}, /* @__PURE__ */ import_react95.default.createElement(Content_default, {
|
|
8221
9315
|
dangerouslySetInnerHTML: { __html: hint }
|
|
8222
9316
|
})));
|
|
8223
9317
|
};
|
|
8224
9318
|
var MetadataItem_default = MetadataItem;
|
|
8225
9319
|
|
|
8226
9320
|
// src/components/Tabs/index.tsx
|
|
8227
|
-
var
|
|
9321
|
+
var React91 = __toESM(__require("react"));
|
|
8228
9322
|
|
|
8229
9323
|
// src/components/Tabs/wrapper.tsx
|
|
8230
|
-
var
|
|
8231
|
-
var
|
|
9324
|
+
var import_styled_components60 = __toESM(__require("styled-components"));
|
|
9325
|
+
var Wrapper33 = import_styled_components60.default.div`
|
|
8232
9326
|
overflow: hidden;
|
|
8233
9327
|
margin-top: ${size(-1)};
|
|
8234
9328
|
margin-left: ${size(-1)};
|
|
@@ -8239,7 +9333,7 @@
|
|
|
8239
9333
|
margin-right: ${size(-2)};
|
|
8240
9334
|
}
|
|
8241
9335
|
`;
|
|
8242
|
-
var List10 =
|
|
9336
|
+
var List10 = import_styled_components60.default.ul`
|
|
8243
9337
|
list-style: none;
|
|
8244
9338
|
padding: 0;
|
|
8245
9339
|
margin: 0;
|
|
@@ -8253,12 +9347,12 @@
|
|
|
8253
9347
|
padding-right: ${size(1)};
|
|
8254
9348
|
}
|
|
8255
9349
|
`;
|
|
8256
|
-
var
|
|
9350
|
+
var Item12 = import_styled_components60.default.li`
|
|
8257
9351
|
display: inline-block;
|
|
8258
9352
|
vertical-align: bottom;
|
|
8259
9353
|
font-size: 1rem;
|
|
8260
9354
|
`;
|
|
8261
|
-
var Action9 = (0,
|
|
9355
|
+
var Action9 = (0, import_styled_components60.default)(ButtonReset).attrs(() => ({
|
|
8262
9356
|
role: "tab",
|
|
8263
9357
|
className: "wayke__theme wayke__font--bold"
|
|
8264
9358
|
}))`
|
|
@@ -8284,7 +9378,7 @@
|
|
|
8284
9378
|
z-index: 1;
|
|
8285
9379
|
}
|
|
8286
9380
|
|
|
8287
|
-
${(props) => props.active &&
|
|
9381
|
+
${(props) => props.active && import_styled_components60.css`
|
|
8288
9382
|
color: ${(props2) => props2.theme.color.textDark};
|
|
8289
9383
|
|
|
8290
9384
|
:after {
|
|
@@ -8294,9 +9388,9 @@
|
|
|
8294
9388
|
`;
|
|
8295
9389
|
|
|
8296
9390
|
// src/components/Tabs/index.tsx
|
|
8297
|
-
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */
|
|
9391
|
+
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React91.createElement(Wrapper33, null, /* @__PURE__ */ React91.createElement(List10, null, tabs.map((tab) => /* @__PURE__ */ React91.createElement(Item12, {
|
|
8298
9392
|
key: tab.name
|
|
8299
|
-
}, /* @__PURE__ */
|
|
9393
|
+
}, /* @__PURE__ */ React91.createElement(Action9, {
|
|
8300
9394
|
title: tab.displayName,
|
|
8301
9395
|
onClick: onClick ? () => onClick(tab.name) : void 0,
|
|
8302
9396
|
active: tab.name === active ? "true" : void 0
|
|
@@ -8304,31 +9398,31 @@
|
|
|
8304
9398
|
var Tabs_default = Tabs;
|
|
8305
9399
|
|
|
8306
9400
|
// src/layouts/searchItem/Property.tsx
|
|
8307
|
-
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */
|
|
9401
|
+
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */ import_react96.default.createElement(Repeat, null, /* @__PURE__ */ import_react96.default.createElement(H5, {
|
|
8308
9402
|
as: "h3"
|
|
8309
|
-
}, name), /* @__PURE__ */
|
|
9403
|
+
}, name), /* @__PURE__ */ import_react96.default.createElement(TableList, null, !!properties.length && properties.map((property, index2) => /* @__PURE__ */ import_react96.default.createElement(MetadataItem_default, {
|
|
8310
9404
|
name: property.name,
|
|
8311
9405
|
hint: property.hint,
|
|
8312
9406
|
value: property.value,
|
|
8313
9407
|
unit: property.unit,
|
|
8314
9408
|
key: `${property.name}-${index2}`
|
|
8315
9409
|
}))));
|
|
8316
|
-
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */
|
|
9410
|
+
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */ import_react96.default.createElement("div", {
|
|
8317
9411
|
className: "tab-section"
|
|
8318
|
-
}, !!properties.length && /* @__PURE__ */
|
|
9412
|
+
}, !!properties.length && /* @__PURE__ */ import_react96.default.createElement(Repeat, null, /* @__PURE__ */ import_react96.default.createElement(TableList, null, properties.map((property, index2) => /* @__PURE__ */ import_react96.default.createElement(MetadataItem_default, {
|
|
8319
9413
|
name: property.name,
|
|
8320
9414
|
hint: property.hint,
|
|
8321
9415
|
value: property.value,
|
|
8322
9416
|
unit: property.unit,
|
|
8323
9417
|
key: `${property.name}-${index2}`
|
|
8324
|
-
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */
|
|
9418
|
+
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */ import_react96.default.createElement(MetadataSubCategory, {
|
|
8325
9419
|
name: subCategory.name,
|
|
8326
9420
|
properties: subCategory.properties,
|
|
8327
9421
|
key: `${subCategory.name}-${index2}`
|
|
8328
9422
|
})));
|
|
8329
9423
|
var PropertySet = ({ propertySet, vehicleData }) => {
|
|
8330
|
-
const [activeCategoryId, setActiveCategoryId] = (0,
|
|
8331
|
-
const mappedProperties = (0,
|
|
9424
|
+
const [activeCategoryId, setActiveCategoryId] = (0, import_react96.useState)(-1);
|
|
9425
|
+
const mappedProperties = (0, import_react96.useMemo)(() => {
|
|
8332
9426
|
if (!propertySet) {
|
|
8333
9427
|
return void 0;
|
|
8334
9428
|
}
|
|
@@ -8339,24 +9433,24 @@
|
|
|
8339
9433
|
property_tree_sorter_default(tree);
|
|
8340
9434
|
return tree;
|
|
8341
9435
|
}, [propertySet]);
|
|
8342
|
-
(0,
|
|
9436
|
+
(0, import_react96.useEffect)(() => {
|
|
8343
9437
|
const categories = mappedProperties?.categories?.length !== void 0 ? mappedProperties?.categories : void 0;
|
|
8344
9438
|
if (activeCategoryId < 0 && categories !== void 0 && categories.length > 0) {
|
|
8345
9439
|
setActiveCategoryId(categories[0].id);
|
|
8346
9440
|
}
|
|
8347
9441
|
}, [mappedProperties]);
|
|
8348
|
-
const onTab = (0,
|
|
9442
|
+
const onTab = (0, import_react96.useCallback)((id) => setActiveCategoryId(parseInt(id, 10)), []);
|
|
8349
9443
|
const activeCategory = mappedProperties?.categories?.find(
|
|
8350
9444
|
(category) => category.id === activeCategoryId
|
|
8351
9445
|
);
|
|
8352
|
-
return /* @__PURE__ */
|
|
9446
|
+
return /* @__PURE__ */ import_react96.default.createElement(import_react96.default.Fragment, null, /* @__PURE__ */ import_react96.default.createElement(Repeat, null, /* @__PURE__ */ import_react96.default.createElement(Tabs_default, {
|
|
8353
9447
|
tabs: mappedProperties?.categories?.map((category) => ({
|
|
8354
9448
|
name: `${category.id}`,
|
|
8355
9449
|
displayName: category.name
|
|
8356
9450
|
})) || [],
|
|
8357
9451
|
active: `${activeCategoryId}`,
|
|
8358
9452
|
onClick: onTab
|
|
8359
|
-
})), activeCategory && /* @__PURE__ */
|
|
9453
|
+
})), activeCategory && /* @__PURE__ */ import_react96.default.createElement(Repeat, null, /* @__PURE__ */ import_react96.default.createElement(MetadataCategory, {
|
|
8360
9454
|
properties: activeCategory.properties,
|
|
8361
9455
|
subCategories: activeCategory.subCategories
|
|
8362
9456
|
})));
|
|
@@ -8364,11 +9458,11 @@
|
|
|
8364
9458
|
var Property_default = PropertySet;
|
|
8365
9459
|
|
|
8366
9460
|
// src/components/Pdf/index.tsx
|
|
8367
|
-
var
|
|
9461
|
+
var import_react97 = __toESM(__require("react"));
|
|
8368
9462
|
|
|
8369
9463
|
// src/components/Pdf/wrapper.tsx
|
|
8370
|
-
var
|
|
8371
|
-
var PdfListItem =
|
|
9464
|
+
var import_styled_components61 = __toESM(__require("styled-components"));
|
|
9465
|
+
var PdfListItem = import_styled_components61.default.li.attrs(() => ({
|
|
8372
9466
|
className: "wayke__theme wayke__color--primary-text"
|
|
8373
9467
|
}))`
|
|
8374
9468
|
flex: 0 0 50%;
|
|
@@ -8378,14 +9472,14 @@
|
|
|
8378
9472
|
flex: 0 0 100%;
|
|
8379
9473
|
}
|
|
8380
9474
|
`;
|
|
8381
|
-
var PdfContainer =
|
|
9475
|
+
var PdfContainer = import_styled_components61.default.ul`
|
|
8382
9476
|
list-style: none;
|
|
8383
9477
|
padding: 0;
|
|
8384
9478
|
display: flex;
|
|
8385
9479
|
flex-wrap: wrap;
|
|
8386
9480
|
margin: ${size(-1)};
|
|
8387
9481
|
`;
|
|
8388
|
-
var PdfLink =
|
|
9482
|
+
var PdfLink = import_styled_components61.default.a.attrs(() => ({
|
|
8389
9483
|
className: "wayke__theme wayke__color--primary-text wayke__font--bold"
|
|
8390
9484
|
}))`
|
|
8391
9485
|
text-decoration: none;
|
|
@@ -8399,19 +9493,19 @@
|
|
|
8399
9493
|
height: 100%;
|
|
8400
9494
|
}
|
|
8401
9495
|
`;
|
|
8402
|
-
var PdfTitle =
|
|
9496
|
+
var PdfTitle = import_styled_components61.default.div`
|
|
8403
9497
|
color: ${(props) => props.theme.color.textDark};
|
|
8404
9498
|
`;
|
|
8405
|
-
var PdfSubtitle =
|
|
9499
|
+
var PdfSubtitle = import_styled_components61.default.div`
|
|
8406
9500
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
8407
9501
|
`;
|
|
8408
|
-
var PdfColumn =
|
|
9502
|
+
var PdfColumn = import_styled_components61.default.div`
|
|
8409
9503
|
flex 0 0 auto;
|
|
8410
9504
|
&:first-child {
|
|
8411
9505
|
flex: 1 1 auto;
|
|
8412
9506
|
}
|
|
8413
9507
|
`;
|
|
8414
|
-
var PdfListInner =
|
|
9508
|
+
var PdfListInner = import_styled_components61.default.div`
|
|
8415
9509
|
position: relative;
|
|
8416
9510
|
border: 1px solid ${(props) => props.theme.color.border};
|
|
8417
9511
|
padding: ${size(1.5)};
|
|
@@ -8423,12 +9517,12 @@
|
|
|
8423
9517
|
`;
|
|
8424
9518
|
|
|
8425
9519
|
// src/components/Pdf/index.tsx
|
|
8426
|
-
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */
|
|
9520
|
+
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */ import_react97.default.createElement(PdfListItem, null, /* @__PURE__ */ import_react97.default.createElement(PdfListInner, null, /* @__PURE__ */ import_react97.default.createElement(PdfColumn, null, /* @__PURE__ */ import_react97.default.createElement(PdfTitle, null, document2.name), /* @__PURE__ */ import_react97.default.createElement(PdfSubtitle, null, document2.contentType)), /* @__PURE__ */ import_react97.default.createElement(PdfColumn, null, /* @__PURE__ */ import_react97.default.createElement(PdfLink, {
|
|
8427
9521
|
href: document2.url,
|
|
8428
9522
|
rel: "noopener noreferrer nofollow",
|
|
8429
9523
|
target: "_blank"
|
|
8430
9524
|
}, "\xD6ppna"))));
|
|
8431
|
-
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */
|
|
9525
|
+
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */ import_react97.default.createElement(PdfContainer, null, documents.map((document2, i) => /* @__PURE__ */ import_react97.default.createElement(PdfDownloadItem, {
|
|
8432
9526
|
key: `${document2.url}-${i}`,
|
|
8433
9527
|
document: document2
|
|
8434
9528
|
})));
|
|
@@ -8445,10 +9539,10 @@
|
|
|
8445
9539
|
onClickSearchItem
|
|
8446
9540
|
}) => {
|
|
8447
9541
|
const { ecomSettings } = useSettings_default();
|
|
8448
|
-
const ecomContext = (0,
|
|
9542
|
+
const ecomContext = (0, import_react98.useRef)();
|
|
8449
9543
|
const { loading, data: result } = useSearchItem_default(id);
|
|
8450
9544
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } = useCentralStorage_default(result?.vehicle);
|
|
8451
|
-
(0,
|
|
9545
|
+
(0, import_react98.useEffect)(() => {
|
|
8452
9546
|
if (ecomSettings) {
|
|
8453
9547
|
ecomContext.current = new import_ecom_web.default({
|
|
8454
9548
|
id,
|
|
@@ -8470,28 +9564,28 @@
|
|
|
8470
9564
|
}
|
|
8471
9565
|
};
|
|
8472
9566
|
}, []);
|
|
8473
|
-
(0,
|
|
9567
|
+
(0, import_react98.useEffect)(() => {
|
|
8474
9568
|
if (!disableResetScrollOnInit) {
|
|
8475
9569
|
window.scrollTo(0, 0);
|
|
8476
9570
|
}
|
|
8477
9571
|
}, []);
|
|
8478
|
-
(0,
|
|
9572
|
+
(0, import_react98.useEffect)(() => {
|
|
8479
9573
|
if (result?.vehicle?.data && modifyDocumentTitleItem) {
|
|
8480
9574
|
const { vehicle: vehicle2 } = result;
|
|
8481
9575
|
const { registrationNumber } = vehicle2.data;
|
|
8482
9576
|
document.title = `${registrationNumber} | ${vehicle2.title} | ${vehicle2.shortDescription}`;
|
|
8483
9577
|
}
|
|
8484
9578
|
}, [result]);
|
|
8485
|
-
const options = (0,
|
|
9579
|
+
const options = (0, import_react98.useMemo)(
|
|
8486
9580
|
() => result?.vehicle?.data?.options?.filter(notEmpty).map((opt) => ({ title: opt })),
|
|
8487
9581
|
[result?.vehicle?.data?.options]
|
|
8488
9582
|
);
|
|
8489
|
-
const onShowMoreOptionsClick = (0,
|
|
9583
|
+
const onShowMoreOptionsClick = (0, import_react98.useCallback)(() => pubsub_default.publish("OptionsClick"), []);
|
|
8490
9584
|
if (loading) {
|
|
8491
|
-
return /* @__PURE__ */
|
|
9585
|
+
return /* @__PURE__ */ import_react98.default.createElement(PageLoading_default, null);
|
|
8492
9586
|
}
|
|
8493
9587
|
if (!result?.vehicle?.data) {
|
|
8494
|
-
return /* @__PURE__ */
|
|
9588
|
+
return /* @__PURE__ */ import_react98.default.createElement(Page404_default, null);
|
|
8495
9589
|
}
|
|
8496
9590
|
const { vehicle } = result;
|
|
8497
9591
|
const contact = centralStorageVehicle?.contact;
|
|
@@ -8525,40 +9619,40 @@
|
|
|
8525
9619
|
if (fuelType) {
|
|
8526
9620
|
uspList.push({ title: fuelType });
|
|
8527
9621
|
}
|
|
8528
|
-
return /* @__PURE__ */
|
|
9622
|
+
return /* @__PURE__ */ import_react98.default.createElement(import_react98.default.Fragment, null, /* @__PURE__ */ import_react98.default.createElement(Page, null, /* @__PURE__ */ import_react98.default.createElement(PageSection, {
|
|
8529
9623
|
large: true
|
|
8530
|
-
}, /* @__PURE__ */
|
|
9624
|
+
}, /* @__PURE__ */ import_react98.default.createElement(Container_default, null, /* @__PURE__ */ import_react98.default.createElement(ProductPage, null, /* @__PURE__ */ import_react98.default.createElement(ProductPageAside, null, /* @__PURE__ */ import_react98.default.createElement(ProductPageAsideSection, {
|
|
8531
9625
|
mobileOrder: 1
|
|
8532
|
-
}, !pathRoute && hashRoute ? /* @__PURE__ */
|
|
9626
|
+
}, !pathRoute && hashRoute ? /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(UtilityFontSizeSmall, null, /* @__PURE__ */ import_react98.default.createElement(ButtonInlineLight, {
|
|
8533
9627
|
as: "a",
|
|
8534
9628
|
href: "#",
|
|
8535
9629
|
title: "Tillbaka till bils\xF6k"
|
|
8536
|
-
}, /* @__PURE__ */
|
|
9630
|
+
}, /* @__PURE__ */ import_react98.default.createElement(ButtonContent, null, /* @__PURE__ */ import_react98.default.createElement(IconChevronLeft, {
|
|
8537
9631
|
block: true
|
|
8538
|
-
})), /* @__PURE__ */
|
|
9632
|
+
})), /* @__PURE__ */ import_react98.default.createElement(ButtonContent, null, "Tillbaka till bils\xF6k")))) : null, manufacturer?.logotype && /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(LogoBox_default, {
|
|
8539
9633
|
logo: manufacturer.logotype,
|
|
8540
9634
|
alt: manufacturer.name
|
|
8541
|
-
})), /* @__PURE__ */
|
|
9635
|
+
})), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react98.default.createElement(H1, {
|
|
8542
9636
|
noMargin: true
|
|
8543
|
-
}, title)), shortDescription && /* @__PURE__ */
|
|
9637
|
+
}, title)), shortDescription && /* @__PURE__ */ import_react98.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react98.default.createElement("div", null, shortDescription)), /* @__PURE__ */ import_react98.default.createElement(RepeatSmall, null, /* @__PURE__ */ import_react98.default.createElement(UspList_default, {
|
|
8544
9638
|
small: true,
|
|
8545
9639
|
items: uspList
|
|
8546
|
-
})))), /* @__PURE__ */
|
|
9640
|
+
})))), /* @__PURE__ */ import_react98.default.createElement(ProductPageAsideSection, {
|
|
8547
9641
|
mobileOrder: 2
|
|
8548
|
-
}, /* @__PURE__ */
|
|
9642
|
+
}, /* @__PURE__ */ import_react98.default.createElement(PriceTable_default, {
|
|
8549
9643
|
price
|
|
8550
|
-
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */
|
|
9644
|
+
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */ import_react98.default.createElement(ProductPageAsideSection, {
|
|
8551
9645
|
mobileOrder: 4
|
|
8552
|
-
}, financialOptions.length > 0 && /* @__PURE__ */
|
|
9646
|
+
}, financialOptions.length > 0 && /* @__PURE__ */ import_react98.default.createElement(FinancialOptions_default, {
|
|
8553
9647
|
id,
|
|
8554
9648
|
financialOptions
|
|
8555
|
-
}), insuranceOptions.length > 0 && /* @__PURE__ */
|
|
9649
|
+
}), insuranceOptions.length > 0 && /* @__PURE__ */ import_react98.default.createElement(InsuranceOptions_default, {
|
|
8556
9650
|
id,
|
|
8557
9651
|
branch: centralStorageVehicle?.branch,
|
|
8558
9652
|
insuranceOptions
|
|
8559
|
-
})), /* @__PURE__ */
|
|
9653
|
+
})), /* @__PURE__ */ import_react98.default.createElement(ProductPageAsideSection, {
|
|
8560
9654
|
mobileOrder: 5
|
|
8561
|
-
}, /* @__PURE__ */
|
|
9655
|
+
}, /* @__PURE__ */ import_react98.default.createElement(CheckList_default, {
|
|
8562
9656
|
manufacturer,
|
|
8563
9657
|
packageOptions,
|
|
8564
9658
|
ecommerce,
|
|
@@ -8566,141 +9660,77 @@
|
|
|
8566
9660
|
contact: centralStorageVehicle?.contact,
|
|
8567
9661
|
loadingCentralStorageVehicle,
|
|
8568
9662
|
toggleEcomModal: () => ecomContext.current?.start()
|
|
8569
|
-
}))), /* @__PURE__ */
|
|
9663
|
+
}))), /* @__PURE__ */ import_react98.default.createElement(ProductPageMain, null, /* @__PURE__ */ import_react98.default.createElement(ProductPageAsideSection, {
|
|
8570
9664
|
mobileOrder: 3
|
|
8571
|
-
}, /* @__PURE__ */
|
|
9665
|
+
}, /* @__PURE__ */ import_react98.default.createElement(Gallery_default, {
|
|
8572
9666
|
media,
|
|
8573
9667
|
placeholderImage
|
|
8574
|
-
})), /* @__PURE__ */
|
|
9668
|
+
})), /* @__PURE__ */ import_react98.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(H2, {
|
|
8575
9669
|
noMargin: true
|
|
8576
|
-
}, "Biluppgifter")), /* @__PURE__ */
|
|
9670
|
+
}, "Biluppgifter")), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(Content_default, null, /* @__PURE__ */ import_react98.default.createElement("p", null, "Information direkt fr\xE5n Transportstyrelsen och tillverkaren."))), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(Property_default, {
|
|
8577
9671
|
propertySet,
|
|
8578
9672
|
vehicleData: vehicle.data
|
|
8579
|
-
}))), description && /* @__PURE__ */
|
|
9673
|
+
}))), description && /* @__PURE__ */ import_react98.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react98.default.createElement(Blockquote_default, {
|
|
8580
9674
|
author: contact && contact.name ? contact.name : null,
|
|
8581
9675
|
date: publishedAt ? dateTimeFormat.format(publishedAt, dateTimeFormat.DayMonth) : void 0,
|
|
8582
9676
|
avatar: contact?.avatar || void 0
|
|
8583
|
-
}, !!description && /* @__PURE__ */
|
|
9677
|
+
}, !!description && /* @__PURE__ */ import_react98.default.createElement("p", null, description))), (options?.length || 0) > 0 && /* @__PURE__ */ import_react98.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(H2, {
|
|
8584
9678
|
noMargin: true
|
|
8585
|
-
}, "Utrustning")), /* @__PURE__ */
|
|
9679
|
+
}, "Utrustning")), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(Content_default, null, /* @__PURE__ */ import_react98.default.createElement("p", null, "Kompletterande uppgifter om bilen."))), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(ExtendContent_default, {
|
|
8586
9680
|
actionTitle: "Visa mer",
|
|
8587
9681
|
onClick: onShowMoreOptionsClick
|
|
8588
|
-
}, /* @__PURE__ */
|
|
9682
|
+
}, /* @__PURE__ */ import_react98.default.createElement(UspList_default, {
|
|
8589
9683
|
items: options
|
|
8590
|
-
})))), (documents.length || 0) > 0 && /* @__PURE__ */
|
|
9684
|
+
})))), (documents.length || 0) > 0 && /* @__PURE__ */ import_react98.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(H2, {
|
|
8591
9685
|
noMargin: true
|
|
8592
|
-
}, "Dokument")), /* @__PURE__ */
|
|
9686
|
+
}, "Dokument")), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(Content_default, null, /* @__PURE__ */ import_react98.default.createElement("p", null, "Tillh\xF6rande dokument f\xF6r bilen."))), /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(Pdf_default, {
|
|
8593
9687
|
documents
|
|
8594
|
-
}))), /* @__PURE__ */
|
|
9688
|
+
}))), /* @__PURE__ */ import_react98.default.createElement(ProductPageMainSection, null, /* @__PURE__ */ import_react98.default.createElement(Branch_default, {
|
|
8595
9689
|
branch,
|
|
8596
9690
|
loading: loadingCentralStorageVehicle
|
|
8597
|
-
}), ecommerce && ecommerce.enabled && /* @__PURE__ */
|
|
9691
|
+
}), ecommerce && ecommerce.enabled && /* @__PURE__ */ import_react98.default.createElement(Repeat, null, /* @__PURE__ */ import_react98.default.createElement(ButtonPrimary, {
|
|
8598
9692
|
disabled: !!ecommerce.reserved,
|
|
8599
9693
|
title: "K\xF6p bilen online",
|
|
8600
9694
|
onClick: () => ecomContext.current?.start()
|
|
8601
|
-
}, "K\xF6p bilen online"))), /* @__PURE__ */
|
|
9695
|
+
}, "K\xF6p bilen online"))), /* @__PURE__ */ import_react98.default.createElement(PackageOptions_default, {
|
|
8602
9696
|
packageOptions
|
|
8603
|
-
}), /* @__PURE__ */
|
|
9697
|
+
}), /* @__PURE__ */ import_react98.default.createElement(ManufacturerPackagesOption_default, {
|
|
8604
9698
|
packageOption: manufacturer?.packageOption
|
|
8605
|
-
}))))), /* @__PURE__ */
|
|
9699
|
+
}))))), /* @__PURE__ */ import_react98.default.createElement(Related_default, {
|
|
8606
9700
|
id,
|
|
8607
9701
|
hashRoute,
|
|
8608
9702
|
pathRoute,
|
|
8609
9703
|
onClickSearchItem
|
|
8610
|
-
})), false, /* @__PURE__ */
|
|
9704
|
+
})), false, /* @__PURE__ */ import_react98.default.createElement(portal_element_default, {
|
|
8611
9705
|
id: portal_namespace_exports.DefaultPortal
|
|
8612
9706
|
}));
|
|
8613
9707
|
};
|
|
8614
9708
|
var searchItem_default = WaykeSearchItem;
|
|
8615
9709
|
|
|
8616
9710
|
// src/providers/WaykeProvider.tsx
|
|
8617
|
-
var
|
|
9711
|
+
var import_react108 = __toESM(__require("react"));
|
|
8618
9712
|
|
|
8619
9713
|
// src/providers/graphqlProvider.tsx
|
|
8620
|
-
var
|
|
9714
|
+
var import_react99 = __toESM(__require("react"));
|
|
8621
9715
|
var import_client9 = __require("@apollo/client");
|
|
8622
9716
|
var GraphqlProvider = ({ uri, children }) => {
|
|
8623
9717
|
const client = new import_client9.ApolloClient({ uri, cache: new import_client9.InMemoryCache() });
|
|
8624
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ import_react99.default.createElement(import_client9.ApolloProvider, {
|
|
8625
9719
|
client
|
|
8626
9720
|
}, children);
|
|
8627
9721
|
};
|
|
8628
9722
|
var graphqlProvider_default = GraphqlProvider;
|
|
8629
9723
|
|
|
8630
9724
|
// src/providers/themeProvider.tsx
|
|
8631
|
-
var
|
|
8632
|
-
var
|
|
8633
|
-
var ThemeProvider = ({ children }) => /* @__PURE__ */
|
|
9725
|
+
var import_react100 = __toESM(__require("react"));
|
|
9726
|
+
var import_styled_components62 = __require("styled-components");
|
|
9727
|
+
var ThemeProvider = ({ children }) => /* @__PURE__ */ import_react100.default.createElement(import_styled_components62.ThemeProvider, {
|
|
8634
9728
|
theme: theme_default
|
|
8635
9729
|
}, children);
|
|
8636
9730
|
var themeProvider_default = ThemeProvider;
|
|
8637
9731
|
|
|
8638
9732
|
// src/State/Search/SearchProvider.tsx
|
|
8639
|
-
var
|
|
8640
|
-
|
|
8641
|
-
// src/hooks/useFetch.ts
|
|
8642
|
-
var import_react87 = __require("react");
|
|
8643
|
-
var cache = {};
|
|
8644
|
-
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
8645
|
-
var setCachedResult = (key, value) => {
|
|
8646
|
-
cache[key] = value;
|
|
8647
|
-
};
|
|
8648
|
-
var pendingPromise = {};
|
|
8649
|
-
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
8650
|
-
var setPendingPromise = (url, promise) => {
|
|
8651
|
-
pendingPromise = {
|
|
8652
|
-
...pendingPromise,
|
|
8653
|
-
[url]: promise
|
|
8654
|
-
};
|
|
8655
|
-
};
|
|
8656
|
-
var clearPendingPromise = (url) => {
|
|
8657
|
-
delete pendingPromise[url];
|
|
8658
|
-
};
|
|
8659
|
-
var useFetch = (path, options, skip, promiseCache) => {
|
|
8660
|
-
const [data, setData] = (0, import_react87.useState)();
|
|
8661
|
-
const [loading, setLoading] = (0, import_react87.useState)(false);
|
|
8662
|
-
const [error, setError] = (0, import_react87.useState)(false);
|
|
8663
|
-
const doFetch = (0, import_react87.useCallback)(async () => {
|
|
8664
|
-
const key = path.toString();
|
|
8665
|
-
const cached = getCachedResult(key);
|
|
8666
|
-
setError(false);
|
|
8667
|
-
if (cached) {
|
|
8668
|
-
setData(cached);
|
|
8669
|
-
return;
|
|
8670
|
-
}
|
|
8671
|
-
setLoading(true);
|
|
8672
|
-
try {
|
|
8673
|
-
const reusePromise = promiseCache && isPendingPromise(key);
|
|
8674
|
-
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
8675
|
-
if (promiseCache) {
|
|
8676
|
-
setPendingPromise(key, request);
|
|
8677
|
-
}
|
|
8678
|
-
const result = await request;
|
|
8679
|
-
if (result.ok) {
|
|
8680
|
-
const json2 = await result.clone().json();
|
|
8681
|
-
setCachedResult(key, json2);
|
|
8682
|
-
setData(json2);
|
|
8683
|
-
}
|
|
8684
|
-
} catch (e) {
|
|
8685
|
-
setError(true);
|
|
8686
|
-
} finally {
|
|
8687
|
-
setLoading(false);
|
|
8688
|
-
clearPendingPromise(key);
|
|
8689
|
-
}
|
|
8690
|
-
return;
|
|
8691
|
-
}, [path, options]);
|
|
8692
|
-
(0, import_react87.useEffect)(() => {
|
|
8693
|
-
if (!skip) {
|
|
8694
|
-
doFetch();
|
|
8695
|
-
}
|
|
8696
|
-
}, [path, skip]);
|
|
8697
|
-
return {
|
|
8698
|
-
loading,
|
|
8699
|
-
data,
|
|
8700
|
-
error
|
|
8701
|
-
};
|
|
8702
|
-
};
|
|
8703
|
-
var useFetch_default = useFetch;
|
|
9733
|
+
var import_react101 = __toESM(__require("react"));
|
|
8704
9734
|
|
|
8705
9735
|
// src/utils/url.ts
|
|
8706
9736
|
var getUrlSearchParamsFromUrl = () => new URLSearchParams(window.location.search);
|
|
@@ -8717,12 +9747,12 @@
|
|
|
8717
9747
|
children
|
|
8718
9748
|
}) => {
|
|
8719
9749
|
const { replaceState, pushState } = usePath_default();
|
|
8720
|
-
const [queryFilter, setQueryFilter] = (0,
|
|
9750
|
+
const [queryFilter, setQueryFilter] = (0, import_react101.useState)({
|
|
8721
9751
|
searchParams: initialSearchParams
|
|
8722
9752
|
});
|
|
8723
|
-
const [initialFacets, setInitialFacets] = (0,
|
|
8724
|
-
const [documents, setDocuments] = (0,
|
|
8725
|
-
const [initialize, setInitialize] = (0,
|
|
9753
|
+
const [initialFacets, setInitialFacets] = (0, import_react101.useState)();
|
|
9754
|
+
const [documents, setDocuments] = (0, import_react101.useState)();
|
|
9755
|
+
const [initialize, setInitialize] = (0, import_react101.useState)(false);
|
|
8726
9756
|
const { data: initialDataRepsonse } = useFetch_default(
|
|
8727
9757
|
`${url}?hits=0`,
|
|
8728
9758
|
{
|
|
@@ -8758,7 +9788,7 @@
|
|
|
8758
9788
|
});
|
|
8759
9789
|
}
|
|
8760
9790
|
};
|
|
8761
|
-
(0,
|
|
9791
|
+
(0, import_react101.useEffect)(() => {
|
|
8762
9792
|
if (useQueryParamsFromUrl) {
|
|
8763
9793
|
window.addEventListener("popstate", popStateEvent);
|
|
8764
9794
|
}
|
|
@@ -8772,12 +9802,12 @@
|
|
|
8772
9802
|
pubsub_default.unsubscribeAction(onFilterUpdateEvent);
|
|
8773
9803
|
};
|
|
8774
9804
|
}, []);
|
|
8775
|
-
(0,
|
|
9805
|
+
(0, import_react101.useEffect)(() => {
|
|
8776
9806
|
if (initialDataRepsonse) {
|
|
8777
9807
|
setInitialFacets(initialDataRepsonse.facets);
|
|
8778
9808
|
}
|
|
8779
9809
|
}, [initialDataRepsonse]);
|
|
8780
|
-
(0,
|
|
9810
|
+
(0, import_react101.useEffect)(() => {
|
|
8781
9811
|
if (useQueryParamsFromUrl) {
|
|
8782
9812
|
const nextSearchParams = new URLSearchParams(queryFilter.searchParams);
|
|
8783
9813
|
nextSearchParams.delete("hits");
|
|
@@ -8800,7 +9830,7 @@
|
|
|
8800
9830
|
}
|
|
8801
9831
|
}
|
|
8802
9832
|
}, [queryFilter, initialize, useQueryParamsFromUrl]);
|
|
8803
|
-
(0,
|
|
9833
|
+
(0, import_react101.useEffect)(() => {
|
|
8804
9834
|
if (response) {
|
|
8805
9835
|
if (!initialFacets && !useQueryParamsFromUrl) {
|
|
8806
9836
|
setInitialFacets(response.facets);
|
|
@@ -8825,7 +9855,7 @@
|
|
|
8825
9855
|
}
|
|
8826
9856
|
}
|
|
8827
9857
|
}, [response, useQueryParamsFromUrl]);
|
|
8828
|
-
const onFilterUpdate = (0,
|
|
9858
|
+
const onFilterUpdate = (0, import_react101.useCallback)(
|
|
8829
9859
|
(nextQuery) => {
|
|
8830
9860
|
{
|
|
8831
9861
|
if (!initialize) {
|
|
@@ -8838,7 +9868,7 @@
|
|
|
8838
9868
|
},
|
|
8839
9869
|
[initialize]
|
|
8840
9870
|
);
|
|
8841
|
-
const onLoadMore = (0,
|
|
9871
|
+
const onLoadMore = (0, import_react101.useCallback)(() => {
|
|
8842
9872
|
if (response) {
|
|
8843
9873
|
setQueryFilter({
|
|
8844
9874
|
searchParams: new URLSearchParams(response?.documentList.pagination.nextPage?.query),
|
|
@@ -8846,7 +9876,7 @@
|
|
|
8846
9876
|
});
|
|
8847
9877
|
}
|
|
8848
9878
|
}, [response]);
|
|
8849
|
-
const onInitialize = (0,
|
|
9879
|
+
const onInitialize = (0, import_react101.useCallback)(
|
|
8850
9880
|
(_initialQueryParams) => {
|
|
8851
9881
|
if (!initialize) {
|
|
8852
9882
|
const searchParamsFromUrl = getUrlSearchParamsFromUrl();
|
|
@@ -8890,15 +9920,15 @@
|
|
|
8890
9920
|
onLoadMore,
|
|
8891
9921
|
onInitialize
|
|
8892
9922
|
};
|
|
8893
|
-
return /* @__PURE__ */
|
|
9923
|
+
return /* @__PURE__ */ import_react101.default.createElement(SearchContext.Provider, {
|
|
8894
9924
|
value
|
|
8895
9925
|
}, children);
|
|
8896
9926
|
};
|
|
8897
9927
|
var SearchProvider_default = SearchProvider;
|
|
8898
9928
|
|
|
8899
9929
|
// src/components/Root/index.tsx
|
|
8900
|
-
var
|
|
8901
|
-
var Root =
|
|
9930
|
+
var import_styled_components63 = __toESM(__require("styled-components"));
|
|
9931
|
+
var Root = import_styled_components63.default.div.attrs(() => ({
|
|
8902
9932
|
className: "wayke__theme wayke__font--regular"
|
|
8903
9933
|
}))`
|
|
8904
9934
|
background-color: ${(props) => props.theme.color.bg};
|
|
@@ -8940,21 +9970,21 @@
|
|
|
8940
9970
|
var useEcom_default = useEcom;
|
|
8941
9971
|
|
|
8942
9972
|
// src/State/Settings/SettingsProvider.tsx
|
|
8943
|
-
var
|
|
9973
|
+
var import_react102 = __toESM(__require("react"));
|
|
8944
9974
|
var SettingsProvider = ({
|
|
8945
9975
|
googleMapsApiKey,
|
|
8946
9976
|
googleMapsMarker,
|
|
8947
9977
|
ecomSettings,
|
|
8948
9978
|
children
|
|
8949
|
-
}) => /* @__PURE__ */
|
|
9979
|
+
}) => /* @__PURE__ */ import_react102.default.createElement(SettingsContext.Provider, {
|
|
8950
9980
|
value: { ecomSettings, googleMapsApiKey, googleMapsMarker }
|
|
8951
9981
|
}, children);
|
|
8952
9982
|
var SettingsProvider_default = SettingsProvider;
|
|
8953
9983
|
|
|
8954
9984
|
// src/State/RelatedSearch/RelatedSearchProvider.tsx
|
|
8955
|
-
var
|
|
9985
|
+
var import_react103 = __toESM(__require("react"));
|
|
8956
9986
|
var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
8957
|
-
const [queryFilter, setQueryFilter] = (0,
|
|
9987
|
+
const [queryFilter, setQueryFilter] = (0, import_react103.useState)();
|
|
8958
9988
|
const query = queryFilter?.searchParams.toString();
|
|
8959
9989
|
const {
|
|
8960
9990
|
loading,
|
|
@@ -8969,7 +9999,7 @@
|
|
|
8969
9999
|
},
|
|
8970
10000
|
!queryFilter
|
|
8971
10001
|
);
|
|
8972
|
-
const fetchRelated = (0,
|
|
10002
|
+
const fetchRelated = (0, import_react103.useCallback)(
|
|
8973
10003
|
(searchParams) => setQueryFilter({
|
|
8974
10004
|
searchParams
|
|
8975
10005
|
}),
|
|
@@ -8983,31 +10013,31 @@
|
|
|
8983
10013
|
queryFilter,
|
|
8984
10014
|
fetchRelated
|
|
8985
10015
|
};
|
|
8986
|
-
return /* @__PURE__ */
|
|
10016
|
+
return /* @__PURE__ */ import_react103.default.createElement(RelatedSearchContext.Provider, {
|
|
8987
10017
|
value
|
|
8988
10018
|
}, children);
|
|
8989
10019
|
};
|
|
8990
10020
|
var RelatedSearchProvider_default = RelatedSearchProvider;
|
|
8991
10021
|
|
|
8992
10022
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
8993
|
-
var
|
|
10023
|
+
var import_react105 = __toESM(__require("react"));
|
|
8994
10024
|
|
|
8995
10025
|
// src/hooks/useSessionStorage.ts
|
|
8996
|
-
var
|
|
10026
|
+
var import_react104 = __require("react");
|
|
8997
10027
|
var useSessionStorage = (key) => {
|
|
8998
|
-
const [value, setValue] = (0,
|
|
8999
|
-
const set = (0,
|
|
10028
|
+
const [value, setValue] = (0, import_react104.useState)(sessionStorage.getItem(key));
|
|
10029
|
+
const set = (0, import_react104.useCallback)(
|
|
9000
10030
|
(v) => {
|
|
9001
10031
|
sessionStorage.setItem(key, v);
|
|
9002
10032
|
setValue(v);
|
|
9003
10033
|
},
|
|
9004
10034
|
[key]
|
|
9005
10035
|
);
|
|
9006
|
-
const remove = (0,
|
|
10036
|
+
const remove = (0, import_react104.useCallback)(() => {
|
|
9007
10037
|
sessionStorage.removeItem(key);
|
|
9008
10038
|
setValue(null);
|
|
9009
10039
|
}, [key]);
|
|
9010
|
-
const clear = (0,
|
|
10040
|
+
const clear = (0, import_react104.useCallback)(() => {
|
|
9011
10041
|
sessionStorage.clear();
|
|
9012
10042
|
setValue(null);
|
|
9013
10043
|
}, [key]);
|
|
@@ -9023,21 +10053,21 @@
|
|
|
9023
10053
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
9024
10054
|
var CentralStorageProvider = ({ children }) => {
|
|
9025
10055
|
const { value, set, remove } = useSessionStorage_default("centralStorage");
|
|
9026
|
-
const setCentralStorageId = (0,
|
|
9027
|
-
return /* @__PURE__ */
|
|
10056
|
+
const setCentralStorageId = (0, import_react105.useCallback)((id) => id ? set(id) : remove(), []);
|
|
10057
|
+
return /* @__PURE__ */ import_react105.default.createElement(CentralStorageContext.Provider, {
|
|
9028
10058
|
value: { centralStorageId: value, setCentralStorageId }
|
|
9029
10059
|
}, children);
|
|
9030
10060
|
};
|
|
9031
10061
|
var CentralStorageProvider_default = CentralStorageProvider;
|
|
9032
10062
|
|
|
9033
10063
|
// src/State/Path/PathProvider.tsx
|
|
9034
|
-
var
|
|
10064
|
+
var import_react107 = __toESM(__require("react"));
|
|
9035
10065
|
|
|
9036
10066
|
// src/hooks/usePrevious.ts
|
|
9037
|
-
var
|
|
10067
|
+
var import_react106 = __require("react");
|
|
9038
10068
|
var usePrevious = (value) => {
|
|
9039
|
-
const ref = (0,
|
|
9040
|
-
(0,
|
|
10069
|
+
const ref = (0, import_react106.useRef)();
|
|
10070
|
+
(0, import_react106.useEffect)(() => {
|
|
9041
10071
|
ref.current = value;
|
|
9042
10072
|
});
|
|
9043
10073
|
return ref.current;
|
|
@@ -9065,9 +10095,9 @@
|
|
|
9065
10095
|
var regexGuidAnyWhere = /(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}/g;
|
|
9066
10096
|
var POP_STATE = "popstate";
|
|
9067
10097
|
var PathProvider = ({ children }) => {
|
|
9068
|
-
const [state, dispatch] = (0,
|
|
10098
|
+
const [state, dispatch] = (0, import_react107.useReducer)(reducer_default, initialState);
|
|
9069
10099
|
const previousPath = usePrevious_default(state.path);
|
|
9070
|
-
(0,
|
|
10100
|
+
(0, import_react107.useEffect)(() => {
|
|
9071
10101
|
const onPopState = () => {
|
|
9072
10102
|
dispatch({ type: SET_PATH, path: window.location.pathname });
|
|
9073
10103
|
};
|
|
@@ -9076,7 +10106,7 @@
|
|
|
9076
10106
|
window.removeEventListener(POP_STATE, onPopState);
|
|
9077
10107
|
};
|
|
9078
10108
|
}, []);
|
|
9079
|
-
const pushState = (0,
|
|
10109
|
+
const pushState = (0, import_react107.useCallback)((path) => {
|
|
9080
10110
|
const h1 = window.location.hash;
|
|
9081
10111
|
history.pushState(null, "", `${path}`);
|
|
9082
10112
|
const h2 = window.location.hash;
|
|
@@ -9085,7 +10115,7 @@
|
|
|
9085
10115
|
}
|
|
9086
10116
|
dispatch({ type: SET_PATH, path });
|
|
9087
10117
|
}, []);
|
|
9088
|
-
const replaceState = (0,
|
|
10118
|
+
const replaceState = (0, import_react107.useCallback)((path) => {
|
|
9089
10119
|
const h1 = window.location.hash;
|
|
9090
10120
|
history.replaceState(null, "", path);
|
|
9091
10121
|
const h2 = window.location.hash;
|
|
@@ -9094,8 +10124,8 @@
|
|
|
9094
10124
|
}
|
|
9095
10125
|
dispatch({ type: SET_PATH, path });
|
|
9096
10126
|
}, []);
|
|
9097
|
-
const id = (0,
|
|
9098
|
-
const value = (0,
|
|
10127
|
+
const id = (0, import_react107.useMemo)(() => state.path.match(regexGuidAnyWhere)?.pop(), [state.path]);
|
|
10128
|
+
const value = (0, import_react107.useMemo)(
|
|
9099
10129
|
() => ({
|
|
9100
10130
|
...state,
|
|
9101
10131
|
previousPath,
|
|
@@ -9105,7 +10135,7 @@
|
|
|
9105
10135
|
}),
|
|
9106
10136
|
[state]
|
|
9107
10137
|
);
|
|
9108
|
-
return /* @__PURE__ */
|
|
10138
|
+
return /* @__PURE__ */ import_react107.default.createElement(PathContext.Provider, {
|
|
9109
10139
|
value
|
|
9110
10140
|
}, children);
|
|
9111
10141
|
};
|
|
@@ -9125,33 +10155,33 @@
|
|
|
9125
10155
|
children
|
|
9126
10156
|
}) => {
|
|
9127
10157
|
useEcom_default(ecomSettings);
|
|
9128
|
-
return /* @__PURE__ */
|
|
10158
|
+
return /* @__PURE__ */ import_react108.default.createElement(PathProvider_default, null, /* @__PURE__ */ import_react108.default.createElement(SettingsProvider_default, {
|
|
9129
10159
|
googleMapsApiKey,
|
|
9130
10160
|
googleMapsMarker,
|
|
9131
10161
|
ecomSettings
|
|
9132
|
-
}, /* @__PURE__ */
|
|
10162
|
+
}, /* @__PURE__ */ import_react108.default.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ import_react108.default.createElement(graphqlProvider_default, {
|
|
9133
10163
|
uri: graphQlUrl
|
|
9134
|
-
}, /* @__PURE__ */
|
|
10164
|
+
}, /* @__PURE__ */ import_react108.default.createElement(SearchProvider_default, {
|
|
9135
10165
|
url,
|
|
9136
10166
|
apiKey,
|
|
9137
10167
|
useQueryParamsFromUrl,
|
|
9138
10168
|
pathRoute
|
|
9139
|
-
}, /* @__PURE__ */
|
|
10169
|
+
}, /* @__PURE__ */ import_react108.default.createElement(RelatedSearchProvider_default, {
|
|
9140
10170
|
url,
|
|
9141
10171
|
urlMlt,
|
|
9142
10172
|
apiKey
|
|
9143
|
-
}, /* @__PURE__ */
|
|
10173
|
+
}, /* @__PURE__ */ import_react108.default.createElement(themeProvider_default, null, /* @__PURE__ */ import_react108.default.createElement(Root_default, null, children))))))));
|
|
9144
10174
|
};
|
|
9145
10175
|
var WaykeProvider_default = WaykeProvider;
|
|
9146
10176
|
|
|
9147
10177
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
9148
|
-
var
|
|
10178
|
+
var import_react111 = __toESM(__require("react"));
|
|
9149
10179
|
|
|
9150
10180
|
// src/layouts/WaykeComposite.tsx
|
|
9151
|
-
var
|
|
10181
|
+
var import_react110 = __toESM(__require("react"));
|
|
9152
10182
|
|
|
9153
10183
|
// src/hooks/useHashGuid.ts
|
|
9154
|
-
var
|
|
10184
|
+
var import_react109 = __require("react");
|
|
9155
10185
|
var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
9156
10186
|
var HASH_CHANGE = "hashchange";
|
|
9157
10187
|
var getGuid = () => {
|
|
@@ -9159,7 +10189,7 @@
|
|
|
9159
10189
|
return regexGuid.test(guid) || !guid ? guid : void 0;
|
|
9160
10190
|
};
|
|
9161
10191
|
var useHashGuid = () => {
|
|
9162
|
-
const [id, setId] = (0,
|
|
10192
|
+
const [id, setId] = (0, import_react109.useState)(() => getGuid());
|
|
9163
10193
|
const onHashChange = () => {
|
|
9164
10194
|
const guid = window.location.hash.substr(1, window.location.hash.length);
|
|
9165
10195
|
if (regexGuid.test(guid) || !guid) {
|
|
@@ -9168,7 +10198,7 @@
|
|
|
9168
10198
|
throw "Invalid Guid";
|
|
9169
10199
|
}
|
|
9170
10200
|
};
|
|
9171
|
-
(0,
|
|
10201
|
+
(0, import_react109.useEffect)(() => {
|
|
9172
10202
|
onHashChange();
|
|
9173
10203
|
window.addEventListener(HASH_CHANGE, onHashChange);
|
|
9174
10204
|
return () => {
|
|
@@ -9193,7 +10223,7 @@
|
|
|
9193
10223
|
}) => {
|
|
9194
10224
|
const hashId = useHashGuid_default();
|
|
9195
10225
|
const { id: pathId } = usePath_default();
|
|
9196
|
-
(0,
|
|
10226
|
+
(0, import_react110.useEffect)(() => {
|
|
9197
10227
|
if (!pathRoute) {
|
|
9198
10228
|
if (hashId) {
|
|
9199
10229
|
pubsub_default.publish("HashRouteChange", hashId);
|
|
@@ -9203,14 +10233,14 @@
|
|
|
9203
10233
|
}
|
|
9204
10234
|
}, [hashId]);
|
|
9205
10235
|
const id = pathId || hashId;
|
|
9206
|
-
return /* @__PURE__ */
|
|
10236
|
+
return /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, id ? /* @__PURE__ */ import_react110.default.createElement(searchItem_default, {
|
|
9207
10237
|
id,
|
|
9208
10238
|
hashRoute: !pathRoute,
|
|
9209
10239
|
disableResetScrollOnInit,
|
|
9210
10240
|
placeholderImage,
|
|
9211
10241
|
pathRoute,
|
|
9212
10242
|
modifyDocumentTitleItem
|
|
9213
|
-
}) : /* @__PURE__ */
|
|
10243
|
+
}) : /* @__PURE__ */ import_react110.default.createElement(search_default, {
|
|
9214
10244
|
filterList,
|
|
9215
10245
|
initialQueryParams,
|
|
9216
10246
|
removeSearchBar,
|
|
@@ -9224,15 +10254,15 @@
|
|
|
9224
10254
|
var WaykeComposite_default = WaykeComposite;
|
|
9225
10255
|
|
|
9226
10256
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
9227
|
-
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */
|
|
10257
|
+
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */ import_react111.default.createElement(WaykeProvider_default, {
|
|
9228
10258
|
...provider
|
|
9229
|
-
}, /* @__PURE__ */
|
|
10259
|
+
}, /* @__PURE__ */ import_react111.default.createElement(WaykeComposite_default, {
|
|
9230
10260
|
...composite
|
|
9231
10261
|
}));
|
|
9232
10262
|
var WaykeCompositeWithProvider_default = WaykeCompositeWithProvider;
|
|
9233
10263
|
|
|
9234
10264
|
// src/providers/WaykeItemProvidet.tsx
|
|
9235
|
-
var
|
|
10265
|
+
var import_react112 = __toESM(__require("react"));
|
|
9236
10266
|
var WaykeItemProvider = ({
|
|
9237
10267
|
url,
|
|
9238
10268
|
urlMlt,
|
|
@@ -9244,17 +10274,17 @@
|
|
|
9244
10274
|
children
|
|
9245
10275
|
}) => {
|
|
9246
10276
|
useEcom_default(ecomSettings);
|
|
9247
|
-
return /* @__PURE__ */
|
|
10277
|
+
return /* @__PURE__ */ import_react112.default.createElement(PathProvider_default, null, /* @__PURE__ */ import_react112.default.createElement(SettingsProvider_default, {
|
|
9248
10278
|
googleMapsApiKey,
|
|
9249
10279
|
googleMapsMarker,
|
|
9250
10280
|
ecomSettings
|
|
9251
|
-
}, /* @__PURE__ */
|
|
10281
|
+
}, /* @__PURE__ */ import_react112.default.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ import_react112.default.createElement(graphqlProvider_default, {
|
|
9252
10282
|
uri: graphQlUrl
|
|
9253
|
-
}, /* @__PURE__ */
|
|
10283
|
+
}, /* @__PURE__ */ import_react112.default.createElement(RelatedSearchProvider_default, {
|
|
9254
10284
|
url,
|
|
9255
10285
|
urlMlt,
|
|
9256
10286
|
apiKey
|
|
9257
|
-
}, /* @__PURE__ */
|
|
10287
|
+
}, /* @__PURE__ */ import_react112.default.createElement(themeProvider_default, null, /* @__PURE__ */ import_react112.default.createElement(Root_default, null, children)))))));
|
|
9258
10288
|
};
|
|
9259
10289
|
var WaykeItemProvidet_default = WaykeItemProvider;
|
|
9260
10290
|
|