1import{r as ce,wa as me}from"./chunk-JB56VYDL.js";import{a as pe}from"./chunk-JKSJDQSI.js";import"./chunk-XKURR3UN.js";import"./chunk-PULGLR6U.js";import"./chunk-A66EWMQB.js";import"./chunk-EKMKUUTQ.js";import"./chunk-FVT6YXMQ.js";import"./chunk-SJJ62P6D.js";import"./chunk-EYT5YVXV.js";import"./chunk-6O4J7ZFP.js";import"./chunk-3FRIUJOE.js";import"./chunk-74HRWSLT.js";import"./chunk-ICXUT6DP.js";import"./chunk-NB5ABEJQ.js";import"./chunk-QMOG5IKY.js";import"./chunk-BYMYJPHF.js";import"./chunk-ECXTIDUB.js";import"./chunk-S4ES2FYV.js";import{a as de}from"./chunk-E5BLUDPV.js";import"./chunk-E7UEBVHO.js";import"./chunk-CNVPFOFC.js";import"./chunk-DJ3CEFR4.js";import{ma as se}from"./chunk-E3JBYBRE.js";import"./chunk-SOCXJR6N.js";import"./chunk-NH3AGL36.js";import"./chunk-BEATIRQG.js";import"./chunk-5IV3AJNK.js";import"./chunk-HIUH4DG4.js";import{A as Z,Db as ie,Eb as ne,Ib as oe,Pc as re,Wb as ae,ea as Q,g as J,ib as Y,ka as X,lb as $,mb as ee,nb as te,sb as V,ud as le,we as W}from"./chunk-W4ETJWG2.js";import{K,cc as O}from"./chunk-6FXJPR5H.js";import{Cb as B,Da as T,Hb as j,Ic as q,Nc as l,Oc as S,Pc as m,Xc as x,Yc as z,Zc as w,_b as I,ac as M,c as D,fc as u,gc as o,hb as A,hc as a,ic as C,id as U,lb as n,pc as k,pd as s,qd as p,ua as f,ud as H,v as R,va as b,wc as G,xb as v,zc as y}from"./chunk-MNOKAULF.js";import{a as E}from"./chunk-XFGHHPE4.js";var be=()=>({rows:10});function ve(r,c){r&1&&C(0,"nz-skeleton",1),r&2&&u("nzActive",!0)("nzParagraph",U(2,be))}var _e=(()=>{let c=class c{constructor(e,t){this.modal=e,this.t=t,this.loading=T(!1)}ngOnInit(){this.loading.set(!0),de("https://js.hsforms.net/forms/embed/v2.js").then(()=>{hbspt.forms.create({portalId:"6892479",formId:"e0fc4cee-df15-4211-9c6c-54853aa56e37",target:".hbspt-form-container",onFormReady:()=>{this.loading.set(!1),console.log("form ready")},onFormSubmit:()=>{console.log("submit")},onFormSubmitted:()=>{console.log("submited"),this.displaySuccessModal()},onBeforeFormSubmit:()=>{console.log("before submit")},onFormFailedValidation:()=>{console.log("form failed validation")}})})}displaySuccessModal(){console.log("what?"),this.modal.success({nzTitle:this.t.t("guest_screening_form_cmp_success_title"),nzContent:this.t.t("guest_screening_form_cmp_success_content"),nzWidth:500})}};c.\u0275fac=function(t){return new(t||c)(v(V),v(O))},c.\u0275cmp=B({type:c,selectors:[["host-claim-form"]],decls:3,vars:1,consts:[[1,"v4-layout-content","min-h-[calc(100vh-150px)]"],[3,"nzActive","nzParagraph"],["data-portalid","6892479",1,"hbspt-form-container"]],template:function(t,i){t&1&&(o(0,"div",0),I(1,ve,1,3,"nz-skeleton",1),C(2,"div",2),a()),t&2&&(n(),M(i.loading()?1:-1))},dependencies:[W,le],encapsulation:2});let r=c;return r})();function ye(r,c){r&1&&(o(0,"span",26),l(1),s(2,"translate"),a(),o(3,"a",27),l(4),s(5,"translate"),a()),r&2&&(n(),m("",p(2,3,"guest_screening_html_you_must_set")," "),n(2),u("routerLink","/app/properties/properties"),n(),S(p(5,5,"guest_screening_html_go_to_property")))}function Se(r,c){if(r&1){let _=k();o(0,"div",28),l(1),s(2,"translate"),a(),o(3,"div",29)(4,"div",30)(5,"v4-house-select",31),w("ngModelChange",function(t){f(_);let i=y(2);return z(i.propertyIds,t)||(i.propertyIds=t),b(t)}),a()()()}if(r&2){let _=y(2);n(),m(" ",p(2,3,"guest_screening_html_by_select_prop")," "),n(4),u("tempAutoSelectWhenOnlyOneProperty",!0),x("ngModel",_.propertyIds)}}function Ce(r,c){if(r&1){let _=k();o(0,"div",28),l(1),s(2,"translate"),a(),o(3,"div",29)(4,"div",30)(5,"v4-room-types-select",32),w("ngModelChange",function(t){f(_);let i=y(2);return z(i.roomTypeIds,t)||(i.roomTypeIds=t),b(t)}),a()()()}if(r&2){let _=y(2);n(),m(" ",p(2,2,"guest_screening_html_by_select_roomtype")," "),n(4),x("ngModel",_.roomTypeIds)}}function xe(r,c){if(r&1){let _=k();o(0,"div",28),l(1),s(2,"translate"),a(),o(3,"div",29)(4,"div",30)(5,"nz-select",33),w("ngModelChange",function(t){f(_);let i=y(2);return z(i.groupIds,t)||(i.groupIds=t),b(t)}),a()()()}if(r&2){let _=y(2);n(),m(" ",p(2,4,"guest_screening_html_by_select_group")," "),n(4),u("nzDisabled",!_.enabled())("nzOptions",_.optionsOfGroupList),x("ngModel",_.groupIds)}}function ze(r,c){if(r&1&&(o(0,"div",24),I(1,Se,6,5)(2,Ce,6,4)(3,xe,6,6),a()),r&2){let _,e=y();
1n(),M((_=e.applicable)==="by_property"?1:_==="by_room_type"?2:_==="by_group"?3:-1)}}var ge=(()=>{let c=class c{constructor(e,t,i,d){this.http=e,this.t=t,this.msg=i,this.modal=d,this.linkDoc="https://hostex.io/help/guest-screening/",this.listOfChannel=[],this.enabled=T(!1),this.applicable="all",this.propertyIds=[],this.groupIds=[],this.roomTypeIds=[],this.optionsOfGroupList=[]}ngOnInit(){this.fetchGroupList(),this.fetchSettings()}fetchGroupList(){this.http.get("/api/house_group/group_list").subscribe(e=>{var t,i;this.optionsOfGroupList=(i=(t=e==null?void 0:e.data)==null?void 0:t.list)==null?void 0:i.map(d=>({label:d.name,value:d.group_id})),this.optionsOfGroupList.unshift({label:this.t.t("word.any"),value:-1})})}fetchSettings(){this.http.get("/api/guest_screening/get_settings").subscribe(e=>{var t,i,d,g,h,L,F,P;e.error_code===0&&(this.listOfChannel=(i=(t=e==null?void 0:e.data)==null?void 0:t.channels)==null?void 0:i.map(N=>({label:N.title,value:N.channel_type,checked:N.is_active})),this.applicable=(d=e==null?void 0:e.data)==null?void 0:d.applicable,this.balance=(g=e==null?void 0:e.data)==null?void 0:g.balance,this.propertyIds=((h=e==null?void 0:e.data)==null?void 0:h.property_ids)||[],this.roomTypeIds=((L=e==null?void 0:e.data)==null?void 0:L.room_type_ids)||[],this.groupIds=((F=e==null?void 0:e.data)==null?void 0:F.group_ids)||[],this.enabled.set((P=e==null?void 0:e.data)==null?void 0:P.enabled))})}requestUpdateSettings(e){this.http.post("/api/guest_screening/update_settings",e).subscribe(t=>{t.error_code===0&&(this.msg.success(this.t.t("word.success")),this.fetchSettings())})}requestSwitchEnabledState(e){this.http.post("/api/guest_screening/update_enable",e).subscribe(t=>{t.error_code===0&&(this.msg.success(this.t.t(this.enabled()?"guest_screening_ts_warn_disabled":"guest_screening_ts_warn_enabled")),this.fetchSettings())})}checkIfBalanceGtZero(){return new D(e=>{this.balance<=0?this.msg.warning(this.t.t("guest_screening_ts_warn_recharge")):e.next(null),e.complete()})}displayAdditionalChargeWarning(){return new D(e=>{this.modal.confirm({nzTitle:this.t.t("guest_screening_ts_warn_add_title"),nzContent:`${this.t.t("guest_screening_ts_warn_add_content")} <a href="https://hostex.io/help/sms-pricing/" target="_blank">${this.t.t("balance-account_html_view_pricing")} ></a>`,nzWidth:500,nzOnOk:()=>{e.next(null)}}).afterClose.subscribe(()=>{e.complete()})})}displayBalanceModal(){this.modal.create({nzTitle:null,nzContent:se,nzWidth:600,nzFooter:null})}onSwitchEnabledState(){this.enabled()?this.requestSwitchEnabledState({enabled:!1}):this.checkIfBalanceGtZero().pipe(R(()=>this.displayAdditionalChargeWarning())).subscribe(()=>{let e={enabled:!0};this.requestSwitchEnabledState(e)})}onClickRecharge(){this.displayBalanceModal()}onSave(){var t,i,d;let e=E(E(E({channel_types:this.listOfChannel.filter(g=>g.checked).map(g=>g.value),applicable:this.applicable},((t=this.propertyIds)==null?void 0:t.length)&&{property_ids:this.propertyIds}),((i=this.groupIds)==null?void 0:i.length)&&{group_ids:this.groupIds}),((d=this.roomTypeIds)==null?void 0:d.length)&&{room_type_ids:this.roomTypeIds});this.requestUpdateSettings(e)}};c.\u0275fac=function(t){return new(t||c)(v(J),v(O),v(Y),v(V))},c.\u0275cmp=B({type:c,selectors:[["host-guest-screening"]],decls:72,vars:62,consts:[["msgTpl",""],[1,"v4-layout-content"],[1,"v4-layout-block-card","mb-[30px]"],["src","/app/assets/v4/workplace_guest_screening.svg","alt","",1,"v4-layout-block-card-img","w-[80px]"],[1,"v4-layout-block-card-title"],[1,"v4-layout-block-card-desc"],["target","_blank",3,"href"],["href","https://truvi.com/platform/customer-support/","target","_blank"],[1,"v4-layout-block-card-footer","space-x-[12px]"],["nz-button","","nzType","primary",3,"click"],["href","https://share.hsforms.com/2ctLwdJ4yTb6ll7JGCCwAJw43q9r","target","_blank"],["nz-button",""],["nz-button","",3,"click"],["nzShowIcon","",1,"mb-[30px]",3,"nzMessage"],[1,"v4-layout-form"],[1,"v4-layout-form-title","!mb-[6px]"],[1,"v4-layout-form-desc"],[3,"ngModelChange","ngModel","nzDisabled"],[1,"v4-layout-form","v4-layout-form-vertical"],[1,"mb-[24px]"],["nz-radio","","nzValue","all",1,"flex","mb-[8px]"],["nz-radio","","nzValue","by_property",1,"flex","mb-[8px]"],["nz-radio","","nzValue","by_group",1,"flex","mb-[8px]"],["nz-radio","","nzValue","by_room_type",1,"flex"],[1,"v4-layout-field"],["nz-button","","nzType","primary","nzSize","large",3,"click","disabled"],[1,"text-c-d2-main-text","text-[13px]","leading-[18px]"],[3,"routerLink"],[1,"v4-layout-field-label"],[1,"v4-layout-field-control"],[1,"v4-layout-field-row","w-[150px]"],["size","small",3,"ngModelChange","tempAutoSelectWhenOnl
1yOneProperty","ngModel"],["size","small",1,"w-full",3,"ngModelChange","ngModel"],["nzMode","multiple","nzSize","small",1,"w-full",3,"ngModelChange","nzDisabled","nzOptions","ngModel"]],template:function(t,i){if(t&1){let d=k();o(0,"div",1)(1,"div",2),C(2,"img",3),o(3,"div")(4,"div",4),l(5),s(6,"translate"),a(),o(7,"div",5),l(8),s(9,"translate"),a(),o(10,"div",5),l(11),s(12,"translate"),o(13,"a",6),l(14),s(15,"translate"),l(16," >"),a()(),o(17,"div",5),l(18),s(19,"translate"),o(20,"a",7),l(21),s(22,"translate"),a()(),o(23,"div",8)(24,"button",9),G("click",function(){return f(d),b(i.onSwitchEnabledState())}),l(25),s(26,"translate"),a(),o(27,"a",10)(28,"button",11),l(29),s(30,"translate"),a()(),o(31,"button",12),G("click",function(){return f(d),b(i.onClickRecharge())}),l(32),s(33,"translate"),a()()()(),C(34,"nz-alert",13),j(35,ye,6,7,"ng-template",null,0,H),o(37,"div",14)(38,"div",15),l(39),s(40,"translate"),a(),o(41,"div",16),l(42),s(43,"translate"),a(),o(44,"div")(45,"nz-checkbox-group",17),w("ngModelChange",function(h){return f(d),z(i.listOfChannel,h)||(i.listOfChannel=h),b(h)}),a()()(),o(46,"div",18)(47,"div",15),l(48),s(49,"translate"),a(),o(50,"div",16),l(51),s(52,"translate"),a(),o(53,"div",19)(54,"nz-radio-group",17),w("ngModelChange",function(h){return f(d),z(i.applicable,h)||(i.applicable=h),b(h)}),o(55,"label",20),l(56),s(57,"translate"),a(),o(58,"label",21),l(59),s(60,"translate"),a(),o(61,"label",22),l(62),s(63,"translate"),a(),o(64,"label",23),l(65),s(66,"translate"),a()()(),I(67,ze,4,1,"div",24),a(),o(68,"div",14)(69,"button",25),G("click",function(){return f(d),b(i.onSave())}),l(70),s(71,"translate"),a()()()}if(t&2){let d=q(36);n(5),m(" ",p(6,26,"guest_screening_html_guest_scr")," "),n(3),m(" ",p(9,28,"guest_screening_html_enable_guest")," "),n(3),m(" ",p(12,30,"guest_screening_html_upon_activ")," "),n(2),u("href",i.linkDoc,A),n(),m(" ",p(15,32,"channel-account_html-\u4E86\u89E3\u66F4\u591A")," "),n(4),m(" ",p(19,34,"guest_screening_html_this_service")," "),n(3),S(p(22,36,"guest_screening_html_truvi_support")),n(4),m(" ",p(26,38,i.enabled()?"guest_screening_html_disable_guest_btn":"guest_screening_html_enable_guest_btn")," "),n(4),m(" ",p(30,40,"guest_screening_html_file_claim")," "),n(3),m(" ",p(33,42,"guest_screening_html_recharge")," "),n(2),u("nzMessage",d),n(5),m(" ",p(40,44,"guest_screening_html_applicable_ch")," "),n(3),m(" ",p(43,46,"guest_screening_html_bookings_from")," "),n(3),x("ngModel",i.listOfChannel),u("nzDisabled",!i.enabled()),n(3),m(" ",p(49,48,"guest_screening_html_applicable_pro")," "),n(3),m(" ",p(52,50,"guest_screening_html_guests_booking")," "),n(3),x("ngModel",i.applicable),u("nzDisabled",!i.enabled()),n(2),S(p(57,52,"word.all")),n(3),S(p(60,54,"guest_screening_html_by_property")),n(3),S(p(63,56,"guest_screening_html_by_group")),n(3),S(p(66,58,"guest_screening_html_by_roomtype")),n(2),M(i.applicable!=="all"?67:-1),n(2),u("disabled",!i.enabled()),n(),m(" ",p(71,60,"template_form_component_save_chang")," ")}},dependencies:[W,Q,X,Z,te,$,ee,oe,ne,ie,ae,re,me,pe,ce,K],styles:["[_nghost-%COMP%] .ant-checkbox-wrapper{margin-bottom:16px}"]});let r=c;return r})();var at=[{path:"",pathMatch:"full",component:ge},{path:"form",component:_e,data:{secondary:!0}}];export{at as GUEST_SCREENING_ROUTES};
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.