1import{a as T,b as O}from"./chunk-SFLQE3S3.js";import{a as M}from"./chunk-4QSX2ID2.js";import{a as A}from"./chunk-5Z5BMIEK.js";import"./chunk-F7WEC35K.js";import"./chunk-2ZFGFKD3.js";import"./chunk-CCJQNZRA.js";import"./chunk-XI55ZHLP.js";import"./chunk-SPBN5SGA.js";import"./chunk-SQFNQB4W.js";import"./chunk-7UZYWCAJ.js";import"./chunk-CVTPZEQL.js";import"./chunk-M5KMMXMR.js";import{D as F,c as S,g as j,k as E,o as R,p as V}from"./chunk-VJSDRMDF.js";import"./chunk-A6E4KNWS.js";import"./chunk-BKZ3NTEO.js";import"./chunk-4O3FVBGX.js";import"./chunk-7HOM3374.js";import"./chunk-QEIEQV3T.js";import{c as _,e as L,f as D}from"./chunk-NPEBVN6N.js";import"./chunk-EDKQWKB2.js";import"./chunk-TFMCKN6Q.js";import"./chunk-K4JYZJ73.js";import{$b as u,Bd as w,Cc as C,Fc as s,Hc as c,K as p,N as v,Tc as I,Vb as k,Wb as x,Xb as b,Yb as l,Zb as o,_b as n,db as i,oc as y,pb as d,qc as B,wb as g}from"./chunk-6LRC7VF4.js";import{a as f,b as h}from"./chunk-ODN5LVDJ.js";function q(a,P){if(a&1&&(o(0,"label",10),u(1,"input",11),o(2,"div",12)(3,"div",13)(4,"p",14),s(5),n(),o(6,"p",15),s(7),n()(),o(8,"span",16),s(9),n()()()),a&2){let e=P.$implicit,t=B();C("active",t.instantBook.value===e.value),i(),l("value",e.value)("formControl",t.instantBook),i(4),c(" ",e.key.name," "),i(2),c(" ",e.key.desc," "),i(2),c(" ",e.key.icon," ")}}var W=(()=>{class a{constructor(e,t,r,m){this.hs=e,this.route=t,this.router=r,this.cdr=m,this.instantBook=new E(null),this.progress=0,this.isLoading=!1,this.instantBookingOptions=[{key:{name:"Instant Booking",desc:"Guests can reserve the apartment instantly.",icon:"quickreply"},value:!0},{key:{name:"Booking Approval",desc:"You are required to confirm each reservation.",icon:"approval_delegation"},value:!1}]}ngOnInit(){this.id=this.route.snapshot.paramMap.get("id"),this.progress=this.hs.progress.getValue().progress??0,this.loadListingData()}loadListingData(){this.hs.getListingByListingId(this.id).pipe(p(1)).subscribe(e=>{this.listingData=e.data?.[0],this.instantBook.setValue(this.listingData?.instantBook??null),this.cdr.detectChanges()})}submit(){if(this.instantBook.value===null)return;let e=h(f({},this.listingData),{id:this.id,instantBook:this.instantBook.value,lastCompletedStep:"instant-book"});delete e._id,this.isLoading=!0,this.hs.updateListing(e).pipe(p(1),v(()=>{this.isLoading=!1,this.cdr.detectChanges()})).subscribe({next:t=>{t?.success&&this.router.navigate([`/become-a-host/${this.id}/legal`]),this.cdr.detectChanges()}})}static{this.\u0275fac=function(t){return new(t||a)(d(A),d(_),d(L),d(w))}}static{this.\u0275cmp=g({type:a,selectors:[["app-instant-book"]],decls:14,vars:6,consts:[[1,"flex","flex-col","h-full"],[1,"grow","overflow-auto","scroller","flex","h-full","flex-col"],[1,"max-w-[650px]","w-full","p-5","mx-auto","my-auto"],[1,"md:text-3xl","text-2xl","fr-semibold","mb-5"],[1,"flex","flex-col","gap-5"],[1,"radio-container","border","rounded-lg","p-5","w-full","h-full","hover:border-secondary",3,"active"],["styleClass","h-[6px] rounded-none custom-progress-bar",3,"value","showValue"],[1,"p-5","flex","items-center","justify-between","gap-2"],[1,"underline",3,"routerLink"],[1,"livjaza-secondary-btn","xs","!px-6",3,"click","disabled"],[1,"radio-container","border","rounded-lg","p-5","w-full","h-full","hover:border-secondary"],["type","radio",1,"radio-input",3,"value","formControl"],[1,"w-full","h-full","flex","justify-between"],[1,"basis-3/4","text-left"],[1,"f-medium"],[1,"text-grey_2","mb-0"],[1,"material-symbols-outlined","text-3xl"]],template:function(t,r){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),s(4,"How would you like to accept bookings?"),n(),o(5,"div",4),x(6,q,10,7,"label",5,k),n()()(),u(8,"p-progressBar",6),o(9,"div",7)(10,"a",8),s(11," Back "),n(),o(12,"button",9),y("click",function(){return r.submit()}),s(13," Next "),n()()()),t&2&&(i(),l("@slideUp",void 0),i(5),b(r.instantBookingOptions),i(2),l("value",r.progress)("showValue",!1),i(2),l("routerLink",I("/become-a-host/",r.id,"/price")),i(2),l("disabled",r.isLoading))},dependencies:[F,S,R,j,V,O,T,D],encapsulation:2,data:{animation:[M]}})}}return a})();export{W as InstantBookComponent};
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.