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