// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){if(int(e.epoch)>1424822400){var r=loadHelper("national.com-microdata-parser.js"),a=r(e);if(a)return a}var i=Scanner.fromMessage(e);i.setLocale(t);var o,d,p,s,x,g,c,T,l,m,u,h,f,P,C,v,k,A,y,R,N;p=i.getSpan().innerCapture(regExpFormatted(/\1 (\d+)/,n.confirmationNumberPrefix),1),f=i.getSpan().nextText(n.detailsHeader).nextTag("table1"),f.exists()||(f=i.getSpan().nextText(n.detailsAlternateHeader).nextTag("table1")),o=f.innerText(n.namePrefix).nextTag("td1").nextTag("td1").tagContents(),d=f.innerText(n.emailPrefix).nextTag("td1").nextTag("td1").tagContents().innerCapture(/(.*)\s?/,1),m=f.innerText(n.vehicleTypePrefix).nextTag("td1").nextTag("td1").tagContents(),m=m.split("-"),m=m.length?m[m.length-1].trim():null;var S=f.innerText(n.pickupHeader).withEnd(f.innerText(n.dropoffHeader).getStart());A=S.innerText(n.pickupNamePrefix).nextTag("td1").nextTag("td1").tagContents(),N=S.innerText(n.pickupTimePrefix).nextTag("td1").nextTag("td1").innerDate(),y=S.innerText(n.pickupAddressPrefix).nextTag("td1").nextTag("td1"),y=y.tagContents().getLength()>y.innerAddress().getLength()||not(y.innerAddress())?y.tagContents():y.innerAddress(),R=S.innerText(n.pickupTelephonePrefix).nextTag("td1").nextTag("td1"),R=R.innerPhoneNumber()?R.innerPhoneNumber():R.tagContents();var b=f.innerText(n.dropoffHeader).withEnd(f.getEnd());P=b.innerText(n.pickupNamePrefix).nextTag("td1").nextTag("td1").tagContents(),k=b.innerText(n.pickupTimePrefix).nextTag("td1").nextTag("td1").innerDate(),C=b.innerText(n.pickupAddressPrefix).nextTag("td1").nextTag("td1"),C=C.tagContents().getLength()>C.innerAddress().getLength()||not(C.innerAddress())?C.tagContents():C.innerAddress(),C=not(C)&&valid(b.innerText(n.pickupAddressPrefix).parentTag("td1").innerAddress())?b.innerText(n.pickupAddressPrefix).parentTag("td1").innerAddress():b.innerCapture(regExpFormatted(/\1 ([-\w\n, ]+)\2/,n.pickupAddressPrefix,n.pickupTelephonePrefix),1).trim(),v=b.innerText(n.pickupTelephonePrefix).nextTag("td1").nextTag("td1"),v=v.innerPhoneNumber()?v.innerPhoneNumber():v.tagContents(),not(v)&&(v=b.innerCapture(regExpFormatted(/\1 ([-.+() \d]+)(?: ext|\n)/,n.pickupTelephonePrefix),1)),/^National Car Rental Reservation Cancellation/.test(e.subject)&&(s="Cancelled");var L=f.innerCapture(/\(($<priceCurrency>[A-Z]{3})\)\s+Approximate Estimated Conversion:\s+.*?($<totalPrice>[\d,.]+)/);if(T=L?L.$totalPrice:null,l=L?L.$priceCurrency:null,g=i.getSpan().nextText(n.modifyReservationUrlPrefix).nextLink(),c=i.getSpan().nextText(n.modifyReservationUrlPrefix).nextLink(),(not(P)||valid(P,A)&&""+A==""+P)&&(C=y,not(v)&&(v=R)),ASSERT(o,m,p,N,OR(A,y)))return[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:T,priceCurrency:l,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(s||"Confirmed"),checkinUrl:x,modifyReservationUrl:g,cancelReservationUrl:c,underName:{"@type":"http://schema.org/Person",name:o,email:d},provider:{"@type":"http://schema.org/Organization",name:"National"},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:m},license:u,color:h},pickupTime:N,pickupLocation:{"@type":"http://schema.org/Place",name:A,telephone:R,address:y},dropoffTime:k,dropoffLocation:{"@type":"http://schema.org/Place",name:P,telephone:v,address:C}}]}}).call();