PageSourceSearch

https://www.galapagosislands.com/ecommerce/255.28a9457982ba4c41.js

js galapagosislands.com collected 2026-10-02 06:37:43 UTC 256,934 bytes, 1 lines download raw bytes

1(self.webpackChunke_commerce_gtc_ii=self.webpackChunke_commerce_gtc_ii||[]).push([[255],{6058:(se,ie,_)=>{"use strict";_.d(ie,{H:()=>k});var o=_(4650),v=_(6895);function f(e,D){1&e&&(o.ynx(0),o.TgZ(1,"table",110)(2,"tbody")(3,"tr")(4,"th",111),o._uU(5,"Adults:"),o.qZA(),o.TgZ(6,"td"),o._uU(7,"\xa0"),o.qZA()(),o.TgZ(8,"tr")(9,"th",111),o._uU(10,"Children*:"),o.qZA(),o.TgZ(11,"td"),o._uU(12,"\xa0"),o.qZA()()()(),o.TgZ(13,"p",112),o._uU(14,"*Children ages considered 6 to 11"),o.qZA(),o.BQk())}function N(e,D){1&e&&(o.ynx(0),o.TgZ(1,"p",112),o._uU(2,"Number of Passengers"),o.qZA(),o.BQk())}function c(e,D){1&e&&(o.ynx(0),o.TgZ(1,"div",21)(2,"h5",113),o._UZ(3,"i",114),o._uU(4," Number of Passengers:"),o.qZA()(),o._UZ(5,"span",115)(6,"span",116),o.TgZ(7,"div",117),o._uU(8,"*Up to 12 years old"),o.qZA(),o.BQk())}let k=(()=>{const D=class{constructor(){this.isCharter=!1}};let e=D;return D.\u0275fac=function(R){return new(R||D)},D.\u0275cmp=o.Xpm({type:D,selectors:[["app-loading-checkout"]],inputs:{isCharter:"isCharter"},decls:307,vars:3,consts:[[1,"bg-light","border-bottom","mb-3","pt-3","position-relative"],[1,"container"],[1,"cta-float"],["src","assets/images/cta/usa.jpg","width","20","height","20"],["href","tel:18008114037",2,"float","right"],["src","assets/images/cta/ecuador.jpg","width","20","height","20"],["href","tel:59326024565"],["href","javascript:void(Tawk_API.toggle())"],[1,"row"],[1,"col-lg-8","col-sm-12"],[1,"row","no-gutters","mb-4",2,"opacity",".5"],[1,"col-6","col-sm-3","mt-2","steps"],[1,"badge","badge-pill","text-white","float-left","mr-2"],[1,"bg-white","border-top","position-relative"],[1,"promo-esq","preload"],[1,"row","no-gutters"],[1,"col-md-5","col-sm-12"],[1,"cruise-img-box"],["height","137","width","275","src","assets/images/loading-boat.gif","alt","Loading"],[1,"col-md-7","col-sm-12"],[1,"pt-3","px-3","pb-2"],[1,"col-12"],[1,"mb-1","preload"],[1,"cruise-category","preload"],[1,"icons"],["aria-hidden","true",1,"fa","fa-star"],[1,"small","preload"],[1,"mb-1","preload","bg-info","my-2",2,"width","130px","opacity",".5"],[1,"loader1","w-100"],[1,"loader1","w-100","mb-0"],[1,"pt-2","cruise-details","border-0","mb-5"],[1,"nav","nav-tabs","border-0"],[1,"nav-item","mr-1"],[1,"nav-link","text-white","border-light"],[1,"d-none","d-md-inline"],[1,"mb-3",2,"color","#ccc"],["id","accordion"],[1,"card","mb-3"],["id","headingOne",1,"card-header","bg-white"],[1,"card","bg-light","float-none","float-md-right","mt-2"],[1,"card-body","small","px-2","pt-3"],[1,"loader1",2,"width","60px"],[1,"mb-1","preload",2,"width","110px"],[1,"loader1",2,"width","80px"],[1,"bg-orange","options","text-white","text-center","float-left","mr-3","position-relative","disabled-check"],[1,"mt-2","fs-24",2,"opacity",".1"],[1,"icons","packages","mb-2","preload",2,"opacity",".5"],["data-toggle","tooltip","data-placement","bottom","title","","aria-hidden","true","data-original-title","Cruise",1,"fa","fa-ship"],[1,"sr-only"],["aria-hidden","true",1,"fa","fa-plus","small"],["data-toggle","tooltip","data-placement","bottom","title","","aria-hidden","true","data-original-title","Meals",1,"fa","fa-utensils"],["data-toggle","tooltip","data-placement","bottom","title","","aria-hidden","true","data-original-title","Excursions",1,"fa","fa-hiking"],["data-toggle","tooltip","data-placement","bottom","title","","aria-hidden","true","data-original-title","Galapagos Flights",1,"fa","fa-plane","text-success"],[1,"row","mt-3","clearfix","w-100"],[1,"col-sm-6"],[1,"preload","w-50"],[1,"fs-13","comp-features"],[1,"fs-13","not-included"],[1,"btn","btn-success","float-right","pl-4","pr-4","selector","disabled-check"],[1,"text-white"],["aria-hidden","true",1,"fa","fa-angle-down"],["id","headingTwo",1,"card-header","bg-white"],[1,"row","mb-3","mt-4","text-center"],[1,"col-12","mb-5"],[1,"btn","btn-block","bg-gray","btn-lg","need_assistance_gm","text-white"],["aria-hidden","true",1,"fa","fa-pen-square"],[1,"col-md-4","mb-3"],["href","javascript:void(0)","data-toggle","modal","data-target","#contact",1,"need_assistance_gm"],["src","assets/images/cta/e-mail.png","width","213","height","78","alt","E-mail Us",1,"img-fluid"],["src","assets/images/cta/chat.png","width","222","height","77","alt","Chat with a specialist",1,"img-fluid"],["src","assets/images/cta/telephone.png","width","225","height","78","alt","Talk to an Expert","usemap","#Map",1,"float-none","img-fluid","float-md-right"],["name","Map"],["shape","rect","coords","84,5,218,31","href","tel:18008114037","alt","USA Toll-Free Number"],["shape","rect","coords","84,33,220,58","href","tel:59326020851","alt","UK Toll-Free Number"],[1,"col-lg-4","col-sm-12"],[1,"card","mb-3","mt-2","bg-gray","border-0",2,"opacity",".5"],[1,"card-header"],[1,"fs-24","mt-2"],[1,"card-body"],[1,"summary","text-muted","pb-1"],["aria-hidden","true",1,"fa","fa-user-fr
1iends"],[4,"ngIf"],[1,"mt-3","summary","text-muted","pb-1"],["aria-hidden","true",1,"fa","fa-map-marked"],["cellpadding","4",1,"small","w-100","summary"],["width","9%","rowspan","2",1,"dayname"],["width","3%",1,"timeday"],["width","88%"],[1,"timeday"],["rowspan","2",1,"dayname"],[1,"card-footer","pt-0"],["border","0","cellpadding","10","cellspacing","0","align","center"],["align","center","bgcolor","#DDDDDD",2,"border","0!important"],["href","https://www.paypal.com/us/webapps/mpp/paypal-popup","title","How PayPal Works","onclick","javascript:window.open('https://www.paypal.com/us/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;"],["src","https://www.paypalobjects.com/digitalassets/c/website/marketing/na/us/logo-center/9_bdg_secured_by_pp_2line.png","border","0","alt","Secured by PayPal"],[1,"card","mb-3","mt-2","border-0",2,"opacity",".8"],[1,"card-header","bg-dark"],[1,"fs-24","mt-2","text-light"],["aria-hidden","true",1,"fa","fa-search","float-right",2,"color","#999"],[1,"card-body","bg-window","border-top","border-white"],[1,"row","no-gutters","my-2"],[1,"summary","pb-1"],["aria-hidden","true",1,"fa","fa-calendar","text-muted"],[1,"loader1","w-100","mb-3","mt-2",2,"height","26px"],[1,"loader1","w-100",2,"height","26px"],[1,"col-12","mt-3"],["href","index.html",1,"btn","btn-block","btn-secondary"],[1,"row","mb-3"],["href","https://galavail.com/","target","_blank"],["src","assets/images/galavail-mini.png","width","126","height","45","alt","Powered by GalAvail",1,"float-right"],["cellpadding","3"],["scope","row",1,"blue","pr-4"],[1,"small","pb-3"],[1,"summary","mt-3","mb-3","pb-1"],["aria-hidden","true",1,"fa","fa-user-friends","text-muted"],[1,"loader1","mr-2","mb-3",2,"height","26px","width","47.5%"],[1,"loader1","mb-3",2,"height","26px","width","49%"],[1,"col-12","small"]],template:function(R,Q){1&R&&(o.TgZ(0,"div",0)(1,"div",1)(2,"p",2)(3,"strong"),o._uU(4,"Questions?"),o.qZA(),o._uU(5,"\xa0 "),o.TgZ(6,"span"),o._uU(7,"Toll-free: "),o.qZA(),o._UZ(8,"img",3),o.TgZ(9,"a",4),o._uU(10,"1-800-811-4037"),o.qZA(),o.TgZ(11,"span"),o._uU(12,"\u2022"),o.qZA(),o._UZ(13,"img",5),o.TgZ(14,"a",6),o._uU(15,"593-2-6024-565"),o.qZA(),o._uU(16," or "),o.TgZ(17,"a",7),o._uU(18,"Chat with us"),o.qZA(),o._uU(19,"."),o.qZA(),o.TgZ(20,"div",8)(21,"div",9)(22,"div",10)(23,"div",11)(24,"div",12),o._uU(25,"1"),o.qZA(),o._uU(26," Cruise Options "),o.qZA(),o.TgZ(27,"div",11)(28,"div",12),o._uU(29,"2"),o.qZA(),o._uU(30," Who is Traveling "),o.qZA(),o.TgZ(31,"div",11)(32,"div",12),o._uU(33,"3"),o.qZA(),o._uU(34," Payment Options "),o.qZA(),o.TgZ(35,"div",11)(36,"div",12),o._uU(37,"4"),o.qZA(),o._uU(38," Booking Summary "),o.qZA()(),o.TgZ(39,"div",13)(40,"div",14),o._UZ(41,"span"),o.qZA(),o.TgZ(42,"div",15)(43,"div",16)(44,"div",17),o._UZ(45,"img",18),o.qZA()(),o.TgZ(46,"div",19)(47,"div",20)(48,"div",8)(49,"div",21),o._UZ(50,"h5",22),o.TgZ(51,"div",23)(52,"div",24),o._UZ(53,"i",25)(54,"i",25)(55,"i",25)(56,"i",25)(57,"i",25),o.qZA(),o._UZ(58,"span",26),o.qZA(),o._UZ(59,"h5",27)(60,"span",28)(61,"span",29),o.qZA()()()()()(),o.TgZ(62,"nav",30)(63,"ul",31)(64,"li",32)(65,"a",33),o._uU(66,"CRUISE"),o.qZA()(),o.TgZ(67,"li",32)(68,"a",33),o._uU(69,"PHOTOS"),o.qZA()(),o.TgZ(70,"li",32)(71,"a",33),o._uU(72,"ITINERARY"),o.qZA()(),o.TgZ(73,"li",32)(74,"a",33),o._uU(75,"SPEC"),o.TgZ(76,"span",34),o._uU(77,"IFICATION"),o.qZA(),o._uU(78,"S"),o.qZA()(),o.TgZ(79,"li",32)(80,"a",33),o._uU(81,"REVIEWS"),o.qZA()(),o.TgZ(82,"li",32)(83,"a",33),o._uU(84,"FAQs"),o.qZA()()()(),o.TgZ(85,"h3",35),o._uU(86,"Please choose any of our tour options below:"),o.qZA(),o.TgZ(87,"div",36)(88,"div",37)(89,"div",38)(90,"div",39)(91,"div",40),o._UZ(92,"span",41)(93,"h5",42)(94,"span",43),o.qZA()(),o._UZ(95,"span",44),o.TgZ(96,"h3",45),o._uU(97,"Galapagos Cruise plus Flight"),o.qZA(),o.TgZ(98,"div",46),o._UZ(99,"i",47),o.TgZ(100,"span",48),o._uU(101,"Cruise"),o.qZA(),o._UZ(102,"i",49)(103,"i",50),o.TgZ(104,"span",48),o._uU(105,"Meals"),o.qZA(),o._UZ(106,"i",49)(107,"i",51),o.TgZ(108,"span",48),o._uU(109,"Excursions"),o.qZA(),o._UZ(110,"i",49)(111,"i",52),o.TgZ(112,"span",48),o._uU(113,"Galapagos Flights"),o.qZA()(),o.TgZ(114,"div",53)(115,"div",54),o._UZ(116,"b",55),o.TgZ(117,"ul",56)(118,"li"),o._UZ(119,"b",28),o.qZA(),o.TgZ(120,"li"),o._UZ(121,"b",28),o.qZA(),o.TgZ(122,"li"),o._UZ(123,"b",28),o.qZA(),o.TgZ(124,"li"),o._UZ(125,"b",28),o.qZA()()(),o.TgZ(126,"div",54),o._UZ(127,"b",55),o.TgZ(128,"ul",57)(129,"li"),o._UZ(130,"b",28),o.qZA(),o.TgZ(131,"li"),o._UZ(132,"b",28),o.qZA(),o.TgZ(133,"li"),o._UZ(134,"b",28),o.qZA(),o.TgZ(135,"li"),o._UZ(136,"b",28),o.qZA()()()(),o.TgZ(137,"a",58)(138,"span",59),o._uU(139,"Select "),o._UZ(140,"i",60),o.qZA()()()(),o.TgZ(141,"div",37)(142,"div",61)(143,"div",39)(144,"div",40),o._UZ(145,"span",41)(146,"h5",42)(147,"span",43),o.qZA()(),o._UZ(148,"span",44),o.TgZ(149,"h3",45),o._uU(150,"Galapagos Cruise"),o.qZA(),o.TgZ(151,"div",46),o._UZ(152,"i",47),o.TgZ(153,"span",48),o._uU(154,"Cruise"),o.qZA(),o._UZ(155,"i",49)(156,"i",50),o.TgZ(157,"span",48),o._uU(158,"Meals"),o.qZA(),o._UZ(159,"i",49)(160,"i",51),o.TgZ(161,"span",48),o._uU(162,"Excursions"),o.qZA()(),o.TgZ(163,"div",53)(164,"div",54),o._UZ(165,"b",55),o.TgZ(166,"ul",56)(167,"li"),o._UZ(168,"b",28),o.qZA(),o.TgZ(169,"li"),o._UZ(170,"b",28),o.qZA(),o.TgZ(171,"li"),o._UZ(172,"b",28),o.qZA(),o.TgZ(173,"li"),o._UZ(174,"b",28),o.qZA()()(),o.TgZ(175,"div",54),o._UZ(176,"b",55),o.TgZ(177,"ul",57)(178,"li"),o._UZ(179,"b",28),o.qZA(),o.TgZ(180,"li"),o._UZ(181,"b",28),o.qZA(),o.TgZ(182,"li"),o._UZ(183,"b",28),o.qZA(),o.TgZ(184,"li"),o._UZ(185,"b",28),o.qZA()()()(),o.TgZ(186,"a",58)(187,"span",59),o._uU(188,"Select "),o._UZ(189,"i",60),o.qZA()()()()(),o.TgZ(190,"div",62)(191,"div",63)(192,"a",64),o._UZ(193,"i",65),o._uU(194," Need Assistance? Contact Us"),o.qZA()(),o.TgZ(195,"div",66)(196,"a",67),o._UZ(197,"img",68),o.qZA()(),o.TgZ(198,"div",66)(199,"a",7),o._UZ(200,"img",69),o.qZA()(),o.TgZ(201,"div",66),o._UZ(202,"img",70),o.TgZ(203,"map",71),o._UZ(204,"area",72)(205,"area",73),o.qZA()()()(),o.TgZ(206,"div",74)(207,"div",75)(208,"div",76)(209,"h3",77),o._uU(210,"Tour Summary"),o.qZA()(),o.TgZ(211,"div",78)(212,"h5",79),o._UZ(213,"i",80),o._uU(214," Number of Passengers"),o.qZA(),o.YNc(215,f,15,0,"ng-container",81),o.YNc(216,N,3,0,"ng-container",81),o.TgZ(217,"h5",82),o._UZ(218,"i",83),o._uU(219," Galapagos Itinerary"),o.qZA(),o.TgZ(220,"table",84)(221,"tbody")(222,"tr")(223,"td",85),o._uU(224,"\xa0"),o.qZA(),o.TgZ(225,"td",86),o._uU(226,"AM"),o.qZA(),o.TgZ(227,"td",87),o._uU(228,"\xa0"),o.qZA()(),o.TgZ(229,"tr")(230,"td",88),o._uU(231,"PM"),o.qZA(),o.TgZ(232,"td"),o._uU(233,"\xa0"),o.qZA()(),o.TgZ(234,"tr")(235,"td",89),o._uU(236,"\xa0"),o.qZA(),o.TgZ(237,"td",88),o._uU(238,"AM"),o.qZA(),o.TgZ(239,"td"),o._uU(240,"\xa0"),o.qZA()(),o.TgZ(241,"tr")(242,"td",88),o._uU(243,"PM"),o.qZA(),o.TgZ(244,"td"),o._uU(245,"\xa0"),o.qZA()(),o.TgZ(246,"tr")(247,"td",89),o._uU(248,"\xa0"),o.qZA(),o.TgZ(249,"td",88),o._uU(250,"AM"),o.qZA(),o.TgZ(251,"td"),o._uU(252,"\xa0"),o.qZA()(),o.TgZ(253,"tr")(254,"td",88),o._uU(255,"PM"),o.qZA(),o.TgZ(256,"td"),o._uU(257,"\xa0"),o.qZA()(),o.TgZ(258,"tr")(259,"td",89),o._uU(260,"\xa0"),o.qZA(),o.TgZ(261,"td",88),o._uU(262,"AM"),o.qZA(),o.TgZ(263,"td"),o._uU(264,"\xa0"),o.qZA()(),o.TgZ(265,"tr")(266,"td",88),o._uU(267,"PM"),o.qZA(),o.TgZ(268,"td"),o._uU(269,"\xa0"),o.qZA()(),o.TgZ(270,"tr")(271,"td",89),o._uU(272,"\xa0"),o.qZA(),o.TgZ(273,"td",88),o._uU(274,"AM"),o.qZA(),o.TgZ(275,"td"),o._uU(276,"\xa0"),o.qZA()()()()(),o.TgZ(277,"div",90)(278,"table",91)(279,"tbody")(280,"tr"),o._UZ(281,"td",92),o.qZA(),o.TgZ(282,"tr")(283,"td",92)(284,"a",93),o._UZ(285,"img",94),o.qZA()()()()()()(),o.TgZ(286,"div",95)(287,"div",96)(288,"h3",97),o._uU(289,"Your search criteria "),o._UZ(290,"i",98),o.qZA()(),o.TgZ(291,"div",99)(292,"div",100)(293,"div",21)(294,"h5",101),o._UZ(295,"i",102),o._uU(296," Tour Dates:"),o.qZA()(),o._UZ(297,"span",103)(298,"span",104),o.YNc(299,c,9,0,"ng-container",81),o.TgZ(300,"div",105)(301,"a",106),o._uU(302,"Search"),o.qZA()()()()()()(),o.TgZ(303,"div",107)(304,"div",21)(305,"a",108),o._UZ(306,"img",109),o.qZA()()()()()),2&R&&(o.xp6(215),o.Q6J("ngIf",!Q.isCharter),o.xp6(1),o.Q6J("ngIf",Q.isCharter),o.xp6(83),o.Q6J("ngIf",!Q.isCharter))},dependencies:[v.O5]}),e})()},587:(se,ie,_)=>{"use strict";_.d(ie,{Y:()=>o});var o=(()=>{return(v=o||(o={})).TOTAL_INVOICED="Total Invoiced",v.TOTAL_TO_BE_PAID="Total to be paid",v.TRANSFER_TEXT="All the information for wire transfer was successfully sent to your registered email address.",v.TOTAL_BILLED="Total Billed",v.TOTAL_PAID="Total Paid",v.WITHOUT_TRANSFER_TEXT="One of our Trip Advisors is going to contact you as soon as possible to confirm your payment and booking.",o;var v})()},4255:(se,ie,_)=>{"use strict";_.r(ie),_.d(ie,{CheckoutModule:()=>Oa});var o=_(6895),v=_(8869),f=_(7770),N=_(1625),c=_(7802),k=_(4787),e=_(4650),D=_(4205),O=_(3613),W=_(8064),R=_(5431),Q=_(2186),oe=_(2636),z=_(7579),V=(()=>{return(i=V||(V={}))[i.IdleTime=6e5]="IdleTime",i[i.CountdownTime=5e3]="CountdownTime",V;var i})();let H=(()=>{const s=class{constructor(){this.userInactive=new z.x,this.reset(),this.initListener()}initListener(){window.addEventListener("mousemove",()=>this.reset()),window.addEventListener("click",()=>this.reset()),window.addEventListener("keypress",()=>this.reset()),window.addEventListener("DOMMouseScroll",()=>this.reset()),window.addEventListener("mousewheel",()=>this.reset()),window.addEventListener("touchmove",()=>this.reset()),window.addEventListener("MSPointerMove",()=>this.reset())}reset(){clearTimeout(this.timeoutId),clearTimeout(this.countdownId),this.startIdleTimer()}startIdleTimer(){this.timeoutId=setTimeout(()=>{this.startCountdown()},V.IdleTime)}startCountdown(){this.countdownValue=V.CountdownTime/1e3,this.countdownId=setInterval(()=>{this.countdownValue--,this.countdownValue<=0&&this.userInactive.next(!0)},1e3)}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),i})();var ue=_(3837),U=_(8343),B=_(6058),L=_(9197),X=_(6035),d=_(7997),h=_(7913),m=_(6721),C=_(556),P=_(4985),y=_(2533),Y=_(8471),J=_(2610),b=_(5260),q=_(8367),S=_(7927),T=_(5861),E=_(7340),u=_(433),ee=_(1094),pe=_(2702),ot=_(5395),Ye=_(3646),Je=_(9834),j=_(706),We=_(3372);let ct=(()=>{const s=class{};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-cabins-form-loading"]],decls:2,vars:0,consts:[[1,"row",2,"display","flex","justify-content","center"]],template:function(r,n){1&r&&(e.TgZ(0,"div",0),e._UZ(1,"app-loading-spinner"),e.qZA())},dependencies:[We.g]}),i})(),lt=(()=>{const s=class{transform(t,r,n){try{let l=0;for(let p=0;p<n.length&&p<=r;p++)for(let g=0;g<n[p].length;g++)(p<r||p===r&&g<=t)&&(l+=1);return l}catch(l){return console.log("Transform2dArrayIndexPipe()"),console.error(l),0}}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275pipe=e.Yjl({name:"transform2dArrayIndex",type:s,pure:!0}),i})();var Ve=_(377);
1function ut(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",3)(1,"h3"),e._uU(2,"Currently there are "),e.TgZ(3,"b",4),e._uU(4,"no cabins available"),e.qZA(),e._uU(5," to select."),e.qZA(),e.TgZ(6,"p",5)(7,"a",6),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.goToSearchResults())}),e._UZ(8,"i",7),e._uU(9," Back to search results here"),e.qZA()()()}}const be=function(){return{maximumFractionDigits:2}};function dt(i,s){if(1&i&&(e.TgZ(0,"p",35),e._uU(1),e.qZA()),2&i){const a=e.oxw().index,t=e.oxw(2);let r;e.xp6(1),e.hij("US$ ",null==(r=t.getWasPrice(a))?null:r.toLocaleString("en",e.DdM(1,be)),"")}}function ht(i,s){if(1&i&&(e.TgZ(0,"option",48),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.s9C("value",s.index),e.xp6(1),e.Oqu(a.description)}}const pt=function(i){return{"form-control":!0,select_num_passenger_gm:!0,"alert-input":i}},mt=function(i){return{"form-control":!0,select_num_children_gm:!0,"alert-input":i}},gt=function(i){return{"custom-select":!0,"custom-select-sm":!0,select_type_bed_gm:!0,"alert-input":i}};function _t(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",36)(1,"div",37)(2,"div",38)(3,"div",39)(4,"div",40),e._uU(5,"Adults"),e.qZA()(),e._UZ(6,"input",41),e.qZA()(),e.TgZ(7,"div",42)(8,"div",38)(9,"div",39)(10,"div",40),e._uU(11,"Children*"),e.qZA()(),e._UZ(12,"input",43),e.qZA()(),e.TgZ(13,"div",44)(14,"div",38)(15,"div",39)(16,"div",40),e._uU(17,"Bed Type"),e.qZA()(),e.TgZ(18,"select",45),e.NdJ("change",function(){e.CHM(a);const r=e.oxw().index,n=e.oxw(2);return e.KtG(n.onOptionBedSelected(r))}),e.TgZ(19,"option",46),e._uU(20,"Please Select"),e.qZA(),e.YNc(21,ht,2,2,"option",47),e.qZA()()()()}if(2&i){const a=e.oxw().index,t=e.oxw(2);e.xp6(6),e.Q6J("ngClass",e.VKq(4,pt,!1===t.cabinFormsCompleteList.valid)),e.xp6(6),e.Q6J("ngClass",e.VKq(6,mt,!1===t.cabinFormsCompleteList.valid)),e.xp6(6),e.Q6J("ngClass",e.VKq(8,gt,!1===t.cabinFormsCompleteList.valid)),e.xp6(3),e.Q6J("ngForOf",t.getListOfBeds(a))}}function ft(i,s){1&i&&(e.ynx(0),e.TgZ(1,"div",49)(2,"p"),e._UZ(3,"i",50),e._uU(4," You must select at least one adult for this cabin. "),e.qZA()(),e.BQk())}function vt(i,s){1&i&&(e.ynx(0),e.TgZ(1,"div",51)(2,"p"),e._UZ(3,"i",50),e._uU(4," Maximum capacity reached for this cabin. "),e._UZ(5,"br"),e._uU(6,"Please review the number of passengers or select another cabin to continue. "),e.qZA()(),e.BQk())}function Tt(i,s){1&i&&(e.ynx(0),e.TgZ(1,"div",51)(2,"p"),e._UZ(3,"i",50),e._uU(4," You must choose a bed type. "),e.qZA()(),e.BQk())}const Qe=function(i){return{opacity:i}},Ct=function(i){return{outline:i}};function yt(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",12),e.ynx(2,13),e.TgZ(3,"div",14)(4,"div",15)(5,"div",16),e.NdJ("click",function(){const r=e.CHM(a),n=r.$implicit,l=r.index,p=e.oxw(2);return e.KtG(p.selectAction(n.value.isSelected,l))}),e._UZ(6,"img",17),e.qZA(),e.TgZ(7,"div",18),e.NdJ("click",function(){const r=e.CHM(a),n=r.$implicit,l=r.index,p=e.oxw(2);return e.KtG(p.selectAction(n.value.isSelected,l))}),e.TgZ(8,"div",19)(9,"div",20)(10,"p",21),e._uU(11),e.qZA(),e.TgZ(12,"p",22),e._uU(13),e.qZA(),e.TgZ(14,"p",23)(15,"b"),e._uU(16,"Capacity:"),e.qZA(),e._uU(17),e.qZA()(),e.TgZ(18,"div",24)(19,"div",25),e._uU(20),e.TgZ(21,"span",26),e._uU(22,"per person"),e.qZA()(),e.YNc(23,dt,2,2,"p",27),e.TgZ(24,"div",28),e._uU(25,"per person"),e.qZA()()()()()(),e.TgZ(26,"div",29),e.YNc(27,_t,22,10,"div",30),e.qZA(),e.TgZ(28,"div",31)(29,"a",32),e.NdJ("click",function(){const r=e.CHM(a),n=r.$implicit,l=r.index,p=e.oxw(2);return e.KtG(p.selectAction(n.value.isSelected,l))}),e.TgZ(30,"span",33),e._uU(31,"SELECT"),e.qZA(),e._UZ(32,"i",34),e.qZA()(),e.BQk(),e.qZA(),e.YNc(33,ft,5,0,"ng-container",2),e.YNc(34,vt,7,0,"ng-container",2),e.YNc(35,Tt,5,0,"ng-container",2),e.BQk()}if(2&i){const a=s.$implicit,t=s.index,r=e.oxw(2);let n;e.xp6(2),e.Q6J("formGroupName",t),e.xp6(1),e.Q6J("@selectUnselect",a.value.isSelected?"selected":"unSelected"),e.xp6(1),e.Q6J("ngStyle",e.VKq(19,Qe,"1")),e.xp6(2),e.Q6J("src",r.getFotoCabina(t),e.LSH)("ngStyle",e.VKq(21,Ct,a.value.isSelected?"3px solid #28a745":"none")),e.xp6(5),e.Oqu(r.getBedTypeName(t)),e.xp6(2),e.AsE("",r.getCabinTypeName(t)," / ",r.getBedTypeName(t),""),e.xp6(4),e.hij(" ",r.getCapacity(t)," guests"),e.xp6(3),e.hij("US$ ",null==(n=r.getPrice(t))?null:n.toLocaleStr
1ing("en",e.DdM(23,be))," "),e.xp6(3),e.Q6J("ngIf",r.hasPromo&&r.getPromo(t)!=r.PROMO_RAC),e.xp6(3),e.Q6J("@selectUnselect",a.value.isSelected?"selected":"unSelected"),e.xp6(1),e.Q6J("ngIf",a.value.isSelected),e.xp6(1),e.Q6J("@selectUnselect",a.value.isSelected?"selected":"unSelected"),e.xp6(1),e.Q6J("ngClass",a.value.isSelected?"bg-success":"none")("ngStyle",e.VKq(24,Qe,a.value.isSelected?"1":"0.5")),e.xp6(4),e.Q6J("ngIf",r.validateObj(t,"childrenWithoutAdult")),e.xp6(1),e.Q6J("ngIf",r.validateObj(t,"exceededCapacity")),e.xp6(1),e.Q6J("ngIf",r.validateObj(t,"bedTypeIsEmpty"))}}function bt(i,s){if(1&i&&(e.TgZ(0,"div",52),e._UZ(1,"i",50),e.TgZ(2,"p"),e._uU(3),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(3),e.hij("Number of selected adults must not be greater than ",a.adultsInUrl,".")}}function At(i,s){if(1&i&&(e.TgZ(0,"div",52),e._UZ(1,"i",50),e.TgZ(2,"p"),e._uU(3),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(3),e.hij("Number of selected children must not be greater than ",a.childrenInUrl,".")}}function St(i,s){if(1&i&&(e.TgZ(0,"div",52),e._UZ(1,"i",50),e.TgZ(2,"p"),e._uU(3),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(3),e.hij(" Number of selected adults must be ",a.adultsInUrl,".")}}function xt(i,s){if(1&i&&(e.TgZ(0,"div",52),e._UZ(1,"i",50),e.TgZ(2,"p"),e._uU(3),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(3),e.hij(" Number of selected children must be ",a.childrenInUrl,".")}}function Pt(i,s){if(1&i&&(e.TgZ(0,"div",52),e._UZ(1,"i",50),e.TgZ(2,"p"),e._uU(3),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(3),e.hij(" Number of selected cabin must be ",a.selectedCabins,".")}}function Zt(i,s){if(1&i&&(e.TgZ(0,"em"),e._uU(1),e._UZ(2,"i",59),e.qZA()),2&i){const a=e.oxw(2).index,t=e.oxw(3);e.xp6(1),e.hij(" This cabin cannot be shared and a ",t.getSglPercent(a),"% surcharge wil be applied ")}}function It(i,s){if(1&i&&(e.TgZ(0,"small",58),e._UZ(1,"br"),e.YNc(2,Zt,3,1,"em",2),e.qZA()),2&i){const a=e.oxw().index,t=e.oxw(3);e.xp6(2),e.Q6J("ngIf","0"!=t.getSglPercent(a))}}const Ft=function(i){return{height:i}};function qt(i,s){if(1&i&&(e.ynx(0),e.TgZ(1,"div",60)(2,"div",61)(3,"b"),e._uU(4),e.ALo(5,"transform2dArrayIndex"),e.qZA(),e.TgZ(6,"em",62),e._uU(7),e.qZA()(),e.TgZ(8,"div",63),e._uU(9),e.qZA()(),e.BQk()),2&i){const a=s.$implicit,t=s.index,r=e.oxw(),n=r.$implicit,l=r.index,p=e.oxw(3);e.xp6(1),e.Q6J("ngStyle",e.VKq(8,Ft,1===n.length?"100%":"")),e.xp6(3),e.hij("Passenger ",e.Dn7(5,4,t,l,p.purchaseCabinPassengers),""),e.xp6(3),e.Oqu(a.type),e.xp6(2),e.hij(" US$ ",a.price.toLocaleString("en",e.DdM(10,be))," ")}}function Nt(i,s){if(1&i&&(e.ynx(0),e.TgZ(1,"div",54)(2,"div",55)(3,"b"),e._uU(4),e.ALo(5,"cabinOrdinalName"),e.qZA(),e._uU(6),e.YNc(7,It,3,1,"small",56),e.qZA(),e.TgZ(8,"div",57),e.YNc(9,qt,10,11,"ng-container",9),e.qZA()(),e.BQk()),2&i){const a=s.$implicit,t=s.index,r=e.oxw(3);e.xp6(4),e.hij("",e.lcZ(5,5,t+1),":"),e.xp6(2),e.AsE(" ",r.getCabinTypeName(r.getIndexOfSelectedCabins(t))," / ",r.getBedTypeName(r.getIndexOfSelectedCabins(t))," "),e.xp6(1),e.Q6J("ngIf",1==a.length),e.xp6(2),e.Q6J("ngForOf",a)}}function Et(i,s){if(1&i&&(e.TgZ(0,"div",72)(1,"div",61)(2,"b"),e._uU(3),e.ALo(4,"transform2dArrayIndex"),e.qZA(),e.TgZ(5,"em",62),e._uU(6),e.qZA()(),e.TgZ(7,"div",63),e._uU(8),e.qZA()()),2&i){const a=s.$implicit,t=s.index,r=e.oxw().index,n=e.oxw(5);e.xp6(3),e.hij("Passenger ",e.Dn7(4,3,t,r,n.purchaseAirTicketDetail),""),e.xp6(3),e.Oqu(a.type),e.xp6(2),e.hij(" US$ ",a.price," ")}}function Ut(i,s){if(1&i&&(e.ynx(0),e.YNc(1,Et,9,7,"div",71),e.BQk()),2&i){const a=s.$implicit;e.xp6(1),e.Q6J("ngForOf",a)}}function Ot(i,s){if(1&i&&(e.TgZ(0,"div",70)(1,"div",55),e._uU(2," Galapagos Flight Tickets to/from Quito or Guayaquil (Round Trip) "),e.qZA(),e.TgZ(3,"div",57),e.YNc(4,Ut,2,1,"ng-container",9),e.qZA()()),2&i){const a=e.oxw(4);e.xp6(4),e.Q6J("ngForOf",a.purchaseAirTicketDetail)}}function wt(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",64)(2,"div",65)(3,"h3",66),e._uU(4,"Do you want to buy Galapagos air tickets?"),e.qZA(),e.TgZ(5,"p"),e._uU(6,"Almost all cruise operators insist that you buy cruise and the round trip ticket from Quito/Guayaquil to Galapagos Islands together. If you buy the flight separately you risk arriving at the wrong time and 
1you may miss the boat. Also the boat operator may charge you a fee."),e.qZA(),e.TgZ(7,"p"),e._uU(8,"If you have already bought your Galapagos flight or need more information please contact one of our trip advisors."),e.qZA(),e.TgZ(9,"p",67)(10,"label")(11,"input",68),e.NdJ("change",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.toggleIncludeGalapagosAirTickets())}),e.qZA(),e._uU(12," Include Galapagos air tickets"),e.qZA()()()(),e.YNc(13,Ot,5,1,"div",69),e.BQk()}if(2&i){const a=e.oxw(3);e.xp6(11),e.Q6J("checked",a.includeGalapagosAirTickets),e.xp6(2),e.Q6J("ngIf",!0===a.includeGalapagosAirTickets)}}function Rt(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",73)(2,"div",74)(3,"b"),e._uU(4,"Total price:"),e.qZA()(),e.TgZ(5,"div",75)(6,"h5",76)(7,"strong",77),e._uU(8),e.qZA()()()(),e.TgZ(9,"div",78)(10,"div",79)(11,"a",80),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.confirm(r.cabinFormsCompleteList.value.cabinFormsArray))}),e._uU(12,"Next "),e._UZ(13,"i",81),e.qZA()()(),e.BQk()}if(2&i){const a=e.oxw(3);e.xp6(8),e.hij(" US$ ",a.getTotalPrice().toLocaleString("en",e.DdM(2,be)),""),e.xp6(3),e.Q6J("goToTopCondition",a.cabinFormsCompleteList.valid)}}function Mt(i,s){if(1&i&&(e.TgZ(0,"div",53),e.YNc(1,Nt,10,7,"ng-container",9),e.YNc(2,wt,14,2,"ng-container",2),e.YNc(3,Rt,14,3,"ng-container",2),e.qZA()),2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.purchaseCabinPassengers),e.xp6(1),e.Q6J("ngIf",!1===a.includeAirFare),e.xp6(1),e.Q6J("ngIf",a.cabinFormsCompleteList.valid)}}function kt(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",3)(1,"h3"),e._uU(2,"Select Cabin(s), bed type and passengers"),e.qZA(),e.TgZ(3,"p",5),e._uU(4,"Cabins required for this search: "),e.TgZ(5,"b",4),e._uU(6),e.qZA(),e._uU(7),e.qZA(),e.TgZ(8,"form",8),e.NdJ("change",function(){e.CHM(a);const r=e.oxw();return r.setRemainingAdults(),e.KtG(r.cabinFormChanged())}),e.YNc(9,yt,36,26,"ng-container",9),e.YNc(10,bt,4,1,"div",10),e.YNc(11,At,4,1,"div",10),e.YNc(12,St,4,1,"div",10),e.YNc(13,xt,4,1,"div",10),e.YNc(14,Pt,4,1,"div",10),e.YNc(15,Mt,4,3,"div",11),e.qZA()()}if(2&i){const a=e.oxw();e.xp6(6),e.Oqu(a.selectedCabins),e.xp6(1),e.hij(" (",a.numberOfPassengers," passengers)"),e.xp6(1),e.Q6J("formGroup",a.cabinFormsCompleteList),e.xp6(1),e.Q6J("ngForOf",a.cabinFormsArray.controls),e.xp6(1),e.Q6J("ngIf",(a.cabinFormsCompleteList.touched||a.cabinFormsCompleteList.dirty)&&a.cabinFormsCompleteList.hasError("exceededAdults")),e.xp6(1),e.Q6J("ngIf",(a.cabinFormsCompleteList.touched||a.cabinFormsCompleteList.dirty)&&a.cabinFormsCompleteList.hasError("exceededChildren")),e.xp6(1),e.Q6J("ngIf",(a.cabinFormsCompleteList.touched||a.cabinFormsCompleteList.dirty)&&a.cabinFormsCompleteList.hasError("remainingAdults")),e.xp6(1),e.Q6J("ngIf",(a.cabinFormsCompleteList.touched||a.cabinFormsCompleteList.dirty)&&a.cabinFormsCompleteList.hasError("remainingChildren")),e.xp6(1),e.Q6J("ngIf",(a.cabinFormsCompleteList.touched||a.cabinFormsCompleteList.dirty)&&a.cabinFormsCompleteList.hasError("execedSelectedCabins")),e.xp6(1),e.Q6J("ngIf",a.cabinFormsCompleteList.valid)}}function Dt(i,s){if(1&i&&(e.TgZ(0,"div",82)(1,"p",62),e._uU(2),e.qZA()()),2&i){const a=e.oxw();e.xp6(2),e.AsE("*Age from ",a.cruise.minimumAgeChild," to ",a.cruise.maximumAgeChild," years old. Tickets for children usually costs less than the regular fare.")}}function Lt(i,s){1&i&&e._UZ(0,"app-cabins-form-loading")}let Bt=(()=>{const s=class extends N.H{constructor(t,r,n,l,p,g,x,A,F,M){super(t),this.injector=t,this.fb=r,this.purchaseRequestService=n,this.cabinService=l,this.airTicketService=p,this.appResourceService=g,this.cd=x,this.ngWebflowService=A,this.loadingBar=F,this.searcherFiltersService=M,this.showSelectCabinForm=!1,this.includeAirFare=!1,this.packageCode=0,this.hasPromo=!1,this.cabinasItinerarioMenorWrapper=[],this.adultsInUrl=0,this.childrenInUrl=0,this.selectedItinerary=0,this.selectedCabins=0,this.selectedCabinsArray=[],this.cabinFormsCompleteList=this.fb.group({}),this.numberOfPassengers=0,this.numberOfRemainingAdults=0,this.numberOfRemainingChildren=0,this.purchaseCabinPassengers=[],this.cabinPhotoDirectory="",this.fotoCabinaListMainImage=[],this.includeGalapagosAirTickets=!1,this.purchaseAirTicketDetail=[],this.totalPurchaseAirTicket=0,this.isTherChild=!1,this.isAloneInCabin=!1,this.loading=!0,this.loader=this.loadingBar.useRef(),this.promo=0,this.PROMO_RAC=pe.F.PROMO_RAC,this.cruise=this.cruiseService.getDefaultCruise(),this.createCabinForms()}ngOnInit(){var t=this;return(0,T.Z)(function*(){t.adultsInUrl=Number(t.purchaseRequestService.getNumberRequestAdults()),t.childrenInUrl=Number(t.purchaseRequestService.getNumberRequestChildren()),yield t.getCabinInformation(),t.isTherChild=0!==t.childrenInUrl,t.selectedItinerary=t.cruise.iterIndex,t.selectedCabins=t.purchaseRequestService.getNumberOfAvailableCabins(),t.purchaseCabinPassengers=t.createCabinFormPassengers(),t.numberOfPassengers=t.purchaseRequestService.getNumberOfPassengers(),t.selectedCabinsArray=ee.F.getArrayOfNumbers(t.purchaseRequestService.getNumberOfAvailableCabins(),!1),t.numberOfRemainingAdults=t.adultsInUrl,t.numberOfRemainingChildren=t.childrenInUrl,t.cabinPhotoDirectory=t.appResourceService.getAppResourceUrl("cabin_photo_directory"),t.includeGalapagosAirTickets=!1,t.purchaseAirTicketDetail=t.createPurchaseAirTicketDetails(),t.totalPurchaseAirTicket=O.v.calculateTotalAirTicketPrice(O.v.getPurchaseAirTicketDetailsAsArray(t.purchaseAirTicketDetail)),t.cabinFormsArray.length>0&&t.selectAction(!1,0)})()}createCabinForms(){this.cabinFormsCompleteList=this.fb.group({cabinFormsArray:this.fb.array([])},{validators:this.validateCabinForms.bind(this)})}get cabinFormsArray(){return this.cabinFormsCompleteList.get("cabinFormsArray")}setCabinsForms(){null!=this.cabinFormsCompleteList&&this.cabinFormsCompleteList.contains("cabinFormsArray")&&this.cabinasItinerarioMenorWrapper.forEach(r=>{this.cabinFormsArray.push(this.createCabinForm())})}createPurchaseAirTicketDetails(){try{if((0,f.le)(this.includeGalapagosAirTickets)||!1===this.includeGalapagosAirTickets||this.purchaseCabinPassengers.length<1||!0===this.cabinFormsCompleteList.invali
1d)return[];const t=[];return this.purchaseCabinPassengers.forEach(r=>{const n=[];r.forEach(l=>{const p=this.airTicketService.getAirTicketPrice(l.type);n.push({type:l.type,price:p})}),t.push(n)}),t}catch(t){return console.log("SelectCabinFormComponent.createAirTicket()"),console.error(t),[]}}validateCabinForms(t){const r={};let n=0,l=0,p=0,g=0;try{return(0,f.le)(this.cabinFormsArray)?{validationError:!0}:(this.cabinFormsArray.controls.forEach(A=>{l+=this.getTotalNumerOfSelectedPassengersByCabinFormByType(A,m.N.ADULT),p+=this.getTotalNumerOfSelectedPassengersByCabinFormByType(A,m.N.CHILD),g+=this.getTotalSelectedCabins(A)}),n=l+p,n>this.numberOfPassengers&&(r.exceededPassengers=!0),l>this.adultsInUrl&&(r.exceededAdults=!0),g>this.selectedCabins&&(r.execedSelectedCabins=!0),p>this.childrenInUrl&&(r.exceededChildren=!0),n<this.numberOfPassengers&&(r.remainingPassengers=!0),l<this.adultsInUrl&&(r.remainingAdults=!0),p<this.childrenInUrl&&(r.remainingChildren=!0),r)}catch(A){return console.error(A),{validationError:!0}}}createCabinForm(){return this.fb.group({cabinaItinerarioMenor:new u.NI(-1),camaCabinaList:new u.NI(-1),adults:new u.NI(1,u.kI.required),children:new u.NI(0,u.kI.required),isSelected:new u.NI(!1)},{validators:this.validateCabinForm.bind(this)})}validateCabinForm(t){try{const r={};if(t.value.isSelected){const n={validationError:!0},l=t.get("cabinaItinerarioMenor").value;if((0,f.le)(l))return n;const p=this.cabinasItinerarioMenorWrapper[l];if((0,f.le)(p))return n;const g=this.getTotalNumerOfSelectedPassengersByCabinForm(t);g>p.getCapacidad()&&(r.exceededCapacity={capacity:p.getCapacidad(),selectedPassengers:g}),this.isChildWithOutAdultByCabinForm(t)&&(r.childrenWithoutAdult=!0),this.isEmptyBedType(t)&&(r.bedTypeIsEmpty=!0)}return r}catch(r){return console.error(r),{validationError:!0}}}onOptionBedSelected(t){const r=this.getListOfBeds(t),n=this.cabinFormsCompleteList.value.cabinFormsArray[t].camaCabinaList;this.ngWebflowService.addWebFlowAction(y.B.SELECTED_BED_+(1999===this.packageCode?"A":"B")+"_"+this.cruise.name.replaceAll(" ","-"),{data:r[Number(n)]},!0)}isChildWithOutAdultByCabinForm(t){try{const r=this.getTotalNumerOfSelectedPassengersByCabinFormByType(t,m.N.ADULT),n=this.getTotalNumerOfSelectedPassengersByCabinFormByType(t,m.N.CHILD);return 0===r&&n>0}catch(r){throw console.error(r),r}}isEmptyBedType(t){try{return-1===t.get("camaCabinaList").value}catch(r){throw console.error(r),r}}getTotalNumerOfSelectedPassengersByCabinFormByType(t,r){let n=0;try{if((0,f.le)(t))return 0;if(t.contains("cabinaItinerarioMenor")&&!(0,f.le)(t.get("cabinaItinerarioMenor").value)&&t.get("isSelected").value)if(r===m.N.ADULT)t.contains("adults")&&!(0,f.le)(t.contains("adults"))&&(n+=Number(t.get("adults").value));else{if(r!==m.N.CHILD)throw new Error;t.contains("children")&&!(0,f.le)(t.contains("children"))&&(n+=Number(t.get("children").value))}return n}catch(l){throw console.error(l),l}}getTotalSelectedCabins(t){let r=0;try{return(0,f.le)(t)?0:(t.contains("cabinaItinerarioMenor")&&!(0,f.le)(t.get("cabinaItinerarioMenor").value)&&t.get("isSelected").value&&(r+=1),r)}catch(n){throw console.error(n),n}}getTotalNumerOfSelectedPassengersByCabinForm(t){let r=0;try{return(0,f.le)(t)?0:(t.contains("cabinaItinerarioMenor")&&!(0,f.le)(t.get("cabinaItinerarioMenor").value)&&t.contains("adults")&&!(0,f.le)(t.contains("adults"))&&t.contains("children")&&!(0,f.le)(t.contains("children"))&&(r+=Number(t.get("adults").value)+Number(t.get("children").value)),r)}catch(n){throw console.error(n),n}}createCabinFormPassengers(){try{const t=[];return this.cabinFormsArray.controls.forEach((r,n)=>{const l=[],p=this.getCabinFormsFormControlValue(n,"cabinaItinerarioMenor");if((0,f.le)(p))return[];const g=this.cabinasItinerarioMenorWrapper[p];if((0,f.le)(g))return[];const x=this.getCabinFormsFormControlValue(n,"adults"),A=this.getCabinFormsFormControlValue(n,"children");if((0,f.le)(x)&&(0,f.le)(A))return[];const F=1===Number(x)&&0===Number(A),M=g.getAppPrice(this.cruise.category,this.includeAirFare,F,m.N.ADULT,this.cabinService),ae=g.getChildPrice(this.cruise.category,this.includeAirFare,this.cabinService),Ce=g.getWasPrice(this.cruise.category,this.includeAirFare,F,m.N.ADULT,this.cabinService);this.isAloneInCabin=F;const ye=g.getWasPrice(this.cruise.category,this.includeAirFare,F,m.N.CHILD,this.cabinService);this.purchaseRequestService.setPercentUsed(g.getAgencyPercentOBj());const fe=g.getValorSuplemento();for(let $=0;$<x;$++)l.push({type:m.N.ADULT,price:M,wasPrice:Ce,valueSupplement:fe});for(let $=0;$<A;$++)l.push({type:m.N.CHILD,price:ae,wasPrice:ye,valueSupplement:fe});t.push(l)}),t}catch(t){return console.error(t),[]}}createCabinFormPassengersForSelected(){try{const t=[];
1return this.cabinFormsArray.controls.forEach((r,n)=>{if(!0===r.get("isSelected").value){const l=[],p=this.getCabinFormsFormControlValue(n,"cabinaItinerarioMenor");if((0,f.le)(p))return[];const g=this.cabinasItinerarioMenorWrapper[p];if((0,f.le)(g))return[];const x=this.getCabinFormsFormControlValue(n,"adults"),A=this.getCabinFormsFormControlValue(n,"children");if((0,f.le)(x)&&(0,f.le)(A))return[];const F=1===Number(x)&&0===Number(A),M=g.getAppPrice(this.cruise.category,this.includeAirFare,F,m.N.ADULT,this.cabinService),ae=g.getChildPrice(this.cruise.category,this.includeAirFare,this.cabinService),Ce=g.getWasPrice(this.cruise.category,this.includeAirFare,F,m.N.ADULT,this.cabinService);this.isAloneInCabin=F;const ye=g.getWasPrice(this.cruise.category,this.includeAirFare,F,m.N.CHILD,this.cabinService);this.purchaseRequestService.setPercentUsed(g.getAgencyPercentOBj());const fe=g.getValorSuplemento();for(let $=0;$<x;$++)l.push({type:m.N.ADULT,price:M,wasPrice:Ce,valueSupplement:fe});for(let $=0;$<A;$++)l.push({type:m.N.CHILD,price:ae,wasPrice:ye,valueSupplement:fe});t.push(l)}}),t}catch(t){return console.error(t),[]}}getCabinFormsFormControlValue(t,r){try{const n=this.getCabinFormsFormControl(t,r);return(0,f.le)(n)?null:n.value}catch(n){return console.error(n),null}}getCabinFormsFormControl(t,r){try{const n=this.getCabinFormsArrayElement(t);return(0,f.le)(n)?new u.NI:n.get(r)}catch(n){return console.error(n),new u.NI}}getCabinFormsArrayElement(t){return this.cabinFormsArray.get(t.toString())}selectAction(t,r){this.cabinFormsCompleteList.markAllAsTouched(),this.selectedCabins>1?this.getNumberCabinsSelected()<this.selectedCabins?this.cabinFormsArray.get(r.toString())?.patchValue({isSelected:!0,cabinaItinerarioMenor:r}):this.cabinFormsArray.get(r.toString())?.patchValue({isSelected:!1,camaCabinaList:-1,cabinaItinerarioMenor:-1,children:0,adults:1}):this.cabinFormsArray.controls.forEach((n,l)=>{r!==l?this.cabinFormsArray.get(l.toString())?.patchValue({isSelected:!1,camaCabinaList:-1,cabinaItinerarioMenor:-1,children:0,adults:1}):this.cabinFormsArray.get(r.toString())?.patchValue({isSelected:!0,cabinaItinerarioMenor:r})})}getNumberCabinsSelected(){let t=0;return this.cabinFormsArray.value.forEach(r=>{r.isSelected&&(t+=1)}),t}getPrice(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);if((0,f.le)(r))return;const n=this.isIncludeSupplementInCabin(t);return r.getAppPrice(this.cruise.category,this.includeAirFare,n,m.N.ADULT,this.cabinService)}catch(r){return console.log("SelectCabinFormComponent.getPrice()"),void console.error(r)}}getCurrentCabinaItinerarioMenorWrapper(t){try{return this.cabinasItinerarioMenorWrapper[t]}catch(r){return void console.error("SelectCabinFormComponent.getCurrentCabinaItinerarioMenorWrapper() > An error has happened: "+r)}}isIncludeSupplementInCabin(t){try{const r=this.getTotalNumerOfSelectedPassengersByCabinByType(t,m.N.ADULT),n=this.getTotalNumberOfSelectedPassengersByCabin(t);return 1===r&&1===n}catch{return!1}}getTotalNumerOfSelectedPassengersByCabinByType(t,r){try{const n=this.getCabinFormsArrayElement(t);if((0,f.le)(n))throw new Error;return this.getTotalNumerOfSelectedPassengersByCabinFormByType(n,r)}catch(n){throw console.error(n),n}}getTotalNumberOfSelectedPassengersByCabin(t){let r=0;try{const n=this.getCabinFormsArrayElement(t);return(0,f.le)(n)?0:(r=this.getTotalNumerOfSelectedPassengersByCabinForm(n),r)}catch(n){throw console.log("SelectCabinFormComponent.getTotalNumberOfSelectedPassengersByCabin()"),console.error(n),n}}getWasPrice(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);if((0,f.le)(r))return;const n=this.isIncludeSupplementInCabin(t);return r.getWasPrice(this.cruise.category,this.includeAirFare,n,m.N.ADULT,this.cabinService)}catch(r){return void console.error("SelectCabinFormComponent.getPrice() > An error has happened: "+r)}}setRemainingAdults(){this.numberOfRemainingAdults=this.getNumberOfRemainingPassengersByType(m.N.ADULT)}getNumberOfRemainingPassengersByType(t){try{const r=this.getTotalNumberOfSelectedPassengersByType(t);return t===m.N.ADULT?this.adultsInUrl-r:t===m.N.CHILD?this.childrenInUrl-r:0}catch(r){return console.error(r),0}}getTotalNumberOfSelectedPassengersByType(t){let r=0;if((0,f.le)(this.cabinFormsArray))throw new Error;
1return this.cabinFormsArray.controls.forEach(n=>{n.contains("cabinaItinerarioMenor")&&!(0,f.le)(n.get("cabinaItinerarioMenor").value)&&(t===m.N.ADULT?n.contains("adults")&&!(0,f.le)(n.contains("adults"))&&(r+=Number(n.get("adults").value)):t===m.N.CHILD&&n.contains("children")&&!(0,f.le)(n.contains("children"))&&(r+=Number(n.get("children").value)))}),r}cabinFormChanged(){try{this.purchaseCabinPassengers=[],this.cabinFormsCompleteList.valid?(this.purchaseCabinPassengers=this.createCabinFormPassengersForSelected(),this.reloadPurchaseAirTicketDetails()):(this.purchaseCabinPassengers=[],this.purchaseAirTicketDetail=[],this.totalPurchaseAirTicket=0),this.cd.detectChanges()}catch(t){console.log("SelectCabinFormComponent.cabinFormChanged()"),console.error(t)}}reloadPurchaseAirTicketDetails(){try{this.purchaseAirTicketDetail=this.createPurchaseAirTicketDetails(),this.totalPurchaseAirTicket=this.calculateTotalAirTicketPrice()}catch(t){console.log("SelectCabinFormCompoent.reloadPurchaseAirTicketsDetails()"),console.error(t)}}calculateTotalAirTicketPrice(){try{const t=O.v.getPurchaseAirTicketDetailsAsArray(this.purchaseAirTicketDetail);return O.v.calculateTotalAirTicketPrice(t)}catch{return 0}}getTotalPrice(){try{const t=[];this.purchaseCabinPassengers.forEach(n=>{n.forEach(l=>{t.push(l)})});let r=[];return!0===this.includeGalapagosAirTickets&&!(0,f.le)(this.purchaseAirTicketDetail)&&(r=O.v.getPurchaseAirTicketDetailsAsArray(this.purchaseAirTicketDetail)),this.purchaseRequestService.estimateTotalPriceCabins(t,this.includeGalapagosAirTickets,r)}catch(t){throw console.error(t),t}}getCabinTypeName(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);return(0,f.le)(r)?"":r.getCabinaFullName()}catch(r){return console.error("SelectCabinFormComponent.getCabinTypeName() > An error has happened while executing the method. "+r),""}}getIndexOfSelectedCabins(t){let r=[];return this.cabinFormsCompleteList.value.cabinFormsArray.forEach(n=>{-1!==n.cabinaItinerarioMenor&&r.push(n.cabinaItinerarioMenor)}),r[t]}getCapacity(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);return(0,f.le)(r)?0:r.getCapacidad()}catch(r){return console.error("SelectCabinFormComponent.getCapacity() > An error has happened while executing the method. "+r),0}}getBedTypeName(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);if((0,f.le)(r))return"";const n=this.getCabinFormsFormControlValue(t,"camaCabinaList");if((0,f.le)(n))return"";const l=r.getCamaCabinaList();return(0,f.le)(l)||0===l.length||(0,f.le)(l[n])?"":l[n.valueOf()].description}catch(r){return console.log("SelectCabinFormComponent.getBedTypeName(): "+r),console.error(r),""}}getFotoCabina(t){const r="assets/images/icons/select-foto.png";try{const n=this.getCurrentCabinaItinerarioMenorWrapper(t);if((0,f.le)(n))return r;const l=this.appResourceService.getAppResourceUrl("cabin_photo_directory");return n.getFotoCabinaListMainImage()?l+n.getFotoCabinaListMainImage():r}catch(n){return console.log("SelectCabinComponent.getFotoCabina()"),console.error(n),r||null}}getFilteredCabinaItinerarioMenorWrapper(t){try{const r=[];return this.cabinasItinerarioMenorWrapper.forEach((n,l)=>{let p=!1;this.cabinFormsArray.controls.forEach((g,x)=>{(0,f.le)(g.get("cabinaItinerarioMenor").value)||t!==x&&Number(g.get("cabinaItinerarioMenor").value)===l&&(p=!0)}),r.push({cabina:n,selected:p})}),r}catch(r){return console.error(r),[]}}confirm(t){try{if(!1===this.cabinFormsCompleteList.valid)return Object.keys(this.cabinFormsCompleteList.controls).forEach(g=>{this.cabinFormsCompleteList.get(g).controls.forEach(A=>{this.validateAllFormFields(A)})}),void this.validateAllFormFields(this.cabinFormsCompleteList);const r=[];this.purchaseCabinPassengers=this.createCabinFormPassengers();let n=0;t.forEach((g,x)=>{if(g.isSelected){const A=this.createPurchaseCabinObject(g,this.purchaseCabinPassengers[n]);if((0,f.le)(A))throw new Error;n+=1,r.push(A)}}),this.purchaseRequestService.addCabins(r),this.purchaseRequestService.setIncludeAirFare(this.includeAirFare),this.purchaseRequestService.purchase.includesFreeTransfers=(this.cruise.availability[this.cruise.iterIndex]?.aditionalServices??[]).some(g=>g.toLowerCase().includes("transfer")),this.purchaseRequestService.setIncludeGalapagosAirTickets(this.includeGalapagosAirTickets),!0===this.includeGalapagosAirTickets&&this.purchaseRequestService.setPurchaseAirTicket(),this.purchaseRequestService.setTotalCabinPrice(),this.purchaseRequestService.setPurchaseTotalPrice(),this.purchaseRequestService.purchaseRequestStatus=k.I.CABINS_COMPLETED,console.log("** select cabins ",r),this.ngWebflowService.addWebFlowAction(y.B.SELECTED_CABINS,r),this.ngWebflowService.addWebFlowAction(y.B.ENTERING_PASSENGER_DATA,{goPassengerForm:"start entering data"})}catch(r){throw console.log("SelecCabinFormComponent.Confirm()"+r.toString()),console.error(r),r}}createPurchaseCabinObject(t,r){try{const n=this.cabinasItinerarioMenorWrapper[t.cabinaItinerarioMenor];if((0,f.le)(n))return null;const l=n.getCamaCabinaList();if((0,f.le)(l))return null;const p=l[t.camaCabinaList];return(0,f.le)(p)?null:{adults:Number(t.adults),children:Number(t.children),cabinaItinerarioMenor:n.getCabinaItinerarioMenor(),camaCabinaList:p,purchaseCabinPasssengers:r}}catch(n){return console.log("SelectCabinFormComponent.createPurchaseCabinObject() > An error has happened "+n),console.error(n),null}}validateObj(t,r){const n=this.getCabinFormsArrayElement(t);return(n.touched||n.dirty)&&n.hasError(r)}isValidCabin(t){const r=this.getCabinFormsArrayElement(t);return(r.touched||r.dirty)&&r.invalid}getSglPercent(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);return(0,f.le)(r)?"0":r.getSglPercent().toString()}catch{return"0"}}getListOfBeds(t){try{const r=this.getCabinFormsFormControlValue(t,"cabinaItinerarioMenor");if((0,f.le)(r))return[];const n=this.cabinasItinerarioMenorWrapper[r];return(0,f.le)(n)?[]:n.getCamaCabinaList()}catch(r){return console.error("SelectCabinComponent.getListOfBeds() > An error has happened "+r),[]}}toggleIncludeGalapagosAirTickets(){try{this.includeGalapagosAirTickets=!this.includeGalapagosAirTickets,this.purchaseRequestService.setAditionalServices(this.includeGalapagosAirTickets?this.cruise.availability[this.cruise.iterIndex].aditionalServices:[]),this.ngWebflowService.addWebFlowAction(y.B.SELECTED_PACKAGE_+(1999===this.packageCode?"A":"B"),{includeGalapagosAirTickets:this.includeGalapagosAirTickets},!0),this.reloadPurchaseAirTicketDetails()}catch(t){console.log("SelectCabinComponent.toggleIncludeGalapagosAirTickets()"),console.error(t)}}getCabinInformation(){var t=this;return(0,T.Z)(function*(){const r=t.cruise.availability[t.selectedItinerary];if(r)try{t.loader.start();const n=yield t.cabinService.getAllCabins(r.code,t.paramsUrl.adults,t.paramsUrl.children,t.cruise.userCode).toProm
1ise();n&&n.length>0&&n.forEach(l=>{l.packageCode=t.packageCode,l.percents=t.cruise.availability[t.selectedItinerary].percents,l.packageGBCCode=t.cruise.availability[t.selectedItinerary].packageGBCCode;const p=new h.W(l);t.cabinasItinerarioMenorWrapper.push(p),t.fotoCabinaListMainImage.push(p.getFotoCabinaListMainImage())}),t.setCabinsForms(),t.loading=!1,t.cd.detectChanges(),t.loader.complete()}catch(n){console.error("Error happened in SelectCabinFormComponent.getCabinInformation() > "+n)}})()}goToSearchResults(){const t=this.searcherFiltersService.getSearchRouteGeneric()||["/search"];this.router.navigate(t)}getPromo(t){try{const r=this.getCurrentCabinaItinerarioMenorWrapper(t);return(0,f.le)(r)?void 0:r.getPromo()}catch(r){return void console.error("SelectCabinFormComponent.getPromo() > An error has happened: "+r)}}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(e.zs3),e.Y36(u.qu),e.Y36(O.v),e.Y36(b.p),e.Y36(ot.V),e.Y36(Ye.m),e.Y36(e.sBO),e.Y36(q.k7),e.Y36(oe.dL),e.Y36(W.y))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-cabins-form"]],inputs:{showSelectCabinForm:"showSelectCabinForm",cruise:"cruise",includeAirFare:"includeAirFare",packageCode:"packageCode",hasPromo:"hasPromo",cabinasItinerarioMenorWrapper:"cabinasItinerarioMenorWrapper"},features:[e.qOj],decls:4,vars:4,consts:[["class","card-body",4,"ngIf"],["class","card-footer",4,"ngIf"],[4,"ngIf"],[1,"card-body"],[1,"text-danger"],[2,"font-size","18px"],[1,"btn","bg-light","text-secondary","mb-3",3,"click"],[1,"fa","fa-angle-left"],[3,"formGroup","change"],[4,"ngFor","ngForOf"],["class","fs-13 p-2 alert-warning alerts mb-3","id","cabin1a-alert","style","display: flex; justify-content: flex-end;",4,"ngIf"],["class","container","id","option-a-next",4,"ngIf"],["id","cabin1a-select","formArrayName","cabinFormsArray",1,"row","no-gutters","my-1","border-bottom","py-0","border-top","cabin-selected"],[3,"formGroupName"],[1,"col-12","col-md","pr-md-0","pr-3"],[1,"row","option-select-list-card","my-1",3,"ngStyle"],[1,"col-sm-6","col-md-4","col-lg-5","col-xl-4","pr-0",3,"click"],["title","Choose Cabin Type",1,"img-fluid","mr-2","cabin-pic",3,"src","ngStyle"],[1,"col-sm-6","col-md-8","col-lg-7","col-xl-8",2,"border-color","black",3,"click"],[1,"row","no-gutters"],[1,"col-md-8","col-lg-12","col-xl-8"],[1,"m-0","mt-2","cabin-title","text-secondary"],[1,"small","font-weight-bold","orange","m-0"],[1,"fs-13","m-0"],[1,"col-md-4","col-lg-12","col-xl-4","justify-content-center","align-items-center"],[1,"mt-2","mb-0","cabin-title","font-weight-bold"],[1,"small","d-sm-inline","d-md-none","d-lg-inline","d-xl-none"],["class","m-0 text-secondary line-through small",4,"ngIf"],[1,"small","d-none","d-md-inline","d-lg-none","d-xl-inline"],[1,"col","col-md","pax-select",2,"padding-right","6px"],["class","row no-gutters my-2",4,"ngIf"],[1,"col","col-md","checkbx"],["id","cabin1a",1,"w-100","text-center","h-100","d-block","position-relative","selcabin",3,"ngClass","ngStyle","click"],[1,"d-block","d-md-none","pt-2","h5","text-white"],["id","check-icon",1,"fa","fa-check","d-md-inline","d-none","text-white","position-absolute"],[1,"m-0","text-secondary","line-through","small"],[1,"row","no-gutters","my-2"],[1,"col-6","mb-2","pr-2"],[1,"input-group","input-group-sm"],[1,"input-group-prepend"],[1,"input-group-text"],["id","cabin1a-adults","name","cabin1a-adults","formControlName","adults","type","number","min","0","max","2",3,"ngClass"],[1,"col-6","mb-2"],["id","cabin1a-children","name","cabin1a-children","formControlName","children","type","number","min","0","max","1",3,"ngClass"],[1,"col-12"],["name","cabin1a-type-bed","id","cabin1a-type-bed","formControlName","camaCabinaList",3,"ngClass","change"],["value","-1","selected","","disabled",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["id","cabin1a-alert",1,"fs-13","p-2","alert-warning","alerts","mb-3","text-right",2,"text-align","right"],[1,"fa","fa-exclamation-triangle"],["id","cabin1a-alert",1,"fs-13","p-2","alert-warning","alerts","mb-3",2,"text-align","right"],["id","cabin1a-alert",1,"fs-13","p-2","alert-warning","alerts","mb-3",2,"display","flex","justify-content","flex-end"],["id","option-a-next",1,"container"],[1,"row","mt-4"],[1,"col-sm-5","col-md-7","col-lg-6","col-xl-7","bg-gray","p-2"],["style","text-align: center; font-size: small;",4,"ngIf"],[1,"col-sm-7","col-md-5","col-lg-6","col-xl-5"],[2,"text-align","center","font-size","small"],[1,"fas","fa-wind-warning"],[1,"row","bg-light","fs-13","p-2","border-top",3,"ngStyle"],[1,"col-6","col-sm-7"],[1,"small"],[1,"col-6","col-sm-5","text-right"],[1,"row","mt-1","bg-light"],[1,"col-12","pr-0","text-center","fs-13"],[1,"fs-24","orange","mt-3"],[1,"font-weight-bold"],["type","checkbox","id","tkts",3,"checked","change"],["class","row mt-4","id","flight-tickets",4,"ngIf"],["id","flight-tickets",1,"row","mt-4"],["class","row bg-light fs-13 p-2 border-top",4,"ngFor","ngForOf"],[1,"row","bg-light","fs-13","p-2","border-top"],[1,"row","mt-1"],[1,"col-5","col-md-7","col-lg-6","col-xl-7","bg-orange","text-white","p-2","text-right"],[1,"col-7","col-md-5","col-lg-6","col-xl-5","text-right","bg-light","p-2","pr-4"],[1,"m-0"],[2,"font-weight","600"],[1,"row","mt-3","pr-0"],[1,"col-12","pr-0"],["id","option-a","galGoToTop","",1,"btn","btn-success","float-right","pl-4","pr-4","next_passenger_gm","edit-next",2,"color","#fff",3,"goToTopCondition","click"],[1,"fa","fa-angle-right"],[1,"card-footer"]],template:function(r,n){1&r&&(e.YNc(0,ut,10,0,"div",0),e.YNc(1,kt,16,10,"div",0),e.YNc(2,Dt,3,2,"div",1),e.YNc(3,Lt,1,0,"app-cabins-form-loading",2)),2&r&&(e.Q6J("ngIf",!n.loading&&0==n.cabinFormsArray.length),e.xp6(1),e.Q6J("ngIf",!n.loading&&n.cabinFormsArray.length>0),e.xp6(1),e.Q6J("ngIf",!n.loading&&n.cabinFormsArray.length>0),e.xp6(1),e.Q6J("ngIf",n.loading))},dependencies:[o.mk,o.sg,o.O5,o.PC,u._Y,u.YN,u.Kr,u.Fj,u.wV,u.EJ,u.JJ,u.JL,u.qQ,u.Fd,u.sg,u.u,u.x0,u.CE,Je.K,j.mh,ct,lt,Ve.p],styles:["#check-icon[_ngcontent-%COMP%]{font-size:24px}div.cabin-selected[_ngcontent-%COMP%]:hover{cursor:pointer;background-color:#d4edda}"],data:{animation:[(0,E.X$)("selectUnselect",[(0,E.SB)("selected",(0,E.oB)({opacity:1,backgroundColor:"#d4edda"})),(0,E.SB)("unSelect",(0,E.oB)({opacity:.5,backgroundColor:"white"})),(0,E.eR)("selected => unSelect",[(0,E.jt)("1s")]),(0,E.eR)("unSelect => selected",[(0,E.jt)("0.5s")])])]}}),i})();const Ae=function(){return{maximumFractionDigits:2}};
1function Yt(i,s){if(1&i&&(e.TgZ(0,"p",32),e._uU(1),e.qZA()),2&i){const a=e.oxw(2);e.xp6(1),e.hij("US$ ",a.wasPriceWithAirFare.toLocaleString("en",e.DdM(1,Ae)),"")}}function Jt(i,s){1&i&&e._UZ(0,"i",16)}function Wt(i,s){1&i&&e._UZ(0,"i",33)}function Vt(i,s){1&i&&e._UZ(0,"i",16)}function Qt(i,s){1&i&&e._UZ(0,"i",34)}function Gt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1," \xa0 "),e.TgZ(2,"strong",35),e._uU(3,"(Tkt Free)"),e.qZA()())}function Ht(i,s){if(1&i&&(e.TgZ(0,"span"),e._uU(1," ("),e.TgZ(2,"span",36),e._uU(3),e.qZA(),e._uU(4,") "),e.qZA()),2&i){const a=e.oxw(2);e.xp6(3),e.Oqu(a.getPromoName())}}function jt(i,s){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.Oqu(a.name)}}function Kt(i,s){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.Oqu(a.name)}}function $t(i,s){if(1&i&&(e.TgZ(0,"div"),e._UZ(1,"p",39),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(3);e.xp6(1),e.Q6J("innerHTML",t.hasTextFree(a),e.oJD)}}function zt(i,s){if(1&i&&(e.TgZ(0,"li",38),e.YNc(1,$t,2,1,"div",18),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.Q6J("ngIf",""!=a)}}function Xt(i,s){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,zt,2,1,"li",37),e.qZA()),2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.cruise.availability[a.itineraryIndex].aditionalServices)}}function er(i,s){1&i&&(e.TgZ(0,"div")(1,"div",26)(2,"span",27),e._uU(3,"** Free services apply only: when purchasing roundtrip tickets on the corresponding dates of the chosen cruise."),e.qZA()(),e.TgZ(4,"div",26)(5,"span",27),e._uU(6,"** The night before the cruise is scheduled."),e.qZA()()())}function tr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6),e._uU(4," from "),e.TgZ(5,"h3",7),e._uU(6),e.qZA(),e.YNc(7,Yt,2,2,"p",8),e._uU(8," per person "),e.qZA()(),e.TgZ(9,"span",9),e._uU(10,"Option 1"),e.qZA(),e.TgZ(11,"h3",10),e._uU(12,"Galapagos Cruise plus Local Flight"),e.qZA(),e.TgZ(13,"div",11),e._UZ(14,"i",12),e.YNc(15,Jt,1,0,"i",13),e.YNc(16,Wt,1,0,"i",14),e.YNc(17,Vt,1,0,"i",13),e.YNc(18,Qt,1,0,"i",15),e._UZ(19,"i",16),e.TgZ(20,"i",17),e.YNc(21,Gt,4,0,"span",18),e.qZA()(),e.TgZ(22,"p",19),e._uU(23),e.YNc(24,Ht,5,1,"span",18),e.qZA(),e.TgZ(25,"p",19),e._uU(26,"\u2022 Galapagos Flight Tickets to/from Quito or Guayaquil (Round Trip)* "),e.qZA(),e.TgZ(27,"div",20)(28,"div",21)(29,"b",22),e._uU(30,"Cruise Includes:"),e.qZA(),e.TgZ(31,"ul",23),e.YNc(32,jt,2,1,"li",24),e.qZA()(),e.TgZ(33,"div",21)(34,"b",22),e._uU(35,"Not included in Cruise:"),e.qZA(),e.TgZ(36,"ul",25),e.YNc(37,Kt,2,1,"li",24),e.qZA()(),e.TgZ(38,"div",26),e.YNc(39,Xt,2,1,"div",18),e.qZA(),e.TgZ(40,"div",26)(41,"span",27),e._uU(42,"* Flights are subject to availability"),e.qZA()(),e.YNc(43,er,7,0,"div",18),e.qZA(),e.TgZ(44,"a",28),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.toggleCabins("A"))}),e._uU(45),e._UZ(46,"i",29),e.qZA()(),e.TgZ(47,"div",30),e._UZ(48,"app-cabins-form",31),e.qZA()()}if(2&i){const a=e.oxw();e.xp6(6),e.hij("US$ ",a.priceWithAirFare.toLocaleString("en",e.DdM(19,Ae)),""),e.xp6(1),e.Q6J("ngIf",a.hasPromo),e.xp6(8),e.Q6J("ngIf",a.hasWordInSA("hotel")||a.hasWordInSA("Hotel")||a.hasWordInSA("Hotels")||a.hasWordInSA("hotels")),e.xp6(1),e.Q6J("ngIf",a.hasWordInSA("hotel")||a.hasWordInSA("Hotel")||a.hasWordInSA("Hotels")||a.hasWordInSA("hotels")),e.xp6(1),e.Q6J("ngIf",a.hasWordInSA("transfers")||a.hasWordInSA("Transfers")||a.hasWordInSA("Transfer")||a.hasWordInSA("transfer")),e.xp6(1),e.Q6J("ngIf",a.hasWordInSA("transfers")||a.hasWordInSA("Transfers")||a.hasWordInSA("Transfer")||a.hasWordInSA("transfer")),e.xp6(3),e.Q6J("ngIf",a.cruise.availability[0].packageGBCCode===a.valuePackageGBCCode),e.xp6(2),e.hij("\u2022 ",a.getCruiseItineraryDuration(),"-Days Galapagos Cruise "),e.xp6(1),e.Q6J("ngIf",a.hasPromo),e.xp6(8),e.Q6J("ngForOf",a.featureInclude),e.xp6(5),e.Q6J("ngForOf",a.featureNotIncludeOptionA),e.xp6(2),e.Q6J("ngIf",a.cruise.availability[a.itineraryIndex].aditionalServices.length),e.xp6(4),e.Q6J("ngIf",a.cruise.availability[a.itineraryIndex].aditionalServices.length),e.xp6(1),e.Q6J("ngClass",null!=a.cruise.availability[a.itineraryIndex].visibleDeparture?a.cruise.availability[a.itineraryIndex].visibleDeparture?"":"disabled":""),e.xp6(1),e.hij(" ",null!=a.cruise.availability[a.itineraryIndex].visibleDeparture?a.cruise.availability[a.itineraryIndex].visibleDeparture?a.textSelectOptionA:"CRUISE NOT AVAILABLE":a.textSelectOptionA," "),e.xp6(3),e.Q6J("includeAirFare",!0)("hasPromo",a.hasPromo)("cruise",a.cruise)("packageCode",a.optionA)}}
1function rr(i,s){if(1&i&&(e.TgZ(0,"p",32),e._uU(1),e.qZA()),2&i){const a=e.oxw(2);e.xp6(1),e.hij("US$ ",a.wasPriceWithoutAirFare.toLocaleString("en",e.DdM(1,Ae)),"")}}function ir(i,s){if(1&i&&(e.TgZ(0,"span"),e._uU(1," ("),e.TgZ(2,"span",36),e._uU(3),e.qZA(),e._uU(4,") "),e.qZA()),2&i){const a=e.oxw(2);e.xp6(3),e.Oqu(a.getPromoName())}}function ar(i,s){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.Oqu(a.name)}}function nr(i,s){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.Oqu(a.name)}}function sr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",3)(1,"div",40)(2,"div",5)(3,"div",6),e._uU(4," from "),e.TgZ(5,"h3",7),e._uU(6),e.qZA(),e.YNc(7,rr,2,2,"p",8),e._uU(8," per person "),e.qZA()(),e.TgZ(9,"span",9),e._uU(10,"Option 2"),e.qZA(),e.TgZ(11,"h3",10),e._uU(12,"Galapagos Cruise"),e.qZA(),e.TgZ(13,"div",11),e._UZ(14,"i",12),e.qZA(),e.TgZ(15,"p",19),e._uU(16),e.YNc(17,ir,5,1,"span",18),e.qZA(),e.TgZ(18,"div",20)(19,"div",21)(20,"b",22),e._uU(21,"Cruise Includes:"),e.qZA(),e.TgZ(22,"ul",23),e.YNc(23,ar,2,1,"li",24),e.qZA()(),e.TgZ(24,"div",21)(25,"b",22),e._uU(26,"Not included in Cruise:"),e.qZA(),e.TgZ(27,"ul",25),e.YNc(28,nr,2,1,"li",24),e.qZA()()(),e.TgZ(29,"a",41),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.toggleCabins("B"))}),e._uU(30),e._UZ(31,"i",29),e.qZA()(),e.TgZ(32,"div",42),e._UZ(33,"app-cabins-form",31),e.qZA()()}if(2&i){const a=e.oxw();e.xp6(6),e.hij("US$ ",a.priceWithoutAirFare.toLocaleString("en",e.DdM(12,Ae)),""),e.xp6(1),e.Q6J("ngIf",a.hasPromo),e.xp6(9),e.hij("\u2022 ",a.getCruiseItineraryDuration(),"-Days Galapagos Cruise "),e.xp6(1),e.Q6J("ngIf",a.hasPromo),e.xp6(6),e.Q6J("ngForOf",a.featureIncludeOptionB),e.xp6(5),e.Q6J("ngForOf",a.featureNotIncludeOptionB),e.xp6(1),e.Q6J("ngClass",null!=a.cruise.availability[a.itineraryIndex].visibleDeparture?a.cruise.availability[a.itineraryIndex].visibleDeparture?"":"disabled":""),e.xp6(1),e.hij(" ",null!=a.cruise.availability[a.itineraryIndex].visibleDeparture?a.cruise.availability[a.itineraryIndex].visibleDeparture?a.textSelectOptionB:"CRUISE NOT AVAILABLE":a.textSelectOptionB," "),e.xp6(3),e.Q6J("includeAirFare",!1)("hasPromo",a.hasPromo)("cruise",a.cruise)("packageCode",a.optionB)}}let or=(()=>{const s=class{constructor(t,r,n,l,p,g,x,A,F,M,ae){this.cruiseService=t,this.purchaseRequestService=r,this.promoService=n,this.cabinService=l,this.searcherFiltersService=p,this.activatedRoute=g,this.routerNavService=x,this.cd=A,this.ngWebflowService=F,this.router=M,this.location=ae,this.showSelectCabinForm=!1,this.includeAirFare=!1,this.packageCode=0,this.hasPromo=!1,this.apliedPackageA=!1,this.isDefaultOptions=!1,this.isShowOptionA=!1,this.isShowOptionB=!1,this.itineraryIndex=0,this.priceWithAirFare=0,this.priceWithoutAirFare=0,this.wasPriceWithAirFare=0,this.wasPriceWithoutAirFare=0,this.optionA=C.N.TYPE_A,this.optionB=C.N.TYPE_B,this.featureInclude=[],this.featureIncludeOptionB=[],this.featureNotIncludeOptionA=[],this.featureNotIncludeOptionB=[],this.featureServices=[],this.selectedItinerary=0,this.isOptionBIncludesFreeTransfers=!1,this.fotoCabinaListMainImage=[],this.valuePackageGBCCode=Y.M.INCLUDES_AIR_TICKETS,this.selectOptionA=!1,this.selectOptionB=!1,this.textSelectOptionA="Select",this.textSelectOptionB="Select",this.keywords=["Flight ticket round trip to Galapagos"],this.cruise=t.getDefaultCruise(),this.generateUrl()}ngOnInit(){this.paramsUrl=this.activatedRoute.snapshot.params,this.cruise=this.purchaseRequestService.getCruise(),this.purchaseRequestService.setNumberRequestAdults(Number(this.paramsUrl.adults)),this.purchaseRequestService.setNumberRequestChildren(Number(this.paramsUrl.children)),this.hasPromo=P.G.doesItineraryHasPromo(this.cruise,this.cruise.iterIndex),this.itineraryIndex=this.cruise.iterIndex,this.priceWithAirFare=this.cruiseService.getCruisePriceinNewFormat(this.cruise,this.itineraryIndex,!0,this.optionA),this.priceWithoutAirFare=this.cruiseService.getCruisePriceinNewFormat(this.cruise,this.itineraryIndex,!1,this.optionB),this.wasPriceWithAirFare=this.getWasPrice(!0),this.wasPriceWithoutAirFare=this.getWasPrice(!1),this.showOptions(),this.isOptionBIncludesFreeTransfers=this.hasWordInSA("transfer"),this.setFeaturesValues()}setFeaturesValues(){this.featureServices=this.cruise.availability[this.itineraryIndex].featureServices,this.featureServices.forEac
1h(t=>{t.value?(this.isItemOptionA(t)&&(this.isItemOptionAInclude(t)||this.featureInclude.push(t)),this.isItemOptionB(t)&&this.featureIncludeOptionB.push(t)):(this.isItemOptionAInclude(t)||this.featureNotIncludeOptionA.push(t),this.featureNotIncludeOptionB.push(t))}),this.featureNotIncludeOptionA.forEach((t,r)=>{t.name==this.keywords&&(this.featureNotIncludeOptionA.splice(r,1),this.featureNotIncludeOptionA.unshift(t))}),this.featureNotIncludeOptionB.forEach((t,r)=>{t.name==this.keywords&&(this.featureNotIncludeOptionB.splice(r,1),this.featureNotIncludeOptionB.unshift(t))})}showOptions(){try{this.isDefaultOptions=this.purchaseRequestService.isPackageOption(C.N.TYPE_DEFAULT),this.isShowOptionA=this.purchaseRequestService.isOptionAAvailable(),this.isShowOptionB=this.purchaseRequestService.isOptionBAvailable()}catch(t){console.log("SelectCabinComponent.showOptions()"),console.error(t)}}hasWordInSA(t){return(this.cruise.availability[this.itineraryIndex]?.aditionalServices??[]).some(n=>n.toLowerCase().includes(t.toLowerCase()))}getCruiseItineraryDuration(){try{return this.purchaseRequestService.getCruiseWrapper().getCruiseItineraryDuration().substring(0,1)}catch(t){return console.log("SelectCabinComponent.getCruiseItineraryDuration()"),console.error(t),""}}getPromoName(){return this.hasPromo?this.promoService.getPromoText(this.cruise.availability[this.cruise.iterIndex].promotionType,this.cruise.availability[this.cruise.iterIndex].promotionValue):""}getWasPrice(t){return new h.W(this.cruise.availability[this.itineraryIndex]).getWasPrice(this.cruise.category,t,!1,m.N.ADULT,this.cabinService)}hasTextFree(t){const r=t.split(" ");let n="<P>";return r.forEach(l=>{"FREE"===l?n+=` <strong>${l}</strong>`:n=n+" "+l}),n+="</p>",n}toggleCabins(t){switch(t){case"A":this.purchaseRequestService.setAditionalServices(this.cruise.availability[this.cruise.iterIndex].aditionalServices);const r=this.hasPromo?this.wasPriceWithoutAirFare:void 0;this.ngWebflowService.addWebFlowAction(y.B.SELECTED_PACKAGE_+t+"_"+this.cruise.name.replaceAll(" ","-"),{priceWithAirFare:this.priceWithAirFare,wasPriceWithAirFare:r},!0),this.selectOptionA=!0,this.selectOptionB=!1;break;case"B":this.purchaseRequestService.setAditionalServices([]);const n=this.hasPromo?this.wasPriceWithoutAirFare:void 0;this.ngWebflowService.addWebFlowAction(y.B.SELECTED_PACKAGE_+t+"_"+this.cruise.name.replaceAll(" ","-"),{priceWithoutAirFare:this.priceWithoutAirFare,wasPriceWithoutAirFare:n},!0),this.selectOptionA=!1,this.selectOptionB=!0}this.selectOptionA&&(this.textSelectOptionA="Selected",this.textSelectOptionB="Select"),this.selectOptionB&&(this.textSelectOptionB="Selected",this.textSelectOptionA="Select")}isItemOptionB(t){return!(this.hasWordInAditionalService(t,"hotel")||this.hasWordInAditionalService(t,"Hotel")||this.hasWordInAditionalService(t,"Hotels")||this.hasWordInAditionalService(t,"hotels")||this.hasWordInAditionalService(t,"transfers")||this.hasWordInAditionalService(t,"Transfers")||this.hasWordInAditionalService(t,"Transfer")||this.hasWordInAditionalService(t,"transfer")||this.hasWordInAditionalService(t,"airports")||this.hasWordInAditionalService(t,"Airports")||this.hasWordInAditionalService(t,"Airport")||this.hasWordInAditionalService(t,"airport"))}isItemOptionA(t){return!(!this.hasWordInSA("hotel")&&this.hasWordInAditionalService(t,"hotel")||!this.hasWordInSA("Hotel")&&this.hasWordInAditionalService(t,"Hotel")||!this.hasWordInSA("Hotels")&&this.hasWordInAditionalService(t,"Hotels")||!this.hasWordInSA("hotels")&&this.hasWordInAditionalService(t,"hotels")||!this.hasWordInSA("transfers")&&this.hasWordInAditionalService(t,"transfers")||!this.hasWordInSA("Transfers")&&this.hasWordInAditionalService(t,"Transfers")||!this.hasWordInSA("Transfer")&&this.hasWordInAditionalService(t,"Transfer")||!this.hasWordInSA("transfer")&&this.hasWordInAditionalService(t,"transfer"))}isItemOptionAInclude(t){return this.keywords.some(r=>t.name.includes(r))}hasWordInAditionalService(t,r){let n=-1;try{return n=t.name.indexOf(r),!(n<0)}catch{return!1}}generateUrl(){this.location.replaceState(this.router.url)}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(P.G),e.Y36(O.v),e.Y36(J.m),e.Y36(b.p),e.Y36(W.y),e.Y36(v.gz),e.Y36(D.r),e.Y36(e.sBO),e.Y36(q.k7),e.Y36(v.F0),e.Y36(o.Ye))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-package-option"]],inputs:{showSelectCabinForm:"showSelectCabinForm",cruise:"cruise",includeAirFare:"includeAirFare",packageCode:"packageCode"},decls:5,vars:2,consts:[[1,"mb-3"],["id","accordion"],["class","card mb-3",4,"ngIf"],[1,"card","mb-3"],["id","headingOne",1,"card-header","bg-white"],[1,"card","bg-light","float-none","float-md-right","mt-2"],[1,"card-body","small","p-2"],[1,"mb-0","line"],["class","m-0 text-secondary line-through",4,"ngIf"],[1,"bg-orange","options","text-white","text-center","float-left","mr-3","position-relative"],[1,"text-secondary","mt-2","fs-24"],[1,"icons","packages","mb-2"],["placement","bottom","ngbTooltip","Cruise",1,"fa","fa-ship"],["class","fa fa-plus","style","font-size: 8px; padding: 4px;",4,"ngIf"],["class","fa fa-hotel","placement","bottom","ngbTooltip","Hotel",4,"ngIf"],["class","fa fa-shuttle-van","placement","bottom","ngbTooltip","transfer",4,"ngIf"],[1,"fa","fa-plus",2,"font-size","8px","padding","4px"],["placement","bottom","ngbTooltip","Galapagos Flights",1,"fa","fa-plane","text-success"],[4,"ngIf"],[1,"my-1","condensed","h6","text-info"],[1,"row","mt-3","clearfix","w-100"],[1,"col-sm-6"],[1,"fs-13","text-muted","text-uppercase"],[1,"fs-13","comp-features"],[4,"ngFor","ngForOf"],[1,"fs-13","not-included"],[1,"col-12"],[1,"small"],["href","javascript:void(0)","data-toggle","collapse","data-target","#collapseOne","aria-expanded","fal
1se","aria-controls","collapseOne",1,"btn","btn-success","float-right","pl-4","pr-4","selector",3,"ngClass","click"],[1,"fa","fa-angle-down"],["id","collapseOne","aria-labelledby","headingOne","data-parent","#accordion",1,"collapse","cabins"],[3,"includeAirFare","hasPromo","cruise","packageCode"],[1,"m-0","text-secondary","line-through"],["placement","bottom","ngbTooltip","Hotel",1,"fa","fa-hotel"],["placement","bottom","ngbTooltip","transfer",1,"fa","fa-shuttle-van"],["data-toggle","collapse","href","#includes3","role","button","aria-expanded","false","aria-controls","includes",2,"font-family","'Poppins', sans-serif !important","font-size","14px"],[1,"offer"],["style","display: flex;",4,"ngFor","ngForOf"],[2,"display","flex"],[3,"innerHTML"],["id","headingTwo",1,"card-header","bg-white"],["href","javascript:void(0)","data-toggle","collapse","data-target","#collapseTwo","aria-expanded","false","aria-controls","collapseTwo",1,"btn","btn-success","float-right","pl-4","pr-4","selector",3,"ngClass","click"],["id","collapseTwo","aria-labelledby","headingTwo","data-parent","#accordion",1,"collapse","cabins"]],template:function(r,n){1&r&&(e.TgZ(0,"h3",0),e._uU(1,"Please choose any of our tour options below:"),e.qZA(),e.TgZ(2,"div",1),e.YNc(3,tr,49,20,"div",2),e.YNc(4,sr,34,13,"div",2),e.qZA()),2&r&&(e.xp6(3),e.Q6J("ngIf",n.isDefaultOptions||n.isShowOptionA),e.xp6(1),e.Q6J("ngIf",n.isDefaultOptions||n.isShowOptionB))},dependencies:[o.mk,o.sg,o.O5,S._L,Bt],styles:[".disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}"]}),i})();var Ee=_(4958),Ue=_(5202);function cr(i,s){1&i&&(e.TgZ(0,"div",22)(1,"small"),e._uU(2,"Name is Required"),e.qZA()())}function lr(i,s){1&i&&(e.TgZ(0,"div",22)(1,"small"),e._uU(2,"Email is Required"),e.qZA()())}function ur(i,s){if(1&i&&(e.TgZ(0,"option",23),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.s9C("value",a),e.xp6(1),e.Oqu(a)}}function dr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"label",24),e._uU(3,"Other:"),e.qZA(),e.TgZ(4,"input",25),e.NdJ("focusout",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.addLog())}),e.qZA()()()}}function hr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",20)(1,"div",6)(2,"label",26),e._uU(3,"Questions or requirements"),e.qZA(),e.TgZ(4,"textarea",27),e.NdJ("focusout",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.addLog())}),e.qZA()(),e.TgZ(5,"button",28),e._uU(6,"Send"),e.qZA(),e.TgZ(7,"a",29),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.cancel())}),e._uU(8,"Cancel"),e.qZA()()}}function pr(i,s){1&i&&(e.TgZ(0,"div",30),e._UZ(1,"app-loading-spinner"),e.qZA())}const Ge=function(i){return{"is-invalid":i}},He=function(i,s){return[i,s]};function mr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"form",2),e.NdJ("ngSubmit",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.onSubmit())}),e.TgZ(1,"p",3),e._uU(2,' Fields with an "*" are mandatory.'),e.qZA(),e.TgZ(3,"div",4)(4,"div",5)(5,"div",6)(6,"label",7),e._uU(7,"Name*"),e.qZA(),e.TgZ(8,"input",8),e.NdJ("focusout",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.addLog())}),e.qZA(),e.YNc(9,cr,3,0,"div",9),e.qZA()(),e.TgZ(10,"div",5)(11,"div",6)(12,"label",10),e._uU(13,"Telephone"),e.qZA(),e._UZ(14,"ngx-intl-tel-input",11),e.qZA()(),e.TgZ(15,"div",5)(16,"div",6)(17,"label",12),e._uU(18,"Email*"),e.qZA(),e.TgZ(19,"input",13),e.NdJ("focusout",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.addLog())}),e.qZA(),e.YNc(20,lr,3,0,"div",9),e.qZA()(),e.TgZ(21,"div",5)(22,"div",6)(23,"label",14),e._uU(24,"How did you find us?:"),e.qZA(),e.TgZ(25,"select",15),e.NdJ("focusout",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.addLog())}),e.TgZ(26,"option",16),e._uU(27,"Please select"),e.qZA(),e.YNc(28,ur,2,2,"option",17),e.qZA()()(),e.YNc(29,dr,5,0,"div",18),e.YNc(30,hr,9,0,"div",19),e.TgZ(31,"div",20),e.YNc(32,pr,2,0,"div",21),e.qZA()()()}if(2&i){const a=e.oxw();e.Q6J("formGroup",a.contactForm),e.xp6(8),e.Q6J("ngClass",e.VKq(21,Ge,a.validateForm(a.contactForm,"firstName"))),e.xp6(1),e.Q6J("ngIf",a.validateForm(a.contactForm,"firstName")),e.xp6(5),e.Q6J("cssClass","custom")("preferredCountries",e.WLB(23,He,a.CountryISO.UnitedStates,a.CountryISO.UnitedKingdom))("enableAutoCountrySelect",!0)("enablePlaceholder",!0)("searchCountryFlag",!0)("searchCountryField",e.WLB(26,He,a.SearchCountryField.Iso2,a.SearchCountryField.Name))("selectFirstCountry",!1)("selectedCountryISO",a.CountryISO.UnitedStates)("maxLength",15)("phoneValidation",!0)("separateDialCode",!0),e.xp6(
15),e.Q6J("ngClass",e.VKq(29,Ge,a.validateForm(a.contactForm,"email"))),e.xp6(1),e.Q6J("ngIf",a.validateForm(a.contactForm,"email")),e.xp6(6),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",a.howFindUsList),e.xp6(1),e.Q6J("ngIf","Other"===a.contactForm.get("howFindUs").value),e.xp6(1),e.Q6J("ngIf",!a.loading),e.xp6(2),e.Q6J("ngIf",a.loading)}}function gr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",31)(1,"div",32)(2,"div",33)(3,"p",34),e._uU(4,"Your message has been sent successfully. One of our sales specialists will contact you as soon as possible."),e.qZA(),e.TgZ(5,"p",34)(6,"a",35),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.goToSearchResults())}),e._uU(7,"Go back to search results"),e.qZA(),e._uU(8," and continue looking for Galapagos cruises."),e.qZA()()()()}}let _r=(()=>{const s=class{constructor(t,r,n,l,p,g,x,A,F,M){this.contactFormService=t,this.purchaseRequestService=r,this.router=n,this.searcherFiltersService=l,this.ngWebflowService=p,this.countryService=g,this.companyParams=x,this.utilsService=A,this.promoService=F,this.cruiseService=M,this.closeContactFormModal=new e.vpe,this.contactForm=new u.cw({}),this.arrayOfCountries=[],this.howFindUsList=[],this.isInquireCRMSent=!1,this.isSendContactFormMessageSuccess=!1,this.isShowContactForm=!0,this.loading=!1,this.SearchCountryField=j.wX,this.CountryISO=j.HT,this.PhoneNumberFormat=j.M9,this.company=this.companyParams.company,this.cruise=this.cruiseService.getCruiseSelected(),this.howFindUsList=t.getHowFindUsList(),this.availabilitySelected=this.cruise.availability[0]}ngOnInit(){this.createContactForm(),this.createArrayofCountries()}createContactForm(){this.contactForm=new u.cw({firstName:new u.NI(null,[u.kI.required,u.kI.minLength(2)]),email:new u.NI(null,[u.kI.required,u.kI.email]),phone:new u.NI(null),country:new u.NI(null),commnets:new u.NI(""),howFindUs:new u.NI(null),otherValue:new u.NI(null)})}createArrayofCountries(){this.arrayOfCountries=this.countryService.getCountries()}onSubmit(){if(this.contactForm.valid){this.loading=!0;const t=this.contactForm.value;t.purchase=this.purchaseRequestService.purchase,this.contactFormService.sendInquireEmail(this.prepareSendRequestInquire()).subscribe(r=>
1{const n=this.contactFormService.isSendFormResponseSuccess(r);this.ngWebflowService.addWebFlowAction(y.B.SENDING_FORM,{result:{actionStatus:n,purchaseStatus:this.getPurchaseRequestStatus(),contacPerson:t}}),this.isShowContactForm=!1,this.isInquireCompleted(),this.loading=!1,this.isSendContactFormMessageSuccess=n,setTimeout(()=>{this.contactForm.reset(),this.isShowContactForm=!0,this.isSendContactFormMessageSuccess=!n},2e3)},r=>{this.ngWebflowService.addWebFlowAction(y.B.SENDING_FORM,{result:{actionStatus:!0,purchaseStatus:this.getPurchaseRequestStatus()}}),this.isInquireFailed(),console.error(r),this.loading=!1})}else this.validateAllFormFields(this.contactForm)}prepareSendRequestInquire(){const t={emailReceptor:this.company.email,subject:"New Request",inquireDTO:{...this.contactForm.value,phone:(0,f.le)(this.contactForm.value.phone)?"none":this.contactForm.value.phone.e164Number,company:c.N.pathNameUrl,commnets:this.contactForm.value.commnets,boat:this.cruise.name,howFindUs:this.getHowFIndUsValue(),otherValue:this.getOtherValue(),promotion:this.availabilitySelected.promotionType===pe.F.PROMO_RAC?"Regular Rate":this.getPromoText(this.availabilitySelected.promotionType,this.availabilitySelected.promotionValue),packageGBCCode:this.availabilitySelected.packageGBCCode,startDate:this.availabilitySelected.startDate.toString().substring(0,this.availabilitySelected.startDate.toString().length-11),endDate:this.availabilitySelected.endDate.toString().substring(0,this.availabilitySelected.endDate.toString().length-11),days:this.availabilitySelected.length,opcDays:this.availabilitySelected.name,adults:this.searcherFiltersService.getSearchRequestObj().adults,childs:this.searcherFiltersService.getSearchRequestObj().children,interestFlights:!1,interestAmazon:!1,interestPeru:!1,interestEcuador:!1,lastName:"",interestPromos:null,category:this.getCategory(this.cruise.category),charterOnly:this.availabilitySelected.charterOnly,groupsOnly:this.availabilitySelected.groupsOnly,type:this.cruise.type,pricePerson:this.cruiseService.calculatePrice(this.cruise.availability[this.cruise.iterIndex].promotionPrice,this.cruise.availability[this.cruise.iterIndex].percents,this.cruise.availability[this.cruise.iterIndex].packageCode)},company:{logoCompany:this.company.logo,nameCompany:this.company.name,mainColorCompany:this.company.mainColor,secondaryColorCompany:this.company.secondaryColor,headerColorCompany:this.company.headercolor,footerColorCompany:this.company.footerColor,infoMailCompany:this.company.infoEmail,phoneCompany:this.company.phone,webSiteCompany:this.company.webSite},amenities:["All"],categories:[],priceFrom:"All",priceTo:"All",aditionalServicesList:this.availabilitySelected.aditionalServices};return console.log("objectResquest",t),t}getPurchaseRequestStatus(){return this.purchaseRequestService.getStringStatus(this.purchaseRequestService.purchaseRequestStatus)}getHowFIndUsValue(){return(0,f.le)(this.contactForm.value.howFindUs)||""===this.contactForm.value.howFindUs?"Not specific":"Other"===this.contactForm.value.howFindUs?this.contactForm.value.otherValue:this.contactForm.value.howFindUs}getOtherValue(){return(0,f.le)(this.contactForm.value.otherValue)||""===this.contactForm.value.otherValue?"Not specific":this.contactForm.value.otherValue}getCategory(t){let r="";switch(t){case 5:r="Luxury";break;case 4:r="First Class";break;case 3:r="Mid-range";break;case 2:r="Budget";break;default:r="All"}return r}getPromoText(t,r){return this.promoService.getPromoText(t,r)}isInquireCompleted(){try{this.contactFormService.sendFormWhenInquireComplete(this.prepareSendRequest().inquireDTO,this.purchaseRequestService.purchase).subscribe(t=>
1{this.isInquireCRMSent=this.contactFormService.isSendFormResponseSuccess(t),this.ngWebflowService.addWebFlowAction(y.B.INQUIRE_CRM_COMPLETED,{result:"INQUIRECRM_COMPLETED"})},t=>{console.log("inquire.isBlockDepartureFailed()"),console.error(t),this.isInquireCRMSent=!1,this.ngWebflowService.addWebFlowAction(y.B.INQUIRE_CRM_ERROR,{result:t})})}catch(t){console.log("inquireCRM.isBlockDepartureFailed()"),console.error(t)}}prepareSendRequest(){const t={emailReceptor:this.company.email,subject:"New Request",inquireDTO:{...this.contactForm.value,itiObject:this.contactForm.value.phone,phone:(0,f.le)(this.contactForm.value.phone)?"none":this.contactForm.value.phone.e164Number,company:c.N.pathNameUrl,boat:this.cruise.name,promotion:this.availabilitySelected.promotionType===pe.F.PROMO_RAC?"Regular Rate":this.getPromoText(this.availabilitySelected.promotionType,this.availabilitySelected.promotionValue),startDate:this.availabilitySelected.startDate.toString().substring(0,this.availabilitySelected.startDate.toString().length-11),endDate:this.availabilitySelected.endDate.toString().substring(0,this.availabilitySelected.endDate.toString().length-11),days:this.availabilitySelected.length,opcDays:this.availabilitySelected.name,adults:this.searcherFiltersService.getSearchRequestObj().adults,childs:this.searcherFiltersService.getSearchRequestObj().children,interestFlights:!1,interestAmazon:!1,interestPeru:!1,interestEcuador:!1,lastName:"",interestPromos:null,category:this.getCategory(this.cruise.category),charterOnly:this.availabilitySelected.charterOnly,groupsOnly:this.availabilitySelected.groupsOnly,type:this.cruise.type,pricePerson:this.cruiseService.calculatePrice(this.cruise.availability[this.cruise.iterIndex].promotionPrice,this.cruise.availability[this.cruise.iterIndex].percents,this.cruise.availability[this.cruise.iterIndex].packageCode)},company:{logoCompany:this.company.logo,nameCompany:this.company.name,mainColorCompany:this.company.mainColor,secondaryColorCompany:this.company.secondaryColor,headerColorCompany:this.company.headercolor,footerColorCompany:this.company.footerColor,infoMailCompany:this.company.infoEmail,phoneCompany:this.company.phone,webSiteCompany:this.company.webSite},amenities:["All"],categories:[],priceFrom:"All",priceTo:"All",aditionalServicesList:this.availabilitySelected.aditionalServices};return console.log("objectResquest",t),t}isInquireFailed(){try{this.contactFormService.sendFormWhenInquireFAILED(this.prepareSendRequest().inquireDTO,this.purchaseRequestService.purchase).subscribe(t=>
1{this.isInquireCRMSent=this.contactFormService.isSendFormResponseSuccess(t),this.ngWebflowService.addWebFlowAction(y.B.INQUIRE_CRM_COMPLETED,{result:"INQUIRECRM_COMPLETED"})},t=>{console.log("inquire.isBlockDepartureFailed()"),console.error(t),this.isInquireCRMSent=!1,this.ngWebflowService.addWebFlowAction(y.B.INQUIRE_CRM_ERROR,{result:t})})}catch(t){console.log("inquireCRM.isBlockDepartureFailed()"),console.error(t)}}validateForm(t,r){return t.get(r)?.touched&&t.get(r)?.invalid}validateAllFormFields(t){Object.keys(t.controls).forEach(r=>{const n=t.get(r);n instanceof u.p4?n.markAsTouched({onlySelf:!0}):n instanceof u.nJ&&this.validateAllFormFields(n)})}cancel(){this.closeContactFormModal.emit(!1)}addLog(){this.ngWebflowService.addWebFlowAction(y.B.INPUT_CONTACT_FORM_DATA,{passengerForm:{...this.contactForm.value}},!0)}goToSearchResults(){const t=this.searcherFiltersService.getSearchRouteGeneric()||["/search"];this.router.navigate(t)}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(Ee.j),e.Y36(O.v),e.Y36(v.F0),e.Y36(W.y),e.Y36(q.k7),e.Y36(Ue.T),e.Y36(R.N),e.Y36(ee.F),e.Y36(J.m),e.Y36(P.G))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-contact-form"]],outputs:{closeContactFormModal:"closeContactFormModal"},decls:2,vars:2,consts:[[3,"formGroup","ngSubmit",4,"ngIf"],["class","error-inquire",4,"ngIf"],[3,"formGroup","ngSubmit"],[1,"small"],[1,"row"],[1,"col-md-6"],[1,"form-group"],["for","name",1,"col-form-label","col-form-label-sm"],["type","name","formControlName","firstName","id","name",1,"form-control","form-control-sm",3,"ngClass","focusout"],["class","invalid-feedback",4,"ngIf"],["for","phone",1,"col-form-label","col-form-label-sm"],["name","phone","formControlName","phone",1,"form-control","form-control-sm",3,"cssClass","preferredCountries","enableAutoCountrySelect","enablePlaceholder","searchCountryFlag","searchCountryField","selectFirstCountry","selectedCountryISO","maxLength","phoneValidation","separateDialCode"],["for","email",1,"col-form-label","col-form-label-sm"],["type","email","formControlName","email","id","email",1,"form-control","form-control-sm",3,"ngClass","focusout"],["for","howFindUs",1,"col-form-label","col-form-label-sm"],["id","howFindUs","name","howFindUs","formControlName","howFindUs",1,"form-control",3,"focusout"],[3,"ngValue"],[3,"value",4,"ngFor","ngForOf"],["class","col-md-6",4,"ngIf"],["class","col-md-12",4,"ngIf"],[1,"col-md-12"],["class","row","style","display: flex;justify-content: center;",4,"ngIf"],[1,"invalid-feedback"],[3,"value"],["for","otherValue",1,"col-form-label","col-form-label-sm"],["type","otherValue","formControlName","otherValue","id","otherValue",1,"form-control","form-control-sm",3,"focusout"],["for","message",1,"col-form-label","col-form-label-sm"],["name","message","rows","3","id","message","formControlName","commnets",1,"form-control",3,"focusout"],[1,"btn","btn-success",2,"margin-right","5px"],["href","javascript:void(0)","data-dismiss","modal","aria-label","Close",1,"btn","btn-outline-danger",3,"click"],[1,"row",2,"display","flex","justify-content","center"],[1,"error-inquire"],[1,"alert-success","pb-2","rounded","mb-3"],[1,"col-12","pt-2"],[1,"text-success"],["galScreenFocus","","offSet","180","role","button",1,"gotosearch",3,"click"]],template:function(r,n){1&r&&(e.YNc(0,mr,33,31,"form",0),e.YNc(1,gr,9,0,"div",1)),2&r&&(e.Q6J("ngIf",n.isShowContactForm),e.xp6(1),e.Q6J("ngIf",!n.isShowContactForm&&n.isSendContactFormMessageSuccess))},dependencies:[o.mk,o.sg,o.O5,u._Y,u.YN,u.Kr,u.Fj,u.EJ,u.JJ,u.JL,u.sg,u.u,j.FV,j.mh,We.g],styles:[".text-success[_ngcontent-%COMP%]{color:#3c763d!important}.gotosearch[_ngcontent-%COMP%]{color:#e27f04!important}.gotosearch[_ngcontent-%COMP%]:focus, .gotosearch[_ngcontent-%COMP%]:hover{color:#e27f04!important}"]}),i})();var Oe=_(312);let fr=(()=>{const s=class{constructor(){this.visibleNeedAssistance=!1}ngOnInit(){}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-ctas"]],decls:27,vars:4,consts:[["id","ctas",1,"row","mb-3","mt-8","text-center"],[1,"col-12","mb-5"],["href","javascript:void(0)","data-toggle","modal","data-target","#contact",1,"btn","btn-block","btn-secondary","btn-lg","need_assistance_gm",3,"click"],[1,"fa","fa-pen-square"],[1,"col-md-4","mb-3"],["href","javascript:void(0)","data-toggle","modal","data-target","#contact",1,"need_assistance_gm",3,"click"],["src","assets/images/cta/e-mail.png","width","213","height","78","alt","E-mail Us",1,"img-fluid"],["href","javascript:void(Tawk_API.toggle())"],["src","assets/images/cta/chat.png","width","222","height","77","alt","Chat with a specialist",1,"img-fluid"],["src","assets/images/cta/telephone.png","width","225","height","78","alt","Talk to an Expert","usemap","#Map",1,"float-none","img-fluid","float-md-right"],["name","Map"],["shape","rect","coords","84,5,218,31","href","tel:18008114037","alt","USA Toll-Free Number"],["shape","rect","coords","84,33,220,58","href","tel:59326024565","alt","UK Toll-Free Number"],[3,"visible","closeColor","closable","modalWidth","visibleChange"],[1,"modal-content"],[1,"modal-header","bg-orange"],[1,"text-white","mb-0"],["type","button","data-dismiss","modal","aria-label","Close",1,"close","text-white",3,"click"],["aria-hidden","true"],[1,"modal-body"],[3,"closeContactFormModal"]],template:function(r,n){1&r&&(e.TgZ(0,"div",0)(1,"div",1)(2,"a",2),e.NdJ("click",function(){return n.visibleNeedAssistance=!0}),e._UZ(3,"i",3),e._uU(4," Need Assistance? Contact Us"),e.qZA()(),e.TgZ(5,"div",4)(6,"a",5),e.NdJ("click",function(){return n.visibleNeedAssistance=!0}),e._UZ(7,"img",6),e.qZA()(),e.TgZ(8,"div",4)(9,"a",7),e._UZ(10,"img",8),e.qZA()(),e.TgZ(11,"div",4),e._UZ(12,"img",9),e.TgZ(13,"map",10),e._UZ(14,"area",11)(15,"area",12),e.qZA()()(),e.TgZ(16,"app-modal",13),e.NdJ("visibleChange",function(){return n.visibleNeedAssistance=!1}),e.TgZ(17,"div",14)(18,"div",15)(19,"h3",16),e._UZ(20,"i",3),e._uU(21," Contact a Galapagos Specialist "),e.qZA(),e.TgZ(22,"button",17),e.NdJ("click",function(){return n.visibleNeedAssistance=!1}),e.TgZ(23,"span",18),e._uU(24,"\xd7"),e.qZA()()(),e.TgZ(25,"div",19)(26,"app-contact-form",20),e.NdJ("closeContactFormModal",function(){return n.visibleNeedAssistance=!1}),e.qZA()()()()),2&r&&(e.xp6(16),e.Q6J("visible",n.visibleNeedAssistance)("closeColor","#000000")("closable",!1)("modalWidth","500px"))},dependencies:[_r,Oe.z],styles:["#ctas[_ngcontent-%COMP%]{position:relative;bottom:0}"]}),i})();var ce=(()=>{return(i=ce||(ce={})).ADULT="Adult",i.CHILD="Child",ce;var i})(),Se=(()=>{return(i=Se||(Se={})).MALE="Male",i.FEMALE="Female",Se;var i})(),xe=(()=>{return(i=xe||(xe={})).QGQ="Quito - Galapagos - Quito",i.GGG="Guayaquil - Galapagos - Guayaquil",i.QGG="Quito - Galapagos - Guayaquil",i.GGQ="Guayaquil - Galapagos - Quito",xe;var i})();let vr=(()=>{const s=class{constructor(){this.months=[],this.today=new Date,this.fillMonths(this.today.getFullYear())}fillMonths(t){this.months=[],this.addMonth({codigo:1,valor:"January",estado:1,nombreCorto:"Jan"},t),this.addMonth({codigo:2,valor:"February",estado:1,nombreCorto:"Feb"},t),this.addMonth({codigo:3,valor:"March",estado:1,nombreCorto:"Mar"},t),this.addMonth({codigo:4,valor:"April",estado:1,nombreCorto:"Apr"},t),this.addMonth({codigo:5,valor:"May",estado:1,nombreCorto:"May"},t),this.addMonth({codigo:6,valor:"June",estado:1,nombreCorto:"Jun"},t),this.addMonth({codigo:7,valor:"July",estado:1,nombreCorto:"Jul"},t),this.addMonth({codigo:8,valor:"August",estado:1,nombreCorto:"Aug"},t),this.addMonth({codigo:9,valor:"September",estado:1,nombreCorto:"Sep"},t),this.addMonth({codigo:10,valor:"October",estado:1,nombreCorto:"Oct"},t),this.addMonth({codigo:11,valor:"November",estado:1,nombreCorto:"Nov"},t),this.addMonth({codigo:12,valor:"December",estado:1,nombreCorto:"Dec"},t)}addMonth(t,r){this.getMonths().push(t)}getMonths(){return this.months}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),i})(),Tr=(()=>{const s=class{constructor(t){this.elementRef=t,this.galFormNumber=0,this.galCabinIndex=0,this.galPassengerIndex=0,this.galTabIndex=0}ngOnInit(){try{this.elementRef.nativeElement.tabIndex=1e4*this.galFormNumber+1e3*(this.galCabinIndex+1)+100*(this.galPassengerIndex+1)+this.galTabIndex}catch(t){console.log("PassengerFormTabIndexDirective.constructor()"),console.error(t)}}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(e.SBq))},s.\u0275dir=e.lG2({type:s,selectors:[["","galPassengerFormTabIndex",""]],inputs:{galFormNumber:"galFormNumber",galCabinIndex:"galCabinIndex",galPassengerIndex:"galPassengerIndex",galTabIndex:"galTabIndex"}}),i})(),Cr=(()=>{const s=class{constructor(t){this.appResourceService=t,this.doesOpe
1nWhyInfoDialog=!1,this.closeWhyInfoModal=new e.vpe}ngOnInit(){}closeAction(){this.closeWhyInfoModal.emit(!1)}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(Ye.m))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-modal-why-info"]],inputs:{doesOpenWhyInfoDialog:"doesOpenWhyInfoDialog"},outputs:{closeWhyInfoModal:"closeWhyInfoModal"},decls:13,vars:4,consts:[[3,"visible","closeColor","modalWidth","modalMinHeight","visibleChange"],[1,"modal-content"],[1,"modal-header","bg-orange",2,"background","#e27f04"],[1,"text-white","mb-0",2,"color","#fff"],["aria-hidden","true",1,"fa","fa-globe"],["type","button","data-dismiss","modal","aria-label","Close",1,"close","text-white"],[1,"modal-body"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-secondary",3,"click"]],template:function(r,n){1&r&&(e.TgZ(0,"app-modal",0),e.NdJ("visibleChange",function(){return n.closeAction()}),e.TgZ(1,"div",1)(2,"div",2)(3,"h3",3),e._UZ(4,"i",4),e._uU(5," Why is Passport Number required ? "),e.qZA(),e._UZ(6,"button",5),e.qZA(),e.TgZ(7,"div",6)(8,"p"),e._uU(9,"Passport information is required as part of the entry procedures to enter the Galapagos National Park and for booking your Ecuador Mainland-Galapagos Flights."),e.qZA()(),e.TgZ(10,"div",7)(11,"button",8),e.NdJ("click",function(){return n.closeAction()}),e._uU(12,"Close"),e.qZA()()()()),2&r&&e.Q6J("visible",n.doesOpenWhyInfoDialog)("closeColor","#fff")("modalWidth","498px")("modalMinHeight","254px")},dependencies:[Oe.z]}),i})(),yr=(()=>{const s=class{constructor(t){this.purchaseRequestService=t}transform(t,r){try{let n=0;const l=this.purchaseRequestService.purchase?.cabins?this.purchaseRequestService.purchase.cabins.length:0;for(let p=0;p<l&&p<=r;p++)if(this.purchaseRequestService.purchase?.cabins)for(let g=0;g<this.purchaseRequestService.purchase.cabins[p].purchaseCabinPasssengers.length;g++)(p<r||p===r&&g<=t)&&n++;return n}catch(n){return console.error(n),0}}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(O.v,16))},s.\u0275pipe=e.Yjl({name:"showPassengerIndexInPassengerForm",type:s,pure:!0}),i})(),br=(()=>{const s=class{transform(t,r,n,l=!1){try{let p="";return!this.isNullOrUndefined(r)&&""!==r||!this.isNullOrUndefined(n)&&""!==n?(!0===l&&(p+="Passenger "+t+": "),p+=this.isNullOrUndefined(r)?"":r,p+=this.isNullOrUndefined(n)?"":" "+n):p+="Passenger "+t,p}catch(p){return console.log("ShowCabinPassengerNamePipe.transform()"),console.error(p),""}}isNullOrUndefined(t){return null===t||null==t}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275pipe=e.Yjl({name:"showCabinPassengerName",type:s,pure:!0}),i})();function Ar(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Name is Required"),e.qZA()())}function Sr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Last name is Required"),e.qZA()())}function xr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Email is Required"),e.qZA()())}function Pr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Telephone is Required"),e.qZA()())}function Zr(i,s){if(1&i&&(e.TgZ(0,"option",56),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a.name),e.xp6(1),e.hij("",a.name," ")}}function Ir(i,s){1&i&&(e.TgZ(0,"div")(1,"label",22),e._uU(2,"Other: "),e.qZA(),e._UZ(3,"input",57),e.qZA())}function Fr(i,s){1&i&&(e.TgZ(0,"div",58),e._uU(1," Please review the preceding form to continue. "),e.qZA())}function qr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"First name is required"),e.qZA()())}function Nr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"First name is required"),e.qZA()())}function Er(i,s){if(1&i&&(e.TgZ(0,"option",56),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a),e.xp6(1),e.Oqu(a)}}function Ur(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Invalid year"),e.qZA()())}function Or(i,s){if(1&i&&(e.TgZ(0,"option",56),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a.codigo),e.xp6(1),e.Oqu(a.nombreCorto)}}function wr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Invalid month"),e.qZA()())}function Rr(i,s){if(1&i&&(e.TgZ(0,"option",56),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a.value),e.xp6(1),e.Oqu(a.name)}}function Mr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Invalid day"),e.qZA()())}function kr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Local Flights is Required"),e.qZA()())}const G=function(i){return{"is-invalid":i}};
1function Dr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",12)(1,"label"),e._uU(2,"Local Flights:"),e.qZA(),e.TgZ(3,"select",80),e.NdJ("change",function(){e.CHM(a);const r=e.oxw().$implicit,n=e.oxw(3);return e.KtG(n.addLog(n.validateForm(r,"localFlight")))}),e.TgZ(4,"option",19),e._uU(5,"Choose your flight"),e.qZA(),e.TgZ(6,"option",56),e._uU(7),e.qZA(),e.TgZ(8,"option",56),e._uU(9),e.qZA(),e.TgZ(10,"option",56),e._uU(11),e.qZA(),e.TgZ(12,"option",56),e._uU(13),e.qZA()(),e.YNc(14,kr,3,0,"div",14),e.qZA()}if(2&i){const a=e.oxw(),t=a.$implicit,r=a.index,n=e.oxw().index,l=e.oxw(2);e.xp6(3),e.Q6J("ngClass",e.VKq(15,G,l.validateForm(t,"localFlight")))("galFormNumber",1)("galCabinIndex",n)("galPassengerIndex",r)("galTabIndex",2),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("value",l.localFlights.QGQ.valueOf()),e.xp6(1),e.Oqu(l.localFlights.QGQ.valueOf()),e.xp6(1),e.Q6J("value",l.localFlights.GGG.valueOf()),e.xp6(1),e.Oqu(l.localFlights.GGG.valueOf()),e.xp6(1),e.Q6J("value",l.localFlights.QGG.valueOf()),e.xp6(1),e.Oqu(l.localFlights.QGG.valueOf()),e.xp6(1),e.Q6J("value",l.localFlights.GGQ.valueOf()),e.xp6(1),e.Oqu(l.localFlights.GGQ.valueOf()),e.xp6(1),e.Q6J("ngIf",l.validateForm(t,"localFlight"))}}function Lr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Address is Required"),e.qZA()())}function Br(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Gender is Required"),e.qZA()())}function Yr(i,s){if(1&i&&(e.TgZ(0,"option",56),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a.name),e.xp6(1),e.hij("",a.name," ")}}function Jr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Country is Required"),e.qZA()())}function Wr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Passport is Required"),e.qZA()())}function Vr(i,s){1&i&&(e.TgZ(0,"div",21)(1,"small"),e._uU(2,"Allergies is Required"),e.qZA()())}function Qr(i,s){if(1&i&&(e.TgZ(0,"div",58),e._uU(1),e.qZA()),2&i){const a=e.oxw(5);e.xp6(1),e.hij(" Please review the passenger's birthdate. Passengers must be at least ",a.minAge," years old. ")}}function Gr(i,s){if(1&i&&(e.TgZ(0,"div",58),e._uU(1),e.qZA()),2&i){const a=e.oxw(5);e.xp6(1),e.hij(" According to the birthdate you selected, this passenger does not qualify as a child. Children must be up to ",a.maxChildAge," years old. ")}}function Hr(i,s){if(1&i&&(e.TgZ(0,"div",81),e.YNc(1,Qr,2,1,"div",48),e.YNc(2,Gr,2,1,"div",48),e.qZA()),2&i){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",a.hasError("birthdateError")||a.hasError("notAllowedBirtdate")),e.xp6(1),e.Q6J("ngIf",a.hasError("notChild"))}}function jr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",64)(1,"div",5)(2,"h3",6),e._UZ(3,"i",7),e._uU(4),e.ALo(5,"showCabinPassengerName"),e.ALo(6,"showPassengerIndexInPassengerForm"),e.TgZ(7,"div",65),e._uU(8),e.qZA()()(),e.TgZ(9,"div",9)(10,"div",35)(11,"div",11)(12,"div",12)(13,"label"),e._uU(14,"First Name:"),e.qZA(),e.TgZ(15,"input",66),e.NdJ("focusout",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"firstName")))}),e.qZA(),e.YNc(16,qr,3,0,"div",14),e.qZA(),e.TgZ(17,"div",12)(18,"label"),e._uU(19,"Last Name:"),e.qZA(),e.TgZ(20,"input",67),e.NdJ("focusout",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"lastName")))}),e.qZA(),e.YNc(21,Nr,3,0,"div",14),e.qZA(),e.TgZ(22,"div",12)(23,"label"),e._uU(24,"Date of Birth:"),e.qZA(),e.TgZ(25,"table",68)(26,"tbody")(27,"tr")(28,"td")(29,"select",69),e.NdJ("change",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return l.onChangeEnable(n,"birthMonth"),e.KtG(l.addLog(l.validateForm(n,"birthYear")))}),e.TgZ(30,"option",19),e._uU(31,"Year"),e.qZA(),e.YNc(32,Er,2,2,"option",20),e.qZA(),e.YNc(33,Ur,3,0,"div",14),e.qZA(),e.TgZ(34,"td")(35,"select",70),e.NdJ("change",function(){const r=e.CHM(a),n=r.$implicit,l=r.index,p=e.oxw().index,g=e.oxw(2);return g.onChangeEnable(n,"birthday"),g.setDays(p,l),e.KtG(g.addLog(g.validateForm(n,"birthMonth")))}),e.TgZ(36,"option",19),e._uU(37,"Month"),e.qZA(),e.YNc(38,Or,2,2,"option",20),e.qZA(),e.YNc(39,wr,3,0,"div",14),e.qZA(),e.TgZ(40,"td")(41,"select",71),e.NdJ("change",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"birthday")))}),e.TgZ(42,"option",19),e._uU(43,"Day"),e.qZA(),e.YNc(44,Rr,2,2,"option",20),e.qZA(),e.YNc(45,Mr,3,0,"div",14),e.qZA()()()()(),e.YNc(46,Dr,15,17,"div",72),e.TgZ(47,"div",12)(48,"label"),e._uU(49,"Address:"),e.qZA(),e.TgZ(50,"input",73),e.NdJ("focusout",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"address")))}),e.qZA(),e.YNc(51,Lr,3,0,"div",14),e.qZA()(),e.TgZ(52,"div",11)(53,"div",12)(54,"label"),e._uU(55,"Gender:"),e.qZA(),e.TgZ(56,"select",74),e.NdJ("change",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"gender")))}),e.TgZ(57,"option",19),e._uU(58,"Please select"),e.qZA(),e.TgZ(59,"option",56),e._uU(60),e.qZA(),e.TgZ(61,"option",56),e._uU(62),e.qZA()(),e.YNc(63,Br,3,0,"div",14),e.qZA(),e.TgZ(64,"div",12)(65,"label"),e._uU(66,"Country of Origin:"),e.qZA(),e.TgZ(67,"select",75),e.NdJ("change",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"country")))}),e.TgZ(68,"option",19),e._uU(69,"Please select"),e.qZA(),e.YNc(70,Yr,2,2,"option",20),e.qZA(),e.YNc(71,Jr,3,0,"div",14),e.qZA(),e.TgZ(72,"div",12)(73,"label"),e._uU(74,"Passport #: "),e.TgZ(75,"a",76),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.openDialogWhyInfo())}),e._uU(76,"Why?"),e.qZA()(),e.TgZ(77,"input",77),e.NdJ("focusout",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"passport")))}),e.qZA(),e.YNc(78,Wr,3,0,"div",14),e.qZA(),e.TgZ(79,"div",12)(80,"label"),e._uU(81,"Allergies:"),e.qZA(),e.TgZ(82,"input",78),e.NdJ("focusout",function(){const n=e.CHM(a).$implicit,l=e.oxw(3);return e.KtG(l.addLog(l.validateForm(n,"allergies")))}),e.qZA(),e.YNc(83,Vr,3,0,"div",14),e.qZA()()()(),e.ynx(84),e.TgZ(85,"div",35)(86,"div",31),e.YNc(87,Hr,3,2,"div",79),e.qZA()(),e.BQk(),e.qZA()}if(2&i){const a=s.$implicit,t=s.index,r=e.oxw().index,n=e.oxw(2);let l,p,g;e.Q6J("formGroupName",t),e.xp6(4),e.hij(" ",e.gM2(5,87,e.xi3(6,92,t,r),null==(l=a.get("firstName"))?null:l.value,null==(l=a.get("lastName"))?null:l.value,!0)," "),e.xp6(4),e.Oqu(null==(p=a.get("passengerType"))?null:p.value),e.xp6(7),e.Q6J("ngClass",e.VKq(95,G,n.validateForm(a,"f
1irstName")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",1),e.uIk("id","firstName_"+r),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"firstName")),e.xp6(4),e.Q6J("ngClass",e.VKq(97,G,n.validateForm(a,"lastName")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",3),e.uIk("id","lastName_"+r),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"lastName")),e.xp6(8),e.Q6J("ngClass",e.VKq(99,G,n.validateForm(a,"birthYear")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",5),e.uIk("id","birthYear_"+r),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",n.years),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"birthYear")),e.xp6(2),e.Q6J("ngClass",e.VKq(101,G,n.validateForm(a,"birthMonth")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",6),e.uIk("id","birthMonth_"+r),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",n.months),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"birthMonth")),e.xp6(2),e.Q6J("ngClass",e.VKq(103,G,n.validateForm(a,"birthday")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",7),e.uIk("id","birthday_"+r),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",n.days),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"birthday")),e.xp6(1),e.Q6J("ngIf",n.hasAirTickets()),e.xp6(4),e.Q6J("ngClass",e.VKq(105,G,n.validateForm(a,"address")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",9),e.uIk("id","address_"+r),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"birthday")),e.xp6(5),e.Q6J("ngClass",e.VKq(107,G,n.validateForm(a,"gender")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",2),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("value",n.genders.FEMALE.valueOf()),e.xp6(1),e.Oqu(n.genders.FEMALE.valueOf()),e.xp6(1),e.Q6J("value",n.genders.MALE.valueOf()),e.xp6(1),e.Oqu(n.genders.MALE.valueOf()),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"gender")),e.xp6(4),e.Q6J("ngClass",e.VKq(109,G,n.validateForm(a,"country")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",4),e.uIk("id","country_"+r),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",n.countries),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"country")),e.xp6(6),e.Q6J("ngClass",e.VKq(111,G,n.validateForm(a,"passport")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",8),e.uIk("id","passport_"+r),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"passport")),e.xp6(4),e.Q6J("ngClass",e.VKq(113,G,n.validateForm(a,"allergies")))("galFormNumber",1)("galCabinIndex",r)("galPassengerIndex",t)("galTabIndex",10),e.uIk("id","allergies_"+r),e.xp6(1),e.Q6J("ngIf",n.validateForm(a,"allergies")),e.xp6(4),e.Q6J("ngIf",(null==(g=a.get("birthMonth"))?null:g.touched)&&(null==(g=a.get("birthday"))?null:g.touched)&&(null==(g=a.get("birthYear"))?null:g.touched)&&(a.hasError("birthdateError")||a.hasError("notAllowedBirtdate")||a.hasError("notChild")))}}function Kr(i,s){if(1&i&&(e.TgZ(0,"div",61)(1,"h3",62),e._uU(2),e.ALo(3,"cabinOrdinalName"),e.qZA(),e.YNc(4,jr,88,115,"div",63),e.qZA()),2&i){const a=s.$implicit,t=s.index,r=e.oxw(2);e.Q6J("formArrayName",t),e.xp6(2),e.AsE("",e.lcZ(3,5,t+1)," Cabin (",r.purchaseCabinInformation[t],")"),e.xp6(2),e.Q6J("ngForOf",a.controls)("ngForTrackBy",r.trackByFn)}}function $r(i,s){if(1&i&&(e.ynx(0,59),e.YNc(1,Kr,5,7,"div",60),e.BQk()),2&i){const a=e.oxw();e.xp6(1),e.Q6J("ngForOf",a.getPurchasePassengerFormControls())}}function zr(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div")(1,"app-modal-why-info",82),e.NdJ("closeWhyInfoModal",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.doesOpenWhyInfoDialog=!1)}),e.qZA()()}if(2&i){const a=e.oxw();e.xp6(1),e.Q6J("doesOpenWhyInfoDialog",a.doesOpenWhyInfoDialog)}}const je=function(i,s){return[i,s]},Xr=function(i){return{"btn-disabled":!0,"btn-success":i}};let ei=(()=>{const s=class{constructor(t,r,n,l,p,g,x,A,F){this.purchaseRequestService=t,this.fb=r,this.monthService=n,this.countryService=l,this.ngWebflowService=p,this.router=g,this.location=x,this.companyService=A,this.searcherFiltersService=F,this.purchasePassengerForm=new u.nJ({}),this.namesMinLength=2,this.months=[],this.purchaseCabinInformation=[],this.years=[],this.days=[],this.genders=Se,this.localFlights=xe,this.countries=[],this.isOtherContactPerson=!0,this.testFormArrays=[],this.isShowErrorsSummary=!1,this.purchaseContactPassengersListElements=[],this.isOtherContactPersonValue=-1,this.minAge=0,this.maxChildAge=0,this.doesOpe
1nWhyInfoDialog=!1,this.hasFlight=!1,this.disabledName=!0,this.visibleGuest=!1,this.SearchCountryField=j.wX,this.CountryISO=j.HT,this.PhoneNumberFormat=j.M9,this.generateUrl()}ngOnInit(){this.months=this.monthService.getMonths(),this.years=this.generateYears(),this.countries=this.countryService.getCountries(),this.purchasePassengerForm=this.createPassengerForms(),this.purchaseCabinInformation=this.getPurchaseCabinInformation(),this.purchaseContactPassengersListElements=this.getPurchaseContactPassengersListElements(),this.minAge=this.purchaseRequestService.getCruiseWrapper().getEdadMinima(),this.maxChildAge=this.purchaseRequestService.getCruiseWrapper().getEdadNino()}createPassengerForms(){const t=[];return this.purchaseRequestService?.purchase?.cabins&&this.purchaseRequestService.purchase.cabins.forEach(r=>{const n=this.createFormArrayForCabin(r);t.push(n)}),this.purchasePassengerForm=this.fb.group({purchasePassengers:new u.vC(t),purchaseContactPersonForm:this.createContactForm()}),this.purchasePassengerForm}get purchasePassengersArray(){return this.purchasePassengerForm.get("purchasePassengers")}getPurchasePassengerFormControls(){try{return this.purchasePassengerForm.controls.purchasePassengers.controls}catch(t){return console.error(t),[]}}createContactForm(){let t;return t=this.fb.group({firstName:[null,u.kI.required],lastName:[null,u.kI.required],comments:"",email:[null,[u.kI.required,u.kI.email]],phone:[null,u.kI.required],purchasePassenger:[0,u.kI.required],howFindUs:[""],valueOther:[""]}),t}createFormArrayForCabin(t){const r=[],n=ee.F.getArrayOfNumbersByRange(0,t.adults-1),l=ee.F.getArrayOfNumbersByRange(0,t.children-1);return n.forEach(()=>{r.push(this.visibleGuest?this.createPassagerForm(ce.ADULT):this.createPassagerFormNoValidate(ce.ADULT))}),l.forEach(()=>{r.push(this.visibleGuest?this.createPassagerForm(ce.CHILD):this.createPassagerFormNoValidate(ce.CHILD))}),new u.vC(r)}createPassagerFormNoValidate(t){return this.fb.group({firstName:["no data"],lastName:["no data"],localFlight:["no data"],gender:["no data"],country:["no data"],passport:["no data"],birthday:["01"],birthMonth:["01"],birthYear:["2020"],address:["no data"],allergies:["no data"],passengerType:[t]})}createPassagerForm(t){return console.log("createPassagerForm",this.purchaseRequestService.isIncludeAirFare(),this.purchaseRequestService.isIncludeGalapagosAirTickets()),this.hasAirTickets(),this.fb.group({firstName:[null,[u.kI.required,u.kI.minLength(this.namesMinLength)]],lastName:[null,[u.kI.required,u.kI.minLength(this.namesMinLength)]],localFlight:[null,this.hasAirTickets()?u.kI.required:null],gender:[null,u.kI.required],country:[null,u.kI.required],passport:[null,u.kI.required],birthday:[{value:null,disabled:!0},u.kI.required],birthMonth:[{value:null,disabled:!0},u.kI.required],birthYear:[null,u.kI.required],address:[null,u.kI.required],allergies:[null,u.kI.required],passengerType:[t,u.kI.required]},{validator:this.birthDateValidator.bind(this)})}hasAirTickets(){return!(!this.purchaseRequestService.isIncludeAirFare()&&!this.purchaseRequestService.isIncludeGalapagosAirTickets())}birthDateValidator(t){if((0,f.le)(t?.get("birthYear")?.value)||(0,f.le)(t?.get("birthMonth")?.value)||(0,f.le)(t?.get("birthday")?.value))return{notAllowedBirtdate:!1,notChild:!1,birthdateError:!0};const r=ee.F.getDate(t?.get("birthYear")?.value,t?.get("birthMonth")?.value,t?.get("birthday")?.value),n=this.purchaseRequestService.getCruiseWrapper().getMinBirthDateForChild(),l=this.purchaseRequestService.getCruiseWrapper().getMaxBirthDateForChild();return(0,f.le)(r)||(0,f.le)(n)||(0,f.le)(l)?{notAllowedBirtdate:!1,notChild:!1,birthdateError:!0}:r>n?{notAllowedBirtdate:!0,notChild:!1,birthdateError:!1}:t?.get("passengerType")?.value===ce.CHILD&&(r>n||r<l)?{notAllowedBirtdate:!1,notChild:!0,birthdateError:!1}:void 0}getPurchaseCabinInformation(){try{return this.purchaseRequestService.getPurchaseCabinObjectSummary().map(t=>t.cabinaItinerarioNombre+" / "+t.camaCabinaNombre)}catch(t){return console.error(t),[]}}trackByFn(t,r){return t}generateYears(){try{const t=[],r=new Date,n=r.getFullYear()-100,l=r.getFullYear()-this.purchaseRequestService.purchase.cruise.minimumAgeChild;for(let p=n;p<=l;p++)t.push(p);return t.sort((p,g)=>g-p)}catch(t){return console.log("PassengerFormComponent.generateYears()"),console.error(t),[]}}getMonthDays(t,r){try{const n=this.purchasePassengersArray.get(t.toString()).get(r.toString()).get("birthMonth")?.value,l=this.purchasePassengersArray.get(t.toString()).get(r.toString()).get("birthYear")?.value;return(0,f.le)(n)||(0,f.le)(l)?[]:ee.F.generateMonthDays(n,l)}catch(n){return console.log(),console.error(n),[]}}setDays(t,r){this.days=this.getMonthDays(t,r)}setIsOtherContactPerson(){this.isOtherContactPerson=-1===Number(this.purchasePassengerForm.get("purchaseContactPerson
1Form")?.get("purchasePassenger")?.value),this.isOtherContactPerson?(this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("firstName")?.setValidators([u.kI.required,u.kI.minLength(this.namesMinLength)]),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("lastName")?.setValidators([u.kI.required,u.kI.minLength(this.namesMinLength)]),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("firstName")?.updateValueAndValidity(),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("lastName")?.updateValueAndValidity()):(this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("firstName")?.setValidators(null),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("lastName")?.setValidators(null),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("firstName")?.updateValueAndValidity(),this.purchasePassengerForm?.get("purchaseContactPersonForm")?.get("lastName")?.updateValueAndValidity())}getPurchaseContactPassengersListElements(){try{const t=[];return this.purchaseRequestService?.purchase?.cabins&&this.purchaseRequestService.purchase.cabins.forEach((r,n)=>{r.purchaseCabinPasssengers.forEach((l,p)=>{l.type===ce.ADULT&&t.push({cabinIndex:Number(n),passengerIndex:Number(p)})})}),t}catch(t){return console.error(t),[]}}validateContactPerson(t,r){return{country:t.country,firstName:t.firstName,lastName:t.lastName,comments:t.comments,phone:t.phone.e164Number,email:t.email,purchasePasengerIndex:t.purchasePassenger,purchasePassengerInformation:void 0,howFindUs:t.howFindUs&&""!==t.howFindUs?t.howFindUs:"Not specific",valueOther:"Other"===t.howFindUs?""===t.valueOther?"Not specific":t.valueOther:"Not specific",itiObject:t.phone}}
1confirm(t,r){try{if(!0===this.purchasePassengerForm.invalid)return this.validateAllFormFields(this.purchasePassengerForm),this.testFormArrays=this.getPurchasePassengerFormControls(),this.testFormArrays.forEach(l=>{l.controls.forEach(g=>{this.validateAllFormFields(g)})}),void(this.isShowErrorsSummary=!0);if(this.purchaseRequestService.addPurchasePassengersInformation(t),this.purchaseRequestService.addPurchaseContectPerson(this.validateContactPerson(r,t)),(0,f.le)(r.firstName)){const l=this.purchaseContactPassengersListElements[r.purchasePassenger].cabinIndex,p=this.purchaseContactPassengersListElements[r.purchasePassenger].passengerIndex;r.firstName=t[Number(l)][Number(p)].firstName,r.lastName=t[Number(l)][Number(p)].lastName}this.purchaseRequestService.purchaseRequestStatus=k.I.PASSENGER_COMPLETED,this.ngWebflowService.addWebFlowAction(y.B.FILL_PASSENGER_FORM,{passengers:t,contactPerson:r}),this.ngWebflowService.addWebFlowAction(y.B.BOOKING_START,{message:"booking start"})}catch(n){throw console.log("PassengerFormComponent.confirm()"),console.error(n),n}}validateAllFormFields(t){Object.keys(t.controls).forEach(r=>{const n=t.get(r);n instanceof u.p4?n.markAsTouched({onlySelf:!0}):n instanceof u.nJ&&this.validateAllFormFields(n)})}goBack(){try{this.ngWebflowService.addWebFlowAction(y.B.GO_BACK_+this.purchaseRequestService.purchaseRequestStatus,{goBackFrom:this.purchaseRequestService.purchaseRequestStatus,passengerForm:{...this.purchasePassengerForm.value}}),this.purchaseRequestService.purchaseRequestStatus=k.I.INITIAL}catch(t){console.log("PassengerFormComponent.goBack()"),console.error(t)}}validateForm(t,r){return t.get(r)?.touched&&t.get(r)?.invalid}openDialogWhyInfo(){this.doesOpenWhyInfoDialog=!0}addLog(t){}addLogEmail(t){t||this.ngWebflowService.addWebFlowAction(y.B.MAIN_CONTACT_PERSON_EMAIL,{contactPersonEmail:this.purchasePassengerForm.value.purchaseContactPersonForm.email},!0)}onChangeEnable(t,r){t.get(r)?.enable()}onCheckboxChange(t){this.visibleGuest=t.target.checked,this.purchasePassengerForm=this.createPassengerForms()}generateUrl(){const t=this.getCheckoutUrl("checkout",0,"fetch-step/pax");this.location.replaceState(t)}getCheckoutUrl(t,r,n){if(null==this.purchaseRequestService.purchase)return"";if(null==this.purchaseRequestService.purchase.cruise)return"";const l=this.purchaseRequestService.purchase.cruise;return t+"/"+encodeURIComponent(this.companyService.getCode())+"/"+encodeURIComponent(l.availability[r].code.toString())+"/"+this.searcherFiltersService.getSearchRequestObj().adults+"/"+this.searcherFiltersService.getSearchRequestObj().children+"/"+n}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(O.v),e.Y36(u.QS),e.Y36(vr),e.Y36(Ue.T),e.Y36(q.k7),e.Y36(v.F0),e.Y36(o.Ye),e.Y36(R.N),e.Y36(W.y))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-passenger-form"]],decls:105,vars:43,consts:[[1,"mb-1","mt-4"],[1,"mb-4"],[1,"text-danger"],[3,"formGroup"],["formGroupName","purchaseContactPersonForm",1,"card","mb-3"],[1,"card-header","border-bottom-0","bg-orange","text-white"],[1,"fs-24","m-0"],[1,"fa","fa-pen-square"],[2,"font-family","'Roboto Condensed'"],[1,"card-body"],["id","othername",1,"row"],[1,"col-md-6"],[1,"form-group"],["name","name","formControlName","firstName","type","text","id","name","value","",1,"form-control",3,"ngClass","focusout"],["class","invalid-feedback",4,"ngIf"],["name","lname","formControlName","lastName","type","text","id","lname","value","",1,"form-control",3,"ngClass","focusout"],["type","text","formControlName","email","name","email","id","email","value","","tabindex","20002",1,"form-control",3,"ngClass","focusout"],["name","phone","formControlName","phone",1,"form-control",3,"cssClass","preferredCountries","enableAutoCountrySelect","enablePlaceholder","searchCountryFlag","searchCountryField","selectFirstCountry","selectedCountryISO","maxLength","phoneValidation","separateDialCode"],["formControlName","country","name","country","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"galFormNumber","galTabIndex"],[3,"ngValue"],[3,"value",4,"ngFor","ngForOf"],[1,"invalid-feedback"],["for","purchasePassenger",1,"control-label"],["formControlName","howFindUs","i
1d","howFindUs","tabindex","20006",1,"form-control",3,"focusout"],["value",""],["value","Internet search"],["value","Recomendation from friend / family"],["value","Social media channels"],["value","Other"],[4,"ngIf"],["id","comments",1,"row"],[1,"col-md-12"],[1,"form-group","mt-2"],["for","message",1,"control-label"],["name","comments","rows","3","id","comments","formControlName","comments",1,"form-control"],[1,"row"],[1,"col-md-6","mb-3"],[1,"form-check","form-check-inline","ps-0"],[1,"form-check","form-check-inline"],["type","radio","name","areYou","id","yesPax","checked","",1,"form-check-input"],["for","yesPax",1,"form-check-label"],["type","radio","name","areYou","id","noPax",1,"form-check-input"],["for","noPax",1,"form-check-label"],[1,"form-check","form-switch"],["type","checkbox","id","infoSwitch",1,"form-check-input",3,"checked","change"],["for","infoSwitch",1,"form-check-label"],[1,"row","pt-2"],[1,"col-12"],["class","alert alert-danger","role","alert",4,"ngIf"],["formArrayName","purchasePassengers",4,"ngIf"],[1,"row","mt-2"],[1,"col-12","text-right"],["href","javascript:void()",1,"btn","btn-lg","btn-danger","mr-3","back_select_cabin_gm",3,"click"],[1,"fa","fa-angle-left"],["href","javascript:void()",1,"btn","btn-lg","btn-success","next_pay_gm",3,"ngClass","click"],[1,"fa","fa-angle-right"],[3,"value"],["type","text","formControlName","valueOther","id","valueOther","tabindex","20007",1,"form-control"],["role","alert",1,"alert","alert-danger"],["formArrayName","purchasePassengers"],[3,"formArrayName",4,"ngFor","ngForOf"],[3,"formArrayName"],[1,"fs-24","text-muted"],["class","card mb-3",3,"formGroupName",4,"ngFor","ngForOf","ngForTrackBy"],[1,"card","mb-3",3,"formGroupName"],[1,"badge-pill","badge","badge-orange","float-right"],["formControlName","firstName","galPassengerFormTabIndex","","type","text","name","traveldate","id","traveldate",1,"form-control",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","focusout"],["formControlName","lastName","galPassengerFormTabIndex","","type","text","name","price2","id","price",1,"form-control",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","focusout"],[1,"w-100"],["name","year","formControlName","birthYear","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],["name","month","formControlName","birthMonth","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],["name","day","formControlName","birthday","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],["class","form-group",4,"ngIf"],["formControlName","address","type","text","name","address","galPassengerFormTabIndex","",1,"form-control",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","focusout"],["id","selcategory","name","selcategory","formControlName","gender","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],["formControlName","country","name","country","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],["href","#","data-toggle","modal","data-target","#passport",2,"font-size","12px","font-style","italic",3,"click"],["type","text","name","price4","formControlName","passport","galPassengerFormTabIndex","",1,"form-control",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","focusout"],["type","text","name","allergies","formControlName","allergies","galPassengerFormTabIndex","",1,"form-control",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","focusout"],["style","border-top: 1px solid #fff;",4,"ngIf"],["id","selLocalFlight","name","selLocalFlight","formControlName","localFlight","galPassengerFormTabIndex","",1,"form-control","custom-select",3,"ngClass","galFormNumber","galCabinIndex","galPassengerIndex","galTabIndex","change"],[2,"border-top","1px solid #fff"],[3,"doesOpenWhyInfoDialog","closeWhyInfoModal"]],template:function(r,n){if(1&r&&(e.TgZ(0,"h3",0),e._uU(1,"Who is traveling?"),e.qZA(),e.TgZ(2,"p",1),e._uU(3,"Please fill in the form(s) below with information about each passenger. "),e.TgZ(4,"b",2),e._uU(5,"All fields"),e.qZA(),e._uU(6," are mandatory:"),e.qZA(),e.TgZ(7,"form",3)(8,"div",4)(9,"div",5)(10,"h3",6)(11,"i",7)(12,"span",8),e._uU(13,"Main contact person"),e.qZA()()()(),e.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"div",12)(18,"label"),e._uU(19,"First Name:"),e.qZA(),e.TgZ(20,"input",13),e.NdJ("focusout",function(){return n.addLog(n.validateForm(n.purchasePassengerForm.get("purchaseContactPerson
1Form"),"firstName"))}),e.qZA(),e.YNc(21,Ar,3,0,"div",14),e.qZA()(),e.TgZ(22,"div",11)(23,"div",12)(24,"label"),e._uU(25,"Last Name:"),e.qZA(),e.TgZ(26,"input",15),e.NdJ("focusout",function(){return n.addLog(n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"lastName"))}),e.qZA(),e.YNc(27,Sr,3,0,"div",14),e.qZA()(),e.TgZ(28,"div",11)(29,"div",12)(30,"label"),e._uU(31,"E-mail:"),e.qZA(),e.TgZ(32,"input",16),e.NdJ("focusout",function(){return n.addLogEmail(n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"email"))}),e.qZA(),e.YNc(33,xr,3,0,"div",14),e.qZA()(),e.TgZ(34,"div",11)(35,"div",12)(36,"label"),e._uU(37,"Telephone:"),e.qZA(),e._UZ(38,"ngx-intl-tel-input",17),e.YNc(39,Pr,3,0,"div",14),e.qZA()(),e.TgZ(40,"div",11)(41,"div",12)(42,"label"),e._uU(43,"Country:"),e.qZA(),e.TgZ(44,"select",18)(45,"option",19),e._uU(46,"Please select"),e.qZA(),e.YNc(47,Zr,2,2,"option",20),e.qZA(),e.TgZ(48,"div",21)(49,"small"),e._uU(50,"Country is Required"),e.qZA()()()(),e.TgZ(51,"div",11)(52,"div")(53,"label",22),e._uU(54,"How did you find us?: "),e.qZA(),e.TgZ(55,"select",23),e.NdJ("focusout",function(){return n.addLog(n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"howFindUs"))}),e.TgZ(56,"option",24),e._uU(57,"Please choose"),e.qZA(),e.TgZ(58,"option",25),e._uU(59,"Internet search"),e.qZA(),e.TgZ(60,"option",26),e._uU(61,"Recomendation from friend / family"),e.qZA(),e.TgZ(62,"option",27),e._uU(63,"Social media channels"),e.qZA(),e.TgZ(64,"option",28),e._uU(65,"Other"),e.qZA()()(),e.YNc(66,Ir,4,0,"div",29),e.qZA()(),e.TgZ(67,"div",30)(68,"div",31)(69,"div",32)(70,"label",33),e._uU(71,"Comments:"),e.qZA(),e._UZ(72,"textarea",34),e.qZA()()(),e.TgZ(73,"div",35)(74,"div",36)(75,"div",37),e._uU(76,"Are you cruising with us? "),e.qZA(),e.TgZ(77,"div",38),e._UZ(78,"input",39),e.TgZ(79,"label",40),e._uU(80,"Yes"),e.qZA()(),e.TgZ(81,"div",38),e._UZ(82,"input",41),e.TgZ(83,"label",42),e._uU(84,"No"),e.qZA()()(),e.TgZ(85,"div",36)(86,"div",43)(87,"input",44),e.NdJ("change",function(p){return n.onCheckboxChange(p)}),e.qZA(),e.TgZ(88,"label",45),e._uU(89,"Enter guests' personal information now"),e.qZA()()()()(),e.TgZ(90,"div",46)(91,"div",47),e.YNc(92,Fr,2,0,"div",48),e.qZA()()(),e.YNc(93,$r,2,1,"ng-container",49),e.TgZ(94,"div",4)(95,"div",9)(96,"div",50)(97,"div",51)(98,"a",52),e.NdJ("click",function(){return n.goBack()}),e._UZ(99,"i",53),e._uU(100," Back"),e.qZA(),e.TgZ(101,"a",54),e.NdJ("click",function(){return n.confirm(n.purchasePassengerForm.value.purchasePassengers,n.purchasePassengerForm.value.purchaseContactPersonForm)}),e._uU(102,"Next "),e._UZ(103,"i",55),e.qZA()()(),e.YNc(104,zr,2,1,"div",29),e.qZA()()()),2&r){let l,p;e.xp6(7),e.Q6J("formGroup",n.purchasePassengerForm),e.xp6(13),e.Q6J("ngClass",e.VKq(29,G,n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"firstName"))),e.xp6(1),e.Q6J("ngIf",n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"firstName")),e.xp6(5),e.Q6J("ngClass",e.VKq(31,G,n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"lastName"))),e.xp6(1),e.Q6J("ngIf",n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"lastName")),e.xp6(5),e.Q6J("ngClass",e.VKq(33,G,n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"email"))),e.xp6(1),e.Q6J("ngIf",n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"email")),e.xp6(5),e.Q6J("cssClass","custom")("preferredCountries",e.WLB(35,je,n.CountryISO.UnitedStates,n.CountryISO.UnitedKingdom))("enableAutoCountrySelect",!0)("enablePlaceholder",!0)("searchCountryFlag",!0)("searchCountryField",e.WLB(38,je,n.SearchCountryField.Iso2,n.SearchCountryField.Name))("selectFirstCountry",!1)("selectedCountryISO",n.CountryISO.UnitedStates)("maxLength",15)("phoneValidation",!0)("separateDialCode",!0),e.xp6(1),e.Q6J("ngIf",n.validateForm(n.purchasePassengerForm.get("purchaseContactPersonForm"),"phone")),e.xp6(5),e.Q6J("galFormNumber",1)("galTabIndex",4),e.xp6(1),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",n.countries),e.xp6(19),e.Q6J("ngIf","Other"===(null==(l=n.purchasePassengerForm.get("purchaseContactPerson
1Form"))||null==(p=l.get("howFindUs"))?null:p.value)),e.xp6(21),e.Q6J("checked",n.visibleGuest),e.xp6(5),e.Q6J("ngIf",!0===n.isShowErrorsSummary&&!0===n.purchasePassengerForm.invalid),e.xp6(1),e.Q6J("ngIf",n.visibleGuest),e.xp6(8),e.Q6J("ngClass",e.VKq(41,Xr,n.purchasePassengerForm.valid)),e.xp6(3),e.Q6J("ngIf",n.doesOpenWhyInfoDialog)}},dependencies:[o.mk,o.sg,o.O5,u._Y,u.YN,u.Kr,u.Fj,u.EJ,u.JJ,u.JL,u.sg,u.u,u.x0,u.CE,Tr,j.FV,j.mh,Cr,Ve.p,yr,br]}),i})();var te=_(2058),Pe=(()=>{return(i=Pe||(Pe={})).PAYPAL="PAYPAL",i.payflowCreditCard="payflowCreditCard",Pe;var i})(),ne=(()=>{return(i=ne||(ne={})).HTTP_ERROR="1",i.RESERVED_ERROR="0",ne;var i})(),Ze=(()=>{return(i=Ze||(Ze={}))[i.TYPE_PAYPAL=1]="TYPE_PAYPAL",i[i.TYPE_PAY_ONLINE=2]="TYPE_PAY_ONLINE",i[i.TYPE_DIRECT_TRANSFER=3]="TYPE_DIRECT_TRANSFER",Ze;var i})(),ti=_(735),Ke=_(6053),de=(()=>{return(i=de||(de={})).CREDIT_CARD="credit_card",i.TRANSFER="transfer",i.PAYPAL="paypal",i.CASH="cash",de;var i})();var ri=_(6820);let ii=(()=>{const s=class{constructor(){this.paymentsType=[],this.fillPromos()}fillPromos(){this.addPaymentType({code:6,value:"Visa",type:te.G.STRIPE_CHECKOUT,img:"visa.svg",heightValue:25}),this.addPaymentType({code:7,value:"Mastercard",type:te.G.STRIPE_CHECKOUT,img:"mastercard.svg",heightValue:35}),this.addPaymentType({code:8,value:"American Express",type:te.G.STRIPE_CHECKOUT,img:"amex.svg",heightValue:35}),this.addPaymentType({code:5,value:"Paypal",type:te.G.PAYPAL_OPTION_REQUEST,img:"paypal.svg",heightValue:35}),this.addPaymentType({code:4,value:"Wells",type:te.G.FOREIGNS_BANKS,img:"wells.svg",heightValue:35}),this.addPaymentType({code:3,value:"td",type:te.G.FOREIGNS_BANKS,img:"td.svg",heightValue:35}),this.addPaymentType({code:2,value:"Zelle",type:te.G.FOREIGNS_BANKS,img:"zelle.svg",heightValue:25}),this.addPaymentType({code:9,value:"Transfer in Ec",type:te.G.LOCAL_TRANSFER,img:"ecuador-account.svg",heightValue:35}),this.addPaymentType({code:9,value:"Direct transfer",type:te.G.LOCAL_TRANSFER,img:"direct-transfer.svg",heightValue:35}),this.addPaymentType({code:1,value:"bank international",type:te.G.FOREIGNS_BANKS,img:"international-bank.svg",heightValue:35}),this.addPaymentType({code:11,value:"wire-transfer",type:te.G.FOREIGNS_BANKS,img:"wire-transfer.svg",heightValue:35})}addPaymentType(t){this.paymentsType.push(t)}getPaymentsType(){return this.paymentsType}getPaymentsByType(t){let r=[];for(const n of this.getPaymentsType())n.type===t&&r.push(n);return r}getAllPaymentsBytypes(t){let r=[];for(const n of this.getPaymentsType()){let l=t.find(p=>p===n.type);l&&l>=0&&r.push(n)}return r}getImagesByListNames(t){let r=[];for(const n of this.getPaymentsType())t.findIndex(p=>p===n.img)>=0&&r.push(n);return r}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),i})();var ze=_(6180),we=_(2843),Re=_(262),ai=_(9646);let re=(()=>{const s=class{constructor(t){if(this.creditCardModel={creditCardNumber:0,securityNumber:0,expirationMonth:0,expirationYear:0,billToFirstName:"",billToLastName:"",billToStreet:"",billToStreet2:"",billToCity:"",billToState:"",billToCountry:0,billToPhoneNumber:"",billToZip:"",billToEmail:""},this.billToFirstName="",this.billToLastName="",this.billToStreet="",this.billToStreet2="",this.billToCity="",this.billToState="",this.billToPhoneNumber="",this.billToZip="",this.billToEmail="",!t)throw new Error("Credit Card Model is required");this.initializeInstanceAttributes(t),this.validate()}initializeInstanceAttributes(t){this.setModel(t),this.setProductNumber(t.creditCardNumber),this.setSecurityNumber(t.securityNumber),this.setExpirationMonth(Number(t.expirationMonth)),this.setExpirationYear(Number(t.expirationYear)),this.setBillToFirstName(t.billToFirstName),this.setBillToLastName(t.billToLastName),this.setBillToStreet(t.billToStreet),t.billToStreet2&&t.hasOwnProperty("billToStreet2")&&this.setBillToStreet2(t.billToStreet2),this.setBillToCity(t.billToCity),this.setBillToState(t.billToState),this.setBillToCountry(t.billToCountry),this.setBillToPhoneNumber(t.billToPhoneNumber),this.setBillToZip(t.billToZip),this.setBillToEmail(t.billToEmail)}getProductNumber(){return this.creditCardNumber}setProductNumber(t){this.creditCardNumber=t.toString()}getSecurityNumber(){return this.securityNumber}setSecurityNumber(t){this.securityNumber=t.toString()}getExpirationMonth(){return this.expirationMonth}setExpirationMonth(t){this.expirationMonth=t.toString()}getExpirationYear(){return this.expirationYear}setExpirationYear(t){this.expirationYear=t.toString()}setBillToFirstName(t){this.billToFirstName=t}getBillToFirstName(){return this.billToFirstName}setBillToLastName(t){this.billToLastName=t}getBillToLastName(){return this.billToLastName}setBillToStreet(t){this.billToStreet=t}getBillToStreet(){return this.billToStreet}
1setBillToStreet2(t){this.billToStreet2=t}getBillToStreet2(){return this.billToStreet2}setBillToCity(t){this.billToCity=t}getBillToCity(){return this.billToCity}setBillToState(t){this.billToState=t}getBillToState(){return this.billToState}getBillToStateFirstTwoLetters(){return this.billToState.substring(0,2)}setBillToCountry(t){this.billToCountry=t.toString()}getBillToCountry(){return this.billToCountry}setBillToPhoneNumber(t){this.billToPhoneNumber=t}getBillToPhoneNumber(){return this.billToPhoneNumber}setBillToZip(t){this.billToZip=t}getBillToZip(){return this.billToZip}setBillToEmail(t){this.billToEmail=t}getBillToEmail(){return this.billToEmail}setModel(t){this.creditCardModel=t}getExpirationDate(){try{return""+this.padLeftExpirationMonth()+this.getExpirationYearLastTwoDigits()}catch(t){console.error(t)}return"0000"}getExpirationYearLastTwoDigits(){try{return(this.getExpirationYear()+"").substr(2,2)}catch{return"00"}}padLeftExpirationMonth(){const t=this.getExpirationMonth();try{return t<1?"01":t<10?"0"+t:t>12?"12":t+""}catch(r){return console.error(r),"01"}}validate(){this.isCreditCardNumberValid(),this.isSecurityNumberValid(),this.areRequiredFieldsPresent()}isCreditCardNumberValid(){const t=new RegExp(s.creditCardRegex),r=this.getProductNumber()+"";if(!t.test(r))throw new Error("Invalid credit card number")}isSecurityNumberValid(){const t=new RegExp(s.securityNumberRegex),r=this.getSecurityNumber()+"";if(!t.test(r))throw new Error("Invalid security number")}areRequiredFieldsPresent(){if(this.isNullUndefinedOrEmpty(this.creditCardNumber+"")||this.isNullUndefinedOrEmpty(this.securityNumber+"")||this.isNullUndefinedOrEmpty(this.expirationMonth+"")||this.isNullUndefinedOrEmpty(this.expirationYear+"")||this.isNullUndefinedOrEmpty(this.billToFirstName)||this.isNullUndefinedOrEmpty(this.billToLastName)||this.isNullUndefinedOrEmpty(this.billToStreet)||this.isNullUndefinedOrEmpty(this.billToCity)||this.isNullUndefinedOrEmpty(this.billToState)||this.isNullUndefinedOrEmpty(this.billToCountry+"")||this.isNullUndefinedOrEmpty(this.billToPhoneNumber)||this.isNullUndefinedOrEmpty(this.billToZip)||this.isNullUndefinedOrEmpty(this.billToEmail))throw new Error("Please check the required fields")}isNullUndefinedOrEmpty(t){return null==t||""===t.trim()}};let i=s;return s.creditCardRegex="^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$",s.securityNumberRegex="^[0-9]{3,4}$",s.expirationMonthRegex="^(0?[1-9]|1[012])$",s.expirationYearRegex="^[0-9]{3,4}$",s.maxYearsExpirationDate=20,s.noEmpty="^(?!\\s*$).+",i})();var le=_(678),Z=_(2468);function ni(i,s){if(1&i&&(e.TgZ(0,"div",1)(1,"div",2)(2,"p")(3,"i",3),e._uU(4,"\xa0\xa0\xa0"),e.qZA(),e.TgZ(5,"strong"),e._uU(6),e.qZA()(),e.TgZ(7,"p"),e._uU(8),e.qZA()()()),2&i){const a=e.oxw();e.xp6(6),e.Oqu(a.errorHeader),e.xp6(2),e.Oqu(a.errorText)}}let Me=(()=>{const s=class{constructor(){this.errorHeader="",this.errorText="",this.visible=!1}};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-credit-card-error-payment"]],inputs:{errorHeader:"errorHeader",errorText:"errorText",visible:"visible"},standalone:!0,features:[e.jDz],decls:1,vars:1,consts:[["class","col-md-12",4,"ngIf"],[1,"col-md-12"],["role","alert",1,"alert","alert-danger"],[1,"fa","fa-exclamation-triangle"]],template:function(r,n){1&r&&e.YNc(0,ni,9,2,"div",0),2&r&&e.Q6J("ngIf",n.visible)},dependencies:[o.ez,o.O5]}),i})();const si=i=>le.validateCardNumber(i.value)?null:{creditCardNumber:!0},oi=i=>{let s=i.value;if(console.log("expirationDate",s),null!=s&&""!==s){console.log("creditcardutils.parseCardExpiry(expirationDate)",le.parseCardExpiry(s));const{month:a,year:t}=le.parseCardExpiry(s);return le.validateCardExpiry(a,t)?null:{creditCardExpiration:!0}}};function ci(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToFirstName"),"")}}function li(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToLastName"),"")}}function ui(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("creditCardNumber"),"")}}function di(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("expirationDate"),"")}}function hi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("securityNumber"),"")}}function pi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToStreet"),"")}}function mi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToStreet2"),"")}}function gi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToCity"),"")}}function _i(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToState"),"")}}function fi(i,s){if(1&i&&(e.TgZ(0,"option",29),e._uU(1),e.qZA()),2&i){const a=s.$implicit;e.Q6J("value",a.code),e.xp6(1),e.Oqu(a.name)}}function vi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToCountry"),"")}}function Ti(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToZip"),"")}}function Ci(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToPhoneNumber"),"")}}function yi(i,s){if(1&i&&(e.TgZ(0,"span",39),e._uU(1),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.hij(" ",a.getFieldError("billToEmail"),"")}}function bi(i,s){1&i&&(e.TgZ(0,"div",51),e._uU(1," To continue you must agree to our Terms and Conditions. "),e.qZA())}function Ai(i,s){1&i&&e._UZ(0,"span",52)}function Si(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Please Wait"),e.qZA())}function xi(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Pay Now"),e.qZA())}function Pi(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",40)(1,"div",41)(2,"p"),e._uU(3," To proceed, please agree to our "),e.TgZ(4,"a",42)(5,"u"),e._uU(6,"Terms & Conditions"),e.qZA()(),e._uU(7,". "),e.qZA(),e.TgZ(8,"label",43)(9,"input",44),e.NdJ("change",function(r){e.CHM(a);const n=e.oxw();return e.KtG(n.changeTermsPayTransfer(r.target))}),e.qZA(),e._uU(10," I agree to the Terms & Conditions."),e.qZA()(),e.TgZ(11,"div",45),e.YNc(12,bi,2,0,"div",46),e.qZA(),e.TgZ(13,"div",47),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.termsCondition=!0)}),e.TgZ(14,"button",48),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.sendForm())}),e.YNc(15,Ai,1,0,"span",49),e._uU(16,"\xa0"),e.YNc(17,Si,2,0,"span",50),e.YNc(18,xi,2,0,"span",50),e.qZA()()()}if(2&i){const a=e.oxw();e.xp6(9),e.Q6J("checked",a.termsConditionPaytransfer),e.xp6(3),e.Q6J("ngIf",!a.termsConditionPaytransfer&&a.termsCondition),e.xp6(2),e.Q6J("disabled",!a.termsConditionPaytransfer||a.loading),e.xp6(1),e.Q6J("ngIf",a.loading),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading)}}const K=function(i){return{"is-invalid":i}};let Xe=(()=>{const s=class{constructor(t,r){this.fb=t,this.countryInfoService=r,this.arrayOfExpirationMonths=[],this.arrayOfExpirationYears=[],this.arrayOfCountries=[],this.termsConditionPaytransfer=!1,this.valueTerms="none",this.termsCondition=!1,this.validateCardNumber=!1,this.validateCardExpiration=!1,this.validateCardType="credit-card",this.errorTextPaymentHeader="Oops! Something went wrong!",this.errorTextPaymentHeaderAttempts="Oops! Payment Attempt Limit Reached",this.loading=!1,this.errorTextPaymentResponse="",this.errorTextPaymentAttempts="",this.isShowErrorMessageInForm=!1,this.isShowPaymentErrorMessageInForm=!1,this.submitEvent=ne
1w e.vpe,this.attempts=0,this.locked=!1,this.creditCardFormGroup=this.fb.group({billToFirstName:[null,[u.kI.required,u.kI.maxLength(30),u.kI.pattern(re.noEmpty)]],billToLastName:[null,[u.kI.required,u.kI.maxLength(30),u.kI.pattern(re.noEmpty)]],creditCardNumber:[null,[u.kI.required,u.kI.minLength(16),si]],expirationDate:[null,[u.kI.required,oi]],securityNumber:[null,[u.kI.required,u.kI.minLength(3),u.kI.maxLength(4),u.kI.pattern(re.securityNumberRegex)]],billToStreet:[null,[u.kI.required,u.kI.maxLength(30),u.kI.pattern(re.noEmpty)]],billToStreet2:[null,[u.kI.maxLength(30),u.kI.pattern(re.noEmpty)]],billToCity:[null,[u.kI.required,u.kI.maxLength(20),u.kI.pattern(re.noEmpty)]],billToState:[null,[u.kI.required,u.kI.pattern(re.noEmpty)]],billToCountry:[null,[u.kI.required,u.kI.pattern(re.noEmpty)]],billToZip:[null,[u.kI.required,u.kI.maxLength(9),u.kI.pattern(re.noEmpty)]],billToPhoneNumber:[null,[u.kI.required,u.kI.maxLength(10),u.kI.pattern(re.noEmpty)]],billToEmail:[null,[u.kI.required,u.kI.email,u.kI.maxLength(60)]]})}ngOnInit(){this.arrayOfCountries=this.countryInfoService.getCountries(),this.arrayOfExpirationMonths=Z.s.createArrayOfExpirationMonths(),this.arrayOfExpirationYears=Z.s.createArrayOfExpirationYears(re.maxYearsExpirationDate)}sendForm(){this.creditCardFormGroup.invalid?this.creditCardFormGroup.markAllAsTouched():this.creditCardFormGroup.valid&&this.confirm()}confirm(){1===this.attempts&&this.disableFormElements(),this.submitEvent.emit(this.creditCardFormGroup.value)}disableFormElements(){this.creditCardFormGroup.disable({})}enableFormElements(){this.creditCardFormGroup.enable({})}changeTermsPayTransfer(t){const r=t.checked;this.termsConditionPaytransfer=r,this.valueTerms=r?"all":"none"}keyUp(t){this.creditCardFormGroup.controls.creditCardNumber.setValue(le.formatCardNumber(this.creditCardFormGroup.controls.creditCardNumber.value)),this.validateCardNumber=le.validateCardNumber(this.creditCardFormGroup.controls.creditCardNumber.value),this.validateCardType=le.parseCardType(this.creditCardFormGroup.controls.creditCardNumber.value)}keyUpExpirationDate(t){this.creditCardFormGroup.controls.expirationDate.setValue(le.formatCardExpiry(this.creditCardFormGroup.controls.expirationDate.value))}isValidField(t){return this.creditCardFormGroup.controls[t].errors&&this.creditCardFormGroup.controls[t].touched}getFieldError(t){if(!this.creditCardFormGroup.controls[t])return null;const r=this.creditCardFormGroup.controls[t].errors||{};for(const n of Object.keys(r))switch(console.log(n),n){case"required":return"This field is required";case"minlength":return`Min length is ${r[n].requiredLength}`;case"creditCardNumber":return"Card Number is Invalid";case"creditCardExpiration":return"Expiration Date is Invalid";case"email":return"Invalid email";case"pattern":return"";default:return"Error"}return null}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(u.qu),e.Y36(Ue.T))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-credit-card"]],inputs:{loading:"loading",errorTextPaymentResponse:"errorTextPaymentResponse",errorTextPaymentAttempts:"errorTextPaymentAttempts",isShowErrorMessageInForm:"isShowErrorMessageInForm",isShowPaymentErrorMessageInForm:"isShowPaymentErrorMessageInForm",attempts:"attempts",locked:"locked"},outputs:{submitEvent:"submitEvent"},standalone:!0,features:[e.jDz],decls:101,vars:63,consts:[["xmlns","http://www.w3.org/1999/html",1,"row"],[1,"card-body",3,"formGroup"],[1,"text-danger"],[1,"mb-3","mt-3"],[1,"fs-24","text-muted"],[1,"row"],[1,"col-md-6"],[1,"form-group"],["for","billToFirstName"],["formControlName","billToFirstName","id","billToFirstName","placeholder","Given name","type","text",1,"form-control",3,"ngClass"],["class","form-text text-danger",4,"ngIf"],[1,"d-none","d-md-block"],["formControlName","billToLastName","id","billToLastName","placeholder","Last name","type","text",1,"form-control",3,"ngClass"],["for","creditCardNumber"],["formControlName","creditCardNumber","inputmode","numeric","id","creditCardNumber","placeholder","Card Number",1,"form-control",2,"display","inline-block","width","90%",3,"ngClass","keyup"],[2,"display","inline-block","width","10%","height","30px","padding-left","5px",3,"src"],["for","expirationDate"],["formControlName","expirationDate","inputmode","numeric","id","expirationDate","placeholder","MM / YY",1,"form-control",3,"ngClass","keyup"],["for","securityNumber"],["formControlName","securityNumber","id","securityNumber","placeholder","CVC","maxlength","4","onkeypress","return event.charCode >= 48 && event.charCode <= 57",1,"form-control",3,"ngClass"],["for","billToStreet"],["type","text","id","billToStreet","formControlName","billToStreet","placeholder","Street and number, P.O. box, c/o.",1,"form-control",3,"ngClass"],["formControlName","billToStreet2","id","billToStreet2","placeholder","Apartment, suite, unit, building, floor, etc.","type","text","maxlength","30",1,"form-control",3,"ngClass"],["for","billToCity"],["type","text","id","billToCity","formControlName","billToCity","placeholder","Billing city",1,"form-control",3,"ngClass"],["for","billToState"],["type","text","id","billToState","formControlName","billToState","placeholder","State / Province",1,"form-control",3,"ngClass"],["for","billToCountry"],["id","billToCountry","formControlName","billToCountry",1,"form-control",3,"ngClass"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],["for","billToZip"],["type","text","id","billToZip","formControlName","billToZip","placeholder","Billing Zip code",1,"form-control",3,"ngClass"],["for","billToPhoneNumber"],["type","text","id","billToPhoneNumber","formControlName","billToPhoneNumber","placeholder","Phone Number",1,"form-control",3,"ngClass"],["for","billToEmail"],["type","text","id","billToEmail","formControlName","billToEmail","placeholder","Email",1,"form-control",3,"ngClass"],[3,"visible","errorHeader","errorText"],["class","row mt-4",4,"ngIf"],[1,"form-text","text-danger"],[1,"row","mt-4"],[1,"col-12"],["href","https://www.galapagosislands.com/documents/full_terms_conditions_ecommerce.pdf","target","_blank"],[1,"fs-13"],["type","checkbox","id","card",1,"agree",3,"checked","change"],[1,"col-md-8"],["class","fs-13 p-1 alert-danger mb-3",4,"ngIf"],[1,"col-12","text-center",3,"click"],["id","card-button",1,"btn","btn-success","btn-lg","float-right",2,"width","300px",3,"disabled","click"],["class","lds-dual-ring",4,"ngIf"],[4,"ngIf"],[1,"fs-13","p-1","alert-danger","mb-3"],[1,"lds-dual-ring"]],template:function(r,n){1&r&&(e.TgZ(0,"div",0)(1,"form",1)(2,"p"),e._uU(3,"Please fill in the form below. "),e.TgZ(4,"b",2),e._uU(5,"All fields"),e.qZA(),e._uU(6," are mandatory:"),e.qZA(),e._UZ(7,"hr",3),e.TgZ(8,"h3",4),e._uU(9,"Credit Card Information"),e.qZA(),e.TgZ(10,"div",5)(11,"div",6)(12,"div",7)(13,"label",8),e._uU(14,"Name on card:"),e.qZA(),e._UZ(15,"input",9),e.YNc(16,ci,2,1,"span",10),e.qZA()(),e.TgZ(17,"div",6)(18,"div",7)(19,"label",11),e._uU(20,"\xa0"),e.qZA(),e._UZ(21,"input",12),e.YNc(22,li,2,1,"span",10),e.qZA()()(),e.TgZ(23,"div",5)(24,"div",6)(25,"div",7)(26,"label",13),e._uU(27,"Card Number:"),e.qZA(),e.TgZ(28,"div")(29,"input",14),e.NdJ("keyup",function(p){return n.keyUp(p)}),e.qZA(),e._UZ(30,"img",15),e.qZA(),e.YNc(31,ui,2,1,"span",10),e.qZA()(),e.TgZ(32,"div",6)(33,"div",7)(34,"label",16),e._uU(35,"Expiration Date:"),e.qZA(),e.TgZ(36,"input",17),e.NdJ("keyup",function(p){return n.keyUpExpirationDate(p)}),e.qZA(),e.YNc(37,di,2,1,"span",10),e.qZA()()(),e.TgZ(38,"div",5)(39,"div",6)(40,"div",7)(41,"label",18),e._uU(42,"CVV:"),e.qZA(),e._UZ(43,"input",19),e.YNc(44,hi,2,1,"span",10),e.qZA()()(),e._UZ(45,"hr",3),e.TgZ(46,"h3",4),e._uU(47,"Billing Information"),e.qZA(),e.TgZ(48,"div",5)(49,"div",6)(50,"div",7)(51,"label",20),e._uU(52,"Street address:"),e.qZA(),e._UZ(53,"input",21),e.YNc(54,pi,2,1,"span",10),e.qZA()(),e.TgZ(55,"div",6)(56,"div",7)(57,"label",11),e._uU(58,"\xa0"),e.qZA(),e._UZ(59,"input",22),e.YNc(60,mi,2,1,"span",10),e.qZA()()(),e.TgZ(61,"div",5)(62,"div",6)(63,"div",7)(64,"label",23),e._uU(65,"City:"),e.qZA(),e._UZ(66,"input",24),e.YNc(67,gi,2,1,"span",10),e.qZA(),e.TgZ(68,"div",7)(69,"label",25),e._uU(70,"State / Province:"),e.qZA(),e._UZ(71,"input",26),e.YNc(72,_i,2,1,"span",10),e.qZA(),e.TgZ(73,"div",7)(74,"label",27),e._uU(75,"Country:"),e.qZA(),e.TgZ(76,"select",28)(77,"option",29),e._uU(78,"Select country"),e.qZA(),e.YNc(79,fi,2,2,"option",30),e.qZA(),e.YNc(80,vi,2,1,"span",10),e.qZA()(),e.TgZ(81,"div",6)(82,"div",7)(83,"label",31),e._uU(84,"Zip Code:"),e.qZA(),e._UZ(85,"input",32),e.YNc(86,Ti,2,1,"span",10),e.qZA(),e.TgZ(87,"div",7)(88,"label",33),e._uU(89,"Phone number:"),e.qZA(),e._UZ(90,"input",34),e.YNc(91,Ci,2,1,"span",10),e.qZA(),e.TgZ(92,"div",7)(93,"label",35),e._uU(94,"Email:"),e.qZA(),e._UZ(95,"input",36),e.YNc(96,yi,2,1,"span",10),e.qZA()()(),e._UZ(97,"app-credit-card-error-payment",37)(98,"app-credit-card-error-payment",37)(99,"hr"),e.YNc(100,Pi,19,6,"div",38),e.qZA()()),2&r&&(e.xp6(1),e.Q6J("formGroup",n.creditCardFormGroup),e.xp6(14),e.Q6J("ngClass",e.VKq(37,K,n.isValidField("billToFirstName"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToFirstName")),e.xp6(
15),e.Q6J("ngClass",e.VKq(39,K,n.isValidField("billToLastName"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToLastName")),e.xp6(7),e.Q6J("ngClass",e.VKq(41,K,n.isValidField("creditCardNumber"))),e.xp6(1),e.MGl("src","assets/images/payments/",n.validateCardType,".svg",e.LSH),e.xp6(1),e.Q6J("ngIf",n.isValidField("creditCardNumber")),e.xp6(5),e.Q6J("ngClass",e.VKq(43,K,n.isValidField("expirationDate"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("expirationDate")),e.xp6(6),e.Q6J("ngClass",e.VKq(45,K,n.isValidField("securityNumber"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("securityNumber")),e.xp6(9),e.Q6J("ngClass",e.VKq(47,K,n.isValidField("billToStreet"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToStreet")),e.xp6(5),e.Q6J("ngClass",e.VKq(49,K,n.isValidField("billToStreet2"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToStreet2")),e.xp6(6),e.Q6J("ngClass",e.VKq(51,K,n.isValidField("billToCity"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToCity")),e.xp6(4),e.Q6J("ngClass",e.VKq(53,K,n.isValidField("billToState"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToState")),e.xp6(4),e.Q6J("ngClass",e.VKq(55,K,n.isValidField("billToCountry"))),e.xp6(1),e.Q6J("value",null),e.xp6(2),e.Q6J("ngForOf",n.arrayOfCountries),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToCountry")),e.xp6(5),e.Q6J("ngClass",e.VKq(57,K,n.isValidField("billToZip"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToZip")),e.xp6(4),e.Q6J("ngClass",e.VKq(59,K,n.isValidField("billToPhoneNumber"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToPhoneNumber")),e.xp6(4),e.Q6J("ngClass",e.VKq(61,K,n.isValidField("billToEmail"))),e.xp6(1),e.Q6J("ngIf",n.isValidField("billToEmail")),e.xp6(1),e.Q6J("visible",n.isShowPaymentErrorMessageInForm&&!n.loading&&!n.locked)("errorHeader",n.errorTextPaymentHeader)("errorText",n.errorTextPaymentResponse),e.xp6(1),e.Q6J("visible",n.isShowPaymentErrorMessageInForm&&!n.loading&&n.locked)("errorHeader",n.errorTextPaymentHeaderAttempts)("errorText",n.errorTextPaymentAttempts),e.xp6(2),e.Q6J("ngIf",!n.locked))},dependencies:[o.ez,o.mk,o.sg,o.O5,u.UX,u._Y,u.YN,u.Kr,u.Fj,u.EJ,u.JJ,u.JL,u.nD,u.sg,u.u,Me],styles:['.row-item[_ngcontent-%COMP%]{display:flex;padding:5px 0}.control-label[_ngcontent-%COMP%]{text-align:right}@media (max-width: 576px){form-horizontal[_ngcontent-%COMP%]{display:flex;flex-direction:column}.row-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:5px}.row-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{text-align:left}#button-pay-now[_ngcontent-%COMP%]{width:90%}}.lds-dual-ring[_ngcontent-%COMP%]{display:inline-block;width:20px;height:20px}.lds-dual-ring[_ngcontent-%COMP%]:after{content:" ";display:block;width:20px;height:20px;margin:3px;border-radius:50%;border:3px solid #fff;border-color:#fff transparent #fff transparent;animation:_ngcontent-%COMP%_lds-dual-ring 1.2s linear infinite}@keyframes _ngcontent-%COMP%_lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}']}),i})();const Zi=[{errorText:"Invalid expiration date: 10562-This transaction cannot be processed. Please enter a valid credit card expiration year.",errorTextCustom:"Invalid expiration date: 10562-This transaction cannot be processed. Please enter a valid credit card expiration year"},{errorText:"This transaction cannot be processed.",errorTextCustom:"This transaction cannot be processed."}];var ke=_(529),et=_(4004);class Ii{constructor(){}}var w=(()=>{return(i=w||(w={})).partner="PARTNER",i.vendor="VENDOR",i.user="USER",i.password="PWD",i.paymentMethod="TENDER",i.creditCardNumber="ACCT",i.expirationDate="EXPDATE",i.transactionType="TRXTYPE",i.amount="AMT",i.verbosity="VERBOSITY",i.payflowTransactionId="ORIGID",i.securityNumber="CVV2",i.billToFirstName="BILLTOFIRSTNAME",i.billToLastName="BILLTOLASTNAME",i.billToStreet="BILLTOSTREET",i.billToStreet2="BILLTOSTREET2",i.billToCity="BILLTOCITY",i.billToState="BILLTOSTATE",i.billToCountry="BILLTOCOUNTRY",i.billToPhoneNumber="BILLTOPHONENUM",i.billToZip="BILLTOZIP",i.billToEmail="BILLTOEMAIL",w;var i})();class Ie extends Ii{constructor(){super(),this.amount=0,this.originalTransactionId="",this.comment1="",this.comment2=""}setPaymentMethod(s){this.paymentMethod=s}getPaymentMethod(){return this.paymentMethod}setTransactionType(s){this.transactionType=s}getTransactionType(){return this.transactionType}setAmount(s){this.amount=s}getAmount(){return this.amount}getPreparedAmount(){const s=this.getAmount();
1return Z.s.roundNumberToTwoDecimals(s)}setCreditCard(s){this.creditCard=s}getCreditCard(){return this.creditCard}setVerbosity(s){this.verbosity=s}getVerbosity(){return this.verbosity}getRequestToServer(){const s=this.generateEncodedNameValuePairRequestJson();return this.requestToServer=s,s}getOriginalTransactionId(){return this.originalTransactionId}setOriginalTransactionId(s){this.originalTransactionId=s}getComment1(){return this.comment1}setComment1(s){this.comment1=s}getComment2(){return this.comment2}setComment2(s){this.comment2=s}generateEncodedNameValuePairRequestString(){let s="";try{s+=this.getElementNameValuePairString(w.creditCardNumber,this.getCreditCard().getProductNumber()+""),s+=this.getElementNameValuePairString(w.expirationDate,this.getCreditCard().getExpirationDate()+""),s+=this.getElementNameValuePairString(w.securityNumber,this.getCreditCard().getSecurityNumber()+""),s+=this.getElementNameValuePairString(w.billToFirstName,this.getCreditCard().getBillToFirstName()),s+=this.getElementNameValuePairString(w.billToLastName,this.getCreditCard().getBillToLastName()),s+=this.getElementNameValuePairString(w.billToStreet,this.getCreditCard().getBillToStreet()),s+=this.getElementNameValuePairString(w.billToStreet2,this.getCreditCard().getBillToStreet2()),s+=this.getElementNameValuePairString(w.billToCity,this.getCreditCard().getBillToCity()),s+=this.getElementNameValuePairString(w.billToState,this.getCreditCard().getBillToStateFirstTwoLetters()),s+=this.getElementNameValuePairString(w.billToCountry,this.getCreditCard().getBillToCountry()+""),s+=this.getElementNameValuePairString(w.billToPhoneNumber,this.getCreditCard().getBillToPhoneNumber()),s+=this.getElementNameValuePairString(w.billToZip,this.getCreditCard().getBillToZip()),s+=this.getElementNameValuePairString(w.billToEmail,this.getCreditCard().getBillToEmail()),s+=this.getElementNameValuePairString(w.paymentMethod,this.getPaymentMethod()),s+=this.getElementNameValuePairString(w.transactionType,this.getTransactionType()),s+=this.getElementNameValuePairString(w.amount,this.getPreparedAmount()),s+=this.getElementNameValuePairString(w.verbosity,this.getVerbosity()),null!==this.getOriginalTransactionId()&&void 0!==this.getOriginalTransactionId()&&(s+=this.getElementNameValuePairString(w.payflowTransactionId,this.getOriginalTransactionId()))}catch(a){console.error(a)}return(0,e.X6Q)()&&console.log("DevMode: "+s),s}getElementNameValuePairString(s,a){return this.isNullEmptyOrUndefined(s)||this.isNullEmptyOrUndefined(a)?"":s+this.getTagLengthForAValue(a)+"="+a+"&"}getTagLengthForAValue(s){return"["+s.length+"]"}isNullEmptyOrUndefined(s){return null==s||""===s.trim()}generateEncodedNameValuePairRequestJson(){try{return{acct:btoa(this.getCreditCard().getProductNumber().toString()),expdate:btoa(this.getCreditCard().getExpirationDate()),cvv2:btoa(this.getCreditCard().getSecurityNumber().toString()),billtofirstname:btoa(this.getCreditCard().getBillToFirstName()),billtolastname:btoa(this.getCreditCard().getBillToLastName()),billtostreet:btoa(this.getCreditCard().getBillToStreet()),billtostreet2:btoa(this.getCreditCard().getBillToStreet2()),billtocity:btoa(this.getCreditCard().getBillToCity()),billtostate:btoa(this.getCreditCard().getBillToStateFirstTwoLetters()),billtocountry:btoa(this.getCreditCard().getBillToCountry().toString()),billtophonenum:btoa(this.getCreditCard().getBillToPhoneNumber()),billtozip:btoa(this.getCreditCard().getBillToZip()),billtoemail:btoa(this.getCreditCard().getBillToEmail()),tender:btoa(this.getPaymentMethod()),trxtype:btoa(this.getTransactionType()),amt:btoa(this.getPreparedAmount()),verbosity:btoa(this.getVerbosity())}}catch(s){console.error(s)}}}var he=(()=>{return(i=he||(he={})).creditCard="C",i.automatedClearingHouseACH="A",i.pinlessDebit="D",i.telecheck="K",i.paypal="P",he;var i})(),De=_(8582);const Te=class{static getInstance(){return Te.transactionRequestFactory}constructor(){}createPayflowSaleTransaction(s,a,t,r,n){const l=new Ie;return l.setVerbosity(s.defaultVerbosity),l.setTransactionType(s.defaultTransactionType),l.setPaymentMethod(he.creditCard),l.setCreditCard(a),l.setAmount(t),l.setComment1(r),l.setComment2(n),l}createPayflowVerificationTransaction(s,a){const t=new Ie;return t.setVerbosity(s.defaultVerbosity),t.setTransactionType(De.A.authorization),t.setPaymentMethod(he.creditCard),t.setCreditCard(a),t.setComment1("Verification transaction"),t.setAmount(0),t}createPayflowAutorizationTransaction(s,a,t,r,n){const l=new Ie;return l.setVerbosity(s.defaultVerbosity),l.setTransactionType(De.A.authorization),l.setPaymentMethod(he.creditCard),l.setCreditCard(a),l.setAmount(t),l.setComment1(r),l.setComment2(n),l}createPayflowDelayedTransaction(s,a,t,r,n,l){const p=t.getPayflowTransactionId();if(t.isError()||t.getTransactionRequest().getAmount()<r||this.isEmptyNullOrUndefined(p))throw new Error("Amount cannot be greater than authorized amount.");const g=new Ie;return g.setVerbosity(s.defaultVerbosity),g.setTransactionType(De.A.delayedCapture),g.setPaymentMethod(he.creditCard),g.setCreditCard(a),g.setOriginalTransactionId(p),g.setAmount(r),g.setComment1(n),g.setComment2(l),g}isEmptyNullOrUndefined(s){return""===s||null==s}};let Fe=Te;Te.transactionRequestFactory=new Te;var ve=(()=>{return(i=ve||(ve={}))[i.approved=0]="approved",i[i.rejected=1]="rejected",i[i.invalidTenderType=2]="invalidTenderType",i[i.invalidTransactionType=3]="invalidTransactionType",i[i.invalidAmountFormat=4]="invalidAmountFormat",i[i.invalidMerchantInformation=5]="invalidMerchantInformation",i[i.invalidCurrencyCode=6]="invalidCurrencyCode",i[i.fieldFormatError=7]="fieldFormatError",i[i.notATransactionServer=8]="notATransactionServer",i[i.tooManyParametersOrInvalidStream=9]="tooManyParametersOrInvalidStream",i[i.tooManyLineItems=10]="tooManyLineItems",i[i.clientTimeoutWaitingForResponse=11]="clientTimeoutWaitingForResponse",i[i.declined=12]="declined",i[i.referral=13]="referral",i[i.invalidClientCertificationId=14]="invalidClientCertificationId",i[i.originalTransactionIdNotFound=19]="originalTransactionIdNotFound",ve;var i})(),me=(()=>{return(i=me||(me={})).Y="Y",i.N="N",i.X="X",me;var i})(),qe=(()=>{return(i=qe||(qe={})).Y="Y",i.N="N",i.X="X",qe;var i})(),Ne=(()=>{return(i=Ne||(Ne={}))[i.visa=0]="visa",i[i.masterCard=1]="masterCard",i[i.discover=2]="discover",i[i.americanExpress=3]="americanExpress",i[i.dinersClub=4]="dinersClub",i[i.JCB=5]="JCB",Ne;var i})(),I=(()=>{return(i=I||(I={})).result="RESULT",i.payflowTransactionId="PNREF",i.paypalProcessorTransactionId="PPREF",i.responseMessage="RESPMSG",i.authCode="AUTHCODE",i.addressVerificationServiceStreetAddress="AVSADDR",i.addressVerificationServiceZip="AVSZIP",i.cardSecurityCodeMatch="CVV2MATCH",i.correlationId="CORRELATIONID",i.rawAddressVerificationServiceResponse="PROCAVS",i.rawCVV2Response="PROCCVV2",i.internationalAddressVerificationService="IAVS",i.PREFPSMSG="PREFPSMSG",i.POSTFPSMSG="POSTFPSMSG",i.hostCode="HOSTCODE",i.hostCodeResponseText="RESPTEXT",i.rawBuyerAuthentication="PROCCARDSECURE",i.additionalErrorMessage="ADDLMSGS",i.paymentType="PAYMENTTYPE",i.amexId="AMEXID",
1i.amexPostData="AMEXPOSDATA",i.ccTransactionId="CCTRANSID",i.ccTransactionPostData="CCTRANS_POSDATA",i.amount="AMT",i.originalAmount="ORIGAMT",i.cardType="CARDTYPE",i.emailMatch="EMAILMATCH",i.phoneMatch="PHONEMATCH",i.extraProcessorMessage="EXTRSPMSG",i.transactionTime="TRANSTIME",i.duplicate="DUPLICATE",i.dateToSettle="DATE_TO_SETTLE",i.paymentAdviceCode="PAYMENTADVICECODE",i.transactionState="TRANSSTATE",I;var i})();class tt{constructor(s,a){this.encodedNameValuePairResponseString="",this.payflowTransactionId="",this.paypalProcessorTransactionId="",this.responseMessage="",this.authCode="",this.correlationId="",this.rawAddressVerificationServiceResponse="",this.rawCVV2Response="",this.hostCode="",this.hostCodeResponseText="",this.rawBuyerAuthentication="",this.additionalErrorMessage="",this.paymentType="",this.amexId="",this.amexPostData="",this.ccTransactionId="",this.ccTransactionPostData="",this.amount=0,this.originalAmount=0,this.emailMatch="",this.phoneMatch="",this.extraProcessorMessage="",this.transactionTime="",this.dateToSettle="",this.paymentAdviceCode="",this.transactionState="",this.encodedNameValuePairResponseString=s,this.setTransactionRequest(a),this.initializeInstanceMembers()}getId(){return this.getPaypalProcessorTransactionId()}isSuccess(){return this.getResult()===ve.approved}isError(){return this.getResult()!==ve.approved}getServerResponse(){return this.encodedNameValuePairResponseString}initializeInstanceMembers(){try{const s=this.createMapOfDecodedElementsFromListOfNameValuePairEncodedResponseString();this.initializeInstanceMembersFromValuePairMap(s)}catch(s){console.error(s)}}createMapOfDecodedElementsFromListOfNameValuePairEncodedResponseString(){const s=new Map;try{return Z.s.splitStringSeparatedByAmpersandSignIntoArray(this.getEncodedNameValuePairResponseString()).forEach(a=>{const t=Z.s.splitStringSeparatedByEqualsSignIntoArray(a),r=this.getNameElementFromNameValuePairArray(t),n=this.getValueElementFromNameValuePairArray(t);s.set(r,n)}),s}catch(a){console.error(a)}return s}getNameElementFromNameValuePairArray(s){return Z.s.getElementInAnArrayFromAGivenPosition(s,0)}getValueElementFromNameValuePairArray(s){return Z.s.getElementInAnArrayFromAGivenPosition(s,1)}initializeInstanceMembersFromValuePairMap(s){const a=parseInt(Z.s.getValueFromMap(s,I.result),10);this.setResult(a);const t=Z.s.getValueFromMap(s,I.payflowTransactionId);this.setPayflowTransactionId(t);const r=Z.s.getValueFromMap(s,I.paypalProcessorTransactionId);this.setPaypalProcessorTransactionId(r);const n=Z.s.getValueFromMap(s,I.responseMessage);this.setResponseMessage(n);const l=Z.s.getValueFromMap(s,I.authCode);this.setAuthCode(l);let g=Z.s.getValueFromMap(s,I.addressVerificationServiceStreetAddress);this.setAddressVerificationServiceStreetAddress(me[g]);let A=Z.s.getValueFromMap(s,I.addressVerificationServiceZip);this.setAddressVerificationServiceZip(me[A]);let M=Z.s.getValueFromMap(s,I.cardSecurityCodeMatch);this.setCardSecurityCodeMatch(qe[M]);const ae=Z.s.getValueFromMap(s,I.correlationId);this.setCorrelationId(ae);const Ce=Z.s.getValueFromMap(s,I.rawAddressVerificationServiceResponse);this.setRawAddressVerificationServiceResponse(Ce);const ye=Z.s.getValueFromMap(s,I.rawCVV2Response);this.setRawCVV2Response(ye);let $=Z.s.getValueFromMap(s,I.internationalAddressVerificationService);this.setInternationalAddressVerificationService(me[$]);const wa=Z.s.getValueFromMap(s,I.hostCode);this.setHostCode(wa);const Ra=Z.s.getValueFromMap(s,I.hostCodeResponseText);this.setHostCodeResponseText(Ra);const Ma=Z.s.getValueFromMap(s,I.rawBuyerAuthentication);this.setRawBuyerAuthentication(Ma);const ka=Z.s.getValueFromMap(s,I.additionalErrorMessage);this.setAdditionalErrorMessage(ka);const Da=Z.s.getValueFromMap(s,I.paymentType);this.setPaymentType(Da);const La=Z.s.getValueFromMap(s,I.amexId);this.setAmexId(La);const Ba=Z.s.getValueFromMap(s,I.amexPostData);this.setAmexPostData(Ba);const Ya=Z.s.getValueFromMap(s,I.ccTransactionId);this.setCcTransactionId(Ya);const Ja=Z.s.getValueFromMap(s,I.ccTransactionPostData);this.setCcTransactionPostData(Ja);const Wa=parseInt(Z.s.getValueFromMap(s,I.amount),10);this.setAmount(Wa);const Va=parseInt(Z.s.getValueFromMap(s,I.originalAmount),10);this.setOriginalAmount(Va);let Qa=Z.s.getValueFromMap(s,I.cardType);this.setCardType(Ne[Qa]);const Ga=Z.s.getValueFromMap(s,I.emailMatch);this.setEmailMatch(Ga);const Ha=Z.s.getValueFromMap(s,I.phoneMatch);this.setPhoneMatch(Ha);const ja=Z.s.getValueFromMap(s,I.extraProcessorMessage);this.setExtraProcessorMessage(ja);const Ka=Z.s.getValueFromMap(s,I.transactionTime);this.setTransactionTime(Ka);const $a=parseInt(Z.s.getValueFromMap(s,I.duplicate),10);this.setDuplicate($a);const za=Z.s.getValueFromMap(s,I.dateToSettle);this.setDateToSettle(za);const Xa=Z.s.getValueFromMap(s,I.paymentAdviceCode);this.setPaymentAdviceCode(Xa);const en=Z.s.getValueFromMap(s,I.transactionState);this.setTransactionState(en)}getTransactionRequest(){return this.transactionRequest}setTransactionRequest(s){this.transactionRequest=s}getResult(){return this.result}setResult(s){this.result=s}getStatus(){return this.result}getPayflowTransactionId(){return this.payflowTransactionId}setPayflowTransactionId(s){this.payflowTransactionId=s}getPaypalProcessorTransactionId(){return this.paypalProcessorTransactionId}setPaypalProcessorTransactionId(s){this.paypalProcessorTransactionId=s}getResponseMessage(){return this.responseMessage}setResponseMessage(s){this.responseMessage=s}getAuthCode(){return this.authCode}setAuthCode(s){this.authCode=s}setAddressVerificationServiceStreetAddress(s){this.addressVerificationServiceStreetAddress=s}getAddressVerificationServiceStreetAddress(){return this.addressVerificationServiceStreetAddress}setAddressVerificationServiceZip(s){this.addressVerificationServiceZip=s}getAddressVerificationServiceZip(){return this.addressVerificationServiceZip}getCardSecurityCodeMatch(){return this.cardSecurityCodeMatch}setCardSecurityCodeMatch(s){this.cardSecurityCodeMatch=s}getCorrelationId(){return this.correlationId}setCorrelationId(s){this.correlationId=s}getRawAddressVerificationServiceResponse(){return this.rawAddressVerificationServiceResponse}setRawAddressVerificationServiceResponse(s){this.rawAddressVerificationServiceResponse=s}getRawCVV2Response(){return this.rawCVV2Response}setRawCVV2Response(s){this.rawCVV2Response=s}setInternationalAddressVerificationService(s){this.internationalAddressVerificationService=s}getInternationalAddressVerificationService(){return this.internationalAddressVerificationService}getHostCode(){return this.hostCode}setHostCode(s){this.hostCode=s}getHostCodeResponseText(){return this.hostCodeResponseText}setHostCodeResponseText(s){this.hostCodeResponseText=s}getRawBuyerAuthentication(){return this.rawBuyerAuthentication}setRawBuyerAuthentication(s){this.rawBuyerAuthentication=s}getAdditionalErrorMessage(){return this.additionalErrorMessage}setAdditionalErrorMessage(s){this.additionalErrorMessage=s}getPaymentType(){return this.paymentType}setPaymentType(s){this.paymentType=s}getAmexId(){return this.amexId}setAmexId(s){this.amexId=s}getAmexPostData(){return this.amexPostData}setAmexPostData(s){this.amexPostData=s}getCcTransactionId(){return this.ccTransactionId}setCcTransactionId(s){this.ccTransactionId=s}getCcTransactionPostData(){return this.ccTransactionPostData}setCcTransactionPostData(s){this.ccTransactionPostData=s}getAmount(){return this.amount}setAmount(s){this.amount=s}getOriginalAmount(){return this.originalAmount}setOriginalAmount(s){this.originalAmount=s}getCardType(){return this.cardType}setCardType(s){this.cardType=s}getEmailMatch(){return this.emailMatch}setEmailMatch(s){this.emailMatch=s}getPhoneMatch(){return this.phoneMatch}setPhoneMatch(s){this.phoneMatch=s}getExtraProcessorMessage(){return this.extraProcessorMessage}setExtraProcessorMessage(s){this.extraProcessorMessage=s}getTransactionTime(){return this.transactionTime}setTransactionTime(s){this.transactionTime=s}getDuplicate(){return this.duplicate}setDuplicate(s){this.duplicate=s}getDateToSettle(){return this.dateToSettle}setDateToSettle(s){this.dateToSettle=s}getPaymentAdviceCode(){return this.paymentAdviceCode}setPaymentAdviceCode(s){this.paymentAdviceCode=s}getTransactionState(){return this.transactionState}setTransactionState(s){this.transactionState=s}getEncodedNameValuePairResponseString(){return this.encodedNameValuePairResponseString}}let Fi=(()=>{const s=class{constructor(t){this.httpClient=t,this.httpOptions={headers:new ke.WM({"Content-Type":"application/json"})}}requestCreditCardPayment(t,r,n,l,p){const g=c.N.ngGtcPayflow,A=Fe.getInstance().createPayflowSaleTransaction(g,t,r,n,l);return this.requestPayflowPaymentToPayflowGatewayApi(A.getRequestToServer(),p).pipe((0,et.U)(F=>new tt(F,A)),(0,Re.K)(this.handleError))}requestAuthorizationPayment(t,r,n,l,p){console.log("in request");const g=c.N.ngGtcPayflow,A=Fe.getInstance().createPayflowAutorizationTransaction(g,t,l,r,n);return this.requestPayflowPaymentToPayflowGatewayApi(A.getRequestToServer(),p).pipe((0,et.U)(F=>(console.log("resp",F),new tt(F,A))))}requestPayflowPaymentToPayflowGatewayApi(t,r){const n=c.N.ngGtcPayflow.apiUrl+this.getUrlParameter()+"/";return this.getRequestHeaders(r),this.httpClient.post(n,t,this.httpOptions).pipe((0,Re.K)(this.handleError))}getRequestHeaders(t){return new ke.WM({"Content-Type":"text/namevalue"})}getUrlParameter(){try{return Z.s.generateRandomNumberByType(c.N.ngGtcPayflow.numberType)+""}catch{return""}}handleError(t){return 0===t.status?console.error("An error occurred:",t.error):console.error(`Backend returned code ${t.status}, body was: `,t.error),(0,we._)(()=>new Error("Something bad happened; please try again later."))}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.LFG(ke.eN))},s.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),i})();function qi(i,s){if(1&i&&(e.TgZ(0,"li",3),e._UZ(1,"img",4),e.qZA()),2&i){const a=s.$implicit;e.xp6(1),e.MGl("src","assets/images/payments/",a.img,"",e.LSH),e.s9C("alt",a.img),e.s9C("height",a.heightValue)}}let rt=(()=>{const s=class{constructor(t,r,n,l){this.purchaseRequestService=t,this.payflowService=r,this.ngWebflowService=n,this.companyParamsService=l,this.imagesCreditCard=[],this.termsCondictios=!1,this.onErrorPayment=new e.vpe,this.setProcessStatus=new e.vpe,this.eventCLicFlagTerms=new e.vpe,this.cabinWasReservedOrHttpError=ne
1w e.vpe,this.successPaymentRequest=new e.vpe,this.errorTextPaymentResponse="",this.errorTextPaymentAttempts="",this.paymentOptions=new e.vpe,this.isLoading=new e.vpe,this.failedAttempts=new e.vpe,this.locked=!1,this.attempts=0,this.isOpenModal=!1,this.iconsCreditCard=[],this.comment1="",this.comment2="",this.amount=0,this.reference="",this.urlPrivacy="",this.isShowErrorMessageInForm=!1,this.isShowErrorMessageInFormChange=new e.vpe,this.isShowPaymentErrorMessageInForm=!1,this.isRequestingPayment=!1,this.isLoadingRequestingPayment=!1,this.messageErrorAudit="",this.messageCreditCardError="",this.isThereCreditCardError=!1,this.email=this.companyParamsService.getInfoEmail()}ngOnInit(){this.comment1=this.purchaseRequestService.getPurchaseDescriptor(),this.urlPrivacy=this.companyParamsService.getPrivacy(),this.amount=this.purchaseRequestService.getTotalPrice(),this.generatePaymentUniqueReference()}load(){this.errorTextPaymentResponse="",this.isThereCreditCardError=!1,this.messageCreditCardError="",this.setProcessStatus.emit(!0),this.isLoadingRequestingPayment=!0,this.isRequestingPayment=!0,this.isLoading.emit(!0),this.isShowErrorMessageInForm=!1,this.isShowPaymentErrorMessageInForm=!1,this.purchaseRequestService.setErrorPayment(this.errorTextPaymentResponse),this.isShowErrorMessageInFormChange.emit(this.isShowErrorMessageInForm)}getMessageErrorAudit(t){return"Transaction with the ID "+t.getId()+". Error Number: "+t.getStatus()+". Message: "+t.getResponseMessage()+". Contact Us:"+this.companyParamsService.getInfoEmail()}formatCreditCardData(t){t.creditCardNumber=t.creditCardNumber.replace(/\s/g,"");const{month:r,year:n}=le.parseCardExpiry(t.expirationDate);return t.expirationMonth=r,t.expirationYear=n,t}submit(t){var r=this;return(0,T.Z)(function*(){r.paymentOptions.emit(de.CREDIT_CARD);try{let n;r.load(),r.amount=r.purchaseRequestService.getTotalPrice(),t=r.formatCreditCardData(t);const l=new re(t);yield r.setTransactionCode(),r.payflowService.requestAuthorizationPayment(l,r.comment1,r.comment2,r.amount,r.reference).subscribe(function(){var p=(0,T.Z)(function*(g){if(r.purchaseRequestService.setTrackingCode(g.getId()),n=g,g.isError())return r.failedAttempts.emit(r.attempts++),r.messageErrorAudit=r.getMessageErrorAudit(g),r.errorTextPaymentResponse=r.getMessageErrorCustom(g),r.purchaseRequestService.setErrorPayment(r.errorTextPaymentResponse),r.ngWebflowService.addWebFlowAction(y.B.REQUEST_CREDITCARD_PAYMENT_ERROR,{error:r.messageErrorAudit}),r.isRequestingPayment=!1,r.isLoading.emit(!1),r.isLoadingRequestingPayment=!1,r.isShowErrorMessageInForm=!0,r.isShowErrorMessageInFormChange.emit(r.isShowErrorMessageInForm),r.isShowPaymentErrorMessageInForm=!0,r.cabinWasReservedOrHttpError.emit(ne.HTTP_ERROR),r.ngWebflowService.addWebFlowAction(y.B.BOOKING_FAILED,{message:"booking failed"}),r.onErrorPayment.emit(r.errorTextPaymentResponse),(0,we._)(new Error(r.messageErrorAudit));{const x=yield r.purchaseRequestService.requestBlockCabinOnHold(r.purchaseRequestService.getPercentUsed()).toPromise();return!1===(!0===r.purchaseRequestService.setBlockDeparture(x)&&r.purchaseRequestService.isRequestBlockDepartureSuccess())?(r.changeVisible(),r.isRequestingPayment=!1,r.isLoading.emit(!1),r.isLoadingRequestingPayment=!1,r.setProcessStatus.emit(!1),r.cabinWasReservedOrHttpError.emit(ne.RESERVED_ERROR),r.ngWebflowService.addWebFlowAction(y.B.BOOKING_FAILED,{message:"booking failed"}),new Error("Block Cabin falied")):(r.isRequestingPayment=!1,r.isLoading.emit(!1),r.isLoadingRequestingPayment=!1,r.successPaymentRequest.emit(),"ok")}});return function(g){return p.apply(this,arguments)}}()),(0,Re.K)(p=>(0,ai.of)(p))}catch(n){r.isLoadingRequestingPayment=!0,r.setProcessStatus.emit(!1),r.messageCreditCardError=n.message,r.isThereCreditCardError=!0}})()}setTransactionCode(){var t=this;return(0,T.Z)(function*(){try{const r=yield t.purchaseRequestService.requestStatusAvailability(t.purchaseRequestService.getPercentUsed()).toPromise();t.purchaseRequestService.setValueTransaction(r.message)}catch(r){t.onErrorPayment.emit(r),t.setProcessStatus.emit(!1)}})()}requestCreditCardPayment(t){try{return this.payflowService.requestAuthorizationPayment(t,this.comment1,this.comment2,this.amount,this.reference)}catch(r){return console.log("CreditCardFormComponent.requestCreditCardPayment()"),console.error(r),(0,we._)(r)}}generatePaymentUniqueReference(){const r=Date.now(),n=Math.round(this.amount),l=this.purchaseRequestService.getCruiseWrapper().getCurrentItinerary().code,p=this.purchaseRequestService.getPurchaseContactPerson()?.email;this.reference=(""+r+n+l+p).substring(0,32)}changeVisible(){this.isOpenModal=!1}flagClic(){this.eventCLicFlagTerms.emit(!0),this.termsCondictios&&(this.isOpenModal=!0)}getMessageErrorCustom(t){let r=t.getResponseMessage();const n=Zi;if(n.length>0)for(let l=0;l<n.length;l++)if(r.includes(n[l].errorText))return n[l].errorTextCustom;return r}getErrorTextPaymentResponse(t,r){return`Booking Failed: Your booking could not be completed due to an error with your payment method (${t}).\n    Your transaction has not been charged. We recommend you try a different payment method or Contact Us at (${r}) `}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(O.v),e.Y36(Fi),e.Y36(q.k7),e.Y36(R.N))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-credit-card-api"]],inputs:{imagesCreditCard:"imagesCreditCard",termsCondictios:"termsCondictios",errorTextPaymentResponse:"errorTextPaymentResponse",errorTextPaymentAttempts:"errorTextPaymentAttempts",locked:"locked",isShowErrorMessageInForm:"isShowErrorMessageInForm"},outputs:{onErrorPayment:"onErrorPayment",setProcessStatus:"setProcessStatus",eventCLicFlagTerms:"eventCLicFlagTerms",cabinWasReservedOrHttpError:"cabinWasReservedOrHttpError",successPaymentRequest:"successPaymentRequest",paymentOptions:"paymentOptions",isLoading:"isLoading",failedAttempts:"failedAttempts",isShowErrorMessageInFormChange:"isShowErrorMessageInFormChange"},standalone:!0,features:[e.jDz],decls:4,vars:8,consts:[["class","d-inline-block",4,"ngFor","ngForOf"],[1,"modal-body"],[3,"loading","isShowErrorMessageInForm","isShowPaymentErrorMessageInForm","errorTextPaymentResponse","attempts","locked","errorTextPaymentAttempts","submitEvent"],[1,"d-inline-block"],[1,"mr-2","mt-2",3,"src","alt","height"]],template:function(r,n){1&r&&(e.TgZ(0,"ul"),e.YNc(1,qi,2,3,"li",0),e.qZA(),e.TgZ(2,"div",1)(3,"app-credit-card",2),e.NdJ("submitEvent",function(p){return n.submit(p)}),e.qZA()()),2&r&&(e.xp6(1),e.Q6J("ngForOf",n.imagesCreditCard),e.xp6(2),e.Q6J("loading",n.isRequestingPayment)("isShowErrorMessageInForm",n.isShowErrorMessageInForm)("isShowPaymentErrorMessageInForm",n.isShowPaymentErrorMessageInForm)("errorTextPaymentResponse",n.getErrorTextPaymentResponse(n.errorTextPaymentResponse,n.email))("attempts",n.attempts)("locked",n.locked)("errorTextPaymentAttempts",n.errorTextPaymentAttempts))},dependencies:[Xe,o.ez,o.sg],styles:[".lib-container[_ngcontent-%COMP%]{overflow-y:scroll;height:600px;padding:20px}"]}),i})();const Ni=["payPalButtonContainer"];let it=(()=>{class i{constructor(a){this.zone=a}registerScript(a,t,r){const n=window[t];if(n)return void this.zone.run(()=>{r(n)});const l=document.createElement("script");
1l.id=this.getElemId(t),l.innerHTML="",l.onload=()=>{this.zone.run(()=>{r(window[t])})},l.src=a,l.async=!0,l.defer=!0,document.getElementsByTagName("head")[0].appendChild(l)}cleanup(a){const t=document.getElementById(this.getElemId(a));t&&t.remove()}getElemId(a){return`ngx-paypal-script-elem-${a}`}}return i.\u0275fac=function(a){return new(a||i)(e.LFG(e.R0b))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i})(),at=(()=>{class i{constructor(a){this.scriptService=a,this.paypalWindowName="paypal"}registerPayPalScript(a,t){this.scriptService.registerScript(this.getUrlForConfig(a),this.paypalWindowName,t)}destroyPayPalScript(){this.scriptService.cleanup(this.paypalWindowName)}getUrlForConfig(a){const t=[{name:"client-id",value:a.clientId}];return a.locale&&t.push({name:"locale",value:a.locale}),a.currency&&t.push({name:"currency",value:a.currency}),a.commit&&t.push({name:"commit",value:a.commit}),a.vault&&t.push({name:"vault",value:a.vault}),a.intent&&t.push({name:"intent",value:a.intent}),a.funding&&t.push({name:"components",value:"buttons,funding-eligibility"}),a.extraParams&&t.push(...a.extraParams),`https://www.paypal.com/sdk/js${this.getQueryString(t)}`}getQueryString(a){let t="";for(let r=0;r<a.length;r++){const n=a[r];t+=0===r?"?":"&",t+=`${n.name}=${n.value}`}return t}}return i.\u0275fac=function(a){return new(a||i)(e.LFG(it))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i})(),Ei=(()=>{class i{constructor(a,t,r){this.paypalScriptService=a,this.cdr=t,this.ngZone=r,this.registerScript=!0,this.scriptLoaded=new e.vpe,this.ngUnsubscribe=new z.x,this.initializePayPal=!0}set payPalButtonContainer(a){this.payPalButtonContainerElem=a}ngOnChanges(a){this.payPalButtonContainerId||(this.payPalButtonContainerId=this.generateElementId());const t=this.config;a.config.isFirstChange()&&t&&this.registerScript&&this.initPayPalScript(t,r=>{this.payPal=r,this.doPayPalCheck()}),a.config.isFirstChange()||this.reinitialize(t)}ngOnDestroy(){this.paypalScriptService.destroyPayPalScript(),this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}ngAfterViewInit(){this.doPayPalCheck()}customInit(a){this.payPal=a,this.doPayPalCheck()}reinitialize(a){if(this.config=a,this.payPal=void 0,this.paypalScriptService.destroyPayPalScript(),this.payPalButtonContainerId=this.generateElementId(),this.initializePayPal=!0,this.payPalButtonContainerElem)try{for(;this.payPalButtonContainerElem.nativeElement.firstChild;)this.payPalButtonContainerElem.nativeElement.removeChild(this.payPalButtonContainerElem.nativeElement.firstChild)}catch(t){console.error(t)}this.cdr.detectChanges(),this.config&&(this.payPal?this.doPayPalCheck():this.initPayPalScript(this.config,t=>{this.payPal=t,this.doPayPalCheck()}))}doPayPalCheck(){this.initializePayPal&&this.config&&this.payPal&&this.payPalButtonContainerElem&&this.payPalButtonContainerElem.nativeElement.id&&(this.initializePayPal=!1,this.initPayPal(this.config,this.payPal))}initPayPalScript(a,t){this.paypalScriptService.registerPayPalScript({clientId:a.clientId,locale:a.advanced?.locale,commit:a.advanced&&a.advanced.commit?a.advanced.commit:void 0,currency:a.currency,vault:a.vault,intent:a.intent,funding:null!=a.fundingSource||null!=a.fundingSource,extraParams:a.advanced&&a.advanced.extraQueryParams?a.advanced.extraQueryParams:[]},r=>{this.scriptLoaded.next(r),t(r)})}generateElementId(){return`ngx-captcha-id-${this.generateGuid()}`}initPayPal(a,t){this.ngZone.runOutsideAngular(()=>{const p={style:a.style,fundingSource:void 0,onApprove:(x,A)=>this.ngZone.run(()=>{if(a.onApprove&&a.onApprove(x,A),a.authorizeOnServer)return a.authorizeOnServer(x,A);const F=a.onClientAuthorization;F&&A.order.capture().then(M=>{this.ngZone.run(()=>{F(M)})})}),onError:x=>{this.ngZone.run(()=>{a.onError&&a.onError(x)})},onCancel:(x,A)=>{this.ngZone.run(()=>{a.onCancel&&a.onCancel(x,A)})},onClick:(x,A)=>{this.ngZone.run(()=>{a.onClick&&a.onClick(x,A)})},onInit:(x,A)=>{this.ngZone.run(()=>{a.onInit&&a.onInit(x,A)})},...(a.createOrderOnClient||a.createOrderOnServer)&&{createOrder:(x,A)=>this.ngZone.run(()=>{if(a.createOrderOnClient&&a.createOrderOnServer)throw Error("Both 'createOrderOnClient' and 'createOrderOnServer' are defined.\n                    Please choose one or the other.");if(!a.createOrderOnClient&&!a.createOrderOnServer)throw Error("Neither 'createOrderOnClient' or 'createOrderOnServer' are defined.\n                    Please define one of these to create order.");if(a.createOrderOnClient)return A.order.create(a.createOrderOnClient(x));if(a.createOrderOnServer)return a.createOrderOnServer(x);throw Error("Invalid state for 'createOrder'.")})},...a.createSubscriptionOnClient&&{createSubscription:(x,A)=>this.ngZone.run(()=>
1{if(a.createSubscriptionOnClient)return A.subscription.create(a.createSubscriptionOnClient(x))})},...a.onShippingChange&&{onShippingChange:(x,A)=>this.ngZone.run(()=>{if(a.onShippingChange)return a.onShippingChange(x,A)})}};let g;switch(a.fundingSource){case"PAYPAL":g=t.FUNDING.PAYPAL;break;case"CARD":g=t.FUNDING.CARD;break;case"PAYLATER":g=t.FUNDING.PAYLATER;break;case"CREDIT":g=t.FUNDING.CREDIT;break;case"VENMO":g=t.FUNDING.VENMO}null!=g&&(p.fundingSource=g,"PAYPAL"!==a.fundingSource&&delete p.style?.color),t.Buttons(p).render(`#${this.payPalButtonContainerId}`)})}generateGuid(){let a=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=16*Math.random();return a>0?(n=(a+n)%16|0,a=Math.floor(a/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"==r?n:7&n|8).toString(16)})}}return i.\u0275fac=function(a){return new(a||i)(e.Y36(at),e.Y36(e.sBO),e.Y36(e.R0b))},i.\u0275cmp=e.Xpm({type:i,selectors:[["ngx-paypal"]],viewQuery:function(a,t){if(1&a&&e.Gf(Ni,5),2&a){let r;e.iGM(r=e.CRH())&&(t.payPalButtonContainer=r.first)}},inputs:{config:"config",registerScript:"registerScript"},outputs:{scriptLoaded:"scriptLoaded"},features:[e.TTD],decls:2,vars:1,consts:[[3,"id"],["payPalButtonContainer",""]],template:function(a,t){1&a&&e._UZ(0,"div",0,1),2&a&&e.Q6J("id",t.payPalButtonContainerId)},encapsulation:2,changeDetection:0}),i})(),Ui=(()=>{class i{}return i.\u0275fac=function(a){return new(a||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({providers:[it,at],imports:[o.ez]}),i})(),Oi=(()=>{const s=class{constructor(t,r){this.purchaseRequestService=t,this.companyParamsService=r,this.showSuccess=!1,this.isSelectedThirtyPercent=!1,this.clientId="",this.purchaseTotalPrice=999999,this.onCancelPayment=new e.vpe,this.onErrorPayment=new e.vpe,this.setProcessStatus=new e.vpe,this.cabinWasReservedOrHttpError=new e.vpe,this.successPaymentRequest=new e.vpe,this.paymentOptions=new e.vpe}ngOnInit(){this.clientId=c.N.production?this.companyParamsService.getPayPalInfo().clientProductionToken:this.companyParamsService.getPayPalInfo().clientSandboxToken,this.initConfig()}ngOnChanges(t){this.initConfig()}initConfig(){var t=this;const r=this.purchaseRequestService.getIsSelectedThirtyPerent()?this.purchaseRequestService.getPaypalItemsApiWithThirtyPercent(this.purchaseTotalPrice):this.purchaseRequestService.getPaypalItemsApi();var n;this.payPalConfig={currency:c.N.PAYPAL_EXPRESS_CHECKOUT_CONFIG.CURRENCY,clientId:this.clientId,createOrderOnClient:n=>({intent:c.N.PAYPAL_EXPRESS_CHECKOUT_CONFIG.REQUEST_INTENT,purchase_units:[{amount:{currency_code:c.N.PAYPAL_EXPRESS_CHECKOUT_CONFIG.CURRENCY,value:this.purchaseTotalPrice?.toString(),breakdown:{item_total:{currency_code:c.N.PAYPAL_EXPRESS_CHECKOUT_CONFIG.CURRENCY,value:this.purchaseTotalPrice?.toString()}}},items:r}]}),advanced:{commit:"true"},style:this.getPayPalButtonStyleObject(!1),onApprove:(n=(0,T.Z)(function*(l,p){t.setProcessStatus.emit(!0);try{t.paymentOptions.emit(de.PAYPAL),yield t.setTransactionCode();const g=yield t.purchaseRequestService.requestBlockCabinOnHold(t.purchaseRequestService.getPercentUsed()).toPromise();if(!1===(!0===t.purchaseRequestService.setBlockDeparture(g)&&t.purchaseRequestService.isRequestBlockDepartureSuccess()))return t.cabinWasReservedOrHttpError.emit(ne.RESERVED_ERROR),new Error("Block Cabin falied");{const F=yield p.order.capture();return t.purchaseRequestService.setTrackingCode(F.id),t.successPaymentRequest.emit(),"ok"}}catch{return t.cabinWasReservedOrHttpError.emit(ne.HTTP_ERROR),"error"}}),function(p,g){return n.apply(this,arguments)}),onCancel:(n,l)=>{this.onCancelPayment.emit(n),this.setProcessStatus.emit(!1)},onError:n=>{this.onErrorPayment.emit(n),this.setProcessStatus.emit(!1)},onClick:(n,l)=>{}}}setTransactionCode(){var t=this;return(0,T.Z)(function*(){try{const r=yield t.purchaseRequestService.requestStatusAvailability(t.purchaseRequestService.getPercentUsed()).toPromise();t.purchaseRequestService.setValueTransaction(r.message)}catch(r){t.onErrorPayment.emit(r),t.setProcessStatus.emit(!1)}})()}getPayPalButtonStyleObject(t){return{fundingicons:t,shape:"rect",label:"paypal",tagline:!1,layout:"horizontal"}}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(O.v),e.Y36(R.N))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-paypal-api"]],inputs:{purchaseTotalPrice:"purchaseTotalPrice"},outputs:{onCancelPayment:"onCancelPayment",onErrorPayment:"onErrorPayment",setProcessStatus:"setProcessStatus",cabinWasReservedOrHttpError:"cabinWasReservedOrHttpError",successPaymentRequest:"successPaymentRequest",paymentOptions:"paymentOptions"},features:[e.TTD],decls:1,vars:1,consts:[[3,"config"]],template:function(r,n){1&r&&e._UZ(0,"ngx-paypal",0),2&r&&e.Q6J("config",n.payPalConfig)},dependencies:[Ei]}),i})();const nt=function(){return{maximumFractionDigits:2}};function wi(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",4)(1,"div",5)(2,"div",4)(3,"div",6)(4,"label",7)(5,"input",8),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.selectThirtyPercent())}),e.qZA()(),e._uU(6," Send full amount now "),e.qZA(),e.TgZ(7,"div",9)(8,"h3",10),e._uU(9),e.qZA()()()(),e.TgZ(10,"div",5)(11,"div",4)(12,"div",11)(13,"label",7)(14,"input",8),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.selectThirtyPercent())}),e.qZA()(),e._uU(15),e.qZA(),e.TgZ(16,"div",12)(17,"h3",10),e._uU(18),e.qZA()()()()()}if(2&i){const a=e.oxw();e.xp6(5),e.Q6J("checked",!a.isSelectedThirtyPercent),e.xp6(4),e.hij("US$ ",null==a.allValuePrice?null:a.allValuePrice.toLocaleStr
1ing("en",e.DdM(5,nt)),""),e.xp6(5),e.Q6J("checked",a.isSelectedThirtyPercent),e.xp6(1),e.hij(" Reserve with a ",a.percentPartialPaymentValue,"% deposit only "),e.xp6(3),e.hij("US$ ",null==a.onlyThirtyPrice?null:a.onlyThirtyPrice.toLocaleString("en",e.DdM(6,nt))," ")}}function Ri(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",14)(1,"div",15)(2,"p")(3,"strong"),e._uU(4,"We are almost there! "),e.qZA()(),e.TgZ(5,"p"),e._uU(6,"Given that your cruise will take place within the next 72 hours, one of our Travel Advisors will contact you as soon as possible via e-mail to arrange your payment method and confirm your tour. "),e.qZA(),e.TgZ(7,"p"),e._uU(8,"Thank you for contacting us."),e.qZA()(),e.TgZ(9,"p",16)(10,"a",17),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.goToSearchResults())}),e._UZ(11,"i",18),e._uU(12," Back to search results here"),e.qZA()()()}}function Mi(i,s){if(1&i&&(e.TgZ(0,"div",4),e.YNc(1,Ri,13,0,"div",13),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.Q6J("ngIf",!1===a.isAutoPaymentAccepted)}}function ki(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",14),e._UZ(1,"app-credit-card-error-payment",19),e.TgZ(2,"p",16)(3,"a",17),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.goToSearchResults())}),e._UZ(4,"i",18),e._uU(5," Back to search results here"),e.qZA()()()}if(2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("visible",!0)("errorHeader",a.errorTransactionTitle)("errorText",a.errorTransaction)}}function Di(i,s){if(1&i&&(e.TgZ(0,"div",4),e.YNc(1,ki,6,3,"div",13),e.qZA()),2&i){const a=e.oxw();e.xp6(1),e.Q6J("ngIf",!a.isBlockDepartureSuccess)}}function Li(i,s){1&i&&e._UZ(0,"i",37)}function Bi(i,s){1&i&&e._UZ(0,"i",38)}function Yi(i,s){1&i&&e._UZ(0,"i",39)}function Ji(i,s){if(1&i&&(e.TgZ(0,"a",40),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.s9C("href",a.linkInfo,e.LSH),e.xp6(1),e.hij("",a.linkInfo," ")}}function Wi(i,s){if(1&i&&e._UZ(0,"img",42),2&i){const a=s.$implicit;e.MGl("src","assets/images/payments/",a.img,"",e.LSH),e.s9C("alt",a.img),e.s9C("height",a.heightValue)}}function Vi(i,s){if(1&i&&(e.ynx(0),e.YNc(1,Wi,1,3,"img",41),e.BQk()),2&i){const a=e.oxw().index,t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.getImagesByType(a))}}function Qi(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"app-credit-card-api",43),e.NdJ("isShowErrorMessageInFormChange",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.isShowErrorMessageInFormChange(r))})("eventCLicFlagTerms",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.flagClick=!0)})("setProcessStatus",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.setProcessing(r))})("cabinWasReservedOrHttpError",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.cabinWasReservedOrHttpError(r))})("successPaymentRequest",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.sendEmailConfirmationEvent(r))})("onErrorPayment",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.paymentErrorCreditCard(r))})("isLoading",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.setLoading(r))})("failedAttempts",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.failedAttempts(r))})("paymentOptions",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.paymentOptions(r))}),e.qZA(),e.BQk()}if(2&i){const a=e.oxw().index,t=e.oxw(2);e.xp6(1),e.Q6J("imagesCreditCard",t.getImagesByType(a))("termsCondictios",t.termsCondition)("isShowErrorMessageInForm",!0===t.isAutoPaymentAccepted&&void 0!==t.isBlockDepartureSuccess&&!t.isBlockDepartureSuccess)("locked",t.isPaymentAttempt)("errorTextPaymentAttempts",t.errorTextPaymentAttempts)}}const Gi=function(i){return{"pointer-events":i}};function Hi(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",44)(1,"app-paypal-api",45),e.NdJ("setProcessStatus",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.setProcessing(r))})("cabinWasReservedOrHttpError",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.cabinWasReservedOrHttpError(r))})("successPaymentRequest",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.sendEmailConfirmationEvent(r))})("onCancelPayment",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.paymentCanceled(r))})("paymentOptions",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.paymentOptions(r))})("onErrorPayment",function(r){e.CHM(a);const n=e.oxw(3);return e.KtG(n.paymentError(r))}),e.qZA()()}if(2&i){const a=e.oxw(3);e.Q6J("ngStyle",e.VKq(2,Gi,a.termsCondition?"all":"none")),e.xp6(1),e.Q6J("purchaseTotalPrice",a.purchaseTotalPrice)}}function ji(i,s){1&i&&(e.TgZ(0,"div",50),e._uU(1,"To continue you must agree to our Terms and Conditions."),e.qZA())}function Ki(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",4)(2,"div",14)(3,"p"),e._uU(4,"To proceed, please agree to our "),e.TgZ(5,"a",46)(6,"u"),e._uU(7,"Terms & Conditions"),e.qZA()(),e._uU(8,"."),e.qZA(),e.TgZ(9,"label",47)(10,"input",48),e.NdJ("change",function(r){e.CHM(a);const n=e.oxw().$implicit,l=e.oxw(2);return e.KtG(l.changeTermsPayTransfer(r.target,n.type))}),e.qZA(),e._uU(11," I agree to the Terms & Conditions."),e.qZA()(),e.TgZ(12,"div",14),e.YNc(13,ji,2,0,"div",49),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw(3);e.xp6(5),e.Q6J("href",null==a.companyData?null:a.companyData.privacyUrl,e.LSH),e.xp6(
15),e.Q6J("checked",a.termsCondition),e.xp6(3),e.Q6J("ngIf",!a.termsCondition&&a.flagClick)}}function $i(i,s){1&i&&e._UZ(0,"span",54)}function zi(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Please Wait"),e.qZA())}function Xi(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Accept"),e.qZA())}function ea(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",4)(1,"div",51),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.flagClick=!0)}),e.TgZ(2,"button",52),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(3);return e.KtG(r.blockCabinNewjson())}),e.YNc(3,$i,1,0,"span",53),e._uU(4,"\xa0"),e.YNc(5,zi,2,0,"span",2),e.YNc(6,Xi,2,0,"span",2),e.qZA()()()}if(2&i){const a=e.oxw(3);e.xp6(2),e.Q6J("disabled",!a.termsCondition||a.loading),e.xp6(1),e.Q6J("ngIf",a.loading),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading)}}function ta(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",22)(1,"div",23)(2,"a",24),e.NdJ("click",function(){const n=e.CHM(a).index,l=e.oxw(2);return e.KtG(l.changePaymentMethod(n))}),e._uU(3,"Select "),e._UZ(4,"i",25),e.qZA(),e.TgZ(5,"h3",26)(6,"container-element",27),e.YNc(7,Li,1,0,"i",28),e.YNc(8,Bi,1,0,"i",29),e.YNc(9,Yi,1,0,"i",30),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"div",31)(12,"div",32),e.ynx(13),e.TgZ(14,"p"),e._uU(15),e.qZA(),e.YNc(16,Ji,2,2,"a",33),e.BQk(),e.TgZ(17,"div",4)(18,"div",34),e.YNc(19,Vi,2,1,"ng-container",2),e.qZA()(),e.YNc(20,Qi,2,5,"ng-container",2),e.TgZ(21,"div",35),e.NdJ("click",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.flagClick=!0)}),e.YNc(22,Hi,2,4,"div",36),e.qZA(),e.YNc(23,Ki,14,3,"ng-container",2),e.YNc(24,ea,7,4,"div",1),e.qZA()()()}if(2&i){const a=s.$implicit,t=s.index,r=e.oxw(2);e.xp6(6),e.Q6J("ngSwitch",a.type),e.xp6(1),e.Q6J("ngSwitchCase",r.paymentMethodTypeEnum.PAYPAL_CHECKOUT),e.xp6(1),e.Q6J("ngSwitchCase",r.paymentMethodTypeEnum.CREDIT_CARD_ONLINE),e.xp6(2),e.hij(" ",a.name," "),e.xp6(1),e.Q6J("id",t)("@collapse",!a.selected),e.xp6(4),e.hij(" ",a.description," "),e.xp6(1),e.Q6J("ngIf",a.linkInfo),e.xp6(3),e.Q6J("ngIf",a.type!=r.paymentMethodTypeEnum.CREDIT_CARD_ONLINE),e.xp6(1),e.Q6J("ngIf",a.type===r.paymentMethodTypeEnum.CREDIT_CARD_ONLINE),e.xp6(2),e.Q6J("ngIf",a.type===r.paymentMethodTypeEnum.PAYPAL_CHECKOUT),e.xp6(1),e.Q6J("ngIf",a.type!==r.paymentMethodTypeEnum.CREDIT_CARD_ONLINE),e.xp6(1),e.Q6J("ngIf",null==(null==a?null:a.objectConfiguration)&&a.type!==r.paymentMethodTypeEnum.CREDIT_CARD_ONLINE)}}function ra(i,s){if(1&i&&(e.ynx(0),e.TgZ(1,"p"),e._uU(2,"Please choose your payment method:"),e.qZA(),e.TgZ(3,"div",20),e.YNc(4,ta,25,13,"div",21),e.qZA(),e.BQk()),2&i){const a=e.oxw();e.xp6(4),e.Q6J("ngForOf",a.paymentMethods)}}function ia(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",55)(1,"div",56)(2,"a",57),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.goBack())}),e._UZ(3,"i",18),e._uU(4," Back"),e.qZA(),e._UZ(5,"br"),e.qZA()()}}let aa=(()=>{const s=class{constructor(t,r,n,l,p,g,x,A,F,M,ae){this.router=t,this.paymentsTypeService=r,this.purchaseRequestService=n,this.companyParamsService=l,this.contactFormService=p,this.httpRequestService=g,this.ngWebflowService=x,this.cruiseService=A,this.searcherFiltersService=F,this.location=M,this.companyService=ae,this.isAutoPaymentAccepted=!1,this.termsCondition=!1,this.valueTerms="none",this.EXCEDED_VALUE=1e5,this.purchaseTotalPrice=this.EXCEDED_VALUE,this.isPaymentComplete=!1,this.isPaymentCancel=!1,this.isPaymentError=!1,this.isProcessing=!1,this.loading=!1,this.paymentMethodTypeEnum=te.G,this.minDepartureTimeToEnableAutoPayment=0,this.minDepartureTimeToEnableThirtyPercent=0,this.paymentType=Pe,this.comment1="",this.isRequestingBlockDeparture=!1,this.hasThirtyPercent=!1,this.isSelectedThirtyPercent=!1,this.allValuePrice=0,this.onlyThirtyPrice=0,this.flagClick=!1,this.percentPartialPaymentValue=0,this.paymentMethods=[],this.successStripe=!1,this.failureStripe=!1,this.counterSuccessAutomaticEmail=0,this.openCreditCardModal=!1,this.isInquireSent=!1,this.errorTransactionTitle="Oops! Something went wrong!",this.errorTransaction="",this.collapsed=!1,this.cruiseWrapper=new Ke.S(this.cruiseService.getCruiseSelected()),this.errorText="",this.errorTextPaymentAttempts="",this.isPaymentAttempt=!1,this.totalPaymentAttempt=1,this.paymentOption=de.CASH,this.isPaymentErrorCreditCard=!1,this.isBlockDepartureSuccess=!0,this.generateUrl()}ngOnInit(){this.paymentMethods=this.companyParamsService.getPaymentMethods(),this.initPaymentMethod(),this.isAutoPaymentAccepted=this.purchaseRequestService.isAutoPaymentAccepted(),this.companyData=this.companyParamsService.getCompanyParams(),this.minDepartureTimeToEnableAutoPayment=c.N.PURCHASE.MIN_TIME_TO_ENABLE_AUTOPAYMENT,this.minDepartureTimeToEnableThirtyPercent=c.N.PURCHASE.MIN_TIME_TO_ENABLE_THIRTYPERCENT,this.allValuePrice=this.purchaseRequestService.getTotalPrice(),this.percentPartialPaymentValue=this.companyParamsService.company.percentPartialPayment,this.allValuePrice&&(this.onlyThirtyPrice=Math.round(this.allValuePrice*this.companyParamsService.company.percentPartialPayment/100)),this.isOnTimeToPay(),this.paymentErrorCreditCardAttempt(),this.errorTransaction="Booking failed: The selected cabin is no longer available. Your payment for this transaction has not been charged. We recommend you choose another cabin, restart your search, or Contact Us at ("+this.companyData.infoEmail+")"}initPaymentMethod(){this.paymentMethod={},this.paymentMethod.paypal=!1,this.paymentMethod.creditCard=!1,this.paymentMethod.transfer=!1,this.paymentMethods.forEach(t=>{t.selected=!1}),this.purchaseTotalPrice=this.purchaseRequestService.getTotalPrice(),this.purchaseRequestService.setPaymentMethod(this.paymentMethod),this.purchaseRequestService.setIsSelectedThirtyPerent(!1)}isOnTimeToPay(){try{this.httpRequestService.requestPost(ri.A.DATE,{}).subscribe(t=>{const r=new Date(this.purchaseRequestService.getCruiseWrapper().getCurrentItinerary().startDate),n=Number(r.getTime())-Number(t),l=ee.F.millisecondsToHours(n),p=ee.F.millisecondsToDays(n);this.hasThirtyPercent=!(p<this.minDepartureTimeToEnableThirtyPercent),l<this.minDepartureTimeToEnableAutoPayment?(this.isAutoPaymentAccepted=!1,this.sendEmail()):this.isAutoPaymentAccepted=!0},t=>{console.error(t),this.isAutoPaymentAccepted=!1},()=>{})}catch(t){console.error(t),this.isAutoPaymentAccepted=!1}}fillRequestDatatoInquire(t){const r=this.searcherFiltersService.getSearchRequestObj().categoriesArray;return{emailReceptor:this.companyParamsService.company.emailEcommerce,subject:"New Request",inquireDTO:{company:"E-COMMERCE-CTG",boat:t?.cruise?.name,promotion:t?.cruise?.availability[t?.cruise?.iterIndex].promotion,startDate:t?.cruise?.availability[t?.cruise?.iterIndex].startDate.toString().substring(0,t?.cruise?.availability[t?.cruise?.iterIndex].startDate.toString().length-11),endDate:t?.cruise?.availability[t?.cruise?.iterIndex].endDate.toString().substring(0,t?.cruise?.availability[t?.cruise?.iterIndex].endDate.toString().length-11),days:t?.cruise?.availability[t?.cruise?.iterIndex].length,opcDays:t?.cruise?.availability[t.cruise.iterIndex].name,adults:this.searcherFiltersService.getSearchRequestObj().adults,childs:this.searcherFiltersService.getSearchRequestObj().children,commnets:"Given that your cruise will take place within the next 72 hours",interestFlights:!0,interestAmazon:!0,interestPeru:!0,interestEcuador:!0,lastName:t.purchaseContactPerson?.lastName,firstName:t.purchaseContactPerson?.firstName,email:t.purchaseContactPerson?.email,phone:t.purchaseContactPerson?.phone,charterOnly:t.cruise?.availability[t.cruise?.iterIndex].charterOnly,groupsOnly:t.cruise?.availability[t.cruise?.iterIndex].groupsOnly,country:"",interestPromos:!1,category:this.getCategory(t?.cruise?.category?t?.cruise?.category:0),type:t.cruise?.type,otherValue:t.purchaseContactPerson?.valueOther,howFindUs:t.purchaseContactPerson?.howFindUs,pricePerson:this.cruiseService.calculatePriceWithPackage(t.cruise?.availability[t.cruise?.iterIndex].promotionPrice?t.cruise?.availability[t.cruise?.iterIndex].promotionPrice:this.EXCEDED_VALUE,t.cruise?.availability[t.cruise?.iterIndex].percents,t.cruise?.availability[t.cruise?.iterIndex].packageCode,this.getIsitIncludedAirTickets())},company:{logoCompany:this.companyParamsService.company.logo,nameCompany:this.companyParamsService.company.nameRequest,mainColorCompany:this.companyParamsService.getMainColor(),secondaryColorCompany:this.companyParamsService.getSecundaryColor(),headerColorCompany:this.companyParamsService.getHeaderColor(),footerColorCompany:this.companyParamsService.getFooterColor(),infoMailCompany:this.companyParamsService.getInfoEmail(),phoneCompany:this.companyParamsService.getPhone(),webSiteCompany:this.companyParamsService.getWebSite()},amenities:this.searcherFiltersService.getSearchRequestObj().amenities,categories:0===r?.length?["All"]:this.getCategoryArray(this.searcherFiltersService.getSearchRequestObj().categoriesArray||[]),priceFrom:0===this.searcherFiltersService.getSearchRequestObj().priceFrom?"All":this.searcherFiltersService.getSearchRequestObj().priceFrom,priceTo:0===this.searcherFiltersService.getSearchRequestObj().priceTo?"All":this.searcherFiltersService.getSearchRequestObj().priceTo,month:0,year:0,aditionalServicesList:t.cruise?.availability[t.cruise?.iterIndex].aditionalServices,keyCompany:this.companyParamsService.keyCompany}}sendEmail(){const t=this.purchaseRequestService.purchase,r={};r.name=t.purchaseContactPerson.firstName,r.email=t.purchaseContactPerson.email,r.phone=t.purchaseContactPerson.phone,r.howFindUs=t.purchaseContactPerson.howFindUs,r.valueOther=t.purchaseContactPerson.valueOther,r.message="The departure time is less than 72h.",r.purchase=t,r.codeProcess=ti.s.G_ECOM,r.itiObject=t.purchaseContactPerson.itiObject;const p=this.fillRequestDatatoInquire(this.purchaseRequestService.purchase).inquireDTO;this.contactFormService.sendForm(r).subscribe(g=>
1{this.contactFormService.isSendFormResponseSuccess(g),this.ngWebflowService.addWebFlowAction(y.B.SENDING_AUTOMATIC_LESS_72H_SUCCESS,{data:{purchaseStatus:this.purchaseRequestService.purchaseRequestStatus,inquireDTO:p}})},g=>{this.ngWebflowService.addWebFlowAction(y.B.SENDING_AUTOMATIC_LESS_72H_FAILED,{data:{purchaseStatus:this.purchaseRequestService.purchaseRequestStatus,inquireDTO:p}}),g.error&&(console.error("Error sending email",g.error),this.ngWebflowService.addWebFlowAction(y.B.SENDING_AUTOMATIC_LESS_72H_FAILED,{data:{purchaseStatus:this.purchaseRequestService.purchaseRequestStatus,inquireDTO:p}}))})}getImagesByType(t){const r=this.paymentMethods[t].icons;return r&&r.length>0?this.paymentsTypeService.getImagesByListNames(r.map(n=>n.img)):[]}isShowErrorMessageInFormChange(t){this.isPaymentErrorCreditCard=t}setLoading(t){this.loading=t}setProcessing(t){this.isProcessing=t}cabinWasReservedOrHttpError(t){console.log("Init proceess cancel",t),t===ne.RESERVED_ERROR?(this.purchaseRequestService.setTypeErrorOnHold(!1),this.requestBookingConfirmationAutomatic(!1),this.initPaymentMethod(),this.isBlockDepartureSuccess=!1):(this.purchaseRequestService.setTypeErrorOnHold(!0),this.requestBookingConfirmationAutomatic(!0)),this.isProcessing=!1,this.isRequestingBlockDeparture=!1}requestBookingConfirmationAutomatic(t){this.purchaseRequestService.requestbookingInquire(!0,t).subscribe(n=>{this.counterSuccessAutomaticEmail++})}sendEmailConfirmationEvent(t){this.requestBookingConfirmation()}requestBookingConfirmation(){try{this.ngWebflowService.addWebFlowAction(y.B.SEND_REQUEST_CONFIRMATION_EMAIL_START,this.purchaseRequestService.getRequestSendConfirmEmail()),this.purchaseRequestService.requestbookingConfirm().subscribe(t=>{this.purchaseRequestService.isRequestBookingConfirmationSuccess(t)&&(this.purchaseRequestService.purchaseRequestStatus=k.I.BOOCKING_CONFIRMATION_SENT,this.purchaseRequestService.purchaseRequestStatus=k.I.DATA_PASSENGER_COMPLETED,this.ngWebflowService.addWebFlowAction(y.B.SEND_REQUEST_CONFIRMATION_EMAIL_SUCCESS,t),this.purchaseRequestService.purchaseRequestStatus=k.I.PAYMENT_COMPLETED,this.ngWebflowService.addWebFlowAction(y.B.BOOKING_COMPLETED,{message:"booking completed"}))},t=>{console.log("BookTourComponent.requestbookingConfirm()"),this.ngWebflowService.addWebFlowAction(y.B.SEND_REQUEST_CONFIRMATION_EMAIL_FAILED,this.purchaseRequestService.purchase),console.error(t)},()=>{})}catch(t){console.log("BookTourComponent.requestbookingConfirm()"),this.ngWebflowService.addWebFlowAction(y.B.SEND_REQUEST_CONFIRMATION_EMAIL_ERROR,this.purchaseRequestService.purchase),console.error(t)}}selectThirtyPercent(){this.isSelectedThirtyPercent=!this.isSelectedThirtyPercent,this.purchaseRequestService.setIsSelectedThirtyPerent(this.isSelectedThirtyPercent);const t=this.purchaseRequestService.getTotalPrice();console.log("total",t),this.purchaseTotalPrice=t||0}changePaymentMethod(t){this.termsCondition=!1,this.flagClick=!1,this.paymentMethods.forEach((n,l)=>{n.selected=l===t});const r=this.paymentMethods[t];r.type===Ze.TYPE_DIRECT_TRANSFER?(this.paymentMethod.transfer=!0,this.paymentMethod.creditCard=!1,this.paymentMethod.paypal=!1):(this.paymentMethod.transfer=!1,this.paymentMethod.creditCard=!1,this.paymentMethod.paypal=!1),this.purchaseRequestService.setCodePaymentMethod(r.code),this.purchaseRequestService.setPaymentMethod(this.paymentMethod)}paymentErrorCreditCard(t){this.errorText="",null!=t&&""!==t&&(this.errorText="Your booking could not be completed due to an error with your payment method,"+t+". Your transaction has not been charged. We recommend you try a different payment method or Contact Us at ("+this.companyData.infoEmail+")")}paymentErrorCreditCardAttempt(){this.errorTextPaymentAttempts=`We apologize, but you have reached the maximum number of allowed attempts for this payment method. Your transaction has not been processed. We recommend you try a different payment method or Contact Us at (${this.companyData.infoEmail})`}paymentError(t){try{this.isPaymentComplete=!1,this.isPaymentCancel=!1,this.isPaymentError=!0,this.purchaseRequestService.isRequestBlockDepartureSuccess(),this.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_ERROR,{result:"error:"+t})}catch(r){console.log("PaymentOptionsComponent.paymentError()"),console.error(r)}}paymentCanceled(t){try{this.isPaymentComplete=!1,this.isPaymentCancel=!0,this.isPaymentError=!1,this.purchaseRequestService.isRequestBlockDepartureSuccess(),this.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_CANCEL,{result:"canceled",data:t})}catch(r){console.log("PaymentOptionsComponent.paymentCanceled()"),console.error(r)}}blockCabinNewjson(){var t=this;return(0,T.Z)(function*(){t.isProcessing=!0,t.loading=!0,t.paymentOption=de.TRANSFER,t.purchaseRequestService.setRequestBlockCabinOnHold(t.purchaseRequestService.getPercentUsed()),t.startBlockDeparture(),yield t.setTransactionCode(),t.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_START,t.purchaseRequestService.getPercentUsed()),t.purchaseRequestService.requestBlockCabinOnHold(t.purchaseRequestService.getPercentUsed()).subscribe(r=>{const n=t.purchaseRequestService.setBlockDeparture(r);t.loading=!1,t.isBlockDepartureSuccess=!0===n&&t.purchaseRequestService.isRequestBlockDepartureSuccess(),!1===t.isBlockDepartureSuccess?(t.isBlockDepartureFailed(),t.cabinWasReservedOrHttpError(ne.RESERVED_ERROR)):(t.isPaymentComplete=!0,t.isPaymentCancel=!1,t.isPaymentError=!1,t.whenpaymentComplete(),t.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_SUCCESS,{result:"completed: ",termsConditions:(!1).valueOf,purchase:t.purchaseRequestService.purchase}),t.requestBookingConfirmation()),t.isRequestingBlockDeparture=!1},r=>{t.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_FAILED,{result:"failed: "+r,termsConditions:(!1).valueOf,purchase:t.purchaseRequestService.purchase}),t.ngWebflowService.addWebFlowAction(y.B.BOOKING_FAILED,{message:"booking failed"}),t.errorProcess(r)}
1,()=>{t.ngWebflowService.addWebFlowAction(y.B.ON_HOLD,{result:"BLOCK_DEPARTURE_SUCCESS",data:t.purchaseRequestService.getBlockCabinRequest()}),t.ngWebflowService.addWebFlowAction(y.B.BOOKING_COMPLETED,{message:"booking completed"}),t.isRequestingBlockDeparture=!1,t.isProcessing=!1})})()}startBlockDeparture(){this.ngWebflowService.addWebFlowAction(y.B.START_ON_HOLD,{requestBlockCabin:this.purchaseRequestService.getBlockCabinRequest()})}whenpaymentComplete(){try{this.contactFormService.sendFormWhenCompletePayment(this.purchaseRequestService.purchase).subscribe(t=>{this.isInquireSent=this.contactFormService.isSendFormResponseSuccess(t)},t=>{console.log("PaymentOptionsComponent.isBlockDepartureFailed()"),console.error(t),this.isInquireSent=!1})}catch(t){console.log("PaymentOptionsComponent.isBlockDepartureFailed()"),console.error(t)}}setTransactionCode(){var t=this;return(0,T.Z)(function*(){try{const r=yield t.purchaseRequestService.requestStatusAvailability(t.purchaseRequestService.getPercentUsed()).toPromise();t.purchaseRequestService.setValueTransaction(r.message)}catch(r){throw t.errorProcess(r),new ReferenceError("falied code transaction")}})()}errorProcess(t){this.isRequestingBlockDeparture=!1,console.log("PaymentOptionsComponent.blockDeparture()"),console.error(t),this.isBlockDepartureFailed(),this.cabinWasReservedOrHttpError(ne.HTTP_ERROR)}isBlockDepartureFailed(){try{this.contactFormService.sendFormWhenBLockDepartureFails(this.purchaseRequestService.purchase).subscribe(t=>
1{this.isInquireSent=this.contactFormService.isSendFormResponseSuccess(t)},t=>{console.log("PaymentOptionsComponent.isBlockDepartureFailed()"),console.error(t),this.isInquireSent=!1}),this.ngWebflowService.addWebFlowAction(y.B.EXECUTING_PAYMENT_BLOCK_DEPARTURE_FAILED,{result:"BLOCK_DEPARTURE_FAILED",data:this.purchaseRequestService.getBlockCabinRequest()})}catch(t){console.log("PaymentOptionsComponent.isBlockDepartureFailed()"),console.error(t)}}changeTermsPayTransfer(t,r){const n=t.checked;this.termsCondition=n,this.valueTerms=n?"all":"none";let l={};r===this.paymentMethodTypeEnum.GENERAL_TRANSFER?l.termsCondition=this.termsCondition:r===this.paymentMethodTypeEnum.PAYPAL_CHECKOUT&&(l.termsConditionPaytransfer=this.termsCondition),l.requestSendConfEmail=this.purchaseRequestService.preparePurchaseBookingConfirm(),this.ngWebflowService.addWebFlowAction(y.B.CLICK_TERMS_CONDITIONS,{nameBoat:this.cruiseWrapper?.getName(),itinerarySelected:this.cruiseWrapper?.getCurrentItineraryForLogs()})}goBack(){try{this.ngWebflowService.addWebFlowAction(y.B.GO_BACK_+this.purchaseRequestService.purchaseRequestStatus,{goBackFrom:this.purchaseRequestService.purchaseRequestStatus}),this.purchaseRequestService.purchaseRequestStatus=k.I.CABINS_COMPLETED}catch(t){console.log("PassengerFormComponent.goBack()"),console.error(t)}}getCategory(t){let r="";switch(t){case 5:r="Luxury";break;case 4:r="First Class";break;case 3:r="Mid-range";break;case 2:r="Budget";break;default:r="All"}return r}getIsitIncludedAirTickets(){return!!this.purchaseRequestService?.purchase?.cruise&&Number(this.purchaseRequestService?.purchase?.cruise.availability[this.purchaseRequestService?.purchase?.cruise.iterIndex].packageGBCCode)===Number(Y.M.INCLUDES_AIR_TICKETS)}getCategoryArray(t){let r=[];return t.forEach(n=>{switch(n){case 5:r.push("Luxury");break;case 4:r.push("First Class");break;case 3:r.push("Mid-range");break;case 2:r.push("Budget");break;default:r.push("All")}}),r}failedAttempts(t){t>=this.totalPaymentAttempt&&(this.isPaymentAttempt=!0)}goToSearchResults(){const t=this.searcherFiltersService.getSearchRouteGeneric()||["/search"];this.router.navigate(t)}paymentOptions(t){this.paymentOption=t}generateUrl(){const t=this.getCheckoutUrl("checkout",0,"fetch-step/payment");this.location.replaceState(t)}getCheckoutUrl(t,r,n){if(null==this.purchaseRequestService.purchase)return"";if(null==this.purchaseRequestService.purchase.cruise)return"";const l=this.purchaseRequestService.purchase.cruise;return t+"/"+encodeURIComponent(this.companyService.getCode())+"/"+encodeURIComponent(l.availability[r].code.toString())+"/"+this.searcherFiltersService.getSearchRequestObj().adults+"/"+this.searcherFiltersService.getSearchRequestObj().children+"/"+n}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(v.F0),e.Y36(ii),e.Y36(O.v),e.Y36(R.N),e.Y36(Ee.j),e.Y36(ze.g),e.Y36(q.k7),e.Y36(P.G),e.Y36(W.y),e.Y36(o.Ye),e.Y36(R.N))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-payment-options"]],decls:7,vars:5,consts:[[1,"mt-4","mb-3"],["class","row",4,"ngIf"],[4,"ngIf"],["fxLayout","row",4,"ngIf"],[1,"row"],[1,"col-md-6"],[1,"col-md-8"],["for","reserve"],["type","checkbox","name","reserve","id","reserve",3,"checked","click"],[1,"col-md-4"],[2,"margin-top","3px","font-size","14px !important"],[1,"col-md-9"],[1,"col-md-3","pl-0"],["class","col-md-12",4,"ngIf"],[1,"col-md-12"],["role","alert",1,"alert","alert-info"],[2,"font-size","18px"],[1,"btn","bg-light","text-secondary","mb-3",3,"click"],[1,"fa","fa-angle-left"],[3,"visible","errorHeader","errorText"],["id","accordion"],["class","card mb-3",4,"ngFor","ngForOf"],[1,"card","mb-3"],[1,"card-header","bg-white","pb-2","pt-2"],["href","javascript:void(0)",1,"btn","btn-success","float-right",3,"click"],[1,"fa","fa-angle-down"],[1,"text-muted","mt-2",2,"font-size","20px"],[3,"ngSwitch"],["class","fa fa-paypal w-icon",4,"ngSwitchCase"],["class","fa fa-credit-card w-icon",4,"ngSwitchCase"],["class","fa fa-exchange-alt w-icon",4,"ngSwitchDefault"],[1,"collapsible",3,"id"],[1,"card-body"],["target","_blank","rel","noopener noreferrer","style","padding-left: 5px;
1",3,"href",4,"ngIf"],[1,"col-12"],[1,"paypalbutton",3,"click"],[3,"ngStyle",4,"ngIf"],[1,"fa","fa-paypal","w-icon"],[1,"fa","fa-credit-card","w-icon"],[1,"fa","fa-exchange-alt","w-icon"],["target","_blank","rel","noopener noreferrer",2,"padding-left","5px",3,"href"],["class","mr-2 mt-2",3,"src","alt","height",4,"ngFor","ngForOf"],[1,"mr-2","mt-2",3,"src","alt","height"],[3,"imagesCreditCard","termsCondictios","isShowErrorMessageInForm","locked","errorTextPaymentAttempts","isShowErrorMessageInFormChange","eventCLicFlagTerms","setProcessStatus","cabinWasReservedOrHttpError","successPaymentRequest","onErrorPayment","isLoading","failedAttempts","paymentOptions"],[3,"ngStyle"],[3,"purchaseTotalPrice","setProcessStatus","cabinWasReservedOrHttpError","successPaymentRequest","onCancelPayment","paymentOptions","onErrorPayment"],["target","_blank",3,"href"],[1,"fs-13"],["type","checkbox","id","terms-condition",1,"agree",3,"checked","change"],["class","fs-13 p-1 alert-danger mb-3",4,"ngIf"],[1,"fs-13","p-1","alert-danger","mb-3"],[1,"col-12",3,"click"],["id","card-button",1,"btn","btn-success","btn-lg","float-right",2,"width","300px",3,"disabled","click"],["class","lds-dual-ring",4,"ngIf"],[1,"lds-dual-ring"],["fxLayout","row"],[1,"col-12","text-right","mb-3"],["href","javascript:void()",1,"btn","btn-danger","back_select_cabin_gm",3,"click"]],template:function(r,n){1&r&&(e.TgZ(0,"h3",0),e._uU(1,"Cruise Payment Options"),e.qZA(),e.YNc(2,wi,19,7,"div",1),e.YNc(3,Mi,2,1,"div",1),e.YNc(4,Di,2,1,"div",1),e.YNc(5,ra,5,1,"ng-container",2),e.YNc(6,ia,6,0,"div",3)),2&r&&(e.xp6(2),e.Q6J("ngIf",n.hasThirtyPercent),e.xp6(1),e.Q6J("ngIf",!n.loading),e.xp6(1),e.Q6J("ngIf",!n.loading),e.xp6(1),e.Q6J("ngIf",!0===n.isAutoPaymentAccepted&&void 0!==n.isBlockDepartureSuccess&&!0===n.isBlockDepartureSuccess),e.xp6(1),e.Q6J("ngIf",n.isBlockDepartureSuccess))},dependencies:[o.sg,o.O5,o.PC,o.RF,o.n9,o.ED,rt,Me,Oi],styles:['.collapsible[_ngcontent-%COMP%]{overflow:hidden}#wire-button[_ngcontent-%COMP%]{cursor:pointer}.paypalbutton[_ngcontent-%COMP%]{width:18%}.lds-dual-ring[_ngcontent-%COMP%]{display:inline-block;width:20px;height:20px}.lds-dual-ring[_ngcontent-%COMP%]:after{content:" ";display:block;width:20px;height:20px;margin:3px;border-radius:50%;border:3px solid #fff;border-color:#fff transparent #fff transparent;animation:_ngcontent-%COMP%_lds-dual-ring 1.2s linear infinite}@keyframes _ngcontent-%COMP%_lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],data:{animation:[(0,E.X$)("collapse",[(0,E.SB)("false",(0,E.oB)({height:E.l3,visibility:E.l3})),(0,E.SB)("true",(0,E.oB)({height:"0",visibility:"hidden"})),(0,E.eR)("false => true",(0,E.jt)("300ms ease-in")),(0,E.eR)("true => false",(0,E.jt)("300ms ease-out"))])]}}),i})();var ge=_(587),_e=(()=>{return(i=_e||(_e={})).PAYMENT_CODE="Payment Code",i.PAYMENT_METHOD="Payment Method",i.TRANSFER="Transfer",_e;var i})();const Le=function(){return{maximumFractionDigits:2}};function na(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",17),e._uU(2),e.qZA(),e.TgZ(3,"div",15)(4,"h3",11),e._uU(5),e.qZA()()()),2&i){const a=e.oxw();e.xp6(2),e.hij("",a.getTextTotalPaid(),":"),e.xp6(3),e.hij("US$ ",a.getPurchaseTotalPrice().toLocaleString("en",e.DdM(2,Le)),"")}}function sa(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",17),e._uU(2),e.qZA(),e.TgZ(3,"div",15)(4,"h3",11),e._uU(5),e.qZA()()()),2&i){const a=e.oxw();e.xp6(2),e.hij("",a.valuePercent,"% Deposit:"),e.xp6(3),e.hij("US$ ",a.getPurchaseTotalPrice().toLocaleString("en",e.DdM(2,Le)),"")}}function oa(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"First Name:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw().$implicit;e.xp6(4),e.Oqu(a.firstName)}}function ca(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"First Name:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(4),e.Oqu(null==a.purchaseContactPerson?null:a.purchaseContactPerson.firstName)}}function la(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"Last Name:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw().$implicit;e.xp6(4),e.Oqu(a.lastName)}}function ua(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"Last Name:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(4),e.Oqu(null==a.purchaseContactPerson?null:a.purchaseContactPerson.lastName)}}function da(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"E-mail:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(4),e.Oqu(null==a.purchaseContactPerson?null:a.purchaseContactPerson.email)}}function ha(i,s){if(1&i&&(e.TgZ(0,"div",8)(1,"div",26),e._uU(2,"Telephone:"),e.qZA(),e.TgZ(3,"div",27),e._uU(4),e.qZA()()),2&i){const a=e.oxw(2);e.xp6(4),e.Oqu(null==a.purchaseContactPerson?null:a.purchaseContactPerson.phone)}}function pa(i,s){if(1&i&&(e.TgZ(0,"div",4)(1,"div",22)(2,"h3",23),e._UZ(3,"i",24),e._uU(4),e.qZA()(),e.TgZ(5,"div",25)(6,"div",6)(7,"div",7),e.YNc(8,oa,5,1,"div",16),e.YNc(9,ca,5,1,"div",16),e.YNc(10,la,5,1,"div",16),e.YNc(11,ua,5,1,"div",16),e.TgZ(12,"div",8)(13,"div",26),e._uU(14,"Date of Birth:"),e.qZA(),e.TgZ(15,"div",27),e._uU(16),e.qZA()(),e.TgZ(17,"div",8)(18,"div",26),e._uU(19,"Address:"),e.qZA(),e.TgZ(20,"div",27),e._uU(21),e.qZA()(),e.YNc(22,da,5,1,"div",16),e.qZA(),e.TgZ(23,"div",12)(24,"div",8)(25,"div",26),e._uU(26,"Gender:"),e.qZA(),e.TgZ(27,"div",27),e._uU(28),e.qZA()(),e.TgZ(29,"div",8)(30,"div",26),e._uU(31,"Country:"),e.qZA(),e.TgZ(32,"div",27),e._uU(33),e.qZA()(),e.TgZ(34,"div",8)(35,"div",26),e._uU(36,"Passport #:"),e.qZA(),e.TgZ(37,"div",27),e._uU(38),e.qZA()(),e.TgZ(39,"div",8)(40,"div",26),e._uU(41,"Alergies:"),e.qZA(),e.TgZ(42,"div",27),e._uU(43),e.qZA()(),e.YNc(44,ha,5,1,"div",16),e.qZA()()()()),2&i){const a=s.$implicit,t=s.index,r=e.oxw();e.xp6(4),e.HOy(" Passenger #",t+1,": ",a.firstName," ",a.lastName," ",r.isPurchaseContactPerson(a)?"(Contact person)":"",""),e.xp6(4),e.Q6J("ngIf",!r.isPurchaseContactPerson(a)),e.xp6(1),e.Q6J("ngIf",r.isPurchaseContactPerson(a)),e.xp6(1),e.Q6J("ngIf",!r.isPurchaseContactPerson(a)),e.xp6(1),e.Q6J("ngIf",r.isPurchaseContactPerson(a)),e.xp6(
15),e.lnq("",a.birthday,"/",a.birthMonth,"/",a.birthYear,""),e.xp6(5),e.Oqu(a.address),e.xp6(1),e.Q6J("ngIf",r.isPurchaseContactPerson(a)),e.xp6(6),e.Oqu(a.gender),e.xp6(5),e.Oqu(a.country),e.xp6(5),e.Oqu(a.passport),e.xp6(5),e.Oqu(a.allergies),e.xp6(1),e.Q6J("ngIf",r.isPurchaseContactPerson(a))}}const ma=function(i){return{fa:i}};function ga(i,s){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"button",37),e.NdJ("click",function(){const n=e.CHM(a).$implicit,l=e.oxw(2);return e.KtG(l.setExperience(n.value))}),e.qZA(),e.BQk()}if(2&i){const a=s.$implicit;e.xp6(1),e.Q6J("ngClass",e.VKq(1,ma,a.selected))}}function _a(i,s){1&i&&(e.TgZ(0,"div",38),e._uU(1," Please to send your booking experience, you must add some commentary."),e.qZA())}function fa(i,s){if(1&i){const a=e.EpF();e.TgZ(0,"div",28)(1,"h4",29),e._uU(2,"Please rate your booking experience:"),e.qZA(),e.TgZ(3,"div",30),e.YNc(4,ga,2,3,"ng-container",31),e.qZA(),e.TgZ(5,"div",32)(6,"i",33),e._uU(7,"\xa0 Bad \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 \xa0 Excellent"),e.qZA(),e.TgZ(8,"textarea",34),e.NdJ("ngModelChange",function(r){e.CHM(a);const n=e.oxw();return e.KtG(n.messageExperience=r)})("input",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.controlMessageEmpty())}),e.qZA(),e.YNc(9,_a,2,0,"div",35),e.TgZ(10,"button",36),e.NdJ("click",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.submitExperience())}),e._uU(11,"Submit"),e.qZA()()()}if(2&i){const a=e.oxw();e.xp6(4),e.Q6J("ngForOf",a.arrayExperience),e.xp6(4),e.Q6J("ngModel",a.messageExperience),e.xp6(1),e.Q6J("ngIf",a.isMessageExperienceEmpty)}}function va(i,s){1&i&&(e.TgZ(0,"div",28)(1,"h4",29),e._uU(2,"Thank you for your review."),e.qZA()())}let Ta=(()=>{const s=class{constructor(t,r,n,l,p,g){this.cruiseService=t,this.companyParamsService=r,this.purchaseRequestService=n,this.utilsService=l,this.activatedRoute=p,this.httpRequestService=g,this.adults=0,this.children=0,this.tourLengthShortName="",this.purchaseRequestStatusType=k.I,this.purchaseCabinPassengers=[],this.cruiseWrapper=new Ke.S(this.cruiseService.getCruiseSelected()),this.valuePercent=0,this.messageExperience="",this.isMessageExperienceEmpty=!1,this.sentExpiriencie=!1,this.purchaseRequestPassengers=[],this.arrayExperience=[]}ngOnInit(){this.urlParams=this.activatedRoute.snapshot.params,this.purchaseRequestPassengers=this.purchaseRequestService.getPurchasePassengersInformation(),this.purchaseContactPerson=this.purchaseRequestService.getPurchaseContactPerson(),this.valuePercent=this.companyParamsService.getPercentPartialPayment(),this.arrayExperience=this.utilsService.createNumberArray(5,!1).map(t=>({value:t,selected:!1})),this.setScriptGTag(),this.setOpenAIScript(),this.tourLengthShortName=this.cruise.availability[this.cruise.iterIndex].length.substring(0,1),this.adults=this.purchaseRequestService.purchase.adults,this.children=this.purchaseRequestService.purchase.children,this.tourLength=this.cruiseWrapper.getLenght(),this.purchaseCabinPassengers=this.purchaseRequestService.getPurchaseCabinPassengers()}getInvoiceText(){return this.purchaseRequestService.getPaymentMethod(),ge.Y.TOTAL_BILLED}getPurchaseWithOutDiscount(){try{return this.purchaseRequestService.getTotalPriceWithoutDiscount()}catch(t){throw console.log("TourSummary.getPurchaseTotalPrice()"),console.error(t),t}}getPurchaseRequestStatus(){return this.purchaseRequestService.purchaseRequestStatus}getTextTotalPaid(){let t="";return t=this.purchaseRequestService.getPaymentMethod().transfer?this.purchaseRequestService.getIsSelectedThirtyPerent()?`Initial deposit (${this.companyParamsService.getPercentPartialPayment()})% to be paid*`:ge.Y.TOTAL_TO_BE_PAID:this.purchaseRequestService.getIsSelectedThirtyPerent()?`Initial deposit (${this.companyParamsService.getPercentPartialPayment()})% paid*`:ge.Y.TOTAL_PAID,t}getPurchaseTotalPrice(){return this.purchaseRequestService.getTotalPrice()}isWithThirtyPercent(){return this.purchaseRequestService.getIsSelectedThirtyPerent()}getTitlePaymentMethod(){return this.purchaseRequestService.getPaymentMethod().transfer?_e.PAYMENT_METHOD:_e.PAYMENT_CODE}getValuePaymentMethod(){return this.purchaseRequestService.getPaymentMethod().transfer?_e.TRANSFER:this.purchaseRequestService.getBookingTrackCode()?.substring(0,10)}getPurchaseCabinPassengers(){try{return this.purchaseRequestService.getPurchaseCabinPassengers()}catch(t){return console.log("TourSummary.getPurchaseCabinPassengers()"),console.error(t),[]}}submitExperience(){if(""===this.messageExperience)return void(this.isMessageExperienceEmpty=!0);this.isMessageExperienceEmpty=!1;let t=0;t=this.arrayExperience.filter(n=>!0===n.selected).length,this.sentExpiriencie=!0}
1setExperience(t){this.arrayExperience=this.arrayExperience.map(r=>r.value<=t?{...r,selected:!0}:{...r,selected:!1})}isPurchaseContactPerson(t){const r=this.purchaseContactPerson;return!(0,f.le)(r)&&JSON.stringify(t)===JSON.stringify(r.purchasePassengerInformation)}controlMessageEmpty(){console.log("**** message ",this.messageExperience),this.isMessageExperienceEmpty=""===this.messageExperience}getThanYouText(){return this.purchaseRequestService.getPaymentMethod().transfer?ge.Y.TRANSFER_TEXT:ge.Y.WITHOUT_TRANSFER_TEXT}setScriptGTag(){localStorage.setItem("gtc_tp",this.getPurchaseWithOutDiscount().toString()),localStorage.setItem("gtc_env",c.N.production?"prod":"dev");var t=document.createElement("script");t.type="text/javascript",t.src="assets/js/gtag.js",document.body.appendChild(t)}setOpenAIScript(){let t=document.createElement("script"),r="oaiq('measure', 'registration_completed', {type: 'customer_action',amount: "+this.purchaseRequestService.getTotalPrice()+",currency: 'USD'});";t.innerText=r,t.type="text/javascript",document.body.appendChild(t)}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(P.G),e.Y36(R.N),e.Y36(O.v),e.Y36(ee.F),e.Y36(v.gz),e.Y36(ze.g))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-thank-you-page"]],decls:50,vars:15,consts:[[1,"mt-4","mb-3"],["id","1072697850",2,"display","none"],[1,"alert-success","p-3","rounded","mb-3","purchase-alert"],[1,"fa","fa-check-circle"],[1,"card","mb-3"],[1,"card-body","pb-1","pt-2"],[1,"row","no-gutters"],[1,"col-md-7"],[1,"row","pt-2","pb-2","no-gutters","border-bottom"],[1,"col-5","font-weight-bold","text-muted"],[1,"col-7"],[1,"fs-24","orange","m-0"],[1,"col-md-5"],[1,"row","pt-2","pb-2","pr-1","no-gutters","border-bottom"],[1,"col-5","col-md-6","font-weight-bold","text-muted",2,"white-space","nowrap"],[1,"col-7","col-md-6"],["class","row pt-2 pb-2 no-gutters border-bottom",4,"ngIf"],[1,"col-5","col-md-6","font-weight-bold","text-muted"],[1,"card-footer","border-top-0","bg-gray"],[1,"small","m-0"],["class","card mb-3",4,"ngFor","ngForOf"],["class","text-center mt-4 pt-3 border-bottom border-top",4,"ngIf"],[1,"card-header","border-bottom-0","bg-orange","text-white"],[1,"fs-24","m-0"],[1,"fa","fa-user-alt"],[1,"card-body"],[1,"col-4","font-weight-bold","text-muted"],[1,"col-8"],[1,"text-center","mt-4","pt-3","border-bottom","border-top"],[1,"condensed"],[1,"mt-3"],[4,"ngFor","ngForOf"],[1,"mt-3","justify-content-center"],[1,"fs-13","text-muted","mt-0"],["rows","4","placeholder","Comments and recommendations...",1,"form-control","mx-auto","fs-13","mt-3",2,"max-width","450px",3,"ngModel","ngModelChange","input"],["class","fs-13 p-2 alert-warning mb-3",4,"ngIf"],["type","submit",1,"btn","bg-orange","my-4","text-white",3,"click"],["aria-hidden","true","aria-hidden","true",1,"far","fa-star","orange",2,"font-size","32px",3,"ngClass","click"],[1,"fs-13","p-2","alert-warning","mb-3"]],template:function(r,n){1&r&&(e.TgZ(0,"h3",0),e._uU(1,"Booking Summary"),e.qZA(),e.TgZ(2,"div",1)(3,"span"),e._uU(4),e.qZA()(),e.TgZ(5,"div",2)(6,"h5"),e._UZ(7,"i",3),e._uU(8," Thank you for choosing us!"),e.qZA(),e.TgZ(9,"p"),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",5)(13,"div",6)(14,"div",7)(15,"div",8)(16,"div",9),e._uU(17,"Cruise:"),e.qZA(),e.TgZ(18,"div",10),e._uU(19),e.qZA()(),e.TgZ(20,"div",8)(21,"div",9),e._uU(22),e.qZA(),e.TgZ(23,"div",10)(24,"h3",11),e._uU(25),e.qZA()()(),e.TgZ(26,"div",8)(27,"div",9),e._uU(28,"Departure Date:"),e.qZA(),e.TgZ(29,"div",10),e._uU(30),e.qZA()()(),e.TgZ(31,"div",12)(32,"div",13)(33,"div",14),e._uU(34),e.qZA(),e.TgZ(35,"div",15),e._uU(36),e.qZA()(),e.YNc(37,na,6,3,"div",16),e.YNc(38,sa,6,3,"div",16),e.TgZ(39,"div",8)(40,"div",17),e._uU(41,"Itinerary:"),e.qZA(),e.TgZ(42,"div",15),e._uU(43),e.qZA()()()()(),e.TgZ(44,"div",18)(45,"p",19),e._uU(46,"*Includes taxes and fees"),e.qZA()()(),e.YNc(47,pa,45,18,"div",20),e.YNc(48,fa,12,3,"div",21),e.YNc(49,va,3,0,"div",21)),2&r&&(e.xp6(4),e.Oqu(n.gtc_stamp),e.xp6(6),e.Oqu(n.getThanYouText()),e.xp6(9),e.Oqu(n.cruiseWrapper.getLongName()),e.xp6(3),e.hij("",n.getInvoiceText(),"*:"),e.xp6(3),e.hij("US$ ",n.getPurchaseWithOutDiscount().toLocaleStr
1ing("en",e.DdM(14,Le)),""),e.xp6(5),e.Oqu(n.cruiseWrapper.getStartAndEndDataSummary()),e.xp6(4),e.hij(" ",n.getTitlePaymentMethod(),":"),e.xp6(2),e.Oqu(n.getValuePaymentMethod()),e.xp6(1),e.Q6J("ngIf",!n.isWithThirtyPercent()),e.xp6(1),e.Q6J("ngIf",n.isWithThirtyPercent()),e.xp6(5),e.hij("",n.cruiseWrapper.getLenght()," "),e.xp6(4),e.Q6J("ngForOf",n.purchaseRequestPassengers),e.xp6(1),e.Q6J("ngIf",!n.sentExpiriencie),e.xp6(1),e.Q6J("ngIf",n.sentExpiriencie))},dependencies:[o.mk,o.sg,o.O5,u.Fj,u.JJ,u.On,j.mh]}),i})();var Ca=_(2805);let ya=(()=>{const s=class{constructor(t,r,n){this.router=t,this.purchaseRequestService=r,this.searcherFiltersService=n,this.REDIRECT_TIME=10,this.obsTimer=(0,Ca.H)(1e3,1e3)}ngOnInit(){this.remainingTimeCounter()}remainingTimeCounter(){try{this.remainingTime=this.REDIRECT_TIME,this.obsTimer.subscribe(t=>{this.remainingTime-=1,this.currTime=t,t==this.REDIRECT_TIME&&(this.remainingTime=0,this.goToSearchResults())})}catch(t){console.log("CheckoutTimeoutComponent.remainingTimeCounter()"),console.error(t)}}goToSearchResults(){const t=this.searcherFiltersService.getSearchRouteGeneric()||["/search"];this.router.navigate(t)}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(v.F0),e.Y36(O.v),e.Y36(W.y))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-checkout-timeout"]],decls:14,vars:2,consts:[[1,"alert","alert-success"],[1,"alert-heading"],["role","button","galGoToTop","",3,"click"],[1,"mb-0"],[1,"badge"]],template:function(r,n){1&r&&(e.TgZ(0,"div",0)(1,"h4",1),e._uU(2,"Request time expired!"),e.qZA(),e.TgZ(3,"p"),e._uU(4,"Time required to complete your galapagos cruise reservation has expired. Please, "),e.TgZ(5,"a",2),e.NdJ("click",function(){return n.goToSearchResults()}),e._uU(6,"go back to search results"),e.qZA(),e._uU(7," and start the process again."),e.qZA(),e._UZ(8,"hr"),e.TgZ(9,"p",3),e._uU(10,"You will be redirected to the search results in "),e.TgZ(11,"span",4),e._uU(12),e.qZA(),e._uU(13),e.qZA()()),2&r&&(e.xp6(12),e.Oqu(n.remainingTime),e.xp6(1),e.hij(" second",n.remainingTime>1?"s":"","."))},dependencies:[Je.K]}),i})();function ba(i,s){1&i&&e._UZ(0,"app-checkout-timeout")}function Aa(i,s){1&i&&e._UZ(0,"app-package-option")}function Sa(i,s){1&i&&e._UZ(0,"app-passenger-form")}function xa(i,s){1&i&&e._UZ(0,"app-payment-options")}function Pa(i,s){1&i&&e._UZ(0,"app-thank-you-page")}function Za(i,s){if(1&i&&(e.ynx(0),e.YNc(1,Aa,1,0,"app-package-option",9),e.YNc(2,Sa,1,0,"app-passenger-form",9),e.YNc(3,xa,1,0,"app-payment-options",9),e.YNc(4,Pa,1,0,"app-thank-you-page",9),e.BQk()),2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getPurchaseRequestStatus()==a.purchaseRequestStatus.INITIAL),e.xp6(1),e.Q6J("ngIf",a.getPurchaseRequestStatus()==a.purchaseRequestStatus.CABINS_COMPLETED),e.xp6(1),e.Q6J("ngIf",a.getPurchaseRequestStatus()==a.purchaseRequestStatus.PASSENGER_COMPLETED),e.xp6(1),e.Q6J("ngIf",a.getPurchaseRequestStatus()==a.purchaseRequestStatus.PAYMENT_COMPLETED)}}function Ia(i,s){1&i&&e._UZ(0,"app-small-searcher",26),2&i&&e.Q6J("isCharter",!1)}function Fa(i,s){if(1&i&&(e.TgZ(0,"div",10)(1,"div",1)(2,"p",11)(3,"strong"),e._uU(4,"Questions?"),e.qZA(),e._uU(5,"\xa0 "),e.TgZ(6,"span"),e._uU(7,"Toll-free: "),e.qZA(),e._UZ(8,"img",12),e.TgZ(9,"a",13),e._uU(10,"1-800-811-4037"),e.qZA(),e.TgZ(11,"span"),e._uU(12,"\u2022"),e.qZA(),e._UZ(13,"img",14),e.TgZ(14,"a",15),e._uU(15,"593-2-6024-565"),e.qZA(),e._uU(16," or "),e.TgZ(17,"a",16),e._uU(18,"Chat with us"),e.qZA(),e._uU(19,"."),e.qZA(),e.TgZ(20,"div",17)(21,"div",18),e._UZ(22,"app-up-slide")(23,"app-cruise-info"),e.YNc(24,ba,1,0,"app-checkout-timeout",9),e.YNc(25,Za,5,4,"ng-container",9),e._UZ(26,"app-ctas"),e.qZA(),e.TgZ(27,"div",19),e._UZ(28,"app-tour-summary",20),e.YNc(29,Ia,1,1,"app-small-searcher",21),e.qZA()(),e.TgZ(30,"div",22)(31,"div",23)(32,"a",24),e._UZ(33,"img",25),e.qZA()()()()()),2&i){const a=e.oxw();e.xp6(24),e.Q6J("ngIf",a.showTimeout),e.xp6(1),e.Q6J("ngIf",!a.showTimeout),e.xp6(3),e.Q6J("valueAdults",a.dataInUrl.adults)("valueChildren",a.dataInUrl.children)("isCharter",!1),e.xp6(1),e.Q6J("ngIf",a.getPurchaseRequestStatus()==a.purchaseRequestStatus.INITIAL)}}function qa(i,s){1&i&&e._UZ(0,"app-loading-checkout")}let Be=(()=>{const s=class extends N.H{constructor(t,r,n,l,p,g,x,A,F,M,ae){super(r),this.routerNavService=t,this.injector=r,this.purchaseRequestService=n,this.searcherFiltersService=l,this.companyRequestService=p,this.seoService=g,this.document=x,this.loadingBar=A,this.location=F,this.companyService=M,this.idleUserService=ae,this.dataInUrl={adults:2,children:0,co
1de:"",availability:""},this.loading=!0,this.purchaseRequestStatus=k.I,this.loader=this.loadingBar.useRef(),this.showTimeout=!1,x.querySelector("link[rel='canonical']").remove()}ngOnInit(){this.idleUserService.userInactive.subscribe(t=>this.showTimeout=t),this.loadSearchData(),this.document.documentElement.scrollTop=0,this.setDataOfUrl(),this.fillCruiseInfo(),this.generateTags()}ngOnDestroy(){this.loader.complete()}setDataOfUrl(){this.dataInUrl=this.routerNavService.getParamsUrlInCheckout()}fillCruiseInfo(){this.loader.start();const t=this.routerNavService.getParamsUrlInCheckout(),r={key:t.code,code:t.availability,agency:this.companyRequestService.getAgencyCode(),adults:t.adults,children:t.children};(this.router.url.includes("fetch-step/pax")||this.router.url.includes("fetch-step/payment"))&&this.generateUrl(r.code),this.cruiseService.requestFindAvailabilityByCode(r).subscribe(n=>{n[0]&&(n[0].iterIndex=0,this.purchaseRequestService.purchaseRequestStatus=k.I.INITIAL,this.cruiseService.setCruiseSelected(n[0]),this.purchaseRequestService.addCruise(n[0]),this.purchaseRequestService.setPercent(n[0].availability[0].percents),this.purchaseRequestService.setFeatureServices(n[0].availability[0].featureServices),this.loading=!1),this.loader.complete()},n=>{this.loader.complete()})}getPurchaseRequestStatus(){return this.purchaseRequestService.purchaseRequestStatus}goToSearchResults(){const t=this.searcherFiltersService.getSearchRouteGeneric()||["/search"];this.router.navigate(t)}generateTags(){let t;t={company:this.companyRequestService.getKeyRequestCompany(c.N.pathNameUrl).key,boat:(0,f.le)(this.paramsUrl.cruiseName)||"0"===this.paramsUrl.cruiseName?"":this.paramsUrl.cruiseName},this.seoService.generateTags(t)}loadSearchData(){const t=this.getLocalStorageValue("searchParams");null!==t&&this.searcherFiltersService.setSearchRequestObj(t)}generateUrl(t){const r=this.getCheckoutUrl("checkout",t,"selection-step");this.location.replaceState(r)}getCheckoutUrl(t,r,n){return t+"/"+encodeURIComponent(this.companyService.getCode())+"/"+encodeURIComponent(r)+"/"+this.searcherFiltersService.getSearchRequestObj().adults+"/"+this.searcherFiltersService.getSearchRequestObj().children+"/"+n}};let i=s;return s.\u0275fac=function(r){return new(r||s)(e.Y36(D.r),e.Y36(e.zs3),e.Y36(O.v),e.Y36(W.y),e.Y36(R.N),e.Y36(Q.v),e.Y36(o.K0),e.Y36(oe.dL),e.Y36(o.Ye),e.Y36(R.N),e.Y36(H))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-checkout"]],features:[e.qOj],decls:16,vars:2,consts:[[1,"grayback","text-white"],[1,"container"],[1,"row","py-3"],[1,"col-md-8"],[1,"d-none","d-sm-inline"],[1,"col-md-4","text-right"],[1,"btn","bg-light","text-secondary","mb-3",3,"click"],[1,"fa","fa-angle-left"],["class","bg-light border-bottom mb-3 pt-3 position-relative",4,"ngIf"],[4,"ngIf"],[1,"bg-light","border-bottom","mb-3","pt-3","position-relative"],[1,"cta-float"],["src","assets/images/cta/usa.jpg","width","20","height","20"],["href","tel:18008114037",2,"float","right"],["src","assets/images/cta/ecuador.jpg","width","20","height","20"],["href","tel:59326024565"],["href","javascript:void(Tawk_API.toggle())"],[1,"row"],[1,"col-lg-8","col-sm-12"],[1,"col-lg-4","col-sm-12"],[3,"valueAdults","valueChildren","isCharter"],[3,"isCharter",4,"ngIf"],[1,"row","mb-3"],[1,"col-12"],["href","https://galavail.com/","target","_blank"],["src","assets/images/galavail-mini.png","width","126","height","45","alt","Powered by GalAvail",1,"float-right"],[3,"isCharter"]],template:function(r,n){1&r&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1"),e._uU(5,"Reserve your "),e.TgZ(6,"span",4),e._uU(7,"Galapagos"),e.qZA(),e._uU(8," Cruise"),e.qZA()(),e.TgZ(9,"div",5)(10,"a",6),e.NdJ("click",function(){return n.goToSearchResults()}),e._UZ(11,"i",7),e._uU(12," Back to Search Results"),e.qZA()()()()(),e._UZ(13,"app-cta"),e.YNc(14,Fa,34,6,"div",8),e.YNc(15,qa,1,0,"app-loading-checkout",9)),2&r&&(e.xp6(14),e.Q6J("ngIf",!n.loading),e.xp6(1),e.Q6J("ngIf",n.loading))},dependencies:[o.O5,ue.t,U.R,B.H,L.O,X.y,d.Y,or,fr,ei,aa,Ta,ya]}),i})();var Na=_(4466),Ea=_(294);const Ua=[{path:":code/:availability/:adults/:children/selection-step",component:Be},{path:":code/:availability/:adults/:children/fetch-step/pax",component:Be},{path:":code/:availability/:adults/:children/fetch-step/payment",component:Be}];let Oa=(()=>{const s=class{};let i=s;return s.\u0275fac=function(r){return new(r||s)},s.\u0275mod=e.oAB({type:s}),s.\u0275inj=e.cJS({providers:[Ee.j],imports:[o.ez,u.u5,u.UX,v.Bz.forChild(Ua),Na.m,Ea.I,Ui,Xe,rt,Me,j.J7,L.O,X.y,Oe.z,d.Y]}),i})()},8343:(se,ie,_)=>{"use strict";_.d(ie,{R:()=>z});var o=_(6053),v=_(4650),f=_(433),N=_(4205),c=_(5431),k=_(7674),e=_(8064),D=_(8869),O=_(4985),W=_(6895),R=_(706),Q=_(8813);function oe(V,H){1&V&&(v.ynx(0),v.TgZ(1,"div",6)(2,"h5",13),v._UZ(3,"i",14),v._uU(4," Number of Passengers:"),v.qZA()(),v.TgZ(5,"div",15)(6,"div",16)(7,"div",17)(8,"div",18),v._uU(9,"Adults"),v.qZA()(),v._UZ(10,"input",19),v.qZA()(),v.TgZ(11,"div",20)(12,"div",16)(13,"div",17)(14,"div",18),v._uU(15,"Children*"),v.qZA()(),v._UZ(16,"input",21),v.qZA()(),v.TgZ(17,"div",22),v._uU(18,"*Up to 12 years old"),v.qZA(),v.BQk())}let z=(()=>{const H=class{constructor(U,B,L,X,d,h,m){this.formBuilder=U,this.routerNavService=B,this.companyService=L,this.statusResultsService=X,this.searcherFiltersService=d,this.router=h,this.cruiseService=m,this.isCharter=!1,this.cruiseWrapper=new o.S(this.cruiseService.getCruiseSelected()),this.formFilters=this.formBuilder.group({}),this.isCalendarLoaded=!1,this.today=new Date,this.year=this.cruiseWrapper.getYearEndDate(),this.dataInUrl={adults:2,children:0,co
1de:"",availability:""}}ngOnInit(){this.setDataOfUrl(),this.buildForm()}get monthsSelected(){try{return this.formFilters.get("monthsSelected")}catch{return this.formBuilder.array([])}}get adultsSelected(){return this.formFilters.get("adults")}get childrenSelected(){return this.formFilters.get("children")}get dateFromSelected(){return this.formFilters.get("dateFrom")}get dateToSelected(){return this.formFilters.get("dateTo")}buildForm(){this.buildDateFromTo(),this.formFilters=this.formBuilder.group({adults:[Number(this.dataInUrl.adults)],children:[this.dataInUrl.children],dateFrom:this.defaultFrom,dateTo:this.defaultTo})}buildDateFromTo(){this.defaultFrom=this.stringToDate(this.searcherFiltersService.getSearchRequestObj().dateFrom),this.defaultTo=this.stringToDate(this.searcherFiltersService.getSearchRequestObj().dateTo)}createGroupDate(U){return this.formBuilder.group({name:[U.name],selected:[U.selected],value:[U.value],allowed:[U.allowed]})}setDataOfUrl(){this.dataInUrl=this.routerNavService.getParamsUrlInCheckout()}onDateRangeSelectedIndividual(U){this.formFilters.controls.dateFrom.setValue(U.from),this.formFilters.controls.dateTo.setValue(U.to)}executeSearch(){this.statusResultsService.setSearching(!0),this.setSearchModel();const U=this.searcherFiltersService.getSearchRouteArray()||["/search"];this.cruiseService.restartCruises(),this.router.navigate(U)}setSearchModel(){const B={...this.searcherFiltersService.getSearchRequestObj(),boat:this.cruiseWrapper.getName(),adults:Number(this.adultsSelected?.value),children:Number(this.childrenSelected?.value),dateFrom:this.searcherFiltersService.formatDate(this.dateFromSelected?.value),dateTo:this.searcherFiltersService.formatDate(this.dateToSelected?.value)};this.searcherFiltersService.setSearchRequestObj(B)}stringToDate(U){const B=Number(U.substring(0,2)),L=Number(U.substring(2,4))-1,X=Number(U.substring(4,8));return new Date(X,L,B)}};let V=H;return H.\u0275fac=function(B){return new(B||H)(v.Y36(f.qu),v.Y36(N.r),v.Y36(c.N),v.Y36(k.R),v.Y36(e.y),v.Y36(D.F0),v.Y36(O.G))},H.\u0275cmp=v.Xpm({type:H,selectors:[["app-small-searcher"]],inputs:{isCharter:"isCharter"},decls:16,vars:4,consts:[[1,"card","mb-3","mt-2","border-0",3,"formGroup"],[1,"card-header","bg-dark"],[1,"fs-24","mt-2","text-light"],[1,"fa","fa-search","float-right",2,"color","#999"],[1,"card-body","bg-window","border-top","border-white"],[1,"row","no-gutters","my-2"],[1,"col-12"],[1,"summary","pb-1"],[1,"fa","fa-calendar","text-muted"],[3,"from","to","rangeDateSelected"],[4,"ngIf"],[1,"col-12","mt-3"],[1,"btn","btn-block","btn-secondary",2,"color","#fff",3,"click"],[1,"summary","mt-3","mb-3","pb-1"],[1,"fa","fa-user-friends","text-muted"],[1,"col-6","mb-2","pr-2"],[1,"input-group","input-group-sm"],[1,"input-group-prepend"],[1,"input-group-text"],["id","search-adults","name","search-adults","formControlName","adults","type","number","min","1","max","18","value","2",1,"form-control"],[1,"col-6","mb-2"],["id","search-children","name","search-children","formControlName","children","type","number","min","0","max","8","value","0",1,"form-control"],[1,"col-12","small"]],template:function(B,L){1&B&&(v.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),v._uU(3,"Your search criteria "),v._UZ(4,"i",3),v.qZA()(),v.TgZ(5,"div",4)(6,"div",5)(7,"div",6)(8,"h5",7),v._UZ(9,"i",8),v._uU(10," Tour Dates:"),v.qZA()(),v.TgZ(11,"app-range-individual-calendar",9),v.NdJ("rangeDateSelected",function(d){return L.onDateRangeSelectedIndividual(d)}),v.qZA(),v.YNc(12,oe,19,0,"ng-container",10),v.TgZ(13,"div",11)(14,"a",12),v.NdJ("click",function(){return L.executeSearch()}),v._uU(15,"Search"),v.qZA()()()()()),2&B&&(v.Q6J("formGroup",L.formFilters),v.xp6(11),v.Q6J("from",L.defaultFrom)("to",L.defaultTo),v.xp6(1),v.Q6J("ngIf",!L.isCharter))},dependencies:[W.O5,f.Fj,f.wV,f.JJ,f.JL,f.qQ,f.Fd,f.sg,f.u,R.mh,Q.t],styles:[".auto-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.border-right[_ngcontent-%COMP%]{min-width:49.16px;border-right:0!important}.wd-100[_ngcontent-%COMP%]{width:99%}.all-months[_ngcontent-%COMP%]{width:-webkit-fill-available;max-width:205px}"]}),V})()},3837:(se,ie,_)=>{"use strict";_.d(ie,{t:()=>J});var o=_(4787),v=_(6053),f=_(7770),N=_(587),c=_(4650),k=_(4985),e=_(3613),D=_(5431),O=_(6895),W=_(6749),R=_(377);function Q(b,q){if(1&b&&(c.TgZ(0,"div",19)(1,"b",20),c._uU(2,"Payment Code:"),c.qZA(),c._uU(3),c.qZA()),2&b){const S=c.oxw();let T;c.xp6(3),c.hij(" ",null==(T=S.purchaseRequestService.getBookingTrackCode())?null:T.substring(0,10),"")}}function oe(b,q){1&b&&(c.TgZ(0,"div",19)(1,"b",20),c._uU(2,"Payment Method:"),c.qZA(),c._uU(3," Transfer"),c.qZA())}const z=function(){return{maximumFractionDigits:2}};function V(b,q){if(1&b&&(c.TgZ(0,"tr")(1,"th",25),c._uU(2),c.qZA(),c.TgZ(3,"td"),c._uU(4),c.qZA()()),2&b){const S=q.$implicit,T=q.index;c.xp6(2),c.hij("Passenger ",T+1,":"),c.xp6(2),c.hij("US$ ",S.price.toLocaleStr
1ing("en",c.DdM(2,z)),"")}}function H(b,q){if(1&b&&(c.TgZ(0,"tr")(1,"th",25),c._uU(2,"Air Tickets"),c.qZA(),c.TgZ(3,"td"),c._uU(4),c.qZA()()),2&b){const S=c.oxw(2);c.xp6(4),c.hij("US$",S.getGalapagosAirTicketsTotal().toLocaleString("en",c.DdM(1,z)),"")}}function ue(b,q){if(1&b&&(c.TgZ(0,"tr")(1,"th",25),c._uU(2),c.qZA(),c.TgZ(3,"td")(4,"h3",26),c._uU(5),c.qZA()()()),2&b){const S=c.oxw(2);let T;c.xp6(2),c.hij("",S.getTextTotalPaid(),"*:"),c.xp6(3),c.hij("US$ ",null==(T=S.getPurchaseTotalPrice())?null:T.toLocaleString("en",c.DdM(2,z)),"")}}function U(b,q){if(1&b&&(c.TgZ(0,"tr")(1,"th",25),c._uU(2),c.qZA(),c.TgZ(3,"td")(4,"h3",26),c._uU(5),c.qZA()()()),2&b){const S=c.oxw(2);let T;c.xp6(2),c.hij("",S.valuePercent,"% Deposit:"),c.xp6(3),c.hij("US$ ",null==(T=S.getPurchaseTotalPrice())?null:T.toLocaleString("en",c.DdM(2,z)),"")}}function B(b,q){if(1&b&&(c.ynx(0,21),c.TgZ(1,"h5",7),c._UZ(2,"i",22),c._uU(3," Prices"),c.qZA(),c.TgZ(4,"p",23),c._uU(5),c.TgZ(6,"strong"),c._uU(7),c.qZA(),c._uU(8),c.qZA(),c.TgZ(9,"table",9)(10,"tbody"),c.YNc(11,V,5,3,"tr",24),c.YNc(12,H,5,2,"tr",6),c.TgZ(13,"tr")(14,"th",25),c._uU(15),c.qZA(),c.TgZ(16,"td")(17,"h3",26),c._uU(18),c.qZA()()(),c.YNc(19,ue,6,3,"tr",6),c.YNc(20,U,6,3,"tr",6),c.qZA()(),c.TgZ(21,"p",27),c._uU(22,"*Includes taxes and fees"),c.qZA(),c.BQk()),2&b){const S=c.oxw();let T;c.xp6(5),c.AsE("",S.cruiseWrapper.getLenght(),"-day Galapagos cruise on the ",S.cruiseWrapper.getLongName()," on "),c.xp6(2),c.Oqu(S.purchaseRequestService.getPurchaseCabinTypeSummary()),c.xp6(1),c.AsE(", for ",S.purchaseRequestService.getNumberOfPassengers()," passenger",S.purchaseRequestService.getNumberOfPassengers()>1?"s":"","."),c.xp6(3),c.Q6J("ngForOf",S.getPurchaseCabinPassengers()),c.xp6(1),c.Q6J("ngIf",!0===S.isPurchaseIncludeAirTickets()),c.xp6(3),c.hij("",S.getInvoiceText(),"*:"),c.xp6(3),c.hij("US$ ",null==(T=S.getPurchaseWithOutDiscount())?null:T.toLocaleString("en",c.DdM(11,z)),""),c.xp6(1),c.Q6J("ngIf",S.getPurchaseRequestStatus()>=S.purchaseRequestStatusType.PAYMENT_COMPLETED),c.xp6(1),c.Q6J("ngIf",S.getPurchaseRequestStatus()===S.purchaseRequestStatusType.PASSENGER_COMPLETED&&S.isWithThirtyPercent())}}function L(b,q){if(1&b&&(c.TgZ(0,"tbody")(1,"tr")(2,"th",30)(3,"h3",31),c._uU(4),c.ALo(5,"cabinOrdinalName"),c.qZA()(),c.TgZ(6,"th",32),c._uU(7,"Type:"),c.qZA(),c.TgZ(8,"td",13),c._uU(9),c.qZA()(),c.TgZ(10,"tr")(11,"th",32),c._uU(12,"Bed:"),c.qZA(),c.TgZ(13,"td",13),c._uU(14),c.qZA()()()),2&b){const S=q.$implicit,T=q.index;c.xp6(4),c.Oqu(c.lcZ(5,3,T+1)),c.xp6(5),c.Oqu(S.cabinaItinerarioNombre),c.xp6(5),c.Oqu(S.camaCabinaNombre)}}function X(b,q){if(1&b&&(c.ynx(0),c.TgZ(1,"h5",7),c._UZ(2,"i",28),c._uU(3," Accommodation"),c.qZA(),c.TgZ(4,"table",29),c.YNc(5,L,15,5,"tbody",24),c.qZA(),c.BQk()),2&b){const S=c.oxw();c.xp6(5),c.Q6J("ngForOf",S.getPurchaseCabinObjectSummary())}}function d(b,q){1&b&&(c.TgZ(0,"li"),c._uU(1,"Galapagos Airfare to/from Ecuador Mainland"),c.qZA())}function h(b,q){if(1&b&&(c.TgZ(0,"li")(1,"strong"),c._uU(2,"FREE"),c.qZA(),c._uU(3),c.qZA()),2&b){const S=q.$implicit;c.xp6(3),c.hij(" ",S,"* ")}}function m(b,q){if(1&b&&(c.TgZ(0,"div"),c.YNc(1,h,4,1,"li",24),c.qZA()),2&b){const S=c.oxw(2);c.xp6(1),c.Q6J("ngForOf",S.cruiseSelected.availability[S.ITERINDEX].aditionalServices)}}function C(b,q){if(1&b&&(c.ynx(0),c.TgZ(1,"h5",7),c._UZ(2,"i",33),c._uU(3," Tour Includes"),c.qZA(),c.TgZ(4,"ul",34)(5,"li"),c._uU(6),c.qZA(),c.YNc(7,d,2,0,"li",6),c.YNc(8,m,2,1,"div",6),c.qZA(),c.BQk()),2&b){const S=c.oxw();c.xp6(6),c.hij("",S.getCruiseItineraryDuration(),"-day Galapagos Cruise"),c.xp6(1),c.Q6J("ngIf",S.isIncludeAirFare()),c.xp6(1),c.Q6J("ngIf",S.cruiseSelected.availability[S.ITERINDEX].aditionalServices.length)}}function P(b,q){if(1&b&&(c.TgZ(0,"tbody")(1,"tr")(2,"th",35),c._uU(3,"Adults:"),c.qZA(),c.TgZ(4,"td"),c._uU(5),c.qZA()(),c.TgZ(6,"tr")(7,"th",35),c._uU(8,"Children*:"),c.qZA(),c.TgZ(9,"td"),c._uU(10),c.qZA()()()),2&b){const S=c.oxw();c.xp6(5),c.Oqu(S.valueAdults),c.xp6(5),c.Oqu(S.valueChildren)}}function y(b,q){if(1&b&&(c.TgZ(0,"p",27),c._uU(1),c.qZA()),2&b){const S=c.oxw();c.xp6(1),c.AsE("*Children ages considered ",null==S.cruiseSelected?null:S.cruiseSelected.minimumAgeChild," to ",null==S.cruiseSelected?null:S.cruiseSelected.maximumAgeChild,"")}}function Y(b,q){if(1&b&&(c.TgZ(0,"p",27),c._uU(1),c.qZA()),2&b){const S=c.oxw();c.xp6(1),c.hij("Up to ",null==S.cruiseSelected?null:S.cruiseSelected.passengers," passengers")}}let J=(()=>{const q=class{constructor(T,E,u){this.cruiseService=T,this.purchaseRequestService=E,this.companyParamsService=u,this.valueAdults=0,this.valueChildren=0,this.isCharter=!1,this.purchaseRequestStatusType=o.I,this.cruiseName="",this.itineraryName="",this.bookingTrackCode="",this.valuePercent=0,this.ITERINDEX=0,this.cruiseSelected=T.getCruiseSelected(),this.cruiseWrapper=new v.S(this.cruiseSelected)}ngOnInit(){this.itineraries=this.cruiseService.getItineraries(),this.valuePercent=this.companyParamsService.getPercentPartialPayment(),this.cruiseName=this.cruiseSelected?this.cruiseSelected.name:"",this.itineraryName=this.cruiseService.getItineraryName(),this.bookingTrackCode=this.purchaseRequestService.getBookingTrackCode()}getPurchaseRequestStatus(){return this.purchaseRequestService.purchaseRequestStatus}getPurchaseCabinPassengers(){try{return this.purchaseRequestService.getPurchaseCabinPassengers()}catch(T){return console.log("TourSummary.getPurchaseCabinPassengers()"),console.error(T),[]}}getPurchaseCabinObjectSummary(){try{return this.purchaseRequestService.getPurchaseCabinObjectSummary()}catch(T){return console.log("TourSummaryComponent.getPurchaseRequestCabins()"),console.error(T),[]}}isPurchaseIncludeAirTickets(){try{return this.purchaseRequestService.isIncludeGalapagosAirTickets()}catch{return console.log("TourSummaryComponent.isPurchaseIncludeAirTickets()"),!1}}getGalapagosAirTicketsTotal(){try{if((0,f.le)(this.isPurchaseIncludeAirTickets())||!1===this.isPurchaseIncludeAirTickets())return 0;const T=this.purchaseRequestService.getPurchaseAirTicket();return(0,f.le)(T)?0:T.totalPurchaseAirTicketPrice}catch{return console.log("TourSummaryComponent.getGalapagosAirTicketsTotal()"),0}}getInvoiceText(){return this.purchaseRequestService.getPaymentMethod(),N.Y.TOTAL_BILLED}getPurchaseWithOutDiscount(){try{return this.purchaseRequestService.getTotalPriceWithoutDiscount()}catch(T){throw console.log("TourSummary.getPurchaseTotalPrice()"),console.error(T),T}}getTextTotalPaid(){try{let T="";return T=this.purchaseRequestService.getPaymentMethod().transfer?this.purchaseRequestService.getIsSelectedThirtyPerent()?`Initial deposit (${this.companyParamsService.getPercentPartialPayment()})% to be paid*`:N.Y.TOTAL_TO_BE_PAID:this.purchaseRequestService.getIsSelectedThirtyPerent()?`Initial deposit (${this.companyParamsService.getPercentPartialPayment()})% paid*`:N.Y.TOTAL_PAID,T}catch(T){return console.log("TourSummaryComponent.isPurchaseIncludeAirTickets()"),console.error(T),""}}getPurchaseTotalPrice(){try{return this.purchaseRequestService.getTotalPrice()}catch(T){throw console.log("TourSummary.getPurchaseTotalPrice()"),console.error(T),T}}isWithThirtyPercent(){try{return this.purchaseRequestService.getIsSelectedThirtyPerent()}catch(T){console.log("TourSummaryComponent.isPurchaseIncludeAirTickets()"),console.error(T)}}isIncludeAirFare(){try{return this.purchaseRequestService.isIncludeAirFare()}catch(T){return console.error(T),!1}}getCruiseItineraryDuration(){try{return this.purchaseRequestService.getCruiseWrapper().getCruiseItineraryDuration()}catch(T){return console.error(T),null}}};let b=q;return q.\u0275fac=function(E){return new(E||q)(c.Y36(k.G),c.Y36(e.v),c.Y36(D.N))},q.\u0275cmp=c.Xpm({type:q,selectors:[["app-tour-summary"]],inputs:{valueAdults:"valueAdults",valueChildren:"valueChildren",isCharter:"isCharter"},decls:33,vars:13,consts:[[1,"card","mb-3","mt-2","bg-gray","border-0"],[1,"card-header"],[1,"fs-24","mt-2"],[1,"card-body"],["class","alert-light border rounded p-2 mb-4",4,"ngIf"],["id","prices",4,"ngIf"],[4,"ngIf"],[1,"summary","text-muted","pb-1"],[1,"fa","fa-user-fr
1iends"],["cellpadding","3"],["class","small pb-3",4,"ngIf"],[3,"itineraries","isIncludeTableHeader","cruiseName","tourLengthShortName"],[1,"mt-4",2,"color","#900"],[1,"fs-13"],[1,"card-footer","pt-0"],["border","0","cellpadding","10","cellspacing","0","align","center"],["align","center","bgcolor","#DDDDDD",2,"border","0!important"],["href","https://www.paypal.com/us/webapps/mpp/paypal-popup","title","How PayPal Works","onclick","javascript:window.open('https://www.paypal.com/us/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;"],["src","https://www.paypalobjects.com/digitalassets/c/website/marketing/na/us/logo-center/9_bdg_secured_by_pp_2line.png","border","0","alt","Secured by PayPal"],[1,"alert-light","border","rounded","p-2","mb-4"],[1,"text-dark"],["id","prices"],[1,"fas","fa-coins"],[1,"p-2","text-dark","alert-light"],[4,"ngFor","ngForOf"],["scope","row",1,"blue","pr-3"],[1,"fs-24","orange"],[1,"small","pb-3"],[1,"fas","fa-bed"],["cellpadding","3",1,"mb-4"],["rowspan","2","scope","row",1,"pr-3","align-top","pl-0"],[1,"fs-24","text-muted"],["scope","row",1,"blue","fs-13","align-top"],[1,"fas","fa-map-marker-alt"],[1,"comp-features","pl-0","fs-13","mb-5"],["scope","row",1,"blue","pr-4"]],template:function(E,u){if(1&E&&(c.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),c._uU(3,"Tour Summary"),c.qZA()(),c.TgZ(4,"div",3),c.YNc(5,Q,4,1,"div",4),c.YNc(6,oe,4,0,"div",4),c.YNc(7,B,23,12,"ng-container",5),c.YNc(8,X,6,1,"ng-container",6),c.YNc(9,C,9,3,"ng-container",6),c.ynx(10),c.TgZ(11,"h5",7),c._UZ(12,"i",8),c._uU(13," Number of Passengers"),c.qZA(),c.TgZ(14,"table",9),c.YNc(15,P,11,2,"tbody",6),c.qZA(),c.YNc(16,y,2,2,"p",10),c.YNc(17,Y,2,1,"p",10),c._UZ(18,"app-itinerary-details",11),c.TgZ(19,"h5",12),c._uU(20,"IMPORTANT"),c.qZA(),c.TgZ(21,"p",13),c._uU(22,"*Remember you must arrive in the cities of Quito or Guayaquil to start your program."),c.qZA(),c.TgZ(23,"p",13),c._uU(24,"**We suggest that clients arrive in the country 48 hours before the cruise departure to avoid any loss due to flight delays or bad weather. "),c.qZA(),c.BQk(),c.qZA(),c.TgZ(25,"div",14)(26,"table",15)(27,"tr"),c._UZ(28,"td",16),c.qZA(),c.TgZ(29,"tr")(30,"td",16)(31,"a",17),c._UZ(32,"img",18),c.qZA()()()()()()),2&E){let ee,pe;c.xp6(5),c.Q6J("ngIf",u.getPurchaseRequestStatus()>=u.purchaseRequestStatusType.PAYMENT_COMPLETED&&!(null!=(ee=u.purchaseRequestService.getPaymentMethod())&&ee.transfer)),c.xp6(1),c.Q6J("ngIf",u.getPurchaseRequestStatus()>=u.purchaseRequestStatusType.PAYMENT_COMPLETED&&(null==(pe=u.purchaseRequestService.getPaymentMethod())?null:pe.transfer)),c.xp6(1),c.Q6J("ngIf",u.getPurchaseRequestStatus()>=u.purchaseRequestStatusType.CABINS_COMPLETED),c.xp6(1),c.Q6J("ngIf",u.getPurchaseRequestStatus()>=u.purchaseRequestStatusType.PASSENGER_COMPLETED),c.xp6(1),c.Q6J("ngIf",u.getPurchaseRequestStatus()>=u.purchaseRequestStatusType.PASSENGER_COMPLETED),c.xp6(6),c.Q6J("ngIf",!u.isCharter),c.xp6(1),c.Q6J("ngIf",!u.isCharter),c.xp6(1),c.Q6J("ngIf",u.isCharter),c.xp6(1),c.Q6J("itineraries",u.itineraries)("isIncludeTableHeader",!1)("cruiseName",u.cruiseName)("tourLengthShortName",u.itineraryName)("isIncludeTableHeader",!0)}},dependencies:[O.sg,O.O5,W.l,R.p]}),b})()},678:function(se,ie,_){se=_.nmd(se),function(){var f,o=[].indexOf||function(v){for(var f=0,N=this.length;f<N;f++)if(f in this&&this[f]===v)return f;return-1};f=function(){var v,f,N,c,oe,ue;return(N={}).cards=[{type:"visaelectron",pattern:/^4(026|17500|405|508|844|91[37])/,format:c=/(\d{1,4})/g,length:[16],cvcLength:[3],luhn:!0},{type:"maestro",pattern:/^(5(018|0[23]|[68])|6(39|7))/,format:c,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"forbrugsforeningen",pattern:/^600/,format:c,length:[16],cvcLength:[3],luhn:!0},{type:"dankort",pattern:/^5019/,format:c,length:[16],cvcLength:[3],luhn:!0},{type:"visa",pattern:/^4/,format:c,length:[13,16],cvcLength:[3],luhn:!0},{type:"mastercard",pattern:/^(5[1-5]|2[2-7])/,format:c,length:[16],cvcLength:[3],luhn:!0},{type:"amex",pattern:/^3[47]/,format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"dinersclub",pattern:/^3[0689]/,format:/(\d{1,4})(\d{1,6})?(\d{1,4})?/,length:[14],cvcLength:[3],luhn:!0},{type:"discover",pattern:/^6([045]|22)/,format:c,length:[16],cvcLength:[3],luhn:!0},{type:"unionpay",pattern:/^(62|88)/,format:c,length:[16,17,18,19],cvcLength:[3],luhn:!1}
1,{type:"jcb",pattern:/^35/,format:c,length:[16],cvcLength:[3],luhn:!0}],v=function(d){var h,m,C,P;for(d=(d+"").replace(/\D/g,""),m=0,C=(P=N.cards).length;m<C;m++)if((h=P[m]).pattern.test(d))return h},f=function(d){var h,m,C,P;for(m=0,C=(P=N.cards).length;m<C;m++)if((h=P[m]).type===d)return h},oe=function(d){var h,m,C,P,y,Y;for(y=!0,Y=0,C=0,P=(m=(d+"").split("").reverse()).length;C<P;C++)h=m[C],h=parseInt(h,10),(y=!y)&&(h*=2),h>9&&(h-=9),Y+=h;return Y%10==0},ue=function(d){var h,m,y,Y,J,b;for(null==d&&(d=""),b="",y=0,J=(m=d.split("")).length;y<J;y++)(Y="\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19".indexOf(h=m[y]))>-1&&(h="0123456789"[Y]),b+=h;return b},N.parseCardExpiry=function(d){var h,C,P;return h=(C=(d=d.replace(/\s/g,"")).split("/",2))[0],2===(P=C[1])?.length&&/^\d+$/.test(P)&&(P=(new Date).getFullYear().toString().slice(0,2)+P),{month:h=parseInt(h,10),year:P=parseInt(P,10)}},N.validateCardNumber=function(d){var h;return d=(d+"").replace(/\s+|-/g,""),!(!/^\d+$/.test(d)||(h=v(d),!h))&&o.call(h.length,d.length)>=0&&(!1===h.luhn||oe(d))},N.validateCardExpiry=function(d,h){var m,C,P;return"object"==typeof d&&"month"in d&&(d=(P=d).month,h=P.year),!!(d&&h&&(d=String(d).trim(),h=String(h).trim(),/^\d+$/.test(d))&&/^\d+$/.test(h)&&1<=d&&d<=12&&(2===h.length&&(h=h<70?"20"+h:"19"+h),4===h.length))&&(C=new Date(h,d),m=new Date,C.setMonth(C.getMonth()-1),C.setMonth(C.getMonth()+1,1),C>m)},N.validateCardCVC=function(d,h){var m;return d=String(d).trim(),!!/^\d+$/.test(d)&&(null!=(m=f(h))?o.call(m.cvcLength,d.length)>=0:d.length>=3&&d.length<=4)},N.parseCardType=function(d){var h;return d&&(null!=(h=v(d))?h.type:void 0)||null},N.formatCardNumber=function(d){var h,m,C;return d=(d=ue(d)).replace(/\D/g,""),(h=v(d))?(d=d.slice(0,h.length[h.length.length-1]),h.format.global?null!=(C=d.match(h.format))?C.join(" "):void 0:null==(m=h.format.exec(d))?void 0:(m.shift(),(m=m.filter(Boolean)).join(" "))):d},N.formatCardExpiry=function(d){var h,m,C,P;return(m=(d=ue(d)).match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))?(h=m[1]||"",C=m[2]||"",(P=m[3]||"").length>0?C=" / ":" /"===C?(h=h.substring(0,1),C=""):2===h.length||C.length>0?C=" / ":1===h.length&&"0"!==h&&"1"!==h&&(h="0"+h,C=" / "),h+C+P):""},N},null!==se?se.exports=f():_.amdD("creditcardutils",f)}.call(this)}}]);

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.