(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[50],{FfDs:function(t,e,a){"use strict";var n=a("mwIZ"),c=a.n(n),r=a("q1tI"),o=a.n(r),s=a("Ty5D"),i=a("udB/"),l=a("B6RA"),p=a("8Fj4"),m=a("6uZD"),u=a("ZRKa"),d=a("4ltZ"),f=a("85nz"),h=a("BvFm"),g=a("B2Cw"),b=a("wd8a");function O(){return(O=Object.assign||function(t){for(var e=1;e=0||(c[a]=t[a]);return c}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(c[a]=t[a])}return c}e.a=t=>{let e,{component:a,props:n}=t,r=y(t,["component","props"]),j=n.FarmID,D=l.default.getState();try{e=D.farms.farms.find(t=>t.FarmID===(j||r.computedMatch.params.FarmID))}catch(w){e=void 0}!j&&r.computedMatch.params.FarmID&&n.isAuthenticated&&(j=r.computedMatch.params.FarmID,e&&Object(f.b)(e)?(l.default.dispatch(Object(p.a)(j)),l.default.dispatch(Object(m.d)(j)),l.default.dispatch(Object(g.b)(j)),l.default.dispatch({type:"LIST_ALL_SETTINGS",payload:u.a.getAllSettings(j),meta:{user:D.user.user}}),l.default.dispatch(Object(d.d)(j)),l.default.dispatch({type:"SHOW_NAVIGATION"})):l.default.dispatch(Object(p.a)(null)));let E=c()(l.default.getState(),"user.user.UserType",b.USER),I=c()(l.default.getState(),"user.user.DocRead",[]),A=c()(l.default.getState(),"documents.documents",[]).filter(t=>t.ForceRead&&!I.includes(t.DocID)&&(!t.ApplyTo||t.ApplyTo.includes(E)))[0],S=!n.isAuthenticating&&n.isAuthenticated&&Object(h.e)();const v=r.location.pathname.split("/").slice(-1)[0],F=r.location.pathname.split("/").slice(-3)[0];return o.a.createElement(s.d,O({},r,{render:t=>n.isAuthenticating?o.a.createElement(i.a,{isLoading:n.isAuthenticating}):n.isAuthenticated?S?"/getstarted"===r.location.pathname?o.a.createElement(a,O({},t,n)):o.a.createElement(s.c,{to:"/getstarted"}):A?r.location.pathname!=="/accept/".concat(A.DocID)?o.a.createElement(s.c,{to:"/accept/".concat(A.DocID)}):o.a.createElement(a,O({},t,n)):j&&Object(f.b)(e)||"/farmChooser"===r.path||"/settings/farms/add"===r.location.pathname||r.location.pathname==="/farms/manage/"+v||"/settings/license/subscriptions"===r.location.pathname||r.location.pathname.includes("/farmSettings")?o.a.createElement(a,O({},t,n)):"/settings/farms/add"===r.location.pathname?o.a.createElement(s.c,{to:"/settings/farms/add"}):r.location.pathname==="/farms/manage/"+v?o.a.createElement(s.c,{to:"/farms/manage/"+v}):o.a.createElement(s.c,{to:"/farmChooser"}):"confirm"===F?o.a.createElement(a,O({},t,n)):o.a.createElement(s.c,{to:"/login?redirect=".concat(t.location.pathname).concat(t.location.search)})}))}}}]); //# sourceMappingURL=main~7da7c122.b6faeb29.chunk.js.map