// Copyright 2014 Apple Inc.  All Rights Reserved.
(function(){return function(e,t,r){function a(e){return e=e.replace(/[^\d\sa-zA-z:\u6642]+/g," ").replace(/\s+/g," ").replace(/^(\d+)\s(\d+)\s/,"$1/$2/"),e=getFuzzyDate(n.getDetachedSpan(e))}var n=Scanner.fromMessage(e);n.setLocale(t);var o,p,i,c,s,m,l,h,u,g,d,f,C,v,S,y,R,T,k,P;o=n.getSpan().innerCapture(r.guestName,1),i=n.getSpan().innerCapture(r.reservationId,1),p=n.getSpan().innerCapture(r.guestEmail,1);var U="J net rental";T=""+n.getSpan().innerCapture(r.pickup,1),v=""+n.getSpan().innerCapture(r.dropoff,1),P=""+n.getSpan().innerCapture(r.pickupTime,1),P=a(P),y=""+n.getSpan().innerCapture(r.dropoffTime,1),y=a(y),g=""+n.getSpan().innerCapture(r.car,1);var z=n.getSpan().nextRegExp(r.price).tagContents().innerCapture(r.price,1);if(h=z.innerCapture(/([\d,.]+)/,1),u=z.innerCapture(/([^\d,.]+)/,1).trim(),r.confirmSubject.test(e.subject)){if(!ASSERT(o,i,P,y,T,v))return CONTINUE;c="Confirmed"}if(r.cancellationSubject.test(e.subject)){if(i=n.getSpan().innerCapture(r.cancellationReservationId,1),!ASSERT(o,i,P,y,T,v))return CONTINUE;c="Cancelled"}return 0===(""+g).length||null===g?[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:u,reservationId:i,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:s,modifyReservationUrl:m,cancelReservationUrl:l,underName:{"@type":"http://schema.org/Person",name:o,email:p},provider:{"@type":"http://schema.org/Organization",name:U},pickupTime:P,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:k,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:C,telephone:S,address:v}}]:[{"@context":"http://schema.org","@type":"http://schema.org/RentalCarReservation",totalPrice:h,priceCurrency:u,reservationId:i,reservationStatus:"http://schema.org/Reservation"+(c||"Confirmed"),checkinUrl:s,modifyReservationUrl:m,cancelReservationUrl:l,underName:{"@type":"http://schema.org/Person",name:o,email:p},provider:{"@type":"http://schema.org/Organization",name:U},reservationFor:{"@type":"http://schema.org/Car",brand:{"@type":"http://schema.org/Organization",name:g},license:d,color:f},pickupTime:P,pickupLocation:{"@type":"http://schema.org/Place",name:R,telephone:k,address:T},dropoffTime:y,dropoffLocation:{"@type":"http://schema.org/Place",name:C,telephone:S,address:v}}]}}).call();