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