1import{a9 as J,Q as m,j as Q,aa as G,ab as W,F as r,J as d,H as l,Y as C,a6 as A,K as a,u as c,a8 as x,Z as _,ac as H,a7 as L,a0 as s,q as f,ad as Y,i as D,a4 as X,R as tt,A as et,a2 as F,W as v,ae as nt,af as ot,G as it,a as b,x as at,y as lt,ag as E,ah as T,ai as u,_ as q,$ as k,a1 as O,aj as B,E as rt,ak as st,al as ct}from"./index-DUrPV9Cf.js";import{F as pt,N as dt,a as ut}from"./forms-DDZlCCaC.js";import{o as mt}from"./order-kim.utils-nnSotNQ5.js";import{r as $}from"./onboarding-content-utils-Daue4bKO.js";import"./onboarding-step-options-BkxWU8b4.js";import{i as R}from"./profession-utils-KLnE0-VX.js";import{B as _t}from"./banner.component-CSmyWEFs.js";import{B as ht}from"./button.component-CXGXoxGb.js";import{B as ft}from"./buttonTile.component-C4Tc-eDK.js";import{C as gt}from"./card.component-BUAiX38Z.js";import{C as Ct}from"./contentTile.component-B8cyGv_p.js";import{a as bt,H as vt}from"./header.component-xMILluNC.js";import{C as xt}from"./checkbox.component-BbIfpS3W.js";import{L as Tt}from"./linkTeaserTile.component-BvAlKWAU.js";import{L as yt}from"./linkTile.component-BYh7JeC7.js";import{M as Pt}from"./modal.component-C-xgdCVs.js";import{N as St}from"./notification.component-bOpEjdzO.js";import{f as wt,a as N}from"./format-date.utils-C7ab7w2O.js";import{g as Dt,a as kt,m as Ot}from"./salutation.utils-5NArBR3l.js";import{g as Ft}from"./product.utils-BEb16PDD.js";import{B as It}from"./badge.component-L9NR_fTs.js";import{I as Mt}from"./icon-badge.component-DnPKWslp.js";import{L as At}from"./label.component-Dgmpflf6.js";import{P as Lt}from"./pageHeading.component-C55WtJLZ.js";import{S as Et}from"./spinner.component-BRdyh3b_.js";import{d as qt}from"./demo-order-CfZIHiLa.js";import{h as Bt,r as I,g as M,o as Vt}from"./order-portal-task.utils-edBUFvkx.js";import{l as Ht,S as zt}from"./lexical-to-html.utils-ChbndRmN.js";import{N as $t}from"./notification.service-BlfgZ-FC.js";import{S as Rt}from"./step-sync.service-BhavQTGy.js";import"./_commonjsHelpers-CqkleIqs.js";import"./tile-style.directive-Y8mo6lDy.js";import"./dateTimestampProvider-CV0dHcg-.js";const Nt=(o,e)=>e.name;function jt(o,e){if(o&1&&(r(0,"app-link",2),d(1," Sendung verfolgen "),l()),o&2){let t;const n=s();c("href",(t=(t=n.order())==null?null:t.trackingLink)!==null&&t!==void 0?t:"")("variant","secondary")("iconPosition","right")("icon","/icons/external-link.svg")}}function Qt(o,e){if(o&1&&(r(0,"app-badge",5),d(1),l()),o&2){const t=s();c("variant",t.getOrderStatusVariant(t.order().status)),a(),x(" ",t.getOrderStatusLabel(t.order().status)," ")}}function Gt(o,e){if(o&1&&(r(0,"div",7),f(1,"app-icon-badge",8),r(2,"p"),d(3),l()()),o&2){const t=e.$implicit,n=s();a(),c("icon",n.getProductIcon(t.type))("alt",t.name),a(2),Y("",t.count,"x ",t.name,"")}}const P=class P{constructor(){this.order=J.required(),this.formattedDate=m(()=>wt(this.order()?.createdAt??"")),this.customer=m(()=>{const e=this.order()?.customer;return typeof e=="object"&&e!==null?e:null}),this.productSummary=m(()=>{const e=this.order()?.products??[],t=new Map;return e.forEach(n=>{const i=this.getProduct(n?.product);if(i){const p=t.get(i.name);p?p.count++:t.set(i.name,{count:1,type:i.type,name:i.name})}}),Array.from(t.values()).sort((n,i)=>{const p=n.name.toLowerCase().includes("opticati"),g=i.name.toLowerCase().includes("opticati");return p&&!g?-1:!p&&g?1:n.name.localeCompare(i.name)})}),this.getOrderStatusVariant=Dt,this.getOrderStatusLabel=kt,this.getProductIcon=Ft}getProduct(e){return typeof e=="object"&&e!==null?e:null}};P.ɵfac=function(t){return new(t||P)},P.ɵcmp=Q({type:P,selectors:[["app-order-tile"]],inputs:{order:[1,"order"]},decls:32,vars:8,consts:[[1,"flex","items-center","justify-between","gap-4","max-md:flex-col","max-md:items-start"],[3,"tag","size"],[3,"href","variant","iconPosition","icon"],[1,"mt-10","grid","gap-6","gap-x-10","lg:grid-cols-2"],[1,"grid","gap-x-10","gap-y-6","lg:grid-cols-2"],[3,"variant"],[1,"mt-3","flex","flex-row","flex-wrap","gap-x-8","gap-y-3","lg:gap-y-4"],[1,"flex","items-center","gap-2","lg:gap-4"],[3,"icon","alt"]],template:function(t,n){if(t&1&&(r(0,"div")(1,"div",0)(2,"app-heading",1),d(3),l(),C(4,jt,2,4,"app-link",2),l(),r(5,"div",3)(6,"div",4)(7,"div")(8,"app-label"),d(9,"Bestelldatum"),l(),r(10,"p"),d(11),l()(),r(12,"div")(13,"app-label"),d(14,"Status"),l(),C(15,Qt,2,2,"app-badge",5),l(),r(16,"div")(17,"app-label"),d(18,"Leistungserbringer"),l(),r(19,"p"),d(20),l()(),r(21,"div")(22,"app-label"),d(23,"IK"),l(
1),r(24,"p"),d(25),l()()(),r(26,"div")(27,"app-label"),d(28,"Enthaltene Produkte"),l(),r(29,"div",6),A(30,Gt,4,4,"div",7,Nt),l()()()()),t&2){let i,p,g,y,w;a(2),c("tag","h3")("size","medium"),a(),x("Bestellung ",(i=n.order())==null?null:i.id,""),a(),_((p=n.order())!=null&&p.trackingLink?4:-1),a(7),H(n.formattedDate()),a(4),_((g=n.order())!=null&&g.status?15:-1),a(5),H((y=n.customer())==null?null:y.contractPartner),a(5),H((w=n.customer())==null?null:w.ikNumber),a(5),L(n.productSummary())}},dependencies:[G,Mt,At,It,W],encapsulation:2});let z=P;const Wt=()=>({href:"/portal/account/payment-details",label:"Zahlungsdaten jetzt prüfen"}),U=o=>["col-span-full",o],Z=o=>({"col-span-full lg:col-span-4":!0,hidden:o}),K=(o,e)=>e.id,Ut=(o,e)=>e.href;function Zt(o,e){o&1&&(r(0,"div",0),f(1,"app-spinner"),l())}function Kt(o,e){if(o&1&&f(0,"app-banner",19),o&2){const t=e.$implicit,n=s(4);c("title","Bitte prüfen Sie Ihre Zahlungsdaten und die Kontodeckung")("text",n.failedDebitBannerText(t))("link",ct(3,Wt))}}function Jt(o,e){if(o&1&&(r(0,"div",17),A(1,Kt,1,4,"app-banner",19,K),l()),o&2){s(2);const t=u(1);a(),L(t)}}function Yt(o,e){if(o&1&&(C(0,Jt,3,0,"div",17),f(1,"app-link-tile",18)(2,"app-link-tile",18)(3,"app-link-tile",18)),o&2){s();const t=u(1);_(t.length>0?0:-1),a(),c("label","Account anzeigen")("href","/portal/account/credentials")("size","medium"),a(),c("label","Bestellungen anzeigen")("href","/portal/account/orders")("size","medium"),a(),c("label","Rechnungen anzeigen")("href","/portal/account/invoices")("size","large")}}function Xt(o,e){o&1&&(r(0,"app-heading",14),d(1," Offene Aufgaben "),l()),o&2&&c("tag","h2")("size","large")}function te(o,e){if(o&1){const t=q();r(0,"app-button",10),b("action",function(){k(t);const i=s(2).$implicit,p=s(3);return O(p.openCancelAppointmentModal(i))}),d(1," Termin stornieren "),l()}o&2&&c("variant","secondary")}function ee(o,e){if(o&1&&(r(0,"div",26),f(1,"app-link-tile",27),l()),o&2){const t=s(2).$implicit,n=u(0),i=u(1),p=s(3);c("ngClass",B(4,Z,p.shouldSpanFullInstallationTile(t,n))),a(),c("label","Ich habe meine Refinanzierung noch nicht beantragt")("href",n.primaryHref)("queryParams",i)}}function ne(o,e){if(o&1&&(r(0,"app-content-tile",23)(1,"app-link",24),d(2," Checkliste für die Installation "),l(),C(3,te,2,1,"app-button",25),l(),C(4,ee,2,6,"div",26)),o&2){const t=s().$implicit,n=u(0),i=s(3);c("color","blue")("subTitle",i.getAppointmentTileSubTitle(t))("title",i.getDaysUntilInstallationLabel(t))("text",i.getAppointmentTileText(t))("ngClass",B(10,U,i.shouldSpanFullInstallationTile(t,n)?"lg:col-span-full":"lg:col-span-8")),a(),c("href","/portal/checklist")("iconPosition","right")("icon","/icons/arrow-right.svg"),a(2),_(i.isMedicalAidsCategory(t.professionalGroupCategory)?-1:3),a(),_(n.showRefinancingTile?4:-1)}}function oe(o,e){if(o&1&&(r(0,"div",26),f(1,"app-link-tile",27),l()),o&2){const t=s(2).$implicit,n=u(0),i=u(1),p=s(3);c("ngClass",B(4,Z,p.shouldSpanFullInstallationTile(t,n))),a(),c("label","Ich habe meine Refinanzierung noch nicht beantragt")("href",n.primaryHref)("queryParams",i)}}function ie(o,e){if(o&1&&(r(0,"app-content-tile",23)(1,"app-link",24),d(2," Checkliste für die Installation "),l()(),C(3,oe,2,6,"div",26)),o&2){const t=s().$implicit,n=u(0),i=s(3);c("color","blue")("subTitle",i.getAppointmentTileSubTitle(t))("title","Termin noch nicht bestätigt")("text",i.getPendingAppointmentTileText(t))("ngClass",B(9,U,i.shouldSpanFullInstallationTile(t,n)?"lg:col-span-full":"lg:col-span-8")),a(),c("href","/portal/checklist")("iconPosition","right")("icon","/icons/arrow-right.svg"),a(2),_(n.showRefinancingTile?3:-1)}}function ae(o,e){if(o&1&&(r(0,"div",15),f(1,"app-link-teaser-tile",30),l()),o&2){s();const t=u(0),n=u(1);s(2);const i=u(0),p=u(1);st("mt-6",t<=3&&i.requiresEhba),a(),c("href",i.primaryHref)("title",n.title)("text",n.text)("image",n.image)("label",i.linkLabel)("queryParams",p)}}function le(o,e){if(o&1){const t=q();r(0,"app-button-tile",34),b("action",function(){k(t);const i=s(4).$implicit,p=s(3);return O(p.handleFastLane(i))}),l()}if(o&2){s(4);const t=u(0),n=s(3);c("label",n.getPortalTile2Label(t))}}function re(o,e){if(o&1){const t=q();r(0,"app-button-tile",35),b("action",function(){k(t);const i=s(7);
1return O(i.openFlyout())}),l()}if(o&2){s(6);const t=u(2);c("label",(t==null||t.flyout==null?null:t.flyout.label)||"")("color","secondary")("icon","questionmark")}}function se(o,e){if(o&1&&(r(0,"div",29),f(1,"app-link-tile",31),C(2,le,1,1,"app-button-tile",32)(3,re,1,3,"app-button-tile",33),l()),o&2){s(3);const t=u(0),n=u(1),i=s(3);a(),c("label",i.getPortalTile1Label(t))("href",t.primaryHref)("queryParams",n),a(),_(t.showFastLane?2:-1),a(),_(t.showFlyout?3:-1)}}function ce(o,e){if(o&1&&(E(0)(1),C(2,ae,2,8,"div",28)(3,se,4,5,"div",29)),o&2){const t=s(2).$implicit,n=u(0),i=s(3),p=T(i.getCurrentStepForOrderReactive(t.id));a();const g=T(i.getOnboardingTeaser(p,t));a(),_(g?2:n.variant==="onboarding"||n.variant==="three-tiles"?3:-1)}}function pe(o,e){if(o&1&&(r(0,"div",15),f(1,"app-link-teaser-tile",30),l()),o&2){s(2);const t=u(0),n=u(1);a(),c("href",t.primaryHref)("title",t.customTeaser.title)("text",t.customTeaser.text)("image",t.customTeaser.image)("label",t.customTeaser.label)("queryParams",n)}}function de(o,e){if(o&1&&(r(0,"div",15),f(1,"app-link-tile",27),l()),o&2){s(2);const t=u(0),n=u(1);a(),c("label",t.linkLabel)("href",t.primaryHref)("queryParams",n)}}function ue(o,e){if(o&1&&C(0,ce,4,3)(1,pe,2,6,"div",15)(2,de,2,3,"div",15),o&2){s();const t=u(0);_(t.showStepBasedTeaser?0:t.customTeaser?1:2)}}function me(o,e){if(o&1&&(E(0)(1),r(2,"div",20)(3,"div",21),f(4,"app-order-tile",22),l(),C(5,ne,5,12)(6,ie,4,11)(7,ue,3,1),l()),o&2){const t=e.$implicit,n=s(3),i=T(n.getOrderPortalFlow(t));a(),T(n.getOrderPortalQueryParams(t,i)),a(3),c("order",t),a(),_(t.installation!=null&&t.installation.installationDate?5:n.hasPendingInstallationRequest(t)?6:7)}}function _e(o,e){if(o&1&&A(0,me,8,4,"div",20,K),o&2){s();const t=u(0);L(t)}}function he(o,e){o&1&&(r(0,"div",15)(1,"p"),d(2,"Keine Bestellungen gefunden"),l()())}function fe(o,e){if(o&1){const t=q();E(0),r(1,"app-grid",16)(2,"app-content-tile",36)(3,"div",37)(4,"app-checkbox",38),b("ngModelChange",function(i){k(t);const p=s(2);return O(p.onVivaCheckboxChange(i))}),d(5),l()(),r(6,"div",39)(7,"app-button",40),b("action",function(){k(t);const i=s(2);return O(i.handleVivaPrimaryClick())}),d(8),l()()()()}if(o&2){let t,n,i,p,g,y;s();const w=u(2),V=s(),h=w==null?null:w.vivaDiscount;a(2),c("title",(h==null?null:h.cardTitle)||"")("badge",(t=h==null?null:h.badgeText)!==null&&t!==void 0?t:"")("text",(h==null?null:h.cardText)||"")("image",(h==null?null:h.image)||null)("additionalText",(n=h==null?null:h.footerNote)!==null&&n!==void 0?n:""),a(2),c("ngModel",V.requestVivaDiscount())("error",(i=V.vivaDiscountCheckboxError())!==null&&i!==void 0?i:""),a(),x(" ",(p=h==null?null:h.checkboxLabel)!==null&&p!==void 0?p:""," "),a(2),c("label",(g=h==null?null:h.primaryButtonLabel)!==null&&g!==void 0?g:"")("variant","primary")("loading",V.loadingVivaDiscountEmail()),a(),x(" ",(y=h==null?null:h.primaryButtonLabel)!==null&&y!==void 0?y:""," ")}}function ge(o,e){if(o&1&&(r(0,"li",47)(1,"span",48)(2,"div",49),d(3),l(),d(4),l(),r(5,"app-link",50),d(6," Jetzt ansehen "),l()()),o&2){const t=e.$implicit,n=e.$index;a(3),x(" ",n+1," "),a(),x(" ",t.label," "),a(),c("href",t.href)("variant","secondary")("icon","/icons/arrow-right.svg")("iconPosition","right")("queryParams",t.queryParams)}}function Ce(o,e){if(o&1&&(r(0,"div",16)(1,"app-grid")(2,"app-heading",15),d(3,"Lernen Sie das OpticaTI-Demoportal kennen "),l()(),r(4,"app-grid",41)(5,"app-card",15)(6,"ul",42)(7,"li",43)(8,"div",44),f(9,"img",45),l(),r(10,"span",46),d(11,"Testbestellung im TI-Shop abgeschlossen"),l()(),A(12,ge,7,7,"li",47,Ut),l()()()()),o&2){const t=s(2);a(12),L(t.demoLinks())}}function be(o,e){if(o&1&&(E(0)(1)(2),r(3,"app-grid",12),f(4,"app-page-heading",13),C(5,Yt,4,10)(6,Xt,2,2,"app-heading",14)(7,_e,2,0)(8,he,3,0,"div",15),l(),C(9,fe,9,12,"app-grid",16)(10,Ce,14,0,"div",16)),o&2){const t=s(),n=T(t.openPortalOrders());a(),T(t.customersWithFailedDebits()),a(),T(t.portal()),a(2),c("subTitle",t.subTitle())("title",t.isDemoMode?"Willkommen im OpticaTI-Demoportal!":"Willkommen im TI-Portal!"),a(),_(t.isDemoMode?-1:5),a(),_(t.isDemoMode?-1:6),a(),_(n.length>0?7:8),a(2),_(!t.isDemoMode&&!t.loadingPortal()&&t.shouldShowVivaDiscountRecommendation()?9:-1),a(),_(t.isDemoMode?10:-1)}}function ve(o,e){if(o&1&&(r(0,"p",6),d(1),l()),o&2){const t=s();a(),x(" ",t.errorCancelAppointment()," ")}}const S=class S{constructor(){this.isMedicalAidsCategory=R,this.payloadService=D(X),this.router=D(tt),this.route=D(et),this.stepSyncService=D(Rt),this.notificationService=D($t),this.isDemoMode=!1,this.orders=this.isDemoMode?null:F(this.payloadService.getOrders(),{initialValue:null}),this.customers=this.isDemoMode?null:F(this.payloadService.getCustomers(),{initialValue:null}),this.onboarding=F(this.payloadService.getOnboarding(),{initialValue:null}),this.cancelAppointmentOnboardingContent=m(()=>$(this.onboarding(),this.selectedOrderForCancellation()?.professionalGroupCategory)),this.cancelAppointmentModalTitle=m(()=>{const e=this.selectedOrderForCancellation();return e&&this.orderHasPlusSupport(e)?"Plus Support Termin stornieren?":this.cancelAppointmentOnboardingContent()?.step3?.subStep4?.cancelationModal?.title??""}),this.portal=F(this.payloadService.getPortal(),{initialValue:null}),this.showCancelAppointmentModal=v(!1),this.selectedOrderForCancellation=v(null),this.openCancelAppointmentModal=e=>{this.selectedOrderForCancellation.set(e),this.showCancelAppointmentModal.set(!0)},this.requestVivaDiscount=v(!1),this.vivaDiscountCheckboxError=v(null),this.loadingVivaDiscountEmail=v(!1),this.vivaDiscountEmailSent=v(!1),this.showOrderSuccessModal=v(!1),this.loadingPortal=m(()=>this.isDemoMode?!1:this.portal()===null),this.currentStep=m(()=>{const e=this.stepSyncService.getCurrentStep(),t=this.allOrders()[0]?.currentStep??0;return Math.max(e,t)}),this.loadingOrders=m(()=>this.isDemoMode?!1:this.orders?.()===null),this.loadingCustomers=m(()=>this.isDemoMode?!1:this.customers?.()===null),this.loadingOnboarding=m(()=>this.onboarding()===null),this.loadingCancelAppointment=v(!1),this.errorCancelAppointment=v(null),this.demoOrder={...qt,status:"ORDERED"},this.customersWithFailedDebits=m(()=>{if(this.isDemoMode){const t=this.demoOrder.customer;return typeof t=="object"&&t!==null&&t.failedDebitCount>0?[t]:[]}return(this.customers?.()?.docs??[]).filter(t=>(t.failedDebitCount??0)>0)}),this.allOrders=m(()=>this.isDemoMode?[this.demoOrder]:this.orders?.()?.docs??[]),this.openPortalOrders=m(()=>this.allOrders().filter(e=>Bt(e))),this.orderSteps=m(()=>{const e=this.allOrders(),t=new Map;return e.forEach(n=>{const i=n.currentStep??0;t.set(n.id,i)}),t}),this.account=m(()=>{const e=this.allOrders()[0]?.account;return typeof e=="object"&&e!==null?e:null}),this.subTitle=m(()=>{const e=this.account();return e?`Hallo ${Ot(e.salutation)} ${e.lastname}`:"Hallo Gast"}
1),this.showFlyout=v(!1),this.openFlyout=()=>this.showFlyout.set(!0),this.installationDate=m(()=>{const e=this.allOrders()[0]?.installation?.installationDate??null;return e?new Date(e):null}),this.handleCancelAppointment=()=>{this.loadingCancelAppointment.set(!0);const e=this.selectedOrderForCancellation();if(!e?.id){console.error("No order ID available for cancelling appointment"),this.loadingCancelAppointment.set(!1);return}this.payloadService.cancelAppointment({orderId:e.id}).subscribe({next:()=>{this.loadingCancelAppointment.set(!1),this.showCancelAppointmentModal.set(!1);const t=this.selectedOrderForCancellation();if(this.selectedOrderForCancellation.set(null),!t)return;const n=I(t);this.router.navigate([n.primaryHref],{queryParams:M(t,n)})},error:t=>{console.error("Failed to cancel appointment:",t),this.loadingCancelAppointment.set(!1),this.errorCancelAppointment.set("Es gab ein Problem bei der Terminbuchung. Bitte kontaktieren Sie den Support.")}})},this.daysUntilInstallation=m(()=>{const e=this.installationDate();if(!e)return null;const t=new Date(e),n=new Date,i=t.getTime()-n.getTime(),p=Math.ceil(i/(1e3*60*60*24));return p>0?p:0}),this.formattedInstallationDate=m(()=>N(this.installationDate()??"")),this.handleFastLane=e=>{const t=e??this.allOrders()[0];if(!t){console.error("No order available for fast lane");return}const n=I(t);if(n.showFastLane){if(this.isDemoMode){console.warn("Fast lane is not available in demo mode."),this.router.navigate([n.primaryHref],{queryParams:{...M(t,n),goto:"installation"}});return}this.payloadService.setCurrentStep({currentStep:9,orderId:t.id}).subscribe({next:()=>{this.router.navigate([n.primaryHref],{queryParams:M(t,n)})},error:i=>{console.error("Failed to update step:",i)}})}},this.demoLinks=m(()=>{const e=this.allOrders()[0],t=e?.id,n=t?{orderId:t}:{};return[...(e?I(e):null)?.requiresEhba!==!1?[{label:"Mehr über den eHBA Ausweis erfahren ",href:"/portal/onboarding",queryParams:n}]:[],{label:"Mehr über den SMC-B Ausweis erfahren",href:"/portal/onboarding",queryParams:{...n,goto:"smcb"}},{label:"Sehen Sie sich den Installationsprozess an",href:"/portal/onboarding",queryParams:{...n,goto:"installation"}},{label:"Jetzt die Installations-Checkliste ansehen",href:"/portal/checklist"}]}),this.route.queryParams.subscribe(e=>{e.orderSuccess==="true"&&(this.showOrderSuccessModal.set(!0),this.router.navigate([],{relativeTo:this.route,queryParams:{orderSuccess:null},queryParamsHandling:"merge",replaceUrl:!0}))})}failedDebitBannerText(e){return`Die letzte Abbuchung für Ihre IK-Nummer ${e.ikNumber} war leider nicht möglich. Die hinterlegte Zahlungsart konnte nicht belastet werden. Der offene Betrag wird beim nächsten Zahlungslauf erneut mit der hinterlegten Zahlungsart berücksichtigt. Bitte prüfen und aktualisieren Sie ggf. Ihre Zahlungsdaten.`}getCurrentStepForOrderReactive(e){return this.orderSteps().get(e)??0}getOrderPortalFlow(e){return I(e)}shouldSpanFullInstallationTile(e,t){return!t.showRefinancingTile||this.getCurrentStepForOrderReactive(e.id)>16||!Vt(e)}getOrderPortalQueryParams(e,t){return M(e,t)}getOnboardingTeaser(e,t){const n=$(this.onboarding(),t.professionalGroupCategory),i=this.getOrderPortalFlow(t);return e>0&&e<=3?i.requiresEhba?{title:n?.step1?.subStep1?.headline||"",text:n?.step1?.subStep1?.text||"",image:"/teaser-ehba.svg"}:{title:n?.step2?.subStep1?.headline||"",text:n?.step2?.subStep1?.text||"",image:"/teaser-smcb.svg"}:e>3&&e<=7?{title:n?.step2?.subStep1?.headline||"",text:n?.step2?.subStep1?.text||"",image:"/teaser-smcb.svg"}:e>7?{title:n?.step3?.subStep1?.headline||"",text:n?.step3?.subStep1?.text||"",image:"/teaser-installation.svg"}:null}getPortalTile1Label(e){return e.requiresEhba?this.portal()?.tile1||"":"Ich habe meinen SMC-B Ausweis noch nicht"}getPortalTile2Label(e){return e.requiresEhba?this.portal()?.tile2||"":"Ich habe meinen SMC-B Ausweis bereits erhalten"}shouldShowVivaDiscountRecommendation(){return!!this.getVivaDiscountEligibleOrder()&&!this.vivaDiscountEmailSent()}getVivaDiscountEligibleOrder(){const e=["logopadie","ergotherapie","physiotherapie","podologie"];return this.allOrders().find(t=>t.practiceSoftware!=="Optica Viva"&&!t.vivaDiscountRequested&&e.includes(t.professionalGroup.toLowerCase()))}getPortalFlyoutText(){return Ht(this.portal()?.flyout?.flyoutText)}get daysUntilInstallationLabel(){const e=this.daysUntilInstallation();return`Noch ${e} ${e===1?"Tag":"Tage"} bis zur Installation`}orderHasPlusSupport(e){return mt(e)}getAppointmentTileSubTitle(e){return this.orderHasPlusSupport(e)?"Plus Support Termin":"Installationstermin"}getPendingAppointmentTileText(e){return this.orderHasPlusSupport(e)?"Anfrage zum Plus Support Termin ist noch nicht bestätigt.":"Anfrage zum Installationstermin ist noch nicht bestätigt."}getAppointmentTileText(e){return this.orderHasPlusSupport(e)?`Ihr Termin zum Plus Support ist am ${this.getFormattedInstallationDate(e)}`:`Ihr Installationstermin ist am ${this.getFormattedInstallationDate(e)}`}getDaysUntilInstallationLabel(e){const t=this.getDaysUntilInstallation(e),n=t===1?"Tag":"Tage";return this.orderHasPlusSupport(e)?`Noch ${t} ${n} bis zum Plus Support`:`Noch ${t} ${n} bis zur Installation`}onVivaCheckboxChange(e){this.requestVivaDiscount.set(e),e&&this.vivaDiscountCheckboxError.set(null)}handleVivaPrimaryClick(){if(this.loadingVivaDiscountEmail())return;if(!this.requestVivaDiscount()){this.vivaDiscountCheckboxError.set("Bitte aktivieren Sie die Checkbox, um die Rabattinformationen zu erhalten.");return}const e=this.getVivaDiscountEligibleOrder()?.id;if(!e){this.vivaDiscountCheckboxError.set("Es wurde keine Bestellung gefunden.");return}this.loadingVivaDiscountEmail.set(!0),this.vivaDiscountCheckboxError.set(null),this.payloadService.sendVivaDiscountEmail({orderId:e}).subscribe({next:()=>{this.loadingVivaDiscountEmail.set(!1),this.vivaDiscountEmailSent.set(!0),this.notificationService.show("Die Informationen zum Rabattangebot wurden per E-Mail versendet.","success")},error:t=>{if(console.error("Failed to send Viva discount email:",t),this.loadingVivaDiscountEmail.set(!1),t?.status===409){this.vivaDiscountCheckboxError.set("Die Rabattinformationen wurden für diese Bestellung bereits angefordert.");return}this.vivaDiscountCheckboxError.set("Die E-Mail konnte nicht versendet werden. Bitte versuchen Sie es erneut.")}})}getCurrentStepForOrder(e){const t=this.stepSyncService.getCurrentStep(),n=e.currentStep??0;return Math.max(t,n)}getInstallationDateForOrder(e){const t=e.installation?.installationDate??null;return t?new Date(t):null}hasPendingInstallationRequest(e){return R(e.professionalGroupCategory)&&!!e.installation?.desiredDate&&!e.installation?.installationDate}getDaysUntilInstallation(e){const t=this.getInstallationDateForOrder(e);if(!t)return null;const n=new Date(t),i=new Date,p=n.getTime()-i.getTime(),g=Math.ceil(p/(1e3*60*60*24));return g>0?g:0}getFormattedInstallationDate(e){return N(this.getInstallationDateForOrder(e)??"")}};S.ɵfac=function(t){return new(t||S)},S.ɵcmp=Q({type:S,selectors:[["app-portal"]],decls:23,vars:19,consts:[[1,"flex","min-h-[50vh]","items-center","justify-center"],[3,"closed","open","title"],[1,"whitespace-pre-line"],[1,"mt-6","grid","grid-cols-2","gap-2"],[3,"action","variant","fullWidth"],[3,"action","variant","fullWidth","loading"],[1,"mt-2","text-xs","text-red-500"],[3,"closed","open","type","title"],[1,"mb-6","text-gray-700"],[1,"flex","justify-end"],[3,"action","variant"],[3,"innerHTML"],[1,"relative"],[1,"col-span-full",3,"subTitle","title"],[1,"col-span-full","mt-24",3,"tag","size"],[1,"col-span-full"],[1,"mt-20","block"],[1,"col-span-full","mb-10","flex","flex-col","gap-4"],[1,"col-span-full","md:col-span-4",3,"label","href","size"],[1,"col-span-full",3,"title","text","link"],[1,"col-span-full","grid","h-full","grid-cols-subgrid","gap-4","overflow-hidden","rounded-3xl","bg-neutral-100","p-2"],[1,"col-span-full","p-5","lg:p-10"],[3,"order"],[3,"color","subTitle","title","text","ngClass"],[3,"href","iconPosition","icon"],[3,"variant"],[3,"ngClass"],[3,"label","href","queryParams"],[1,"col-span-full",3,"mt-6"],[1,"col-span-full","grid","grid-cols-subgrid","gap-4"],[3,"href","title","text","image","label","queryParams"],[1,"col-span-full","md:col-span-4",3,"label","href","queryParams"],[1,"col-span-full","md:col-span-4",3,"label"],["aria-haspopup","dialog",1,"col-span-full","md:col-span-4",3,"label","color","icon"],[1,"col-span-full","md:col-span-4",3,"action","label"],["aria-haspopup","dialog",1,"col-span-full","md:col-span-4",3,"action","label","color","icon"],[1,"col-span-full",3,"title","badge","text","image","additionalText"],[1,"mb-6"],["
1id","viva-discount-checkbox",3,"ngModelChange","ngModel","error"],[1,"flex","flex-wrap","gap-4"],[3,"action","label","variant","loading"],[1,"relative","mt-4","block","text-sm"],[1,"flex","flex-col","gap-6"],[1,"flex","flex-col","gap-4","max-md:hidden","md:flex-row","md:items-center"],[1,"flex","size-10","shrink-0","items-center","justify-center","rounded-full","bg-brand-300","text-base"],["src","/icons/checkmark.svg","alt","Pfeil Icon",1,"size-5"],[1,"text-xl"],[1,"flex","flex-col","justify-between","gap-2","md:flex-row","md:items-center"],[1,"flex","items-center","gap-4","text-xl"],[1,"flex","size-10","shrink-0","items-center","justify-center","rounded-full","border","border-neutral-500","text-base","max-md:hidden"],[3,"href","variant","icon","iconPosition","queryParams"]],template:function(t,n){if(t&1&&(f(0,"app-header"),r(1,"div"),C(2,Zt,2,0,"div",0)(3,be,11,10),l(),f(4,"app-notification"),r(5,"app-modal",1),b("closed",function(){return n.showCancelAppointmentModal.set(!1),n.selectedOrderForCancellation.set(null)}),r(6,"p",2),d(7),l(),r(8,"div",3)(9,"app-button",4),b("action",function(){return n.showCancelAppointmentModal.set(!1)}),d(10," Nein "),l(),r(11,"app-button",5),b("action",function(){return n.handleCancelAppointment()}),d(12," Ja "),l()(),C(13,ve,2,1,"p",6),l(),r(14,"app-modal",7),b("closed",function(){return n.showOrderSuccessModal.set(!1)}),r(15,"p",8),d(16,"Ihre Bestellung wurde erfolgreich aufgegeben."),l(),r(17,"div",9)(18,"app-button",10),b("action",function(){return n.showOrderSuccessModal.set(!1)}),d(19," Verstanden "),l()()(),r(20,"app-flyout",1),b("closed",function(){return n.showFlyout.set(!1)}),f(21,"div",11),at(22,"safeHtml"),l()),t&2){let i,p;a(2),_(n.loadingOrders()||n.loadingOnboarding()||n.loadingCustomers()?2:3),a(3),c("open",n.showCancelAppointmentModal())("title",n.cancelAppointmentModalTitle()),a(2),x(" ",(i=(i=n.cancelAppointmentOnboardingContent())==null||i.step3==null||i.step3.subStep4==null||i.step3.subStep4.cancelationModal==null?null:i.step3.subStep4.cancelationModal.text)!==null&&i!==void 0?i:""," "),a(2),c("variant","secondary")("fullWidth",!0),a(2),c("variant","primary")("fullWidth",!0)("loading",n.loadingCancelAppointment()),a(2),_(n.errorCancelAppointment()?13:-1),a(),c("open",n.showOrderSuccessModal())("type","success")("title","Bestellung erfolgreich"),a(4),c("variant","primary"),a(2),c("open",n.showFlyout())("title",((p=n.portal())==null||p.flyout==null?null:p.flyout.flyoutTitle)||""),a(),c("innerHTML",lt(22,17,n.getPortalFlyoutText()),rt)}},dependencies:[nt,ot,ft,it,yt,Lt,bt,Et,Tt,_t,G,gt,z,W,St,Ct,vt,ht,Pt,zt,xt,pt,dt,ut],encapsulation:2});let j=S;export{j as default};
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.