@wayke-se/components-react 3.0.0-beta.6 → 3.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1958 -928
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1926 -896
- package/dist/index.mjs.map +4 -4
- package/esbuild/common.js +1 -1
- package/esbuild/lib.js +0 -1
- package/esbuild/start.js +1 -0
- package/package.json +1 -1
- package/src/components/Gallery/index.tsx +2 -6
- package/src/utils/formats.ts +1 -1
- package/www/index.html +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2106,7 +2106,7 @@ var Loader_default = Loader;
|
|
|
2106
2106
|
|
|
2107
2107
|
// src/utils/formats.ts
|
|
2108
2108
|
import { format as formatFns } from "date-fns";
|
|
2109
|
-
import
|
|
2109
|
+
import sv from "date-fns/locale/sv";
|
|
2110
2110
|
|
|
2111
2111
|
// src/utils/constants.ts
|
|
2112
2112
|
var MANUFACTURER = "manufacturer";
|
|
@@ -2310,6 +2310,12 @@ var IconChevronLeft = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2,
|
|
|
2310
2310
|
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2311
2311
|
d: "M13 17.7L4.3 9 13 .3l.7.7-8 8 8 8-.7.7z"
|
|
2312
2312
|
}));
|
|
2313
|
+
var IconChevronRight = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2314
|
+
viewBox: "0 0 18 18",
|
|
2315
|
+
block
|
|
2316
|
+
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2317
|
+
d: "M5 .3L13.7 9 5 17.7l-.7-.7 8-8-8-8L5 .3z"
|
|
2318
|
+
}));
|
|
2313
2319
|
var IconCheck = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2314
2320
|
viewBox: "0 0 16 16",
|
|
2315
2321
|
block
|
|
@@ -4516,7 +4522,7 @@ var WaykeSearch = ({
|
|
|
4516
4522
|
var search_default = WaykeSearch;
|
|
4517
4523
|
|
|
4518
4524
|
// src/layouts/searchItem/index.tsx
|
|
4519
|
-
import
|
|
4525
|
+
import React94, { useMemo as useMemo6, useRef as useRef4, useCallback as useCallback38, useEffect as useEffect18 } from "react";
|
|
4520
4526
|
import WaykeEcomWeb from "@wayke-se/ecom-web";
|
|
4521
4527
|
|
|
4522
4528
|
// src/components/PriceTable/index.tsx
|
|
@@ -4795,184 +4801,1406 @@ var ExtendContent = ({ children, actionTitle, onClick }) => {
|
|
|
4795
4801
|
var ExtendContent_default = ExtendContent;
|
|
4796
4802
|
|
|
4797
4803
|
// src/components/Gallery/index.tsx
|
|
4798
|
-
import
|
|
4804
|
+
import React50, { useState as useState15, useCallback as useCallback18, useRef as useRef3, useMemo as useMemo3 } from "react";
|
|
4805
|
+
import Slider3 from "react-slick";
|
|
4799
4806
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
if (element) {
|
|
4810
|
-
scrollIntoView(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
4811
|
-
}
|
|
4812
|
-
setIndex(newIndex);
|
|
4813
|
-
}, []);
|
|
4814
|
-
const onMouseDown = useCallback14(() => {
|
|
4815
|
-
if (isDragging.current) {
|
|
4816
|
-
isDragging.current = false;
|
|
4817
|
-
}
|
|
4818
|
-
}, []);
|
|
4819
|
-
const onMouseMove = useCallback14(() => {
|
|
4820
|
-
if (!isDragging.current) {
|
|
4821
|
-
isDragging.current = true;
|
|
4822
|
-
}
|
|
4823
|
-
}, []);
|
|
4824
|
-
const onClick = useCallback14(() => {
|
|
4825
|
-
pubsub_default.publish("ImagesClick");
|
|
4826
|
-
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
4827
|
-
setLightbox(true);
|
|
4828
|
-
}
|
|
4829
|
-
}, [lightbox, media]);
|
|
4830
|
-
const nextImage = useCallback14(() => {
|
|
4831
|
-
if (!slider || !slider.current) {
|
|
4832
|
-
return;
|
|
4833
|
-
}
|
|
4834
|
-
slider.current.slickNext();
|
|
4835
|
-
}, [slider]);
|
|
4836
|
-
const prevImage = useCallback14(() => {
|
|
4837
|
-
if (!slider || !slider.current) {
|
|
4838
|
-
return;
|
|
4839
|
-
}
|
|
4840
|
-
slider.current.slickPrev();
|
|
4841
|
-
}, [slider]);
|
|
4842
|
-
const goTo = (target) => {
|
|
4843
|
-
if (!slider || !slider.current) {
|
|
4844
|
-
return;
|
|
4845
|
-
}
|
|
4846
|
-
if (slider.current) {
|
|
4847
|
-
setIndex(target);
|
|
4848
|
-
slider.current.slickGoTo(target);
|
|
4807
|
+
|
|
4808
|
+
// src/components/Gallery/wrapper.tsx
|
|
4809
|
+
import styled33, { css as css12 } from "styled-components";
|
|
4810
|
+
var quickNavWidth = 83;
|
|
4811
|
+
var Wrapper17 = styled33.div`
|
|
4812
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
4813
|
+
${Wrapper} & {
|
|
4814
|
+
margin-left: ${size(-3)};
|
|
4815
|
+
margin-right: ${size(-3)};
|
|
4849
4816
|
}
|
|
4850
|
-
}
|
|
4851
|
-
const onDisableNavigation = () => {
|
|
4852
|
-
if (!isDragging.current)
|
|
4853
|
-
setNavigationDisabled(true);
|
|
4854
|
-
};
|
|
4855
|
-
const onEnableNavigation = (e) => {
|
|
4856
|
-
e.stopPropagation();
|
|
4857
|
-
isDragging.current = false;
|
|
4858
|
-
setNavigationDisabled(false);
|
|
4859
|
-
};
|
|
4860
|
-
const onToggleLightbox = useCallback14(() => setLightbox(!lightbox), [lightbox]);
|
|
4861
|
-
const mediaLength = media?.length || 0;
|
|
4862
|
-
const placeholder = useMemo3(
|
|
4863
|
-
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
4864
|
-
[placeholderImage]
|
|
4865
|
-
);
|
|
4866
|
-
return /* @__PURE__ */ React38.createElement("p", null, "heheh");
|
|
4867
|
-
};
|
|
4868
|
-
var Gallery_default = Gallery;
|
|
4817
|
+
}
|
|
4869
4818
|
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4819
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
4820
|
+
${Wrapper} & {
|
|
4821
|
+
margin-left: ${size(-2)};
|
|
4822
|
+
margin-right: ${size(-2)};
|
|
4823
|
+
}
|
|
4824
|
+
}
|
|
4875
4825
|
|
|
4876
4826
|
${(props) => props.theme.breakpoint.Md} {
|
|
4877
|
-
|
|
4827
|
+
position: relative;
|
|
4828
|
+
padding-right: ${quickNavWidth}px;
|
|
4878
4829
|
}
|
|
4879
4830
|
`;
|
|
4880
|
-
var
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4831
|
+
var Main = styled33.div`
|
|
4832
|
+
position: relative;
|
|
4833
|
+
height: 0;
|
|
4834
|
+
padding-bottom: 66.66666667%;
|
|
4884
4835
|
|
|
4885
4836
|
${(props) => props.theme.breakpoint.Md} {
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4837
|
+
//background-color: ${(props) => props.theme.color.accent};
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
.slick-slider,
|
|
4841
|
+
.slick-list,
|
|
4842
|
+
.slick-track,
|
|
4843
|
+
.slick-slide,
|
|
4844
|
+
.slick-slide > * {
|
|
4845
|
+
height: 100%;
|
|
4846
|
+
}
|
|
4847
|
+
|
|
4848
|
+
.slick-slide > * {
|
|
4849
|
+
font-size: 0;
|
|
4850
|
+
|
|
4851
|
+
> * {
|
|
4852
|
+
font-size: 1rem;
|
|
4853
|
+
}
|
|
4889
4854
|
}
|
|
4890
4855
|
`;
|
|
4891
|
-
var
|
|
4856
|
+
var Alt = styled33.div`
|
|
4857
|
+
position: absolute;
|
|
4858
|
+
top: 0;
|
|
4859
|
+
bottom: 0;
|
|
4860
|
+
right: 0;
|
|
4861
|
+
width: ${quickNavWidth}px;
|
|
4862
|
+
padding-left: ${size(1)};
|
|
4863
|
+
|
|
4892
4864
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4893
|
-
display:
|
|
4865
|
+
display: none;
|
|
4894
4866
|
}
|
|
4895
4867
|
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4868
|
+
:after {
|
|
4869
|
+
content: '';
|
|
4870
|
+
position: absolute;
|
|
4871
|
+
bottom: 0;
|
|
4872
|
+
left: 0;
|
|
4873
|
+
right: 0;
|
|
4874
|
+
height: ${size(2.5)};
|
|
4875
|
+
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
|
4876
|
+
pointer-events: none;
|
|
4900
4877
|
}
|
|
4901
4878
|
`;
|
|
4902
|
-
var
|
|
4879
|
+
var Item8 = styled33.div`
|
|
4880
|
+
position: relative;
|
|
4881
|
+
width: 100%;
|
|
4882
|
+
height: 100%;
|
|
4883
|
+
overflow: hidden;
|
|
4884
|
+
|
|
4885
|
+
:focus {
|
|
4886
|
+
outline: none;
|
|
4887
|
+
}
|
|
4888
|
+
|
|
4903
4889
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4904
|
-
|
|
4890
|
+
//background-color: ${(props) => props.theme.color.textDark};
|
|
4891
|
+
transition: border-radius 150ms ease;
|
|
4892
|
+
}
|
|
4893
|
+
`;
|
|
4894
|
+
var SliderWrapper = styled33.div`
|
|
4895
|
+
position: absolute;
|
|
4896
|
+
top: 0;
|
|
4897
|
+
bottom: 0;
|
|
4898
|
+
left: 0;
|
|
4899
|
+
right: 0;
|
|
4905
4900
|
|
|
4906
|
-
|
|
4907
|
-
|
|
4901
|
+
.slick-slider {
|
|
4902
|
+
position: absolute;
|
|
4903
|
+
top: 0;
|
|
4904
|
+
bottom: 0;
|
|
4905
|
+
left: 0;
|
|
4906
|
+
right: 0;
|
|
4907
|
+
user-select: none;
|
|
4908
|
+
touch-action: pan-y;
|
|
4909
|
+
-webkit-tap-highlight-color: transparent;
|
|
4910
|
+
|
|
4911
|
+
.slick-list,
|
|
4912
|
+
.slick-track {
|
|
4913
|
+
transform: translate3d(0, 0, 0);
|
|
4908
4914
|
}
|
|
4915
|
+
}
|
|
4909
4916
|
|
|
4910
|
-
|
|
4911
|
-
|
|
4917
|
+
.slick-list {
|
|
4918
|
+
position: relative;
|
|
4919
|
+
display: block;
|
|
4920
|
+
margin: 0;
|
|
4921
|
+
padding: 0;
|
|
4922
|
+
overflow: hidden;
|
|
4923
|
+
|
|
4924
|
+
&:focus {
|
|
4925
|
+
outline: none;
|
|
4912
4926
|
}
|
|
4913
4927
|
|
|
4914
|
-
|
|
4915
|
-
|
|
4928
|
+
&.dragging {
|
|
4929
|
+
cursor: pointer;
|
|
4930
|
+
cursor: hand;
|
|
4916
4931
|
}
|
|
4917
4932
|
}
|
|
4918
4933
|
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4934
|
+
.slick-track {
|
|
4935
|
+
position: relative;
|
|
4936
|
+
top: 0;
|
|
4937
|
+
left: 0;
|
|
4938
|
+
display: block;
|
|
4939
|
+
margin-left: auto;
|
|
4940
|
+
margin-right: auto;
|
|
4941
|
+
|
|
4942
|
+
&::before,
|
|
4943
|
+
&::after {
|
|
4944
|
+
content: '';
|
|
4945
|
+
display: table;
|
|
4922
4946
|
}
|
|
4923
4947
|
|
|
4924
|
-
|
|
4925
|
-
|
|
4948
|
+
&::after {
|
|
4949
|
+
clear: both;
|
|
4926
4950
|
}
|
|
4927
4951
|
}
|
|
4928
|
-
`;
|
|
4929
|
-
var ProductPageMainSection = styled33.div`
|
|
4930
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
4931
|
-
order: 99;
|
|
4932
|
-
padding: ${size(4)} 0;
|
|
4933
|
-
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
4934
4952
|
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4953
|
+
.slick-slide {
|
|
4954
|
+
display: none;
|
|
4955
|
+
float: left;
|
|
4956
|
+
min-height: 1px;
|
|
4957
|
+
}
|
|
4958
|
+
|
|
4959
|
+
.slick-loading {
|
|
4960
|
+
.slick-track {
|
|
4961
|
+
visibility: hidden;
|
|
4962
|
+
}
|
|
4963
|
+
|
|
4964
|
+
img {
|
|
4965
|
+
display: none;
|
|
4940
4966
|
}
|
|
4941
4967
|
}
|
|
4942
4968
|
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4969
|
+
.slick-initialized {
|
|
4970
|
+
.slick-slide {
|
|
4971
|
+
display: block;
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
|
|
4975
|
+
.slick-slide.dragging img {
|
|
4976
|
+
pointer-events: none;
|
|
4977
|
+
}
|
|
4978
|
+
|
|
4979
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
4980
|
+
overflow: hidden;
|
|
4981
|
+
|
|
4982
|
+
.slick-list {
|
|
4983
|
+
overflow: visible;
|
|
4984
|
+
width: 95%;
|
|
4985
|
+
}
|
|
4986
|
+
|
|
4987
|
+
.slick-slide {
|
|
4988
|
+
border-right: ${size(1)} solid ${(props) => props.theme.color.bg};
|
|
4989
|
+
//transform: scale(0.95);
|
|
4990
|
+
transform-origin: 0 50%;
|
|
4991
|
+
transition: transform 150ms ease;
|
|
4992
|
+
}
|
|
4993
|
+
|
|
4994
|
+
.slick-slide.slick-active {
|
|
4995
|
+
transform: none;
|
|
4996
|
+
|
|
4997
|
+
${Item8} {
|
|
4998
|
+
border-top-left-radius: 0;
|
|
4999
|
+
border-bottom-left-radius: 0;
|
|
5000
|
+
}
|
|
4948
5001
|
}
|
|
4949
5002
|
}
|
|
4950
5003
|
`;
|
|
4951
|
-
var
|
|
4952
|
-
|
|
5004
|
+
var Image2 = styled33.img`
|
|
5005
|
+
display: block;
|
|
5006
|
+
position: absolute;
|
|
5007
|
+
left: 0;
|
|
5008
|
+
top: 0;
|
|
5009
|
+
right: 0;
|
|
5010
|
+
bottom: 0;
|
|
5011
|
+
margin: auto;
|
|
5012
|
+
max-width: 100%;
|
|
5013
|
+
max-height: 100%;
|
|
5014
|
+
object-fit: cover;
|
|
5015
|
+
cursor: pointer;
|
|
5016
|
+
`;
|
|
5017
|
+
var ImageFull = styled33.img`
|
|
5018
|
+
display: block;
|
|
5019
|
+
position: absolute;
|
|
5020
|
+
top: 0;
|
|
5021
|
+
left: 0;
|
|
5022
|
+
width: 100%;
|
|
5023
|
+
height: 100%;
|
|
5024
|
+
object-fit: cover;
|
|
4953
5025
|
`;
|
|
5026
|
+
var Arrow = styled33(ButtonReset)`
|
|
5027
|
+
position: absolute;
|
|
5028
|
+
top: 50%;
|
|
5029
|
+
transform: translateY(-50%);
|
|
5030
|
+
display: flex;
|
|
5031
|
+
align-items: center;
|
|
5032
|
+
justify-content: center;
|
|
5033
|
+
width: ${size(4)};
|
|
5034
|
+
height: ${size(4)};
|
|
5035
|
+
border-radius: 50%;
|
|
5036
|
+
font-size: 1rem;
|
|
5037
|
+
line-height: 1;
|
|
5038
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
5039
|
+
backdrop-filter: blur(5px);
|
|
5040
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5041
|
+
color: ${(props) => props.theme.color.textDark};
|
|
5042
|
+
transform-origin: 50% 50%;
|
|
5043
|
+
transition: transform 200ms ease;
|
|
4954
5044
|
|
|
4955
|
-
|
|
4956
|
-
|
|
5045
|
+
:before {
|
|
5046
|
+
content: '';
|
|
5047
|
+
position: absolute;
|
|
5048
|
+
top: 0;
|
|
5049
|
+
bottom: 0;
|
|
5050
|
+
left: 0;
|
|
5051
|
+
right: 0;
|
|
5052
|
+
border-radius: 50%;
|
|
5053
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
5054
|
+
opacity: 0;
|
|
5055
|
+
transition: opacity 200ms ease;
|
|
5056
|
+
}
|
|
4957
5057
|
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
current
|
|
4963
|
-
default
|
|
4964
|
-
max
|
|
4965
|
-
min
|
|
4966
|
-
step
|
|
5058
|
+
:hover {
|
|
5059
|
+
:before {
|
|
5060
|
+
opacity: 1;
|
|
5061
|
+
}
|
|
4967
5062
|
}
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
from
|
|
4972
|
-
until
|
|
5063
|
+
|
|
5064
|
+
:active {
|
|
5065
|
+
transform: translateY(-50%) scale(0.95);
|
|
4973
5066
|
}
|
|
4974
|
-
|
|
4975
|
-
|
|
5067
|
+
|
|
5068
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5069
|
+
display: none;
|
|
5070
|
+
}
|
|
5071
|
+
`;
|
|
5072
|
+
var ArrowLeft = styled33(Arrow)`
|
|
5073
|
+
left: ${size(2)};
|
|
5074
|
+
`;
|
|
5075
|
+
var ArrowRight = styled33(Arrow)`
|
|
5076
|
+
right: ${size(2)};
|
|
5077
|
+
`;
|
|
5078
|
+
var QuickNav = styled33.ul`
|
|
5079
|
+
position: relative;
|
|
5080
|
+
max-height: 100%;
|
|
5081
|
+
list-style: none;
|
|
5082
|
+
padding: 0;
|
|
5083
|
+
margin: 0;
|
|
5084
|
+
overflow: auto;
|
|
5085
|
+
-webkit-overflow-scrolling: touch;
|
|
5086
|
+
`;
|
|
5087
|
+
var QuickNavItem = styled33.li.attrs(() => ({
|
|
5088
|
+
className: "wayke__theme wayke__color--primary-text"
|
|
5089
|
+
}))`
|
|
5090
|
+
position: relative;
|
|
5091
|
+
|
|
5092
|
+
& + & {
|
|
5093
|
+
margin-top: ${size(1)};
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5096
|
+
${({ active }) => active && css12`
|
|
5097
|
+
:before {
|
|
5098
|
+
content: '';
|
|
5099
|
+
position: absolute;
|
|
5100
|
+
top: 0;
|
|
5101
|
+
left: 0;
|
|
5102
|
+
width: 100%;
|
|
5103
|
+
height: 100%;
|
|
5104
|
+
border: 3px solid currentColor;
|
|
5105
|
+
z-index: 2;
|
|
5106
|
+
}
|
|
5107
|
+
`}
|
|
5108
|
+
`;
|
|
5109
|
+
var QuickNavBtn = styled33(ButtonReset)`
|
|
5110
|
+
position: relative;
|
|
5111
|
+
display: block;
|
|
5112
|
+
width: 100%;
|
|
5113
|
+
height: 0;
|
|
5114
|
+
padding-bottom: 66.66666667%; // 3:2
|
|
5115
|
+
transform-origin: 50% 50%;
|
|
5116
|
+
transition: transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5117
|
+
|
|
5118
|
+
:before {
|
|
5119
|
+
content: '';
|
|
5120
|
+
position: absolute;
|
|
5121
|
+
top: 0;
|
|
5122
|
+
left: 0;
|
|
5123
|
+
width: 100%;
|
|
5124
|
+
height: 100%;
|
|
5125
|
+
background-color: rgba(0, 0, 0, 0.15);
|
|
5126
|
+
opacity: 0;
|
|
5127
|
+
z-index: 1;
|
|
5128
|
+
transition: opacity 150ms ease;
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
:hover {
|
|
5132
|
+
:before {
|
|
5133
|
+
opacity: 1;
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
|
|
5137
|
+
:active {
|
|
5138
|
+
transform: scale(0.95);
|
|
5139
|
+
}
|
|
5140
|
+
`;
|
|
5141
|
+
var QuickNavImg = styled33.img`
|
|
5142
|
+
display: block;
|
|
5143
|
+
position: absolute;
|
|
5144
|
+
top: 0;
|
|
5145
|
+
left: 0;
|
|
5146
|
+
width: 100%;
|
|
5147
|
+
height: 100%;
|
|
5148
|
+
object-fit: cover;
|
|
5149
|
+
`;
|
|
5150
|
+
var MediaButtonWrapper = styled33.div`
|
|
5151
|
+
position: absolute;
|
|
5152
|
+
bottom: ${size(2)};
|
|
5153
|
+
left: 50%;
|
|
5154
|
+
transform: translateX(-50%);
|
|
5155
|
+
z-index: 1;
|
|
5156
|
+
`;
|
|
5157
|
+
var EnableNavigationButton = styled33.div`
|
|
5158
|
+
position: absolute;
|
|
5159
|
+
bottom: ${size(2)};
|
|
5160
|
+
left: 50%;
|
|
5161
|
+
transform: translateX(-50%);
|
|
5162
|
+
z-index: 1;
|
|
5163
|
+
`;
|
|
5164
|
+
|
|
5165
|
+
// src/components/Lightbox/index.tsx
|
|
5166
|
+
import React45 from "react";
|
|
5167
|
+
|
|
5168
|
+
// src/components/Lightbox/wrapper.tsx
|
|
5169
|
+
import styled34 from "styled-components";
|
|
5170
|
+
var Wrapper18 = styled34.div`
|
|
5171
|
+
position: fixed;
|
|
5172
|
+
top: 0;
|
|
5173
|
+
bottom: 0;
|
|
5174
|
+
left: 0;
|
|
5175
|
+
right: 0;
|
|
5176
|
+
padding: ${size(3)};
|
|
5177
|
+
z-index: 90;
|
|
5178
|
+
overflow: auto;
|
|
5179
|
+
|
|
5180
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5181
|
+
padding: ${size(2)};
|
|
5182
|
+
}
|
|
5183
|
+
`;
|
|
5184
|
+
var UiBlock2 = styled34.div.attrs(() => ({
|
|
5185
|
+
role: "button"
|
|
5186
|
+
}))`
|
|
5187
|
+
position: fixed;
|
|
5188
|
+
top: 0;
|
|
5189
|
+
bottom: 0;
|
|
5190
|
+
left: 0;
|
|
5191
|
+
right: 0;
|
|
5192
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
5193
|
+
z-index: -1;
|
|
5194
|
+
`;
|
|
5195
|
+
var Item9 = styled34.div`
|
|
5196
|
+
position: relative;
|
|
5197
|
+
|
|
5198
|
+
& + & {
|
|
5199
|
+
margin-top: ${size(1)};
|
|
5200
|
+
}
|
|
5201
|
+
`;
|
|
5202
|
+
var Img2 = styled34.img`
|
|
5203
|
+
position: relative;
|
|
5204
|
+
display: block;
|
|
5205
|
+
max-width: 100%;
|
|
5206
|
+
max-height: calc(100vh - ${size(6)});
|
|
5207
|
+
margin: 0 auto;
|
|
5208
|
+
z-index: 1;
|
|
5209
|
+
|
|
5210
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5211
|
+
max-height: calc(100vh - ${size(4)});
|
|
5212
|
+
}
|
|
5213
|
+
`;
|
|
5214
|
+
var CloseBtn2 = styled34(ButtonReset)`
|
|
5215
|
+
display: flex;
|
|
5216
|
+
align-items: center;
|
|
5217
|
+
justify-content: center;
|
|
5218
|
+
position: fixed;
|
|
5219
|
+
top: ${size(2)};
|
|
5220
|
+
right: ${size(2)};
|
|
5221
|
+
width: ${size(5)};
|
|
5222
|
+
height: ${size(5)};
|
|
5223
|
+
border-radius: 50%;
|
|
5224
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
5225
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5226
|
+
transform-origin: 50% 50%;
|
|
5227
|
+
transition: 200ms ease, transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5228
|
+
z-index: 1;
|
|
5229
|
+
|
|
5230
|
+
:before {
|
|
5231
|
+
content: '';
|
|
5232
|
+
position: absolute;
|
|
5233
|
+
top: 0;
|
|
5234
|
+
left: 0;
|
|
5235
|
+
width: 100%;
|
|
5236
|
+
height: 100%;
|
|
5237
|
+
background-color: ${(props) => props.theme.color.hoverOverlay};
|
|
5238
|
+
border-radius: 50%;
|
|
5239
|
+
opacity: 0;
|
|
5240
|
+
transition: opacity 150ms ease;
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
:hover {
|
|
5244
|
+
:before {
|
|
5245
|
+
opacity: 1;
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5248
|
+
|
|
5249
|
+
:active {
|
|
5250
|
+
transform: scale(0.97);
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5253
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5254
|
+
top: ${size(1)};
|
|
5255
|
+
right: ${size(1)};
|
|
5256
|
+
}
|
|
5257
|
+
`;
|
|
5258
|
+
|
|
5259
|
+
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5260
|
+
import React41 from "react";
|
|
5261
|
+
|
|
5262
|
+
// src/components/Video/YoutubePlayer.tsx
|
|
5263
|
+
import React38 from "react";
|
|
5264
|
+
|
|
5265
|
+
// src/components/Video/utils.ts
|
|
5266
|
+
var getVimeoId = (url) => {
|
|
5267
|
+
const regExp = /\/(\d+)/;
|
|
5268
|
+
const match = url.match(regExp);
|
|
5269
|
+
return match && match[1].length > 3 ? match[1] : "";
|
|
5270
|
+
};
|
|
5271
|
+
var getYouTubeId = (url) => {
|
|
5272
|
+
const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
|
5273
|
+
const match = url.match(regExp);
|
|
5274
|
+
return match && match[7].length === 11 ? match[7] : "";
|
|
5275
|
+
};
|
|
5276
|
+
var youtubeBase = "https://img.youtube.com/vi/";
|
|
5277
|
+
var getYoutubeThumbnail = (url) => {
|
|
5278
|
+
const id = getYouTubeId(url);
|
|
5279
|
+
if (!id) {
|
|
5280
|
+
return void 0;
|
|
5281
|
+
}
|
|
5282
|
+
return {
|
|
5283
|
+
maxresdefault: `${youtubeBase}${id}/maxresdefault.jpg`,
|
|
5284
|
+
hqdefault: `${youtubeBase}${id}/hqdefault.jpg`,
|
|
5285
|
+
mqdefault: `${youtubeBase}${id}/mqdefault.jpg`
|
|
5286
|
+
};
|
|
5287
|
+
};
|
|
5288
|
+
var onImageLoad = (e, thumbnail) => {
|
|
5289
|
+
if (thumbnail?.length === 2 && e.currentTarget.src === thumbnail[0] && e.currentTarget.naturalWidth === 120 && e.currentTarget.naturalHeight === 90) {
|
|
5290
|
+
e.currentTarget.src = thumbnail[1];
|
|
5291
|
+
}
|
|
5292
|
+
};
|
|
5293
|
+
var onImageError = (e, thumbnail) => {
|
|
5294
|
+
if (thumbnail?.length === 2) {
|
|
5295
|
+
e.currentTarget.src = thumbnail[1];
|
|
5296
|
+
}
|
|
5297
|
+
};
|
|
5298
|
+
|
|
5299
|
+
// src/components/Video/wrapper.tsx
|
|
5300
|
+
import styled35 from "styled-components";
|
|
5301
|
+
var Wrapper19 = styled35.div`
|
|
5302
|
+
position: relative;
|
|
5303
|
+
width: 100%;
|
|
5304
|
+
height: ${(props) => props.isPreview ? "100%" : 0};
|
|
5305
|
+
padding-bottom: ${(props) => props.ratio ? props.ratio : "56.25%"};
|
|
5306
|
+
`;
|
|
5307
|
+
var Iframe = styled35.iframe.attrs(() => ({
|
|
5308
|
+
width: "100%",
|
|
5309
|
+
height: "100%",
|
|
5310
|
+
allowFullScreen: true,
|
|
5311
|
+
frameBorder: "0"
|
|
5312
|
+
}))`
|
|
5313
|
+
position: absolute;
|
|
5314
|
+
top: 0;
|
|
5315
|
+
left: 0;
|
|
5316
|
+
width: 100%;
|
|
5317
|
+
height: 100%;
|
|
5318
|
+
`;
|
|
5319
|
+
|
|
5320
|
+
// src/components/Video/YoutubePlayer.tsx
|
|
5321
|
+
var YouTubePlayer = ({ url, autoplay }) => /* @__PURE__ */ React38.createElement(Wrapper19, null, /* @__PURE__ */ React38.createElement(Iframe, {
|
|
5322
|
+
src: `https://www.youtube.com/embed/${getYouTubeId(url)}?&enablejsapi=1&?rel=0${autoplay ? "&autoplay=1" : ""}`
|
|
5323
|
+
}));
|
|
5324
|
+
var YoutubePlayer_default = YouTubePlayer;
|
|
5325
|
+
|
|
5326
|
+
// src/components/Video/VimeoPlayer.tsx
|
|
5327
|
+
import React39 from "react";
|
|
5328
|
+
var VimeoPlayer = ({ url, autoplay }) => /* @__PURE__ */ React39.createElement(Wrapper19, null, /* @__PURE__ */ React39.createElement(Iframe, {
|
|
5329
|
+
src: `https://player.vimeo.com/video/${getVimeoId(url)}?${autoplay ? "&autoplay=1" : ""}&loop=0&autopause=0`
|
|
5330
|
+
}));
|
|
5331
|
+
var VimeoPlayer_default = VimeoPlayer;
|
|
5332
|
+
|
|
5333
|
+
// src/components/Video/CustomPlayer.tsx
|
|
5334
|
+
import React40 from "react";
|
|
5335
|
+
|
|
5336
|
+
// src/components/Video/Video.tsx
|
|
5337
|
+
import styled36 from "styled-components";
|
|
5338
|
+
var Video = styled36.video`
|
|
5339
|
+
position: absolute;
|
|
5340
|
+
top: 0;
|
|
5341
|
+
left: 0;
|
|
5342
|
+
object-fit: ${({ modal }) => modal ? "contain" : "cover"};
|
|
5343
|
+
`;
|
|
5344
|
+
var Video_default = Video;
|
|
5345
|
+
|
|
5346
|
+
// src/components/Video/CustomPlayer.tsx
|
|
5347
|
+
var CustomPlayer = ({ url, controls, modal, ratio = "56.25%", isPreview }) => {
|
|
5348
|
+
return /* @__PURE__ */ React40.createElement(Wrapper19, {
|
|
5349
|
+
ratio,
|
|
5350
|
+
isPreview
|
|
5351
|
+
}, /* @__PURE__ */ React40.createElement(Video_default, {
|
|
5352
|
+
key: url,
|
|
5353
|
+
modal,
|
|
5354
|
+
preload: "metadata",
|
|
5355
|
+
controls,
|
|
5356
|
+
width: "100%",
|
|
5357
|
+
height: "100%",
|
|
5358
|
+
src: url
|
|
5359
|
+
}));
|
|
5360
|
+
};
|
|
5361
|
+
var CustomPlayer_default = CustomPlayer;
|
|
5362
|
+
|
|
5363
|
+
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5364
|
+
var ytNames = ["youtube.com", "youtu.be"];
|
|
5365
|
+
var isYouTubeVideo = (url) => ytNames.some((host) => url.indexOf(host) >= 0);
|
|
5366
|
+
var vNames = ["vimeo.com"];
|
|
5367
|
+
var isVimeoVideo = (url) => vNames.some((host) => url.indexOf(host) >= 0);
|
|
5368
|
+
var VideoPlayer = ({ url, autoplay = false, controls = true }) => {
|
|
5369
|
+
if (!url)
|
|
5370
|
+
return null;
|
|
5371
|
+
if (isYouTubeVideo(url))
|
|
5372
|
+
return /* @__PURE__ */ React41.createElement(YoutubePlayer_default, {
|
|
5373
|
+
url,
|
|
5374
|
+
autoplay
|
|
5375
|
+
});
|
|
5376
|
+
if (isVimeoVideo(url))
|
|
5377
|
+
return /* @__PURE__ */ React41.createElement(VimeoPlayer_default, {
|
|
5378
|
+
url,
|
|
5379
|
+
autoplay
|
|
5380
|
+
});
|
|
5381
|
+
return /* @__PURE__ */ React41.createElement(CustomPlayer_default, {
|
|
5382
|
+
ratio: "56.25%",
|
|
5383
|
+
controls,
|
|
5384
|
+
url
|
|
5385
|
+
});
|
|
5386
|
+
};
|
|
5387
|
+
var EmbeddedVideoLightbox_default = VideoPlayer;
|
|
5388
|
+
|
|
5389
|
+
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5390
|
+
import React44, { useState as useState10, useCallback as useCallback14 } from "react";
|
|
5391
|
+
|
|
5392
|
+
// src/components/Gallery/MediaButton.tsx
|
|
5393
|
+
import React42 from "react";
|
|
5394
|
+
var MediaButton = ({ text, onClick }) => /* @__PURE__ */ React42.createElement(MediaButtonWrapper, null, /* @__PURE__ */ React42.createElement(ButtonSecondary, {
|
|
5395
|
+
onClick,
|
|
5396
|
+
title: text
|
|
5397
|
+
}, /* @__PURE__ */ React42.createElement(ButtonContent, null, text)));
|
|
5398
|
+
var MediaButton_default = MediaButton;
|
|
5399
|
+
|
|
5400
|
+
// src/components/ThreeSixty/Rotation.tsx
|
|
5401
|
+
import React43, { useState as useState9, useEffect as useEffect7, useRef as useRef2, cloneElement, Children } from "react";
|
|
5402
|
+
var calculateCurrentFrame = (startFrame, delta, length) => {
|
|
5403
|
+
const frame = (startFrame + delta) % length;
|
|
5404
|
+
if (frame < 0) {
|
|
5405
|
+
return frame + length;
|
|
5406
|
+
}
|
|
5407
|
+
return frame;
|
|
5408
|
+
};
|
|
5409
|
+
var Rotation = ({ children }) => {
|
|
5410
|
+
const startFrame = useRef2(0);
|
|
5411
|
+
const pointerPosition = useRef2();
|
|
5412
|
+
const max = useRef2(0);
|
|
5413
|
+
const [state, setState] = useState9({
|
|
5414
|
+
current: 0,
|
|
5415
|
+
outsideMouseMove: false
|
|
5416
|
+
});
|
|
5417
|
+
useEffect7(() => {
|
|
5418
|
+
document.addEventListener("mouseup", touchEnd);
|
|
5419
|
+
return () => {
|
|
5420
|
+
window.document.removeEventListener("mouseup", touchEnd);
|
|
5421
|
+
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5422
|
+
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5423
|
+
};
|
|
5424
|
+
}, []);
|
|
5425
|
+
const touchMove = (event) => {
|
|
5426
|
+
const notTouched = typeof pointerPosition.current !== "number";
|
|
5427
|
+
event.preventDefault();
|
|
5428
|
+
if (notTouched) {
|
|
5429
|
+
return;
|
|
5430
|
+
}
|
|
5431
|
+
const childCount = Children.count(children);
|
|
5432
|
+
const { offsetWidth } = event.currentTarget;
|
|
5433
|
+
const pointer = calculatePointerPosition(event);
|
|
5434
|
+
const max2 = offsetWidth;
|
|
5435
|
+
const offset = pointer - (pointerPosition.current || 0);
|
|
5436
|
+
const delta = Math.floor(offset / max2 * childCount);
|
|
5437
|
+
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5438
|
+
};
|
|
5439
|
+
const mouseMove = (event) => {
|
|
5440
|
+
const notTouched = typeof pointerPosition.current !== "number";
|
|
5441
|
+
event.preventDefault();
|
|
5442
|
+
if (notTouched || !state.outsideMouseMove)
|
|
5443
|
+
return;
|
|
5444
|
+
const childCount = Children.count(children);
|
|
5445
|
+
const pointer = calculatePointerPosition(event);
|
|
5446
|
+
const offset = pointer - (pointerPosition.current || 0);
|
|
5447
|
+
const delta = Math.floor(offset / max.current * childCount);
|
|
5448
|
+
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5449
|
+
};
|
|
5450
|
+
const mouseUp = () => {
|
|
5451
|
+
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5452
|
+
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5453
|
+
pointerPosition.current = void 0;
|
|
5454
|
+
startFrame.current = 0;
|
|
5455
|
+
};
|
|
5456
|
+
const touchStart = (event) => {
|
|
5457
|
+
event.preventDefault();
|
|
5458
|
+
pointerPosition.current = calculatePointerPosition(event);
|
|
5459
|
+
startFrame.current = state.current;
|
|
5460
|
+
const { offsetWidth } = event.currentTarget;
|
|
5461
|
+
max.current = offsetWidth;
|
|
5462
|
+
window.document.body.addEventListener("mousemove", mouseMove);
|
|
5463
|
+
window.document.body.addEventListener("mouseup", mouseUp);
|
|
5464
|
+
};
|
|
5465
|
+
const touchEnd = (event) => {
|
|
5466
|
+
event.preventDefault();
|
|
5467
|
+
pointerPosition.current = void 0;
|
|
5468
|
+
startFrame.current = 0;
|
|
5469
|
+
};
|
|
5470
|
+
const onMouseEnter = () => {
|
|
5471
|
+
if (state.outsideMouseMove)
|
|
5472
|
+
setState({ ...state, outsideMouseMove: false });
|
|
5473
|
+
};
|
|
5474
|
+
const onMouseLeave = () => {
|
|
5475
|
+
if (!state.outsideMouseMove)
|
|
5476
|
+
setState({ ...state, outsideMouseMove: true });
|
|
5477
|
+
};
|
|
5478
|
+
const setCurrentFrame = (current) => {
|
|
5479
|
+
if (current !== state.current) {
|
|
5480
|
+
setState({ ...state, current });
|
|
5481
|
+
}
|
|
5482
|
+
};
|
|
5483
|
+
const calculatePointerPosition = (event) => {
|
|
5484
|
+
const { clientX } = event.type.indexOf("touch") === 0 ? event.changedTouches[0] : event;
|
|
5485
|
+
const { offsetLeft } = event.currentTarget;
|
|
5486
|
+
return clientX - offsetLeft;
|
|
5487
|
+
};
|
|
5488
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
|
5489
|
+
onTouchStart: touchStart,
|
|
5490
|
+
onTouchMove: touchMove,
|
|
5491
|
+
onTouchEnd: touchEnd,
|
|
5492
|
+
onMouseDown: touchStart,
|
|
5493
|
+
onMouseMove: touchMove,
|
|
5494
|
+
onMouseEnter,
|
|
5495
|
+
onMouseLeave
|
|
5496
|
+
}, Children.map(
|
|
5497
|
+
children,
|
|
5498
|
+
(child, i) => cloneElement(child, {
|
|
5499
|
+
style: {
|
|
5500
|
+
width: "100%",
|
|
5501
|
+
display: state.current === i ? "block" : "none"
|
|
5502
|
+
}
|
|
5503
|
+
})
|
|
5504
|
+
));
|
|
5505
|
+
};
|
|
5506
|
+
var Rotation_default = Rotation;
|
|
5507
|
+
|
|
5508
|
+
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5509
|
+
var ThreeSixtyLightbox = ({ urls }) => {
|
|
5510
|
+
const [started2, setStarted] = useState10(false);
|
|
5511
|
+
const onStart = useCallback14(() => setStarted(true), []);
|
|
5512
|
+
if (!started2) {
|
|
5513
|
+
return /* @__PURE__ */ React44.createElement(Item9, null, /* @__PURE__ */ React44.createElement(Img2, {
|
|
5514
|
+
src: urls[0],
|
|
5515
|
+
alt: "alt"
|
|
5516
|
+
}), /* @__PURE__ */ React44.createElement(MediaButton_default, {
|
|
5517
|
+
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5518
|
+
onClick: onStart
|
|
5519
|
+
}));
|
|
5520
|
+
}
|
|
5521
|
+
return /* @__PURE__ */ React44.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React44.createElement(Img2, {
|
|
5522
|
+
key: image,
|
|
5523
|
+
src: image,
|
|
5524
|
+
alt: `Bild ${i + 1}`
|
|
5525
|
+
})));
|
|
5526
|
+
};
|
|
5527
|
+
var ThreeSixtLightbox_default = ThreeSixtyLightbox;
|
|
5528
|
+
|
|
5529
|
+
// src/components/Lightbox/index.tsx
|
|
5530
|
+
var Lightbox = ({ index: index2, media, onClose }) => {
|
|
5531
|
+
const onRef = (ref) => {
|
|
5532
|
+
if (ref) {
|
|
5533
|
+
setTimeout(() => {
|
|
5534
|
+
ref.scrollIntoView();
|
|
5535
|
+
}, 300);
|
|
5536
|
+
}
|
|
5537
|
+
};
|
|
5538
|
+
const onKeyDown = (e) => {
|
|
5539
|
+
if (e.keyCode === 27) {
|
|
5540
|
+
onClose();
|
|
5541
|
+
}
|
|
5542
|
+
};
|
|
5543
|
+
return /* @__PURE__ */ React45.createElement(Wrapper18, {
|
|
5544
|
+
ref: (ref) => ref?.focus(),
|
|
5545
|
+
onKeyDown,
|
|
5546
|
+
tabIndex: 0
|
|
5547
|
+
}, /* @__PURE__ */ React45.createElement(UiBlock2, {
|
|
5548
|
+
onClick: onClose,
|
|
5549
|
+
"aria-hidden": true
|
|
5550
|
+
}), media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React45.createElement(Item9, {
|
|
5551
|
+
key: i,
|
|
5552
|
+
ref: index2 === i ? onRef : void 0
|
|
5553
|
+
}, m.type === "image" && /* @__PURE__ */ React45.createElement(Img2, {
|
|
5554
|
+
id: `lightbox-image-${i}`,
|
|
5555
|
+
src: m.files[0].url,
|
|
5556
|
+
alt: `Bild ${i + 1}`
|
|
5557
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React45.createElement(ThreeSixtLightbox_default, {
|
|
5558
|
+
urls: m.files.map((x) => x.url)
|
|
5559
|
+
}), m.type === "embedded" && /* @__PURE__ */ React45.createElement(EmbeddedVideoLightbox_default, {
|
|
5560
|
+
url: m.files[0].url
|
|
5561
|
+
}))), /* @__PURE__ */ React45.createElement(CloseBtn2, {
|
|
5562
|
+
onClick: onClose,
|
|
5563
|
+
title: "St\xE4ng"
|
|
5564
|
+
}, /* @__PURE__ */ React45.createElement(IconCancel, {
|
|
5565
|
+
block: true
|
|
5566
|
+
})));
|
|
5567
|
+
};
|
|
5568
|
+
var Lightbox_default = Lightbox;
|
|
5569
|
+
|
|
5570
|
+
// src/components/Video/EmbededVideo.tsx
|
|
5571
|
+
import React47, { useState as useState14, useCallback as useCallback16 } from "react";
|
|
5572
|
+
|
|
5573
|
+
// src/components/Video/useThumbnail.ts
|
|
5574
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
5575
|
+
|
|
5576
|
+
// src/hooks/useVimeoThumbnail.ts
|
|
5577
|
+
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
5578
|
+
|
|
5579
|
+
// src/hooks/useFetch.ts
|
|
5580
|
+
import { useEffect as useEffect8, useState as useState11, useCallback as useCallback15 } from "react";
|
|
5581
|
+
var cache = {};
|
|
5582
|
+
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
5583
|
+
var setCachedResult = (key, value) => {
|
|
5584
|
+
cache[key] = value;
|
|
5585
|
+
};
|
|
5586
|
+
var pendingPromise = {};
|
|
5587
|
+
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
5588
|
+
var setPendingPromise = (url, promise) => {
|
|
5589
|
+
pendingPromise = {
|
|
5590
|
+
...pendingPromise,
|
|
5591
|
+
[url]: promise
|
|
5592
|
+
};
|
|
5593
|
+
};
|
|
5594
|
+
var clearPendingPromise = (url) => {
|
|
5595
|
+
delete pendingPromise[url];
|
|
5596
|
+
};
|
|
5597
|
+
var useFetch = (path, options, skip, promiseCache) => {
|
|
5598
|
+
const [data, setData] = useState11();
|
|
5599
|
+
const [loading, setLoading] = useState11(false);
|
|
5600
|
+
const [error, setError] = useState11(false);
|
|
5601
|
+
const doFetch = useCallback15(async () => {
|
|
5602
|
+
const key = path.toString();
|
|
5603
|
+
const cached = getCachedResult(key);
|
|
5604
|
+
setError(false);
|
|
5605
|
+
if (cached) {
|
|
5606
|
+
setData(cached);
|
|
5607
|
+
return;
|
|
5608
|
+
}
|
|
5609
|
+
setLoading(true);
|
|
5610
|
+
try {
|
|
5611
|
+
const reusePromise = promiseCache && isPendingPromise(key);
|
|
5612
|
+
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
5613
|
+
if (promiseCache) {
|
|
5614
|
+
setPendingPromise(key, request);
|
|
5615
|
+
}
|
|
5616
|
+
const result = await request;
|
|
5617
|
+
if (result.ok) {
|
|
5618
|
+
const json2 = await result.clone().json();
|
|
5619
|
+
setCachedResult(key, json2);
|
|
5620
|
+
setData(json2);
|
|
5621
|
+
}
|
|
5622
|
+
} catch (e) {
|
|
5623
|
+
setError(true);
|
|
5624
|
+
} finally {
|
|
5625
|
+
setLoading(false);
|
|
5626
|
+
clearPendingPromise(key);
|
|
5627
|
+
}
|
|
5628
|
+
return;
|
|
5629
|
+
}, [path, options]);
|
|
5630
|
+
useEffect8(() => {
|
|
5631
|
+
if (!skip) {
|
|
5632
|
+
doFetch();
|
|
5633
|
+
}
|
|
5634
|
+
}, [path, skip]);
|
|
5635
|
+
return {
|
|
5636
|
+
loading,
|
|
5637
|
+
data,
|
|
5638
|
+
error
|
|
5639
|
+
};
|
|
5640
|
+
};
|
|
5641
|
+
var useFetch_default = useFetch;
|
|
5642
|
+
|
|
5643
|
+
// src/hooks/useVimeoThumbnail.ts
|
|
5644
|
+
var useVimeoThumbnail = (id, small) => {
|
|
5645
|
+
const [thumbnail, setThumbnail] = useState12();
|
|
5646
|
+
const { data } = useFetch_default(
|
|
5647
|
+
`http://vimeo.com/api/v2/video/${id}.json`,
|
|
5648
|
+
{},
|
|
5649
|
+
!id || !!thumbnail,
|
|
5650
|
+
true
|
|
5651
|
+
);
|
|
5652
|
+
useEffect9(() => {
|
|
5653
|
+
if (data?.[0]) {
|
|
5654
|
+
if (small && data[0].thumbnail_small) {
|
|
5655
|
+
setThumbnail(data[0].thumbnail_small);
|
|
5656
|
+
} else if (data[0].thumbnail_large) {
|
|
5657
|
+
setThumbnail(data[0].thumbnail_large);
|
|
5658
|
+
}
|
|
5659
|
+
}
|
|
5660
|
+
}, [data]);
|
|
5661
|
+
return thumbnail;
|
|
5662
|
+
};
|
|
5663
|
+
var useVimeoThumbnail_default = useVimeoThumbnail;
|
|
5664
|
+
|
|
5665
|
+
// src/components/Video/useThumbnail.ts
|
|
5666
|
+
var useThumbnail = (url, small) => {
|
|
5667
|
+
if (url?.toLowerCase().endsWith(".mp4"))
|
|
5668
|
+
return;
|
|
5669
|
+
const [thumbnail, setThumbnail] = useState13();
|
|
5670
|
+
const vimeoId = url ? getVimeoId(url) : void 0;
|
|
5671
|
+
const vimeoThumbnail = useVimeoThumbnail_default(vimeoId, small);
|
|
5672
|
+
useEffect10(() => {
|
|
5673
|
+
if (url) {
|
|
5674
|
+
const youtubeThumbnail = getYoutubeThumbnail(url);
|
|
5675
|
+
if (youtubeThumbnail) {
|
|
5676
|
+
if (small) {
|
|
5677
|
+
setThumbnail([youtubeThumbnail.mqdefault]);
|
|
5678
|
+
} else {
|
|
5679
|
+
setThumbnail([youtubeThumbnail.maxresdefault, youtubeThumbnail.hqdefault]);
|
|
5680
|
+
}
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5683
|
+
}, [url]);
|
|
5684
|
+
return vimeoThumbnail ? [vimeoThumbnail] : thumbnail;
|
|
5685
|
+
};
|
|
5686
|
+
var useThumbnail_default = useThumbnail;
|
|
5687
|
+
|
|
5688
|
+
// src/components/Modal/index.tsx
|
|
5689
|
+
import * as React46 from "react";
|
|
5690
|
+
|
|
5691
|
+
// src/components/Modal/wrapper.tsx
|
|
5692
|
+
import styled37 from "styled-components";
|
|
5693
|
+
var Wrapper20 = styled37.div.attrs(() => ({
|
|
5694
|
+
role: "dialog"
|
|
5695
|
+
}))`
|
|
5696
|
+
position: fixed;
|
|
5697
|
+
top: 0;
|
|
5698
|
+
bottom: 0;
|
|
5699
|
+
left: 0;
|
|
5700
|
+
right: 0;
|
|
5701
|
+
width: 100%;
|
|
5702
|
+
white-space: normal;
|
|
5703
|
+
text-align: left;
|
|
5704
|
+
z-index: 90;
|
|
5705
|
+
display: flex;
|
|
5706
|
+
align-items: center;
|
|
5707
|
+
justify-content: center;
|
|
5708
|
+
|
|
5709
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5710
|
+
padding: ${size(2)};
|
|
5711
|
+
}
|
|
5712
|
+
`;
|
|
5713
|
+
var UiBlock3 = styled37.div.attrs(() => ({
|
|
5714
|
+
"aria-hidden": "true",
|
|
5715
|
+
role: "button"
|
|
5716
|
+
}))`
|
|
5717
|
+
position: fixed;
|
|
5718
|
+
top: 0;
|
|
5719
|
+
bottom: 0;
|
|
5720
|
+
left: 0;
|
|
5721
|
+
right: 0;
|
|
5722
|
+
background-color: rgba(0, 0, 0, 0.35);
|
|
5723
|
+
z-index: -1;
|
|
5724
|
+
|
|
5725
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
5726
|
+
animation: ${fadeIn} 300ms ease forwards;
|
|
5727
|
+
}
|
|
5728
|
+
|
|
5729
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
5730
|
+
animation: ${fadeIn} 400ms ease forwards;
|
|
5731
|
+
}
|
|
5732
|
+
`;
|
|
5733
|
+
var Dialog = styled37.article.attrs(() => ({
|
|
5734
|
+
className: "wayke__theme wayke__font--regular"
|
|
5735
|
+
}))`
|
|
5736
|
+
display: flex;
|
|
5737
|
+
flex-direction: column;
|
|
5738
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
5739
|
+
z-index: 1;
|
|
5740
|
+
width: 100%;
|
|
5741
|
+
max-width: 680px;
|
|
5742
|
+
max-height: 100%;
|
|
5743
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
5744
|
+
overflow: hidden;
|
|
5745
|
+
|
|
5746
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5747
|
+
align-self: flex-end;
|
|
5748
|
+
transform: translateY(100%);
|
|
5749
|
+
animation: ${noTransform} 300ms ease forwards;
|
|
5750
|
+
}
|
|
5751
|
+
|
|
5752
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5753
|
+
transform: translateY(${size(2)});
|
|
5754
|
+
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
5755
|
+
}
|
|
5756
|
+
`;
|
|
5757
|
+
var Content4 = styled37.div`
|
|
5758
|
+
flex: 1 1 auto;
|
|
5759
|
+
overflow: auto;
|
|
5760
|
+
-webkit-overflow-scrolling: touch;
|
|
5761
|
+
`;
|
|
5762
|
+
var Header4 = styled37.header`
|
|
5763
|
+
display: flex;
|
|
5764
|
+
align-items: center;
|
|
5765
|
+
min-height: 60px;
|
|
5766
|
+
padding: ${size(3)};
|
|
5767
|
+
padding-bottom: 0;
|
|
5768
|
+
`;
|
|
5769
|
+
var Heading5 = styled37.div`
|
|
5770
|
+
flex: 1 1 auto;
|
|
5771
|
+
|
|
5772
|
+
${H1} {
|
|
5773
|
+
font-size: 1.5rem;
|
|
5774
|
+
}
|
|
5775
|
+
`;
|
|
5776
|
+
var Close2 = styled37.div`
|
|
5777
|
+
flex-shrink: 0;
|
|
5778
|
+
margin: ${size(-2)};
|
|
5779
|
+
padding-left: ${size(3)};
|
|
5780
|
+
`;
|
|
5781
|
+
var CloseBtn3 = styled37(ButtonReset)`
|
|
5782
|
+
display: block;
|
|
5783
|
+
padding: ${size(2)};
|
|
5784
|
+
`;
|
|
5785
|
+
var Body4 = styled37.div`
|
|
5786
|
+
padding: ${size(3)};
|
|
5787
|
+
`;
|
|
5788
|
+
var Image3 = styled37.img`
|
|
5789
|
+
display: block;
|
|
5790
|
+
width: calc(100% + ${size(6)});
|
|
5791
|
+
margin-left: ${size(-3)};
|
|
5792
|
+
margin-bottom: ${size(3)};
|
|
5793
|
+
`;
|
|
5794
|
+
var ModalFoldout = styled37.div`
|
|
5795
|
+
background-color: ${(props) => props.theme.color.accent};
|
|
5796
|
+
margin: ${size(-3)};
|
|
5797
|
+
margin-top: ${size(3)};
|
|
5798
|
+
padding: ${size(3)};
|
|
5799
|
+
`;
|
|
5800
|
+
var ModalFoldoutBody = styled37.div``;
|
|
5801
|
+
|
|
5802
|
+
// src/components/Modal/index.tsx
|
|
5803
|
+
var Modal = ({ id, title, onClose, children }) => {
|
|
5804
|
+
return /* @__PURE__ */ React46.createElement(portal_default, {
|
|
5805
|
+
id: id || portal_namespace_exports.DefaultPortal
|
|
5806
|
+
}, /* @__PURE__ */ React46.createElement(Wrapper20, {
|
|
5807
|
+
onClick: (e) => e.stopPropagation()
|
|
5808
|
+
}, /* @__PURE__ */ React46.createElement(UiBlock3, {
|
|
5809
|
+
onClick: onClose,
|
|
5810
|
+
title: "St\xE4ng modal"
|
|
5811
|
+
}), /* @__PURE__ */ React46.createElement(Dialog, null, /* @__PURE__ */ React46.createElement(Content4, null, /* @__PURE__ */ React46.createElement(Header4, null, /* @__PURE__ */ React46.createElement(Heading5, null, /* @__PURE__ */ React46.createElement(H1, {
|
|
5812
|
+
noMargin: true
|
|
5813
|
+
}, title)), /* @__PURE__ */ React46.createElement(Close2, null, /* @__PURE__ */ React46.createElement(CloseBtn3, {
|
|
5814
|
+
onClick: onClose,
|
|
5815
|
+
title: "St\xE4ng modal"
|
|
5816
|
+
}, /* @__PURE__ */ React46.createElement(IconCancel, {
|
|
5817
|
+
block: true
|
|
5818
|
+
})))), /* @__PURE__ */ React46.createElement(Body4, null, children)))));
|
|
5819
|
+
};
|
|
5820
|
+
var Modal_default = Modal;
|
|
5821
|
+
|
|
5822
|
+
// src/components/Video/EmbededVideo.tsx
|
|
5823
|
+
var GalleryEmbed = ({ src, index: index2 }) => {
|
|
5824
|
+
const [modal, setModal] = useState14();
|
|
5825
|
+
const thumbnail = useThumbnail_default(src);
|
|
5826
|
+
const onClick = (e) => {
|
|
5827
|
+
e.stopPropagation();
|
|
5828
|
+
setModal(src);
|
|
5829
|
+
};
|
|
5830
|
+
const onCloseModal = (e) => {
|
|
5831
|
+
e.stopPropagation();
|
|
5832
|
+
setModal(void 0);
|
|
5833
|
+
};
|
|
5834
|
+
const onError = useCallback16(
|
|
5835
|
+
(e) => onImageError(e, thumbnail),
|
|
5836
|
+
[thumbnail]
|
|
5837
|
+
);
|
|
5838
|
+
const onLoad = useCallback16(
|
|
5839
|
+
(e) => onImageLoad(e, thumbnail),
|
|
5840
|
+
[thumbnail]
|
|
5841
|
+
);
|
|
5842
|
+
const customVideo = src.toLowerCase().endsWith(".mp4");
|
|
5843
|
+
if (thumbnail?.length && !customVideo) {
|
|
5844
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(ImageFull, {
|
|
5845
|
+
onLoad,
|
|
5846
|
+
src: thumbnail[0],
|
|
5847
|
+
onError,
|
|
5848
|
+
alt: `Bild ${index2 + 1}`
|
|
5849
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
5850
|
+
text: "Spela video",
|
|
5851
|
+
onClick
|
|
5852
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
5853
|
+
title: "Video",
|
|
5854
|
+
onClose: onCloseModal
|
|
5855
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
5856
|
+
url: modal
|
|
5857
|
+
})));
|
|
5858
|
+
}
|
|
5859
|
+
if (customVideo)
|
|
5860
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(CustomPlayer_default, {
|
|
5861
|
+
ratio: "66.66%",
|
|
5862
|
+
isPreview: true,
|
|
5863
|
+
controls: false,
|
|
5864
|
+
url: src
|
|
5865
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
5866
|
+
text: "Spela video",
|
|
5867
|
+
onClick
|
|
5868
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
5869
|
+
title: "Video",
|
|
5870
|
+
onClose: onCloseModal
|
|
5871
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
5872
|
+
url: modal
|
|
5873
|
+
})));
|
|
5874
|
+
return null;
|
|
5875
|
+
};
|
|
5876
|
+
var EmbededVideo_default = GalleryEmbed;
|
|
5877
|
+
|
|
5878
|
+
// src/components/Video/QuickNavEmbeded.tsx
|
|
5879
|
+
import React48, { useCallback as useCallback17 } from "react";
|
|
5880
|
+
var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
5881
|
+
const thumbnail = useThumbnail_default(src);
|
|
5882
|
+
const onError = useCallback17(
|
|
5883
|
+
(e) => onImageError(e, thumbnail),
|
|
5884
|
+
[thumbnail]
|
|
5885
|
+
);
|
|
5886
|
+
const onLoad = useCallback17(
|
|
5887
|
+
(e) => onImageLoad(e, thumbnail),
|
|
5888
|
+
[thumbnail]
|
|
5889
|
+
);
|
|
5890
|
+
const customVideo = src?.toLowerCase().endsWith(".mp4");
|
|
5891
|
+
if (thumbnail?.length && !customVideo)
|
|
5892
|
+
return /* @__PURE__ */ React48.createElement(QuickNavImg, {
|
|
5893
|
+
onLoad,
|
|
5894
|
+
src: thumbnail[0],
|
|
5895
|
+
onError,
|
|
5896
|
+
alt: `Bild ${index2 + 1}`
|
|
5897
|
+
});
|
|
5898
|
+
if (customVideo)
|
|
5899
|
+
return /* @__PURE__ */ React48.createElement(CustomPlayer_default, {
|
|
5900
|
+
key: index2,
|
|
5901
|
+
url: src,
|
|
5902
|
+
ratio: "66.66%"
|
|
5903
|
+
});
|
|
5904
|
+
return null;
|
|
5905
|
+
};
|
|
5906
|
+
var QuickNavEmbeded_default = QuickNavEmbeded;
|
|
5907
|
+
|
|
5908
|
+
// src/components/ThreeSixty/ThreeSixty.tsx
|
|
5909
|
+
import React49 from "react";
|
|
5910
|
+
var onMediaClick = (e, func) => {
|
|
5911
|
+
e.stopPropagation();
|
|
5912
|
+
e.preventDefault();
|
|
5913
|
+
func();
|
|
5914
|
+
};
|
|
5915
|
+
var ThreeSixty = ({ urls, visible, onDisableNavigation, navigationDisabled }) => {
|
|
5916
|
+
if (!visible || !navigationDisabled && visible) {
|
|
5917
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Image2, {
|
|
5918
|
+
src: urls[0],
|
|
5919
|
+
alt: "alt"
|
|
5920
|
+
}), /* @__PURE__ */ React49.createElement(MediaButton_default, {
|
|
5921
|
+
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5922
|
+
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
5923
|
+
}));
|
|
5924
|
+
}
|
|
5925
|
+
if (navigationDisabled && visible) {
|
|
5926
|
+
return /* @__PURE__ */ React49.createElement("div", {
|
|
5927
|
+
onClick: (e) => {
|
|
5928
|
+
e.stopPropagation();
|
|
5929
|
+
e.preventDefault();
|
|
5930
|
+
}
|
|
5931
|
+
}, /* @__PURE__ */ React49.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React49.createElement(Image2, {
|
|
5932
|
+
key: image,
|
|
5933
|
+
src: image,
|
|
5934
|
+
alt: `Bild ${i + 1}`
|
|
5935
|
+
}))));
|
|
5936
|
+
}
|
|
5937
|
+
return null;
|
|
5938
|
+
};
|
|
5939
|
+
var ThreeSixty_default = ThreeSixty;
|
|
5940
|
+
|
|
5941
|
+
// src/components/Gallery/index.tsx
|
|
5942
|
+
var sliderSettings = {
|
|
5943
|
+
dots: false,
|
|
5944
|
+
arrows: false,
|
|
5945
|
+
infinite: true,
|
|
5946
|
+
speed: 300,
|
|
5947
|
+
slidesToShow: 1,
|
|
5948
|
+
slidesToScroll: 1
|
|
5949
|
+
};
|
|
5950
|
+
var Gallery = ({ media, placeholderImage }) => {
|
|
5951
|
+
const slider = useRef3(null);
|
|
5952
|
+
const quickNavRef = useRef3(null);
|
|
5953
|
+
const isDragging = useRef3(false);
|
|
5954
|
+
const [index2, setIndex] = useState15(0);
|
|
5955
|
+
const [lightbox, setLightbox] = useState15(false);
|
|
5956
|
+
const [navigationDisabled, setNavigationDisabled] = useState15(false);
|
|
5957
|
+
const beforeChange = useCallback18((_, newIndex) => {
|
|
5958
|
+
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
5959
|
+
if (element) {
|
|
5960
|
+
scrollIntoView(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
5961
|
+
}
|
|
5962
|
+
setIndex(newIndex);
|
|
5963
|
+
}, []);
|
|
5964
|
+
const onMouseDown = useCallback18(() => {
|
|
5965
|
+
if (isDragging.current) {
|
|
5966
|
+
isDragging.current = false;
|
|
5967
|
+
}
|
|
5968
|
+
}, []);
|
|
5969
|
+
const onMouseMove = useCallback18(() => {
|
|
5970
|
+
if (!isDragging.current) {
|
|
5971
|
+
isDragging.current = true;
|
|
5972
|
+
}
|
|
5973
|
+
}, []);
|
|
5974
|
+
const onClick = useCallback18(() => {
|
|
5975
|
+
pubsub_default.publish("ImagesClick");
|
|
5976
|
+
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
5977
|
+
setLightbox(true);
|
|
5978
|
+
}
|
|
5979
|
+
}, [lightbox, media]);
|
|
5980
|
+
const nextImage = useCallback18(() => {
|
|
5981
|
+
if (!slider || !slider.current) {
|
|
5982
|
+
return;
|
|
5983
|
+
}
|
|
5984
|
+
slider.current.slickNext();
|
|
5985
|
+
}, [slider]);
|
|
5986
|
+
const prevImage = useCallback18(() => {
|
|
5987
|
+
if (!slider || !slider.current) {
|
|
5988
|
+
return;
|
|
5989
|
+
}
|
|
5990
|
+
slider.current.slickPrev();
|
|
5991
|
+
}, [slider]);
|
|
5992
|
+
const goTo = (target) => {
|
|
5993
|
+
if (!slider || !slider.current) {
|
|
5994
|
+
return;
|
|
5995
|
+
}
|
|
5996
|
+
if (slider.current) {
|
|
5997
|
+
setIndex(target);
|
|
5998
|
+
slider.current.slickGoTo(target);
|
|
5999
|
+
}
|
|
6000
|
+
};
|
|
6001
|
+
const onDisableNavigation = () => {
|
|
6002
|
+
if (!isDragging.current)
|
|
6003
|
+
setNavigationDisabled(true);
|
|
6004
|
+
};
|
|
6005
|
+
const onEnableNavigation = (e) => {
|
|
6006
|
+
e.stopPropagation();
|
|
6007
|
+
isDragging.current = false;
|
|
6008
|
+
setNavigationDisabled(false);
|
|
6009
|
+
};
|
|
6010
|
+
const onToggleLightbox = useCallback18(() => setLightbox(!lightbox), [lightbox]);
|
|
6011
|
+
const mediaLength = media?.length || 0;
|
|
6012
|
+
const placeholder = useMemo3(
|
|
6013
|
+
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
6014
|
+
[placeholderImage]
|
|
6015
|
+
);
|
|
6016
|
+
return /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(Wrapper17, null, /* @__PURE__ */ React50.createElement(Main, null, /* @__PURE__ */ React50.createElement(SliderWrapper, {
|
|
6017
|
+
onMouseDown,
|
|
6018
|
+
onMouseMove,
|
|
6019
|
+
onClick
|
|
6020
|
+
}, /* @__PURE__ */ React50.createElement(Slider3, {
|
|
6021
|
+
...sliderSettings,
|
|
6022
|
+
swipe: !navigationDisabled,
|
|
6023
|
+
touchMove: !navigationDisabled,
|
|
6024
|
+
swipeToSlide: !navigationDisabled,
|
|
6025
|
+
ref: slider,
|
|
6026
|
+
beforeChange
|
|
6027
|
+
}, !!media?.length ? media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React50.createElement(Item8, {
|
|
6028
|
+
key: m.files[0].url || i
|
|
6029
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(Image2, {
|
|
6030
|
+
src: m.files[0].formats.filter(notEmpty).find((x) => x.format === "1170x")?.url,
|
|
6031
|
+
alt: `Bild ${i + 1}`
|
|
6032
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(ThreeSixty_default, {
|
|
6033
|
+
urls: m.files.map((x) => x.url),
|
|
6034
|
+
visible: i === index2,
|
|
6035
|
+
onDisableNavigation,
|
|
6036
|
+
navigationDisabled
|
|
6037
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(EmbededVideo_default, {
|
|
6038
|
+
src: m.files[0].url,
|
|
6039
|
+
index: i + 1
|
|
6040
|
+
}))) : /* @__PURE__ */ React50.createElement(Item8, {
|
|
6041
|
+
key: placeholder
|
|
6042
|
+
}, /* @__PURE__ */ React50.createElement(Image2, {
|
|
6043
|
+
src: placeholder,
|
|
6044
|
+
alt: `Bild 1`
|
|
6045
|
+
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(EnableNavigationButton, null, /* @__PURE__ */ React50.createElement(ButtonSecondary, {
|
|
6046
|
+
onClick: onEnableNavigation,
|
|
6047
|
+
title: "St\xE4ng"
|
|
6048
|
+
}, /* @__PURE__ */ React50.createElement(ButtonContent, null, "St\xE4ng")))), !navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(ArrowLeft, {
|
|
6049
|
+
onClick: prevImage,
|
|
6050
|
+
title: "F\xF6reg\xE5ende bild"
|
|
6051
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronLeft, {
|
|
6052
|
+
block: true
|
|
6053
|
+
})), /* @__PURE__ */ React50.createElement(ArrowRight, {
|
|
6054
|
+
onClick: nextImage,
|
|
6055
|
+
title: "N\xE4sta bild"
|
|
6056
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronRight, {
|
|
6057
|
+
block: true
|
|
6058
|
+
})))), /* @__PURE__ */ React50.createElement(Alt, null, /* @__PURE__ */ React50.createElement(QuickNav, {
|
|
6059
|
+
ref: quickNavRef
|
|
6060
|
+
}, !!media?.length ? media.map((m, i) => {
|
|
6061
|
+
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === "225x150")?.url || m.files[0].url;
|
|
6062
|
+
return /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6063
|
+
key: src || i,
|
|
6064
|
+
active: index2 === i
|
|
6065
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6066
|
+
onClick: () => goTo(i),
|
|
6067
|
+
title: `G\xE5 till bild ${i + 1}`
|
|
6068
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6069
|
+
src,
|
|
6070
|
+
alt: `Bild ${i + 1}`
|
|
6071
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6072
|
+
src,
|
|
6073
|
+
alt: `Bild ${i + 1}`
|
|
6074
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(QuickNavEmbeded_default, {
|
|
6075
|
+
src,
|
|
6076
|
+
index: i
|
|
6077
|
+
}), m.type === "sphere" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6078
|
+
src: m.files[0].url,
|
|
6079
|
+
alt: `Bild ${i + 1}`
|
|
6080
|
+
})));
|
|
6081
|
+
}) : /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6082
|
+
key: placeholder,
|
|
6083
|
+
active: true
|
|
6084
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6085
|
+
onClick: () => goTo(0),
|
|
6086
|
+
title: `G\xE5 till bild 0`
|
|
6087
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6088
|
+
src: placeholder,
|
|
6089
|
+
alt: `Bild 1`
|
|
6090
|
+
})))))), lightbox && !!media?.length && /* @__PURE__ */ React50.createElement(Lightbox_default, {
|
|
6091
|
+
media,
|
|
6092
|
+
index: index2,
|
|
6093
|
+
onClose: onToggleLightbox
|
|
6094
|
+
}));
|
|
6095
|
+
};
|
|
6096
|
+
var Gallery_default = Gallery;
|
|
6097
|
+
|
|
6098
|
+
// src/components/ProductPage/index.tsx
|
|
6099
|
+
import styled38 from "styled-components";
|
|
6100
|
+
var ProductPage = styled38.div`
|
|
6101
|
+
display: flex;
|
|
6102
|
+
flex-direction: column;
|
|
6103
|
+
|
|
6104
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6105
|
+
flex-direction: row;
|
|
6106
|
+
}
|
|
6107
|
+
`;
|
|
6108
|
+
var ProductPageAside = styled38.div`
|
|
6109
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6110
|
+
display: contents;
|
|
6111
|
+
}
|
|
6112
|
+
|
|
6113
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6114
|
+
flex-shrink: 0;
|
|
6115
|
+
width: calc(375px + ${size(2)});
|
|
6116
|
+
padding-right: ${size(2)};
|
|
6117
|
+
}
|
|
6118
|
+
`;
|
|
6119
|
+
var ProductPageMain = styled38.div`
|
|
6120
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6121
|
+
display: contents;
|
|
6122
|
+
}
|
|
6123
|
+
|
|
6124
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6125
|
+
flex: 1 1 100%;
|
|
6126
|
+
min-width: 0;
|
|
6127
|
+
padding-left: ${size(2)};
|
|
6128
|
+
}
|
|
6129
|
+
`;
|
|
6130
|
+
var ProductPageAsideSection = styled38.div`
|
|
6131
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6132
|
+
order: ${(props) => props.mobileOrder};
|
|
6133
|
+
|
|
6134
|
+
& + & {
|
|
6135
|
+
margin-top: ${size(2)};
|
|
6136
|
+
}
|
|
6137
|
+
|
|
6138
|
+
:last-child {
|
|
6139
|
+
margin-bottom: ${size(4)};
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6142
|
+
${ProductPageMain} & {
|
|
6143
|
+
margin-top: ${size(2)};
|
|
6144
|
+
}
|
|
6145
|
+
}
|
|
6146
|
+
|
|
6147
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6148
|
+
& + & {
|
|
6149
|
+
margin-top: ${size(4)};
|
|
6150
|
+
}
|
|
6151
|
+
|
|
6152
|
+
${ProductPageMain} & {
|
|
6153
|
+
margin-bottom: ${size(8)};
|
|
6154
|
+
}
|
|
6155
|
+
}
|
|
6156
|
+
`;
|
|
6157
|
+
var ProductPageMainSection = styled38.div`
|
|
6158
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
6159
|
+
order: 99;
|
|
6160
|
+
padding: ${size(4)} 0;
|
|
6161
|
+
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
6162
|
+
|
|
6163
|
+
${Wrapper} & {
|
|
6164
|
+
margin-left: ${size(-2)};
|
|
6165
|
+
margin-right: ${size(-2)};
|
|
6166
|
+
padding-left: ${size(2)};
|
|
6167
|
+
padding-right: ${size(2)};
|
|
6168
|
+
}
|
|
6169
|
+
}
|
|
6170
|
+
|
|
6171
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6172
|
+
& + & {
|
|
6173
|
+
margin-top: ${size(8)};
|
|
6174
|
+
padding-top: ${size(8)};
|
|
6175
|
+
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
6176
|
+
}
|
|
6177
|
+
}
|
|
6178
|
+
`;
|
|
6179
|
+
var ProductPageContentLimit = styled38.div`
|
|
6180
|
+
max-width: 420px;
|
|
6181
|
+
`;
|
|
6182
|
+
|
|
6183
|
+
// src/hooks/useSearchItem.ts
|
|
6184
|
+
import { useQuery } from "@apollo/client";
|
|
6185
|
+
|
|
6186
|
+
// src/queries/SEARCH_ITEM_QUERY.ts
|
|
6187
|
+
import { gql } from "@apollo/client";
|
|
6188
|
+
var FinancialOptionDetail = gql`
|
|
6189
|
+
fragment FinancialOptionDetail on FinancialOptionDetail {
|
|
6190
|
+
current
|
|
6191
|
+
default
|
|
6192
|
+
max
|
|
6193
|
+
min
|
|
6194
|
+
step
|
|
6195
|
+
}
|
|
6196
|
+
`;
|
|
6197
|
+
var HoursOpen = gql`
|
|
6198
|
+
fragment HoursOpen on HoursOpen {
|
|
6199
|
+
from
|
|
6200
|
+
until
|
|
6201
|
+
}
|
|
6202
|
+
`;
|
|
6203
|
+
var SEARCH_ITEM_QUERY = gql`
|
|
4976
6204
|
query SearchItem($id: ID!) {
|
|
4977
6205
|
vehicle(id: $id) {
|
|
4978
6206
|
id
|
|
@@ -5118,231 +6346,97 @@ var SEARCH_ITEM_QUERY = gql`
|
|
|
5118
6346
|
insuranceOptions {
|
|
5119
6347
|
insuranceHeader
|
|
5120
6348
|
institute
|
|
5121
|
-
identifier
|
|
5122
|
-
logotype
|
|
5123
|
-
name
|
|
5124
|
-
description
|
|
5125
|
-
longDescription
|
|
5126
|
-
url
|
|
5127
|
-
insuranceText
|
|
5128
|
-
requiresPersonalNumber
|
|
5129
|
-
requiresDistance
|
|
5130
|
-
terms
|
|
5131
|
-
}
|
|
5132
|
-
financialOptions {
|
|
5133
|
-
description
|
|
5134
|
-
administrationFee
|
|
5135
|
-
downPayment {
|
|
5136
|
-
...FinancialOptionDetail
|
|
5137
|
-
}
|
|
5138
|
-
duration {
|
|
5139
|
-
...FinancialOptionDetail
|
|
5140
|
-
}
|
|
5141
|
-
effectiveInterest
|
|
5142
|
-
image
|
|
5143
|
-
includes
|
|
5144
|
-
includes
|
|
5145
|
-
interest
|
|
5146
|
-
link {
|
|
5147
|
-
title
|
|
5148
|
-
url
|
|
5149
|
-
}
|
|
5150
|
-
loanAmount
|
|
5151
|
-
logotype
|
|
5152
|
-
mileage {
|
|
5153
|
-
...FinancialOptionDetail
|
|
5154
|
-
}
|
|
5155
|
-
monthlyCost
|
|
5156
|
-
name
|
|
5157
|
-
residual {
|
|
5158
|
-
...FinancialOptionDetail
|
|
5159
|
-
}
|
|
5160
|
-
setupFee
|
|
5161
|
-
terms
|
|
5162
|
-
totalCreditCost
|
|
5163
|
-
totalResidualValue
|
|
5164
|
-
type
|
|
5165
|
-
url
|
|
5166
|
-
}
|
|
5167
|
-
media {
|
|
5168
|
-
type
|
|
5169
|
-
files {
|
|
5170
|
-
formats {
|
|
5171
|
-
format
|
|
5172
|
-
url
|
|
5173
|
-
}
|
|
5174
|
-
url
|
|
5175
|
-
}
|
|
5176
|
-
}
|
|
5177
|
-
location {
|
|
5178
|
-
city
|
|
5179
|
-
county
|
|
5180
|
-
streetAddress
|
|
5181
|
-
postalCode
|
|
5182
|
-
}
|
|
5183
|
-
price
|
|
5184
|
-
shortDescription
|
|
5185
|
-
title
|
|
5186
|
-
}
|
|
5187
|
-
}
|
|
5188
|
-
${HoursOpen}
|
|
5189
|
-
${FinancialOptionDetail}
|
|
5190
|
-
`;
|
|
5191
|
-
var SEARCH_ITEM_QUERY_default = SEARCH_ITEM_QUERY;
|
|
5192
|
-
|
|
5193
|
-
// src/hooks/useSearchItem.ts
|
|
5194
|
-
var useSearchItem = (id) => useQuery(SEARCH_ITEM_QUERY_default, {
|
|
5195
|
-
variables: { id },
|
|
5196
|
-
skip: !id
|
|
5197
|
-
});
|
|
5198
|
-
var useSearchItem_default = useSearchItem;
|
|
5199
|
-
|
|
5200
|
-
// src/components/Modal/index.tsx
|
|
5201
|
-
import * as React39 from "react";
|
|
5202
|
-
|
|
5203
|
-
// src/components/Modal/wrapper.tsx
|
|
5204
|
-
import styled34 from "styled-components";
|
|
5205
|
-
var Wrapper17 = styled34.div.attrs(() => ({
|
|
5206
|
-
role: "dialog"
|
|
5207
|
-
}))`
|
|
5208
|
-
position: fixed;
|
|
5209
|
-
top: 0;
|
|
5210
|
-
bottom: 0;
|
|
5211
|
-
left: 0;
|
|
5212
|
-
right: 0;
|
|
5213
|
-
width: 100%;
|
|
5214
|
-
white-space: normal;
|
|
5215
|
-
text-align: left;
|
|
5216
|
-
z-index: 90;
|
|
5217
|
-
display: flex;
|
|
5218
|
-
align-items: center;
|
|
5219
|
-
justify-content: center;
|
|
5220
|
-
|
|
5221
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
5222
|
-
padding: ${size(2)};
|
|
5223
|
-
}
|
|
5224
|
-
`;
|
|
5225
|
-
var UiBlock2 = styled34.div.attrs(() => ({
|
|
5226
|
-
"aria-hidden": "true",
|
|
5227
|
-
role: "button"
|
|
5228
|
-
}))`
|
|
5229
|
-
position: fixed;
|
|
5230
|
-
top: 0;
|
|
5231
|
-
bottom: 0;
|
|
5232
|
-
left: 0;
|
|
5233
|
-
right: 0;
|
|
5234
|
-
background-color: rgba(0, 0, 0, 0.35);
|
|
5235
|
-
z-index: -1;
|
|
5236
|
-
|
|
5237
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
5238
|
-
animation: ${fadeIn} 300ms ease forwards;
|
|
5239
|
-
}
|
|
5240
|
-
|
|
5241
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
5242
|
-
animation: ${fadeIn} 400ms ease forwards;
|
|
5243
|
-
}
|
|
5244
|
-
`;
|
|
5245
|
-
var Dialog = styled34.article.attrs(() => ({
|
|
5246
|
-
className: "wayke__theme wayke__font--regular"
|
|
5247
|
-
}))`
|
|
5248
|
-
display: flex;
|
|
5249
|
-
flex-direction: column;
|
|
5250
|
-
background-color: ${(props) => props.theme.color.bg};
|
|
5251
|
-
z-index: 1;
|
|
5252
|
-
width: 100%;
|
|
5253
|
-
max-width: 680px;
|
|
5254
|
-
max-height: 100%;
|
|
5255
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
5256
|
-
overflow: hidden;
|
|
5257
|
-
|
|
5258
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
5259
|
-
align-self: flex-end;
|
|
5260
|
-
transform: translateY(100%);
|
|
5261
|
-
animation: ${noTransform} 300ms ease forwards;
|
|
5262
|
-
}
|
|
5263
|
-
|
|
5264
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
5265
|
-
transform: translateY(${size(2)});
|
|
5266
|
-
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
5267
|
-
}
|
|
5268
|
-
`;
|
|
5269
|
-
var Content4 = styled34.div`
|
|
5270
|
-
flex: 1 1 auto;
|
|
5271
|
-
overflow: auto;
|
|
5272
|
-
-webkit-overflow-scrolling: touch;
|
|
5273
|
-
`;
|
|
5274
|
-
var Header4 = styled34.header`
|
|
5275
|
-
display: flex;
|
|
5276
|
-
align-items: center;
|
|
5277
|
-
min-height: 60px;
|
|
5278
|
-
padding: ${size(3)};
|
|
5279
|
-
padding-bottom: 0;
|
|
5280
|
-
`;
|
|
5281
|
-
var Heading5 = styled34.div`
|
|
5282
|
-
flex: 1 1 auto;
|
|
5283
|
-
|
|
5284
|
-
${H1} {
|
|
5285
|
-
font-size: 1.5rem;
|
|
6349
|
+
identifier
|
|
6350
|
+
logotype
|
|
6351
|
+
name
|
|
6352
|
+
description
|
|
6353
|
+
longDescription
|
|
6354
|
+
url
|
|
6355
|
+
insuranceText
|
|
6356
|
+
requiresPersonalNumber
|
|
6357
|
+
requiresDistance
|
|
6358
|
+
terms
|
|
6359
|
+
}
|
|
6360
|
+
financialOptions {
|
|
6361
|
+
description
|
|
6362
|
+
administrationFee
|
|
6363
|
+
downPayment {
|
|
6364
|
+
...FinancialOptionDetail
|
|
6365
|
+
}
|
|
6366
|
+
duration {
|
|
6367
|
+
...FinancialOptionDetail
|
|
6368
|
+
}
|
|
6369
|
+
effectiveInterest
|
|
6370
|
+
image
|
|
6371
|
+
includes
|
|
6372
|
+
includes
|
|
6373
|
+
interest
|
|
6374
|
+
link {
|
|
6375
|
+
title
|
|
6376
|
+
url
|
|
6377
|
+
}
|
|
6378
|
+
loanAmount
|
|
6379
|
+
logotype
|
|
6380
|
+
mileage {
|
|
6381
|
+
...FinancialOptionDetail
|
|
6382
|
+
}
|
|
6383
|
+
monthlyCost
|
|
6384
|
+
name
|
|
6385
|
+
residual {
|
|
6386
|
+
...FinancialOptionDetail
|
|
6387
|
+
}
|
|
6388
|
+
setupFee
|
|
6389
|
+
terms
|
|
6390
|
+
totalCreditCost
|
|
6391
|
+
totalResidualValue
|
|
6392
|
+
type
|
|
6393
|
+
url
|
|
6394
|
+
}
|
|
6395
|
+
media {
|
|
6396
|
+
type
|
|
6397
|
+
files {
|
|
6398
|
+
formats {
|
|
6399
|
+
format
|
|
6400
|
+
url
|
|
6401
|
+
}
|
|
6402
|
+
url
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6405
|
+
location {
|
|
6406
|
+
city
|
|
6407
|
+
county
|
|
6408
|
+
streetAddress
|
|
6409
|
+
postalCode
|
|
6410
|
+
}
|
|
6411
|
+
price
|
|
6412
|
+
shortDescription
|
|
6413
|
+
title
|
|
6414
|
+
}
|
|
5286
6415
|
}
|
|
6416
|
+
${HoursOpen}
|
|
6417
|
+
${FinancialOptionDetail}
|
|
5287
6418
|
`;
|
|
5288
|
-
var
|
|
5289
|
-
flex-shrink: 0;
|
|
5290
|
-
margin: ${size(-2)};
|
|
5291
|
-
padding-left: ${size(3)};
|
|
5292
|
-
`;
|
|
5293
|
-
var CloseBtn2 = styled34(ButtonReset)`
|
|
5294
|
-
display: block;
|
|
5295
|
-
padding: ${size(2)};
|
|
5296
|
-
`;
|
|
5297
|
-
var Body4 = styled34.div`
|
|
5298
|
-
padding: ${size(3)};
|
|
5299
|
-
`;
|
|
5300
|
-
var Image2 = styled34.img`
|
|
5301
|
-
display: block;
|
|
5302
|
-
width: calc(100% + ${size(6)});
|
|
5303
|
-
margin-left: ${size(-3)};
|
|
5304
|
-
margin-bottom: ${size(3)};
|
|
5305
|
-
`;
|
|
5306
|
-
var ModalFoldout = styled34.div`
|
|
5307
|
-
background-color: ${(props) => props.theme.color.accent};
|
|
5308
|
-
margin: ${size(-3)};
|
|
5309
|
-
margin-top: ${size(3)};
|
|
5310
|
-
padding: ${size(3)};
|
|
5311
|
-
`;
|
|
5312
|
-
var ModalFoldoutBody = styled34.div``;
|
|
6419
|
+
var SEARCH_ITEM_QUERY_default = SEARCH_ITEM_QUERY;
|
|
5313
6420
|
|
|
5314
|
-
// src/
|
|
5315
|
-
var
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
}, /* @__PURE__ */ React39.createElement(UiBlock2, {
|
|
5321
|
-
onClick: onClose,
|
|
5322
|
-
title: "St\xE4ng modal"
|
|
5323
|
-
}), /* @__PURE__ */ React39.createElement(Dialog, null, /* @__PURE__ */ React39.createElement(Content4, null, /* @__PURE__ */ React39.createElement(Header4, null, /* @__PURE__ */ React39.createElement(Heading5, null, /* @__PURE__ */ React39.createElement(H1, {
|
|
5324
|
-
noMargin: true
|
|
5325
|
-
}, title)), /* @__PURE__ */ React39.createElement(Close2, null, /* @__PURE__ */ React39.createElement(CloseBtn2, {
|
|
5326
|
-
onClick: onClose,
|
|
5327
|
-
title: "St\xE4ng modal"
|
|
5328
|
-
}, /* @__PURE__ */ React39.createElement(IconCancel, {
|
|
5329
|
-
block: true
|
|
5330
|
-
})))), /* @__PURE__ */ React39.createElement(Body4, null, children)))));
|
|
5331
|
-
};
|
|
5332
|
-
var Modal_default = Modal;
|
|
6421
|
+
// src/hooks/useSearchItem.ts
|
|
6422
|
+
var useSearchItem = (id) => useQuery(SEARCH_ITEM_QUERY_default, {
|
|
6423
|
+
variables: { id },
|
|
6424
|
+
skip: !id
|
|
6425
|
+
});
|
|
6426
|
+
var useSearchItem_default = useSearchItem;
|
|
5333
6427
|
|
|
5334
6428
|
// src/components/FinancialOptions/index.tsx
|
|
5335
|
-
import
|
|
6429
|
+
import React59, { Fragment } from "react";
|
|
5336
6430
|
|
|
5337
6431
|
// src/components/FinancialOptions/leasing.tsx
|
|
5338
|
-
import
|
|
6432
|
+
import React53, { useState as useState16, useCallback as useCallback19 } from "react";
|
|
5339
6433
|
|
|
5340
6434
|
// src/components/OptionBox/index.tsx
|
|
5341
|
-
import * as
|
|
6435
|
+
import * as React51 from "react";
|
|
5342
6436
|
|
|
5343
6437
|
// src/components/OptionBox/wrapper.tsx
|
|
5344
|
-
import
|
|
5345
|
-
var
|
|
6438
|
+
import styled39 from "styled-components";
|
|
6439
|
+
var Wrapper21 = styled39.div`
|
|
5346
6440
|
display: flex;
|
|
5347
6441
|
align-items: center;
|
|
5348
6442
|
padding: ${size(1)};
|
|
@@ -5353,14 +6447,14 @@ var Wrapper18 = styled35.div`
|
|
|
5353
6447
|
margin-top: ${size(1)};
|
|
5354
6448
|
}
|
|
5355
6449
|
`;
|
|
5356
|
-
var Logo2 =
|
|
6450
|
+
var Logo2 = styled39.div`
|
|
5357
6451
|
position: relative;
|
|
5358
6452
|
flex-shrink: 0;
|
|
5359
6453
|
margin-right: ${size(1)};
|
|
5360
6454
|
width: ${size(9.5)};
|
|
5361
6455
|
height: ${size(6)};
|
|
5362
6456
|
`;
|
|
5363
|
-
var LogoImg =
|
|
6457
|
+
var LogoImg = styled39.img`
|
|
5364
6458
|
display: block;
|
|
5365
6459
|
position: absolute;
|
|
5366
6460
|
left: 0;
|
|
@@ -5371,17 +6465,17 @@ var LogoImg = styled35.img`
|
|
|
5371
6465
|
max-width: 100%;
|
|
5372
6466
|
max-height: 100%;
|
|
5373
6467
|
`;
|
|
5374
|
-
var Content5 =
|
|
6468
|
+
var Content5 = styled39.div`
|
|
5375
6469
|
flex: 1 1 auto;
|
|
5376
6470
|
text-align: right;
|
|
5377
6471
|
line-height: 1.4;
|
|
5378
6472
|
`;
|
|
5379
|
-
var OptionBoxHeading =
|
|
6473
|
+
var OptionBoxHeading = styled39.div.attrs(() => ({
|
|
5380
6474
|
className: "wayke__theme wayke__font--bold"
|
|
5381
6475
|
}))`
|
|
5382
6476
|
font-size: 1rem;
|
|
5383
6477
|
`;
|
|
5384
|
-
var OptionBoxContent =
|
|
6478
|
+
var OptionBoxContent = styled39.div`
|
|
5385
6479
|
margin-top: ${size(0.5)};
|
|
5386
6480
|
font-size: 0.875rem;
|
|
5387
6481
|
|
|
@@ -5391,24 +6485,24 @@ var OptionBoxContent = styled35.div`
|
|
|
5391
6485
|
`;
|
|
5392
6486
|
|
|
5393
6487
|
// src/components/OptionBox/index.tsx
|
|
5394
|
-
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */
|
|
6488
|
+
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */ React51.createElement(Wrapper21, null, logo && /* @__PURE__ */ React51.createElement(Logo2, null, /* @__PURE__ */ React51.createElement(LogoImg, {
|
|
5395
6489
|
src: logo,
|
|
5396
6490
|
srcSet: logo2x,
|
|
5397
6491
|
alt: logoAlt
|
|
5398
|
-
})), /* @__PURE__ */
|
|
6492
|
+
})), /* @__PURE__ */ React51.createElement(Content5, null, children));
|
|
5399
6493
|
var OptionBox_default = OptionBox;
|
|
5400
6494
|
|
|
5401
6495
|
// src/components/DataList/index.tsx
|
|
5402
|
-
import
|
|
6496
|
+
import React52 from "react";
|
|
5403
6497
|
|
|
5404
6498
|
// src/components/DataList/wrapper.tsx
|
|
5405
|
-
import
|
|
5406
|
-
var List8 =
|
|
6499
|
+
import styled40 from "styled-components";
|
|
6500
|
+
var List8 = styled40.ul`
|
|
5407
6501
|
list-style: none;
|
|
5408
6502
|
padding: 0;
|
|
5409
6503
|
margin: 0;
|
|
5410
6504
|
`;
|
|
5411
|
-
var
|
|
6505
|
+
var Item10 = styled40.li`
|
|
5412
6506
|
display: flex;
|
|
5413
6507
|
align-items: flex-start;
|
|
5414
6508
|
|
|
@@ -5416,10 +6510,10 @@ var Item8 = styled36.li`
|
|
|
5416
6510
|
margin-top: ${size(1)};
|
|
5417
6511
|
}
|
|
5418
6512
|
`;
|
|
5419
|
-
var Label7 =
|
|
6513
|
+
var Label7 = styled40.div`
|
|
5420
6514
|
flex: 1 1 auto;
|
|
5421
6515
|
`;
|
|
5422
|
-
var Value2 =
|
|
6516
|
+
var Value2 = styled40.div.attrs(() => ({
|
|
5423
6517
|
className: "wayke__theme wayke__font--bold"
|
|
5424
6518
|
}))`
|
|
5425
6519
|
flex-shrink: 0;
|
|
@@ -5427,25 +6521,25 @@ var Value2 = styled36.div.attrs(() => ({
|
|
|
5427
6521
|
`;
|
|
5428
6522
|
|
|
5429
6523
|
// src/components/DataList/index.tsx
|
|
5430
|
-
var DataList = ({ items }) => /* @__PURE__ */
|
|
6524
|
+
var DataList = ({ items }) => /* @__PURE__ */ React52.createElement(List8, null, items.map((item) => /* @__PURE__ */ React52.createElement(Item10, {
|
|
5431
6525
|
key: item.label
|
|
5432
|
-
}, /* @__PURE__ */
|
|
6526
|
+
}, /* @__PURE__ */ React52.createElement(Label7, null, item.label), /* @__PURE__ */ React52.createElement(Value2, null, item.value))));
|
|
5433
6527
|
var DataList_default = DataList;
|
|
5434
6528
|
|
|
5435
6529
|
// src/components/FinancialOptions/leasing.tsx
|
|
5436
6530
|
var Leasing = ({ financialOption }) => {
|
|
5437
|
-
const [modal, setModal] =
|
|
5438
|
-
const toggleModal =
|
|
6531
|
+
const [modal, setModal] = useState16(false);
|
|
6532
|
+
const toggleModal = useCallback19(() => setModal(!modal), [modal]);
|
|
5439
6533
|
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
5440
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, modal && /* @__PURE__ */ React53.createElement(Modal_default, {
|
|
5441
6535
|
title: "Privatleasing",
|
|
5442
6536
|
onClose: toggleModal
|
|
5443
|
-
}, image && /* @__PURE__ */
|
|
6537
|
+
}, image && /* @__PURE__ */ React53.createElement(Image3, {
|
|
5444
6538
|
src: image,
|
|
5445
6539
|
alt: "Privatleasing"
|
|
5446
|
-
}), description && /* @__PURE__ */
|
|
6540
|
+
}), description && /* @__PURE__ */ React53.createElement(Content_default, {
|
|
5447
6541
|
dangerouslySetInnerHTML: { __html: description }
|
|
5448
|
-
}), /* @__PURE__ */
|
|
6542
|
+
}), /* @__PURE__ */ React53.createElement(ModalFoldout, null, /* @__PURE__ */ React53.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React53.createElement(DataList_default, {
|
|
5449
6543
|
items: [
|
|
5450
6544
|
{
|
|
5451
6545
|
label: "M\xE5nadskostnad",
|
|
@@ -5460,14 +6554,14 @@ var Leasing = ({ financialOption }) => {
|
|
|
5460
6554
|
value: `${numberSeparator(mileage?.current || 0)} mil/\xE5r`
|
|
5461
6555
|
}
|
|
5462
6556
|
]
|
|
5463
|
-
})))), /* @__PURE__ */
|
|
6557
|
+
})))), /* @__PURE__ */ React53.createElement(OptionBox_default, null, /* @__PURE__ */ React53.createElement(React53.Fragment, null, monthlyCost !== null && monthlyCost !== void 0 && /* @__PURE__ */ React53.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/m\xE5n`)), /* @__PURE__ */ React53.createElement(OptionBoxContent, null, /* @__PURE__ */ React53.createElement("p", null, "Privatleasing", " ", mileage?.current && duration?.current && /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(UtilityTextPrimary, null, numberSeparator(mileage?.current), " mil/\xE5r"), " ", "i ", /* @__PURE__ */ React53.createElement(UtilityTextPrimary, null, duration?.current, " m\xE5n"), ".", " ")), /* @__PURE__ */ React53.createElement("p", null, /* @__PURE__ */ React53.createElement(ButtonInline, {
|
|
5464
6558
|
onClick: toggleModal
|
|
5465
6559
|
}, "L\xE4s mer")))));
|
|
5466
6560
|
};
|
|
5467
6561
|
var leasing_default = Leasing;
|
|
5468
6562
|
|
|
5469
6563
|
// src/components/FinancialOptions/loan.tsx
|
|
5470
|
-
import
|
|
6564
|
+
import React58, { useState as useState19, useCallback as useCallback22 } from "react";
|
|
5471
6565
|
|
|
5472
6566
|
// src/hooks/useLoan.ts
|
|
5473
6567
|
import { useQuery as useQuery2 } from "@apollo/client";
|
|
@@ -5523,22 +6617,22 @@ var useLoanCalculation = (id, duration, downPayment, residual) => useQuery2(LOAN
|
|
|
5523
6617
|
var useLoan_default = useLoanCalculation;
|
|
5524
6618
|
|
|
5525
6619
|
// src/components/FinancialOptions/LoanModal.tsx
|
|
5526
|
-
import
|
|
6620
|
+
import React57, { useState as useState18, useCallback as useCallback21, useEffect as useEffect12 } from "react";
|
|
5527
6621
|
|
|
5528
6622
|
// src/components/ContentLogo/index.tsx
|
|
5529
|
-
import
|
|
5530
|
-
var ContentLogo =
|
|
6623
|
+
import styled41 from "styled-components";
|
|
6624
|
+
var ContentLogo = styled41.div`
|
|
5531
6625
|
${(props) => props.theme.breakpoint.Sm} {
|
|
5532
6626
|
display: flex;
|
|
5533
6627
|
align-items: flex-start;
|
|
5534
6628
|
}
|
|
5535
6629
|
`;
|
|
5536
|
-
var ContentLogoText =
|
|
6630
|
+
var ContentLogoText = styled41.div`
|
|
5537
6631
|
${(props) => props.theme.breakpoint.Sm} {
|
|
5538
6632
|
flex: 1 1 auto;
|
|
5539
6633
|
}
|
|
5540
6634
|
`;
|
|
5541
|
-
var ContentLogoMedia =
|
|
6635
|
+
var ContentLogoMedia = styled41.div`
|
|
5542
6636
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
5543
6637
|
margin-top: ${size(2)};
|
|
5544
6638
|
}
|
|
@@ -5550,44 +6644,44 @@ var ContentLogoMedia = styled37.div`
|
|
|
5550
6644
|
`;
|
|
5551
6645
|
|
|
5552
6646
|
// src/components/RangeSlider/SliderWithLabel.tsx
|
|
5553
|
-
import
|
|
6647
|
+
import React56, { useCallback as useCallback20, useEffect as useEffect11, useState as useState17 } from "react";
|
|
5554
6648
|
|
|
5555
6649
|
// src/components/RangeSliderLabel/index.tsx
|
|
5556
|
-
import
|
|
6650
|
+
import React54 from "react";
|
|
5557
6651
|
|
|
5558
6652
|
// src/components/RangeSliderLabel/wrapper.tsx
|
|
5559
|
-
import
|
|
5560
|
-
var
|
|
6653
|
+
import styled42, { css as css13 } from "styled-components";
|
|
6654
|
+
var Wrapper22 = styled42.div`
|
|
5561
6655
|
display: flex;
|
|
5562
6656
|
align-items: flex-end;
|
|
5563
6657
|
`;
|
|
5564
|
-
var Label8 =
|
|
6658
|
+
var Label8 = styled42.div.attrs(() => ({
|
|
5565
6659
|
className: "wayke__theme wayke__font--bold"
|
|
5566
6660
|
}))`
|
|
5567
6661
|
flex: 1 1 auto;
|
|
5568
6662
|
`;
|
|
5569
|
-
var Value3 =
|
|
6663
|
+
var Value3 = styled42.div.attrs(() => ({
|
|
5570
6664
|
className: "wayke__theme wayke__font--bold wayke__color--primary-text"
|
|
5571
6665
|
}))`
|
|
5572
6666
|
flex-shrink: 0;
|
|
5573
6667
|
padding-left: ${size(2)};
|
|
5574
6668
|
font-size: 1.125rem;
|
|
5575
6669
|
|
|
5576
|
-
${({ isHighlighted }) => isHighlighted &&
|
|
6670
|
+
${({ isHighlighted }) => isHighlighted && css13`
|
|
5577
6671
|
font-size: 1.375rem;
|
|
5578
6672
|
color: ${(props) => props.theme.color.textDark} !important;
|
|
5579
6673
|
`}
|
|
5580
6674
|
`;
|
|
5581
6675
|
|
|
5582
6676
|
// src/components/RangeSliderLabel/index.tsx
|
|
5583
|
-
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */
|
|
6677
|
+
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */ React54.createElement(Wrapper22, null, /* @__PURE__ */ React54.createElement(Label8, null, label), value && /* @__PURE__ */ React54.createElement(Value3, {
|
|
5584
6678
|
isHighlighted: highlight
|
|
5585
6679
|
}, value));
|
|
5586
6680
|
var RangeSliderLabel_default = RangeSliderLabel;
|
|
5587
6681
|
|
|
5588
6682
|
// src/components/RangeSlider/RangeSliderSimple.tsx
|
|
5589
|
-
import
|
|
5590
|
-
import { Slider as
|
|
6683
|
+
import React55 from "react";
|
|
6684
|
+
import { Slider as Slider4, Rail as Rail2, Handles as Handles2, Tracks as Tracks2 } from "react-compound-slider";
|
|
5591
6685
|
var RangeSliderSimple = ({
|
|
5592
6686
|
loading,
|
|
5593
6687
|
values,
|
|
@@ -5606,7 +6700,7 @@ var RangeSliderSimple = ({
|
|
|
5606
6700
|
if (steps.length < 2) {
|
|
5607
6701
|
return null;
|
|
5608
6702
|
}
|
|
5609
|
-
return /* @__PURE__ */
|
|
6703
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Slider, null, /* @__PURE__ */ React55.createElement(Slider4, {
|
|
5610
6704
|
disabled: loading,
|
|
5611
6705
|
mode: 1,
|
|
5612
6706
|
step,
|
|
@@ -5615,20 +6709,20 @@ var RangeSliderSimple = ({
|
|
|
5615
6709
|
onUpdate,
|
|
5616
6710
|
values,
|
|
5617
6711
|
rootStyle: { position: "relative" }
|
|
5618
|
-
}, /* @__PURE__ */
|
|
6712
|
+
}, /* @__PURE__ */ React55.createElement(Rail2, null, ({ getRailProps }) => /* @__PURE__ */ React55.createElement(Bar2, {
|
|
5619
6713
|
...getRailProps()
|
|
5620
|
-
})), /* @__PURE__ */
|
|
6714
|
+
})), /* @__PURE__ */ React55.createElement(Handles2, null, ({ handles, getHandleProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
5621
6715
|
className: "slider-handles"
|
|
5622
|
-
}, handles.map((handle) => /* @__PURE__ */
|
|
6716
|
+
}, handles.map((handle) => /* @__PURE__ */ React55.createElement(Handle2, {
|
|
5623
6717
|
key: handle.id,
|
|
5624
6718
|
handle,
|
|
5625
6719
|
domain,
|
|
5626
6720
|
getHandleProps
|
|
5627
|
-
})))), /* @__PURE__ */
|
|
6721
|
+
})))), /* @__PURE__ */ React55.createElement(Tracks2, {
|
|
5628
6722
|
right: false
|
|
5629
|
-
}, ({ tracks, getTrackProps }) => /* @__PURE__ */
|
|
6723
|
+
}, ({ tracks, getTrackProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
5630
6724
|
className: "slider-tracks"
|
|
5631
|
-
}, tracks.map(({ id, source, target }) => /* @__PURE__ */
|
|
6725
|
+
}, tracks.map(({ id, source, target }) => /* @__PURE__ */ React55.createElement(Track2, {
|
|
5632
6726
|
key: id,
|
|
5633
6727
|
source,
|
|
5634
6728
|
target,
|
|
@@ -5648,18 +6742,18 @@ var SliderWithLabel = ({
|
|
|
5648
6742
|
formatValues,
|
|
5649
6743
|
onChange
|
|
5650
6744
|
}) => {
|
|
5651
|
-
const [local, setLocal] =
|
|
5652
|
-
const onUpdate =
|
|
6745
|
+
const [local, setLocal] = useState17(steps);
|
|
6746
|
+
const onUpdate = useCallback20((nextValues) => {
|
|
5653
6747
|
setLocal([...nextValues]);
|
|
5654
6748
|
}, []);
|
|
5655
|
-
|
|
6749
|
+
useEffect11(() => {
|
|
5656
6750
|
if (!loading)
|
|
5657
6751
|
setLocal(void 0);
|
|
5658
6752
|
}, [loading]);
|
|
5659
|
-
return /* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderLabel_default, {
|
|
5660
6754
|
label,
|
|
5661
6755
|
value: `${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ""}`
|
|
5662
|
-
})), /* @__PURE__ */
|
|
6756
|
+
})), /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderSimple_default, {
|
|
5663
6757
|
loading,
|
|
5664
6758
|
values,
|
|
5665
6759
|
domain,
|
|
@@ -5684,22 +6778,22 @@ var stepGenerator = (step, max, steps = [], current) => {
|
|
|
5684
6778
|
return stepGenerator(step, max, steps, nextCurrent);
|
|
5685
6779
|
};
|
|
5686
6780
|
var LoanModal = ({ id, financialOption, onClose }) => {
|
|
5687
|
-
const [tmp, setTmp] =
|
|
5688
|
-
const [extend, setExtend] =
|
|
5689
|
-
const onToggleExtend =
|
|
6781
|
+
const [tmp, setTmp] = useState18();
|
|
6782
|
+
const [extend, setExtend] = React57.useState(false);
|
|
6783
|
+
const onToggleExtend = React57.useCallback(() => {
|
|
5690
6784
|
if (!extend) {
|
|
5691
6785
|
pubsub_default.publish("FinanceInterest");
|
|
5692
6786
|
}
|
|
5693
6787
|
setExtend(!extend);
|
|
5694
6788
|
}, [extend]);
|
|
5695
|
-
const [variables, setVariables] =
|
|
6789
|
+
const [variables, setVariables] = useState18({
|
|
5696
6790
|
duration: financialOption.duration?.current,
|
|
5697
6791
|
downPayment: financialOption.downPayment?.current,
|
|
5698
6792
|
residual: financialOption.residual?.current
|
|
5699
6793
|
});
|
|
5700
6794
|
const { duration, downPayment, residual } = variables;
|
|
5701
6795
|
const { loading, data } = useLoan_default(id, duration, downPayment, residual);
|
|
5702
|
-
|
|
6796
|
+
useEffect12(() => {
|
|
5703
6797
|
if (data) {
|
|
5704
6798
|
setTmp(data);
|
|
5705
6799
|
setVariables({
|
|
@@ -5715,7 +6809,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5715
6809
|
const downPaymentMax = loan?.downPayment?.max || 0;
|
|
5716
6810
|
const downPaymentStep = loan?.downPayment?.step || 0;
|
|
5717
6811
|
const downPaymentSteps = stepGenerator(downPaymentStep, downPaymentMax);
|
|
5718
|
-
const onDownPaymentChange =
|
|
6812
|
+
const onDownPaymentChange = useCallback21(
|
|
5719
6813
|
(values) => {
|
|
5720
6814
|
pubsub_default.publish("FinanceInterest");
|
|
5721
6815
|
setVariables({ ...variables, downPayment: values[0] });
|
|
@@ -5727,7 +6821,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5727
6821
|
const durationMax = loan?.duration?.max || 0;
|
|
5728
6822
|
const durationStep = loan?.duration?.step || 0;
|
|
5729
6823
|
const durationSteps = stepGenerator(durationStep, durationMax);
|
|
5730
|
-
const onDurationChange =
|
|
6824
|
+
const onDurationChange = useCallback21(
|
|
5731
6825
|
(values) => {
|
|
5732
6826
|
pubsub_default.publish("FinanceInterest");
|
|
5733
6827
|
setVariables({ ...variables, duration: values[0] });
|
|
@@ -5739,7 +6833,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5739
6833
|
const residualMax = (loan?.residual?.max || 0) * 100 || 0;
|
|
5740
6834
|
const residualStep = (loan?.residual?.step || 0) * 100 || 0;
|
|
5741
6835
|
const residualSteps = stepGenerator(residualStep, residualMax);
|
|
5742
|
-
const onResidualChange =
|
|
6836
|
+
const onResidualChange = useCallback21(
|
|
5743
6837
|
(values) => {
|
|
5744
6838
|
pubsub_default.publish("FinanceInterest");
|
|
5745
6839
|
setVariables({ ...variables, residual: values[0] / 100 });
|
|
@@ -5748,14 +6842,14 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5748
6842
|
);
|
|
5749
6843
|
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
5750
6844
|
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
5751
|
-
return /* @__PURE__ */
|
|
6845
|
+
return /* @__PURE__ */ React57.createElement(Modal_default, {
|
|
5752
6846
|
title: "L\xE5nealternativ",
|
|
5753
6847
|
onClose
|
|
5754
|
-
}, /* @__PURE__ */
|
|
6848
|
+
}, /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(ContentLogo, null, financialOption?.description && /* @__PURE__ */ React57.createElement(ContentLogoText, null, /* @__PURE__ */ React57.createElement(Content_default, null, /* @__PURE__ */ React57.createElement("p", null, financialOption.description))), financialOption?.image && /* @__PURE__ */ React57.createElement(ContentLogoMedia, null, /* @__PURE__ */ React57.createElement(LogoBox_default, {
|
|
5755
6849
|
logo: financialOption.image,
|
|
5756
6850
|
alt: financialOption.name || "Logotyp",
|
|
5757
6851
|
wide: true
|
|
5758
|
-
})))), /* @__PURE__ */
|
|
6852
|
+
})))), /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
5759
6853
|
label: "Kontantinsatts",
|
|
5760
6854
|
values: [downPaymentCurrent],
|
|
5761
6855
|
domain: [downPaymentMin, downPaymentMax],
|
|
@@ -5764,7 +6858,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5764
6858
|
formatValues: true,
|
|
5765
6859
|
loading,
|
|
5766
6860
|
onChange: onDownPaymentChange
|
|
5767
|
-
})), /* @__PURE__ */
|
|
6861
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
5768
6862
|
label: "Avbetalning",
|
|
5769
6863
|
values: [durationCurrent],
|
|
5770
6864
|
domain: [durationMin, durationMax],
|
|
@@ -5772,7 +6866,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5772
6866
|
unit: "m\xE5n",
|
|
5773
6867
|
loading,
|
|
5774
6868
|
onChange: onDurationChange
|
|
5775
|
-
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */
|
|
6869
|
+
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
5776
6870
|
label: "Restskuld",
|
|
5777
6871
|
values: [residualCurrent],
|
|
5778
6872
|
domain: [residualMin, residualMax],
|
|
@@ -5780,12 +6874,12 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
5780
6874
|
unit: "%",
|
|
5781
6875
|
loading,
|
|
5782
6876
|
onChange: onResidualChange
|
|
5783
|
-
})), /* @__PURE__ */
|
|
6877
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(RepeatTiny, null, /* @__PURE__ */ React57.createElement(Content_default, {
|
|
5784
6878
|
small: true
|
|
5785
|
-
}, /* @__PURE__ */
|
|
6879
|
+
}, /* @__PURE__ */ React57.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__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(ButtonClear, {
|
|
5786
6880
|
onClick: onToggleExtend,
|
|
5787
6881
|
title: extend ? "Visa mindre information" : "Visa mer information"
|
|
5788
|
-
}, /* @__PURE__ */
|
|
6882
|
+
}, /* @__PURE__ */ React57.createElement(ButtonContent, null, extend ? "Mindre information" : "Mer information"))), /* @__PURE__ */ React57.createElement(React57.Fragment, null, extend && /* @__PURE__ */ React57.createElement(ModalFoldout, null, /* @__PURE__ */ React57.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React57.createElement(DataList_default, {
|
|
5789
6883
|
items: [
|
|
5790
6884
|
{
|
|
5791
6885
|
label: "R\xE4nta",
|
|
@@ -5814,8 +6908,8 @@ var LoanModal_default = LoanModal;
|
|
|
5814
6908
|
|
|
5815
6909
|
// src/components/FinancialOptions/loan.tsx
|
|
5816
6910
|
var Loan = ({ id, financialOption }) => {
|
|
5817
|
-
const [modal, setModal] =
|
|
5818
|
-
const toggleModal =
|
|
6911
|
+
const [modal, setModal] = useState19(false);
|
|
6912
|
+
const toggleModal = useCallback22(() => setModal(!modal), [modal]);
|
|
5819
6913
|
const { data } = useLoan_default(
|
|
5820
6914
|
id,
|
|
5821
6915
|
financialOption.duration?.current,
|
|
@@ -5827,100 +6921,100 @@ var Loan = ({ id, financialOption }) => {
|
|
|
5827
6921
|
const monthlyCost = data?.loan?.monthlyCost;
|
|
5828
6922
|
const logo = financialOption?.logotype || "https://placehold.it/67x10";
|
|
5829
6923
|
if (financialOption.loanAmount === void 0 || financialOption.loanAmount === null || interest === void 0 || duration === void 0 || monthlyCost === void 0 || interest === null || duration === null || monthlyCost === null) {
|
|
5830
|
-
return /* @__PURE__ */
|
|
6924
|
+
return /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
5831
6925
|
logo,
|
|
5832
6926
|
logoAlt: "Logotyp"
|
|
5833
|
-
}, /* @__PURE__ */
|
|
6927
|
+
}, /* @__PURE__ */ React58.createElement(OptionBoxHeading, null, "Laddar..."), /* @__PURE__ */ React58.createElement(OptionBoxContent, null, /* @__PURE__ */ React58.createElement("p", null, "Laddar...")));
|
|
5834
6928
|
}
|
|
5835
|
-
return /* @__PURE__ */
|
|
6929
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null, modal && /* @__PURE__ */ React58.createElement(LoanModal_default, {
|
|
5836
6930
|
id,
|
|
5837
6931
|
financialOption,
|
|
5838
6932
|
onClose: toggleModal
|
|
5839
|
-
}), /* @__PURE__ */
|
|
6933
|
+
}), /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
5840
6934
|
logo,
|
|
5841
6935
|
logoAlt: "Logotyp"
|
|
5842
|
-
}, /* @__PURE__ */
|
|
6936
|
+
}, /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(OptionBoxHeading, null, `${numberSeparator(monthlyCost)} kr/m\xE5n*`), /* @__PURE__ */ React58.createElement(OptionBoxContent, null, /* @__PURE__ */ React58.createElement("p", null, "Delbetala", " ", financialOption.loanAmount && duration && /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(UtilityTextPrimary, null, numberSeparator(financialOption.loanAmount), " kr"), " ", "i ", /* @__PURE__ */ React58.createElement(UtilityTextPrimary, null, duration, " m\xE5n"), ".")), /* @__PURE__ */ React58.createElement("p", null, `*Ber\xE4knat p\xE5 ${(interest * 100).toFixed(2)}% r\xE4nta. `, /* @__PURE__ */ React58.createElement(ButtonInline, {
|
|
5843
6937
|
onClick: toggleModal
|
|
5844
6938
|
}, "L\xE4s mer"))))));
|
|
5845
6939
|
};
|
|
5846
6940
|
var loan_default = Loan;
|
|
5847
6941
|
|
|
5848
6942
|
// src/components/FinancialOptions/index.tsx
|
|
5849
|
-
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */
|
|
6943
|
+
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */ React59.createElement(Repeat, null, /* @__PURE__ */ React59.createElement(RepeatTiny, null, /* @__PURE__ */ React59.createElement(VisualHeading, null, "Andra finansieringsalternativ")), /* @__PURE__ */ React59.createElement(RepeatTiny, null, financialOptions.map((financialOption, index2) => /* @__PURE__ */ React59.createElement(Fragment, {
|
|
5850
6944
|
key: index2
|
|
5851
|
-
}, financialOption.type === "leasing" && /* @__PURE__ */
|
|
6945
|
+
}, financialOption.type === "leasing" && /* @__PURE__ */ React59.createElement(leasing_default, {
|
|
5852
6946
|
financialOption
|
|
5853
|
-
}), financialOption.type === "loan" && /* @__PURE__ */
|
|
6947
|
+
}), financialOption.type === "loan" && /* @__PURE__ */ React59.createElement(loan_default, {
|
|
5854
6948
|
id,
|
|
5855
6949
|
financialOption
|
|
5856
6950
|
})))));
|
|
5857
6951
|
var FinancialOptions_default = FinancialOptions;
|
|
5858
6952
|
|
|
5859
6953
|
// src/components/InsuranceOptions/index.tsx
|
|
5860
|
-
import
|
|
6954
|
+
import React71 from "react";
|
|
5861
6955
|
|
|
5862
6956
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
5863
|
-
import
|
|
6957
|
+
import React68, { useState as useState22, useCallback as useCallback25 } from "react";
|
|
5864
6958
|
|
|
5865
6959
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
5866
|
-
import
|
|
6960
|
+
import React67, { useState as useState21, useCallback as useCallback24 } from "react";
|
|
5867
6961
|
|
|
5868
6962
|
// src/components/DetailBox/index.tsx
|
|
5869
|
-
import
|
|
6963
|
+
import React60 from "react";
|
|
5870
6964
|
|
|
5871
6965
|
// src/components/DetailBox/wrapper.tsx
|
|
5872
|
-
import
|
|
5873
|
-
var
|
|
6966
|
+
import styled43 from "styled-components";
|
|
6967
|
+
var Wrapper23 = styled43.article`
|
|
5874
6968
|
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
|
5875
6969
|
border-radius: 3px;
|
|
5876
6970
|
overflow: hidden;
|
|
5877
6971
|
`;
|
|
5878
|
-
var
|
|
6972
|
+
var Main2 = styled43.div`
|
|
5879
6973
|
padding: ${size(2.5)};
|
|
5880
6974
|
`;
|
|
5881
|
-
var Heading6 =
|
|
6975
|
+
var Heading6 = styled43(H2).attrs(() => ({
|
|
5882
6976
|
as: "h1"
|
|
5883
6977
|
}))`
|
|
5884
6978
|
margin-bottom: 0;
|
|
5885
6979
|
`;
|
|
5886
|
-
var Description3 =
|
|
6980
|
+
var Description3 = styled43.div`
|
|
5887
6981
|
margin-top: ${size(1)};
|
|
5888
6982
|
`;
|
|
5889
|
-
var Footer3 =
|
|
6983
|
+
var Footer3 = styled43.div`
|
|
5890
6984
|
margin-top: ${size(1)};
|
|
5891
6985
|
color: red;
|
|
5892
6986
|
`;
|
|
5893
|
-
var Foldout =
|
|
6987
|
+
var Foldout = styled43.div`
|
|
5894
6988
|
background-color: ${(props) => props.theme.color.accent};
|
|
5895
6989
|
padding: ${size(2.5)};
|
|
5896
6990
|
`;
|
|
5897
6991
|
|
|
5898
6992
|
// src/components/DetailBox/index.tsx
|
|
5899
6993
|
var DetailBox = ({ heading, description, children }) => {
|
|
5900
|
-
const [extend, setExtend] =
|
|
5901
|
-
const onToggleExtend =
|
|
6994
|
+
const [extend, setExtend] = React60.useState(false);
|
|
6995
|
+
const onToggleExtend = React60.useCallback(() => setExtend(!extend), [extend]);
|
|
5902
6996
|
const extendBtnText = extend ? "Mindre information" : "Mer information";
|
|
5903
|
-
return /* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ React60.createElement(Wrapper23, null, /* @__PURE__ */ React60.createElement(Main2, null, /* @__PURE__ */ React60.createElement(Heading6, null, heading), description && /* @__PURE__ */ React60.createElement(Description3, null, description), /* @__PURE__ */ React60.createElement(Footer3, null, /* @__PURE__ */ React60.createElement(ButtonClear, {
|
|
5904
6998
|
onClick: onToggleExtend
|
|
5905
|
-
}, /* @__PURE__ */
|
|
6999
|
+
}, /* @__PURE__ */ React60.createElement(ButtonContent, null, extendBtnText)))), extend && /* @__PURE__ */ React60.createElement(Foldout, null, children));
|
|
5906
7000
|
};
|
|
5907
7001
|
var DetailBox_default = DetailBox;
|
|
5908
7002
|
|
|
5909
7003
|
// src/components/ExtendInfo/index.tsx
|
|
5910
|
-
import
|
|
7004
|
+
import React61, { useState as useState20, useCallback as useCallback23 } from "react";
|
|
5911
7005
|
|
|
5912
7006
|
// src/components/ExtendInfo/wrapper.tsx
|
|
5913
|
-
import
|
|
5914
|
-
var
|
|
5915
|
-
var Header5 =
|
|
7007
|
+
import styled44 from "styled-components";
|
|
7008
|
+
var Wrapper24 = styled44.div``;
|
|
7009
|
+
var Header5 = styled44.div`
|
|
5916
7010
|
display: flex;
|
|
5917
7011
|
align-items: center;
|
|
5918
7012
|
`;
|
|
5919
|
-
var Title =
|
|
5920
|
-
var Info2 =
|
|
7013
|
+
var Title = styled44.div``;
|
|
7014
|
+
var Info2 = styled44.div`
|
|
5921
7015
|
margin-left: ${size(1)};
|
|
5922
7016
|
`;
|
|
5923
|
-
var InfoBtn =
|
|
7017
|
+
var InfoBtn = styled44(ButtonReset).attrs(() => ({
|
|
5924
7018
|
className: "wayke__theme wayke__color--primary-text"
|
|
5925
7019
|
}))`
|
|
5926
7020
|
position: relative;
|
|
@@ -5958,7 +7052,7 @@ var InfoBtn = styled40(ButtonReset).attrs(() => ({
|
|
|
5958
7052
|
transform: scale(0.95);
|
|
5959
7053
|
}
|
|
5960
7054
|
`;
|
|
5961
|
-
var Extend2 =
|
|
7055
|
+
var Extend2 = styled44.div`
|
|
5962
7056
|
padding-top: ${size(1)};
|
|
5963
7057
|
margin-top: ${size(1)};
|
|
5964
7058
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
@@ -5967,23 +7061,23 @@ var Extend2 = styled40.div`
|
|
|
5967
7061
|
|
|
5968
7062
|
// src/components/ExtendInfo/index.tsx
|
|
5969
7063
|
var ExtendInfo = ({ title, children }) => {
|
|
5970
|
-
const [extend, setExtend] =
|
|
5971
|
-
const onToggleExtend =
|
|
5972
|
-
return /* @__PURE__ */
|
|
7064
|
+
const [extend, setExtend] = useState20(false);
|
|
7065
|
+
const onToggleExtend = useCallback23(() => setExtend(!extend), [extend]);
|
|
7066
|
+
return /* @__PURE__ */ React61.createElement(Wrapper24, null, /* @__PURE__ */ React61.createElement(Header5, null, /* @__PURE__ */ React61.createElement(Title, null, title), children && /* @__PURE__ */ React61.createElement(Info2, null, /* @__PURE__ */ React61.createElement(InfoBtn, {
|
|
5973
7067
|
onClick: onToggleExtend,
|
|
5974
7068
|
title: "Mer information"
|
|
5975
|
-
}, /* @__PURE__ */
|
|
7069
|
+
}, /* @__PURE__ */ React61.createElement(IconInfo, {
|
|
5976
7070
|
block: true
|
|
5977
|
-
})))), extend && /* @__PURE__ */
|
|
7071
|
+
})))), extend && /* @__PURE__ */ React61.createElement(Extend2, null, children));
|
|
5978
7072
|
};
|
|
5979
7073
|
var ExtendInfo_default = ExtendInfo;
|
|
5980
7074
|
|
|
5981
7075
|
// src/components/InputLabel/index.tsx
|
|
5982
|
-
import
|
|
7076
|
+
import React62 from "react";
|
|
5983
7077
|
|
|
5984
7078
|
// src/components/InputLabel/wrapper.tsx
|
|
5985
|
-
import
|
|
5986
|
-
var
|
|
7079
|
+
import styled45 from "styled-components";
|
|
7080
|
+
var Wrapper25 = styled45.label.attrs(() => ({
|
|
5987
7081
|
className: "wayke__theme wayke__font--bold"
|
|
5988
7082
|
}))`
|
|
5989
7083
|
margin-bottom: ${size(0.5)};
|
|
@@ -5991,24 +7085,24 @@ var Wrapper22 = styled41.label.attrs(() => ({
|
|
|
5991
7085
|
`;
|
|
5992
7086
|
|
|
5993
7087
|
// src/components/InputLabel/index.tsx
|
|
5994
|
-
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */
|
|
7088
|
+
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */ React62.createElement(Wrapper25, {
|
|
5995
7089
|
htmlFor
|
|
5996
7090
|
}, children);
|
|
5997
7091
|
var InputLabel_default = InputLabel;
|
|
5998
7092
|
|
|
5999
7093
|
// src/components/InputText/index.tsx
|
|
6000
|
-
import
|
|
7094
|
+
import React63 from "react";
|
|
6001
7095
|
|
|
6002
7096
|
// src/components/InputText/wrapper.tsx
|
|
6003
|
-
import
|
|
6004
|
-
var
|
|
7097
|
+
import styled46 from "styled-components";
|
|
7098
|
+
var Wrapper26 = styled46.div`
|
|
6005
7099
|
position: relative;
|
|
6006
7100
|
display: flex;
|
|
6007
7101
|
align-items: stretch;
|
|
6008
7102
|
background-color: ${(props) => props.theme.color.accent};
|
|
6009
7103
|
border-radius: 3px;
|
|
6010
7104
|
`;
|
|
6011
|
-
var Input2 =
|
|
7105
|
+
var Input2 = styled46.input.attrs(() => ({
|
|
6012
7106
|
type: "text",
|
|
6013
7107
|
className: "wayke__theme wayke__font--regular"
|
|
6014
7108
|
}))`
|
|
@@ -6055,7 +7149,7 @@ var Input2 = styled42.input.attrs(() => ({
|
|
|
6055
7149
|
`;
|
|
6056
7150
|
|
|
6057
7151
|
// src/components/InputText/index.tsx
|
|
6058
|
-
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */
|
|
7152
|
+
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */ React63.createElement(Wrapper26, null, /* @__PURE__ */ React63.createElement(Input2, {
|
|
6059
7153
|
placeholder,
|
|
6060
7154
|
value,
|
|
6061
7155
|
id,
|
|
@@ -6066,12 +7160,12 @@ var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @
|
|
|
6066
7160
|
var InputText_default = InputText;
|
|
6067
7161
|
|
|
6068
7162
|
// src/components/InputCheckbox/index.tsx
|
|
6069
|
-
import * as
|
|
7163
|
+
import * as React65 from "react";
|
|
6070
7164
|
|
|
6071
7165
|
// src/components/InputCheckbox/wrapper.tsx
|
|
6072
|
-
import * as
|
|
6073
|
-
import
|
|
6074
|
-
var Label9 =
|
|
7166
|
+
import * as React64 from "react";
|
|
7167
|
+
import styled47, { css as css14 } from "styled-components";
|
|
7168
|
+
var Label9 = styled47.label.attrs(() => ({
|
|
6075
7169
|
className: "wayke__theme wayke__color--primary-text"
|
|
6076
7170
|
}))`
|
|
6077
7171
|
position: relative;
|
|
@@ -6101,13 +7195,13 @@ var Label9 = styled43.label.attrs(() => ({
|
|
|
6101
7195
|
margin-top: -2px;
|
|
6102
7196
|
}
|
|
6103
7197
|
`;
|
|
6104
|
-
var
|
|
7198
|
+
var Wrapper27 = styled47((props) => /* @__PURE__ */ React64.createElement("div", {
|
|
6105
7199
|
...props
|
|
6106
7200
|
})).attrs(({ type, checked }) => ({
|
|
6107
7201
|
role: type || "checkbox",
|
|
6108
7202
|
"aria-checked": checked
|
|
6109
7203
|
}))`
|
|
6110
|
-
${({ error }) => error &&
|
|
7204
|
+
${({ error }) => error && css14`
|
|
6111
7205
|
${Label9} {
|
|
6112
7206
|
color: ${(props) => props.theme.color.ui.negative};
|
|
6113
7207
|
|
|
@@ -6117,7 +7211,7 @@ var Wrapper24 = styled43((props) => /* @__PURE__ */ React53.createElement("div",
|
|
|
6117
7211
|
}
|
|
6118
7212
|
`}
|
|
6119
7213
|
`;
|
|
6120
|
-
var Input3 =
|
|
7214
|
+
var Input3 = styled47((props) => /* @__PURE__ */ React64.createElement("input", {
|
|
6121
7215
|
...props,
|
|
6122
7216
|
className: `${props.checked ? "checked" : void 0} ${props.className}`
|
|
6123
7217
|
})).attrs(({ type, checked }) => ({
|
|
@@ -6148,23 +7242,23 @@ var Input3 = styled43((props) => /* @__PURE__ */ React53.createElement("input",
|
|
|
6148
7242
|
}
|
|
6149
7243
|
}
|
|
6150
7244
|
`;
|
|
6151
|
-
var LabelText =
|
|
7245
|
+
var LabelText = styled47.div`
|
|
6152
7246
|
color: ${(props) => props.theme.color.textDark};
|
|
6153
7247
|
`;
|
|
6154
7248
|
|
|
6155
7249
|
// src/components/InputSelect/index.tsx
|
|
6156
|
-
import
|
|
7250
|
+
import React66 from "react";
|
|
6157
7251
|
|
|
6158
7252
|
// src/components/InputSelect/wrapper.tsx
|
|
6159
|
-
import
|
|
7253
|
+
import styled48 from "styled-components";
|
|
6160
7254
|
var iconSize2 = "0.875rem";
|
|
6161
7255
|
var selectPadding = size(2);
|
|
6162
|
-
var
|
|
7256
|
+
var Wrapper28 = styled48.div`
|
|
6163
7257
|
position: relative;
|
|
6164
7258
|
background-color: ${(props) => props.theme.color.accent};
|
|
6165
7259
|
border-radius: 3px;
|
|
6166
7260
|
`;
|
|
6167
|
-
var Select2 =
|
|
7261
|
+
var Select2 = styled48.select.attrs(() => ({
|
|
6168
7262
|
className: "wayke__theme wayke__font--regular"
|
|
6169
7263
|
}))`
|
|
6170
7264
|
position: relative;
|
|
@@ -6198,10 +7292,10 @@ var Select2 = styled44.select.attrs(() => ({
|
|
|
6198
7292
|
border: 0;
|
|
6199
7293
|
}
|
|
6200
7294
|
`;
|
|
6201
|
-
var Option2 =
|
|
7295
|
+
var Option2 = styled48.option`
|
|
6202
7296
|
color: ${(props) => props.theme.color.textDark};
|
|
6203
7297
|
`;
|
|
6204
|
-
var Icon5 =
|
|
7298
|
+
var Icon5 = styled48.div`
|
|
6205
7299
|
position: absolute;
|
|
6206
7300
|
top: 50%;
|
|
6207
7301
|
right: ${selectPadding};
|
|
@@ -6210,29 +7304,29 @@ var Icon5 = styled44.div`
|
|
|
6210
7304
|
`;
|
|
6211
7305
|
|
|
6212
7306
|
// src/components/InputSelect/index.tsx
|
|
6213
|
-
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */
|
|
7307
|
+
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */ React66.createElement(Wrapper28, null, /* @__PURE__ */ React66.createElement(Select2, {
|
|
6214
7308
|
value,
|
|
6215
7309
|
onChange,
|
|
6216
7310
|
title,
|
|
6217
7311
|
"aria-label": title
|
|
6218
|
-
}, options?.map((option) => /* @__PURE__ */
|
|
7312
|
+
}, options?.map((option) => /* @__PURE__ */ React66.createElement(Option2, {
|
|
6219
7313
|
key: option.value,
|
|
6220
7314
|
value: option.value
|
|
6221
|
-
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */
|
|
7315
|
+
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */ React66.createElement(Icon5, null, /* @__PURE__ */ React66.createElement(IconChevronDown, {
|
|
6222
7316
|
block: true
|
|
6223
7317
|
})));
|
|
6224
7318
|
var InputSelect_default = InputSelect;
|
|
6225
7319
|
|
|
6226
7320
|
// src/components/InputGroup/index.tsx
|
|
6227
|
-
import
|
|
6228
|
-
var InputGroup =
|
|
7321
|
+
import styled49 from "styled-components";
|
|
7322
|
+
var InputGroup = styled49.div`
|
|
6229
7323
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6230
7324
|
display: flex;
|
|
6231
7325
|
align-items: flex-start;
|
|
6232
7326
|
margin: ${size(-0.5)};
|
|
6233
7327
|
}
|
|
6234
7328
|
`;
|
|
6235
|
-
var InputGroupColumn =
|
|
7329
|
+
var InputGroupColumn = styled49.div`
|
|
6236
7330
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
6237
7331
|
& + & {
|
|
6238
7332
|
margin-top: ${size(1)};
|
|
@@ -6246,12 +7340,12 @@ var InputGroupColumn = styled45.div`
|
|
|
6246
7340
|
`;
|
|
6247
7341
|
|
|
6248
7342
|
// src/components/ColumnRow/index.tsx
|
|
6249
|
-
import
|
|
6250
|
-
var ColumnRow =
|
|
7343
|
+
import styled50 from "styled-components";
|
|
7344
|
+
var ColumnRow = styled50.div`
|
|
6251
7345
|
display: flex;
|
|
6252
7346
|
align-items: flex-start;
|
|
6253
7347
|
`;
|
|
6254
|
-
var ColumnRowItem =
|
|
7348
|
+
var ColumnRowItem = styled50.div`
|
|
6255
7349
|
flex: 1 1 auto;
|
|
6256
7350
|
|
|
6257
7351
|
:last-child:not(:only-child) {
|
|
@@ -6326,30 +7420,30 @@ var ssnIsValid = (s) => s ? /^\d{2,4}\d{2}\d{2}\-?\d{4}$/.test(s) : false;
|
|
|
6326
7420
|
|
|
6327
7421
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
6328
7422
|
var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
6329
|
-
const [form, setForm] =
|
|
7423
|
+
const [form, setForm] = useState21({
|
|
6330
7424
|
ssn: "",
|
|
6331
7425
|
drivingDistance: "BETWEEN0AND1000" /* Between0And1000 */
|
|
6332
7426
|
});
|
|
6333
|
-
const [payload, setPayload] =
|
|
7427
|
+
const [payload, setPayload] = useState21();
|
|
6334
7428
|
const { loading, data, error } = useInsurance_default(
|
|
6335
7429
|
id,
|
|
6336
7430
|
branch?.id ? branch?.id : void 0,
|
|
6337
7431
|
ssnIsValid(payload?.ssn) ? payload?.ssn : void 0,
|
|
6338
7432
|
payload?.drivingDistance
|
|
6339
7433
|
);
|
|
6340
|
-
const onChangeSsn =
|
|
7434
|
+
const onChangeSsn = useCallback24(
|
|
6341
7435
|
(e) => setForm({ ...form, ssn: e.currentTarget.value }),
|
|
6342
7436
|
[form]
|
|
6343
7437
|
);
|
|
6344
|
-
const onChangeDrivingDistance =
|
|
7438
|
+
const onChangeDrivingDistance = useCallback24(
|
|
6345
7439
|
(e) => setForm({ ...form, drivingDistance: e.currentTarget.value }),
|
|
6346
7440
|
[form]
|
|
6347
7441
|
);
|
|
6348
|
-
const onShowInsurances =
|
|
7442
|
+
const onShowInsurances = useCallback24(() => {
|
|
6349
7443
|
pubsub_default.publish("InsuranceInterest");
|
|
6350
7444
|
setPayload(form);
|
|
6351
7445
|
}, [form]);
|
|
6352
|
-
const onKeyDown =
|
|
7446
|
+
const onKeyDown = useCallback24(
|
|
6353
7447
|
(e) => {
|
|
6354
7448
|
if (e.keyCode === 13 && ssnIsValid(form.ssn) && !loading) {
|
|
6355
7449
|
onShowInsurances();
|
|
@@ -6364,105 +7458,105 @@ var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
|
6364
7458
|
{ value: "BETWEEN2000AND2500" /* Between2000And2500 */, displayName: "2000 - 2500" },
|
|
6365
7459
|
{ value: "OVER2500" /* Over2500 */, displayName: "2500+" }
|
|
6366
7460
|
];
|
|
6367
|
-
return /* @__PURE__ */
|
|
7461
|
+
return /* @__PURE__ */ React67.createElement(Modal_default, {
|
|
6368
7462
|
title: "F\xF6rs\xE4kring",
|
|
6369
7463
|
onClose
|
|
6370
|
-
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */
|
|
7464
|
+
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(ContentLogo, null, insuranceOptions.description && /* @__PURE__ */ React67.createElement(ContentLogoText, null, /* @__PURE__ */ React67.createElement(Content_default, null, /* @__PURE__ */ React67.createElement("p", null, insuranceOptions.description))), insuranceOptions.logotype && /* @__PURE__ */ React67.createElement(ContentLogoMedia, null, /* @__PURE__ */ React67.createElement(LogoBox_default, {
|
|
6371
7465
|
logo: insuranceOptions.logotype,
|
|
6372
7466
|
alt: insuranceOptions.name || "Logotyp",
|
|
6373
7467
|
wide: true
|
|
6374
|
-
})))), /* @__PURE__ */
|
|
7468
|
+
})))), /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(RepeatSmall, null, /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(InputGroup, null, /* @__PURE__ */ React67.createElement(InputGroupColumn, null, /* @__PURE__ */ React67.createElement(InputLabel_default, {
|
|
6375
7469
|
htmlFor: "input-insurance-personalnumber"
|
|
6376
|
-
}, "Personnummer"), /* @__PURE__ */
|
|
7470
|
+
}, "Personnummer"), /* @__PURE__ */ React67.createElement(InputText_default, {
|
|
6377
7471
|
placeholder: "\xC5\xC5\xC5\xC5MMDD-XXXX",
|
|
6378
7472
|
label: "Personnummer",
|
|
6379
7473
|
value: form.ssn,
|
|
6380
7474
|
onChange: onChangeSsn,
|
|
6381
7475
|
onKeyDown,
|
|
6382
7476
|
id: "input-insurance-personalnumber"
|
|
6383
|
-
})), /* @__PURE__ */
|
|
7477
|
+
})), /* @__PURE__ */ React67.createElement(InputGroupColumn, null, /* @__PURE__ */ React67.createElement(InputLabel_default, {
|
|
6384
7478
|
htmlFor: "input-insurance-mileage"
|
|
6385
|
-
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */
|
|
7479
|
+
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */ React67.createElement(InputSelect_default, {
|
|
6386
7480
|
value: form.drivingDistance,
|
|
6387
7481
|
onChange: onChangeDrivingDistance,
|
|
6388
7482
|
options,
|
|
6389
7483
|
unit: "mil",
|
|
6390
7484
|
title: "Uppskattad k\xF6rstr\xE4cka per \xE5r"
|
|
6391
|
-
})))), /* @__PURE__ */
|
|
7485
|
+
})))), /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(ButtonPrimary, {
|
|
6392
7486
|
fullWidth: true,
|
|
6393
7487
|
disabled: !ssnIsValid(form.ssn) || loading,
|
|
6394
7488
|
onClick: onShowInsurances
|
|
6395
|
-
}, /* @__PURE__ */
|
|
7489
|
+
}, /* @__PURE__ */ React67.createElement(ButtonContent, null, "Visa f\xF6rs\xE4kringar")))), false, /* @__PURE__ */ React67.createElement(RepeatSmall, null, /* @__PURE__ */ React67.createElement(Content_default, {
|
|
6396
7490
|
small: true
|
|
6397
|
-
}, /* @__PURE__ */
|
|
7491
|
+
}, /* @__PURE__ */ React67.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__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(Loader_default, null)), error && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(Snackbar_default, {
|
|
6398
7492
|
severity: "error",
|
|
6399
7493
|
icon: true,
|
|
6400
7494
|
heading: "Ett fel har intr\xE4ffat"
|
|
6401
|
-
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */
|
|
7495
|
+
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */ React67.createElement(React67.Fragment, null, data?.insurances && /* @__PURE__ */ React67.createElement(Repeat, null, data?.insurances.map((insurance) => /* @__PURE__ */ React67.createElement(Repeat, {
|
|
6402
7496
|
key: insurance.name
|
|
6403
|
-
}, /* @__PURE__ */
|
|
7497
|
+
}, /* @__PURE__ */ React67.createElement(DetailBox_default, {
|
|
6404
7498
|
heading: `${numberSeparator(insurance.price)} ${insurance.unit}`,
|
|
6405
7499
|
description: insurance.name
|
|
6406
|
-
}, /* @__PURE__ */
|
|
7500
|
+
}, /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(React67.Fragment, null, insurance.description && /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(Content_default, null, /* @__PURE__ */ React67.createElement("p", null, insurance.description)))), /* @__PURE__ */ React67.createElement(React67.Fragment, null, insurance.url && /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(ButtonInline, {
|
|
6407
7501
|
as: "a",
|
|
6408
7502
|
href: insurance.url || "",
|
|
6409
7503
|
target: "_blank",
|
|
6410
7504
|
rel: "noopener noreferrer nofollow"
|
|
6411
|
-
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */
|
|
7505
|
+
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(H4, null, "F\xF6rs\xE4kringen inneh\xE5ller"), insurance.items.map((item) => /* @__PURE__ */ React67.createElement(RepeatSmall, {
|
|
6412
7506
|
key: item.name || ""
|
|
6413
|
-
}, /* @__PURE__ */
|
|
7507
|
+
}, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
6414
7508
|
title: item.name || ""
|
|
6415
|
-
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */
|
|
7509
|
+
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(H4, null, "V\xE4lj till"), insurance.addons.map((addon) => /* @__PURE__ */ React67.createElement(RepeatSmall, {
|
|
6416
7510
|
key: addon.title || ""
|
|
6417
|
-
}, /* @__PURE__ */
|
|
7511
|
+
}, /* @__PURE__ */ React67.createElement(ColumnRow, null, /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
6418
7512
|
title: addon.title || ""
|
|
6419
|
-
}, addon.description)), /* @__PURE__ */
|
|
7513
|
+
}, addon.description)), /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(UtilityTextBold, null, "+", addon.price, " ", addon.unit))))))))))));
|
|
6420
7514
|
};
|
|
6421
7515
|
var InsuranceModal_default = InsuranceModal;
|
|
6422
7516
|
|
|
6423
7517
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
6424
7518
|
var Insurance = ({ id, branch, insuranceOptions }) => {
|
|
6425
|
-
const [modal, setModal] =
|
|
6426
|
-
const toggleModal =
|
|
7519
|
+
const [modal, setModal] = useState22(false);
|
|
7520
|
+
const toggleModal = useCallback25(() => setModal(!modal), [modal]);
|
|
6427
7521
|
if (!insuranceOptions.length) {
|
|
6428
7522
|
return null;
|
|
6429
7523
|
}
|
|
6430
|
-
return /* @__PURE__ */
|
|
7524
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, modal && /* @__PURE__ */ React68.createElement(InsuranceModal_default, {
|
|
6431
7525
|
id,
|
|
6432
7526
|
branch,
|
|
6433
7527
|
onClose: toggleModal,
|
|
6434
7528
|
insuranceOptions: insuranceOptions[0]
|
|
6435
|
-
}), /* @__PURE__ */
|
|
7529
|
+
}), /* @__PURE__ */ React68.createElement(Repeat, null, /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(VisualHeading, null, "V\xE4lj till f\xF6rs\xE4kring")), /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(React68.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React68.createElement(OptionBox_default, {
|
|
6436
7530
|
key: `${insuranceOption.url}-${index2}`,
|
|
6437
7531
|
logo: insuranceOption.logotype || void 0,
|
|
6438
7532
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
6439
|
-
}, /* @__PURE__ */
|
|
7533
|
+
}, /* @__PURE__ */ React68.createElement(OptionBoxHeading, null, "F\xE5 prisf\xF6rslag"), /* @__PURE__ */ React68.createElement(OptionBoxContent, null, /* @__PURE__ */ React68.createElement("p", null, /* @__PURE__ */ React68.createElement(ButtonInline, {
|
|
6440
7534
|
onClick: toggleModal
|
|
6441
7535
|
}, "Mer information")))))))));
|
|
6442
7536
|
};
|
|
6443
7537
|
var Insurance_default = Insurance;
|
|
6444
7538
|
|
|
6445
7539
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
6446
|
-
import
|
|
7540
|
+
import React70, { useState as useState23, useCallback as useCallback26 } from "react";
|
|
6447
7541
|
import { marked as marked2 } from "marked";
|
|
6448
7542
|
|
|
6449
7543
|
// src/components/InsuranceOptions/InsuranceFreeModal.tsx
|
|
6450
|
-
import
|
|
7544
|
+
import React69 from "react";
|
|
6451
7545
|
import { marked } from "marked";
|
|
6452
7546
|
var InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
|
|
6453
|
-
return /* @__PURE__ */
|
|
7547
|
+
return /* @__PURE__ */ React69.createElement(Modal_default, {
|
|
6454
7548
|
title: insuranceOptions?.insuranceHeader ?? "F\xF6rs\xE4kring",
|
|
6455
7549
|
onClose
|
|
6456
|
-
}, insuranceOptions?.longDescription && /* @__PURE__ */
|
|
7550
|
+
}, insuranceOptions?.longDescription && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(Content_default, {
|
|
6457
7551
|
dangerouslySetInnerHTML: {
|
|
6458
7552
|
__html: marked(insuranceOptions.longDescription)
|
|
6459
7553
|
}
|
|
6460
|
-
})), insuranceOptions?.url && /* @__PURE__ */
|
|
7554
|
+
})), insuranceOptions?.url && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(ButtonInline, {
|
|
6461
7555
|
as: "a",
|
|
6462
7556
|
href: insuranceOptions.url,
|
|
6463
7557
|
target: "_blank",
|
|
6464
7558
|
rel: "noopener noreferrer"
|
|
6465
|
-
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */
|
|
7559
|
+
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(LogoBox_default, {
|
|
6466
7560
|
logo: insuranceOptions.logotype,
|
|
6467
7561
|
alt: insuranceOptions.name || "Logotyp",
|
|
6468
7562
|
wide: true
|
|
@@ -6472,23 +7566,23 @@ var InsuranceFreeModal_default = InsuranceFreeModal;
|
|
|
6472
7566
|
|
|
6473
7567
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
6474
7568
|
var Insurance2 = ({ insuranceOptions }) => {
|
|
6475
|
-
const [modal, setModal] =
|
|
6476
|
-
const toggleModal =
|
|
7569
|
+
const [modal, setModal] = useState23(false);
|
|
7570
|
+
const toggleModal = useCallback26(() => setModal(!modal), [modal]);
|
|
6477
7571
|
if (!insuranceOptions.length) {
|
|
6478
7572
|
return null;
|
|
6479
7573
|
}
|
|
6480
|
-
return /* @__PURE__ */
|
|
7574
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, modal && /* @__PURE__ */ React70.createElement(InsuranceFreeModal_default, {
|
|
6481
7575
|
onClose: toggleModal,
|
|
6482
7576
|
insuranceOptions: insuranceOptions[0]
|
|
6483
|
-
}), /* @__PURE__ */
|
|
7577
|
+
}), /* @__PURE__ */ React70.createElement(Repeat, null, /* @__PURE__ */ React70.createElement(RepeatTiny, null, /* @__PURE__ */ React70.createElement(VisualHeading, null, insuranceOptions[0]?.insuranceHeader ?? "F\xF6rs\xE4kring")), /* @__PURE__ */ React70.createElement(RepeatTiny, null, /* @__PURE__ */ React70.createElement(React70.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React70.createElement(OptionBox_default, {
|
|
6484
7578
|
key: `${insuranceOption.url}-${index2}`,
|
|
6485
7579
|
logo: insuranceOption.logotype || void 0,
|
|
6486
7580
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
6487
|
-
}, insuranceOption.description && /* @__PURE__ */
|
|
7581
|
+
}, insuranceOption.description && /* @__PURE__ */ React70.createElement(Content_default, {
|
|
6488
7582
|
dangerouslySetInnerHTML: {
|
|
6489
7583
|
__html: marked2(insuranceOption.description)
|
|
6490
7584
|
}
|
|
6491
|
-
}), /* @__PURE__ */
|
|
7585
|
+
}), /* @__PURE__ */ React70.createElement(OptionBoxContent, null, /* @__PURE__ */ React70.createElement("p", null, /* @__PURE__ */ React70.createElement(ButtonInline, {
|
|
6492
7586
|
onClick: toggleModal
|
|
6493
7587
|
}, "Mer information")))))))));
|
|
6494
7588
|
};
|
|
@@ -6501,12 +7595,12 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
6501
7595
|
}
|
|
6502
7596
|
if (insuranceOptions.length > 0) {
|
|
6503
7597
|
if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
|
|
6504
|
-
return /* @__PURE__ */
|
|
7598
|
+
return /* @__PURE__ */ React71.createElement(Insurance_default, {
|
|
6505
7599
|
id,
|
|
6506
7600
|
branch,
|
|
6507
7601
|
insuranceOptions
|
|
6508
7602
|
});
|
|
6509
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ React71.createElement(InsuranceFree_default, {
|
|
6510
7604
|
insuranceOptions
|
|
6511
7605
|
});
|
|
6512
7606
|
}
|
|
@@ -6515,22 +7609,22 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
6515
7609
|
var InsuranceOptions_default = InsuranceOptions;
|
|
6516
7610
|
|
|
6517
7611
|
// src/layouts/searchItem/ManufacturerPackagesOption.tsx
|
|
6518
|
-
import
|
|
7612
|
+
import React72 from "react";
|
|
6519
7613
|
import { marked as marked3 } from "marked";
|
|
6520
7614
|
var ManufacturerPackageOption = ({ packageOption }) => {
|
|
6521
7615
|
if (!packageOption) {
|
|
6522
7616
|
return null;
|
|
6523
7617
|
}
|
|
6524
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ React72.createElement(ProductPageMainSection, null, /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(H2, {
|
|
6525
7619
|
noMargin: true
|
|
6526
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
7620
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(Content_default, {
|
|
6527
7621
|
dangerouslySetInnerHTML: { __html: marked3(packageOption.description) }
|
|
6528
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
7622
|
+
})), packageOption.link?.url && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(ButtonInline, {
|
|
6529
7623
|
as: "a",
|
|
6530
7624
|
href: packageOption.link.url,
|
|
6531
7625
|
target: "_blank",
|
|
6532
7626
|
rel: "noopener noreferrer"
|
|
6533
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
7627
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(LogoBox_default, {
|
|
6534
7628
|
logo: packageOption.image,
|
|
6535
7629
|
alt: "Logotyp",
|
|
6536
7630
|
wide: true
|
|
@@ -6539,23 +7633,23 @@ var ManufacturerPackageOption = ({ packageOption }) => {
|
|
|
6539
7633
|
var ManufacturerPackagesOption_default = ManufacturerPackageOption;
|
|
6540
7634
|
|
|
6541
7635
|
// src/layouts/searchItem/CheckList.tsx
|
|
6542
|
-
import
|
|
7636
|
+
import React79, { useState as useState27, useCallback as useCallback31, useEffect as useEffect13 } from "react";
|
|
6543
7637
|
|
|
6544
7638
|
// src/components/ActionList/index.tsx
|
|
6545
|
-
import
|
|
7639
|
+
import React74, { useCallback as useCallback28 } from "react";
|
|
6546
7640
|
|
|
6547
7641
|
// src/components/ActionList/toggle-item.tsx
|
|
6548
|
-
import
|
|
7642
|
+
import React73, { useState as useState24, useCallback as useCallback27 } from "react";
|
|
6549
7643
|
var initialValue = {};
|
|
6550
7644
|
var getInitialValue = (title) => title && !!initialValue[title];
|
|
6551
7645
|
var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
6552
|
-
const [visible, setVisible] =
|
|
6553
|
-
const _onClickValue =
|
|
7646
|
+
const [visible, setVisible] = useState24(() => getInitialValue(type));
|
|
7647
|
+
const _onClickValue = useCallback27(() => {
|
|
6554
7648
|
if (onClickValue) {
|
|
6555
7649
|
onClickValue();
|
|
6556
7650
|
}
|
|
6557
7651
|
}, []);
|
|
6558
|
-
const onClick =
|
|
7652
|
+
const onClick = useCallback27(() => {
|
|
6559
7653
|
if (!visible) {
|
|
6560
7654
|
initialValue[type] = true;
|
|
6561
7655
|
setVisible(true);
|
|
@@ -6565,17 +7659,17 @@ var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
6565
7659
|
}
|
|
6566
7660
|
}, [visible]);
|
|
6567
7661
|
const visibleTitle = type === "tel" ? "Ring" : type === "mailto" ? "Skicka ett mail till" : "";
|
|
6568
|
-
return /* @__PURE__ */
|
|
7662
|
+
return /* @__PURE__ */ React73.createElement(RepeatTiny, null, visible ? /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
6569
7663
|
onClick: _onClickValue,
|
|
6570
7664
|
as: "a",
|
|
6571
7665
|
href: `${type}:${value}`,
|
|
6572
7666
|
title: `${visibleTitle} ${value}`,
|
|
6573
7667
|
fullWidth: true
|
|
6574
|
-
}, /* @__PURE__ */
|
|
7668
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, value)) : /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
6575
7669
|
onClick,
|
|
6576
7670
|
title,
|
|
6577
7671
|
fullWidth: true
|
|
6578
|
-
}, /* @__PURE__ */
|
|
7672
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, title)));
|
|
6579
7673
|
};
|
|
6580
7674
|
var toggle_item_default = ToggleItem;
|
|
6581
7675
|
|
|
@@ -6688,18 +7782,18 @@ var formatPhonenumber = (text) => {
|
|
|
6688
7782
|
var ActionList = ({ contact, branch }) => {
|
|
6689
7783
|
const email = contact?.email || branch?.contact?.email;
|
|
6690
7784
|
const phonenumber = contact?.phonenumber || branch?.contact?.phonenumber;
|
|
6691
|
-
const onClickMailVisible =
|
|
6692
|
-
const onClickPhoneVisible =
|
|
6693
|
-
const onClickPhoneValue =
|
|
7785
|
+
const onClickMailVisible = useCallback28(() => pubsub_default.publish("MailVisible"), []);
|
|
7786
|
+
const onClickPhoneVisible = useCallback28(() => pubsub_default.publish("PhonenumberVisible"), []);
|
|
7787
|
+
const onClickPhoneValue = useCallback28(() => pubsub_default.publish("PhonenumberCall"), []);
|
|
6694
7788
|
if (!email && !phonenumber) {
|
|
6695
7789
|
return null;
|
|
6696
7790
|
}
|
|
6697
|
-
return /* @__PURE__ */
|
|
7791
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, email && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
6698
7792
|
onClickVisible: onClickMailVisible,
|
|
6699
7793
|
title: "Visa mailadress",
|
|
6700
7794
|
value: email,
|
|
6701
7795
|
type: "mailto"
|
|
6702
|
-
}), phonenumber && /* @__PURE__ */
|
|
7796
|
+
}), phonenumber && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
6703
7797
|
title: "Visa telefonnummer",
|
|
6704
7798
|
value: formatPhonenumber(phonenumber),
|
|
6705
7799
|
type: "tel",
|
|
@@ -6710,16 +7804,16 @@ var ActionList = ({ contact, branch }) => {
|
|
|
6710
7804
|
var ActionList_default = ActionList;
|
|
6711
7805
|
|
|
6712
7806
|
// src/components/CheckMarkList/index.tsx
|
|
6713
|
-
import
|
|
7807
|
+
import React75 from "react";
|
|
6714
7808
|
|
|
6715
7809
|
// src/components/CheckMarkList/wrapper.tsx
|
|
6716
|
-
import
|
|
6717
|
-
var List9 =
|
|
7810
|
+
import styled51 from "styled-components";
|
|
7811
|
+
var List9 = styled51.ul`
|
|
6718
7812
|
list-style: none;
|
|
6719
7813
|
padding: 0;
|
|
6720
7814
|
margin: 0;
|
|
6721
7815
|
`;
|
|
6722
|
-
var
|
|
7816
|
+
var Item11 = styled51.li`
|
|
6723
7817
|
position: relative;
|
|
6724
7818
|
font-size: 0.875rem;
|
|
6725
7819
|
|
|
@@ -6727,7 +7821,7 @@ var Item9 = styled47.li`
|
|
|
6727
7821
|
margin-top: ${size(0.5)};
|
|
6728
7822
|
}
|
|
6729
7823
|
`;
|
|
6730
|
-
var Icon6 =
|
|
7824
|
+
var Icon6 = styled51.div.attrs(() => ({
|
|
6731
7825
|
className: "wayke__theme wayke__color--primary-text"
|
|
6732
7826
|
}))`
|
|
6733
7827
|
position: absolute;
|
|
@@ -6735,52 +7829,52 @@ var Icon6 = styled47.div.attrs(() => ({
|
|
|
6735
7829
|
top: 4px; // Magic number
|
|
6736
7830
|
font-size: 0.875em;
|
|
6737
7831
|
`;
|
|
6738
|
-
var Label10 =
|
|
7832
|
+
var Label10 = styled51.div`
|
|
6739
7833
|
padding-left: calc(1em + ${size(1)});
|
|
6740
7834
|
`;
|
|
6741
7835
|
|
|
6742
7836
|
// src/components/CheckMarkList/index.tsx
|
|
6743
|
-
var CheckMarkListItem = ({ children }) => /* @__PURE__ */
|
|
7837
|
+
var CheckMarkListItem = ({ children }) => /* @__PURE__ */ React75.createElement(Item11, null, /* @__PURE__ */ React75.createElement(Icon6, null, /* @__PURE__ */ React75.createElement(IconCheck, {
|
|
6744
7838
|
block: true
|
|
6745
|
-
})), /* @__PURE__ */
|
|
6746
|
-
var CheckMarkList = ({ children }) => /* @__PURE__ */
|
|
7839
|
+
})), /* @__PURE__ */ React75.createElement(Label10, null, children));
|
|
7840
|
+
var CheckMarkList = ({ children }) => /* @__PURE__ */ React75.createElement(List9, null, children);
|
|
6747
7841
|
var CheckMarkList_default = CheckMarkList;
|
|
6748
7842
|
|
|
6749
7843
|
// src/components/SwitchBar/index.tsx
|
|
6750
|
-
import
|
|
7844
|
+
import React76, { useState as useState25, useCallback as useCallback29 } from "react";
|
|
6751
7845
|
|
|
6752
7846
|
// src/components/SwitchBar/wrapper.tsx
|
|
6753
|
-
import
|
|
6754
|
-
var
|
|
7847
|
+
import styled52 from "styled-components";
|
|
7848
|
+
var Wrapper29 = styled52.div`
|
|
6755
7849
|
padding: ${size(1.5)} ${size(2)};
|
|
6756
7850
|
background-color: ${(props) => props.theme.color.accentDark};
|
|
6757
7851
|
border-radius: 3px;
|
|
6758
7852
|
font-size: 0.875rem;
|
|
6759
7853
|
`;
|
|
6760
|
-
var Header6 =
|
|
7854
|
+
var Header6 = styled52.div`
|
|
6761
7855
|
display: flex;
|
|
6762
7856
|
align-items: center;
|
|
6763
7857
|
`;
|
|
6764
|
-
var Body5 =
|
|
7858
|
+
var Body5 = styled52.div`
|
|
6765
7859
|
font-size: 0.875rem;
|
|
6766
7860
|
margin-top: ${size(1)};
|
|
6767
7861
|
`;
|
|
6768
|
-
var Info3 =
|
|
7862
|
+
var Info3 = styled52.div`
|
|
6769
7863
|
flex: 1 1 auto;
|
|
6770
7864
|
display: flex;
|
|
6771
7865
|
align-items: center;
|
|
6772
7866
|
`;
|
|
6773
|
-
var Action7 =
|
|
7867
|
+
var Action7 = styled52.div`
|
|
6774
7868
|
flex-shrink: 0;
|
|
6775
7869
|
padding-left: ${size(1.5)};
|
|
6776
7870
|
font-size: 0.875rem;
|
|
6777
7871
|
`;
|
|
6778
|
-
var InfoContent =
|
|
7872
|
+
var InfoContent = styled52.div`
|
|
6779
7873
|
& + & {
|
|
6780
7874
|
margin-left: ${size(0.75)};
|
|
6781
7875
|
}
|
|
6782
7876
|
`;
|
|
6783
|
-
var InfoBtn2 =
|
|
7877
|
+
var InfoBtn2 = styled52(ButtonReset).attrs(() => ({
|
|
6784
7878
|
className: "wayke__theme wayke__color--primary-text"
|
|
6785
7879
|
}))`
|
|
6786
7880
|
position: relative;
|
|
@@ -6814,7 +7908,7 @@ var InfoBtn2 = styled48(ButtonReset).attrs(() => ({
|
|
|
6814
7908
|
transform: scale(0.95);
|
|
6815
7909
|
}
|
|
6816
7910
|
`;
|
|
6817
|
-
var Title2 =
|
|
7911
|
+
var Title2 = styled52.div.attrs(() => ({
|
|
6818
7912
|
className: "wayke__theme wayke__font--bold"
|
|
6819
7913
|
}))`
|
|
6820
7914
|
font-size: 1rem;
|
|
@@ -6822,17 +7916,17 @@ var Title2 = styled48.div.attrs(() => ({
|
|
|
6822
7916
|
|
|
6823
7917
|
// src/components/SwitchBar/index.tsx
|
|
6824
7918
|
var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
6825
|
-
const [info, setInfo] =
|
|
6826
|
-
const onToggleInfo =
|
|
6827
|
-
return /* @__PURE__ */
|
|
7919
|
+
const [info, setInfo] = useState25(false);
|
|
7920
|
+
const onToggleInfo = useCallback29(() => setInfo(!info), [info]);
|
|
7921
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement(Wrapper29, null, /* @__PURE__ */ React76.createElement(Header6, null, /* @__PURE__ */ React76.createElement(Info3, null, /* @__PURE__ */ React76.createElement(InfoContent, null, /* @__PURE__ */ React76.createElement(Title2, null, title)), children && /* @__PURE__ */ React76.createElement(InfoContent, null, /* @__PURE__ */ React76.createElement(InfoBtn2, {
|
|
6828
7922
|
onClick: onToggleInfo,
|
|
6829
7923
|
title: "Mer information"
|
|
6830
|
-
}, /* @__PURE__ */
|
|
7924
|
+
}, /* @__PURE__ */ React76.createElement(IconInfo, {
|
|
6831
7925
|
block: true
|
|
6832
|
-
})))), actionTitle && /* @__PURE__ */
|
|
7926
|
+
})))), actionTitle && /* @__PURE__ */ React76.createElement(Action7, null, /* @__PURE__ */ React76.createElement(ButtonInline, {
|
|
6833
7927
|
onClick,
|
|
6834
7928
|
title: actionTitle
|
|
6835
|
-
}, actionTitle))), body && /* @__PURE__ */
|
|
7929
|
+
}, actionTitle))), body && /* @__PURE__ */ React76.createElement(Body5, null, body)), info && /* @__PURE__ */ React76.createElement(Modal_default, {
|
|
6836
7930
|
title,
|
|
6837
7931
|
onClose: onToggleInfo
|
|
6838
7932
|
}, children));
|
|
@@ -6840,7 +7934,7 @@ var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
|
6840
7934
|
var SwitchBar_default = SwitchBar;
|
|
6841
7935
|
|
|
6842
7936
|
// src/layouts/searchItem/BranchModal.tsx
|
|
6843
|
-
import
|
|
7937
|
+
import React77, { useState as useState26, useCallback as useCallback30, useContext as useContext3 } from "react";
|
|
6844
7938
|
|
|
6845
7939
|
// src/State/CentralStorage/CentralStorageContext.ts
|
|
6846
7940
|
import { createContext as createContext3 } from "react";
|
|
@@ -6852,23 +7946,23 @@ var CentralStorageContext = createContext3({
|
|
|
6852
7946
|
// src/layouts/searchItem/BranchModal.tsx
|
|
6853
7947
|
var BranchModal = ({ loading, connections, onClose }) => {
|
|
6854
7948
|
const { centralStorageId, setCentralStorageId } = useContext3(CentralStorageContext);
|
|
6855
|
-
const [localValue, setLocalValue] =
|
|
6856
|
-
const onConfirm =
|
|
7949
|
+
const [localValue, setLocalValue] = useState26(centralStorageId);
|
|
7950
|
+
const onConfirm = useCallback30((id) => {
|
|
6857
7951
|
if (id) {
|
|
6858
7952
|
setCentralStorageId(id);
|
|
6859
7953
|
}
|
|
6860
7954
|
}, []);
|
|
6861
|
-
const onChange =
|
|
7955
|
+
const onChange = useCallback30(
|
|
6862
7956
|
(e) => setLocalValue(e.currentTarget.value),
|
|
6863
7957
|
[]
|
|
6864
7958
|
);
|
|
6865
7959
|
if (!localValue) {
|
|
6866
7960
|
return null;
|
|
6867
7961
|
}
|
|
6868
|
-
return /* @__PURE__ */
|
|
7962
|
+
return /* @__PURE__ */ React77.createElement(Modal_default, {
|
|
6869
7963
|
title: "Byt anl\xE4ggning",
|
|
6870
7964
|
onClose
|
|
6871
|
-
}, /* @__PURE__ */
|
|
7965
|
+
}, /* @__PURE__ */ React77.createElement(Repeat, null, /* @__PURE__ */ React77.createElement(RepeatTiny, null, /* @__PURE__ */ React77.createElement(Content_default, null, /* @__PURE__ */ React77.createElement("p", null, "V\xE4lj den anl\xE4ggning du vill visa kontaktuppgifter f\xF6r."))), /* @__PURE__ */ React77.createElement(RepeatTiny, null, /* @__PURE__ */ React77.createElement(InputLabel_default, null, "V\xE4lj anl\xE4ggning"), /* @__PURE__ */ React77.createElement(InputSelect_default, {
|
|
6872
7966
|
value: localValue,
|
|
6873
7967
|
onChange,
|
|
6874
7968
|
options: connections?.map((x) => ({
|
|
@@ -6876,27 +7970,27 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
6876
7970
|
displayName: x.name
|
|
6877
7971
|
})),
|
|
6878
7972
|
title: "V\xE4lj anl\xE4ggning"
|
|
6879
|
-
}))), /* @__PURE__ */
|
|
7973
|
+
}))), /* @__PURE__ */ React77.createElement(Repeat, null, /* @__PURE__ */ React77.createElement(ButtonPrimary, {
|
|
6880
7974
|
disabled: loading,
|
|
6881
7975
|
fullWidth: true,
|
|
6882
7976
|
onClick: () => onConfirm(localValue)
|
|
6883
|
-
}, /* @__PURE__ */
|
|
7977
|
+
}, /* @__PURE__ */ React77.createElement(ButtonContent, null, "V\xE4lj"))));
|
|
6884
7978
|
};
|
|
6885
7979
|
var BranchModal_default = BranchModal;
|
|
6886
7980
|
|
|
6887
7981
|
// src/layouts/searchItem/PackageOptionModal.tsx
|
|
6888
|
-
import
|
|
7982
|
+
import React78 from "react";
|
|
6889
7983
|
import { marked as marked4 } from "marked";
|
|
6890
|
-
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */
|
|
7984
|
+
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */ React78.createElement(Modal_default, {
|
|
6891
7985
|
title: packageOption.title || "",
|
|
6892
7986
|
onClose
|
|
6893
|
-
}, packageOption.image && /* @__PURE__ */
|
|
7987
|
+
}, packageOption.image && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(LogoBox_default, {
|
|
6894
7988
|
logo: packageOption.image,
|
|
6895
7989
|
alt: packageOption.title || void 0,
|
|
6896
7990
|
wide: true
|
|
6897
|
-
})), packageOption.description && /* @__PURE__ */
|
|
7991
|
+
})), packageOption.description && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(Content_default, {
|
|
6898
7992
|
dangerouslySetInnerHTML: { __html: marked4(packageOption.description) }
|
|
6899
|
-
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */
|
|
7993
|
+
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(ButtonInline, {
|
|
6900
7994
|
as: "a",
|
|
6901
7995
|
href: packageOption.link.href,
|
|
6902
7996
|
target: "_blank",
|
|
@@ -6914,90 +8008,90 @@ var CheckList = ({
|
|
|
6914
8008
|
toggleEcomModal,
|
|
6915
8009
|
loadingCentralStorageVehicle
|
|
6916
8010
|
}) => {
|
|
6917
|
-
const [modalBranch, setModalBranch] =
|
|
6918
|
-
const openModalBranch =
|
|
6919
|
-
const closeModalBranch =
|
|
6920
|
-
const [modal, setModal] =
|
|
6921
|
-
const onOpen =
|
|
6922
|
-
const onClose =
|
|
6923
|
-
|
|
8011
|
+
const [modalBranch, setModalBranch] = useState27(false);
|
|
8012
|
+
const openModalBranch = useCallback31(() => setModalBranch(true), []);
|
|
8013
|
+
const closeModalBranch = useCallback31(() => setModalBranch(false), []);
|
|
8014
|
+
const [modal, setModal] = useState27();
|
|
8015
|
+
const onOpen = useCallback31((nextModal) => setModal(nextModal), []);
|
|
8016
|
+
const onClose = useCallback31(() => setModal(void 0), []);
|
|
8017
|
+
useEffect13(() => {
|
|
6924
8018
|
if ((branch || contact) && modalBranch) {
|
|
6925
8019
|
setModalBranch(false);
|
|
6926
8020
|
}
|
|
6927
8021
|
}, [branch, contact]);
|
|
6928
8022
|
const packageOption = manufacturer?.packageOption;
|
|
6929
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ React79.createElement(React79.Fragment, null, modalBranch && /* @__PURE__ */ React79.createElement(BranchModal_default, {
|
|
6930
8024
|
loading: loadingCentralStorageVehicle,
|
|
6931
8025
|
connections: branch?.connections,
|
|
6932
8026
|
onClose: closeModalBranch
|
|
6933
|
-
}), modal && /* @__PURE__ */
|
|
8027
|
+
}), modal && /* @__PURE__ */ React79.createElement(PackageOptionModal_default, {
|
|
6934
8028
|
packageOption: modal,
|
|
6935
8029
|
onClose
|
|
6936
|
-
}), /* @__PURE__ */
|
|
8030
|
+
}), /* @__PURE__ */ React79.createElement(Repeat, null, /* @__PURE__ */ React79.createElement(CheckMarkList_default, null, packageOption?.title && /* @__PURE__ */ React79.createElement(CheckMarkListItem, null, /* @__PURE__ */ React79.createElement(React79.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
6937
8031
|
onClick: () => onOpen({
|
|
6938
8032
|
title: packageOption?.title,
|
|
6939
8033
|
image: packageOption?.image,
|
|
6940
8034
|
description: packageOption?.description,
|
|
6941
8035
|
link: packageOption?.link
|
|
6942
8036
|
})
|
|
6943
|
-
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */
|
|
8037
|
+
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */ React79.createElement(CheckMarkListItem, {
|
|
6944
8038
|
key: packageOption2.title || index2
|
|
6945
|
-
}, /* @__PURE__ */
|
|
8039
|
+
}, /* @__PURE__ */ React79.createElement(React79.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
6946
8040
|
onClick: () => onOpen({
|
|
6947
8041
|
title: packageOption2?.title,
|
|
6948
8042
|
image: packageOption2?.image,
|
|
6949
8043
|
description: packageOption2?.description,
|
|
6950
8044
|
link: packageOption2?.link
|
|
6951
8045
|
})
|
|
6952
|
-
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */
|
|
8046
|
+
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */ React79.createElement(CheckMarkListItem, null, "Hemleverans"))), /* @__PURE__ */ React79.createElement(Repeat, null, ecommerce && ecommerce.enabled && /* @__PURE__ */ React79.createElement(RepeatTiny, null, /* @__PURE__ */ React79.createElement(ButtonPrimary, {
|
|
6953
8047
|
disabled: !!ecommerce.reserved,
|
|
6954
8048
|
fullWidth: true,
|
|
6955
8049
|
onClick: toggleEcomModal
|
|
6956
|
-
}, /* @__PURE__ */
|
|
8050
|
+
}, /* @__PURE__ */ React79.createElement(ButtonContent, null, "K\xF6p bilen online"))), ecommerce?.reserved && /* @__PURE__ */ React79.createElement(RepeatTiny, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
6957
8051
|
title: "Bilen \xE4r reserverad",
|
|
6958
8052
|
body: "Denna bil \xE4r reserverad av en annan k\xF6pare."
|
|
6959
|
-
}, /* @__PURE__ */
|
|
8053
|
+
}, /* @__PURE__ */ React79.createElement(Content_default, null, /* @__PURE__ */ React79.createElement("p", null, "Denna bil \xE4r reserverad av en annan k\xF6pare.")))), /* @__PURE__ */ React79.createElement(ActionList_default, {
|
|
6960
8054
|
branch,
|
|
6961
8055
|
contact
|
|
6962
|
-
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */
|
|
8056
|
+
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */ React79.createElement(Repeat, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
6963
8057
|
title: "Centrallagerbil",
|
|
6964
8058
|
actionTitle: "Byt anl\xE4ggning",
|
|
6965
8059
|
onClick: openModalBranch
|
|
6966
|
-
}, /* @__PURE__ */
|
|
8060
|
+
}, /* @__PURE__ */ React79.createElement(Content_default, null, /* @__PURE__ */ React79.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.")))));
|
|
6967
8061
|
};
|
|
6968
8062
|
var CheckList_default = CheckList;
|
|
6969
8063
|
|
|
6970
8064
|
// src/layouts/searchItem/Related.tsx
|
|
6971
|
-
import
|
|
8065
|
+
import React81, { useCallback as useCallback32 } from "react";
|
|
6972
8066
|
|
|
6973
8067
|
// src/components/SectionHeader/index.tsx
|
|
6974
|
-
import
|
|
8068
|
+
import React80 from "react";
|
|
6975
8069
|
|
|
6976
8070
|
// src/components/SectionHeader/wrapper.tsx
|
|
6977
|
-
import
|
|
6978
|
-
var
|
|
8071
|
+
import styled53 from "styled-components";
|
|
8072
|
+
var Wrapper30 = styled53.div`
|
|
6979
8073
|
display: flex;
|
|
6980
8074
|
align-items: center;
|
|
6981
8075
|
`;
|
|
6982
|
-
var Heading7 =
|
|
8076
|
+
var Heading7 = styled53.div`
|
|
6983
8077
|
flex: 1 1 auto;
|
|
6984
8078
|
`;
|
|
6985
|
-
var Action8 =
|
|
8079
|
+
var Action8 = styled53.div`
|
|
6986
8080
|
flex-shrink: 0;
|
|
6987
8081
|
padding-left: ${size(2)};
|
|
6988
8082
|
`;
|
|
6989
8083
|
|
|
6990
8084
|
// src/components/SectionHeader/index.tsx
|
|
6991
|
-
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */
|
|
8085
|
+
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */ React80.createElement(Wrapper30, null, /* @__PURE__ */ React80.createElement(Heading7, null, children), onClick && actionTitle && /* @__PURE__ */ React80.createElement(Action8, null, /* @__PURE__ */ React80.createElement(ButtonClear, {
|
|
6992
8086
|
as: "a",
|
|
6993
8087
|
href: "#",
|
|
6994
8088
|
onClick
|
|
6995
|
-
}, /* @__PURE__ */
|
|
8089
|
+
}, /* @__PURE__ */ React80.createElement(ButtonContent, null, actionTitle))));
|
|
6996
8090
|
var SectionHeader_default = SectionHeader;
|
|
6997
8091
|
|
|
6998
8092
|
// src/components/OverflowGrid/index.tsx
|
|
6999
|
-
import
|
|
7000
|
-
var OverflowGrid =
|
|
8093
|
+
import styled54 from "styled-components";
|
|
8094
|
+
var OverflowGrid = styled54.div`
|
|
7001
8095
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
7002
8096
|
${Wrapper} & {
|
|
7003
8097
|
margin-left: ${size(-3)};
|
|
@@ -7012,7 +8106,7 @@ var OverflowGrid = styled50.div`
|
|
|
7012
8106
|
}
|
|
7013
8107
|
}
|
|
7014
8108
|
`;
|
|
7015
|
-
var OverflowGridList =
|
|
8109
|
+
var OverflowGridList = styled54.ul`
|
|
7016
8110
|
display: flex;
|
|
7017
8111
|
align-items: flex-start;
|
|
7018
8112
|
list-style: none;
|
|
@@ -7044,7 +8138,7 @@ var OverflowGridList = styled50.ul`
|
|
|
7044
8138
|
}
|
|
7045
8139
|
}
|
|
7046
8140
|
`;
|
|
7047
|
-
var OverflowGridItem =
|
|
8141
|
+
var OverflowGridItem = styled54.li`
|
|
7048
8142
|
flex: 1 0 auto;
|
|
7049
8143
|
width: calc(100% - ${size(2)});
|
|
7050
8144
|
max-width: calc(100% - ${size(2)});
|
|
@@ -7062,7 +8156,7 @@ var OverflowGridItem = styled50.li`
|
|
|
7062
8156
|
`;
|
|
7063
8157
|
|
|
7064
8158
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
7065
|
-
import { useContext as useContext4, useEffect as
|
|
8159
|
+
import { useContext as useContext4, useEffect as useEffect14 } from "react";
|
|
7066
8160
|
|
|
7067
8161
|
// src/State/RelatedSearch/RelatedSearchContext.ts
|
|
7068
8162
|
import { createContext as createContext4 } from "react";
|
|
@@ -7078,7 +8172,7 @@ var RelatedSearchContext = createContext4({
|
|
|
7078
8172
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
7079
8173
|
var useRelatedSearch = (id) => {
|
|
7080
8174
|
const data = useContext4(RelatedSearchContext);
|
|
7081
|
-
|
|
8175
|
+
useEffect14(() => {
|
|
7082
8176
|
const searchParams = new URLSearchParams();
|
|
7083
8177
|
searchParams.set("hits", "3");
|
|
7084
8178
|
if (data.moreLikeThisUrl && id) {
|
|
@@ -7104,7 +8198,7 @@ var regexPathGuid = (path) => {
|
|
|
7104
8198
|
// src/layouts/searchItem/Related.tsx
|
|
7105
8199
|
var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
7106
8200
|
const { loading, response, moreLikeThisUrl } = useRelatedSearch_default(id);
|
|
7107
|
-
const onItemClicked =
|
|
8201
|
+
const onItemClicked = useCallback32((id2) => {
|
|
7108
8202
|
pubsub_default.publish("ItemClicked", id2);
|
|
7109
8203
|
if (onClickSearchItem) {
|
|
7110
8204
|
onClickSearchItem(id2);
|
|
@@ -7114,30 +8208,30 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
7114
8208
|
return null;
|
|
7115
8209
|
}
|
|
7116
8210
|
if (loading) {
|
|
7117
|
-
return /* @__PURE__ */
|
|
8211
|
+
return /* @__PURE__ */ React81.createElement(Loader_default, null);
|
|
7118
8212
|
}
|
|
7119
|
-
return /* @__PURE__ */
|
|
8213
|
+
return /* @__PURE__ */ React81.createElement(PageSection, {
|
|
7120
8214
|
accent: true,
|
|
7121
8215
|
large: true,
|
|
7122
8216
|
className: "wayke__theme wayke__color--accent-bg"
|
|
7123
|
-
}, /* @__PURE__ */
|
|
8217
|
+
}, /* @__PURE__ */ React81.createElement(Container_default, null, moreLikeThisUrl ? /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
7124
8218
|
onClick: () => {
|
|
7125
8219
|
}
|
|
7126
|
-
}, /* @__PURE__ */
|
|
8220
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
7127
8221
|
noMargin: true
|
|
7128
|
-
}, "Relaterade fordon"))) : /* @__PURE__ */
|
|
8222
|
+
}, "Relaterade fordon"))) : /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
7129
8223
|
onClick: () => {
|
|
7130
8224
|
},
|
|
7131
8225
|
actionTitle: "Visa alla"
|
|
7132
|
-
}, /* @__PURE__ */
|
|
8226
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
7133
8227
|
noMargin: true
|
|
7134
|
-
}, "Senast inkomna"))), /* @__PURE__ */
|
|
8228
|
+
}, "Senast inkomna"))), /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(OverflowGrid, null, /* @__PURE__ */ React81.createElement(OverflowGridList, null, response?.documentList.documents.map((document2) => {
|
|
7135
8229
|
const prefix = pathRoute ? `/${pathRoute}` : "/";
|
|
7136
8230
|
const r = regexPathGuid(pathRoute);
|
|
7137
8231
|
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}`;
|
|
7138
|
-
return /* @__PURE__ */
|
|
8232
|
+
return /* @__PURE__ */ React81.createElement(OverflowGridItem, {
|
|
7139
8233
|
key: document2._id
|
|
7140
|
-
}, /* @__PURE__ */
|
|
8234
|
+
}, /* @__PURE__ */ React81.createElement(ProductCard_default, {
|
|
7141
8235
|
id: document2._id,
|
|
7142
8236
|
onClick: onItemClicked,
|
|
7143
8237
|
title: document2.title,
|
|
@@ -7167,24 +8261,24 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
7167
8261
|
var Related_default = Related;
|
|
7168
8262
|
|
|
7169
8263
|
// src/layouts/searchItem/PackageOptions.tsx
|
|
7170
|
-
import
|
|
8264
|
+
import React82 from "react";
|
|
7171
8265
|
import { marked as marked5 } from "marked";
|
|
7172
8266
|
var PackageOptions = ({ packageOptions }) => {
|
|
7173
8267
|
if (!packageOptions) {
|
|
7174
8268
|
return null;
|
|
7175
8269
|
}
|
|
7176
|
-
return /* @__PURE__ */
|
|
8270
|
+
return /* @__PURE__ */ React82.createElement(React82.Fragment, null, packageOptions.map((packageOption, index2) => /* @__PURE__ */ React82.createElement(ProductPageMainSection, {
|
|
7177
8271
|
key: packageOption.title || index2
|
|
7178
|
-
}, /* @__PURE__ */
|
|
8272
|
+
}, /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(H2, {
|
|
7179
8273
|
noMargin: true
|
|
7180
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
8274
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(Content_default, {
|
|
7181
8275
|
dangerouslySetInnerHTML: { __html: marked5(packageOption.description) }
|
|
7182
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
8276
|
+
})), packageOption.link?.url && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(ButtonInline, {
|
|
7183
8277
|
as: "a",
|
|
7184
8278
|
href: packageOption.link.url,
|
|
7185
8279
|
target: "_blank",
|
|
7186
8280
|
rel: "noopener noreferrer"
|
|
7187
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
8281
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(LogoBox_default, {
|
|
7188
8282
|
logo: packageOption.image,
|
|
7189
8283
|
alt: "Logotyp",
|
|
7190
8284
|
wide: true
|
|
@@ -7193,31 +8287,31 @@ var PackageOptions = ({ packageOptions }) => {
|
|
|
7193
8287
|
var PackageOptions_default = PackageOptions;
|
|
7194
8288
|
|
|
7195
8289
|
// src/layouts/searchItem/Branch.tsx
|
|
7196
|
-
import
|
|
8290
|
+
import React87, { useState as useState30, useCallback as useCallback35, useEffect as useEffect15 } from "react";
|
|
7197
8291
|
|
|
7198
8292
|
// src/components/TableColumn/index.tsx
|
|
7199
|
-
import
|
|
7200
|
-
var TableColumn =
|
|
8293
|
+
import styled55 from "styled-components";
|
|
8294
|
+
var TableColumn = styled55.div`
|
|
7201
8295
|
line-height: 1.2;
|
|
7202
8296
|
`;
|
|
7203
|
-
var TableColumnRow =
|
|
8297
|
+
var TableColumnRow = styled55.div`
|
|
7204
8298
|
display: flex;
|
|
7205
8299
|
align-items: flex-start;
|
|
7206
8300
|
margin: ${size(-1)};
|
|
7207
8301
|
`;
|
|
7208
|
-
var TableColumnCell =
|
|
8302
|
+
var TableColumnCell = styled55.div`
|
|
7209
8303
|
flex: 1 0 50%;
|
|
7210
8304
|
padding: ${size(1)};
|
|
7211
8305
|
`;
|
|
7212
8306
|
|
|
7213
8307
|
// src/components/OpeningHours/index.tsx
|
|
7214
|
-
import
|
|
8308
|
+
import React84, { useMemo as useMemo4 } from "react";
|
|
7215
8309
|
|
|
7216
8310
|
// src/components/Badge/index.tsx
|
|
7217
|
-
import
|
|
8311
|
+
import React83 from "react";
|
|
7218
8312
|
|
|
7219
8313
|
// src/components/Badge/wrapper.tsx
|
|
7220
|
-
import
|
|
8314
|
+
import styled56 from "styled-components";
|
|
7221
8315
|
var getBg = (severity) => {
|
|
7222
8316
|
let bg = theme_default.color.textDark;
|
|
7223
8317
|
if (severity === "positive") {
|
|
@@ -7227,7 +8321,7 @@ var getBg = (severity) => {
|
|
|
7227
8321
|
}
|
|
7228
8322
|
return bg;
|
|
7229
8323
|
};
|
|
7230
|
-
var
|
|
8324
|
+
var Wrapper31 = styled56.div.attrs(() => ({
|
|
7231
8325
|
className: "wayke__theme wayke__font--bold"
|
|
7232
8326
|
}))`
|
|
7233
8327
|
display: inline-block;
|
|
@@ -7240,7 +8334,7 @@ var Wrapper28 = styled52.div.attrs(() => ({
|
|
|
7240
8334
|
`;
|
|
7241
8335
|
|
|
7242
8336
|
// src/components/Badge/index.tsx
|
|
7243
|
-
var Badge = ({ label, severity }) => /* @__PURE__ */
|
|
8337
|
+
var Badge = ({ label, severity }) => /* @__PURE__ */ React83.createElement(Wrapper31, {
|
|
7244
8338
|
severity
|
|
7245
8339
|
}, label);
|
|
7246
8340
|
var Badge_default = Badge;
|
|
@@ -7324,33 +8418,33 @@ var OpeningHours = ({ openingHours }) => {
|
|
|
7324
8418
|
if (!oh) {
|
|
7325
8419
|
return null;
|
|
7326
8420
|
}
|
|
7327
|
-
return /* @__PURE__ */
|
|
8421
|
+
return /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement(RepeatSmall, null, /* @__PURE__ */ React84.createElement(Badge_default, {
|
|
7328
8422
|
label: currentlyOpen ? "\xD6ppet" : "St\xE4ngt",
|
|
7329
8423
|
severity: currentlyOpen ? "positive" : "negative"
|
|
7330
|
-
})), /* @__PURE__ */
|
|
8424
|
+
})), /* @__PURE__ */ React84.createElement(RepeatSmall, null, /* @__PURE__ */ React84.createElement(TableColumn, null, /* @__PURE__ */ React84.createElement(TableColumnRow, null, /* @__PURE__ */ React84.createElement(TableColumnCell, null, /* @__PURE__ */ React84.createElement(UtilityTextBold, null, today?.title)), /* @__PURE__ */ React84.createElement(TableColumnCell, null, /* @__PURE__ */ React84.createElement(UtilityTextBold, null, today?.from ? `${today.from}-${today.until}` : "St\xE4ngt"))), oh.map((o) => /* @__PURE__ */ React84.createElement(TableColumnRow, {
|
|
7331
8425
|
key: o.titleFrom
|
|
7332
|
-
}, /* @__PURE__ */
|
|
8426
|
+
}, /* @__PURE__ */ React84.createElement(TableColumnCell, null, o.titleTo ? `${o.titleFrom}-${o.titleTo}` : o.titleFrom), /* @__PURE__ */ React84.createElement(TableColumnCell, null, o.from ? `${o.from}-${o.until}` : "St\xE4ngt"))))));
|
|
7333
8427
|
};
|
|
7334
8428
|
var OpeningHours_default = OpeningHours;
|
|
7335
8429
|
|
|
7336
8430
|
// src/components/PhoneNumber/index.tsx
|
|
7337
|
-
import
|
|
8431
|
+
import React85, { useState as useState28, useCallback as useCallback33 } from "react";
|
|
7338
8432
|
var PhoneNumber = ({ phoneNumber }) => {
|
|
7339
|
-
const [visible, setVisible] =
|
|
7340
|
-
const onClick =
|
|
7341
|
-
return /* @__PURE__ */
|
|
8433
|
+
const [visible, setVisible] = useState28(false);
|
|
8434
|
+
const onClick = useCallback33(() => !visible && setVisible(true), [visible]);
|
|
8435
|
+
return /* @__PURE__ */ React85.createElement(TableColumnRow, null, /* @__PURE__ */ React85.createElement(TableColumnCell, null, "Telefonnummer"), /* @__PURE__ */ React85.createElement(TableColumnCell, null, visible ? /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
7342
8436
|
as: "a",
|
|
7343
8437
|
href: `tel:${phoneNumber}`,
|
|
7344
8438
|
title: `Ring ${phoneNumber}`
|
|
7345
|
-
}, /* @__PURE__ */
|
|
8439
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, phoneNumber)) : /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
7346
8440
|
onClick,
|
|
7347
8441
|
title: "Visa telefonnummer"
|
|
7348
|
-
}, /* @__PURE__ */
|
|
8442
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, "Visa telefonnummer"))));
|
|
7349
8443
|
};
|
|
7350
8444
|
var PhoneNumber_default = PhoneNumber;
|
|
7351
8445
|
|
|
7352
8446
|
// src/components/Map/index.tsx
|
|
7353
|
-
import
|
|
8447
|
+
import React86, { useState as useState29, useCallback as useCallback34 } from "react";
|
|
7354
8448
|
|
|
7355
8449
|
// src/State/Settings/useSettings.ts
|
|
7356
8450
|
import { useContext as useContext5 } from "react";
|
|
@@ -7364,16 +8458,16 @@ var useSettings = () => useContext5(SettingsContext);
|
|
|
7364
8458
|
var useSettings_default = useSettings;
|
|
7365
8459
|
|
|
7366
8460
|
// src/components/Map/wrapper.tsx
|
|
7367
|
-
import
|
|
7368
|
-
var
|
|
8461
|
+
import styled57 from "styled-components";
|
|
8462
|
+
var Wrapper32 = styled57.a`
|
|
7369
8463
|
display: block;
|
|
7370
8464
|
`;
|
|
7371
|
-
var
|
|
8465
|
+
var Image4 = styled57.img`
|
|
7372
8466
|
display: block;
|
|
7373
8467
|
width: 100%;
|
|
7374
8468
|
border-radius: 3px;
|
|
7375
8469
|
`;
|
|
7376
|
-
var Placeholder =
|
|
8470
|
+
var Placeholder = styled57.a`
|
|
7377
8471
|
display: block;
|
|
7378
8472
|
position: relative;
|
|
7379
8473
|
width: 100%;
|
|
@@ -7383,7 +8477,7 @@ var Placeholder = styled53.a`
|
|
|
7383
8477
|
border-radius: 3px;
|
|
7384
8478
|
color: ${(props) => props.theme.color.textDark};
|
|
7385
8479
|
`;
|
|
7386
|
-
var PlaceholderAction =
|
|
8480
|
+
var PlaceholderAction = styled57.div`
|
|
7387
8481
|
position: absolute;
|
|
7388
8482
|
top: 50%;
|
|
7389
8483
|
left: 50%;
|
|
@@ -7393,8 +8487,8 @@ var PlaceholderAction = styled53.div`
|
|
|
7393
8487
|
// src/components/Map/index.tsx
|
|
7394
8488
|
var StaticMap = ({ position }) => {
|
|
7395
8489
|
const { googleMapsApiKey, googleMapsMarker } = useSettings_default();
|
|
7396
|
-
const [visible, setVisible] =
|
|
7397
|
-
const onShowMap =
|
|
8490
|
+
const [visible, setVisible] = useState29(false);
|
|
8491
|
+
const onShowMap = useCallback34((e) => {
|
|
7398
8492
|
if (googleMapsApiKey) {
|
|
7399
8493
|
e.preventDefault();
|
|
7400
8494
|
setVisible(true);
|
|
@@ -7405,33 +8499,33 @@ var StaticMap = ({ position }) => {
|
|
|
7405
8499
|
}
|
|
7406
8500
|
const { latitude, longitude } = position;
|
|
7407
8501
|
if (visible && googleMapsApiKey) {
|
|
7408
|
-
return /* @__PURE__ */
|
|
8502
|
+
return /* @__PURE__ */ React86.createElement(Wrapper32, {
|
|
7409
8503
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
7410
8504
|
title: "Visa p\xE5 Google Maps",
|
|
7411
8505
|
target: "_blank",
|
|
7412
8506
|
rel: "nofollow noopener noreferrer"
|
|
7413
|
-
}, /* @__PURE__ */
|
|
8507
|
+
}, /* @__PURE__ */ React86.createElement(Image4, {
|
|
7414
8508
|
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}`,
|
|
7415
8509
|
alt: "Karta"
|
|
7416
8510
|
}));
|
|
7417
8511
|
}
|
|
7418
|
-
return /* @__PURE__ */
|
|
8512
|
+
return /* @__PURE__ */ React86.createElement(Placeholder, {
|
|
7419
8513
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
7420
8514
|
target: "_blank",
|
|
7421
8515
|
rel: "noopener noreferrer nofollow",
|
|
7422
8516
|
onClick: onShowMap
|
|
7423
|
-
}, /* @__PURE__ */
|
|
8517
|
+
}, /* @__PURE__ */ React86.createElement(PlaceholderAction, null, /* @__PURE__ */ React86.createElement(ButtonSecondary, {
|
|
7424
8518
|
as: "div"
|
|
7425
|
-
}, /* @__PURE__ */
|
|
8519
|
+
}, /* @__PURE__ */ React86.createElement(ButtonContent, null, "Visa karta"))));
|
|
7426
8520
|
};
|
|
7427
8521
|
var Map_default = StaticMap;
|
|
7428
8522
|
|
|
7429
8523
|
// src/layouts/searchItem/Branch.tsx
|
|
7430
8524
|
var Branch2 = ({ branch, loading }) => {
|
|
7431
|
-
const [modal, setModal] =
|
|
7432
|
-
const openModal =
|
|
7433
|
-
const closeModal =
|
|
7434
|
-
|
|
8525
|
+
const [modal, setModal] = useState30(false);
|
|
8526
|
+
const openModal = useCallback35(() => setModal(true), []);
|
|
8527
|
+
const closeModal = useCallback35(() => setModal(false), []);
|
|
8528
|
+
useEffect15(() => {
|
|
7435
8529
|
if (branch && modal) {
|
|
7436
8530
|
setModal(false);
|
|
7437
8531
|
}
|
|
@@ -7439,29 +8533,29 @@ var Branch2 = ({ branch, loading }) => {
|
|
|
7439
8533
|
if (!branch) {
|
|
7440
8534
|
return null;
|
|
7441
8535
|
}
|
|
7442
|
-
return /* @__PURE__ */
|
|
8536
|
+
return /* @__PURE__ */ React87.createElement(React87.Fragment, null, modal && /* @__PURE__ */ React87.createElement(BranchModal_default, {
|
|
7443
8537
|
loading,
|
|
7444
8538
|
connections: branch?.connections,
|
|
7445
8539
|
onClose: closeModal
|
|
7446
|
-
}), /* @__PURE__ */
|
|
8540
|
+
}), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(H2, {
|
|
7447
8541
|
noMargin: true
|
|
7448
|
-
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */
|
|
8542
|
+
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(Map_default, {
|
|
7449
8543
|
position: branch?.location?.position
|
|
7450
|
-
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */
|
|
8544
|
+
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(Content_default, null, /* @__PURE__ */ React87.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar.", " ", /* @__PURE__ */ React87.createElement(ButtonInline, {
|
|
7451
8545
|
as: "span",
|
|
7452
8546
|
role: "button",
|
|
7453
8547
|
onClick: openModal,
|
|
7454
8548
|
inline: true
|
|
7455
|
-
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */
|
|
8549
|
+
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(ProductPageContentLimit, null, /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(TableColumn, null, branch?.location?.streetAddress && branch?.location?.city && /* @__PURE__ */ React87.createElement(TableColumnRow, null, /* @__PURE__ */ React87.createElement(TableColumnCell, null, "Adress"), /* @__PURE__ */ React87.createElement(TableColumnCell, null, /* @__PURE__ */ React87.createElement(ButtonInlineBold, null, /* @__PURE__ */ React87.createElement(ButtonContent, null, `${branch?.location?.streetAddress}, ${branch?.location?.city}`)))), branch?.contact?.phonenumber && /* @__PURE__ */ React87.createElement(PhoneNumber_default, {
|
|
7456
8550
|
phoneNumber: formatPhonenumber(branch.contact.phonenumber)
|
|
7457
|
-
}))), branch?.openingHours && /* @__PURE__ */
|
|
8551
|
+
}))), branch?.openingHours && /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(OpeningHours_default, {
|
|
7458
8552
|
openingHours: branch.openingHours
|
|
7459
8553
|
})))));
|
|
7460
8554
|
};
|
|
7461
8555
|
var Branch_default = Branch2;
|
|
7462
8556
|
|
|
7463
8557
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
7464
|
-
import { useContext as useContext6, useEffect as
|
|
8558
|
+
import { useContext as useContext6, useEffect as useEffect16 } from "react";
|
|
7465
8559
|
|
|
7466
8560
|
// src/hooks/useSearchItemBranch.ts
|
|
7467
8561
|
import { useQuery as useQuery4 } from "@apollo/client";
|
|
@@ -7598,7 +8692,7 @@ var useCentralStorage = (vehicle) => {
|
|
|
7598
8692
|
const connections = vehicle?.branch?.connections;
|
|
7599
8693
|
const branchId = centralStorageId ? connections?.find((x) => x.id === centralStorageId)?.id : void 0;
|
|
7600
8694
|
const { data, loading } = useSearchItemBranch_default(vehicle?.id, branchId);
|
|
7601
|
-
|
|
8695
|
+
useEffect16(() => {
|
|
7602
8696
|
if ((connections?.length || 0) > 0) {
|
|
7603
8697
|
const match = centralStorageId ? connections?.find((x) => x.id === centralStorageId) : void 0;
|
|
7604
8698
|
if (!match) {
|
|
@@ -7617,23 +8711,23 @@ var useCentralStorage = (vehicle) => {
|
|
|
7617
8711
|
var useCentralStorage_default = useCentralStorage;
|
|
7618
8712
|
|
|
7619
8713
|
// src/layouts/searchItem/Page404.tsx
|
|
7620
|
-
import
|
|
7621
|
-
var Page404 = () => /* @__PURE__ */
|
|
8714
|
+
import React88 from "react";
|
|
8715
|
+
var Page404 = () => /* @__PURE__ */ React88.createElement(Page, null, /* @__PURE__ */ React88.createElement(PageSection, {
|
|
7622
8716
|
large: true
|
|
7623
|
-
}, /* @__PURE__ */
|
|
8717
|
+
}, /* @__PURE__ */ React88.createElement(Container_default, null, /* @__PURE__ */ React88.createElement(H1, {
|
|
7624
8718
|
noMargin: true
|
|
7625
8719
|
}, "404"))));
|
|
7626
8720
|
var Page404_default = Page404;
|
|
7627
8721
|
|
|
7628
8722
|
// src/layouts/searchItem/PageLoading.tsx
|
|
7629
|
-
import
|
|
7630
|
-
var PageLoading = () => /* @__PURE__ */
|
|
8723
|
+
import React89 from "react";
|
|
8724
|
+
var PageLoading = () => /* @__PURE__ */ React89.createElement(Page, null, /* @__PURE__ */ React89.createElement(PageSection, {
|
|
7631
8725
|
large: true
|
|
7632
|
-
}, /* @__PURE__ */
|
|
8726
|
+
}, /* @__PURE__ */ React89.createElement(Container_default, null, /* @__PURE__ */ React89.createElement(Loader_default, null))));
|
|
7633
8727
|
var PageLoading_default = PageLoading;
|
|
7634
8728
|
|
|
7635
8729
|
// src/layouts/searchItem/Property.tsx
|
|
7636
|
-
import
|
|
8730
|
+
import React92, { useCallback as useCallback37, useEffect as useEffect17, useMemo as useMemo5, useState as useState32 } from "react";
|
|
7637
8731
|
|
|
7638
8732
|
// src/utils/vehicle-properties/property-tree-creator.ts
|
|
7639
8733
|
var _PropertyTreeCreator = class {
|
|
@@ -8126,11 +9220,11 @@ var property_remover_default = (properties) => {
|
|
|
8126
9220
|
};
|
|
8127
9221
|
|
|
8128
9222
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
8129
|
-
import
|
|
9223
|
+
import React90, { useState as useState31, useCallback as useCallback36 } from "react";
|
|
8130
9224
|
|
|
8131
9225
|
// src/components/TableList/index.tsx
|
|
8132
|
-
import
|
|
8133
|
-
var TableList =
|
|
9226
|
+
import styled58 from "styled-components";
|
|
9227
|
+
var TableList = styled58.ul`
|
|
8134
9228
|
list-style: none;
|
|
8135
9229
|
padding: 0;
|
|
8136
9230
|
margin: 0;
|
|
@@ -8138,7 +9232,7 @@ var TableList = styled54.ul`
|
|
|
8138
9232
|
border-bottom: 1px solid ${(props) => props.theme.color.border};
|
|
8139
9233
|
font-size: 0.875rem;
|
|
8140
9234
|
`;
|
|
8141
|
-
var TableListItem =
|
|
9235
|
+
var TableListItem = styled58.li`
|
|
8142
9236
|
display: flex;
|
|
8143
9237
|
align-items: center;
|
|
8144
9238
|
padding: ${size(1)} 0;
|
|
@@ -8147,30 +9241,30 @@ var TableListItem = styled54.li`
|
|
|
8147
9241
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
8148
9242
|
}
|
|
8149
9243
|
`;
|
|
8150
|
-
var TableListKey =
|
|
9244
|
+
var TableListKey = styled58.div`
|
|
8151
9245
|
flex: 1 1 auto;
|
|
8152
9246
|
`;
|
|
8153
|
-
var TableListValue =
|
|
9247
|
+
var TableListValue = styled58.div`
|
|
8154
9248
|
flex-shrink: 0;
|
|
8155
9249
|
padding-left: ${size(1)};
|
|
8156
9250
|
`;
|
|
8157
|
-
var TableListBooleanPos =
|
|
9251
|
+
var TableListBooleanPos = styled58.div`
|
|
8158
9252
|
color: ${(props) => props.theme.color.ui.positive};
|
|
8159
9253
|
`;
|
|
8160
|
-
var TableListBooleanNeg =
|
|
9254
|
+
var TableListBooleanNeg = styled58.div`
|
|
8161
9255
|
color: ${(props) => props.theme.color.ui.negative};
|
|
8162
9256
|
`;
|
|
8163
9257
|
|
|
8164
9258
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
8165
9259
|
var formatValue = (value, unit) => {
|
|
8166
9260
|
if (typeof value === "boolean") {
|
|
8167
|
-
return value ? /* @__PURE__ */
|
|
9261
|
+
return value ? /* @__PURE__ */ React90.createElement(TableListBooleanPos, {
|
|
8168
9262
|
title: "Ja"
|
|
8169
|
-
}, /* @__PURE__ */
|
|
9263
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Ja"), /* @__PURE__ */ React90.createElement(IconCheck, {
|
|
8170
9264
|
block: true
|
|
8171
|
-
})) : /* @__PURE__ */
|
|
9265
|
+
})) : /* @__PURE__ */ React90.createElement(TableListBooleanNeg, {
|
|
8172
9266
|
title: "Nej"
|
|
8173
|
-
}, /* @__PURE__ */
|
|
9267
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Nej"), /* @__PURE__ */ React90.createElement(IconCancel, {
|
|
8174
9268
|
block: true
|
|
8175
9269
|
}));
|
|
8176
9270
|
}
|
|
@@ -8183,27 +9277,27 @@ var formatValue = (value, unit) => {
|
|
|
8183
9277
|
return value;
|
|
8184
9278
|
};
|
|
8185
9279
|
var MetadataItem = ({ name, hint, value, unit }) => {
|
|
8186
|
-
const [foldout, setFoldout] =
|
|
8187
|
-
const onToggleFoldout =
|
|
9280
|
+
const [foldout, setFoldout] = useState31(false);
|
|
9281
|
+
const onToggleFoldout = useCallback36(() => setFoldout(!foldout), [foldout]);
|
|
8188
9282
|
const presentedValue = formatValue(value, unit);
|
|
8189
|
-
return /* @__PURE__ */
|
|
9283
|
+
return /* @__PURE__ */ React90.createElement(TableListItem, null, /* @__PURE__ */ React90.createElement(TableListKey, null, hint ? /* @__PURE__ */ React90.createElement(ButtonInline, {
|
|
8190
9284
|
onClick: onToggleFoldout,
|
|
8191
9285
|
title: `Mer information om ${name}`
|
|
8192
|
-
}, name) : name), /* @__PURE__ */
|
|
9286
|
+
}, name) : name), /* @__PURE__ */ React90.createElement(TableListValue, null, value !== void 0 ? presentedValue : "Uppgift saknas"), hint && foldout && /* @__PURE__ */ React90.createElement(Modal_default, {
|
|
8193
9287
|
title: name,
|
|
8194
9288
|
onClose: onToggleFoldout
|
|
8195
|
-
}, /* @__PURE__ */
|
|
9289
|
+
}, /* @__PURE__ */ React90.createElement(Content_default, {
|
|
8196
9290
|
dangerouslySetInnerHTML: { __html: hint }
|
|
8197
9291
|
})));
|
|
8198
9292
|
};
|
|
8199
9293
|
var MetadataItem_default = MetadataItem;
|
|
8200
9294
|
|
|
8201
9295
|
// src/components/Tabs/index.tsx
|
|
8202
|
-
import * as
|
|
9296
|
+
import * as React91 from "react";
|
|
8203
9297
|
|
|
8204
9298
|
// src/components/Tabs/wrapper.tsx
|
|
8205
|
-
import
|
|
8206
|
-
var
|
|
9299
|
+
import styled59, { css as css15 } from "styled-components";
|
|
9300
|
+
var Wrapper33 = styled59.div`
|
|
8207
9301
|
overflow: hidden;
|
|
8208
9302
|
margin-top: ${size(-1)};
|
|
8209
9303
|
margin-left: ${size(-1)};
|
|
@@ -8214,7 +9308,7 @@ var Wrapper30 = styled55.div`
|
|
|
8214
9308
|
margin-right: ${size(-2)};
|
|
8215
9309
|
}
|
|
8216
9310
|
`;
|
|
8217
|
-
var List10 =
|
|
9311
|
+
var List10 = styled59.ul`
|
|
8218
9312
|
list-style: none;
|
|
8219
9313
|
padding: 0;
|
|
8220
9314
|
margin: 0;
|
|
@@ -8228,12 +9322,12 @@ var List10 = styled55.ul`
|
|
|
8228
9322
|
padding-right: ${size(1)};
|
|
8229
9323
|
}
|
|
8230
9324
|
`;
|
|
8231
|
-
var
|
|
9325
|
+
var Item12 = styled59.li`
|
|
8232
9326
|
display: inline-block;
|
|
8233
9327
|
vertical-align: bottom;
|
|
8234
9328
|
font-size: 1rem;
|
|
8235
9329
|
`;
|
|
8236
|
-
var Action9 =
|
|
9330
|
+
var Action9 = styled59(ButtonReset).attrs(() => ({
|
|
8237
9331
|
role: "tab",
|
|
8238
9332
|
className: "wayke__theme wayke__font--bold"
|
|
8239
9333
|
}))`
|
|
@@ -8259,7 +9353,7 @@ var Action9 = styled55(ButtonReset).attrs(() => ({
|
|
|
8259
9353
|
z-index: 1;
|
|
8260
9354
|
}
|
|
8261
9355
|
|
|
8262
|
-
${(props) => props.active &&
|
|
9356
|
+
${(props) => props.active && css15`
|
|
8263
9357
|
color: ${(props2) => props2.theme.color.textDark};
|
|
8264
9358
|
|
|
8265
9359
|
:after {
|
|
@@ -8269,9 +9363,9 @@ var Action9 = styled55(ButtonReset).attrs(() => ({
|
|
|
8269
9363
|
`;
|
|
8270
9364
|
|
|
8271
9365
|
// src/components/Tabs/index.tsx
|
|
8272
|
-
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */
|
|
9366
|
+
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React91.createElement(Wrapper33, null, /* @__PURE__ */ React91.createElement(List10, null, tabs.map((tab) => /* @__PURE__ */ React91.createElement(Item12, {
|
|
8273
9367
|
key: tab.name
|
|
8274
|
-
}, /* @__PURE__ */
|
|
9368
|
+
}, /* @__PURE__ */ React91.createElement(Action9, {
|
|
8275
9369
|
title: tab.displayName,
|
|
8276
9370
|
onClick: onClick ? () => onClick(tab.name) : void 0,
|
|
8277
9371
|
active: tab.name === active ? "true" : void 0
|
|
@@ -8279,30 +9373,30 @@ var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React80.createElement(
|
|
|
8279
9373
|
var Tabs_default = Tabs;
|
|
8280
9374
|
|
|
8281
9375
|
// src/layouts/searchItem/Property.tsx
|
|
8282
|
-
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */
|
|
9376
|
+
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(H5, {
|
|
8283
9377
|
as: "h3"
|
|
8284
|
-
}, name), /* @__PURE__ */
|
|
9378
|
+
}, name), /* @__PURE__ */ React92.createElement(TableList, null, !!properties.length && properties.map((property, index2) => /* @__PURE__ */ React92.createElement(MetadataItem_default, {
|
|
8285
9379
|
name: property.name,
|
|
8286
9380
|
hint: property.hint,
|
|
8287
9381
|
value: property.value,
|
|
8288
9382
|
unit: property.unit,
|
|
8289
9383
|
key: `${property.name}-${index2}`
|
|
8290
9384
|
}))));
|
|
8291
|
-
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */
|
|
9385
|
+
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */ React92.createElement("div", {
|
|
8292
9386
|
className: "tab-section"
|
|
8293
|
-
}, !!properties.length && /* @__PURE__ */
|
|
9387
|
+
}, !!properties.length && /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(TableList, null, properties.map((property, index2) => /* @__PURE__ */ React92.createElement(MetadataItem_default, {
|
|
8294
9388
|
name: property.name,
|
|
8295
9389
|
hint: property.hint,
|
|
8296
9390
|
value: property.value,
|
|
8297
9391
|
unit: property.unit,
|
|
8298
9392
|
key: `${property.name}-${index2}`
|
|
8299
|
-
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */
|
|
9393
|
+
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */ React92.createElement(MetadataSubCategory, {
|
|
8300
9394
|
name: subCategory.name,
|
|
8301
9395
|
properties: subCategory.properties,
|
|
8302
9396
|
key: `${subCategory.name}-${index2}`
|
|
8303
9397
|
})));
|
|
8304
9398
|
var PropertySet = ({ propertySet, vehicleData }) => {
|
|
8305
|
-
const [activeCategoryId, setActiveCategoryId] =
|
|
9399
|
+
const [activeCategoryId, setActiveCategoryId] = useState32(-1);
|
|
8306
9400
|
const mappedProperties = useMemo5(() => {
|
|
8307
9401
|
if (!propertySet) {
|
|
8308
9402
|
return void 0;
|
|
@@ -8314,24 +9408,24 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
8314
9408
|
property_tree_sorter_default(tree);
|
|
8315
9409
|
return tree;
|
|
8316
9410
|
}, [propertySet]);
|
|
8317
|
-
|
|
9411
|
+
useEffect17(() => {
|
|
8318
9412
|
const categories = mappedProperties?.categories?.length !== void 0 ? mappedProperties?.categories : void 0;
|
|
8319
9413
|
if (activeCategoryId < 0 && categories !== void 0 && categories.length > 0) {
|
|
8320
9414
|
setActiveCategoryId(categories[0].id);
|
|
8321
9415
|
}
|
|
8322
9416
|
}, [mappedProperties]);
|
|
8323
|
-
const onTab =
|
|
9417
|
+
const onTab = useCallback37((id) => setActiveCategoryId(parseInt(id, 10)), []);
|
|
8324
9418
|
const activeCategory = mappedProperties?.categories?.find(
|
|
8325
9419
|
(category) => category.id === activeCategoryId
|
|
8326
9420
|
);
|
|
8327
|
-
return /* @__PURE__ */
|
|
9421
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(Tabs_default, {
|
|
8328
9422
|
tabs: mappedProperties?.categories?.map((category) => ({
|
|
8329
9423
|
name: `${category.id}`,
|
|
8330
9424
|
displayName: category.name
|
|
8331
9425
|
})) || [],
|
|
8332
9426
|
active: `${activeCategoryId}`,
|
|
8333
9427
|
onClick: onTab
|
|
8334
|
-
})), activeCategory && /* @__PURE__ */
|
|
9428
|
+
})), activeCategory && /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(MetadataCategory, {
|
|
8335
9429
|
properties: activeCategory.properties,
|
|
8336
9430
|
subCategories: activeCategory.subCategories
|
|
8337
9431
|
})));
|
|
@@ -8339,11 +9433,11 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
8339
9433
|
var Property_default = PropertySet;
|
|
8340
9434
|
|
|
8341
9435
|
// src/components/Pdf/index.tsx
|
|
8342
|
-
import
|
|
9436
|
+
import React93 from "react";
|
|
8343
9437
|
|
|
8344
9438
|
// src/components/Pdf/wrapper.tsx
|
|
8345
|
-
import
|
|
8346
|
-
var PdfListItem =
|
|
9439
|
+
import styled60 from "styled-components";
|
|
9440
|
+
var PdfListItem = styled60.li.attrs(() => ({
|
|
8347
9441
|
className: "wayke__theme wayke__color--primary-text"
|
|
8348
9442
|
}))`
|
|
8349
9443
|
flex: 0 0 50%;
|
|
@@ -8353,14 +9447,14 @@ var PdfListItem = styled56.li.attrs(() => ({
|
|
|
8353
9447
|
flex: 0 0 100%;
|
|
8354
9448
|
}
|
|
8355
9449
|
`;
|
|
8356
|
-
var PdfContainer =
|
|
9450
|
+
var PdfContainer = styled60.ul`
|
|
8357
9451
|
list-style: none;
|
|
8358
9452
|
padding: 0;
|
|
8359
9453
|
display: flex;
|
|
8360
9454
|
flex-wrap: wrap;
|
|
8361
9455
|
margin: ${size(-1)};
|
|
8362
9456
|
`;
|
|
8363
|
-
var PdfLink =
|
|
9457
|
+
var PdfLink = styled60.a.attrs(() => ({
|
|
8364
9458
|
className: "wayke__theme wayke__color--primary-text wayke__font--bold"
|
|
8365
9459
|
}))`
|
|
8366
9460
|
text-decoration: none;
|
|
@@ -8374,19 +9468,19 @@ var PdfLink = styled56.a.attrs(() => ({
|
|
|
8374
9468
|
height: 100%;
|
|
8375
9469
|
}
|
|
8376
9470
|
`;
|
|
8377
|
-
var PdfTitle =
|
|
9471
|
+
var PdfTitle = styled60.div`
|
|
8378
9472
|
color: ${(props) => props.theme.color.textDark};
|
|
8379
9473
|
`;
|
|
8380
|
-
var PdfSubtitle =
|
|
9474
|
+
var PdfSubtitle = styled60.div`
|
|
8381
9475
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
8382
9476
|
`;
|
|
8383
|
-
var PdfColumn =
|
|
9477
|
+
var PdfColumn = styled60.div`
|
|
8384
9478
|
flex 0 0 auto;
|
|
8385
9479
|
&:first-child {
|
|
8386
9480
|
flex: 1 1 auto;
|
|
8387
9481
|
}
|
|
8388
9482
|
`;
|
|
8389
|
-
var PdfListInner =
|
|
9483
|
+
var PdfListInner = styled60.div`
|
|
8390
9484
|
position: relative;
|
|
8391
9485
|
border: 1px solid ${(props) => props.theme.color.border};
|
|
8392
9486
|
padding: ${size(1.5)};
|
|
@@ -8398,12 +9492,12 @@ var PdfListInner = styled56.div`
|
|
|
8398
9492
|
`;
|
|
8399
9493
|
|
|
8400
9494
|
// src/components/Pdf/index.tsx
|
|
8401
|
-
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */
|
|
9495
|
+
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */ React93.createElement(PdfListItem, null, /* @__PURE__ */ React93.createElement(PdfListInner, null, /* @__PURE__ */ React93.createElement(PdfColumn, null, /* @__PURE__ */ React93.createElement(PdfTitle, null, document2.name), /* @__PURE__ */ React93.createElement(PdfSubtitle, null, document2.contentType)), /* @__PURE__ */ React93.createElement(PdfColumn, null, /* @__PURE__ */ React93.createElement(PdfLink, {
|
|
8402
9496
|
href: document2.url,
|
|
8403
9497
|
rel: "noopener noreferrer nofollow",
|
|
8404
9498
|
target: "_blank"
|
|
8405
9499
|
}, "\xD6ppna"))));
|
|
8406
|
-
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */
|
|
9500
|
+
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */ React93.createElement(PdfContainer, null, documents.map((document2, i) => /* @__PURE__ */ React93.createElement(PdfDownloadItem, {
|
|
8407
9501
|
key: `${document2.url}-${i}`,
|
|
8408
9502
|
document: document2
|
|
8409
9503
|
})));
|
|
@@ -8420,10 +9514,10 @@ var WaykeSearchItem = ({
|
|
|
8420
9514
|
onClickSearchItem
|
|
8421
9515
|
}) => {
|
|
8422
9516
|
const { ecomSettings } = useSettings_default();
|
|
8423
|
-
const ecomContext =
|
|
9517
|
+
const ecomContext = useRef4();
|
|
8424
9518
|
const { loading, data: result } = useSearchItem_default(id);
|
|
8425
9519
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } = useCentralStorage_default(result?.vehicle);
|
|
8426
|
-
|
|
9520
|
+
useEffect18(() => {
|
|
8427
9521
|
if (ecomSettings) {
|
|
8428
9522
|
ecomContext.current = new WaykeEcomWeb({
|
|
8429
9523
|
id,
|
|
@@ -8445,12 +9539,12 @@ var WaykeSearchItem = ({
|
|
|
8445
9539
|
}
|
|
8446
9540
|
};
|
|
8447
9541
|
}, []);
|
|
8448
|
-
|
|
9542
|
+
useEffect18(() => {
|
|
8449
9543
|
if (!disableResetScrollOnInit) {
|
|
8450
9544
|
window.scrollTo(0, 0);
|
|
8451
9545
|
}
|
|
8452
9546
|
}, []);
|
|
8453
|
-
|
|
9547
|
+
useEffect18(() => {
|
|
8454
9548
|
if (result?.vehicle?.data && modifyDocumentTitleItem) {
|
|
8455
9549
|
const { vehicle: vehicle2 } = result;
|
|
8456
9550
|
const { registrationNumber } = vehicle2.data;
|
|
@@ -8461,12 +9555,12 @@ var WaykeSearchItem = ({
|
|
|
8461
9555
|
() => result?.vehicle?.data?.options?.filter(notEmpty).map((opt) => ({ title: opt })),
|
|
8462
9556
|
[result?.vehicle?.data?.options]
|
|
8463
9557
|
);
|
|
8464
|
-
const onShowMoreOptionsClick =
|
|
9558
|
+
const onShowMoreOptionsClick = useCallback38(() => pubsub_default.publish("OptionsClick"), []);
|
|
8465
9559
|
if (loading) {
|
|
8466
|
-
return /* @__PURE__ */
|
|
9560
|
+
return /* @__PURE__ */ React94.createElement(PageLoading_default, null);
|
|
8467
9561
|
}
|
|
8468
9562
|
if (!result?.vehicle?.data) {
|
|
8469
|
-
return /* @__PURE__ */
|
|
9563
|
+
return /* @__PURE__ */ React94.createElement(Page404_default, null);
|
|
8470
9564
|
}
|
|
8471
9565
|
const { vehicle } = result;
|
|
8472
9566
|
const contact = centralStorageVehicle?.contact;
|
|
@@ -8500,40 +9594,40 @@ var WaykeSearchItem = ({
|
|
|
8500
9594
|
if (fuelType) {
|
|
8501
9595
|
uspList.push({ title: fuelType });
|
|
8502
9596
|
}
|
|
8503
|
-
return /* @__PURE__ */
|
|
9597
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(Page, null, /* @__PURE__ */ React94.createElement(PageSection, {
|
|
8504
9598
|
large: true
|
|
8505
|
-
}, /* @__PURE__ */
|
|
9599
|
+
}, /* @__PURE__ */ React94.createElement(Container_default, null, /* @__PURE__ */ React94.createElement(ProductPage, null, /* @__PURE__ */ React94.createElement(ProductPageAside, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
8506
9600
|
mobileOrder: 1
|
|
8507
|
-
}, !pathRoute && hashRoute ? /* @__PURE__ */
|
|
9601
|
+
}, !pathRoute && hashRoute ? /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(UtilityFontSizeSmall, null, /* @__PURE__ */ React94.createElement(ButtonInlineLight, {
|
|
8508
9602
|
as: "a",
|
|
8509
9603
|
href: "#",
|
|
8510
9604
|
title: "Tillbaka till bils\xF6k"
|
|
8511
|
-
}, /* @__PURE__ */
|
|
9605
|
+
}, /* @__PURE__ */ React94.createElement(ButtonContent, null, /* @__PURE__ */ React94.createElement(IconChevronLeft, {
|
|
8512
9606
|
block: true
|
|
8513
|
-
})), /* @__PURE__ */
|
|
9607
|
+
})), /* @__PURE__ */ React94.createElement(ButtonContent, null, "Tillbaka till bils\xF6k")))) : null, manufacturer?.logotype && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(LogoBox_default, {
|
|
8514
9608
|
logo: manufacturer.logotype,
|
|
8515
9609
|
alt: manufacturer.name
|
|
8516
|
-
})), /* @__PURE__ */
|
|
9610
|
+
})), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement(H1, {
|
|
8517
9611
|
noMargin: true
|
|
8518
|
-
}, title)), shortDescription && /* @__PURE__ */
|
|
9612
|
+
}, title)), shortDescription && /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement("div", null, shortDescription)), /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement(UspList_default, {
|
|
8519
9613
|
small: true,
|
|
8520
9614
|
items: uspList
|
|
8521
|
-
})))), /* @__PURE__ */
|
|
9615
|
+
})))), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
8522
9616
|
mobileOrder: 2
|
|
8523
|
-
}, /* @__PURE__ */
|
|
9617
|
+
}, /* @__PURE__ */ React94.createElement(PriceTable_default, {
|
|
8524
9618
|
price
|
|
8525
|
-
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */
|
|
9619
|
+
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
8526
9620
|
mobileOrder: 4
|
|
8527
|
-
}, financialOptions.length > 0 && /* @__PURE__ */
|
|
9621
|
+
}, financialOptions.length > 0 && /* @__PURE__ */ React94.createElement(FinancialOptions_default, {
|
|
8528
9622
|
id,
|
|
8529
9623
|
financialOptions
|
|
8530
|
-
}), insuranceOptions.length > 0 && /* @__PURE__ */
|
|
9624
|
+
}), insuranceOptions.length > 0 && /* @__PURE__ */ React94.createElement(InsuranceOptions_default, {
|
|
8531
9625
|
id,
|
|
8532
9626
|
branch: centralStorageVehicle?.branch,
|
|
8533
9627
|
insuranceOptions
|
|
8534
|
-
})), /* @__PURE__ */
|
|
9628
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
8535
9629
|
mobileOrder: 5
|
|
8536
|
-
}, /* @__PURE__ */
|
|
9630
|
+
}, /* @__PURE__ */ React94.createElement(CheckList_default, {
|
|
8537
9631
|
manufacturer,
|
|
8538
9632
|
packageOptions,
|
|
8539
9633
|
ecommerce,
|
|
@@ -8541,141 +9635,77 @@ var WaykeSearchItem = ({
|
|
|
8541
9635
|
contact: centralStorageVehicle?.contact,
|
|
8542
9636
|
loadingCentralStorageVehicle,
|
|
8543
9637
|
toggleEcomModal: () => ecomContext.current?.start()
|
|
8544
|
-
}))), /* @__PURE__ */
|
|
9638
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMain, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
8545
9639
|
mobileOrder: 3
|
|
8546
|
-
}, /* @__PURE__ */
|
|
9640
|
+
}, /* @__PURE__ */ React94.createElement(Gallery_default, {
|
|
8547
9641
|
media,
|
|
8548
9642
|
placeholderImage
|
|
8549
|
-
})), /* @__PURE__ */
|
|
9643
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
8550
9644
|
noMargin: true
|
|
8551
|
-
}, "Biluppgifter")), /* @__PURE__ */
|
|
9645
|
+
}, "Biluppgifter")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Information direkt fr\xE5n Transportstyrelsen och tillverkaren."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Property_default, {
|
|
8552
9646
|
propertySet,
|
|
8553
9647
|
vehicleData: vehicle.data
|
|
8554
|
-
}))), description && /* @__PURE__ */
|
|
9648
|
+
}))), description && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Blockquote_default, {
|
|
8555
9649
|
author: contact && contact.name ? contact.name : null,
|
|
8556
9650
|
date: publishedAt ? dateTimeFormat.format(publishedAt, dateTimeFormat.DayMonth) : void 0,
|
|
8557
9651
|
avatar: contact?.avatar || void 0
|
|
8558
|
-
}, !!description && /* @__PURE__ */
|
|
9652
|
+
}, !!description && /* @__PURE__ */ React94.createElement("p", null, description))), (options?.length || 0) > 0 && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
8559
9653
|
noMargin: true
|
|
8560
|
-
}, "Utrustning")), /* @__PURE__ */
|
|
9654
|
+
}, "Utrustning")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Kompletterande uppgifter om bilen."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(ExtendContent_default, {
|
|
8561
9655
|
actionTitle: "Visa mer",
|
|
8562
9656
|
onClick: onShowMoreOptionsClick
|
|
8563
|
-
}, /* @__PURE__ */
|
|
9657
|
+
}, /* @__PURE__ */ React94.createElement(UspList_default, {
|
|
8564
9658
|
items: options
|
|
8565
|
-
})))), (documents.length || 0) > 0 && /* @__PURE__ */
|
|
9659
|
+
})))), (documents.length || 0) > 0 && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
8566
9660
|
noMargin: true
|
|
8567
|
-
}, "Dokument")), /* @__PURE__ */
|
|
9661
|
+
}, "Dokument")), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Content_default, null, /* @__PURE__ */ React94.createElement("p", null, "Tillh\xF6rande dokument f\xF6r bilen."))), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(Pdf_default, {
|
|
8568
9662
|
documents
|
|
8569
|
-
}))), /* @__PURE__ */
|
|
9663
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Branch_default, {
|
|
8570
9664
|
branch,
|
|
8571
9665
|
loading: loadingCentralStorageVehicle
|
|
8572
|
-
}), ecommerce && ecommerce.enabled && /* @__PURE__ */
|
|
9666
|
+
}), ecommerce && ecommerce.enabled && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(ButtonPrimary, {
|
|
8573
9667
|
disabled: !!ecommerce.reserved,
|
|
8574
9668
|
title: "K\xF6p bilen online",
|
|
8575
9669
|
onClick: () => ecomContext.current?.start()
|
|
8576
|
-
}, "K\xF6p bilen online"))), /* @__PURE__ */
|
|
9670
|
+
}, "K\xF6p bilen online"))), /* @__PURE__ */ React94.createElement(PackageOptions_default, {
|
|
8577
9671
|
packageOptions
|
|
8578
|
-
}), /* @__PURE__ */
|
|
9672
|
+
}), /* @__PURE__ */ React94.createElement(ManufacturerPackagesOption_default, {
|
|
8579
9673
|
packageOption: manufacturer?.packageOption
|
|
8580
|
-
}))))), /* @__PURE__ */
|
|
9674
|
+
}))))), /* @__PURE__ */ React94.createElement(Related_default, {
|
|
8581
9675
|
id,
|
|
8582
9676
|
hashRoute,
|
|
8583
9677
|
pathRoute,
|
|
8584
9678
|
onClickSearchItem
|
|
8585
|
-
})), false, /* @__PURE__ */
|
|
9679
|
+
})), false, /* @__PURE__ */ React94.createElement(portal_element_default, {
|
|
8586
9680
|
id: portal_namespace_exports.DefaultPortal
|
|
8587
9681
|
}));
|
|
8588
9682
|
};
|
|
8589
9683
|
var searchItem_default = WaykeSearchItem;
|
|
8590
9684
|
|
|
8591
9685
|
// src/providers/WaykeProvider.tsx
|
|
8592
|
-
import
|
|
9686
|
+
import React102 from "react";
|
|
8593
9687
|
|
|
8594
9688
|
// src/providers/graphqlProvider.tsx
|
|
8595
|
-
import
|
|
9689
|
+
import React95 from "react";
|
|
8596
9690
|
import { ApolloProvider as ApolloProviderBase, ApolloClient, InMemoryCache } from "@apollo/client";
|
|
8597
9691
|
var GraphqlProvider = ({ uri, children }) => {
|
|
8598
9692
|
const client = new ApolloClient({ uri, cache: new InMemoryCache() });
|
|
8599
|
-
return /* @__PURE__ */
|
|
9693
|
+
return /* @__PURE__ */ React95.createElement(ApolloProviderBase, {
|
|
8600
9694
|
client
|
|
8601
9695
|
}, children);
|
|
8602
9696
|
};
|
|
8603
9697
|
var graphqlProvider_default = GraphqlProvider;
|
|
8604
9698
|
|
|
8605
9699
|
// src/providers/themeProvider.tsx
|
|
8606
|
-
import
|
|
9700
|
+
import React96 from "react";
|
|
8607
9701
|
import { ThemeProvider as ThemeProviderBase } from "styled-components";
|
|
8608
|
-
var ThemeProvider = ({ children }) => /* @__PURE__ */
|
|
9702
|
+
var ThemeProvider = ({ children }) => /* @__PURE__ */ React96.createElement(ThemeProviderBase, {
|
|
8609
9703
|
theme: theme_default
|
|
8610
9704
|
}, children);
|
|
8611
9705
|
var themeProvider_default = ThemeProvider;
|
|
8612
9706
|
|
|
8613
9707
|
// src/State/Search/SearchProvider.tsx
|
|
8614
|
-
import
|
|
8615
|
-
|
|
8616
|
-
// src/hooks/useFetch.ts
|
|
8617
|
-
import { useEffect as useEffect15, useState as useState27, useCallback as useCallback35 } from "react";
|
|
8618
|
-
var cache = {};
|
|
8619
|
-
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
8620
|
-
var setCachedResult = (key, value) => {
|
|
8621
|
-
cache[key] = value;
|
|
8622
|
-
};
|
|
8623
|
-
var pendingPromise = {};
|
|
8624
|
-
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
8625
|
-
var setPendingPromise = (url, promise) => {
|
|
8626
|
-
pendingPromise = {
|
|
8627
|
-
...pendingPromise,
|
|
8628
|
-
[url]: promise
|
|
8629
|
-
};
|
|
8630
|
-
};
|
|
8631
|
-
var clearPendingPromise = (url) => {
|
|
8632
|
-
delete pendingPromise[url];
|
|
8633
|
-
};
|
|
8634
|
-
var useFetch = (path, options, skip, promiseCache) => {
|
|
8635
|
-
const [data, setData] = useState27();
|
|
8636
|
-
const [loading, setLoading] = useState27(false);
|
|
8637
|
-
const [error, setError] = useState27(false);
|
|
8638
|
-
const doFetch = useCallback35(async () => {
|
|
8639
|
-
const key = path.toString();
|
|
8640
|
-
const cached = getCachedResult(key);
|
|
8641
|
-
setError(false);
|
|
8642
|
-
if (cached) {
|
|
8643
|
-
setData(cached);
|
|
8644
|
-
return;
|
|
8645
|
-
}
|
|
8646
|
-
setLoading(true);
|
|
8647
|
-
try {
|
|
8648
|
-
const reusePromise = promiseCache && isPendingPromise(key);
|
|
8649
|
-
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
8650
|
-
if (promiseCache) {
|
|
8651
|
-
setPendingPromise(key, request);
|
|
8652
|
-
}
|
|
8653
|
-
const result = await request;
|
|
8654
|
-
if (result.ok) {
|
|
8655
|
-
const json2 = await result.clone().json();
|
|
8656
|
-
setCachedResult(key, json2);
|
|
8657
|
-
setData(json2);
|
|
8658
|
-
}
|
|
8659
|
-
} catch (e) {
|
|
8660
|
-
setError(true);
|
|
8661
|
-
} finally {
|
|
8662
|
-
setLoading(false);
|
|
8663
|
-
clearPendingPromise(key);
|
|
8664
|
-
}
|
|
8665
|
-
return;
|
|
8666
|
-
}, [path, options]);
|
|
8667
|
-
useEffect15(() => {
|
|
8668
|
-
if (!skip) {
|
|
8669
|
-
doFetch();
|
|
8670
|
-
}
|
|
8671
|
-
}, [path, skip]);
|
|
8672
|
-
return {
|
|
8673
|
-
loading,
|
|
8674
|
-
data,
|
|
8675
|
-
error
|
|
8676
|
-
};
|
|
8677
|
-
};
|
|
8678
|
-
var useFetch_default = useFetch;
|
|
9708
|
+
import React97, { useState as useState33, useEffect as useEffect19, useCallback as useCallback39 } from "react";
|
|
8679
9709
|
|
|
8680
9710
|
// src/utils/url.ts
|
|
8681
9711
|
var getUrlSearchParamsFromUrl = () => new URLSearchParams(window.location.search);
|
|
@@ -8692,12 +9722,12 @@ var SearchProvider = ({
|
|
|
8692
9722
|
children
|
|
8693
9723
|
}) => {
|
|
8694
9724
|
const { replaceState, pushState } = usePath_default();
|
|
8695
|
-
const [queryFilter, setQueryFilter] =
|
|
9725
|
+
const [queryFilter, setQueryFilter] = useState33({
|
|
8696
9726
|
searchParams: initialSearchParams
|
|
8697
9727
|
});
|
|
8698
|
-
const [initialFacets, setInitialFacets] =
|
|
8699
|
-
const [documents, setDocuments] =
|
|
8700
|
-
const [initialize, setInitialize] =
|
|
9728
|
+
const [initialFacets, setInitialFacets] = useState33();
|
|
9729
|
+
const [documents, setDocuments] = useState33();
|
|
9730
|
+
const [initialize, setInitialize] = useState33(false);
|
|
8701
9731
|
const { data: initialDataRepsonse } = useFetch_default(
|
|
8702
9732
|
`${url}?hits=0`,
|
|
8703
9733
|
{
|
|
@@ -8733,7 +9763,7 @@ var SearchProvider = ({
|
|
|
8733
9763
|
});
|
|
8734
9764
|
}
|
|
8735
9765
|
};
|
|
8736
|
-
|
|
9766
|
+
useEffect19(() => {
|
|
8737
9767
|
if (useQueryParamsFromUrl) {
|
|
8738
9768
|
window.addEventListener("popstate", popStateEvent);
|
|
8739
9769
|
}
|
|
@@ -8747,12 +9777,12 @@ var SearchProvider = ({
|
|
|
8747
9777
|
pubsub_default.unsubscribeAction(onFilterUpdateEvent);
|
|
8748
9778
|
};
|
|
8749
9779
|
}, []);
|
|
8750
|
-
|
|
9780
|
+
useEffect19(() => {
|
|
8751
9781
|
if (initialDataRepsonse) {
|
|
8752
9782
|
setInitialFacets(initialDataRepsonse.facets);
|
|
8753
9783
|
}
|
|
8754
9784
|
}, [initialDataRepsonse]);
|
|
8755
|
-
|
|
9785
|
+
useEffect19(() => {
|
|
8756
9786
|
if (useQueryParamsFromUrl) {
|
|
8757
9787
|
const nextSearchParams = new URLSearchParams(queryFilter.searchParams);
|
|
8758
9788
|
nextSearchParams.delete("hits");
|
|
@@ -8775,7 +9805,7 @@ var SearchProvider = ({
|
|
|
8775
9805
|
}
|
|
8776
9806
|
}
|
|
8777
9807
|
}, [queryFilter, initialize, useQueryParamsFromUrl]);
|
|
8778
|
-
|
|
9808
|
+
useEffect19(() => {
|
|
8779
9809
|
if (response) {
|
|
8780
9810
|
if (!initialFacets && !useQueryParamsFromUrl) {
|
|
8781
9811
|
setInitialFacets(response.facets);
|
|
@@ -8800,7 +9830,7 @@ var SearchProvider = ({
|
|
|
8800
9830
|
}
|
|
8801
9831
|
}
|
|
8802
9832
|
}, [response, useQueryParamsFromUrl]);
|
|
8803
|
-
const onFilterUpdate =
|
|
9833
|
+
const onFilterUpdate = useCallback39(
|
|
8804
9834
|
(nextQuery) => {
|
|
8805
9835
|
{
|
|
8806
9836
|
if (!initialize) {
|
|
@@ -8813,7 +9843,7 @@ var SearchProvider = ({
|
|
|
8813
9843
|
},
|
|
8814
9844
|
[initialize]
|
|
8815
9845
|
);
|
|
8816
|
-
const onLoadMore =
|
|
9846
|
+
const onLoadMore = useCallback39(() => {
|
|
8817
9847
|
if (response) {
|
|
8818
9848
|
setQueryFilter({
|
|
8819
9849
|
searchParams: new URLSearchParams(response?.documentList.pagination.nextPage?.query),
|
|
@@ -8821,7 +9851,7 @@ var SearchProvider = ({
|
|
|
8821
9851
|
});
|
|
8822
9852
|
}
|
|
8823
9853
|
}, [response]);
|
|
8824
|
-
const onInitialize =
|
|
9854
|
+
const onInitialize = useCallback39(
|
|
8825
9855
|
(_initialQueryParams) => {
|
|
8826
9856
|
if (!initialize) {
|
|
8827
9857
|
const searchParamsFromUrl = getUrlSearchParamsFromUrl();
|
|
@@ -8865,15 +9895,15 @@ var SearchProvider = ({
|
|
|
8865
9895
|
onLoadMore,
|
|
8866
9896
|
onInitialize
|
|
8867
9897
|
};
|
|
8868
|
-
return /* @__PURE__ */
|
|
9898
|
+
return /* @__PURE__ */ React97.createElement(SearchContext.Provider, {
|
|
8869
9899
|
value
|
|
8870
9900
|
}, children);
|
|
8871
9901
|
};
|
|
8872
9902
|
var SearchProvider_default = SearchProvider;
|
|
8873
9903
|
|
|
8874
9904
|
// src/components/Root/index.tsx
|
|
8875
|
-
import
|
|
8876
|
-
var Root =
|
|
9905
|
+
import styled61 from "styled-components";
|
|
9906
|
+
var Root = styled61.div.attrs(() => ({
|
|
8877
9907
|
className: "wayke__theme wayke__font--regular"
|
|
8878
9908
|
}))`
|
|
8879
9909
|
background-color: ${(props) => props.theme.color.bg};
|
|
@@ -8915,21 +9945,21 @@ var useEcom = (ecomSettings) => {
|
|
|
8915
9945
|
var useEcom_default = useEcom;
|
|
8916
9946
|
|
|
8917
9947
|
// src/State/Settings/SettingsProvider.tsx
|
|
8918
|
-
import
|
|
9948
|
+
import React98 from "react";
|
|
8919
9949
|
var SettingsProvider = ({
|
|
8920
9950
|
googleMapsApiKey,
|
|
8921
9951
|
googleMapsMarker,
|
|
8922
9952
|
ecomSettings,
|
|
8923
9953
|
children
|
|
8924
|
-
}) => /* @__PURE__ */
|
|
9954
|
+
}) => /* @__PURE__ */ React98.createElement(SettingsContext.Provider, {
|
|
8925
9955
|
value: { ecomSettings, googleMapsApiKey, googleMapsMarker }
|
|
8926
9956
|
}, children);
|
|
8927
9957
|
var SettingsProvider_default = SettingsProvider;
|
|
8928
9958
|
|
|
8929
9959
|
// src/State/RelatedSearch/RelatedSearchProvider.tsx
|
|
8930
|
-
import
|
|
9960
|
+
import React99, { useState as useState34, useCallback as useCallback40 } from "react";
|
|
8931
9961
|
var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
8932
|
-
const [queryFilter, setQueryFilter] =
|
|
9962
|
+
const [queryFilter, setQueryFilter] = useState34();
|
|
8933
9963
|
const query = queryFilter?.searchParams.toString();
|
|
8934
9964
|
const {
|
|
8935
9965
|
loading,
|
|
@@ -8944,7 +9974,7 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
8944
9974
|
},
|
|
8945
9975
|
!queryFilter
|
|
8946
9976
|
);
|
|
8947
|
-
const fetchRelated =
|
|
9977
|
+
const fetchRelated = useCallback40(
|
|
8948
9978
|
(searchParams) => setQueryFilter({
|
|
8949
9979
|
searchParams
|
|
8950
9980
|
}),
|
|
@@ -8958,31 +9988,31 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
8958
9988
|
queryFilter,
|
|
8959
9989
|
fetchRelated
|
|
8960
9990
|
};
|
|
8961
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ React99.createElement(RelatedSearchContext.Provider, {
|
|
8962
9992
|
value
|
|
8963
9993
|
}, children);
|
|
8964
9994
|
};
|
|
8965
9995
|
var RelatedSearchProvider_default = RelatedSearchProvider;
|
|
8966
9996
|
|
|
8967
9997
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
8968
|
-
import
|
|
9998
|
+
import React100, { useCallback as useCallback42 } from "react";
|
|
8969
9999
|
|
|
8970
10000
|
// src/hooks/useSessionStorage.ts
|
|
8971
|
-
import { useState as
|
|
10001
|
+
import { useState as useState35, useCallback as useCallback41 } from "react";
|
|
8972
10002
|
var useSessionStorage = (key) => {
|
|
8973
|
-
const [value, setValue] =
|
|
8974
|
-
const set =
|
|
10003
|
+
const [value, setValue] = useState35(sessionStorage.getItem(key));
|
|
10004
|
+
const set = useCallback41(
|
|
8975
10005
|
(v) => {
|
|
8976
10006
|
sessionStorage.setItem(key, v);
|
|
8977
10007
|
setValue(v);
|
|
8978
10008
|
},
|
|
8979
10009
|
[key]
|
|
8980
10010
|
);
|
|
8981
|
-
const remove =
|
|
10011
|
+
const remove = useCallback41(() => {
|
|
8982
10012
|
sessionStorage.removeItem(key);
|
|
8983
10013
|
setValue(null);
|
|
8984
10014
|
}, [key]);
|
|
8985
|
-
const clear =
|
|
10015
|
+
const clear = useCallback41(() => {
|
|
8986
10016
|
sessionStorage.clear();
|
|
8987
10017
|
setValue(null);
|
|
8988
10018
|
}, [key]);
|
|
@@ -8998,21 +10028,21 @@ var useSessionStorage_default = useSessionStorage;
|
|
|
8998
10028
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
8999
10029
|
var CentralStorageProvider = ({ children }) => {
|
|
9000
10030
|
const { value, set, remove } = useSessionStorage_default("centralStorage");
|
|
9001
|
-
const setCentralStorageId =
|
|
9002
|
-
return /* @__PURE__ */
|
|
10031
|
+
const setCentralStorageId = useCallback42((id) => id ? set(id) : remove(), []);
|
|
10032
|
+
return /* @__PURE__ */ React100.createElement(CentralStorageContext.Provider, {
|
|
9003
10033
|
value: { centralStorageId: value, setCentralStorageId }
|
|
9004
10034
|
}, children);
|
|
9005
10035
|
};
|
|
9006
10036
|
var CentralStorageProvider_default = CentralStorageProvider;
|
|
9007
10037
|
|
|
9008
10038
|
// src/State/Path/PathProvider.tsx
|
|
9009
|
-
import
|
|
10039
|
+
import React101, { useCallback as useCallback43, useEffect as useEffect21, useMemo as useMemo7, useReducer } from "react";
|
|
9010
10040
|
|
|
9011
10041
|
// src/hooks/usePrevious.ts
|
|
9012
|
-
import { useRef as
|
|
10042
|
+
import { useRef as useRef5, useEffect as useEffect20 } from "react";
|
|
9013
10043
|
var usePrevious = (value) => {
|
|
9014
|
-
const ref =
|
|
9015
|
-
|
|
10044
|
+
const ref = useRef5();
|
|
10045
|
+
useEffect20(() => {
|
|
9016
10046
|
ref.current = value;
|
|
9017
10047
|
});
|
|
9018
10048
|
return ref.current;
|
|
@@ -9042,7 +10072,7 @@ var POP_STATE = "popstate";
|
|
|
9042
10072
|
var PathProvider = ({ children }) => {
|
|
9043
10073
|
const [state, dispatch] = useReducer(reducer_default, initialState);
|
|
9044
10074
|
const previousPath = usePrevious_default(state.path);
|
|
9045
|
-
|
|
10075
|
+
useEffect21(() => {
|
|
9046
10076
|
const onPopState = () => {
|
|
9047
10077
|
dispatch({ type: SET_PATH, path: window.location.pathname });
|
|
9048
10078
|
};
|
|
@@ -9051,7 +10081,7 @@ var PathProvider = ({ children }) => {
|
|
|
9051
10081
|
window.removeEventListener(POP_STATE, onPopState);
|
|
9052
10082
|
};
|
|
9053
10083
|
}, []);
|
|
9054
|
-
const pushState =
|
|
10084
|
+
const pushState = useCallback43((path) => {
|
|
9055
10085
|
const h1 = window.location.hash;
|
|
9056
10086
|
history.pushState(null, "", `${path}`);
|
|
9057
10087
|
const h2 = window.location.hash;
|
|
@@ -9060,7 +10090,7 @@ var PathProvider = ({ children }) => {
|
|
|
9060
10090
|
}
|
|
9061
10091
|
dispatch({ type: SET_PATH, path });
|
|
9062
10092
|
}, []);
|
|
9063
|
-
const replaceState =
|
|
10093
|
+
const replaceState = useCallback43((path) => {
|
|
9064
10094
|
const h1 = window.location.hash;
|
|
9065
10095
|
history.replaceState(null, "", path);
|
|
9066
10096
|
const h2 = window.location.hash;
|
|
@@ -9080,7 +10110,7 @@ var PathProvider = ({ children }) => {
|
|
|
9080
10110
|
}),
|
|
9081
10111
|
[state]
|
|
9082
10112
|
);
|
|
9083
|
-
return /* @__PURE__ */
|
|
10113
|
+
return /* @__PURE__ */ React101.createElement(PathContext.Provider, {
|
|
9084
10114
|
value
|
|
9085
10115
|
}, children);
|
|
9086
10116
|
};
|
|
@@ -9100,33 +10130,33 @@ var WaykeProvider = ({
|
|
|
9100
10130
|
children
|
|
9101
10131
|
}) => {
|
|
9102
10132
|
useEcom_default(ecomSettings);
|
|
9103
|
-
return /* @__PURE__ */
|
|
10133
|
+
return /* @__PURE__ */ React102.createElement(PathProvider_default, null, /* @__PURE__ */ React102.createElement(SettingsProvider_default, {
|
|
9104
10134
|
googleMapsApiKey,
|
|
9105
10135
|
googleMapsMarker,
|
|
9106
10136
|
ecomSettings
|
|
9107
|
-
}, /* @__PURE__ */
|
|
10137
|
+
}, /* @__PURE__ */ React102.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React102.createElement(graphqlProvider_default, {
|
|
9108
10138
|
uri: graphQlUrl
|
|
9109
|
-
}, /* @__PURE__ */
|
|
10139
|
+
}, /* @__PURE__ */ React102.createElement(SearchProvider_default, {
|
|
9110
10140
|
url,
|
|
9111
10141
|
apiKey,
|
|
9112
10142
|
useQueryParamsFromUrl,
|
|
9113
10143
|
pathRoute
|
|
9114
|
-
}, /* @__PURE__ */
|
|
10144
|
+
}, /* @__PURE__ */ React102.createElement(RelatedSearchProvider_default, {
|
|
9115
10145
|
url,
|
|
9116
10146
|
urlMlt,
|
|
9117
10147
|
apiKey
|
|
9118
|
-
}, /* @__PURE__ */
|
|
10148
|
+
}, /* @__PURE__ */ React102.createElement(themeProvider_default, null, /* @__PURE__ */ React102.createElement(Root_default, null, children))))))));
|
|
9119
10149
|
};
|
|
9120
10150
|
var WaykeProvider_default = WaykeProvider;
|
|
9121
10151
|
|
|
9122
10152
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
9123
|
-
import
|
|
10153
|
+
import React104 from "react";
|
|
9124
10154
|
|
|
9125
10155
|
// src/layouts/WaykeComposite.tsx
|
|
9126
|
-
import
|
|
10156
|
+
import React103, { useEffect as useEffect23 } from "react";
|
|
9127
10157
|
|
|
9128
10158
|
// src/hooks/useHashGuid.ts
|
|
9129
|
-
import { useState as
|
|
10159
|
+
import { useState as useState36, useEffect as useEffect22 } from "react";
|
|
9130
10160
|
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;
|
|
9131
10161
|
var HASH_CHANGE = "hashchange";
|
|
9132
10162
|
var getGuid = () => {
|
|
@@ -9134,7 +10164,7 @@ var getGuid = () => {
|
|
|
9134
10164
|
return regexGuid.test(guid) || !guid ? guid : void 0;
|
|
9135
10165
|
};
|
|
9136
10166
|
var useHashGuid = () => {
|
|
9137
|
-
const [id, setId] =
|
|
10167
|
+
const [id, setId] = useState36(() => getGuid());
|
|
9138
10168
|
const onHashChange = () => {
|
|
9139
10169
|
const guid = window.location.hash.substr(1, window.location.hash.length);
|
|
9140
10170
|
if (regexGuid.test(guid) || !guid) {
|
|
@@ -9143,7 +10173,7 @@ var useHashGuid = () => {
|
|
|
9143
10173
|
throw "Invalid Guid";
|
|
9144
10174
|
}
|
|
9145
10175
|
};
|
|
9146
|
-
|
|
10176
|
+
useEffect22(() => {
|
|
9147
10177
|
onHashChange();
|
|
9148
10178
|
window.addEventListener(HASH_CHANGE, onHashChange);
|
|
9149
10179
|
return () => {
|
|
@@ -9168,7 +10198,7 @@ var WaykeComposite = ({
|
|
|
9168
10198
|
}) => {
|
|
9169
10199
|
const hashId = useHashGuid_default();
|
|
9170
10200
|
const { id: pathId } = usePath_default();
|
|
9171
|
-
|
|
10201
|
+
useEffect23(() => {
|
|
9172
10202
|
if (!pathRoute) {
|
|
9173
10203
|
if (hashId) {
|
|
9174
10204
|
pubsub_default.publish("HashRouteChange", hashId);
|
|
@@ -9178,14 +10208,14 @@ var WaykeComposite = ({
|
|
|
9178
10208
|
}
|
|
9179
10209
|
}, [hashId]);
|
|
9180
10210
|
const id = pathId || hashId;
|
|
9181
|
-
return /* @__PURE__ */
|
|
10211
|
+
return /* @__PURE__ */ React103.createElement(React103.Fragment, null, id ? /* @__PURE__ */ React103.createElement(searchItem_default, {
|
|
9182
10212
|
id,
|
|
9183
10213
|
hashRoute: !pathRoute,
|
|
9184
10214
|
disableResetScrollOnInit,
|
|
9185
10215
|
placeholderImage,
|
|
9186
10216
|
pathRoute,
|
|
9187
10217
|
modifyDocumentTitleItem
|
|
9188
|
-
}) : /* @__PURE__ */
|
|
10218
|
+
}) : /* @__PURE__ */ React103.createElement(search_default, {
|
|
9189
10219
|
filterList,
|
|
9190
10220
|
initialQueryParams,
|
|
9191
10221
|
removeSearchBar,
|
|
@@ -9199,15 +10229,15 @@ var WaykeComposite = ({
|
|
|
9199
10229
|
var WaykeComposite_default = WaykeComposite;
|
|
9200
10230
|
|
|
9201
10231
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
9202
|
-
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */
|
|
10232
|
+
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */ React104.createElement(WaykeProvider_default, {
|
|
9203
10233
|
...provider
|
|
9204
|
-
}, /* @__PURE__ */
|
|
10234
|
+
}, /* @__PURE__ */ React104.createElement(WaykeComposite_default, {
|
|
9205
10235
|
...composite
|
|
9206
10236
|
}));
|
|
9207
10237
|
var WaykeCompositeWithProvider_default = WaykeCompositeWithProvider;
|
|
9208
10238
|
|
|
9209
10239
|
// src/providers/WaykeItemProvidet.tsx
|
|
9210
|
-
import
|
|
10240
|
+
import React105 from "react";
|
|
9211
10241
|
var WaykeItemProvider = ({
|
|
9212
10242
|
url,
|
|
9213
10243
|
urlMlt,
|
|
@@ -9219,17 +10249,17 @@ var WaykeItemProvider = ({
|
|
|
9219
10249
|
children
|
|
9220
10250
|
}) => {
|
|
9221
10251
|
useEcom_default(ecomSettings);
|
|
9222
|
-
return /* @__PURE__ */
|
|
10252
|
+
return /* @__PURE__ */ React105.createElement(PathProvider_default, null, /* @__PURE__ */ React105.createElement(SettingsProvider_default, {
|
|
9223
10253
|
googleMapsApiKey,
|
|
9224
10254
|
googleMapsMarker,
|
|
9225
10255
|
ecomSettings
|
|
9226
|
-
}, /* @__PURE__ */
|
|
10256
|
+
}, /* @__PURE__ */ React105.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React105.createElement(graphqlProvider_default, {
|
|
9227
10257
|
uri: graphQlUrl
|
|
9228
|
-
}, /* @__PURE__ */
|
|
10258
|
+
}, /* @__PURE__ */ React105.createElement(RelatedSearchProvider_default, {
|
|
9229
10259
|
url,
|
|
9230
10260
|
urlMlt,
|
|
9231
10261
|
apiKey
|
|
9232
|
-
}, /* @__PURE__ */
|
|
10262
|
+
}, /* @__PURE__ */ React105.createElement(themeProvider_default, null, /* @__PURE__ */ React105.createElement(Root_default, null, children)))))));
|
|
9233
10263
|
};
|
|
9234
10264
|
var WaykeItemProvidet_default = WaykeItemProvider;
|
|
9235
10265
|
|