module.exports = "(function(e,S,I){var t=I(8361).J,a=I(9404),u=I(3219),E=I(8361)._;S.CURRENT_SESSION_INDEX=0;var n=18e5;function D(e,I){var t;t=S.isInSameSession(e,I)?e.getValueOrDefault([u.FIELDS.SESSION_ID]):I.getValueOrDefault([u.FIELDS.TIME]),I.setFieldValue(u.FIELDS.SESSION_ID,t)}function r(e,I,t){var a,E=e.getValueOrDefault([u.FIELDS.SESSION_INDEX]);a=S.isInSameSession(I,e)?E:t?E+1:E-1,I.setFieldValue(u.FIELDS.SESSION_INDEX,a)}S.isInSameSession=function(e,S){var I=e.getValueOrDefault([u.FIELDS.TIME],0),t=S.getValueOrDefault([u.FIELDS.TIME],0);return this.isTimestampInSameSession(I,t)},S.isTimestampInSameSession=function(e,S){return Math.abs(e-S)<n},S.updateSessionId=function(e,S){if(!e)return S.setFieldValue(u.FIELDS.SESSION_ID,S.getValueOrDefault([u.FIELDS.TIME])),void 0;var I=e.getValueOrDefault([u.FIELDS.TIME]),a=e.getValueOrDefault([u.FIELDS.SESSION_ID]),n=S.getValueOrDefault([u.FIELDS.TIME]);I=\"number\"!=typeof I?n-36e5:I,a=\"number\"!=typeof a?I:a,D(e=new t(new E(\"\",\"\"),I,a),S)},S.updateSessionIndex=function(e,S){if(!e)return S.setFieldValue(u.FIELDS.SESSION_INDEX,0),void 0;var I=e.getValueOrDefault([u.FIELDS.TIME]),a=e.getValueOrDefault([u.FIELDS.SESSION_INDEX]),n=S.getValueOrDefault([u.FIELDS.TIME]),D=e.getValueOrDefault([u.FIELDS.SESSION_ID]);I=\"number\"!=typeof I?n-36e5:I,a=\"number\"!=typeof a?0:a,D=\"number\"!=typeof D?I:D,r(e=new t(new E(\"\",\"\"),I,D,a),S,!1)},S.sessionize=function(e){var I=e.length;if(0!==I){e[0].setFieldValue(u.FIELDS.SESSION_ID,e[0].getValueOrDefault([u.FIELDS.TIME]));for(var t=1;t<I;t++)D(e[t-1],e[t]);var E=S.CURRENT_SESSION_INDEX,l=e[I-1].getValueOrDefault([u.FIELDS.TIME]);a.now()-l>n&&(E+=1),e[I-1].setFieldValue(u.FIELDS.SESSION_INDEX,E);for(t=I-1;t>0;t--)r(e[t],e[t-1],!0)}},S.reindexIfNecessary=function(e,S,I){var t=function(e){for(var S=0;S<e.length;S++){var I=e[S].getValueOrDefault([u.FIELDS.SESSION_INDEX]);e[S].setFieldValue(u.FIELDS.SESSION_INDEX,I+1)}};-1===e.getValueOrDefault([u.FIELDS.SESSION_INDEX])&&(t(S),t(I))},S.sessionSortPredicate=function(e,S){return e[u.FIELDS.TIME]-S[u.FIELDS.TIME]},S.applyMigrations=function(e){return!1}})";