@wayke-se/components-react 3.0.0-beta.4 → 3.0.0-beta.5
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 +636 -970
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +544 -878
- package/dist/index.mjs.map +4 -4
- package/esbuild/lib.js +1 -0
- package/package.json +2 -3
- package/src/components/Gallery/index.tsx +24 -31
- package/src/components/Lightbox/index.tsx +11 -11
package/dist/index.mjs
CHANGED
|
@@ -4522,7 +4522,7 @@ var WaykeSearch = ({
|
|
|
4522
4522
|
var search_default = WaykeSearch;
|
|
4523
4523
|
|
|
4524
4524
|
// src/layouts/searchItem/index.tsx
|
|
4525
|
-
import
|
|
4525
|
+
import React94, { useMemo as useMemo6, useRef as useRef4, useCallback as useCallback38, useEffect as useEffect18 } from "react";
|
|
4526
4526
|
import WaykeEcomWeb from "@wayke-se/ecom-web";
|
|
4527
4527
|
|
|
4528
4528
|
// src/components/PriceTable/index.tsx
|
|
@@ -4801,7 +4801,7 @@ var ExtendContent = ({ children, actionTitle, onClick }) => {
|
|
|
4801
4801
|
var ExtendContent_default = ExtendContent;
|
|
4802
4802
|
|
|
4803
4803
|
// src/components/Gallery/index.tsx
|
|
4804
|
-
import
|
|
4804
|
+
import React50, { useState as useState15, useCallback as useCallback18, useRef as useRef3, useMemo as useMemo3 } from "react";
|
|
4805
4805
|
import Slider3 from "react-slick";
|
|
4806
4806
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
4807
4807
|
|
|
@@ -5163,7 +5163,7 @@ var EnableNavigationButton = styled33.div`
|
|
|
5163
5163
|
`;
|
|
5164
5164
|
|
|
5165
5165
|
// src/components/Lightbox/index.tsx
|
|
5166
|
-
import
|
|
5166
|
+
import React45 from "react";
|
|
5167
5167
|
|
|
5168
5168
|
// src/components/Lightbox/wrapper.tsx
|
|
5169
5169
|
import styled34 from "styled-components";
|
|
@@ -5386,315 +5386,19 @@ var VideoPlayer = ({ url, autoplay = false, controls = true }) => {
|
|
|
5386
5386
|
};
|
|
5387
5387
|
var EmbeddedVideoLightbox_default = VideoPlayer;
|
|
5388
5388
|
|
|
5389
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5390
|
-
import React43 from "react";
|
|
5391
|
-
|
|
5392
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5393
|
-
import React42, { lazy, useState as useState9, useEffect as useEffect7 } from "react";
|
|
5394
|
-
|
|
5395
|
-
// src/components/Sphere/wrapper.tsx
|
|
5396
|
-
import styled37 from "styled-components";
|
|
5397
|
-
var compassSize = size(4);
|
|
5398
|
-
var controlBtnSize = size(4);
|
|
5399
|
-
var Wrapper20 = styled37.div`
|
|
5400
|
-
position: relative;
|
|
5401
|
-
width: 100%;
|
|
5402
|
-
height: 0 !important;
|
|
5403
|
-
padding-bottom: 66.666% !important; // 3:2
|
|
5404
|
-
|
|
5405
|
-
.pnlm-container {
|
|
5406
|
-
position: absolute;
|
|
5407
|
-
height: 100% !important;
|
|
5408
|
-
background-image: none;
|
|
5409
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5410
|
-
}
|
|
5411
|
-
|
|
5412
|
-
// Compass
|
|
5413
|
-
|
|
5414
|
-
.pnlm-compass {
|
|
5415
|
-
width: ${compassSize};
|
|
5416
|
-
height: ${compassSize};
|
|
5417
|
-
border-radius: 50%;
|
|
5418
|
-
bottom: ${size(2)};
|
|
5419
|
-
left: ${size(2)};
|
|
5420
|
-
right: auto;
|
|
5421
|
-
margin-top: 0;
|
|
5422
|
-
border: 5px solid transparent;
|
|
5423
|
-
border-top-color: ${(props) => props.theme.color.textLight};
|
|
5424
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5425
|
-
background-image: none;
|
|
5426
|
-
backdrop-filter: blur(5px);
|
|
5427
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5428
|
-
box-sizing: border-box;
|
|
5429
|
-
|
|
5430
|
-
&:hover {
|
|
5431
|
-
background-color: red;
|
|
5432
|
-
}
|
|
5433
|
-
}
|
|
5434
|
-
|
|
5435
|
-
// Controls (zoom & fullscreen button)
|
|
5436
|
-
|
|
5437
|
-
.pnlm-grab,
|
|
5438
|
-
.pnlm-grabbing {
|
|
5439
|
-
.pnlm-controls-container {
|
|
5440
|
-
display: block;
|
|
5441
|
-
}
|
|
5442
|
-
}
|
|
5443
|
-
|
|
5444
|
-
.pnlm-controls-container {
|
|
5445
|
-
display: none;
|
|
5446
|
-
top: ${size(2)};
|
|
5447
|
-
left: ${size(2)};
|
|
5448
|
-
}
|
|
5449
|
-
|
|
5450
|
-
.pnlm-controls {
|
|
5451
|
-
margin-top: 0;
|
|
5452
|
-
|
|
5453
|
-
& + .pnlm-controls {
|
|
5454
|
-
margin-top: ${size(1)};
|
|
5455
|
-
}
|
|
5456
|
-
}
|
|
5457
|
-
|
|
5458
|
-
// Fullscreen button
|
|
5459
|
-
|
|
5460
|
-
.pnlm-fullscreen-toggle-button {
|
|
5461
|
-
display: none;
|
|
5462
|
-
position: relative;
|
|
5463
|
-
width: ${controlBtnSize};
|
|
5464
|
-
height: ${controlBtnSize};
|
|
5465
|
-
background-image: none;
|
|
5466
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5467
|
-
backdrop-filter: blur(5px);
|
|
5468
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5469
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5470
|
-
border: 0;
|
|
5471
|
-
border-radius: 50%;
|
|
5472
|
-
|
|
5473
|
-
&:hover {
|
|
5474
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5475
|
-
}
|
|
5476
|
-
|
|
5477
|
-
&:before {
|
|
5478
|
-
position: absolute;
|
|
5479
|
-
top: 50%;
|
|
5480
|
-
left: 50%;
|
|
5481
|
-
transform: translate(-50%, -50%);
|
|
5482
|
-
font-size: 0.875rem;
|
|
5483
|
-
}
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
.pnlm-fullscreen-toggle-button-inactive {
|
|
5487
|
-
&:before {
|
|
5488
|
-
content: '⤢';
|
|
5489
|
-
}
|
|
5490
|
-
|
|
5491
|
-
&.pnlm-fullscreen-toggle-button-active {
|
|
5492
|
-
&:before {
|
|
5493
|
-
content: '⤢';
|
|
5494
|
-
}
|
|
5495
|
-
}
|
|
5496
|
-
}
|
|
5497
|
-
|
|
5498
|
-
// Gyroscope (Orientation)
|
|
5499
|
-
|
|
5500
|
-
.pnlm-orientation-button {
|
|
5501
|
-
background-image: none;
|
|
5502
|
-
width: ${controlBtnSize};
|
|
5503
|
-
height: ${controlBtnSize};
|
|
5504
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5505
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5506
|
-
border: 0;
|
|
5507
|
-
border-radius: 999px;
|
|
5508
|
-
|
|
5509
|
-
&:hover {
|
|
5510
|
-
background-color: red;
|
|
5511
|
-
}
|
|
5512
|
-
|
|
5513
|
-
&:before {
|
|
5514
|
-
content: 'A';
|
|
5515
|
-
position: absolute;
|
|
5516
|
-
top: 50%;
|
|
5517
|
-
left: 50%;
|
|
5518
|
-
transform: translate(-50%, -50%);
|
|
5519
|
-
font-size: 0.875rem;
|
|
5520
|
-
}
|
|
5521
|
-
|
|
5522
|
-
&.pnlm-orientation-button-active {
|
|
5523
|
-
background-color: green;
|
|
5524
|
-
|
|
5525
|
-
&:hover {
|
|
5526
|
-
background-color: pink;
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
}
|
|
5530
|
-
|
|
5531
|
-
// Zoom controls
|
|
5532
|
-
|
|
5533
|
-
.pnlm-zoom-controls {
|
|
5534
|
-
display: none;
|
|
5535
|
-
height: auto;
|
|
5536
|
-
width: auto;
|
|
5537
|
-
background-color: transparent;
|
|
5538
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5539
|
-
border: 0;
|
|
5540
|
-
border-radius: 999px;
|
|
5541
|
-
|
|
5542
|
-
> * {
|
|
5543
|
-
&:first-child {
|
|
5544
|
-
border-top-left-radius: 999px;
|
|
5545
|
-
border-top-right-radius: 999px;
|
|
5546
|
-
}
|
|
5547
|
-
|
|
5548
|
-
&:last-child {
|
|
5549
|
-
border-bottom-left-radius: 999px;
|
|
5550
|
-
border-bottom-right-radius: 999px;
|
|
5551
|
-
}
|
|
5552
|
-
}
|
|
5553
|
-
}
|
|
5554
|
-
|
|
5555
|
-
.pnlm-zoom-in,
|
|
5556
|
-
.pnlm-zoom-out {
|
|
5557
|
-
position: relative;
|
|
5558
|
-
display: block;
|
|
5559
|
-
width: ${controlBtnSize};
|
|
5560
|
-
height: ${controlBtnSize};
|
|
5561
|
-
background-image: none;
|
|
5562
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5563
|
-
backdrop-filter: blur(5px);
|
|
5564
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5565
|
-
border-radius: 0;
|
|
5566
|
-
|
|
5567
|
-
&:before {
|
|
5568
|
-
position: absolute;
|
|
5569
|
-
top: 50%;
|
|
5570
|
-
left: 50%;
|
|
5571
|
-
transform: translate(-50%, -50%);
|
|
5572
|
-
}
|
|
5573
|
-
|
|
5574
|
-
&:hover {
|
|
5575
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5576
|
-
}
|
|
5577
|
-
}
|
|
5578
|
-
|
|
5579
|
-
.pnlm-zoom-in {
|
|
5580
|
-
top: auto;
|
|
5581
|
-
|
|
5582
|
-
&:before {
|
|
5583
|
-
content: '+';
|
|
5584
|
-
}
|
|
5585
|
-
}
|
|
5586
|
-
|
|
5587
|
-
.pnlm-zoom-out {
|
|
5588
|
-
bottom: auto;
|
|
5589
|
-
border-top: 1px solid ${(props) => props.theme.color.textDark};
|
|
5590
|
-
|
|
5591
|
-
&:before {
|
|
5592
|
-
content: '-';
|
|
5593
|
-
}
|
|
5594
|
-
}
|
|
5595
|
-
|
|
5596
|
-
// Load Button
|
|
5597
|
-
|
|
5598
|
-
.pnlm-load-button {
|
|
5599
|
-
top: auto;
|
|
5600
|
-
bottom: ${size(2)};
|
|
5601
|
-
transform: translateX(-50%);
|
|
5602
|
-
width: auto;
|
|
5603
|
-
height: auto;
|
|
5604
|
-
padding: ${size(1.75)} ${size(2)};
|
|
5605
|
-
border-radius: 3px;
|
|
5606
|
-
margin: 0;
|
|
5607
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5608
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5609
|
-
line-height: 1.1;
|
|
5610
|
-
user-select: none;
|
|
5611
|
-
|
|
5612
|
-
&:hover {
|
|
5613
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5614
|
-
}
|
|
5615
|
-
|
|
5616
|
-
p {
|
|
5617
|
-
margin: 0;
|
|
5618
|
-
font-size: 0.875rem;
|
|
5619
|
-
}
|
|
5620
|
-
}
|
|
5621
|
-
|
|
5622
|
-
// Load box
|
|
5623
|
-
|
|
5624
|
-
.pnlm-load-box {
|
|
5625
|
-
background-color: transparent;
|
|
5626
|
-
height: auto;
|
|
5627
|
-
margin: 0;
|
|
5628
|
-
width: 150px;
|
|
5629
|
-
transform: translate(-50%, -50%);
|
|
5630
|
-
|
|
5631
|
-
> p {
|
|
5632
|
-
display: none;
|
|
5633
|
-
}
|
|
5634
|
-
}
|
|
5635
|
-
|
|
5636
|
-
// Load bar
|
|
5637
|
-
|
|
5638
|
-
.pnlm-lbar {
|
|
5639
|
-
width: 100%;
|
|
5640
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5641
|
-
border: 0;
|
|
5642
|
-
}
|
|
5643
|
-
|
|
5644
|
-
.pnlm-lbar-fill {
|
|
5645
|
-
background-color: ${(props) => props.theme.color.textLight};
|
|
5646
|
-
}
|
|
5647
|
-
`;
|
|
5648
|
-
|
|
5649
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5650
|
-
var ReactPannellum = lazy(() => import("pannellum-react/es/elements/Pannellum"));
|
|
5651
|
-
var SphereViewer = ({ id, src, preview, autoLoad, onStart }) => {
|
|
5652
|
-
const [number] = useState9(Math.floor(1e8 + Math.random() * 9e8));
|
|
5653
|
-
useEffect7(() => {
|
|
5654
|
-
setTimeout(() => {
|
|
5655
|
-
if (onStart) {
|
|
5656
|
-
const startBtn = document.querySelector(".pnlm-load-button");
|
|
5657
|
-
if (startBtn)
|
|
5658
|
-
startBtn.addEventListener("click", onStart);
|
|
5659
|
-
}
|
|
5660
|
-
}, 100);
|
|
5661
|
-
}, []);
|
|
5662
|
-
return /* @__PURE__ */ React42.createElement(Wrapper20, null, /* @__PURE__ */ React42.createElement(React42.Suspense, {
|
|
5663
|
-
fallback: /* @__PURE__ */ React42.createElement(Loader_default, null)
|
|
5664
|
-
}, /* @__PURE__ */ React42.createElement(ReactPannellum, {
|
|
5665
|
-
id: `a-${id}-${number}`,
|
|
5666
|
-
image: src,
|
|
5667
|
-
hfov: 120,
|
|
5668
|
-
autoLoad,
|
|
5669
|
-
compass: true,
|
|
5670
|
-
width: "100%",
|
|
5671
|
-
preview
|
|
5672
|
-
})));
|
|
5673
|
-
};
|
|
5674
|
-
var SphereViewer_default = SphereViewer;
|
|
5675
|
-
|
|
5676
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5677
|
-
var SphereLightbox = ({ url }) => /* @__PURE__ */ React43.createElement(SphereViewer_default, {
|
|
5678
|
-
id: url,
|
|
5679
|
-
src: url,
|
|
5680
|
-
preview: url,
|
|
5681
|
-
autoLoad: true
|
|
5682
|
-
});
|
|
5683
|
-
var SphereLightbox_default = SphereLightbox;
|
|
5684
|
-
|
|
5685
5389
|
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5686
|
-
import
|
|
5390
|
+
import React44, { useState as useState10, useCallback as useCallback14 } from "react";
|
|
5687
5391
|
|
|
5688
5392
|
// src/components/Gallery/MediaButton.tsx
|
|
5689
|
-
import
|
|
5690
|
-
var MediaButton = ({ text, onClick }) => /* @__PURE__ */
|
|
5393
|
+
import React42 from "react";
|
|
5394
|
+
var MediaButton = ({ text, onClick }) => /* @__PURE__ */ React42.createElement(MediaButtonWrapper, null, /* @__PURE__ */ React42.createElement(ButtonSecondary, {
|
|
5691
5395
|
onClick,
|
|
5692
5396
|
title: text
|
|
5693
|
-
}, /* @__PURE__ */
|
|
5397
|
+
}, /* @__PURE__ */ React42.createElement(ButtonContent, null, text)));
|
|
5694
5398
|
var MediaButton_default = MediaButton;
|
|
5695
5399
|
|
|
5696
5400
|
// src/components/ThreeSixty/Rotation.tsx
|
|
5697
|
-
import
|
|
5401
|
+
import React43, { useState as useState9, useEffect as useEffect7, useRef as useRef2, cloneElement, Children } from "react";
|
|
5698
5402
|
var calculateCurrentFrame = (startFrame, delta, length) => {
|
|
5699
5403
|
const frame = (startFrame + delta) % length;
|
|
5700
5404
|
if (frame < 0) {
|
|
@@ -5706,11 +5410,11 @@ var Rotation = ({ children }) => {
|
|
|
5706
5410
|
const startFrame = useRef2(0);
|
|
5707
5411
|
const pointerPosition = useRef2();
|
|
5708
5412
|
const max = useRef2(0);
|
|
5709
|
-
const [state, setState] =
|
|
5413
|
+
const [state, setState] = useState9({
|
|
5710
5414
|
current: 0,
|
|
5711
5415
|
outsideMouseMove: false
|
|
5712
5416
|
});
|
|
5713
|
-
|
|
5417
|
+
useEffect7(() => {
|
|
5714
5418
|
document.addEventListener("mouseup", touchEnd);
|
|
5715
5419
|
return () => {
|
|
5716
5420
|
window.document.removeEventListener("mouseup", touchEnd);
|
|
@@ -5781,7 +5485,7 @@ var Rotation = ({ children }) => {
|
|
|
5781
5485
|
const { offsetLeft } = event.currentTarget;
|
|
5782
5486
|
return clientX - offsetLeft;
|
|
5783
5487
|
};
|
|
5784
|
-
return /* @__PURE__ */
|
|
5488
|
+
return /* @__PURE__ */ React43.createElement("div", {
|
|
5785
5489
|
onTouchStart: touchStart,
|
|
5786
5490
|
onTouchMove: touchMove,
|
|
5787
5491
|
onTouchEnd: touchEnd,
|
|
@@ -5803,18 +5507,18 @@ var Rotation_default = Rotation;
|
|
|
5803
5507
|
|
|
5804
5508
|
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5805
5509
|
var ThreeSixtyLightbox = ({ urls }) => {
|
|
5806
|
-
const [started2, setStarted] =
|
|
5510
|
+
const [started2, setStarted] = useState10(false);
|
|
5807
5511
|
const onStart = useCallback14(() => setStarted(true), []);
|
|
5808
5512
|
if (!started2) {
|
|
5809
|
-
return /* @__PURE__ */
|
|
5513
|
+
return /* @__PURE__ */ React44.createElement(Item9, null, /* @__PURE__ */ React44.createElement(Img2, {
|
|
5810
5514
|
src: urls[0],
|
|
5811
5515
|
alt: "alt"
|
|
5812
|
-
}), /* @__PURE__ */
|
|
5516
|
+
}), /* @__PURE__ */ React44.createElement(MediaButton_default, {
|
|
5813
5517
|
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5814
5518
|
onClick: onStart
|
|
5815
5519
|
}));
|
|
5816
5520
|
}
|
|
5817
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ React44.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React44.createElement(Img2, {
|
|
5818
5522
|
key: image,
|
|
5819
5523
|
src: image,
|
|
5820
5524
|
alt: `Bild ${i + 1}`
|
|
@@ -5836,46 +5540,44 @@ var Lightbox = ({ index: index2, media, onClose }) => {
|
|
|
5836
5540
|
onClose();
|
|
5837
5541
|
}
|
|
5838
5542
|
};
|
|
5839
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ React45.createElement(Wrapper18, {
|
|
5840
5544
|
ref: (ref) => ref?.focus(),
|
|
5841
5545
|
onKeyDown,
|
|
5842
5546
|
tabIndex: 0
|
|
5843
|
-
}, /* @__PURE__ */
|
|
5547
|
+
}, /* @__PURE__ */ React45.createElement(UiBlock2, {
|
|
5844
5548
|
onClick: onClose,
|
|
5845
5549
|
"aria-hidden": true
|
|
5846
|
-
}), media.map((m, i) => /* @__PURE__ */
|
|
5550
|
+
}), media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React45.createElement(Item9, {
|
|
5847
5551
|
key: i,
|
|
5848
5552
|
ref: index2 === i ? onRef : void 0
|
|
5849
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
5553
|
+
}, m.type === "image" && /* @__PURE__ */ React45.createElement(Img2, {
|
|
5850
5554
|
id: `lightbox-image-${i}`,
|
|
5851
5555
|
src: m.files[0].url,
|
|
5852
5556
|
alt: `Bild ${i + 1}`
|
|
5853
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
5557
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React45.createElement(ThreeSixtLightbox_default, {
|
|
5854
5558
|
urls: m.files.map((x) => x.url)
|
|
5855
|
-
}), m.type === "
|
|
5856
|
-
url: m.files[0].url
|
|
5857
|
-
}), m.type === "embedded" && /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
5559
|
+
}), m.type === "embedded" && /* @__PURE__ */ React45.createElement(EmbeddedVideoLightbox_default, {
|
|
5858
5560
|
url: m.files[0].url
|
|
5859
|
-
}))), /* @__PURE__ */
|
|
5561
|
+
}))), /* @__PURE__ */ React45.createElement(CloseBtn2, {
|
|
5860
5562
|
onClick: onClose,
|
|
5861
5563
|
title: "St\xE4ng"
|
|
5862
|
-
}, /* @__PURE__ */
|
|
5564
|
+
}, /* @__PURE__ */ React45.createElement(IconCancel, {
|
|
5863
5565
|
block: true
|
|
5864
5566
|
})));
|
|
5865
5567
|
};
|
|
5866
5568
|
var Lightbox_default = Lightbox;
|
|
5867
5569
|
|
|
5868
5570
|
// src/components/Video/EmbededVideo.tsx
|
|
5869
|
-
import
|
|
5571
|
+
import React47, { useState as useState14, useCallback as useCallback16 } from "react";
|
|
5870
5572
|
|
|
5871
5573
|
// src/components/Video/useThumbnail.ts
|
|
5872
|
-
import { useEffect as
|
|
5574
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
5873
5575
|
|
|
5874
5576
|
// src/hooks/useVimeoThumbnail.ts
|
|
5875
|
-
import { useEffect as
|
|
5577
|
+
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
5876
5578
|
|
|
5877
5579
|
// src/hooks/useFetch.ts
|
|
5878
|
-
import { useEffect as
|
|
5580
|
+
import { useEffect as useEffect8, useState as useState11, useCallback as useCallback15 } from "react";
|
|
5879
5581
|
var cache = {};
|
|
5880
5582
|
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
5881
5583
|
var setCachedResult = (key, value) => {
|
|
@@ -5893,9 +5595,9 @@ var clearPendingPromise = (url) => {
|
|
|
5893
5595
|
delete pendingPromise[url];
|
|
5894
5596
|
};
|
|
5895
5597
|
var useFetch = (path, options, skip, promiseCache) => {
|
|
5896
|
-
const [data, setData] =
|
|
5897
|
-
const [loading, setLoading] =
|
|
5898
|
-
const [error, setError] =
|
|
5598
|
+
const [data, setData] = useState11();
|
|
5599
|
+
const [loading, setLoading] = useState11(false);
|
|
5600
|
+
const [error, setError] = useState11(false);
|
|
5899
5601
|
const doFetch = useCallback15(async () => {
|
|
5900
5602
|
const key = path.toString();
|
|
5901
5603
|
const cached = getCachedResult(key);
|
|
@@ -5925,7 +5627,7 @@ var useFetch = (path, options, skip, promiseCache) => {
|
|
|
5925
5627
|
}
|
|
5926
5628
|
return;
|
|
5927
5629
|
}, [path, options]);
|
|
5928
|
-
|
|
5630
|
+
useEffect8(() => {
|
|
5929
5631
|
if (!skip) {
|
|
5930
5632
|
doFetch();
|
|
5931
5633
|
}
|
|
@@ -5940,14 +5642,14 @@ var useFetch_default = useFetch;
|
|
|
5940
5642
|
|
|
5941
5643
|
// src/hooks/useVimeoThumbnail.ts
|
|
5942
5644
|
var useVimeoThumbnail = (id, small) => {
|
|
5943
|
-
const [thumbnail, setThumbnail] =
|
|
5645
|
+
const [thumbnail, setThumbnail] = useState12();
|
|
5944
5646
|
const { data } = useFetch_default(
|
|
5945
5647
|
`http://vimeo.com/api/v2/video/${id}.json`,
|
|
5946
5648
|
{},
|
|
5947
5649
|
!id || !!thumbnail,
|
|
5948
5650
|
true
|
|
5949
5651
|
);
|
|
5950
|
-
|
|
5652
|
+
useEffect9(() => {
|
|
5951
5653
|
if (data?.[0]) {
|
|
5952
5654
|
if (small && data[0].thumbnail_small) {
|
|
5953
5655
|
setThumbnail(data[0].thumbnail_small);
|
|
@@ -5964,10 +5666,10 @@ var useVimeoThumbnail_default = useVimeoThumbnail;
|
|
|
5964
5666
|
var useThumbnail = (url, small) => {
|
|
5965
5667
|
if (url?.toLowerCase().endsWith(".mp4"))
|
|
5966
5668
|
return;
|
|
5967
|
-
const [thumbnail, setThumbnail] =
|
|
5669
|
+
const [thumbnail, setThumbnail] = useState13();
|
|
5968
5670
|
const vimeoId = url ? getVimeoId(url) : void 0;
|
|
5969
5671
|
const vimeoThumbnail = useVimeoThumbnail_default(vimeoId, small);
|
|
5970
|
-
|
|
5672
|
+
useEffect10(() => {
|
|
5971
5673
|
if (url) {
|
|
5972
5674
|
const youtubeThumbnail = getYoutubeThumbnail(url);
|
|
5973
5675
|
if (youtubeThumbnail) {
|
|
@@ -5984,11 +5686,11 @@ var useThumbnail = (url, small) => {
|
|
|
5984
5686
|
var useThumbnail_default = useThumbnail;
|
|
5985
5687
|
|
|
5986
5688
|
// src/components/Modal/index.tsx
|
|
5987
|
-
import * as
|
|
5689
|
+
import * as React46 from "react";
|
|
5988
5690
|
|
|
5989
5691
|
// src/components/Modal/wrapper.tsx
|
|
5990
|
-
import
|
|
5991
|
-
var
|
|
5692
|
+
import styled37 from "styled-components";
|
|
5693
|
+
var Wrapper20 = styled37.div.attrs(() => ({
|
|
5992
5694
|
role: "dialog"
|
|
5993
5695
|
}))`
|
|
5994
5696
|
position: fixed;
|
|
@@ -6008,7 +5710,7 @@ var Wrapper21 = styled38.div.attrs(() => ({
|
|
|
6008
5710
|
padding: ${size(2)};
|
|
6009
5711
|
}
|
|
6010
5712
|
`;
|
|
6011
|
-
var UiBlock3 =
|
|
5713
|
+
var UiBlock3 = styled37.div.attrs(() => ({
|
|
6012
5714
|
"aria-hidden": "true",
|
|
6013
5715
|
role: "button"
|
|
6014
5716
|
}))`
|
|
@@ -6028,7 +5730,7 @@ var UiBlock3 = styled38.div.attrs(() => ({
|
|
|
6028
5730
|
animation: ${fadeIn} 400ms ease forwards;
|
|
6029
5731
|
}
|
|
6030
5732
|
`;
|
|
6031
|
-
var Dialog =
|
|
5733
|
+
var Dialog = styled37.article.attrs(() => ({
|
|
6032
5734
|
className: "wayke__theme wayke__font--regular"
|
|
6033
5735
|
}))`
|
|
6034
5736
|
display: flex;
|
|
@@ -6052,74 +5754,74 @@ var Dialog = styled38.article.attrs(() => ({
|
|
|
6052
5754
|
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
6053
5755
|
}
|
|
6054
5756
|
`;
|
|
6055
|
-
var Content4 =
|
|
5757
|
+
var Content4 = styled37.div`
|
|
6056
5758
|
flex: 1 1 auto;
|
|
6057
5759
|
overflow: auto;
|
|
6058
5760
|
-webkit-overflow-scrolling: touch;
|
|
6059
5761
|
`;
|
|
6060
|
-
var Header4 =
|
|
5762
|
+
var Header4 = styled37.header`
|
|
6061
5763
|
display: flex;
|
|
6062
5764
|
align-items: center;
|
|
6063
5765
|
min-height: 60px;
|
|
6064
5766
|
padding: ${size(3)};
|
|
6065
5767
|
padding-bottom: 0;
|
|
6066
5768
|
`;
|
|
6067
|
-
var Heading5 =
|
|
5769
|
+
var Heading5 = styled37.div`
|
|
6068
5770
|
flex: 1 1 auto;
|
|
6069
5771
|
|
|
6070
5772
|
${H1} {
|
|
6071
5773
|
font-size: 1.5rem;
|
|
6072
5774
|
}
|
|
6073
5775
|
`;
|
|
6074
|
-
var Close2 =
|
|
5776
|
+
var Close2 = styled37.div`
|
|
6075
5777
|
flex-shrink: 0;
|
|
6076
5778
|
margin: ${size(-2)};
|
|
6077
5779
|
padding-left: ${size(3)};
|
|
6078
5780
|
`;
|
|
6079
|
-
var CloseBtn3 =
|
|
5781
|
+
var CloseBtn3 = styled37(ButtonReset)`
|
|
6080
5782
|
display: block;
|
|
6081
5783
|
padding: ${size(2)};
|
|
6082
5784
|
`;
|
|
6083
|
-
var Body4 =
|
|
5785
|
+
var Body4 = styled37.div`
|
|
6084
5786
|
padding: ${size(3)};
|
|
6085
5787
|
`;
|
|
6086
|
-
var Image3 =
|
|
5788
|
+
var Image3 = styled37.img`
|
|
6087
5789
|
display: block;
|
|
6088
5790
|
width: calc(100% + ${size(6)});
|
|
6089
5791
|
margin-left: ${size(-3)};
|
|
6090
5792
|
margin-bottom: ${size(3)};
|
|
6091
5793
|
`;
|
|
6092
|
-
var ModalFoldout =
|
|
5794
|
+
var ModalFoldout = styled37.div`
|
|
6093
5795
|
background-color: ${(props) => props.theme.color.accent};
|
|
6094
5796
|
margin: ${size(-3)};
|
|
6095
5797
|
margin-top: ${size(3)};
|
|
6096
5798
|
padding: ${size(3)};
|
|
6097
5799
|
`;
|
|
6098
|
-
var ModalFoldoutBody =
|
|
5800
|
+
var ModalFoldoutBody = styled37.div``;
|
|
6099
5801
|
|
|
6100
5802
|
// src/components/Modal/index.tsx
|
|
6101
5803
|
var Modal = ({ id, title, onClose, children }) => {
|
|
6102
|
-
return /* @__PURE__ */
|
|
5804
|
+
return /* @__PURE__ */ React46.createElement(portal_default, {
|
|
6103
5805
|
id: id || portal_namespace_exports.DefaultPortal
|
|
6104
|
-
}, /* @__PURE__ */
|
|
5806
|
+
}, /* @__PURE__ */ React46.createElement(Wrapper20, {
|
|
6105
5807
|
onClick: (e) => e.stopPropagation()
|
|
6106
|
-
}, /* @__PURE__ */
|
|
5808
|
+
}, /* @__PURE__ */ React46.createElement(UiBlock3, {
|
|
6107
5809
|
onClick: onClose,
|
|
6108
5810
|
title: "St\xE4ng modal"
|
|
6109
|
-
}), /* @__PURE__ */
|
|
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, {
|
|
6110
5812
|
noMargin: true
|
|
6111
|
-
}, title)), /* @__PURE__ */
|
|
5813
|
+
}, title)), /* @__PURE__ */ React46.createElement(Close2, null, /* @__PURE__ */ React46.createElement(CloseBtn3, {
|
|
6112
5814
|
onClick: onClose,
|
|
6113
5815
|
title: "St\xE4ng modal"
|
|
6114
|
-
}, /* @__PURE__ */
|
|
5816
|
+
}, /* @__PURE__ */ React46.createElement(IconCancel, {
|
|
6115
5817
|
block: true
|
|
6116
|
-
})))), /* @__PURE__ */
|
|
5818
|
+
})))), /* @__PURE__ */ React46.createElement(Body4, null, children)))));
|
|
6117
5819
|
};
|
|
6118
5820
|
var Modal_default = Modal;
|
|
6119
5821
|
|
|
6120
5822
|
// src/components/Video/EmbededVideo.tsx
|
|
6121
5823
|
var GalleryEmbed = ({ src, index: index2 }) => {
|
|
6122
|
-
const [modal, setModal] =
|
|
5824
|
+
const [modal, setModal] = useState14();
|
|
6123
5825
|
const thumbnail = useThumbnail_default(src);
|
|
6124
5826
|
const onClick = (e) => {
|
|
6125
5827
|
e.stopPropagation();
|
|
@@ -6139,34 +5841,34 @@ var GalleryEmbed = ({ src, index: index2 }) => {
|
|
|
6139
5841
|
);
|
|
6140
5842
|
const customVideo = src.toLowerCase().endsWith(".mp4");
|
|
6141
5843
|
if (thumbnail?.length && !customVideo) {
|
|
6142
|
-
return /* @__PURE__ */
|
|
5844
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(ImageFull, {
|
|
6143
5845
|
onLoad,
|
|
6144
5846
|
src: thumbnail[0],
|
|
6145
5847
|
onError,
|
|
6146
5848
|
alt: `Bild ${index2 + 1}`
|
|
6147
|
-
}), /* @__PURE__ */
|
|
5849
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
6148
5850
|
text: "Spela video",
|
|
6149
5851
|
onClick
|
|
6150
|
-
}), modal && /* @__PURE__ */
|
|
5852
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
6151
5853
|
title: "Video",
|
|
6152
5854
|
onClose: onCloseModal
|
|
6153
|
-
}, /* @__PURE__ */
|
|
5855
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
6154
5856
|
url: modal
|
|
6155
5857
|
})));
|
|
6156
5858
|
}
|
|
6157
5859
|
if (customVideo)
|
|
6158
|
-
return /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(CustomPlayer_default, {
|
|
6159
5861
|
ratio: "66.66%",
|
|
6160
5862
|
isPreview: true,
|
|
6161
5863
|
controls: false,
|
|
6162
5864
|
url: src
|
|
6163
|
-
}), /* @__PURE__ */
|
|
5865
|
+
}), /* @__PURE__ */ React47.createElement(MediaButton_default, {
|
|
6164
5866
|
text: "Spela video",
|
|
6165
5867
|
onClick
|
|
6166
|
-
}), modal && /* @__PURE__ */
|
|
5868
|
+
}), modal && /* @__PURE__ */ React47.createElement(Modal_default, {
|
|
6167
5869
|
title: "Video",
|
|
6168
5870
|
onClose: onCloseModal
|
|
6169
|
-
}, /* @__PURE__ */
|
|
5871
|
+
}, /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
6170
5872
|
url: modal
|
|
6171
5873
|
})));
|
|
6172
5874
|
return null;
|
|
@@ -6174,7 +5876,7 @@ var GalleryEmbed = ({ src, index: index2 }) => {
|
|
|
6174
5876
|
var EmbededVideo_default = GalleryEmbed;
|
|
6175
5877
|
|
|
6176
5878
|
// src/components/Video/QuickNavEmbeded.tsx
|
|
6177
|
-
import
|
|
5879
|
+
import React48, { useCallback as useCallback17 } from "react";
|
|
6178
5880
|
var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
6179
5881
|
const thumbnail = useThumbnail_default(src);
|
|
6180
5882
|
const onError = useCallback17(
|
|
@@ -6187,14 +5889,14 @@ var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
|
6187
5889
|
);
|
|
6188
5890
|
const customVideo = src?.toLowerCase().endsWith(".mp4");
|
|
6189
5891
|
if (thumbnail?.length && !customVideo)
|
|
6190
|
-
return /* @__PURE__ */
|
|
5892
|
+
return /* @__PURE__ */ React48.createElement(QuickNavImg, {
|
|
6191
5893
|
onLoad,
|
|
6192
5894
|
src: thumbnail[0],
|
|
6193
5895
|
onError,
|
|
6194
5896
|
alt: `Bild ${index2 + 1}`
|
|
6195
5897
|
});
|
|
6196
5898
|
if (customVideo)
|
|
6197
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ React48.createElement(CustomPlayer_default, {
|
|
6198
5900
|
key: index2,
|
|
6199
5901
|
url: src,
|
|
6200
5902
|
ratio: "66.66%"
|
|
@@ -6203,60 +5905,30 @@ var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
|
6203
5905
|
};
|
|
6204
5906
|
var QuickNavEmbeded_default = QuickNavEmbeded;
|
|
6205
5907
|
|
|
6206
|
-
// src/components/Sphere/Sphere.tsx
|
|
6207
|
-
import React51 from "react";
|
|
6208
|
-
var onMediaClick = (e, func) => {
|
|
6209
|
-
e.stopPropagation();
|
|
6210
|
-
e.preventDefault();
|
|
6211
|
-
func();
|
|
6212
|
-
};
|
|
6213
|
-
var Sphere = ({ url, preview, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6214
|
-
if (!visible || !navigationDisabled && visible) {
|
|
6215
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(ImageFull, {
|
|
6216
|
-
src: preview,
|
|
6217
|
-
alt: "alt"
|
|
6218
|
-
}), /* @__PURE__ */ React51.createElement(MediaButton_default, {
|
|
6219
|
-
text: "Starta 360\xB0 interi\xF6rt",
|
|
6220
|
-
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
6221
|
-
}));
|
|
6222
|
-
}
|
|
6223
|
-
if (navigationDisabled && visible) {
|
|
6224
|
-
return /* @__PURE__ */ React51.createElement(SphereViewer_default, {
|
|
6225
|
-
id: url,
|
|
6226
|
-
preview: url,
|
|
6227
|
-
src: url,
|
|
6228
|
-
autoLoad: true,
|
|
6229
|
-
onStart: onDisableNavigation
|
|
6230
|
-
});
|
|
6231
|
-
}
|
|
6232
|
-
return null;
|
|
6233
|
-
};
|
|
6234
|
-
var Sphere_default = Sphere;
|
|
6235
|
-
|
|
6236
5908
|
// src/components/ThreeSixty/ThreeSixty.tsx
|
|
6237
|
-
import
|
|
6238
|
-
var
|
|
5909
|
+
import React49 from "react";
|
|
5910
|
+
var onMediaClick = (e, func) => {
|
|
6239
5911
|
e.stopPropagation();
|
|
6240
5912
|
e.preventDefault();
|
|
6241
5913
|
func();
|
|
6242
5914
|
};
|
|
6243
5915
|
var ThreeSixty = ({ urls, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6244
5916
|
if (!visible || !navigationDisabled && visible) {
|
|
6245
|
-
return /* @__PURE__ */
|
|
5917
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Image2, {
|
|
6246
5918
|
src: urls[0],
|
|
6247
5919
|
alt: "alt"
|
|
6248
|
-
}), /* @__PURE__ */
|
|
5920
|
+
}), /* @__PURE__ */ React49.createElement(MediaButton_default, {
|
|
6249
5921
|
text: "Starta 360\xB0 exteri\xF6rt",
|
|
6250
|
-
onClick: (e) =>
|
|
5922
|
+
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
6251
5923
|
}));
|
|
6252
5924
|
}
|
|
6253
5925
|
if (navigationDisabled && visible) {
|
|
6254
|
-
return /* @__PURE__ */
|
|
5926
|
+
return /* @__PURE__ */ React49.createElement("div", {
|
|
6255
5927
|
onClick: (e) => {
|
|
6256
5928
|
e.stopPropagation();
|
|
6257
5929
|
e.preventDefault();
|
|
6258
5930
|
}
|
|
6259
|
-
}, /* @__PURE__ */
|
|
5931
|
+
}, /* @__PURE__ */ React49.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React49.createElement(Image2, {
|
|
6260
5932
|
key: image,
|
|
6261
5933
|
src: image,
|
|
6262
5934
|
alt: `Bild ${i + 1}`
|
|
@@ -6279,9 +5951,9 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6279
5951
|
const slider = useRef3(null);
|
|
6280
5952
|
const quickNavRef = useRef3(null);
|
|
6281
5953
|
const isDragging = useRef3(false);
|
|
6282
|
-
const [index2, setIndex] =
|
|
6283
|
-
const [lightbox, setLightbox] =
|
|
6284
|
-
const [navigationDisabled, setNavigationDisabled] =
|
|
5954
|
+
const [index2, setIndex] = useState15(0);
|
|
5955
|
+
const [lightbox, setLightbox] = useState15(false);
|
|
5956
|
+
const [navigationDisabled, setNavigationDisabled] = useState15(false);
|
|
6285
5957
|
const beforeChange = useCallback18((_, newIndex) => {
|
|
6286
5958
|
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
6287
5959
|
if (element) {
|
|
@@ -6341,87 +6013,81 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6341
6013
|
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
6342
6014
|
[placeholderImage]
|
|
6343
6015
|
);
|
|
6344
|
-
return /* @__PURE__ */
|
|
6016
|
+
return /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(Wrapper17, null, /* @__PURE__ */ React50.createElement(Main, null, /* @__PURE__ */ React50.createElement(SliderWrapper, {
|
|
6345
6017
|
onMouseDown,
|
|
6346
6018
|
onMouseMove,
|
|
6347
6019
|
onClick
|
|
6348
|
-
}, /* @__PURE__ */
|
|
6020
|
+
}, /* @__PURE__ */ React50.createElement(Slider3, {
|
|
6349
6021
|
...sliderSettings,
|
|
6350
6022
|
swipe: !navigationDisabled,
|
|
6351
6023
|
touchMove: !navigationDisabled,
|
|
6352
6024
|
swipeToSlide: !navigationDisabled,
|
|
6353
6025
|
ref: slider,
|
|
6354
6026
|
beforeChange
|
|
6355
|
-
}, !!media?.length ? media.map((m, i) => /* @__PURE__ */
|
|
6027
|
+
}, !!media?.length ? media.filter((x) => x.type !== "sphere").map((m, i) => /* @__PURE__ */ React50.createElement(Item8, {
|
|
6356
6028
|
key: m.files[0].url || i
|
|
6357
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
6029
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(Image2, {
|
|
6358
6030
|
src: m.files[0].formats.filter(notEmpty).find((x) => x.format === "1170x")?.url,
|
|
6359
6031
|
alt: `Bild ${i + 1}`
|
|
6360
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
6032
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(ThreeSixty_default, {
|
|
6361
6033
|
urls: m.files.map((x) => x.url),
|
|
6362
6034
|
visible: i === index2,
|
|
6363
6035
|
onDisableNavigation,
|
|
6364
6036
|
navigationDisabled
|
|
6365
|
-
}), m.type === "embedded" && /* @__PURE__ */
|
|
6037
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(EmbededVideo_default, {
|
|
6366
6038
|
src: m.files[0].url,
|
|
6367
6039
|
index: i + 1
|
|
6368
|
-
})
|
|
6369
|
-
visible: i === index2,
|
|
6370
|
-
url: m.files[0].url,
|
|
6371
|
-
preview: m.files[0].url,
|
|
6372
|
-
onDisableNavigation,
|
|
6373
|
-
navigationDisabled
|
|
6374
|
-
}))) : /* @__PURE__ */ React53.createElement(Item8, {
|
|
6040
|
+
}))) : /* @__PURE__ */ React50.createElement(Item8, {
|
|
6375
6041
|
key: placeholder
|
|
6376
|
-
}, /* @__PURE__ */
|
|
6042
|
+
}, /* @__PURE__ */ React50.createElement(Image2, {
|
|
6377
6043
|
src: placeholder,
|
|
6378
6044
|
alt: `Bild 1`
|
|
6379
|
-
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */
|
|
6045
|
+
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(EnableNavigationButton, null, /* @__PURE__ */ React50.createElement(ButtonSecondary, {
|
|
6380
6046
|
onClick: onEnableNavigation,
|
|
6381
6047
|
title: "St\xE4ng"
|
|
6382
|
-
}, /* @__PURE__ */
|
|
6048
|
+
}, /* @__PURE__ */ React50.createElement(ButtonContent, null, "St\xE4ng")))), !navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(ArrowLeft, {
|
|
6383
6049
|
onClick: prevImage,
|
|
6384
6050
|
title: "F\xF6reg\xE5ende bild"
|
|
6385
|
-
}, /* @__PURE__ */
|
|
6051
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronLeft, {
|
|
6386
6052
|
block: true
|
|
6387
|
-
})), /* @__PURE__ */
|
|
6053
|
+
})), /* @__PURE__ */ React50.createElement(ArrowRight, {
|
|
6388
6054
|
onClick: nextImage,
|
|
6389
6055
|
title: "N\xE4sta bild"
|
|
6390
|
-
}, /* @__PURE__ */
|
|
6056
|
+
}, /* @__PURE__ */ React50.createElement(IconChevronRight, {
|
|
6391
6057
|
block: true
|
|
6392
|
-
})))), /* @__PURE__ */
|
|
6058
|
+
})))), /* @__PURE__ */ React50.createElement(Alt, null, /* @__PURE__ */ React50.createElement(QuickNav, {
|
|
6393
6059
|
ref: quickNavRef
|
|
6394
6060
|
}, !!media?.length ? media.map((m, i) => {
|
|
6395
6061
|
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === "225x150")?.url || m.files[0].url;
|
|
6396
|
-
return /* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6397
6063
|
key: src || i,
|
|
6398
6064
|
active: index2 === i
|
|
6399
|
-
}, /* @__PURE__ */
|
|
6065
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6400
6066
|
onClick: () => goTo(i),
|
|
6401
6067
|
title: `G\xE5 till bild ${i + 1}`
|
|
6402
|
-
}, m.type === "image" && /* @__PURE__ */
|
|
6068
|
+
}, m.type === "image" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6403
6069
|
src,
|
|
6404
6070
|
alt: `Bild ${i + 1}`
|
|
6405
|
-
}), m.type === "threesixty" && /* @__PURE__ */
|
|
6071
|
+
}), m.type === "threesixty" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6406
6072
|
src,
|
|
6407
6073
|
alt: `Bild ${i + 1}`
|
|
6408
|
-
}), m.type === "embedded" && /* @__PURE__ */
|
|
6074
|
+
}), m.type === "embedded" && /* @__PURE__ */ React50.createElement(QuickNavEmbeded_default, {
|
|
6409
6075
|
src,
|
|
6410
6076
|
index: i
|
|
6411
|
-
}), m.type === "sphere" && /* @__PURE__ */
|
|
6077
|
+
}), m.type === "sphere" && /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6412
6078
|
src: m.files[0].url,
|
|
6413
6079
|
alt: `Bild ${i + 1}`
|
|
6414
6080
|
})));
|
|
6415
|
-
}) : /* @__PURE__ */
|
|
6081
|
+
}) : /* @__PURE__ */ React50.createElement(QuickNavItem, {
|
|
6416
6082
|
key: placeholder,
|
|
6417
6083
|
active: true
|
|
6418
|
-
}, /* @__PURE__ */
|
|
6084
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavBtn, {
|
|
6419
6085
|
onClick: () => goTo(0),
|
|
6420
6086
|
title: `G\xE5 till bild 0`
|
|
6421
|
-
}, /* @__PURE__ */
|
|
6087
|
+
}, /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6422
6088
|
src: placeholder,
|
|
6423
6089
|
alt: `Bild 1`
|
|
6424
|
-
})))))), lightbox && !!media?.length && /* @__PURE__ */
|
|
6090
|
+
})))))), lightbox && !!media?.length && /* @__PURE__ */ React50.createElement(Lightbox_default, {
|
|
6425
6091
|
media,
|
|
6426
6092
|
index: index2,
|
|
6427
6093
|
onClose: onToggleLightbox
|
|
@@ -6430,8 +6096,8 @@ var Gallery = ({ media, placeholderImage }) => {
|
|
|
6430
6096
|
var Gallery_default = Gallery;
|
|
6431
6097
|
|
|
6432
6098
|
// src/components/ProductPage/index.tsx
|
|
6433
|
-
import
|
|
6434
|
-
var ProductPage =
|
|
6099
|
+
import styled38 from "styled-components";
|
|
6100
|
+
var ProductPage = styled38.div`
|
|
6435
6101
|
display: flex;
|
|
6436
6102
|
flex-direction: column;
|
|
6437
6103
|
|
|
@@ -6439,7 +6105,7 @@ var ProductPage = styled39.div`
|
|
|
6439
6105
|
flex-direction: row;
|
|
6440
6106
|
}
|
|
6441
6107
|
`;
|
|
6442
|
-
var ProductPageAside =
|
|
6108
|
+
var ProductPageAside = styled38.div`
|
|
6443
6109
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6444
6110
|
display: contents;
|
|
6445
6111
|
}
|
|
@@ -6450,7 +6116,7 @@ var ProductPageAside = styled39.div`
|
|
|
6450
6116
|
padding-right: ${size(2)};
|
|
6451
6117
|
}
|
|
6452
6118
|
`;
|
|
6453
|
-
var ProductPageMain =
|
|
6119
|
+
var ProductPageMain = styled38.div`
|
|
6454
6120
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6455
6121
|
display: contents;
|
|
6456
6122
|
}
|
|
@@ -6461,7 +6127,7 @@ var ProductPageMain = styled39.div`
|
|
|
6461
6127
|
padding-left: ${size(2)};
|
|
6462
6128
|
}
|
|
6463
6129
|
`;
|
|
6464
|
-
var ProductPageAsideSection =
|
|
6130
|
+
var ProductPageAsideSection = styled38.div`
|
|
6465
6131
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6466
6132
|
order: ${(props) => props.mobileOrder};
|
|
6467
6133
|
|
|
@@ -6488,7 +6154,7 @@ var ProductPageAsideSection = styled39.div`
|
|
|
6488
6154
|
}
|
|
6489
6155
|
}
|
|
6490
6156
|
`;
|
|
6491
|
-
var ProductPageMainSection =
|
|
6157
|
+
var ProductPageMainSection = styled38.div`
|
|
6492
6158
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
6493
6159
|
order: 99;
|
|
6494
6160
|
padding: ${size(4)} 0;
|
|
@@ -6510,7 +6176,7 @@ var ProductPageMainSection = styled39.div`
|
|
|
6510
6176
|
}
|
|
6511
6177
|
}
|
|
6512
6178
|
`;
|
|
6513
|
-
var ProductPageContentLimit =
|
|
6179
|
+
var ProductPageContentLimit = styled38.div`
|
|
6514
6180
|
max-width: 420px;
|
|
6515
6181
|
`;
|
|
6516
6182
|
|
|
@@ -6760,17 +6426,17 @@ var useSearchItem = (id) => useQuery(SEARCH_ITEM_QUERY_default, {
|
|
|
6760
6426
|
var useSearchItem_default = useSearchItem;
|
|
6761
6427
|
|
|
6762
6428
|
// src/components/FinancialOptions/index.tsx
|
|
6763
|
-
import
|
|
6429
|
+
import React59, { Fragment } from "react";
|
|
6764
6430
|
|
|
6765
6431
|
// src/components/FinancialOptions/leasing.tsx
|
|
6766
|
-
import
|
|
6432
|
+
import React53, { useState as useState16, useCallback as useCallback19 } from "react";
|
|
6767
6433
|
|
|
6768
6434
|
// src/components/OptionBox/index.tsx
|
|
6769
|
-
import * as
|
|
6435
|
+
import * as React51 from "react";
|
|
6770
6436
|
|
|
6771
6437
|
// src/components/OptionBox/wrapper.tsx
|
|
6772
|
-
import
|
|
6773
|
-
var
|
|
6438
|
+
import styled39 from "styled-components";
|
|
6439
|
+
var Wrapper21 = styled39.div`
|
|
6774
6440
|
display: flex;
|
|
6775
6441
|
align-items: center;
|
|
6776
6442
|
padding: ${size(1)};
|
|
@@ -6781,14 +6447,14 @@ var Wrapper22 = styled40.div`
|
|
|
6781
6447
|
margin-top: ${size(1)};
|
|
6782
6448
|
}
|
|
6783
6449
|
`;
|
|
6784
|
-
var Logo2 =
|
|
6450
|
+
var Logo2 = styled39.div`
|
|
6785
6451
|
position: relative;
|
|
6786
6452
|
flex-shrink: 0;
|
|
6787
6453
|
margin-right: ${size(1)};
|
|
6788
6454
|
width: ${size(9.5)};
|
|
6789
6455
|
height: ${size(6)};
|
|
6790
6456
|
`;
|
|
6791
|
-
var LogoImg =
|
|
6457
|
+
var LogoImg = styled39.img`
|
|
6792
6458
|
display: block;
|
|
6793
6459
|
position: absolute;
|
|
6794
6460
|
left: 0;
|
|
@@ -6799,17 +6465,17 @@ var LogoImg = styled40.img`
|
|
|
6799
6465
|
max-width: 100%;
|
|
6800
6466
|
max-height: 100%;
|
|
6801
6467
|
`;
|
|
6802
|
-
var Content5 =
|
|
6468
|
+
var Content5 = styled39.div`
|
|
6803
6469
|
flex: 1 1 auto;
|
|
6804
6470
|
text-align: right;
|
|
6805
6471
|
line-height: 1.4;
|
|
6806
6472
|
`;
|
|
6807
|
-
var OptionBoxHeading =
|
|
6473
|
+
var OptionBoxHeading = styled39.div.attrs(() => ({
|
|
6808
6474
|
className: "wayke__theme wayke__font--bold"
|
|
6809
6475
|
}))`
|
|
6810
6476
|
font-size: 1rem;
|
|
6811
6477
|
`;
|
|
6812
|
-
var OptionBoxContent =
|
|
6478
|
+
var OptionBoxContent = styled39.div`
|
|
6813
6479
|
margin-top: ${size(0.5)};
|
|
6814
6480
|
font-size: 0.875rem;
|
|
6815
6481
|
|
|
@@ -6819,24 +6485,24 @@ var OptionBoxContent = styled40.div`
|
|
|
6819
6485
|
`;
|
|
6820
6486
|
|
|
6821
6487
|
// src/components/OptionBox/index.tsx
|
|
6822
|
-
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, {
|
|
6823
6489
|
src: logo,
|
|
6824
6490
|
srcSet: logo2x,
|
|
6825
6491
|
alt: logoAlt
|
|
6826
|
-
})), /* @__PURE__ */
|
|
6492
|
+
})), /* @__PURE__ */ React51.createElement(Content5, null, children));
|
|
6827
6493
|
var OptionBox_default = OptionBox;
|
|
6828
6494
|
|
|
6829
6495
|
// src/components/DataList/index.tsx
|
|
6830
|
-
import
|
|
6496
|
+
import React52 from "react";
|
|
6831
6497
|
|
|
6832
6498
|
// src/components/DataList/wrapper.tsx
|
|
6833
|
-
import
|
|
6834
|
-
var List8 =
|
|
6499
|
+
import styled40 from "styled-components";
|
|
6500
|
+
var List8 = styled40.ul`
|
|
6835
6501
|
list-style: none;
|
|
6836
6502
|
padding: 0;
|
|
6837
6503
|
margin: 0;
|
|
6838
6504
|
`;
|
|
6839
|
-
var Item10 =
|
|
6505
|
+
var Item10 = styled40.li`
|
|
6840
6506
|
display: flex;
|
|
6841
6507
|
align-items: flex-start;
|
|
6842
6508
|
|
|
@@ -6844,10 +6510,10 @@ var Item10 = styled41.li`
|
|
|
6844
6510
|
margin-top: ${size(1)};
|
|
6845
6511
|
}
|
|
6846
6512
|
`;
|
|
6847
|
-
var Label7 =
|
|
6513
|
+
var Label7 = styled40.div`
|
|
6848
6514
|
flex: 1 1 auto;
|
|
6849
6515
|
`;
|
|
6850
|
-
var Value2 =
|
|
6516
|
+
var Value2 = styled40.div.attrs(() => ({
|
|
6851
6517
|
className: "wayke__theme wayke__font--bold"
|
|
6852
6518
|
}))`
|
|
6853
6519
|
flex-shrink: 0;
|
|
@@ -6855,25 +6521,25 @@ var Value2 = styled41.div.attrs(() => ({
|
|
|
6855
6521
|
`;
|
|
6856
6522
|
|
|
6857
6523
|
// src/components/DataList/index.tsx
|
|
6858
|
-
var DataList = ({ items }) => /* @__PURE__ */
|
|
6524
|
+
var DataList = ({ items }) => /* @__PURE__ */ React52.createElement(List8, null, items.map((item) => /* @__PURE__ */ React52.createElement(Item10, {
|
|
6859
6525
|
key: item.label
|
|
6860
|
-
}, /* @__PURE__ */
|
|
6526
|
+
}, /* @__PURE__ */ React52.createElement(Label7, null, item.label), /* @__PURE__ */ React52.createElement(Value2, null, item.value))));
|
|
6861
6527
|
var DataList_default = DataList;
|
|
6862
6528
|
|
|
6863
6529
|
// src/components/FinancialOptions/leasing.tsx
|
|
6864
6530
|
var Leasing = ({ financialOption }) => {
|
|
6865
|
-
const [modal, setModal] =
|
|
6531
|
+
const [modal, setModal] = useState16(false);
|
|
6866
6532
|
const toggleModal = useCallback19(() => setModal(!modal), [modal]);
|
|
6867
6533
|
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
6868
|
-
return /* @__PURE__ */
|
|
6534
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, modal && /* @__PURE__ */ React53.createElement(Modal_default, {
|
|
6869
6535
|
title: "Privatleasing",
|
|
6870
6536
|
onClose: toggleModal
|
|
6871
|
-
}, image && /* @__PURE__ */
|
|
6537
|
+
}, image && /* @__PURE__ */ React53.createElement(Image3, {
|
|
6872
6538
|
src: image,
|
|
6873
6539
|
alt: "Privatleasing"
|
|
6874
|
-
}), description && /* @__PURE__ */
|
|
6540
|
+
}), description && /* @__PURE__ */ React53.createElement(Content_default, {
|
|
6875
6541
|
dangerouslySetInnerHTML: { __html: description }
|
|
6876
|
-
}), /* @__PURE__ */
|
|
6542
|
+
}), /* @__PURE__ */ React53.createElement(ModalFoldout, null, /* @__PURE__ */ React53.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React53.createElement(DataList_default, {
|
|
6877
6543
|
items: [
|
|
6878
6544
|
{
|
|
6879
6545
|
label: "M\xE5nadskostnad",
|
|
@@ -6888,14 +6554,14 @@ var Leasing = ({ financialOption }) => {
|
|
|
6888
6554
|
value: `${numberSeparator(mileage?.current || 0)} mil/\xE5r`
|
|
6889
6555
|
}
|
|
6890
6556
|
]
|
|
6891
|
-
})))), /* @__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, {
|
|
6892
6558
|
onClick: toggleModal
|
|
6893
6559
|
}, "L\xE4s mer")))));
|
|
6894
6560
|
};
|
|
6895
6561
|
var leasing_default = Leasing;
|
|
6896
6562
|
|
|
6897
6563
|
// src/components/FinancialOptions/loan.tsx
|
|
6898
|
-
import
|
|
6564
|
+
import React58, { useState as useState19, useCallback as useCallback22 } from "react";
|
|
6899
6565
|
|
|
6900
6566
|
// src/hooks/useLoan.ts
|
|
6901
6567
|
import { useQuery as useQuery2 } from "@apollo/client";
|
|
@@ -6951,22 +6617,22 @@ var useLoanCalculation = (id, duration, downPayment, residual) => useQuery2(LOAN
|
|
|
6951
6617
|
var useLoan_default = useLoanCalculation;
|
|
6952
6618
|
|
|
6953
6619
|
// src/components/FinancialOptions/LoanModal.tsx
|
|
6954
|
-
import
|
|
6620
|
+
import React57, { useState as useState18, useCallback as useCallback21, useEffect as useEffect12 } from "react";
|
|
6955
6621
|
|
|
6956
6622
|
// src/components/ContentLogo/index.tsx
|
|
6957
|
-
import
|
|
6958
|
-
var ContentLogo =
|
|
6623
|
+
import styled41 from "styled-components";
|
|
6624
|
+
var ContentLogo = styled41.div`
|
|
6959
6625
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6960
6626
|
display: flex;
|
|
6961
6627
|
align-items: flex-start;
|
|
6962
6628
|
}
|
|
6963
6629
|
`;
|
|
6964
|
-
var ContentLogoText =
|
|
6630
|
+
var ContentLogoText = styled41.div`
|
|
6965
6631
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6966
6632
|
flex: 1 1 auto;
|
|
6967
6633
|
}
|
|
6968
6634
|
`;
|
|
6969
|
-
var ContentLogoMedia =
|
|
6635
|
+
var ContentLogoMedia = styled41.div`
|
|
6970
6636
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
6971
6637
|
margin-top: ${size(2)};
|
|
6972
6638
|
}
|
|
@@ -6978,23 +6644,23 @@ var ContentLogoMedia = styled42.div`
|
|
|
6978
6644
|
`;
|
|
6979
6645
|
|
|
6980
6646
|
// src/components/RangeSlider/SliderWithLabel.tsx
|
|
6981
|
-
import
|
|
6647
|
+
import React56, { useCallback as useCallback20, useEffect as useEffect11, useState as useState17 } from "react";
|
|
6982
6648
|
|
|
6983
6649
|
// src/components/RangeSliderLabel/index.tsx
|
|
6984
|
-
import
|
|
6650
|
+
import React54 from "react";
|
|
6985
6651
|
|
|
6986
6652
|
// src/components/RangeSliderLabel/wrapper.tsx
|
|
6987
|
-
import
|
|
6988
|
-
var
|
|
6653
|
+
import styled42, { css as css13 } from "styled-components";
|
|
6654
|
+
var Wrapper22 = styled42.div`
|
|
6989
6655
|
display: flex;
|
|
6990
6656
|
align-items: flex-end;
|
|
6991
6657
|
`;
|
|
6992
|
-
var Label8 =
|
|
6658
|
+
var Label8 = styled42.div.attrs(() => ({
|
|
6993
6659
|
className: "wayke__theme wayke__font--bold"
|
|
6994
6660
|
}))`
|
|
6995
6661
|
flex: 1 1 auto;
|
|
6996
6662
|
`;
|
|
6997
|
-
var Value3 =
|
|
6663
|
+
var Value3 = styled42.div.attrs(() => ({
|
|
6998
6664
|
className: "wayke__theme wayke__font--bold wayke__color--primary-text"
|
|
6999
6665
|
}))`
|
|
7000
6666
|
flex-shrink: 0;
|
|
@@ -7008,13 +6674,13 @@ var Value3 = styled43.div.attrs(() => ({
|
|
|
7008
6674
|
`;
|
|
7009
6675
|
|
|
7010
6676
|
// src/components/RangeSliderLabel/index.tsx
|
|
7011
|
-
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, {
|
|
7012
6678
|
isHighlighted: highlight
|
|
7013
6679
|
}, value));
|
|
7014
6680
|
var RangeSliderLabel_default = RangeSliderLabel;
|
|
7015
6681
|
|
|
7016
6682
|
// src/components/RangeSlider/RangeSliderSimple.tsx
|
|
7017
|
-
import
|
|
6683
|
+
import React55 from "react";
|
|
7018
6684
|
import { Slider as Slider4, Rail as Rail2, Handles as Handles2, Tracks as Tracks2 } from "react-compound-slider";
|
|
7019
6685
|
var RangeSliderSimple = ({
|
|
7020
6686
|
loading,
|
|
@@ -7034,7 +6700,7 @@ var RangeSliderSimple = ({
|
|
|
7034
6700
|
if (steps.length < 2) {
|
|
7035
6701
|
return null;
|
|
7036
6702
|
}
|
|
7037
|
-
return /* @__PURE__ */
|
|
6703
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Slider, null, /* @__PURE__ */ React55.createElement(Slider4, {
|
|
7038
6704
|
disabled: loading,
|
|
7039
6705
|
mode: 1,
|
|
7040
6706
|
step,
|
|
@@ -7043,20 +6709,20 @@ var RangeSliderSimple = ({
|
|
|
7043
6709
|
onUpdate,
|
|
7044
6710
|
values,
|
|
7045
6711
|
rootStyle: { position: "relative" }
|
|
7046
|
-
}, /* @__PURE__ */
|
|
6712
|
+
}, /* @__PURE__ */ React55.createElement(Rail2, null, ({ getRailProps }) => /* @__PURE__ */ React55.createElement(Bar2, {
|
|
7047
6713
|
...getRailProps()
|
|
7048
|
-
})), /* @__PURE__ */
|
|
6714
|
+
})), /* @__PURE__ */ React55.createElement(Handles2, null, ({ handles, getHandleProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
7049
6715
|
className: "slider-handles"
|
|
7050
|
-
}, handles.map((handle) => /* @__PURE__ */
|
|
6716
|
+
}, handles.map((handle) => /* @__PURE__ */ React55.createElement(Handle2, {
|
|
7051
6717
|
key: handle.id,
|
|
7052
6718
|
handle,
|
|
7053
6719
|
domain,
|
|
7054
6720
|
getHandleProps
|
|
7055
|
-
})))), /* @__PURE__ */
|
|
6721
|
+
})))), /* @__PURE__ */ React55.createElement(Tracks2, {
|
|
7056
6722
|
right: false
|
|
7057
|
-
}, ({ tracks, getTrackProps }) => /* @__PURE__ */
|
|
6723
|
+
}, ({ tracks, getTrackProps }) => /* @__PURE__ */ React55.createElement("div", {
|
|
7058
6724
|
className: "slider-tracks"
|
|
7059
|
-
}, tracks.map(({ id, source, target }) => /* @__PURE__ */
|
|
6725
|
+
}, tracks.map(({ id, source, target }) => /* @__PURE__ */ React55.createElement(Track2, {
|
|
7060
6726
|
key: id,
|
|
7061
6727
|
source,
|
|
7062
6728
|
target,
|
|
@@ -7076,18 +6742,18 @@ var SliderWithLabel = ({
|
|
|
7076
6742
|
formatValues,
|
|
7077
6743
|
onChange
|
|
7078
6744
|
}) => {
|
|
7079
|
-
const [local, setLocal] =
|
|
6745
|
+
const [local, setLocal] = useState17(steps);
|
|
7080
6746
|
const onUpdate = useCallback20((nextValues) => {
|
|
7081
6747
|
setLocal([...nextValues]);
|
|
7082
6748
|
}, []);
|
|
7083
|
-
|
|
6749
|
+
useEffect11(() => {
|
|
7084
6750
|
if (!loading)
|
|
7085
6751
|
setLocal(void 0);
|
|
7086
6752
|
}, [loading]);
|
|
7087
|
-
return /* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ React56.createElement(React56.Fragment, null, /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderLabel_default, {
|
|
7088
6754
|
label,
|
|
7089
6755
|
value: `${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ""}`
|
|
7090
|
-
})), /* @__PURE__ */
|
|
6756
|
+
})), /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(RangeSliderSimple_default, {
|
|
7091
6757
|
loading,
|
|
7092
6758
|
values,
|
|
7093
6759
|
domain,
|
|
@@ -7112,22 +6778,22 @@ var stepGenerator = (step, max, steps = [], current) => {
|
|
|
7112
6778
|
return stepGenerator(step, max, steps, nextCurrent);
|
|
7113
6779
|
};
|
|
7114
6780
|
var LoanModal = ({ id, financialOption, onClose }) => {
|
|
7115
|
-
const [tmp, setTmp] =
|
|
7116
|
-
const [extend, setExtend] =
|
|
7117
|
-
const onToggleExtend =
|
|
6781
|
+
const [tmp, setTmp] = useState18();
|
|
6782
|
+
const [extend, setExtend] = React57.useState(false);
|
|
6783
|
+
const onToggleExtend = React57.useCallback(() => {
|
|
7118
6784
|
if (!extend) {
|
|
7119
6785
|
pubsub_default.publish("FinanceInterest");
|
|
7120
6786
|
}
|
|
7121
6787
|
setExtend(!extend);
|
|
7122
6788
|
}, [extend]);
|
|
7123
|
-
const [variables, setVariables] =
|
|
6789
|
+
const [variables, setVariables] = useState18({
|
|
7124
6790
|
duration: financialOption.duration?.current,
|
|
7125
6791
|
downPayment: financialOption.downPayment?.current,
|
|
7126
6792
|
residual: financialOption.residual?.current
|
|
7127
6793
|
});
|
|
7128
6794
|
const { duration, downPayment, residual } = variables;
|
|
7129
6795
|
const { loading, data } = useLoan_default(id, duration, downPayment, residual);
|
|
7130
|
-
|
|
6796
|
+
useEffect12(() => {
|
|
7131
6797
|
if (data) {
|
|
7132
6798
|
setTmp(data);
|
|
7133
6799
|
setVariables({
|
|
@@ -7176,14 +6842,14 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7176
6842
|
);
|
|
7177
6843
|
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
7178
6844
|
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
7179
|
-
return /* @__PURE__ */
|
|
6845
|
+
return /* @__PURE__ */ React57.createElement(Modal_default, {
|
|
7180
6846
|
title: "L\xE5nealternativ",
|
|
7181
6847
|
onClose
|
|
7182
|
-
}, /* @__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, {
|
|
7183
6849
|
logo: financialOption.image,
|
|
7184
6850
|
alt: financialOption.name || "Logotyp",
|
|
7185
6851
|
wide: true
|
|
7186
|
-
})))), /* @__PURE__ */
|
|
6852
|
+
})))), /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7187
6853
|
label: "Kontantinsatts",
|
|
7188
6854
|
values: [downPaymentCurrent],
|
|
7189
6855
|
domain: [downPaymentMin, downPaymentMax],
|
|
@@ -7192,7 +6858,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7192
6858
|
formatValues: true,
|
|
7193
6859
|
loading,
|
|
7194
6860
|
onChange: onDownPaymentChange
|
|
7195
|
-
})), /* @__PURE__ */
|
|
6861
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7196
6862
|
label: "Avbetalning",
|
|
7197
6863
|
values: [durationCurrent],
|
|
7198
6864
|
domain: [durationMin, durationMax],
|
|
@@ -7200,7 +6866,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7200
6866
|
unit: "m\xE5n",
|
|
7201
6867
|
loading,
|
|
7202
6868
|
onChange: onDurationChange
|
|
7203
|
-
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */
|
|
6869
|
+
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(SliderWithLabel_default, {
|
|
7204
6870
|
label: "Restskuld",
|
|
7205
6871
|
values: [residualCurrent],
|
|
7206
6872
|
domain: [residualMin, residualMax],
|
|
@@ -7208,12 +6874,12 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7208
6874
|
unit: "%",
|
|
7209
6875
|
loading,
|
|
7210
6876
|
onChange: onResidualChange
|
|
7211
|
-
})), /* @__PURE__ */
|
|
6877
|
+
})), /* @__PURE__ */ React57.createElement(RepeatSmall, null, /* @__PURE__ */ React57.createElement(RepeatTiny, null, /* @__PURE__ */ React57.createElement(Content_default, {
|
|
7212
6878
|
small: true
|
|
7213
|
-
}, /* @__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, {
|
|
7214
6880
|
onClick: onToggleExtend,
|
|
7215
6881
|
title: extend ? "Visa mindre information" : "Visa mer information"
|
|
7216
|
-
}, /* @__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, {
|
|
7217
6883
|
items: [
|
|
7218
6884
|
{
|
|
7219
6885
|
label: "R\xE4nta",
|
|
@@ -7242,7 +6908,7 @@ var LoanModal_default = LoanModal;
|
|
|
7242
6908
|
|
|
7243
6909
|
// src/components/FinancialOptions/loan.tsx
|
|
7244
6910
|
var Loan = ({ id, financialOption }) => {
|
|
7245
|
-
const [modal, setModal] =
|
|
6911
|
+
const [modal, setModal] = useState19(false);
|
|
7246
6912
|
const toggleModal = useCallback22(() => setModal(!modal), [modal]);
|
|
7247
6913
|
const { data } = useLoan_default(
|
|
7248
6914
|
id,
|
|
@@ -7255,100 +6921,100 @@ var Loan = ({ id, financialOption }) => {
|
|
|
7255
6921
|
const monthlyCost = data?.loan?.monthlyCost;
|
|
7256
6922
|
const logo = financialOption?.logotype || "https://placehold.it/67x10";
|
|
7257
6923
|
if (financialOption.loanAmount === void 0 || financialOption.loanAmount === null || interest === void 0 || duration === void 0 || monthlyCost === void 0 || interest === null || duration === null || monthlyCost === null) {
|
|
7258
|
-
return /* @__PURE__ */
|
|
6924
|
+
return /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
7259
6925
|
logo,
|
|
7260
6926
|
logoAlt: "Logotyp"
|
|
7261
|
-
}, /* @__PURE__ */
|
|
6927
|
+
}, /* @__PURE__ */ React58.createElement(OptionBoxHeading, null, "Laddar..."), /* @__PURE__ */ React58.createElement(OptionBoxContent, null, /* @__PURE__ */ React58.createElement("p", null, "Laddar...")));
|
|
7262
6928
|
}
|
|
7263
|
-
return /* @__PURE__ */
|
|
6929
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null, modal && /* @__PURE__ */ React58.createElement(LoanModal_default, {
|
|
7264
6930
|
id,
|
|
7265
6931
|
financialOption,
|
|
7266
6932
|
onClose: toggleModal
|
|
7267
|
-
}), /* @__PURE__ */
|
|
6933
|
+
}), /* @__PURE__ */ React58.createElement(OptionBox_default, {
|
|
7268
6934
|
logo,
|
|
7269
6935
|
logoAlt: "Logotyp"
|
|
7270
|
-
}, /* @__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, {
|
|
7271
6937
|
onClick: toggleModal
|
|
7272
6938
|
}, "L\xE4s mer"))))));
|
|
7273
6939
|
};
|
|
7274
6940
|
var loan_default = Loan;
|
|
7275
6941
|
|
|
7276
6942
|
// src/components/FinancialOptions/index.tsx
|
|
7277
|
-
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, {
|
|
7278
6944
|
key: index2
|
|
7279
|
-
}, financialOption.type === "leasing" && /* @__PURE__ */
|
|
6945
|
+
}, financialOption.type === "leasing" && /* @__PURE__ */ React59.createElement(leasing_default, {
|
|
7280
6946
|
financialOption
|
|
7281
|
-
}), financialOption.type === "loan" && /* @__PURE__ */
|
|
6947
|
+
}), financialOption.type === "loan" && /* @__PURE__ */ React59.createElement(loan_default, {
|
|
7282
6948
|
id,
|
|
7283
6949
|
financialOption
|
|
7284
6950
|
})))));
|
|
7285
6951
|
var FinancialOptions_default = FinancialOptions;
|
|
7286
6952
|
|
|
7287
6953
|
// src/components/InsuranceOptions/index.tsx
|
|
7288
|
-
import
|
|
6954
|
+
import React71 from "react";
|
|
7289
6955
|
|
|
7290
6956
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7291
|
-
import
|
|
6957
|
+
import React68, { useState as useState22, useCallback as useCallback25 } from "react";
|
|
7292
6958
|
|
|
7293
6959
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7294
|
-
import
|
|
6960
|
+
import React67, { useState as useState21, useCallback as useCallback24 } from "react";
|
|
7295
6961
|
|
|
7296
6962
|
// src/components/DetailBox/index.tsx
|
|
7297
|
-
import
|
|
6963
|
+
import React60 from "react";
|
|
7298
6964
|
|
|
7299
6965
|
// src/components/DetailBox/wrapper.tsx
|
|
7300
|
-
import
|
|
7301
|
-
var
|
|
6966
|
+
import styled43 from "styled-components";
|
|
6967
|
+
var Wrapper23 = styled43.article`
|
|
7302
6968
|
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
|
7303
6969
|
border-radius: 3px;
|
|
7304
6970
|
overflow: hidden;
|
|
7305
6971
|
`;
|
|
7306
|
-
var Main2 =
|
|
6972
|
+
var Main2 = styled43.div`
|
|
7307
6973
|
padding: ${size(2.5)};
|
|
7308
6974
|
`;
|
|
7309
|
-
var Heading6 =
|
|
6975
|
+
var Heading6 = styled43(H2).attrs(() => ({
|
|
7310
6976
|
as: "h1"
|
|
7311
6977
|
}))`
|
|
7312
6978
|
margin-bottom: 0;
|
|
7313
6979
|
`;
|
|
7314
|
-
var Description3 =
|
|
6980
|
+
var Description3 = styled43.div`
|
|
7315
6981
|
margin-top: ${size(1)};
|
|
7316
6982
|
`;
|
|
7317
|
-
var Footer3 =
|
|
6983
|
+
var Footer3 = styled43.div`
|
|
7318
6984
|
margin-top: ${size(1)};
|
|
7319
6985
|
color: red;
|
|
7320
6986
|
`;
|
|
7321
|
-
var Foldout =
|
|
6987
|
+
var Foldout = styled43.div`
|
|
7322
6988
|
background-color: ${(props) => props.theme.color.accent};
|
|
7323
6989
|
padding: ${size(2.5)};
|
|
7324
6990
|
`;
|
|
7325
6991
|
|
|
7326
6992
|
// src/components/DetailBox/index.tsx
|
|
7327
6993
|
var DetailBox = ({ heading, description, children }) => {
|
|
7328
|
-
const [extend, setExtend] =
|
|
7329
|
-
const onToggleExtend =
|
|
6994
|
+
const [extend, setExtend] = React60.useState(false);
|
|
6995
|
+
const onToggleExtend = React60.useCallback(() => setExtend(!extend), [extend]);
|
|
7330
6996
|
const extendBtnText = extend ? "Mindre information" : "Mer information";
|
|
7331
|
-
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, {
|
|
7332
6998
|
onClick: onToggleExtend
|
|
7333
|
-
}, /* @__PURE__ */
|
|
6999
|
+
}, /* @__PURE__ */ React60.createElement(ButtonContent, null, extendBtnText)))), extend && /* @__PURE__ */ React60.createElement(Foldout, null, children));
|
|
7334
7000
|
};
|
|
7335
7001
|
var DetailBox_default = DetailBox;
|
|
7336
7002
|
|
|
7337
7003
|
// src/components/ExtendInfo/index.tsx
|
|
7338
|
-
import
|
|
7004
|
+
import React61, { useState as useState20, useCallback as useCallback23 } from "react";
|
|
7339
7005
|
|
|
7340
7006
|
// src/components/ExtendInfo/wrapper.tsx
|
|
7341
|
-
import
|
|
7342
|
-
var
|
|
7343
|
-
var Header5 =
|
|
7007
|
+
import styled44 from "styled-components";
|
|
7008
|
+
var Wrapper24 = styled44.div``;
|
|
7009
|
+
var Header5 = styled44.div`
|
|
7344
7010
|
display: flex;
|
|
7345
7011
|
align-items: center;
|
|
7346
7012
|
`;
|
|
7347
|
-
var Title =
|
|
7348
|
-
var Info2 =
|
|
7013
|
+
var Title = styled44.div``;
|
|
7014
|
+
var Info2 = styled44.div`
|
|
7349
7015
|
margin-left: ${size(1)};
|
|
7350
7016
|
`;
|
|
7351
|
-
var InfoBtn =
|
|
7017
|
+
var InfoBtn = styled44(ButtonReset).attrs(() => ({
|
|
7352
7018
|
className: "wayke__theme wayke__color--primary-text"
|
|
7353
7019
|
}))`
|
|
7354
7020
|
position: relative;
|
|
@@ -7386,7 +7052,7 @@ var InfoBtn = styled45(ButtonReset).attrs(() => ({
|
|
|
7386
7052
|
transform: scale(0.95);
|
|
7387
7053
|
}
|
|
7388
7054
|
`;
|
|
7389
|
-
var Extend2 =
|
|
7055
|
+
var Extend2 = styled44.div`
|
|
7390
7056
|
padding-top: ${size(1)};
|
|
7391
7057
|
margin-top: ${size(1)};
|
|
7392
7058
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
@@ -7395,23 +7061,23 @@ var Extend2 = styled45.div`
|
|
|
7395
7061
|
|
|
7396
7062
|
// src/components/ExtendInfo/index.tsx
|
|
7397
7063
|
var ExtendInfo = ({ title, children }) => {
|
|
7398
|
-
const [extend, setExtend] =
|
|
7064
|
+
const [extend, setExtend] = useState20(false);
|
|
7399
7065
|
const onToggleExtend = useCallback23(() => setExtend(!extend), [extend]);
|
|
7400
|
-
return /* @__PURE__ */
|
|
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, {
|
|
7401
7067
|
onClick: onToggleExtend,
|
|
7402
7068
|
title: "Mer information"
|
|
7403
|
-
}, /* @__PURE__ */
|
|
7069
|
+
}, /* @__PURE__ */ React61.createElement(IconInfo, {
|
|
7404
7070
|
block: true
|
|
7405
|
-
})))), extend && /* @__PURE__ */
|
|
7071
|
+
})))), extend && /* @__PURE__ */ React61.createElement(Extend2, null, children));
|
|
7406
7072
|
};
|
|
7407
7073
|
var ExtendInfo_default = ExtendInfo;
|
|
7408
7074
|
|
|
7409
7075
|
// src/components/InputLabel/index.tsx
|
|
7410
|
-
import
|
|
7076
|
+
import React62 from "react";
|
|
7411
7077
|
|
|
7412
7078
|
// src/components/InputLabel/wrapper.tsx
|
|
7413
|
-
import
|
|
7414
|
-
var
|
|
7079
|
+
import styled45 from "styled-components";
|
|
7080
|
+
var Wrapper25 = styled45.label.attrs(() => ({
|
|
7415
7081
|
className: "wayke__theme wayke__font--bold"
|
|
7416
7082
|
}))`
|
|
7417
7083
|
margin-bottom: ${size(0.5)};
|
|
@@ -7419,24 +7085,24 @@ var Wrapper26 = styled46.label.attrs(() => ({
|
|
|
7419
7085
|
`;
|
|
7420
7086
|
|
|
7421
7087
|
// src/components/InputLabel/index.tsx
|
|
7422
|
-
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */
|
|
7088
|
+
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */ React62.createElement(Wrapper25, {
|
|
7423
7089
|
htmlFor
|
|
7424
7090
|
}, children);
|
|
7425
7091
|
var InputLabel_default = InputLabel;
|
|
7426
7092
|
|
|
7427
7093
|
// src/components/InputText/index.tsx
|
|
7428
|
-
import
|
|
7094
|
+
import React63 from "react";
|
|
7429
7095
|
|
|
7430
7096
|
// src/components/InputText/wrapper.tsx
|
|
7431
|
-
import
|
|
7432
|
-
var
|
|
7097
|
+
import styled46 from "styled-components";
|
|
7098
|
+
var Wrapper26 = styled46.div`
|
|
7433
7099
|
position: relative;
|
|
7434
7100
|
display: flex;
|
|
7435
7101
|
align-items: stretch;
|
|
7436
7102
|
background-color: ${(props) => props.theme.color.accent};
|
|
7437
7103
|
border-radius: 3px;
|
|
7438
7104
|
`;
|
|
7439
|
-
var Input2 =
|
|
7105
|
+
var Input2 = styled46.input.attrs(() => ({
|
|
7440
7106
|
type: "text",
|
|
7441
7107
|
className: "wayke__theme wayke__font--regular"
|
|
7442
7108
|
}))`
|
|
@@ -7483,7 +7149,7 @@ var Input2 = styled47.input.attrs(() => ({
|
|
|
7483
7149
|
`;
|
|
7484
7150
|
|
|
7485
7151
|
// src/components/InputText/index.tsx
|
|
7486
|
-
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, {
|
|
7487
7153
|
placeholder,
|
|
7488
7154
|
value,
|
|
7489
7155
|
id,
|
|
@@ -7494,12 +7160,12 @@ var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @
|
|
|
7494
7160
|
var InputText_default = InputText;
|
|
7495
7161
|
|
|
7496
7162
|
// src/components/InputCheckbox/index.tsx
|
|
7497
|
-
import * as
|
|
7163
|
+
import * as React65 from "react";
|
|
7498
7164
|
|
|
7499
7165
|
// src/components/InputCheckbox/wrapper.tsx
|
|
7500
|
-
import * as
|
|
7501
|
-
import
|
|
7502
|
-
var Label9 =
|
|
7166
|
+
import * as React64 from "react";
|
|
7167
|
+
import styled47, { css as css14 } from "styled-components";
|
|
7168
|
+
var Label9 = styled47.label.attrs(() => ({
|
|
7503
7169
|
className: "wayke__theme wayke__color--primary-text"
|
|
7504
7170
|
}))`
|
|
7505
7171
|
position: relative;
|
|
@@ -7529,7 +7195,7 @@ var Label9 = styled48.label.attrs(() => ({
|
|
|
7529
7195
|
margin-top: -2px;
|
|
7530
7196
|
}
|
|
7531
7197
|
`;
|
|
7532
|
-
var
|
|
7198
|
+
var Wrapper27 = styled47((props) => /* @__PURE__ */ React64.createElement("div", {
|
|
7533
7199
|
...props
|
|
7534
7200
|
})).attrs(({ type, checked }) => ({
|
|
7535
7201
|
role: type || "checkbox",
|
|
@@ -7545,7 +7211,7 @@ var Wrapper28 = styled48((props) => /* @__PURE__ */ React67.createElement("div",
|
|
|
7545
7211
|
}
|
|
7546
7212
|
`}
|
|
7547
7213
|
`;
|
|
7548
|
-
var Input3 =
|
|
7214
|
+
var Input3 = styled47((props) => /* @__PURE__ */ React64.createElement("input", {
|
|
7549
7215
|
...props,
|
|
7550
7216
|
className: `${props.checked ? "checked" : void 0} ${props.className}`
|
|
7551
7217
|
})).attrs(({ type, checked }) => ({
|
|
@@ -7576,23 +7242,23 @@ var Input3 = styled48((props) => /* @__PURE__ */ React67.createElement("input",
|
|
|
7576
7242
|
}
|
|
7577
7243
|
}
|
|
7578
7244
|
`;
|
|
7579
|
-
var LabelText =
|
|
7245
|
+
var LabelText = styled47.div`
|
|
7580
7246
|
color: ${(props) => props.theme.color.textDark};
|
|
7581
7247
|
`;
|
|
7582
7248
|
|
|
7583
7249
|
// src/components/InputSelect/index.tsx
|
|
7584
|
-
import
|
|
7250
|
+
import React66 from "react";
|
|
7585
7251
|
|
|
7586
7252
|
// src/components/InputSelect/wrapper.tsx
|
|
7587
|
-
import
|
|
7253
|
+
import styled48 from "styled-components";
|
|
7588
7254
|
var iconSize2 = "0.875rem";
|
|
7589
7255
|
var selectPadding = size(2);
|
|
7590
|
-
var
|
|
7256
|
+
var Wrapper28 = styled48.div`
|
|
7591
7257
|
position: relative;
|
|
7592
7258
|
background-color: ${(props) => props.theme.color.accent};
|
|
7593
7259
|
border-radius: 3px;
|
|
7594
7260
|
`;
|
|
7595
|
-
var Select2 =
|
|
7261
|
+
var Select2 = styled48.select.attrs(() => ({
|
|
7596
7262
|
className: "wayke__theme wayke__font--regular"
|
|
7597
7263
|
}))`
|
|
7598
7264
|
position: relative;
|
|
@@ -7626,10 +7292,10 @@ var Select2 = styled49.select.attrs(() => ({
|
|
|
7626
7292
|
border: 0;
|
|
7627
7293
|
}
|
|
7628
7294
|
`;
|
|
7629
|
-
var Option2 =
|
|
7295
|
+
var Option2 = styled48.option`
|
|
7630
7296
|
color: ${(props) => props.theme.color.textDark};
|
|
7631
7297
|
`;
|
|
7632
|
-
var Icon5 =
|
|
7298
|
+
var Icon5 = styled48.div`
|
|
7633
7299
|
position: absolute;
|
|
7634
7300
|
top: 50%;
|
|
7635
7301
|
right: ${selectPadding};
|
|
@@ -7638,29 +7304,29 @@ var Icon5 = styled49.div`
|
|
|
7638
7304
|
`;
|
|
7639
7305
|
|
|
7640
7306
|
// src/components/InputSelect/index.tsx
|
|
7641
|
-
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, {
|
|
7642
7308
|
value,
|
|
7643
7309
|
onChange,
|
|
7644
7310
|
title,
|
|
7645
7311
|
"aria-label": title
|
|
7646
|
-
}, options?.map((option) => /* @__PURE__ */
|
|
7312
|
+
}, options?.map((option) => /* @__PURE__ */ React66.createElement(Option2, {
|
|
7647
7313
|
key: option.value,
|
|
7648
7314
|
value: option.value
|
|
7649
|
-
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */
|
|
7315
|
+
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */ React66.createElement(Icon5, null, /* @__PURE__ */ React66.createElement(IconChevronDown, {
|
|
7650
7316
|
block: true
|
|
7651
7317
|
})));
|
|
7652
7318
|
var InputSelect_default = InputSelect;
|
|
7653
7319
|
|
|
7654
7320
|
// src/components/InputGroup/index.tsx
|
|
7655
|
-
import
|
|
7656
|
-
var InputGroup =
|
|
7321
|
+
import styled49 from "styled-components";
|
|
7322
|
+
var InputGroup = styled49.div`
|
|
7657
7323
|
${(props) => props.theme.breakpoint.Sm} {
|
|
7658
7324
|
display: flex;
|
|
7659
7325
|
align-items: flex-start;
|
|
7660
7326
|
margin: ${size(-0.5)};
|
|
7661
7327
|
}
|
|
7662
7328
|
`;
|
|
7663
|
-
var InputGroupColumn =
|
|
7329
|
+
var InputGroupColumn = styled49.div`
|
|
7664
7330
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
7665
7331
|
& + & {
|
|
7666
7332
|
margin-top: ${size(1)};
|
|
@@ -7674,12 +7340,12 @@ var InputGroupColumn = styled50.div`
|
|
|
7674
7340
|
`;
|
|
7675
7341
|
|
|
7676
7342
|
// src/components/ColumnRow/index.tsx
|
|
7677
|
-
import
|
|
7678
|
-
var ColumnRow =
|
|
7343
|
+
import styled50 from "styled-components";
|
|
7344
|
+
var ColumnRow = styled50.div`
|
|
7679
7345
|
display: flex;
|
|
7680
7346
|
align-items: flex-start;
|
|
7681
7347
|
`;
|
|
7682
|
-
var ColumnRowItem =
|
|
7348
|
+
var ColumnRowItem = styled50.div`
|
|
7683
7349
|
flex: 1 1 auto;
|
|
7684
7350
|
|
|
7685
7351
|
:last-child:not(:only-child) {
|
|
@@ -7754,11 +7420,11 @@ var ssnIsValid = (s) => s ? /^\d{2,4}\d{2}\d{2}\-?\d{4}$/.test(s) : false;
|
|
|
7754
7420
|
|
|
7755
7421
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7756
7422
|
var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
7757
|
-
const [form, setForm] =
|
|
7423
|
+
const [form, setForm] = useState21({
|
|
7758
7424
|
ssn: "",
|
|
7759
7425
|
drivingDistance: "BETWEEN0AND1000" /* Between0And1000 */
|
|
7760
7426
|
});
|
|
7761
|
-
const [payload, setPayload] =
|
|
7427
|
+
const [payload, setPayload] = useState21();
|
|
7762
7428
|
const { loading, data, error } = useInsurance_default(
|
|
7763
7429
|
id,
|
|
7764
7430
|
branch?.id ? branch?.id : void 0,
|
|
@@ -7792,105 +7458,105 @@ var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
|
7792
7458
|
{ value: "BETWEEN2000AND2500" /* Between2000And2500 */, displayName: "2000 - 2500" },
|
|
7793
7459
|
{ value: "OVER2500" /* Over2500 */, displayName: "2500+" }
|
|
7794
7460
|
];
|
|
7795
|
-
return /* @__PURE__ */
|
|
7461
|
+
return /* @__PURE__ */ React67.createElement(Modal_default, {
|
|
7796
7462
|
title: "F\xF6rs\xE4kring",
|
|
7797
7463
|
onClose
|
|
7798
|
-
}, (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, {
|
|
7799
7465
|
logo: insuranceOptions.logotype,
|
|
7800
7466
|
alt: insuranceOptions.name || "Logotyp",
|
|
7801
7467
|
wide: true
|
|
7802
|
-
})))), /* @__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, {
|
|
7803
7469
|
htmlFor: "input-insurance-personalnumber"
|
|
7804
|
-
}, "Personnummer"), /* @__PURE__ */
|
|
7470
|
+
}, "Personnummer"), /* @__PURE__ */ React67.createElement(InputText_default, {
|
|
7805
7471
|
placeholder: "\xC5\xC5\xC5\xC5MMDD-XXXX",
|
|
7806
7472
|
label: "Personnummer",
|
|
7807
7473
|
value: form.ssn,
|
|
7808
7474
|
onChange: onChangeSsn,
|
|
7809
7475
|
onKeyDown,
|
|
7810
7476
|
id: "input-insurance-personalnumber"
|
|
7811
|
-
})), /* @__PURE__ */
|
|
7477
|
+
})), /* @__PURE__ */ React67.createElement(InputGroupColumn, null, /* @__PURE__ */ React67.createElement(InputLabel_default, {
|
|
7812
7478
|
htmlFor: "input-insurance-mileage"
|
|
7813
|
-
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */
|
|
7479
|
+
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */ React67.createElement(InputSelect_default, {
|
|
7814
7480
|
value: form.drivingDistance,
|
|
7815
7481
|
onChange: onChangeDrivingDistance,
|
|
7816
7482
|
options,
|
|
7817
7483
|
unit: "mil",
|
|
7818
7484
|
title: "Uppskattad k\xF6rstr\xE4cka per \xE5r"
|
|
7819
|
-
})))), /* @__PURE__ */
|
|
7485
|
+
})))), /* @__PURE__ */ React67.createElement(RepeatTiny, null, /* @__PURE__ */ React67.createElement(ButtonPrimary, {
|
|
7820
7486
|
fullWidth: true,
|
|
7821
7487
|
disabled: !ssnIsValid(form.ssn) || loading,
|
|
7822
7488
|
onClick: onShowInsurances
|
|
7823
|
-
}, /* @__PURE__ */
|
|
7489
|
+
}, /* @__PURE__ */ React67.createElement(ButtonContent, null, "Visa f\xF6rs\xE4kringar")))), false, /* @__PURE__ */ React67.createElement(RepeatSmall, null, /* @__PURE__ */ React67.createElement(Content_default, {
|
|
7824
7490
|
small: true
|
|
7825
|
-
}, /* @__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, {
|
|
7826
7492
|
severity: "error",
|
|
7827
7493
|
icon: true,
|
|
7828
7494
|
heading: "Ett fel har intr\xE4ffat"
|
|
7829
|
-
}, "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, {
|
|
7830
7496
|
key: insurance.name
|
|
7831
|
-
}, /* @__PURE__ */
|
|
7497
|
+
}, /* @__PURE__ */ React67.createElement(DetailBox_default, {
|
|
7832
7498
|
heading: `${numberSeparator(insurance.price)} ${insurance.unit}`,
|
|
7833
7499
|
description: insurance.name
|
|
7834
|
-
}, /* @__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, {
|
|
7835
7501
|
as: "a",
|
|
7836
7502
|
href: insurance.url || "",
|
|
7837
7503
|
target: "_blank",
|
|
7838
7504
|
rel: "noopener noreferrer nofollow"
|
|
7839
|
-
}, "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, {
|
|
7840
7506
|
key: item.name || ""
|
|
7841
|
-
}, /* @__PURE__ */
|
|
7507
|
+
}, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
7842
7508
|
title: item.name || ""
|
|
7843
|
-
}, 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, {
|
|
7844
7510
|
key: addon.title || ""
|
|
7845
|
-
}, /* @__PURE__ */
|
|
7511
|
+
}, /* @__PURE__ */ React67.createElement(ColumnRow, null, /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(ExtendInfo_default, {
|
|
7846
7512
|
title: addon.title || ""
|
|
7847
|
-
}, addon.description)), /* @__PURE__ */
|
|
7513
|
+
}, addon.description)), /* @__PURE__ */ React67.createElement(ColumnRowItem, null, /* @__PURE__ */ React67.createElement(UtilityTextBold, null, "+", addon.price, " ", addon.unit))))))))))));
|
|
7848
7514
|
};
|
|
7849
7515
|
var InsuranceModal_default = InsuranceModal;
|
|
7850
7516
|
|
|
7851
7517
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7852
7518
|
var Insurance = ({ id, branch, insuranceOptions }) => {
|
|
7853
|
-
const [modal, setModal] =
|
|
7519
|
+
const [modal, setModal] = useState22(false);
|
|
7854
7520
|
const toggleModal = useCallback25(() => setModal(!modal), [modal]);
|
|
7855
7521
|
if (!insuranceOptions.length) {
|
|
7856
7522
|
return null;
|
|
7857
7523
|
}
|
|
7858
|
-
return /* @__PURE__ */
|
|
7524
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, modal && /* @__PURE__ */ React68.createElement(InsuranceModal_default, {
|
|
7859
7525
|
id,
|
|
7860
7526
|
branch,
|
|
7861
7527
|
onClose: toggleModal,
|
|
7862
7528
|
insuranceOptions: insuranceOptions[0]
|
|
7863
|
-
}), /* @__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, {
|
|
7864
7530
|
key: `${insuranceOption.url}-${index2}`,
|
|
7865
7531
|
logo: insuranceOption.logotype || void 0,
|
|
7866
7532
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7867
|
-
}, /* @__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, {
|
|
7868
7534
|
onClick: toggleModal
|
|
7869
7535
|
}, "Mer information")))))))));
|
|
7870
7536
|
};
|
|
7871
7537
|
var Insurance_default = Insurance;
|
|
7872
7538
|
|
|
7873
7539
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7874
|
-
import
|
|
7540
|
+
import React70, { useState as useState23, useCallback as useCallback26 } from "react";
|
|
7875
7541
|
import { marked as marked2 } from "marked";
|
|
7876
7542
|
|
|
7877
7543
|
// src/components/InsuranceOptions/InsuranceFreeModal.tsx
|
|
7878
|
-
import
|
|
7544
|
+
import React69 from "react";
|
|
7879
7545
|
import { marked } from "marked";
|
|
7880
7546
|
var InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
|
|
7881
|
-
return /* @__PURE__ */
|
|
7547
|
+
return /* @__PURE__ */ React69.createElement(Modal_default, {
|
|
7882
7548
|
title: insuranceOptions?.insuranceHeader ?? "F\xF6rs\xE4kring",
|
|
7883
7549
|
onClose
|
|
7884
|
-
}, insuranceOptions?.longDescription && /* @__PURE__ */
|
|
7550
|
+
}, insuranceOptions?.longDescription && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(Content_default, {
|
|
7885
7551
|
dangerouslySetInnerHTML: {
|
|
7886
7552
|
__html: marked(insuranceOptions.longDescription)
|
|
7887
7553
|
}
|
|
7888
|
-
})), insuranceOptions?.url && /* @__PURE__ */
|
|
7554
|
+
})), insuranceOptions?.url && /* @__PURE__ */ React69.createElement(Repeat, null, /* @__PURE__ */ React69.createElement(ButtonInline, {
|
|
7889
7555
|
as: "a",
|
|
7890
7556
|
href: insuranceOptions.url,
|
|
7891
7557
|
target: "_blank",
|
|
7892
7558
|
rel: "noopener noreferrer"
|
|
7893
|
-
}, "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, {
|
|
7894
7560
|
logo: insuranceOptions.logotype,
|
|
7895
7561
|
alt: insuranceOptions.name || "Logotyp",
|
|
7896
7562
|
wide: true
|
|
@@ -7900,23 +7566,23 @@ var InsuranceFreeModal_default = InsuranceFreeModal;
|
|
|
7900
7566
|
|
|
7901
7567
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7902
7568
|
var Insurance2 = ({ insuranceOptions }) => {
|
|
7903
|
-
const [modal, setModal] =
|
|
7569
|
+
const [modal, setModal] = useState23(false);
|
|
7904
7570
|
const toggleModal = useCallback26(() => setModal(!modal), [modal]);
|
|
7905
7571
|
if (!insuranceOptions.length) {
|
|
7906
7572
|
return null;
|
|
7907
7573
|
}
|
|
7908
|
-
return /* @__PURE__ */
|
|
7574
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, modal && /* @__PURE__ */ React70.createElement(InsuranceFreeModal_default, {
|
|
7909
7575
|
onClose: toggleModal,
|
|
7910
7576
|
insuranceOptions: insuranceOptions[0]
|
|
7911
|
-
}), /* @__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, {
|
|
7912
7578
|
key: `${insuranceOption.url}-${index2}`,
|
|
7913
7579
|
logo: insuranceOption.logotype || void 0,
|
|
7914
7580
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7915
|
-
}, insuranceOption.description && /* @__PURE__ */
|
|
7581
|
+
}, insuranceOption.description && /* @__PURE__ */ React70.createElement(Content_default, {
|
|
7916
7582
|
dangerouslySetInnerHTML: {
|
|
7917
7583
|
__html: marked2(insuranceOption.description)
|
|
7918
7584
|
}
|
|
7919
|
-
}), /* @__PURE__ */
|
|
7585
|
+
}), /* @__PURE__ */ React70.createElement(OptionBoxContent, null, /* @__PURE__ */ React70.createElement("p", null, /* @__PURE__ */ React70.createElement(ButtonInline, {
|
|
7920
7586
|
onClick: toggleModal
|
|
7921
7587
|
}, "Mer information")))))))));
|
|
7922
7588
|
};
|
|
@@ -7929,12 +7595,12 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7929
7595
|
}
|
|
7930
7596
|
if (insuranceOptions.length > 0) {
|
|
7931
7597
|
if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
|
|
7932
|
-
return /* @__PURE__ */
|
|
7598
|
+
return /* @__PURE__ */ React71.createElement(Insurance_default, {
|
|
7933
7599
|
id,
|
|
7934
7600
|
branch,
|
|
7935
7601
|
insuranceOptions
|
|
7936
7602
|
});
|
|
7937
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ React71.createElement(InsuranceFree_default, {
|
|
7938
7604
|
insuranceOptions
|
|
7939
7605
|
});
|
|
7940
7606
|
}
|
|
@@ -7943,22 +7609,22 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7943
7609
|
var InsuranceOptions_default = InsuranceOptions;
|
|
7944
7610
|
|
|
7945
7611
|
// src/layouts/searchItem/ManufacturerPackagesOption.tsx
|
|
7946
|
-
import
|
|
7612
|
+
import React72 from "react";
|
|
7947
7613
|
import { marked as marked3 } from "marked";
|
|
7948
7614
|
var ManufacturerPackageOption = ({ packageOption }) => {
|
|
7949
7615
|
if (!packageOption) {
|
|
7950
7616
|
return null;
|
|
7951
7617
|
}
|
|
7952
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ React72.createElement(ProductPageMainSection, null, /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(H2, {
|
|
7953
7619
|
noMargin: true
|
|
7954
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
7620
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(Content_default, {
|
|
7955
7621
|
dangerouslySetInnerHTML: { __html: marked3(packageOption.description) }
|
|
7956
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
7622
|
+
})), packageOption.link?.url && /* @__PURE__ */ React72.createElement(Repeat, null, /* @__PURE__ */ React72.createElement(ButtonInline, {
|
|
7957
7623
|
as: "a",
|
|
7958
7624
|
href: packageOption.link.url,
|
|
7959
7625
|
target: "_blank",
|
|
7960
7626
|
rel: "noopener noreferrer"
|
|
7961
|
-
}, 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, {
|
|
7962
7628
|
logo: packageOption.image,
|
|
7963
7629
|
alt: "Logotyp",
|
|
7964
7630
|
wide: true
|
|
@@ -7967,17 +7633,17 @@ var ManufacturerPackageOption = ({ packageOption }) => {
|
|
|
7967
7633
|
var ManufacturerPackagesOption_default = ManufacturerPackageOption;
|
|
7968
7634
|
|
|
7969
7635
|
// src/layouts/searchItem/CheckList.tsx
|
|
7970
|
-
import
|
|
7636
|
+
import React79, { useState as useState27, useCallback as useCallback31, useEffect as useEffect13 } from "react";
|
|
7971
7637
|
|
|
7972
7638
|
// src/components/ActionList/index.tsx
|
|
7973
|
-
import
|
|
7639
|
+
import React74, { useCallback as useCallback28 } from "react";
|
|
7974
7640
|
|
|
7975
7641
|
// src/components/ActionList/toggle-item.tsx
|
|
7976
|
-
import
|
|
7642
|
+
import React73, { useState as useState24, useCallback as useCallback27 } from "react";
|
|
7977
7643
|
var initialValue = {};
|
|
7978
7644
|
var getInitialValue = (title) => title && !!initialValue[title];
|
|
7979
7645
|
var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
7980
|
-
const [visible, setVisible] =
|
|
7646
|
+
const [visible, setVisible] = useState24(() => getInitialValue(type));
|
|
7981
7647
|
const _onClickValue = useCallback27(() => {
|
|
7982
7648
|
if (onClickValue) {
|
|
7983
7649
|
onClickValue();
|
|
@@ -7993,17 +7659,17 @@ var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
7993
7659
|
}
|
|
7994
7660
|
}, [visible]);
|
|
7995
7661
|
const visibleTitle = type === "tel" ? "Ring" : type === "mailto" ? "Skicka ett mail till" : "";
|
|
7996
|
-
return /* @__PURE__ */
|
|
7662
|
+
return /* @__PURE__ */ React73.createElement(RepeatTiny, null, visible ? /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
7997
7663
|
onClick: _onClickValue,
|
|
7998
7664
|
as: "a",
|
|
7999
7665
|
href: `${type}:${value}`,
|
|
8000
7666
|
title: `${visibleTitle} ${value}`,
|
|
8001
7667
|
fullWidth: true
|
|
8002
|
-
}, /* @__PURE__ */
|
|
7668
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, value)) : /* @__PURE__ */ React73.createElement(ButtonSecondary, {
|
|
8003
7669
|
onClick,
|
|
8004
7670
|
title,
|
|
8005
7671
|
fullWidth: true
|
|
8006
|
-
}, /* @__PURE__ */
|
|
7672
|
+
}, /* @__PURE__ */ React73.createElement(ButtonContent, null, title)));
|
|
8007
7673
|
};
|
|
8008
7674
|
var toggle_item_default = ToggleItem;
|
|
8009
7675
|
|
|
@@ -8122,12 +7788,12 @@ var ActionList = ({ contact, branch }) => {
|
|
|
8122
7788
|
if (!email && !phonenumber) {
|
|
8123
7789
|
return null;
|
|
8124
7790
|
}
|
|
8125
|
-
return /* @__PURE__ */
|
|
7791
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, null, email && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
8126
7792
|
onClickVisible: onClickMailVisible,
|
|
8127
7793
|
title: "Visa mailadress",
|
|
8128
7794
|
value: email,
|
|
8129
7795
|
type: "mailto"
|
|
8130
|
-
}), phonenumber && /* @__PURE__ */
|
|
7796
|
+
}), phonenumber && /* @__PURE__ */ React74.createElement(toggle_item_default, {
|
|
8131
7797
|
title: "Visa telefonnummer",
|
|
8132
7798
|
value: formatPhonenumber(phonenumber),
|
|
8133
7799
|
type: "tel",
|
|
@@ -8138,16 +7804,16 @@ var ActionList = ({ contact, branch }) => {
|
|
|
8138
7804
|
var ActionList_default = ActionList;
|
|
8139
7805
|
|
|
8140
7806
|
// src/components/CheckMarkList/index.tsx
|
|
8141
|
-
import
|
|
7807
|
+
import React75 from "react";
|
|
8142
7808
|
|
|
8143
7809
|
// src/components/CheckMarkList/wrapper.tsx
|
|
8144
|
-
import
|
|
8145
|
-
var List9 =
|
|
7810
|
+
import styled51 from "styled-components";
|
|
7811
|
+
var List9 = styled51.ul`
|
|
8146
7812
|
list-style: none;
|
|
8147
7813
|
padding: 0;
|
|
8148
7814
|
margin: 0;
|
|
8149
7815
|
`;
|
|
8150
|
-
var Item11 =
|
|
7816
|
+
var Item11 = styled51.li`
|
|
8151
7817
|
position: relative;
|
|
8152
7818
|
font-size: 0.875rem;
|
|
8153
7819
|
|
|
@@ -8155,7 +7821,7 @@ var Item11 = styled52.li`
|
|
|
8155
7821
|
margin-top: ${size(0.5)};
|
|
8156
7822
|
}
|
|
8157
7823
|
`;
|
|
8158
|
-
var Icon6 =
|
|
7824
|
+
var Icon6 = styled51.div.attrs(() => ({
|
|
8159
7825
|
className: "wayke__theme wayke__color--primary-text"
|
|
8160
7826
|
}))`
|
|
8161
7827
|
position: absolute;
|
|
@@ -8163,52 +7829,52 @@ var Icon6 = styled52.div.attrs(() => ({
|
|
|
8163
7829
|
top: 4px; // Magic number
|
|
8164
7830
|
font-size: 0.875em;
|
|
8165
7831
|
`;
|
|
8166
|
-
var Label10 =
|
|
7832
|
+
var Label10 = styled51.div`
|
|
8167
7833
|
padding-left: calc(1em + ${size(1)});
|
|
8168
7834
|
`;
|
|
8169
7835
|
|
|
8170
7836
|
// src/components/CheckMarkList/index.tsx
|
|
8171
|
-
var CheckMarkListItem = ({ children }) => /* @__PURE__ */
|
|
7837
|
+
var CheckMarkListItem = ({ children }) => /* @__PURE__ */ React75.createElement(Item11, null, /* @__PURE__ */ React75.createElement(Icon6, null, /* @__PURE__ */ React75.createElement(IconCheck, {
|
|
8172
7838
|
block: true
|
|
8173
|
-
})), /* @__PURE__ */
|
|
8174
|
-
var CheckMarkList = ({ children }) => /* @__PURE__ */
|
|
7839
|
+
})), /* @__PURE__ */ React75.createElement(Label10, null, children));
|
|
7840
|
+
var CheckMarkList = ({ children }) => /* @__PURE__ */ React75.createElement(List9, null, children);
|
|
8175
7841
|
var CheckMarkList_default = CheckMarkList;
|
|
8176
7842
|
|
|
8177
7843
|
// src/components/SwitchBar/index.tsx
|
|
8178
|
-
import
|
|
7844
|
+
import React76, { useState as useState25, useCallback as useCallback29 } from "react";
|
|
8179
7845
|
|
|
8180
7846
|
// src/components/SwitchBar/wrapper.tsx
|
|
8181
|
-
import
|
|
8182
|
-
var
|
|
7847
|
+
import styled52 from "styled-components";
|
|
7848
|
+
var Wrapper29 = styled52.div`
|
|
8183
7849
|
padding: ${size(1.5)} ${size(2)};
|
|
8184
7850
|
background-color: ${(props) => props.theme.color.accentDark};
|
|
8185
7851
|
border-radius: 3px;
|
|
8186
7852
|
font-size: 0.875rem;
|
|
8187
7853
|
`;
|
|
8188
|
-
var Header6 =
|
|
7854
|
+
var Header6 = styled52.div`
|
|
8189
7855
|
display: flex;
|
|
8190
7856
|
align-items: center;
|
|
8191
7857
|
`;
|
|
8192
|
-
var Body5 =
|
|
7858
|
+
var Body5 = styled52.div`
|
|
8193
7859
|
font-size: 0.875rem;
|
|
8194
7860
|
margin-top: ${size(1)};
|
|
8195
7861
|
`;
|
|
8196
|
-
var Info3 =
|
|
7862
|
+
var Info3 = styled52.div`
|
|
8197
7863
|
flex: 1 1 auto;
|
|
8198
7864
|
display: flex;
|
|
8199
7865
|
align-items: center;
|
|
8200
7866
|
`;
|
|
8201
|
-
var Action7 =
|
|
7867
|
+
var Action7 = styled52.div`
|
|
8202
7868
|
flex-shrink: 0;
|
|
8203
7869
|
padding-left: ${size(1.5)};
|
|
8204
7870
|
font-size: 0.875rem;
|
|
8205
7871
|
`;
|
|
8206
|
-
var InfoContent =
|
|
7872
|
+
var InfoContent = styled52.div`
|
|
8207
7873
|
& + & {
|
|
8208
7874
|
margin-left: ${size(0.75)};
|
|
8209
7875
|
}
|
|
8210
7876
|
`;
|
|
8211
|
-
var InfoBtn2 =
|
|
7877
|
+
var InfoBtn2 = styled52(ButtonReset).attrs(() => ({
|
|
8212
7878
|
className: "wayke__theme wayke__color--primary-text"
|
|
8213
7879
|
}))`
|
|
8214
7880
|
position: relative;
|
|
@@ -8242,7 +7908,7 @@ var InfoBtn2 = styled53(ButtonReset).attrs(() => ({
|
|
|
8242
7908
|
transform: scale(0.95);
|
|
8243
7909
|
}
|
|
8244
7910
|
`;
|
|
8245
|
-
var Title2 =
|
|
7911
|
+
var Title2 = styled52.div.attrs(() => ({
|
|
8246
7912
|
className: "wayke__theme wayke__font--bold"
|
|
8247
7913
|
}))`
|
|
8248
7914
|
font-size: 1rem;
|
|
@@ -8250,17 +7916,17 @@ var Title2 = styled53.div.attrs(() => ({
|
|
|
8250
7916
|
|
|
8251
7917
|
// src/components/SwitchBar/index.tsx
|
|
8252
7918
|
var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
8253
|
-
const [info, setInfo] =
|
|
7919
|
+
const [info, setInfo] = useState25(false);
|
|
8254
7920
|
const onToggleInfo = useCallback29(() => setInfo(!info), [info]);
|
|
8255
|
-
return /* @__PURE__ */
|
|
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, {
|
|
8256
7922
|
onClick: onToggleInfo,
|
|
8257
7923
|
title: "Mer information"
|
|
8258
|
-
}, /* @__PURE__ */
|
|
7924
|
+
}, /* @__PURE__ */ React76.createElement(IconInfo, {
|
|
8259
7925
|
block: true
|
|
8260
|
-
})))), actionTitle && /* @__PURE__ */
|
|
7926
|
+
})))), actionTitle && /* @__PURE__ */ React76.createElement(Action7, null, /* @__PURE__ */ React76.createElement(ButtonInline, {
|
|
8261
7927
|
onClick,
|
|
8262
7928
|
title: actionTitle
|
|
8263
|
-
}, actionTitle))), body && /* @__PURE__ */
|
|
7929
|
+
}, actionTitle))), body && /* @__PURE__ */ React76.createElement(Body5, null, body)), info && /* @__PURE__ */ React76.createElement(Modal_default, {
|
|
8264
7930
|
title,
|
|
8265
7931
|
onClose: onToggleInfo
|
|
8266
7932
|
}, children));
|
|
@@ -8268,7 +7934,7 @@ var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
|
8268
7934
|
var SwitchBar_default = SwitchBar;
|
|
8269
7935
|
|
|
8270
7936
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8271
|
-
import
|
|
7937
|
+
import React77, { useState as useState26, useCallback as useCallback30, useContext as useContext3 } from "react";
|
|
8272
7938
|
|
|
8273
7939
|
// src/State/CentralStorage/CentralStorageContext.ts
|
|
8274
7940
|
import { createContext as createContext3 } from "react";
|
|
@@ -8280,7 +7946,7 @@ var CentralStorageContext = createContext3({
|
|
|
8280
7946
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8281
7947
|
var BranchModal = ({ loading, connections, onClose }) => {
|
|
8282
7948
|
const { centralStorageId, setCentralStorageId } = useContext3(CentralStorageContext);
|
|
8283
|
-
const [localValue, setLocalValue] =
|
|
7949
|
+
const [localValue, setLocalValue] = useState26(centralStorageId);
|
|
8284
7950
|
const onConfirm = useCallback30((id) => {
|
|
8285
7951
|
if (id) {
|
|
8286
7952
|
setCentralStorageId(id);
|
|
@@ -8293,10 +7959,10 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
8293
7959
|
if (!localValue) {
|
|
8294
7960
|
return null;
|
|
8295
7961
|
}
|
|
8296
|
-
return /* @__PURE__ */
|
|
7962
|
+
return /* @__PURE__ */ React77.createElement(Modal_default, {
|
|
8297
7963
|
title: "Byt anl\xE4ggning",
|
|
8298
7964
|
onClose
|
|
8299
|
-
}, /* @__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, {
|
|
8300
7966
|
value: localValue,
|
|
8301
7967
|
onChange,
|
|
8302
7968
|
options: connections?.map((x) => ({
|
|
@@ -8304,27 +7970,27 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
8304
7970
|
displayName: x.name
|
|
8305
7971
|
})),
|
|
8306
7972
|
title: "V\xE4lj anl\xE4ggning"
|
|
8307
|
-
}))), /* @__PURE__ */
|
|
7973
|
+
}))), /* @__PURE__ */ React77.createElement(Repeat, null, /* @__PURE__ */ React77.createElement(ButtonPrimary, {
|
|
8308
7974
|
disabled: loading,
|
|
8309
7975
|
fullWidth: true,
|
|
8310
7976
|
onClick: () => onConfirm(localValue)
|
|
8311
|
-
}, /* @__PURE__ */
|
|
7977
|
+
}, /* @__PURE__ */ React77.createElement(ButtonContent, null, "V\xE4lj"))));
|
|
8312
7978
|
};
|
|
8313
7979
|
var BranchModal_default = BranchModal;
|
|
8314
7980
|
|
|
8315
7981
|
// src/layouts/searchItem/PackageOptionModal.tsx
|
|
8316
|
-
import
|
|
7982
|
+
import React78 from "react";
|
|
8317
7983
|
import { marked as marked4 } from "marked";
|
|
8318
|
-
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */
|
|
7984
|
+
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */ React78.createElement(Modal_default, {
|
|
8319
7985
|
title: packageOption.title || "",
|
|
8320
7986
|
onClose
|
|
8321
|
-
}, packageOption.image && /* @__PURE__ */
|
|
7987
|
+
}, packageOption.image && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(LogoBox_default, {
|
|
8322
7988
|
logo: packageOption.image,
|
|
8323
7989
|
alt: packageOption.title || void 0,
|
|
8324
7990
|
wide: true
|
|
8325
|
-
})), packageOption.description && /* @__PURE__ */
|
|
7991
|
+
})), packageOption.description && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(Content_default, {
|
|
8326
7992
|
dangerouslySetInnerHTML: { __html: marked4(packageOption.description) }
|
|
8327
|
-
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */
|
|
7993
|
+
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */ React78.createElement(Repeat, null, /* @__PURE__ */ React78.createElement(ButtonInline, {
|
|
8328
7994
|
as: "a",
|
|
8329
7995
|
href: packageOption.link.href,
|
|
8330
7996
|
target: "_blank",
|
|
@@ -8342,90 +8008,90 @@ var CheckList = ({
|
|
|
8342
8008
|
toggleEcomModal,
|
|
8343
8009
|
loadingCentralStorageVehicle
|
|
8344
8010
|
}) => {
|
|
8345
|
-
const [modalBranch, setModalBranch] =
|
|
8011
|
+
const [modalBranch, setModalBranch] = useState27(false);
|
|
8346
8012
|
const openModalBranch = useCallback31(() => setModalBranch(true), []);
|
|
8347
8013
|
const closeModalBranch = useCallback31(() => setModalBranch(false), []);
|
|
8348
|
-
const [modal, setModal] =
|
|
8014
|
+
const [modal, setModal] = useState27();
|
|
8349
8015
|
const onOpen = useCallback31((nextModal) => setModal(nextModal), []);
|
|
8350
8016
|
const onClose = useCallback31(() => setModal(void 0), []);
|
|
8351
|
-
|
|
8017
|
+
useEffect13(() => {
|
|
8352
8018
|
if ((branch || contact) && modalBranch) {
|
|
8353
8019
|
setModalBranch(false);
|
|
8354
8020
|
}
|
|
8355
8021
|
}, [branch, contact]);
|
|
8356
8022
|
const packageOption = manufacturer?.packageOption;
|
|
8357
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ React79.createElement(React79.Fragment, null, modalBranch && /* @__PURE__ */ React79.createElement(BranchModal_default, {
|
|
8358
8024
|
loading: loadingCentralStorageVehicle,
|
|
8359
8025
|
connections: branch?.connections,
|
|
8360
8026
|
onClose: closeModalBranch
|
|
8361
|
-
}), modal && /* @__PURE__ */
|
|
8027
|
+
}), modal && /* @__PURE__ */ React79.createElement(PackageOptionModal_default, {
|
|
8362
8028
|
packageOption: modal,
|
|
8363
8029
|
onClose
|
|
8364
|
-
}), /* @__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, {
|
|
8365
8031
|
onClick: () => onOpen({
|
|
8366
8032
|
title: packageOption?.title,
|
|
8367
8033
|
image: packageOption?.image,
|
|
8368
8034
|
description: packageOption?.description,
|
|
8369
8035
|
link: packageOption?.link
|
|
8370
8036
|
})
|
|
8371
|
-
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */
|
|
8037
|
+
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */ React79.createElement(CheckMarkListItem, {
|
|
8372
8038
|
key: packageOption2.title || index2
|
|
8373
|
-
}, /* @__PURE__ */
|
|
8039
|
+
}, /* @__PURE__ */ React79.createElement(React79.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
8374
8040
|
onClick: () => onOpen({
|
|
8375
8041
|
title: packageOption2?.title,
|
|
8376
8042
|
image: packageOption2?.image,
|
|
8377
8043
|
description: packageOption2?.description,
|
|
8378
8044
|
link: packageOption2?.link
|
|
8379
8045
|
})
|
|
8380
|
-
}, 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, {
|
|
8381
8047
|
disabled: !!ecommerce.reserved,
|
|
8382
8048
|
fullWidth: true,
|
|
8383
8049
|
onClick: toggleEcomModal
|
|
8384
|
-
}, /* @__PURE__ */
|
|
8050
|
+
}, /* @__PURE__ */ React79.createElement(ButtonContent, null, "K\xF6p bilen online"))), ecommerce?.reserved && /* @__PURE__ */ React79.createElement(RepeatTiny, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
8385
8051
|
title: "Bilen \xE4r reserverad",
|
|
8386
8052
|
body: "Denna bil \xE4r reserverad av en annan k\xF6pare."
|
|
8387
|
-
}, /* @__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, {
|
|
8388
8054
|
branch,
|
|
8389
8055
|
contact
|
|
8390
|
-
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */
|
|
8056
|
+
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */ React79.createElement(Repeat, null, /* @__PURE__ */ React79.createElement(SwitchBar_default, {
|
|
8391
8057
|
title: "Centrallagerbil",
|
|
8392
8058
|
actionTitle: "Byt anl\xE4ggning",
|
|
8393
8059
|
onClick: openModalBranch
|
|
8394
|
-
}, /* @__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.")))));
|
|
8395
8061
|
};
|
|
8396
8062
|
var CheckList_default = CheckList;
|
|
8397
8063
|
|
|
8398
8064
|
// src/layouts/searchItem/Related.tsx
|
|
8399
|
-
import
|
|
8065
|
+
import React81, { useCallback as useCallback32 } from "react";
|
|
8400
8066
|
|
|
8401
8067
|
// src/components/SectionHeader/index.tsx
|
|
8402
|
-
import
|
|
8068
|
+
import React80 from "react";
|
|
8403
8069
|
|
|
8404
8070
|
// src/components/SectionHeader/wrapper.tsx
|
|
8405
|
-
import
|
|
8406
|
-
var
|
|
8071
|
+
import styled53 from "styled-components";
|
|
8072
|
+
var Wrapper30 = styled53.div`
|
|
8407
8073
|
display: flex;
|
|
8408
8074
|
align-items: center;
|
|
8409
8075
|
`;
|
|
8410
|
-
var Heading7 =
|
|
8076
|
+
var Heading7 = styled53.div`
|
|
8411
8077
|
flex: 1 1 auto;
|
|
8412
8078
|
`;
|
|
8413
|
-
var Action8 =
|
|
8079
|
+
var Action8 = styled53.div`
|
|
8414
8080
|
flex-shrink: 0;
|
|
8415
8081
|
padding-left: ${size(2)};
|
|
8416
8082
|
`;
|
|
8417
8083
|
|
|
8418
8084
|
// src/components/SectionHeader/index.tsx
|
|
8419
|
-
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, {
|
|
8420
8086
|
as: "a",
|
|
8421
8087
|
href: "#",
|
|
8422
8088
|
onClick
|
|
8423
|
-
}, /* @__PURE__ */
|
|
8089
|
+
}, /* @__PURE__ */ React80.createElement(ButtonContent, null, actionTitle))));
|
|
8424
8090
|
var SectionHeader_default = SectionHeader;
|
|
8425
8091
|
|
|
8426
8092
|
// src/components/OverflowGrid/index.tsx
|
|
8427
|
-
import
|
|
8428
|
-
var OverflowGrid =
|
|
8093
|
+
import styled54 from "styled-components";
|
|
8094
|
+
var OverflowGrid = styled54.div`
|
|
8429
8095
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
8430
8096
|
${Wrapper} & {
|
|
8431
8097
|
margin-left: ${size(-3)};
|
|
@@ -8440,7 +8106,7 @@ var OverflowGrid = styled55.div`
|
|
|
8440
8106
|
}
|
|
8441
8107
|
}
|
|
8442
8108
|
`;
|
|
8443
|
-
var OverflowGridList =
|
|
8109
|
+
var OverflowGridList = styled54.ul`
|
|
8444
8110
|
display: flex;
|
|
8445
8111
|
align-items: flex-start;
|
|
8446
8112
|
list-style: none;
|
|
@@ -8472,7 +8138,7 @@ var OverflowGridList = styled55.ul`
|
|
|
8472
8138
|
}
|
|
8473
8139
|
}
|
|
8474
8140
|
`;
|
|
8475
|
-
var OverflowGridItem =
|
|
8141
|
+
var OverflowGridItem = styled54.li`
|
|
8476
8142
|
flex: 1 0 auto;
|
|
8477
8143
|
width: calc(100% - ${size(2)});
|
|
8478
8144
|
max-width: calc(100% - ${size(2)});
|
|
@@ -8490,7 +8156,7 @@ var OverflowGridItem = styled55.li`
|
|
|
8490
8156
|
`;
|
|
8491
8157
|
|
|
8492
8158
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8493
|
-
import { useContext as useContext4, useEffect as
|
|
8159
|
+
import { useContext as useContext4, useEffect as useEffect14 } from "react";
|
|
8494
8160
|
|
|
8495
8161
|
// src/State/RelatedSearch/RelatedSearchContext.ts
|
|
8496
8162
|
import { createContext as createContext4 } from "react";
|
|
@@ -8506,7 +8172,7 @@ var RelatedSearchContext = createContext4({
|
|
|
8506
8172
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8507
8173
|
var useRelatedSearch = (id) => {
|
|
8508
8174
|
const data = useContext4(RelatedSearchContext);
|
|
8509
|
-
|
|
8175
|
+
useEffect14(() => {
|
|
8510
8176
|
const searchParams = new URLSearchParams();
|
|
8511
8177
|
searchParams.set("hits", "3");
|
|
8512
8178
|
if (data.moreLikeThisUrl && id) {
|
|
@@ -8542,30 +8208,30 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8542
8208
|
return null;
|
|
8543
8209
|
}
|
|
8544
8210
|
if (loading) {
|
|
8545
|
-
return /* @__PURE__ */
|
|
8211
|
+
return /* @__PURE__ */ React81.createElement(Loader_default, null);
|
|
8546
8212
|
}
|
|
8547
|
-
return /* @__PURE__ */
|
|
8213
|
+
return /* @__PURE__ */ React81.createElement(PageSection, {
|
|
8548
8214
|
accent: true,
|
|
8549
8215
|
large: true,
|
|
8550
8216
|
className: "wayke__theme wayke__color--accent-bg"
|
|
8551
|
-
}, /* @__PURE__ */
|
|
8217
|
+
}, /* @__PURE__ */ React81.createElement(Container_default, null, moreLikeThisUrl ? /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
8552
8218
|
onClick: () => {
|
|
8553
8219
|
}
|
|
8554
|
-
}, /* @__PURE__ */
|
|
8220
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
8555
8221
|
noMargin: true
|
|
8556
|
-
}, "Relaterade fordon"))) : /* @__PURE__ */
|
|
8222
|
+
}, "Relaterade fordon"))) : /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(SectionHeader_default, {
|
|
8557
8223
|
onClick: () => {
|
|
8558
8224
|
},
|
|
8559
8225
|
actionTitle: "Visa alla"
|
|
8560
|
-
}, /* @__PURE__ */
|
|
8226
|
+
}, /* @__PURE__ */ React81.createElement(H2, {
|
|
8561
8227
|
noMargin: true
|
|
8562
|
-
}, "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) => {
|
|
8563
8229
|
const prefix = pathRoute ? `/${pathRoute}` : "/";
|
|
8564
8230
|
const r = regexPathGuid(pathRoute);
|
|
8565
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}`;
|
|
8566
|
-
return /* @__PURE__ */
|
|
8232
|
+
return /* @__PURE__ */ React81.createElement(OverflowGridItem, {
|
|
8567
8233
|
key: document2._id
|
|
8568
|
-
}, /* @__PURE__ */
|
|
8234
|
+
}, /* @__PURE__ */ React81.createElement(ProductCard_default, {
|
|
8569
8235
|
id: document2._id,
|
|
8570
8236
|
onClick: onItemClicked,
|
|
8571
8237
|
title: document2.title,
|
|
@@ -8595,24 +8261,24 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8595
8261
|
var Related_default = Related;
|
|
8596
8262
|
|
|
8597
8263
|
// src/layouts/searchItem/PackageOptions.tsx
|
|
8598
|
-
import
|
|
8264
|
+
import React82 from "react";
|
|
8599
8265
|
import { marked as marked5 } from "marked";
|
|
8600
8266
|
var PackageOptions = ({ packageOptions }) => {
|
|
8601
8267
|
if (!packageOptions) {
|
|
8602
8268
|
return null;
|
|
8603
8269
|
}
|
|
8604
|
-
return /* @__PURE__ */
|
|
8270
|
+
return /* @__PURE__ */ React82.createElement(React82.Fragment, null, packageOptions.map((packageOption, index2) => /* @__PURE__ */ React82.createElement(ProductPageMainSection, {
|
|
8605
8271
|
key: packageOption.title || index2
|
|
8606
|
-
}, /* @__PURE__ */
|
|
8272
|
+
}, /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(H2, {
|
|
8607
8273
|
noMargin: true
|
|
8608
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
8274
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(Content_default, {
|
|
8609
8275
|
dangerouslySetInnerHTML: { __html: marked5(packageOption.description) }
|
|
8610
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
8276
|
+
})), packageOption.link?.url && /* @__PURE__ */ React82.createElement(Repeat, null, /* @__PURE__ */ React82.createElement(ButtonInline, {
|
|
8611
8277
|
as: "a",
|
|
8612
8278
|
href: packageOption.link.url,
|
|
8613
8279
|
target: "_blank",
|
|
8614
8280
|
rel: "noopener noreferrer"
|
|
8615
|
-
}, 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, {
|
|
8616
8282
|
logo: packageOption.image,
|
|
8617
8283
|
alt: "Logotyp",
|
|
8618
8284
|
wide: true
|
|
@@ -8621,31 +8287,31 @@ var PackageOptions = ({ packageOptions }) => {
|
|
|
8621
8287
|
var PackageOptions_default = PackageOptions;
|
|
8622
8288
|
|
|
8623
8289
|
// src/layouts/searchItem/Branch.tsx
|
|
8624
|
-
import
|
|
8290
|
+
import React87, { useState as useState30, useCallback as useCallback35, useEffect as useEffect15 } from "react";
|
|
8625
8291
|
|
|
8626
8292
|
// src/components/TableColumn/index.tsx
|
|
8627
|
-
import
|
|
8628
|
-
var TableColumn =
|
|
8293
|
+
import styled55 from "styled-components";
|
|
8294
|
+
var TableColumn = styled55.div`
|
|
8629
8295
|
line-height: 1.2;
|
|
8630
8296
|
`;
|
|
8631
|
-
var TableColumnRow =
|
|
8297
|
+
var TableColumnRow = styled55.div`
|
|
8632
8298
|
display: flex;
|
|
8633
8299
|
align-items: flex-start;
|
|
8634
8300
|
margin: ${size(-1)};
|
|
8635
8301
|
`;
|
|
8636
|
-
var TableColumnCell =
|
|
8302
|
+
var TableColumnCell = styled55.div`
|
|
8637
8303
|
flex: 1 0 50%;
|
|
8638
8304
|
padding: ${size(1)};
|
|
8639
8305
|
`;
|
|
8640
8306
|
|
|
8641
8307
|
// src/components/OpeningHours/index.tsx
|
|
8642
|
-
import
|
|
8308
|
+
import React84, { useMemo as useMemo4 } from "react";
|
|
8643
8309
|
|
|
8644
8310
|
// src/components/Badge/index.tsx
|
|
8645
|
-
import
|
|
8311
|
+
import React83 from "react";
|
|
8646
8312
|
|
|
8647
8313
|
// src/components/Badge/wrapper.tsx
|
|
8648
|
-
import
|
|
8314
|
+
import styled56 from "styled-components";
|
|
8649
8315
|
var getBg = (severity) => {
|
|
8650
8316
|
let bg = theme_default.color.textDark;
|
|
8651
8317
|
if (severity === "positive") {
|
|
@@ -8655,7 +8321,7 @@ var getBg = (severity) => {
|
|
|
8655
8321
|
}
|
|
8656
8322
|
return bg;
|
|
8657
8323
|
};
|
|
8658
|
-
var
|
|
8324
|
+
var Wrapper31 = styled56.div.attrs(() => ({
|
|
8659
8325
|
className: "wayke__theme wayke__font--bold"
|
|
8660
8326
|
}))`
|
|
8661
8327
|
display: inline-block;
|
|
@@ -8668,7 +8334,7 @@ var Wrapper32 = styled57.div.attrs(() => ({
|
|
|
8668
8334
|
`;
|
|
8669
8335
|
|
|
8670
8336
|
// src/components/Badge/index.tsx
|
|
8671
|
-
var Badge = ({ label, severity }) => /* @__PURE__ */
|
|
8337
|
+
var Badge = ({ label, severity }) => /* @__PURE__ */ React83.createElement(Wrapper31, {
|
|
8672
8338
|
severity
|
|
8673
8339
|
}, label);
|
|
8674
8340
|
var Badge_default = Badge;
|
|
@@ -8752,33 +8418,33 @@ var OpeningHours = ({ openingHours }) => {
|
|
|
8752
8418
|
if (!oh) {
|
|
8753
8419
|
return null;
|
|
8754
8420
|
}
|
|
8755
|
-
return /* @__PURE__ */
|
|
8421
|
+
return /* @__PURE__ */ React84.createElement(React84.Fragment, null, /* @__PURE__ */ React84.createElement(RepeatSmall, null, /* @__PURE__ */ React84.createElement(Badge_default, {
|
|
8756
8422
|
label: currentlyOpen ? "\xD6ppet" : "St\xE4ngt",
|
|
8757
8423
|
severity: currentlyOpen ? "positive" : "negative"
|
|
8758
|
-
})), /* @__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, {
|
|
8759
8425
|
key: o.titleFrom
|
|
8760
|
-
}, /* @__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"))))));
|
|
8761
8427
|
};
|
|
8762
8428
|
var OpeningHours_default = OpeningHours;
|
|
8763
8429
|
|
|
8764
8430
|
// src/components/PhoneNumber/index.tsx
|
|
8765
|
-
import
|
|
8431
|
+
import React85, { useState as useState28, useCallback as useCallback33 } from "react";
|
|
8766
8432
|
var PhoneNumber = ({ phoneNumber }) => {
|
|
8767
|
-
const [visible, setVisible] =
|
|
8433
|
+
const [visible, setVisible] = useState28(false);
|
|
8768
8434
|
const onClick = useCallback33(() => !visible && setVisible(true), [visible]);
|
|
8769
|
-
return /* @__PURE__ */
|
|
8435
|
+
return /* @__PURE__ */ React85.createElement(TableColumnRow, null, /* @__PURE__ */ React85.createElement(TableColumnCell, null, "Telefonnummer"), /* @__PURE__ */ React85.createElement(TableColumnCell, null, visible ? /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
8770
8436
|
as: "a",
|
|
8771
8437
|
href: `tel:${phoneNumber}`,
|
|
8772
8438
|
title: `Ring ${phoneNumber}`
|
|
8773
|
-
}, /* @__PURE__ */
|
|
8439
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, phoneNumber)) : /* @__PURE__ */ React85.createElement(ButtonInlineBold, {
|
|
8774
8440
|
onClick,
|
|
8775
8441
|
title: "Visa telefonnummer"
|
|
8776
|
-
}, /* @__PURE__ */
|
|
8442
|
+
}, /* @__PURE__ */ React85.createElement(ButtonContent, null, "Visa telefonnummer"))));
|
|
8777
8443
|
};
|
|
8778
8444
|
var PhoneNumber_default = PhoneNumber;
|
|
8779
8445
|
|
|
8780
8446
|
// src/components/Map/index.tsx
|
|
8781
|
-
import
|
|
8447
|
+
import React86, { useState as useState29, useCallback as useCallback34 } from "react";
|
|
8782
8448
|
|
|
8783
8449
|
// src/State/Settings/useSettings.ts
|
|
8784
8450
|
import { useContext as useContext5 } from "react";
|
|
@@ -8792,16 +8458,16 @@ var useSettings = () => useContext5(SettingsContext);
|
|
|
8792
8458
|
var useSettings_default = useSettings;
|
|
8793
8459
|
|
|
8794
8460
|
// src/components/Map/wrapper.tsx
|
|
8795
|
-
import
|
|
8796
|
-
var
|
|
8461
|
+
import styled57 from "styled-components";
|
|
8462
|
+
var Wrapper32 = styled57.a`
|
|
8797
8463
|
display: block;
|
|
8798
8464
|
`;
|
|
8799
|
-
var Image4 =
|
|
8465
|
+
var Image4 = styled57.img`
|
|
8800
8466
|
display: block;
|
|
8801
8467
|
width: 100%;
|
|
8802
8468
|
border-radius: 3px;
|
|
8803
8469
|
`;
|
|
8804
|
-
var Placeholder =
|
|
8470
|
+
var Placeholder = styled57.a`
|
|
8805
8471
|
display: block;
|
|
8806
8472
|
position: relative;
|
|
8807
8473
|
width: 100%;
|
|
@@ -8811,7 +8477,7 @@ var Placeholder = styled58.a`
|
|
|
8811
8477
|
border-radius: 3px;
|
|
8812
8478
|
color: ${(props) => props.theme.color.textDark};
|
|
8813
8479
|
`;
|
|
8814
|
-
var PlaceholderAction =
|
|
8480
|
+
var PlaceholderAction = styled57.div`
|
|
8815
8481
|
position: absolute;
|
|
8816
8482
|
top: 50%;
|
|
8817
8483
|
left: 50%;
|
|
@@ -8821,7 +8487,7 @@ var PlaceholderAction = styled58.div`
|
|
|
8821
8487
|
// src/components/Map/index.tsx
|
|
8822
8488
|
var StaticMap = ({ position }) => {
|
|
8823
8489
|
const { googleMapsApiKey, googleMapsMarker } = useSettings_default();
|
|
8824
|
-
const [visible, setVisible] =
|
|
8490
|
+
const [visible, setVisible] = useState29(false);
|
|
8825
8491
|
const onShowMap = useCallback34((e) => {
|
|
8826
8492
|
if (googleMapsApiKey) {
|
|
8827
8493
|
e.preventDefault();
|
|
@@ -8833,33 +8499,33 @@ var StaticMap = ({ position }) => {
|
|
|
8833
8499
|
}
|
|
8834
8500
|
const { latitude, longitude } = position;
|
|
8835
8501
|
if (visible && googleMapsApiKey) {
|
|
8836
|
-
return /* @__PURE__ */
|
|
8502
|
+
return /* @__PURE__ */ React86.createElement(Wrapper32, {
|
|
8837
8503
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8838
8504
|
title: "Visa p\xE5 Google Maps",
|
|
8839
8505
|
target: "_blank",
|
|
8840
8506
|
rel: "nofollow noopener noreferrer"
|
|
8841
|
-
}, /* @__PURE__ */
|
|
8507
|
+
}, /* @__PURE__ */ React86.createElement(Image4, {
|
|
8842
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}`,
|
|
8843
8509
|
alt: "Karta"
|
|
8844
8510
|
}));
|
|
8845
8511
|
}
|
|
8846
|
-
return /* @__PURE__ */
|
|
8512
|
+
return /* @__PURE__ */ React86.createElement(Placeholder, {
|
|
8847
8513
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8848
8514
|
target: "_blank",
|
|
8849
8515
|
rel: "noopener noreferrer nofollow",
|
|
8850
8516
|
onClick: onShowMap
|
|
8851
|
-
}, /* @__PURE__ */
|
|
8517
|
+
}, /* @__PURE__ */ React86.createElement(PlaceholderAction, null, /* @__PURE__ */ React86.createElement(ButtonSecondary, {
|
|
8852
8518
|
as: "div"
|
|
8853
|
-
}, /* @__PURE__ */
|
|
8519
|
+
}, /* @__PURE__ */ React86.createElement(ButtonContent, null, "Visa karta"))));
|
|
8854
8520
|
};
|
|
8855
8521
|
var Map_default = StaticMap;
|
|
8856
8522
|
|
|
8857
8523
|
// src/layouts/searchItem/Branch.tsx
|
|
8858
8524
|
var Branch2 = ({ branch, loading }) => {
|
|
8859
|
-
const [modal, setModal] =
|
|
8525
|
+
const [modal, setModal] = useState30(false);
|
|
8860
8526
|
const openModal = useCallback35(() => setModal(true), []);
|
|
8861
8527
|
const closeModal = useCallback35(() => setModal(false), []);
|
|
8862
|
-
|
|
8528
|
+
useEffect15(() => {
|
|
8863
8529
|
if (branch && modal) {
|
|
8864
8530
|
setModal(false);
|
|
8865
8531
|
}
|
|
@@ -8867,29 +8533,29 @@ var Branch2 = ({ branch, loading }) => {
|
|
|
8867
8533
|
if (!branch) {
|
|
8868
8534
|
return null;
|
|
8869
8535
|
}
|
|
8870
|
-
return /* @__PURE__ */
|
|
8536
|
+
return /* @__PURE__ */ React87.createElement(React87.Fragment, null, modal && /* @__PURE__ */ React87.createElement(BranchModal_default, {
|
|
8871
8537
|
loading,
|
|
8872
8538
|
connections: branch?.connections,
|
|
8873
8539
|
onClose: closeModal
|
|
8874
|
-
}), /* @__PURE__ */
|
|
8540
|
+
}), /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(H2, {
|
|
8875
8541
|
noMargin: true
|
|
8876
|
-
}, 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, {
|
|
8877
8543
|
position: branch?.location?.position
|
|
8878
|
-
})), (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, {
|
|
8879
8545
|
as: "span",
|
|
8880
8546
|
role: "button",
|
|
8881
8547
|
onClick: openModal,
|
|
8882
8548
|
inline: true
|
|
8883
|
-
}, "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, {
|
|
8884
8550
|
phoneNumber: formatPhonenumber(branch.contact.phonenumber)
|
|
8885
|
-
}))), branch?.openingHours && /* @__PURE__ */
|
|
8551
|
+
}))), branch?.openingHours && /* @__PURE__ */ React87.createElement(Repeat, null, /* @__PURE__ */ React87.createElement(OpeningHours_default, {
|
|
8886
8552
|
openingHours: branch.openingHours
|
|
8887
8553
|
})))));
|
|
8888
8554
|
};
|
|
8889
8555
|
var Branch_default = Branch2;
|
|
8890
8556
|
|
|
8891
8557
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
8892
|
-
import { useContext as useContext6, useEffect as
|
|
8558
|
+
import { useContext as useContext6, useEffect as useEffect16 } from "react";
|
|
8893
8559
|
|
|
8894
8560
|
// src/hooks/useSearchItemBranch.ts
|
|
8895
8561
|
import { useQuery as useQuery4 } from "@apollo/client";
|
|
@@ -9026,7 +8692,7 @@ var useCentralStorage = (vehicle) => {
|
|
|
9026
8692
|
const connections = vehicle?.branch?.connections;
|
|
9027
8693
|
const branchId = centralStorageId ? connections?.find((x) => x.id === centralStorageId)?.id : void 0;
|
|
9028
8694
|
const { data, loading } = useSearchItemBranch_default(vehicle?.id, branchId);
|
|
9029
|
-
|
|
8695
|
+
useEffect16(() => {
|
|
9030
8696
|
if ((connections?.length || 0) > 0) {
|
|
9031
8697
|
const match = centralStorageId ? connections?.find((x) => x.id === centralStorageId) : void 0;
|
|
9032
8698
|
if (!match) {
|
|
@@ -9045,23 +8711,23 @@ var useCentralStorage = (vehicle) => {
|
|
|
9045
8711
|
var useCentralStorage_default = useCentralStorage;
|
|
9046
8712
|
|
|
9047
8713
|
// src/layouts/searchItem/Page404.tsx
|
|
9048
|
-
import
|
|
9049
|
-
var Page404 = () => /* @__PURE__ */
|
|
8714
|
+
import React88 from "react";
|
|
8715
|
+
var Page404 = () => /* @__PURE__ */ React88.createElement(Page, null, /* @__PURE__ */ React88.createElement(PageSection, {
|
|
9050
8716
|
large: true
|
|
9051
|
-
}, /* @__PURE__ */
|
|
8717
|
+
}, /* @__PURE__ */ React88.createElement(Container_default, null, /* @__PURE__ */ React88.createElement(H1, {
|
|
9052
8718
|
noMargin: true
|
|
9053
8719
|
}, "404"))));
|
|
9054
8720
|
var Page404_default = Page404;
|
|
9055
8721
|
|
|
9056
8722
|
// src/layouts/searchItem/PageLoading.tsx
|
|
9057
|
-
import
|
|
9058
|
-
var PageLoading = () => /* @__PURE__ */
|
|
8723
|
+
import React89 from "react";
|
|
8724
|
+
var PageLoading = () => /* @__PURE__ */ React89.createElement(Page, null, /* @__PURE__ */ React89.createElement(PageSection, {
|
|
9059
8725
|
large: true
|
|
9060
|
-
}, /* @__PURE__ */
|
|
8726
|
+
}, /* @__PURE__ */ React89.createElement(Container_default, null, /* @__PURE__ */ React89.createElement(Loader_default, null))));
|
|
9061
8727
|
var PageLoading_default = PageLoading;
|
|
9062
8728
|
|
|
9063
8729
|
// src/layouts/searchItem/Property.tsx
|
|
9064
|
-
import
|
|
8730
|
+
import React92, { useCallback as useCallback37, useEffect as useEffect17, useMemo as useMemo5, useState as useState32 } from "react";
|
|
9065
8731
|
|
|
9066
8732
|
// src/utils/vehicle-properties/property-tree-creator.ts
|
|
9067
8733
|
var _PropertyTreeCreator = class {
|
|
@@ -9554,11 +9220,11 @@ var property_remover_default = (properties) => {
|
|
|
9554
9220
|
};
|
|
9555
9221
|
|
|
9556
9222
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9557
|
-
import
|
|
9223
|
+
import React90, { useState as useState31, useCallback as useCallback36 } from "react";
|
|
9558
9224
|
|
|
9559
9225
|
// src/components/TableList/index.tsx
|
|
9560
|
-
import
|
|
9561
|
-
var TableList =
|
|
9226
|
+
import styled58 from "styled-components";
|
|
9227
|
+
var TableList = styled58.ul`
|
|
9562
9228
|
list-style: none;
|
|
9563
9229
|
padding: 0;
|
|
9564
9230
|
margin: 0;
|
|
@@ -9566,7 +9232,7 @@ var TableList = styled59.ul`
|
|
|
9566
9232
|
border-bottom: 1px solid ${(props) => props.theme.color.border};
|
|
9567
9233
|
font-size: 0.875rem;
|
|
9568
9234
|
`;
|
|
9569
|
-
var TableListItem =
|
|
9235
|
+
var TableListItem = styled58.li`
|
|
9570
9236
|
display: flex;
|
|
9571
9237
|
align-items: center;
|
|
9572
9238
|
padding: ${size(1)} 0;
|
|
@@ -9575,30 +9241,30 @@ var TableListItem = styled59.li`
|
|
|
9575
9241
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
9576
9242
|
}
|
|
9577
9243
|
`;
|
|
9578
|
-
var TableListKey =
|
|
9244
|
+
var TableListKey = styled58.div`
|
|
9579
9245
|
flex: 1 1 auto;
|
|
9580
9246
|
`;
|
|
9581
|
-
var TableListValue =
|
|
9247
|
+
var TableListValue = styled58.div`
|
|
9582
9248
|
flex-shrink: 0;
|
|
9583
9249
|
padding-left: ${size(1)};
|
|
9584
9250
|
`;
|
|
9585
|
-
var TableListBooleanPos =
|
|
9251
|
+
var TableListBooleanPos = styled58.div`
|
|
9586
9252
|
color: ${(props) => props.theme.color.ui.positive};
|
|
9587
9253
|
`;
|
|
9588
|
-
var TableListBooleanNeg =
|
|
9254
|
+
var TableListBooleanNeg = styled58.div`
|
|
9589
9255
|
color: ${(props) => props.theme.color.ui.negative};
|
|
9590
9256
|
`;
|
|
9591
9257
|
|
|
9592
9258
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9593
9259
|
var formatValue = (value, unit) => {
|
|
9594
9260
|
if (typeof value === "boolean") {
|
|
9595
|
-
return value ? /* @__PURE__ */
|
|
9261
|
+
return value ? /* @__PURE__ */ React90.createElement(TableListBooleanPos, {
|
|
9596
9262
|
title: "Ja"
|
|
9597
|
-
}, /* @__PURE__ */
|
|
9263
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Ja"), /* @__PURE__ */ React90.createElement(IconCheck, {
|
|
9598
9264
|
block: true
|
|
9599
|
-
})) : /* @__PURE__ */
|
|
9265
|
+
})) : /* @__PURE__ */ React90.createElement(TableListBooleanNeg, {
|
|
9600
9266
|
title: "Nej"
|
|
9601
|
-
}, /* @__PURE__ */
|
|
9267
|
+
}, /* @__PURE__ */ React90.createElement(SrOnly, null, "Nej"), /* @__PURE__ */ React90.createElement(IconCancel, {
|
|
9602
9268
|
block: true
|
|
9603
9269
|
}));
|
|
9604
9270
|
}
|
|
@@ -9611,27 +9277,27 @@ var formatValue = (value, unit) => {
|
|
|
9611
9277
|
return value;
|
|
9612
9278
|
};
|
|
9613
9279
|
var MetadataItem = ({ name, hint, value, unit }) => {
|
|
9614
|
-
const [foldout, setFoldout] =
|
|
9280
|
+
const [foldout, setFoldout] = useState31(false);
|
|
9615
9281
|
const onToggleFoldout = useCallback36(() => setFoldout(!foldout), [foldout]);
|
|
9616
9282
|
const presentedValue = formatValue(value, unit);
|
|
9617
|
-
return /* @__PURE__ */
|
|
9283
|
+
return /* @__PURE__ */ React90.createElement(TableListItem, null, /* @__PURE__ */ React90.createElement(TableListKey, null, hint ? /* @__PURE__ */ React90.createElement(ButtonInline, {
|
|
9618
9284
|
onClick: onToggleFoldout,
|
|
9619
9285
|
title: `Mer information om ${name}`
|
|
9620
|
-
}, name) : name), /* @__PURE__ */
|
|
9286
|
+
}, name) : name), /* @__PURE__ */ React90.createElement(TableListValue, null, value !== void 0 ? presentedValue : "Uppgift saknas"), hint && foldout && /* @__PURE__ */ React90.createElement(Modal_default, {
|
|
9621
9287
|
title: name,
|
|
9622
9288
|
onClose: onToggleFoldout
|
|
9623
|
-
}, /* @__PURE__ */
|
|
9289
|
+
}, /* @__PURE__ */ React90.createElement(Content_default, {
|
|
9624
9290
|
dangerouslySetInnerHTML: { __html: hint }
|
|
9625
9291
|
})));
|
|
9626
9292
|
};
|
|
9627
9293
|
var MetadataItem_default = MetadataItem;
|
|
9628
9294
|
|
|
9629
9295
|
// src/components/Tabs/index.tsx
|
|
9630
|
-
import * as
|
|
9296
|
+
import * as React91 from "react";
|
|
9631
9297
|
|
|
9632
9298
|
// src/components/Tabs/wrapper.tsx
|
|
9633
|
-
import
|
|
9634
|
-
var
|
|
9299
|
+
import styled59, { css as css15 } from "styled-components";
|
|
9300
|
+
var Wrapper33 = styled59.div`
|
|
9635
9301
|
overflow: hidden;
|
|
9636
9302
|
margin-top: ${size(-1)};
|
|
9637
9303
|
margin-left: ${size(-1)};
|
|
@@ -9642,7 +9308,7 @@ var Wrapper34 = styled60.div`
|
|
|
9642
9308
|
margin-right: ${size(-2)};
|
|
9643
9309
|
}
|
|
9644
9310
|
`;
|
|
9645
|
-
var List10 =
|
|
9311
|
+
var List10 = styled59.ul`
|
|
9646
9312
|
list-style: none;
|
|
9647
9313
|
padding: 0;
|
|
9648
9314
|
margin: 0;
|
|
@@ -9656,12 +9322,12 @@ var List10 = styled60.ul`
|
|
|
9656
9322
|
padding-right: ${size(1)};
|
|
9657
9323
|
}
|
|
9658
9324
|
`;
|
|
9659
|
-
var Item12 =
|
|
9325
|
+
var Item12 = styled59.li`
|
|
9660
9326
|
display: inline-block;
|
|
9661
9327
|
vertical-align: bottom;
|
|
9662
9328
|
font-size: 1rem;
|
|
9663
9329
|
`;
|
|
9664
|
-
var Action9 =
|
|
9330
|
+
var Action9 = styled59(ButtonReset).attrs(() => ({
|
|
9665
9331
|
role: "tab",
|
|
9666
9332
|
className: "wayke__theme wayke__font--bold"
|
|
9667
9333
|
}))`
|
|
@@ -9697,9 +9363,9 @@ var Action9 = styled60(ButtonReset).attrs(() => ({
|
|
|
9697
9363
|
`;
|
|
9698
9364
|
|
|
9699
9365
|
// src/components/Tabs/index.tsx
|
|
9700
|
-
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, {
|
|
9701
9367
|
key: tab.name
|
|
9702
|
-
}, /* @__PURE__ */
|
|
9368
|
+
}, /* @__PURE__ */ React91.createElement(Action9, {
|
|
9703
9369
|
title: tab.displayName,
|
|
9704
9370
|
onClick: onClick ? () => onClick(tab.name) : void 0,
|
|
9705
9371
|
active: tab.name === active ? "true" : void 0
|
|
@@ -9707,30 +9373,30 @@ var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React94.createElement(
|
|
|
9707
9373
|
var Tabs_default = Tabs;
|
|
9708
9374
|
|
|
9709
9375
|
// src/layouts/searchItem/Property.tsx
|
|
9710
|
-
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */
|
|
9376
|
+
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(H5, {
|
|
9711
9377
|
as: "h3"
|
|
9712
|
-
}, name), /* @__PURE__ */
|
|
9378
|
+
}, name), /* @__PURE__ */ React92.createElement(TableList, null, !!properties.length && properties.map((property, index2) => /* @__PURE__ */ React92.createElement(MetadataItem_default, {
|
|
9713
9379
|
name: property.name,
|
|
9714
9380
|
hint: property.hint,
|
|
9715
9381
|
value: property.value,
|
|
9716
9382
|
unit: property.unit,
|
|
9717
9383
|
key: `${property.name}-${index2}`
|
|
9718
9384
|
}))));
|
|
9719
|
-
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */
|
|
9385
|
+
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */ React92.createElement("div", {
|
|
9720
9386
|
className: "tab-section"
|
|
9721
|
-
}, !!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, {
|
|
9722
9388
|
name: property.name,
|
|
9723
9389
|
hint: property.hint,
|
|
9724
9390
|
value: property.value,
|
|
9725
9391
|
unit: property.unit,
|
|
9726
9392
|
key: `${property.name}-${index2}`
|
|
9727
|
-
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */
|
|
9393
|
+
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */ React92.createElement(MetadataSubCategory, {
|
|
9728
9394
|
name: subCategory.name,
|
|
9729
9395
|
properties: subCategory.properties,
|
|
9730
9396
|
key: `${subCategory.name}-${index2}`
|
|
9731
9397
|
})));
|
|
9732
9398
|
var PropertySet = ({ propertySet, vehicleData }) => {
|
|
9733
|
-
const [activeCategoryId, setActiveCategoryId] =
|
|
9399
|
+
const [activeCategoryId, setActiveCategoryId] = useState32(-1);
|
|
9734
9400
|
const mappedProperties = useMemo5(() => {
|
|
9735
9401
|
if (!propertySet) {
|
|
9736
9402
|
return void 0;
|
|
@@ -9742,7 +9408,7 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9742
9408
|
property_tree_sorter_default(tree);
|
|
9743
9409
|
return tree;
|
|
9744
9410
|
}, [propertySet]);
|
|
9745
|
-
|
|
9411
|
+
useEffect17(() => {
|
|
9746
9412
|
const categories = mappedProperties?.categories?.length !== void 0 ? mappedProperties?.categories : void 0;
|
|
9747
9413
|
if (activeCategoryId < 0 && categories !== void 0 && categories.length > 0) {
|
|
9748
9414
|
setActiveCategoryId(categories[0].id);
|
|
@@ -9752,14 +9418,14 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9752
9418
|
const activeCategory = mappedProperties?.categories?.find(
|
|
9753
9419
|
(category) => category.id === activeCategoryId
|
|
9754
9420
|
);
|
|
9755
|
-
return /* @__PURE__ */
|
|
9421
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(Tabs_default, {
|
|
9756
9422
|
tabs: mappedProperties?.categories?.map((category) => ({
|
|
9757
9423
|
name: `${category.id}`,
|
|
9758
9424
|
displayName: category.name
|
|
9759
9425
|
})) || [],
|
|
9760
9426
|
active: `${activeCategoryId}`,
|
|
9761
9427
|
onClick: onTab
|
|
9762
|
-
})), activeCategory && /* @__PURE__ */
|
|
9428
|
+
})), activeCategory && /* @__PURE__ */ React92.createElement(Repeat, null, /* @__PURE__ */ React92.createElement(MetadataCategory, {
|
|
9763
9429
|
properties: activeCategory.properties,
|
|
9764
9430
|
subCategories: activeCategory.subCategories
|
|
9765
9431
|
})));
|
|
@@ -9767,11 +9433,11 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9767
9433
|
var Property_default = PropertySet;
|
|
9768
9434
|
|
|
9769
9435
|
// src/components/Pdf/index.tsx
|
|
9770
|
-
import
|
|
9436
|
+
import React93 from "react";
|
|
9771
9437
|
|
|
9772
9438
|
// src/components/Pdf/wrapper.tsx
|
|
9773
|
-
import
|
|
9774
|
-
var PdfListItem =
|
|
9439
|
+
import styled60 from "styled-components";
|
|
9440
|
+
var PdfListItem = styled60.li.attrs(() => ({
|
|
9775
9441
|
className: "wayke__theme wayke__color--primary-text"
|
|
9776
9442
|
}))`
|
|
9777
9443
|
flex: 0 0 50%;
|
|
@@ -9781,14 +9447,14 @@ var PdfListItem = styled61.li.attrs(() => ({
|
|
|
9781
9447
|
flex: 0 0 100%;
|
|
9782
9448
|
}
|
|
9783
9449
|
`;
|
|
9784
|
-
var PdfContainer =
|
|
9450
|
+
var PdfContainer = styled60.ul`
|
|
9785
9451
|
list-style: none;
|
|
9786
9452
|
padding: 0;
|
|
9787
9453
|
display: flex;
|
|
9788
9454
|
flex-wrap: wrap;
|
|
9789
9455
|
margin: ${size(-1)};
|
|
9790
9456
|
`;
|
|
9791
|
-
var PdfLink =
|
|
9457
|
+
var PdfLink = styled60.a.attrs(() => ({
|
|
9792
9458
|
className: "wayke__theme wayke__color--primary-text wayke__font--bold"
|
|
9793
9459
|
}))`
|
|
9794
9460
|
text-decoration: none;
|
|
@@ -9802,19 +9468,19 @@ var PdfLink = styled61.a.attrs(() => ({
|
|
|
9802
9468
|
height: 100%;
|
|
9803
9469
|
}
|
|
9804
9470
|
`;
|
|
9805
|
-
var PdfTitle =
|
|
9471
|
+
var PdfTitle = styled60.div`
|
|
9806
9472
|
color: ${(props) => props.theme.color.textDark};
|
|
9807
9473
|
`;
|
|
9808
|
-
var PdfSubtitle =
|
|
9474
|
+
var PdfSubtitle = styled60.div`
|
|
9809
9475
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
9810
9476
|
`;
|
|
9811
|
-
var PdfColumn =
|
|
9477
|
+
var PdfColumn = styled60.div`
|
|
9812
9478
|
flex 0 0 auto;
|
|
9813
9479
|
&:first-child {
|
|
9814
9480
|
flex: 1 1 auto;
|
|
9815
9481
|
}
|
|
9816
9482
|
`;
|
|
9817
|
-
var PdfListInner =
|
|
9483
|
+
var PdfListInner = styled60.div`
|
|
9818
9484
|
position: relative;
|
|
9819
9485
|
border: 1px solid ${(props) => props.theme.color.border};
|
|
9820
9486
|
padding: ${size(1.5)};
|
|
@@ -9826,12 +9492,12 @@ var PdfListInner = styled61.div`
|
|
|
9826
9492
|
`;
|
|
9827
9493
|
|
|
9828
9494
|
// src/components/Pdf/index.tsx
|
|
9829
|
-
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, {
|
|
9830
9496
|
href: document2.url,
|
|
9831
9497
|
rel: "noopener noreferrer nofollow",
|
|
9832
9498
|
target: "_blank"
|
|
9833
9499
|
}, "\xD6ppna"))));
|
|
9834
|
-
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */
|
|
9500
|
+
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */ React93.createElement(PdfContainer, null, documents.map((document2, i) => /* @__PURE__ */ React93.createElement(PdfDownloadItem, {
|
|
9835
9501
|
key: `${document2.url}-${i}`,
|
|
9836
9502
|
document: document2
|
|
9837
9503
|
})));
|
|
@@ -9851,7 +9517,7 @@ var WaykeSearchItem = ({
|
|
|
9851
9517
|
const ecomContext = useRef4();
|
|
9852
9518
|
const { loading, data: result } = useSearchItem_default(id);
|
|
9853
9519
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } = useCentralStorage_default(result?.vehicle);
|
|
9854
|
-
|
|
9520
|
+
useEffect18(() => {
|
|
9855
9521
|
if (ecomSettings) {
|
|
9856
9522
|
ecomContext.current = new WaykeEcomWeb({
|
|
9857
9523
|
id,
|
|
@@ -9873,12 +9539,12 @@ var WaykeSearchItem = ({
|
|
|
9873
9539
|
}
|
|
9874
9540
|
};
|
|
9875
9541
|
}, []);
|
|
9876
|
-
|
|
9542
|
+
useEffect18(() => {
|
|
9877
9543
|
if (!disableResetScrollOnInit) {
|
|
9878
9544
|
window.scrollTo(0, 0);
|
|
9879
9545
|
}
|
|
9880
9546
|
}, []);
|
|
9881
|
-
|
|
9547
|
+
useEffect18(() => {
|
|
9882
9548
|
if (result?.vehicle?.data && modifyDocumentTitleItem) {
|
|
9883
9549
|
const { vehicle: vehicle2 } = result;
|
|
9884
9550
|
const { registrationNumber } = vehicle2.data;
|
|
@@ -9891,10 +9557,10 @@ var WaykeSearchItem = ({
|
|
|
9891
9557
|
);
|
|
9892
9558
|
const onShowMoreOptionsClick = useCallback38(() => pubsub_default.publish("OptionsClick"), []);
|
|
9893
9559
|
if (loading) {
|
|
9894
|
-
return /* @__PURE__ */
|
|
9560
|
+
return /* @__PURE__ */ React94.createElement(PageLoading_default, null);
|
|
9895
9561
|
}
|
|
9896
9562
|
if (!result?.vehicle?.data) {
|
|
9897
|
-
return /* @__PURE__ */
|
|
9563
|
+
return /* @__PURE__ */ React94.createElement(Page404_default, null);
|
|
9898
9564
|
}
|
|
9899
9565
|
const { vehicle } = result;
|
|
9900
9566
|
const contact = centralStorageVehicle?.contact;
|
|
@@ -9928,40 +9594,40 @@ var WaykeSearchItem = ({
|
|
|
9928
9594
|
if (fuelType) {
|
|
9929
9595
|
uspList.push({ title: fuelType });
|
|
9930
9596
|
}
|
|
9931
|
-
return /* @__PURE__ */
|
|
9597
|
+
return /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(Page, null, /* @__PURE__ */ React94.createElement(PageSection, {
|
|
9932
9598
|
large: true
|
|
9933
|
-
}, /* @__PURE__ */
|
|
9599
|
+
}, /* @__PURE__ */ React94.createElement(Container_default, null, /* @__PURE__ */ React94.createElement(ProductPage, null, /* @__PURE__ */ React94.createElement(ProductPageAside, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9934
9600
|
mobileOrder: 1
|
|
9935
|
-
}, !pathRoute && hashRoute ? /* @__PURE__ */
|
|
9601
|
+
}, !pathRoute && hashRoute ? /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(UtilityFontSizeSmall, null, /* @__PURE__ */ React94.createElement(ButtonInlineLight, {
|
|
9936
9602
|
as: "a",
|
|
9937
9603
|
href: "#",
|
|
9938
9604
|
title: "Tillbaka till bils\xF6k"
|
|
9939
|
-
}, /* @__PURE__ */
|
|
9605
|
+
}, /* @__PURE__ */ React94.createElement(ButtonContent, null, /* @__PURE__ */ React94.createElement(IconChevronLeft, {
|
|
9940
9606
|
block: true
|
|
9941
|
-
})), /* @__PURE__ */
|
|
9607
|
+
})), /* @__PURE__ */ React94.createElement(ButtonContent, null, "Tillbaka till bils\xF6k")))) : null, manufacturer?.logotype && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(LogoBox_default, {
|
|
9942
9608
|
logo: manufacturer.logotype,
|
|
9943
9609
|
alt: manufacturer.name
|
|
9944
|
-
})), /* @__PURE__ */
|
|
9610
|
+
})), /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(RepeatSmall, null, /* @__PURE__ */ React94.createElement(H1, {
|
|
9945
9611
|
noMargin: true
|
|
9946
|
-
}, 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, {
|
|
9947
9613
|
small: true,
|
|
9948
9614
|
items: uspList
|
|
9949
|
-
})))), /* @__PURE__ */
|
|
9615
|
+
})))), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9950
9616
|
mobileOrder: 2
|
|
9951
|
-
}, /* @__PURE__ */
|
|
9617
|
+
}, /* @__PURE__ */ React94.createElement(PriceTable_default, {
|
|
9952
9618
|
price
|
|
9953
|
-
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */
|
|
9619
|
+
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9954
9620
|
mobileOrder: 4
|
|
9955
|
-
}, financialOptions.length > 0 && /* @__PURE__ */
|
|
9621
|
+
}, financialOptions.length > 0 && /* @__PURE__ */ React94.createElement(FinancialOptions_default, {
|
|
9956
9622
|
id,
|
|
9957
9623
|
financialOptions
|
|
9958
|
-
}), insuranceOptions.length > 0 && /* @__PURE__ */
|
|
9624
|
+
}), insuranceOptions.length > 0 && /* @__PURE__ */ React94.createElement(InsuranceOptions_default, {
|
|
9959
9625
|
id,
|
|
9960
9626
|
branch: centralStorageVehicle?.branch,
|
|
9961
9627
|
insuranceOptions
|
|
9962
|
-
})), /* @__PURE__ */
|
|
9628
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9963
9629
|
mobileOrder: 5
|
|
9964
|
-
}, /* @__PURE__ */
|
|
9630
|
+
}, /* @__PURE__ */ React94.createElement(CheckList_default, {
|
|
9965
9631
|
manufacturer,
|
|
9966
9632
|
packageOptions,
|
|
9967
9633
|
ecommerce,
|
|
@@ -9969,77 +9635,77 @@ var WaykeSearchItem = ({
|
|
|
9969
9635
|
contact: centralStorageVehicle?.contact,
|
|
9970
9636
|
loadingCentralStorageVehicle,
|
|
9971
9637
|
toggleEcomModal: () => ecomContext.current?.start()
|
|
9972
|
-
}))), /* @__PURE__ */
|
|
9638
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMain, null, /* @__PURE__ */ React94.createElement(ProductPageAsideSection, {
|
|
9973
9639
|
mobileOrder: 3
|
|
9974
|
-
}, /* @__PURE__ */
|
|
9640
|
+
}, /* @__PURE__ */ React94.createElement(Gallery_default, {
|
|
9975
9641
|
media,
|
|
9976
9642
|
placeholderImage
|
|
9977
|
-
})), /* @__PURE__ */
|
|
9643
|
+
})), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
9978
9644
|
noMargin: true
|
|
9979
|
-
}, "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, {
|
|
9980
9646
|
propertySet,
|
|
9981
9647
|
vehicleData: vehicle.data
|
|
9982
|
-
}))), description && /* @__PURE__ */
|
|
9648
|
+
}))), description && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Blockquote_default, {
|
|
9983
9649
|
author: contact && contact.name ? contact.name : null,
|
|
9984
9650
|
date: publishedAt ? dateTimeFormat.format(publishedAt, dateTimeFormat.DayMonth) : void 0,
|
|
9985
9651
|
avatar: contact?.avatar || void 0
|
|
9986
|
-
}, !!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, {
|
|
9987
9653
|
noMargin: true
|
|
9988
|
-
}, "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, {
|
|
9989
9655
|
actionTitle: "Visa mer",
|
|
9990
9656
|
onClick: onShowMoreOptionsClick
|
|
9991
|
-
}, /* @__PURE__ */
|
|
9657
|
+
}, /* @__PURE__ */ React94.createElement(UspList_default, {
|
|
9992
9658
|
items: options
|
|
9993
|
-
})))), (documents.length || 0) > 0 && /* @__PURE__ */
|
|
9659
|
+
})))), (documents.length || 0) > 0 && /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(H2, {
|
|
9994
9660
|
noMargin: true
|
|
9995
|
-
}, "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, {
|
|
9996
9662
|
documents
|
|
9997
|
-
}))), /* @__PURE__ */
|
|
9663
|
+
}))), /* @__PURE__ */ React94.createElement(ProductPageMainSection, null, /* @__PURE__ */ React94.createElement(Branch_default, {
|
|
9998
9664
|
branch,
|
|
9999
9665
|
loading: loadingCentralStorageVehicle
|
|
10000
|
-
}), ecommerce && ecommerce.enabled && /* @__PURE__ */
|
|
9666
|
+
}), ecommerce && ecommerce.enabled && /* @__PURE__ */ React94.createElement(Repeat, null, /* @__PURE__ */ React94.createElement(ButtonPrimary, {
|
|
10001
9667
|
disabled: !!ecommerce.reserved,
|
|
10002
9668
|
title: "K\xF6p bilen online",
|
|
10003
9669
|
onClick: () => ecomContext.current?.start()
|
|
10004
|
-
}, "K\xF6p bilen online"))), /* @__PURE__ */
|
|
9670
|
+
}, "K\xF6p bilen online"))), /* @__PURE__ */ React94.createElement(PackageOptions_default, {
|
|
10005
9671
|
packageOptions
|
|
10006
|
-
}), /* @__PURE__ */
|
|
9672
|
+
}), /* @__PURE__ */ React94.createElement(ManufacturerPackagesOption_default, {
|
|
10007
9673
|
packageOption: manufacturer?.packageOption
|
|
10008
|
-
}))))), /* @__PURE__ */
|
|
9674
|
+
}))))), /* @__PURE__ */ React94.createElement(Related_default, {
|
|
10009
9675
|
id,
|
|
10010
9676
|
hashRoute,
|
|
10011
9677
|
pathRoute,
|
|
10012
9678
|
onClickSearchItem
|
|
10013
|
-
})), false, /* @__PURE__ */
|
|
9679
|
+
})), false, /* @__PURE__ */ React94.createElement(portal_element_default, {
|
|
10014
9680
|
id: portal_namespace_exports.DefaultPortal
|
|
10015
9681
|
}));
|
|
10016
9682
|
};
|
|
10017
9683
|
var searchItem_default = WaykeSearchItem;
|
|
10018
9684
|
|
|
10019
9685
|
// src/providers/WaykeProvider.tsx
|
|
10020
|
-
import
|
|
9686
|
+
import React102 from "react";
|
|
10021
9687
|
|
|
10022
9688
|
// src/providers/graphqlProvider.tsx
|
|
10023
|
-
import
|
|
9689
|
+
import React95 from "react";
|
|
10024
9690
|
import { ApolloProvider as ApolloProviderBase, ApolloClient, InMemoryCache } from "@apollo/client";
|
|
10025
9691
|
var GraphqlProvider = ({ uri, children }) => {
|
|
10026
9692
|
const client = new ApolloClient({ uri, cache: new InMemoryCache() });
|
|
10027
|
-
return /* @__PURE__ */
|
|
9693
|
+
return /* @__PURE__ */ React95.createElement(ApolloProviderBase, {
|
|
10028
9694
|
client
|
|
10029
9695
|
}, children);
|
|
10030
9696
|
};
|
|
10031
9697
|
var graphqlProvider_default = GraphqlProvider;
|
|
10032
9698
|
|
|
10033
9699
|
// src/providers/themeProvider.tsx
|
|
10034
|
-
import
|
|
9700
|
+
import React96 from "react";
|
|
10035
9701
|
import { ThemeProvider as ThemeProviderBase } from "styled-components";
|
|
10036
|
-
var ThemeProvider = ({ children }) => /* @__PURE__ */
|
|
9702
|
+
var ThemeProvider = ({ children }) => /* @__PURE__ */ React96.createElement(ThemeProviderBase, {
|
|
10037
9703
|
theme: theme_default
|
|
10038
9704
|
}, children);
|
|
10039
9705
|
var themeProvider_default = ThemeProvider;
|
|
10040
9706
|
|
|
10041
9707
|
// src/State/Search/SearchProvider.tsx
|
|
10042
|
-
import
|
|
9708
|
+
import React97, { useState as useState33, useEffect as useEffect19, useCallback as useCallback39 } from "react";
|
|
10043
9709
|
|
|
10044
9710
|
// src/utils/url.ts
|
|
10045
9711
|
var getUrlSearchParamsFromUrl = () => new URLSearchParams(window.location.search);
|
|
@@ -10056,12 +9722,12 @@ var SearchProvider = ({
|
|
|
10056
9722
|
children
|
|
10057
9723
|
}) => {
|
|
10058
9724
|
const { replaceState, pushState } = usePath_default();
|
|
10059
|
-
const [queryFilter, setQueryFilter] =
|
|
9725
|
+
const [queryFilter, setQueryFilter] = useState33({
|
|
10060
9726
|
searchParams: initialSearchParams
|
|
10061
9727
|
});
|
|
10062
|
-
const [initialFacets, setInitialFacets] =
|
|
10063
|
-
const [documents, setDocuments] =
|
|
10064
|
-
const [initialize, setInitialize] =
|
|
9728
|
+
const [initialFacets, setInitialFacets] = useState33();
|
|
9729
|
+
const [documents, setDocuments] = useState33();
|
|
9730
|
+
const [initialize, setInitialize] = useState33(false);
|
|
10065
9731
|
const { data: initialDataRepsonse } = useFetch_default(
|
|
10066
9732
|
`${url}?hits=0`,
|
|
10067
9733
|
{
|
|
@@ -10097,7 +9763,7 @@ var SearchProvider = ({
|
|
|
10097
9763
|
});
|
|
10098
9764
|
}
|
|
10099
9765
|
};
|
|
10100
|
-
|
|
9766
|
+
useEffect19(() => {
|
|
10101
9767
|
if (useQueryParamsFromUrl) {
|
|
10102
9768
|
window.addEventListener("popstate", popStateEvent);
|
|
10103
9769
|
}
|
|
@@ -10111,12 +9777,12 @@ var SearchProvider = ({
|
|
|
10111
9777
|
pubsub_default.unsubscribeAction(onFilterUpdateEvent);
|
|
10112
9778
|
};
|
|
10113
9779
|
}, []);
|
|
10114
|
-
|
|
9780
|
+
useEffect19(() => {
|
|
10115
9781
|
if (initialDataRepsonse) {
|
|
10116
9782
|
setInitialFacets(initialDataRepsonse.facets);
|
|
10117
9783
|
}
|
|
10118
9784
|
}, [initialDataRepsonse]);
|
|
10119
|
-
|
|
9785
|
+
useEffect19(() => {
|
|
10120
9786
|
if (useQueryParamsFromUrl) {
|
|
10121
9787
|
const nextSearchParams = new URLSearchParams(queryFilter.searchParams);
|
|
10122
9788
|
nextSearchParams.delete("hits");
|
|
@@ -10139,7 +9805,7 @@ var SearchProvider = ({
|
|
|
10139
9805
|
}
|
|
10140
9806
|
}
|
|
10141
9807
|
}, [queryFilter, initialize, useQueryParamsFromUrl]);
|
|
10142
|
-
|
|
9808
|
+
useEffect19(() => {
|
|
10143
9809
|
if (response) {
|
|
10144
9810
|
if (!initialFacets && !useQueryParamsFromUrl) {
|
|
10145
9811
|
setInitialFacets(response.facets);
|
|
@@ -10229,15 +9895,15 @@ var SearchProvider = ({
|
|
|
10229
9895
|
onLoadMore,
|
|
10230
9896
|
onInitialize
|
|
10231
9897
|
};
|
|
10232
|
-
return /* @__PURE__ */
|
|
9898
|
+
return /* @__PURE__ */ React97.createElement(SearchContext.Provider, {
|
|
10233
9899
|
value
|
|
10234
9900
|
}, children);
|
|
10235
9901
|
};
|
|
10236
9902
|
var SearchProvider_default = SearchProvider;
|
|
10237
9903
|
|
|
10238
9904
|
// src/components/Root/index.tsx
|
|
10239
|
-
import
|
|
10240
|
-
var Root =
|
|
9905
|
+
import styled61 from "styled-components";
|
|
9906
|
+
var Root = styled61.div.attrs(() => ({
|
|
10241
9907
|
className: "wayke__theme wayke__font--regular"
|
|
10242
9908
|
}))`
|
|
10243
9909
|
background-color: ${(props) => props.theme.color.bg};
|
|
@@ -10279,21 +9945,21 @@ var useEcom = (ecomSettings) => {
|
|
|
10279
9945
|
var useEcom_default = useEcom;
|
|
10280
9946
|
|
|
10281
9947
|
// src/State/Settings/SettingsProvider.tsx
|
|
10282
|
-
import
|
|
9948
|
+
import React98 from "react";
|
|
10283
9949
|
var SettingsProvider = ({
|
|
10284
9950
|
googleMapsApiKey,
|
|
10285
9951
|
googleMapsMarker,
|
|
10286
9952
|
ecomSettings,
|
|
10287
9953
|
children
|
|
10288
|
-
}) => /* @__PURE__ */
|
|
9954
|
+
}) => /* @__PURE__ */ React98.createElement(SettingsContext.Provider, {
|
|
10289
9955
|
value: { ecomSettings, googleMapsApiKey, googleMapsMarker }
|
|
10290
9956
|
}, children);
|
|
10291
9957
|
var SettingsProvider_default = SettingsProvider;
|
|
10292
9958
|
|
|
10293
9959
|
// src/State/RelatedSearch/RelatedSearchProvider.tsx
|
|
10294
|
-
import
|
|
9960
|
+
import React99, { useState as useState34, useCallback as useCallback40 } from "react";
|
|
10295
9961
|
var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
10296
|
-
const [queryFilter, setQueryFilter] =
|
|
9962
|
+
const [queryFilter, setQueryFilter] = useState34();
|
|
10297
9963
|
const query = queryFilter?.searchParams.toString();
|
|
10298
9964
|
const {
|
|
10299
9965
|
loading,
|
|
@@ -10322,19 +9988,19 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
10322
9988
|
queryFilter,
|
|
10323
9989
|
fetchRelated
|
|
10324
9990
|
};
|
|
10325
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ React99.createElement(RelatedSearchContext.Provider, {
|
|
10326
9992
|
value
|
|
10327
9993
|
}, children);
|
|
10328
9994
|
};
|
|
10329
9995
|
var RelatedSearchProvider_default = RelatedSearchProvider;
|
|
10330
9996
|
|
|
10331
9997
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
10332
|
-
import
|
|
9998
|
+
import React100, { useCallback as useCallback42 } from "react";
|
|
10333
9999
|
|
|
10334
10000
|
// src/hooks/useSessionStorage.ts
|
|
10335
|
-
import { useState as
|
|
10001
|
+
import { useState as useState35, useCallback as useCallback41 } from "react";
|
|
10336
10002
|
var useSessionStorage = (key) => {
|
|
10337
|
-
const [value, setValue] =
|
|
10003
|
+
const [value, setValue] = useState35(sessionStorage.getItem(key));
|
|
10338
10004
|
const set = useCallback41(
|
|
10339
10005
|
(v) => {
|
|
10340
10006
|
sessionStorage.setItem(key, v);
|
|
@@ -10363,20 +10029,20 @@ var useSessionStorage_default = useSessionStorage;
|
|
|
10363
10029
|
var CentralStorageProvider = ({ children }) => {
|
|
10364
10030
|
const { value, set, remove } = useSessionStorage_default("centralStorage");
|
|
10365
10031
|
const setCentralStorageId = useCallback42((id) => id ? set(id) : remove(), []);
|
|
10366
|
-
return /* @__PURE__ */
|
|
10032
|
+
return /* @__PURE__ */ React100.createElement(CentralStorageContext.Provider, {
|
|
10367
10033
|
value: { centralStorageId: value, setCentralStorageId }
|
|
10368
10034
|
}, children);
|
|
10369
10035
|
};
|
|
10370
10036
|
var CentralStorageProvider_default = CentralStorageProvider;
|
|
10371
10037
|
|
|
10372
10038
|
// src/State/Path/PathProvider.tsx
|
|
10373
|
-
import
|
|
10039
|
+
import React101, { useCallback as useCallback43, useEffect as useEffect21, useMemo as useMemo7, useReducer } from "react";
|
|
10374
10040
|
|
|
10375
10041
|
// src/hooks/usePrevious.ts
|
|
10376
|
-
import { useRef as useRef5, useEffect as
|
|
10042
|
+
import { useRef as useRef5, useEffect as useEffect20 } from "react";
|
|
10377
10043
|
var usePrevious = (value) => {
|
|
10378
10044
|
const ref = useRef5();
|
|
10379
|
-
|
|
10045
|
+
useEffect20(() => {
|
|
10380
10046
|
ref.current = value;
|
|
10381
10047
|
});
|
|
10382
10048
|
return ref.current;
|
|
@@ -10406,7 +10072,7 @@ var POP_STATE = "popstate";
|
|
|
10406
10072
|
var PathProvider = ({ children }) => {
|
|
10407
10073
|
const [state, dispatch] = useReducer(reducer_default, initialState);
|
|
10408
10074
|
const previousPath = usePrevious_default(state.path);
|
|
10409
|
-
|
|
10075
|
+
useEffect21(() => {
|
|
10410
10076
|
const onPopState = () => {
|
|
10411
10077
|
dispatch({ type: SET_PATH, path: window.location.pathname });
|
|
10412
10078
|
};
|
|
@@ -10444,7 +10110,7 @@ var PathProvider = ({ children }) => {
|
|
|
10444
10110
|
}),
|
|
10445
10111
|
[state]
|
|
10446
10112
|
);
|
|
10447
|
-
return /* @__PURE__ */
|
|
10113
|
+
return /* @__PURE__ */ React101.createElement(PathContext.Provider, {
|
|
10448
10114
|
value
|
|
10449
10115
|
}, children);
|
|
10450
10116
|
};
|
|
@@ -10464,33 +10130,33 @@ var WaykeProvider = ({
|
|
|
10464
10130
|
children
|
|
10465
10131
|
}) => {
|
|
10466
10132
|
useEcom_default(ecomSettings);
|
|
10467
|
-
return /* @__PURE__ */
|
|
10133
|
+
return /* @__PURE__ */ React102.createElement(PathProvider_default, null, /* @__PURE__ */ React102.createElement(SettingsProvider_default, {
|
|
10468
10134
|
googleMapsApiKey,
|
|
10469
10135
|
googleMapsMarker,
|
|
10470
10136
|
ecomSettings
|
|
10471
|
-
}, /* @__PURE__ */
|
|
10137
|
+
}, /* @__PURE__ */ React102.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React102.createElement(graphqlProvider_default, {
|
|
10472
10138
|
uri: graphQlUrl
|
|
10473
|
-
}, /* @__PURE__ */
|
|
10139
|
+
}, /* @__PURE__ */ React102.createElement(SearchProvider_default, {
|
|
10474
10140
|
url,
|
|
10475
10141
|
apiKey,
|
|
10476
10142
|
useQueryParamsFromUrl,
|
|
10477
10143
|
pathRoute
|
|
10478
|
-
}, /* @__PURE__ */
|
|
10144
|
+
}, /* @__PURE__ */ React102.createElement(RelatedSearchProvider_default, {
|
|
10479
10145
|
url,
|
|
10480
10146
|
urlMlt,
|
|
10481
10147
|
apiKey
|
|
10482
|
-
}, /* @__PURE__ */
|
|
10148
|
+
}, /* @__PURE__ */ React102.createElement(themeProvider_default, null, /* @__PURE__ */ React102.createElement(Root_default, null, children))))))));
|
|
10483
10149
|
};
|
|
10484
10150
|
var WaykeProvider_default = WaykeProvider;
|
|
10485
10151
|
|
|
10486
10152
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10487
|
-
import
|
|
10153
|
+
import React104 from "react";
|
|
10488
10154
|
|
|
10489
10155
|
// src/layouts/WaykeComposite.tsx
|
|
10490
|
-
import
|
|
10156
|
+
import React103, { useEffect as useEffect23 } from "react";
|
|
10491
10157
|
|
|
10492
10158
|
// src/hooks/useHashGuid.ts
|
|
10493
|
-
import { useState as
|
|
10159
|
+
import { useState as useState36, useEffect as useEffect22 } from "react";
|
|
10494
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;
|
|
10495
10161
|
var HASH_CHANGE = "hashchange";
|
|
10496
10162
|
var getGuid = () => {
|
|
@@ -10498,7 +10164,7 @@ var getGuid = () => {
|
|
|
10498
10164
|
return regexGuid.test(guid) || !guid ? guid : void 0;
|
|
10499
10165
|
};
|
|
10500
10166
|
var useHashGuid = () => {
|
|
10501
|
-
const [id, setId] =
|
|
10167
|
+
const [id, setId] = useState36(() => getGuid());
|
|
10502
10168
|
const onHashChange = () => {
|
|
10503
10169
|
const guid = window.location.hash.substr(1, window.location.hash.length);
|
|
10504
10170
|
if (regexGuid.test(guid) || !guid) {
|
|
@@ -10507,7 +10173,7 @@ var useHashGuid = () => {
|
|
|
10507
10173
|
throw "Invalid Guid";
|
|
10508
10174
|
}
|
|
10509
10175
|
};
|
|
10510
|
-
|
|
10176
|
+
useEffect22(() => {
|
|
10511
10177
|
onHashChange();
|
|
10512
10178
|
window.addEventListener(HASH_CHANGE, onHashChange);
|
|
10513
10179
|
return () => {
|
|
@@ -10532,7 +10198,7 @@ var WaykeComposite = ({
|
|
|
10532
10198
|
}) => {
|
|
10533
10199
|
const hashId = useHashGuid_default();
|
|
10534
10200
|
const { id: pathId } = usePath_default();
|
|
10535
|
-
|
|
10201
|
+
useEffect23(() => {
|
|
10536
10202
|
if (!pathRoute) {
|
|
10537
10203
|
if (hashId) {
|
|
10538
10204
|
pubsub_default.publish("HashRouteChange", hashId);
|
|
@@ -10542,14 +10208,14 @@ var WaykeComposite = ({
|
|
|
10542
10208
|
}
|
|
10543
10209
|
}, [hashId]);
|
|
10544
10210
|
const id = pathId || hashId;
|
|
10545
|
-
return /* @__PURE__ */
|
|
10211
|
+
return /* @__PURE__ */ React103.createElement(React103.Fragment, null, id ? /* @__PURE__ */ React103.createElement(searchItem_default, {
|
|
10546
10212
|
id,
|
|
10547
10213
|
hashRoute: !pathRoute,
|
|
10548
10214
|
disableResetScrollOnInit,
|
|
10549
10215
|
placeholderImage,
|
|
10550
10216
|
pathRoute,
|
|
10551
10217
|
modifyDocumentTitleItem
|
|
10552
|
-
}) : /* @__PURE__ */
|
|
10218
|
+
}) : /* @__PURE__ */ React103.createElement(search_default, {
|
|
10553
10219
|
filterList,
|
|
10554
10220
|
initialQueryParams,
|
|
10555
10221
|
removeSearchBar,
|
|
@@ -10563,15 +10229,15 @@ var WaykeComposite = ({
|
|
|
10563
10229
|
var WaykeComposite_default = WaykeComposite;
|
|
10564
10230
|
|
|
10565
10231
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10566
|
-
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */
|
|
10232
|
+
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */ React104.createElement(WaykeProvider_default, {
|
|
10567
10233
|
...provider
|
|
10568
|
-
}, /* @__PURE__ */
|
|
10234
|
+
}, /* @__PURE__ */ React104.createElement(WaykeComposite_default, {
|
|
10569
10235
|
...composite
|
|
10570
10236
|
}));
|
|
10571
10237
|
var WaykeCompositeWithProvider_default = WaykeCompositeWithProvider;
|
|
10572
10238
|
|
|
10573
10239
|
// src/providers/WaykeItemProvidet.tsx
|
|
10574
|
-
import
|
|
10240
|
+
import React105 from "react";
|
|
10575
10241
|
var WaykeItemProvider = ({
|
|
10576
10242
|
url,
|
|
10577
10243
|
urlMlt,
|
|
@@ -10583,17 +10249,17 @@ var WaykeItemProvider = ({
|
|
|
10583
10249
|
children
|
|
10584
10250
|
}) => {
|
|
10585
10251
|
useEcom_default(ecomSettings);
|
|
10586
|
-
return /* @__PURE__ */
|
|
10252
|
+
return /* @__PURE__ */ React105.createElement(PathProvider_default, null, /* @__PURE__ */ React105.createElement(SettingsProvider_default, {
|
|
10587
10253
|
googleMapsApiKey,
|
|
10588
10254
|
googleMapsMarker,
|
|
10589
10255
|
ecomSettings
|
|
10590
|
-
}, /* @__PURE__ */
|
|
10256
|
+
}, /* @__PURE__ */ React105.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React105.createElement(graphqlProvider_default, {
|
|
10591
10257
|
uri: graphQlUrl
|
|
10592
|
-
}, /* @__PURE__ */
|
|
10258
|
+
}, /* @__PURE__ */ React105.createElement(RelatedSearchProvider_default, {
|
|
10593
10259
|
url,
|
|
10594
10260
|
urlMlt,
|
|
10595
10261
|
apiKey
|
|
10596
|
-
}, /* @__PURE__ */
|
|
10262
|
+
}, /* @__PURE__ */ React105.createElement(themeProvider_default, null, /* @__PURE__ */ React105.createElement(Root_default, null, children)))))));
|
|
10597
10263
|
};
|
|
10598
10264
|
var WaykeItemProvidet_default = WaykeItemProvider;
|
|
10599
10265
|
|