blue-chestnut-solar-expert 0.0.71 → 0.0.73
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/stencil-library/{decoder-DafVsihn.js → decoder-DUMy4-YU.js} +5 -5
- package/dist/stencil-library/{decoder-DafVsihn.js.map → decoder-DUMy4-YU.js.map} +1 -1
- package/dist/stencil-library/{deflate-BOWpTFAE.js → deflate-B57bxEA2.js} +5 -5
- package/dist/stencil-library/{deflate-BOWpTFAE.js.map → deflate-B57bxEA2.js.map} +1 -1
- package/dist/stencil-library/eraser-icon.entry.js +1 -1
- package/dist/stencil-library/house-icon.entry.js +1 -1
- package/dist/stencil-library/icon-selector.entry.js +1 -1
- package/dist/stencil-library/{index-ICfDNUMe.js → index-DzvFVH7F.js} +4 -4
- package/dist/stencil-library/index-DzvFVH7F.js.map +1 -0
- package/dist/stencil-library/{jpeg-DWgO3UMT.js → jpeg-CZDb06H8.js} +5 -5
- package/dist/stencil-library/{jpeg-DWgO3UMT.js.map → jpeg-CZDb06H8.js.map} +1 -1
- package/dist/stencil-library/{lerc-BQV9jxbc.js → lerc-yI_Z-vIH.js} +5 -5
- package/dist/stencil-library/{lerc-BQV9jxbc.js.map → lerc-yI_Z-vIH.js.map} +1 -1
- package/dist/stencil-library/loading-widget.entry.js +2 -2
- package/dist/stencil-library/{lzw-fGokKIJR.js → lzw-uwOJU9LC.js} +5 -5
- package/dist/stencil-library/{lzw-fGokKIJR.js.map → lzw-uwOJU9LC.js.map} +1 -1
- package/dist/stencil-library/{map-draw-DHsfxmE8.js → map-draw-BJErx7pC.js} +12 -12
- package/dist/stencil-library/{map-draw-DHsfxmE8.js.map → map-draw-BJErx7pC.js.map} +1 -1
- package/dist/stencil-library/map-draw.entry.js +3 -3
- package/dist/stencil-library/map-selector.entry.js +2 -2
- package/dist/stencil-library/marker-icon.entry.js +1 -1
- package/dist/stencil-library/move-icon.entry.js +1 -1
- package/dist/stencil-library/octagon-minus-icon.entry.js +1 -1
- package/dist/stencil-library/{packbits-vWMrdouf.js → packbits-CAMElV0D.js} +5 -5
- package/dist/stencil-library/{packbits-vWMrdouf.js.map → packbits-CAMElV0D.js.map} +1 -1
- package/dist/stencil-library/polygon-buttons.entry.js +2 -2
- package/dist/stencil-library/polygon-information.entry.js +2 -2
- package/dist/stencil-library/{raw-BZExdvHz.js → raw-Czhh0DXR.js} +5 -5
- package/dist/stencil-library/{raw-BZExdvHz.js.map → raw-Czhh0DXR.js.map} +1 -1
- package/dist/stencil-library/search-icon.entry.js +1 -1
- package/dist/stencil-library/settings-icon.entry.js +1 -1
- package/dist/stencil-library/settings-modal.entry.js +2 -2
- package/dist/stencil-library/solar-expert.entry.esm.js.map +1 -1
- package/dist/stencil-library/solar-expert.entry.js +4 -4
- package/dist/stencil-library/solar-expert.entry.js.map +1 -1
- package/dist/stencil-library/solar-system-form.entry.esm.js.map +1 -1
- package/dist/stencil-library/solar-system-form.entry.js +142 -105
- package/dist/stencil-library/solar-system-form.entry.js.map +1 -1
- package/dist/stencil-library/stencil-library.esm.js +3 -3
- package/dist/stencil-library/{store-CcqrFuBK.js → store-nKI4l4pt.js} +3 -3
- package/dist/stencil-library/{store-CcqrFuBK.js.map → store-nKI4l4pt.js.map} +1 -1
- package/dist/stencil-library/toast-notification.entry.js +1 -1
- package/dist/stencil-library/tool-box.entry.js +2 -2
- package/dist/stencil-library/tutorial-component.entry.js +2 -2
- package/dist/stencil-library/undo-icon.entry.js +1 -1
- package/dist/stencil-library/{webimage-DzcyYZ7I.js → webimage-22q9OHrk.js} +5 -5
- package/dist/stencil-library/{webimage-DzcyYZ7I.js.map → webimage-22q9OHrk.js.map} +1 -1
- package/dist/types/components/solar-system-form/solar-system-form.d.ts +4 -4
- package/package.json +1 -1
- package/dist/stencil-library/index-ICfDNUMe.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
if (typeof global === "undefined") { var global = globalThis || window || self; }
|
|
3
|
-
import { r as registerInstance, h } from './index-
|
|
3
|
+
import { r as registerInstance, h } from './index-DzvFVH7F.js';
|
|
4
4
|
import { b as DEFAULT_SOLAR_PANEL_TYPE } from './config-CWfV1nKn.js';
|
|
5
|
-
import { g as getLanguageStrings, s as state } from './store-
|
|
5
|
+
import { g as getLanguageStrings, s as state } from './store-nKI4l4pt.js';
|
|
6
6
|
import { d as distExports, H as HEAT_PUMP_CONSUMPTION } from './constants-hboFofU4.js';
|
|
7
7
|
|
|
8
8
|
async function fetchSolarData(latitude, longitude, apiKey) {
|
|
@@ -111,7 +111,7 @@ const SolarSystemForm = class {
|
|
|
111
111
|
polygonCanvas;
|
|
112
112
|
pixelInMeters;
|
|
113
113
|
householdConsumption = 4500;
|
|
114
|
-
consumptionProfile =
|
|
114
|
+
consumptionProfile = "mostly_at_home";
|
|
115
115
|
electricityPrice = 0.3;
|
|
116
116
|
compensationRate = 0.07;
|
|
117
117
|
annualPriceIncrease = 2;
|
|
@@ -119,16 +119,16 @@ const SolarSystemForm = class {
|
|
|
119
119
|
costSavings = 0;
|
|
120
120
|
numberOfPanels = 5;
|
|
121
121
|
panelPeakPower = 0.4; // kW per panel
|
|
122
|
-
firstname =
|
|
123
|
-
surname =
|
|
124
|
-
email =
|
|
125
|
-
phone =
|
|
126
|
-
firstnameError =
|
|
127
|
-
surnameError =
|
|
128
|
-
emailError =
|
|
129
|
-
phoneError =
|
|
122
|
+
firstname = "";
|
|
123
|
+
surname = "";
|
|
124
|
+
email = "";
|
|
125
|
+
phone = "";
|
|
126
|
+
firstnameError = "";
|
|
127
|
+
surnameError = "";
|
|
128
|
+
emailError = "";
|
|
129
|
+
phoneError = "";
|
|
130
130
|
electricCar = false;
|
|
131
|
-
electricCarChargingTime =
|
|
131
|
+
electricCarChargingTime = "day";
|
|
132
132
|
heatPump = 0;
|
|
133
133
|
battery = 0;
|
|
134
134
|
batteryEnabled = false;
|
|
@@ -139,10 +139,10 @@ const SolarSystemForm = class {
|
|
|
139
139
|
totalEnergyConsumption = 4500;
|
|
140
140
|
totalEnergyProduction = 0;
|
|
141
141
|
isSubmitting = false;
|
|
142
|
-
submitMessage =
|
|
142
|
+
submitMessage = "";
|
|
143
143
|
submitSuccess = false;
|
|
144
144
|
privacyPolicyAccepted = false;
|
|
145
|
-
privacyPolicyError =
|
|
145
|
+
privacyPolicyError = "";
|
|
146
146
|
updateSystemConfigs() {
|
|
147
147
|
if (Object.keys(this.systemConfigs).length === 0) {
|
|
148
148
|
this.numberOfPanels = 0;
|
|
@@ -151,16 +151,19 @@ const SolarSystemForm = class {
|
|
|
151
151
|
}
|
|
152
152
|
this.numberOfPanels = Object.keys(this.systemConfigs).reduce((acc, curr) => acc + this.systemConfigs[curr].numberOfPanels, 0);
|
|
153
153
|
this.maxPanels = Object.keys(this.systemConfigs).reduce((acc, curr) => acc + this.systemConfigs[curr].numberOfPanels, 0);
|
|
154
|
-
this.panelPeakPower =
|
|
154
|
+
this.panelPeakPower =
|
|
155
|
+
Object.entries(this.systemConfigs)[0][1][0]?.panel.kWattPeak ?? 0.44;
|
|
155
156
|
this.recalculate();
|
|
156
157
|
}
|
|
157
158
|
formatEuropeanNumber(num, decimals = 2) {
|
|
158
159
|
const fixed = num.toFixed(decimals);
|
|
159
|
-
const [integerPart, decimalPart] = fixed.split(
|
|
160
|
+
const [integerPart, decimalPart] = fixed.split(".");
|
|
160
161
|
// Add dots as thousands separators
|
|
161
|
-
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g,
|
|
162
|
+
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
162
163
|
// Join with comma as decimal separator
|
|
163
|
-
return decimalPart
|
|
164
|
+
return decimalPart
|
|
165
|
+
? `${formattedInteger},${decimalPart}`
|
|
166
|
+
: formattedInteger;
|
|
164
167
|
}
|
|
165
168
|
recalculate() {
|
|
166
169
|
const currentSystemConfigs = {};
|
|
@@ -211,13 +214,17 @@ const SolarSystemForm = class {
|
|
|
211
214
|
averageKilometersPerDay: this.kmDrivenPerYear / 365,
|
|
212
215
|
consumptionkWhPer100km: 20,
|
|
213
216
|
batteryKWh: 80,
|
|
214
|
-
chargingHours: this.electricCarChargingTime ===
|
|
217
|
+
chargingHours: this.electricCarChargingTime === "day"
|
|
218
|
+
? distExports.generateElectricCarChargingHours(6, 18)
|
|
219
|
+
: distExports.generateElectricCarChargingHours(18, 6),
|
|
215
220
|
}
|
|
216
221
|
: undefined,
|
|
217
222
|
};
|
|
218
223
|
const result = distExports.simulate(simulationConfig);
|
|
219
224
|
this.compensation20Years = result.compensationPerDay * 365 * 20;
|
|
220
|
-
this.savedCosts20Years =
|
|
225
|
+
this.savedCosts20Years =
|
|
226
|
+
result.byYearSavedCosts.reduce((acc, curr) => acc + curr, 0) +
|
|
227
|
+
this.compensation20Years;
|
|
221
228
|
this.costSavings = result.byYearSavedCosts[0];
|
|
222
229
|
this.autonomy = result.autonomy * 100;
|
|
223
230
|
this.totalEnergyConsumption = result.totalEnergyConsumptionDay * 365;
|
|
@@ -236,7 +243,7 @@ const SolarSystemForm = class {
|
|
|
236
243
|
isValid = false;
|
|
237
244
|
}
|
|
238
245
|
else {
|
|
239
|
-
this.firstnameError =
|
|
246
|
+
this.firstnameError = "";
|
|
240
247
|
}
|
|
241
248
|
// Validate surname
|
|
242
249
|
if (!this.surname.trim()) {
|
|
@@ -244,7 +251,7 @@ const SolarSystemForm = class {
|
|
|
244
251
|
isValid = false;
|
|
245
252
|
}
|
|
246
253
|
else {
|
|
247
|
-
this.surnameError =
|
|
254
|
+
this.surnameError = "";
|
|
248
255
|
}
|
|
249
256
|
// Validate email
|
|
250
257
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
@@ -257,19 +264,20 @@ const SolarSystemForm = class {
|
|
|
257
264
|
isValid = false;
|
|
258
265
|
}
|
|
259
266
|
else {
|
|
260
|
-
this.emailError =
|
|
267
|
+
this.emailError = "";
|
|
261
268
|
}
|
|
262
269
|
// Validate phone (optional)
|
|
263
270
|
const phoneRegex = /^[\+]?[1-9][\d]{0,15}$/;
|
|
264
|
-
if (this.phone.trim() &&
|
|
271
|
+
if (this.phone.trim() &&
|
|
272
|
+
!phoneRegex.test(this.phone.replace(/[\s\-\(\)]/g, ""))) {
|
|
265
273
|
this.phoneError = t.solarSystemForm.phoneError;
|
|
266
274
|
isValid = false;
|
|
267
275
|
}
|
|
268
276
|
else {
|
|
269
|
-
this.phoneError =
|
|
277
|
+
this.phoneError = "";
|
|
270
278
|
}
|
|
271
279
|
if (!this.privacyPolicyAccepted) {
|
|
272
|
-
this.privacyPolicyError =
|
|
280
|
+
this.privacyPolicyError = "Datenschutzerklärung muss akzeptiert werden";
|
|
273
281
|
}
|
|
274
282
|
return isValid;
|
|
275
283
|
}
|
|
@@ -278,13 +286,13 @@ const SolarSystemForm = class {
|
|
|
278
286
|
return;
|
|
279
287
|
}
|
|
280
288
|
if (!this.privacyPolicyAccepted) {
|
|
281
|
-
this.privacyPolicyError =
|
|
289
|
+
this.privacyPolicyError = "Datenschutzerklärung muss akzeptiert werden";
|
|
282
290
|
return;
|
|
283
291
|
}
|
|
284
292
|
this.isSubmitting = true;
|
|
285
|
-
this.submitMessage =
|
|
293
|
+
this.submitMessage = "";
|
|
286
294
|
this.submitSuccess = false;
|
|
287
|
-
this.privacyPolicyError =
|
|
295
|
+
this.privacyPolicyError = "";
|
|
288
296
|
const t = getLanguageStrings(state.settings.language);
|
|
289
297
|
try {
|
|
290
298
|
const leadData = {
|
|
@@ -329,23 +337,25 @@ const SolarSystemForm = class {
|
|
|
329
337
|
totalEnergyConsumption: this.totalEnergyConsumption,
|
|
330
338
|
},
|
|
331
339
|
};
|
|
332
|
-
console.log(
|
|
340
|
+
console.log("leadData", leadData);
|
|
333
341
|
const result = await sendLeadToNexvoro(leadData);
|
|
334
342
|
this.submitSuccess = result.success;
|
|
335
343
|
if (result.success) {
|
|
336
|
-
console.log(
|
|
344
|
+
console.log("Lead successfully sent to Nexvoro", result);
|
|
337
345
|
this.submitMessage = t.solarSystemForm.leadSubmitted;
|
|
338
346
|
// Optionally reset form or show success message
|
|
339
347
|
}
|
|
340
348
|
else {
|
|
341
|
-
console.error(
|
|
349
|
+
console.error("Failed to send lead to Nexvoro:", result.message);
|
|
342
350
|
this.submitMessage = t.solarSystemForm.leadError;
|
|
343
351
|
}
|
|
344
352
|
}
|
|
345
353
|
catch (error) {
|
|
346
|
-
console.error(
|
|
354
|
+
console.error("Error in handleRequestOffer:", error);
|
|
347
355
|
this.submitSuccess = false;
|
|
348
|
-
this.submitMessage = error instanceof Error
|
|
356
|
+
this.submitMessage = error instanceof Error
|
|
357
|
+
? error.message
|
|
358
|
+
: "An unexpected error occurred";
|
|
349
359
|
}
|
|
350
360
|
finally {
|
|
351
361
|
this.isSubmitting = false;
|
|
@@ -357,115 +367,134 @@ const SolarSystemForm = class {
|
|
|
357
367
|
render() {
|
|
358
368
|
const t = getLanguageStrings(state.settings.language);
|
|
359
369
|
// Reusable style objects
|
|
360
|
-
const borderStyle = { border:
|
|
361
|
-
const errorBorderStyle = { border:
|
|
362
|
-
return (h("div", { key: '
|
|
370
|
+
const borderStyle = { border: "1px solid var(--color-border)" };
|
|
371
|
+
const errorBorderStyle = { border: "1px solid var(--color-error)" };
|
|
372
|
+
return (h("div", { key: '0b1187e05ca785c911e7d1a3a549727f09f05739', class: "flex flex-col justify-center items-center w-full h-full pt-4" // style={{
|
|
363
373
|
,
|
|
364
374
|
// display: (Object.keys(this.systemConfigs).length === 0)
|
|
365
375
|
// ? "none"
|
|
366
376
|
// : "flex",
|
|
367
377
|
// }}
|
|
368
|
-
id: "solar-system-form" }, h("h1", { key: '
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
this.
|
|
373
|
-
|
|
374
|
-
|
|
378
|
+
id: "solar-system-form" }, h("h1", { key: '0a9e696ad9af11480e89314b1ceb0611b4781dca', class: "text-2xl font-bold text-secondary mb-4 w-full" }, t.solarSystemForm.title), h("div", { key: 'f1bbf956e2892497cfa2d82130f3ada3ad9587ac', class: "w-full bg-primary rounded-4xl space-y-6" }, h("div", { key: '6b4d06ccf7da55b28f015b66ff7c720bb419d48a', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '8d343f6f381b94eb8e5de0fd2eb9089317d63d21', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.systemInformation), h("div", { key: 'c6c6713e9e4a0a4a55eb753b1e076d0f266499c3', class: "flex flex-col sm:flex-row gap-4" }, h("div", { key: 'ed4dd4cd50873f477d71af99ca510af19d2cfa1e', class: "flex-1 bg-muted rounded-4xl p-4 space-y-3" }, h("div", { key: 'cc0f5d355d62ad98f0e02bfaa15e6ef61810a54c', class: "flex items-center justify-between" }, h("label", { key: '282d5b4f8aff0090438c6913ea0525d712777b8d', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.numberOfPanels), !this.isIOS()
|
|
379
|
+
? (h("input", { type: "number", class: "w-20 px-3 py-1 rounded-full bg-muted text-muted-foreground text-right", value: this.numberOfPanels, readOnly: true }))
|
|
380
|
+
: (h("input", { type: "number", min: "1", max: this.maxPanels, class: "w-20 px-3 py-1 rounded-full focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground text-center", style: borderStyle, value: this.numberOfPanels, onInput: (e) => {
|
|
381
|
+
const value = parseInt(e.target.value);
|
|
382
|
+
if (value >= 1 && value <= this.maxPanels) {
|
|
383
|
+
this.numberOfPanels = value;
|
|
384
|
+
this.recalculate();
|
|
385
|
+
}
|
|
386
|
+
} }))), !this.isIOS() && (h("input", { key: 'e544bee2d42001b9d85e5a55ed9b804194a0e622', type: "range", min: "1", max: this.maxPanels, step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.numberOfPanels, onInput: (e) => {
|
|
375
387
|
this.numberOfPanels = parseInt(e.target.value);
|
|
376
388
|
if (isNaN(this.numberOfPanels)) {
|
|
377
389
|
this.numberOfPanels = 0;
|
|
378
390
|
}
|
|
379
391
|
this.recalculate();
|
|
380
|
-
} }))), h("div", { key: '
|
|
392
|
+
} }))), h("div", { key: 'a618803e807fdda74e6232e87eb386d6f6dcbcf4', class: "flex-1 bg-muted rounded-4xl p-4" }, h("div", { key: 'bad3efbea8d9950db88ba67dbdd08f62097888bd', class: "flex items-center justify-between" }, h("label", { key: 'b823bca49ddec25e35ca4c9e156cfbdc1b787afd', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.panelPeakPower), h("span", { key: 'd0d6471466f9b0be006063c81861f17c2663a2c9', class: "text-text-muted" }, this.panelPeakPower.toFixed(2), " kW")), h("div", { key: 'bac1748cea5793a199220e4fd637589ed53b5c78', class: "flex items-center justify-between mt-4" }, h("span", { key: 'b1e66a5bdf9f461fba1d6b419e44d18a30faaf25', class: "text-sm font-medium text-text-muted" }, t.solarSystemForm.totalSystemPeakPower), h("span", { key: '2ab25c952fa374633d733874793bcd045b34d940', class: "font-bold text-text-muted" }, (DEFAULT_SOLAR_PANEL_TYPE.kWattPeak * this.numberOfPanels)
|
|
393
|
+
.toFixed(1), " kWp"))))), h("div", { key: '69df03f393b9754bbd15a13e6a6b1b76014e2b8b', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '90c5c541c1bed5399b0272bec579c1a7dce45cee', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.householdConsumptionTitle), h("div", { key: '11d96b8edb0b2515f27128ac796c47471c3cda95', class: "grid grid-rows-2 gap-0" }, h("div", { key: '26e779fbf8d55b2e06f6634f2de173ceffa58c1e', class: "grid grid-cols-2 gap-4" }, h("label", { key: '09d78230a12018c5f3113ea5540a86525973bcfd', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.annualConsumption), h("label", { key: '3554e34651a10e266a86f936eb85a1512bd3533a', class: "block text-sm font-medium text-text-muted" }, t.solarSystemForm.consumptionProfileTitle)), h("div", { key: 'df550f5a9b45343517c5d6c1ae14a8be6c2a76ad', class: "grid grid-cols-2 gap-4" }, h("input", { key: '3b4ac90138e3bbd6e0146018e3255f178dae7577', type: "number", step: "100", min: "0", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, value: this.householdConsumption, onInput: (e) => {
|
|
381
394
|
this.householdConsumption = parseInt(e.target.value);
|
|
382
395
|
this.recalculate();
|
|
383
|
-
} }), h("select", { key: '
|
|
384
|
-
this.consumptionProfile = e.target
|
|
396
|
+
} }), h("select", { key: '1ec4c3700005c35e7340433d0a3b006b9da2cbba', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground", style: borderStyle, onChange: (e) => {
|
|
397
|
+
this.consumptionProfile = e.target
|
|
398
|
+
.value;
|
|
385
399
|
this.recalculate();
|
|
386
|
-
} }, h("option", { key: '
|
|
387
|
-
this.heatPump = e.target.checked
|
|
400
|
+
} }, h("option", { key: '44f5c519bbdb3a92466f334fbf2f82aaf464a169', value: "mostly_at_home", selected: this.consumptionProfile === "mostly_at_home" }, t.solarSystemForm.consumptionProfiles.mostlyAtHome), h("option", { key: '1865421788bc521163e085f218accc12c281608b', value: "mostly_away", selected: this.consumptionProfile === "mostly_away" }, t.solarSystemForm.consumptionProfiles.mostlyAway))))), h("div", { key: '126415bcd65f1006d218206ade9219b7bf244efc', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: '39ca810eaf21948ab3928023210fe7a42fbe2b44', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.additionalComponents.title), h("div", { key: 'dcf90e37baafe5ddf460aa73694b371750f5b0e5', class: "flex flex-col gap-4" }, h("div", { key: 'bc8f7a44473624c8e8118cb57ba3dfe36ac0887e', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: '1e1cb05c75cb1a68d7552a806f54afeca6371975', class: "flex items-center justify-between" }, h("div", { key: 'f5bd5eeacdbda09b1f08d10adf94a0dfc361240d', class: "flex items-center gap-2" }, h("input", { key: 'c8e79b2d22c6d95609d225e8c0d277291dd83611', type: "checkbox", id: "heatPump", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.heatPump > 0, onChange: (e) => {
|
|
401
|
+
this.heatPump = e.target.checked
|
|
402
|
+
? 100
|
|
403
|
+
: 0;
|
|
388
404
|
this.recalculate();
|
|
389
|
-
} }), h("label", { key: '
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
value
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
405
|
+
} }), h("label", { key: 'e3006a5d2de194eecd0e72737f251bb5c5115b53', htmlFor: "heatPump", class: "text-text-muted" }, t.solarSystemForm.additionalComponents.heatPump)), this.heatPump > 0 && !this.isIOS() && (h("span", { key: '7ad5e1bb13d9fc88d82d986537d55698532ca4b0', class: "text-text-muted" }, this.heatPump, " m\u00B2"))), this.heatPump > 0 && (h("div", { key: 'd2dd231fe4290a0a771e08658cf18cf3309bb1dc', class: "flex flex-col gap-2" }, this.isIOS()
|
|
406
|
+
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "10", max: "300", step: "10", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.heatPump, onInput: (e) => {
|
|
407
|
+
let value = parseInt(e.target.value);
|
|
408
|
+
if (isNaN(value)) {
|
|
409
|
+
value = 0;
|
|
410
|
+
}
|
|
411
|
+
if (value >= 0 && value <= 300) {
|
|
412
|
+
this.heatPump = value;
|
|
413
|
+
this.recalculate();
|
|
414
|
+
}
|
|
415
|
+
} }), h("span", { class: "text-sm text-text-muted" }, "m\u00B2")))
|
|
416
|
+
: (h("input", { type: "range", min: "10", max: "300", step: "10", class: "input-slider custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.heatPump, onInput: (e) => {
|
|
417
|
+
this.heatPump = parseInt(e.target.value);
|
|
396
418
|
this.recalculate();
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
this.recalculate();
|
|
401
|
-
} }))))), h("div", { key: 'b2c26948b91e806323e38ef5c2cf171fb8c3a465', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: '1322f4c1d551a3e3e408157a8f164097bc91ce89', class: "flex items-center justify-between" }, h("div", { key: '0ebb09ed454e348e2b1fd2e731a176527108dc00', class: "flex items-center gap-2" }, h("input", { key: '6f51c0af64bdf6122bcd468fd3499d200472f421', type: "checkbox", id: "electricCar", class: "w-4 h-4 accent-tertiary border-border rounded focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.electricCar, onChange: e => {
|
|
402
|
-
this.electricCar = e.target.checked;
|
|
419
|
+
} }))))), h("div", { key: '09abfc182803b296199c81e446a465df1b257fb6', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: '9b34ba19c2d341e7126ab9dd4e41e12ec46bd0af', class: "flex items-center justify-between" }, h("div", { key: 'a02c0bf1a224b777cf052b21bd6a3ac55eddddc0', class: "flex items-center gap-2" }, h("input", { key: 'cf5777cd407b7f1bbb2254eec5574632d873e0e1', type: "checkbox", id: "electricCar", class: "w-4 h-4 accent-tertiary border-border rounded focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.electricCar, onChange: (e) => {
|
|
420
|
+
this.electricCar =
|
|
421
|
+
e.target.checked;
|
|
403
422
|
this.recalculate();
|
|
404
|
-
} }), h("label", { key: '
|
|
405
|
-
|
|
423
|
+
} }), h("label", { key: '4e7e9c6dba4a5a47833203c635fe9403d5ee8a4b', htmlFor: "electricCar", class: "text-text-muted" }, t.solarSystemForm.additionalComponents.electricCar))), this.electricCar && (h("div", { key: 'f03cbbc1d5ceea2002bcd11bbd595918178aab1d', class: "flex flex-col gap-2" }, h("div", { key: '780c1ca3ac92ee0c9b9fe0328ebd7e4e8de3366b', class: "grid grid-cols-2 gap-4" }, h("label", { key: '205c59dd21a772723f8210c6615bf3e07ee5e119', class: "text-sm text-text-muted" }, t.solarSystemForm.additionalComponents.chargingTime), h("label", { key: '15a2ab7107e14230fbc7fb6b7b965d89cfe75a49', class: "text-sm text-text-muted" }, t.solarSystemForm.additionalComponents
|
|
424
|
+
.kilometersPerYear)), h("div", { key: 'a3f80193746e8ca40e8799d14ea9a44164f4325e', class: "grid grid-cols-2 gap-4" }, h("select", { key: 'e66397157fc45bb26d95ab9376df9dd1c54fc9cc', class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", onChange: (e) => {
|
|
425
|
+
this.electricCarChargingTime =
|
|
426
|
+
e.target.value;
|
|
406
427
|
this.recalculate();
|
|
407
|
-
}, style: borderStyle }, h("option", { key: '
|
|
428
|
+
}, style: borderStyle }, h("option", { key: 'b9a3c81e7f8a76010f295a57696ff9595e195fa4', value: "day", selected: this.electricCarChargingTime === "day" }, t.solarSystemForm.additionalComponents
|
|
429
|
+
.chargingTimeDay), h("option", { key: 'da4e95c399df579825a2c44ed0bf15fd20de8058', value: "night", selected: this.electricCarChargingTime === "night" }, t.solarSystemForm.additionalComponents
|
|
430
|
+
.chargingTimeNight)), h("input", { key: '5823eb3e5369fd1577128afd483912c761385cb5', type: "number", min: "1000", max: "100000", step: "1000", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.kmDrivenPerYear, onInput: (e) => {
|
|
408
431
|
this.kmDrivenPerYear = parseInt(e.target.value);
|
|
409
432
|
if (isNaN(this.kmDrivenPerYear)) {
|
|
410
433
|
this.kmDrivenPerYear = 0;
|
|
411
434
|
}
|
|
412
435
|
this.recalculate();
|
|
413
|
-
}, style: borderStyle }))))), h("div", { key: '
|
|
414
|
-
this.batteryEnabled =
|
|
436
|
+
}, style: borderStyle }))))), h("div", { key: 'bf4bb9b6911d9072de0e5a34128469c3855e136c', class: "flex flex-col bg-muted rounded-4xl p-4 gap-4" }, h("div", { key: 'ed5084831cf85939c537a2bf0e97be0471c62ab4', class: "flex items-center justify-between" }, h("div", { key: '325fa94d4ff16098191ed66715d4c1bd5f606716', class: "flex items-center gap-2" }, h("input", { key: '409479ac9bdbae3fef07204df6250c4df46518e7', type: "checkbox", id: "battery", class: "w-4 h-4 accent-tertiary border-border rounded-full focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.batteryEnabled, onChange: (e) => {
|
|
437
|
+
this.batteryEnabled =
|
|
438
|
+
e.target.checked;
|
|
415
439
|
this.battery = this.batteryEnabled ? 5 : 0;
|
|
416
440
|
this.recalculate();
|
|
417
|
-
} }), h("label", { key: '
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
value
|
|
421
|
-
|
|
422
|
-
|
|
441
|
+
} }), h("label", { key: '9637b0edf052aaf92cff7b31b389ee54274271e9', htmlFor: "battery", class: "text-text-muted" }, t.solarSystemForm.additionalComponents.battery)), this.batteryEnabled && !this.isIOS() && (h("span", { key: 'af196680d7004d8e21a13286d42e298ea5f93078', class: "text-text-muted" }, this.battery, " kWh"))), this.batteryEnabled && (h("div", { key: 'ab9f3910284ae5db5b72937405e4cd32d010ea97', class: "flex flex-col gap-2" }, this.isIOS()
|
|
442
|
+
? (h("div", { class: "flex items-center gap-2" }, h("input", { type: "number", min: "0", max: "20", step: "1", class: "flex-1 px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", value: this.battery, onInput: (e) => {
|
|
443
|
+
let value = parseInt(e.target.value);
|
|
444
|
+
if (isNaN(value)) {
|
|
445
|
+
value = 0;
|
|
446
|
+
}
|
|
447
|
+
if (value >= 0 && value <= 20) {
|
|
448
|
+
this.battery = value;
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
this.battery = 20;
|
|
452
|
+
}
|
|
453
|
+
this.recalculate();
|
|
454
|
+
}, style: borderStyle }), h("span", { class: "text-sm text-text-muted" }, "kWh")))
|
|
455
|
+
: (h("input", { type: "range", min: "1", max: "20", step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.battery, onInput: (e) => {
|
|
456
|
+
const value = parseInt(e.target.value);
|
|
423
457
|
this.battery = value;
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
this.battery = value;
|
|
432
|
-
this.batteryEnabled = value > 0;
|
|
433
|
-
this.recalculate();
|
|
434
|
-
} }))))))), h("div", { key: '6dd880664327368d90962dbc075324dac489b43f', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'cae87b42efe9efb67bb981c99536c9c9917c0810', class: "font-semibold text-secondary pb-2", style: { fontSize: '0.875rem' } }, t.solarSystemForm.electricityCostsTitle), h("div", { key: 'a4e7fafca2069b11602c44c2fd8a66f44db40249', style: {
|
|
435
|
-
display: 'grid',
|
|
436
|
-
gridTemplateColumns: 'repeat(auto-fit, minmax(100px, 1fr))',
|
|
437
|
-
gap: '1rem',
|
|
438
|
-
} }, h("div", { key: 'd900544fdf28538bc377ca4cc3b6de1d7ea5a9f0' }, h("label", { key: 'ea7775bee25362953e23c4d56daced2830ab1df7', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.electricityPrice), h("input", { key: '3a290ed738522cff562a86b3d6955338cb9a45c7', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.electricityPrice.toFixed(2), onInput: e => {
|
|
458
|
+
this.batteryEnabled = value > 0;
|
|
459
|
+
this.recalculate();
|
|
460
|
+
} }))))))), h("div", { key: '8dd8987adaaad7b3acc2a46c5953cd38dbef4dd5', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'a5b7cf0b28418239d5e4db8b0a1b05a97dd747d1', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.electricityCostsTitle), h("div", { key: 'bda8db9601ac80ca08ade1f4d123fb3d356e476a', style: {
|
|
461
|
+
display: "grid",
|
|
462
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(100px, 1fr))",
|
|
463
|
+
gap: "1rem",
|
|
464
|
+
} }, h("div", { key: 'dca92ded68fc82082f3b4657b35fea464d3109dc' }, h("label", { key: 'aeabc5e3e1d5179a00d9b28dc4e6baaae482f7d7', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.electricityPrice), h("input", { key: '53afdeb3d3934536f6e29bfbdc0fdf65738f225f', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.electricityPrice.toFixed(2), onInput: (e) => {
|
|
439
465
|
this.electricityPrice = parseFloat(e.target.value);
|
|
440
466
|
this.recalculate();
|
|
441
|
-
} })), h("div", { key: '
|
|
467
|
+
} })), h("div", { key: 'c03a3b9e51415e786da69c9da6214aed64423511' }, h("label", { key: 'fe258adee58c9d530018c26d4128acde3df38937', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.compensationRate), h("input", { key: '5050bce8c5168f4fc0e989161b739a4af947b454', type: "number", step: "0.01", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.compensationRate.toFixed(2), onInput: (e) => {
|
|
442
468
|
this.compensationRate = parseFloat(e.target.value);
|
|
443
469
|
this.recalculate();
|
|
444
|
-
} })), h("div", { key: '
|
|
470
|
+
} })), h("div", { key: 'b61735b192d5cd0dc1676c1a6c145d41666b6a53' }, h("label", { key: 'fe4854b465f29247cadebb9bf379ffda0a9198a4', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.annualPriceIncrease), h("input", { key: 'f82fd8ddd7e3ddb6a034558e9358bb189f889a26', type: "number", step: "0.1", class: "w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted", style: borderStyle, value: this.annualPriceIncrease.toFixed(1), onInput: (e) => {
|
|
445
471
|
this.annualPriceIncrease = parseFloat(e.target.value);
|
|
446
472
|
this.recalculate();
|
|
447
|
-
} })))), h("div", { key: '
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
473
|
+
} })))), h("div", { key: '7519292258a4bf564b6c0f53a3c320f477d1e0d8', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'e43983f648b14d20ecb82b7628b1928a602506b3', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.resultsTitle), h("div", { key: '86d9b368d20f8110c420f7964bd4401153a71a1c', class: "bg-muted rounded-4xl p-4" }, h("div", { key: 'c6e850a89d84d419eebec2a16f2715a932b6f5e2', class: "flex flex-col sm:flex-row sm:items-center justify-between" }, h("span", { key: '8cdce9f16d03a46e2c8a664696d50471c3b16e83', class: "text-text-muted" }, t.solarSystemForm.autonomy), h("span", { key: 'ad9b8874d2a817148c1a052a1742ed69bffd2be2', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.autonomy > 100
|
|
474
|
+
? "100"
|
|
475
|
+
: this.formatEuropeanNumber(this.autonomy, 1), "%")), h("div", { key: 'fed49801213c5ba009bba2554b791d8cb5b70ef6', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: 'bb95581a8ef28e03282b7fdc159e8074c1e99a5d', class: "text-text-muted" }, t.solarSystemForm.totalEnergyConsumption), h("span", { key: '185dd78103722c01995b7f51eba6ad981167f0dc', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyConsumption, 0), " ", "kWh/", t.solarSystemForm.year)), h("div", { key: '06b6b2f7b254656e01ac58a9b883602d7015ae63', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("span", { key: '859d235acd7815563eb5f75e3d6b283833dde94d', class: "text-text-muted" }, t.solarSystemForm.totalEnergyProduction), h("span", { key: '1f3e6b930775426c895f9802a4c90aa7a334d476', class: "text-xl font-bold text-secondary mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.totalEnergyProduction, 0), " ", "kWh/", t.solarSystemForm.year)), h("div", { key: '469d8e892b84afa1436810a7b5d75e9187d7d451', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: '928de608998fe55baec7177a1ee855110a73f082', class: "flex items-center gap-2" }, h("span", { key: '01713e280205ec26270bde54c3dcc1fbab1c9bd9', class: "text-text-muted" }, t.solarSystemForm.costSavings)), h("span", { key: 'c1e49d857748ae877b7a7b5130c26716a7d2af49', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.costSavings), " ", "\u20AC/", t.solarSystemForm.year)), h("div", { key: '344774ffade439ccec0dc7701a2fd0f7082b5b7c', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: '4267c3680c326f24bed4ddc559cd3ddefb69cbd6', class: "flex items-center gap-2" }, h("span", { key: '66f1fc1a05b1b6660fd2a3207a1ff313f8daadf2', class: "text-text-muted" }, t.solarSystemForm.compensation20Years)), h("span", { key: 'dd0ba7c6a43fce07e6d60261fe6d2ecfe699f098', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.compensation20Years), " \u20AC")), h("div", { key: '4ee325ba62189bc7bc243891d4b5c32901329388', class: "flex flex-col sm:flex-row sm:items-center justify-between mt-4" }, h("div", { key: 'a2212b762ca6315e68b45a1e165a799d4dbc36ea', class: "flex items-center gap-2" }, h("span", { key: 'af0598e52f05f3f1667471bdf09a9e79e8c79741', class: "text-text-muted" }, t.solarSystemForm.monetaryBenefit20Years)), h("span", { key: 'd7a3368046fa675d55fb814e8fcaae9182887f62', class: "text-xl font-bold text-success mt-1 sm:mt-0" }, this.formatEuropeanNumber(this.savedCosts20Years), " \u20AC")))), h("div", { key: 'c64a2931feae28a6baee28571d58e36415160acd', class: "space-y-4 p-4 rounded-4xl", style: borderStyle }, h("h2", { key: 'd62ca816ac96a3c90a9ea276ed9ad85e9d5fa81e', class: "font-semibold text-secondary pb-2", style: { fontSize: "1rem" } }, t.solarSystemForm.requestOffer), h("div", { key: 'f35d527744da8e85acfb93dc003789fc73156aa9', style: {
|
|
476
|
+
display: "grid",
|
|
477
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(1 00px, 1fr))",
|
|
478
|
+
gap: "1rem",
|
|
479
|
+
} }, h("div", { key: '88d1092d67419751356432af6e7038e2436b38c0' }, h("label", { key: 'f6e3712707935c9efc56a5a05e342efa1475eb10', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.firstname || "Vorname"), h("input", { key: '8bc61473e8b7b37b1be03e17dbefdd63e7830297', type: "text", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.firstnameError ? errorBorderStyle : borderStyle, value: this.firstname, onInput: (e) => {
|
|
452
480
|
this.firstname = e.target.value;
|
|
453
481
|
this.validateForm();
|
|
454
|
-
}, placeholder: "Vorname" }), this.firstnameError && h("p", { key: '
|
|
482
|
+
}, placeholder: "Vorname" }), this.firstnameError && (h("p", { key: 'eda195bb0b019bedc71aeecba105e22c1abb3dd1', class: "text-error text-sm mt-1" }, this.firstnameError))), h("div", { key: '2500655e4237b6abd5e77938e49ea1ef5a51e0fb' }, h("label", { key: '19d716c21446e2747d864b0b9703dd1fa2573229', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.surname || "Nachname"), h("input", { key: 'ca462010e60314bc82a6dced177b1edaa9544cf0', type: "text", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.surnameError ? errorBorderStyle : borderStyle, value: this.surname, onInput: (e) => {
|
|
455
483
|
this.surname = e.target.value;
|
|
456
484
|
this.validateForm();
|
|
457
|
-
}, placeholder: "Nachname" }), this.surnameError && h("p", { key: '
|
|
485
|
+
}, placeholder: "Nachname" }), this.surnameError && (h("p", { key: 'fc327dcb73b1c2d5103e5882248aa723e07ec537', class: "text-error text-sm mt-1" }, this.surnameError))), h("div", { key: 'ac9b9e79fe48a0d34bef94991b1722b7d8c53e5d' }, h("label", { key: '4689d8d157fc4600dd04d305d09ce583d6f632f2', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.email), h("input", { key: 'aad86818f6934aa1451232c22ff3dce1d1987035', type: "email", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.emailError ? errorBorderStyle : borderStyle, value: this.email, onInput: (e) => {
|
|
458
486
|
this.email = e.target.value;
|
|
459
487
|
this.validateForm();
|
|
460
|
-
}, placeholder: "mail@beispiel.com" }), this.emailError && h("p", { key: '
|
|
488
|
+
}, placeholder: "mail@beispiel.com" }), this.emailError && (h("p", { key: '6a7a1fad12a4caa10b61919c7d4c7dec3588efd5', class: "text-error text-sm mt-1" }, this.emailError))), h("div", { key: '3b6179c006ec55ff145484f64a30c114b2d37f47' }, h("label", { key: '1310913ed3df2bf5c674e406189f03037b5ee25f', class: "block text-sm font-medium text-text-muted mb-1" }, t.solarSystemForm.phone), h("input", { key: '71277f8de6d34a78a95336c7432fdd6c0152f230', type: "tel", class: `w-full px-4 py-2 rounded-4xl focus:ring-2 focus:ring-tertiary focus:border-transparent bg-muted text-muted-foreground`, style: this.phoneError ? errorBorderStyle : borderStyle, value: this.phone, onInput: (e) => {
|
|
461
489
|
this.phone = e.target.value;
|
|
462
490
|
this.validateForm();
|
|
463
|
-
}, placeholder: "0171 23456789" }), this.phoneError && h("p", { key: '
|
|
464
|
-
this.privacyPolicyAccepted =
|
|
491
|
+
}, placeholder: "0171 23456789" }), this.phoneError && (h("p", { key: '8e3478b75c944f4004142ea84221837e8d6829c1', class: "text-error text-sm mt-1" }, this.phoneError)))), h("div", { key: 'c7538c4d45ad3a30584f13528936d59b684cf9c7', class: "flex flex-col items-center gap-4" }, h("div", { key: '2780819d38f28b32d61594a3fce63570ce1add87', class: "flex flex-col items-start w-full" }, h("div", { key: '464dd1428c4f9d346fd7a8f956351fd9e01ff1b7', class: "flex items-center gap-2" }, h("input", { key: '1ed5bc7d6251306408e20b627d363b22b6b950d0', type: "checkbox", id: "privacyPolicy", class: "w-4 h-4 accent-tertiary border-border rounded focus:ring-tertiary focus:ring-offset-0 focus:ring-2", checked: this.privacyPolicyAccepted, onChange: (e) => {
|
|
492
|
+
this.privacyPolicyAccepted =
|
|
493
|
+
e.target.checked;
|
|
465
494
|
if (e.target.checked) {
|
|
466
|
-
this.privacyPolicyError =
|
|
495
|
+
this.privacyPolicyError = "";
|
|
467
496
|
}
|
|
468
|
-
} }), h("label", { key: '
|
|
497
|
+
} }), h("label", { key: '5097ea3f5f63bcd444d23dc63b89c2ba8d4d96ba', htmlFor: "privacyPolicy", class: "text-sm text-text-muted" }, "Ich stimme der", " ", h("a", { key: 'f9d8a034156d0ef120514538a4b985971b8caae0', href: "https://www.solaravatar.com/rechtliches/datenschutz", target: "_blank", rel: "noopener noreferrer", class: "text-secondary hover:underline" }, "Datenschutzerkl\u00E4rung"), " ", "zu.")), this.privacyPolicyError && (h("p", { key: 'd802a925c9bf9a138af304878183837102a8eaf6', class: "text-error text-sm mt-1 ml-6" }, this.privacyPolicyError))), h("button", { key: '340678d027e1f34ce182fdd5e26fd79f35f739ea', onClick: () => this.handleRequestOffer(), disabled: !this.firstname.trim() ||
|
|
469
498
|
!this.surname.trim() ||
|
|
470
499
|
!this.email.trim() ||
|
|
471
500
|
!!this.firstnameError ||
|
|
@@ -473,9 +502,17 @@ const SolarSystemForm = class {
|
|
|
473
502
|
!!this.emailError ||
|
|
474
503
|
!!this.phoneError ||
|
|
475
504
|
!this.privacyPolicyAccepted ||
|
|
476
|
-
this.isSubmitting, class: `px-6 py-3 rounded-4xl transition-colors duration-200 flex items-center gap-2 ${this.isSubmitting
|
|
477
|
-
|
|
478
|
-
|
|
505
|
+
this.isSubmitting, class: `px-6 py-3 rounded-4xl transition-colors duration-200 flex items-center gap-2 ${this.isSubmitting
|
|
506
|
+
? "bg-muted text-text-muted cursor-not-allowed"
|
|
507
|
+
: "bg-secondary hover:bg-tertiary"}`, style: {
|
|
508
|
+
color: this.isSubmitting
|
|
509
|
+
? "var(--color-text-muted)"
|
|
510
|
+
: "#ffffff",
|
|
511
|
+
} }, this.isSubmitting && (h("div", { key: '1de9e16d3282d780ecff4bee2af4fef64080c5aa', class: "w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin" })), this.isSubmitting
|
|
512
|
+
? t.solarSystemForm.sending
|
|
513
|
+
: t.solarSystemForm.requestOfferButton), this.submitMessage && (h("div", { key: '58a1cf2190a7aae7671bb1d889d31650301b25f0', class: `text-sm px-4 py-2 rounded-4xl ${this.submitSuccess
|
|
514
|
+
? "bg-success/10 text-success border border-success/20"
|
|
515
|
+
: "bg-error/10 text-error border border-error/20"}` }, this.submitMessage)))))));
|
|
479
516
|
}
|
|
480
517
|
static get watchers() { return {
|
|
481
518
|
"systemConfigs": ["updateSystemConfigs"]
|