module.exports = "(function(e,r,i){var t=i(5894),n=i(9970),o=i(9921),c=i(232);function u(e,r){var i=o.buildFromSpecV0_1(r);if(1!==i.length)throw new Error(\"Invalid query descriptor; verify that no aggregators are specified\");return c.execute(i[0],e)}function f(e,r){return t.map(e,(function(e){return t.isFunction(e.toObject)?e.toObject(r):e}))}function s(e,r){if(!e)return[\"Descriptor not defined\"];var i=[];return e.count&&i.push('Unexpected \"count\" clause specified'),e.pick&&e.pick.modifier&&-1===r.indexOf(e.pick.modifier)&&i.push('Invalid \"pick\" modifier \"'+e.pick.modifier+'\"'),t.each(e.filters,(function(e){t.isUndefined(e.modifier)||i.push('Unexpected \"filter\" modifier \"'+e.modifier+'\"')})),i.length>0?i:void 0}function a(e,r){var i={revenueAsTag:!1,timeAsTimestamp:!0};if(t.isUndefined(r))return f(n.getEvents(e),i);if(t.isNumber(r)){if(r<=0)throw new Error(\"Count must be a positive integer, got \"+r);return f(n.getEvents(e).slice(-r),i)}var c=s(r,t.values(o.RECENCY_FILTERS));if(c)throw new Error(c.join(\"\\n\"));return f(u(n.getEvents(e),r),i)}function d(e,r){if(!(r=t.cloneDeep(r)||{}).pick)throw new Error('No \"pick\" clause provided in query descriptor');if(!r.pick.name)throw new Error('No field name provided in \"pick\" clause');r.pick.modifier=r.pick.modifier||o.FREQUENCY_FILTERS.MOST_FREQUENT;var i=s(r,t.values(o.FREQUENCY_FILTERS));if(i)throw new Error(i.join(\"\\n\"));return u(n.getEvents(e),r)}function p(e,r){var i=o.buildFromSpecV0_2(r),u=n.getEvents(e),s=f(c.execute(i,u),{revenueAsTag:!0,timeAsTimestamp:!1});return(r.pick||r.reduce&&\"count\"===r.reduce.aggregator)&&(s=t.flatten(s)),r.reduce&&(s=s[0]),s}e.exports=[\"stores/visitor_events\",function(e){return{getEvents:t.partial(a,e),getByFrequency:t.partial(d,e),query:t.partial(p,e)}}]})";