/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@altronix/linq-io-react@0.0.20/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var axios=_interopDefault(require("axios")),operators=require("rxjs/operators"),reduxObservable=require("redux-observable"),rxjs=require("rxjs"),redux=require("redux"),ajax=axios,login=function(t,e){axios.defaults.headers.common.Authorization="Basic "+btoa(t+":"+e)},__assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var s in e=arguments[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},__assign.apply(this,arguments)},IO_REQUEST="io/request",IO_RESPONSE="io/response",IO_ERROR="io/error",request=function(t,e,r){var o=e?"POST":"GET",s=t,i=t.split(" "),n=i[0];i.length>1&&isRequestType(n)&&(o=n,s=i.slice(1).join(" "));var a={type:IO_REQUEST,url:s,method:o,meta:r};return e&&(a.data=e),a},response=function(t,e,r){return{type:IO_RESPONSE,request:e,data:t,meta:r}},error=function(t,e,r){return{type:IO_ERROR,request:e,error:t,meta:r}},actionCreator=function(t){return function(e){return e?__assign({},e,{type:t}):{type:t}}},responseFrom=function(t,e){return void 0===e&&(e="GET"),function(r){return r.pipe(reduxObservable.ofType(IO_RESPONSE),operators.filter((function(r){return r.request.url===t&&e===r.request.method})),operators.take(1))}};function isRequestType(t){return"GET"===t||"POST"===t||"DELETE"===t}var Actions,makeRequest=function(t){return rxjs.from(new Promise((function(e,r){!function t(o){("POST"===o.method?ajax.post(o.url,o.data):"DELETE"===o.method?ajax.delete(o.url):ajax.get(o.url)).then((function(t){return e(t)})).catch((function(e){e.response&&504==e.response.status?setTimeout((function(){return t(o)}),500):r(e)}))}(t)})))},requestEpic=function(t){return t.pipe(reduxObservable.ofType(IO_REQUEST),operators.concatMap((function(t){return makeRequest(t).pipe(operators.map((function(e){return response(e.data,t)})),operators.catchError((function(e){return rxjs.of(error(e,t))})),operators.delay(300))})))};!function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/about/get",t.REQUEST_POST="io/request/about/post",t.RESPONSE_GET="io/response/about/get",t.RESPONSE_POST="io/response/about/post",t.EDIT="io/edit/about",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())}}}}(Actions||(Actions={})),function(t){t.bitmapToArray=function(t,e){var r=[];t.toString(2).split("").forEach((function(t){r.push(parseInt(t))}));for(var o=r.length;o<e;o++)r.unshift(0);return r},t.arrayToBitmap=function(t){return parseInt(t.join(""),2)},t.diff=function(e,r){var o,s={};for(var i in e){var n=typeof e[i];"string"===n||"number"===n||"boolean"===n?e[i]!==r[i]&&(s=Object.assign({},s,((o={})[i]=e[i],o))):"object"===n&&(s[i]=t.diff(e[i],r[i]))}return s},t.isDiff=function(e,r){return!!Object.keys(t.diff(e,r)).length},t.convertBooleansToNumbers=function(e,r){var o={};return r.forEach((function(r){var s=e[r];"boolean"==typeof s&&(o[r]=t.boolToNum(s))})),o},t.convertNumbersToBooleans=function(e,r){var o={};return r.forEach((function(r){var s=e[r];"number"==typeof s&&(o[r]=t.numToBool(s))})),o},t.convertUxToServer=function(e,r){var o={};return r.forEach((function(r){var s=e[r];"number"==typeof s&&(o[r]=t.scaleServer(s))})),o},t.convertServerToUx=function(e,r){var o={};return r.forEach((function(r){var s=e[r];"number"==typeof s&&(o[r]=t.scaleUx(s))})),o},t.numToBool=function(t){return 1==t},t.boolToNum=function(t){return 1==t?1:0},t.scaleUx=function(t,e){return void 0===e&&(e=2),parseFloat((t/1e3).toFixed(e))},t.scaleServer=function(t){return 1e3*t},t.selectMap=function(t,e){return"number"==typeof t?e[t]:e.indexOf(t)}}(exports.Utils||(exports.Utils={}));var About,Actions$2,IpConfigOnReboot,Actions$4,Utils=exports.Utils,fromServer=function(t){return __assign({},t,{policies:exports.Utils.bitmapToArray(t.policies,3)})},toServer=function(t){return __assign({},t,{policies:exports.Utils.arrayToBitmap(t.policies)})},ImportFilters=Object.freeze({fromServer:fromServer,toServer:toServer});!function(t){t.Actions=Actions,t.Filters=ImportFilters}(About||(About={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/ipconfigonreboot/get",t.REQUEST_POST="io/request/ipconfigonreboot/post",t.RESPONSE_GET="io/response/ipconfigonreboot/get",t.RESPONSE_POST="io/response/ipconfigonreboot/post",t.EDIT="io/edit/ipconfigonreboot",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())}}}}(Actions$2||(Actions$2={})),function(t){t.Actions=Actions$2}(IpConfigOnReboot||(IpConfigOnReboot={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/alertsRecent/get",t.REQUEST_POST="io/request/alertsRecent/post",t.RESPONSE_GET="io/response/alertsRecent/get",t.RESPONSE_POST="io/response/alertsRecent/post",t.EDIT="io/edit/alertsRecent",t.POLL_START="io/poll/alertsRecent/start",t.POLL_STOP="io/poll/alertsRecent/stop",t.ALERT_SET="io/alertsRecent/set/alert",t.ALERT_CLR="io/alertsRecent/clr/alert",t.ALERT_CANCEL="io/alertsRecent/clr/cancel",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.alertSet=actionCreator(t.ALERT_SET),t.alertClr=actionCreator(t.ALERT_CLR),t.alertCancel=actionCreator(t.ALERT_CANCEL),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))},close:function(){return r(t.alertClr())},cancel:function(){return r(t.alertCancel())}}}}(Actions$4||(Actions$4={}));var AlertsRecent,Actions$6,fromServer$1=function(t){var e=new Date(1e3*t.when);return Object.assign({},t,{when:e.toLocaleDateString()+" "+e.toLocaleTimeString()})},ImportFilters$1=Object.freeze({fromServer:fromServer$1});!function(t){t.Actions=Actions$4,t.Filters=ImportFilters$1}(AlertsRecent||(AlertsRecent={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/unix/get",t.REQUEST_POST="io/request/unix/post",t.REQUEST_SYNC="io/request/unix/sync",t.RESPONSE_GET="io/response/unix/get",t.RESPONSE_POST="io/response/unix/post",t.RESPONSE_SYNC="io/response/unix/sync",t.POLL_START="io/poll/unix/start",t.POLL_STOP="io/poll/unix/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.syncRequest=actionCreator(t.REQUEST_SYNC),t.syncResponse=actionCreator(t.RESPONSE_SYNC),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.fetchRequest=e,t.bindDispatchProps=function(r){return{fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))},sync:function(){return r(t.syncRequest({data:{unix:Math.round(Date.now()/1e3)}}))}}}}(Actions$6||(Actions$6={}));var Unix,Actions$8,Rtc,fromServer$2=function(t){var e=new Date(1e3*t.unix);return __assign({},t,{unix:e.toLocaleDateString()+" "+e.toLocaleTimeString()})},toServer$1=function(t){return __assign({},t,{unix:Date.parse(t.unix)/1e3})},ImportFilters$2=Object.freeze({fromServer:fromServer$2,toServer:toServer$1});!function(t){t.Actions=Actions$6,t.Filters=ImportFilters$2}(Unix||(Unix={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/rtc/get",t.REQUEST_POST="io/request/rtc/post",t.RESPONSE_GET="io/response/rtc/get",t.RESPONSE_POST="io/response/rtc/post",t.EDIT="io/edit/rtc",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())}}}}(Actions$8||(Actions$8={})),function(t){t.Actions=Actions$8}(Rtc||(Rtc={}));var Actions$a,getEpic=function(t){return t.pipe(reduxObservable.ofType(Actions.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/about"),operators.map((function(t){return Actions.getResponse({data:t.data})})),operators.startWith(request("/ATX/about")))})))},postEpic=function(t){return t.pipe(reduxObservable.ofType(Actions.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/about","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions.postResponse({data:t.data})),rxjs.of(Actions.getRequest()))})),operators.startWith(request("/ATX/about",e.data)))})))},AboutEpics=reduxObservable.combineEpics(getEpic,postEpic);!function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/ipconfig/get",t.REQUEST_POST="io/request/ipconfig/post",t.RESPONSE_GET="io/response/ipconfig/get",t.RESPONSE_POST="io/response/ipconfig/post",t.EDIT="io/edit/ipconfig",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())}}}}(Actions$a||(Actions$a={}));var _a,getEpic$1=function(t){return t.pipe(reduxObservable.ofType(Actions$a.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/network/ipConfig"),operators.map((function(t){return Actions$a.getResponse({data:t.data})})),operators.startWith(request("/ATX/network/ipConfig")))})))},postEpic$1=function(t){return t.pipe(reduxObservable.ofType(Actions$a.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/network/ipConfig","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$a.postResponse({data:t.data})),rxjs.of(Actions$a.getRequest()))})),operators.startWith(request("/ATX/network/ipConfig",e.data)))})))},IpConfigEpics=reduxObservable.combineEpics(getEpic$1,postEpic$1),getEpic$2=function(t){return t.pipe(reduxObservable.ofType(Actions$2.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/sys/onReboot/network/ipConfig"),operators.map((function(t){return Actions$2.getResponse({data:t.data})})),operators.startWith(request("/ATX/sys/onReboot/network/ipConfig")))})))},postEpic$2=function(t){return t.pipe(reduxObservable.ofType(Actions$2.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/sys/onReboot/network/ipConfig","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$2.postResponse({data:t.data})),rxjs.of(Actions$2.getRequest()))})),operators.startWith(request("/ATX/sys/onReboot/network/ipConfig",e.data)))})))},IpConfigOnRebootEpics=reduxObservable.combineEpics(getEpic$2,postEpic$2),getEpic$3=function(t){return t.pipe(reduxObservable.ofType(Actions$4.REQUEST_GET),operators.mergeMap((function(){return t.pipe(responseFrom("/ATX/alerts"),operators.mergeMap((function(t){return rxjs.of(Actions$4.getResponse({data:t.data}))})),operators.startWith(request("/ATX/alerts")))})))},setAlertEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$4.RESPONSE_GET),operators.switchMap((function(e){return rxjs.from(e.data.alerts.recent.reverse().slice(0,e.diff)).pipe(operators.concatMap((function(e){return rxjs.timer(1,1e4).pipe(operators.mergeMap((function(){return rxjs.of(Actions$4.alertSet({data:e})).pipe(operators.delay(200))})),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$4.ALERT_CLR))))})),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$4.ALERT_CANCEL))))})))},clrAlertEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$4.ALERT_SET),operators.concatMap((function(){return rxjs.of(Actions$4.alertClr()).pipe(operators.delay(6e3),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$4.ALERT_CLR))))})))},cancelAlertEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$4.ALERT_CANCEL),operators.mergeMap((function(){return rxjs.from([Actions$4.alertClr()])})))},pollEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$4.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$4.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$4.getRequest()})),operators.repeat(),operators.startWith(Actions$4.getRequest()),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$4.POLL_STOP))))})))},alertsRecentEpics=reduxObservable.combineEpics(getEpic$3,setAlertEpic,clrAlertEpic,cancelAlertEpic,pollEpic),getEpic$4=function(t){return t.pipe(reduxObservable.ofType(Actions$6.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/timers/unix"),operators.map((function(t){return Actions$6.getResponse({data:t.data})})),operators.startWith(request("/ATX/timers/unix")))})))},postEpic$3=function(t){return t.pipe(reduxObservable.ofType(Actions$6.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/timers/unix","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$6.postResponse({data:t.data})),rxjs.of(Actions$6.getRequest()))})),operators.startWith(request("/ATX/timers/unix",e.data)))})))},syncEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$6.REQUEST_SYNC),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/timers/unix","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$6.syncResponse({data:t.data})),rxjs.of(Actions$6.getRequest()))})),operators.startWith(request("/ATX/timers/unix",e.data)))})))},pollEpic$1=function(t){return t.pipe(reduxObservable.ofType(Actions$6.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$6.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$6.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$6.POLL_STOP))),operators.startWith(Actions$6.getRequest()))})))},unixEpics=reduxObservable.combineEpics(getEpic$4,postEpic$3,syncEpic,pollEpic$1),getEpic$5=function(t){return t.pipe(reduxObservable.ofType(Actions$8.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/timers/rtc"),operators.map((function(t){return Actions$8.getResponse({data:t.data})})),operators.startWith(request("/ATX/timers/rtc")))})))},postEpic$4=function(t){return t.pipe(reduxObservable.ofType(Actions$8.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/timers/rtc/comp","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$8.postResponse({data:t.data})),rxjs.of(Actions$8.getRequest()),rxjs.of(request("/ATX/exe/save",{save:1})))})),operators.startWith(request("/ATX/timers/rtc/comp",e.data)))})))},rtcEpics=reduxObservable.combineEpics(getEpic$5,postEpic$4),Epics=reduxObservable.combineEpics(requestEpic,AboutEpics,IpConfigEpics,IpConfigOnRebootEpics,alertsRecentEpics,unixEpics,rtcEpics),storeInit=function(t){return{data:Object.assign(t instanceof Array?[]:{},t),form:Object.assign(t instanceof Array?[]:{},t),submitRequired:!1,loadingGet:!1,loadingPost:!1,status:"INIT",statusMessage:""}},initialAbout={siteId:"",prjVersion:"",productKey:"",product:"",mqxVersion:"",atxVersion:"",sslVersion:"",webVersion:"",mfg:"",user:"",mac:"",sid:"",policies:[]},initial=storeInit(initialAbout),aboutReducer=function(t,e){switch(void 0===t&&(t=initial),e.type){case Actions.REQUEST_POST:return __assign({},t,{loadingPost:!0});case Actions.REQUEST_GET:return __assign({},t,{loadingGet:!0});case Actions.RESPONSE_GET:return __assign({},t,{status:"OK",data:fromServer(e.data.about),form:fromServer(e.data.about),submitRequired:!1,loadingGet:!1});case Actions.RESPONSE_POST:return __assign({},t,{loadingPost:!1});case Actions.EDIT:var r=Object.assign({},t.form,e.data),o=!!Object.keys(exports.Utils.diff(r,t.data)).length;return __assign({},t,{form:r},{submitRequired:o});default:return t}},initialData={recent:[],count:-1},initial$1={data:initialData,form:initialData,submitRequired:!1,loadingGet:!1,loadingPost:!1,status:"INIT",statusMessage:"",pending:0};function createReducerActions(t,e){return function(r,o){void 0===r&&(r=e);var s=t[o.type];return s?s(r,o):r}}var actions=((_a={})[Actions$4.REQUEST_GET]=getRequest,_a[Actions$4.REQUEST_POST]=postRequest,_a[Actions$4.RESPONSE_GET]=getResponse,_a[Actions$4.RESPONSE_POST]=postResponse,_a[Actions$4.EDIT]=edit,_a[Actions$4.ALERT_SET]=alertSet,_a[Actions$4.ALERT_CLR]=alertClr,_a[Actions$4.ALERT_CANCEL]=alertCancel,_a),alertsRecentReducer=createReducerActions(actions,initial$1);function getRequest(t){return __assign({},t,{loadingGet:!0})}function getResponse(t,e){if(!e.data.alerts)return __assign({},t);e.diff=t.data.count>0?e.data.alerts.count-t.data.count:0;var r=e.diff,o=e.data.alerts.recent.map((function(t){return fromServer$1(t)})),s=Object.assign({},t.data,{recent:o,count:e.data.alerts.count});return __assign({},t,{status:"OK",data:Object.assign({},s),form:Object.assign({},s),submitRequired:!1,loadingGet:!1,pending:r})}function postRequest(t){return __assign({},t,{loadingPost:!0})}function postResponse(t){return __assign({},t,{loadingPost:!1})}function edit(t){return __assign({},t)}function alertSet(t,e){return __assign({},t,{alert:fromServer$1(e.data)})}function alertClr(t){var e=t.pending>0?t.pending-1:0;return __assign({},t,{pending:e,alert:void 0})}function alertCancel(t){var e={count:-1,recent:t.data.recent};return __assign({},t,{pending:0,data:Object.assign({},e)})}var _a$1,initialIpConfig={ip:"",sn:"",gw:"",meth:"STATIC"},initial$2=storeInit(initialIpConfig),ipConfigReducer=function(t,e){switch(void 0===t&&(t=initial$2),e.type){case Actions$a.REQUEST_POST:return __assign({},t,{loadingPost:!0});case Actions$a.REQUEST_GET:return __assign({},t,{loadingGet:!0});case Actions$a.RESPONSE_GET:return __assign({},t,{status:"OK",data:e.data.ipConfig,form:e.data.ipConfig,submitRequired:!1,loadingGet:!1});case Actions$a.RESPONSE_POST:return __assign({},t,{loadingPost:!1});case Actions$a.EDIT:var r=Object.assign({},t.form,e.data),o=!!Object.keys(exports.Utils.diff(r,t.data)).length;return __assign({},t,{form:r},{submitRequired:o});default:return t}},initialIpConfigOnReboot={ip:"",sn:"",gw:"",meth:"STATIC"},initial$3=storeInit(initialIpConfigOnReboot),ipConfigReducer$1=function(t,e){switch(void 0===t&&(t=initial$3),e.type){case Actions$2.REQUEST_POST:return __assign({},t,{loadingPost:!0});case Actions$2.REQUEST_GET:return __assign({},t,{loadingGet:!0});case Actions$2.RESPONSE_GET:return __assign({},t,{status:"OK",data:e.data.ipConfig,form:e.data.ipConfig,submitRequired:!1,loadingGet:!1});case Actions$2.RESPONSE_POST:return __assign({},t,{loadingPost:!1});case Actions$2.EDIT:var r=Object.assign({},t.form,e.data),o=!!Object.keys(exports.Utils.diff(r,t.data)).length;return __assign({},t,{form:r},{submitRequired:o});default:return t}},initial$4={loading:!1,pending:[],total:[],ping:0},actions$1=((_a$1={})[IO_REQUEST]=ioRequest,_a$1[IO_RESPONSE]=ioResponse,_a$1[IO_ERROR]=ioError,_a$1);function ioRequest(t){var e=Object.assign([],t.pending);return e.push({start:(new Date).getTime(),finish:0}),__assign({},t,{pending:e,loading:!0})}function ioResponse(t){var e=Object.assign([],t.pending),r=Object.assign([],t.total),o=e.shift(),s=-1;return o&&(o.finish=(new Date).getTime(),s=o.finish-o.start,r.push(o)),__assign({},t,{ping:s,pending:e,total:r,loading:!1})}function ioError(t){var e=Object.assign([],t.pending),r=Object.assign([],t.total),o=e.shift(),s=-1;return o&&(o.finish=(new Date).getTime(),s=o.finish-o.start,r.push(o)),__assign({},t,{ping:s,pending:e,total:r,loading:!1})}var Actions$c,AjaxReducer=createReducerActions(actions$1,initial$4),initialState={unix:""},initial$5=storeInit(initialState),unixReducer=function(t,e){switch(void 0===t&&(t=initial$5),e.type){case Actions$6.REQUEST_POST:return __assign({},t,{loadingPost:!0});case Actions$6.REQUEST_GET:return __assign({},t,{loadingGet:!0});case Actions$6.REQUEST_SYNC:return __assign({},t,{loadingPost:!0});case Actions$6.RESPONSE_GET:return __assign({},t,{status:"OK",data:fromServer$2(e.data),form:fromServer$2(e.data),submitRequired:!1,loadingGet:!1});case Actions$6.RESPONSE_POST:case Actions$6.RESPONSE_SYNC:return __assign({},t,{loadingPost:!1});default:return t}},initialRtc={tcr:0,cir:0},initial$6=storeInit(initialRtc),rtcReducer=function(t,e){switch(void 0===t&&(t=initial$6),e.type){case Actions$8.REQUEST_POST:return __assign({},t,{loadingPost:!0});case Actions$8.REQUEST_GET:return __assign({},t,{loadingGet:!0});case Actions$8.RESPONSE_GET:return __assign({},t,{status:"OK",data:e.data.rtc,form:e.data.rtc,submitRequired:!1,loadingGet:!1});case Actions$8.RESPONSE_POST:return __assign({},t,{loadingPost:!1});case Actions$8.EDIT:var r=Object.assign({},t.form,e.data),o=!!Object.keys(exports.Utils.diff(r,t.data)).length;return __assign({},t,{form:r},{submitRequired:o});default:return t}},Reducer=redux.combineReducers({io:AjaxReducer,about:aboutReducer,ipConfig:ipConfigReducer,ipConfigOnReboot:ipConfigReducer$1,alertsRecent:alertsRecentReducer,unix:unixReducer,rtc:rtcReducer});!function(t){t.Epics=Epics,t.Reducer=Reducer,t.About=About,t.IpConfigOnReboot=IpConfigOnReboot,t.AlertsRecent=AlertsRecent,t.Unix=Unix,t.Rtc=Rtc,t.bindDispatchProps=function(e){return{dispatch:{about:t.About.Actions.bindDispatchProps(e),ipConfigOnReboot:t.IpConfigOnReboot.Actions.bindDispatchProps(e),alertsRecent:t.AlertsRecent.Actions.bindDispatchProps(e),unix:t.Unix.Actions.bindDispatchProps(e),rtc:t.Rtc.Actions.bindDispatchProps(e)}}}}(exports.Common||(exports.Common={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/linq8acm/outputs/get",t.REQUEST_POST="io/request/linq8acm/outputs/post",t.RESPONSE_GET="io/response/linq8acm/outputs/get",t.RESPONSE_POST="io/response/linq8acm/outputs/post",t.EDIT="io/edit/linq8acm/outputs",t.POLL_START="io/poll/linq8acm/outputs/start",t.POLL_STOP="io/poll/linq8acm/outputs/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e,o){return r(t.edit({data:o,idx:e}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))}}}}(Actions$c||(Actions$c={}));var Outputs,Actions$e,fromServer$3=function(t){var e;return e=t.facpOnOff?t.latch?"Latching":"NonLatching":"Inactive",__assign({},t,{type:Utils.selectMap(t.type,["Fail Safe","Fail Secure","Auxillary"]),v:Utils.scaleUx(t.v,1),i:Utils.scaleUx(t.i,2),vHigh:Utils.scaleUx(t.vHigh,1),vLow:Utils.scaleUx(t.vLow,1),iHigh:Utils.scaleUx(t.iHigh,2),iLow:Utils.scaleUx(t.iLow,2),input_inv:Utils.numToBool(t.input_inv),noNc:Utils.numToBool(t.noNc),facp:Utils.numToBool(t.facp),facpOnOff:Utils.numToBool(t.facpOnOff),_facpCtrl:e,latch:Utils.numToBool(t.latch),bBackup:Utils.numToBool(t.bBackup),eolFacp:Utils.numToBool(t.eolFacp),triggered:Utils.numToBool(t.triggered),locked:Utils.numToBool(t.locked),pcycl_dur:Utils.scaleUx(t.pcycl_dur)})},toServer$2=function(t){var e={};t._facpCtrl&&("Inactive"==t._facpCtrl?(e.latch=0,e.facpOnOff=0):"Latching"==t._facpCtrl?(e.latch=1,e.facpOnOff=1):"NonLatching"==t._facpCtrl&&(e.latch=0,e.facpOnOff=1));var r=Utils.convertBooleansToNumbers(t,["input_inv","noNc","bBackup","facp","eolFacp","triggered","locked"]),o=Utils.convertUxToServer(t,["vHigh","vLow","iHigh","iLow","pcycl_dur","i","ical","ioff","v","vcal","voff"]);return t.hasOwnProperty("type")&&void 0!==t.type&&(o.type=Utils.selectMap(t.type,["Fail Safe","Fail Secure","Auxillary"])),Object.assign({},t,r,o,e)},outputStatus=function(t,e){var r=t.latch?"Manually Disabled (or FACP reset needed)":"Manually Disabled";return t.facp?"FACP":e?t.bBackup?t.triggered?"Battery Backup":r:t.triggered?"No Battery Backup":r:t.triggered?"Normal":r},totalPower=function(t){var e=0;return t.forEach((function(t){return e+=Math.round(t.v*t.i)})),e.toFixed(1)},ImportFilters$3=Object.freeze({fromServer:fromServer$3,toServer:toServer$2,outputStatus:outputStatus,totalPower:totalPower});!function(t){t.Actions=Actions$c,t.Filters=ImportFilters$3}(Outputs||(Outputs={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/linq8acm/batteries/get",t.REQUEST_POST="io/request/linq8acm/batteries/post",t.RESPONSE_GET="io/response/linq8acm/batteries/get",t.RESPONSE_POST="io/response/linq8acm/batteries/post",t.EDIT="io/edit/linq8acm/batteries",t.POLL_START="io/poll/linq8acm/batteries/start",t.POLL_STOP="io/poll/linq8acm/batteries/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.edit=actionCreator(t.EDIT),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e,o){return r(t.edit({data:o,idx:e}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))}}}}(Actions$e||(Actions$e={}));var Batteries,Actions$g,fromServer$4=function(t){var e=new Date(1e3*t.ServDate),r=new Date(1e3*t.InstDate);return Object.assign({},t,{v:Utils.scaleUx(t.v,1),i:Utils.scaleUx(t.i,1),direct:Utils.numToBool(t.direct),Present:Utils.numToBool(t.Present),InstDate:""+r.toISOString().split("T")[0],ServDate:""+e.toISOString().split("T")[0],Cap:Utils.scaleUx(t.Cap),vHigh:Utils.scaleUx(t.vHigh,1),vLow:Utils.scaleUx(t.vLow,1),iHigh:Utils.scaleUx(t.iHigh,1),chg_iHigh:Utils.scaleUx(t.chg_iHigh,1),iLow:Utils.scaleUx(t.iLow,1),chg_iLow:Utils.scaleUx(t.chg_iLow,1)})},toServer$3=function(t){var e={},r=Utils.convertBooleansToNumbers(t,["direct","Present"]),o=Utils.convertUxToServer(t,["Cap","vHigh","vLow","iHigh","iLow","chg_iHigh","chg_iLow"]);return t.InstDate&&(e.InstDate=Date.parse(t.InstDate)/1e3),t.ServDate&&(e.ServDate=Date.parse(t.ServDate)/1e3),Object.assign({},t,e,r,o)},ImportFilters$4=Object.freeze({fromServer:fromServer$4,toServer:toServer$3});!function(t){t.Actions=Actions$e,t.Filters=ImportFilters$4}(Batteries||(Batteries={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/linq8acm/powersupplies/get",t.REQUEST_POST="io/request/linq8acm/powersupplies/post",t.RESPONSE_GET="io/response/linq8acm/powersupplies/get",t.RESPONSE_POST="io/response/linq8acm/powersupplies/post",t.EDIT="io/edit/linq8acm/powersupplies",t.POLL_START="io/poll/linq8acm/powerSupplies/start",t.POLL_STOP="io/poll/linq8acm/powerSupplies/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e,o){return r(t.edit({data:o,idx:e}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))}}}}(Actions$g||(Actions$g={}));var PowerSupplies,Actions$i,_a$2,fromServer$5=function(t){return Object.assign({},t,{v:Utils.scaleUx(t.v,1),i:Utils.scaleUx(t.i,1),vHigh:Utils.scaleUx(t.vHigh,1),iHigh:Utils.scaleUx(t.iHigh,1),vLow:Utils.scaleUx(t.vLow,1),iLow:Utils.scaleUx(t.iLow,1),Present:Utils.numToBool(t.Present)})},toServer$4=function(t){var e=Utils.convertBooleansToNumbers(t,["Present"]),r=Utils.convertUxToServer(t,["vHigh","iHigh","vLow","iLow","i","ical","ioff","v","vcal","voff"]);return Object.assign({},t,e,r)},ImportFilters$5=Object.freeze({fromServer:fromServer$5,toServer:toServer$4});!function(t){t.Actions=Actions$g,t.Filters=ImportFilters$5}(PowerSupplies||(PowerSupplies={})),function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/linq8acm/inputs/get",t.REQUEST_POST="io/request/linq8acm/inputs/post",t.RESPONSE_GET="io/response/linq8acm/inputs/get",t.RESPONSE_POST="io/response/linq8acm/inputs/post",t.RESPONSE_POST_END="io/response/linq8acm/inputs/post/end",t.EDIT="io/edit/linq8acm/inputs",t.EDIT_COMMANDS="io/edit/commands/linq8acm/inputs",t.POLL_START="io/poll/linq8acm/inputs/start",t.POLL_STOP="io/poll/linq8acm/inputs/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.postResponseEnd=actionCreator(t.RESPONSE_POST_END),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.edit=actionCreator(t.EDIT),t.editCommands=actionCreator(t.EDIT_COMMANDS),t.fetchRequest=e,t.bindDispatchProps=function(r){return{edit:function(e,o){return r(t.edit({data:o,idx:e}))},editCommands:function(e,o,s,i){return r(t.editCommands({idx:e,output:s,url:o,cmd:i}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))}}}}(Actions$i||(Actions$i={}));var Inputs,Actions$j,emptyCommands=((_a$2={})["/ATX/hardware/flags/mask"]=["x","x","x","x","x","x","x","x"],_a$2),input={id:"",status:!1,cmds:emptyCommands},inputs=[__assign({},input),__assign({},input),__assign({},input),__assign({},input),__assign({},input),__assign({},input),__assign({},input),__assign({},input)],initial$7=storeInit(inputs),fromServer$6=function(t){var e=Object.assign({},emptyCommands);return t.cmds.forEach((function(t){return e[t.url]=t.data.mask.split("")})),{id:t.id,status:Utils.numToBool(t.status),cmds:e}},toServer$5=function(t){var e={},r=[];if(t.id&&(e.id=t.id),null!=t.cmds){for(var o in t.cmds){var s=t.cmds[o].join("");r.push({url:o,data:{mask:s}})}e.cmds=r}return e},ImportFilters$6=Object.freeze({fromServer:fromServer$6,toServer:toServer$5});!function(t){t.Actions=Actions$i,t.Filters=ImportFilters$6}(Inputs||(Inputs={})),function(t){t.REQUEST_GET="io/request/linq8acm/timers/get",t.RESPONSE_GET="io/response/linq8acm/timers/get",t.REQUEST_EDIT="io/request/linq8acm/timers/edit",t.RESPONSE_EDIT="io/response/linq8acm/timers/edit",t.RESPONSE_EDIT_END="io/response/linq8acm/timers/edit/end",t.REQUEST_ADD="io/request/linq8acm/timers/add",t.RESPONSE_ADD="io/response/linq8acm/timers/add",t.REQUEST_DELETE="io/request/linq8acm/timers/delete",t.RESPONSE_DELETE="io/response/linq8acm/timers/delete",t.EDIT_TIMERS="io/edit/timers/linq8acm/timers",t.EDIT_TIMERS_COMMANDS="io/edit/timers/commands/linq8acm/timers",t.EDIT_NEW="io/edit/new/linq8acm/timers",t.EDIT_NEW_COMMANDS="io/edit/new/commands/linq8acm/timers",t.editAdd=actionCreator(t.EDIT_NEW),t.editTimers=actionCreator(t.EDIT_TIMERS),t.editAddCommands=actionCreator(t.EDIT_NEW_COMMANDS),t.editTimersCommands=actionCreator(t.EDIT_TIMERS_COMMANDS),t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.editRequest=actionCreator(t.REQUEST_EDIT),t.editResponse=actionCreator(t.RESPONSE_EDIT),t.editResponseEnd=actionCreator(t.RESPONSE_EDIT_END),t.addRequest=actionCreator(t.REQUEST_ADD),t.addResponse=actionCreator(t.RESPONSE_ADD),t.deleteRequest=actionCreator(t.REQUEST_DELETE),t.deleteResponse=actionCreator(t.RESPONSE_DELETE),t.bindDispatchProps=function(e){return{editTimers:function(r,o){return e(t.editTimers({data:o,idx:r}))},editTimersCommands:function(r,o,s,i){return e(t.editTimersCommands({idx:r,output:s,url:o,cmd:i}))},editAdd:function(r){return e(t.editAdd({data:r}))},editAddCommands:function(r,o,s){return e(t.editAddCommands({output:o,url:r,cmd:s}))},fetch:function(){return e(t.getRequest())},update:function(r){return e(t.editRequest({data:r}))},add:function(r){return e(t.addRequest({data:r}))},remove:function(r){return e(t.deleteRequest({data:r}))}}}}(Actions$j||(Actions$j={}));var Timers,intervalNumMap={60:"1 minute",900:"15 minutes",1800:"30 minutes",2700:"45 minutes",3600:"60 minutes",86400:"1 day",604800:"1 week"},intervalStrMap={"1 minute":60,"15 minutes":900,"30 minutes":1800,"45 minutes":2700,"60 minutes":3600,"1 day":86400,"1 week":604800},fromServer$7=function(t,e){var r=new Date(1e3*e.start),o={};return e.cmds.forEach((function(t){return o[t.url]=t.data.mask.split("")})),{label:t,interval:intervalNumMap[e.interval],startDate:r.toISOString().split("T")[0],startTime:""+r.toTimeString().split(" ")[0],cmds:o}},toServer$6=function(t){var e={},r=[];if(t.interval&&(e.interval=intervalStrMap[t.interval]),t.startTime&&t.startDate&&(e.start=Date.parse(t.startDate+" "+t.startTime)/1e3),null!=t.cmds){for(var o in t.cmds){var s=t.cmds[o].join("");r.push({url:o,data:{mask:s}})}e.cmds=r}return e},emptyTimer=function(){return{label:"Timer Label",startDate:(new Date).toISOString().split("T")[0],startTime:"00:00",interval:intervals()[0],cmds:{"/ATX/hardware/flags/mask":["x","x","x","x","x","x","x","x"]}}},intervals=function(){return Object.keys(intervalStrMap)},ImportFilters$7=Object.freeze({fromServer:fromServer$7,toServer:toServer$6,emptyTimer:emptyTimer,intervals:intervals});!function(t){t.Actions=Actions$j,t.Filters=ImportFilters$7}(Timers||(Timers={}));var Actions$k,PULSE="p",TOGGLE="t",ON="1",OFF="0";!function(t){function e(e){return e?t.postRequest({data:e}):t.getRequest()}t.REQUEST_GET="io/request/linq8acm/flags/get",t.REQUEST_POST="io/request/linq8acm/flags/post",t.RESPONSE_GET="io/response/linq8acm/flags/get",t.RESPONSE_POST="io/response/linq8acm/flags/post",t.EDIT="io/edit/linq8acm/flags",t.POLL_START="io/poll/linq8acm/outputs/start",t.POLL_STOP="io/poll/linq8acm/outputs/stop",t.getRequest=actionCreator(t.REQUEST_GET),t.getResponse=actionCreator(t.RESPONSE_GET),t.postRequest=actionCreator(t.REQUEST_POST),t.postResponse=actionCreator(t.RESPONSE_POST),t.edit=actionCreator(t.EDIT),t.pollStart=actionCreator(t.POLL_START),t.pollStop=actionCreator(t.POLL_STOP),t.fetchRequest=e,t.exe=function(e,r){return t.postRequest({data:{},exe:{idx:e,cmd:r}})},t.bindDispatchProps=function(r){return{edit:function(e){return r(t.edit({data:e}))},fetch:function(t){return r(t?e(t):e())},poll:function(e){return r(e?t.pollStart({data:e}):t.pollStop({data:e}))},calZeros:function(){return r(e({calZeros:1}))},turnOn:function(e){return r(t.exe(e,ON))},turnOff:function(e){return r(t.exe(e,OFF))},toggle:function(e){return r(t.exe(e,TOGGLE))},pulse:function(e){return r(t.exe(e,PULSE))},exe:function(e,o){return r(t.exe(e,o))}}}}(Actions$k||(Actions$k={}));var Flags,fromServer$8=function(t){return{calib:exports.Utils.numToBool(t.calib),calZeros:0,port_calib:exports.Utils.numToBool(t.port_calib),acFail:exports.Utils.numToBool(t.acFail),battFail:exports.Utils.numToBool(t.battFail),inpStatus:exports.Utils.numToBool(t.inpStatus),tamper:exports.Utils.numToBool(t.tamper),facp:exports.Utils.numToBool(t.facp),wetEol:exports.Utils.numToBool(t.wetEol),relayTgl:exports.Utils.numToBool(t.relayTgl),inputTrigger:exports.Utils.numToBool(t.inputTrigger),resetTamper:exports.Utils.numToBool(t.resetTamper),facpTamper:exports.Utils.numToBool(t.facpTamper),acCommTrbl:exports.Utils.numToBool(t.acCommTrbl),battTamper:exports.Utils.numToBool(t.battTamper),mask:"",temp:Math.round(.125*t.temp),thigh:Math.round(.125*t.thigh)}},toServer$7=function(t){var e=exports.Utils.convertBooleansToNumbers(t,["calib","port_calib","acFail","battFail","inpStatus","tamper","facp","wetEol","relayTgl","inputTrigger","resetTamper","acCommTrbl","facpTamper","battTamper"]);return t.hasOwnProperty("thigh")&&void 0!==t.thigh&&(e.thigh=Math.round(t.thigh/.125)),e},ImportFilters$8=Object.freeze({fromServer:fromServer$8,toServer:toServer$7});!function(t){t.Actions=Actions$k,t.Filters=ImportFilters$8}(Flags||(Flags={}));var _a$3,getEpic$6=function(t){return t.pipe(reduxObservable.ofType(Actions$c.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/hardware/outputs"),operators.map((function(t){return Actions$c.getResponse({data:t.data})})),operators.startWith(request("/ATX/hardware/outputs")))})))},postEpic$5=function(t){return t.pipe(reduxObservable.ofType(Actions$c.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/hardware/outputs","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$c.postResponse({data:t.data})),rxjs.of(Actions$c.getRequest()),rxjs.of(request("/ATX/hardware/exe/save",{save:1})))})),operators.startWith(request("/ATX/hardware/outputs",e.post||e.data)))})))},pollEpic$2=function(t){return t.pipe(reduxObservable.ofType(Actions$c.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$c.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$c.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$c.POLL_STOP))),operators.startWith(Actions$c.getRequest()))})))},outputEpics=reduxObservable.combineEpics(getEpic$6,postEpic$5,pollEpic$2),getEpic$7=function(t){return t.pipe(reduxObservable.ofType(Actions$e.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/hardware/batt"),operators.map((function(t){return Actions$e.getResponse({data:t.data})})),operators.startWith(request("/ATX/hardware/batt")))})))},postEpic$6=function(t){return t.pipe(reduxObservable.ofType(Actions$e.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/hardware/batt","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$e.postResponse({data:t.data})),rxjs.of(Actions$e.getRequest()),rxjs.of(request("/ATX/hardware/exe/save",{save:1})))})),operators.startWith(request("/ATX/hardware/batt",e.post)))})))},pollEpic$3=function(t){return t.pipe(reduxObservable.ofType(Actions$e.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$e.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$e.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$e.POLL_STOP))),operators.startWith(Actions$e.getRequest()))})))},batteryEpics=reduxObservable.combineEpics(getEpic$7,postEpic$6,pollEpic$3),getEpic$8=function(t){return t.pipe(reduxObservable.ofType(Actions$k.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/hardware/flags"),operators.map((function(t){return Actions$k.getResponse({data:t.data})})),operators.startWith(request("/ATX/hardware/flags")))})))},postEpic$7=function(t){return t.pipe(reduxObservable.ofType(Actions$k.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/hardware/flags","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$k.postResponse({data:t.data})),rxjs.of(Actions$k.getRequest()),rxjs.of(request("/ATX/hardware/exe/save",{save:1})))})),operators.startWith(request("/ATX/hardware/flags",e.data)))})))},pollEpic$4=function(t){return t.pipe(reduxObservable.ofType(Actions$k.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$k.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$k.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$k.POLL_STOP))),operators.startWith(Actions$k.getRequest()))})))},flagEpics=reduxObservable.combineEpics(getEpic$8,postEpic$7,pollEpic$4),getEpic$9=function(t){return t.pipe(reduxObservable.ofType(Actions$g.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/hardware/ps"),operators.map((function(t){return Actions$g.getResponse({data:t.data})})),operators.startWith(request("/ATX/hardware/ps")))})))},postEpic$8=function(t){return t.pipe(reduxObservable.ofType(Actions$g.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/hardware/ps","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$g.postResponse({data:t.data})),rxjs.of(Actions$g.getRequest()),rxjs.of(request("/ATX/hardware/exe/save",{save:1})))})),operators.startWith(request("/ATX/hardware/ps",e.post||e.data)))})))},pollEpic$5=function(t){return t.pipe(reduxObservable.ofType(Actions$g.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$g.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$g.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$g.POLL_STOP))),operators.startWith(Actions$g.getRequest()))})))},powerSupplyEpics=reduxObservable.combineEpics(getEpic$9,postEpic$8,pollEpic$5),getEpic$a=function(t){return t.pipe(reduxObservable.ofType(Actions$i.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/hardware/inputs"),operators.map((function(t){return Actions$i.getResponse({data:t.data})})),operators.startWith(request("/ATX/hardware/inputs")))})))},postEpic$9=function(t){return t.pipe(reduxObservable.ofType(Actions$i.REQUEST_POST),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.mergeMap((function(e){return rxjs.concat(rxjs.from(Object.keys(e.post||{}).map((function(t){return{key:t,post:e.post&&e.post[t]}}))).pipe(operators.concatMap((function(e){return t.pipe(responseFrom("/ATX/hardware/inputs/"+e.key,"POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$i.postResponse({data:t.data})),rxjs.of(Actions$i.getRequest()))})),operators.startWith(request("/ATX/hardware/inputs/"+e.key,e.post)))}))),rxjs.of(Actions$i.postResponseEnd()))})))},saveEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$i.RESPONSE_POST_END),operators.concatMap((function(){return rxjs.of(request("/ATX/hardware/exe/save",{save:1}))})))},pollEpic$6=function(t){return t.pipe(reduxObservable.ofType(Actions$i.POLL_START),operators.switchMap((function(){return t.pipe(reduxObservable.ofType(Actions$i.RESPONSE_GET),operators.delay(5e3),operators.map((function(){return Actions$i.getRequest()})),operators.repeat(),operators.takeUntil(t.pipe(reduxObservable.ofType(Actions$i.POLL_STOP))),operators.startWith(Actions$i.getRequest()))})))},inputsEpics=reduxObservable.combineEpics(getEpic$a,postEpic$9,saveEpic,pollEpic$6),getEpic$b=function(t){return t.pipe(reduxObservable.ofType(Actions$j.REQUEST_GET),operators.switchMap((function(){return t.pipe(responseFrom("/ATX/timers/schedule"),operators.map((function(t){return Actions$j.getResponse({data:t.data})})),operators.startWith(request("/ATX/timers/schedule")))})))},addEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$j.REQUEST_ADD),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/timers/schedule","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$j.addResponse({data:t.data})),rxjs.of(Actions$j.getRequest()),rxjs.of(request("/ATX/exe/save",{save:1})))})),operators.startWith(request("/ATX/timers/schedule",e.post)))})))},removeEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$j.REQUEST_DELETE),operators.switchMap((function(e){return t.pipe(responseFrom("/ATX/timers/schedule/"+e.data,"DELETE"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$j.addResponse({data:t.data})),rxjs.of(Actions$j.getRequest()),rxjs.of(request("/ATX/exe/save",{save:1})))})),operators.startWith(request("DELETE /ATX/timers/schedule/"+e.data)))})))},editEpic=function(t){return t.pipe(reduxObservable.ofType(Actions$j.REQUEST_EDIT),operators.filter((function(t){return!!Object.keys(t.data).length})),operators.mergeMap((function(e){return rxjs.concat(rxjs.from(Object.keys(e.post||{}).map((function(t){return{key:t,post:e.post}}))).pipe(operators.concatMap((function(e){return t.pipe(responseFrom("/ATX/timers/schedule","POST"),operators.switchMap((function(t){return rxjs.concat(rxjs.of(Actions$j.editResponse({data:t.data})),rxjs.of(Actions$j.getRequest()),rxjs.of(request("/ATX/exe/save",{save:1})))})),operators.startWith(request("/ATX/timers/schedule",e.post)))}))),rxjs.of(Actions$j.editResponseEnd()))})))},timerEpics=reduxObservable.combineEpics(getEpic$b,editEpic,addEpic,removeEpic),epics=reduxObservable.combineEpics(outputEpics,batteryEpics,flagEpics,powerSupplyEpics,inputsEpics,timerEpics),batt={v:0,vLoad:0,i:0,cur_zero:0,chgGauge:0,direct:!1,Cap:0,Lvl:0,Present:!1,iHigh:0,chg_iHigh:0,iLow:0,chg_iLow:0,vHigh:0,vLow:0,InstDate:"",ServDate:"",battStatus:""},initial$8=storeInit([__assign({},batt),__assign({},batt)]),actions$2=((_a$3={})[Actions$e.REQUEST_GET]=getRequest$1,_a$3[Actions$e.REQUEST_POST]=postRequest$1,_a$3[Actions$e.RESPONSE_GET]=getResponse$1,_a$3[Actions$e.RESPONSE_POST]=postResponse$1,_a$3[Actions$e.EDIT]=edit$1,_a$3[IO_ERROR]=error$1,_a$3),batteriesReducer=createReducerActions(actions$2,initial$8);function getRequest$1(t){return __assign({},t,{loadingGet:!0})}function postRequest$1(t,e){e.post={batt:{}};for(var r=0;r<t.form.length;r++){var o=toServer$3(exports.Utils.diff(t.form[r],t.data[r]));Object.keys(o).length&&(e.post.batt["batt"+r]=o)}return __assign({},t,{loadingPost:!0})}function getResponse$1(t,e){var r=[];for(var o in e.data.batt)r.push(fromServer$4(e.data.batt[o]));return __assign({},t,{status:"OK",data:Object.assign([],r),form:Object.assign([],r),submitRequired:!1,loadingGet:!1})}function postResponse$1(t){return __assign({},t,{loadingPost:!1})}function edit$1(t,e){var r,o=Object.assign({},t.form[e.idx],e.data),s=Object.assign([],t.form,((r={})[e.idx]=o,r)),i=!1;return s.forEach((function(e,r){exports.Utils.isDiff(e,t.data[r])&&(i=!0)})),__assign({},t,{form:s},{submitRequired:i})}function error$1(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var _a$4,ps={id:"",v:0,vcal:0,voff:0,i:0,ical:0,ioff:0,iHigh:0,iLow:0,vHigh:0,vLow:0,Present:!1},initial$9=storeInit([__assign({},ps),__assign({},ps)]),actions$3=((_a$4={})[Actions$g.REQUEST_GET]=getRequest$2,_a$4[Actions$g.REQUEST_POST]=postRequest$2,_a$4[Actions$g.RESPONSE_GET]=getResponse$2,_a$4[Actions$g.RESPONSE_POST]=postResponse$2,_a$4[Actions$g.EDIT]=edit$2,_a$4[IO_ERROR]=error$2,_a$4),powerSuppliesReducer=createReducerActions(actions$3,initial$9);function getRequest$2(t){return __assign({},t,{loadingGet:!0})}function postRequest$2(t,e){e.post={ps:{}};for(var r=0;r<t.form.length;r++){var o=toServer$4(exports.Utils.diff(t.form[r],t.data[r]));Object.keys(o).length&&(e.post.ps["ps"+r]=o)}return __assign({},t,{loadingPost:!0})}function getResponse$2(t,e){var r=[];for(var o in e.data.ps)r.push(fromServer$5(e.data.ps[o]));return __assign({},t,{status:"OK",data:Object.assign([],r),form:Object.assign([],r),submitRequired:!1,loadingGet:!1})}function postResponse$2(t){return __assign({},t,{loadingPost:!1})}function edit$2(t,e){var r,o=Object.assign({},t.form[e.idx],e.data),s=Object.assign([],t.form,((r={})[e.idx]=o,r)),i=!1;return s.forEach((function(e,r){exports.Utils.isDiff(e,t.data[r])&&(i=!0)})),__assign({},t,{form:s},{submitRequired:i})}function error$2(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var _a$5,ch={idx:0,type:"Fail Safe",v:0,vcal:0,voff:0,i:0,ical:0,ioff:0,input:-1,input_inv:!1,noNc:!1,iHigh:0,iLow:0,vHigh:0,vLow:0,facp:!1,facpOnOff:!1,_facpCtrl:"Inactive",latch:!1,bBackup:!1,id:"",eolFacp:!1,triggered:!1,locked:!1,out_timer:0,pcycl_dur:0},chs=[__assign({},ch),__assign({},ch),__assign({},ch),__assign({},ch),__assign({},ch),__assign({},ch),__assign({},ch),__assign({},ch)],initial$a=storeInit(chs),actions$4=((_a$5={})[Actions$c.REQUEST_GET]=getRequest$3,_a$5[Actions$c.REQUEST_POST]=postRequest$3,_a$5[Actions$c.RESPONSE_GET]=getResponse$3,_a$5[Actions$c.RESPONSE_POST]=postResponse$3,_a$5[Actions$c.EDIT]=edit$3,_a$5[IO_ERROR]=error$3,_a$5),outputsReducer=createReducerActions(actions$4,initial$a);function getRequest$3(t){return __assign({},t,{loadingGet:!0})}function postRequest$3(t,e){e.post={chs:{}};for(var r=0;r<t.form.length;r++){var o=toServer$2(exports.Utils.diff(t.form[r],t.data[r]));Object.keys(o).length&&(e.post.chs["ch"+r]=o)}return __assign({},t,{loadingPost:!0})}function getResponse$3(t,e){var r=[];for(var o in e.data.outputs.chs)r.push(fromServer$3(e.data.outputs.chs[o]));return __assign({},t,{status:"OK",data:Object.assign([],r),form:Object.assign([],r),submitRequired:!1,loadingGet:!1})}function postResponse$3(t){return __assign({},t,{loadingPost:!1})}function edit$3(t,e){var r,o=Object.assign({},t.form[e.idx],e.data),s=Object.assign([],t.form,((r={})[e.idx]=o,r)),i=!1;return s.forEach((function(e,r){exports.Utils.isDiff(e,t.data[r])&&(i=!0)})),__assign({},t,{form:s},{submitRequired:i})}function error$3(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var _a$6,_a$7,initialData$1={mask:"",facpTamper:!1,acCommTrbl:!1,battTamper:!1,calib:!1,calZeros:0,port_calib:!1,acFail:!1,battFail:!1,inpStatus:!1,tamper:!1,facp:!1,wetEol:!1,relayTgl:!1,inputTrigger:!1,resetTamper:!1,temp:0,thigh:0},initial$b=storeInit(initialData$1),actions$5=((_a$6={})[Actions$k.REQUEST_GET]=getRequest$4,_a$6[Actions$k.REQUEST_POST]=postRequest$4,_a$6[Actions$k.RESPONSE_GET]=getResponse$4,_a$6[Actions$k.RESPONSE_POST]=postResponse$4,_a$6[Actions$k.EDIT]=edit$4,_a$6[IO_ERROR]=error$4,_a$6),flagsReducer=createReducerActions(actions$5,initial$b);function getRequest$4(t){return __assign({},t,{loadingGet:!0})}function postRequest$4(t,e){if(e.exe){var r="xxxxxxxx".split("");r[e.exe.idx]=e.exe.cmd,Object.assign(e.data,toServer$7(e.data),{mask:r.join("")})}else Object.assign(e.data,toServer$7(e.data));return __assign({},t,{loadingPost:!0})}function getResponse$4(t,e){return __assign({},t,{status:"OK",data:fromServer$8(e.data.flags),form:fromServer$8(e.data.flags),submitRequired:!1,loadingGet:!1})}function postResponse$4(t){return __assign({},t,{loadingPost:!1})}function edit$4(t,e){var r=Object.assign({},t.form,e.data),o=!!Object.keys(exports.Utils.diff(r,t.data)).length;return __assign({},t,{form:r},{submitRequired:o})}function error$4(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var actions$6=((_a$7={})[Actions$i.REQUEST_GET]=getRequest$5,_a$7[Actions$i.REQUEST_POST]=postRequest$5,_a$7[Actions$i.RESPONSE_GET]=getResponse$5,_a$7[Actions$i.RESPONSE_POST]=postResponse$5,_a$7[Actions$i.RESPONSE_POST_END]=postResponseEnd,_a$7[Actions$i.EDIT]=edit$5,_a$7[Actions$i.EDIT_COMMANDS]=editCommands,_a$7[IO_ERROR]=error$5,_a$7),inputsReducer=createReducerActions(actions$6,initial$7);function getRequest$5(t){return __assign({},t,{loadingGet:!0})}function postRequest$5(t,e){e.post={};for(var r=0;r<t.form.length;r++){var o={},s={};for(var i in t.form[r].cmds){t.form[r].cmds[i].join("")!==t.data[r].cmds[i].join("")&&(s[i]=t.form[r].cmds[i])}t.form[r].id!==t.data[r].id&&(o.id=t.form[r].id),Object.keys(s).length&&(o.cmds=s),Object.keys(o).length&&(e.post["input"+r]=toServer$5(o))}return __assign({},t,{loadingPost:!0})}function getResponse$5(t,e){var r=[];for(var o in e.data.inputs)r.push(fromServer$6(e.data.inputs[o]));return __assign({},t,{status:"OK",data:Object.assign([],r),form:Object.assign([],r),submitRequired:!1,loadingGet:!1})}function postResponse$5(t){return __assign({},t)}function postResponseEnd(t){return __assign({},t,{loadingPost:!1})}function edit$5(t,e){var r,o=Object.assign({},t.form[e.idx],e.data),s=Object.assign([],t.form,((r={})[e.idx]=o,r)),i=!1;for(var n in s)exports.Utils.isDiff({id:s[n].id},{id:t.data[n].id})&&(i=!0);return __assign({},t,{form:s},{submitRequired:i})}function editCommands(t,e){var r,o,s,i=e.url,n=e.idx,a=e.output,c=e.cmd,p=t.form[n].cmds,u=Object.assign({},p,((r={})[i]=Object.assign([],p[i],((o={})[a]=c,o)),r)),l=Object.assign({},t.form[n],{cmds:u}),d=Object.assign([],t.form,((s={})[n]=l,s)),f=!1;for(var E in d)for(var T in d[E].cmds){d[E].cmds[T].join("")!=t.data[E].cmds[T].join("")&&(f=!0)}return __assign({},t,{form:d,submitRequired:f})}function error$5(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var _a$8,timers={timers:[],newTimer:emptyTimer()},initial$c=storeInit(timers),actions$7=((_a$8={})[Actions$j.REQUEST_GET]=getRequest$6,_a$8[Actions$j.RESPONSE_GET]=getResponse$6,_a$8[Actions$j.REQUEST_EDIT]=editRequest,_a$8[Actions$j.RESPONSE_EDIT]=editResponse,_a$8[Actions$j.RESPONSE_EDIT_END]=editResponseEnd,_a$8[Actions$j.REQUEST_ADD]=addRequest,_a$8[Actions$j.RESPONSE_ADD]=addResponse,_a$8[Actions$j.REQUEST_DELETE]=deleteRequest,_a$8[Actions$j.RESPONSE_DELETE]=deleteResponse,_a$8[Actions$j.EDIT_NEW]=editAdd,_a$8[Actions$j.EDIT_NEW_COMMANDS]=editAddCommands,_a$8[Actions$j.EDIT_TIMERS]=editTimers,_a$8[Actions$j.EDIT_TIMERS_COMMANDS]=editTimersCommands,_a$8[IO_ERROR]=error$6,_a$8),timersReducer=createReducerActions(actions$7,initial$c),diffTimer=function(t,e){return exports.Utils.diff({label:t.label,startDate:t.startDate,startTime:t.startTime,interval:t.interval},{label:e.label,startDate:e.startDate,startTime:e.startTime,interval:e.interval})},diffTimerCmds=function(t,e){var r={};for(var o in t.cmds)e.cmds[o]&&t.cmds[o].join("")!=e.cmds[o].join("")&&(r[o]=t.cmds[o]);return r};function getRequest$6(t){return __assign({},t,{loadingGet:!0})}function getResponse$6(t,e){var r=[];for(var o in e.data.schedule)r.push(fromServer$7(o,e.data.schedule[o]));return __assign({},t,{status:"OK",data:Object.assign({},t.data,{timers:r}),form:Object.assign({},t.form,{timers:r}),submitRequired:!1,loadingGet:!1})}function editRequest(t,e){e.post={};for(var r=0;r<t.form.timers.length;r++){var o=diffTimer(t.form.timers[r],t.data.timers[r]),s=diffTimerCmds(t.form.timers[r],t.data.timers[r]);Object.keys(s).length&&(o.cmds=s),Object.keys(o).length&&(e.post[""+t.form.timers[r].label]=toServer$6(t.form.timers[r]))}return __assign({},t,{loadingPost:!0})}function editResponse(t){return __assign({},t)}function editResponseEnd(t){return __assign({},t,{loadingPost:!1})}function addRequest(t,e){return e.post={},e.post[""+e.data.label]=toServer$6(e.data),__assign({},t,{loadingPost:!0})}function addResponse(t){return __assign({},t,{loadingPost:!1})}function deleteRequest(t){return __assign({},t,{loadingPost:!0})}function deleteResponse(t){return __assign({},t,{loadingPost:!1})}function editAdd(t,e){var r=Object.assign({},t.form.newTimer,e.data),o=Object.assign({},t.form,{newTimer:r}),s=!!Object.keys(diffTimer(r,t.data.newTimer)).length;return __assign({},t,{form:o,submitRequired:s})}function editAddCommands(t,e){var r,o,s=e.url,i=e.output,n=e.cmd,a=t.form.newTimer.cmds,c=Object.assign({},a,((r={})[s]=Object.assign([],a[s],((o={})[i]=n,o)),r)),p=Object.assign({},t.form.newTimer,{cmds:c}),u=Object.assign({},t.form,{newTimer:p}),l=!!Object.keys(diffTimerCmds(p,t.data.newTimer)).length;return __assign({},t,{form:u,submitRequired:l})}function editTimers(t,e){var r,o=Object.assign([],t.form.timers,((r={})[e.idx]=Object.assign({},t.form.timers[e.idx],e.data),r)),s=Object.assign({},t.form,{timers:o}),i=!1;for(var n in s.timers)Object.keys(diffTimer(s.timers[n],t.data.timers[n])).length&&(i=!0);return __assign({},t,{form:s},{submitRequired:i})}function editTimersCommands(t,e){var r,o,s,i=e.idx,n=e.url,a=e.output,c=e.cmd,p=t.form.timers[i].cmds,u=Object.assign({},p,((r={})[n]=Object.assign([],p[n],((o={})[a]=c,o)),r)),l=Object.assign({},t.form.timers[i],{cmds:u}),d=Object.assign([],t.form.timers,((s={})[e.idx]=l,s)),f=Object.assign({},t.form,{timers:d}),E=!!Object.keys(diffTimerCmds(l,t.data.timers[i])).length;return __assign({},t,{form:f,submitRequired:E})}function error$6(t){return __assign({},t,{loadingPost:!1,loadingGet:!1})}var reducers=redux.combineReducers({powerSupplies:powerSuppliesReducer,batteries:batteriesReducer,outputs:outputsReducer,flags:flagsReducer,inputs:inputsReducer,timers:timersReducer});!function(t){t.Epics=epics,t.Reducer=reducers,t.Outputs=Outputs,t.Batteries=Batteries,t.PowerSupplies=PowerSupplies,t.Flags=Flags,t.Inputs=Inputs,t.Timers=Timers,t.bindDispatchProps=function(e){return{dispatch:{outputs:t.Outputs.Actions.bindDispatchProps(e),powerSupplies:t.PowerSupplies.Actions.bindDispatchProps(e),batteries:t.Batteries.Actions.bindDispatchProps(e),flags:t.Flags.Actions.bindDispatchProps(e),inputs:t.Inputs.Actions.bindDispatchProps(e),timers:t.Timers.Actions.bindDispatchProps(e)}}}}(exports.Linq8acm||(exports.Linq8acm={})),exports.ajax=ajax,exports.login=login,exports.requestEpic=requestEpic,exports.IO_REQUEST=IO_REQUEST,exports.IO_RESPONSE=IO_RESPONSE,exports.IO_ERROR=IO_ERROR,exports.request=request,exports.response=response,exports.error=error,exports.actionCreator=actionCreator,exports.responseFrom=responseFrom;
//# sourceMappingURL=/sm/7635997869059a77e1545dd4e7141c8e5df66604362a865dfd19d4cb0ada5e6a.map