// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var a=Scanner.fromMessage(e);a.setLocale(t);var r,i,g,o,s,p,x,c,d,m,u,l,C,T,h,y,S,E;if(!n.emailTitelConfirmation.test(e.subject)&&!n.emailTitelCancelConfirmation.test(e.subject))return CONTINUE;s=a.getSpan().nextRegExp(n.reservationId).nextAnyTag("td").tagContents().innerCapture(/([\w\d]+)/,1),r=a.getSpan().nextRegExp(n.guestName).nextAnyTag("td").tagContents(),i=a.getSpan().nextRegExp(n.guestEmail).nextAnyTag("td").tagContents(),c=a.getSpan().nextRegExp(n.checkInDate).nextAnyTag("td").tagContents().innerDate(),x=a.getSpan().nextRegExp(n.checkInTime).nextDate(),u=a.getSpan().nextRegExp(n.checkOutDate).nextAnyTag("td").tagContents().innerDate(),m=a.getSpan().nextRegExp(n.checkOutTime).nextDate(),d=getFuzzyDate(a.getDetachedSpan(c+" "+x).innerDate()),l=getFuzzyDate(a.getDetachedSpan(u+" "+m).innerDate());var R=a.getSpan().nextRegExp(n.price).nextAnyTag("td").tagContents();g=R.innerCapture(/([\d,.]+)/,1),o=R.innerCapture(/([^\d,.]+)/,1).trim(),S=E=a.getSpan().nextRegExp(n.reservationId).nextAnyTag("td").tagContents().innerLink();var f=a.getSpan().nextRegExp(n.hotelInfo).nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").nextAnyTag("td").tagContents();if(T=f.innerCapture(regExpFormatted(/(.+)/),1),C=a.getSpan().nextRegExp(n.hotelInfo).nextLink(),h=f.innerPhoneNumber(),y=f.innerCapture(n.hotelAddress,1).trim(),n.emailTitelConfirmation.test(e.subject)){if(!ASSERT(r,s,d,l,y))return CONTINUE;p="Confirmed"}if(n.emailTitelCancelConfirmation.test(e.subject)){if(T="Rendezvous Hotels",!ASSERT(r,s,d,l,T))return CONTINUE;p="Cancelled"}return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:r,email:i},totalPrice:g,priceCurrency:o,checkinTime:d,checkoutTime:l,modifyReservationUrl:S,cancelReservationUrl:E,reservationStatus:"http://schema.org/Reservation"+(p||"Confirmed"),reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:T,url:C,telephone:h,address:y}}]}}).call();