// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,n){var a=Scanner.fromMessage(e);a.setLocale(t);var r,o,p,i,g,s,c,d,l,T,x,h,m,u,C,v,f,y,S,b,F,k,A,R,E;if(regExpFormatted(/\1$/,n.cancelled).test(e.subject)&&(i="Cancelled"),u=a.getSpan().nextText(n.name).nextTag("table4").lastInnerTag("tr4"),r=u.innerTag("td4").tagContents(),o=u.lastInnerTag("td4").tagContents(),p=a.getSpan().innerCapture(regExpFormatted(/\1 (\w+)\s/,n.reservationId),1),E=a.getSpan().nextText(n.price).nextTag("td3").nextTag("td3").tagContents(),d=E.innerCapture(/([\d,.]+)/,1),l=E.innerCapture(/([^\d,.]+)/,1),T=a.getSpan().nextText(n.pickup).previousTag("table4").nextTag("td4").nextTag("td4").nextTag("td4").tagContents(),c=a.getSpan().nextText(n.cancelReservationUrl).nextLink(),b=a.getSpan().nextText(n.pickup).parentAnyTag("table"),R=b.innerDate(),u=b.innerTag("table5").allInnerTagsFiltered("td5").map(function(e){return""+e}),u.length>=2&&(F=u[0],k=a.getDetachedSpan(u.slice(1).join("-"))),A=b.innerText("Phone:").parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1 (.*)/,n.phone),1),C=a.getSpan().nextText(n.dropoff).parentAnyTag("table"),S=C.innerDate(),u=C.innerTag("table5").allInnerTagsFiltered("td5").map(function(e){return""+e}),u.length>=2?(v=u[0],f=a.getDetachedSpan(u.slice(1).join("-")),y=b.innerText(n.phone).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/\1 (.*)/,n.phone),1)):C.innerText(n.sameLocationAsPickup).exists()&&(v=F,f=k,y=A),m=a.getSpan().nextText(n.provider).parentAnyTag("td").tagContents().innerCapture(regExpFormatted(/(.*)\s+\1/,n.provider),1),not(m)&&(m=F),ASSERT(m,r,T,k,R))return[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:d,priceCurrency:l,reservationId:p,reservationStatus:"http://schema.org/Reservation"+(i||"Confirmed"),checkinUrl:g,modifyReservationUrl:s,cancelReservationUrl:c,underName:{"@type":"http://schema.org/Person",name:r},provider:{"@type":"http://schema.org/Organization",name:m},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:T},license:x,color:h},pickupTime:R,pickupLocation:{"@type":"http://schema.org/Place",name:F,telephone:A,address:k},dropoffTime:S,dropoffLocation:{"@type":"http://schema.org/Place",name:v,telephone:y,address:f}}]}}).call();