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