// 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,c,d,m,x,u,C,l,T,h,E,S,y;if(!n.emailTitelConfirmation.test(e.subject)&&!n.emailTitelCancelConfirmation.test(e.subject))return CONTINUE;s=a.getSpan().nextRegExp(n.reservationId).parentAnyTag("td").tagContents().innerCapture(n.reservationIdRegExp,1),r=a.getSpan().nextRegExp(n.guestName).nextAnyTag("td").tagContents(),i=a.getSpan().nextRegExp(n.guestEmail).nextAnyTag("td").tagContents(),d=a.getSpan().nextRegExp(n.checkInDate).nextAnyTag("td").tagContents(),u=a.getSpan().nextRegExp(n.checkOutDate).nextAnyTag("td").tagContents(),c=a.getSpan().nextRegExp(n.checkInTime).nextAnyTag("td").tagContents().innerDate(),x=a.getSpan().nextRegExp(n.checkOutTime).nextAnyTag("td").tagContents().innerDate(),m=getFuzzyDate(a.getDetachedSpan(d+" "+c).innerDate()),C=getFuzzyDate(a.getDetachedSpan(u+" "+x).innerDate());var R=a.getSpan().nextRegExp(n.price).nextAnyTag("td").tagContents();g=R.innerCapture(/([\d,.]+)/,1),o=R.innerCapture(/([^\d,.]+)/,1).trim();var f=a.getSpan().nextRegExp(n.reservationId).parentTag("table3").nextTag("td3").tagContents();if(T=f.innerCapture(regExpFormatted(/(.+)</),1),l=f.innerLink(),h=f.innerPhoneNumber(),E=f.lastInnerAddress(),S=a.getSpan().nextRegExp(n.modifyUrl).parentAnyTag("td").tagContents().innerLink(),n.emailTitelConfirmation.test(e.subject)){if(!ASSERT(r,s,m,C,E))return CONTINUE;p="Confirmed"}if(n.emailTitelCancelConfirmation.test(e.subject)){if(!ASSERT(r,s,m,C,E))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:m,checkoutTime:C,modifyReservationUrl:S,cancelReservationUrl:y,reservationStatus:"http://schema.org/Reservation"+(p||"Confirmed"),reservationId:s,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:T,url:l,telephone:h,address:E}}]}}).call();