1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,424039,e=>{"use strict";var t=e.i(843476),r=e.i(555528),o=e.i(432188),i=e.i(355827),n=e.i(524911),s=e.i(816233),u=e.i(996510),a=e.i(766164),l=e.i(484478),c=e.i(538783),d=e.i(399126),p=e.i(699085),m=e.i(788021),g=e.i(108215),h=e.i(264051),f=e.i(711627),y=e.i(866807),S=e.i(151920),v=e.i(476678),b=e.i(96463),k=e.i(190263),N=e.i(557105),V=e.i(649476),_=e.i(537460),C=e.i(812497),P=e.i(618566),O=e.i(271645),T=e.i(322831),w=e.i(499683);let{useRef:j}=O.default;w.setLocale(V.yupLocales),e.s(["default",0,({type:e,button:V,productKey:E,heatflow:R,spc:L,targetGroup:x,calculatorStoryId:D,productStoryId:F})=>{var A;let B,[G,K]=(0,O.useState)(),[U,I]=(0,O.useState)(!1),[M,q]=(0,O.useState)(!1),{postcode:z,city:J,consumption:W,consumptionNt:Z,setState:$,setCity:H,getURLParams:Q}=(0,v.useCalculatorStore)((A=e=>({postcode:e.postcode,city:e.city,consumption:e.consumption,consumptionNt:e.consumptionNt,setState:e.setState,setCity:e.setCity,getURLParams:e.getURLParams}),B=j(),e=>{let t=A(e);return!function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(t,r[o])||!Object.is(e[r[o]],t[r[o]]))return!1;return!0}(B.current,t)?B.current=t:B.current})),X=(0,v.useCalculatorStoreHydrated)(),{isDVG:Y}=(0,f.useRegionService)(),{t:ee}=(0,T.useTranslation)(),et=(0,h.usePostcodeSelect)(),er=(0,O.useRef)(!1),eo=(0,P.usePathname)(),ei=(0,P.useRouter)(),en=(0,N.useSettings)(),es=(0,b.useOrderFormSettings)(),{tariffs:eu}=(0,s.useProductOverviewService)(U),{selectProduct:ea}=(0,S.default)(c.EventSource.Calculator),{checkConsumptionRange:el}=(0,g.useConsumptionRanges)(),ec=(0,P.useSearchParams)().get("telljaid"),ed=(0,k.useOrderStore)(e=>e.update),ep=(0,O.useMemo)(()=>(0,i.resolveCalculatorTargetGroup)(eo,x),[eo,x]),em=(0,p.resolveStory)(L?.region);(0,O.useEffect)(()=>{if(X&&!er.current){if(z&&J){er.current=!0,et.setInitialValue({postcode:z,cityName:J});return}z&&!J&&(er.current=!0,et.resolveFromPostcode(z))}},[X,z,J]),(0,O.useEffect)(()=>{if(!X||!z||J)return;let e=et.selectedValue.cityName;e&&H(e)},[X,z,J,et.selectedValue.cityName,H]);let eg=(0,O.useMemo)(()=>w.object({postcode:w.string().length(5,ee("Bitte geben Sie eine 5 stellige PLZ an.")).matches(m.GERMAN_POSTCODE_PATTERN,"Bitte geben Sie eine gültige PLZ an.").required().test("postcode-is-valid",et.error??"",()=>!et.error).test("postcode-is-in-region",ee("Aktuell bieten wir das Produkt für die eingegebene PLZ nicht an."),()=>!!(!em||em.content.postcodes?.includes(et.selectedValue.postcode))).test("city-required",ee("Der Ortsname wurde noch nicht erkannt."),()=>!!et.selectedValue.postcode&&!!et.selectedValue.cityName),city:w.string().required(),consumption:w.number().required(),consumptionNt:w.number().when([],{is:()=>!!R,then:()=>w.number().required()})}),[ee,R,et.error,et.selectedValue.postcode,et.selectedValue.cityName,em]),eh=()=>(0,o.getCalculatorDefaultConsumptionString)(en,e,R,ep),ef=()=>(0,o.getCalculatorDefaultConsumptionNtString)(en,R),ey=(0,C.useFormik)({initialValues:{postcode:"",city:"",consumption:eh(),consumptionNt:ef()},validationSchema:eg,onSubmit:async(t,{setSubmitting:r})=>{r(!1),t=(0,p.trimStringValues)(t);let o=await Y(et.selectedValue.postcode)?y.Region.DVG:y.Region.ADVG,i=L?.products?.map(e=>(0,p.resolveStory)(e)?.content.key).filter(e=>void 0!==e)??[];if(E&&i.push(E),$({postcode:t.postcode,city:t.city,consumption:Number(t.consumption),consumptionNt:R?Number(t.consumptionNt):0,targetGroup:ep,productCategory:e,customerRegion:o,heatflow:!!R,regionSpecificTariffs:i,singlePriceCalculator:{skipOrderType:(0,p.stringToEnum)(_.OrderType,L?.orderType),retention:L?.retention,kwkCalculator:L?.is_kwk_calculator,kwkTelljaId:L?.is_kwk_calculator&&ec?ec:void 0,availableOrderTypes:L?.available_order_types??_.AllOrderTypes,cancellationCampaign:void 0,presetDeliveryDate:void 0},sourceUrl:(0,d.linkToString)(eo),salesPartnerNumber:(0,l.resolveSalesPartnerNumber)(L?.custom_vkn_number,es?.sales_partner_number),campaignId:sessionStorage?.getItem("swd_campaign")||void 0,calculatorStoryId:D,productStoryId:F}),ed({kwkCode:L?.is_kwk_calculator&&ec?ec:void 0,isKwKOrder:L?.is_kwk_calculator&&!!ec}),L?.skipProductOverview){I(!0),q(!0);return}let n=el(e,ep,o,Number(t.consumption),Number(t.consumptionNt));(0,d.linkToString)(n?.redirection_link)?ei.push((0,d.linkToString)(n?.redirection_link)):ei.push(`/${a.ORDER_SLUG}/${a.PRODUCTOVERVIEW_SLUG}${Q()}`)}});return(0,O.useEffect)(()=>{ey.setFieldValue("postcode",z),ey.setFieldValue("city",J),ey.setFieldValue("consumption",W||eh()),ey.setFieldValue("consumptionNt",R?Z||ef():"")},[z,J,W,Z]),(0,O.useEffect)(()=>{ey.setFieldValue("city",et.selectedValue.cityName)},[et.selectedValue.cityName]),(0,O.useEffect)(()=>{ey.setFieldValue("consumption",String(G?.value||eh()))},[G]),(0,O.useEffect)(()=>
1{if(R||ep!==u.TargetGroup.PK)return;let t=e===u.ProductCategory.Electricity?en?.consumption_steps_electricity:en?.consumption_steps_gas;if(!t?.length)return;let r=String(String(ey.values.consumption??"").trim()||W||eh()).trim();if(!r)return;let o=t.find(e=>String(e.value).trim()===r);o&&K(e=>void 0!==e?e:o)},[R,ep,e,en?.consumption_steps_electricity,en?.consumption_steps_gas,W,ey.values.consumption]),(0,O.useEffect)(()=>{U&&L?.skipProductOverview&&1===eu.length&&eu[0]&&ea(eu[0],0)},[U,L?.skipProductOverview,eu]),(0,t.jsx)(r.default,{type:e,button:V,heatflow:R,targetGroup:ep,ready:!0,onSubmit:ey.handleSubmit,postcode:{value:ey.values.postcode,onChange:e=>{et.handleInputChange(e),ey.setFieldValue("postcode",et.selectedValue.postcode),ey.setFieldValue("city",et.selectedValue.cityName),ey.handleChange(e)},onBlur:ey.handleBlur,error:!!(ey.touched.postcode&&ey.errors.postcode),helperText:ey.touched.postcode&&ey.errors.postcode,inputProps:{maxLength:5,inputMode:"numeric","aria-label":et.selectedValue.cityName},endAdornment:(0,t.jsx)("span",{"aria-hidden":!0,children:(0,t.jsx)(n.default,{state:{...et,loading:et.loading||X&&!!z&&!et.selectedValue.cityName&&!et.error}})})},consumption:{value:ey.values.consumption,onChange:ey.handleChange,onBlur:ey.handleBlur,error:!!(ey.touched.consumption&&ey.errors.consumption),helperText:ey.touched.consumption&&ey.errors.consumption,inputProps:{maxLength:7,"aria-label":R?ee("Kilowattstunde / Jahr"):ee("Kilowattstunde")},endAdornment:(0,t.jsx)("span",{"aria-hidden":!0,children:R?ee("kWh / Jahr"):ee("kWh")})}
1,consumptionNt:R?{value:ey.values.consumptionNt,onChange:ey.handleChange,onBlur:ey.handleBlur,error:!!(ey.touched.consumptionNt&&ey.errors.consumptionNt),helperText:ey.touched.consumptionNt&&ey.errors.consumptionNt,inputProps:{maxLength:7,"aria-label":ee("Kilowattstunde / Jahr")},endAdornment:(0,t.jsx)("span",{"aria-hidden":!0,children:ee("kWh / Jahr")})}:void 0,selectedStep:G,setSelectedStep:K,submitDisabled:M,formikErrors:ey.errors,formikTouched:ey.touched})}],424039)},921379,function(e){e.n(e.i(424039))}]); 2 3//# sourceMappingURL=1apdwudd22jeb.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.