(function(){u8.Crm.Offline=function(){};$.extend(u8.Crm.Offline.prototype,{getJob:function(e){var t=this;u8.request("OfflineChannel.GetJob",{},function(n,r){return e&&e(t,r.error?r:r.response)})},startJob:function(e,t){var n=this;u8.request("OfflineChannel.StartJob",e,function(e,r){return t&&t(n,r.error?r:r.response)})},getSettings:function(e){var t=this;u8.request("OfflineChannel.GetSettings",{},function(n,r){return e&&e(t,r.error?r:r.response)})},getLatestSuccessfulSynchronizationDate:function(e){var t={statement:"select (Date, Time) from (C3) where (DestinationStation='$parStationNumber' AND Failure='') orderby (Date descending, Time descending)",options:{maxRows:1,parameters:{StationNumber:u8.session.environment.stationNumber}}};u8.services.queries.execute(t,function(t,n){if(!n.resultSet||!n.resultSet.rows||n.resultSet.rows.length==0){return e(this,{})}var r=n.resultSet.rows[0].values;var i=u8.services.typeConverter;var s=i.toDate(r[0]).addTime(i.toTime(r[1]));e(this,{value:s})})},isServerReachable:function(e){var t=this;u8.request("OfflineChannel.IsServerReachable",{},function(n,r){return e&&e(t,r.error?r:{value:r.response})})},isStationToReinitialize:function(e,t){var n=this;u8.request("OfflineChannel.IsStationToReinitialize",e,function(e,r){return t&&t(n,r.error?r:{value:r.response})})},getClientUrl:function(e){var t=this;u8.request("OfflineChannel.GetClientUrl",{},function(n,r){return e&&e(t,r.error?r:{value:r.response})})}});u8.services.add("offline",u8.Crm.Offline)})();