// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var r=Scanner.fromMessage(e);r.setLocale(t);var a,i,o,s,c,g,p,x,h,m=r.getSpan(),d=n.isCancellation?"Cancelled":"Confirmed";c=m.nextText(n.hotelNamePrefix).nextText(n.reservationIdPrefix).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1\s?(.+)/,n.reservationIdPrefix),1),a=m.innerCapture(n.underPersonNameRegExp,1).tagContents();var l=m.nextText(n.hotelNamePrefix).nextTag("table3").nextTag("table3").allInnerTags("td3").map(function(e){return e.tagContents()});l&&l.length>3&&(i=l[0],s=r.getDetachedSpan(l[2]+", "+l[3]),l[5]&&(o=l[5])),g=m.next(n.checkInDateTimePrefix).nextDate(),p=m.next(n.checkOutDateTimePrefix).nextDate();var u=m.innerCapture(regExpFormatted(/\1\s?([\d\,\.]+)\s?(\D{1,3})/,n.pricePrefix));if(u&&u!==r.getNullSpan()&&3===u.length?[,x,h]=u:(u=m.innerCapture(regExpFormatted(/\1\s(\D)\s?([\d\,\.]+)/,n.pricePrefix)),u&&3===u.length?[,h,x]=u:(u=m.innerCapture(regExpFormatted(/\1\s?([\d\,\.]+)\s(\D)/,n.pricePrefix)),u&&3===u.length&&([,h,x]=u))),ASSERT(g,OR(i,s)))return[{"@context":"http://schema.org","@type":"http://schema.org/LodgingReservation",underName:{"@type":"http://schema.org/Person",name:a},totalPrice:x,priceCurrency:h,checkinTime:g,checkoutTime:p,reservationStatus:"http://schema.org/Reservation"+d,reservationId:c,reservationFor:{"@type":"http://schema.org/LodgingBusiness",name:i,telephone:o,address:s}}]}}).call();