hemfixarna-web-components 1.6.3 → 1.6.4
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/esm/hemfixarna-address_36.entry.js +2189 -823
- package/package.json +1 -1
@@ -1,25 +1,24 @@
|
|
1
|
-
import {
|
1
|
+
import { f as forceUpdate, F as Fragment, c as getAssetPath, a as getElement, g as getRenderingRef, h, r as registerInstance } from './index-8c417125.js';
|
2
2
|
|
3
3
|
const appendToMap = (map, propName, value) => {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
4
|
+
const items = map.get(propName);
|
5
|
+
if (!items) {
|
6
|
+
map.set(propName, [value]);
|
7
|
+
} else if (!items.includes(value)) {
|
8
|
+
items.push(value);
|
9
|
+
}
|
11
10
|
};
|
12
11
|
const debounce = (fn, ms) => {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
let timeoutId;
|
13
|
+
return (...args) => {
|
14
|
+
if (timeoutId) {
|
15
|
+
clearTimeout(timeoutId);
|
16
|
+
}
|
17
|
+
timeoutId = setTimeout(() => {
|
18
|
+
timeoutId = 0;
|
19
|
+
fn(...args);
|
20
|
+
}, ms);
|
21
|
+
};
|
23
22
|
};
|
24
23
|
|
25
24
|
/**
|
@@ -31,167 +30,168 @@ const debounce = (fn, ms) => {
|
|
31
30
|
*
|
32
31
|
* Better leak in Edge than to be useless.
|
33
32
|
*/
|
34
|
-
const isConnected =
|
35
|
-
const cleanupElements = debounce(
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
const isConnected = maybeElement => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
34
|
+
const cleanupElements = debounce(map => {
|
35
|
+
for (let key of map.keys()) {
|
36
|
+
map.set(key, map.get(key).filter(isConnected));
|
37
|
+
}
|
39
38
|
}, 2000);
|
40
39
|
const stencilSubscription = () => {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
40
|
+
if (typeof getRenderingRef !== 'function') {
|
41
|
+
// If we are not in a stencil project, we do nothing.
|
42
|
+
// This function is not really exported by @stencil/core.
|
43
|
+
return {};
|
44
|
+
}
|
45
|
+
const elmsToUpdate = new Map();
|
46
|
+
return {
|
47
|
+
dispose: () => elmsToUpdate.clear(),
|
48
|
+
get: propName => {
|
49
|
+
const elm = getRenderingRef();
|
50
|
+
if (elm) {
|
51
|
+
appendToMap(elmsToUpdate, propName, elm);
|
52
|
+
}
|
53
|
+
},
|
54
|
+
set: propName => {
|
55
|
+
const elements = elmsToUpdate.get(propName);
|
56
|
+
if (elements) {
|
57
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
58
|
+
}
|
59
|
+
cleanupElements(elmsToUpdate);
|
60
|
+
},
|
61
|
+
reset: () => {
|
62
|
+
elmsToUpdate.forEach(elms => elms.forEach(forceUpdate));
|
63
|
+
cleanupElements(elmsToUpdate);
|
64
|
+
},
|
65
|
+
};
|
67
66
|
};
|
68
67
|
|
69
|
-
const unwrap =
|
68
|
+
const unwrap = val => (typeof val === 'function' ? val() : val);
|
70
69
|
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
const on = (eventName, callback) => {
|
127
|
-
handlers[eventName].push(callback);
|
128
|
-
return () => {
|
129
|
-
removeFromArray(handlers[eventName], callback);
|
130
|
-
};
|
131
|
-
};
|
132
|
-
const onChange = (propName, cb) => {
|
133
|
-
const unSet = on('set', (key, newValue) => {
|
134
|
-
if (key === propName) {
|
135
|
-
cb(newValue);
|
136
|
-
}
|
70
|
+
const unwrappedState = unwrap(defaultState);
|
71
|
+
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
72
|
+
const handlers = {
|
73
|
+
dispose: [],
|
74
|
+
get: [],
|
75
|
+
set: [],
|
76
|
+
reset: [],
|
77
|
+
};
|
78
|
+
const reset = () => {
|
79
|
+
var _a;
|
80
|
+
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
81
|
+
// otherwise, the state won't be properly reset
|
82
|
+
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
83
|
+
handlers.reset.forEach(cb => cb());
|
84
|
+
};
|
85
|
+
const dispose = () => {
|
86
|
+
// Call first dispose as resetting the state would
|
87
|
+
// cause less updates ;)
|
88
|
+
handlers.dispose.forEach(cb => cb());
|
89
|
+
reset();
|
90
|
+
};
|
91
|
+
const get = propName => {
|
92
|
+
handlers.get.forEach(cb => cb(propName));
|
93
|
+
return states.get(propName);
|
94
|
+
};
|
95
|
+
const set = (propName, value) => {
|
96
|
+
const oldValue = states.get(propName);
|
97
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
98
|
+
states.set(propName, value);
|
99
|
+
handlers.set.forEach(cb => cb(propName, value, oldValue));
|
100
|
+
}
|
101
|
+
};
|
102
|
+
const state =
|
103
|
+
typeof Proxy === 'undefined'
|
104
|
+
? {}
|
105
|
+
: new Proxy(unwrappedState, {
|
106
|
+
get(_, propName) {
|
107
|
+
return get(propName);
|
108
|
+
},
|
109
|
+
ownKeys(_) {
|
110
|
+
return Array.from(states.keys());
|
111
|
+
},
|
112
|
+
getOwnPropertyDescriptor() {
|
113
|
+
return {
|
114
|
+
enumerable: true,
|
115
|
+
configurable: true,
|
116
|
+
};
|
117
|
+
},
|
118
|
+
has(_, propName) {
|
119
|
+
return states.has(propName);
|
120
|
+
},
|
121
|
+
set(_, propName, value) {
|
122
|
+
set(propName, value);
|
123
|
+
return true;
|
124
|
+
},
|
137
125
|
});
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
unSet();
|
143
|
-
unReset();
|
144
|
-
};
|
145
|
-
};
|
146
|
-
const use = (...subscriptions) => {
|
147
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
148
|
-
if (subscription.set) {
|
149
|
-
unsubs.push(on('set', subscription.set));
|
150
|
-
}
|
151
|
-
if (subscription.get) {
|
152
|
-
unsubs.push(on('get', subscription.get));
|
153
|
-
}
|
154
|
-
if (subscription.reset) {
|
155
|
-
unsubs.push(on('reset', subscription.reset));
|
156
|
-
}
|
157
|
-
if (subscription.dispose) {
|
158
|
-
unsubs.push(on('dispose', subscription.dispose));
|
159
|
-
}
|
160
|
-
return unsubs;
|
161
|
-
}, []);
|
162
|
-
return () => unsubs.forEach((unsub) => unsub());
|
126
|
+
const on = (eventName, callback) => {
|
127
|
+
handlers[eventName].push(callback);
|
128
|
+
return () => {
|
129
|
+
removeFromArray(handlers[eventName], callback);
|
163
130
|
};
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
forceUpdate,
|
131
|
+
};
|
132
|
+
const onChange = (propName, cb) => {
|
133
|
+
const unSet = on('set', (key, newValue) => {
|
134
|
+
if (key === propName) {
|
135
|
+
cb(newValue);
|
136
|
+
}
|
137
|
+
});
|
138
|
+
// We need to unwrap the defaultState because it might be a function.
|
139
|
+
// Otherwise we might not be sending the right reset value.
|
140
|
+
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
141
|
+
return () => {
|
142
|
+
unSet();
|
143
|
+
unReset();
|
178
144
|
};
|
145
|
+
};
|
146
|
+
const use = (...subscriptions) => {
|
147
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
148
|
+
if (subscription.set) {
|
149
|
+
unsubs.push(on('set', subscription.set));
|
150
|
+
}
|
151
|
+
if (subscription.get) {
|
152
|
+
unsubs.push(on('get', subscription.get));
|
153
|
+
}
|
154
|
+
if (subscription.reset) {
|
155
|
+
unsubs.push(on('reset', subscription.reset));
|
156
|
+
}
|
157
|
+
if (subscription.dispose) {
|
158
|
+
unsubs.push(on('dispose', subscription.dispose));
|
159
|
+
}
|
160
|
+
return unsubs;
|
161
|
+
}, []);
|
162
|
+
return () => unsubs.forEach(unsub => unsub());
|
163
|
+
};
|
164
|
+
const forceUpdate = key => {
|
165
|
+
const oldValue = states.get(key);
|
166
|
+
handlers.set.forEach(cb => cb(key, oldValue, oldValue));
|
167
|
+
};
|
168
|
+
return {
|
169
|
+
state,
|
170
|
+
get,
|
171
|
+
set,
|
172
|
+
on,
|
173
|
+
onChange,
|
174
|
+
use,
|
175
|
+
dispose,
|
176
|
+
reset,
|
177
|
+
forceUpdate,
|
178
|
+
};
|
179
179
|
};
|
180
180
|
const removeFromArray = (array, item) => {
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
181
|
+
const index = array.indexOf(item);
|
182
|
+
if (index >= 0) {
|
183
|
+
array[index] = array[array.length - 1];
|
184
|
+
array.length--;
|
185
|
+
}
|
186
186
|
};
|
187
187
|
|
188
188
|
const createStore = (defaultState, shouldUpdate) => {
|
189
|
-
|
190
|
-
|
191
|
-
|
189
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
190
|
+
map.use(stencilSubscription());
|
191
|
+
return map;
|
192
192
|
};
|
193
193
|
|
194
|
-
const { state, onChange
|
194
|
+
const { state, onChange } = createStore({
|
195
195
|
step: 1,
|
196
196
|
checkoutStep: 1,
|
197
197
|
checkoutEdit: false,
|
@@ -228,9 +228,14 @@ onChange('creditSafeUser', user => {
|
|
228
228
|
window.sessionStorage.setItem(`hemfixarna-${state.business}-creditSafeUser`, JSON.stringify(user));
|
229
229
|
});
|
230
230
|
onChange('selectedProduct', product => {
|
231
|
-
if (!state.customer || !product)
|
232
|
-
|
233
|
-
|
231
|
+
if (!state.customer || !product) return;
|
232
|
+
const categories = [
|
233
|
+
...state.customer.categories,
|
234
|
+
...state.customer.categories.map(c => {
|
235
|
+
var _a;
|
236
|
+
return (_a = c.sub_categories) !== null && _a !== void 0 ? _a : [];
|
237
|
+
}),
|
238
|
+
].flat();
|
234
239
|
const category = categories.find(c => c && c.id === product.category);
|
235
240
|
if (category) {
|
236
241
|
state.parentCategory = category;
|
@@ -239,8 +244,7 @@ onChange('selectedProduct', product => {
|
|
239
244
|
state.parentCategory = null;
|
240
245
|
});
|
241
246
|
onChange('selectedCustomerCategory', category => {
|
242
|
-
if (!state.customer || !category)
|
243
|
-
return;
|
247
|
+
if (!state.customer || !category) return;
|
244
248
|
if (category.parent) {
|
245
249
|
const parent = state.customer.categories.find(c => c.id === category.parent);
|
246
250
|
if (parent) {
|
@@ -251,20 +255,18 @@ onChange('selectedCustomerCategory', category => {
|
|
251
255
|
state.parentCategory = null;
|
252
256
|
});
|
253
257
|
|
254
|
-
const hideField =
|
258
|
+
const hideField = field => {
|
255
259
|
return field.split(' ').reduce((acc, curr) => {
|
256
260
|
if (curr.length <= 2) {
|
257
261
|
return acc + curr.slice(0, 1) + '* ';
|
258
|
-
}
|
259
|
-
else {
|
262
|
+
} else {
|
260
263
|
return acc + curr.slice(0, 1) + '*'.repeat(curr.length - 2) + curr.slice(-1) + ' ';
|
261
264
|
}
|
262
265
|
}, '');
|
263
266
|
};
|
264
267
|
|
265
|
-
const scrollToTop =
|
266
|
-
if (!el)
|
267
|
-
return;
|
268
|
+
const scrollToTop = el => {
|
269
|
+
if (!el) return;
|
268
270
|
el.scrollTo({
|
269
271
|
top: 0,
|
270
272
|
behavior: 'smooth',
|
@@ -274,7 +276,7 @@ const scrollToTop = (el) => {
|
|
274
276
|
const HemfixarnaAddress = class {
|
275
277
|
constructor(hostRef) {
|
276
278
|
registerInstance(this, hostRef);
|
277
|
-
this.handleSubmit =
|
279
|
+
this.handleSubmit = e => {
|
278
280
|
e.preventDefault();
|
279
281
|
const streetValid = this.street.length > 0;
|
280
282
|
if (!streetValid) {
|
@@ -300,20 +302,63 @@ const HemfixarnaAddress = class {
|
|
300
302
|
scrollToTop(el);
|
301
303
|
}
|
302
304
|
};
|
303
|
-
this.handleChangeStreet =
|
305
|
+
this.handleChangeStreet = e => {
|
304
306
|
this.streetError = null;
|
305
307
|
this.street = this.street === state.user.street ? '' : e.target.value;
|
306
308
|
};
|
307
|
-
this.handleChangeZip =
|
309
|
+
this.handleChangeZip = e => {
|
308
310
|
this.zipError = null;
|
309
311
|
this.zip = this.zip === state.user.zip ? '' : e.target.value;
|
310
312
|
};
|
311
|
-
this.handleChangeTown =
|
313
|
+
this.handleChangeTown = e => {
|
312
314
|
this.townError = null;
|
313
315
|
this.town = this.town === state.user.town ? '' : e.target.value;
|
314
316
|
};
|
315
317
|
this.render = () => {
|
316
|
-
return
|
318
|
+
return h(
|
319
|
+
'form',
|
320
|
+
{ class: 'hemfixarna_address', onSubmit: e => this.handleSubmit(e) },
|
321
|
+
h(
|
322
|
+
'div',
|
323
|
+
null,
|
324
|
+
h('input', {
|
325
|
+
class: `${this.street.length ? 'input_active' : ''}`,
|
326
|
+
onInput: this.handleChangeStreet,
|
327
|
+
type: 'text',
|
328
|
+
name: 'street',
|
329
|
+
value: this.street === state.user.street ? hideField(this.street) : this.street,
|
330
|
+
}),
|
331
|
+
h('label', { htmlFor: 'street' }, 'Gatuaddress '),
|
332
|
+
),
|
333
|
+
this.streetError && h('span', null, this.streetError),
|
334
|
+
h(
|
335
|
+
'div',
|
336
|
+
null,
|
337
|
+
h('input', {
|
338
|
+
class: `${this.zip.length ? 'input_active' : ''}`,
|
339
|
+
onInput: this.handleChangeZip,
|
340
|
+
type: 'tel',
|
341
|
+
name: 'zip',
|
342
|
+
value: this.zip === state.user.zip ? hideField(this.zip) : this.zip,
|
343
|
+
}),
|
344
|
+
h('label', { htmlFor: 'zip' }, 'Postnummer '),
|
345
|
+
),
|
346
|
+
this.zipError && h('span', null, this.zipError),
|
347
|
+
h(
|
348
|
+
'div',
|
349
|
+
null,
|
350
|
+
h('input', {
|
351
|
+
class: `${this.town.length ? 'input_active' : ''}`,
|
352
|
+
onInput: this.handleChangeTown,
|
353
|
+
type: 'text',
|
354
|
+
name: 'town',
|
355
|
+
value: this.town === state.user.town ? hideField(this.town) : this.town,
|
356
|
+
}),
|
357
|
+
h('label', { htmlFor: 'town' }, 'Ort '),
|
358
|
+
),
|
359
|
+
this.townError && h('span', null, this.townError),
|
360
|
+
h('input', { type: 'submit', value: 'Forts\u00E4tt' }),
|
361
|
+
);
|
317
362
|
};
|
318
363
|
this.street = '';
|
319
364
|
this.streetError = null;
|
@@ -329,57 +374,51 @@ const HemfixarnaAddress = class {
|
|
329
374
|
this.town = state.user.town;
|
330
375
|
}
|
331
376
|
}
|
332
|
-
get el() {
|
377
|
+
get el() {
|
378
|
+
return getElement(this);
|
379
|
+
}
|
333
380
|
};
|
334
381
|
|
335
|
-
const getRutPrice =
|
382
|
+
const getRutPrice = price => {
|
336
383
|
return Math.ceil(price / 2);
|
337
384
|
};
|
338
|
-
const getRotPrice =
|
385
|
+
const getRotPrice = price => {
|
339
386
|
return Math.ceil(price * 0.7);
|
340
387
|
};
|
341
|
-
const getGreenPrice =
|
388
|
+
const getGreenPrice = price => {
|
342
389
|
return Math.ceil(price * 0.5);
|
343
390
|
};
|
344
391
|
const getProductPrice = (product, price, amount = 1) => {
|
345
392
|
if (product.rot && state.rot) {
|
346
393
|
return getRotPrice((price || product.price) * amount);
|
347
|
-
}
|
348
|
-
else if (product.rut && state.rut) {
|
394
|
+
} else if (product.rut && state.rut) {
|
349
395
|
return getRutPrice((price || product.price) * amount);
|
350
|
-
}
|
351
|
-
else if (product.green && state.green) {
|
396
|
+
} else if (product.green && state.green) {
|
352
397
|
return getGreenPrice((price || product.price) * amount);
|
353
|
-
}
|
354
|
-
else {
|
398
|
+
} else {
|
355
399
|
return (price || product.price) * amount;
|
356
400
|
}
|
357
401
|
};
|
358
|
-
const getProductPriceWithRotAndRut =
|
402
|
+
const getProductPriceWithRotAndRut = product => {
|
359
403
|
if (product.rot) {
|
360
404
|
return getRotPrice(product.price);
|
361
|
-
}
|
362
|
-
else if (product.rut && state.rut) {
|
405
|
+
} else if (product.rut && state.rut) {
|
363
406
|
return getRutPrice(product.price);
|
364
|
-
}
|
365
|
-
else {
|
407
|
+
} else {
|
366
408
|
return product.price;
|
367
409
|
}
|
368
410
|
};
|
369
411
|
const getPartPrice = (part, product, amount = 1) => {
|
370
412
|
if (product.rot && state.rot) {
|
371
413
|
return getRotPrice(part.price * amount);
|
372
|
-
}
|
373
|
-
else if (product.rut && state.rut) {
|
414
|
+
} else if (product.rut && state.rut) {
|
374
415
|
return getRutPrice(part.price * amount);
|
375
|
-
}
|
376
|
-
else {
|
416
|
+
} else {
|
377
417
|
return part.price * amount;
|
378
418
|
}
|
379
419
|
};
|
380
420
|
const getStartFee = () => {
|
381
|
-
if (!state.cart)
|
382
|
-
return { rut: 0, rot: 0, green: 0 };
|
421
|
+
if (!state.cart) return { rut: 0, rot: 0, green: 0 };
|
383
422
|
const hasRut = state.cart.some(item => item.rut && item.start_fee);
|
384
423
|
const hasRot = state.cart.some(item => item.rot && item.start_fee);
|
385
424
|
const hasGreen = state.cart.some(item => item.green && item.start_fee);
|
@@ -397,46 +436,52 @@ const getStartFee = () => {
|
|
397
436
|
// return { rut: 0, rot: 0, length: 0 };
|
398
437
|
// }
|
399
438
|
};
|
400
|
-
const getItemPrice =
|
439
|
+
const getItemPrice = item => {
|
401
440
|
const partsPrice = item.parts.reduce((acc, curr) => {
|
402
441
|
return acc + curr.price * curr.amount;
|
403
442
|
}, 0);
|
404
443
|
return getProductPrice(item, item.price * item.amount + partsPrice);
|
405
444
|
};
|
406
445
|
const calculateRot = () => {
|
407
|
-
const totalWithRot =
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
446
|
+
const totalWithRot =
|
447
|
+
state.cart.reduce((acc, curr) => {
|
448
|
+
return curr.rot ? acc + getItemPrice(curr) : acc;
|
449
|
+
}, 0) + getStartFee().rot;
|
450
|
+
const totalWithoutRot =
|
451
|
+
state.cart.reduce((acc, curr) => {
|
452
|
+
const partsPrice = curr.parts.reduce((acc, curr) => {
|
453
|
+
return acc + curr.price * curr.amount;
|
454
|
+
}, 0);
|
455
|
+
return curr.rot ? acc + curr.price * curr.amount + partsPrice : acc;
|
456
|
+
}, 0) + Number(state.options.start_fee);
|
416
457
|
return totalWithoutRot - totalWithRot;
|
417
458
|
};
|
418
459
|
const calculateRut = () => {
|
419
|
-
const totalWithRut =
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
460
|
+
const totalWithRut =
|
461
|
+
state.cart.reduce((acc, curr) => {
|
462
|
+
return curr.rut ? acc + getItemPrice(curr) : acc;
|
463
|
+
}, 0) + getStartFee().rut;
|
464
|
+
const totalWithoutRut =
|
465
|
+
state.cart.reduce((acc, curr) => {
|
466
|
+
const partsPrice = curr.parts.reduce((acc, curr) => {
|
467
|
+
return acc + curr.price * curr.amount;
|
468
|
+
}, 0);
|
469
|
+
return curr.rut ? acc + curr.price * curr.amount + partsPrice : acc;
|
470
|
+
}, 0) + Number(state.options.start_fee);
|
428
471
|
return totalWithoutRut - totalWithRut;
|
429
472
|
};
|
430
473
|
const calculateGreenDiscount = () => {
|
431
|
-
const totalWithGreen =
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
474
|
+
const totalWithGreen =
|
475
|
+
state.cart.reduce((acc, curr) => {
|
476
|
+
return curr.green ? acc + getItemPrice(curr) : acc;
|
477
|
+
}, 0) + getStartFee().green;
|
478
|
+
const totalWithoutGreen =
|
479
|
+
state.cart.reduce((acc, curr) => {
|
480
|
+
const partsPrice = curr.parts.reduce((acc, curr) => {
|
481
|
+
return acc + curr.price * curr.amount;
|
482
|
+
}, 0);
|
483
|
+
return curr.green ? acc + curr.price * curr.amount + partsPrice : acc;
|
484
|
+
}, 0) + Number(state.options.start_fee);
|
440
485
|
return totalWithoutGreen - totalWithGreen;
|
441
486
|
};
|
442
487
|
const getTotalPrice = () => {
|
@@ -445,43 +490,43 @@ const getTotalPrice = () => {
|
|
445
490
|
|
446
491
|
var Business;
|
447
492
|
(function (Business) {
|
448
|
-
Business[
|
449
|
-
Business[
|
450
|
-
Business[
|
451
|
-
Business[
|
452
|
-
Business[
|
453
|
-
Business[
|
454
|
-
Business[
|
455
|
-
Business[
|
456
|
-
Business[
|
457
|
-
Business[
|
458
|
-
Business[
|
459
|
-
Business[
|
460
|
-
Business[
|
461
|
-
Business[
|
462
|
-
Business[
|
463
|
-
Business[
|
464
|
-
Business[
|
465
|
-
Business[
|
466
|
-
Business[
|
467
|
-
Business[
|
493
|
+
Business['kund'] = 'kund';
|
494
|
+
Business['byggmax'] = 'byggmax';
|
495
|
+
Business['skanska'] = 'skanska';
|
496
|
+
Business['string'] = 'string-furniture';
|
497
|
+
Business['hornbach'] = 'hornbach';
|
498
|
+
Business['forebygg'] = 'forebygg';
|
499
|
+
Business['doro'] = 'doro';
|
500
|
+
Business['elfa'] = 'elfa';
|
501
|
+
Business['kbygg'] = 'k-bygg';
|
502
|
+
Business['norrgavel'] = 'norrgavel';
|
503
|
+
Business['fargvaruhuset'] = 'fargvaruhuset';
|
504
|
+
Business['zaptec'] = 'zaptec';
|
505
|
+
Business['tesla'] = 'tesla';
|
506
|
+
Business['klint'] = 'klint';
|
507
|
+
Business['flyttsmart'] = 'flyttsmart';
|
508
|
+
Business['lg'] = 'lg';
|
509
|
+
Business['sparfonster'] = 'sparfonster';
|
510
|
+
Business['power'] = 'power';
|
511
|
+
Business['traningspartner'] = 'traningspartner';
|
512
|
+
Business['superfront'] = 'superfront';
|
468
513
|
})(Business || (Business = {}));
|
469
514
|
var WidgetStyle;
|
470
515
|
(function (WidgetStyle) {
|
471
|
-
WidgetStyle[
|
472
|
-
WidgetStyle[
|
473
|
-
WidgetStyle[
|
474
|
-
WidgetStyle[
|
516
|
+
WidgetStyle['standard'] = 'standard';
|
517
|
+
WidgetStyle['alternative'] = 'alternative';
|
518
|
+
WidgetStyle['alternative_2'] = 'alternative_2';
|
519
|
+
WidgetStyle['alternative_3'] = 'alternative_3';
|
475
520
|
})(WidgetStyle || (WidgetStyle = {}));
|
476
521
|
var TopCategory;
|
477
522
|
(function (TopCategory) {
|
478
|
-
TopCategory[
|
523
|
+
TopCategory['byggmax'] = 'category/bygg';
|
479
524
|
})(TopCategory || (TopCategory = {}));
|
480
525
|
|
481
|
-
const isProduct =
|
526
|
+
const isProduct = category => {
|
482
527
|
return category.post_name !== undefined;
|
483
528
|
};
|
484
|
-
const isBusiness =
|
529
|
+
const isBusiness = partner => {
|
485
530
|
return Object.values(Business).includes(partner);
|
486
531
|
};
|
487
532
|
|
@@ -498,12 +543,10 @@ const HemfixarnaBox = class {
|
|
498
543
|
if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.taxonomy) === 'service_cat') {
|
499
544
|
state.selectedCategory = taxonomy;
|
500
545
|
state.step = 2;
|
501
|
-
}
|
502
|
-
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
|
546
|
+
} else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
|
503
547
|
state.selectedService = taxonomy;
|
504
548
|
state.step = 3;
|
505
|
-
}
|
506
|
-
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
|
549
|
+
} else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
|
507
550
|
state.selectedProduct = taxonomy;
|
508
551
|
state.step = 4;
|
509
552
|
}
|
@@ -519,9 +562,34 @@ const HemfixarnaBox = class {
|
|
519
562
|
scrollToTop(el);
|
520
563
|
}
|
521
564
|
render() {
|
522
|
-
return this.category
|
565
|
+
return this.category
|
566
|
+
? h(
|
567
|
+
Fragment,
|
568
|
+
null,
|
569
|
+
isProduct(this.category)
|
570
|
+
? h(
|
571
|
+
'li',
|
572
|
+
{ onClick: () => this.setProduct() },
|
573
|
+
h('img', { class: 'hemfixarna_logo', height: 82, src: this.category.icon, alt: this.category.post_name }),
|
574
|
+
h('div', null, h('p', null, this.category.title), !this.category.invoice ? h('p', { class: 'price' }, 'Fr\u00E5n ', getProductPrice(this.category), 'kr') : null),
|
575
|
+
)
|
576
|
+
: h(
|
577
|
+
'li',
|
578
|
+
{ onClick: () => (state.selectedCustomerCategory = this.category) },
|
579
|
+
h('img', { class: 'hemfixarna_logo', height: 82, src: this.category.icon, alt: this.category.name }),
|
580
|
+
h('div', null, h('p', null, this.category.name)),
|
581
|
+
),
|
582
|
+
)
|
583
|
+
: h(
|
584
|
+
'li',
|
585
|
+
{ onClick: () => this.setTaxonomy(this.post) },
|
586
|
+
this.post.icon && h('img', { class: 'hemfixarna_logo', height: 82, src: this.icon, alt: this.postTitle }),
|
587
|
+
h('div', null, h('p', null, this.postTitle), state.step === 3 && h('p', { class: 'price' }, 'Fr\u00E5n ', getProductPrice(this.post), 'kr')),
|
588
|
+
);
|
589
|
+
}
|
590
|
+
get el() {
|
591
|
+
return getElement(this);
|
523
592
|
}
|
524
|
-
get el() { return getElement(this); }
|
525
593
|
};
|
526
594
|
|
527
595
|
const HemfixarnaBreadcrumbs = class {
|
@@ -563,24 +631,85 @@ const HemfixarnaBreadcrumbs = class {
|
|
563
631
|
const close = getAssetPath(`./assets/close.svg`);
|
564
632
|
const cart = getAssetPath(`./assets/cart.svg`);
|
565
633
|
const back = getAssetPath(`./assets/back.svg`);
|
566
|
-
return
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
634
|
+
return h(
|
635
|
+
'div',
|
636
|
+
null,
|
637
|
+
h(
|
638
|
+
'div',
|
639
|
+
{ class: 'hemfixarna_crumbs' },
|
640
|
+
h(
|
641
|
+
'div',
|
642
|
+
{ class: 'hemfixarna_crumbs--links' },
|
643
|
+
h('img', { onClick: () => this.handleHomePageClick(), src: logo, width: 110 }),
|
644
|
+
!this.loadFromQuery || this.isDemo ? h('img', { onClick: () => this.closeModal(), class: 'close', src: close, width: 32 }) : null,
|
645
|
+
h('div', null, h('button', { onClick: () => this.handleHomePageClick() }, 'Alla tj\u00E4nster')),
|
646
|
+
),
|
647
|
+
h(
|
648
|
+
'div',
|
649
|
+
{ class: 'hemfixarna_crumbs--right' },
|
650
|
+
h('hemfixarna-contact', null),
|
651
|
+
h(
|
652
|
+
'div',
|
653
|
+
{ onClick: () => this.handleCartClick(), class: `cart ${this.getCartLength() > 0 ? 'cart_active' : ''}` },
|
654
|
+
h('img', { src: cart, width: 24 }),
|
655
|
+
h('span', null, this.getCartLength()),
|
656
|
+
),
|
657
|
+
),
|
658
|
+
),
|
659
|
+
[3, 4].includes(state.step) &&
|
660
|
+
!state.customer &&
|
661
|
+
h(
|
662
|
+
'button',
|
663
|
+
{
|
664
|
+
class: 'hemfixarna_crumbs--back',
|
665
|
+
onClick: () => {
|
666
|
+
state.step = state.step === 4 ? 3 : 2;
|
667
|
+
},
|
668
|
+
},
|
669
|
+
h('img', { width: 24, src: back, alt: 'back arrow' }),
|
670
|
+
h('span', null, 'Se allt ', state.step === 4 ? state.selectedService.post_title : state.selectedCategory.name),
|
671
|
+
),
|
672
|
+
!state.parentCategory &&
|
673
|
+
state.step &&
|
674
|
+
state.selectedCustomerCategory &&
|
675
|
+
h(
|
676
|
+
'button',
|
677
|
+
{
|
678
|
+
class: 'hemfixarna_crumbs--back',
|
679
|
+
onClick: () => {
|
680
|
+
state.step = 1;
|
681
|
+
state.selectedCustomerCategory = null;
|
682
|
+
state.selectedProduct = null;
|
683
|
+
state.maleri = null;
|
684
|
+
},
|
685
|
+
},
|
686
|
+
h('img', { width: 24, src: back, alt: 'back arrow' }),
|
687
|
+
h('span', null, 'Se alla tj\u00E4nster'),
|
688
|
+
),
|
689
|
+
state.parentCategory &&
|
690
|
+
state.step < 5 &&
|
691
|
+
h(
|
692
|
+
'button',
|
693
|
+
{
|
694
|
+
class: 'hemfixarna_crumbs--back',
|
695
|
+
onClick: () => {
|
696
|
+
state.step = 1;
|
697
|
+
state.selectedCustomerCategory = state.parentCategory;
|
698
|
+
state.selectedProduct = null;
|
699
|
+
state.maleri = null;
|
700
|
+
},
|
701
|
+
},
|
702
|
+
h('img', { width: 24, src: back, alt: 'back arrow' }),
|
703
|
+
h('span', null, 'Se allt ', state.parentCategory.name),
|
704
|
+
),
|
705
|
+
);
|
706
|
+
}
|
707
|
+
get el() {
|
708
|
+
return getElement(this);
|
579
709
|
}
|
580
|
-
get el() { return getElement(this); }
|
581
710
|
};
|
582
711
|
|
583
|
-
const hemfixarnaByggmaxCss =
|
712
|
+
const hemfixarnaByggmaxCss = '';
|
584
713
|
|
585
714
|
const MyComponent$j = class {
|
586
715
|
constructor(hostRef) {
|
@@ -596,7 +725,17 @@ const MyComponent$j = class {
|
|
596
725
|
this.buttonBg = undefined;
|
597
726
|
}
|
598
727
|
render() {
|
599
|
-
return
|
728
|
+
return h('hemfixarna-component', {
|
729
|
+
forceOldTree: this.forceOldTree,
|
730
|
+
id: this.id,
|
731
|
+
slug: this.slug,
|
732
|
+
business: Business.byggmax,
|
733
|
+
topCategory: TopCategory.byggmax,
|
734
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
735
|
+
widgetStyle: this.widgetStyle,
|
736
|
+
buttonBg: this.buttonBg,
|
737
|
+
buttonColor: this.buttonColor,
|
738
|
+
});
|
600
739
|
}
|
601
740
|
};
|
602
741
|
MyComponent$j.style = hemfixarnaByggmaxCss;
|
@@ -608,11 +747,53 @@ const HemfixarnaCart = class {
|
|
608
747
|
}
|
609
748
|
render() {
|
610
749
|
const back = getAssetPath(`./assets/back.svg`);
|
611
|
-
return
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
750
|
+
return h(
|
751
|
+
'div',
|
752
|
+
{ class: 'hemfixarna_cart' },
|
753
|
+
h(
|
754
|
+
'div',
|
755
|
+
{ class: 'hemfixarna_cart--left' },
|
756
|
+
h(
|
757
|
+
'h2',
|
758
|
+
null,
|
759
|
+
state.checkoutStep === 2 &&
|
760
|
+
!state.checkoutEdit &&
|
761
|
+
h(
|
762
|
+
'button',
|
763
|
+
{
|
764
|
+
onClick: () => {
|
765
|
+
state.checkoutStep = 1;
|
766
|
+
},
|
767
|
+
},
|
768
|
+
h('img', { width: 24, src: back, alt: 'back arrow' }),
|
769
|
+
),
|
770
|
+
'Din bokning',
|
771
|
+
),
|
772
|
+
h('hemfixarna-orderrows', { tree: this.tree }),
|
773
|
+
),
|
774
|
+
h(
|
775
|
+
'div',
|
776
|
+
{ class: 'hemfixarna_cart--right' },
|
777
|
+
h(
|
778
|
+
'h2',
|
779
|
+
null,
|
780
|
+
state.checkoutStep === 2 &&
|
781
|
+
!state.checkoutEdit &&
|
782
|
+
h(
|
783
|
+
'button',
|
784
|
+
{
|
785
|
+
onClick: () => {
|
786
|
+
state.checkoutStep = 1;
|
787
|
+
},
|
788
|
+
},
|
789
|
+
h('img', { width: 24, src: back, alt: 'back arrow' }),
|
790
|
+
),
|
791
|
+
'Dina uppgifter',
|
792
|
+
),
|
793
|
+
h('hemfixarna-checkout', null),
|
794
|
+
h('hemfixarna-info', null),
|
795
|
+
),
|
796
|
+
);
|
616
797
|
}
|
617
798
|
};
|
618
799
|
|
@@ -625,22 +806,40 @@ const HemfixarnaCategory = class {
|
|
625
806
|
state.step = 3;
|
626
807
|
}
|
627
808
|
render() {
|
628
|
-
return
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
809
|
+
return h(
|
810
|
+
'div',
|
811
|
+
null,
|
812
|
+
h('h2', null, state.selectedCategory.name),
|
813
|
+
h(
|
814
|
+
'div',
|
815
|
+
{ class: 'hemfixarna_categories--wrapper' },
|
816
|
+
h(
|
817
|
+
'div',
|
818
|
+
null,
|
819
|
+
h(
|
820
|
+
'ul',
|
821
|
+
{ class: 'hemfixarna_categories' },
|
822
|
+
state.selectedCategory.services
|
823
|
+
.sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
|
824
|
+
.map(s => {
|
825
|
+
var _a;
|
826
|
+
return h('hemfixarna-box', { post: s, icon: (_a = s.icon.url) !== null && _a !== void 0 ? _a : s.icon, postTitle: s.post_title });
|
827
|
+
}),
|
828
|
+
),
|
829
|
+
),
|
830
|
+
h('hemfixarna-info', null),
|
831
|
+
),
|
832
|
+
);
|
634
833
|
}
|
635
834
|
};
|
636
835
|
|
637
|
-
const base$2 = `${
|
836
|
+
const base$2 = `${'https://hemfixarna.se'}/wp-json/headless`;
|
638
837
|
async function fetchWithType(request, options) {
|
639
838
|
const response = await fetch(request, options);
|
640
839
|
const body = await response.json();
|
641
840
|
return body;
|
642
841
|
}
|
643
|
-
const getTaxonomy = async
|
842
|
+
const getTaxonomy = async endpoint => {
|
644
843
|
if (!endpoint) {
|
645
844
|
return;
|
646
845
|
}
|
@@ -649,26 +848,23 @@ const getTaxonomy = async (endpoint) => {
|
|
649
848
|
try {
|
650
849
|
const res = await fetch(`${base$2}/${type}/${slug}`);
|
651
850
|
return await res.json();
|
652
|
-
}
|
653
|
-
catch (error) {
|
851
|
+
} catch (error) {
|
654
852
|
console.log(error);
|
655
853
|
}
|
656
854
|
};
|
657
|
-
const getCustomer = async
|
855
|
+
const getCustomer = async slug => {
|
658
856
|
try {
|
659
857
|
const res = await fetch(`${base$2}/customer/${slug}`);
|
660
858
|
return await res.json();
|
661
|
-
}
|
662
|
-
catch (error) {
|
859
|
+
} catch (error) {
|
663
860
|
console.log(error);
|
664
861
|
}
|
665
862
|
};
|
666
863
|
const getOptions = async () => {
|
667
864
|
try {
|
668
865
|
const res = await fetch(`${base$2}/webcoptions`);
|
669
|
-
return
|
670
|
-
}
|
671
|
-
catch (error) {
|
866
|
+
return await res.json();
|
867
|
+
} catch (error) {
|
672
868
|
console.log(error);
|
673
869
|
}
|
674
870
|
};
|
@@ -676,17 +872,15 @@ const getRut = async () => {
|
|
676
872
|
try {
|
677
873
|
const data = await fetchWithType(`${base$2}/rut`);
|
678
874
|
return data;
|
679
|
-
}
|
680
|
-
catch (error) {
|
875
|
+
} catch (error) {
|
681
876
|
console.log(error);
|
682
877
|
}
|
683
878
|
};
|
684
879
|
const getRot = async () => {
|
685
880
|
try {
|
686
881
|
const res = await fetch(`${base$2}/rot`);
|
687
|
-
return
|
688
|
-
}
|
689
|
-
catch (error) {
|
882
|
+
return await res.json();
|
883
|
+
} catch (error) {
|
690
884
|
console.log(error);
|
691
885
|
}
|
692
886
|
};
|
@@ -694,12 +888,11 @@ const getGreenDiscount = async () => {
|
|
694
888
|
try {
|
695
889
|
const res = await fetch(`${base$2}/green-discount`);
|
696
890
|
return await res.json();
|
697
|
-
}
|
698
|
-
catch (error) {
|
891
|
+
} catch (error) {
|
699
892
|
console.log(error);
|
700
893
|
}
|
701
894
|
};
|
702
|
-
const postOrder = async
|
895
|
+
const postOrder = async data => {
|
703
896
|
try {
|
704
897
|
const res = await fetch(`${base$2}/weborder`, {
|
705
898
|
method: 'POST',
|
@@ -708,15 +901,14 @@ const postOrder = async (data) => {
|
|
708
901
|
'Content-Type': 'application/json',
|
709
902
|
},
|
710
903
|
});
|
711
|
-
return
|
712
|
-
}
|
713
|
-
catch (error) {
|
904
|
+
return await res.json();
|
905
|
+
} catch (error) {
|
714
906
|
console.log(error);
|
715
907
|
}
|
716
908
|
};
|
717
909
|
|
718
|
-
const base$1 = `${
|
719
|
-
const postPerson = async
|
910
|
+
const base$1 = `${'https://hemfixarna.se'}/wp-json/felix`;
|
911
|
+
const postPerson = async felixOrder => {
|
720
912
|
try {
|
721
913
|
return await fetchWithType(`${base$1}/createperson`, {
|
722
914
|
method: 'POST',
|
@@ -725,8 +917,7 @@ const postPerson = async (felixOrder) => {
|
|
725
917
|
'Content-Type': 'application/json',
|
726
918
|
},
|
727
919
|
});
|
728
|
-
}
|
729
|
-
catch (error) {
|
920
|
+
} catch (error) {
|
730
921
|
console.log(error);
|
731
922
|
}
|
732
923
|
};
|
@@ -734,7 +925,7 @@ const postPerson = async (felixOrder) => {
|
|
734
925
|
const HemfixarnaCheckout = class {
|
735
926
|
constructor(hostRef) {
|
736
927
|
registerInstance(this, hostRef);
|
737
|
-
this.handleChangeDate =
|
928
|
+
this.handleChangeDate = e => {
|
738
929
|
this.dateError = null;
|
739
930
|
this.date = e.target.value;
|
740
931
|
};
|
@@ -743,8 +934,7 @@ const HemfixarnaCheckout = class {
|
|
743
934
|
};
|
744
935
|
this.sendOrder = async () => {
|
745
936
|
var _a, _b, _c, _d;
|
746
|
-
if (this.loading)
|
747
|
-
return;
|
937
|
+
if (this.loading) return;
|
748
938
|
this.loading = true;
|
749
939
|
let order = {
|
750
940
|
firstName: state.creditSafeUser.firstName,
|
@@ -788,8 +978,7 @@ const HemfixarnaCheckout = class {
|
|
788
978
|
const felixOrder = await postPerson(order);
|
789
979
|
if (!felixOrder || !((_d = (_c = felixOrder.response) === null || _c === void 0 ? void 0 : _c.scriptResult) === null || _d === void 0 ? void 0 : _d.includes('OK'))) {
|
790
980
|
order = Object.assign(Object.assign({}, order), { felixStatus: 'error' });
|
791
|
-
}
|
792
|
-
else {
|
981
|
+
} else {
|
793
982
|
order = Object.assign(Object.assign({}, order), { felixStatus: 'success' });
|
794
983
|
}
|
795
984
|
try {
|
@@ -798,17 +987,15 @@ const HemfixarnaCheckout = class {
|
|
798
987
|
state.step = 6;
|
799
988
|
const el = this.el.closest('.hemfixarna_content');
|
800
989
|
scrollToTop(el);
|
801
|
-
}
|
802
|
-
else {
|
990
|
+
} else {
|
803
991
|
this.generalError = 'Något gick fel, försök igen senare';
|
804
992
|
}
|
805
|
-
}
|
806
|
-
catch (error) {
|
993
|
+
} catch (error) {
|
807
994
|
this.generalError = 'Något gick fel, försök igen senare';
|
808
995
|
}
|
809
996
|
this.loading = false;
|
810
997
|
};
|
811
|
-
this.handleSubmit =
|
998
|
+
this.handleSubmit = e => {
|
812
999
|
e.preventDefault();
|
813
1000
|
this.generalError = null;
|
814
1001
|
const validDate = this.date.length > 0;
|
@@ -834,7 +1021,7 @@ const HemfixarnaCheckout = class {
|
|
834
1021
|
this.sendOrder();
|
835
1022
|
}
|
836
1023
|
};
|
837
|
-
this.handleKeyDown =
|
1024
|
+
this.handleKeyDown = event => {
|
838
1025
|
this.enteredPin += event.key;
|
839
1026
|
const correctPin = '+0033';
|
840
1027
|
if (this.enteredPin.length === correctPin.length) {
|
@@ -854,15 +1041,89 @@ const HemfixarnaCheckout = class {
|
|
854
1041
|
const down = getAssetPath(`./assets/down.svg`);
|
855
1042
|
const loading = getAssetPath(`./assets/spinner.gif`);
|
856
1043
|
if (state.checkoutEdit) {
|
857
|
-
return h(
|
858
|
-
}
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
1044
|
+
return h('hemfixarna-address', null);
|
1045
|
+
} else if (state.checkoutStep === 1) {
|
1046
|
+
return h('hemfixarna-getuser', null);
|
1047
|
+
} else if (state.checkoutStep === 2) {
|
1048
|
+
return h(
|
1049
|
+
'div',
|
1050
|
+
{ class: 'mb-2' },
|
1051
|
+
h(
|
1052
|
+
'div',
|
1053
|
+
{ class: 'hemfixarna_addressinfo' },
|
1054
|
+
h(
|
1055
|
+
'div',
|
1056
|
+
null,
|
1057
|
+
h('p', null, hideField(state.user.firstName)),
|
1058
|
+
h('p', null, hideField(state.user.lastName)),
|
1059
|
+
h('p', null, state.user.email),
|
1060
|
+
h('p', null, state.user.phone),
|
1061
|
+
),
|
1062
|
+
h('div', null, h('p', null, hideField(state.user.street)), h('p', null, hideField(state.user.zip)), h('p', null, hideField(state.user.town))),
|
1063
|
+
h('button', { onClick: () => (state.checkoutEdit = true) }, 'Beh\u00F6ver du \u00E4ndra adressen?'),
|
1064
|
+
),
|
1065
|
+
h(
|
1066
|
+
'form',
|
1067
|
+
{ onSubmit: e => this.handleSubmit(e) },
|
1068
|
+
h(
|
1069
|
+
'div',
|
1070
|
+
null,
|
1071
|
+
h('img', { src: dateLogo, width: 24 }),
|
1072
|
+
h('input', {
|
1073
|
+
class: `${this.date.length ? 'input_active' : ''}`,
|
1074
|
+
min: new Date().toISOString().split('T')[0],
|
1075
|
+
onChange: e => this.handleChangeDate(e),
|
1076
|
+
type: 'date',
|
1077
|
+
name: 'date',
|
1078
|
+
value: this.date,
|
1079
|
+
}),
|
1080
|
+
h('label', { htmlFor: 'date' }, 'Tidigaste datum f\u00F6r hembes\u00F6k'),
|
1081
|
+
h('img', { src: down, width: 24 }),
|
1082
|
+
),
|
1083
|
+
this.dateError && h('span', null, this.dateError),
|
1084
|
+
state.customer.source && this.showSources
|
1085
|
+
? h(
|
1086
|
+
Fragment,
|
1087
|
+
null,
|
1088
|
+
h('p', null, 'Inloggad som:', h('strong', null, ' ', state.customer.source.fieldData.So01_Name)),
|
1089
|
+
h('label', null, 'S\u00E4ljare (S\u00E4ljarId)', h('input', { type: 'text', value: this.sellerID, onChange: e => (this.sellerID = e.target.value) })),
|
1090
|
+
h('label', null, 'PartnerOrderID (RefferalID)', h('input', { type: 'text', value: this.RefferalID, onChange: e => (this.RefferalID = e.target.value) })),
|
1091
|
+
((_a = state.customer.source.sub_sources) === null || _a === void 0 ? void 0 : _a.length)
|
1092
|
+
? h(
|
1093
|
+
'div',
|
1094
|
+
null,
|
1095
|
+
h(
|
1096
|
+
'select',
|
1097
|
+
{ onChange: e => (this.selectedSubSource = e.target.value) },
|
1098
|
+
h('option', { disabled: true, selected: true, value: 'null' }, 'V\u00E4lj underk\u00E4lla'),
|
1099
|
+
state.customer.source.sub_sources.map(sub => h('option', { value: sub['So_SubSource::_id'] }, sub['So_SubSource::Sus01_Name'])),
|
1100
|
+
),
|
1101
|
+
)
|
1102
|
+
: h('h4', null, 'Det finns inga underk\u00E4llor att v\u00E4lja'),
|
1103
|
+
)
|
1104
|
+
: null,
|
1105
|
+
h('label', { class: 'hemfixarna_checkbox' }, h('input', { onChange: () => this.handleChangeTerms(), type: 'checkbox' }), h('span', { innerHTML: state.options.terms })),
|
1106
|
+
state.cart
|
1107
|
+
.filter(i => {
|
1108
|
+
var _a;
|
1109
|
+
return (_a = i.terms_checkout) === null || _a === void 0 ? void 0 : _a.length;
|
1110
|
+
})
|
1111
|
+
.map(item =>
|
1112
|
+
h(
|
1113
|
+
Fragment,
|
1114
|
+
null,
|
1115
|
+
h('label', { class: 'hemfixarna_checkbox' }, h('input', { onChange: () => this.handleChangeTerms(), type: 'checkbox' }), h('span', null, item.terms_checkout)),
|
1116
|
+
),
|
1117
|
+
),
|
1118
|
+
this.generalError && h('span', null, this.generalError),
|
1119
|
+
h(
|
1120
|
+
'div',
|
1121
|
+
{ class: this.loading ? 'loading' : '' },
|
1122
|
+
h('input', { type: 'submit', value: this.loading ? '' : 'Skicka bokning' }),
|
1123
|
+
h('img', { width: 20, height: 20, src: loading, alt: 'spinner' }),
|
1124
|
+
),
|
1125
|
+
),
|
1126
|
+
);
|
866
1127
|
}
|
867
1128
|
};
|
868
1129
|
this.date = '';
|
@@ -891,17 +1152,19 @@ const HemfixarnaCheckout = class {
|
|
891
1152
|
disconnectedCallback() {
|
892
1153
|
window.removeEventListener('keydown', this.handleKeyDown);
|
893
1154
|
}
|
894
|
-
get el() {
|
1155
|
+
get el() {
|
1156
|
+
return getElement(this);
|
1157
|
+
}
|
895
1158
|
};
|
896
1159
|
|
897
|
-
const hemfixarnaCss = "@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap\");\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n* {\n box-sizing: border-box;\n}\n\n:host {\n font-family: \"Inter\", sans-serif;\n}\n:host input[type=text] {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host .mb-2 {\n margin-bottom: 32px;\n}\n:host button {\n color: #474444;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n position: relative;\n}\n:host form button {\n position: absolute;\n right: 0;\n top: -1rem;\n}\n:host form img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n}\n:host form img:first-of-type {\n left: 16px;\n}\n:host form img:last-of-type {\n right: 16px;\n}\n:host form span {\n margin-top: -8px;\n color: #ec6632;\n}\n:host form p {\n text-align: center;\n}\n:host form p {\n margin: 0;\n}\n:host form div {\n position: relative;\n}\n:host form div label {\n pointer-events: none;\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: #fff;\n padding: 4px;\n transition: 0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host form div input {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host form div input:focus ~ label,\n:host form div .input_active ~ label {\n top: 0;\n transform: translateY(-50%);\n background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);\n}\n:host form select {\n padding: 0.75rem 1rem;\n width: 100%;\n}\n:host h1 {\n font-size: 24px;\n font-weight: 400;\n line-height: 32px;\n letter-spacing: -3%;\n text-align: left;\n margin: 0 0 8px;\n}\n:host h2 {\n margin: 0 0 24px;\n font-weight: 700;\n font-size: 20px;\n line-height: 28px;\n letter-spacing: -3%;\n}\n:host p {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna {\n width: 100%;\n /* Hide default HTML checkbox */\n /* The slider */\n}\n:host .hemfixarna_contact {\n display: flex;\n gap: 16px;\n}\n:host .hemfixarna_contact a {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #474444;\n text-decoration: none;\n font-weight: 600;\n font-size: 13px;\n}\n:host .hemfixarna_contact a:hover {\n text-decoration: underline;\n}\n:host .hemfixarna_contact--horizontal span {\n display: none;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_contact--horizontal span {\n display: initial;\n }\n}\n:host .hemfixarna_painting {\n opacity: 0;\n padding: 0 1rem;\n animation: fadeIn 0.5s forwards 0.3s;\n}\n:host .hemfixarna_painting > h2,\n:host .hemfixarna_painting p {\n text-align: center;\n padding: 0 16px;\n}\n:host .hemfixarna_painting > h2 {\n margin: 0 0 8px;\n}\n:host .hemfixarna_partnerlogo {\n max-height: 50px;\n min-height: 45px;\n object-fit: contain;\n max-width: 150px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_partnerlogo {\n max-width: 200px;\n }\n}\n:host .hemfixarna_nav {\n position: absolute;\n top: 0;\n width: 100dvw;\n left: 0;\n height: 80px;\n z-index: 9999;\n}\n:host .hemfixarna_nav--links {\n display: none !important;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav--links {\n display: flex !important;\n }\n}\n:host .hemfixarna_nav--links a {\n color: #ec6632;\n text-decoration: none;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 56px;\n padding: 8px 32px;\n text-transform: capitalize;\n}\n:host .hemfixarna_nav > div {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav > div {\n padding: 0 32px;\n }\n}\n:host .hemfixarna_nav > div > div {\n display: flex;\n gap: 32px;\n justify-content: space-between;\n}\n:host .hemfixarna_nav > div > img {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n}\n:host .hemfixarna_nav a {\n text-decoration: none;\n}\n:host .hemfixarna_nav p {\n color: #474444;\n}\n:host .hemfixarna_nav p.with-bg {\n color: #fff;\n}\n:host .hemfixarna_standalone .hemfixarna_backdrop {\n background: #fffaf2;\n opacity: 1;\n}\n:host .hemfixarna_standalone .hemfixarna_modal {\n top: 80px;\n transform: translateX(-50%);\n border: none;\n height: calc(100dvh - 80px);\n opacity: 0;\n}\n:host .hemfixarna_standalone .hemfixarna_modal--open {\n opacity: 1;\n}\n:host .hemfixarna .switch {\n position: relative;\n display: inline-block;\n width: 40px;\n height: 20px;\n}\n:host .hemfixarna .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n:host .hemfixarna .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 34px;\n}\n:host .hemfixarna .slider:before {\n position: absolute;\n content: \"\";\n height: 18px;\n width: 18px;\n left: 2px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 50%;\n}\n:host .hemfixarna input:checked + .slider {\n background-color: #fcd9c9;\n}\n:host .hemfixarna input:focus + .slider {\n box-shadow: 0 0 1px #fcd9c9;\n}\n:host .hemfixarna input:checked + .slider:before {\n -webkit-transform: translateX(18px);\n -ms-transform: translateX(18px);\n transform: translateX(18px);\n background: #ec6632;\n}\n:host .hemfixarna_maleribox {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n width: 100%;\n min-height: 132px;\n padding: 24px;\n display: flex;\n align-items: center;\n gap: 24px;\n text-align: left;\n}\n:host .hemfixarna_maleribox:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_checkbox {\n display: grid;\n grid-template-columns: 40px auto;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna_checkbox > span {\n transform: translateY(6px);\n}\n:host .hemfixarna_checkbox span,\n:host .hemfixarna_checkbox span p {\n color: #474444;\n font-size: 14px;\n}\n:host .hemfixarna_checkbox p {\n text-align: left;\n}\n:host .hemfixarna_info {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n border-radius: 4px;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_info h2 {\n margin: 0;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_info {\n position: sticky;\n top: 0;\n }\n}\n:host .hemfixarna_infomodal {\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n max-width: 80%;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n padding: 32px;\n z-index: 99;\n border-radius: 4px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host .hemfixarna_infomodal p,\n:host .hemfixarna_infomodal h4 {\n margin: 0;\n}\n:host .hemfixarna_infomodal button {\n background: #ec6632;\n color: #fff;\n border-radius: 60px;\n font-size: 16px;\n padding: 8px 16px;\n}\n:host .hemfixarna_addressinfo {\n padding: 16px 16px 64px;\n border: 1px solid #fcd9c9;\n position: relative;\n margin-bottom: 32px;\n display: grid;\n grid-template-columns: 1fr;\n gap: 8px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_addressinfo {\n grid-template-columns: 1fr 1fr;\n }\n}\n:host .hemfixarna_addressinfo button {\n position: absolute;\n bottom: 16px;\n right: 16px;\n font-weight: 500;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n:host .hemfixarna_part {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: grid;\n padding: 16px;\n grid-template-columns: auto 75px;\n}\n:host .hemfixarna_counter {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_counter span {\n padding: 0 8px;\n}\n:host .hemfixarna_counter img {\n cursor: pointer;\n}\n:host .hemfixarna_counter img:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_description {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_description ul {\n list-style: disc;\n padding-right: 12px;\n transform: translateX(12px);\n}\n:host .hemfixarna_description--hidden {\n max-height: 140px;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n}\n:host .hemfixarna_description--hidden::after {\n content: \"\";\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 128px;\n background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2);\n}\n:host .hemfixarna_terms {\n font-size: 14px;\n}\n:host .hemfixarna_terms a {\n color: inherit;\n}\n:host .hemfixarna_logo {\n height: 64px;\n}\n:host .hemfixarna_box {\n padding: 16px;\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n border-radius: 4px;\n gap: 16px 8px;\n border-radius: 4px;\n gap: 16px 8px;\n}\n:host .hemfixarna_box p,\n:host .hemfixarna_box span {\n font-size: 15px;\n}\n:host .hemfixarna_box .underline {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n:host .hemfixarna_box .pointer {\n cursor: pointer;\n}\n:host .hemfixarna_box .p-s {\n font-size: 12px;\n}\n:host .hemfixarna_box > div {\n display: grid;\n gap: 8px;\n}\n:host .hemfixarna_box--standard {\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_box--alternative, :host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n background: transparent;\n border: 1px solid #e3e3e3;\n}\n:host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725);\n}\n:host .hemfixarna_box--alternative_3 {\n justify-content: center;\n}\n:host .hemfixarna_altbtn {\n display: flex !important;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n margin-left: auto;\n}\n:host .hemfixarna_btn {\n margin-left: auto;\n}\n:host .hemfixarna_btn, :host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n border: none;\n border-radius: 60px;\n font-weight: 600;\n letter-spacing: 0.5px;\n line-height: 20px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_btn:not(.disabled):hover, :host .hemfixarna_buy:not(.disabled):hover,\n:host .hemfixarna input[type=submit]:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna div:has(> input[type=submit]) {\n position: relative;\n}\n:host .hemfixarna div:has(> input[type=submit]) input {\n cursor: pointer;\n}\n:host .hemfixarna div:has(> input[type=submit]) img {\n display: none;\n}\n:host .hemfixarna .loading {\n cursor: default;\n opacity: 0.6;\n}\n:host .hemfixarna .loading > img {\n display: initial !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n:host .hemfixarna_btn {\n font-size: 14px;\n background: #c84e18;\n color: #fff;\n padding: 16px 24px;\n white-space: nowrap;\n position: relative;\n}\n:host .hemfixarna_btn span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_btn span {\n background: #25a710;\n color: #fff;\n right: 0 !important;\n}\n:host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n font-size: 21px;\n background: #25a710;\n color: #fff;\n padding: 16px 24px;\n}\n:host .hemfixarna .disabled {\n opacity: 0.5;\n cursor: default;\n}\n:host .hemfixarna_modal {\n position: fixed;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n border-radius: 4px;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n transform: translate(-50%, -50%) scale(0.7);\n opacity: 0;\n height: 92%;\n width: 92%;\n max-width: 920px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host .hemfixarna_modal--open {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n:host .hemfixarna_backdrop {\n z-index: 999;\n position: fixed;\n background: #474444;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n transition: transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host .hemfixarna_backdrop--open {\n opacity: 0.3;\n}\n:host .hemfixarna_order {\n position: absolute;\n top: -1px;\n left: -1px;\n right: -1px;\n bottom: -1px;\n background-repeat: no-repeat !important;\n background-size: cover !important;\n background-position: center !important;\n display: grid;\n grid-template-columns: 1fr 1fr;\n padding: 48px 32px 64px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_order {\n grid-template-columns: 1fr;\n grid-template-rows: 0 auto;\n }\n}\n:host .hemfixarna_order > div:last-of-type {\n background: #fffaf2;\n padding: 32px;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow: auto;\n}\n:host .hemfixarna_order img {\n cursor: pointer;\n}\n:host .hemfixarna_order button {\n margin: 16px 0;\n padding: 0;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-size: 14px;\n font-weight: 600;\n}\n:host .hemfixarna_cart {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart {\n grid-template-columns: 1fr;\n gap: 0;\n }\n}\n:host .hemfixarna_cart--right h2, :host .hemfixarna_cart--left h2 {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_cart--right h2 img, :host .hemfixarna_cart--left h2 img {\n margin-top: 3.2px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_cart--left h2 button {\n display: none;\n }\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart--right h2 button {\n display: none;\n }\n}\n:host .hemfixarna_cart--startfee {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot div {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_cart--additional {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--additional p {\n font-size: 14px;\n}\n:host .hemfixarna_cart--additional strong {\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n position: relative;\n}\n:host .hemfixarna_cart--additional strong img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: -24px;\n}\n:host .hemfixarna_cart--price {\n border-top: 1px solid #fcd9c9;\n padding: 16px;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--price h3 {\n margin: 0;\n}\n:host .hemfixarna_cart--item {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 0;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--item span {\n font-size: 12px;\n}\n:host .hemfixarna_cart--item > div {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--item > div > div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n:host .hemfixarna_cart--item > div button {\n color: #ec6632;\n}\n:host .hemfixarna_categories {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n:host .hemfixarna_categories--wrapper {\n gap: 32px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_categories--wrapper {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_categories li {\n position: relative;\n background: #fff;\n border-radius: 4px;\n min-height: 132px;\n padding: 24px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n align-items: center;\n gap: 24px;\n cursor: pointer;\n}\n:host .hemfixarna_categories li:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_categories li > button {\n height: 100%;\n width: 100%;\n}\n:host .hemfixarna_categories li .price {\n font-weight: 700;\n}\n:host .hemfixarna_content {\n height: 100%;\n overflow: auto;\n padding: 0 32px 64px;\n}\n:host .hemfixarna_content--5 {\n padding-top: 16px;\n}\n:host .hemfixarna_content--painting {\n padding: 0;\n overflow: initial;\n}\n:host .hemfixarna_crumbs {\n position: relative;\n padding: 16px 24px;\n border-bottom: 1px solid #fcd9c9;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_crumbs--back {\n padding: 16px 24px 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs--back:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs img {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .close {\n position: absolute;\n right: -16px;\n top: -16px;\n z-index: 9;\n -webkit-transform: translate3d(0, 0, 0);\n}\n:host .hemfixarna_crumbs .cart {\n display: flex;\n padding-left: 16px;\n position: relative;\n}\n:host .hemfixarna_crumbs .cart img {\n cursor: inherit;\n}\n:host .hemfixarna_crumbs .cart span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_crumbs .cart_active {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .cart_active span {\n background: #25a710;\n color: #fff;\n}\n:host .hemfixarna_crumbs--links {\n display: flex;\n align-items: center;\n gap: 16px;\n overflow: auto;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_crumbs--links {\n -ms-overflow-style: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar {\n display: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar-button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs--right {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_crumbs button {\n white-space: nowrap;\n background: #f1ded6;\n border-radius: 64px;\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.3px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs button:not(.active):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n@media (max-width: 768px) {\n :host .hemfixarna_crumbs button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs .active {\n background: #fffaf2;\n cursor: default;\n}\n:host .hemfixarna_features {\n gap: 12px !important;\n}\n:host .hemfixarna_features li {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_address {\n margin-bottom: 16px;\n}\n:host .hemfixarna_product {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_product--link {\n font-weight: 700;\n color: #474444;\n text-underline-offset: 4px;\n}\n:host .hemfixarna_product--left {\n gap: 32px;\n}\n:host .hemfixarna_product--right {\n gap: 32px;\n}\n:host .hemfixarna_product--price {\n margin-top: 4px;\n font-weight: 700;\n}\n:host .hemfixarna_product--total {\n text-align: center;\n margin: -16px 0;\n font-size: 21px;\n line-height: 28px;\n}\n:host .hemfixarna_product--item {\n background: #fff;\n padding: 16px;\n display: grid;\n grid-template-columns: auto 75px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_product--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--grid {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_product--grid > div {\n display: flex;\n flex-direction: column;\n}\n:host .hemfixarna_product--grid ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n:host .hemfixarna_product p {\n margin: 0;\n}\n:host .hemfixarna_product--top {\n display: flex;\n gap: 32px;\n}\n:host .hemfixarna_product--top img {\n object-fit: contain;\n}\n:host .hemfixarna_product--top > div {\n width: 100%;\n}\n:host .hemfixarna_product--top > div h1 {\n max-width: 80%;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--top > div h1 {\n max-width: 100%;\n }\n}\n:host .hemfixarna_product--top h4 {\n margin-bottom: 8px;\n}\n:host h5,\n:host p {\n margin: 0;\n}\n:host input[type=submit] {\n cursor: pointer;\n}\n:host input[type=date] ~ label {\n left: 56px;\n}\n:host input[type=date] {\n border: 1px solid #fcd9c9;\n padding-left: 64px;\n}\n:host input[type=checkbox] {\n height: 18px;\n width: 18px;\n border: 1px solid #fcd9c9;\n}\n:host input[type=checkbox]:checked {\n background: red;\n}\n:host input[type=date]::-webkit-calendar-picker-indicator {\n background: transparent;\n bottom: 0;\n color: transparent;\n cursor: pointer;\n height: auto;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: auto;\n}\n:host button,\n:host a {\n cursor: pointer;\n background: none;\n border: none;\n}\n:host ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}";
|
1160
|
+
const hemfixarnaCss =
|
1161
|
+
'@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n* {\n box-sizing: border-box;\n}\n\n:host {\n font-family: "Inter", sans-serif;\n}\n:host input[type=text] {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host .mb-2 {\n margin-bottom: 32px;\n}\n:host button {\n color: #474444;\n}\n:host form {\n display: flex;\n flex-direction: column;\n gap: 16px;\n position: relative;\n}\n:host form button {\n position: absolute;\n right: 0;\n top: -1rem;\n}\n:host form img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n}\n:host form img:first-of-type {\n left: 16px;\n}\n:host form img:last-of-type {\n right: 16px;\n}\n:host form span {\n margin-top: -8px;\n color: #ec6632;\n}\n:host form p {\n text-align: center;\n}\n:host form p {\n margin: 0;\n}\n:host form div {\n position: relative;\n}\n:host form div label {\n pointer-events: none;\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: #fff;\n padding: 4px;\n transition: 0.2s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host form div input {\n padding: 16px;\n width: 100%;\n font-size: 16px;\n border: 1px solid #fcd9c9;\n}\n:host form div input:focus ~ label,\n:host form div .input_active ~ label {\n top: 0;\n transform: translateY(-50%);\n background: linear-gradient(180deg, #fffaf2 50%, #fff 50%);\n}\n:host form select {\n padding: 0.75rem 1rem;\n width: 100%;\n}\n:host h1 {\n font-size: 24px;\n font-weight: 400;\n line-height: 32px;\n letter-spacing: -3%;\n text-align: left;\n margin: 0 0 8px;\n}\n:host h2 {\n margin: 0 0 24px;\n font-weight: 700;\n font-size: 20px;\n line-height: 28px;\n letter-spacing: -3%;\n}\n:host p {\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna {\n width: 100%;\n /* Hide default HTML checkbox */\n /* The slider */\n}\n:host .hemfixarna_contact {\n display: flex;\n gap: 16px;\n}\n:host .hemfixarna_contact a {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #474444;\n text-decoration: none;\n font-weight: 600;\n font-size: 13px;\n}\n:host .hemfixarna_contact a:hover {\n text-decoration: underline;\n}\n:host .hemfixarna_contact--horizontal span {\n display: none;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_contact--horizontal span {\n display: initial;\n }\n}\n:host .hemfixarna_painting {\n opacity: 0;\n padding: 0 1rem;\n animation: fadeIn 0.5s forwards 0.3s;\n}\n:host .hemfixarna_painting > h2,\n:host .hemfixarna_painting p {\n text-align: center;\n padding: 0 16px;\n}\n:host .hemfixarna_painting > h2 {\n margin: 0 0 8px;\n}\n:host .hemfixarna_partnerlogo {\n max-height: 50px;\n min-height: 45px;\n object-fit: contain;\n max-width: 150px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_partnerlogo {\n max-width: 200px;\n }\n}\n:host .hemfixarna_nav {\n position: absolute;\n top: 0;\n width: 100dvw;\n left: 0;\n height: 80px;\n z-index: 9999;\n}\n:host .hemfixarna_nav--links {\n display: none !important;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav--links {\n display: flex !important;\n }\n}\n:host .hemfixarna_nav--links a {\n color: #ec6632;\n text-decoration: none;\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 56px;\n padding: 8px 32px;\n text-transform: capitalize;\n}\n:host .hemfixarna_nav > div {\n position: relative;\n overflow: hidden;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_nav > div {\n padding: 0 32px;\n }\n}\n:host .hemfixarna_nav > div > div {\n display: flex;\n gap: 32px;\n justify-content: space-between;\n}\n:host .hemfixarna_nav > div > img {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: -1;\n}\n:host .hemfixarna_nav a {\n text-decoration: none;\n}\n:host .hemfixarna_nav p {\n color: #474444;\n}\n:host .hemfixarna_nav p.with-bg {\n color: #fff;\n}\n:host .hemfixarna_standalone .hemfixarna_backdrop {\n background: #fffaf2;\n opacity: 1;\n}\n:host .hemfixarna_standalone .hemfixarna_modal {\n top: 80px;\n transform: translateX(-50%);\n border: none;\n height: calc(100dvh - 80px);\n opacity: 0;\n}\n:host .hemfixarna_standalone .hemfixarna_modal--open {\n opacity: 1;\n}\n:host .hemfixarna .switch {\n position: relative;\n display: inline-block;\n width: 40px;\n height: 20px;\n}\n:host .hemfixarna .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n:host .hemfixarna .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 34px;\n}\n:host .hemfixarna .slider:before {\n position: absolute;\n content: "";\n height: 18px;\n width: 18px;\n left: 2px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border-radius: 50%;\n}\n:host .hemfixarna input:checked + .slider {\n background-color: #fcd9c9;\n}\n:host .hemfixarna input:focus + .slider {\n box-shadow: 0 0 1px #fcd9c9;\n}\n:host .hemfixarna input:checked + .slider:before {\n -webkit-transform: translateX(18px);\n -ms-transform: translateX(18px);\n transform: translateX(18px);\n background: #ec6632;\n}\n:host .hemfixarna_maleribox {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n width: 100%;\n min-height: 132px;\n padding: 24px;\n display: flex;\n align-items: center;\n gap: 24px;\n text-align: left;\n}\n:host .hemfixarna_maleribox:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_checkbox {\n display: grid;\n grid-template-columns: 40px auto;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: -3%;\n}\n:host .hemfixarna_checkbox > span {\n transform: translateY(6px);\n}\n:host .hemfixarna_checkbox span,\n:host .hemfixarna_checkbox span p {\n color: #474444;\n font-size: 14px;\n}\n:host .hemfixarna_checkbox p {\n text-align: left;\n}\n:host .hemfixarna_info {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 32px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n border-radius: 4px;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_info h2 {\n margin: 0;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_info {\n position: sticky;\n top: 0;\n }\n}\n:host .hemfixarna_infomodal {\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n max-width: 80%;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n padding: 32px;\n z-index: 99;\n border-radius: 4px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n:host .hemfixarna_infomodal p,\n:host .hemfixarna_infomodal h4 {\n margin: 0;\n}\n:host .hemfixarna_infomodal button {\n background: #ec6632;\n color: #fff;\n border-radius: 60px;\n font-size: 16px;\n padding: 8px 16px;\n}\n:host .hemfixarna_addressinfo {\n padding: 16px 16px 64px;\n border: 1px solid #fcd9c9;\n position: relative;\n margin-bottom: 32px;\n display: grid;\n grid-template-columns: 1fr;\n gap: 8px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_addressinfo {\n grid-template-columns: 1fr 1fr;\n }\n}\n:host .hemfixarna_addressinfo button {\n position: absolute;\n bottom: 16px;\n right: 16px;\n font-weight: 500;\n text-underline-offset: 2px;\n text-decoration: underline;\n}\n:host .hemfixarna_part {\n background: #fff;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: grid;\n padding: 16px;\n grid-template-columns: auto 75px;\n}\n:host .hemfixarna_counter {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_counter span {\n padding: 0 8px;\n}\n:host .hemfixarna_counter img {\n cursor: pointer;\n}\n:host .hemfixarna_counter img:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_description {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_description ul {\n list-style: disc;\n padding-right: 12px;\n transform: translateX(12px);\n}\n:host .hemfixarna_description--hidden {\n max-height: 140px;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n}\n:host .hemfixarna_description--hidden::after {\n content: "";\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 128px;\n background: linear-gradient(180deg, rgba(255, 253, 250, 0), rgba(255, 253, 250, 0.46) 50%, #fffaf2);\n}\n:host .hemfixarna_terms {\n font-size: 14px;\n}\n:host .hemfixarna_terms a {\n color: inherit;\n}\n:host .hemfixarna_logo {\n height: 64px;\n}\n:host .hemfixarna_box {\n padding: 16px;\n display: flex;\n align-items: center;\n width: 100%;\n box-sizing: border-box;\n border-radius: 4px;\n gap: 16px 8px;\n border-radius: 4px;\n gap: 16px 8px;\n}\n:host .hemfixarna_box p,\n:host .hemfixarna_box span {\n font-size: 15px;\n}\n:host .hemfixarna_box .underline {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n:host .hemfixarna_box .pointer {\n cursor: pointer;\n}\n:host .hemfixarna_box .p-s {\n font-size: 12px;\n}\n:host .hemfixarna_box > div {\n display: grid;\n gap: 8px;\n}\n:host .hemfixarna_box--standard {\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n}\n:host .hemfixarna_box--alternative, :host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n background: transparent;\n border: 1px solid #e3e3e3;\n}\n:host .hemfixarna_box--alternative_2, :host .hemfixarna_box--alternative_3 {\n box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.0784313725);\n}\n:host .hemfixarna_box--alternative_3 {\n justify-content: center;\n}\n:host .hemfixarna_altbtn {\n display: flex !important;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n margin-left: auto;\n}\n:host .hemfixarna_btn {\n margin-left: auto;\n}\n:host .hemfixarna_btn, :host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n border: none;\n border-radius: 60px;\n font-weight: 600;\n letter-spacing: 0.5px;\n line-height: 20px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_btn:not(.disabled):hover, :host .hemfixarna_buy:not(.disabled):hover,\n:host .hemfixarna input[type=submit]:not(.disabled):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna div:has(> input[type=submit]) {\n position: relative;\n}\n:host .hemfixarna div:has(> input[type=submit]) input {\n cursor: pointer;\n}\n:host .hemfixarna div:has(> input[type=submit]) img {\n display: none;\n}\n:host .hemfixarna .loading {\n cursor: default;\n opacity: 0.6;\n}\n:host .hemfixarna .loading > img {\n display: initial !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n:host .hemfixarna_btn {\n font-size: 14px;\n background: #c84e18;\n color: #fff;\n padding: 16px 24px;\n white-space: nowrap;\n position: relative;\n}\n:host .hemfixarna_btn span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_btn span {\n background: #25a710;\n color: #fff;\n right: 0 !important;\n}\n:host .hemfixarna_buy,\n:host .hemfixarna input[type=submit] {\n font-size: 21px;\n background: #25a710;\n color: #fff;\n padding: 16px 24px;\n}\n:host .hemfixarna .disabled {\n opacity: 0.5;\n cursor: default;\n}\n:host .hemfixarna_modal {\n position: fixed;\n background: #fffaf2;\n border: 1px solid #fcd9c9;\n border-radius: 4px;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n transform: translate(-50%, -50%) scale(0.7);\n opacity: 0;\n height: 92%;\n width: 92%;\n max-width: 920px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n:host .hemfixarna_modal--open {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n}\n:host .hemfixarna_backdrop {\n z-index: 999;\n position: fixed;\n background: #474444;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n transition: transform 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946), opacity 0.1s cubic-bezier(0.465, 0.183, 0.153, 0.946);\n}\n:host .hemfixarna_backdrop--open {\n opacity: 0.3;\n}\n:host .hemfixarna_order {\n position: absolute;\n top: -1px;\n left: -1px;\n right: -1px;\n bottom: -1px;\n background-repeat: no-repeat !important;\n background-size: cover !important;\n background-position: center !important;\n display: grid;\n grid-template-columns: 1fr 1fr;\n padding: 48px 32px 64px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_order {\n grid-template-columns: 1fr;\n grid-template-rows: 0 auto;\n }\n}\n:host .hemfixarna_order > div:last-of-type {\n background: #fffaf2;\n padding: 32px;\n display: flex;\n flex-direction: column;\n max-height: 100%;\n overflow: auto;\n}\n:host .hemfixarna_order img {\n cursor: pointer;\n}\n:host .hemfixarna_order button {\n margin: 16px 0;\n padding: 0;\n text-decoration: underline;\n text-underline-offset: 2px;\n font-size: 14px;\n font-weight: 600;\n}\n:host .hemfixarna_cart {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart {\n grid-template-columns: 1fr;\n gap: 0;\n }\n}\n:host .hemfixarna_cart--right h2, :host .hemfixarna_cart--left h2 {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_cart--right h2 img, :host .hemfixarna_cart--left h2 img {\n margin-top: 3.2px;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_cart--left h2 button {\n display: none;\n }\n}\n@media (max-width: 768px) {\n :host .hemfixarna_cart--right h2 button {\n display: none;\n }\n}\n:host .hemfixarna_cart--startfee {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--rutrot div {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_cart--additional {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 16px;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--additional p {\n font-size: 14px;\n}\n:host .hemfixarna_cart--additional strong {\n text-decoration: underline;\n text-underline-offset: 2px;\n cursor: pointer;\n position: relative;\n}\n:host .hemfixarna_cart--additional strong img {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: -24px;\n}\n:host .hemfixarna_cart--price {\n border-top: 1px solid #fcd9c9;\n padding: 16px;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--price h3 {\n margin: 0;\n}\n:host .hemfixarna_cart--item {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 16px 0;\n border-top: 1px solid #fcd9c9;\n}\n:host .hemfixarna_cart--item span {\n font-size: 12px;\n}\n:host .hemfixarna_cart--item > div {\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_cart--item > div > div {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n:host .hemfixarna_cart--item > div button {\n color: #ec6632;\n}\n:host .hemfixarna_categories {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n:host .hemfixarna_categories--wrapper {\n gap: 32px;\n display: grid;\n grid-template-columns: 1fr 1fr;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_categories--wrapper {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_categories li {\n position: relative;\n background: #fff;\n border-radius: 4px;\n min-height: 132px;\n padding: 24px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n display: flex;\n align-items: center;\n gap: 24px;\n cursor: pointer;\n}\n:host .hemfixarna_categories li:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_categories li > button {\n height: 100%;\n width: 100%;\n}\n:host .hemfixarna_categories li .price {\n font-weight: 700;\n}\n:host .hemfixarna_content {\n height: 100%;\n overflow: auto;\n padding: 0 32px 64px;\n}\n:host .hemfixarna_content--5 {\n padding-top: 16px;\n}\n:host .hemfixarna_content--painting {\n padding: 0;\n overflow: initial;\n}\n:host .hemfixarna_crumbs {\n position: relative;\n padding: 16px 24px;\n border-bottom: 1px solid #fcd9c9;\n display: flex;\n justify-content: space-between;\n}\n:host .hemfixarna_crumbs--back {\n padding: 16px 24px 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs--back:hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_crumbs img {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .close {\n position: absolute;\n right: -16px;\n top: -16px;\n z-index: 9;\n -webkit-transform: translate3d(0, 0, 0);\n}\n:host .hemfixarna_crumbs .cart {\n display: flex;\n padding-left: 16px;\n position: relative;\n}\n:host .hemfixarna_crumbs .cart img {\n cursor: inherit;\n}\n:host .hemfixarna_crumbs .cart span {\n position: absolute;\n background: #fff;\n border-radius: 100%;\n width: 24px;\n height: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 13px;\n line-height: 11px;\n top: -6px;\n right: -12px;\n}\n:host .hemfixarna_crumbs .cart_active {\n cursor: pointer;\n}\n:host .hemfixarna_crumbs .cart_active span {\n background: #25a710;\n color: #fff;\n}\n:host .hemfixarna_crumbs--links {\n display: flex;\n align-items: center;\n gap: 16px;\n overflow: auto;\n}\n@media (min-width: 769px) {\n :host .hemfixarna_crumbs--links {\n -ms-overflow-style: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar {\n display: none;\n }\n :host .hemfixarna_crumbs--links::-webkit-scrollbar-button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs--right {\n display: flex;\n align-items: center;\n}\n:host .hemfixarna_crumbs button {\n white-space: nowrap;\n background: #f1ded6;\n border-radius: 64px;\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.3px;\n box-shadow: none !important;\n}\n:host .hemfixarna_crumbs button:not(.active):hover {\n transition: 0.1s all cubic-bezier(0.465, 0.183, 0.153, 0.946);\n filter: brightness(1.02);\n transform: scale(1.01);\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.0392156863);\n}\n@media (max-width: 768px) {\n :host .hemfixarna_crumbs button {\n display: none;\n }\n}\n:host .hemfixarna_crumbs .active {\n background: #fffaf2;\n cursor: default;\n}\n:host .hemfixarna_features {\n gap: 12px !important;\n}\n:host .hemfixarna_features li {\n display: flex;\n gap: 16px;\n align-items: center;\n}\n:host .hemfixarna_address {\n margin-bottom: 16px;\n}\n:host .hemfixarna_product {\n display: grid;\n gap: 16px;\n}\n:host .hemfixarna_product--link {\n font-weight: 700;\n color: #474444;\n text-underline-offset: 4px;\n}\n:host .hemfixarna_product--left {\n gap: 32px;\n}\n:host .hemfixarna_product--right {\n gap: 32px;\n}\n:host .hemfixarna_product--price {\n margin-top: 4px;\n font-weight: 700;\n}\n:host .hemfixarna_product--total {\n text-align: center;\n margin: -16px 0;\n font-size: 21px;\n line-height: 28px;\n}\n:host .hemfixarna_product--item {\n background: #fff;\n padding: 16px;\n display: grid;\n grid-template-columns: auto 75px;\n box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.0392156863);\n}\n:host .hemfixarna_product--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 32px;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--grid {\n grid-template-columns: 1fr;\n }\n}\n:host .hemfixarna_product--grid > div {\n display: flex;\n flex-direction: column;\n}\n:host .hemfixarna_product--grid ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n:host .hemfixarna_product p {\n margin: 0;\n}\n:host .hemfixarna_product--top {\n display: flex;\n gap: 32px;\n}\n:host .hemfixarna_product--top img {\n object-fit: contain;\n}\n:host .hemfixarna_product--top > div {\n width: 100%;\n}\n:host .hemfixarna_product--top > div h1 {\n max-width: 80%;\n}\n@media (max-width: 768px) {\n :host .hemfixarna_product--top > div h1 {\n max-width: 100%;\n }\n}\n:host .hemfixarna_product--top h4 {\n margin-bottom: 8px;\n}\n:host h5,\n:host p {\n margin: 0;\n}\n:host input[type=submit] {\n cursor: pointer;\n}\n:host input[type=date] ~ label {\n left: 56px;\n}\n:host input[type=date] {\n border: 1px solid #fcd9c9;\n padding-left: 64px;\n}\n:host input[type=checkbox] {\n height: 18px;\n width: 18px;\n border: 1px solid #fcd9c9;\n}\n:host input[type=checkbox]:checked {\n background: red;\n}\n:host input[type=date]::-webkit-calendar-picker-indicator {\n background: transparent;\n bottom: 0;\n color: transparent;\n cursor: pointer;\n height: auto;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n width: auto;\n}\n:host button,\n:host a {\n cursor: pointer;\n background: none;\n border: none;\n}\n:host ul {\n list-style: none;\n margin: 0;\n padding: 0;\n}';
|
898
1162
|
|
899
1163
|
const HemfixarnaComponent = class {
|
900
1164
|
constructor(hostRef) {
|
901
1165
|
registerInstance(this, hostRef);
|
902
|
-
this.slugIsOldFormat =
|
903
|
-
if (!slug)
|
904
|
-
return false;
|
1166
|
+
this.slugIsOldFormat = slug => {
|
1167
|
+
if (!slug) return false;
|
905
1168
|
return ['product', 'service', 'category'].some(str => slug.includes(str));
|
906
1169
|
};
|
907
1170
|
this.triggerScrollTotop = () => {
|
@@ -928,14 +1191,19 @@ const HemfixarnaComponent = class {
|
|
928
1191
|
loadCategoryOrProduct(id) {
|
929
1192
|
this.proppedProduct = null;
|
930
1193
|
if (id.startsWith('c-')) {
|
931
|
-
const categories = [
|
1194
|
+
const categories = [
|
1195
|
+
...state.customer.categories,
|
1196
|
+
...state.customer.categories.map(c => {
|
1197
|
+
var _a;
|
1198
|
+
return (_a = c.sub_categories) !== null && _a !== void 0 ? _a : [];
|
1199
|
+
}),
|
1200
|
+
].flat();
|
932
1201
|
const category = categories.find(c => c && c.id === id.replace('c-', ''));
|
933
1202
|
if (category) {
|
934
1203
|
state.selectedCustomerCategory = category;
|
935
1204
|
state.step = 2;
|
936
1205
|
}
|
937
|
-
}
|
938
|
-
else {
|
1206
|
+
} else {
|
939
1207
|
const products = state.customer.categories
|
940
1208
|
.map(c => (c.show_products ? c.products : c.sub_categories ? c.sub_categories.map(c => c.products) : []))
|
941
1209
|
.flat()
|
@@ -951,8 +1219,7 @@ const HemfixarnaComponent = class {
|
|
951
1219
|
async watchSlugChange(newValue) {
|
952
1220
|
if (this.slugIsOldFormat(newValue)) {
|
953
1221
|
this.fetchNewTaxonomy(newValue);
|
954
|
-
}
|
955
|
-
else if (state.customer && newValue) {
|
1222
|
+
} else if (state.customer && newValue) {
|
956
1223
|
this.loadCategoryOrProduct(newValue);
|
957
1224
|
}
|
958
1225
|
}
|
@@ -961,8 +1228,7 @@ const HemfixarnaComponent = class {
|
|
961
1228
|
if (id === 'maleri') {
|
962
1229
|
state.maleri = true;
|
963
1230
|
state.step = 4;
|
964
|
-
}
|
965
|
-
else {
|
1231
|
+
} else {
|
966
1232
|
this.loadCategoryOrProduct(id);
|
967
1233
|
}
|
968
1234
|
}
|
@@ -975,8 +1241,7 @@ const HemfixarnaComponent = class {
|
|
975
1241
|
const res = await getTaxonomy(slug);
|
976
1242
|
if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found' || (res === null || res === void 0 ? void 0 : res.code) === 'rest_no_route') {
|
977
1243
|
console.log('taxonomy not found');
|
978
|
-
}
|
979
|
-
else if (res) {
|
1244
|
+
} else if (res) {
|
980
1245
|
this.setTaxonomy(res);
|
981
1246
|
if ((res === null || res === void 0 ? void 0 : res.post_type) === 'ikea_product') {
|
982
1247
|
this.product = res;
|
@@ -1010,35 +1275,30 @@ const HemfixarnaComponent = class {
|
|
1010
1275
|
const customer = await getCustomer(this.business);
|
1011
1276
|
if ((customer === null || customer === void 0 ? void 0 : customer.code) === 'not_found') {
|
1012
1277
|
console.warn('customer not found');
|
1013
|
-
}
|
1014
|
-
else if (customer) {
|
1278
|
+
} else if (customer) {
|
1015
1279
|
state.customer = customer;
|
1016
1280
|
if (this.id) {
|
1017
1281
|
if (this.id === 'maleri') {
|
1018
1282
|
state.maleri = true;
|
1019
1283
|
state.step = 4;
|
1020
|
-
}
|
1021
|
-
else {
|
1284
|
+
} else {
|
1022
1285
|
this.loadCategoryOrProduct(this.id);
|
1023
1286
|
}
|
1024
|
-
}
|
1025
|
-
else if (this.slug && !this.slugIsOldFormat(this.slug)) {
|
1287
|
+
} else if (this.slug && !this.slugIsOldFormat(this.slug)) {
|
1026
1288
|
this.loadCategoryOrProduct(this.slug);
|
1027
1289
|
}
|
1028
1290
|
}
|
1029
|
-
}
|
1030
|
-
catch (error) {
|
1291
|
+
} catch (error) {
|
1031
1292
|
console.warn('customer not found');
|
1032
1293
|
}
|
1033
1294
|
}
|
1034
|
-
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found')
|
1295
|
+
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found');
|
1035
1296
|
else if (tree) {
|
1036
1297
|
this.tree = tree;
|
1037
1298
|
}
|
1038
1299
|
if ((res === null || res === void 0 ? void 0 : res.code) === 'not_found') {
|
1039
1300
|
console.log('taxonomy not found');
|
1040
|
-
}
|
1041
|
-
else if (res) {
|
1301
|
+
} else if (res) {
|
1042
1302
|
this.setTaxonomy(res);
|
1043
1303
|
if ((res === null || res === void 0 ? void 0 : res.post_type) === 'ikea_product') {
|
1044
1304
|
this.product = res;
|
@@ -1061,13 +1321,11 @@ const HemfixarnaComponent = class {
|
|
1061
1321
|
if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.taxonomy) === 'service_cat') {
|
1062
1322
|
state.selectedCategory = taxonomy;
|
1063
1323
|
state.step = 2;
|
1064
|
-
}
|
1065
|
-
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
|
1324
|
+
} else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'service') {
|
1066
1325
|
state.selectedService = taxonomy;
|
1067
1326
|
state.selectedCategory = this.tree.sub_cats.find(c => c.services.find(s => s.ID === taxonomy.ID));
|
1068
1327
|
state.step = 3;
|
1069
|
-
}
|
1070
|
-
else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
|
1328
|
+
} else if ((taxonomy === null || taxonomy === void 0 ? void 0 : taxonomy.post_type) === 'ikea_product') {
|
1071
1329
|
state.selectedProduct = taxonomy;
|
1072
1330
|
state.selectedService = this.tree.sub_cats
|
1073
1331
|
.map(c => c.services)
|
@@ -1093,8 +1351,7 @@ const HemfixarnaComponent = class {
|
|
1093
1351
|
}, 200);
|
1094
1352
|
}
|
1095
1353
|
handleClick(e) {
|
1096
|
-
if (this.loadFromQuery && !this.isDemo)
|
1097
|
-
return;
|
1354
|
+
if (this.loadFromQuery && !this.isDemo) return;
|
1098
1355
|
if ((e === null || e === void 0 ? void 0 : e.composedPath()[0]).classList.contains('hemfixarna_backdrop')) {
|
1099
1356
|
this.closeModal();
|
1100
1357
|
}
|
@@ -1116,17 +1373,178 @@ const HemfixarnaComponent = class {
|
|
1116
1373
|
const monteringLogo = getAssetPath(`./assets/montering.svg`);
|
1117
1374
|
const navBackground = ((_a = this.nav) === null || _a === void 0 ? void 0 : _a.background) ? getAssetPath(this.nav.background) : '';
|
1118
1375
|
const navLogo = ((_b = this.nav) === null || _b === void 0 ? void 0 : _b.logo) ? getAssetPath(this.nav.logo) : '';
|
1119
|
-
return
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1376
|
+
return h(
|
1377
|
+
'div',
|
1378
|
+
{ class: `hemfixarna ${this.loadFromQuery ? 'hemfixarna_standalone' : ''}` },
|
1379
|
+
this.loadFromQuery && !this.isDemo && this.nav
|
1380
|
+
? h(
|
1381
|
+
'nav',
|
1382
|
+
{ class: 'hemfixarna_nav', style: { backgroundColor: (_c = this.nav.backgroundColor) !== null && _c !== void 0 ? _c : '' } },
|
1383
|
+
h(
|
1384
|
+
'div',
|
1385
|
+
null,
|
1386
|
+
h(
|
1387
|
+
'div',
|
1388
|
+
{ class: 'hemfixarna_nav--logos' },
|
1389
|
+
h('a', { href: this.nav.url, target: '_blank' }, h('img', { class: 'hemfixarna_partnerlogo', src: navLogo, alt: `${this.business} logo` })),
|
1390
|
+
h(
|
1391
|
+
'a',
|
1392
|
+
{ href: 'https://hemfixarna.se/', target: '_blank' },
|
1393
|
+
h('p', { class: navBackground || this.nav.backgroundColor ? 'with-bg' : '' }, 'I samarbete med:'),
|
1394
|
+
h('img', { src: logo, alt: 'hemfixarna_logo', width: 104 }),
|
1395
|
+
),
|
1396
|
+
),
|
1397
|
+
h(
|
1398
|
+
'div',
|
1399
|
+
{ class: 'hemfixarna_nav--links' },
|
1400
|
+
h('a', { href: this.nav.url, target: '_blank' }, 'Till ', this.business),
|
1401
|
+
h('a', { href: 'https://www.hemfixarna.se/', target: '_blank' }, 'Till Hemfixarna'),
|
1402
|
+
),
|
1403
|
+
navBackground ? h('img', { src: navBackground, class: 'nav_background', alt: 'nav_background' }) : null,
|
1404
|
+
),
|
1405
|
+
)
|
1406
|
+
: null,
|
1407
|
+
!this.loadFromQuery || this.isDemo
|
1408
|
+
? h(
|
1409
|
+
'div',
|
1410
|
+
{ class: `hemfixarna_box hemfixarna_box--${this.widgetStyle}` },
|
1411
|
+
[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle)
|
1412
|
+
? h('img', { src: this.id === 'maleri' ? pensel : monteringLogo, alt: 'montering logo', width: 32, height: 32 })
|
1413
|
+
: null,
|
1414
|
+
h(
|
1415
|
+
'div',
|
1416
|
+
null,
|
1417
|
+
h(
|
1418
|
+
'div',
|
1419
|
+
null,
|
1420
|
+
h(
|
1421
|
+
'p',
|
1422
|
+
{
|
1423
|
+
onClick: () => this.openModal(),
|
1424
|
+
class: `pointer ${[WidgetStyle.alternative_2, WidgetStyle.alternative_3].includes(this.widgetStyle) && state.selectedProduct ? 'underline' : ''}`,
|
1425
|
+
},
|
1426
|
+
this.id === 'maleri'
|
1427
|
+
? h('span', null, 'Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r')
|
1428
|
+
: h(
|
1429
|
+
Fragment,
|
1430
|
+
null,
|
1431
|
+
!state.selectedCustomerCategory && !this.product && !this.proppedProduct
|
1432
|
+
? h(
|
1433
|
+
Fragment,
|
1434
|
+
null,
|
1435
|
+
((_d = state.customer) === null || _d === void 0 ? void 0 : _d.widget_title)
|
1436
|
+
? h('span', null, state.customer.widget_title)
|
1437
|
+
: h('span', null, 'Montering/Installation - ', h('strong', { class: 'underline' }, 'se priser h\u00E4r')),
|
1438
|
+
)
|
1439
|
+
: h(
|
1440
|
+
Fragment,
|
1441
|
+
null,
|
1442
|
+
((_e = this.product) === null || _e === void 0 ? void 0 : _e.title) ||
|
1443
|
+
((_f = this.proppedProduct) === null || _f === void 0 ? void 0 : _f.title) ||
|
1444
|
+
((_g = state.selectedCustomerCategory) === null || _g === void 0 ? void 0 : _g.widget_title) ||
|
1445
|
+
h(
|
1446
|
+
'span',
|
1447
|
+
null,
|
1448
|
+
'Montering',
|
1449
|
+
h('wbr', null),
|
1450
|
+
'/Installation ',
|
1451
|
+
(_j = (_h = state.selectedCustomerCategory) === null || _h === void 0 ? void 0 : _h.name) !== null && _j !== void 0 ? _j : 'på plats',
|
1452
|
+
' - ',
|
1453
|
+
h('strong', { class: 'underline' }, 'se priser h\u00E4r'),
|
1454
|
+
),
|
1455
|
+
(this.product && ((_k = this.slug) === null || _k === void 0 ? void 0 : _k.includes('product'))) ||
|
1456
|
+
(this.proppedProduct &&
|
1457
|
+
!((_l = this.product) === null || _l === void 0 ? void 0 : _l.invoice) &&
|
1458
|
+
!((_m = this.proppedProduct) === null || _m === void 0 ? void 0 : _m.invoice))
|
1459
|
+
? h('span', null, ' från', ' ', h('strong', null, getProductPriceWithRotAndRut(this.proppedProduct || this.product), 'kr'))
|
1460
|
+
: null,
|
1461
|
+
),
|
1462
|
+
),
|
1463
|
+
),
|
1464
|
+
),
|
1465
|
+
this.widgetStyle === WidgetStyle.standard ? h('img', { src: logo, width: 104 }) : null,
|
1466
|
+
this.widgetStyle === WidgetStyle.alternative ? h('span', { class: 'p-s' }, 'Utf\u00F6rs av ', h('strong', null, 'Hemfixarna')) : null,
|
1467
|
+
),
|
1468
|
+
[WidgetStyle.standard, WidgetStyle.alternative].includes(this.widgetStyle)
|
1469
|
+
? h(
|
1470
|
+
'button',
|
1471
|
+
{
|
1472
|
+
onClick: () => this.openModal(),
|
1473
|
+
class: 'hemfixarna_btn',
|
1474
|
+
style: {
|
1475
|
+
color:
|
1476
|
+
((_o = this.buttonColor) === null || _o === void 0 ? void 0 : _o.startsWith('#')) ||
|
1477
|
+
!((_p = this.buttonColor) === null || _p === void 0 ? void 0 : _p.length)
|
1478
|
+
? this.buttonColor
|
1479
|
+
: `#${this.buttonColor}`,
|
1480
|
+
backgroundColor:
|
1481
|
+
((_q = this.buttonBg) === null || _q === void 0 ? void 0 : _q.startsWith('#')) || !((_r = this.buttonBg) === null || _r === void 0 ? void 0 : _r.length)
|
1482
|
+
? this.buttonBg
|
1483
|
+
: `#${this.buttonBg}`,
|
1484
|
+
},
|
1485
|
+
},
|
1486
|
+
'Best\u00E4ll h\u00E4r',
|
1487
|
+
this.getCartLength() > 0 && h('span', null, this.getCartLength()),
|
1488
|
+
)
|
1489
|
+
: null,
|
1490
|
+
WidgetStyle.alternative_2 === this.widgetStyle
|
1491
|
+
? h('div', { class: 'hemfixarna_altbtn' }, h('strong', { class: 'p-s' }, 'Utf\u00F6rs av'), h('img', { src: logo, alt: 'hemfixarna logo', width: 98 }))
|
1492
|
+
: null,
|
1493
|
+
)
|
1494
|
+
: null,
|
1495
|
+
this.modal &&
|
1496
|
+
h(
|
1497
|
+
'div',
|
1498
|
+
null,
|
1499
|
+
h(
|
1500
|
+
'div',
|
1501
|
+
{ class: `hemfixarna_modal ${this.showModal ? 'hemfixarna_modal--open' : ''}` },
|
1502
|
+
state.modal &&
|
1503
|
+
h(
|
1504
|
+
'div',
|
1505
|
+
{ class: 'hemfixarna_infomodal' },
|
1506
|
+
state.modal.title && h('h2', null, state.modal.title),
|
1507
|
+
state.modal.text.map(t => h('p', { innerHTML: t })),
|
1508
|
+
h('div', null, h('button', { onClick: () => (state.modal = null) }, 'St\u00E4ng')),
|
1509
|
+
),
|
1510
|
+
(this.tree || state.customer) &&
|
1511
|
+
h('hemfixarna-breadcrumbs', { isDemo: this.isDemo, loadFromQuery: this.loadFromQuery, closeModal: () => this.closeModal(), tree: this.tree }),
|
1512
|
+
!state.customer || this.slugIsOldFormat(this.slug)
|
1513
|
+
? h(
|
1514
|
+
'div',
|
1515
|
+
{ class: `hemfixarna_content hemfixarna_content--${state.step}` },
|
1516
|
+
state.step === 1 && this.tree && h('hemfixarna-start', { tree: this.tree }),
|
1517
|
+
state.step === 2 && state.selectedCategory && h('hemfixarna-category', null),
|
1518
|
+
state.step === 3 && state.selectedService && h('hemfixarna-service', null),
|
1519
|
+
state.step === 4 && state.selectedProduct && h('hemfixarna-product', null),
|
1520
|
+
state.step === 5 && h('hemfixarna-cart', { tree: this.tree }),
|
1521
|
+
state.step === 6 && h('hemfixarna-order', { tree: this.tree }),
|
1522
|
+
)
|
1523
|
+
: h(
|
1524
|
+
'div',
|
1525
|
+
{ class: `hemfixarna_content hemfixarna_content--${state.step} ${state.step === 4 && state.maleri ? 'hemfixarna_content--painting' : ''}` },
|
1526
|
+
state.step < 4 && h('hemfixarna-start', null),
|
1527
|
+
state.step === 4 && h('hemfixarna-product', null),
|
1528
|
+
state.step === 5 && h('hemfixarna-cart', { tree: this.tree }),
|
1529
|
+
state.step === 6 && h('hemfixarna-order', { tree: this.tree }),
|
1530
|
+
),
|
1531
|
+
),
|
1532
|
+
!this.isDemo ? h('div', { class: `hemfixarna_backdrop ${this.showModal ? 'hemfixarna_backdrop--open' : ''}` }) : null,
|
1533
|
+
),
|
1534
|
+
);
|
1535
|
+
}
|
1536
|
+
static get assetsDirs() {
|
1537
|
+
return ['assets'];
|
1538
|
+
}
|
1539
|
+
get el() {
|
1540
|
+
return getElement(this);
|
1541
|
+
}
|
1542
|
+
static get watchers() {
|
1543
|
+
return {
|
1544
|
+
slug: ['watchSlugChange'],
|
1545
|
+
id: ['watchIdChange'],
|
1546
|
+
};
|
1547
|
+
}
|
1130
1548
|
};
|
1131
1549
|
HemfixarnaComponent.style = hemfixarnaCss;
|
1132
1550
|
|
@@ -1136,11 +1554,52 @@ const HemfixarnaInfo$1 = class {
|
|
1136
1554
|
this.vertical = false;
|
1137
1555
|
}
|
1138
1556
|
render() {
|
1139
|
-
return
|
1557
|
+
return h(
|
1558
|
+
'div',
|
1559
|
+
{ class: `hemfixarna_contact ${this.vertical ? 'hemfixarna_contact--vertical' : 'hemfixarna_contact--horizontal'}` },
|
1560
|
+
h(
|
1561
|
+
'a',
|
1562
|
+
{ href: 'tel:0770-220 720' },
|
1563
|
+
h(
|
1564
|
+
'svg',
|
1565
|
+
{ width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
1566
|
+
h('path', {
|
1567
|
+
d: 'M7 4V20H17V4H7ZM6 2H18C18.5523 2 19 2.44772 19 3V21C19 21.5523 18.5523 22 18 22H6C5.44772 22 5 21.5523 5 21V3C5 2.44772 5.44772 2 6 2ZM12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17Z',
|
1568
|
+
fill: '#C84E18',
|
1569
|
+
}),
|
1570
|
+
),
|
1571
|
+
h('span', null, '0770-220 720'),
|
1572
|
+
),
|
1573
|
+
h(
|
1574
|
+
'a',
|
1575
|
+
{ href: 'https://hemfixarna.se/kundservice/', target: '_blank' },
|
1576
|
+
h(
|
1577
|
+
'svg',
|
1578
|
+
{ width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' },
|
1579
|
+
h(
|
1580
|
+
'g',
|
1581
|
+
{ 'clip-path': 'url(#clip0_1001_894)' },
|
1582
|
+
h('path', {
|
1583
|
+
d: 'M21 12.22C21 6.73 16.74 3 12 3C7.31 3 3 6.65 3 12.28C2.4 12.62 2 13.26 2 14V16C2 17.1 2.9 18 4 18H5V11.9C5 8.03 8.13 4.9 12 4.9C15.87 4.9 19 8.03 19 11.9V19H11V21H19C20.1 21 21 20.1 21 19V17.78C21.59 17.47 22 16.86 22 16.14V13.84C22 13.14 21.59 12.53 21 12.22Z',
|
1584
|
+
fill: '#C84E18',
|
1585
|
+
}),
|
1586
|
+
h('path', { d: 'M9 14C9.55228 14 10 13.5523 10 13C10 12.4477 9.55228 12 9 12C8.44772 12 8 12.4477 8 13C8 13.5523 8.44772 14 9 14Z', fill: '#C84E18' }),
|
1587
|
+
h('path', { d: 'M15 14C15.5523 14 16 13.5523 16 13C16 12.4477 15.5523 12 15 12C14.4477 12 14 12.4477 14 13C14 13.5523 14.4477 14 15 14Z', fill: '#C84E18' }),
|
1588
|
+
h('path', {
|
1589
|
+
d: 'M18 11.03C17.52 8.18 15.04 6 12.05 6C9.01997 6 5.75997 8.51 6.01997 12.45C8.48997 11.44 10.35 9.24 10.88 6.56C12.19 9.19 14.88 11 18 11.03Z',
|
1590
|
+
fill: '#C84E18',
|
1591
|
+
}),
|
1592
|
+
),
|
1593
|
+
h('defs', null, h('clipPath', { id: 'clip0_1001_894' }, h('rect', { width: '24', height: '24', fill: 'white' }))),
|
1594
|
+
),
|
1595
|
+
h('span', null, 'Kundservice'),
|
1596
|
+
),
|
1597
|
+
);
|
1140
1598
|
}
|
1141
1599
|
};
|
1142
1600
|
|
1143
|
-
const hemfixarnaDemoCss =
|
1601
|
+
const hemfixarnaDemoCss =
|
1602
|
+
'@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap"); :host{font-family:"Inter", sans-serif}:host .hemfixarna_widgetstyles label{cursor:pointer}:host .hemfixarna_widgetstyles>div{display:flex;gap:1rem}:host .hemfixarna_widgetstyles h5{margin:1rem 0}:host .hemfixarna_example{margin-bottom:16px;background:#000;padding:16px;color:#fff;display:flex;justify-content:space-between;cursor:pointer;max-width:500px;box-sizing:border-box;position:relative}:host .hemfixarna_example--tooltip{background:#000;top:-48px;font-size:16px;left:40%;color:white;padding:8px;position:absolute;opacity:0}:host .hemfixarna_example--tooltip::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}:host .hemfixarna_example:hover .hemfixarna_example--tooltip{opacity:1}:host .hemfixarna_example p{font-size:14px}:host .hemfixarna_example img{filter:invert(1)}:host .hemfixarna_install{display:grid;gap:8px;margin-top:16px}:host .hemfixarna_product--label{background:#e1e0f5}:host .hemfixarna_categories{max-height:100%;overflow:auto;position:relative}:host .hemfixarna_categories--label{display:flex;align-items:center;justify-content:space-between;padding:8px}:host .hemfixarna_categories--label button{background:#3f3a92;border:none;font-weight:600;padding:3.2px 9.6px;border-radius:10px;margin-right:8px;color:#ece8e8}:host .hemfixarna_categories--label button:active{transform:scale(0.95)}:host .hemfixarna_categories--label--big{font-weight:600;border-bottom:1px solid black}:host p{margin:0}:host span{color:darkolivegreen;font-size:10px}:host button{cursor:pointer}:host>div:not(.hemfixarna_hosted){grid-template-columns:1fr 1fr}:host .hemfixarna_hosted .hemfixarna_scripts{display:none}:host>div{display:grid;gap:32px;width:100%;height:100vh;place-items:center;overflow:hidden;padding:16px 32px;box-sizing:border-box}:host>div>*{width:100%}:host>div>div{max-width:500px}:host>div ul{margin:0;padding:0;list-style:none}:host>div ul ul{gap:1px;display:grid}:host>div ul li{padding-left:16px;background:#fff}';
|
1144
1603
|
|
1145
1604
|
const MyComponent$i = class {
|
1146
1605
|
constructor(hostRef) {
|
@@ -1180,10 +1639,10 @@ const MyComponent$i = class {
|
|
1180
1639
|
})
|
1181
1640
|
.then(response => response.json())
|
1182
1641
|
.then(json => {
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1642
|
+
if (json && json) {
|
1643
|
+
this.colorAccessibility = json;
|
1644
|
+
}
|
1645
|
+
});
|
1187
1646
|
// Your color accessibility logic here
|
1188
1647
|
}
|
1189
1648
|
getTopLevelCategory() {
|
@@ -1212,12 +1671,11 @@ const MyComponent$i = class {
|
|
1212
1671
|
var _a;
|
1213
1672
|
if (process.env.FORCE_OLD_TREE) {
|
1214
1673
|
const tree = await getTaxonomy(this.getTopLevelCategory());
|
1215
|
-
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found')
|
1674
|
+
if ((tree === null || tree === void 0 ? void 0 : tree.code) === 'not_found');
|
1216
1675
|
else if (tree) {
|
1217
1676
|
this.tree = tree;
|
1218
1677
|
}
|
1219
|
-
}
|
1220
|
-
else {
|
1678
|
+
} else {
|
1221
1679
|
const partner = window.location.pathname.replace('/', '');
|
1222
1680
|
this.partner = isBusiness(partner) ? partner : (_a = process.env.BUSINESS) !== null && _a !== void 0 ? _a : Business.kund;
|
1223
1681
|
const customer = await getCustomer(this.partner);
|
@@ -1258,17 +1716,371 @@ const MyComponent$i = class {
|
|
1258
1716
|
render() {
|
1259
1717
|
var _a;
|
1260
1718
|
const copy = getAssetPath(`./assets/copy.png`);
|
1261
|
-
return
|
1262
|
-
|
1719
|
+
return h(
|
1720
|
+
'div',
|
1721
|
+
{ class: ((_a = this.customer) === null || _a === void 0 ? void 0 : _a.at_hemfixarna) ? 'hemfixarna_hosted' : '' },
|
1722
|
+
h(
|
1723
|
+
'div',
|
1724
|
+
{ class: 'hemfixarna_scripts' },
|
1725
|
+
h(
|
1726
|
+
'div',
|
1727
|
+
{ onClick: () => this.copyExample(), class: 'hemfixarna_example' },
|
1728
|
+
h('p', null, this.getExample()),
|
1729
|
+
h('img', { src: copy, height: 20 }),
|
1730
|
+
h('span', { class: 'hemfixarna_example--tooltip' }, this.tooltipText),
|
1731
|
+
),
|
1732
|
+
this.partner === Business.byggmax &&
|
1733
|
+
h('hemfixarna-byggmax', {
|
1734
|
+
buttonColor: this.buttonColor,
|
1735
|
+
buttonBg: this.buttonBg,
|
1736
|
+
widgetStyle: this.widgetStyle,
|
1737
|
+
forceOldTree: Boolean(process.env.FORCE_OLD_TREE),
|
1738
|
+
slug: this.selectedSlug,
|
1739
|
+
id: this.selectedID,
|
1740
|
+
}),
|
1741
|
+
this.partner === Business.skanska &&
|
1742
|
+
h('hemfixarna-skanska', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1743
|
+
this.partner === Business.sparfonster &&
|
1744
|
+
h('hemfixarna-sparfonster', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1745
|
+
this.partner === Business.string &&
|
1746
|
+
h('hemfixarna-string-furniture', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1747
|
+
this.partner === Business.hornbach &&
|
1748
|
+
h('hemfixarna-hornbach', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1749
|
+
this.partner === Business.traningspartner &&
|
1750
|
+
h('hemfixarna-traningspartner', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1751
|
+
this.partner === Business.superfront &&
|
1752
|
+
h('hemfixarna-superfront', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1753
|
+
this.partner === Business.zaptec &&
|
1754
|
+
h('hemfixarna-zaptec', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1755
|
+
this.partner === Business.tesla &&
|
1756
|
+
h('hemfixarna-tesla', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1757
|
+
this.partner === Business.forebygg &&
|
1758
|
+
h('hemfixarna-forebygg', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1759
|
+
this.partner === Business.doro && h('hemfixarna-doro', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1760
|
+
this.partner === Business.elfa &&
|
1761
|
+
h('hemfixarna-elfa', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1762
|
+
this.partner === Business.kbygg &&
|
1763
|
+
h('hemfixarna-kbygg', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1764
|
+
this.partner === Business.fargvaruhuset &&
|
1765
|
+
h('hemfixarna-fargvaruhuset', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1766
|
+
this.partner === Business.norrgavel &&
|
1767
|
+
h('hemfixarna-norrgavel', { isDemo: true, buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1768
|
+
this.partner === Business.klint && h('hemfixarna-klint', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1769
|
+
this.partner === Business.flyttsmart &&
|
1770
|
+
h('hemfixarna-flyttsmart', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1771
|
+
this.partner === Business.power && h('hemfixarna-power', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1772
|
+
this.partner === Business.kund && h('hemfixarna-kund', { buttonColor: this.buttonColor, buttonBg: this.buttonBg, widgetStyle: this.widgetStyle, id: this.selectedID }),
|
1773
|
+
h(
|
1774
|
+
'div',
|
1775
|
+
{ class: 'hemfixarna_install' },
|
1776
|
+
h(
|
1777
|
+
'div',
|
1778
|
+
{ onClick: () => this.copyCdn(), class: 'hemfixarna_example' },
|
1779
|
+
h('p', null, this.cdnLink),
|
1780
|
+
h('span', { class: 'hemfixarna_example--tooltip' }, this.tooltipText),
|
1781
|
+
h('img', { src: copy, height: 20 }),
|
1782
|
+
),
|
1783
|
+
),
|
1784
|
+
h(
|
1785
|
+
'div',
|
1786
|
+
{ class: 'hemfixarna_widgetstyles' },
|
1787
|
+
h('h5', null, 'Widget styles'),
|
1788
|
+
h(
|
1789
|
+
'div',
|
1790
|
+
null,
|
1791
|
+
Object.values(WidgetStyle).map(style =>
|
1792
|
+
h('label', { key: style }, h('input', { type: 'radio', value: style, checked: this.widgetStyle === style, onChange: () => (this.widgetStyle = style) }), style),
|
1793
|
+
),
|
1794
|
+
),
|
1795
|
+
h(
|
1796
|
+
'div',
|
1797
|
+
null,
|
1798
|
+
h('div', null, h('h5', null, 'Button background color'), h('input', { type: 'text', value: this.buttonBg, onInput: e => (this.buttonBg = e.target.value) })),
|
1799
|
+
h('div', null, h('h5', null, 'Button text color'), h('input', { type: 'text', value: this.buttonColor, onInput: e => (this.buttonColor = e.target.value) })),
|
1800
|
+
),
|
1801
|
+
),
|
1802
|
+
h('span', null, 'Write an hexa code no # needed'),
|
1803
|
+
this.colorAccessibility
|
1804
|
+
? h(
|
1805
|
+
'div',
|
1806
|
+
null,
|
1807
|
+
h('h5', null, 'Tillg\u00E4nglighetsrapport'),
|
1808
|
+
h(
|
1809
|
+
'div',
|
1810
|
+
null,
|
1811
|
+
h('strong', null, 'Liten text:'),
|
1812
|
+
h('span', { style: { color: this.getColor(this.colorAccessibility.small) } }, this.colorAccessibility.small),
|
1813
|
+
h('br', null),
|
1814
|
+
h('strong', null, 'Fet text:'),
|
1815
|
+
h('span', { style: { color: this.getColor(this.colorAccessibility.bold) } }, this.colorAccessibility.bold),
|
1816
|
+
h('br', null),
|
1817
|
+
h('strong', null, 'Stor text:'),
|
1818
|
+
h('span', { style: { color: this.getColor(this.colorAccessibility.large) } }, this.colorAccessibility.large),
|
1819
|
+
h('br', null),
|
1820
|
+
h('strong', null, 'Kontrastf\u00F6rh\u00E5llande:'),
|
1821
|
+
' ',
|
1822
|
+
this.colorAccessibility.contrast,
|
1823
|
+
),
|
1824
|
+
)
|
1825
|
+
: null,
|
1826
|
+
),
|
1827
|
+
h(
|
1828
|
+
'ul',
|
1829
|
+
{ class: 'hemfixarna_categories' },
|
1830
|
+
this.customer
|
1831
|
+
? h(
|
1832
|
+
'div',
|
1833
|
+
null,
|
1834
|
+
this.customer.logo
|
1835
|
+
? h(
|
1836
|
+
'div',
|
1837
|
+
{ style: { width: '100%', display: 'flex', justifyContent: 'center' } },
|
1838
|
+
h('img', { style: { maxWidth: '250px', height: 'auto', margin: '0 auto 2rem' }, src: this.customer.logo.url, alt: this.customer.post_title }),
|
1839
|
+
)
|
1840
|
+
: null,
|
1841
|
+
this.showMaleri()
|
1842
|
+
? h(
|
1843
|
+
'li',
|
1844
|
+
null,
|
1845
|
+
h(
|
1846
|
+
'div',
|
1847
|
+
{ class: 'hemfixarna_categories--label hemfixarna_categories--label--big' },
|
1848
|
+
h('div', null, h('p', null, 'M\u00E5leriverktyget'), h('span', null, 'maleri')),
|
1849
|
+
h(
|
1850
|
+
'div',
|
1851
|
+
null,
|
1852
|
+
h('button', { onClick: () => navigator.clipboard.writeText('maleri') }, 'Kopiera ID'),
|
1853
|
+
this.customer.at_hemfixarna
|
1854
|
+
? h(
|
1855
|
+
'button',
|
1856
|
+
{
|
1857
|
+
onClick: () => {
|
1858
|
+
var _a;
|
1859
|
+
return navigator.clipboard.writeText(
|
1860
|
+
`${(_a = 'https://hemfixarna.se') !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=maleri`,
|
1861
|
+
);
|
1862
|
+
},
|
1863
|
+
},
|
1864
|
+
'Kopiera URL',
|
1865
|
+
)
|
1866
|
+
: h('button', { onClick: () => (this.selectedID = 'maleri') }, 'Ladda m\u00E5leri'),
|
1867
|
+
),
|
1868
|
+
),
|
1869
|
+
)
|
1870
|
+
: null,
|
1871
|
+
this.customer.categories.map(c =>
|
1872
|
+
h(
|
1873
|
+
'li',
|
1874
|
+
null,
|
1875
|
+
h(
|
1876
|
+
'div',
|
1877
|
+
{ class: 'hemfixarna_categories--label hemfixarna_categories--label--big' },
|
1878
|
+
h('div', null, h('p', null, c.name), h('span', null, `c-${c.id}`)),
|
1879
|
+
h(
|
1880
|
+
'div',
|
1881
|
+
null,
|
1882
|
+
h('button', { onClick: () => navigator.clipboard.writeText(`c-${c.id}`) }, 'Kopiera ID'),
|
1883
|
+
this.customer.at_hemfixarna
|
1884
|
+
? h(
|
1885
|
+
'button',
|
1886
|
+
{
|
1887
|
+
onClick: () => {
|
1888
|
+
var _a;
|
1889
|
+
return navigator.clipboard.writeText(
|
1890
|
+
`${(_a = 'https://hemfixarna.se') !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`,
|
1891
|
+
);
|
1892
|
+
},
|
1893
|
+
},
|
1894
|
+
'Kopiera URL',
|
1895
|
+
)
|
1896
|
+
: h('button', { onClick: () => (this.selectedID = `c-${c.id}`) }, 'Ladda kategori'),
|
1897
|
+
),
|
1898
|
+
),
|
1899
|
+
c.show_products && c.products
|
1900
|
+
? h(
|
1901
|
+
'ul',
|
1902
|
+
null,
|
1903
|
+
c.products.map(p =>
|
1904
|
+
h(
|
1905
|
+
'li',
|
1906
|
+
null,
|
1907
|
+
h(
|
1908
|
+
'div',
|
1909
|
+
{ class: 'hemfixarna_categories--label hemfixarna_product--label' },
|
1910
|
+
h('div', null, h('p', null, p.fields.title), h('span', null, p.fields.ID)),
|
1911
|
+
h(
|
1912
|
+
'div',
|
1913
|
+
null,
|
1914
|
+
h('button', { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, 'Kopiera ID'),
|
1915
|
+
this.customer.at_hemfixarna
|
1916
|
+
? h(
|
1917
|
+
'button',
|
1918
|
+
{
|
1919
|
+
onClick: () => {
|
1920
|
+
var _a;
|
1921
|
+
return navigator.clipboard.writeText(
|
1922
|
+
`${(_a = 'https://hemfixarna.se') !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`,
|
1923
|
+
);
|
1924
|
+
},
|
1925
|
+
},
|
1926
|
+
'Kopiera URL',
|
1927
|
+
)
|
1928
|
+
: h('button', { onClick: () => (this.selectedID = String(p.fields.ID)) }, 'Ladda produkt'),
|
1929
|
+
),
|
1930
|
+
),
|
1931
|
+
),
|
1932
|
+
),
|
1933
|
+
)
|
1934
|
+
: h(
|
1935
|
+
'ul',
|
1936
|
+
null,
|
1937
|
+
c.sub_categories &&
|
1938
|
+
c.sub_categories.map(sc =>
|
1939
|
+
h(
|
1940
|
+
'li',
|
1941
|
+
null,
|
1942
|
+
h(
|
1943
|
+
'div',
|
1944
|
+
{ class: 'hemfixarna_categories--label' },
|
1945
|
+
h('div', null, h('p', null, sc.name), h('span', null, `c-${sc.id}`)),
|
1946
|
+
h(
|
1947
|
+
'div',
|
1948
|
+
null,
|
1949
|
+
h('button', { onClick: () => navigator.clipboard.writeText(`c-${sc.id}`) }, 'Kopiera ID'),
|
1950
|
+
this.customer.at_hemfixarna
|
1951
|
+
? h(
|
1952
|
+
'button',
|
1953
|
+
{
|
1954
|
+
onClick: () => {
|
1955
|
+
var _a;
|
1956
|
+
return navigator.clipboard.writeText(
|
1957
|
+
`${(_a = 'https://hemfixarna.se') !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=c-${c.id}`,
|
1958
|
+
);
|
1959
|
+
},
|
1960
|
+
},
|
1961
|
+
'Kopiera URL',
|
1962
|
+
)
|
1963
|
+
: h('button', { onClick: () => (this.selectedID = `c-${sc.id}`) }, 'Ladda kategori'),
|
1964
|
+
),
|
1965
|
+
),
|
1966
|
+
h(
|
1967
|
+
'ul',
|
1968
|
+
null,
|
1969
|
+
sc.products.map(p =>
|
1970
|
+
h(
|
1971
|
+
'li',
|
1972
|
+
null,
|
1973
|
+
h(
|
1974
|
+
'div',
|
1975
|
+
{ class: 'hemfixarna_categories--label hemfixarna_product--label' },
|
1976
|
+
h('div', null, h('p', null, p.fields.title), h('span', null, p.fields.ID)),
|
1977
|
+
h(
|
1978
|
+
'div',
|
1979
|
+
null,
|
1980
|
+
h('button', { onClick: () => navigator.clipboard.writeText(String(p.fields.ID)) }, 'Kopiera ID'),
|
1981
|
+
this.customer.at_hemfixarna
|
1982
|
+
? h(
|
1983
|
+
'button',
|
1984
|
+
{
|
1985
|
+
onClick: () => {
|
1986
|
+
var _a;
|
1987
|
+
return navigator.clipboard.writeText(
|
1988
|
+
`${(_a = 'https://hemfixarna.se') !== null && _a !== void 0 ? _a : 'https://hemfixarna.se'}/partner/${this.customer.post_name}?id=${p.fields.ID}`,
|
1989
|
+
);
|
1990
|
+
},
|
1991
|
+
},
|
1992
|
+
'Kopiera URL',
|
1993
|
+
)
|
1994
|
+
: h('button', { onClick: () => (this.selectedID = String(p.fields.ID)) }, 'Ladda produkt'),
|
1995
|
+
),
|
1996
|
+
),
|
1997
|
+
),
|
1998
|
+
),
|
1999
|
+
),
|
2000
|
+
),
|
2001
|
+
),
|
2002
|
+
),
|
2003
|
+
),
|
2004
|
+
),
|
2005
|
+
)
|
2006
|
+
: this.tree
|
2007
|
+
? h(
|
2008
|
+
'div',
|
2009
|
+
null,
|
2010
|
+
this.tree.sub_cats.map(c =>
|
2011
|
+
h(
|
2012
|
+
'li',
|
2013
|
+
null,
|
2014
|
+
h(
|
2015
|
+
'div',
|
2016
|
+
{ class: 'hemfixarna_categories--label hemfixarna_categories--label--big' },
|
2017
|
+
h('div', null, h('p', null, c.name), h('span', null, `category/${c.slug}`)),
|
2018
|
+
h(
|
2019
|
+
'div',
|
2020
|
+
null,
|
2021
|
+
h('button', { onClick: () => navigator.clipboard.writeText(`category/${c.slug}`) }, 'Kopiera slug'),
|
2022
|
+
h('button', { onClick: () => (this.selectedSlug = `category/${c.slug}`) }, 'Ladda kategori'),
|
2023
|
+
),
|
2024
|
+
),
|
2025
|
+
h(
|
2026
|
+
'ul',
|
2027
|
+
null,
|
2028
|
+
c.services.map(sc =>
|
2029
|
+
h(
|
2030
|
+
'li',
|
2031
|
+
null,
|
2032
|
+
h(
|
2033
|
+
'div',
|
2034
|
+
{ class: 'hemfixarna_categories--label' },
|
2035
|
+
h('div', null, h('p', null, sc.post_title), h('span', null, `service/${sc.post_name}`)),
|
2036
|
+
h(
|
2037
|
+
'div',
|
2038
|
+
null,
|
2039
|
+
h('button', { onClick: () => navigator.clipboard.writeText(`service/${sc.post_name}`) }, 'Kopiera slug'),
|
2040
|
+
h('button', { onClick: () => (this.selectedSlug = `service/${sc.post_name}`) }, 'Ladda kategori'),
|
2041
|
+
),
|
2042
|
+
),
|
2043
|
+
h(
|
2044
|
+
'ul',
|
2045
|
+
null,
|
2046
|
+
sc.products.map(sc =>
|
2047
|
+
h(
|
2048
|
+
'li',
|
2049
|
+
null,
|
2050
|
+
h(
|
2051
|
+
'div',
|
2052
|
+
{ class: 'hemfixarna_categories--label' },
|
2053
|
+
h('div', null, h('p', null, sc.post_title), h('span', null, `product/${sc.post_name}`)),
|
2054
|
+
h(
|
2055
|
+
'div',
|
2056
|
+
null,
|
2057
|
+
h('button', { onClick: () => navigator.clipboard.writeText(`product/${sc.post_name}`) }, 'Kopiera slug'),
|
2058
|
+
h('button', { onClick: () => (this.selectedSlug = `product/${sc.post_name}`) }, 'Ladda produkt'),
|
2059
|
+
),
|
2060
|
+
),
|
2061
|
+
),
|
2062
|
+
),
|
2063
|
+
),
|
2064
|
+
),
|
2065
|
+
),
|
2066
|
+
),
|
2067
|
+
),
|
2068
|
+
),
|
2069
|
+
)
|
2070
|
+
: null,
|
2071
|
+
),
|
2072
|
+
);
|
2073
|
+
}
|
2074
|
+
static get watchers() {
|
2075
|
+
return {
|
2076
|
+
buttonBg: ['debouncedFunction'],
|
2077
|
+
buttonColor: ['debouncedFunction'],
|
2078
|
+
};
|
1263
2079
|
}
|
1264
|
-
static get watchers() { return {
|
1265
|
-
"buttonBg": ["debouncedFunction"],
|
1266
|
-
"buttonColor": ["debouncedFunction"]
|
1267
|
-
}; }
|
1268
2080
|
};
|
1269
2081
|
MyComponent$i.style = hemfixarnaDemoCss;
|
1270
2082
|
|
1271
|
-
const hemfixarnaDoroCss =
|
2083
|
+
const hemfixarnaDoroCss = '';
|
1272
2084
|
|
1273
2085
|
const MyComponent$h = class {
|
1274
2086
|
constructor(hostRef) {
|
@@ -1280,12 +2092,19 @@ const MyComponent$h = class {
|
|
1280
2092
|
this.buttonBg = undefined;
|
1281
2093
|
}
|
1282
2094
|
render() {
|
1283
|
-
return
|
2095
|
+
return h('hemfixarna-component', {
|
2096
|
+
widgetStyle: this.widgetStyle,
|
2097
|
+
buttonBg: this.buttonBg,
|
2098
|
+
buttonColor: this.buttonColor,
|
2099
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2100
|
+
id: this.id,
|
2101
|
+
business: Business.doro,
|
2102
|
+
});
|
1284
2103
|
}
|
1285
2104
|
};
|
1286
2105
|
MyComponent$h.style = hemfixarnaDoroCss;
|
1287
2106
|
|
1288
|
-
const hemfixarnaElfaCss =
|
2107
|
+
const hemfixarnaElfaCss = '';
|
1289
2108
|
|
1290
2109
|
const MyComponent$g = class {
|
1291
2110
|
constructor(hostRef) {
|
@@ -1298,7 +2117,16 @@ const MyComponent$g = class {
|
|
1298
2117
|
this.isDemo = false;
|
1299
2118
|
}
|
1300
2119
|
render() {
|
1301
|
-
return
|
2120
|
+
return h('hemfixarna-component', {
|
2121
|
+
widgetStyle: this.widgetStyle,
|
2122
|
+
buttonBg: this.buttonBg,
|
2123
|
+
buttonColor: this.buttonColor,
|
2124
|
+
nav: { url: 'https://elfa.com', logo: 'assets/elfa.png' },
|
2125
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2126
|
+
id: this.id,
|
2127
|
+
business: Business.elfa,
|
2128
|
+
isDemo: this.isDemo,
|
2129
|
+
});
|
1302
2130
|
}
|
1303
2131
|
};
|
1304
2132
|
MyComponent$g.style = hemfixarnaElfaCss;
|
@@ -1314,7 +2142,15 @@ const MyComponent$f = class {
|
|
1314
2142
|
this.isDemo = false;
|
1315
2143
|
}
|
1316
2144
|
render() {
|
1317
|
-
return
|
2145
|
+
return h('hemfixarna-component', {
|
2146
|
+
widgetStyle: this.widgetStyle,
|
2147
|
+
buttonBg: this.buttonBg,
|
2148
|
+
buttonColor: this.buttonColor,
|
2149
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2150
|
+
id: this.id,
|
2151
|
+
business: Business.fargvaruhuset,
|
2152
|
+
isDemo: this.isDemo,
|
2153
|
+
});
|
1318
2154
|
}
|
1319
2155
|
};
|
1320
2156
|
|
@@ -1329,11 +2165,19 @@ const MyComponent$e = class {
|
|
1329
2165
|
this.isDemo = false;
|
1330
2166
|
}
|
1331
2167
|
render() {
|
1332
|
-
return
|
2168
|
+
return h('hemfixarna-component', {
|
2169
|
+
widgetStyle: this.widgetStyle,
|
2170
|
+
buttonBg: this.buttonBg,
|
2171
|
+
buttonColor: this.buttonColor,
|
2172
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2173
|
+
id: this.id,
|
2174
|
+
business: Business.flyttsmart,
|
2175
|
+
isDemo: this.isDemo,
|
2176
|
+
});
|
1333
2177
|
}
|
1334
2178
|
};
|
1335
2179
|
|
1336
|
-
const hemfixarnaForebyggCss =
|
2180
|
+
const hemfixarnaForebyggCss = '';
|
1337
2181
|
|
1338
2182
|
const MyComponent$d = class {
|
1339
2183
|
constructor(hostRef) {
|
@@ -1345,7 +2189,14 @@ const MyComponent$d = class {
|
|
1345
2189
|
this.buttonBg = undefined;
|
1346
2190
|
}
|
1347
2191
|
render() {
|
1348
|
-
return
|
2192
|
+
return h('hemfixarna-component', {
|
2193
|
+
widgetStyle: this.widgetStyle,
|
2194
|
+
buttonBg: this.buttonBg,
|
2195
|
+
buttonColor: this.buttonColor,
|
2196
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2197
|
+
id: this.id,
|
2198
|
+
business: Business.forebygg,
|
2199
|
+
});
|
1349
2200
|
}
|
1350
2201
|
};
|
1351
2202
|
MyComponent$d.style = hemfixarnaForebyggCss;
|
@@ -1353,7 +2204,7 @@ MyComponent$d.style = hemfixarnaForebyggCss;
|
|
1353
2204
|
// src/errors.ts
|
1354
2205
|
var PersonnummerError = class extends Error {
|
1355
2206
|
constructor() {
|
1356
|
-
super(
|
2207
|
+
super('Invalid swedish personal identity number');
|
1357
2208
|
}
|
1358
2209
|
};
|
1359
2210
|
|
@@ -1370,12 +2221,12 @@ var diffInYears = (dateLeft, dateRight) => {
|
|
1370
2221
|
const result = sign * (yearDiff - +isLastYearNotFull);
|
1371
2222
|
return result === 0 ? 0 : result;
|
1372
2223
|
};
|
1373
|
-
var luhn =
|
2224
|
+
var luhn = str => {
|
1374
2225
|
let sum = 0;
|
1375
|
-
str +=
|
2226
|
+
str += '';
|
1376
2227
|
for (let i = 0, l = str.length; i < l; i++) {
|
1377
2228
|
let v = parseInt(str[i]);
|
1378
|
-
v *= 2 - i % 2;
|
2229
|
+
v *= 2 - (i % 2);
|
1379
2230
|
if (v > 9) {
|
1380
2231
|
v -= 9;
|
1381
2232
|
}
|
@@ -1403,53 +2254,53 @@ var Personnummer = class {
|
|
1403
2254
|
*
|
1404
2255
|
* @var {string}
|
1405
2256
|
*/
|
1406
|
-
this._century =
|
2257
|
+
this._century = '';
|
1407
2258
|
/**
|
1408
2259
|
* Personnummer full year.
|
1409
2260
|
*
|
1410
2261
|
* @var {string}
|
1411
2262
|
*/
|
1412
|
-
this._fullYear =
|
2263
|
+
this._fullYear = '';
|
1413
2264
|
/**
|
1414
2265
|
* Personnummer year.
|
1415
2266
|
*
|
1416
2267
|
* @var {string}
|
1417
2268
|
*/
|
1418
|
-
this._year =
|
2269
|
+
this._year = '';
|
1419
2270
|
/**
|
1420
2271
|
* Personnummer month.
|
1421
2272
|
*
|
1422
2273
|
* @var {string}
|
1423
2274
|
*/
|
1424
|
-
this._month =
|
2275
|
+
this._month = '';
|
1425
2276
|
/**
|
1426
2277
|
* Personnummer day.
|
1427
2278
|
*
|
1428
2279
|
* @var {string}
|
1429
2280
|
*/
|
1430
|
-
this._day =
|
2281
|
+
this._day = '';
|
1431
2282
|
/**
|
1432
2283
|
* Personnummer seperator.
|
1433
2284
|
*
|
1434
2285
|
* @var {string}
|
1435
2286
|
*/
|
1436
|
-
this._sep =
|
2287
|
+
this._sep = '';
|
1437
2288
|
/**
|
1438
2289
|
* Personnumer first three of the last four numbers.
|
1439
2290
|
*
|
1440
2291
|
* @var {string}
|
1441
2292
|
*/
|
1442
|
-
this._num =
|
2293
|
+
this._num = '';
|
1443
2294
|
/**
|
1444
2295
|
* The last number of the personnummer.
|
1445
2296
|
*
|
1446
2297
|
* @var {string}
|
1447
2298
|
*/
|
1448
|
-
this._check =
|
2299
|
+
this._check = '';
|
1449
2300
|
this.parse(pin, {
|
1450
2301
|
allowCoordinationNumber: true,
|
1451
2302
|
allowInterimNumber: false,
|
1452
|
-
...options
|
2303
|
+
...options,
|
1453
2304
|
});
|
1454
2305
|
}
|
1455
2306
|
/**
|
@@ -1565,23 +2416,23 @@ var Personnummer = class {
|
|
1565
2416
|
const sep = match[5];
|
1566
2417
|
const num = match[6];
|
1567
2418
|
const check = match[7];
|
1568
|
-
if (typeof century ===
|
2419
|
+
if (typeof century === 'undefined' || !century.length) {
|
1569
2420
|
const d = /* @__PURE__ */ new Date();
|
1570
2421
|
let baseYear = 0;
|
1571
|
-
if (sep ===
|
1572
|
-
this._sep =
|
2422
|
+
if (sep === '+') {
|
2423
|
+
this._sep = '+';
|
1573
2424
|
baseYear = d.getFullYear() - 100;
|
1574
2425
|
} else {
|
1575
|
-
this._sep =
|
2426
|
+
this._sep = '-';
|
1576
2427
|
baseYear = d.getFullYear();
|
1577
2428
|
}
|
1578
|
-
this._century = (
|
2429
|
+
this._century = ('' + (baseYear - ((baseYear - parseInt(year)) % 100))).substr(0, 2);
|
1579
2430
|
} else {
|
1580
2431
|
this._century = century;
|
1581
|
-
if (
|
1582
|
-
this._sep =
|
2432
|
+
if (/* @__PURE__ */ new Date().getFullYear() - parseInt(century + year, 10) < 100) {
|
2433
|
+
this._sep = '-';
|
1583
2434
|
} else {
|
1584
|
-
this._sep =
|
2435
|
+
this._sep = '+';
|
1585
2436
|
}
|
1586
2437
|
}
|
1587
2438
|
this._year = year;
|
@@ -1606,9 +2457,7 @@ var Personnummer = class {
|
|
1606
2457
|
* @return {boolean}
|
1607
2458
|
*/
|
1608
2459
|
valid() {
|
1609
|
-
const valid = luhn(
|
1610
|
-
this.year + this.month + this.day + this.num.replace(/[TRSUWXJKLMN]/, "1")
|
1611
|
-
) === +this.check && !!this.check;
|
2460
|
+
const valid = luhn(this.year + this.month + this.day + this.num.replace(/[TRSUWXJKLMN]/, '1')) === +this.check && !!this.check;
|
1612
2461
|
if (valid && testDate(parseInt(this.century + this.year), +this.month, +this.day)) {
|
1613
2462
|
return valid;
|
1614
2463
|
}
|
@@ -1649,7 +2498,7 @@ var Personnummer = class {
|
|
1649
2498
|
if (this.isCoordinationNumber()) {
|
1650
2499
|
ageDay -= 60;
|
1651
2500
|
}
|
1652
|
-
const ageDate = this.century + this.year +
|
2501
|
+
const ageDate = this.century + this.year + '-' + this.month + '-' + (ageDay < 10 ? '0' + ageDay : ageDay);
|
1653
2502
|
return new Date(ageDate);
|
1654
2503
|
}
|
1655
2504
|
/**
|
@@ -1666,11 +2515,7 @@ var Personnummer = class {
|
|
1666
2515
|
* @return {boolean}
|
1667
2516
|
*/
|
1668
2517
|
isCoordinationNumber() {
|
1669
|
-
return testDate(
|
1670
|
-
parseInt(this.century + this.year),
|
1671
|
-
+this.month,
|
1672
|
-
+this.day - 60
|
1673
|
-
);
|
2518
|
+
return testDate(parseInt(this.century + this.year), +this.month, +this.day - 60);
|
1674
2519
|
}
|
1675
2520
|
/**
|
1676
2521
|
* Check if a Swedish personal identity number is for a female.
|
@@ -1693,299 +2538,300 @@ var Personnummer = class {
|
|
1693
2538
|
var src_default = Personnummer;
|
1694
2539
|
|
1695
2540
|
function createCommonjsModule(fn, basedir, module) {
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
2541
|
+
return (
|
2542
|
+
(module = {
|
2543
|
+
path: basedir,
|
2544
|
+
exports: {},
|
2545
|
+
require: function (path, base) {
|
2546
|
+
return commonjsRequire();
|
2547
|
+
},
|
2548
|
+
}),
|
2549
|
+
fn(module, module.exports),
|
2550
|
+
module.exports
|
2551
|
+
);
|
1703
2552
|
}
|
1704
2553
|
|
1705
|
-
function commonjsRequire
|
1706
|
-
|
2554
|
+
function commonjsRequire() {
|
2555
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
1707
2556
|
}
|
1708
2557
|
|
1709
2558
|
var utf8 = createCommonjsModule(function (module, exports) {
|
1710
|
-
// tslint:disable:no-bitwise
|
1711
|
-
Object.defineProperty(exports,
|
1712
|
-
exports.utf8 = void 0;
|
1713
|
-
exports.utf8 = {
|
1714
|
-
encode: encode,
|
1715
|
-
decode: decode,
|
1716
|
-
};
|
1717
|
-
function encode(unicodeText) {
|
1718
|
-
unicodeText = unicodeText.replace(/\r\n/g,
|
1719
|
-
var result =
|
1720
|
-
for (var i = 0; i < unicodeText.length; i++) {
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
var
|
1739
|
-
var
|
1740
|
-
var
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
}
|
1760
|
-
}
|
1761
|
-
return result;
|
1762
|
-
}
|
2559
|
+
// tslint:disable:no-bitwise
|
2560
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
2561
|
+
exports.utf8 = void 0;
|
2562
|
+
exports.utf8 = {
|
2563
|
+
encode: encode,
|
2564
|
+
decode: decode,
|
2565
|
+
};
|
2566
|
+
function encode(unicodeText) {
|
2567
|
+
unicodeText = unicodeText.replace(/\r\n/g, '\n');
|
2568
|
+
var result = '';
|
2569
|
+
for (var i = 0; i < unicodeText.length; i++) {
|
2570
|
+
var char = unicodeText.charCodeAt(i);
|
2571
|
+
if (char < 128) {
|
2572
|
+
result += String.fromCharCode(char);
|
2573
|
+
} else if (char > 127 && char < 2048) {
|
2574
|
+
result += String.fromCharCode((char >> 6) | 192);
|
2575
|
+
result += String.fromCharCode((char & 63) | 128);
|
2576
|
+
} else {
|
2577
|
+
result += String.fromCharCode((char >> 12) | 224);
|
2578
|
+
result += String.fromCharCode(((char >> 6) & 63) | 128);
|
2579
|
+
result += String.fromCharCode((char & 63) | 128);
|
2580
|
+
}
|
2581
|
+
}
|
2582
|
+
return result;
|
2583
|
+
}
|
2584
|
+
function decode(utf8Text) {
|
2585
|
+
var result = '';
|
2586
|
+
var i = 0;
|
2587
|
+
var char1 = 0;
|
2588
|
+
var char2 = 0;
|
2589
|
+
var char3 = 0;
|
2590
|
+
while (i < utf8Text.length) {
|
2591
|
+
char1 = utf8Text.charCodeAt(i);
|
2592
|
+
if (char1 < 128) {
|
2593
|
+
result += String.fromCharCode(char1);
|
2594
|
+
i++;
|
2595
|
+
} else if (char1 > 191 && char1 < 224) {
|
2596
|
+
char2 = utf8Text.charCodeAt(i + 1);
|
2597
|
+
result += String.fromCharCode(((char1 & 31) << 6) | (char2 & 63));
|
2598
|
+
i += 2;
|
2599
|
+
} else {
|
2600
|
+
char2 = utf8Text.charCodeAt(i + 1);
|
2601
|
+
char3 = utf8Text.charCodeAt(i + 2);
|
2602
|
+
result += String.fromCharCode(((char1 & 15) << 12) | ((char2 & 63) << 6) | (char3 & 63));
|
2603
|
+
i += 3;
|
2604
|
+
}
|
2605
|
+
}
|
2606
|
+
return result;
|
2607
|
+
}
|
1763
2608
|
});
|
1764
2609
|
|
1765
2610
|
var md5 = createCommonjsModule(function (module, exports) {
|
1766
|
-
// tslint:disable:no-bitwise
|
1767
|
-
Object.defineProperty(exports,
|
1768
|
-
exports.generate = void 0;
|
1769
|
-
|
1770
|
-
function generate(unicodeText) {
|
1771
|
-
var x = [];
|
1772
|
-
var k;
|
1773
|
-
var AA;
|
1774
|
-
var BB;
|
1775
|
-
var CC;
|
1776
|
-
var DD;
|
1777
|
-
var a;
|
1778
|
-
var b;
|
1779
|
-
var c;
|
1780
|
-
var d;
|
1781
|
-
var S11 = 7;
|
1782
|
-
var S12 = 12;
|
1783
|
-
var S13 = 17;
|
1784
|
-
var S14 = 22;
|
1785
|
-
var S21 = 5;
|
1786
|
-
var S22 = 9;
|
1787
|
-
var S23 = 14;
|
1788
|
-
var S24 = 20;
|
1789
|
-
var S31 = 4;
|
1790
|
-
var S32 = 11;
|
1791
|
-
var S33 = 16;
|
1792
|
-
var S34 = 23;
|
1793
|
-
var S41 = 6;
|
1794
|
-
var S42 = 10;
|
1795
|
-
var S43 = 15;
|
1796
|
-
var S44 = 21;
|
1797
|
-
var utf8Text = utf8.utf8.encode(unicodeText);
|
1798
|
-
x = convertToWordArray(utf8Text);
|
1799
|
-
a = 0x67452301;
|
1800
|
-
b = 0xefcdab89;
|
1801
|
-
c = 0x98badcfe;
|
1802
|
-
d = 0x10325476;
|
1803
|
-
for (k = 0; k < x.length; k += 16) {
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
}
|
1877
|
-
return wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
|
1878
|
-
}
|
1879
|
-
exports.generate = generate;
|
1880
|
-
function rotateLeft(lValue, iShiftBits) {
|
1881
|
-
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
1882
|
-
}
|
1883
|
-
function addUnsigned(lX, lY) {
|
1884
|
-
var lX4;
|
1885
|
-
var lY4;
|
1886
|
-
var lX8;
|
1887
|
-
var lY8;
|
1888
|
-
var lResult;
|
1889
|
-
lX8 = lX & 0x80000000;
|
1890
|
-
lY8 = lY & 0x80000000;
|
1891
|
-
lX4 = lX & 0x40000000;
|
1892
|
-
lY4 = lY & 0x40000000;
|
1893
|
-
lResult = (lX & 0x3fffffff) + (lY & 0x3fffffff);
|
1894
|
-
if (lX4 & lY4) {
|
1895
|
-
|
1896
|
-
}
|
1897
|
-
if (lX4 | lY4) {
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
var
|
1939
|
-
var
|
1940
|
-
var
|
1941
|
-
var
|
1942
|
-
var
|
1943
|
-
var
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
var
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
wordToHexValue + wordToHexValueTemp.substr(wordToHexValueTemp.length - 2, 2);
|
1970
|
-
}
|
1971
|
-
return wordToHexValue;
|
1972
|
-
}
|
2611
|
+
// tslint:disable:no-bitwise
|
2612
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
2613
|
+
exports.generate = void 0;
|
2614
|
+
|
2615
|
+
function generate(unicodeText) {
|
2616
|
+
var x = [];
|
2617
|
+
var k;
|
2618
|
+
var AA;
|
2619
|
+
var BB;
|
2620
|
+
var CC;
|
2621
|
+
var DD;
|
2622
|
+
var a;
|
2623
|
+
var b;
|
2624
|
+
var c;
|
2625
|
+
var d;
|
2626
|
+
var S11 = 7;
|
2627
|
+
var S12 = 12;
|
2628
|
+
var S13 = 17;
|
2629
|
+
var S14 = 22;
|
2630
|
+
var S21 = 5;
|
2631
|
+
var S22 = 9;
|
2632
|
+
var S23 = 14;
|
2633
|
+
var S24 = 20;
|
2634
|
+
var S31 = 4;
|
2635
|
+
var S32 = 11;
|
2636
|
+
var S33 = 16;
|
2637
|
+
var S34 = 23;
|
2638
|
+
var S41 = 6;
|
2639
|
+
var S42 = 10;
|
2640
|
+
var S43 = 15;
|
2641
|
+
var S44 = 21;
|
2642
|
+
var utf8Text = utf8.utf8.encode(unicodeText);
|
2643
|
+
x = convertToWordArray(utf8Text);
|
2644
|
+
a = 0x67452301;
|
2645
|
+
b = 0xefcdab89;
|
2646
|
+
c = 0x98badcfe;
|
2647
|
+
d = 0x10325476;
|
2648
|
+
for (k = 0; k < x.length; k += 16) {
|
2649
|
+
AA = a;
|
2650
|
+
BB = b;
|
2651
|
+
CC = c;
|
2652
|
+
DD = d;
|
2653
|
+
a = FF(a, b, c, d, x[k + 0], S11, 0xd76aa478);
|
2654
|
+
d = FF(d, a, b, c, x[k + 1], S12, 0xe8c7b756);
|
2655
|
+
c = FF(c, d, a, b, x[k + 2], S13, 0x242070db);
|
2656
|
+
b = FF(b, c, d, a, x[k + 3], S14, 0xc1bdceee);
|
2657
|
+
a = FF(a, b, c, d, x[k + 4], S11, 0xf57c0faf);
|
2658
|
+
d = FF(d, a, b, c, x[k + 5], S12, 0x4787c62a);
|
2659
|
+
c = FF(c, d, a, b, x[k + 6], S13, 0xa8304613);
|
2660
|
+
b = FF(b, c, d, a, x[k + 7], S14, 0xfd469501);
|
2661
|
+
a = FF(a, b, c, d, x[k + 8], S11, 0x698098d8);
|
2662
|
+
d = FF(d, a, b, c, x[k + 9], S12, 0x8b44f7af);
|
2663
|
+
c = FF(c, d, a, b, x[k + 10], S13, 0xffff5bb1);
|
2664
|
+
b = FF(b, c, d, a, x[k + 11], S14, 0x895cd7be);
|
2665
|
+
a = FF(a, b, c, d, x[k + 12], S11, 0x6b901122);
|
2666
|
+
d = FF(d, a, b, c, x[k + 13], S12, 0xfd987193);
|
2667
|
+
c = FF(c, d, a, b, x[k + 14], S13, 0xa679438e);
|
2668
|
+
b = FF(b, c, d, a, x[k + 15], S14, 0x49b40821);
|
2669
|
+
a = GG(a, b, c, d, x[k + 1], S21, 0xf61e2562);
|
2670
|
+
d = GG(d, a, b, c, x[k + 6], S22, 0xc040b340);
|
2671
|
+
c = GG(c, d, a, b, x[k + 11], S23, 0x265e5a51);
|
2672
|
+
b = GG(b, c, d, a, x[k + 0], S24, 0xe9b6c7aa);
|
2673
|
+
a = GG(a, b, c, d, x[k + 5], S21, 0xd62f105d);
|
2674
|
+
d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
|
2675
|
+
c = GG(c, d, a, b, x[k + 15], S23, 0xd8a1e681);
|
2676
|
+
b = GG(b, c, d, a, x[k + 4], S24, 0xe7d3fbc8);
|
2677
|
+
a = GG(a, b, c, d, x[k + 9], S21, 0x21e1cde6);
|
2678
|
+
d = GG(d, a, b, c, x[k + 14], S22, 0xc33707d6);
|
2679
|
+
c = GG(c, d, a, b, x[k + 3], S23, 0xf4d50d87);
|
2680
|
+
b = GG(b, c, d, a, x[k + 8], S24, 0x455a14ed);
|
2681
|
+
a = GG(a, b, c, d, x[k + 13], S21, 0xa9e3e905);
|
2682
|
+
d = GG(d, a, b, c, x[k + 2], S22, 0xfcefa3f8);
|
2683
|
+
c = GG(c, d, a, b, x[k + 7], S23, 0x676f02d9);
|
2684
|
+
b = GG(b, c, d, a, x[k + 12], S24, 0x8d2a4c8a);
|
2685
|
+
a = HH(a, b, c, d, x[k + 5], S31, 0xfffa3942);
|
2686
|
+
d = HH(d, a, b, c, x[k + 8], S32, 0x8771f681);
|
2687
|
+
c = HH(c, d, a, b, x[k + 11], S33, 0x6d9d6122);
|
2688
|
+
b = HH(b, c, d, a, x[k + 14], S34, 0xfde5380c);
|
2689
|
+
a = HH(a, b, c, d, x[k + 1], S31, 0xa4beea44);
|
2690
|
+
d = HH(d, a, b, c, x[k + 4], S32, 0x4bdecfa9);
|
2691
|
+
c = HH(c, d, a, b, x[k + 7], S33, 0xf6bb4b60);
|
2692
|
+
b = HH(b, c, d, a, x[k + 10], S34, 0xbebfbc70);
|
2693
|
+
a = HH(a, b, c, d, x[k + 13], S31, 0x289b7ec6);
|
2694
|
+
d = HH(d, a, b, c, x[k + 0], S32, 0xeaa127fa);
|
2695
|
+
c = HH(c, d, a, b, x[k + 3], S33, 0xd4ef3085);
|
2696
|
+
b = HH(b, c, d, a, x[k + 6], S34, 0x4881d05);
|
2697
|
+
a = HH(a, b, c, d, x[k + 9], S31, 0xd9d4d039);
|
2698
|
+
d = HH(d, a, b, c, x[k + 12], S32, 0xe6db99e5);
|
2699
|
+
c = HH(c, d, a, b, x[k + 15], S33, 0x1fa27cf8);
|
2700
|
+
b = HH(b, c, d, a, x[k + 2], S34, 0xc4ac5665);
|
2701
|
+
a = II(a, b, c, d, x[k + 0], S41, 0xf4292244);
|
2702
|
+
d = II(d, a, b, c, x[k + 7], S42, 0x432aff97);
|
2703
|
+
c = II(c, d, a, b, x[k + 14], S43, 0xab9423a7);
|
2704
|
+
b = II(b, c, d, a, x[k + 5], S44, 0xfc93a039);
|
2705
|
+
a = II(a, b, c, d, x[k + 12], S41, 0x655b59c3);
|
2706
|
+
d = II(d, a, b, c, x[k + 3], S42, 0x8f0ccc92);
|
2707
|
+
c = II(c, d, a, b, x[k + 10], S43, 0xffeff47d);
|
2708
|
+
b = II(b, c, d, a, x[k + 1], S44, 0x85845dd1);
|
2709
|
+
a = II(a, b, c, d, x[k + 8], S41, 0x6fa87e4f);
|
2710
|
+
d = II(d, a, b, c, x[k + 15], S42, 0xfe2ce6e0);
|
2711
|
+
c = II(c, d, a, b, x[k + 6], S43, 0xa3014314);
|
2712
|
+
b = II(b, c, d, a, x[k + 13], S44, 0x4e0811a1);
|
2713
|
+
a = II(a, b, c, d, x[k + 4], S41, 0xf7537e82);
|
2714
|
+
d = II(d, a, b, c, x[k + 11], S42, 0xbd3af235);
|
2715
|
+
c = II(c, d, a, b, x[k + 2], S43, 0x2ad7d2bb);
|
2716
|
+
b = II(b, c, d, a, x[k + 9], S44, 0xeb86d391);
|
2717
|
+
a = addUnsigned(a, AA);
|
2718
|
+
b = addUnsigned(b, BB);
|
2719
|
+
c = addUnsigned(c, CC);
|
2720
|
+
d = addUnsigned(d, DD);
|
2721
|
+
}
|
2722
|
+
return wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
|
2723
|
+
}
|
2724
|
+
exports.generate = generate;
|
2725
|
+
function rotateLeft(lValue, iShiftBits) {
|
2726
|
+
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
2727
|
+
}
|
2728
|
+
function addUnsigned(lX, lY) {
|
2729
|
+
var lX4;
|
2730
|
+
var lY4;
|
2731
|
+
var lX8;
|
2732
|
+
var lY8;
|
2733
|
+
var lResult;
|
2734
|
+
lX8 = lX & 0x80000000;
|
2735
|
+
lY8 = lY & 0x80000000;
|
2736
|
+
lX4 = lX & 0x40000000;
|
2737
|
+
lY4 = lY & 0x40000000;
|
2738
|
+
lResult = (lX & 0x3fffffff) + (lY & 0x3fffffff);
|
2739
|
+
if (lX4 & lY4) {
|
2740
|
+
return lResult ^ 0x80000000 ^ lX8 ^ lY8;
|
2741
|
+
}
|
2742
|
+
if (lX4 | lY4) {
|
2743
|
+
if (lResult & 0x40000000) {
|
2744
|
+
return lResult ^ 0xc0000000 ^ lX8 ^ lY8;
|
2745
|
+
} else {
|
2746
|
+
return lResult ^ 0x40000000 ^ lX8 ^ lY8;
|
2747
|
+
}
|
2748
|
+
} else {
|
2749
|
+
return lResult ^ lX8 ^ lY8;
|
2750
|
+
}
|
2751
|
+
}
|
2752
|
+
function F(x, y, z) {
|
2753
|
+
return (x & y) | (~x & z);
|
2754
|
+
}
|
2755
|
+
function G(x, y, z) {
|
2756
|
+
return (x & z) | (y & ~z);
|
2757
|
+
}
|
2758
|
+
function H(x, y, z) {
|
2759
|
+
return x ^ y ^ z;
|
2760
|
+
}
|
2761
|
+
function I(x, y, z) {
|
2762
|
+
return y ^ (x | ~z);
|
2763
|
+
}
|
2764
|
+
function FF(a, b, c, d, x, s, ac) {
|
2765
|
+
a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
|
2766
|
+
return addUnsigned(rotateLeft(a, s), b);
|
2767
|
+
}
|
2768
|
+
function GG(a, b, c, d, x, s, ac) {
|
2769
|
+
a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
|
2770
|
+
return addUnsigned(rotateLeft(a, s), b);
|
2771
|
+
}
|
2772
|
+
function HH(a, b, c, d, x, s, ac) {
|
2773
|
+
a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
|
2774
|
+
return addUnsigned(rotateLeft(a, s), b);
|
2775
|
+
}
|
2776
|
+
function II(a, b, c, d, x, s, ac) {
|
2777
|
+
a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
|
2778
|
+
return addUnsigned(rotateLeft(a, s), b);
|
2779
|
+
}
|
2780
|
+
function convertToWordArray(value) {
|
2781
|
+
var lWordCount;
|
2782
|
+
var lMessageLength = value.length;
|
2783
|
+
var lNumberOfWordsTemp1 = lMessageLength + 8;
|
2784
|
+
var lNumberOfWordsTemp2 = (lNumberOfWordsTemp1 - (lNumberOfWordsTemp1 % 64)) / 64;
|
2785
|
+
var lNumberOfWords = (lNumberOfWordsTemp2 + 1) * 16;
|
2786
|
+
var lWordArray = Array(lNumberOfWords - 1);
|
2787
|
+
var lBytePosition = 0;
|
2788
|
+
var lByteCount = 0;
|
2789
|
+
while (lByteCount < lMessageLength) {
|
2790
|
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
2791
|
+
lBytePosition = (lByteCount % 4) * 8;
|
2792
|
+
lWordArray[lWordCount] = lWordArray[lWordCount] | (value.charCodeAt(lByteCount) << lBytePosition);
|
2793
|
+
lByteCount++;
|
2794
|
+
}
|
2795
|
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
2796
|
+
lBytePosition = (lByteCount % 4) * 8;
|
2797
|
+
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
2798
|
+
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
2799
|
+
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
2800
|
+
return lWordArray;
|
2801
|
+
}
|
2802
|
+
function wordToHex(lValue) {
|
2803
|
+
var wordToHexValue = '';
|
2804
|
+
var wordToHexValueTemp = '';
|
2805
|
+
var lByte;
|
2806
|
+
var lCount;
|
2807
|
+
for (lCount = 0; lCount <= 3; lCount++) {
|
2808
|
+
lByte = (lValue >>> (lCount * 8)) & 255;
|
2809
|
+
wordToHexValueTemp = '0' + lByte.toString(16);
|
2810
|
+
wordToHexValue = wordToHexValue + wordToHexValueTemp.substr(wordToHexValueTemp.length - 2, 2);
|
2811
|
+
}
|
2812
|
+
return wordToHexValue;
|
2813
|
+
}
|
1973
2814
|
});
|
1974
2815
|
|
1975
2816
|
var lib = createCommonjsModule(function (module, exports) {
|
1976
|
-
Object.defineProperty(exports,
|
1977
|
-
exports.MD5 = exports.generate = void 0;
|
1978
|
-
|
1979
|
-
var md5_2 = md5;
|
1980
|
-
Object.defineProperty(exports,
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
2817
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
2818
|
+
exports.MD5 = exports.generate = void 0;
|
2819
|
+
|
2820
|
+
var md5_2 = md5;
|
2821
|
+
Object.defineProperty(exports, 'generate', {
|
2822
|
+
enumerable: true,
|
2823
|
+
get: function () {
|
2824
|
+
return md5_2.generate;
|
2825
|
+
},
|
2826
|
+
});
|
2827
|
+
exports.MD5 = {
|
2828
|
+
generate: md5.generate,
|
2829
|
+
};
|
1984
2830
|
});
|
1985
2831
|
|
1986
|
-
const apiSearch = async
|
2832
|
+
const apiSearch = async query => {
|
1987
2833
|
var _a;
|
1988
|
-
const res = await fetch((_a =
|
2834
|
+
const res = await fetch((_a = 'https://hemfixare-lookup.vercel.app/api') !== null && _a !== void 0 ? _a : 'https://hemfixare-lookup.vercel.app/api', {
|
1989
2835
|
method: 'POST',
|
1990
2836
|
headers: {
|
1991
2837
|
'Content-Type': 'application/json',
|
@@ -2002,21 +2848,23 @@ const apiSearch = async (query) => {
|
|
2002
2848
|
const HemfixarnaGetuser = class {
|
2003
2849
|
constructor(hostRef) {
|
2004
2850
|
registerInstance(this, hostRef);
|
2005
|
-
this.handleChangeEmail =
|
2851
|
+
this.handleChangeEmail = e => {
|
2006
2852
|
this.emailError = null;
|
2007
2853
|
this.email = e.target.value;
|
2008
2854
|
};
|
2009
|
-
this.handleChangePhone =
|
2855
|
+
this.handleChangePhone = e => {
|
2010
2856
|
this.phoneError = null;
|
2011
2857
|
this.phone = e.target.value;
|
2012
2858
|
};
|
2013
|
-
this.handleChangessn =
|
2859
|
+
this.handleChangessn = e => {
|
2014
2860
|
this.ssnError = null;
|
2015
2861
|
this.ssn = e.target.value;
|
2016
2862
|
};
|
2017
|
-
this.handleSubmit = async
|
2863
|
+
this.handleSubmit = async e => {
|
2018
2864
|
e.preventDefault();
|
2019
|
-
const emailRegex = new RegExp(
|
2865
|
+
const emailRegex = new RegExp(
|
2866
|
+
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
2867
|
+
);
|
2020
2868
|
const validEmail = emailRegex.test(this.email);
|
2021
2869
|
if (!validEmail) {
|
2022
2870
|
this.emailError = 'Ange en giltig e-postadress';
|
@@ -2028,8 +2876,7 @@ const HemfixarnaGetuser = class {
|
|
2028
2876
|
const validssn = src_default.valid(this.ssn);
|
2029
2877
|
if (!validssn) {
|
2030
2878
|
this.ssnError = 'Ange ett giltigt personnummer';
|
2031
|
-
}
|
2032
|
-
else if (validssn) {
|
2879
|
+
} else if (validssn) {
|
2033
2880
|
const pn = src_default.parse(this.ssn).format(true);
|
2034
2881
|
this.ssn = [pn.slice(0, 8), '-', pn.slice(8)].join('');
|
2035
2882
|
}
|
@@ -2040,23 +2887,46 @@ const HemfixarnaGetuser = class {
|
|
2040
2887
|
state.creditSafeUser = creditSafeData;
|
2041
2888
|
state.checkoutStep = 2;
|
2042
2889
|
state.user = Object.assign(Object.assign({}, creditSafeData), { email: this.email, phone: this.phone, ssn: this.ssn });
|
2043
|
-
}
|
2044
|
-
else {
|
2890
|
+
} else {
|
2045
2891
|
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
2046
2892
|
}
|
2047
|
-
}
|
2048
|
-
catch (e) {
|
2893
|
+
} catch (e) {
|
2049
2894
|
this.ssnError = 'Vi kunde tyvärr inte hitta en address med ditt angivna personnummer';
|
2050
2895
|
console.log(e);
|
2051
|
-
}
|
2052
|
-
finally {
|
2896
|
+
} finally {
|
2053
2897
|
const el = this.el.closest('.hemfixarna_content');
|
2054
2898
|
scrollToTop(el);
|
2055
2899
|
}
|
2056
2900
|
}
|
2057
2901
|
};
|
2058
2902
|
this.render = () => {
|
2059
|
-
return
|
2903
|
+
return h(
|
2904
|
+
'form',
|
2905
|
+
{ class: 'mb-2', onSubmit: e => this.handleSubmit(e) },
|
2906
|
+
h(
|
2907
|
+
'div',
|
2908
|
+
null,
|
2909
|
+
h('input', { class: `${this.email.length ? 'input_active' : ''}`, onChange: e => this.handleChangeEmail(e), type: 'email', name: 'email', value: this.email }),
|
2910
|
+
h('label', { htmlFor: 'email' }, 'E-post '),
|
2911
|
+
),
|
2912
|
+
this.emailError && h('span', null, this.emailError),
|
2913
|
+
h(
|
2914
|
+
'div',
|
2915
|
+
null,
|
2916
|
+
h('input', { class: `${this.phone.length ? 'input_active' : ''}`, onChange: e => this.handleChangePhone(e), type: 'tel', name: 'phone', value: this.phone }),
|
2917
|
+
h('label', { htmlFor: 'phone' }, 'Mobiltelefon '),
|
2918
|
+
),
|
2919
|
+
this.phoneError && h('span', null, this.phoneError),
|
2920
|
+
h(
|
2921
|
+
'div',
|
2922
|
+
null,
|
2923
|
+
h('input', { class: `${this.ssn.length ? 'input_active' : ''}`, onChange: e => this.handleChangessn(e), type: 'tel', name: 'ssn', value: this.ssn }),
|
2924
|
+
h('label', { htmlFor: 'phone' }, 'Personnummer*'),
|
2925
|
+
),
|
2926
|
+
this.ssnError && h('span', null, this.ssnError),
|
2927
|
+
h('input', { type: 'submit', value: 'Forts\u00E4tt*' }),
|
2928
|
+
h('p', null, '*Vi h\u00E4mtar din adress'),
|
2929
|
+
);
|
2060
2930
|
};
|
2061
2931
|
this.email = '';
|
2062
2932
|
this.emailError = null;
|
@@ -2072,10 +2942,12 @@ const HemfixarnaGetuser = class {
|
|
2072
2942
|
this.ssn = state.user.ssn;
|
2073
2943
|
}
|
2074
2944
|
}
|
2075
|
-
get el() {
|
2945
|
+
get el() {
|
2946
|
+
return getElement(this);
|
2947
|
+
}
|
2076
2948
|
};
|
2077
2949
|
|
2078
|
-
const hemfixarnaHornbachCss =
|
2950
|
+
const hemfixarnaHornbachCss = '';
|
2079
2951
|
|
2080
2952
|
const MyComponent$c = class {
|
2081
2953
|
constructor(hostRef) {
|
@@ -2088,7 +2960,16 @@ const MyComponent$c = class {
|
|
2088
2960
|
this.buttonBg = undefined;
|
2089
2961
|
}
|
2090
2962
|
render() {
|
2091
|
-
return
|
2963
|
+
return h('hemfixarna-component', {
|
2964
|
+
widgetStyle: this.widgetStyle,
|
2965
|
+
buttonBg: this.buttonBg,
|
2966
|
+
buttonColor: this.buttonColor,
|
2967
|
+
nav: { url: 'https://www.hornbach.se/', logo: 'assets/hornbach/logo.svg', background: './assets/hornbach/nav.jpg' },
|
2968
|
+
isDemo: this.isDemo,
|
2969
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
2970
|
+
id: this.id,
|
2971
|
+
business: Business.hornbach,
|
2972
|
+
});
|
2092
2973
|
}
|
2093
2974
|
};
|
2094
2975
|
MyComponent$c.style = hemfixarnaHornbachCss;
|
@@ -2101,13 +2982,45 @@ const HemfixarnaInfo = class {
|
|
2101
2982
|
render() {
|
2102
2983
|
var _a;
|
2103
2984
|
const checked = getAssetPath(`./assets/checked.svg`);
|
2104
|
-
return
|
2985
|
+
return h(
|
2986
|
+
'div',
|
2987
|
+
{ class: 'hemfixarna_info' },
|
2988
|
+
state.step < 5 ? h(Fragment, null, h('h2', null, state.customer.info_title), h('p', null, state.customer.info_text)) : h('h2', null, state.customer.checkout_title),
|
2989
|
+
h(
|
2990
|
+
'ul',
|
2991
|
+
{ class: 'hemfixarna_features' },
|
2992
|
+
state.step < 5
|
2993
|
+
? h(
|
2994
|
+
Fragment,
|
2995
|
+
null,
|
2996
|
+
((_a = state.customer.trust_badges) === null || _a === void 0 ? void 0 : _a.length)
|
2997
|
+
? h(
|
2998
|
+
Fragment,
|
2999
|
+
null,
|
3000
|
+
state.customer.trust_badges.map(l => h('li', { key: l.text }, h('img', { src: checked, alt: 'checked' }), h('p', null, l.text))),
|
3001
|
+
)
|
3002
|
+
: h(
|
3003
|
+
Fragment,
|
3004
|
+
null,
|
3005
|
+
state.options.trust.map(l => h('li', { key: l.trust_badge }, h('img', { src: checked, alt: 'checked' }), h('p', null, l.trust_badge))),
|
3006
|
+
),
|
3007
|
+
)
|
3008
|
+
: h(
|
3009
|
+
Fragment,
|
3010
|
+
null,
|
3011
|
+
state.customer.checkout_trust_badges.map(l => h('li', { key: l.text }, h('img', { src: checked, alt: 'checked' }), h('p', null, l.text))),
|
3012
|
+
),
|
3013
|
+
),
|
3014
|
+
h('img', { src: this.logo, width: 200, alt: 'hemfixarna' }),
|
3015
|
+
h('a', { class: 'hemfixarna_product--link', target: '_blank', href: state.options.link.url }, state.options.link.title),
|
3016
|
+
);
|
2105
3017
|
}
|
2106
3018
|
};
|
2107
3019
|
|
2108
|
-
const hemfixarnaInvoiceCss =
|
3020
|
+
const hemfixarnaInvoiceCss =
|
3021
|
+
':host .invoice{gap:16px;display:grid}:host .invoice form>span{text-align:center;padding:16px 0}:host .invoice img{right:unset;left:unset;position:initial;transform:none}:host .invoice label{cursor:pointer;font-size:14px;display:flex;align-items:flex-start;padding:16px 0}:host .invoice label input{margin:0 5px 0 0;accent-color:#ea662c}:host .invoice-preview{display:flex;gap:4px}:host .invoice-preview div{position:relative}:host .invoice-preview div button{position:absolute;top:0;right:0;padding:0}:host .invoice-preview div button img{width:24px;height:24px}:host .invoice-preview div>img{width:100px;height:80px;object-fit:cover}:host .invoice input[type=email],:host .invoice input[type=tel],:host .invoice textarea{padding:16px;border:1px solid #fcd9c9;font-size:16px}:host .invoice textarea{resize:none;height:200px;font-family:"Inter", sans-serif}:host .invoice div:has(>input[type=file]){display:flex;align-items:center;justify-content:center;cursor:pointer;background:#fff;border:1px solid #fcd9c9;padding:32px 16px;gap:16px}:host .invoice div:has(>input[type=file]) span{color:#000;font-size:12px}:host .invoice input[type=file]{display:none}';
|
2109
3022
|
|
2110
|
-
const base = `${
|
3023
|
+
const base = `${'https://hemfixarna.se'}/wp-json/headless`;
|
2111
3024
|
const HemfixarnaInvoice = class {
|
2112
3025
|
constructor(hostRef) {
|
2113
3026
|
registerInstance(this, hostRef);
|
@@ -2176,15 +3089,18 @@ const HemfixarnaInvoice = class {
|
|
2176
3089
|
this.formImages.forEach(file => {
|
2177
3090
|
formData.append('images[]', file);
|
2178
3091
|
});
|
2179
|
-
formData.append(
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2187
|
-
|
3092
|
+
formData.append(
|
3093
|
+
'product',
|
3094
|
+
JSON.stringify({
|
3095
|
+
title: state.selectedProduct.title,
|
3096
|
+
amount: 1,
|
3097
|
+
has_rut: state.selectedProduct.rut,
|
3098
|
+
has_rot: state.selectedProduct.rot,
|
3099
|
+
has_green: state.selectedProduct.green,
|
3100
|
+
ID: state.selectedProduct.ID,
|
3101
|
+
parts: [],
|
3102
|
+
}),
|
3103
|
+
);
|
2188
3104
|
try {
|
2189
3105
|
const res = await fetch(`${base}/saveinvoiceproduct`, {
|
2190
3106
|
method: 'POST',
|
@@ -2194,13 +3110,11 @@ const HemfixarnaInvoice = class {
|
|
2194
3110
|
if (response.code === 200) {
|
2195
3111
|
state.checkoutInvoice = true;
|
2196
3112
|
state.step = 6;
|
2197
|
-
}
|
2198
|
-
else {
|
3113
|
+
} else {
|
2199
3114
|
this.formError = 'Vi kan inte ta emot din beställning just nu';
|
2200
3115
|
this.formState = 'initial';
|
2201
3116
|
}
|
2202
|
-
}
|
2203
|
-
catch (error) {
|
3117
|
+
} catch (error) {
|
2204
3118
|
this.formError = 'Vi kan inte ta emot din beställning just nu';
|
2205
3119
|
this.formState = 'initial';
|
2206
3120
|
}
|
@@ -2247,9 +3161,50 @@ const HemfixarnaInvoice = class {
|
|
2247
3161
|
}
|
2248
3162
|
render() {
|
2249
3163
|
const upload = getAssetPath(`./assets/drag-drop.svg`);
|
2250
|
-
return
|
3164
|
+
return h(
|
3165
|
+
'div',
|
3166
|
+
{ class: 'invoice' },
|
3167
|
+
h('p', null, state.selectedProduct.invoice_description),
|
3168
|
+
h(
|
3169
|
+
'form',
|
3170
|
+
{ onSubmit: e => this.submit(e) },
|
3171
|
+
h('textarea', { name: 'descriptionInput', placeholder: 'Beskriv ditt \u00E4rende' }),
|
3172
|
+
h(
|
3173
|
+
'div',
|
3174
|
+
{
|
3175
|
+
'role': 'button',
|
3176
|
+
'aria-label': 'upload image',
|
3177
|
+
'onDragOver': e => this.preventDragOver(e),
|
3178
|
+
'onDrop': e => this.handleImageDrop(e),
|
3179
|
+
'onClick': () => this.handleImageClick(),
|
3180
|
+
},
|
3181
|
+
h('img', { src: upload, alt: 'hemfixarna_logo', width: 24 }),
|
3182
|
+
h('div', null, h('p', null, 'Bifoga ev bilder'), h('span', null, '(dra bilder hit)')),
|
3183
|
+
h('input', { onChange: e => this.handleFileInputChange(e), class: 'hemfixarna-file-upload', accept: 'image/*', type: 'file', multiple: true, name: 'fileInput' }),
|
3184
|
+
),
|
3185
|
+
h(
|
3186
|
+
'div',
|
3187
|
+
{ class: 'invoice-preview' },
|
3188
|
+
this.displayImages.map((img, i) =>
|
3189
|
+
h(
|
3190
|
+
'div',
|
3191
|
+
{ key: i },
|
3192
|
+
h('img', { src: img, alt: 'uploaded image' }),
|
3193
|
+
h('button', { onClick: () => this.removeImage(i) }, h('img', { src: getAssetPath(`./assets/close.svg`), alt: 'close' })),
|
3194
|
+
),
|
3195
|
+
),
|
3196
|
+
),
|
3197
|
+
h('input', { placeholder: 'E-post', type: 'email', name: 'emailInput' }),
|
3198
|
+
h('input', { placeholder: 'Telefonnummer', type: 'tel', name: 'telInput' }),
|
3199
|
+
state.selectedProduct.terms_show_checkbox ? h('label', null, h('input', { type: 'checkbox', name: 'termsInput' }), state.selectedProduct.terms) : null,
|
3200
|
+
this.formError ? h('span', null, this.formError) : null,
|
3201
|
+
h('input', { type: 'submit', value: this.formState === 'loading' ? 'Skickar' : 'Kontakta mig' }),
|
3202
|
+
),
|
3203
|
+
);
|
3204
|
+
}
|
3205
|
+
get el() {
|
3206
|
+
return getElement(this);
|
2251
3207
|
}
|
2252
|
-
get el() { return getElement(this); }
|
2253
3208
|
};
|
2254
3209
|
HemfixarnaInvoice.style = hemfixarnaInvoiceCss;
|
2255
3210
|
|
@@ -2264,7 +3219,16 @@ const MyComponent$b = class {
|
|
2264
3219
|
this.isDemo = false;
|
2265
3220
|
}
|
2266
3221
|
render() {
|
2267
|
-
return
|
3222
|
+
return h('hemfixarna-component', {
|
3223
|
+
widgetStyle: this.widgetStyle,
|
3224
|
+
buttonBg: this.buttonBg,
|
3225
|
+
buttonColor: this.buttonColor,
|
3226
|
+
nav: { url: 'https://k-bygg.se', logo: 'assets/kbygg.svg', backgroundColor: '#651d32' },
|
3227
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3228
|
+
id: this.id,
|
3229
|
+
business: Business.kbygg,
|
3230
|
+
isDemo: this.isDemo,
|
3231
|
+
});
|
2268
3232
|
}
|
2269
3233
|
};
|
2270
3234
|
|
@@ -2278,7 +3242,14 @@ const MyComponent$a = class {
|
|
2278
3242
|
this.buttonBg = undefined;
|
2279
3243
|
}
|
2280
3244
|
render() {
|
2281
|
-
return
|
3245
|
+
return h('hemfixarna-component', {
|
3246
|
+
widgetStyle: this.widgetStyle,
|
3247
|
+
buttonBg: this.buttonBg,
|
3248
|
+
buttonColor: this.buttonColor,
|
3249
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3250
|
+
id: this.id,
|
3251
|
+
business: Business.klint,
|
3252
|
+
});
|
2282
3253
|
}
|
2283
3254
|
};
|
2284
3255
|
|
@@ -2292,7 +3263,14 @@ const MyComponent$9 = class {
|
|
2292
3263
|
this.buttonBg = undefined;
|
2293
3264
|
}
|
2294
3265
|
render() {
|
2295
|
-
return
|
3266
|
+
return h('hemfixarna-component', {
|
3267
|
+
widgetStyle: this.widgetStyle,
|
3268
|
+
buttonBg: this.buttonBg,
|
3269
|
+
buttonColor: this.buttonColor,
|
3270
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3271
|
+
id: this.id,
|
3272
|
+
business: Business.kund,
|
3273
|
+
});
|
2296
3274
|
}
|
2297
3275
|
};
|
2298
3276
|
|
@@ -2307,7 +3285,16 @@ const MyComponent$8 = class {
|
|
2307
3285
|
this.isDemo = false;
|
2308
3286
|
}
|
2309
3287
|
render() {
|
2310
|
-
return
|
3288
|
+
return h('hemfixarna-component', {
|
3289
|
+
widgetStyle: this.widgetStyle,
|
3290
|
+
buttonBg: this.buttonBg,
|
3291
|
+
buttonColor: this.buttonColor,
|
3292
|
+
nav: { url: 'https://norrgavel.se', logo: 'assets/norrgavel.svg' },
|
3293
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3294
|
+
id: this.id,
|
3295
|
+
business: Business.norrgavel,
|
3296
|
+
isDemo: this.isDemo,
|
3297
|
+
});
|
2311
3298
|
}
|
2312
3299
|
};
|
2313
3300
|
|
@@ -2315,7 +3302,20 @@ const HemfixarnaOrder = class {
|
|
2315
3302
|
constructor(hostRef) {
|
2316
3303
|
registerInstance(this, hostRef);
|
2317
3304
|
this.render = () => {
|
2318
|
-
return
|
3305
|
+
return h(
|
3306
|
+
'div',
|
3307
|
+
{ style: { background: `url(${state.options.thank_you_image})` }, class: 'hemfixarna_order' },
|
3308
|
+
h('div', null),
|
3309
|
+
h(
|
3310
|
+
'div',
|
3311
|
+
null,
|
3312
|
+
h('h2', null, state.checkoutInvoice ? 'Tack för din förfrågan' : 'Tack för din bokning'),
|
3313
|
+
state.checkoutInvoice ? h('p', null, 'Vi \u00E5terkommer inom kort till dig p\u00E5 angivet telefonnummer eller epost') : null,
|
3314
|
+
state.checkoutInvoice ? h('div', null) : h('hemfixarna-orderrows', { tree: this.tree, cart: false }),
|
3315
|
+
h('span', { onClick: () => this.resetShop() }, h('button', null, 'G\u00F6r en ny bokning')),
|
3316
|
+
h('hemfixarna-info', null),
|
3317
|
+
),
|
3318
|
+
);
|
2319
3319
|
};
|
2320
3320
|
this.tree = undefined;
|
2321
3321
|
}
|
@@ -2350,13 +3350,12 @@ const HemfixarnaOrderrows = class {
|
|
2350
3350
|
state.selectedProduct = product.fields;
|
2351
3351
|
state.step = 4;
|
2352
3352
|
}
|
2353
|
-
}
|
2354
|
-
|
2355
|
-
const
|
2356
|
-
const
|
2357
|
-
const
|
2358
|
-
const
|
2359
|
-
const category = this.tree.sub_cats.find((c) => c.services.find((s) => s.products.find((p) => p.ID === id)));
|
3353
|
+
} else {
|
3354
|
+
const services = this.tree.sub_cats.map(c => c.services).flat();
|
3355
|
+
const products = services.map(s => s.products).flat();
|
3356
|
+
const product = products.find(p => p.ID === id);
|
3357
|
+
const service = services.find(s => s.products.find(p => p.ID === id));
|
3358
|
+
const category = this.tree.sub_cats.find(c => c.services.find(s => s.products.find(p => p.ID === id)));
|
2360
3359
|
state.selectedCategory = category;
|
2361
3360
|
state.selectedService = service;
|
2362
3361
|
state.selectedProduct = product;
|
@@ -2384,23 +3383,130 @@ const HemfixarnaOrderrows = class {
|
|
2384
3383
|
getDiscountedInfo(item) {
|
2385
3384
|
if (item.rut && state.rut) {
|
2386
3385
|
return ' (efter RUT-avdrag)';
|
2387
|
-
}
|
2388
|
-
else if (item.rot && state.rot) {
|
3386
|
+
} else if (item.rot && state.rot) {
|
2389
3387
|
return ' (efter ROT-avdrag)';
|
2390
|
-
}
|
2391
|
-
else if (item.green && state.green) {
|
3388
|
+
} else if (item.green && state.green) {
|
2392
3389
|
return ' (efter Grön teknik avdrag)';
|
2393
|
-
}
|
2394
|
-
else {
|
3390
|
+
} else {
|
2395
3391
|
return '';
|
2396
3392
|
}
|
2397
3393
|
}
|
2398
3394
|
render() {
|
2399
3395
|
const info = getAssetPath(`./assets/info.svg`);
|
2400
|
-
return
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
3396
|
+
return h(
|
3397
|
+
Fragment,
|
3398
|
+
null,
|
3399
|
+
h(
|
3400
|
+
'ul',
|
3401
|
+
{ class: 'hemfixarna_cart--items' },
|
3402
|
+
state.cart.map(item => {
|
3403
|
+
var _a;
|
3404
|
+
return h(
|
3405
|
+
'li',
|
3406
|
+
{ class: 'hemfixarna_cart--item' },
|
3407
|
+
h(
|
3408
|
+
'div',
|
3409
|
+
null,
|
3410
|
+
h(
|
3411
|
+
'div',
|
3412
|
+
null,
|
3413
|
+
item.icon && h('img', { width: 30, src: (_a = item.icon.url) !== null && _a !== void 0 ? _a : item.icon, alt: item.name }),
|
3414
|
+
h('p', null, h('strong', null, item.amount, 'x '), item.name),
|
3415
|
+
),
|
3416
|
+
this.cart && h('button', { onClick: () => this.goToProduct(item.id) }, '\u00C4ndra'),
|
3417
|
+
),
|
3418
|
+
h('p', null, h('strong', null, getProductPrice(item, item.price, item.amount), 'kr'), h('span', null, this.getDiscountedInfo(item))),
|
3419
|
+
item.parts.length > 0 &&
|
3420
|
+
h(
|
3421
|
+
'ul',
|
3422
|
+
null,
|
3423
|
+
item.parts.map(part =>
|
3424
|
+
h('li', null, h('p', null, h('strong', null, part.amount, 'x '), part.name), h('p', null, h('strong', null, getPartPrice(part, item, part.amount), 'kr'))),
|
3425
|
+
),
|
3426
|
+
),
|
3427
|
+
);
|
3428
|
+
}),
|
3429
|
+
),
|
3430
|
+
h(
|
3431
|
+
'div',
|
3432
|
+
{ class: 'hemfixarna_cart--additional' },
|
3433
|
+
h(
|
3434
|
+
'div',
|
3435
|
+
null,
|
3436
|
+
getStartFee().rot > 0 &&
|
3437
|
+
h(
|
3438
|
+
'div',
|
3439
|
+
{ class: 'hemfixarna_cart--startfee' },
|
3440
|
+
h(
|
3441
|
+
'p',
|
3442
|
+
null,
|
3443
|
+
h('strong', { onClick: () => this.openRot() }, state.rotOptions.rot_start_fee_heading, h('img', { height: 16, src: info, alt: 'info monteringsavgift' })),
|
3444
|
+
),
|
3445
|
+
h('p', null, getStartFee().rot, 'kr'),
|
3446
|
+
),
|
3447
|
+
getStartFee().rut > 0 &&
|
3448
|
+
h(
|
3449
|
+
'div',
|
3450
|
+
{ class: 'hemfixarna_cart--startfee' },
|
3451
|
+
h(
|
3452
|
+
'p',
|
3453
|
+
null,
|
3454
|
+
h('strong', { onClick: () => this.openRut() }, state.rutOptions.rut_start_fee_heading, h('img', { height: 16, src: info, alt: 'info monteringsavgift' })),
|
3455
|
+
),
|
3456
|
+
h('p', null, getStartFee().rut, 'kr'),
|
3457
|
+
),
|
3458
|
+
getStartFee().green > 0 &&
|
3459
|
+
h(
|
3460
|
+
'div',
|
3461
|
+
{ class: 'hemfixarna_cart--startfee' },
|
3462
|
+
h(
|
3463
|
+
'p',
|
3464
|
+
null,
|
3465
|
+
h('strong', { onClick: () => this.openGreen() }, state.greenOptions.green_start_fee_heading, h('img', { height: 16, src: info, alt: 'info monteringsavgift' })),
|
3466
|
+
),
|
3467
|
+
h('p', null, getStartFee().green, 'kr'),
|
3468
|
+
),
|
3469
|
+
),
|
3470
|
+
state.cart.find(item => item.rot) &&
|
3471
|
+
h(
|
3472
|
+
'div',
|
3473
|
+
{ class: 'hemfixarna_cart--rutrot' },
|
3474
|
+
h(
|
3475
|
+
'div',
|
3476
|
+
null,
|
3477
|
+
this.cart &&
|
3478
|
+
h('label', { class: 'switch' }, h('input', { checked: state.rot, onChange: () => (state.rot = !state.rot), type: 'checkbox' }), h('span', { class: 'slider' })),
|
3479
|
+
h('p', null, 'ROT-avdrag'),
|
3480
|
+
),
|
3481
|
+
h('p', null, '(-', state.rot ? calculateRot() : 0, 'kr)'),
|
3482
|
+
),
|
3483
|
+
state.cart.find(item => item.rut) &&
|
3484
|
+
h(
|
3485
|
+
'div',
|
3486
|
+
{ class: 'hemfixarna_cart--rutrot' },
|
3487
|
+
h(
|
3488
|
+
'div',
|
3489
|
+
null,
|
3490
|
+
h('label', { class: 'switch' }, h('input', { onChange: () => (state.rut = !state.rut), checked: state.rut, type: 'checkbox' }), h('span', { class: 'slider' })),
|
3491
|
+
h('p', null, 'RUT-avdrag'),
|
3492
|
+
),
|
3493
|
+
h('p', null, '(-', state.rut ? calculateRut() : 0, 'kr)'),
|
3494
|
+
),
|
3495
|
+
state.cart.find(item => item.green) &&
|
3496
|
+
h(
|
3497
|
+
'div',
|
3498
|
+
{ class: 'hemfixarna_cart--rutrot' },
|
3499
|
+
h(
|
3500
|
+
'div',
|
3501
|
+
null,
|
3502
|
+
h('label', { class: 'switch' }, h('input', { onChange: () => (state.green = !state.green), checked: state.green, type: 'checkbox' }), h('span', { class: 'slider' })),
|
3503
|
+
h('p', null, 'Gr\u00F6n teknik avdrag'),
|
3504
|
+
),
|
3505
|
+
h('p', null, '(-', state.green ? calculateGreenDiscount() : 0, 'kr)'),
|
3506
|
+
),
|
3507
|
+
),
|
3508
|
+
h('div', { class: 'hemfixarna_cart--price' }, h('h2', null, 'Totalbelopp: '), h('h2', null, getTotalPrice(), 'kr')),
|
3509
|
+
);
|
2404
3510
|
}
|
2405
3511
|
};
|
2406
3512
|
|
@@ -2415,11 +3521,18 @@ const MyComponent$7 = class {
|
|
2415
3521
|
this.buttonBg = undefined;
|
2416
3522
|
}
|
2417
3523
|
render() {
|
2418
|
-
return
|
3524
|
+
return h('hemfixarna-component', {
|
3525
|
+
widgetStyle: this.widgetStyle,
|
3526
|
+
buttonBg: this.buttonBg,
|
3527
|
+
buttonColor: this.buttonColor,
|
3528
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3529
|
+
id: this.id,
|
3530
|
+
business: Business.power,
|
3531
|
+
});
|
2419
3532
|
}
|
2420
3533
|
};
|
2421
3534
|
|
2422
|
-
const hemfixarnaProductCss =
|
3535
|
+
const hemfixarnaProductCss = '';
|
2423
3536
|
|
2424
3537
|
const HemfixarnaProduct = class {
|
2425
3538
|
constructor(hostRef) {
|
@@ -2432,8 +3545,7 @@ const HemfixarnaProduct = class {
|
|
2432
3545
|
if (productInCart) {
|
2433
3546
|
productInCart.amount++;
|
2434
3547
|
state.cart = [...state.cart];
|
2435
|
-
}
|
2436
|
-
else {
|
3548
|
+
} else {
|
2437
3549
|
state.cart = [
|
2438
3550
|
...state.cart,
|
2439
3551
|
{
|
@@ -2457,8 +3569,7 @@ const HemfixarnaProduct = class {
|
|
2457
3569
|
if (productInCart && productInCart.amount > 1) {
|
2458
3570
|
productInCart.amount--;
|
2459
3571
|
state.cart = [...state.cart];
|
2460
|
-
}
|
2461
|
-
else {
|
3572
|
+
} else {
|
2462
3573
|
state.cart = state.cart.filter(p => p.id !== state.selectedProduct.ID);
|
2463
3574
|
}
|
2464
3575
|
}
|
@@ -2471,8 +3582,7 @@ const HemfixarnaProduct = class {
|
|
2471
3582
|
if (partInCart) {
|
2472
3583
|
partInCart.amount++;
|
2473
3584
|
productInCart.parts = [...productInCart.parts];
|
2474
|
-
}
|
2475
|
-
else {
|
3585
|
+
} else {
|
2476
3586
|
productInCart.parts = [...productInCart.parts, { id: part.ID, amount: 1, price: part.price, name: (_a = part.title) !== null && _a !== void 0 ? _a : part.title }];
|
2477
3587
|
}
|
2478
3588
|
state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];
|
@@ -2485,8 +3595,7 @@ const HemfixarnaProduct = class {
|
|
2485
3595
|
if (partInCart && partInCart.amount > 1) {
|
2486
3596
|
partInCart.amount--;
|
2487
3597
|
productInCart.parts = [...productInCart.parts];
|
2488
|
-
}
|
2489
|
-
else {
|
3598
|
+
} else {
|
2490
3599
|
productInCart.parts = productInCart.parts.filter(sp => sp.id !== part.ID);
|
2491
3600
|
}
|
2492
3601
|
state.cart = [...state.cart.filter(p => p.id !== productInCart.id), productInCart];
|
@@ -2507,7 +3616,9 @@ const HemfixarnaProduct = class {
|
|
2507
3616
|
getPartAmount(partId) {
|
2508
3617
|
var _a;
|
2509
3618
|
const productInCart = state.cart.find(p => p.id === state.selectedProduct.ID);
|
2510
|
-
return (
|
3619
|
+
return (
|
3620
|
+
((_a = productInCart === null || productInCart === void 0 ? void 0 : productInCart.parts.find(sp => sp.id === partId)) === null || _a === void 0 ? void 0 : _a.amount) || 0
|
3621
|
+
);
|
2511
3622
|
}
|
2512
3623
|
getTotalPrice() {
|
2513
3624
|
let price = 0;
|
@@ -2521,8 +3632,7 @@ const HemfixarnaProduct = class {
|
|
2521
3632
|
return acc;
|
2522
3633
|
}, 0);
|
2523
3634
|
price = state.selectedProduct.price * productInCart.amount + partsPrice;
|
2524
|
-
}
|
2525
|
-
else {
|
3635
|
+
} else {
|
2526
3636
|
price = state.selectedProduct.price;
|
2527
3637
|
}
|
2528
3638
|
return getProductPrice(state.selectedProduct, price);
|
@@ -2539,8 +3649,7 @@ const HemfixarnaProduct = class {
|
|
2539
3649
|
if (parents.length > 0 && parents[0].shadowRoot !== null) {
|
2540
3650
|
parents[0].shadowRoot.appendChild(linkElem);
|
2541
3651
|
parents[0].shadowRoot.appendChild(fonts);
|
2542
|
-
}
|
2543
|
-
else {
|
3652
|
+
} else {
|
2544
3653
|
setTimeout(checkAndInjectCSS, 1);
|
2545
3654
|
}
|
2546
3655
|
};
|
@@ -2552,17 +3661,128 @@ const HemfixarnaProduct = class {
|
|
2552
3661
|
const plus = getAssetPath(`./assets/plus.svg`);
|
2553
3662
|
const minus = getAssetPath(`./assets/minus.svg`);
|
2554
3663
|
if (state.maleri) {
|
2555
|
-
return
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
3664
|
+
return h(
|
3665
|
+
'div',
|
3666
|
+
{ class: 'hemfixarna_painting' },
|
3667
|
+
h('script', {
|
3668
|
+
type: 'text/javascript',
|
3669
|
+
src: ['localhost', 'vercel'].some(v => window.location.href.includes(v))
|
3670
|
+
? 'https://painting-dev.vercel.app/static/js/main.js'
|
3671
|
+
: 'https://painting-frontend.vercel.app/static/js/main.js',
|
3672
|
+
defer: true,
|
3673
|
+
async: true,
|
3674
|
+
}),
|
3675
|
+
h('hemfixare-calculator', {
|
3676
|
+
title: state.options.maleri_title,
|
3677
|
+
subtitle: state.options.maleri_text,
|
3678
|
+
modal: 'true',
|
3679
|
+
customer: state.business === Business.string ? 'string' : state.business,
|
3680
|
+
}),
|
3681
|
+
);
|
3682
|
+
}
|
3683
|
+
return state.selectedProduct
|
3684
|
+
? h(
|
3685
|
+
'div',
|
3686
|
+
{ class: 'hemfixarna_product' },
|
3687
|
+
h(
|
3688
|
+
'div',
|
3689
|
+
{ class: 'hemfixarna_product--top' },
|
3690
|
+
state.selectedProduct.icon &&
|
3691
|
+
h('img', { width: 80, src: (_a = state.selectedProduct.icon.url) !== null && _a !== void 0 ? _a : state.selectedProduct.icon, alt: state.selectedProduct.title }),
|
3692
|
+
h(
|
3693
|
+
'div',
|
3694
|
+
null,
|
3695
|
+
h('h1', null, state.selectedProduct.title),
|
3696
|
+
!state.selectedProduct.invoice ? h('h2', null, getProductPrice(state.selectedProduct), ' kr/st') : h('h2', null, state.selectedProduct.invoice_price),
|
3697
|
+
),
|
3698
|
+
),
|
3699
|
+
h(
|
3700
|
+
'div',
|
3701
|
+
{ class: 'hemfixarna_product--grid' },
|
3702
|
+
h(
|
3703
|
+
'div',
|
3704
|
+
{ class: 'hemfixarna_product--left' },
|
3705
|
+
((_b = state.selectedProduct.list) === null || _b === void 0 ? void 0 : _b.length) &&
|
3706
|
+
h(
|
3707
|
+
'ul',
|
3708
|
+
{ class: 'hemfixarna_features' },
|
3709
|
+
state.selectedProduct.list.map(l => h('li', { key: l.bullet }, h('img', { src: checked, alt: 'checked' }), h('p', null, l.bullet))),
|
3710
|
+
),
|
3711
|
+
state.selectedProduct.description &&
|
3712
|
+
h('p', {
|
3713
|
+
onClick: () => (this.hideDescription = false),
|
3714
|
+
class: `hemfixarna_description ${this.hideDescription ? 'hemfixarna_description--hidden' : ''}`,
|
3715
|
+
innerHTML: state.selectedProduct.description,
|
3716
|
+
}),
|
3717
|
+
),
|
3718
|
+
h(
|
3719
|
+
'div',
|
3720
|
+
{ class: 'hemfixarna_product--right' },
|
3721
|
+
state.selectedProduct.invoice
|
3722
|
+
? h('hemfixarna-invoice', null)
|
3723
|
+
: h(
|
3724
|
+
Fragment,
|
3725
|
+
null,
|
3726
|
+
h(
|
3727
|
+
'ul',
|
3728
|
+
null,
|
3729
|
+
h(
|
3730
|
+
'li',
|
3731
|
+
{ class: 'hemfixarna_product--item' },
|
3732
|
+
h('div', null, h('p', null, state.selectedProduct.title), h('p', { class: 'hemfixarna_product--price' }, getProductPrice(state.selectedProduct), 'kr/st')),
|
3733
|
+
h(
|
3734
|
+
'div',
|
3735
|
+
{ class: 'hemfixarna_counter' },
|
3736
|
+
h('img', { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removeProduct() }),
|
3737
|
+
h('span', null, this.getAmount()),
|
3738
|
+
h('img', { src: plus, onClick: () => this.addProduct() }),
|
3739
|
+
),
|
3740
|
+
),
|
3741
|
+
((_c = state.selectedProduct.parts) === null || _c === void 0 ? void 0 : _c.length) &&
|
3742
|
+
state.selectedProduct.parts.map(p => {
|
3743
|
+
var _a;
|
3744
|
+
return h(
|
3745
|
+
'li',
|
3746
|
+
{ class: 'hemfixarna_part' },
|
3747
|
+
h(
|
3748
|
+
'div',
|
3749
|
+
null,
|
3750
|
+
h('p', null, (_a = p.title) !== null && _a !== void 0 ? _a : p.title),
|
3751
|
+
h('p', { class: 'hemfixarna_product--price' }, getPartPrice(p, state.selectedProduct), 'kr/st'),
|
3752
|
+
),
|
3753
|
+
h(
|
3754
|
+
'div',
|
3755
|
+
{ class: 'hemfixarna_counter' },
|
3756
|
+
h('img', { class: `${this.getPartAmount(p.ID) === 0 ? 'disabled' : ''}`, src: minus, onClick: () => this.removePart(p) }),
|
3757
|
+
h('span', null, this.getPartAmount(p.ID)),
|
3758
|
+
h('img', { class: `${this.getAmount() === 0 ? 'disabled' : ''}`, src: plus, onClick: () => this.addPart(p) }),
|
3759
|
+
),
|
3760
|
+
);
|
3761
|
+
}),
|
3762
|
+
),
|
3763
|
+
h('h4', { class: 'hemfixarna_product--total' }, 'Totalt ', this.getTotalPrice(), ' kr'),
|
3764
|
+
h('button', { onClick: () => this.goToCart(), class: `hemfixarna_buy ${this.getAmount() === 0 ? 'disabled' : ''}` }, 'Forts\u00E4tt'),
|
3765
|
+
),
|
3766
|
+
!state.selectedProduct.hide_start_fee &&
|
3767
|
+
(state.selectedProduct.rot || state.selectedProduct.rut) &&
|
3768
|
+
state.rutOptions &&
|
3769
|
+
state.rotOptions &&
|
3770
|
+
h(
|
3771
|
+
'p',
|
3772
|
+
{ class: 'hemfixarna_terms' },
|
3773
|
+
h('strong', null, state.selectedProduct.rot ? state.rotOptions.rot_start_fee_heading : state.rutOptions.rut_start_fee_heading),
|
3774
|
+
h('br', null),
|
3775
|
+
h('span', { innerHTML: state.selectedProduct.rot ? state.rotOptions.rot_start_fee_text : state.rutOptions.rut_start_fee_text }),
|
3776
|
+
),
|
3777
|
+
state.options && h('hemfixarna-info', null),
|
3778
|
+
),
|
3779
|
+
),
|
3780
|
+
)
|
3781
|
+
: null;
|
3782
|
+
}
|
3783
|
+
get el() {
|
3784
|
+
return getElement(this);
|
2564
3785
|
}
|
2565
|
-
get el() { return getElement(this); }
|
2566
3786
|
};
|
2567
3787
|
HemfixarnaProduct.style = hemfixarnaProductCss;
|
2568
3788
|
|
@@ -2571,16 +3791,34 @@ const HemfixarnaService = class {
|
|
2571
3791
|
registerInstance(this, hostRef);
|
2572
3792
|
}
|
2573
3793
|
render() {
|
2574
|
-
return
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
3794
|
+
return h(
|
3795
|
+
'div',
|
3796
|
+
null,
|
3797
|
+
h('h2', null, state.selectedService.post_title),
|
3798
|
+
h(
|
3799
|
+
'div',
|
3800
|
+
{ class: 'hemfixarna_categories--wrapper' },
|
3801
|
+
h(
|
3802
|
+
'div',
|
3803
|
+
null,
|
3804
|
+
h(
|
3805
|
+
'ul',
|
3806
|
+
{ class: 'hemfixarna_categories' },
|
3807
|
+
state.selectedService.products
|
3808
|
+
.sort((a, b) => (a.post_title < b.post_title ? -1 : 1))
|
3809
|
+
.map(p => {
|
3810
|
+
var _a;
|
3811
|
+
return h('hemfixarna-box', { post: p, icon: (_a = p.icon.url) !== null && _a !== void 0 ? _a : p.icon, postTitle: p.title });
|
3812
|
+
}),
|
3813
|
+
),
|
3814
|
+
),
|
3815
|
+
h('hemfixarna-info', null),
|
3816
|
+
),
|
3817
|
+
);
|
2580
3818
|
}
|
2581
3819
|
};
|
2582
3820
|
|
2583
|
-
const hemfixarnaSkanskaCss =
|
3821
|
+
const hemfixarnaSkanskaCss = '';
|
2584
3822
|
|
2585
3823
|
const MyComponent$6 = class {
|
2586
3824
|
constructor(hostRef) {
|
@@ -2593,7 +3831,14 @@ const MyComponent$6 = class {
|
|
2593
3831
|
this.buttonBg = undefined;
|
2594
3832
|
}
|
2595
3833
|
render() {
|
2596
|
-
return
|
3834
|
+
return h('hemfixarna-component', {
|
3835
|
+
widgetStyle: this.widgetStyle,
|
3836
|
+
buttonBg: this.buttonBg,
|
3837
|
+
buttonColor: this.buttonColor,
|
3838
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3839
|
+
id: this.id,
|
3840
|
+
business: Business.skanska,
|
3841
|
+
});
|
2597
3842
|
}
|
2598
3843
|
};
|
2599
3844
|
MyComponent$6.style = hemfixarnaSkanskaCss;
|
@@ -2609,7 +3854,14 @@ const MyComponent$5 = class {
|
|
2609
3854
|
this.buttonBg = undefined;
|
2610
3855
|
}
|
2611
3856
|
render() {
|
2612
|
-
return
|
3857
|
+
return h('hemfixarna-component', {
|
3858
|
+
widgetStyle: this.widgetStyle,
|
3859
|
+
buttonBg: this.buttonBg,
|
3860
|
+
buttonColor: this.buttonColor,
|
3861
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3862
|
+
id: this.id,
|
3863
|
+
business: Business.sparfonster,
|
3864
|
+
});
|
2613
3865
|
}
|
2614
3866
|
};
|
2615
3867
|
|
@@ -2629,22 +3881,60 @@ const HemfixarnaGrid = class {
|
|
2629
3881
|
render() {
|
2630
3882
|
var _a;
|
2631
3883
|
const maleriLogo = getAssetPath('./assets/gubbe-pensel.svg');
|
2632
|
-
return state.customer
|
2633
|
-
?
|
2634
|
-
|
2635
|
-
|
2636
|
-
? state.selectedCustomerCategory.
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
3884
|
+
return state.customer
|
3885
|
+
? h(
|
3886
|
+
'div',
|
3887
|
+
null,
|
3888
|
+
h('h2', null, state.selectedCustomerCategory ? state.selectedCustomerCategory.name : 'Alla tjänster'),
|
3889
|
+
h(
|
3890
|
+
'div',
|
3891
|
+
{ class: 'hemfixarna_categories--wrapper' },
|
3892
|
+
h(
|
3893
|
+
'ul',
|
3894
|
+
{ class: 'hemfixarna_categories' },
|
3895
|
+
((_a = state.selectedCustomerCategory) === null || _a === void 0 ? void 0 : _a.add_painting)
|
3896
|
+
? h(
|
3897
|
+
'button',
|
3898
|
+
{ onClick: () => this.handleMaleriClick(), class: 'hemfixarna_maleribox' },
|
3899
|
+
h('img', { height: 64, src: maleriLogo, alt: 'M\u00E5leri Logotyp' }),
|
3900
|
+
h('p', null, 'Ber\u00E4kna fast pris p\u00E5 m\u00E5leri & tapetsering h\u00E4r'),
|
3901
|
+
)
|
3902
|
+
: null,
|
3903
|
+
state.selectedCustomerCategory
|
3904
|
+
? this.isMainCategory(state.selectedCustomerCategory) && state.selectedCustomerCategory.sub_categories && !state.selectedCustomerCategory.show_products
|
3905
|
+
? state.selectedCustomerCategory.sub_categories.map(c => h('hemfixarna-box', { category: c }))
|
3906
|
+
: state.selectedCustomerCategory.products
|
3907
|
+
? state.selectedCustomerCategory.products.map(c => h('hemfixarna-box', { category: c.fields }))
|
3908
|
+
: null
|
3909
|
+
: state.customer.categories.map(c => h('hemfixarna-box', { category: c })),
|
3910
|
+
),
|
3911
|
+
h('hemfixarna-info', null),
|
3912
|
+
),
|
3913
|
+
)
|
3914
|
+
: h(
|
3915
|
+
'div',
|
3916
|
+
null,
|
3917
|
+
h('h2', null, 'Alla tj\u00E4nster'),
|
3918
|
+
h(
|
3919
|
+
'div',
|
3920
|
+
{ class: 'hemfixarna_categories--wrapper' },
|
3921
|
+
h(
|
3922
|
+
'ul',
|
3923
|
+
{ class: 'hemfixarna_categories' },
|
3924
|
+
this.tree.sub_cats
|
3925
|
+
.sort((a, b) => (a.name < b.name ? -1 : 1))
|
3926
|
+
.map(c => {
|
3927
|
+
var _a;
|
3928
|
+
return h('hemfixarna-box', { post: c, icon: (_a = c.icon.url) !== null && _a !== void 0 ? _a : c.icon, postTitle: c.name });
|
3929
|
+
}),
|
3930
|
+
),
|
3931
|
+
h('hemfixarna-info', null),
|
3932
|
+
),
|
3933
|
+
);
|
3934
|
+
}
|
3935
|
+
};
|
3936
|
+
|
3937
|
+
const hemfixarnaStringCss = '';
|
2648
3938
|
|
2649
3939
|
const MyComponent$4 = class {
|
2650
3940
|
constructor(hostRef) {
|
@@ -2656,7 +3946,14 @@ const MyComponent$4 = class {
|
|
2656
3946
|
this.buttonBg = undefined;
|
2657
3947
|
}
|
2658
3948
|
render() {
|
2659
|
-
return
|
3949
|
+
return h('hemfixarna-component', {
|
3950
|
+
widgetStyle: this.widgetStyle,
|
3951
|
+
buttonBg: this.buttonBg,
|
3952
|
+
buttonColor: this.buttonColor,
|
3953
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3954
|
+
id: this.id,
|
3955
|
+
business: Business.string,
|
3956
|
+
});
|
2660
3957
|
}
|
2661
3958
|
};
|
2662
3959
|
MyComponent$4.style = hemfixarnaStringCss;
|
@@ -2671,7 +3968,14 @@ const MyComponent$3 = class {
|
|
2671
3968
|
this.buttonBg = undefined;
|
2672
3969
|
}
|
2673
3970
|
render() {
|
2674
|
-
return
|
3971
|
+
return h('hemfixarna-component', {
|
3972
|
+
widgetStyle: this.widgetStyle,
|
3973
|
+
buttonBg: this.buttonBg,
|
3974
|
+
buttonColor: this.buttonColor,
|
3975
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
3976
|
+
id: this.id,
|
3977
|
+
business: Business.superfront,
|
3978
|
+
});
|
2675
3979
|
}
|
2676
3980
|
};
|
2677
3981
|
|
@@ -2686,7 +3990,16 @@ const MyComponent$2 = class {
|
|
2686
3990
|
this.buttonBg = undefined;
|
2687
3991
|
}
|
2688
3992
|
render() {
|
2689
|
-
return
|
3993
|
+
return h('hemfixarna-component', {
|
3994
|
+
widgetStyle: this.widgetStyle,
|
3995
|
+
buttonBg: this.buttonBg,
|
3996
|
+
buttonColor: this.buttonColor,
|
3997
|
+
nav: { url: 'https://www.tesla.com/sv_se/home-charging', logo: 'assets/tesla.svg' },
|
3998
|
+
isDemo: this.isDemo,
|
3999
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
4000
|
+
id: this.id,
|
4001
|
+
business: Business.tesla,
|
4002
|
+
});
|
2690
4003
|
}
|
2691
4004
|
};
|
2692
4005
|
|
@@ -2700,7 +4013,14 @@ const MyComponent$1 = class {
|
|
2700
4013
|
this.buttonBg = undefined;
|
2701
4014
|
}
|
2702
4015
|
render() {
|
2703
|
-
return
|
4016
|
+
return h('hemfixarna-component', {
|
4017
|
+
widgetStyle: this.widgetStyle,
|
4018
|
+
buttonBg: this.buttonBg,
|
4019
|
+
buttonColor: this.buttonColor,
|
4020
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
4021
|
+
id: this.id,
|
4022
|
+
business: Business.traningspartner,
|
4023
|
+
});
|
2704
4024
|
}
|
2705
4025
|
};
|
2706
4026
|
|
@@ -2715,10 +4035,56 @@ const MyComponent = class {
|
|
2715
4035
|
this.buttonBg = undefined;
|
2716
4036
|
}
|
2717
4037
|
render() {
|
2718
|
-
return
|
4038
|
+
return h('hemfixarna-component', {
|
4039
|
+
widgetStyle: this.widgetStyle,
|
4040
|
+
buttonBg: this.buttonBg,
|
4041
|
+
buttonColor: this.buttonColor,
|
4042
|
+
nav: { url: 'https://www.zaptec.com/sv/laddningslosningar/zaptec-go', logo: 'assets/zaptec.svg' },
|
4043
|
+
isDemo: this.isDemo,
|
4044
|
+
loadFromQuery: Boolean(this.loadFromQuery),
|
4045
|
+
id: this.id,
|
4046
|
+
business: Business.zaptec,
|
4047
|
+
});
|
2719
4048
|
}
|
2720
4049
|
};
|
2721
4050
|
|
2722
|
-
export {
|
2723
|
-
|
2724
|
-
|
4051
|
+
export {
|
4052
|
+
HemfixarnaAddress as hemfixarna_address,
|
4053
|
+
HemfixarnaBox as hemfixarna_box,
|
4054
|
+
HemfixarnaBreadcrumbs as hemfixarna_breadcrumbs,
|
4055
|
+
MyComponent$j as hemfixarna_byggmax,
|
4056
|
+
HemfixarnaCart as hemfixarna_cart,
|
4057
|
+
HemfixarnaCategory as hemfixarna_category,
|
4058
|
+
HemfixarnaCheckout as hemfixarna_checkout,
|
4059
|
+
HemfixarnaComponent as hemfixarna_component,
|
4060
|
+
HemfixarnaInfo$1 as hemfixarna_contact,
|
4061
|
+
MyComponent$i as hemfixarna_demo,
|
4062
|
+
MyComponent$h as hemfixarna_doro,
|
4063
|
+
MyComponent$g as hemfixarna_elfa,
|
4064
|
+
MyComponent$f as hemfixarna_fargvaruhuset,
|
4065
|
+
MyComponent$e as hemfixarna_flyttsmart,
|
4066
|
+
MyComponent$d as hemfixarna_forebygg,
|
4067
|
+
HemfixarnaGetuser as hemfixarna_getuser,
|
4068
|
+
MyComponent$c as hemfixarna_hornbach,
|
4069
|
+
HemfixarnaInfo as hemfixarna_info,
|
4070
|
+
HemfixarnaInvoice as hemfixarna_invoice,
|
4071
|
+
MyComponent$b as hemfixarna_kbygg,
|
4072
|
+
MyComponent$a as hemfixarna_klint,
|
4073
|
+
MyComponent$9 as hemfixarna_kund,
|
4074
|
+
MyComponent$8 as hemfixarna_norrgavel,
|
4075
|
+
HemfixarnaOrder as hemfixarna_order,
|
4076
|
+
HemfixarnaOrderrows as hemfixarna_orderrows,
|
4077
|
+
MyComponent$7 as hemfixarna_power,
|
4078
|
+
HemfixarnaProduct as hemfixarna_product,
|
4079
|
+
HemfixarnaService as hemfixarna_service,
|
4080
|
+
MyComponent$6 as hemfixarna_skanska,
|
4081
|
+
MyComponent$5 as hemfixarna_sparfonster,
|
4082
|
+
HemfixarnaGrid as hemfixarna_start,
|
4083
|
+
MyComponent$4 as hemfixarna_string_furniture,
|
4084
|
+
MyComponent$3 as hemfixarna_superfront,
|
4085
|
+
MyComponent$2 as hemfixarna_tesla,
|
4086
|
+
MyComponent$1 as hemfixarna_traningspartner,
|
4087
|
+
MyComponent as hemfixarna_zaptec,
|
4088
|
+
};
|
4089
|
+
|
4090
|
+
//# sourceMappingURL=hemfixarna-address_36.entry.js.map
|