1import{a as Ge}from"./chunk-JTVVY34Q.js";import{a as we}from"./chunk-F6ZRODMH.js";import{a as Pe,b as Fe}from"./chunk-KOD6QTLW.js";import{a as Jt,b as Oe}from"./chunk-Z33JMBVS.js";import{a as Le}from"./chunk-YJDFXJBI.js";import"./chunk-GTRV2NJH.js";import{c as Ve,d as Ue,g as De}from"./chunk-IX5QV3BJ.js";import{a as Ae}from"./chunk-ZG4JAB52.js";import"./chunk-XO2KVCBM.js";import{a as Te,b as ke,c as Se,d as xe}from"./chunk-QFVAARMX.js";import{a as Me}from"./chunk-VKB72DDB.js";import"./chunk-XQUHACBD.js";import{a as Et}from"./chunk-FGEY6CG6.js";import{a as ft,b as yt}from"./chunk-RGWY7DUH.js";import{a as Ot,b as Mt}from"./chunk-Z2IAHMJT.js";import{a as gt,b as bt,d as ht,e as at}from"./chunk-PWLZ2ZRD.js";import{Ea as Z,n as Ee,p as Qt,za as Ne}from"./chunk-YTPFNMSR.js";import{a as lt,b as rt,c as ct}from"./chunk-SH34JIJT.js";import"./chunk-HXW4LVW2.js";import"./chunk-Z5RTGFEY.js";import{e as vt,f as be,m as he}from"./chunk-7A7QN4YY.js";import{b as Re}from"./chunk-QXWFDMGF.js";import{c as $e}from"./chunk-PRE65M4F.js";import{H as Rt,b as ve,ca as ot,ga as R}from"./chunk-54K5WGPR.js";import"./chunk-BPGDPSCA.js";import{b as Xt,c as Ce,g as _t,h as dt,i as mt,j as ut,k as pt,l as Be,o as Ie,p as Lt,v as st}from"./chunk-TGKK4UVP.js";import"./chunk-PAQWCVTI.js";import{d as it}from"./chunk-ITFI6T7C.js";import{a as nt,b as fe,c as ye}from"./chunk-AEXWRKEW.js";import"./chunk-AFU2JXOO.js";import{b as Q,d as X,e as J}from"./chunk-VS7VC733.js";import{B as j,k as At,l as zt,m as z,q as ue,s as pe,v as jt,x as ge}from"./chunk-L7FXCJ4N.js";import{$c as Y,Aa as C,Ab as q,Ac as Bt,Ba as B,Bc as It,Cc as U,Dc as T,Ec as L,Fb as E,Fc as v,Gc as de,Ka as le,Lc as w,Mc as H,Nb as re,Nc as K,Pb as p,Sc as V,Tc as P,Uc as Dt,Vc as $t,Wc as Gt,Zc as k,_c as x,a as et,ac as d,b as kt,bc as m,cc as I,cd as qt,fc as W,g as ne,gc as D,i as G,ib as xt,jd as me,mc as A,n as St,nc as y,ob as c,qc as F,rc as Wt,sc as ce,tc as _e,ub as N,zc as Ct}from"./chunk-U5S5BM7F.js";var He=ne(ve());var Zt=class{constructor(u){this.apartmentId=u?.apartmentId||null,this.startDate=u?.startDate||null,this.endDate=u?.endDate||null,this.isForeigner=!!u?.isForeigner,this.paymentMethod=u?.paymentMethod||"\u039B\u03BF\u03B9\u03C0\u03BF\u03AF",this.platform=u?.platform||"\u03BB\u03BB\u03B5\u03C2 \u03C8\u03B7\u03C6\u03B9\u03B1\u03BA\u03AD\u03C2 \u03C0\u03BB\u03B1\u03C4\u03C6\u03CC\u03C1\u03BC\u03B5\u03C2",this.reservationId=u?.reservationId||null,this.amountReceived=u?.amountReceived||0,this.cancellationAmount=u?.cancellationAmount||0,this.cancellationDate=u?.cancellationDate||null,this.guestId=u?.guestId||null,this.guestName=u?.guestName||null,this.guestTaxId=u?.guestTaxId||null}initializeDataFromBookingObject(u){try{if(!u?.booking?.booking_id)return this;this.apartmentId=u.booking.aade_str_source_property_id?parseInt(u.booking.aade_str_source_property_id,10):null,this.startDate=u.booking.start_date_str?Qt(u.booking.start_date_str,"YYYY-MM-DD","DD/MM/YYYY"):null,this.endDate=u.booking.end_date_str?Qt(u.booking.end_date_str,"YYYY-MM-DD","DD/MM/YYYY"):null,this.isForeigner=!!u.booking.customer_is_foreigner,this.reservationId=(u.booking.booking_external_id||u.booking.booking_reference_id||u.booking.booking_id).toString();let i=u.booking.customer_tax_id||null;switch(i&&(i=i.replace(/\D/g,"")),this.guestTaxId=i,this.guestId=this.isForeigner?u.booking.customer_passport_number||u.booking.customer_identity_card_number||this.reservationId:i,this.guestName=u.booking.customer_fullname,u.booking.status==="canceled"?(this.amountReceived=null,this.cancellationAmount=u.booking.costs?.cancelation_policy_amount_collected?.amount_total_local||u.booking.costs?.cancelation_policy_amount_collected?.amount_total||u?.booking?.cancelation_policy_amount_collected_local||u?.booking?.cancelation_policy_amount_collected||null,this.cancellationDate=u.booking.canceled_at?Qt(u.booking.canceled_at,"YYYY-MM-DD","DD/MM/YYYY"):null):(this.amountReceived=u.booking.costs?.accommodation_amount_aade?.amount_total_local||u.booking.costs?.accommodation_amount_aade?.amount_total||u.booking.accommodation_amount_aade_local||u.booking.accommodation_amount_aade||null,this.cancellationAmount=null),u.booking.payment_method){case"bank_deposit":this.paymentMethod="\u039B\u03BF\u03B3\u03B1\u03C1\u03B9\u03B1\u03C3\u03BC\u03CC\u03C2 \u03A0\u03BB\u03B7\u03C1\u03C9\u03BC\u03CE\u03BD \u0397\u03BC\u03B5\u03B4\u03B1\u03C0\u03AE\u03C2";break;case"bank_deposit_int":this.paymentMethod="\u039B\u03BF\u03B3\u03B1\u03C1\u03B9\u03B1\u03C3\u03BC\u03CC\u03C2 \u03A0\u03BB\u03B7\u03C1\u03C9\u03BC\u03CE\u03BD \u0391\u03BB\u03BB\u03BF\u03B4\u03B1\u03C0\u03AE\u03C2";break;case"cash":this.paymentMethod="\u039C\u03B5\u03C4\u03C1\u03B7\u03C4\u03AC";break;case"other":this.paymentMethod="\u039B\u03BF\u03B9\u03C0\u03BF\u03AF";break;default:this.paymentMethod="\u039B\u03BF\u03B9\u03C0\u03BF\u03AF";break}switch(u.booking.booking_channel){case"airbnb.com":this.platform="Airbnb";break;case"booking.com":this.platform="Booking.com";break;case"clickstay":this.platform="Clickstay";break;case"only_apartments":this.platform="Only-apartments";break;case"tripadvisor":this.platform="TripAdvisor";break;default:this.platform="\u03BB\u03BB\u03B5\u03C2 \u03C8\u03B7\u03C6\u03B9\u03B1\u03BA\u03AD\u03C2 \u03C0\u03BB\u03B1\u03C4\u03C6\u03CC\u03C1\u03BC\u03B5\u03C2";break}if(!(0,He.isEmpty)(this))for(let o in this)this[o]===null&&delete this[o];return this}catch{return this}}};function mi(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.STR_REGISTRY.SUBMIT_BOOKING_AS_DRAFT")," "))}function ui(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.STR_REGISTRY.SUBMIT_BOOKINGS_AS_DRAFT")," "))}function pi(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.VAT")," "))}function gi(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.PASSPORT_NUMBER")," "))}
1function bi(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=y().$implicit;c(),v(" ",(i.str_registry_submission_record==null?null:i.str_registry_submission_record.guestTaxId)||"-"," ")}}function hi(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=y().$implicit;c(),v(" ",(i.str_registry_submission_record==null?null:i.str_registry_submission_record.guestId)||"-"," ")}}function fi(n,u){if(n&1&&(d(0,"div",24)(1,"label",38),T(2),m(),d(3,"p",39),I(4,"app-price-format",40),m()()),n&2){let i=y().$implicit;c(2),v(" ",(i.costs==null||i.costs.accommodation_amount_aade==null?null:i.costs.accommodation_amount_aade.label)||"Accommodation amount (AADE)"," "),c(2),p("value",(i.str_registry_submission_record==null?null:i.str_registry_submission_record.amountReceived)||0)}}function yi(n,u){if(n&1&&(d(0,"div",24)(1,"label",35),T(2),m(),d(3,"p",41),I(4,"app-price-format",40),m()()),n&2){let i=y().$implicit;c(2),v(" ",(i.costs==null||i.costs.cancelation_policy_amount_collected==null?null:i.costs.cancelation_policy_amount_collected.label)||"Total amount collected based on the cancelation policy"," "),c(2),p("value",(i.str_registry_submission_record==null?null:i.str_registry_submission_record.cancellationAmount)||0)}}function Ti(n,u){if(n&1&&(d(0,"div",24)(1,"label",35),T(2),k(3,"translate"),m(),d(4,"p",41),T(5),k(6,"date"),m()()),n&2){let i=y().$implicit;c(2),v(" ",x(3,2,"GENERIC.LABELS.DATE.CANCELATION_DATE")," "),c(3),v(" ",i.canceled_at?Y(6,4,i.canceled_at,"yyyy-MM-dd"):"-"," ")}}function ki(n,u){if(n&1&&(d(0,"div",21)(1,"div",22)(2,"div",23)(3,"div",5)(4,"div",24)(5,"label",25),T(6),k(7,"translate"),m(),d(8,"p",26),T(9),m()(),d(10,"div",24)(11,"label",27),T(12),k(13,"translate"),m(),d(14,"p",28),T(15),m()(),d(16,"div",24)(17,"label",27),T(18),k(19,"translate"),m(),d(20,"p",28),T(21),m()(),d(22,"div",24)(23,"label",27),E(24,pi,3,3,"span",12)(25,gi,3,3,"span",12),m(),d(26,"p",28),E(27,bi,2,1,"span",12)(28,hi,2,1,"span",12),m()(),d(29,"div",24)(30,"label",29),T(31),k(32,"translate"),m(),d(33,"p",30),T(34),m()(),d(35,"div",24)(36,"label",31),T(37),k(38,"translate"),m(),d(39,"p",32),T(40),m()(),d(41,"div",24)(42,"label",33),T(43),k(44,"translate"),m(),d(45,"p",34),T(46),m()(),d(47,"div",24)(48,"label",35),T(49),k(50,"translate"),m(),d(51,"p",36),T(52),m()(),E(53,fi,5,2,"div",37)(54,yi,5,2,"div",37)(55,Ti,7,7,"div",37),m()()()()),n&2){let i=u.$implicit;c(6),v(" ",x(7,21,"GENERIC.LABELS.PROPERTY_NAME")," "),c(3),v(" ",i.service_title," "),c(3),v(" ",x(13,23,"COMPONENTS.SERVICES.SERVICE_ACCOMMODATION.PROPERTY_DETAILS.REGISTRATION_NUMBER")," "),c(3),v(" ",i.service_license_number_value||"-"," "),c(3),v(" ",x(19,25,"COMPONENTS.BOOKINGS_TABLE.GUEST")," "),c(3),v(" ",(i.str_registry_submission_record==null?null:i.str_registry_submission_record.guestName)||"-"," "),c(3),p("ngIf",!i.customer_is_foreigner),c(),p("ngIf",i.customer_is_foreigner),c(2),p("ngIf",!i.customer_is_foreigner),c(),p("ngIf",i.customer_is_foreigner),c(3),v(" ",x(32,27,"COMPONENTS.BOOKINGS_TABLE.CHECK_IN")," "),c(3),v(" ",i.start_date_str," "),c(3),v(" ",x(38,29,"COMPONENTS.BOOKINGS_TABLE.CHECK_OUT")," "),c(3),v(" ",i.end_date_str," "),c(3),v(" ",x(44,31,"GENERIC.LABELS.BOOKING_CHANNEL")," "),c(3),v(" ",i.str_registry_booking_channel_label||"-"," "),c(3),v(" ",x(50,33,"GENERIC.LABELS.PAYMENTS.PAYMENT_METHOD")," "),c(3),v(" ",i.str_registry_payment_method_label||"-"," "),c(),p("ngIf",i.status==="confirmed"),c(),p("ngIf",i.status==="canceled"),c(),p("ngIf",i.status==="canceled")}}function Si(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),L(x(2,1,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SUBMIT_TO_AADE")))}function xi(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),L(x(2,1,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SUBMIT_TO_AADE_AS_DRAFT")))}var Ke=(()=>{class n{constructor(i,o,e,l,t,_){this.http=i,this.router=o,this.bsModalRef=e,this.spinner=l,this.utilsService=t,this.translate=_,this.isSubmittingBookingsToAADEStrRegistry=!1,this.spinnerName="bookingsSubmitToAADEStrRegistryLoadingSpinner"}ngOnInit(){return G(this,null,function*(){if(this.draftUpload=!1,this.bookings_obj={ready_for_submission:[],require_data:[],invalid_data:[]},yield this.defineBookingsValidityForAADEStrRegistry(),this.bookings_obj.ready_for_submission?.length)for(let i of this.bookings_obj.ready_for_submission)i.str_registry_submission_record=new Zt,i.str_registry_submission_record=i.str_registry_submission_record.initializeDataFromBookingObject({booking:i}),i.str_registry_booking_channel_label=this.utilsService.getBookingAADEStrBookingChannelLabel({aade_str_submission_booking_channel:i.str_registry_submission_record?.platform||null}),i.str_registry_payment_method_label=this.utilsService.getBookingAADEStrPaymentMethodLabel({payment_method:i.str_registry_submission_record?.paymentMethod||null});R.production||console.log(this.bookings_obj)})}submit(){return G(this,null,function*(){try{let i=this.bookings.map(a=>a.booking_id);if(!i?.length)return Promise.resolve();let o=i.length===1?yield this.translate.get("VIEWS.STR_REGISTRY.ALERT_SUBMIT_BOOKINGS_QUESTION").toProm
1ise():yield this.translate.get("VIEWS.STR_REGISTRY.ALERT_SUBMIT_BOOKINGS_QUESTION_MULTIPLE").toPromise(),e={title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:o,icon:"question",reverseButtons:!0,showCancelButton:!0,cancelButtonText:yield this.translate.get("GENERIC.LABELS.ACTIONS.CANCEL").toPromise(),confirmButtonText:yield this.translate.get("GENERIC.LABELS.YES").toPromise(),focusCancel:!0};if((yield this.utilsService.showAlert(e)).isDismissed)return Promise.resolve();this.isSubmittingBookingsToAADEStrRegistry=!0,this.spinner.show(this.spinnerName);let t=yield this.http.post(`${R.params.host}/api/str-registry/bookings-submit`,{booking_ids:i,draft_upload:!!this.draftUpload}).toPromise();this.isSubmittingBookingsToAADEStrRegistry=!1,this.spinner.hide(this.spinnerName);let _=i.length===1?yield this.translate.get("VIEWS.STR_REGISTRY.ALERT_BOOKING_SUBMITTED").toPromise():yield this.translate.get("VIEWS.STR_REGISTRY.ALERT_BOOKING_SUBMITTED_MULTIPLE").toPromise(),g=yield this.utilsService.showAlert({title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:_,icon:"success",timer:3500,showConfirmButton:!1});this.bsModalRef.content.result=t,this.bsModalRef.hide()}catch(i){R.production||console.log(i),this.isSubmittingBookingsToAADEStrRegistry=!1,this.spinner.hide(this.spinnerName)}})}defineBookingsValidityForAADEStrRegistry(){return G(this,null,function*(){return this.bookings_obj.ready_for_submission=this.utilsService.lodash.filter(this.bookings,i=>i.is_valid_for_submission===!0),this.bookings_obj.require_data=this.utilsService.lodash.filter(this.bookings,i=>!i.is_valid_for_submission&&i?.submission_validity_meta?.errors?.length&&i.submission_validity_meta.errors.map(o=>o.value).some(o=>o.indexOf("missing")>-1)),this.bookings_obj.invalid_data=this.utilsService.lodash.filter(this.bookings,i=>!i.is_valid_for_submission&&i?.submission_validity_meta?.errors?.length&&i.submission_validity_meta.errors.map(o=>o.value).some(o=>o.indexOf("missing")===-1)),Promise.resolve()})}onDraftUploadValueChange(i){this.draftUpload=!!i?.target?.checked,console.log(this.draftUpload),console.log(i)}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(vt),N(nt),N(lt),N(Z),N(Q))}}static{this.\u0275cmp=q({type:n,selectors:[["app-bookings-submit-to-aade-str-registry-modal"]],decls:33,vars:18,consts:[["bookingsSubmitToAADEStrRegistryForm","ngForm"],["id","bookingsSubmitToAADEStrRegistryForm","autocomplete","off",3,"ngSubmit"],[1,"modal-header","bg-tourmie-blue"],[1,"modal-title","pull-left","line-clamp-1"],[1,"modal-body","overflow-y-auto"],[1,"row"],[1,"col-12"],[1,"text-muted"],[1,"form-group"],[1,"icheck-tourmie-blue","icheck-tourmie-rounded"],["type","checkbox","id","draftUpload","name","draftUpload",3,"change"],["for","draftUpload",1,"mb-1"],[4,"ngIf"],["class","col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12",4,"ngFor","ngForOf"],[1,"modal-footer","bg-white"],[1,"row","w-100"],[1,"col-6"],["type","button","role","button",1,"btn","btn-outline-danger",3,"click","disabled"],[1,"col-6","text-right"],["type","submit","role","button",1,"btn","btn-tourmie-blue",3,"disabled","ladda"],["color","#27a9e0","type","ball-scale-multiple",3,"name"],[1,"col-12","col-sm-12","col-md-12","col-lg-12","col-xl-12"],[1,"card","card-dashed","card-aade-str-booking-to-submit"],[1,"card-body","pt-3","pb-0"],[1,"col-12","col-sm-12","col-md-6","col-lg-6","col-xl-6","col-xxl-6"],["for","bookingPropertyTitle",1,"mb-0","font-size-14","line-clamp-1"],["id","bookingPropertyTitle",1,"mb-3","font-size-14","line-clamp-1"],["for","bookingPropertyRegistrationNumberValue",1,"mb-0","font-size-14","line-clamp-1"],["id","bookingPropertyRegistrationNumberValue",1,"mb-3","font-size-14"],["for","bookingStartDate",1,"mb-0","font-size-14","line-clamp-1"],["id","bookingStartDate",1,"mb-3","font-size-14"],["for","bookingEndDate",1,"mb-0","font-size-14","line-clamp-1"],["id","bookingEndDate",1,"mb-3","font-size-14"],["for","bookingChannel",1,"mb-0","font-size-14","line-clamp-1"],["id","bookingChannel",1,"mb-3","font-size-14","line-clamp-1"],["for","cancelationPolicyAmountCollected",1,"mb-0","font-size-14","line-clamp-1"],["id","cancelationPolicyAmountCollected",1,"mb-3","font-size-14","line-clamp-1"],["class","col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6",4,"ngIf"],["for","accommodationAmountAADE",1,"mb-0","font-size-14","line-clamp-1"],["id","accommodationAmountAADE",1,"mb-3","font-size-14"],[3,"value"],["id","cancelationPolicyAmountCollected",1,"mb-3","font-size-14"]],template:function(o,e){if(o&1){let l=D();d(0,"form",1,0),A("ngSubmit",function(){return C(l),B(e.submit())}),d(2,"div",2)(3,"h5",3),T(4),k(5,"translate"),m()(),d(6,"div",4)(7,"div",5)(8,"div",6)(9,"p",7),T(10),k(11,"translate"),m()()(),d(12,"div",5)(13,"div",6)(14,"div",8)(15,"div",9)(16,"input",10),A("change",function(_){return C(l),B(e.onDraftUploadValueChange(_))}),m(),d(17,"label",11),E(18,mi,3,3,"span",12)(19,ui,3,3,"span",12),m()()()()(),d(20,"div",5),E(21,ki,56,35,"div",13),m()(),d(22,"div",14)(23,"div",15)(24,"div",16)(25,"button",17),A("click",function(){return C(l),B(e.bsModalRef.hide())}),T(26),k(27,"translate"),m()(),d(28,"div",18)(29,"button",19),E(30,Si,3,3,"span",12)(31,xi,3,3,"span",12),m()()()()(),I(32,"ngx-spinner",20)}if(o&2){let l=U(1);c(4),v(" ",x(5,12,"VIEWS.STR_REGISTRY.BOOKING_SUBMISSIONS_TO_THE_AADE_REGISTRY")," "),c(6),v(" ",x(11,14,"VIEWS.STR_REGISTRY.BOOKING_SUBMISSIONS_REVIEW_AND_SUBMIT")," "),c(8),p("ngIf",(e.bookings_obj==null||e.bookings_obj.ready_for_submission==null?null:e.bookings_obj.ready_for_submission.length)===1),c(),p("ngIf",(e.bookings_obj==null||e.bookings_obj.ready_for_submission==null?null:e.bookings_obj.ready_for_submission.length)>1),c(2),p("ngForOf",e.bookings_obj.ready_for_submission),c(4),p("disabled",e.isSubmittingBookingsToAADEStrRegistry),c(),v(" ",x(27,16,"GENERIC.BUTTONS.CANCEL")," "),c(3),p("disabled",l.invali
1d||e.isSubmittingBookingsToAADEStrRegistry)("ladda",e.isSubmittingBookingsToAADEStrRegistry),c(),p("ngIf",!e.draftUpload),c(),p("ngIf",e.draftUpload),c(),p("name",e.spinnerName)}},dependencies:[j,zt,z,jt,st,pt,dt,mt,J,X,at,yt,ft,ct,rt,Me],styles:["#bookingsSubmitToAADEStrRegistryForm[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:calc(100vh - 170px)!important;height:calc(100vh - 170px)!important}"]})}}return n})();var vi=n=>({bookings_count:n});function Ri(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.BOOKINGS.UPDATE_PAYMENT_METHOD_OF_SELECTED_BOOKING_TO")," "))}function Ei(n,u){if(n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2){let i=y();c(),v(" ",Y(2,1,"VIEWS.BOOKINGS.UPDATE_PAYMENT_METHOD_OF_SELECTED_N_BOOKINGS_TO",P(4,vi,(i.bookings==null?null:i.bookings.length)||0))," ")}}function Ci(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function Bi(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function Ii(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",12),m()),n&2&&(c(),p("type","input_invalid"))}function Ni(n,u){if(n&1&&(d(0,"small",24),E(1,Ii,2,1,"span",9),m()),n&2){y();let i=U(20);c(),p("ngIf",i.errors.required)}}var Ye=(()=>{class n{constructor(i,o,e,l,t,_){this.http=i,this.router=o,this.bsModalRef=e,this.spinner=l,this.utilsService=t,this.translate=_,this.bookingAADEStrRegistryPaymentMethodOptions=R.booking_params.payment_methods_aade.list,this.bookingPaymentMethodOptions=R.booking_params.payment_methods.list,this.selectedAADEStrPaymentMethod=null,this.selectedPaymentMethod=null,this.isUpdatingBookingsPaymentMethod=!1,this.spinnerName="bookingsPaymentMethodUpdateLoadingSpinner"}ngOnInit(){if(this.bookings?.length===1&&this.bookings[0].payment_method){this.selectedPaymentMethod=this.bookings[0].payment_method;let i=this.utilsService.getBookingAADEStrPaymentMethodValueFromTourmiePaymentMethod({payment_method:this.selectedPaymentMethod});this.selectedAADEStrPaymentMethod=i||null,this.selectedAADEStrPaymentMethod||(this.selectedPaymentMethod=null)}}updateBookingsPaymentMethods(){return G(this,null,function*(){try{let i=this.bookings.map(a=>a.booking_id);if(!i?.length)return this.utilsService.showToast({message:yield this.translate.get("VIEWS.STR_REGISTRY.NO_BOOKINGS_TO_UPDATE").toPromise(),type:"info"}),Promise.resolve();let o=i.length===1?yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_PAYMENT_METHOD_QUESTION").toPromise():yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_PAYMENT_METHOD_QUESTION_MULTIPLE").toPromise(),e={title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:o,icon:"question",reverseButtons:!0,showCancelButton:!0,cancelButtonText:yield this.translate.get("GENERIC.LABELS.ACTIONS.CANCEL").toPromise(),confirmButtonText:yield this.translate.get("GENERIC.LABELS.YES").toPromise(),focusCancel:!0};if((yield this.utilsService.showAlert(e)).isDismissed)return Promise.resolve();this.isUpdatingBookingsPaymentMethod=!0,this.spinner.show(this.spinnerName);let t=yield this.http.post(`${R.params.host}/api/bookings-mass-payment-method-update`,{booking_ids:i,payment_method:this.selectedPaymentMethod}).toPromise();this.isUpdatingBookingsPaymentMethod=!1,this.spinner.hide(this.spinnerName);let _=i.length===1?yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.PAYMENT_METHOD_UPDATED").toPromise():yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.PAYMENT_METHOD_UPDATED_MULTIPLE").toPromise(),g=yield this.utilsService.showAlert({title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:_,icon:"success",timer:3e3,showConfirmButton:!1});this.bsModalRef.content.result=t,this.bsModalRef.hide()}catch(i){R.production||console.log(i),this.isUpdatingBookingsPaymentMethod=!1,this.spinner.hide(this.spinnerName)}})}onAADEStrPaymentMethodChange(i){if(!this.selectedAADEStrPaymentMethod)this.selectedPaymentMethod=null;else{let o=this.utilsService.getBookingPaymentMethodValueFromAADEStrPaymentMethod({aade_str_payment_method:this.selectedAADEStrPaymentMethod});this.selectedPaymentMethod=o||null}}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(vt),N(nt),N(lt),N(Z),N(Q))}}
1static{this.\u0275cmp=q({type:n,selectors:[["app-bookings-payment-method-update-modal"]],decls:36,vars:28,consts:[["bookingsPaymentMethodUpdateForm","ngForm"],["bookingPaymentMethod","ngModel"],["autocomplete","off",3,"ngSubmit"],[1,"modal-header","bg-tourmie-blue"],[1,"modal-title","pull-left"],[1,"modal-body"],[1,"row"],[1,"col-12"],[1,"text-muted"],[4,"ngIf"],[1,"form-group"],["for","bookingPaymentMethod",1,"mb-1"],[3,"type"],["id","bookingPaymentMethod","bindValue","value","name","bookingPaymentMethod","aria-describedby","bookingPaymentMethodHelp","required","",3,"ngModelChange","change","placeholder","items","multiple","closeOnSelect","searchFn","ngModel"],["ng-label-tmp",""],["ng-option-tmp",""],["id","bookingPaymentMethodHelp","class","form-text text-danger",4,"ngIf"],[1,"modal-footer"],[1,"row","w-100"],[1,"col-6"],["type","button","role","button",1,"btn","btn-outline-danger",3,"click","disabled"],[1,"col-6","text-right"],["type","submit","role","button",1,"btn","btn-tourmie-blue",3,"disabled","ladda"],["color","#27a9e0","type","ball-scale-multiple",3,"name"],["id","bookingPaymentMethodHelp",1,"form-text","text-danger"]],template:function(o,e){if(o&1){let l=D();d(0,"form",2,0),A("ngSubmit",function(){return C(l),B(e.updateBookingsPaymentMethods())}),d(2,"div",3)(3,"h5",4),T(4),k(5,"translate"),m()(),d(6,"div",5)(7,"div",6)(8,"div",7)(9,"p",8),E(10,Ri,3,3,"span",9)(11,Ei,3,6,"span",9),m()()(),d(12,"div",6)(13,"div",7)(14,"div",10)(15,"label",11),T(16),k(17,"translate"),I(18,"app-required-field-label",12),m(),d(19,"ng-select",13,1),k(21,"translate"),K("ngModelChange",function(_){return C(l),H(e.selectedAADEStrPaymentMethod,_)||(e.selectedAADEStrPaymentMethod=_),B(_)}),A("change",function(_){return C(l),B(e.onAADEStrPaymentMethodChange(_))}),E(22,Ci,2,1,"ng-template",14)(23,Bi,2,1,"ng-template",15),m(),E(24,Ni,2,1,"small",16),m()()()(),d(25,"div",17)(26,"div",18)(27,"div",19)(28,"button",20),A("click",function(){return C(l),B(e.bsModalRef.hide())}),T(29),k(30,"translate"),m()(),d(31,"div",21)(32,"button",22),T(33),k(34,"translate"),m()()()()(),I(35,"ngx-spinner",23)}if(o&2){let l=U(1),t=U(20);c(4),v(" ",x(5,18,"VIEWS.BOOKINGS.UPDATE_BOOKINGS_PAYMENT_METHOD")," "),c(6),p("ngIf",(e.bookings==null?null:e.bookings.length)===1),c(),p("ngIf",(e.bookings==null?null:e.bookings.length)>1),c(5),v(" ",x(17,20,"GENERIC.LABELS.PAYMENTS.PAYMENT_METHOD")," "),c(2),p("type","asterisk_tooltip"),c(),F("placeholder",x(21,22,"VIEWS.RESERVATIONS.RESERVATION_DETAILS.PLACEHOLDERS.PAYMENT_METHOD")),p("items",e.bookingAADEStrRegistryPaymentMethodOptions)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.selectedAADEStrPaymentMethod),c(5),p("ngIf",t.invalid&&(t.dirty||t.touched)),c(4),p("disabled",e.isUpdatingBookingsPaymentMethod),c(),v(" ",x(30,24,"GENERIC.BUTTONS.CANCEL")," "),c(3),p("disabled",l.invalid||e.isUpdatingBookingsPaymentMethod)("ladda",e.isUpdatingBookingsPaymentMethod),c(),v(" ",x(34,26,"GENERIC.LABELS.ACTIONS.UPDATE")," "),c(2),p("name",e.spinnerName)}},dependencies:[j,z,st,pt,_t,dt,Lt,ut,mt,J,X,at,ht,gt,bt,yt,ft,ct,rt,Et],encapsulation:2})}}return n})();var $i=n=>({bookings_count:n});function Ai(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.BOOKINGS.UPDATE_GUEST_NATIONALITY_OF_SELECTED_BOOKING_TO")," "))}function Oi(n,u){if(n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2){let i=y();c(),v(" ",Y(2,1,"VIEWS.BOOKINGS.UPDATE_GUEST_NATIONALITY_OF_SELECTED_N_BOOKINGS_TO",P(4,$i,(i.bookings==null?null:i.bookings.length)||0))," ")}}function Mi(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["nationality_"+o.utilsService.currentLanguage]||(i==null?null:i.nationality))}}function Li(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["nationality_"+o.utilsService.currentLanguage]||(i==null?null:i.nationality))}}function Pi(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",33),m()),n&2&&(c(),p("type","input_invalid"))}function Fi(n,u){if(n&1&&(d(0,"small",32),E(1,Pi,2,1,"span",11),m()),n&2){y();let i=U(19);c(),p("ngIf",i.errors.required&&(i.dirty||i.touched))}}var qe=(()=>{class n{constructor(i,o,e,l,t,_){this.http=i,this.router=o,this.bsModalRef=e,this.spinner=l,this.utilsService=t,this.translate=_,this.isUpdatingGuestNationality=!1,this.spinnerName="guestNationalityUpdateLoadingSpinner",this.customersNationality=null}ngOnInit(){this.skipUpdateIfNationalityIsKnown=!0,this.bookings?.length===1&&this.bookings[0].customer_nationality&&(this.customersNationality=this.bookings[0].customer_nationality,this.onCustomerNationalityChange(null))}updateGuestNationalities(){return G(this,null,function*(){try{let i=this.bookings.map(a=>a.booking_id);if(this.skipUpdateIfNationalityIsKnown&&(i=this.bookings.filter(a=>!a.customer_nationality).map(a=>a.booking_id)),!i?.length)return this.utilsService.showToast({message:yield this.translate.get("VIEWS.STR_REGISTRY.NO_BOOKINGS_TO_UPDATE").toProm
1ise(),type:"info"}),Promise.resolve();let o=i.length===1?yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_GUEST_NATIONALITY_QUESTION").toPromise():yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_GUEST_NATIONALITY_QUESTION_MULTIPLE").toPromise(),e={title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:o,icon:"question",reverseButtons:!0,showCancelButton:!0,cancelButtonText:yield this.translate.get("GENERIC.LABELS.ACTIONS.CANCEL").toPromise(),confirmButtonText:yield this.translate.get("GENERIC.LABELS.YES").toPromise(),focusCancel:!0};if((yield this.utilsService.showAlert(e)).isDismissed)return Promise.resolve();this.isUpdatingGuestNationality=!0,this.spinner.show(this.spinnerName);let t=yield this.http.post(`${R.params.host}/api/bookings-mass-guest-nationality-update`,{booking_ids:i,customer_nationality:this.customersNationality,customer_is_foreigner:this.customersAreForeigners,skip_update_if_nationality_is_known:!!this.skipUpdateIfNationalityIsKnown}).toPromise();this.isUpdatingGuestNationality=!1,this.spinner.hide(this.spinnerName);let _=i.length===1?yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.STATUS_UPDATED").toPromise():yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.STATUS_UPDATED_MULTIPLE").toPromise(),g=yield this.utilsService.showAlert({title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:_,icon:"success",timer:3e3,showConfirmButton:!1});this.bsModalRef.content.result=t,this.bsModalRef.hide()}catch(i){R.production||console.log(i),this.isUpdatingGuestNationality=!1,this.spinner.hide(this.spinnerName)}})}onCustomerNationalityChange(i){let o=this.customersNationality==="GR",e=this.utilsService.country_codes_eu.includes(this.customersNationality),l=!this.utilsService.country_codes_eu.includes(this.customersNationality);this.customersAreForeigners=!o}onCustomerIsForeignerChange(i){this.customersAreForeigners?(this.customersNationality=null,this.onCustomerNationalityChange(null)):(this.customersNationality="GR",this.onCustomerNationalityChange(null))}onSkipUpdateIfNationalityIsKnownChange(i){this.skipUpdateIfNationalityIsKnown=!!i?.target?.checked}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(vt),N(nt),N(lt),N(Z),N(Q))}}static{this.\u0275cmp=q({type:n,selectors:[["app-guest-nationality-update-update-modal"]],decls:58,vars:38,consts:[["guestNationalitiesUpdateForm","ngForm"],["customerNationality","ngModel"],["customerIsForeigner","ngModel"],["skipUpdateIfNationalityIsKnown","ngModel"],["autocomplete","off",3,"ngSubmit"],[1,"modal-header","bg-tourmie-blue"],[1,"modal-title","pull-left"],[1,"modal-body"],[1,"row"],[1,"col-12"],[1,"text-muted"],[4,"ngIf"],[1,"form-group"],["for","customerNationality",1,"mb-1"],["id","customerNationality","bindValue","alpha_2_code","name","customerNationality","aria-describedby","customerNationalityHelp",3,"ngModelChange","change","items","multiple","placeholder","closeOnSelect","searchFn","ngModel"],["ng-label-tmp",""],["ng-option-tmp",""],["id","customerNationalityHelp","class","form-text text-danger",4,"ngIf"],[1,"icheck-tourmie-blue","icheck-tourmie-rounded"],["type","checkbox","id","customerIsForeigner","name","customerIsForeigner",3,"ngModelChange","change","ngModel"],["for","customerIsForeigner",1,"mb-1"],[1,"ml-1","text-muted",3,"tooltip"],[1,"fas","fa-question-circle"],["type","checkbox","id","skipUpdateIfNationalityIsKnown","name","skipUpdateIfNationalityIsKnown",3,"ngModelChange","change","ngModel"],["for","skipUpdateIfNationalityIsKnown",1,"mb-1"],[1,"modal-footer"],[1,"row","w-100"],[1,"col-6"],["type","button","role","button",1,"btn","btn-outline-danger",3,"click","disabled"],[1,"col-6","text-right"],["type","submit","role","button",1,"btn","btn-tourmie-blue",3,"disabled","ladda"],["color","#27a9e0","type","ball-scale-multiple",3,"name"],["id","customerNationalityHelp",1,"form-text","text-danger"],[3,"type"]],template:function(o,e){if(o&1){let l=D();d(0,"form",4,0),A("ngSubmit",function(){return C(l),B(e.updateGuestNationalities())}),d(2,"div",5)(3,"h5",6),T(4),k(5,"translate"),m()(),d(6,"div",7)(7,"div",8)(8,"div",9)(9,"p",10),E(10,Ai,3,3,"span",11)(11,Oi,3,6,"span",11),m()()(),d(12,"div",8)(13,"div",9)(14,"div",12)(15,"label",13),T(16),k(17,"translate"),m(),d(18,"ng-select",14,1),k(20,"translate"),K("ngModelChange",function(_){return C(l),H(e.customersNationality,_)||(e.customersNationality=_),B(_)}),A("change",function(_){return C(l),B(e.onCustomerNationalityChange(_))}),E(21,Mi,2,1,"ng-template",15)(22,Li,2,1,"ng-template",16),m(),E(23,Fi,2,1,"small",17),m()()(),d(24,"div",8)(25,"div",9)(26,"div",12)(27,"div",18)(28,"input",19,2),K("ngModelChange",function(_){return C(l),H(e.customersAreForeigners,_)||(e.customersAreForeigners=_),B(_)}),A("change",function(_){return C(l),B(e.onCustomerIsForeignerChange(_))}),m(),d(30,"label",20)(31,"span"),T(32),k(33,"translate"),d(34,"small",21),k(35,"translate"),I(36,"i",22),m()()()()()()(),d(37,"div",8)(38,"div",9)(39,"div",12)(40,"div",18)(41,"input",23,3),K("ngModelChange",function(_){C(l);let g=U(42);return H(g,_),B(_)}),A("change",function(_){return C(l),B(e.onSkipUpdateIfNationalityIsKnownChange(_))}),m(),d(43,"label",24)(44,"span"),T(45),k(46,"translate"),m()()()()()()(),d(47,"div",25)(48,"div",26)(49,"div",27)(50,"button",28),A("click",function(){return C(l),B(e.bsModalRef.hide())}),T(51),k(52,"translate"),m()(),d(53,"div",29)(54,"button",30),T(55),k(56,"translate"),m()()()()(),I(57,"ngx-spinner",31)}if(o&2){let l=U(1),t=U(19),_=U(42);c(4),v(" ",x(5,22,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.NATIONALITY")," "),c(6),p("ngIf",(e.bookings==null?null:e.bookings.length)===1),c(),p("ngIf",(e.bookings==null?null:e.bookings.length)>1),c(5),v(" ",x(17,24,"GENERIC.LABELS.NATIONALITY")," "),c(2),F("placeholder",x(20,26,"GENERIC.LABELS.SELECT_NATIONALITY")),p("items",e.utilsService.nationalities)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.customersNationality),c(5
1),p("ngIf",t.invalid),c(5),w("ngModel",e.customersAreForeigners),c(4),v(" ",x(33,28,"GENERIC.LABELS.GUEST_IS_FOREIGNER")," "),c(2),F("tooltip",x(35,30,"GENERIC.LABELS.GUEST_IS_FOREIGNER_CHECKBOX_EXPLANATORY")),c(7),w("ngModel",_),c(4),v(" ",x(46,32,"GENERIC.LABELS.GUEST_NATIONALITY_SKIP_UPDATE_WHEN_VALUE_IS_KNOWN")," "),c(5),p("disabled",e.isUpdatingGuestNationality),c(),v(" ",x(52,34,"GENERIC.BUTTONS.CANCEL")," "),c(3),p("disabled",l.invalid||e.isUpdatingGuestNationality)("ladda",e.isUpdatingGuestNationality),c(),v(" ",x(56,36,"GENERIC.LABELS.ACTIONS.UPDATE")," "),c(2),p("name",e.spinnerName)}},dependencies:[j,z,st,pt,Xt,_t,dt,ut,mt,J,X,at,ht,gt,bt,yt,ft,ct,rt,Et,Mt,Ot],encapsulation:2})}}return n})();var Vi=n=>({bookings_count:n}),ze=()=>["canceled","failed"],je=(n,u,i,o)=>({"badge-success":n,"badge-info":u,"badge-tourmie-blue":i,"badge-danger":o});function Ui(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"VIEWS.BOOKINGS.UPDATE_STR_SUBMISSION_STATUS_OF_SELECTED_BOOKING_TO")," "))}function Di(n,u){if(n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2){let i=y();c(),v(" ",Y(2,1,"VIEWS.BOOKINGS.UPDATE_STR_SUBMISSION_STATUS_OF_SELECTED_N_BOOKINGS_TO",P(4,Vi,(i.bookings==null?null:i.bookings.length)||0))," ")}}function Gi(n,u){if(n&1&&(d(0,"span",24),T(1),m()),n&2){let i=u.item,o=y();p("ngClass",Gt(3,je,o.selectedBookingStrSubmissionStatus==="submitted",o.selectedBookingStrSubmissionStatus==="pending",o.selectedBookingStrSubmissionStatus==="draft",o.selectedBookingStrSubmissionStatus&&V(2,ze).includes(o.selectedBookingStrSubmissionStatus))),c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function wi(n,u){if(n&1&&(d(0,"span",24),T(1),m()),n&2){let i=u.item,o=y();p("ngClass",Gt(3,je,i.value==="submitted",i.value==="pending",i.value==="draft",i.value&&V(2,ze).includes(i.value))),c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function Hi(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",12),m()),n&2&&(c(),p("type","input_invalid"))}function Ki(n,u){if(n&1&&(d(0,"small",25),E(1,Hi,2,1,"span",9),m()),n&2){y();let i=U(20);c(),p("ngIf",i.errors.required)}}var Qe=(()=>{class n{constructor(i,o,e,l,t,_){this.http=i,this.router=o,this.bsModalRef=e,this.spinner=l,this.utilsService=t,this.translate=_,this.selectedBookingStrSubmissionStatus=null,this.isUpdatingBookingsStrSubmissionStatus=!1,this.spinnerName="bookingsStrSubmissionStatusUpdateLoadingSpinner",this.bookingStrSubmissionStatuses=this.utilsService.lodash.filter(R.booking_params.str_submission_statuses.list,g=>["canceled","submitted"].includes(g.value))}ngOnInit(){}updateBookingsStrSubmissionStatuses(){return G(this,null,function*(){try{let i=this.bookings.map(a=>a.booking_id);if(!i?.length)return Promise.resolve();let o=i.length===1?yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_STR_SUBMISSION_STATUS_QUESTION").toPromise():yield this.translate.get("GENERIC.ALERTS.BOOKINGS.UPDATE_STR_SUBMISSION_STATUS_QUESTION").toPromise(),e={title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toPromise(),html:o,icon:"question",reverseButtons:!0,showCancelButton:!0,cancelButtonText:yield this.translate.get("GENERIC.LABELS.ACTIONS.CANCEL").toPromise(),confirmButtonText:yield this.translate.get("GENERIC.LABELS.YES").toPromise(),focusCancel:!0};if((yield this.utilsService.showAlert(e)).isDismissed)return Promise.resolve();this.isUpdatingBookingsStrSubmissionStatus=!0,this.spinner.show(this.spinnerName);let t=yield this.http.post(`${R.params.host}/api/bookings-mass-str-submission-status-update`,{booking_ids:i,status:this.selectedBookingStrSubmissionStatus,service_type:this.service_type}).toPromise();this.isUpdatingBookingsStrSubmissionStatus=!1,this.spinner.hide(this.spinnerName);let _=i.length===1?yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.STR_SUBMISSION_STATUS_UPDATED").toPromise():yield this.translate.get("COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.ALERTS.STR_SUBMISSION_STATUS_UPDATED_MULTIPLE").toPromise(),g=yield this.utilsService.showAlert({title:yield this.translate.get("GENERIC.ALERTS.NOTIFICATION_DEFAULT_TITLE").toProm
1ise(),html:_,icon:"success",timer:3e3,showConfirmButton:!1});this.bsModalRef.content.result=t,this.bsModalRef.hide()}catch(i){R.production||console.log(i),this.isUpdatingBookingsStrSubmissionStatus=!1,this.spinner.hide(this.spinnerName)}})}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(vt),N(nt),N(lt),N(Z),N(Q))}}static{this.\u0275cmp=q({type:n,selectors:[["app-bookings-str-submission-status-update-modal"]],decls:36,vars:28,consts:[["bookingsStrSubmissionStatusUpdateForm","ngForm"],["bookingStatus","ngModel"],["autocomplete","off",3,"ngSubmit"],[1,"modal-header","bg-tourmie-blue"],[1,"modal-title","pull-left"],[1,"modal-body"],[1,"row"],[1,"col-12"],[1,"text-muted"],[4,"ngIf"],[1,"form-group"],["for","bookingsStatus",1,"mb-1"],[3,"type"],["id","bookingStatus","bindValue","value","name","bookingStatus","aria-describedby","bookingStatusHelp","required","",3,"ngModelChange","placeholder","items","multiple","closeOnSelect","searchFn","ngModel"],["ng-label-tmp",""],["ng-option-tmp",""],["id","bookingStatusHelp","class","form-text text-danger",4,"ngIf"],[1,"modal-footer"],[1,"row","w-100"],[1,"col-6"],["type","button","role","button",1,"btn","btn-outline-danger",3,"click","disabled"],[1,"col-6","text-right"],["type","submit","role","button",1,"btn","btn-tourmie-blue",3,"disabled","ladda"],["color","#27a9e0","type","ball-scale-multiple",3,"name"],[1,"badge","text-wrap",3,"ngClass"],["id","bookingStatusHelp",1,"form-text","text-danger"]],template:function(o,e){if(o&1){let l=D();d(0,"form",2,0),A("ngSubmit",function(){return C(l),B(e.updateBookingsStrSubmissionStatuses())}),d(2,"div",3)(3,"h5",4),T(4),k(5,"translate"),m()(),d(6,"div",5)(7,"div",6)(8,"div",7)(9,"p",8),E(10,Ui,3,3,"span",9)(11,Di,3,6,"span",9),m()()(),d(12,"div",6)(13,"div",7)(14,"div",10)(15,"label",11),T(16),k(17,"translate"),I(18,"app-required-field-label",12),m(),d(19,"ng-select",13,1),k(21,"translate"),K("ngModelChange",function(_){return C(l),H(e.selectedBookingStrSubmissionStatus,_)||(e.selectedBookingStrSubmissionStatus=_),B(_)}),E(22,Gi,2,8,"ng-template",14)(23,wi,2,8,"ng-template",15),m(),E(24,Ki,2,1,"small",16),m()()()(),d(25,"div",17)(26,"div",18)(27,"div",19)(28,"button",20),A("click",function(){return C(l),B(e.bsModalRef.hide())}),T(29),k(30,"translate"),m()(),d(31,"div",21)(32,"button",22),T(33),k(34,"translate"),m()()()()(),I(35,"ngx-spinner",23)}if(o&2){let l=U(1),t=U(20);c(4),v(" ",x(5,18,"VIEWS.BOOKINGS.UPDATE_BOOKINGS_STR_SUBMISSION_STATUS")," "),c(6),p("ngIf",(e.bookings==null?null:e.bookings.length)===1),c(),p("ngIf",(e.bookings==null?null:e.bookings.length)>1),c(5),v(" ",x(17,20,"GENERIC.LABELS.STATUS")," "),c(2),p("type","asterisk_tooltip"),c(),F("placeholder",x(21,22,"GENERIC.LABELS.SELECT_STATUS")),p("items",e.bookingStrSubmissionStatuses)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.selectedBookingStrSubmissionStatus),c(5),p("ngIf",t.invalid&&(t.dirty||t.touched)),c(4),p("disabled",e.isUpdatingBookingsStrSubmissionStatus),c(),v(" ",x(30,24,"GENERIC.BUTTONS.CANCEL")," "),c(3),p("disabled",l.invalid||e.isUpdatingBookingsStrSubmissionStatus)("ladda",e.isUpdatingBookingsStrSubmissionStatus),c(),v(" ",x(34,26,"GENERIC.LABELS.ACTIONS.UPDATE")," "),c(2),p("name",e.spinnerName)}},dependencies:[j,At,z,st,pt,_t,dt,Lt,ut,mt,J,X,at,ht,gt,bt,yt,ft,ct,rt,Et],encapsulation:2})}}return n})();var Yi=["strRegistryRecordEditFormComponentElement"],Wi=n=>["/properties",n],qi=n=>["/bookings",n],se=n=>({"is-invalid":n}),Xe=()=>["canceled","rejected","archived"],Je=(n,u,i)=>({"badge-success":n,"badge-info":u,"badge-danger":i}),zi=()=>({dateInputFormat:"DD MMMM YYYY",adaptivePosition:!0,showWeekNumbers:!1,containerClass:"theme-dark-blue",customTodayClass:"bg-info"});function ji(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),L(x(2,1,"GENERIC.LABELS.NIGHTS")))}function Qi(n,u){n&1&&(d(0,"span"),T(1),k(2,"translate"),m()),n&2&&(c(),L(x(2,1,"GENERIC.LABELS.NIGHT")))}function Xi(n,u){if(n&1&&(d(0,"span",55),T(1),m()),n&2){let i=u.item,o=y();p("ngClass",$t(3,Je,o.recordClone.status==="confirmed",o.recordClone.status==="pending",o.recordClone.status&&V(2,Xe).includes(o.recordClone.status))),c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}
1function Ji(n,u){if(n&1&&(d(0,"span",55),T(1),m()),n&2){let i=u.item,o=y();p("ngClass",$t(3,Je,i.value==="confirmed",i.value==="pending",i.value&&V(2,Xe).includes(i.value))),c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function Zi(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function to(n,u){if(n&1&&(d(0,"small",56),E(1,Zi,2,1,"span",25),m()),n&2){y();let i=U(50);c(),p("ngIf",i.errors.required)}}function eo(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function io(n,u){if(n&1&&(d(0,"small",61),E(1,eo,2,1,"span",25),m()),n&2){y();let i=U(8);c(),p("ngIf",i.errors.required&&(i.dirty||i.touched))}}function oo(n,u){if(n&1){let i=D();d(0,"span",62)(1,"a",63),A("click",function(){C(i);let e=y(2);return B(e.recordClone.canceled_at=null)}),d(2,"span",64),T(3),k(4,"translate"),k(5,"lowercase"),m()()()}n&2&&(c(3),v(" ",x(5,3,x(4,1,"GENERIC.LABELS.ACTIONS.CLEAR"))," "))}function so(n,u){if(n&1){let i=D();d(0,"div",10)(1,"div",11)(2,"div",26)(3,"label",57),T(4),k(5,"translate"),I(6,"app-required-field-label",28),m(),d(7,"input",58,8),K("ngModelChange",function(e){C(i);let l=y();return H(l.recordClone.canceled_at,e)||(l.recordClone.canceled_at=e),B(e)}),A("ngModelChange",function(){C(i);let e=y();return B(e.onBookingCancelationDateChange())}),m(),E(9,io,2,1,"small",59)(10,oo,6,5,"span",60),m()()()}if(n&2){let i=U(8),o=y();c(4),v(" ",x(5,7,"GENERIC.LABELS.DATES.CANCELATION_DATE")," "),c(2),p("type","asterisk_tooltip"),c(),p("ngClass",P(9,se,i.invalid&&(i.dirty||i.touched))),w("ngModel",o.recordClone.canceled_at),p("bsConfig",V(11,zi)),c(2),p("ngIf",i.invalid),c(),p("ngIf",o.recordClone.canceled_at)}}function ao(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["nationality_"+o.utilsService.currentLanguage]||(i==null?null:i.nationality))}}function no(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["nationality_"+o.utilsService.currentLanguage]||(i==null?null:i.nationality))}}function lo(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function ro(n,u){if(n&1&&(d(0,"small",65),E(1,lo,2,1,"span",25),m()),n&2){y();let i=U(63);c(),p("ngIf",i.errors.required&&(i.dirty||i.touched))}}function co(n,u){n&1&&(d(0,"small",66),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function _o(n,u){n&1&&I(0,"app-required-field-label",28),n&2&&p("type","asterisk_tooltip")}function mo(n,u){n&1&&(d(0,"small",67),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function uo(n,u){n&1&&(d(0,"small",68),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function po(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function go(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y();c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function bo(n,u){n&1&&(d(0,"span"),I(1,"app-required-field-label",28),m()),n&2&&(c(),p("type","input_invalid"))}function ho(n,u){if(n&1&&(d(0,"small",69),E(1,bo,2,1,"span",25),m()),n&2){y();let i=U(118);c(),p("ngIf",i.errors.required)}}function fo(n,u){if(n&1){let i=D();d(0,"div",11)(1,"div",26)(2,"label",75),T(3),m(),d(4,"div",76)(5,"input",77),K("ngModelChange",function(e){C(i);let l=y().$implicit;return H(l.value.amount_total,e)||(l.value.amount_total=e),B(e)}),m(),d(6,"div",78)(7,"span",79),T(8),m()()()()()}if(n&2){let i=y().$implicit,o=y(2);c(2),Wt("for","strBookingCostRecord__",i.key,""),c(),v(" ",i.value.label||i.key," "),c(2),Wt("id","strBookingCostRecord__",i.key,""),Wt("name","strBookingCostRecord__",i.key,""),w("ngModel",i.value.amount_total),re("aria-describedby","strBookingCostRecordHelp__"+i.key),c(3),L(o.utilsService.currencySymbol)}}function yo(n,u){if(n&1&&(d(0,"div",10),E(1,fo,9,10,"div",74),m()),n&2){let i=u.$implicit,o=y(2);c(),p("ngIf",o.bookingCostsListOptions.visible_items_default.includes(i.key)&&i.value)}}function To(n,u){if(n&1&&(d(0,"div",10)(1,"div",11)(2,"div",70)(3,"div",71)(4,"div",10)(5,"div",11)(6,"h6",72),T(7),k(8,"translate"),m()()(),E(9,yo,2,1,"div",73),k(10,"keyvalue"),m()()()()),n&2){let i=y();c(7),v(" ",x(8,2,"GENERIC.LABELS.PAYMENTS.COSTS")," "),c(2),p("ngForOf",Y(10,4,i.recordClone.costs,i.costsOrderFn))}}var Ze=(()=>{class n{constructor(i,o){this.translate=i,this.utilsService=o,this.showBookingCosts=!1,this.bookingCostsListOptions=ot,this.selectedAADEStrPaymentMethod=null,this.selectedPaymentMethod=null,this.bookingStatuses=this.utilsService.lodash.filter(this.utilsService.bookingStatuses,e=>e.value!=="archived"),this.bookingAADEStrRegistryPaymentMethodOptions=R.booking_params.payment_methods_aade.list,this.bookingPaymentMethodOptions=R.booking_params.payment_methods.list}ngOnInit(){!this.recordClone&&this.record&&(this.recordClone=this.utilsService.lodash.cloneDeep(this.record)),this.initializeBookingCancelationDate(),this.recordClone?.costs&&(Object.values(this.recordClone.costs).every(e=>e===null)||(this.showBookingCosts=!0)),this.selectedPaymentMethod=this.recordClone.payment_method||null;let i=this.utilsService.getBookingAADEStrPaymentMethodValueFromTourmiePaymentMethod({payment_method:this.selectedPaymentMethod});this.selectedAADEStrPaymentMethod=i||null,this.selectedAADEStrPaymentMethod||(this.selectedPaymentMethod=null),R.production||console.log({record:this.record,record_clone:this.recordClone})}onBookingStatusChange(i){this.initializeBookingCancelationDate()}onBookingCancelationDateChange(){}initializeBookingCancelationDate(){try{this.recordClone.status==="canceled"&&!this.recordClone.canceled_at&&this.recordClone.start_date_str&&(this.recordClone.canceled_at=this.recordClone.start_date_str),this.recordClone?.canceled_at&&(this.recordClone.canceled_at=this.utilsService.getDateFromISO(this.recordClone.canceled_at))}catch{}}onCustomerNationalityChange(i){this.recordClone.customer_is_greek=this.recordClone.customer_nationality==="GR",this.recordClone.customer_is_eu_citizen=this.utilsService.country_codes_eu.includes(this.recordClone.customer_nationality),this.recordClone.customer_is_not_eu_citizen=!this.utilsService.country_codes_eu.includes(this.recordClone.customer_nationality),this.recordClone.customer_is_foreigner=!this.recordClone.customer_is_greek}onCustomerIsForeignerChange(i){this.recordClone.customer_is_foreigner?(this.recordClone.customer_nationality=null,this.onCustomerNationalityChange(null)):(this.recordClone.customer_nationality="GR",this.onCustomerNationalityChange(null))}onAADEStrPaymentMethodChange(i){if(!this.selectedAADEStrPaymentMethod)this.selectedPaymentMethod=null;else{let o=this.utilsService.getBookingPaymentMethodValueFromAADEStrPaymentMethod({aade_str_payment_method:this.selectedAADEStrPaymentMethod});this.selectedPaymentMethod=o||null}this.recordClone.payment_method=this.selectedPaymentMethod}costsOrderFn(i,o){let e=ot.order.indexOf(i.key),l=ot.order.indexOf(o.
1key),t=e!==-1,_=l!==-1;return t&&_?e-l:t?-1:_?1:i.key.localeCompare(o.key)}static{this.\u0275fac=function(o){return new(o||n)(N(Q),N(Z))}}static{this.\u0275cmp=q({type:n,selectors:[["app-strregistry-record-edit-form"]],viewQuery:function(o,e){if(o&1&&Ct(Yi,5),o&2){let l;Bt(l=It())&&(e.strRegistryRecordEditFormComponentElement=l.first)}},inputs:{user:"user",record:"record",recordClone:"recordClone"},decls:124,vars:110,consts:[["strRegistryRecordEditFormComponentElement","ngForm"],["bookingStatus","ngModel"],["customerNationality","ngModel"],["customerIsForeigner","ngModel"],["customerPassportNumber","ngModel"],["customerTaxIdNumber","ngModel"],["customerNationalIdCardNumber","ngModel"],["bookingPaymentMethod","ngModel"],["bookingCanceledAtDate","ngModel"],["autocomplete","off"],[1,"row"],[1,"col-12"],["for","propertyName",1,"mb-0"],["id","propertyName"],["target","_blank",3,"routerLink"],["for","guestFullname",1,"mb-0"],["id","guestFullname"],[1,"col-6","col-sm-4","col-md-4"],["for","bookingCheckIn",1,"mb-0"],["id","bookingCheckIn"],["for","bookingCheckout",1,"mb-0"],["id","bookingCheckout"],["for","durationInNights",1,"mb-0"],["id","durationInNights"],[1,"mr-1"],[4,"ngIf"],[1,"form-group"],["for","bookingStatus",1,"mb-1"],[3,"type"],["id","bookingStatus","bindValue","value","name","bookingStatus","aria-describedby","bookingStatusHelp","required","",3,"ngModelChange","change","placeholder","items","multiple","closeOnSelect","searchFn","ngModel"],["ng-label-tmp",""],["ng-option-tmp",""],["id","bookingStatusHelp","class","form-text text-danger",4,"ngIf"],["class","row",4,"ngIf"],["for","customerNationality",1,"mb-1"],["id","customerNationality","bindValue","alpha_2_code","name","customerNationality","aria-describedby","customerNationalityHelp",3,"ngModelChange","change","items","multiple","placeholder","closeOnSelect","searchFn","ngModel"],["id","customerNationalityHelp","class","form-text text-danger",4,"ngIf"],[1,"icheck-tourmie-blue","icheck-tourmie-rounded"],["type","checkbox","id","customerIsForeigner","name","customerIsForeigner",3,"ngModelChange","change","ngModel"],["for","customerIsForeigner",1,"mb-1"],[1,"ml-1","text-muted",3,"tooltip"],[1,"fas","fa-question-circle"],["for","customerPassportNumber",1,"mb-1"],["id","customerPassportNumber","name","customerPassportNumber","type","text","aria-describedby","customerPassportNumberHelp",1,"form-control",3,"ngModelChange","ngClass","placeholder","ngModel"],["id","customerPassportNumberHelp","class","form-text text-danger",4,"ngIf"],["for","customerTaxIdNumber",1,"mb-1"],[3,"type",4,"ngIf"],["id","customerTaxIdNumber","name","customerTaxIdNumber","type","text","aria-describedby","customerTaxIdNumberHelp",1,"form-control",3,"ngModelChange","ngClass","placeholder","ngModel","required"],["id","customerTaxIdNumberHelp","class","form-text text-danger",4,"ngIf"],["for","customerNationalIdCardNumber",1,"mb-1"],["id","customerNationalIdCardNumber","name","customerNationalIdCardNumber","type","text","aria-describedby","customerNationalIdCardNumberHelp",1,"form-control",3,"ngModelChange","ngClass","placeholder","ngModel"],["id","customerNationalIdCardNumberHelp","class","form-text text-danger",4,"ngIf"],["for","bookingPaymentMethod",1,"mb-1"],["id","bookingPaymentMethod","bindValue","value","name","bookingPaymentMethod","aria-describedby","bookingPaymentMethodHelp","required","",3,"ngModelChange","change","placeholder","items","multiple","closeOnSelect","searchFn","ngModel"],["id","bookingPaymentMethodHelp","class","form-text text-danger",4,"ngIf"],[1,"badge","text-wrap",3,"ngClass"],["id","bookingStatusHelp",1,"form-text","text-danger"],["for","bookingCanceledAtDate",1,"mb-2"],["type","text","id","bookingCanceledAtDate","name","bookingCanceledAtDate","bsDatepicker","","aria-describedby","bookingCanceledAtDateHelp","required","","readonly","",1,"form-control","input-date-readonly",3,"ngModelChange","ngClass","ngModel","bsConfig"],["id","bookingCanceledAtDateHelp","class","form-text text-danger",4,"ngIf"],["class","d-block font-size-13 mt-1",4,"ngIf"],["id","bookingCanceledAtDateHelp",1,"form-text","text-danger"],[1,"d-block","font-size-13","mt-1"],["href","javascript:void(0);",1,"text-muted",3,"click"],[1,"hover-text-tourmie-blue"],["id","customerNationalityHelp",1,"form-text","text-danger"],["id","customerPassportNumberHelp",1,"form-text","text-danger"],["id","customerTaxIdNumberHelp",1,"form-text","text-danger"],["id","customerNationalIdCardNumberHelp",1,"form-text","text-danger"],["id","bookingPaymentMethodHelp",1,"form-text","text-danger"],[1,"card","card-booking-costs","box-shadow-none"],[1,"card-body"],[1,"font-size-17","mb-3"],["class","row",4,"ngFor","ngForOf"],["class","col-12",4,"ngIf"],[1,"mb-1",3,"for"],[1,"input-group"],["type","number","min","0","placeholder","",1,"form-control",3,"ngModelChange","id","name","ngModel"],[1,"input-group-append"],[1,"input-group-text"]],template:function(o,e){if(o&1){let l=D();d(0,"form",9,0)(2,"div",10)(3,"div",11)(4,"label",12),T(5),k(6,"translate"),m(),d(7,"p",13)(8,"a",14),T(9),m()()()(),d(10,"div",10)(11,"div",11)(12,"label",15),T(13),k(14,"translate"),m(),d(15,"p",16)(16,"a",14),T(17),m()()()(),d(18,"div",10)(19,"div",17)(20,"label",18),T(2
11),k(22,"translate"),m(),d(23,"p",19)(24,"span"),T(25),m()()(),d(26,"div",17)(27,"label",20),T(28),k(29,"translate"),m(),d(30,"p",21)(31,"span"),T(32),m()()(),d(33,"div",17)(34,"label",22),T(35),k(36,"translate"),m(),d(37,"p",23)(38,"span",24),T(39),m(),E(40,ji,3,3,"span",25)(41,Qi,3,3,"span",25),m()()(),d(42,"div",10)(43,"div",11)(44,"div",26)(45,"label",27),T(46),k(47,"translate"),I(48,"app-required-field-label",28),m(),d(49,"ng-select",29,1),k(51,"translate"),K("ngModelChange",function(_){return C(l),H(e.recordClone.status,_)||(e.recordClone.status=_),B(_)}),A("change",function(_){return C(l),B(e.onBookingStatusChange(_))}),E(52,Xi,2,7,"ng-template",30)(53,Ji,2,7,"ng-template",31),m(),E(54,to,2,1,"small",32),m()()(),E(55,so,11,12,"div",33),d(56,"div",10)(57,"div",11)(58,"div",26)(59,"label",34),T(60),k(61,"translate"),m(),d(62,"ng-select",35,2),k(64,"translate"),K("ngModelChange",function(_){return C(l),H(e.recordClone.customer_nationality,_)||(e.recordClone.customer_nationality=_),B(_)}),A("change",function(_){return C(l),B(e.onCustomerNationalityChange(_))}),E(65,ao,2,1,"ng-template",30)(66,no,2,1,"ng-template",31),m(),E(67,ro,2,1,"small",36),m()()(),d(68,"div",10)(69,"div",11)(70,"div",26)(71,"div",37)(72,"input",38,3),K("ngModelChange",function(_){return C(l),H(e.recordClone.customer_is_foreigner,_)||(e.recordClone.customer_is_foreigner=_),B(_)}),A("change",function(_){return C(l),B(e.onCustomerIsForeignerChange(_))}),m(),d(74,"label",39)(75,"span"),T(76),k(77,"translate"),d(78,"small",40),k(79,"translate"),I(80,"i",41),m()()()()()()(),d(81,"div",10)(82,"div",11)(83,"div",26)(84,"label",42),T(85),k(86,"translate"),m(),d(87,"input",43,4),k(89,"translate"),K("ngModelChange",function(_){return C(l),H(e.recordClone.customer_passport_number,_)||(e.recordClone.customer_passport_number=_),B(_)}),m(),E(90,co,2,1,"small",44),m()(),d(91,"div",11)(92,"div",26)(93,"label",45),T(94),k(95,"translate"),E(96,_o,1,1,"app-required-field-label",46),m(),d(97,"input",47,5),k(99,"translate"),K("ngModelChange",function(_){return C(l),H(e.recordClone.customer_tax_id,_)||(e.recordClone.customer_tax_id=_),B(_)}),m(),E(100,mo,2,1,"small",48),m()(),d(101,"div",11)(102,"div",26)(103,"label",49),T(104),k(105,"translate"),m(),d(106,"input",50,6),k(108,"translate"),K("ngModelChange",function(_){return C(l),H(e.recordClone.customer_identity_card_number,_)||(e.recordClone.customer_identity_card_number=_),B(_)}),m(),E(109,uo,2,1,"small",51),m()()(),d(110,"div",10)(111,"div",11)(112,"div",26)(113,"label",52),T(114),k(115,"translate"),I(116,"app-required-field-label",28),m(),d(117,"ng-select",53,7),k(119,"translate"),K("ngModelChange",function(_){return C(l),H(e.selectedAADEStrPaymentMethod,_)||(e.selectedAADEStrPaymentMethod=_),B(_)}),A("change",function(_){return C(l),B(e.onAADEStrPaymentMethodChange(_))}),E(120,po,2,1,"ng-template",30)(121,go,2,1,"ng-template",31),m(),E(122,ho,2,1,"small",54),m()()(),E(123,To,11,7,"div",33),m()}if(o&2){let l=U(50),t=U(63),_=U(88),g=U(98),a=U(107),s=U(118);c(5),v(" ",x(6,62,"GENERIC.LABELS.PROPERTY")," "),c(3),p("routerLink",P(100,Wi,e.recordClone.service_id)),c(),v(" ",e.recordClone.service_title," "),c(4),v(" ",x(14,64,"GENERIC.LABELS.GUEST")," "),c(3),p("routerLink",P(102,qi,e.recordClone.booking_id)),c(),v(" ",e.recordClone.customer_fullname," "),c(4),v(" ",x(22,66,"COMPONENTS.BOOKINGS_TABLE.CHECK_IN")," "),c(4),v(" ",e.recordClone.start_date_str," "),c(3),v(" ",x(29,68,"COMPONENTS.BOOKINGS_TABLE.CHECK_OUT")," "),c(4),v(" ",e.recordClone.end_date_str," "),c(3),v(" ",x(36,70,"GENERIC.LABELS.DURATION")," "),c(4),L(e.recordClone.duration_in_nights||1),c(),p("ngIf",e.recordClone.duration_in_nights>1),c(),p("ngIf",e.recordClone.duration_in_nights<=1),c(5),v(" ",x(47,72,"GENERIC.LABELS.BOOKING_STATUS")," "),c(2),p("type","asterisk_tooltip"),c(),F("placeholder",x(51,74,"GENERIC.LABELS.SELECT_BOOKING_STATUS")),p("items",e.bookingStatuses)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.recordClone.status),c(5),p("ngIf",l.invalid),c(),p("ngIf",e.recordClone.status==="canceled"),c(5),v(" ",x(61,76,"GENERIC.LABELS.NATIONALITY")," "),c(2),F("placeholder",x(64,78,"GENERIC.LABELS.SELECT_NATIONALITY")),p("items",e.utilsService.nationalities)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.recordClone.customer_nationality),c(5
1),p("ngIf",t.invalid),c(5),w("ngModel",e.recordClone.customer_is_foreigner),c(4),v(" ",x(77,80,"GENERIC.LABELS.GUEST_IS_FOREIGNER")," "),c(2),F("tooltip",x(79,82,"GENERIC.LABELS.GUEST_IS_FOREIGNER_CHECKBOX_EXPLANATORY")),c(7),v(" ",x(86,84,"VIEWS.ADMIN.STAY.CUSTOMERS.DETAILS.PASSPORT.NUMBER")," "),c(2),F("placeholder",x(89,86,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.PASSPORT_NUMBER")),p("ngClass",P(104,se,_.invalid&&(_.dirty||_.touched))),w("ngModel",e.recordClone.customer_passport_number),c(3),p("ngIf",_.invalid&&(_.dirty||_.touched)),c(4),v(" ",x(95,88,"GENERIC.LABELS.TAX_ID_NUMBER")," "),c(2),p("ngIf",!e.recordClone.customer_is_foreigner),c(),F("placeholder",x(99,90,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.VAT")),p("ngClass",P(106,se,g.invalid&&(g.dirty||g.touched))),w("ngModel",e.recordClone.customer_tax_id),p("required",!e.recordClone.customer_is_foreigner),c(3),p("ngIf",g.invalid&&(g.dirty||g.touched)),c(4),v(" ",x(105,92,"GENERIC.LABELS.NATIONAL_ID")," "),c(2),F("placeholder",x(108,94,"VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.NATIONAL_ID")),p("ngClass",P(108,se,a.invalid&&(a.dirty||a.touched))),w("ngModel",e.recordClone.customer_identity_card_number),c(3),p("ngIf",a.invalid&&(a.dirty||a.touched)),c(5),v(" ",x(115,96,"GENERIC.LABELS.PAYMENTS.PAYMENT_METHOD")," "),c(2),p("type","asterisk_tooltip"),c(),F("placeholder",x(119,98,"VIEWS.RESERVATIONS.RESERVATION_DETAILS.PLACEHOLDERS.PAYMENT_METHOD")),p("items",e.bookingAADEStrRegistryPaymentMethodOptions)("multiple",!1)("closeOnSelect",!0)("searchFn",e.utilsService.multilingualDropdownSearchFunction),w("ngModel",e.selectedAADEStrPaymentMethod),c(5),p("ngIf",s.invalid&&(s.dirty||s.touched)),c(),p("ngIf",(e.recordClone==null?null:e.recordClone.costs)&&e.showBookingCosts)}},dependencies:[j,At,zt,z,pe,ge,st,pt,Ce,Be,Xt,_t,dt,Lt,Ie,ut,mt,he,be,J,X,at,ht,gt,bt,Et,Mt,Ot,De,Ve,Ue],styles:[".card-booking-costs[_ngcontent-%COMP%]{border:1px dashed lightgray;border-radius:10px;width:100%;background-color:#f2f2f2}"]})}}return n})();var Tt=ne(ve());var ko=["strRegistryRecordEditFormComponentElement"];function So(n,u){if(n&1&&I(0,"app-strregistry-record-edit-form",14,0),n&2){let i=y();p("user",i.user)("record",i.record)("recordClone",i.recordClone)}}var ti=(()=>{class n{constructor(i,o,e,l){this.http=i,this.bsModalRef=o,this.translate=e,this.utilsService=l,this.isUpdatingSTRRegistryRecord=!1}ngOnInit(){console.log("STRRegistryRecordEditModalComponent"),this.recordClone=(0,Tt.cloneDeep)(this.record)}updateStrRegistryBookingData(){return G(this,null,function*(){let i=null;if(this.record.costs&&this.recordClone.costs){let l=(0,Tt.isEqual)(this.record.costs,this.recordClone.costs);R.production||console.log("costsObjectsAreEqual:",l),l||(i=Object.keys(this.record.costs).reduce((t,_)=>((0,Tt.isEqual)(this.record.costs[_],this.recordClone.costs[_])||(t[_]=this.recordClone.costs[_]),t),{})),R.production||console.log("changedCostsAttributes:",i)}let o=(0,Tt.isEqual)(this.record,this.recordClone);R.production||console.log("objectsAreEqual:",o);let e=null;if(!o){e=Object.keys(this.record).reduce((l,t)=>((0,Tt.isEqual)(this.record[t],this.recordClone[t])||(l[t]=this.recordClone[t]),l),{});for(let l in e)this.record[l]=this.recordClone[l]}if(R.production||console.log("changedAttributes:",e),!e||(0,Tt.isEmpty)(e))return this.utilsService.showToast({message:yield this.translate.get("GENERIC.LABELS.NO_CHANGES_MADE_UPDATE_SKIPPED").toPromise(),type:"info"}),Promise.resolve();this.isUpdatingSTRRegistryRecord=!0;try{let l=yield this.http.put(`${R.params.host}/api/str-registry/bookings/${this.record.booking_id}`,e).toPromise();R.production||console.log(l),this.isUpdatingSTRRegistryRecord=!1,this.utilsService.showToast({message:yield this.translate.get("GENERIC.LABELS.CHANGES_SAVED_SUCCESSFULLY").toPromise(),type:"success"}),this.bsModalRef.content||(this.bsModalRef.content={}),this.bsModalRef.content.action="update",this.bsModalRef.content.attributes_changed=e,this.bsModalRef.content.costs_attributes_changed=i,this.bsModalRef.hide()}catch(l){this.isUpdatingSTRRegistryRecord=!1,console.log(l)}})}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(nt),N(Q),N(Z))}}static{this.\u0275cmp=q({type:n,selectors:[["app-strregistry-record-edit-modal"]],viewQuery:function(o,e){if(o&1&&Ct(ko,5),o&2){let l;Bt(l=It())&&(e.strRegistryRecordEditFormComponentElement=l.first)}},decls:19,vars:14,consts:[["strRegistryRecordEditFormComponentElement",""],[1,"modal-header"],[1,"modal-title","pull-left"],["aria-label","Close",1,"close","pull-right",3,"click","hidden"],["aria-hidden","true"],[1,"fas","fa-times","fa-xs"],[1,"modal-body","flex-grow-1","overflow-auto",2,"max-height","calc(100vh - 120px)"],[3,"user","record","recordClone",4,"ngIf"],[1,"modal-footer","bg-white","w-100",2,"position","absolute","bottom","0"],[1,"row","w-100"],[1,"col-12","col-sm-6"],["type","button","role","button",1,"btn","btn-default","btn-block","btn-sm-inline-block",3,"click","disabled"],[1,"col-12","col-sm-6","text-sm-right"],["type","button","role","button",1,"btn","btn-tourmie-blue","btn-block","btn-sm-inline-block",3,"click","disabled","ladda"],[3,"user","record","recordClone"]],template:function(o,e){o&1&&(d(0,"div",1)(1,"h6",2),T(2),k(3,"translate"),m(),d(4,"span",3),A("click",function(){return e.bsModalRef.hide()}),d(5,"span",4),I(6,"i",5),m()()(),d(7,"div",6),E(8,So,2,3,"app-strregistry-record-edit-form",7),m(),d(9,"div",8)(10,"div",9)(11,"div",10)(12,"button",11),A("click",function(){return e.bsModalRef.hide()}),T(13),k(14,"translate"),m()(),d(15,"div",12)(16,"button",13),A("click",function(){return e.updateStrRegistryBookingData()}
1),T(17),k(18,"translate"),m()()()()),o&2&&(c(2),v(" ",x(3,8,"COMPONENTS.BOOKING_FORM.BOOKING_DETAILS")," "),c(2),p("hidden",e.isUpdatingSTRRegistryRecord),c(4),p("ngIf",e.recordClone),c(4),p("disabled",e.isUpdatingSTRRegistryRecord),c(),v(" ",x(14,10,"GENERIC.LABELS.ACTIONS.CLOSE")," "),c(3),p("disabled",e.strRegistryRecordEditFormComponentElement==null||e.strRegistryRecordEditFormComponentElement.strRegistryRecordEditFormComponentElement==null?null:e.strRegistryRecordEditFormComponentElement.strRegistryRecordEditFormComponentElement.invalid)("ladda",e.isUpdatingSTRRegistryRecord),c(),v(" ",x(18,12,"GENERIC.LABELS.ACTIONS.UPDATE")," "))},dependencies:[j,z,Ze,J,X,yt,ft],encapsulation:2})}}return n})();var xo=["shortTermRegistryBookingsTabset"],ei=()=>({parent:"card-body",table:"all"}),tt=n=>({options:n}),ii=()=>({parent:"card-body",table:"ready_for_submission"}),oi=()=>({parent:"card-body",table:"require_data"}),si=()=>({parent:"card-body",table:"invalid_data"}),ai=()=>({parent:"card-body",table:"submitted"}),ni=()=>({parent:"card-body",table:"submitted_as_draft"}),li=()=>({parent:"card-body",table:"error_in_submission"}),Nt=n=>({count:n}),vo=(n,u)=>({"dropdown-menu-right":n,"dropdown-menu-left":u}),Ro=(n,u)=>({"fa-caret-down":n,"fa-caret-up":u}),ae=n=>({"text-tourmie-blue":n}),Eo=()=>["incomplete","past_due","unpaid"],Co=()=>["incomplete_expired","canceled"],Bo=(n,u,i,o)=>({"text-success":n,"text-tourmie-blue":u,"text-tourmie-orange":i,"text-danger":o}),ri=()=>["canceled","rejected"],ci=(n,u,i)=>({"badge-success":n,"badge-info":u,"badge-danger":i}),_i=(n,u)=>({"badge-success":n,"badge-danger":u}),Io=()=>["all","require_data","invalid_data","submitted"],Yt=()=>["submitted"],di=n=>({bookings_count:n});function No(n,u){n&1&&I(0,"div",41)}function $o(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_ALL_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null?null:i.shortTermRegistryBookingsTablesData.all.records_total_count)||0)),xt)}}function Ao(n,u){if(n&1&&I(0,"table",43,4),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null?null:i.shortTermRegistryBookingsTablesData.all.id)||"tableShortTermRegistryBookingsAll"),p("dtOptions",i.shortTermRegistryBookingsTablesData.all.dt_options)}}function Oo(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_READY_FOR_SUBMISSION_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.ready_for_submission==null?null:i.shortTermRegistryBookingsTablesData.ready_for_submission.records_total_count)||0)),xt)}}function Mo(n,u){if(n&1&&I(0,"table",43,5),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.ready_for_submission==null?null:i.shortTermRegistryBookingsTablesData.ready_for_submission.id)||"tableShortTermRegistryBookingsReadyForSubmission"),p("dtOptions",i.shortTermRegistryBookingsTablesData.ready_for_submission.dt_options)}}function Lo(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_REQUIRE_DATA_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.require_data==null?null:i.shortTermRegistryBookingsTablesData.require_data.records_total_count)||0)),xt)}}function Po(n,u){if(n&1&&I(0,"table",43,6),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.require_data==null?null:i.shortTermRegistryBookingsTablesData.require_data.id)||"tableShortTermRegistryBookingsRequireData"),p("dtOptions",i.shortTermRegistryBookingsTablesData.require_data.dt_options)}}function Fo(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_INVALID_DATA_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.invalid_data==null?null:i.shortTermRegistryBookingsTablesData.invalid_data.records_total_count)||0)),xt)}}function Vo(n,u){if(n&1&&I(0,"table",43,7),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.invalid_data==null?null:i.shortTermRegistryBookingsTablesData.invalid_data.id)||"tableShortTermRegistryBookingsInvali
1dData"),p("dtOptions",i.shortTermRegistryBookingsTablesData.invalid_data.dt_options)}}function Uo(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_SUBMITTED_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.submitted==null?null:i.shortTermRegistryBookingsTablesData.submitted.records_total_count)||0)),xt)}}function Do(n,u){if(n&1&&I(0,"table",43,8),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.submitted==null?null:i.shortTermRegistryBookingsTablesData.submitted.id)||"tableShortTermRegistryBookingsSubmitted"),p("dtOptions",i.shortTermRegistryBookingsTablesData.submitted.dt_options)}}function Go(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_SUBMITTED_AS_DRAFT_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.submitted_as_draft==null?null:i.shortTermRegistryBookingsTablesData.submitted_as_draft.records_total_count)||0)),xt)}}function wo(n,u){if(n&1&&I(0,"table",43,9),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.submitted_as_draft==null?null:i.shortTermRegistryBookingsTablesData.submitted_as_draft.id)||"tableShortTermRegistryBookingsSubmittedAsDraft"),p("dtOptions",i.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_options)}}function Ho(n,u){if(n&1&&(I(0,"div",42),k(1,"translate")),n&2){let i=y();F("innerHTML",Y(1,1,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_ERROR_IN_SUBMISSION_TITLE_PARENTHESES_COUNT_W_ICON",P(4,Nt,(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.error_in_submission==null?null:i.shortTermRegistryBookingsTablesData.error_in_submission.records_total_count)||0)),xt)}}function Ko(n,u){if(n&1&&I(0,"table",43,10),n&2){let i=y();F("id",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.error_in_submission==null?null:i.shortTermRegistryBookingsTablesData.error_in_submission.id)||"tableShortTermRegistryBookingsErrorInSubmission"),p("dtOptions",i.shortTermRegistryBookingsTablesData.error_in_submission.dt_options)}}function Yo(n,u){n&1&&(d(0,"button",46),I(1,"i",47),d(2,"span",48),T(3),k(4,"translate"),m()()),n&2&&(c(3),L(x(4,1,"GENERIC.LABELS.FILTERS")))}function Wo(n,u){if(n&1&&(d(0,"small",60),T(1),k(2,"date"),k(3,"date"),m()),n&2){let i=y(2).options,o=y();c(),de(" ",Y(2,2,o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.start,"dd MMM yyyy")," - ",Y(3,5,o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.end,"dd MMM yyyy")," ")}}function qo(n,u){n&1&&(d(0,"small",60),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"GENERIC.LABELS.SELECT_DATE")," "))}function zo(n,u){n&1&&(d(0,"h6",59),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"PAGES.HOME.FILTER_BY_ACCOUNT")," "))}function jo(n,u){if(n&1&&(d(0,"span",65),I(1,"i",66),m()),n&2){let i=y().item;ce("tooltip","",i.subscription_plan," (",i.subscription_status,")"),p("ngClass",Gt(6,Bo,i.subscription_status==="active",i.subscription_status==="trialing",V(4,Eo).includes(i.subscription_status),V(5,Co).includes(i.subscription_status)))}}function Qo(n,u){if(n&1&&(d(0,"div",63),k(1,"translate"),E(2,jo,2,11,"span",64),d(3,"span"),T(4),m(),I(5,"br"),d(6,"small")(7,"b"),T(8),k(9,"translate"),m(),T(10),m()()),n&2){let i=u.item;_e("title","",i.title," - ",x(1,8,"GENERIC.LABELS.ONLY_ID"),": ",i.account_id,""),c(2),p("ngIf",i.subscription_plan!=="free"),c(2),L(i.title),c(4),v(" ",x(9,10,"GENERIC.LABELS.ONLY_ID"),":"),c(2),v(" ",i.account_id,"")}}function Xo(n,u){if(n&1){let i=D();d(0,"div",50)(1,"ng-select",61),k(2,"translate"),A("change",function(e){C(i);let l=y(2).options,t=y();return B(t.onFilterShortTermRegistryBookingsByAccountValueChange(e,(l==null?null:l.table)||"all"))}),K("ngModelChange",function(e){C(i);let l=y(2).options,t=y();return H(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.account_id,e)||(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.account_id=e),B(e)}),E(3,Qo,11,12,"ng-template",62),m()()}if(n&2){let i=y(2).options,o=y();c(),F("placeholder",x(2,7,"PAGES.HOME.SELECT_ACCOUNT")),p("items",o.allAccounts)("multiple",!1)("closeOnSelect",!0)("searchFn",o.shortTermRegistryBookingsCustomAccountsDropdownListSearchFunction)("minTermLength",3),w("ngModel",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.account_id)}}function Jo(n,u){n&1&&(d(0,"h6",59),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"PAGES.HOME.FILTER_BY_PROPERTY")," "))}
1function Zo(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y(4);c(),L(i["title_"+o.utilsService.currentLanguage]||(i==null?null:i.title))}}function ts(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y(4);c(),L(i["title_"+o.utilsService.currentLanguage]||(i==null?null:i.title))}}function es(n,u){if(n&1){let i=D();d(0,"div",50)(1,"ng-select",67),k(2,"translate"),A("change",function(e){C(i);let l=y(2).options,t=y();return B(t.onFilterShortTermRegistryBookingsByPropertyChange(e,(l==null?null:l.table)||"all"))}),K("ngModelChange",function(e){C(i);let l=y(2).options,t=y();return H(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.service_id,e)||(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.service_id=e),B(e)}),E(3,Zo,2,1,"ng-template",68)(4,ts,2,1,"ng-template",62),m()()}if(n&2){let i=y(2).options,o=y();c(),F("placeholder",x(2,6,"VIEWS.PUBLIC.HOST_PAGE.OTHER_TEMPLATE.SELECT_PROPERTY")),p("items",o.properties)("searchFn",o.utilsService.multilingualDropdownSearchFunction)("multiple",!1)("closeOnSelect",!0),w("ngModel",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.service_id)}}function is(n,u){n&1&&(d(0,"h6",59),T(1),k(2,"translate"),m()),n&2&&(c(),v(" ",x(2,1,"PAGES.HOME.FILTER_BY_BOOKING_CHANNEL")," "))}function os(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y(4);c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function ss(n,u){if(n&1&&(d(0,"span"),T(1),m()),n&2){let i=u.item,o=y(4);c(),L(i["label_"+o.utilsService.currentLanguage]||(i==null?null:i.label))}}function as(n,u){if(n&1){let i=D();d(0,"div",50)(1,"ng-select",69),k(2,"translate"),A("change",function(e){C(i);let l=y(2).options,t=y();return B(t.onFilterShortTermRegistryBookingsByChannelChange(e,(l==null?null:l.table)||"all"))}),K("ngModelChange",function(e){C(i);let l=y(2).options,t=y();return H(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.booking_channel,e)||(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.booking_channel=e),B(e)}),E(3,os,2,1,"ng-template",68)(4,ss,2,1,"ng-template",62),m()()}if(n&2){let i=y(2).options,o=y();c(),F("placeholder",x(2,7,"GENERIC.LABELS.BOOKING_CHANNEL_SELECT")),p("items",o.bookingChannels)("multiple",!1)("searchFn",o.utilsService.multilingualDropdownSearchFunction)("closeOnSelect",!0),w("ngModel",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.booking_channel),p("searchFn",o.utilsService.multilingualDropdownSearchFunction)}}function ns(n,u){if(n&1&&(d(0,"span",71),T(1),m()),n&2){let i=y(3).options,o=y();p("ngClass",$t(3,ci,(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status)==="confirmed",(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status)==="pending",(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status)&&V(2,ri).includes(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status))),c(),v(" ",o.utilsService.getBookingStatusLabel((o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status)||null)," ")}}
1function ls(n,u){if(n&1&&(d(0,"span",71),T(1),m()),n&2){let i=u.item;p("ngClass",$t(3,ci,i.value==="confirmed",i.value==="pending",i.value&&V(2,ri).includes(i.value))),c(),v(" ",i.label," ")}}function rs(n,u){if(n&1){let i=D();d(0,"div",50)(1,"ng-select",70),k(2,"translate"),A("change",function(e){C(i);let l=y(2).options,t=y();return B(t.onFilterShortTermRegistryBookingsByStatusValueChange(e,(l==null?null:l.table)||"all"))}),K("ngModelChange",function(e){C(i);let l=y(2).options,t=y();return H(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.status,e)||(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.status=e),B(e)}),E(3,ns,2,7,"ng-template",68)(4,ls,2,7,"ng-template",62),m()()}if(n&2){let i=y(2).options,o=y();c(),F("placeholder",x(2,5,"GENERIC.LABELS.SELECT_BOOKING_STATUS")),p("items",o.bookingStatuses)("multiple",!1)("closeOnSelect",!0),w("ngModel",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.status)}}function cs(n,u){if(n&1&&(d(0,"span",71),T(1),m()),n&2){let i=u.item,o=y(3).options,e=y();p("ngClass",Dt(2,_i,(e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters==null||e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params==null||e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params.filterby==null?null:e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params.filterby.checkin_submitted)==="submitted",(e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters==null||e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params==null||e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params.filterby==null?null:e.shortTermRegistryBookingsTablesData[(o==null?null:o.table)||"all"].filters.table_params.filterby.checkin_submitted)==="not_submitted")),c(),v(" ",i.label," ")}}function _s(n,u){if(n&1&&(d(0,"span",71),T(1),m()),n&2){let i=u.item;p("ngClass",Dt(2,_i,i.value==="submitted",i.value==="not_submitted")),c(),v(" ",i.label," ")}}function ds(n,u){if(n&1){let i=D();d(0,"div",50)(1,"ng-select",72),k(2,"translate"),A("change",function(e){C(i);let l=y(2).options,t=y();return B(t.onFilterShortTermRegistryBookingsByCheckinSubmittedValueChange(e,(l==null?null:l.table)||"all"))}),K("ngModelChange",function(e){C(i);let l=y(2).options,t=y();return H(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.checkin_submitted,e)||(t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.table_params.filterby.checkin_submitted=e),B(e)}),E(3,cs,2,5,"ng-template",68)(4,_s,2,5,"ng-template",62),m()()}if(n&2){let i=y(2).options,o=y();c(),F("placeholder",x(2,5,"GENERIC.LABELS.SELECT_ONLINE_CHECKIN_STATUS")),p("items",o.utilsService.options_checkin_submitted)("multiple",!1)("closeOnSelect",!0),w("ngModel",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.checkin_submitted)}}function ms(n,u){if(n&1){let i=D();d(0,"div",49)(1,"div",50)(2,"button",51),A("selected",function(e){C(i);let l=y().options,t=y();return B(t.onShortTermRegistryBookingsDaterangePickerValueChange(e,t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.daterange,(l==null?null:l.table)||"all"))})("showDaterangepicker",function(e){C(i);let l=y().options,t=y();return B(t.onShortTermRegistryBookingsDateRangePickerCalendarShow(e,(l==null?null:l.table)||"all"))})("hideDaterangepicker",function(e){C(i);let l=y().options,t=y();return B(t.onShortTermRegistryBookingsDateRangePickerCalendarHide(e,(l==null?null:l.table)||"all"))})("applyDaterangepicker",function(e){C(i);let l=y().options,t=y();return B(t.onShortTermRegistryBookingsDateRangePickerApply(e,t.shortTermRegistryBookingsTablesData[(l==null?null:l.table)||"all"].filters.daterange,(l==null?null:l.table)||"all"))}
1),I(3,"i",52),E(4,Wo,4,8,"small",53)(5,qo,3,3,"small",53),I(6,"i",54),m()(),d(7,"h6",55),T(8),k(9,"translate"),m(),d(10,"a",56),A("click",function(){C(i);let e=y().options,l=y();return B(l.onShortTermRegistryBookingsDateFilterChange("start_date",(e==null?null:e.table)||"all"))}),T(11),k(12,"translate"),m(),d(13,"a",56),A("click",function(){C(i);let e=y().options,l=y();return B(l.onShortTermRegistryBookingsDateFilterChange("end_date",(e==null?null:e.table)||"all"))}),T(14),k(15,"translate"),m(),d(16,"a",56),A("click",function(){C(i);let e=y().options,l=y();return B(l.onShortTermRegistryBookingsDateFilterChange("created_at",(e==null?null:e.table)||"all"))}),T(17),k(18,"translate"),m(),E(19,zo,3,3,"h6",57)(20,Xo,4,9,"div",58)(21,Jo,3,3,"h6",57)(22,es,5,8,"div",58)(23,is,3,3,"h6",57)(24,as,5,9,"div",58),d(25,"h6",59),T(26),k(27,"translate"),m(),E(28,rs,5,7,"div",58),d(29,"h6",59),T(30),k(31,"translate"),m(),E(32,ds,5,7,"div",58),m()}if(n&2){let i=y().options,o=y();p("ngClass",Dt(34,vo,(i==null?null:i.parent)==="card-header",(i==null?null:i.parent)==="card-body")),c(2),p("options",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.picker_options),c(2),p("ngIf",(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.start_str)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.end_str)),c(),p("ngIf",!(!(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null)&&o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.start_str)||!(!(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null)&&o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.end_str)),c(),p("ngClass",Dt(37,Ro,!(!(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null)&&o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.calendar_is_visible),o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.daterange.calendar_is_visible)),c(2),v(" ",x(9,22,"PAGES.HOME.FILTER_BY_DATE")," "),c(2),p("ngClass",P(40,ae,(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.date)==="start_date")),c(),v(" ",x(12,24,"COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.CHECK_IN")," "),c(2),p("ngClass",P(42,ae,(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.date)==="end_date")),c(),v(" ",x(15,26,"COMPONENTS.BOOKING_SINGLE.BOOKING_ACCOMMODATION.CHECK_OUT")," "),c(2),p("ngClass",P(44,ae,(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby.date)==="created_at")),c(),v(" ",x(18,28,"GENERIC.LABELS.BOOKING_CREATED")," "),c(2),p("ngIf",(o.user==null?null:o.user.is_admin)&&!(!(o.user==null||o.user.account==null)&&o.user.account.account_id)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(),p("ngIf",(o.user==null?null:o.user.is_admin)&&!(!(o.user==null||o.user.account==null)&&o.user.account.account_id)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(),p("ngIf",(o.user==null||o.user.account==null?null:o.user.account.account_id)&&(o.properties==null?null:o.properties.length)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(),p("ngIf",(o.user==null||o.user.account==null?null:o.user.account.account_id)&&(o.properties==null?null:o.properties.length)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(),p("ngIf",(o.user==null||o.user.account==null?null:o.user.account.account_id)&&(o.bookingChannels==null?null:o.bookingChannels.length)&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(),p("ngIf",(o.user==null||o.user.account==null?null:o.user.account.account_id)&&o.bookingChannels.length&&(o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)),c(2),v(" ",x(27,30,"PAGES.HOME.FILTER_BY_BOOKING_STATUS")," "),c(2),p("ngIf",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby),c(2),v(" ",x(31,32,"COMPONENTS.BOOKINGS_TABLE.ONLINE_CHECKIN_STATUS")," "),c(2),p("ngIf",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters.table_params.filterby)}}function us(n,u){if(n&1&&E(0,Yo,5,3,"button",44)(1,ms,33,46,"div",45),n&2){let i=u.options,o=y();p("ngIf",(i==null?null:i.parent)==="card-body"),c(),p("ngIf",o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].filters)}}function ps(n,u){if(n&1){let i=D();d(0,"button",76),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryBookingsStatusUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",77),d(2,"span",48),T(3),k(4,"translate"),m()()}if(n&2){let i=y().options;p("hidden",(i==null?null:i.table)&&V(4,Yt).includes(i.table)),c(3),L(x(4,2,"GENERIC.LABELS.ACTIONS.CHANGE_BOOKING_STATUS"))}}function gs(n,u){if(n&1){let i=D();d(0,"button",76),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryGuestNationalityUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",78),d(2,"span",48),T(3),k(4,"translate"),m()()}if(n&2){let i=y().options;p("hidden",(i==null?null:i.table)&&V(4,Yt).includes(i.table)),c(3),L(x(4,2,"GENERIC.LABELS.ACTIONS.CHANGE_NATIONALITY"))}}function bs(n,u){if(n&1){let i=D();d(0,"button",76),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryPaymentMethodUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",79),d(2,"span",48),T(3),k(4,"translate"),m()()}if(n&2){let i=y().options;p("hidden",(i==null?null:i.table)&&V(4,Yt).includes(i.table)),c(3),L(x(4,2,"GENERIC.LABELS.ACTIONS.CHANGE_PAYMENT_METHOD"))}}function hs(n,u){if(n&1){let i=D();d(0,"button",76),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryBookingsStrSubmissionStatusUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",77),d(2,"span",48),T(3),k(4,"translate"),m()()}if(n&2){let i=y().options;p("hidden",(i==null?null:i.table)&&V(4,Yt).includes(i.table)),c(3),L(x(4,2,"GENERIC.LABELS.ACTIONS.CHANGE_SUBMISSION_STATUS"))}}function fs(n,u){if(n&1){let i=D();
1d(0,"button",80),k(1,"translate"),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryBookingsSubmissionModal({table:(e==null?null:e.table)||"all"}))}),I(2,"i",81),d(3,"span",48),T(4),k(5,"translate"),m()()}n&2&&(F("tooltip",x(1,2,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SEND_TO_AADE_EXPLANATORY")),c(4),L(x(5,4,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SUBMIT_TO_AADE")))}function ys(n,u){if(n&1&&(d(0,"span",86),T(1),k(2,"translate"),m()),n&2){let i=y(2).options,o=y();c(),v(" ",Y(2,1,"GENERIC.LABELS.BOOKINGS_ONE_SELECTED",P(4,di,(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)||0))," ")}}function Ts(n,u){if(n&1&&(d(0,"span",86),T(1),k(2,"translate"),m()),n&2){let i=y(2).options,o=y();c(),v(" ",Y(2,1,"GENERIC.LABELS.BOOKINGS_N_SELECTED",P(4,di,(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)||0))," ")}}function ks(n,u){if(n&1){let i=D();d(0,"span",82),E(1,ys,3,6,"span",83)(2,Ts,3,6,"span",83),d(3,"span",84),T(4,"\xA0|\xA0"),m(),d(5,"span",85),A("click",function(){C(i);let e=y().options,l=y();return B(l.deselectAllShortTermRegistryBookingsRows({table:(e==null?null:e.table)||"all"}))}),T(6),k(7,"translate"),m()()}if(n&2){let i=y().options,o=y();p("hidden",(i==null?null:i.table)&&V(6,Yt).includes(i.table)),c(),p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)===1),c(),p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)>1),c(4),L(x(7,4,"GENERIC.LABELS.DESELECT"))}}function Ss(n,u){if(n&1&&E(0,ps,5,5,"button",73)(1,gs,5,5,"button",73)(2,bs,5,5,"button",73)(3,hs,5,5,"button",73)(4,fs,6,6,"button",74)(5,ks,8,7,"span",75),n&2){let i=u.options,o=y();p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)&&(o.user==null||o.user.privileges==null?null:o.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)&&(o.user==null||o.user.privileges==null?null:o.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)&&(o.user==null||o.user.privileges==null?null:o.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)&&(o.user==null||o.user.privileges==null?null:o.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(i==null?null:i.table)&&!V(6,Io).includes(i.table)&&(o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)&&(o.user==null||o.user.privileges==null?null:o.user.privileges.bookings_accommodation_update)&&(o.user==null||o.user.account==null||o.user.account.api_integrations_obj==null||o.user.account.api_integrations_obj.aade_str_registry==null?null:o.user.account.api_integrations_obj.aade_str_registry.id)),c(),p("ngIf",o.shortTermRegistryBookingsTablesData==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"]==null||o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records==null?null:o.shortTermRegistryBookingsTablesData[(i==null?null:i.table)||"all"].selected_records.length)}}function xs(n,u){if(n&1){let i=D();d(0,"a",92),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryBookingsStatusUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",77),d(2,"span",48),T(3),k(4,"translate"),m()()}n&2&&(c(3),L(x(4,1,"GENERIC.LABELS.ACTIONS.CHANGE_BOOKING_STATUS")))}function vs(n,u){if(n&1){let i=D();d(0,"a",92),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryGuestNationalityUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",78),d(2,"span",48),T(3),k(4,"translate"),m()()}n&2&&(c(3),L(x(4,1,"GENERIC.LABELS.ACTIONS.CHANGE_NATIONALITY")))}function Rs(n,u){if(n&1){let i=D();d(0,"a",92),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryPaymentMethodUpdateModal({table:(e==null?null:e.table)||"all"}))}),I(1,"i",79),d(2,"span",48),T(3),k(4,"translate"),m()()}n&2&&(c(3),L(x(4,1,"GENERIC.LABELS.ACTIONS.CHANGE_PAYMENT_METHOD")))}function Es(n,u){if(n&1){let i=D();d(0,"a",93),k(1,"translate"),A("click",function(){C(i);let e=y().options,l=y();return B(l.openShortTermRegistryBookingsSubmissionModal({table:(e==null?null:e.table)||"all"}))}),I(2,"i",81),d(3,"span",48),T(4),k(5,"translate"),m()()}
1n&2&&(F("tooltip",x(1,2,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SEND_TO_AADE_EXPLANATORY")),c(4),L(x(5,4,"VIEWS.SETTINGS.AADE_STR_REGISTRY.ACTION_SUBMIT_TO_AADE")))}function Cs(n,u){if(n&1&&(d(0,"button",87),I(1,"i",88),m(),d(2,"div",89),E(3,xs,5,3,"a",90)(4,vs,5,3,"a",90)(5,Rs,5,3,"a",90)(6,Es,6,6,"a",91),m()),n&2){let i=y();c(3),p("ngIf",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null||i.shortTermRegistryBookingsTablesData.all.selected_records==null?null:i.shortTermRegistryBookingsTablesData.all.selected_records.length)&&(i.user==null||i.user.privileges==null?null:i.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null||i.shortTermRegistryBookingsTablesData.all.selected_records==null?null:i.shortTermRegistryBookingsTablesData.all.selected_records.length)&&(i.user==null||i.user.privileges==null?null:i.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null||i.shortTermRegistryBookingsTablesData.all.selected_records==null?null:i.shortTermRegistryBookingsTablesData.all.selected_records.length)&&(i.user==null||i.user.privileges==null?null:i.user.privileges.bookings_accommodation_update)),c(),p("ngIf",(i.shortTermRegistryBookingsTablesData==null||i.shortTermRegistryBookingsTablesData.all==null||i.shortTermRegistryBookingsTablesData.all.selected_records==null?null:i.shortTermRegistryBookingsTablesData.all.selected_records.length)&&(i.user==null||i.user.privileges==null?null:i.user.privileges.bookings_accommodation_update)&&(i.user==null||i.user.account==null||i.user.account.api_integrations_obj==null||i.user.account.api_integrations_obj.aade_str_registry==null?null:i.user.account.api_integrations_obj.aade_str_registry.id))}}var bn=(()=>{class n{constructor(i,o,e,l,t,_,g,a,s,r,O,h){this.http=i,this.cdRef=o,this.zone=e,this.spinner=l,this.modalService=t,this.translate=_,this.api=g,this.indexedDbService=a,this.storageService=s,this.utilsService=r,this.strRegistryService=O,this.superuser=h,this.spinnerName="STRRegistryPageLoadingSpinner",this.mainSidebarCollapsed=!1,this.isMobile=!1,this.windowWidthSize=0,this.bookingChannels=[],this.selectedShortTermRegistryBooking=null,this.shortTermRegistryBookingsTablesData={all:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsAll",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},ready_for_submission:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsReadyForSubmission",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},require_data:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsRequireData",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},invalid_data:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsInvali
1dData",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},submitted:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsSubmitted",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},submitted_as_draft:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsSubmittedAsDraft",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null},error_in_submission:{dt_options:{},dt_trigger:new St,dt_scroll_y:null,dt_columns:[],id:"tableShortTermRegistryBookingsErrorInSubmission",is_loading:!1,records:[],records_total_count:0,selected_records:[],filters:null}},this.isMobile=this.utilsService.isMobile,this.properties=[],this.bookingStatuses=this.utilsService.lodash.filter(this.utilsService.bookingStatuses,b=>b.value!=="archived"),this.bookingChannels=this.utilsService.lodash.orderBy(this.utilsService.bookingChannels,["label"],["asc"]).filter(b=>b.visible&&b.type==="accommodation")}ngOnInit(){return G(this,null,function*(){this.user=this.storageService.getItem("user"),this.isMobileSubscription=this.utilsService.windowIsMobile().subscribe(o=>{this.isMobile=o}),this.windowWidthSizeSubscription=this.utilsService.getWindowSize().subscribe(o=>{this.windowWidthSize=o.width,this.windowWidthSize>=992&&this.windowWidthSize<=1600&&this.collapseSideBar()}),this.windowWidthSize>=992&&this.windowWidthSize<=1600&&this.collapseSideBar(),this.user?.is_admin&&this.superuser.getAccounts({mini:!0}).then(o=>{this.allAccounts=this.utilsService.lodash.filter(o,e=>e.is_accommodation_provider),this.cdRef.detectChanges()}).catch(o=>{R.production||console.log(o)});try{this.user?.account?.account_id&&this.api.getProperties({options:{fields:["property_aade_use_type","area_size","tax_type","tax_percent","property_city_tax_percent","property_license_number_type","property_license_number_value"]}}).then(o=>{this.properties=o}).catch(o=>{R.production||console.log(o)})}catch{}let i=yield this.indexedDbService.getItem("str_registry_list_tables_filters");console.log(i);for(let o in this.shortTermRegistryBookingsTablesData)this.shortTermRegistryBookingsTablesData[o].filters=this.initializeTableFilters({table:o}),i?.content?.[o]?.filters?.daterange&&(this.shortTermRegistryBookingsTablesData[o].filters.daterange=et(et({},this.shortTermRegistryBookingsTablesData[o].filters.daterange),i.content[o].filters.daterange)),i?.content?.[o]?.filters?.table_params&&(this.shortTermRegistryBookingsTablesData[o].filters.table_params=et(et({},this.shortTermRegistryBookingsTablesData[o].filters.table_params),i.content[o].filters.table_params)),this.initializeShortTermRegistryBookingsDatatableComponentFunctions({table:o}),this.shortTermRegistryBookingsTablesData[o].dt_columns=yield this.getShortTermRegistryDatatableColumns({table:o}),this.getShortTermRegistryBookings({table:o})})}ngOnDestroy(){this.isMobileSubscription&&this.isMobileSubscription.unsubscribe(),this.windowWidthSizeSubscription&&this.windowWidthSizeSubscription.unsubscribe(),this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalHide
1Subscription&&this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalHideSubscription.unsubscribe(),this.selectedShortTermRegistryBookingModalHideSubscription&&this.selectedShortTermRegistryBookingModalHideSubscription.unsubscribe(),this.shortTermRegistryBookingsStatusUpdateModalHideSubscription&&this.shortTermRegistryBookingsStatusUpdateModalHideSubscription.unsubscribe(),this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalHideSubscription&&this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalHideSubscription.unsubscribe(),this.shortTermRegistryGuestNationalityUpdateModalHideSubscription&&this.shortTermRegistryGuestNationalityUpdateModalHideSubscription.unsubscribe(),this.shortTermRegistryBookingPaymentMethodUpdateModalHideSubscription&&this.shortTermRegistryBookingPaymentMethodUpdateModalHideSubscription.unsubscribe(),this.mainSidebarCollapsed&&!this.isMobile&&(document.body.classList.remove("sidebar-closed"),document.body.classList.remove("sidebar-collapse"),document.body.classList.add("sidebar-open"));try{this.indexedDbService.deleteItem("str_registry_list_tables_filters")}catch{}}getShortTermRegistryBookings(i){return G(this,null,function*(){try{return i.table==="all"?(this.shortTermRegistryBookingsTablesData.all.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.all.is_loading=!0,this.shortTermRegistryBookingsTablesData.all.selected_records=[],$("#select-all-checkbox-str-bookings-records-all").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-all").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-all").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-all").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.all.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.all.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.all.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.all.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.all.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.all.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.all.filters?.table_params.showcolumns:null,include_bookings_with_mapped_aade_credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t,l.fetch_service_recommendations=!1;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.all.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.all.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.c
1osts.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s?.accommodation_amount_aade_local||s?.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.all.is_loading=!1,$("#select-all-checkbox-str-bookings-records-all").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-all").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-all").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-all").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.all.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.all.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({recordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.all.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.all.is_loading=!1,$("#select-all-checkbox-str-bookings-records-all").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-all").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-all").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-all").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.all.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.all.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.all.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):i.table==="ready_for_submission"?(this.shortTermRegistryBookingsTablesData.ready_for_submission.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.ready_for_submission.is_loading=!0,this.shortTermRegistryBookingsTablesData.ready_for_submission.selected_records=[],$("#select-all-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-ready-for-submission").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-ready-for-submission").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.ready_for_submission.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.ready_for_submission.filters?.table_params.showcolumns:null,fetch_service_recommendations:!1,include_bookings_ready_for_submission:!0,include_bookings_with_mapped_aade_
1credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0,include_bookings_with_canceled_str_submission_status:!1,include_bookings_with_submitted_str_submission_status:!1},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.ready_for_submission.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.ready_for_submission.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.costs.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s?.accommodation_amount_aade_local||s?.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.ready_for_submission.is_loading=!1,$("#select-all-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-ready-for-submission").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-ready-for-submission").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.ready_for_submission.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.ready_for_submission.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({re
1cordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.ready_for_submission.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.ready_for_submission.is_loading=!1,$("#select-all-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-ready-for-submission").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-ready-for-submission").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.ready_for_submission.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.ready_for_submission.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.ready_for_submission.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):i.table==="require_data"?(this.shortTermRegistryBookingsTablesData.require_data.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.require_data.is_loading=!0,this.shortTermRegistryBookingsTablesData.require_data.selected_records=[],$("#select-all-checkbox-str-bookings-records-require-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-require-data").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-require-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-require-data").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.require_data.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.require_data.filters?.table_params.showcolumns:null,fetch_service_recommendations:!1,include_bookings_with_missing_data:!0,include_bookings_with_mapped_aade_credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0,include_bookings_with_canceled_str_submission_status:!1,include_bookings_with_submitted_str_submission_status:!1},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.require_data.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.require_data.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.c
1osts.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.require_data.is_loading=!1,$("#select-all-checkbox-str-bookings-records-require-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-require-data").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-require-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-require-data").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.require_data.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.require_data.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({recordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.require_data.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.require_data.is_loading=!1,$("#select-all-checkbox-str-bookings-records-require-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-require-data").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-require-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-require-data").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.require_data.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.require_data.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.require_data.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):i.table==="invalid_data"?(this.shortTermRegistryBookingsTablesData.invalid_data.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.invalid_data.is_loading=!0,this.shortTermRegistryBookingsTablesData.invalid_data.selected_records=[],$("#select-all-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-invalid-data").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-invalid-data").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.invalid_data.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.invalid_data.filters?.table_params.showcolumns:null,fetch_service_recommendations:!1,include_bookings_with_invali
1d_data:!0,include_bookings_with_mapped_aade_credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0,include_bookings_with_canceled_str_submission_status:!1,include_bookings_with_submitted_str_submission_status:!1},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.invalid_data.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.invalid_data.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.costs.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.invalid_data.is_loading=!1,$("#select-all-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-invalid-data").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-invalid-data").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.invalid_data.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.invalid_data.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({re
1cordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.invalid_data.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.invalid_data.is_loading=!1,$("#select-all-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-invalid-data").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-invalid-data").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-invalid-data").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.invalid_data.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.invalid_data.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.invalid_data.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):i.table==="submitted"?(this.shortTermRegistryBookingsTablesData.submitted.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.submitted.is_loading=!0,this.shortTermRegistryBookingsTablesData.submitted.selected_records=[],$("#select-all-checkbox-str-bookings-records-submitted").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-submitted").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.submitted.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.submitted.filters?.table_params.showcolumns:null,include_bookings_with_mapped_aade_credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t,l.fetch_service_recommendations=!1;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.submitted.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.submitted.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.c
1osts.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.submitted.is_loading=!1,$("#select-all-checkbox-str-bookings-records-submitted").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-submitted").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.submitted.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.submitted.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({recordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.submitted.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.submitted.is_loading=!1,$("#select-all-checkbox-str-bookings-records-submitted").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-submitted").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.submitted.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.submitted.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.submitted.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):i.table==="submitted_as_draft"?(this.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.submitted_as_draft.is_loading=!0,this.shortTermRegistryBookingsTablesData.submitted_as_draft.selected_records=[],$("#select-all-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted-as-draft").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.submitted_as_draft.filters?.table_params.showcolumns:null,include_bookings_with_mapped_aade_
1credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t,l.fetch_service_recommendations=!1;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.submitted_as_draft.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.submitted_as_draft.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.costs.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.submitted_as_draft.is_loading=!1,$("#select-all-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted-as-draft").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.submitted_as_draft.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({re
1cordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.submitted_as_draft.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.submitted_as_draft.is_loading=!1,$("#select-all-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-submitted-as-draft").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-submitted-as-draft").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.submitted_as_draft.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table}),Promise.resolve()):(i.table==="error_in_submission"&&(this.shortTermRegistryBookingsTablesData.error_in_submission.dt_options=kt(et({autoWidth:!1,serverSide:!0,processing:!0,ajax:(o,e)=>{this.shortTermRegistryBookingsTablesData.error_in_submission.is_loading=!0,this.shortTermRegistryBookingsTablesData.error_in_submission.selected_records=[],$("#select-all-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-error-in-submission").attr("disabled","true"),$(".select-row-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-error-in-submission").attr("disabled","true");let l={draw:o.draw,columns:o.columns,order:[],start:o.start||0,length:o.length||10,search:o?.search?.value?o.search.value:null,date:this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params?.date||null,daterange:this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params?.daterange?.start&&this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params?.daterange?.end?this.shortTermRegistryBookingsTablesData.error_in_submission.filters.table_params.daterange:null,filterby:this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params?.filterby||null,showcolumns:this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params?.showcolumns?.length>0?this.shortTermRegistryBookingsTablesData.error_in_submission.filters?.table_params.showcolumns:null,include_bookings_with_mapped_aade_credentials_account:!0,include_bookings_with_mapped_source_aade_credentials_account:!0,include_bookings_with_mapped_source_property:!0,include_bookings_with_defined_property_aade_use_type:!0,include_bookings_with_canceled_str_submission_status:!1,include_bookings_with_submitted_str_submission_status:!1},t=[];for(let a=0;a<o.columns.length;a++)for(let s=0;s<o.order.length;s++)o.order[s].column===a&&t.push({column_index:s,column_name:o.columns[a].data,dir:o.order[s].dir});l.order=t,l.fetch_service_recommendations=!1;let _=["booking_id","service_id","customer_id","provider_id","booking_channel","booking_external_id","booking_source","booking_reference_id","start_date_str","start_time_str","end_date_str","end_time_str","duration_in_nights","amount","currency","status","payment_status","payment_method","canceled","canceled_at","canceled_by","cancelation_policy_amount_collected","created_at","updated_at","accommodation_amount_aade","fee_climate_crisis_resilience","tax_vat","service_title","service_country","service_license_number_value","str_submission_status","str_submission_meta","is_valid_for_submission","submission_validity_meta","customer_first_name","customer_last_name","customer_fullname","customer_tax_id","customer_passport_number","customer_identity_card_number","customer_driving_license_number","customer_nationality","customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen","customer_is_foreigner","aade_str_integration_id","aade_str_property_mapping_uuid","aade_str_source_property_id","aade_str_credentials_mapping_uuid","account_aade_credentials_uuid","costs"],g={};g["X-Graph-Fields"]=_.toString(),this.http.post(`${R.params.host}/api/str-registry/bookings-dt`,l,{headers:g}).subscribe(a=>{try{this.shortTermRegistryBookingsTablesData.error_in_submission.records=a.data,R.production||console.log(a);for(let s of this.shortTermRegistryBookingsTablesData.error_in_submission.records){s.booking_channel_label=this.utilsService.getBookingChannelLabel(s.booking_channel),s.status_label=this.utilsService.getBookingStatusLabel(s.status),s.payment_status_label=this.utilsService.getBookingPaymentStatusLabel(s.payment_status),s.str_submission_status_label=this.utilsService.getBookingAADEStrSubmissionStatusLabel({booking_str_submission_status:s.str_submission_status}),s.start_date=this.utilsService.getDateFromISO(s.start_date),s.start_time=this.utilsService.getDateFromISO(s.start_time),s.end_date=this.utilsService.getDateFromISO(s.end_date),s.end_time=this.utilsService.getDateFromISO(s.end_time),s.actions_dropdown=null,s.costs=new Rt(s?.costs||null),s.c
1osts.initializeObjects();for(let r in s.costs)ot.visible_items_default.includes(r)&&!s.costs[r].type&&(s.costs[r].type=r);s["costs.total_amount"]=s.costs?.total_amount?.amount_total_local||s.costs?.total_amount?.amount_total||s.amount||0,s["costs.fee_climate_crisis_resilience"]=s.costs?.fee_climate_crisis_resilience?.amount_total_local||s.costs?.fee_climate_crisis_resilience?.amount_total||s.fee_climate_crisis_resilience||0,s["costs.tax_vat"]=s.costs?.tax_vat?.amount_total_local||s.costs?.tax_vat?.amount_total||s.tax_vat||0,s["costs.tax_city"]=s.costs?.tax_city?.amount_total_local||s.costs?.tax_city?.amount_total||s.tax_city||0,s["costs.cancelation_policy_amount_collected"]=s.costs?.cancelation_policy_amount_collected?.amount_total_local||s.costs?.cancelation_policy_amount_collected?.amount_total||s.cancelation_policy_amount_collected||0,s["costs.accommodation_amount_aade"]=s.costs?.accommodation_amount_aade?.amount_total_local||s.costs?.accommodation_amount_aade?.amount_total||s.accommodation_amount_aade||0,!s.customer_is_foreigner&&(s.customer_is_greek||s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_greek?s.customer_is_foreigner=!1:(s.customer_is_eu_citizen||s.customer_is_not_eu_citizen)&&(s.customer_is_foreigner=!0))}this.shortTermRegistryBookingsTablesData.error_in_submission.is_loading=!1,$("#select-all-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-error-in-submission").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-error-in-submission").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.error_in_submission.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.error_in_submission.records_total_count=a?.recordsTotal||a?.data?.length||0,this.cdRef.detectChanges(),e({recordsTotal:a.recordsTotal,recordsFiltered:a.recordsFiltered,data:this.shortTermRegistryBookingsTablesData.error_in_submission.records})}catch(s){R.production||console.log(s),this.shortTermRegistryBookingsTablesData.error_in_submission.is_loading=!1,$("#select-all-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$("#select-all-checkbox-str-bookings-records-error-in-submission").removeAttr("disabled"),$(".select-row-checkbox-str-bookings-records-error-in-submission").prop("checked",!1),$(".select-row-checkbox-str-bookings-records-error-in-submission").removeAttr("disabled"),this.shortTermRegistryBookingsTablesData.error_in_submission.dt_trigger.next(),this.shortTermRegistryBookingsTablesData.error_in_submission.records_total_count=0,this.cdRef.detectChanges(),e({recordsTotal:0,recordsFiltered:0,data:[]})}})},columns:this.shortTermRegistryBookingsTablesData.error_in_submission.dt_columns,columnDefs:[{type:"date",targets:[13]},{targets:0,orderable:!1}]},R.params.datatables.options),{lengthMenu:[[10,25,50],[10,25,50]],order:[[13,"desc"]],select:{style:"multi",selector:"td:first-child > .none"}}),this.initializeShortTermRegistryDatatableRowsSelector({table:i.table})),Promise.resolve())}catch(o){this.shortTermRegistryBookingsTablesData.all.is_loading=!1,this.shortTermRegistryBookingsTablesData.ready_for_submission.is_loading=!1,this.shortTermRegistryBookingsTablesData.require_data.is_loading=!1,this.shortTermRegistryBookingsTablesData.invalid_data.is_loading=!1,this.shortTermRegistryBookingsTablesData.submitted.is_loading=!1,this.shortTermRegistryBookingsTablesData.submitted_as_draft.is_loading=!1,this.shortTermRegistryBookingsTablesData.error_in_submission.is_loading=!1,this.shortTermRegistryBookingsTablesData.all.records=[],this.shortTermRegistryBookingsTablesData.ready_for_submission.records=[],this.shortTermRegistryBookingsTablesData.require_data.records=[],this.shortTermRegistryBookingsTablesData.invalid_data.records=[],this.shortTermRegistryBookingsTablesData.submitted.records=[],this.shortTermRegistryBookingsTablesData.submitted_as_draft.records=[],this.shortTermRegistryBookingsTablesData.error_in_submission.records=[],R.production||console.log(o)}})}getShortTermRegistryDatatableColumns(i){return G(this,null,function*(){let o=[];try{return i.table==="all"?o=[{title:` 2 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 3 <input type="checkbox" id="select-all-checkbox-str-bookings-records-all" /> 4 <label for="select-all-checkbox-str-bookings-records-all"></label> 5 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-all-${_.row}`;return` 6 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 7 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-all" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 8 <label for="${g}"></label> 9 </div> 10 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toProm
10ise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'all' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
10ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 11 <span class="badge ${a}"> 12 ${this.utilsService.getBookingStatusLabel(t.status)} 13 </span> 14 `)}},{title:yield this.translate.get("GENERIC.LABELS.SUBMISSION_STATUS").toPromise(),data:"str_submission_status_label",className:"str_submission_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.str_submission_status==="pending"?a="badge-info":t.str_submission_status==="submitted"?a="badge-success":t.str_submission_status==="draft"?a="badge-info":t.str_submission_status==="failed"||t.str_submission_status==="canceled"?a="badge-danger":a="badge-info",t.str_submission_status?$(e).html(` 15 <span class="badge ${a}"> 16 ${t.str_submission_status_label} 17 </span> 18 `):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="ready_for_submission"?o=[{title:` 19 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 20 <input type="checkbox" id="select-all-checkbox-str-bookings-records-ready-for-submission" /> 21 <label for="select-all-checkbox-str-bookings-records-ready-for-submission"></label> 22 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-ready-for-submission-${_.row}`;return` 23 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 24 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-ready-for-submission" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 25 <label for="${g}"></label> 26 </div> 27 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'ready_for_submission' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
27ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 28 <span class="badge ${a}"> 29 ${this.utilsService.getBookingStatusLabel(t.status)} 30 </span> 31 `)}},{title:yield this.translate.get("GENERIC.LABELS.SUBMISSION_STATUS").toPromise(),data:"str_submission_status_label",className:"str_submission_status",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a="";t.str_submission_status==="pending"?a="badge-info":t.str_submission_status==="submitted"?a="badge-success":t.str_submission_status==="draft"?a="badge-info":t.str_submission_status==="failed"||t.str_submission_status==="canceled"?a="badge-danger":a="badge-info",t.str_submission_status?$(e).html(` 32 <span class="badge ${a}"> 33 ${t.str_submission_status_label} 34 </span> 35 `):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="require_data"?o=[{title:` 36 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 37 <input type="checkbox" id="select-all-checkbox-str-bookings-records-require-data" /> 38 <label for="select-all-checkbox-str-bookings-records-require-data"></label> 39 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-require-data-${_.row}`;return` 40 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 41 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-require-data" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 42 <label for="${g}"></label> 43 </div> 44 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'require_data' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
44ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 45 <span class="badge ${a}"> 46 ${this.utilsService.getBookingStatusLabel(t.status)} 47 </span> 48 `)}},{title:yield this.translate.get("GENERIC.LABELS.MISSING_DATA").toPromise(),data:"str_submission_status_label",className:"str_submission_status",orderable:!1,fnCreatedCell:(e,l,t,_,g)=>{if(!t?.submission_validity_meta?.errors?.length){$(e).html("");return}let a=t.submission_validity_meta.errors.map(s=>{let r=this.utilsService.getBookingAADEStrSubmissionValidityErrorValueItemLabel({submission_validity_error_value:s.value});return r?`<span class="badge badge-warning text-wrap">${r}</span>`:null}).filter(s=>s!==null);a?.length?$(e).html(`${a.join(", ")}`):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="invalid_data"?o=[{title:` 49 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 50 <input type="checkbox" id="select-all-checkbox-str-bookings-records-invalid-data" /> 51 <label for="select-all-checkbox-str-bookings-records-invalid-data"></label> 52 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-invalid-data-${_.row}`;return` 53 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 54 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-invalid-data" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 55 <label for="${g}"></label> 56 </div> 57 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'invalid_data' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
57ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 58 <span class="badge ${a}"> 59 ${this.utilsService.getBookingStatusLabel(t.status)} 60 </span> 61 `)}},{title:yield this.translate.get("GENERIC.LABELS.INVALID_DATA").toPromise(),data:"str_submission_status_label",className:"str_submission_status",orderable:!1,fnCreatedCell:(e,l,t,_,g)=>{if(!t?.submission_validity_meta?.errors?.length){$(e).html("");return}let a=t.submission_validity_meta.errors.map(s=>{let r=this.utilsService.getBookingAADEStrSubmissionValidityErrorValueItemLabel({submission_validity_error_value:s.value});return r?`<span class="badge badge-warning text-wrap">${r}</span>`:null}).filter(s=>s!==null);a?.length?$(e).html(`${a.join(", ")}`):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="submitted"?o=[{title:` 62 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 63 <input type="checkbox" id="select-all-checkbox-str-bookings-records-submitted" /> 64 <label for="select-all-checkbox-str-bookings-records-submitted"></label> 65 </div>`,data:null,orderable:!1,searchable:!1,visible:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-submitted-${_.row}`;return` 66 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 67 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-submitted" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 68 <label for="${g}"></label> 69 </div> 70 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'submitted' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
70ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 71 <span class="badge ${a}"> 72 ${this.utilsService.getBookingStatusLabel(t.status)} 73 </span> 74 `)}},{title:yield this.translate.get("GENERIC.LABELS.SUBMISSION_STATUS").toPromise(),data:"str_submission_status_label",className:"str_submission_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.str_submission_status==="pending"?a="badge-info":t.str_submission_status==="submitted"?a="badge-success":t.str_submission_status==="draft"?a="badge-info":t.str_submission_status==="failed"||t.str_submission_status==="canceled"?a="badge-danger":a="badge-info",t.str_submission_status?$(e).html(` 75 <span class="badge ${a}"> 76 ${t.str_submission_status_label} 77 </span> 78 `):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="submitted_as_draft"?o=[{title:` 79 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 80 <input type="checkbox" id="select-all-checkbox-str-bookings-records-submitted-as-draft" /> 81 <label for="select-all-checkbox-str-bookings-records-submitted-as-draft"></label> 82 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-submitted-as-draft-${_.row}`;return` 83 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 84 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-submitted-as-draft" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 85 <label for="${g}"></label> 86 </div> 87 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'submitted_as_draft' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
87ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 88 <span class="badge ${a}"> 89 ${this.utilsService.getBookingStatusLabel(t.status)} 90 </span> 91 `)}},{title:yield this.translate.get("GENERIC.LABELS.SUBMISSION_STATUS").toPromise(),data:"str_submission_status_label",className:"str_submission_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.str_submission_status==="pending"?a="badge-info":t.str_submission_status==="submitted"?a="badge-success":t.str_submission_status==="draft"?a="badge-info":t.str_submission_status==="failed"||t.str_submission_status==="canceled"?a="badge-danger":a="badge-info",t.str_submission_status?$(e).html(` 92 <span class="badge ${a}"> 93 ${t.str_submission_status_label} 94 </span> 95 `):$(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:i.table==="error_in_submission"?o=[{title:` 96 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 97 <input type="checkbox" id="select-all-checkbox-str-bookings-records-error-in-submission" /> 98 <label for="select-all-checkbox-str-bookings-records-error-in-submission"></label> 99 </div>`,data:null,orderable:!1,searchable:!1,defaultContent:"",className:"text-center",render:(e,l,t,_)=>{let g=`row-checkbox-str-bookings-records-error-in-submission-${_.row}`;return` 100 <div class="icheck-tourmie-blue icheck-table-rows-selector d-inline"> 101 <input type="checkbox" class="select-checkbox select-row-checkbox-str-bookings-records-error-in-submission" data-row-index="${_.row}" data-row-booking-id="${e?.booking_id||"null"}" id="${g}" /> 102 <label for="${g}"></label> 103 </div> 104 `}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.GUEST").toPromise(),data:"customer_fullname",className:"customer_fullname",fnCreatedCell:(e,l,t,_,g)=>{let a=`<a class="text-tourmie-blue" href="/bookings/${t.booking_id}" onclick="event.preventDefault(); tourmie_functions_ng.openStrRegistryListPageBookingModal({ booking_id: '${t.booking_id}', table: 'error_in_submission' })">${t.customer_fullname}</a>`;t.service_title&&(a+=`<span class="text-muted font-size-13 d-block">${t.service_title}</span>`),(t.booking_channel_label||t.booking_channel)&&(a+=`<span class="text-muted font-size-13 d-block">${t.booking_channel_label||t.booking_channel}</span>`),$(e).html(a)}},{title:yield this.translate.get("GENERIC.LABELS.CHANNEL").toPromise(),data:"booking_channel",className:"booking_channel",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.booking_channel_label||t.booking_channel)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_IN").toPromise(),data:"start_date",className:"start_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.start_date_str)}},{title:yield this.translate.get("COMPONENTS.BOOKINGS_TABLE.CHECK_OUT").toPromise(),data:"end_date",className:"end_date",fnCreatedCell:(e,l,t,_,g)=>{$(e).html(t.end_date_str)}},{title:this.utilsService.getBookingCostLabel({type:"total_amount"})||"Total booking amount",data:"costs.total_amount",className:"costs_total_amount",fnCreatedCell:(e,l,t,_,g)=>{let a=t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t?.costs?.total_amount?.amount_total_local||t?.costs?.total_amount?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.total_amount.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"total_amount",new_value:t.costs.total_amount?.amount_total_local||t.costs.total_amount?.amount_total})}catch{t.costs.total_amount.amount_total_local=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"fee_climate_crisis_resilience"})||"Climate Crisis Resilience Fee",data:"costs.fee_climate_crisis_resilience",className:"costs_fee_climate_crisis_resilience",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.fee_climate_crisis_resilience?.amount_total_local||t.costs?.fee_climate_crisis_resilience?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.fee_climate_crisis_resilience.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"fee_climate_crisis_resilience",new_value:t.costs.fee_climate_crisis_resilience?.amount_total_local||t.costs.fee_climate_crisis_resilience?.amount_total})}catch{t.costs.fee_climate_crisis_resilience.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"cancelation_policy_amount_collected"})||"Total amount collected based on the cancelation policy",data:"costs.cancelation_policy_amount_collected",className:"cancelation_policy_amount_collected",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.cancelation_policy_amount_collected?.amount_total_local||t.costs?.cancelation_policy_amount_collected?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.cancelation_policy_amount_collected.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"cancelation_policy_amount_collected",new_value:t.costs.cancelation_policy_amount_collected?.amount_total_local||t.costs.cancelation_policy_amount_collected?.amount_total})}catch{t.costs.cancelation_policy_amount_collected.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_vat"})||"VAT",data:"costs.tax_vat",className:"costs_tax_vat",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_vat?.amount_total_local||t.costs?.tax_vat?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_vat.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_vat",new_value:t.costs.tax_vat?.amount_total_local||t.costs.tax_vat?.amount_total})}catch{t.costs.tax_vat.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"tax_city"})||"City tax",data:"costs.tax_city",className:"costs_tax_city",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs?.tax_city?.amount_total_local||t.costs?.tax_city?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.tax_city.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"tax_city",new_value:t.costs.tax_city?.amount_total_local||t.costs.tax_city?.amount_total})}catch{t.costs.tax_city.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:this.utilsService.getBookingCostLabel({type:"accommodation_amount_aade"})||"Accommodation amount (AADE)",data:"costs.accommodation_amount_aade",className:"costs_accommodation_amount_aade",fnCreatedCell:(e,l,t,_,g)=>{let a=t.costs?.accommodation_amount_aade?.amount_total_local||t.costs?.accommodation_amount_aade?.amount_total||0,s=`<span class="editable-text">${a>=0?this.utilsService.formatPrice({price:a}):"-"}</span>`;$(e).html(s);let r=a;$(e).off("click").on("click",".editable-text",()=>{let O=$(e).text().trim();$(e).html(`<input type="number" class="form-control editable-input" value="${t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total||0}" />`);let h=$(e).find("input");h.trigger("focut").trigger("select"),h.on("blur keydown",b=>{if(b.key==="Escape"){$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);return}if(b.type==="blur"||b.key==="Enter"){let S=h.val(),f=isNaN(parseFloat(S.toString()))?null:parseFloat(S.toString());r!==f&&(t.costs.accommodation_amount_aade.amount_total_local=f||null),$(e).html(`<span class="editable-text">${(t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total)>=0?this.utilsService.formatPrice({price:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total}):"-"}</span>`);try{r!==f&&this.updateTableColumnValueInDB({record:t,field_name:"accommodation_amount_aade",new_value:t.costs.accommodation_amount_aade?.amount_total_local||t.costs.accommodation_amount_aade?.amount_total})}catch{t.costs.accommodation_amount_aade.amount_total=r,$(e).html(`<span class="editable-text">${r>=0?this.utilsService.formatPrice({price:r}):"-"}</span>`)}}})})}},{title:yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toProm
104ise(),data:"status_label",className:"booking_status",fnCreatedCell:(e,l,t,_,g)=>{let a="";t.status==="pending"?a="badge-info":t.status==="confirmed"?a="badge-success":["canceled","archived","rejected"].includes(t.status)?a="badge-danger":a="badge-info",$(e).html(` 105 <span class="badge ${a}"> 106 ${this.utilsService.getBookingStatusLabel(t.status)} 107 </span> 108 `)}},{title:yield this.translate.get("GENERIC.LABELS.SUBMISSION_ERRORS").toPromise(),data:"str_submission_status_label",className:"str_submission_status",fnCreatedCell:(e,l,t,_,g)=>{if(t?.str_submission_meta?.meta?.details){let a=`<span class="badge badge-danger text-wrap">${t.str_submission_meta.meta.details}</span>`;$(e).html(a)}else $(e).html("")}},{title:yield this.translate.get("GENERIC.LABELS.CREATED_AT").toPromise(),data:"created_at",className:"created_at",visible:!1,fnCreatedCell:(e,l,t,_,g)=>{$(e).html(this.utilsService.moment(t.created_at).format("YYYY-MM-DD HH:mm"))}}]:o=[],Promise.resolve(o)}catch(e){return R.production||console.log(e),Promise.resolve(o)}})}initializeShortTermRegistryDatatableRowsSelector(i){try{if(i.table==="all"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-all",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.all.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-all").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-all",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.all.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-all").length,s=$(".select-row-checkbox-str-bookings-records-all:checked").length;$("#select-all-checkbox-str-bookings-records-all").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="ready_for_submission"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-ready-for-submission",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.ready_for_submission.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-ready-for-submission").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-ready-for-submission",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.ready_for_submission.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-ready-for-submission").length,s=$(".select-row-checkbox-str-bookings-records-ready-for-submission:checked").length;$("#select-all-checkbox-str-bookings-records-ready-for-submission").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="require_data"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-require-data",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.require_data.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-require-data").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-require-data",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.require_data.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-require-data").length,s=$(".select-row-checkbox-str-bookings-records-require-data:checked").length;$("#select-all-checkbox-str-bookings-records-require-data").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="invalid_data"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-invalid-data",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.invalid_data.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-invalid-data").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-invalid-data",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.invalid_data.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-invalid-data").length,s=$(".select-row-checkbox-str-bookings-records-invalid-data:checked").length;$("#select-all-checkbox-str-bookings-records-invalid-data").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="submitted"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-submitted",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.submitted.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-submitted").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-submitted",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.submitted.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-submitted").length,s=$(".select-row-checkbox-str-bookings-records-submitted:checked").length;$("#select-all-checkbox-str-bookings-records-submitted").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="submitted_as_draft"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-submitted-as-draft",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.submitted_as_draft.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-submitted-as-draft").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-submitted-as-draft",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.submitted_as_draft.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-submitted-as-draft").length,s=$(".select-row-checkbox-str-bookings-records-submitted-as-draft:checked").length;$("#select-all-checkbox-str-bookings-records-submitted-as-draft").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}else if(i.table==="error_in_submission"){let o=null;$(document).on("change","#select-all-checkbox-str-bookings-records-error-in-submission",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,t=>t?.dt&&t?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.error_in_submission.id)?.dt:null),!o)return;let l=!!(e?.target).checked;$(".select-row-checkbox-str-bookings-records-error-in-submission").prop("checked",l),l?o.rows({search:"applied"}).select():o.rows().deselect(),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})}),$(document).on("change",".select-row-checkbox-str-bookings-records-error-in-submission",e=>{if(!o&&this.datatableElements?.length&&(o=this.datatableElements?._results?.length?this.utilsService.lodash.find(this.datatableElements?._results,r=>r?.dt&&r?.el?.nativeElement?.id===this.shortTermRegistryBookingsTablesData.error_in_submission.id)?.dt:null),!o)return;let l=e?.target?.id||null;if(!l)return;let t=$(`#${l}`),_=parseInt(t.data("row-index"),10),g=o.row(_);t.is(":checked")?g.select():g.deselect();let a=$(".select-row-checkbox-str-bookings-records-error-in-submission").length,s=$(".select-row-checkbox-str-bookings-records-error-in-submission:checked").length;$("#select-all-checkbox-str-bookings-records-error-in-submission").prop("checked",a===s),this.handleShortTermRegistryDatatableRowsSelection({table:i.table})})}}catch{}}initializeTableFilters(i){let o={daterange:{start:this.utilsService.moment().startOf("month").toDate(),start_str:null,end:this.utilsService.moment().endOf("month").toDate(),end_str:null,label:null,calendar_is_visible:!1,picker_options:{locale:{format:"YYYY-MM-DD"},autoApply:!0,alwaysShowCalendars:!0,drops:"auto",opens:"right"}},table_params:{date:null,daterange:{start:null,end:null},showcolumns:[],hidecolumns:[],filterby:{account_id:this.user?.account?.account_id||null,service_id:null,date:"created_at",status:null,checkin_submitted:null,booking_channel:null,str_submission_status:null,str_submission_statuses:[]}}};return i?.table==="submitted"&&(o.table_params.filterby.str_submission_statuses=["submitted"]),i?.table==="submitted_as_draft"&&(o.table_params.filterby.str_submission_statuses=["draft"]),i?.table==="error_in_submission"&&(o.table_params.filterby.str_submission_status="failed"),o}handleShortTermRegistryDatatableRowsSelection(i){if(i.table==="all"){let o=[];$(".select-row-checkbox-str-bookings-records-all:checked").each(function(){let e=$(this).data("row-booking-id");
108e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.all.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.all.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.all.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.all.selected_records,selectedBookingIds:o})}else if(i.table==="ready_for_submission"){let o=[];$(".select-row-checkbox-str-bookings-records-ready-for-submission:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.ready_for_submission.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.ready_for_submission.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.ready_for_submission.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.ready_for_submission.selected_records,selectedBookingIds:o})}else if(i.table==="require_data"){let o=[];$(".select-row-checkbox-str-bookings-records-require-data:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.require_data.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.require_data.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.require_data.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.require_data.selected_records,selectedBookingIds:o})}else if(i.table==="invalid_data"){let o=[];$(".select-row-checkbox-str-bookings-records-invalid-data:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.invalid_data.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.invalid_data.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.invalid_data.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.invalid_data.selected_records,selectedBookingIds:o})}else if(i.table==="submitted"){let o=[];$(".select-row-checkbox-str-bookings-records-submitted:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.submitted.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.submitted.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.submitted.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.submitted.selected_records,selectedBookingIds:o})}else if(i.table==="submitted_as_draft"){let o=[];$(".select-row-checkbox-str-bookings-records-submitted-as-draft:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.submitted_as_draft.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.submitted_as_draft.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.submitted_as_draft.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.submitted_as_draft.selected_records,selectedBookingIds:o})}else if(i.table==="error_in_submission"){let o=[];$(".select-row-checkbox-str-bookings-records-error-in-submission:checked").each(function(){let e=$(this).data("row-booking-id");e!=null&&e!=="null"&&o.push(e)}),o.length?this.shortTermRegistryBookingsTablesData.error_in_submission.selected_records=this.utilsService.lodash.filter(this.shortTermRegistryBookingsTablesData.error_in_submission.records||[],e=>o.includes(e.booking_id)):this.shortTermRegistryBookingsTablesData.error_in_submission.selected_records=[],R.production||console.log({selectedBookings:this.shortTermRegistryBookingsTablesData.error_in_submission.selected_records,selectedBookingIds:o})}else return}deselectAllShortTermRegistryBookingsRows(i){if(i.table==="all")$("#select-all-checkbox-str-bookings-records-all").prop("checked",!1).trigger("change");else if(i.table==="ready_for_submission")$("#select-all-checkbox-str-bookings-records-ready-for-submission").prop("checked",!1).trigger("change");else if(i.table==="require_data")$("#select-all-checkbox-str-bookings-records-require-data").prop("checked",!1).trigger("change");else if(i.table==="invalid_data")$("#select-all-checkbox-str-bookings-records-invalid-data").prop("checked",!1).trigger("change");else if(i.table==="submitted")$("#select-all-checkbox-str-bookings-records-submitted").prop("checked",!1).trigger("change");else if(i.table==="submitted_as_draft")$("#select-all-checkbox-str-bookings-records-submitted-as-draft").prop("checked",!1).trigger("change");else if(i.table==="error_in_submission")$("#select-all-checkbox-str-bookings-records-error-in-submission").prop("checked",!1).trigger("change");else return}updateTableColumnValueInDB(i){return G(this,null,function*(){try{if(i?.field_name&&["customer_is_greek","customer_is_eu_citizen","customer_is_not_eu_citizen"].includes(i.field_name))return Promise.resolve(null);this.spinner.show(this.spinnerName);let o=yield this.http.put(`${R.params.host}/api/str-registry/bookings-dt-column-value`,{record:i.record,fields:[{field_name:i.field_name,new_value:i.new_value}]}).toPromise();this.spinner.hide(this.spinnerName);let e=null;if(["total_amount","fee_climate_crisis_resilience","cancelation_policy_amount_collected","accommodation_amount_aade","tax_vat"].includes(i.field_name))e=this.utilsService.getBookingCostLabel({type:i.field_name||null});else switch(i.field_name){case"costs":e=yield this.translate.get("GENERIC.LABELS.PAYMENTS.BOOKING_AMOUNTS").toProm
108ise();break;case"status":e=yield this.translate.get("GENERIC.LABELS.BOOKING_STATUS").toPromise();break;case"customer_nationality":e=yield this.translate.get("VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.NATIONALITY").toPromise();break;case"customer_tax_id":e=yield this.translate.get("VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.VAT").toPromise();break;case"customer_passport_number":e=yield this.translate.get("VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.PASSPORT_NUMBER").toPromise();break;case"customer_identity_card_number":e=yield this.translate.get("VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.NATIONAL_ID").toPromise();break;case"customer_driving_license_number":e=yield this.translate.get("VIEWS.PUBLIC.HOST_PAGE.HOST_CHECK_IN.PLACEHOLDERS.EXTRA_GUEST.DRIVING_LICENSE_NUMBER").toPromise();break;case"customer_is_foreigner":e=yield this.translate.get("GENERIC.LABELS.GUEST_IS_FOREIGNER").toPromise();break;default:break}let l=this.utilsService.lodash.find(o.fields_updated||[],t=>t.field_name===i.field_name);l?.field_name?this.utilsService.showToast({message:yield this.translate.get("GENERIC.LABELS.VALUE_OF_FIELD_WAS_UPDATED_TO_NEW_VALUE",{fieldNameLabel:e||i.field_name||"-",newValue:l.new_value}).toPromise(),type:"success"}):this.utilsService.showToast({message:yield this.translate.get("GENERIC.LABELS.VALUE_OF_FIELD_WAS_NOT_UPDATED_TO_NEW_VALUE",{fieldNameLabel:e||i.field_name||"-",newValue:i.new_value}).toPromise(),type:"info"});try{l?.field_name==="total_amount"&&(yield this.strRegistryService.refreshBookingCostsAfterTotalAmountChange({booking:i.record}))?.message==="costs_updated"&&this.refreshShortTermRegistryBookingsDatatable()}catch{}return Promise.resolve(o)}catch(o){return this.spinner.hide(this.spinnerName),Promise.reject(o)}})}initializeShortTermRegistryBookingsDatatableComponentFunctions(i){window&&!window.tourmie_functions_ng.redirectToBooking&&(window.tourmie_functions_ng.redirectToBooking=o=>{this.zone.run(()=>{this.utilsService.routerRedirect({path:`/bookings/${o.booking_id}`})})}),window&&!window.tourmie_functions_ng.openStrRegistryListPageBookingModal&&(window.tourmie_functions_ng.openStrRegistryListPageBookingModal=o=>{this.zone.run(()=>{this.openShortTermRegistryBookingModal({booking_id:o?.booking_id||null,table:o?.table||i.table})})})}openShortTermRegistryBookingModal(i){return G(this,null,function*(){if(R.production||console.log(i),!i?.booking_id)return Promise.resolve();try{let o=this.utilsService.lodash.find(this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.records||[],e=>e.booking_id===i.booking_id);if(!o)return Promise.resolve();o?.costs&&(o.costs=this.utilsService.defineBookingCostRecordsObjLabels({costs:o.costs})),this.selectedShortTermRegistryBooking=o,this.selectedShortTermRegistryBookingModalRef=this.modalService.show(ti,{class:"modal-right modal-right-w-500",initialState:{user:this.user,record:this.selectedShortTermRegistryBooking}}),this.selectedShortTermRegistryBookingModalHideSubscription=this.selectedShortTermRegistryBookingModalRef.onHide.subscribe({next:e=>G(this,null,function*(){if(R.production||console.log(this.selectedShortTermRegistryBookingModalRef?.content||null),!this.selectedShortTermRegistryBookingModalRef?.content?.action||this.selectedShortTermRegistryBookingModalRef?.content?.action!=="update"){this.selectedShortTermRegistryBooking=null;return}if(R.production||console.log(this.selectedShortTermRegistryBooking),this.selectedShortTermRegistryBookingModalRef?.content?.attributes_changed&&!this.utilsService.lodash.isEmpty(this.selectedShortTermRegistryBookingModalRef?.content?.attributes_changed)){if(this.selectedShortTermRegistryBookingModalRef.content.costs_attributes_changed?.total_amount)try{(yield this.strRegistryService.refreshBookingCostsAfterTotalAmountChange({booking:this.selectedShortTermRegistryBooking}))?.message==="costs_updated"&&this.refreshShortTermRegistryBookingsDatatable()}catch{}this.refreshShortTermRegistryBookingsDatatable()}yield this.utilsService.delay(250),this.selectedShortTermRegistryBooking=null}),error:e=>{this.selectedShortTermRegistryBooking=null}})}catch(o){this.selectedShortTermRegistryBooking=null,this.spinner.hide(this.spinnerName),R.production||console.log(o)}})}
108openShortTermRegistryBookingsSubmissionModal(i){let o={id:1,keyboard:!1,ignoreBackdropClick:!0,class:"modal-lg",initialState:{user:this.user,bookings:this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.selected_records||[],tableName:i?.table||null}};this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalRef=this.modalService.show(Ke,o),this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalRef.content={result:null},this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalHideSubscription=this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalRef.onHidden.subscribe({next:e=>G(this,null,function*(){let l=this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalRef?.content?.result||null;if(R.production||console.log(this.shortTermRegistryBookingsSubmitToAADEStrRegistryModalRef.content),!(!l?.task_submission_response?.taskId||!l?.bookings_submitted?.length))try{this.refreshShortTermRegistryBookingsDatatable()}catch{}}),error:e=>{R.production||console.log(e)}})}openShortTermRegistryBookingsStatusUpdateModal(i){let o={id:2,keyboard:!1,ignoreBackdropClick:!0,initialState:{user:this.user,service_type:"accommodation",bookings:this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.selected_records||[]}};this.shortTermRegistryBookingsStatusUpdateModalRef=this.modalService.show(Ge,o),this.shortTermRegistryBookingsStatusUpdateModalRef.content={result:null},this.shortTermRegistryBookingsStatusUpdateModalHideSubscription=this.shortTermRegistryBookingsStatusUpdateModalRef.onHidden.subscribe({next:e=>G(this,null,function*(){if(R.production||console.log(this.shortTermRegistryBookingsStatusUpdateModalRef.content),!(!this.shortTermRegistryBookingsStatusUpdateModalRef?.content?.result?.message||this.shortTermRegistryBookingsStatusUpdateModalRef?.content?.result?.message!=="bookings_status_updated"))try{this.refreshShortTermRegistryBookingsDatatable()}catch{}}),error:e=>{R.production||console.log(e)}})}openShortTermRegistryGuestNationalityUpdateModal(i){let o={id:3,keyboard:!1,ignoreBackdropClick:!0,initialState:{user:this.user,bookings:this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.selected_records||[]}};this.shortTermRegistryGuestNationalityUpdateModalRef=this.modalService.show(qe,o),this.shortTermRegistryGuestNationalityUpdateModalRef.content={result:null},this.shortTermRegistryGuestNationalityUpdateModalHideSubscription=this.shortTermRegistryGuestNationalityUpdateModalRef.onHidden.subscribe({next:e=>G(this,null,function*(){if(R.production||console.log(this.shortTermRegistryGuestNationalityUpdateModalRef.content),!(!this.shortTermRegistryGuestNationalityUpdateModalRef?.content?.result?.message||this.shortTermRegistryGuestNationalityUpdateModalRef?.content?.result?.message!=="guest_nationality_updated"))try{this.refreshShortTermRegistryBookingsDatatable()}catch{}}),error:e=>{R.production||console.log(e)}})}openShortTermRegistryPaymentMethodUpdateModal(i){let o={id:4,keyboard:!1,ignoreBackdropClick:!0,initialState:{user:this.user,bookings:this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.selected_records||[]}};this.shortTermRegistryBookingPaymentMethodUpdateModalRef=this.modalService.show(Ye,o),this.shortTermRegistryBookingPaymentMethodUpdateModalRef.content={result:null},this.shortTermRegistryBookingPaymentMethodUpdateModalHideSubscription=this.shortTermRegistryBookingPaymentMethodUpdateModalRef.onHidden.subscribe({next:e=>G(this,null,function*(){if(R.production||console.log(this.shortTermRegistryBookingPaymentMethodUpdateModalRef.content),!(!this.shortTermRegistryBookingPaymentMethodUpdateModalRef?.content?.result?.message||this.shortTermRegistryBookingPaymentMethodUpdateModalRef?.content?.result?.message!=="bookings_payment_method_updated"))try{this.refreshShortTermRegistryBookingsDatatable()}catch{}}),error:e=>{R.production||console.log(e)}})}openShortTermRegistryBookingsStrSubmissionStatusUpdateModal(i){let o={id:5,keyboard:!1,ignoreBackdropClick:!0,initialState:{user:this.user,service_type:"accommodation",bookings:this.shortTermRegistryBookingsTablesData?.[i?.table||"all"]?.selected_records||[]}};this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef=this.modalService.show(Qe,o),this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef.content={result:null},this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalHide
108Subscription=this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef.onHidden.subscribe({next:e=>G(this,null,function*(){if(R.production||console.log(this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef.content),!(!this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef?.content?.result?.message||this.shortTermRegistryBookingsStrSubmissionStatusUpdateModalRef?.content?.result?.message!=="bookings_str_submission_status_updated"))try{this.refreshShortTermRegistryBookingsDatatable()}catch{}}),error:e=>{R.production||console.log(e)}})}onShortTermRegistryBookingsDaterangePickerValueChange(i,o,e){return G(this,null,function*(){o.start=i.start,o.end=i.end,this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.start=this.utilsService.moment(i.start).toDate(),this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.start_str=this.utilsService.moment(this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.start).format("YYYY-MM-DD"),this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.end=this.utilsService.moment(i.end).toDate(),this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.end_str=this.utilsService.moment(this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.end).format("YYYY-MM-DD"),this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.label=i.label,this.shortTermRegistryBookingsTablesData[e||"all"].filters.table_params.daterange.start=this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.start_str,this.shortTermRegistryBookingsTablesData[e||"all"].filters.table_params.daterange.end=this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.end_str,this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.picker_options.startDate=this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.start,this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.picker_options.endDate=this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange.end,R.production||console.log(this.shortTermRegistryBookingsTablesData[e||"all"].filters);for(let l in this.shortTermRegistryBookingsTablesData)try{(e&&l!==e||l!=="all")&&(this.shortTermRegistryBookingsTablesData[l].filters.daterange=this.shortTermRegistryBookingsTablesData[e||"all"].filters.daterange,this.shortTermRegistryBookingsTablesData[l].filters.table_params.daterange=this.shortTermRegistryBookingsTablesData[e||"all"].filters.table_params.daterange)}catch(t){console.log(t)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()})}onShortTermRegistryBookingsDateRangePickerCalendarShow(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.daterange.calendar_is_visible=!0,Ee()}onShortTermRegistryBookingsDateRangePickerCalendarHide(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.daterange.calendar_is_visible=!1}onShortTermRegistryBookingsDateRangePickerApply(i,o,e){try{if(o&&o?.start_str===null&&o?.start_str===o?.end_str){let l={start:this.utilsService.moment(),end:this.utilsService.moment(),label:"Today"};this.onShortTermRegistryBookingsDaterangePickerValueChange(l,o,e)}}catch{}}onShortTermRegistryBookingsDateFilterChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.date=i,R.production||console.log(this.shortTermRegistryBookingsTablesData[o||"all"].filters);for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.date=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.date,R.production||console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}onFilterShortTermRegistryBookingsByAccountValueChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.account_id=i?.account_id||null;for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.account_id=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.account_id,console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}onFilterShortTermRegistryBookingsByPropertyChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.service_id=i?.service_id||null,R.production||console.log(this.shortTermRegistryBookingsTablesData[o||"all"].filters);for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.service_id=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.service_id,console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}onFilterShortTermRegistryBookingsByChannelChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.booking_channel=i?.value||null,R.production||console.log(this.shortTermRegistryBookingsTablesData[o||"all"].filters);for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.booking_channel=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.booking_channel,console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}onFilterShortTermRegistryBookingsByStatusValueChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.status=i?.value||null,R.production||console.log(this.shortTermRegistryBookingsTablesData[o||"all"].filters);for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.status=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.status,console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}onFilterShortTermRegistryBookingsByCheckinSubmittedValueChange(i,o){this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.checkin_submitted=i?.value||null,R.production||console.log(this.shortTermRegistryBookingsTablesData[o||"all"].filters);for(let e in this.shortTermRegistryBookingsTablesData)try{(o&&e!==o||e!=="all")&&(this.shortTermRegistryBookingsTablesData[e].filters.table_params.filterby.checkin_submitted=this.shortTermRegistryBookingsTablesData[o||"all"].filters.table_params.filterby.checkin_submitted,console.log(e))}catch(l){console.log(l)}this.onFiltersChange(),this.refreshShortTermRegistryBookingsDatatable()}shortTermRegistryBookingsCustomAccountsDropdownListSearchFunction(i,o){i=i.toLowerCase();let e=i.split(" ").filter(_=>_),l=[];e.forEach(_=>{let g=`${o.title} ${o.account_id}`.toLowerCase();l.push(g.indexOf(_)!==-1)});let t=_=>_;return l.every(t)}onFiltersChange(){return G(this,null,function*(){try{let i={};for(let e in this.shortTermRegistryBookingsTablesData)this.shortTermRegistryBookingsTablesData[e]?.filters&&(i[e]={filters:this.shortTermRegistryBookingsTablesData[e].filters});let o=yield this.indexedDbService.setItem("str_registry_list_tables_filters",i)}catch(i){console.log(i)}})}refreshShortTermRegistryBookingsDatatable(){this.datatableElements.forEac
108h((i,o)=>{i?.dtInstance&&this.utilsService.delay(50).then(()=>{i.dtInstance.then(e=>{e.ajax.reload()})})})}collapseSideBar(){(!!this.storageService.getItem("sidebarCollapsed")||!this.utilsService.isMobile)&&(document.body.classList.remove("sidebar-open"),document.body.classList.add("sidebar-closed"),document.body.classList.add("sidebar-collapse"),this.mainSidebarCollapsed=!0)}static{this.\u0275fac=function(o){return new(o||n)(N(it),N(me),N(le),N(lt),N(fe),N(Q),N($e),N(Ne),N(Re),N(Z),N(we),N(Ae))}}static{this.\u0275cmp=q({type:n,selectors:[["app-str-registry-list"]],viewQuery:function(o,e){if(o&1&&(Ct(xo,5),Ct(Jt,5)),o&2){let l;Bt(l=It())&&(e.shortTermRegistryBookingsTabset=l.first),Bt(l=It())&&(e.datatableElements=l)}},decls:141,vars:109,consts:[["shortTermRegistryBookingsTabset",""],["shortTermRegistryBookingsFiltersDropdownTemplate",""],["bookingsMassActionsButtonsTemplate",""],["bookingsMassActionsDropdownTemplate",""],["shortTermRegistryBookingsDatatableAll",""],["shortTermRegistryBookingsDatatableReadyForSubmission",""],["shortTermRegistryBookingsDatatableRequireData",""],["shortTermRegistryBookingsDatatableInvalidData",""],["shortTermRegistryBookingsDatatableSubmitted",""],["shortTermRegistryBookingsDatatableSubmittedAsDraft",""],["shortTermRegistryBookingsDatatableErrorsInSubmission",""],[1,"content-wrapper"],[1,"content-header"],[1,"container"],[3,"user","page"],[1,"row"],[1,"col-12"],[1,"m-0","text-dark"],[1,"content"],[1,"card","card-tourmie-blue","card-outline"],[1,"card-header"],[1,"card-title"],["class","card-tools",4,"ngIf"],[1,"card-body"],["type","pills","id","shortTermRegistryBookingsTabs",3,"vertical"],["id","short-term-registry-bookings-all"],["tabHeading",""],[1,"col-sm-12"],[1,"text-muted","font-size-14"],[1,"row","mb-3"],[1,"btn-group"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"table-responsive","short-term-registry-bookings-table-container"],["datatable","","class","table table-hover hover",3,"id","dtOptions",4,"ngIf"],["id","short-term-registry-bookings-ready-for-submission"],["id","short-term-registry-bookings-require-data"],["id","short-term-registry-bookings-invalid-data"],["id","short-term-registry-bookings-submitted"],["id","short-term-registry-bookings-submitted-as-draft"],["id","short-term-registry-bookings-error-in-submission"],["color","#27a9e0","type","ball-scale-multiple",3,"name"],[1,"card-tools"],[3,"innerHTML"],["datatable","",1,"table","table-hover","hover",3,"id","dtOptions"],["type","button","class","btn btn-outline-tourmie-blue btn-sm dropdown-toggle","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",4,"ngIf"],["class","dropdown-menu dropdown-short-term-registry-bookings-table-filters","onclick","event.stopPropagation();",3,"ngClass",4,"ngIf"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-tourmie-blue","btn-sm","dropdown-toggle"],[1,"fa-solid","fa-filter"],[1,"ml-2"],["onclick","event.stopPropagation();",1,"dropdown-menu","dropdown-short-term-registry-bookings-table-filters",3,"ngClass"],[1,"dropdown-item"],["type","button","daterangepicker","",1,"btn","btn-default","btn-block",3,"selected","showDaterangepicker","hideDaterangepicker","applyDaterangepicker","options"],[1,"far","fa-calendar-alt","mr-2"],["class","mr-2",4,"ngIf"],[1,"fas",3,"ngClass"],[1,"dropdown-header","text-left"],["href","javascript:void(0)",1,"dropdown-item","font-size-14",3,"click","ngClass"],["class","dropdown-header text-left mt-2",4,"ngIf"],["class","dropdown-item",4,"ngIf"],[1,"dropdown-header","text-left","mt-2"],[1,"mr-2"],["id","filterByAccountSelect","bindLabel","title","bindValue","account_id","name","filterByAccountSelect","aria-describedby","filterByAccountSelectHelp",3,"change","ngModelChange","placeholder","items","multiple","closeOnSelect","searchFn","minTermLength","ngModel"],["ng-option-tmp",""],[3,"title"],["class","mr-2",3,"ngClass","tooltip",4,"ngIf"],[1,"mr-2",3,"ngClass","tooltip"],[1,"far","fa-credit-card"],["id","filterByPropertySelect","bindValue","service_id","name","filterByPropertySelect","aria-describedby","filterByPropertySelectHelp",3,"change","ngModelChange","placeholder","items","searchFn","multiple","closeOnSelect","ngModel"],["ng-label-tmp",""],["id","filterByChannelSelect","bindValue","value","name","filterByChannelSelect","aria-describedby","filterByChannelSelectHelp",3,"change","ngModelChange","placeholder","items","multiple","searchFn","closeOnSelect","ngModel"],["id","filterByBookingStatusSelect","bindLabel","label","bindValue","value","name","filterByBookingStatusSelect","aria-describedby","filterByBookingStatusSelectHelp",3,"change","ngModelChange","placeholder","items","multiple","closeOnSelect","ngModel"],[1,"badge","text-wrap",3,"ngClass"],["
108id","filterByBookingCheckinSubmittedSelect","bindLabel","label","bindValue","value","name","filterByBookingCheckinSubmittedSelect","aria-describedby","filterByBookingCheckinSubmittedSelectHelp",3,"change","ngModelChange","placeholder","items","multiple","closeOnSelect","ngModel"],["type","button","class","btn btn-outline-tourmie-blue btn-sm ml-2",3,"hidden","click",4,"ngIf"],["type","button","class","btn btn-tourmie-blue btn-sm ml-2",3,"tooltip","click",4,"ngIf"],["class","font-size-15 align-middle ml-2",3,"hidden",4,"ngIf"],["type","button",1,"btn","btn-outline-tourmie-blue","btn-sm","ml-2",3,"click","hidden"],[1,"fa-solid","fa-code-compare"],[1,"fa-regular","fa-flag"],[1,"fa-regular","fa-money-bill-1"],["type","button",1,"btn","btn-tourmie-blue","btn-sm","ml-2",3,"click","tooltip"],[1,"fa-solid","fa-cloud-arrow-up"],[1,"font-size-15","align-middle","ml-2",3,"hidden"],["class","text-muted",4,"ngIf"],[1,"text-muted","font-size-13","mr-1"],[1,"font-weight-500","cursor-pointer","bookings-deselect","font-size-14",3,"click"],[1,"text-muted"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-tool","dropdown-toggle"],[1,"fa-solid","fa-list-check"],[1,"dropdown-menu","dropdown-menu-right","dropdown-bookings-table-mass-actions"],["class","dropdown-item font-size-15","href","javascript:void(0)",3,"click",4,"ngIf"],["class","dropdown-item font-size-15","href","javascript:void(0)",3,"tooltip","click",4,"ngIf"],["href","javascript:void(0)",1,"dropdown-item","font-size-15",3,"click"],["href","javascript:void(0)",1,"dropdown-item","font-size-15",3,"click","tooltip"]],template:function(o,e){if(o&1&&(d(0,"div",11)(1,"div",12)(2,"div",13),I(3,"app-global-notifications",14),d(4,"div",15)(5,"div",16)(6,"h4",17),T(7),k(8,"translate"),m()()()()(),d(9,"div",18)(10,"div",13)(11,"div",19)(12,"div",20)(13,"h3",21),T(14),k(15,"translate"),m(),E(16,No,1,0,"div",22),m(),d(17,"div",23)(18,"div",15)(19,"div",16)(20,"tabset",24,0)(22,"tab",25),E(23,$o,2,6,"ng-template",26),d(24,"div",15)(25,"div",27)(26,"p",28),T(27),k(28,"translate"),m()()(),d(29,"div",29)(30,"div",16)(31,"div",30),W(32,31),m(),W(33,31),m()(),d(34,"div",15)(35,"div",16)(36,"div",32),E(37,Ao,2,2,"table",33),m()()()(),d(38,"tab",34),E(39,Oo,2,6,"ng-template",26),d(40,"div",15)(41,"div",27)(42,"p",28),T(43),k(44,"translate"),m()()(),d(45,"div",29)(46,"div",16)(47,"div",30),W(48,31),m(),W(49,31),m()(),d(50,"div",15)(51,"div",16)(52,"div",32),E(53,Mo,2,2,"table",33),m()()()(),d(54,"tab",35),E(55,Lo,2,6,"ng-template",26),d(56,"div",15)(57,"div",27)(58,"p",28),T(59),k(60,"translate"),m()()(),d(61,"div",29)(62,"div",16)(63,"div",30),W(64,31),m(),W(65,31),m()(),d(66,"div",15)(67,"div",16)(68,"div",32),E(69,Po,2,2,"table",33),m()()()(),d(70,"tab",36),E(71,Fo,2,6,"ng-template",26),d(72,"div",15)(73,"div",27)(74,"p",28),T(75),k(76,"translate"),m()()(),d(77,"div",29)(78,"div",16)(79,"div",30),W(80,31),m(),W(81,31),m()(),d(82,"div",15)(83,"div",16)(84,"div",32),E(85,Vo,2,2,"table",33),m()()()(),d(86,"tab",37),E(87,Uo,2,6,"ng-template",26),d(88,"div",15)(89,"div",27)(90,"p",28),T(91),k(92,"translate"),m()()(),d(93,"div",29)(94,"div",16)(95,"div",30),W(96,31),m(),W(97,31),m()(),d(98,"div",15)(99,"div",16)(100,"div",32),E(101,Do,2,2,"table",33),m()()()(),d(102,"tab",38),E(103,Go,2,6,"ng-template",26),d(104,"div",15)(105,"div",27)(106,"p",28),T(107),k(108,"translate"),m()()(),d(109,"div",29)(110,"div",16)(111,"div",30),W(112,31),m(),W(113,31),m()(),d(114,"div",15)(115,"div",16)(116,"div",32),E(117,wo,2,2,"table",33),m()()()(),d(118,"tab",39),E(119,Ho,2,6,"ng-template",26),d(120,"div",15)(121,"div",27)(122,"p",28),T(123),k(124,"translate"),m()()(),d(125,"div",29)(126,"div",16)(127,"div",30),W(128,31),m(),W(129,31),m()(),d(130,"div",15)(131,"div",16)(132,"div",32),E(133,Ko,2,2,"table",33),m()()()()()()()()()()()(),I(134,"ngx-spinner",40),E(135,us,2,2,"ng-template",null,1,qt)(137,Ss,6,7,"ng-template",null,2,qt)(139,Cs,7,4,"ng-template",null,3,qt)),o&2){let l=U(136),t=U(138);c(3),p("user",e.user)("page","str-registry"),c(4),v(" ",x(8,49,"VIEWS.STR_REGISTRY.BOOKING_SUBMISSIONS_TO_THE_AADE_REGISTRY")," "),c(7),v(" ",x(15,51,"GENERIC.LABELS.BOOKING_PLURAL")," "),c(2),p("ngIf",!1),c(4),p("vertical",e.isMobile),c(
1087),v(" ",x(28,53,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_ALL_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(68,tt,V(67,ei))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(71,tt,V(70,ei))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.all==null||e.shortTermRegistryBookingsTablesData.all.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.all.dt_columns.length)>0),c(6),v(" ",x(44,55,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_READY_FOR_SUBMISSION_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(74,tt,V(73,ii))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(77,tt,V(76,ii))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.ready_for_submission==null||e.shortTermRegistryBookingsTablesData.ready_for_submission.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.ready_for_submission.dt_columns.length)>0),c(6),v(" ",x(60,57,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_REQUIRE_DATA_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(80,tt,V(79,oi))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(83,tt,V(82,oi))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.require_data==null||e.shortTermRegistryBookingsTablesData.require_data.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.require_data.dt_columns.length)>0),c(6),v(" ",x(76,59,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_INVALID_DATA_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(86,tt,V(85,si))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(89,tt,V(88,si))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.invalid_data==null||e.shortTermRegistryBookingsTablesData.invalid_data.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.invalid_data.dt_columns.length)>0),c(6),v(" ",x(92,61,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_SUBMITTED_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(92,tt,V(91,ai))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(95,tt,V(94,ai))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.submitted==null||e.shortTermRegistryBookingsTablesData.submitted.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.submitted.dt_columns.length)>
1080),c(6),v(" ",x(108,63,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_SUBMITTED_AS_DRAFT_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(98,tt,V(97,ni))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(101,tt,V(100,ni))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.submitted_as_draft==null||e.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.submitted_as_draft.dt_columns.length)>0),c(6),v(" ",x(124,65,"VIEWS.STR_REGISTRY.TABLE_AADE_STR_BOOKINGS_ERROR_IN_SUBMISSION_DESCRIPTION")," "),c(5),p("ngTemplateOutlet",l)("ngTemplateOutletContext",P(104,tt,V(103,li))),c(),p("ngTemplateOutlet",t)("ngTemplateOutletContext",P(107,tt,V(106,li))),c(4),p("ngIf",(e.shortTermRegistryBookingsTablesData==null||e.shortTermRegistryBookingsTablesData.error_in_submission==null||e.shortTermRegistryBookingsTablesData.error_in_submission.dt_columns==null?null:e.shortTermRegistryBookingsTablesData.error_in_submission.dt_columns.length)>0),c(),p("name",e.spinnerName)}},dependencies:[j,At,z,ue,jt,st,_t,ut,J,X,Le,Oe,Jt,ct,rt,at,ht,gt,bt,ye,Fe,Pe,Mt,Ot,xe,ke,Te,Se],styles:[".dropdown-short-term-registry-bookings-table-filters[_ngcontent-%COMP%]{width:400px;z-index:1037!important}@media (max-width: 991.98px){.dropdown-short-term-registry-bookings-table-filters[_ngcontent-%COMP%], .dropdown-bookings-table-mass-actions[_ngcontent-%COMP%]{width:76vw;margin-left:64px}}.bookings-deselect[_ngcontent-%COMP%]{text-decoration:underline;text-underline-offset:4px;text-decoration-style:dashed;text-decoration-color:var(--gray)}"]})}}return n})();export{bn as STRRegistryListComponent};
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.