@mseva/digit-ui-module-noc 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),n=require("react"),l=e(n),o=require("react-router-dom"),i=require("react-i18next"),a=require("react-query"),r=require("react-hook-form"),u=require("redux"),s=require("react-redux"),c=e(require("exif-js"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function m(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const v=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),o=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+o}return null},p=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],o=Digit.UserService.getUser().info.roles;return n.map((t,i)=>{let{roles:a}=t;a.map(t=>{o.map(o=>{var a;o.code===t&&l.push(e?null==n||null===(a=n[i])||void 0===a?void 0:a.code:null==n?void 0:n[i])})})}),l};var E=function(e,t){return e===t||e!=e&&t!=t},g=function(e,t){for(var n=e.length;n--;)if(E(e[n][0],t))return n;return-1},h=Array.prototype.splice;function S(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}S.prototype.clear=function(){this.__data__=[],this.size=0},S.prototype.delete=function(e){var t=this.__data__,n=g(t,e);return!(n<0||(n==t.length-1?t.pop():h.call(t,n,1),--this.size,0))},S.prototype.get=function(e){var t=this.__data__,n=g(t,e);return n<0?void 0:t[n][1]},S.prototype.has=function(e){return g(this.__data__,e)>-1},S.prototype.set=function(e,t){var n=this.__data__,l=g(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var b=S,y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e,t){return e(t={exports:{}},t.exports),t.exports}var C,D="object"==typeof y&&y&&y.Object===Object&&y,N="object"==typeof self&&self&&self.Object===Object&&self,T=D||N||Function("return this")(),L=T.Symbol,O=Object.prototype,I=O.hasOwnProperty,w=O.toString,x=L?L.toStringTag:void 0,P=Object.prototype.toString,R=L?L.toStringTag:void 0,F=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":R&&R in Object(e)?function(e){var t=I.call(e,x),n=e[x];try{e[x]=void 0;var l=!0}catch(e){}var o=w.call(e);return l&&(t?e[x]=n:delete e[x]),o}(e):function(e){return P.call(e)}(e)},B=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=function(e){if(!B(e))return!1;var t=F(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=T["__core-js_shared__"],U=(C=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",W=Function.prototype.toString,H=function(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""},j=/^\[object .+?Constructor\]$/,z=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!B(e)||(t=e,U&&U in t))&&(M(e)?z:j).test(H(e));var t}(n)?n:void 0},G=V(T,"Map"),Y=V(Object,"create"),q=Object.prototype.hasOwnProperty,K=Object.prototype.hasOwnProperty;function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}X.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return q.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:K.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this};var $=X,Q=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function J(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}J.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(G||b),string:new $}},J.prototype.delete=function(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return Q(this,e).get(e)},J.prototype.has=function(e){return Q(this,e).has(e)},J.prototype.set=function(e,t){var n=Q(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Z=J;function ee(e){var t=this.__data__=new b(e);this.size=t.size}ee.prototype.clear=function(){this.__data__=new b,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof b){var l=n.__data__;if(!G||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Z(l)}return n.set(e,t),this.size=n.size,this};var te=ee,ne=function(){try{var e=V(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),le=function(e,t,n){"__proto__"==t&&ne?ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},oe=Object.prototype.hasOwnProperty,ie=function(e,t,n){var l=e[t];oe.call(e,t)&&E(l,n)&&(void 0!==n||t in e)||le(e,t,n)},ae=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?le(n,r,u):ie(n,r,u)}return n},re=function(e){return null!=e&&"object"==typeof e},ue=function(e){return re(e)&&"[object Arguments]"==F(e)},se=Object.prototype,ce=se.hasOwnProperty,de=se.propertyIsEnumerable,me=ue(function(){return arguments}())?ue:function(e){return re(e)&&ce.call(e,"callee")&&!de.call(e,"callee")},ve=Array.isArray,pe=function(){return!1},fe=A(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?T.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||pe}),Ee=/^(?:0|[1-9]\d*)$/,ge=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Ee.test(e))&&e>-1&&e%1==0&&e<t},he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_e={};_e["[object Float32Array]"]=_e["[object Float64Array]"]=_e["[object Int8Array]"]=_e["[object Int16Array]"]=_e["[object Int32Array]"]=_e["[object Uint8Array]"]=_e["[object Uint8ClampedArray]"]=_e["[object Uint16Array]"]=_e["[object Uint32Array]"]=!0,_e["[object Arguments]"]=_e["[object Array]"]=_e["[object ArrayBuffer]"]=_e["[object Boolean]"]=_e["[object DataView]"]=_e["[object Date]"]=_e["[object Error]"]=_e["[object Function]"]=_e["[object Map]"]=_e["[object Number]"]=_e["[object Object]"]=_e["[object RegExp]"]=_e["[object Set]"]=_e["[object String]"]=_e["[object WeakMap]"]=!1;var Se=function(e){return function(t){return e(t)}},be=A(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&D.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),ye=be&&be.isTypedArray,Ae=ye?Se(ye):function(e){return re(e)&&he(e.length)&&!!_e[F(e)]},Ce=Object.prototype.hasOwnProperty,De=function(e,t){var n=ve(e),l=!n&&me(e),o=!n&&!l&&fe(e),i=!n&&!l&&!o&&Ae(e),a=n||l||o||i,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!Ce.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ge(s,u))||r.push(s);return r},Ne=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)},Le=function(e,t){return function(n){return e(t(n))}},Oe=Le(Object.keys,Object),Ie=Object.prototype.hasOwnProperty,we=function(e){return null!=e&&he(e.length)&&!M(e)},xe=function(e){return we(e)?De(e):function(e){if(!Te(e))return Oe(e);var t=[];for(var n in Object(e))Ie.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Pe=Object.prototype.hasOwnProperty,Re=function(e){return we(e)?De(e,!0):function(e){if(!B(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Te(e),n=[];for(var l in e)("constructor"!=l||!t&&Pe.call(e,l))&&n.push(l);return n}(e)},Fe=A(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?T.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(n):new e.constructor(n);return e.copy(l),l}}),Be=function(){return[]},Me=Object.prototype.propertyIsEnumerable,ke=Object.getOwnPropertySymbols,Ue=ke?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,o=null==t?0:t.length,i=0,a=[];++l<o;){var r=t[l];Me.call(e,r)&&(a[i++]=r)}return a}(ke(e)))}:Be,We=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},He=Le(Object.getPrototypeOf,Object),je=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)We(t,Ue(e)),e=He(e);return t}:Be,ze=function(e,t,n){var l=t(e);return ve(e)?l:We(l,n(e))},Ve=function(e){return ze(e,xe,Ue)},Ge=function(e){return ze(e,Re,je)},Ye=V(T,"DataView"),qe=V(T,"Promise"),Ke=V(T,"Set"),Xe=V(T,"WeakMap"),$e=H(Ye),Qe=H(G),Je=H(qe),Ze=H(Ke),et=H(Xe),tt=F;(Ye&&"[object DataView]"!=tt(new Ye(new ArrayBuffer(1)))||G&&"[object Map]"!=tt(new G)||qe&&"[object Promise]"!=tt(qe.resolve())||Ke&&"[object Set]"!=tt(new Ke)||Xe&&"[object WeakMap]"!=tt(new Xe))&&(tt=function(e){var t=F(e),n="[object Object]"==t?e.constructor:void 0,l=n?H(n):"";if(l)switch(l){case $e:return"[object DataView]";case Qe:return"[object Map]";case Je:return"[object Promise]";case Ze:return"[object Set]";case et:return"[object WeakMap]"}return t});var nt=tt,lt=Object.prototype.hasOwnProperty,ot=T.Uint8Array,it=function(e){var t=new e.constructor(e.byteLength);return new ot(t).set(new ot(e)),t},at=/\w*$/,rt=L?L.prototype:void 0,ut=rt?rt.valueOf:void 0,st=Object.create,ct=function(){function e(){}return function(t){if(!B(t))return{};if(st)return st(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),dt=be&&be.isMap,mt=dt?Se(dt):function(e){return re(e)&&"[object Map]"==nt(e)},vt=be&&be.isSet,pt=vt?Se(vt):function(e){return re(e)&&"[object Set]"==nt(e)},ft={};ft["[object Arguments]"]=ft["[object Array]"]=ft["[object ArrayBuffer]"]=ft["[object DataView]"]=ft["[object Boolean]"]=ft["[object Date]"]=ft["[object Float32Array]"]=ft["[object Float64Array]"]=ft["[object Int8Array]"]=ft["[object Int16Array]"]=ft["[object Int32Array]"]=ft["[object Map]"]=ft["[object Number]"]=ft["[object Object]"]=ft["[object RegExp]"]=ft["[object Set]"]=ft["[object String]"]=ft["[object Symbol]"]=ft["[object Uint8Array]"]=ft["[object Uint8ClampedArray]"]=ft["[object Uint16Array]"]=ft["[object Uint32Array]"]=!0,ft["[object Error]"]=ft["[object Function]"]=ft["[object WeakMap]"]=!1;var Et=function e(t,n,l,o,i,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=i?l(t,o,i,a):l(t)),void 0!==r)return r;if(!B(t))return t;var d=ve(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&lt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var m=nt(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(fe(t))return Fe(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!i){if(r=s||v?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:ct(He(e))}(t),!u)return s?function(e,t){return ae(e,je(e),t)}(t,function(e,t){return e&&ae(t,Re(t),e)}(r,t)):function(e,t){return ae(e,Ue(e),t)}(t,function(e,t){return e&&ae(t,xe(t),e)}(r,t))}else{if(!ft[m])return i?t:{};r=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return it(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?it(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?it(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,at.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return ut?Object(ut.call(e)):{}}}(t,m,u)}}a||(a=new te);var p=a.get(t);if(p)return p;a.set(t,r),pt(t)?t.forEach(function(o){r.add(e(o,n,l,o,t,a))}):mt(t)&&t.forEach(function(o,i){r.set(i,e(o,n,l,i,t,a))});var f=d?void 0:(c?s?Ge:Ve:s?Re:xe)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(o,i){f&&(o=t[i=o]),ie(r,i,e(o,n,l,i,t,a))}),r},gt=function(e){return Et(e,5)};const ht=e=>{var o,a;const{t:r}=i.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),s=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),c=f();let m=[];1==(null==c?void 0:c.length)&&(m=[null==c||null===(o=c[0])||void 0===o?void 0:o.code]),(null==c?void 0:c.length)>1&&(null==c||c.forEach(e=>{m.push(e.code)}));const[v,p]=n.useState({offset:0,limit:10,tenantId:u,nocType:m[0]}),E={offset:0,limit:10,tenantId:u,nocType:m[0]},g=window.Digit.Utils.browser.isMobile(),{data:h,isLoading:_,isSuccess:S,error:b}=Digit.Hooks.noc.useNOCSearchApplication(u,v,{});return l.createElement("div",null,l.createElement(t.CardHeader,{styles:g?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},r("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(s,{t:r,tenantId:u,onSubmit:function(e,t){void 0===t&&(t=!1);let n=gt(e),l=E;for(const[t,n]of Object.entries(e))null!=n&&null!=n&&""!=n&&(l=d({},l,{[t]:n}));p(1==t?n:l)},isLoading:_,Count:null==h?void 0:h.count,error:b,data:!_&&S&&(null==h||null===(a=h.Noc)||void 0===a?void 0:a.length)>0?h.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},_t=e=>{var n,a;const{state:r}=e.location,{t:u}=i.useTranslation(),s=o.useHistory(),c=null==r||null===(n=r.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_"+p(null==c?void 0:c.applicationStatus,".","_")+"_HEADER"),applicationNumber:null==c?void 0:c.nocNo,info:"REJECTED"==(null==c?void 0:c.applicationStatus)?"":u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.applicationStatus)?l.createElement(t.CardText,null,u("NOC_"+p(null==c?void 0:c.nocType,".","_")+"_"+p(null==c?void 0:c.applicationStatus,".","_")+"_SUB_HEADER")):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/employee")}}))))},St=e=>{let{location:n}=e;const{t:o}=i.useTranslation(),a=[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:o("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},bt=e=>{var a,r,u,s,c,m;let{path:v}=e;const p=o.useLocation(),f=(i.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),E=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NOCInbox"),g=null===(c=Digit)||void 0===c||null===(m=c.ComponentRegistryService)||void 0===m?void 0:m.getComponent("NewNOCStepperForm"),h=window.location.href.includes("/response"),_=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,h?null:l.createElement("div",{style:window.location.href.includes("application-overview")||_?{marginLeft:"10px"}:{}},l.createElement(St,{location:p})),l.createElement(o.Switch,null,l.createElement(t.PrivateRoute,{path:v+"/inbox/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:v+"/search/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:v+"/new-application",component:g}),l.createElement(t.PrivateRoute,{path:v+"/inbox",component:e=>l.createElement(E,d({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/search",component:e=>l.createElement(ht,d({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/response",component:_t})))};function yt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const At=e=>l.createElement("h1",{className:"heading-m"},e.label),Ct=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Dt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ct,null)),Nt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:h}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,S]=n.useState({}),[b,y]=n.useState({}),[A,C]=n.useState([]),[D,N]=n.useState(null),[T,L]=n.useState(null),[O,I]=n.useState(null),[w,x]=n.useState(null),[P,R]=n.useState([]),[F,B]=n.useState(null),[M,k]=n.useState(!1);function U(e){L(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&R(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(m||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:D,setSelectedApprover:N,selectFile:U,uploadedFile:O,setUploadedFile:I,businessService:v}))},[r,A,P,F,O]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(At,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Dt,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:E||(null==r?void 0:r.docUploadRequired)&&!O,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};m.creationReason="STATUS",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:d({},m,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==m?void 0:m.propertyId,tenantId:u,source:null==m?void 0:m.source,channel:null==m?void 0:m.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:O}]),c({Property:d({},m,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},Tt=e=>l.createElement("h1",{className:"heading-m"},e.label),Lt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ot=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Lt,null)),It=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,h]=n.useState({}),[_,S]=n.useState({}),[b,y]=n.useState([]),[A,C]=n.useState({}),[D,N]=n.useState(null),[T,L]=n.useState(null),[O,I]=n.useState(null),[w,x]=n.useState([]),[P,R]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&x(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){N(e.target.files[0])}return n.useEffect(()=>{if(p&&F){var e;const t=F["common-masters"].Department;y(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var n,l,o;const i=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===i);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?L(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&h((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:B,uploadedFile:T,setUploadedFile:L,businessService:v}))},[r,b,w,P,T]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Ot,{onClick:s}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=d({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null}),c({Licenses:[m]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},wt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),xt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xt,null)),Rt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState({}),[C,D]=n.useState(null),[N,T]=n.useState(null),[L,O]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:T,businessService:v,error:L}))},[r,S,N,L]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Pt,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=d({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),c({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Ft=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Bt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Mt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bt,null)),kt=e=>{var o,i,r,u,s,c,m,v,p,f,E,g;let{t:h,action:_,tenantId:S,closeModal:b,submitAction:y,applicationDetails:A,applicationData:C,businessService:D,workflowDetails:N,blockReason:T}=e;console.log("applicationData",C),console.log("workflowDetails",N),Digit.Hooks.obps.useObpsAPI(null!==(o=C)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(r=i.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:S,!1);const{data:L,isLoading:O}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(m=N.data)||void 0===m||null===(v=m.initialActionState)||void 0===v||null===(p=v.nextActions)||void 0===p||null===(f=p.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[x,P]=n.useState({}),[R,F]=n.useState([]),[B,M]=n.useState([]),[k,U]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[Y,q]=n.useState(null),[K,X]=n.useState(null),$=!!Digit.Utils.browser.isMobile();function Q(e){z(e.target.files[0])}n.useEffect(()=>{var e;F(null==L||null===(e=L.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[L]),n.useEffect(()=>{!function(){try{q(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)q(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):q(h("CS_FILE_UPLOAD_ERROR"))})},function(){q(h("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[j]);const J=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},Z=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],o=[];var i,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),o=o.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{o.push({docs:J(e.Documents),date:e.InspectionDate,questions:Z(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",o),o=o.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",o)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,o,i,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{M(null==T?void 0:T.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&w((e=>{var n,o,i,a,r,u,s;let{t:c,action:d,approvers:m,selectedApprover:v,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:g,uploadedFile:h,setUploadedFile:_,assigneeLabel:S,businessService:b,error:y,blockReasonFiltered:A}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+b+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(o=d.state)||void 0===o?void 0:o.state)?null:c(S||"WF_ROLE_"+(null===(i=d.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:m,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:p,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:E,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{_(null)},message:h?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:y})}]}]}})({t:h,action:_,approvers:R,selectedApprover:k,setSelectedApprover:U,selectedBlockReason:W,setBlockReason:H,selectFile:Q,uploadedFile:V,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:B}))},[_,R,K,V,Y]),_&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ft,{label:h(I.label.heading)}),headerBarEnd:l.createElement(Mt,{onClick:b}),actionCancelLabel:h(I.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:h(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:$?{width:"720px"}:{},style:$?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:$?{paddingLeft:"5px"}:{}},O?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,o,i,a,r,u,s,c,m,v,p,f,E,g,D,T,L,O,I,w,x,P,R,F,B;C=d({},C,{documents:te(),additionalDetails:d({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(o=N.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==N||null===(u=N.data)||void 0===u||null===(s=u.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(m=c.assigner)||void 0===m?void 0:m.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(v=N.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.state)||void 0===E?void 0:E.applicationStatus)?[null==N||null===(g=N.data)||void 0===g||null===(D=g.processInstances)||void 0===D||null===(T=D[0])||void 0===T||null===(L=T.assigner)||void 0===L?void 0:L.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(O=N.data)||void 0===O||null===(I=O.processInstances)||void 0===I||null===(w=I[0])||void 0===w||null===(x=w.state)||void 0===x?void 0:x.applicationStatus)?[null==N||null===(P=N.data)||void 0===P||null===(R=P.processInstances)||void 0===R||null===(F=R[0])||void 0===F||null===(B=F.assigner)||void 0===B?void 0:B.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null});const M=function(e,t,n,l,o,i,a,r,u,s,c,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=C)||void 0===l||null===(o=l.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.BPA_LABOUR_CESS)+parseInt(null===(a=C)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=C)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(m=c.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS))){var v,p,f;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==A||null===(v=A.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:d({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(p=e[0])||void 0===p||null===(f=p.Noc)||void 0===f?void 0:f.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var n;let l=!0,o=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,i,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=o||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(o=!1))});let i=[];if(e&&e.map(e=>{var t,n,a,r,u,s,c,d,m,v,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&o)&&i.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?y({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(b(),alert(h("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else y({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}b(),alert(h("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:x,formId:"modal-action"})):l.createElement(t.Loader,null)},Ut=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Wt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ht=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Wt,null)),jt=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:f}=e;const{data:E,isLoading:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[h,_]=(a.useQueryClient(),n.useState({})),[S,b]=n.useState({}),[y,A]=n.useState([]),[C,D]=n.useState({}),[N,T]=n.useState(null),[L,O]=n.useState(null),[I,w]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function P(e){T(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;A(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(u("CS_FILE_UPLOAD_ERROR"))})},function(){w(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{s&&_((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:m,businessService:v,error:p}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(m||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:u,action:s,approvers:y,selectedApprover:C,setSelectedApprover:D,selectFile:P,uploadedFile:L,setUploadedFile:O,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,y,L,I]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ut,{label:u(h.label.heading)}),headerBarEnd:l.createElement(Ht,{onClick:m}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),p=d({},p,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:L?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:L}]:null},documents:i}),v({Noc:p},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},zt=e=>l.createElement("h1",{className:"heading-m"},e.label),Vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vt,null)),Yt=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},qt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState({}),[C,D]=n.useState(null),[N,T]=n.useState(null),[L,O]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[p]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=m)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:m,businessService:v,error:p}=e,f=!0,E=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(f=!1),i.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,d({onChange:e.onChange,date:e.value},n))}:null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{m(null)},message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:T,businessService:v,error:L})):r&&g((e=>{var n;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:m,error:v}=e,p=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:T,businessService:v,error:L}))},[r,S,N,L]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zt,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Gt,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,a,s,v,p,f;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var E,g,h,_,S,b,A,D,T;const t=d({},null===(E=m)||void 0===E||null===(g=E.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=d({},null===(h=m)||void 0===h?void 0:h.billAmendmentDetails,{workflow:{businessId:null===(_=m)||void 0===_||null===(S=_.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(b=m)&&void 0!==b&&null!==(A=b.applicationType)&&void 0!==A&&A.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=m)&&void 0!==D&&null!==(T=D.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}});c({AmendmentUpdate:n})}else{if(m=d({},m,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:d({},null===(n=m)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]})}),null!=e&&e.date&&null!==(l=m)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=gt(null==e?void 0:e.date);m.disconnectionExecutionDate=Yt(t)}else if(null!=e&&e.date){const t=gt(null==e?void 0:e.date);m.connectionExecutionDate=Yt(t)}var L;if("DisconnectWSConnection"==(null===(i=m)||void 0===i||null===(a=i.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=m)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(L=m)||void 0===L?void 0:L.serviceType)?c({WaterConnection:m,disconnectRequest:!0}):c({SewerageConnection:m,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=m)||void 0===p?void 0:p.applicationType))c({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=m)||void 0===f?void 0:f.applicationType))c({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!0});else{var O,I,w,x,P,R,F,B,M,k,U,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenalty&&(m.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(m.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(m.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(m.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(m.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=m)||void 0===H?void 0:H.serviceType)?c({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=e=>l.createElement("h1",{className:"heading-m"},e.label),Xt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xt,null)),Qt=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[N,T]=n.useState(null),[L,O]=n.useState(null),[I,w]=n.useState(!1);function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:T,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{label:a(E.label.heading)}),headerBarEnd:l.createElement($t,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};m.creationReason="CREATE",c({PetRegistrationApplications:[d({},m,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),c({PetRegistrationApplications:[d({},m,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Jt=e=>l.createElement("h1",{className:"heading-m"},e.label),Zt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),en=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zt,null)),tn=e=>{var o,i,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:m,businessService:v}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(o=f.TradeLicense)||void 0===o?void 0:o.TradeType),console.log("applicationData",m);const[g,h]=n.useState({}),[_,S]=n.useState({}),[b,y]=n.useState([]),[A,C]=n.useState(""),[D,N]=n.useState([]),[T,L]=n.useState(null),O=null===(i=m)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",O);const I=n.useMemo(()=>{var e;if(E||!f||!O.length)return[];const t=new Set(O.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[E,f,O]);return console.log("years",I),n.useEffect(()=>{u&&h((e=>{let{t:n,action:o,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:A,setSelectedApprover:C,businessService:v}))},[u,I,D,T]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Jt,{label:r(g.label.heading)}),headerBarEnd:l.createElement(en,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=m)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],o="20"+Number(l)+"-"+(Number(l)+1);m=d({},m,{financialYear:o,action:"INITIATE",additionalDetail:d({},m.additionalDetail,{validityYears:A.length>0?parseInt(A):""})}),c({Licenses:[m]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},nn=e=>l.createElement("h1",{className:"heading-m"},e.label),ln=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),on=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ln,null)),an=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[N,T]=n.useState(null),[L,O]=n.useState(null),[I,w]=n.useState(!1);function x(e){w(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,m),n.useEffect(()=>{g((e=>{let{t:n,action:o,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const m=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:c,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(m,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:T,businessService:v,isUploading:I}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(on,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==m||null===(t=m.auditDetails)||void 0===t?void 0:t.createdBy]:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null};N&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),c({streetVendingDetail:d({},m,{workflow:n})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},rn=e=>l.createElement("h1",{className:"heading-m"},e.label),un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(un,null)),cn=e=>{var o,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,g]=n.useState({}),[h,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[N,T]=n.useState(null),[L,O]=n.useState(null),[I,w]=n.useState(!1);function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?T(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:o,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:T,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(rn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(sn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N}]),c({hallsBookingApplication:[d({},m,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},dn=e=>l.createElement("h1",{className:"heading-m"},e.label),mn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mn,null)),pn=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:m,submitAction:v,applicationData:p,businessService:f,moduleCode:E}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),h=o.useHistory(),[_,S]=n.useState({}),[b,y]=n.useState({}),[A,C]=n.useState([]),[D,N]=n.useState(null),[T,L]=n.useState(null);return n.useEffect(()=>{var e;C(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:A,selectedApprover:D,setSelectedApprover:N,uploadedFile:T,setUploadedFile:L,businessService:f}))},[s,A,T]),s&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dn,{label:u(_.label.heading)}),headerBarEnd:l.createElement(vn,{onClick:m}),actionCancelLabel:u(_.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};T&&(t.documents=[]),v({Asset:d({},p,{workflow:t})})},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},fn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Nt,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Qt,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(It,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(tn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Rt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(kt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(jt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(qt,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(an,e):null!=e&&e.businessService.includes("chb")?l.createElement(cn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(pn,e):void 0;var En=A(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",h="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",T="[object Int32Array]",L="[object Uint8Array]",O="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(R.source),M=RegExp(F.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Z=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",me="["+de+"]",ve="["+ce+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ye="(?:"+fe+"|"+Ee+")",Ae="(?:"+be+"|"+Ee+")",Ce="(?:"+ve+"|"+ge+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[he,_e,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Ne="(?:"+["[\\u2700-\\u27bf]",_e,Se].join("|")+")"+De,Te="(?:"+[he+ve+"?",ve,_e,Se,"[\\ud800-\\udfff]"].join("|")+")",Le=RegExp("['’]","g"),Oe=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Te+De,"g"),we=RegExp([be+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,be+ye,"$"].join("|")+")",be+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pe,Ne].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fe=-1,Be={};Be[A]=Be[C]=Be[D]=Be[N]=Be[T]=Be[L]=Be["[object Uint8ClampedArray]"]=Be[O]=Be[I]=!0,Be[i]=Be[a]=Be[S]=Be[r]=Be[b]=Be[u]=Be[s]=Be[c]=Be[m]=Be[v]=Be[p]=Be[f]=Be[E]=Be[g]=Be[_]=!1;var Me={};Me[i]=Me[a]=Me[S]=Me[b]=Me[r]=Me[u]=Me[A]=Me[C]=Me[D]=Me[N]=Me[T]=Me[m]=Me[v]=Me[p]=Me[f]=Me[E]=Me[g]=Me[h]=Me[L]=Me["[object Uint8ClampedArray]"]=Me[O]=Me[I]=!0,Me[s]=Me[c]=Me[_]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,He="object"==typeof y&&y&&y.Object===Object&&y,je="object"==typeof self&&self&&self.Object===Object&&self,ze=He||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,qe=Ye&&He.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,$e=Ke&&Ke.isDate,Qe=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Ze=Ke&&Ke.isSet,et=Ke&&Ke.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,o=0,i=[];++n<l;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function dt(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function mt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var pt=bt("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,_t,n)}function ht(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function _t(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function yt(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function Ct(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Dt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Nt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Tt(e){return function(t){return e(t)}}function Lt(e,t){return st(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&gt(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&gt(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=yt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=yt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ft(e){return"\\"+ke[e]}function Bt(e){return xe.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function kt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[i++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function jt(e){return Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Gt=yt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var y=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=y.prototype,he=ve.prototype,_e=t["__core-js_shared__"],Se=de.prototype.toString,be=he.hasOwnProperty,ye=0,Ae=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=he.toString,De=Se.call(ve),Ne=ze._,Te=pe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,xe=t.Symbol,ke=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=kt(ve.getPrototypeOf,ve),Ve=ve.create,Ge=he.propertyIsEnumerable,qe=ge.splice,Ke=xe?xe.isConcatSpreadable:void 0,pt=xe?xe.iterator:void 0,yt=xe?xe.toStringTag:void 0,qt=function(){try{var e=Jo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=q&&q.now!==ze.Date.now&&q.now,$t=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=me.ceil,Jt=me.floor,Zt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=kt(ve.keys,ve),on=me.max,an=me.min,rn=q.now,un=t.parseInt,sn=me.random,cn=ge.reverse,dn=Jo(t,"DataView"),mn=Jo(t,"Map"),vn=Jo(t,"Promise"),pn=Jo(t,"Set"),fn=Jo(t,"WeakMap"),En=Jo(ve,"create"),gn=fn&&new fn,hn={},_n=Ti(dn),Sn=Ti(mn),bn=Ti(vn),yn=Ti(pn),An=Ti(fn),Cn=xe?xe.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Tn(e){if(Va(e)&&!Pa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return Li(e)}return new In(e)}var Ln=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=Pa(e),l=!n&&xa(e),o=!n&&!l&&Ma(e),i=!n&&!l&&!o&&Ja(e),a=n||l||o||i,r=a?Dt(e.length,fe):[],u=r.length;for(var s in e)!t&&!be.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ii(s,u))||r.push(s);return r}function kn(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function Un(e,t){return yi(Eo(e),Kn(t,0,e.length))}function Wn(e){return yi(Eo(e))}function Hn(e,t,n){(void 0!==n&&!Oa(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];be.call(e,t)&&Oa(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Oa(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Zn(e,function(e,o,i){t(l,e,n(e),i)}),l}function Gn(e,t){return e&&go(t,Sr(t),e)}function Yn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=y(l),i=null==e;++n<l;)o[n]=i?void 0:fr(e,t[n]);return o}function Kn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,o,a){var s,_=1&t,y=2&t,w=4&t;if(n&&(s=o?n(e,l,o,a):n(e)),void 0!==s)return s;if(!za(e))return e;var x=Pa(e);if(x){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!_)return Eo(e,s)}else{var P=ti(e),R=P==c||P==d;if(Ma(e))return so(e,_);if(P==p||P==i||R&&!o){if(s=y||R?{}:li(e),!_)return y?function(e,t){return go(e,ei(e),t)}(e,function(e,t){return e&&go(t,br(t),e)}(s,e)):function(e,t){return go(e,Zo(e),t)}(e,Gn(s,e))}else{if(!Me[P])return o?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return co(e);case r:case u:return new l(+e);case b:return function(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case A:case C:case D:case N:case T:case L:case"[object Uint8ClampedArray]":case O:case I:return mo(e,n);case m:return new l;case v:case g:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case h:return Dn?ve(Dn.call(e)):{}}}(e,P,_)}}a||(a=new Bn);var F=a.get(e);if(F)return F;a.set(e,s),Xa(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,a))}):Ga(e)&&e.forEach(function(l,o){s.set(o,Xn(l,t,n,o,e,a))});var B=x?void 0:(w?y?Go:Vo:y?br:Sr)(e);return lt(B||e,function(l,o){B&&(l=e[o=l]),jn(s,o,Xn(l,t,n,o,e,a))}),s}function $n(e,t,n){var l=n.length;if(null==e)return!l;for(e=ve(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new Ee(n);return hi(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var o=-1,i=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,Tt(n))),l?(i=ut,a=!1):t.length>=200&&(i=Ot,a=!1,t=new Fn(t));e:for(;++o<r;){var c=e[o],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&d==d){for(var m=s;m--;)if(t[m]===d)continue e;u.push(c)}else i(t,d,l)||u.push(c)}return u}Tn.templateSettings={escape:k,evaluate:U,interpolate:W,variable:"",imports:{_:Tn}},(Tn.prototype=On.prototype).constructor=Tn,(In.prototype=Ln(On.prototype)).constructor=In,(wn.prototype=Ln(On.prototype)).constructor=wn,xn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:be.call(t,e)},xn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(mn||Pn),string:new xn}},Rn.prototype.delete=function(e){var t=$o(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return $o(this,e).get(e)},Rn.prototype.has=function(e){return $o(this,e).has(e)},Rn.prototype.set=function(e,t){var n=$o(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var l=n.__data__;if(!mn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Zn=So(rl),el=So(ul,!0);function tl(e,t){var n=!0;return Zn(e,function(e,l,o){return n=!!t(e,l,o)}),n}function nl(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],a=t(i);if(null!=a&&(void 0===r?a==a&&!Qa(a):n(a,r)))var r=a,u=i}return u}function ll(e,t){var n=[];return Zn(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function ol(e,t,n,l,o){var i=-1,a=e.length;for(n||(n=oi),o||(o=[]);++i<a;){var r=e[i];t>0&&n(r)?t>1?ol(r,t-1,n,l,o):ct(o,r):l||(o[o.length]=r)}return o}var il=bo(),al=bo(!0);function rl(e,t){return e&&il(e,t,Sr)}function ul(e,t){return e&&al(e,t,Sr)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function cl(e,t){for(var n=0,l=(t=io(t,e)).length;null!=e&&n<l;)e=e[Ni(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return Pa(e)?l:ct(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yt&&yt in ve(e)?function(e){var t=be.call(e,yt),n=e[yt];try{e[yt]=void 0;var l=!0}catch(e){}var o=Ce.call(e);return l&&(t?e[yt]=n:delete e[yt]),o}(e):function(e){return Ce.call(e)}(e)}function vl(e,t){return e>t}function pl(e,t){return null!=e&&be.call(e,t)}function fl(e,t){return null!=e&&t in ve(e)}function El(e,t,n){for(var l=n?ut:rt,o=e[0].length,i=e.length,a=i,r=y(i),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,Tt(t))),u=an(c.length,u),r[a]=!n&&(t||o>=120&&c.length>=120)?new Fn(a&&c):void 0}c=e[0];var d=-1,m=r[0];e:for(;++d<o&&s.length<u;){var v=c[d],p=t?t(v):v;if(v=n||0!==v?v:0,!(m?Ot(m,p):l(s,p,n))){for(a=i;--a;){var f=r[a];if(!(f?Ot(f,p):l(e[a],p,n)))continue e}m&&m.push(p),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=pi(e,t=io(t,e)))?e:e[Ni(Ui(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Va(e)&&ml(e)==i}function _l(e,t,n,l,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,o,c){var d=Pa(e),_=Pa(t),y=d?a:ti(e),A=_?a:ti(t),C=(y=y==i?p:y)==p,D=(A=A==i?p:A)==p,N=y==A;if(N&&Ma(e)){if(!Ma(t))return!1;d=!0,C=!1}if(N&&!C)return c||(c=new Bn),d||Ja(e)?jo(e,t,n,l,o,c):function(e,t,n,l,o,i,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new ke(e),new ke(t)));case r:case u:case v:return Oa(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case m:var c=Mt;case E:if(c||(c=Wt),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var p=jo(c(e),c(t),l,o,i,a);return a.delete(e),p;case h:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,y,n,l,o,c);if(!(1&n)){var T=C&&be.call(e,"__wrapped__"),L=D&&be.call(t,"__wrapped__");if(T||L){var O=T?e.value():e,I=L?t.value():t;return c||(c=new Bn),o(O,I,n,l,c)}}return!!N&&(c||(c=new Bn),function(e,t,n,l,o,i){var a=1&n,r=Vo(e),u=r.length;if(u!=Vo(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:be.call(t,c)))return!1}var d=i.get(e),m=i.get(t);if(d&&m)return d==t&&m==e;var v=!0;i.set(e,t),i.set(t,e);for(var p=a;++s<u;){var f=e[c=r[s]],E=t[c];if(l)var g=a?l(E,f,c,t,e,i):l(f,E,c,e,t,i);if(!(void 0===g?f===E||o(f,E,n,l,i):g)){v=!1;break}p||(p="constructor"==c)}if(v&&!p){var h=e.constructor,_=t.constructor;h==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof _&&_ instanceof _||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,n,l,o,c))}(e,t,n,l,_l,o))}function Sl(e,t,n,l){var o=n.length,i=o,a=!l;if(null==e)return!i;for(e=ve(e);o--;){var r=n[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=n[o])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Bn;if(l)var m=l(s,c,u,e,t,d);if(!(void 0===m?_l(c,s,3,l,d):m))return!1}}return!0}function bl(e){return!(!za(e)||(t=e,Ae&&Ae in t))&&(Wa(e)?Te:oe).test(Ti(e));var t}function yl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Pa(e)?Tl(e[0],e[1]):Nl(e):tu(e)}function Al(e){if(!ci(e))return ln(e);var t=[];for(var n in ve(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=Fa(e)?y(e.length):[];return Zn(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Nl(e){var t=Qo(e);return 1==t.length&&t[0][2]?mi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Tl(e,t){return ri(e)&&di(t)?mi(Ni(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):_l(t,l,3)}}function Ll(e,t,n,l,o){e!==t&&il(t,function(i,a){if(o||(o=new Bn),za(i))!function(e,t,n,l,o,i,a){var r=Ei(e,n),u=Ei(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var c=i?i(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var m=Pa(u),v=!m&&Ma(u),p=!m&&!v&&Ja(u);c=u,m||v||p?Pa(r)?c=r:Ba(r)?c=Eo(r):v?(d=!1,c=so(u,!0)):p?(d=!1,c=mo(u,!0)):c=[]:qa(u)||xa(u)?(c=r,xa(r)?c=ar(r):za(r)&&!Wa(r)||(c=li(u))):d=!1}d&&(a.set(u,c),o(c,u,l,i,a),a.delete(u)),Hn(e,n,c)}}(e,t,a,n,Ll,l,o);else{var r=l?l(Ei(e,a),i,a+"",e,t,o):void 0;void 0===r&&(r=i),Hn(e,a,r)}},br)}function Ol(e,t){var n=e.length;if(n)return ii(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Pa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Tt(Xo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,a=o.length,r=n.length;++l<a;){var u=vo(o[l],i[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,o){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(i,io(a,e),r)}return i}function xl(e,t,n,l){var o=l?ht:gt,i=-1,a=t.length,r=e;for(e===t&&(t=Eo(t)),n&&(r=st(e,Tt(n)));++i<a;)for(var u=0,s=t[i],c=n?n(s):s;(u=o(r,c,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Pl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ii(o)?qe.call(e,o,1):Ql(e,o)}}return e}function Rl(e,t){return e+Jt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Bl(e,t){return _i(vi(e,t,Yr),e+"")}function Ml(e){return kn(Or(e))}function kl(e,t){var n=Or(e);return yi(n,Kn(t,0,n.length))}function Ul(e,t,n,l){if(!za(e))return e;for(var o=-1,i=(t=io(t,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Ni(t[o]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=za(c)?c:ii(t[o+1])?[]:{})}jn(r,u,s),r=r[u]}return e}var Wl=gn?function(e,t){return gn.set(e,t),e}:Yr,Hl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jl(e){return yi(Or(e))}function zl(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=y(o);++l<o;)i[l]=e[l+t];return i}function Vl(e,t){var n;return Zn(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Gl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,a=e[i];null!==a&&!Qa(a)&&(n?a<=t:a<t)?l=i+1:o=i}return o}return Yl(e,t,Yr,n)}function Yl(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Qa(t),s=void 0===t;o<i;){var c=Jt((o+i)/2),d=n(e[c]),m=void 0!==d,v=null===d,p=d==d,f=Qa(d);if(a)var E=l||p;else E=s?p&&(l||m):r?p&&m&&(l||!v):u?p&&m&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);E?o=c+1:i=c}return an(i,4294967294)}function ql(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Oa(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Kl(e){return"number"==typeof e?e:Qa(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return st(e,Xl)+"";if(Qa(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $l(e,t,n){var l=-1,o=rt,i=e.length,a=!0,r=[],u=r;if(n)a=!1,o=ut;else if(i>=200){var s=t?null:Bo(e);if(s)return Wt(s);a=!1,o=Ot,u=new Fn}else u=t?[]:r;e:for(;++l<i;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var m=u.length;m--;)if(u[m]===d)continue e;t&&u.push(d),r.push(c)}else o(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function Ql(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Ni(Ui(t))]}function Jl(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function Zl(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function eo(e,t){var n=e;return n instanceof wn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function to(e,t,n){var l=e.length;if(l<2)return l?$l(e[0]):[];for(var o=-1,i=y(l);++o<l;)for(var a=e[o],r=-1;++r<l;)r!=o&&(i[o]=Jn(i[o]||a,e[r],t,n));return $l(ol(i,1),t,n)}function no(e,t,n){for(var l=-1,o=e.length,i=t.length,a={};++l<o;)n(a,e[l],l<i?t[l]:void 0);return a}function lo(e){return Ba(e)?e:[]}function oo(e){return"function"==typeof e?e:Yr}function io(e,t){return Pa(e)?e:ri(e,t)?[e]:Di(rr(e))}var ao=Bl;function ro(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var uo=Kt||function(e){return ze.clearTimeout(e)};function so(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function co(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function mo(e,t){var n=t?co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=Qa(e),a=void 0!==t,r=null===t,u=t==t,s=Qa(t);if(!r&&!s&&!i&&e>t||i&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!o)return 1;if(!l&&!i&&!s&&e<t||s&&n&&o&&!l&&!i||r&&n&&o||!a&&o||!u)return-1}return 0}function po(e,t,n,l){for(var o=-1,i=e.length,a=n.length,r=-1,u=t.length,s=on(i-a,0),c=y(u+s),d=!l;++r<u;)c[r]=t[r];for(;++o<a;)(d||o<i)&&(c[n[o]]=e[o]);for(;s--;)c[r++]=e[o++];return c}function fo(e,t,n,l){for(var o=-1,i=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(i-r,0),d=y(c+s),m=!l;++o<c;)d[o]=e[o];for(var v=o;++u<s;)d[v+u]=t[u];for(;++a<r;)(m||o<i)&&(d[v+n[a]]=e[o++]);return d}function Eo(e,t){var n=-1,l=e.length;for(t||(t=y(l));++n<l;)t[n]=e[n];return t}function go(e,t,n,l){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),o?Yn(n,r,u):jn(n,r,u)}return n}function ho(e,t){return function(n,l){var o=Pa(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(l,2),i)}}function _o(e){return Bl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ai(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++l<o;){var r=n[l];r&&e(t,r,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fa(n))return e(n,l);for(var o=n.length,i=t?o:-1,a=ve(n);(t?i--:++i<o)&&!1!==l(a[i],i,a););return n}}function bo(e){return function(t,n,l){for(var o=-1,i=ve(t),a=l(t),r=a.length;r--;){var u=a[e?r:++o];if(!1===n(i[u],u,i))break}return t}}function yo(e){return function(t){var n=Bt(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),o=n?ro(n,1).join(""):t.slice(1);return l[e]()+o}}function Ao(e){return function(t){return dt(Wr(xr(t).replace(Le,"")),e,"")}}function Co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Ln(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Do(e){return function(t,n,l){var o=ve(t);if(!Fa(t)){var i=Xo(n,3);t=Sr(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,l);return a>-1?o[i?t[a]:a]:void 0}}function No(e){return zo(function(t){var l=t.length,o=l,i=In.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new Ee(n);if(i&&!r&&"wrapper"==qo(a))var r=new In([],!0)}for(o=r?o:l;++o<l;){var u=qo(a=t[o]),s="wrapper"==u?Yo(a):void 0;r=s&&ui(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[qo(s[0])].apply(r,s[3]):1==a.length&&ui(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Pa(n))return r.plant(n).value();for(var o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function To(e,t,n,l,o,i,a,r,u,s){var c=128&t,d=1&t,m=2&t,v=24&t,p=512&t,f=m?void 0:Co(e);return function E(){for(var g=arguments.length,h=y(g),_=g;_--;)h[_]=arguments[_];if(v)var S=Ko(E),b=xt(h,S);if(l&&(h=po(h,l,o,v)),i&&(h=fo(h,i,a,v)),g-=b,v&&g<s){var A=Ut(h,S);return Ro(e,t,To,E.placeholder,n,h,A,r,u,s-g)}var C=d?n:this,D=m?C[e]:e;return g=h.length,r?h=fi(h,r):p&&g>1&&h.reverse(),c&&u<g&&(h.length=u),this&&this!==ze&&this instanceof E&&(D=f||Co(D)),D.apply(C,h)}}function Lo(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function Oo(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Kl(n),l=Kl(l)),o=e(n,l)}return o}}function Io(e){return zo(function(t){return t=st(t,Tt(Xo())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wo(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Qt(e/jt(t)));return Bt(t)?ro(zt(l),0,e).join(""):l.slice(0,e)}function xo(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var o=-1,i=on(Qt((t-e)/(n||1)),0),a=y(i);i--;)a[l?i:++o]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Po(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ir(t),n=ir(n)),e(t,n)}}function Ro(e,t,n,l,o,i,a,r,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,r,u,s],m=n.apply(void 0,d);return ui(e)&&gi(m,d),m.placeholder=l,Si(m,e,t)}function Fo(e){var t=me[e];return function(e,n){if(e=ir(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Bo=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Qr;function Mo(e){return function(t){var n=ti(t);return n==m?Mt(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function ko(e,t,o,i,a,r,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(n);var d=i?i.length:0;if(d||(t&=-97,i=a=void 0),u=void 0===u?u:on(lr(u),0),s=void 0===s?s:lr(s),d-=a?a.length:0,64&t){var m=i,v=a;i=a=void 0}var p=c?void 0:Yo(e),f=[e,t,o,i,a,m,v,r,u,s];if(p&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?po(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fo(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(f,p),e=f[0],t=f[1],o=f[2],i=f[3],a=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:on(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Co(e);return function o(){for(var i=arguments.length,a=y(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var s=i<3&&a[0]!==u&&a[i-1]!==u?[]:Ut(a,u);if((i-=s.length)<n)return Ro(e,t,To,o.placeholder,void 0,a,s,void 0,void 0,n-i);var c=this&&this!==ze&&this instanceof o?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?To.apply(void 0,f):function(e,t,n,l){var o=1&t,i=Co(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=y(s+r),d=this&&this!==ze&&this instanceof t?i:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,o?n:this,c)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=Co(e);return function t(){var i=this&&this!==ze&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((p?Wl:gi)(E,f),e,t)}function Uo(e,t,n,l){return void 0===e||Oa(e,he[n])&&!be.call(l,n)?t:e}function Wo(e,t,n,l,o,i){return za(e)&&za(t)&&(i.set(t,e),Ll(e,t,void 0,Wo,i),i.delete(t)),e}function Ho(e){return qa(e)?void 0:e}function jo(e,t,n,l,o,i){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,m=!0,v=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++d<r;){var p=e[d],f=t[d];if(l)var E=a?l(f,p,d,t,e,i):l(p,f,d,e,t,i);if(void 0!==E){if(E)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(p===e||o(p,e,n,l,i)))return v.push(t)})){m=!1;break}}else if(p!==f&&!o(p,f,n,l,i)){m=!1;break}}return i.delete(e),i.delete(t),m}function zo(e){return _i(vi(e,void 0,Ri),e+"")}function Vo(e){return dl(e,Sr,Zo)}function Go(e){return dl(e,br,ei)}var Yo=gn?function(e){return gn.get(e)}:Qr;function qo(e){for(var t=e.name+"",n=hn[t],l=be.call(hn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Ko(e){return(be.call(Tn,"placeholder")?Tn:e).placeholder}function Xo(){var e=Tn.iteratee||qr;return e=e===qr?yl:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Qo(e){for(var t=Sr(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,di(o)]}return t}function Jo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Zo=Zt?function(e){return null==e?[]:(e=ve(e),at(Zt(e),function(t){return Ge.call(e,t)}))}:ou,ei=Zt?function(e){for(var t=[];e;)ct(t,Zo(e)),e=je(e);return t}:ou,ti=ml;function ni(e,t,n){for(var l=-1,o=(t=io(t,e)).length,i=!1;++l<o;){var a=Ni(t[l]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&ja(o)&&ii(a,o)&&(Pa(e)||xa(e))}function li(e){return"function"!=typeof e.constructor||ci(e)?{}:Ln(je(e))}function oi(e){return Pa(e)||xa(e)||!!(Ke&&e&&e[Ke])}function ii(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ai(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Fa(n)&&ii(t,n.length):"string"==l&&t in n)&&Oa(n[t],e)}function ri(e,t){if(Pa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qa(e))||j.test(e)||!H.test(e)||null!=t&&e in ve(t)}function ui(e){var t=qo(e),n=Tn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Yo(n);return!!l&&e===l[0]}(dn&&ti(new dn(new ArrayBuffer(1)))!=b||mn&&ti(new mn)!=m||vn&&"[object Promise]"!=ti(vn.resolve())||pn&&ti(new pn)!=E||fn&&ti(new fn)!=_)&&(ti=function(e){var t=ml(e),n=t==p?e.constructor:void 0,l=n?Ti(n):"";if(l)switch(l){case _n:return b;case Sn:return m;case bn:return"[object Promise]";case yn:return E;case An:return _}return t});var si=_e?Wa:iu;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function di(e){return e==e&&!za(e)}function mi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vi(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=on(l.length-t,0),a=y(i);++o<i;)a[o]=l[t+o];o=-1;for(var r=y(t+1);++o<t;)r[o]=l[o];return r[t]=n(a),tt(e,this,r)}}function pi(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function fi(e,t){for(var n=e.length,l=an(t.length,n),o=Eo(e);l--;){var i=t[l];e[l]=ii(i,n)?o[i]:void 0}return e}function Ei(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gi=bi(Wl),hi=$t||function(e,t){return ze.setTimeout(e,t)},_i=bi(Hl);function Si(e,t,n){var l=t+"";return _i(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(o,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split($):[]}(l),n)))}function bi(e){var t=0,n=0;return function(){var l=rn(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function yi(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Rl(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Ai,Ci,Di=(Ai=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,o){t.push(l?o.replace(Z,"$1"):n||e)}),t},function(e){return 500===Ci.size&&Ci.clear(),e}),Ci=Ai.cache,Ai);function Ni(e){if("string"==typeof e||Qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ti(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Li(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=Eo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Oi=Bl(function(e,t){return Ba(e)?Jn(e,ol(t,1,Ba,!0)):[]}),Ii=Bl(function(e,t){var n=Ui(t);return Ba(n)&&(n=void 0),Ba(e)?Jn(e,ol(t,1,Ba,!0),Xo(n,2)):[]}),wi=Bl(function(e,t){var n=Ui(t);return Ba(n)&&(n=void 0),Ba(e)?Jn(e,ol(t,1,Ba,!0),void 0,n):[]});function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),Et(e,Xo(t,3),o)}function Pi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=lr(n),o=n<0?on(l+o,0):an(o,l-1)),Et(e,Xo(t,3),o,!0)}function Ri(e){return null!=e&&e.length?ol(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var Bi=Bl(function(e){var t=st(e,lo);return t.length&&t[0]===e[0]?El(t):[]}),Mi=Bl(function(e){var t=Ui(e),n=st(e,lo);return t===Ui(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Xo(t,2)):[]}),ki=Bl(function(e){var t=Ui(e),n=st(e,lo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function Ui(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wi=Bl(Hi);function Hi(e,t){return e&&e.length&&t&&t.length?xl(e,t):e}var ji=zo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,st(t,function(e){return ii(e,n)?+e:e}).sort(vo)),l});function zi(e){return null==e?e:cn.call(e)}var Vi=Bl(function(e){return $l(ol(e,1,Ba,!0))}),Gi=Bl(function(e){var t=Ui(e);return Ba(t)&&(t=void 0),$l(ol(e,1,Ba,!0),Xo(t,2))}),Yi=Bl(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,$l(ol(e,1,Ba,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=on(e.length,t),!0}),Dt(t,function(t){return st(e,bt(t))})}function Ki(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xi=Bl(function(e,t){return Ba(e)?Jn(e,t):[]}),$i=Bl(function(e){return to(at(e,Ba))}),Qi=Bl(function(e){var t=Ui(e);return Ba(t)&&(t=void 0),to(at(e,Ba),Xo(t,2))}),Ji=Bl(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,to(at(e,Ba),void 0,t)}),Zi=Bl(qi),ea=Bl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ki(e,n)});function ta(e){var t=Tn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=zo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&ii(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),oa=ho(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),ia=Do(xi),aa=Do(Pi);function ra(e,t){return(Pa(e)?lt:Zn)(e,Xo(t,3))}function ua(e,t){return(Pa(e)?ot:el)(e,Xo(t,3))}var sa=ho(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ca=Bl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fa(e)?y(e.length):[];return Zn(e,function(e){i[++l]=o?tt(t,e,n):gl(e,t,n)}),i}),da=ho(function(e,t,n){Yn(e,n,t)});function ma(e,t){return(Pa(e)?st:Dl)(e,Xo(t,3))}var va=ho(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Bl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,ol(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,ko(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ha=Bl(function(e,t,n){var l=1;if(n.length){var o=Ut(n,Ko(ha));l|=32}return ko(e,l,t,n,o)}),_a=Bl(function(e,t,n){var l=3;if(n.length){var o=Ut(n,Ko(_a));l|=32}return ko(t,l,e,n,o)});function Sa(e,t,l){var o,i,a,r,u,s,c=0,d=!1,m=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function p(t){var n=o,l=i;return o=i=void 0,c=t,r=e.apply(l,n)}function f(e){return c=e,u=hi(g,t),d?p(e):r}function E(e){var n=e-s;return void 0===s||n>=t||n<0||m&&e-c>=a}function g(){var e=fa();if(E(e))return h(e);u=hi(g,function(e){var n=t-(e-s);return m?an(n,a-(e-c)):n}(e))}function h(e){return u=void 0,v&&o?p(e):(o=i=void 0,r)}function _(){var e=fa(),n=E(e);if(o=arguments,i=this,s=e,n){if(void 0===u)return f(s);if(m)return uo(u),u=hi(g,t),p(s)}return void 0===u&&(u=hi(g,t)),r}return t=ir(t)||0,za(l)&&(d=!!l.leading,a=(m="maxWait"in l)?on(ir(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),_.cancel=function(){void 0!==u&&uo(u),c=0,o=s=i=u=void 0},_.flush=function(){return void 0===u?r:h(fa())},_}var ba=Bl(function(e,t){return Qn(e,1,t)}),ya=Bl(function(e,t,n){return Qn(e,ir(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return l.cache=i.set(o,a)||i,a};return l.cache=new(Aa.Cache||Rn),l}function Ca(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Rn;var Da=ao(function(e,t){var n=(t=1==t.length&&Pa(t[0])?st(t[0],Tt(Xo())):st(ol(t,1),Tt(Xo()))).length;return Bl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Na=Bl(function(e,t){return ko(e,32,void 0,t,Ut(t,Ko(Na)))}),Ta=Bl(function(e,t){return ko(e,64,void 0,t,Ut(t,Ko(Ta)))}),La=zo(function(e,t){return ko(e,256,void 0,void 0,void 0,t)});function Oa(e,t){return e===t||e!=e&&t!=t}var Ia=Po(vl),wa=Po(function(e,t){return e>=t}),xa=hl(function(){return arguments}())?hl:function(e){return Va(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},Pa=y.isArray,Ra=Xe?Tt(Xe):function(e){return Va(e)&&ml(e)==S};function Fa(e){return null!=e&&ja(e.length)&&!Wa(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=en||iu,ka=$e?Tt($e):function(e){return Va(e)&&ml(e)==u};function Ua(e){if(!Va(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Wa(e){if(!za(e))return!1;var t=ml(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==lr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Qe?Tt(Qe):function(e){return Va(e)&&ti(e)==m};function Ya(e){return"number"==typeof e||Va(e)&&ml(e)==v}function qa(e){if(!Va(e)||ml(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Ka=Je?Tt(Je):function(e){return Va(e)&&ml(e)==f},Xa=Ze?Tt(Ze):function(e){return Va(e)&&ti(e)==E};function $a(e){return"string"==typeof e||!Pa(e)&&Va(e)&&ml(e)==g}function Qa(e){return"symbol"==typeof e||Va(e)&&ml(e)==h}var Ja=et?Tt(et):function(e){return Va(e)&&ja(e.length)&&!!Be[ml(e)]},Za=Po(Cl),er=Po(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return $a(e)?zt(e):Eo(e);if(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=ti(e);return(t==m?Mt:t==E?Wt:Or)(e)}function nr(e){return e?(e=ir(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function or(e){return e?Kn(lr(e),0,4294967295):0}function ir(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=le.test(e);return n||ie.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return go(e,br(e))}function rr(e){return null==e?"":Xl(e)}var ur=_o(function(e,t){if(ci(t)||Fa(t))go(t,Sr(t),e);else for(var n in t)be.call(t,n)&&jn(e,n,t[n])}),sr=_o(function(e,t){go(t,br(t),e)}),cr=_o(function(e,t,n,l){go(t,br(t),e,l)}),dr=_o(function(e,t,n,l){go(t,Sr(t),e,l)}),mr=zo(qn),vr=Bl(function(e,t){e=ve(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],a=br(i),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||Oa(c,he[s])&&!be.call(e,s))&&(e[s]=i[s])}return e}),pr=Bl(function(e){return e.push(void 0,Wo),tt(Ar,void 0,e)});function fr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function Er(e,t){return null!=e&&ni(e,t,fl)}var gr=Lo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),hr=Lo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Xo),_r=Bl(gl);function Sr(e){return Fa(e)?Mn(e):Al(e)}function br(e){return Fa(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var yr=_o(function(e,t,n){Ll(e,t,n)}),Ar=_o(function(e,t,n,l){Ll(e,t,n,l)}),Cr=zo(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=io(t,e),l||(l=t.length>1),t}),go(e,Go(e),n),l&&(n=Xn(n,7,Ho));for(var o=t.length;o--;)Ql(n,t[o]);return n}),Dr=zo(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Er(e,n)})}(e,t)});function Nr(e,t){if(null==e)return{};var n=st(Go(e),function(e){return[e]});return t=Xo(t),wl(e,n,function(e,n){return t(e,n[0])})}var Tr=Mo(Sr),Lr=Mo(br);function Or(e){return null==e?[]:Lt(e,Sr(e))}var Ir=Ao(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return Ur(rr(e).toLowerCase())}function xr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Oe,"")}var Pr=Ao(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=Ao(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=yo("toLowerCase"),Br=Ao(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=Ao(function(e,t,n){return e+(n?" ":"")+Ur(t)}),kr=Ao(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ur=yo("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hr=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new ce(e)}}),jr=zo(function(e,t){return lt(t,function(t){t=Ni(t),Yn(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=No(),Gr=No(!0);function Yr(e){return e}function qr(e){return yl("function"==typeof e?e:Xn(e,1))}var Kr=Bl(function(e,t){return function(n){return gl(n,e,t)}}),Xr=Bl(function(e,t){return function(n){return gl(e,n,t)}});function $r(e,t,n){var l=Sr(t),o=sl(t,l);null!=n||za(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sr(t)));var i=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(o,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=Eo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Qr(){}var Jr=Io(st),Zr=Io(it),eu=Io(vt);function tu(e){return ri(e)?bt(Ni(e)):function(e){return function(t){return cl(t,e)}}(e)}var nu=xo(),lu=xo(!0);function ou(){return[]}function iu(){return!1}var au,ru=Oo(function(e,t){return e+t},0),uu=Fo("ceil"),su=Oo(function(e,t){return e/t},1),cu=Fo("floor"),du=Oo(function(e,t){return e*t},1),mu=Fo("round"),vu=Oo(function(e,t){return e-t},0);return Tn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=Ea,Tn.assign=ur,Tn.assignIn=sr,Tn.assignInWith=cr,Tn.assignWith=dr,Tn.at=mr,Tn.before=ga,Tn.bind=ha,Tn.bindAll=jr,Tn.bindKey=_a,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},Tn.chain=ta,Tn.chunk=function(e,t,n){t=(n?ai(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var o=0,i=0,a=y(Qt(l/t));o<l;)a[i++]=zl(e,o,o+=t);return a},Tn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},Tn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=y(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Pa(n)?Eo(n):[n],ol(t,1))},Tn.cond=function(e){var t=null==e?0:e.length,l=Xo();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[l(e[0]),e[1]]}):[],Bl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Tn.conforms=function(e){return function(e){var t=Sr(e);return function(n){return $n(n,e,t)}}(Xn(e,1))},Tn.constant=zr,Tn.countBy=oa,Tn.create=function(e,t){var n=Ln(e);return null==t?n:Gn(n,t)},Tn.curry=function e(t,n,l){var o=ko(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Tn.curryRight=function e(t,n,l){var o=ko(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},Tn.debounce=Sa,Tn.defaults=vr,Tn.defaultsDeep=pr,Tn.defer=ba,Tn.delay=ya,Tn.difference=Oi,Tn.differenceBy=Ii,Tn.differenceWith=wi,Tn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},Tn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},Tn.dropRightWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!0,!0):[]},Tn.dropWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!0):[]},Tn.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=lr(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:lr(l))<0&&(l+=o),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Tn.filter=function(e,t){return(Pa(e)?at:ll)(e,Xo(t,3))},Tn.flatMap=function(e,t){return ol(ma(e,t),1)},Tn.flatMapDeep=function(e,t){return ol(ma(e,t),1/0)},Tn.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),ol(ma(e,t),n)},Tn.flatten=Ri,Tn.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},Tn.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:lr(t)):[]},Tn.flip=function(e){return ko(e,512)},Tn.flow=Vr,Tn.flowRight=Gr,Tn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},Tn.functions=function(e){return null==e?[]:sl(e,Sr(e))},Tn.functionsIn=function(e){return null==e?[]:sl(e,br(e))},Tn.groupBy=sa,Tn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Tn.intersection=Bi,Tn.intersectionBy=Mi,Tn.intersectionWith=ki,Tn.invert=gr,Tn.invertBy=hr,Tn.invokeMap=ca,Tn.iteratee=qr,Tn.keyBy=da,Tn.keys=Sr,Tn.keysIn=br,Tn.map=ma,Tn.mapKeys=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,t(e,l,o),e)}),n},Tn.mapValues=function(e,t){var n={};return t=Xo(t,3),rl(e,function(e,l,o){Yn(n,l,t(e,l,o))}),n},Tn.matches=function(e){return Nl(Xn(e,1))},Tn.matchesProperty=function(e,t){return Tl(e,Xn(t,1))},Tn.memoize=Aa,Tn.merge=yr,Tn.mergeWith=Ar,Tn.method=Kr,Tn.methodOf=Xr,Tn.mixin=$r,Tn.negate=Ca,Tn.nthArg=function(e){return e=lr(e),Bl(function(t){return Ol(t,e)})},Tn.omit=Cr,Tn.omitBy=function(e,t){return Nr(e,Ca(Xo(t)))},Tn.once=function(e){return ga(2,e)},Tn.orderBy=function(e,t,n,l){return null==e?[]:(Pa(t)||(t=null==t?[]:[t]),Pa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Tn.over=Jr,Tn.overArgs=Da,Tn.overEvery=Zr,Tn.overSome=eu,Tn.partial=Na,Tn.partialRight=Ta,Tn.partition=va,Tn.pick=Dr,Tn.pickBy=Nr,Tn.property=tu,Tn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},Tn.pull=Wi,Tn.pullAll=Hi,Tn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,Xo(n,2)):e},Tn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,void 0,n):e},Tn.pullAt=ji,Tn.range=nu,Tn.rangeRight=lu,Tn.rearg=La,Tn.reject=function(e,t){return(Pa(e)?at:ll)(e,Ca(Xo(t,3)))},Tn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Xo(t,3);++l<i;){var a=e[l];t(a,l,e)&&(n.push(a),o.push(l))}return Pl(e,o),n},Tn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Bl(e,t=void 0===t?t:lr(t))},Tn.reverse=zi,Tn.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),(Pa(e)?Un:kl)(e,t)},Tn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Tn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Tn.shuffle=function(e){return(Pa(e)?Wn:jl)(e)},Tn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},Tn.sortBy=pa,Tn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Tn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Xo(t,2)):[]},Tn.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xl(t))&&Bt(e)?ro(zt(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(lr(t),0),Bl(function(n){var l=n[t],o=ro(n,0,t);return l&&ct(o,l),tt(e,this,o)})},Tn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?Zl(e,Xo(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new Ee(n);return za(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sa(e,t,{leading:o,maxWait:t,trailing:i})},Tn.thru=na,Tn.toArray=tr,Tn.toPairs=Tr,Tn.toPairsIn=Lr,Tn.toPath=function(e){return Pa(e)?st(e,Ni):Qa(e)?[e]:Eo(Di(rr(e)))},Tn.toPlainObject=ar,Tn.transform=function(e,t,n){var l=Pa(e),o=l||Ma(e)||Ja(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:za(e)&&Wa(i)?Ln(je(e)):{}}return(o?lt:rl)(e,function(e,l,o){return t(n,e,l,o)}),n},Tn.unary=function(e){return Ea(e,1)},Tn.union=Vi,Tn.unionBy=Gi,Tn.unionWith=Yi,Tn.uniq=function(e){return e&&e.length?$l(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?$l(e,Xo(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$l(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||Ql(e,t)},Tn.unzip=qi,Tn.unzipWith=Ki,Tn.update=function(e,t,n){return null==e?e:Jl(e,t,oo(n))},Tn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,oo(n),l)},Tn.values=Or,Tn.valuesIn=function(e){return null==e?[]:Lt(e,br(e))},Tn.without=Xi,Tn.words=Wr,Tn.wrap=function(e,t){return Na(oo(t),e)},Tn.xor=$i,Tn.xorBy=Qi,Tn.xorWith=Ji,Tn.zip=Zi,Tn.zipObject=function(e,t){return no(e||[],t||[],jn)},Tn.zipObjectDeep=function(e,t){return no(e||[],t||[],Ul)},Tn.zipWith=ea,Tn.entries=Tr,Tn.entriesIn=Lr,Tn.extend=sr,Tn.extendWith=cr,$r(Tn,Tn),Tn.add=ru,Tn.attempt=Hr,Tn.camelCase=Ir,Tn.capitalize=wr,Tn.ceil=uu,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ir(n))==n?n:0),void 0!==t&&(t=(t=ir(t))==t?t:0),Kn(ir(e),t,n)},Tn.clone=function(e){return Xn(e,4)},Tn.cloneDeep=function(e){return Xn(e,5)},Tn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||$n(e,t,Sr(t))},Tn.deburr=xr,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=su,Tn.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,o=n=void 0===n?l:Kn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},Tn.eq=Oa,Tn.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,Rt):e},Tn.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Tn.every=function(e,t,n){var l=Pa(e)?it:tl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},Tn.find=ia,Tn.findIndex=xi,Tn.findKey=function(e,t){return ft(e,Xo(t,3),rl)},Tn.findLast=aa,Tn.findLastIndex=Pi,Tn.findLastKey=function(e,t){return ft(e,Xo(t,3),ul)},Tn.floor=cu,Tn.forEach=ra,Tn.forEachRight=ua,Tn.forIn=function(e,t){return null==e?e:il(e,Xo(t,3),br)},Tn.forInRight=function(e,t){return null==e?e:al(e,Xo(t,3),br)},Tn.forOwn=function(e,t){return e&&rl(e,Xo(t,3))},Tn.forOwnRight=function(e,t){return e&&ul(e,Xo(t,3))},Tn.get=fr,Tn.gt=Ia,Tn.gte=wa,Tn.has=function(e,t){return null!=e&&ni(e,t,pl)},Tn.hasIn=Er,Tn.head=Fi,Tn.identity=Yr,Tn.includes=function(e,t,n,l){e=Fa(e)?e:Or(e),n=n&&!l?lr(n):0;var o=e.length;return n<0&&(n=on(o+n,0)),$a(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&gt(e,t,n)>-1},Tn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:lr(n);return o<0&&(o=on(l+o,0)),gt(e,t,o)},Tn.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=ir(e),t,n)},Tn.invoke=_r,Tn.isArguments=xa,Tn.isArray=Pa,Tn.isArrayBuffer=Ra,Tn.isArrayLike=Fa,Tn.isArrayLikeObject=Ba,Tn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&ml(e)==r},Tn.isBuffer=Ma,Tn.isDate=ka,Tn.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},Tn.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(Pa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Ja(e)||xa(e)))return!e.length;var t=ti(e);if(t==m||t==E)return!e.size;if(ci(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Tn.isEqual=function(e,t){return _l(e,t)},Tn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?_l(e,t,void 0,n):!!l},Tn.isError=Ua,Tn.isFinite=function(e){return"number"==typeof e&&tn(e)},Tn.isFunction=Wa,Tn.isInteger=Ha,Tn.isLength=ja,Tn.isMap=Ga,Tn.isMatch=function(e,t){return e===t||Sl(e,t,Qo(t))},Tn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Qo(t),n)},Tn.isNaN=function(e){return Ya(e)&&e!=+e},Tn.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Tn.isNil=function(e){return null==e},Tn.isNull=function(e){return null===e},Tn.isNumber=Ya,Tn.isObject=za,Tn.isObjectLike=Va,Tn.isPlainObject=qa,Tn.isRegExp=Ka,Tn.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Tn.isSet=Xa,Tn.isString=$a,Tn.isSymbol=Qa,Tn.isTypedArray=Ja,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return Va(e)&&ti(e)==_},Tn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==ml(e)},Tn.join=function(e,t){return null==e?"":nn.call(e,t)},Tn.kebabCase=Pr,Tn.last=Ui,Tn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=lr(n))<0?on(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,_t,o,!0)},Tn.lowerCase=Rr,Tn.lowerFirst=Fr,Tn.lt=Za,Tn.lte=er,Tn.max=function(e){return e&&e.length?nl(e,Yr,vl):void 0},Tn.maxBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),vl):void 0},Tn.mean=function(e){return St(e,Yr)},Tn.meanBy=function(e,t){return St(e,Xo(t,2))},Tn.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},Tn.minBy=function(e,t){return e&&e.length?nl(e,Xo(t,2),Cl):void 0},Tn.stubArray=ou,Tn.stubFalse=iu,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=du,Tn.nth=function(e,t){return e&&e.length?Ol(e,lr(t)):void 0},Tn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Tn.noop=Qr,Tn.now=fa,Tn.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return wo(Jt(o),n)+e+wo(Qt(o),n)},Tn.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+wo(t-l,n):e},Tn.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?wo(t-l,n)+e:e},Tn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},Tn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var o=sn();return an(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return Rl(e,t)},Tn.reduce=function(e,t,n){var l=Pa(e)?dt:At,o=arguments.length<3;return l(e,Xo(t,4),n,o,Zn)},Tn.reduceRight=function(e,t,n){var l=Pa(e)?mt:At,o=arguments.length<3;return l(e,Xo(t,4),n,o,el)},Tn.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:lr(t),Fl(rr(e),t)},Tn.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var l=-1,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ni(t[l])];void 0===i&&(l=o,i=n),e=Wa(i)?i.call(e):i}return e},Tn.round=mu,Tn.runInContext=e,Tn.sample=function(e){return(Pa(e)?kn:Ml)(e)},Tn.size=function(e){if(null==e)return 0;if(Fa(e))return $a(e)?jt(e):e.length;var t=ti(e);return t==m||t==E?e.size:Al(e).length},Tn.snakeCase=Br,Tn.some=function(e,t,n){var l=Pa(e)?vt:Vl;return n&&ai(e,t,n)&&(t=void 0),l(e,Xo(t,3))},Tn.sortedIndex=function(e,t){return Gl(e,t)},Tn.sortedIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2))},Tn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Oa(e[l],t))return l}return-1},Tn.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Tn.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Xo(n,2),!0)},Tn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Oa(e[n],t))return n}return-1},Tn.startCase=Mr,Tn.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:Kn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Tn.subtract=vu,Tn.sum=function(e){return e&&e.length?Ct(e,Yr):0},Tn.sumBy=function(e,t){return e&&e.length?Ct(e,Xo(t,2)):0},Tn.template=function(e,t,n){var l=Tn.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=rr(e),t=cr({},t,l,Uo);var o,i,a=cr({},t.imports,l.imports,Uo),r=Sr(a),u=Lt(a,r),s=0,c=t.interpolate||ue,d="__p += '",m=pe((t.escape||ue).source+"|"+c.source+"|"+(c===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,Ft),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),r&&(i=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var p=be.call(t,"variable")&&t.variable;if(p){if(J.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(w,""):d).replace(x,"$1").replace(P,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Hr(function(){return de(r,v+"return "+d).apply(void 0,u)});if(f.source=d,Ua(f))throw f;return f},Tn.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=Dt(l,t=Xo(t));++n<e;)t(n);return o},Tn.toFinite=nr,Tn.toInteger=lr,Tn.toLength=or,Tn.toLower=function(e){return rr(e).toLowerCase()},Tn.toNumber=ir,Tn.toSafeInteger=function(e){return e?Kn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},Tn.toString=rr,Tn.toUpper=function(e){return rr(e).toUpperCase()},Tn.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),o=zt(t);return ro(l,It(l,o),wt(l,o)+1).join("")},Tn.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ro(l,0,wt(l,zt(t))+1).join("")},Tn.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ro(l,It(l,zt(t))).join("")},Tn.truncate=function(e,t){var n=30,l="...";if(za(t)){var o="separator"in t?t.separator:o;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var i=(e=rr(e)).length;if(Bt(e)){var a=zt(e);i=a.length}if(n>=i)return e;var r=n-jt(l);if(r<1)return l;var u=a?ro(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+l;if(a&&(r+=u.length-r),Ka(o)){if(e.slice(r).search(o)){var s,c=u;for(o.global||(o=pe(o.source,rr(te.exec(o))+"g")),o.lastIndex=0;s=o.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Xl(o),r)!=r){var m=u.lastIndexOf(o);m>-1&&(u=u.slice(0,m))}return u+l},Tn.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(R,Gt):e},Tn.uniqueId=function(e){var t=++ye;return rr(e)+t},Tn.upperCase=kr,Tn.upperFirst=Ur,Tn.each=ra,Tn.eachRight=ua,Tn.first=Fi,$r(Tn,(au={},rl(Tn,function(e,t){be.call(Tn.prototype,t)||(au[t]=e)}),au),{chain:!1}),Tn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Tn[e].placeholder=Tn}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Yr)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Bl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ca(Xo(e)))},wn.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},rl(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),o=Tn[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(Tn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||Pa(t),c=function(e){var t=o.apply(Tn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,m=!!this.__actions__.length,v=i&&!d,p=r&&!m;if(!i&&s){t=p?t:new wn(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[c],thisArg:void 0}),new In(f,d)}return v&&p?e.apply(this,a):(f=this.thru(c),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(Pa(o)?o:[],e)}return this[n](function(n){return t.apply(Pa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=Tn[t];if(n){var l=n.name+"";be.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[To(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=Eo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Eo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Eo(this.__views__),e},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),l=t<0,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,r=i.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,m=0,v=an(u,this.__takeCount__);if(!n||!l&&o==u&&v==u)return eo(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var f=-1,E=e[s+=t];++f<d;){var g=c[f],h=g.type,_=(0,g.iteratee)(E);if(2==h)E=_;else if(!_){if(1==h)continue e;break e}}p[m++]=E}return p},Tn.prototype.at=la,Tn.prototype.chain=function(){return ta(this)},Tn.prototype.commit=function(){return new In(this.value(),this.__chain__)},Tn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var l=Li(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:na,args:[zi],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zi)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,pt&&(Tn.prototype[pt]=function(){return this}),Tn}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(y)});function gn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,o)=>{var i,c,d;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((n,o)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:o},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),a?null!=n&&null!==(i=n.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:o},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=o+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(null==n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const hn=e=>{var t,o;let{t:i,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==a||null===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[g,h]=n.useState([]),[_,S]=n.useState(!0),[b,y]=n.useState(!1),[A,C]=n.useState(!1),{isLoading:D,data:N}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:T,data:L}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,a;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==N||null===(i=N.BPA)||void 0===i||null===(a=i.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==L||null===(t=L["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,i.length);i===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),h(s)},[!D,!T]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,b]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(_n,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:y,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function _n(e){var o,i;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:m,checkEnablingDocs:v}=e;const p=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,g]=n.useState(p?d({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:{}),[h,_]=n.useState(null),[S,b]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[y,A]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,fileName:(null==h?void 0:h.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[S,E]),n.useEffect(()=>{try{y.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],y.map(e=>{var t,n,l;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),m[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(m)))}catch(e){Promise.reject(e)}},[y,E]),n.useEffect(()=>{},[h]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(i=r.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(gn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>g(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var o;0!==Object.keys(n).length&&A(l),(o=l[l.length-1])&&_(o.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Sn(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,o)=>{var i,r,u,s,c,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(o+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(gn,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function bn(e){let{t:o,document:i,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],c=Digit.ULBService.getStateId(),[d,m]=n.useState(),[v,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=i&&null!==(e=i.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=yt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){r(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&p(l.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const yn=e=>{var o;let{t:i,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==s?void 0:s.status)||"",p=(null==d||null===(o=d.data)||void 0===o?void 0:o.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[h,_]=n.useState([]),[S,b]=n.useState([]),[y,A]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[N,T]=n.useState(null),L=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,o=[];var i,r,c,d;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(r=i.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(c=E.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},o.push(l[0].docTypes[0]));let m=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),m.push(e)}),b(m))},[f,h]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[s,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:L?""+i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:L?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:L?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(gn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),y&&(null==S?void 0:S.map((e,t)=>l.createElement(bn,{key:t,document:e,t:i,error:N,setError:T,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:y}))))},An=e=>{let{permissions:o,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.map(e=>({label:e,checked:!1}))),[s,c,m]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?d({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{c(()=>null==s?void 0:s.map((n,l)=>{var o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Cn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Dn(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Nn(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=d({},u,{maxWidth:"950px"}),u=d({},u,{maxWidth:"950px"}),c={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var o;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const Tn=e=>{var o,a,r,u,s,c,d,m,v,p,f,E,g,h,_,S,b,y,A,C,D,N,T;let{scrutinyDetails:L,paymentsList:O=[],additionalDetails:I,applicationData:w}=e;const x=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[P,R]=n.useState(),[F,B]=n.useState(),[M,k]=n.useState(),U=Digit.ULBService.getStateId(),[W,H]=n.useState(),[j,z]=n.useState(),[V,G]=n.useState([]),[Y,q]=n.useState(),[K,X]=n.useState(""),[$,Q]=n.useState(null),[J,Z]=n.useState({}),ee={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[te,ne]=n.useState(!1),[le,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{Q(null);const e=function(){if(Y&&null!=Y&&Y.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Y||null===(t=Y.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(Y.size>=2e6)Q(ie("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Y,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?G([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId,time:new Date}]):Q(ie("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Q(ie("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Y]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,o,i,a;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,o;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(o=I.lessAdjustmentFeeFiles)||void 0===o?void 0:o.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,U).then(e=>Z(null==e?void 0:e.data))}R(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_OTHER_CHARGES),k(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(a=I.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),H(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),G(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:ie}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ie(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ie(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ie("NA");return l.createElement(n.Fragment,null,!(null!=L&&L.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==L||null===(o=L.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+ie(""+e.title),text:null!=e&&e.value?ae(e)+" "+ie(null==e?void 0:e.isUnit):ie("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+ie(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ie(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ie(null==e?void 0:e.title))),null==L||null===(a=L.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==L||null===(r=L.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ie("SHOW_P1_FEES_DETAILS"))),le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ie("HIDE_P1_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ie("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==L||null===(u=L.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ie("SHOW_P2_FEES_DETAILS"))),te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ie("HIDE_P2_FEES_DETAILS"))),te&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ie("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:P,disabled:!x,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(R(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_OTHER_CHARGES)||0,value:F,disabled:!x,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ie,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!x,onChange:e=>{!function(e){H(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:M,disabled:!x,onChange:e=>{!function(e){var t,n,l,o;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(P)?parseFloat(P):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(k(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0&&x?l.createElement("div",null,l.createElement(t.CardLabel,null,ie("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),q(e.target.files[0])},disabled:!x,onDelete:()=>{z(null),q("")},message:j?"1 "+ie("FILEUPLOADED"):ie("ES_NO_FILE_SELECTED_LABEL"),error:$,uploadMessage:K})):null,(null==J||null===(g=J.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ie("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==J||null===(_=J.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==J||null===(b=J.fileStoreIds[(null==J||null===(y=J.fileStoreIds)||void 0===y?void 0:y.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ie("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(P)?parseFloat(P):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(A=I.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==I||null===(N=I.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(M)?parseFloat(M):0))}))),l.createElement("div",null,null==L||null===(T=L.scruntinyDetails)||void 0===T?void 0:T.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ie(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ie(null==e?void 0:e.text))))))))},Ln=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:m}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),p=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>p.map(e=>({Header:m(""+e.name),accessor:f(e.id),id:e.id})));function g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,o,i,a,r,u,s;n.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),n}function h(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+m("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==c||null===(o=c.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==c||null===(a=c.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var o,i,a,r,u;return l.createElement("div",{key:n,style:(null==c||null===(o=c.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},m("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:h(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},On=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},In=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,m]=n.useState(!1),{t:v}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(On,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{m(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{m(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function wn(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function xn(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Pn=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let m=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const p=null==m?void 0:m.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:g,roadCuttingAddlDetails:h,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Rn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Fn=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Bn=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[m,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,b]=n.useState(!1),[y,A]=n.useState(m||{}),[C,D]=n.useState(null),[N,T]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[L,O]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o=d({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==m||null===(n=m.billDetails)||void 0===n?void 0:n.length)>0){var i,a,r,u,c,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==m||null===(i=m.billDetails)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==m||null===(r=m.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==m||null===(c=m.billDetails)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount)}];O(e),T(null==m||null===(f=m.billDetails)||void 0===f?void 0:f[0])}else v(o),A(o)},[]);let w={};const x=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),F=function(e,t,n){void 0===t&&(t=!1);let l=d({},y);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}A(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},L&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==L?void 0:L.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==N?void 0:N.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{b(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(x,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{A(m),b(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{A(m),b(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=y&&y.adhocPenalty?Number(null==y?void 0:y.adhocPenalty):0,n=null!=y&&y.adhocRebate?Number(null==y?void 0:y.adhocRebate):0;var l,o;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,m,p,f,g,h,S;const e=null==s||null===(i=s.additionalDetails)||void 0===i||null===(a=i.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n=d({},null==s||null===(m=s.additionalDetails)||void 0===m||null===(p=m.appDetails)||void 0===p?void 0:p.additionalDetails,y);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(S=h.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,a,r,u,s,c,d,m,p,f,g,h;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(i=e.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount}];E(gt(e.Calculation[0])),T(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),O(S),y.billDetails=null==e?void 0:e.Calculation,v(y),b(!1)}).catch(e=>{var t,n,l,o,i,a;D({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?c(""+(null==e||null===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:c("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Rn,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==y?void 0:y.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==y||null===(r=y.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==y?void 0:y.adhocPenaltyComment)||"",onChange:e=>F("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==y?void 0:y.adhocPenalty)||"",onChange:e=>F("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Fn,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==y?void 0:y.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==y||null===(u=y.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==y?void 0:y.adhocRebateComment)||"",onChange:e=>F("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==y?void 0:y.adhocRebate)||"",onChange:e=>F("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:c(null==C?void 0:C.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Mn=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:d({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},kn=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;o=o||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(i))),n(a)+" ",l.createElement(Mn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Un=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:m}=e;const{t:v}=i.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),h=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(o=m.additionalDetails)&&void 0!==o&&o.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=m.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),g(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(h,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(c=E.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Wn={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Hn=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Wn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Wn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},Wn.cell,Wn.cellLeft,Wn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},Wn.cell,n.length==t+1?Wn.cellRight:{},Wn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:d({},Wn.cell,Wn.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,o)=>l.createElement("td",{style:d({},Wn.cell,{textAlign:"left"},n.length==o+1?Wn.cellRight:{},{whiteSpace:"pre"}),key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},Wn.cell,Wn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},Wn.cell,Wn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:d({},Wn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Wn.cell,key:t,numeric:!0})))))))},jn={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},zn=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,n)=>e+t.amount,0))||0;let m="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let v={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let p=[];p=Object.keys(v),p.sort((e,t)=>v[e]-v[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:jn.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Hn,{headers:[...p],values:s,arrears:m}),!f&&l.createElement("div",{style:jn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:jn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Vn=e=>{let{assessmentData:t}=e;const[o,i]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{i(!o)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},o?"<":">"))),o&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},Gn=e=>{var t;let{applicationData:i}=e;const[a,r]=n.useState(!1);return o.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Yn=e=>{let{payments:t}=e;const[o,i]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{i(!o)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},o?"<":">"))),o&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function qn(e){var a,r,u,s,c,m,v,p,f,E,g,h,S,b,y,A;let{applicationDetails:C,demandData:D,workflowDetails:N,isDataLoading:T,applicationData:L,timelineStatusPrefix:O,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:x,oldValue:P,isInfoLabel:R=!1,propertyId:F}=e;const{t:B}=i.useTranslation(),M=o.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[U,W]=n.useState(null),[H,j]=n.useState([]);let z=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function V(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",C);const[G,Y]=n.useState({}),[q,K]=n.useState(),[X,$]=n.useState([]),[Q,J]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||Q.loading||Q.loaded||Q.canLoad||J({loading:!1,loaded:!1,canLoad:!0}),null==Q||!Q.canLoad||Q.loading||Q.loaded||(J({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(o){function i(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0){const n=o.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const i=Array.from(l.values());return $(i),console.log(i),K(null==o?void 0:o.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==L?void 0:L.tenantId)||k,null==L?void 0:L.propertyId,Y,J));const Z=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ee=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var o;const e={date:Z(null==L||null===(o=L.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==L?void 0:L.channel)||""};return l.createElement(In,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,s,c,d,m,v,p,f,E,g,h,S,b,y,A;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},D=n[t-1],N={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==L||null===(c=L.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)&&null!=L&&null!==(f=L.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(g=E[0])&&void 0!==g&&g.mobileNumber?null==L||null===(h=L.processInstance)||void 0===h||null===(S=h.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(A=y[0])||void 0===A?void 0:A.mobileNumber,comment:B(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(In,{data:N,OpenImage:V,privacy:o})}{var D,N,T,O,I;const t={date:Z(null==L||null===(D=L.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(T=N[0])||void 0===T?void 0:T.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(I=O[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(In,{data:t})}},te=(e,t)=>e?t?e:B(e):B("NA"),ne=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ae=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+B(null==e?void 0:e.isUnit):B("N/A"):null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):B("N/A"),[re,ue]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const se=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=d({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:d({},e.additionalDetails,{propertytobestatus:t}),workflow:d({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:d({},l)},k,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ce=null==C?void 0:C.applicationData,de=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",me=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C),console.log("infolabel",R),console.log("assessment details",q),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:k,filters:{consumerCodes:F},auth:!0}).then(e=>{j(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(kn,{t:B,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,s,c,d,m,v,p,f,E,g,h,_,S,b,y,A,D,T,L,O,I,w,R,F,M,k,U,W,H,j,V,Y,q,K,X,$;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:ne?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&ne?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},le?""+B(e.title):B(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},B(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},B(e)))),null==e?void 0:e.tableRows.map((t,o)=>o===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},B(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},B(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:B(n.title),label:B(n.title),text:l.createElement("img",{src:B(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:B(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},B(null==n?void 0:n.title)))):le||oe?""+B(n.title):B(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+B(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:B(n.title),label:B(n.title),text:ae(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(zn,{bill:null===(r=G.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(Tn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:x,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(s=C.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.fiReport)&&l.createElement(Sn,{fiReport:null==C||null===(v=C.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Dn,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(Nn,{owners:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(xn,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(wn,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),!z&&(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==N||null===(D=N.data)||void 0===D||null===(T=D.nextActions)||void 0===T?void 0:T.length)>0&&l.createElement(An,{applicationData:null==C?void 0:C.applicationData,t:B,permissions:null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.permissions}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(hn,{t:B,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:N})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(yn,{t:B,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:N}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(Tn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(Tn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(Ln,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&l.createElement(gn,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(Cn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Pn,{wsAdditionalDetails:e,oldValue:P}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(V=e.additionalDetails)||void 0===V||null===(Y=V.redirectUrl)||void 0===Y?void 0:Y.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(q=e.additionalDetails)||void 0===q||null===(K=q.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Bn,{wsAdditionalDetails:e,workflowDetails:N}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(Un,{wsAdditionalDetails:e,workflowDetails:N}))}),(null==q?void 0:q.length)>0&&l.createElement(Vn,{assessmentData:X}),l.createElement(Yn,{payments:H}),l.createElement(Gn,{applicationData:null==C?void 0:C.applicationData}),I&&(null==N||null===(s=N.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==N?void 0:N.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=N&&N.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},B("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=N&&null!==(m=N.data)&&void 0!==m&&m.timeline&&1===(null==N||null===(v=N.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:B(""+O+(null==N||null===(f=N.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ee(null==N||null===(g=N.data)||void 0===g?void 0:g.timeline[0],null==N||null===(h=N.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==N||null===(S=N.data)||void 0===S?void 0:S.timeline)&&(null==N||null===(b=N.data)||void 0===b?void 0:b.timeline.slice(0,re?null==N?void 0:N.data.timeline.length:2).map((e,n,o)=>{var i;let a="";var r,u,s,c,d,m;return window.location.href.includes("/obps/")&&(a=null!=N&&null!==(r=N.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=N&&null!==(c=N.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(m=d.state)&&void 0!==m&&m.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:B(""+O+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:ee(e,n,null==N||null===(i=N.data)||void 0===i?void 0:i.timeline)}))}))),(null==N||null===(y=N.data)||void 0===y||null===(A=y.timeline)||void 0===A?void 0:A.length)>2&&l.createElement(t.LinkButton,{label:B(re?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ue(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==me?se(ce,"ACTIVE",de):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==me?se(ce,"INACTIVE",de):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,o;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status)&&M.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var i,a,r;if("INACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&M.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),U&&l.createElement(t.Toast,{error:U.isError,label:B(U.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function Kn(e){var n,o,i,a,r,u,s,c,d,m,v,p,f,E,g,h,_,S;let{t:b,showToast:y,closeToast:A,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var D;let e="";switch(null==y||null===(D=y.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==y?void 0:y.key)?null==y||null===(n=y.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==y?void 0:y.key)?null==y||null===(o=y.error)||void 0===o?void 0:o.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==y?void 0:y.key)?null==y||null===(i=y.error)||void 0===i?void 0:i.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==y?void 0:y.key)?null==y||null===(a=y.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==y?void 0:y.key)?null==y||null===(r=y.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==y?void 0:y.key)?null==y||null===(u=y.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==y?void 0:y.key)?null==y||null===(s=y.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==y?void 0:y.key)?null==y||null===(c=y.error)||void 0===c?void 0:c.message:b("ES_"+C+"_"+(null==y||null===(d=y.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:e,onClose:A}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var N;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?b(e[1]):b(e[0]),n};let n="";switch(null==y||null===(N=y.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==y?void 0:y.key)?null==y||null===(m=y.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(v=y.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==y?void 0:y.key)?null==y||null===(p=y.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==y?void 0:y.key)?null==y||null===(f=y.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==y?void 0:y.key)?null==y||null===(E=y.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(g=y.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==y?void 0:y.key)?null==y||null===(h=y.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==y?void 0:y.key)?null==y||null===(_=y.error)||void 0===_?void 0:_.message:b("ES_"+C+"_"+(null==y||null===(S=y.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:n,onClose:A}))}{var T,L;const e="error"===(null==y?void 0:y.key)?null==y||null===(T=y.error)||void 0===T?void 0:T.message:"ES_"+C+"_"+(null==y||null===(L=y.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:b(e),onClose:A}))}}function Xn(e){var o,a,r,u,s,c,m,v,p,f,E,g,h,_,S,b;let{workflowDetails:y,displayMenu:A,onActionSelect:C,setDisplayMenu:D,businessService:N,forcedActionPrefix:T,ActionBarStyle:L={},MenuStyle:O={}}=e;const{t:I}=i.useTranslation();let w=Digit.UserService.getUser();const x=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const P=null===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,F=!1,B=(null==y||null===(u=y.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==y||null===(m=y.data)||void 0===m||null===(v=m.nextActions)||void 0===v?void 0:v.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(x,()=>{D(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(p=B[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==B?void 0:B.length)?(F=!1,R=!0):(null==B?void 0:B.length)>0&&(F=!0,R=!1),l.createElement(l.Fragment,null,!(null!=y&&y.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:d({},L)},A&&(null!=y&&null!==(E=y.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=y&&null!==(h=y.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:C,style:O}):null,l.createElement(t.SubmitBar,{ref:x,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!A)})),!(null!=y&&y.isLoading)&&!F&&R&&l.createElement(t.ActionBar,{style:d({},L)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(_=B[0])||void 0===_?void 0:_.action,value:null==B||null===(S=B[0])||void 0===S?void 0:S.action,onClick:e=>{C((null==B?void 0:B[0])||{})}},I((T||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()))+"_"+(null==B||null===(b=B[0])||void 0===b?void 0:b.action)))))}const $n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null));function Jn(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Qn,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Zn=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(m,"BPA",["BlockReason"]),{t:p}=i.useTranslation(),f=o.useHistory();let{id:E}=o.useParams();const[g,h]=n.useState(!1),[_,S]=n.useState(null),[b,y]=n.useState(!1),[A,C]=n.useState(!1),[D,N]=n.useState(!1),{data:T}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:L,demandData:O,totalDemandTax:I,totalBalanceTax:w,showToast:x,setShowToast:P,isLoading:R,isDataLoading:F,applicationData:B,mutate:M,nocMutation:k,workflowDetails:U,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:$=!0,oldValue:Q,isInfoLabel:J=!1,clearDataDetails:Z,propertyId:ee}=e;n.useEffect(()=>{x&&U.revalidate()},[x]);const te=a.useQueryClient(),ne=()=>{S(null),y(!1)};return R||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(qn,{applicationDetails:L,demandData:O,id:W,workflowDetails:U,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:$,oldValue:Q,isInfoLabel:J,propertyId:ee}),b?l.createElement(fn,{t:p,action:_,tenantId:c,state:m,id:E,applicationDetails:L,applicationData:null==L?void 0:L.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const o=function(o,i,a,r,u,s,c,m,v,E,g,h,S,b,y,A,D,N){if(0==(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(m=c.additionalDetail)||void 0===m||null===(v=m.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.comment)||void 0===h?void 0:h.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.SewerageConnection)||void 0===y||null===(A=y.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(N=D.comment)||void 0===N?void 0:N.length)){var T,L;"INITIATE"===(null==e||null===(T=e.Licenses)||void 0===T||null===(L=T[0])||void 0===L?void 0:L.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const o=function(o,i,a,r,u){if("BPA"!=(null==e||null===(o=e.BPA)||void 0===o?void 0:o.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(a=i.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),P({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var l,o,i,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=_,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,m,v,E,g,h;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(m=d.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(E=v.workflow)&&void 0!==E&&E.action.includes("APPROVE")?P({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(h=g.workflow)&&void 0!==h&&h.action.includes("REJECT")&&P({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S,b,y;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(S=e.Licenses[0])&&void 0!==S&&null!==(b=S.businessService)&&void 0!==b&&b.includes("BPAREG")?(P({key:"success",action:_}),e.selectedAction=_,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(P({key:"success",action:_}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(y=e.Licenses[0])||void 0===y?void 0:y.applicationNumber)));P({key:"success",action:_}),Z&&setTimeout(Z,3e3),setTimeout(j,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(d({},e)));const o=function(){if(!1!==t&&k){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),o=yt(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,o,i,a,r,u,s,c,d,m,v;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(m=d.Errors)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.message)||e;ne(),P({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(s):s(o)}alert(p("Please select Blocking reason"))}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:U,moduleCode:z,blockReason:null==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Jn,{action:_,workflowDetails:U,businessService:H,isWarningPop:D,closeWarningPopup:()=>{N(!1)}}):null,l.createElement(Kn,{t:p,showToast:x,closeToast:j,businessService:H}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,o,i,a;const r=Digit.Utils.obps.calculateRiskType(null==T||null===(t=T.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==L||null===(n=L.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(o=l.plot)||void 0===o?void 0:o.area,null==L||null===(i=L.edcrDetails)||void 0===i||null===(a=i.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,o,i,a,r,s,d,m,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(o=l.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(d=u.BPA)||void 0===d||null===(m=d.additionalDetails)||void 0===m||null===(v=m.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Xn,{workflowDetails:U,displayMenu:g,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)N(!0);else if(null!=e&&e.redirectionUrll){var o,i,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action)){var s,c;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var m;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(m=e.redirectionUrll)||void 0===m?void 0:m.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),y(!0);else{var v,p;f.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:d({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else y(!0);S(e),h(!1)},setDisplayMenu:h,businessService:H,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function el(e){var o;let{t:i,document:a,setNocDocuments:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],c=Digit.ULBService.getStateId(),[d,m]=n.useState(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o[0]),[v,p]=n.useState(null),[f,E]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{null!=d&&d.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==d?void 0:d.code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}])},[f,d]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+i("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==d?void 0:d.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var o;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(o=n[n.length-1])&&p(o.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const tl=e=>{let{registerRef:o,searchFieldComponents:a}=e;const{t:r}=i.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:o({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:o({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},nl=e=>{let{statuses:o,isInboxLoading:a,controlFilterForm:u,setFilterFormValue:s,applicationTypesOfBPA:c}=e;const{t:d}=i.useTranslation(),m=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);null==c||c.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)});const v=r.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:u,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:m.filter(t=>t.code===e.value)[0],optionsKey:"name",options:m})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"businessService",control:u,render:e=>l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("BUSINESS_SERVICE")),l.createElement(t.RadioButtons,{onSelect:t=>{s("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:f()||[]}))})),v?l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:u,render:e=>{const i=n.useMemo(()=>{var n;return null==o||null===(n=o.filter(e=>e.businessservice===v.code))||void 0===n?void 0:n.map(n=>{var o;return l.createElement(t.CheckBox,{onChange:t=>{var l;return function(t){e.onChange(t)}(t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)))},checked:null===(o=e.value)||void 0===o?void 0:o.includes(null==n?void 0:n.statusid),label:d("WF_"+n.businessservice+"_"+n.applicationstatus.split("_").pop())+" ("+n.count+")"})})},[e.value,o,v]);return l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("ACTION_TEST_APPLICATION_STATUS")),a?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,i))}})):null)};function ll(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ol(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function il(e){ol(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function al(e,t){ol(2,arguments);var n=il(e).getTime(),l=ll(t);return new Date(n+l)}function rl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function ul(e){return ol(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function sl(e){if(ol(1,arguments),!ul(e)&&"number"!=typeof e)return!1;var t=il(e);return!isNaN(Number(t))}var cl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function dl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var ml={date:dl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:dl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},vl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function pl(e){return function(t,n){var l,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;l=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function fl(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,o=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,r=i[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?gl(u,function(e){return e.test(r)}):El(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(s):s,a=n.valueCallback?n.valueCallback(a):a;var c=t.slice(r.length);return{value:a,rest:c}}}function El(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function gl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var hl,_l={code:"en-US",formatDistance:function(e,t,n){var l,o=cl[e];return l="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:ml,formatRelative:function(e,t,n,l){return vl[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:pl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:pl({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pl({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:pl({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:pl({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(hl={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(hl.matchPattern);if(!n)return null;var l=n[0],o=e.match(hl.parsePattern);if(!o)return null;var i=hl.valueCallback?hl.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(l.length);return{value:i,rest:a}}),era:fl({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:fl({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:fl({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:fl({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:fl({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Sl(e,t){ol(2,arguments);var n=ll(t);return al(e,-n)}function bl(e){ol(1,arguments);var t=1,n=il(e),l=n.getUTCDay(),o=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function yl(e){ol(1,arguments);var t=il(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var o=bl(l),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=bl(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Al(e){ol(1,arguments);var t=yl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=bl(n);return l}function Cl(e,t){ol(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.weekStartsOn,i=null==o?0:ll(o),a=null==n.weekStartsOn?i:ll(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=il(e),u=r.getUTCDay(),s=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-s),r.setUTCHours(0,0,0,0),r}function Dl(e,t){ol(1,arguments);var n=il(e),l=n.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:ll(a),u=null==o.firstWeekContainsDate?r:ll(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(l+1,0,u),s.setUTCHours(0,0,0,0);var c=Cl(s,t),d=new Date(0);d.setUTCFullYear(l,0,u),d.setUTCHours(0,0,0,0);var m=Cl(d,t);return n.getTime()>=c.getTime()?l+1:n.getTime()>=m.getTime()?l:l-1}function Nl(e,t){ol(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.firstWeekContainsDate,i=null==o?1:ll(o),a=null==n.firstWeekContainsDate?i:ll(n.firstWeekContainsDate),r=Dl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Cl(u,t);return s}function Tl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Ll={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return Tl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var o=Dl(e,l),i=o>0?o:1-o;return"YY"===t?Tl(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Tl(i,t.length)},R:function(e,t){return Tl(yl(e),t.length)},u:function(e,t){return Tl(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return Tl(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return Tl(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Tl(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return Tl(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var o=function(e,t){ol(1,arguments);var n=il(e),l=Cl(n,t).getTime()-Nl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Tl(o,t.length)},I:function(e,t,n){var l=function(e){ol(1,arguments);var t=il(e),n=bl(t).getTime()-Al(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Tl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Tl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){ol(1,arguments);var t=il(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),o=n-l;return Math.floor(o/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):Tl(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Tl(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var o=e.getUTCDay(),i=(o-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Tl(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),o=0===l?7:l;switch(t){case"i":return String(o);case"ii":return Tl(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,o=e.getUTCHours();switch(l=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,o=e.getUTCHours();switch(l=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return Tl(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Tl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Tl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Tl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Tl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Tl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Tl(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Il(o);case"XXXX":case"XX":return wl(o);case"XXXXX":case"XXX":default:return wl(o,":")}},x:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Il(o);case"xxxx":case"xx":return wl(o);case"xxxxx":case"xxx":default:return wl(o,":")}},O:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ol(o,":");case"OOOO":default:return"GMT"+wl(o,":")}},z:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ol(o,":");case"zzzz":default:return"GMT"+wl(o,":")}},t:function(e,t,n,l){return Tl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Tl((l._originalDate||e).getTime(),t.length)}};function Ol(e,t){var n=e>0?"-":"+",l=Math.abs(e),o=Math.floor(l/60),i=l%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+Tl(i,2)}function Il(e,t){return e%60==0?(e>0?"-":"+")+Tl(Math.abs(e)/60,2):wl(e,t)}function wl(e,t){var n=t||"",l=e>0?"-":"+",o=Math.abs(e);return l+Tl(Math.floor(o/60),2)+n+Tl(o%60,2)}function xl(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Pl(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Rl={p:Pl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],o=l[1],i=l[2];if(!i)return xl(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",xl(o,t)).replace("{{time}}",Pl(i,t))}},Fl=["D","DD"],Bl=["YY","YYYY"];function Ml(e){return-1!==Fl.indexOf(e)}function kl(e){return-1!==Bl.indexOf(e)}function Ul(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Wl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Hl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jl=/^'([^]*?)'?$/,zl=/''/g,Vl=/[a-zA-Z]/;function Gl(e,t,n){ol(2,arguments);var l=String(t),o=n||{},i=o.locale||_l,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:ll(a),u=null==o.firstWeekContainsDate?r:ll(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=i.options&&i.options.weekStartsOn,c=null==s?0:ll(s),d=null==o.weekStartsOn?c:ll(o.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var m=il(e);if(!sl(m))throw new RangeError("Invalid time value");var v=rl(m),p=Sl(m,v),f={firstWeekContainsDate:u,weekStartsOn:d,locale:i,_originalDate:m},E=l.match(Hl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Rl[t])(e,i.formatLong,f):e}).join("").match(Wl).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return Yl(n);var a=Ll[l];if(a)return!o.useAdditionalWeekYearTokens&&kl(n)&&Ul(n,t,e),!o.useAdditionalDayOfYearTokens&&Ml(n)&&Ul(n,t,e),a(p,n,i.localize,f);if(l.match(Vl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function Yl(e){return e.match(jl)[1].replace(zl,"'")}const ql=e=>{var o,a;const{register:u,control:s,setValue:c,getValues:d,reset:m,formState:v}=r.useFormContext(),{t:p}=i.useTranslation(),E=f();return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_SOURCE_MODULE_NUMBER")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_TYPE_LABEL")),l.createElement(r.Controller,{control:s,name:"nocType",render:e=>l.createElement(t.Dropdown,{selected:1==(null==E?void 0:E.length)?E[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:E||[],optionKey:"i18nKey",t:p,disable:1==(null==E?void 0:E.length)})})),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==v||null===(o=v.errors)||void 0===o||null===(a=o.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,p("NOC_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;c("applicationNo",null),c("sourceRefId",null),c("mobileNumber",null),c("nocType",null==E||null===(t=E[0])||void 0===t?void 0:t.code),c("offset",0),c("limit",10),c("sortBy","commencementDate"),c("sortOrder","DESC"),c("isSubmitSuccessful","false"),m({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),c("offset",d("offset")-d("limit")),null==e||e.onSubmit({nocType:null==E||null===(n=E[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},p("ES_COMMON_CLEAR_ALL"))))},Kl=["currentlyActiveMobileModal"],Xl=["currentlyActiveMobileModal"],$l=e=>{var o,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:c,data:v,onSubmit:p}=e;const{t:f}=i.useTranslation(),{handleSubmit:E}=r.useFormContext(),[g,h]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),_=()=>{h({type:"remove"})},S=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},l.createElement(t.CloseSvg,null)),b=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,o=m(e,Kl);const{closeMobilePopupModal:i}=o;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,o,l.createElement(S,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:i}));default:return l.createElement("span",null)}})(d({currentlyActiveMobileModal:n},m(e,Xl)))},[g]);return c?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>h({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(b,{onSubmit:e=>{h({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:_})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==v||null===(a=v[0])||void 0===a?void 0:a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:s,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APP_NO_LABEL")}))},Ql=e=>{let{columns:o,SearchFormFieldsComponent:a,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:m,setValue:v,getValues:p}=r.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=i.useTranslation(),h=()=>{v("offset",d&&10*Math.ceil(d/10)-p("limit")),m(u)()},_=()=>{v("offset",0),m(u)()},S=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function b(e){v("limit",Number(e.target.value)),m(u)()}function y(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function A(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}n.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return c?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},g(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:g,data:s,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:b,currentPage:f,onNextPage:y,onPrevPage:A,pageSizeLimit:Number(p("limit")),onSort:S,totalRecords:d,disableSort:!1,onLastPage:h,onFirstPage:_,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},l.createElement(a,{onSubmit:u,handleSubmit:m,isMobileView:!1})),l.createElement(C,null))},Jl={step:1,isValid:!1,formData:{}},Zl=function(e,t){switch(void 0===e&&(e=Jl),t.type){case"UPDATE_NOCNewApplication_FORM":return d({},e,{formData:d({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return d({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return Jl;default:return e}},eo=["path","url"],to=[],no=()=>{var e,n;const a=o.useRouteMatch(),{path:r}=a,u=(m(a,eo),i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm"));return l.createElement("span",{className:"noc-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(s=to)&&(s=[]),s.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:r+"/new-application",component:u}))));var s},lo=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:a}=i.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},oo=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<r.length?d():o===r.length&&n()}function c(){o>1&&m()}const d=()=>a(o+1),m=()=>a(o-1);return l.createElement(lo,{currentStep:o,nextStep:d,prevStep:m,stepsList:r},(()=>{var e,t;const n=r[o-1],{component:i,key:a,texts:d,currStepConfig:m}=n,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(v,{config:{key:a,texts:d,component:i,currStepNumber:o,currStepConfig:m},onGoNext:s,onBackClick:c,t:u}))})())},io=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],ao=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),ro=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>d({},e,{currStepConfig:io.filter(t=>t.stepNumber===e.stepNumber)})),uo=e=>{var o,i,a,r,u;const{t:s,currentStepData:c,Controller:d,control:m,setValue:v,errors:p,errorStyle:f}=e,E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:g}=Digit.Hooks.obps.useMDMS(E,"common-masters",["GenderType"]);let h=[];return g&&g["common-masters"].GenderType.filter(e=>e.active).map(e=>{h.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),n.useEffect(()=>{console.log("currentStepData1",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;v(t,n)})},[c,v]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_APPLICANT_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),minLength:{value:4,message:s("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:f},null!=p&&p.applicantOwnerOrFirmName?p.applicantOwnerOrFirmName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantEmailId",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(o=p.applicantEmailId)||void 0===o?void 0:o.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantMobileNumber",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:s})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(i=p.applicantMobileNumber)||void 0===i?void 0:i.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),minLength:{value:4,message:s("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(a=p.applicantAddress)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_DOB_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth(),i=t.getDate()-n.getDate();return l>=18||18===l&&(o>0||0===o&&i>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0]})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(r=p.applicantDateOfBirth)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_APPLICANT_GENDER_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:m,name:"applicantGender",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:s,options:h,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0})}))),l.createElement(t.CardLabelError,{style:f},(null==p||null===(u=p.applicantGender)||void 0===u?void 0:u.message)||"")))},so=e=>{var o,i,a,r,u,s,c;const{t:d,currentStepData:m,Controller:v,control:p,setValue:f,errors:E,errorStyle:g}=e,h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",m);const e=null==m?void 0:m.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[m,f]);const{data:_}=Digit.Hooks.noc.useTenants(),[S,b]=n.useState(_);return l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{className:"card-section-header"},d("NOC_PROFESSIONAL_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+d("NOC_PROFESSIONAL_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalName",defaultValue:null==h||null===(o=h.info)||void 0===o?void 0:o.name,rules:{required:d("REQUIRED_FIELD"),minLength:{value:4,message:d("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:d("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},null!=E&&E.professionalName?E.professionalName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_PROFESSIONAL_EMAIL_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalEmailId",defaultValue:null==h||null===(i=h.info)||void 0===i?void 0:i.emailId,rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:d("INVALID_EMAIL_FORMAT")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d,disabled:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(a=E.professionalEmailId)||void 0===a?void 0:a.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalRegId",rules:{required:d("REQUIRED_FIELD")},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(r=E.professionalRegId)||void 0===r?void 0:r.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalMobileNumber",defaultValue:null==h||null===(u=h.info)||void 0===u?void 0:u.mobileNumber,rules:{required:d("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:d("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:d,disable:"true"})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(s=E.professionalMobileNumber)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+d("NOC_PROFESSIONAL_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(v,{control:p,name:"professionalAddress",rules:{required:d("REQUIRED_FIELD"),minLength:{value:4,message:d("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:d("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:d})}))),l.createElement(t.CardLabelError,{style:g},(null==E||null===(c=E.professionalAddress)||void 0===c?void 0:c.message)||""))},co=e=>{var o,i,a,r,u,s,c,m,v,p,f,E,g,h,_;Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),{t:b,currentStepData:y,Controller:A,control:C,setValue:D,errors:N,errorStyle:T,useFieldArray:L,watch:O}=e,[I,w]=n.useState("0.00"),{fields:x,append:P,remove:R}=L({control:C,name:"floorArea"}),F=O("floorArea"),B=O("basementArea");n.useEffect(()=>{const e=null==F?void 0:F.reduce((e,t)=>{const n=parseFloat(null==t?void 0:t.value);return e+(isNaN(n)?0:n)},0),t=isNaN(B)?0:B,n=(e+parseFloat(t)).toFixed(2);w(n),D("totalFloorArea",n)},[F,B]);const[M,k]=n.useState((null==y||null===(o=y.siteDetails)||void 0===o?void 0:o.ulbName)||null),[U,W]=n.useState((null==y||null===(i=y.siteDetails)||void 0===i?void 0:i.ulbType)||""),[H,j]=n.useState((null==y||null===(a=y.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:z,isLoading:V}=Digit.Hooks.noc.useBuildingType(S),{data:G,isLoading:Y}=Digit.Hooks.noc.useRoadType(S),{data:q,isLoading:K}=Digit.Hooks.useTenants(),X=null==q?void 0:q.map(e=>d({},e,{displayName:b(e.i18nKey)}));n.useEffect(()=>{if(M){var e;const t=null==M||null===(e=M.city)||void 0===e?void 0:e.ulbType;W(t),D("ulbType",t)}},[M,D]);const[$,Q]=n.useState((null==y||null===(r=y.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),J=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Z=Digit.Hooks.noc.useTenants(),[ee,te]=n.useState(Z),[ne,le]=n.useState((null==y||null===(u=y.siteDetails)||void 0===u?void 0:u.district)||null),[oe,ie]=n.useState([]),{data:ae}=Digit.Hooks.useBoundaryLocalities(null==ne?void 0:ne.code,"revenue",{enabled:!!ne},b);return n.useEffect(()=>{(null==ae?void 0:ae.length)>0&&ie(ae)},[ae]),n.useEffect(()=>{ie([]),D("zone",null)},[ne]),n.useEffect(()=>{const e=null==y?void 0:y.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&D(t,n)}),Array.isArray(e.floorArea))){for(let e=x.length-1;e>=0;e--)R(e);e.floorArea.forEach(e=>{P({value:e.value||""})})}},[y,D,P,R]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},b("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"plotNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},null!=N&&N.plotNo?N.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"proposedSiteAddress",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:200,message:b("MAX_200_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},null!=N&&N.proposedSiteAddress?N.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ULB_NAME_LABEL"),"*"),!K&&l.createElement(A,{control:C,name:"ulbName",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{k(t),e.onChange(t)},selected:e.value,option:X,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:T},null!=N&&N.ulbName?N.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:U||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"khasraNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},(null==N||null===(s=N.khasraNo)||void 0===s?void 0:s.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"hadbastNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},(null==N||null===(c=N.hadbastNo)||void 0===c?void 0:c.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ROAD_TYPE_LABEL"),"*"),!Y&&l.createElement(A,{control:C,name:"roadType",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:G,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:T},(null==N||null===(m=N.roadType)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"areaLeftForRoadWidening",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},(null==N||null===(v=N.areaLeftForRoadWidening)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL")),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"netPlotAreaAfterWidening",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"roadWidthAtSite",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},null!=N&&N.roadWidthAtSite?N.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_BUILDING_STATUS_LABEL"),"*"),!V&&l.createElement(A,{control:C,name:"buildingStatus",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{j(t),e.onChange(t)},selected:e.value,option:z,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:T},(null==N||null===(p=N.buildingStatus)||void 0===p?void 0:p.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(A,{control:C,name:"isBasementAreaAvailable",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{Q(t),e.onChange(t)},selected:e.value,option:J,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:T},(null==N||null===(f=N.isBasementAreaAvailable)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&"YES"===(null==$?void 0:$.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"basementArea",rules:{required:b("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:b("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},null!=N&&N.basementArea?N.basementArea.message:""),"BUILTUP"===(null==H?void 0:H.code)&&x.map((e,n)=>l.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},l.createElement(t.CardLabel,{className:"card-label-smaller"},0===n?"Ground":""+n," Floor Area*"),l.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},l.createElement(A,{control:C,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:b("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:b("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var o,i;return l.createElement(l.Fragment,null,l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==N||null===(o=N.floorArea)||void 0===o||null===(i=o[n])||void 0===i?void 0:i.value)&&l.createElement(t.CardLabelError,{className:T},N.floorArea[n].value.message))}}),l.createElement("button",{type:"button",onClick:()=>R(n)},"❌")))),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement("button",{type:"button",onClick:()=>P({value:""})},"➕ Add Floor"),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_TOTAL_FLOOR_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"totalFloorArea",defaultValue:I,render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"wardNo",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},(null==N||null===(E=N.wardNo)||void 0===E?void 0:E.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_DISTRICT_LABEL"),"*"),l.createElement(A,{control:C,name:"district",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{le(t),e.onChange(t)},selected:e.value,option:ee.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name"})})),l.createElement(t.CardLabelError,{style:T},(null==N||null===(g=N.district)||void 0===g?void 0:g.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_ZONE_LABEL"),"*"),l.createElement(A,{control:C,name:"zone",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:oe,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:T},(null==N||null===(h=N.zone)||void 0===h?void 0:h.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+b("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(A,{control:C,name:"villageName",rules:{required:b("REQUIRED_FIELD"),maxLength:{value:100,message:b("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:T},(null==N||null===(_=N.villageName)||void 0===_?void 0:_.message)||"")),l.createElement(t.BreakLine,null)))},mo=e=>{var o;const{t:i,currentStepData:a,Controller:r,control:u,setValue:s,errors:c,errorStyle:d}=e,m=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[v,p]=n.useState((null==a||null===(o=a.siteDetails)||void 0===o?void 0:o.specificationBuildingCategory)||[]),{data:f,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(m);return n.useEffect(()=>{console.log("currentStepData4",a);const e=null==a?void 0:a.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;s(t,n)})},[a,s]),l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,null,i("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_PLOT_AREA_JAMA_BANDI_LABEL")),l.createElement("div",{className:"field"},l.createElement(r,{control:u,name:"specificationPlotArea",render:e=>l.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}))),l.createElement(t.CardLabelError,{style:d},null!=c&&c.specificationPlotArea?c.specificationPlotArea.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_BUILDING_CATEGORY_LABEL"),"*"),!E&&f.length>0&&l.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:i("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:f,optionKey:"name"})})),l.createElement(t.CardLabelError,{style:d},null!=c&&c.specificationBuildingCategory?c.specificationBuildingCategory.message:"")))};function vo(e){var o;let{t:i,document:a,setDocuments:r,setError:u,documents:s,action:m,formData:v,handleSubmit:p,id:f}=e;const E=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[g,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(E?d({},E,{active:!0===(null==a?void 0:a.active),code:null==E?void 0:E.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[_,S]=n.useState(null),[b,y]=n.useState(()=>(null==E?void 0:E.filestoreId)||null);function A(e){const t=e.target.files[0];S(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{c.getData(e,function(){const e=c.getTag(this,"GPSLatitude"),n=c.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&n){const l=I(e).toFixed(2),o=I(n).toFixed(2);t({latitude:l,longitude:o})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(sessionStorage.setItem("Latitude1",e.latitude),sessionStorage.setItem("Longitude1",e.longitude)):(sessionStorage.removeItem("Latitude1"),sessionStorage.removeItem("Longitude1"),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(sessionStorage.setItem("Latitude2",e.latitude),sessionStorage.setItem("Longitude2",e.longitude)):(sessionStorage.removeItem("Latitude2"),sessionStorage.removeItem("Longitude2"),alert("Please upload a photo with location details.")))})}const{dropdownData:C}=a;var D=C;const[N,T]=n.useState(!1),[L,O]=n.useState(!1);function I(e){return e[0]+e[1]/60+e[2]/3600}return n.useEffect(()=>{null!=g&&g.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==b?void 0:b.length)||null===b?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==b))||[],{documentType:null==g?void 0:g.code,filestoreId:b,documentUid:b,documentAttachment:b}]})},[b,g]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),n.useEffect(()=>{if("update"===m){var e,t;const n=null==v||null===(e=v.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=D.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return d({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(h(l),y(null==n?void 0:n.fileStoreId)):T(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||h({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(_){O(!0);const e=function(){if(_.size>=5242880)O(!1),u(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=yt(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",_,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;O(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?y(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):u(i("CS_FILE_UPLOAD_ERROR"))})},function(){O(!1),u(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[_]),n.useEffect(()=>{N&&y(null)},[N]),l.createElement("div",{style:{marginBottom:"24px"}},L&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"100%"},option:D.map(e=>{var t;return d({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:i})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),l.createElement("span",null,null!=a&&a.required?" *":""))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement(t.UploadFile,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{onUpload:A,onDelete:()=>{y(null)},id:f,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!b}:{onUpload:A,onDelete:()=>{y(null)},id:f,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!b}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(sessionStorage.getItem("Latitude1")&&sessionStorage.getItem("Longitude1")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude1")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude1"))):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(sessionStorage.getItem("Latitude2")&&sessionStorage.getItem("Longitude2")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude2")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude2"))):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details.")))))}const po=e=>{let{width:t=20,height:n=20,style:o}=e;return l.createElement("svg",{style:o,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},l.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function fo(e){var t;let{value:n={}}=e;const{t:o}=i.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:n},{value:n});let r=[];return null!=n&&n.workflowDocs&&(r=null==n?void 0:n.workflowDocs),l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",o=(null==l?void 0:l.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(a.pdfFiles,null==e?void 0:e.documentAttachment);return l.createElement("a",{target:"_",href:n,style:{minWidth:"100px",marginRight:"10px"},key:t},l.createElement(po,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",textAlign:"center"}},o(null==e?void 0:e.documentType.replace(".","_").toUpperCase())))}))))}const Eo=l.memo(function(e){var o,i,a;let{t:r,document:u,setDocuments:s,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",m);const g=(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",g);const h=Digit.ULBService.getStateId(),[_,S]=n.useState(g?d({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==u||null===(o=u.dropdownData)||void 0===o?void 0:o.length)>0?null==u?void 0:u.dropdownData[0]:{}),[b,y]=n.useState(null),[A,C]=n.useState(()=>(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[D,N]=n.useState([]),[T,L]=n.useState([]),[O,I]=n.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===_.code))),[w,x]=n.useState(null),[P,R]=n.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==m?void 0:m.length)>0&&E()},[m]),n.useEffect(()=>{T.length>0&&null!=_&&_.code&&(s(e=>{if(null===A||null==(null==A?void 0:A.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId);let n=[];return T&&T.map((e,t)=>{var l,o;n.push({documentType:null==_?void 0:_.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:w,longitude:P},documentUid:e.fileStoreId,fileName:(null===(l=O[t])||void 0===l?void 0:l.name)||"",id:m?null===(o=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===o?void 0:o.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),L([])),null!=_&&_.code&&s(e=>{var t;return null===A||null==(null==A?void 0:A.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,o,i;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.split(".")[1])==(null==_||null===(l=_.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==_||null===(o=_.code)||void 0===o?void 0:o.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==_?void 0:_.code),null!=e&&null!==(i=e.file)&&void 0!==i&&i.documentType&&(e.file.documentType=null==_?void 0:_.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId),{documentType:null==_?void 0:_.code,fileStoreId:A.fileStoreId,documentUid:A.fileStoreId,fileName:(null==b?void 0:b.name)||A.fileName||"document",id:m?null===(t=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===t?void 0:t.id:void 0}]})},[A,_]),n.useEffect(()=>{_.code||null===A||L([...T,A])},[A]);const B=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",v);let n=[];return null==v||null===(e=v.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===_.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:h}}])),console.log("selectedUplDocs here",n),n},[v]);return l.createElement("div",null,l.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:h,getFormState:function(e){let t,n,l=_.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{c.getData(e,function(){const e=c.getTag(this,"GPSLatitude"),n=c.getTag(this,"GPSLongitude");if(e&&n){const l=F(e),o=F(n);t({latitude:l,longitude:o})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(o=>{var i,a,r;console.log("Latitude:",o.latitude),console.log("Longitude:",o.longitude),x(o.latitude),R(o.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==o.latitude&&null!==o.longitude?(sessionStorage.setItem("Latitude",o.latitude),sessionStorage.setItem("Longitude",o.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==v||null===(i=v.documents)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.filter(e=>e.documentType===_.code),N(n);let c=[];null==e||e.map((e,t)=>{var n,l,i,a;c.push({documentType:null==_?void 0:_.code,additionalDetails:{category:null==_?void 0:_.code.split(".").slice(0,2).join("_"),latitude:o.latitude,longitude:o.longitude},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(l=n.fileStoreId)||void 0===l?void 0:l.fileStoreId,documentUid:null==e||null===(i=e[1].fileStoreId)||void 0===i?void 0:i.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:m?null===(a=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===a?void 0:a.id:void 0})});const d=[...m.filter(e=>e.documentType!==l),...c];s(d),null===(r=n)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=l,function(e,t){e&&y(e.file),e&&I([...O,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...m.filter(e=>e.documentType!==l)];s(e)}},setuploadedstate:B,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(gn,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?l.createElement("div",null,l.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),l.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),go=e=>{let{matchPath:n}=e;const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:o("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},ho=e=>{let{stateCode:n,userType:i,tenants:a}=e;const{path:r}=o.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),s?l.createElement(t.Loader,null):"citizen"===i?l.createElement(no,null):l.createElement(bt,{path:r,stateCode:n})},_o={NOCModule:ho,NOCCard:()=>{var e,a;const{t:r}=i.useTranslation(),u=o.useLocation(),s=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const c={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:m,data:{totalCount:v,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:d({},c),config:{enabled:(null==c||null===(e=c.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const g=n.useMemo(()=>({Icon:l.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:m?"":v,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:m?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:v,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[m,v]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,g):null},NOCLinks:go,NOCApplicationOverview:()=>{var e,a,r,u,s,c,m,f,E;const{id:g}=o.useParams(),{t:h}=i.useTranslation(),_=Digit.ULBService.getCurrentTenantId(),S=null==_?void 0:_.split(".")[0],[b,y]=n.useState({}),[A,C]=n.useState(null),D={},[N]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[T,L]=n.useState(null),[O,I]=n.useState([]),[w,x]=n.useState([]),[P,R]=n.useState([]),[F,B]=n.useState([]),[M,k]=n.useState([]),[U,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(S,"NOC",["DocumentTypeMapping"]),{data:q}=Digit.Hooks.obps.useMDMS(S,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(h,_,{applicationNo:g}),{mutate:$}=Digit.Hooks.noc.useNOCApplicationActions(_),Q=Digit.Hooks.useWorkflowDetails({tenantId:_,id:g,moduleCode:"NOC"});var J,Z;null!=Q&&null!==(e=Q.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Q.isLoading&&(Q.data.actionState.nextActions=[...null==Q||null===(r=Q.data)||void 0===r?void 0:r.nextActions]),Q&&Q.data&&!Q.isLoading&&(Q.data.initialActionState=(null==Q||null===(J=Q.data)||void 0===J?void 0:J.initialActionState)||d({},null==Q||null===(Z=Q.data)||void 0===Z?void 0:Z.actionState)||{},Q.data.actionState=d({},Q.data)),n.useEffect(()=>{x([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;R(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),n.useEffect(()=>{var e;B(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.DocumentType)},[q]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),n.useEffect(()=>{if(null!=w&&w.length&&null!=P&&P.length){let e=[];w.map(t=>{var n,l;const o=P.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=o&&null!==(n=o[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(o[0].docTypes[0].nocType=o[0].nocType,o[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(o[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],F.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,P,F]),n.useEffect(()=>{var e,t;let n=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),j(null==n?void 0:n.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),n.useEffect(()=>{null!=H&&H.length&&Digit.UploadServices.Filefetch(H,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[H]);const ee=e=>{let{t:o,nocDataDetails:i,nocDocumentsList:a}=e;if(null!=i&&i.length&&null!=a&&a.length&&null!=(null==i?void 0:i[0])){var r,u,s,c,d,m,f,E,g,h,_,S,b,y,A,C,D,N,I,w;const e="WF_"+(null==i||null===(r=i[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==i||null===(u=i[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+o("NOC_MAIN_"+p(null==a||null===(s=a[0])||void 0===s?void 0:s.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+o("NOC_"+(null==i||null===(c=i[0])||void 0===c?void 0:c.nocType)+"_APPLICATION_LABEL"),text:o(null==i||null===(d=i[0])||void 0===d?void 0:d.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_STATUS_LABEL"),text:o(e)||"NA",textStyle:"APPROVED"==(null==i||null===(m=i[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==i||null===(f=i[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_SUBMITED_ON_LABEL"),text:null!=i&&null!==(E=i[0])&&void 0!==E&&null!==(g=E.additionalDetails)&&void 0!==g&&g.SubmittedOn?v(Number(null==i||null===(h=i[0])||void 0===h||null===(_=h.additionalDetails)||void 0===_?void 0:_.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVAL_NO_LABEL"),text:(null==i||null===(S=i[0])||void 0===S?void 0:S.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==i||null===(b=i[0])||void 0===b||null===(y=b.auditDetails)||void 0===y?void 0:y.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(A=i[0])&&void 0!==A&&A.documents&&(null==i||null===(C=i[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==i||null===(D=i[0])||void 0===D||null===(N=D.documents)||void 0===N?void 0:N.map((e,n)=>{var i,r;return l.createElement("a",{target:"_",href:null===(i=U[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},o("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,o("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==Q||null===(I=Q.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==O?void 0:O.map((e,t)=>l.createElement(el,{key:t,document:e,t:o,error:T,setError:L,setNocDocuments:k,nocDocuments:M})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+h(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;y(d({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:h,data:X,nocDataDetails:w,nocDocumentsList:O})}]})),V(!1)}},[X,O,w,N,H,U]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},h("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(Zn,{applicationDetails:b,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:$,workflowDetails:Q,businessService:null!=Q&&null!==(s=Q.data)&&void 0!==s&&s.applicationBusinessService?null==Q||null===(c=Q.data)||void 0===c?void 0:c.applicationBusinessService:null==X||null===(m=X.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:A,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:a}=e;const{t:u}=i.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c={},m={moduleName:"noc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:m,searchForm:c,tableForm:v},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[g,h]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{searchForm:t.data})),d({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{filterForm:t.data})),d({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",d({},e,{tableForm:t.data})),d({},e,{tableForm:t.data})}},E),{data:_,isLoading:S}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:b,data:{statuses:y,totalCount:A}={}}=Digit.Hooks.noc.useInbox({tenantId:s,filters:d({},g)});let C=[];const D={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"},{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},N=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:o}=e;return l.createElement(tl,{registerRef:t,searchFormState:n,searchFieldComponents:o})},[]),T=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(nl,{statuses:y,isInboxLoading:b,registerRef:t,controlFilterForm:n,setFilterFormValue:o,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:S})},[y,b,_,S]),L={SearchFormFields:N,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),h({action:"mutateTableForm",data:d({},v)}),h({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),h({action:"mutateSearchForm",data:c})}},O={FilterFormFields:T,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),h({action:"mutateTableForm",data:d({},v)}),h({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),h({action:"mutateFilterForm",data:m})}},I=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:c,formState:m,totalCount:v,table:p,dispatch:f,onSortingByData:E}=e;const{t:g}=i.useTranslation(),h=n.useMemo(()=>[{Header:g("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(o.Link,{to:s+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:o}=e;return null!==(t=o.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Gl(new Date(null===(n=o.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:g("NOC_MODULE_SOURCE_LABEL"),accessor:e=>g("MODULE_"+(null==e?void 0:e.source)),disableSortBy:!0},{Header:g("NOC_STATUS_LABEL"),accessor:e=>g(null==e?void 0:e.status),disableSortBy:!0},{Header:g("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:g("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?g(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:c,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(a=m.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=m.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:d({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:d({},m.tableForm,{offset:0})}),data:p,columns:h}})(d({},{parentRoute:a,onPageSizeChange:e=>{h({action:"mutateTableForm",data:d({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:A,table:C,dispatch:h,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===l||h({action:"mutateTableForm",data:d({},g.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),w=(e=>{let{parentRoute:n,table:o}=e;const{t:a}=i.useTranslation();return{data:null==o?void 0:o.map(e=>{let{applicationId:t,date:n,source:l,status:o,owner:i,sla:r}=e;return{[a("NOC_APP_NO_LABEL")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:Gl(new Date(n),"dd/MM/yyyy"),[a("NOC_MODULE_SOURCE_LABEL")]:a("MODULE_"+l),[a("NOC_STATUS_LABEL")]:a(o),[a("WF_INBOX_HEADER_CURRENT_OWNER")]:i,[a("ES_INBOX_SLA_DAYS_REMAINING")]:a(r)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(t.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:o,value:i}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{o(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:C}),x={onMobileSortOrderData:e=>{const{sortOrder:t}=e;h({action:"mutateTableForm",data:d({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),h({action:"mutateTableForm",data:v})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),A?l.createElement("p",{className:"inbox-count"},A):null),l.createElement(t.InboxComposer,d({isInboxLoading:b,PropsForInboxLinks:D},L,O,x,{propsForInboxTable:I,propsForInboxMobileCards:w,formState:g})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:s,isLoading:c,Count:d}=e;const[m,v]=n.useState(null),p=r.useForm({defaultValues:{}});n.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","commencementDate"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=i.useTranslation(),t=e=>l.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var l,o;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(o=n.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-"))},disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,o;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,p,E?l.createElement($l,{SearchFormFieldsComponent:ql,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(Ql,{columns:f,SearchFormFieldsComponent:ql,onSubmit:a,data:u,error:s,isLoading:c,Count:d}))},NewNOCStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=s.useDispatch(),[r,u]=n.useState(null),c=s.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),l.createElement(oo,{stepsList:ro,onSubmit:e=>{console.log("dataGet===",e)},step:c,setStep:e=>{a((e=>({type:"SET_NOCNewApplication_STEP",payload:e}))(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var o,a,u;let{config:c,onGoNext:m,onBackClick:v}=e;const p=s.useDispatch(),{t:f}=i.useTranslation(),[E,g]=n.useState(null),[h,_]=n.useState(""),S=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),b=Digit.UserService.getUser(),{control:y,handleSubmit:A,setValue:C,formState:{errors:D},trigger:N}=r.useForm(),T={Controller:r.Controller,control:y,setValue:C,errors:D,trigger:N,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}};function L(e){p(ao(c.key,e)),m()}function O(e){v(c.key,e)}const[I,w]=n.useState((null==S||null===(o=S.applicationDetails)||void 0===o?void 0:o.isRegisteredStakeHolder)||!1),x=Digit.ULBService.getStateId(),[P,R]=n.useState(!1),F=null==b||null===(a=b.info)||void 0===a||null===(u=a.roles)||void 0===u?void 0:u.map(e=>e.code),{data:B,isLoading:M}=Digit.Hooks.obps.useMDMS(x,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!M){var e,t;let n=[];null==B||null===(e=B.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{n.push(e)})});const l=null==n?void 0:n.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.map(e=>{null!=F&&F.includes(e)&&w(!0)})}},[M]),n.useEffect(()=>{var e;null!=S&&null!==(e=S.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&C("isRegisteredStakeHolder","true")},[]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:A(e=>{N(),D.length>0?console.log("Plz fill mandatory fields in Step1"):L(e)})},l.createElement("div",{className:"employeeCard"},I?l.createElement(l.Fragment,null,l.createElement(so,d({onGoBack:O,goNext:L,currentStepData:S,t:f},T)),l.createElement(uo,d({onGoBack:O,goNext:L,currentStepData:S,t:f},T))):l.createElement(l.Fragment,null,l.createElement(uo,d({onGoBack:O,goNext:L,currentStepData:S,t:f},T)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:h,onClose:()=>{g(null),_("")}}))},NewNOCStepFormTwo:e=>{let{config:o,onBackClick:a,onGoNext:u}=e;const{t:c}=i.useTranslation(),m=s.useDispatch(),[v,p]=n.useState(!1),[f,E]=n.useState(""),{control:g,handleSubmit:h,setValue:_,formState:{errors:S},trigger:b,watch:y}=r.useForm({defaultValues:{floorArea:[{value:""}]}}),A=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C={Controller:r.Controller,control:g,setValue:_,errors:S,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:y};function D(e){m(ao(o.key,e)),u()}function N(e){a(o.key,e)}return l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:h(e=>{b(),S.length>0?console.log("Plz fill mandatory fields"):D(e)})},l.createElement("div",{className:"employeeCard"},l.createElement(co,d({onGoBack:N,goNext:D,currentStepData:A,t:c},C)),l.createElement(mo,d({onGoBack:N,goNext:D,currentStepData:A,t:c},C))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:N}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),v&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{p(!1),E("")}}))},NewNOCStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:r}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[m,v]=n.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),g=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){const t=function(e){if(!f){var t,n;const l=(null==E||null===(t=E.NOC)||void 0===t?void 0:t.Documents)||[],o=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],i=l.filter(e=>e.required).map(e=>e.code),a=o.map(e=>e.documentType);return i.filter(e=>!a.includes(e))}}(e);return t.length>0?(v(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(t[0].replace(".","_").toUpperCase())),void d(!0)):sessionStorage.getItem("Latitude1")&&sessionStorage.getItem("Longitude1")&&sessionStorage.getItem("Latitude2")&&sessionStorage.getItem("Longitude2")?void i():(v(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void d(!0))},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!En.isEqual(t,g)),En.isEqual(t,g)||u(ao(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{d(!1),v("")}}))},NewNOCStepFormFour:e=>{let{config:o,onGoNext:i,onBackClick:a,t:r}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[m,v]=n.useState(""),p=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData||{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:p,config:o.currStepConfig,onSubmit:function(e){i()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!En.isEqual(t,p)),En.isEqual(t,p)||u(ao(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{d(!1),v("")}}))},NOCApplicantDetails:uo,NOCProfessionalDetails:so,NOCSiteDetails:co,NOCSpecificationDetails:mo,NOCDocumentsRequired:e=>{var o,i,a;let{t:r,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[m,v]=n.useState(null==c||null===(o=c.documents)||void 0===o?void 0:o.documents),[p,f]=n.useState(null),[E,g]=n.useState(!0),[h,_]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:y}=Digit.Hooks.pt.usePropertyMDMS(S,"NOC",["Documents"]),A=()=>{let e;e=d({},c.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==y||null===(e=y.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==m||m.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),g("0"!=n&&0!=n||!((null==m?void 0:m.length)>0))},[m,h]),l.createElement("div",null,b?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:A,onSkip:()=>s(),isDisabled:E,onAdd:function(){}},null==y||null===(i=y.NOC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(vo,{key:t,document:e,t:r,error:p,setError:f,setDocuments:v,documents:m,setCheckRequiredFields:_,handleSubmit:A})),p&&l.createElement(t.Toast,{label:p,isDleteBtn:!0,onClose:()=>f(null),error:!0})))},NOCSummary:function(e){var n,i,a,r,u,c,d,m,v,p,f,E,g,h,_,S,b,y,A,C,D,N,T,L,O,I,w,x,P,R,F,B,M,k,U,W,H,j,z,V,G,Y,q,K,X,$,Q,J,Z,ee,te,ne,le;let{formData:oe,t:ie}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",oe);const ae={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},re={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ue={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},se={fontWeight:"bold",color:"#555"},ce=(e,n)=>l.createElement("div",{style:re},l.createElement(t.CardLabel,{style:se},e),l.createElement("div",null,n||"NA"));Digit.UserService.getUser();let de=null==oe||null===(n=oe.documents)||void 0===n||null===(i=n.documents)||void 0===i?void 0:i.documents;return console.log("documents here in summary",de),l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},l.createElement("h2",{style:ue},ie("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_FIRM_OWNER_NAME_LABEL"),null==oe||null===(a=oe.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),ce(ie("NOC_APPLICANT_EMAIL_LABEL"),null==oe||null===(r=oe.applicationDetails)||void 0===r?void 0:r.applicantEmailId),ce(ie("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==oe||null===(u=oe.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),ce(ie("NOC_APPLICANT_MOBILE_NO_LABEL"),null==oe||null===(c=oe.applicationDetails)||void 0===c?void 0:c.applicantMobileNumber),ce(ie("NOC_APPLICANT_DOB_LABEL"),null==oe||null===(d=oe.applicationDetails)||void 0===d?void 0:d.applicantDateOfBirth),ce(ie("NOC_APPLICANT_GENDER_LABEL"),null==oe||null===(m=oe.applicationDetails)||void 0===m||null===(v=m.applicantGender)||void 0===v?void 0:v.code),ce(ie("NOC_APPLICANT_ADDRESS_LABEL"),null==oe||null===(p=oe.applicationDetails)||void 0===p?void 0:p.applicantAddress)),(null==oe||null===(f=oe.applicationDetails)||void 0===f?void 0:f.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ue},ie("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PROFESSIONAL_NAME_LABEL"),null==oe||null===(E=oe.applicationDetails)||void 0===E?void 0:E.professionalName),ce(ie("NOC_PROFESSIONAL_EMAIL_LABEL"),null==oe||null===(g=oe.applicationDetails)||void 0===g?void 0:g.professionalEmailId),ce(ie("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==oe||null===(h=oe.applicationDetails)||void 0===h?void 0:h.professionalRegId),ce(ie("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==oe||null===(_=oe.applicationDetails)||void 0===_?void 0:_.professionalMobileNumber),ce(ie("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==oe||null===(S=oe.applicationDetails)||void 0===S?void 0:S.professionalAddress))),l.createElement("h2",{style:ue},ie("NOC_SITE_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PLOT_NO_LABEL"),null==oe||null===(b=oe.siteDetails)||void 0===b?void 0:b.plotNo),ce(ie("NOC_PROPOSED_SITE_ADDRESS"),null==oe||null===(y=oe.siteDetails)||void 0===y?void 0:y.proposedSiteAddress),ce(ie("NOC_ULB_NAME_LABEL"),null==oe||null===(A=oe.siteDetails)||void 0===A||null===(C=A.ulbName)||void 0===C?void 0:C.name),ce(ie("NOC_ULB_TYPE_LABEL"),null==oe||null===(D=oe.siteDetails)||void 0===D?void 0:D.ulbType),ce(ie("NOC_KHASRA_NO_LABEL"),null==oe||null===(N=oe.siteDetails)||void 0===N?void 0:N.khasraNo),ce(ie("NOC_HADBAST_NO_LABEL"),null==oe||null===(T=oe.siteDetails)||void 0===T?void 0:T.hadbastNo),ce(ie("NOC_ROAD_TYPE_LABEL"),null==oe||null===(L=oe.siteDetails)||void 0===L||null===(O=L.roadType)||void 0===O?void 0:O.name),ce(ie("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==oe||null===(I=oe.siteDetails)||void 0===I?void 0:I.areaLeftForRoadWidening),ce(ie("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==oe||null===(w=oe.siteDetails)||void 0===w?void 0:w.netPlotAreaAfterWidening),ce(ie("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==oe||null===(x=oe.siteDetails)||void 0===x?void 0:x.roadWidthAtSite),ce(ie("NOC_BUILDING_STATUS_LABEL"),null==oe||null===(P=oe.siteDetails)||void 0===P||null===(R=P.buildingStatus)||void 0===R?void 0:R.name),ce(ie("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==oe||null===(F=oe.siteDetails)||void 0===F||null===(B=F.isBasementAreaAvailable)||void 0===B?void 0:B.code),"BUILTUP"===(null==oe||null===(M=oe.siteDetails)||void 0===M||null===(k=M.buildingStatus)||void 0===k?void 0:k.code)&&ce(ie("NOC_BASEMENT_AREA_LABEL"),null==oe||null===(U=oe.siteDetails)||void 0===U?void 0:U.basementArea),"BUILTUP"===(null==oe||null===(W=oe.siteDetails)||void 0===W||null===(H=W.buildingStatus)||void 0===H?void 0:H.code)&&(null==oe||null===(j=oe.siteDetails)||void 0===j||null===(z=j.floorArea)||void 0===z?void 0:z.map((e,t)=>ce((e=>0===e?ie("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+ie("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==oe||null===(V=oe.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&ce(ie("NOC_TOTAL_FLOOR_AREA_LABEL"),null==oe||null===(Y=oe.siteDetails)||void 0===Y?void 0:Y.totalFloorArea),ce(ie("NOC_DISTRICT_LABEL"),null==oe||null===(q=oe.siteDetails)||void 0===q||null===(K=q.district)||void 0===K?void 0:K.name),ce(ie("NOC_ZONE_LABEL"),null==oe||null===(X=oe.siteDetails)||void 0===X||null===($=X.zone)||void 0===$?void 0:$.name),ce(ie("NOC_SITE_WARD_NO_LABEL"),null==oe||null===(Q=oe.siteDetails)||void 0===Q?void 0:Q.wardNo),ce(ie("NOC_SITE_VILLAGE_NAME_LABEL"),null==oe||null===(J=oe.siteDetails)||void 0===J?void 0:J.villageName)),l.createElement("h2",{style:ue},ie("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:ae},ce(ie("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==oe||null===(Z=oe.siteDetails)||void 0===Z?void 0:Z.specificationPlotArea),ce(ie("NOC_BUILDING_CATEGORY_LABEL"),null==oe||null===(ee=oe.siteDetails)||void 0===ee||null===(te=ee.specificationBuildingCategory)||void 0===te?void 0:te.name)),l.createElement("h2",{style:ue},ie("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:ae},Array.isArray(null==oe||null===(ne=oe.documents)||void 0===ne||null===(le=ne.documents)||void 0===le?void 0:le.documents)&&oe.documents.documents.documents.length>0?l.createElement(fo,{value:{workflowDocs:oe.documents.documents.documents}}):l.createElement("div",null,ie("NOC_NO_DOCUMENTS_MSG"))))},NOCDocumentWithLatLong:e=>{var o,i,a;let{t:r,config:u,onSelect:s,formData:c}=e;const m=Digit.ULBService.getStateId(),[v,p]=n.useState((null==c||null===(o=c.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[g,h]=n.useState(!0),[_,S]=n.useState(!1),[b,y]=n.useState(!1),A=gt((null==c?void 0:c.PrevStateDocuments)||[]),{isLoading:C,data:D}=Digit.Hooks.pt.usePropertyMDMS(m,"NOC",["Documents"]),N=()=>{let e;e=d({},c.documents,{documents:v}),s(u.key,e)};return n.useEffect(()=>{var e,t;const n=null==D||null===(e=D.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),l=null==n?void 0:n.filter(e=>v.reduce((t,n)=>{var l,o,i,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(o=l.split("."))||void 0===o?void 0:o[0])+"."+(null==n||null===(i=n.documentType)||void 0===i||null===(a=i.split("."))||void 0===a?void 0:a[1])||t},!1));h(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==v?void 0:v.length)>0))},[v,_]),l.createElement("div",null,C?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:N,onSkip:()=>s(),onAdd:function(){}},null==D||null===(i=D.NOC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(Eo,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:S,formData:c,beforeUploadDocuments:A||[],isNextButtonDisabled:b,setIsNextButtonDisabled:y,handleSubmit:N}))),f&&l.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=c&&c.applicationNo?l.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==c?void 0:c.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")}};exports.NOCLinks=go,exports.NOCModule=ho,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:Zl}),exports.initNOCComponents=()=>{Object.entries(_o).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
1
+ var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-router-dom"),o=require("react-i18next"),a=require("react-query"),r=require("react-hook-form");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function s(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const c=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+i}return null},d=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},v=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],l=[],i=Digit.UserService.getUser().info.roles;return n.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&l.push(e?null==n||null===(a=n[o])||void 0===a?void 0:a.code:null==n?void 0:n[o])})})}),l};var p=function(e,t){return e===t||e!=e&&t!=t},m=function(e,t){for(var n=e.length;n--;)if(p(e[n][0],t))return n;return-1},f=Array.prototype.splice;function h(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}h.prototype.clear=function(){this.__data__=[],this.size=0},h.prototype.delete=function(e){var t=this.__data__,n=m(t,e);return!(n<0||(n==t.length-1?t.pop():f.call(t,n,1),--this.size,0))},h.prototype.get=function(e){var t=this.__data__,n=m(t,e);return n<0?void 0:t[n][1]},h.prototype.has=function(e){return m(this.__data__,e)>-1},h.prototype.set=function(e,t){var n=this.__data__,l=m(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var E=h,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(e,t){return e(t={exports:{}},t.exports),t.exports}var b,y="object"==typeof g&&g&&g.Object===Object&&g,A="object"==typeof self&&self&&self.Object===Object&&self,C=y||A||Function("return this")(),D=C.Symbol,T=Object.prototype,w=T.hasOwnProperty,O=T.toString,N=D?D.toStringTag:void 0,x=Object.prototype.toString,I=D?D.toStringTag:void 0,P=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=w.call(e,N),n=e[N];try{e[N]=void 0;var l=!0}catch(e){}var i=O.call(e);return l&&(t?e[N]=n:delete e[N]),i}(e):function(e){return x.call(e)}(e)},L=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},R=function(e){if(!L(e))return!1;var t=P(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},F=C["__core-js_shared__"],M=(b=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+b:"",B=Function.prototype.toString,k=function(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""},U=/^\[object .+?Constructor\]$/,W=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!L(e)||(t=e,M&&M in t))&&(R(e)?W:U).test(k(e));var t}(n)?n:void 0},H=j(C,"Map"),z=j(Object,"create"),V=Object.prototype.hasOwnProperty,Y=Object.prototype.hasOwnProperty;function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}G.prototype.clear=function(){this.__data__=z?z(null):{},this.size=0},G.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},G.prototype.get=function(e){var t=this.__data__;if(z){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return V.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return z?void 0!==t[e]:Y.call(t,e)},G.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=z&&void 0===t?"__lodash_hash_undefined__":t,this};var q=G,K=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}X.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(H||E),string:new q}},X.prototype.delete=function(e){var t=K(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return K(this,e).get(e)},X.prototype.has=function(e){return K(this,e).has(e)},X.prototype.set=function(e,t){var n=K(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var J=X;function $(e){var t=this.__data__=new E(e);this.size=t.size}$.prototype.clear=function(){this.__data__=new E,this.size=0},$.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$.prototype.get=function(e){return this.__data__.get(e)},$.prototype.has=function(e){return this.__data__.has(e)},$.prototype.set=function(e,t){var n=this.__data__;if(n instanceof E){var l=n.__data__;if(!H||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new J(l)}return n.set(e,t),this.size=n.size,this};var Z=$,Q=function(){try{var e=j(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ee=function(e,t,n){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},te=Object.prototype.hasOwnProperty,ne=function(e,t,n){var l=e[t];te.call(e,t)&&p(l,n)&&(void 0!==n||t in e)||ee(e,t,n)},le=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?ee(n,r,u):ne(n,r,u)}return n},ie=function(e){return null!=e&&"object"==typeof e},oe=function(e){return ie(e)&&"[object Arguments]"==P(e)},ae=Object.prototype,re=ae.hasOwnProperty,ue=ae.propertyIsEnumerable,se=oe(function(){return arguments}())?oe:function(e){return ie(e)&&re.call(e,"callee")&&!ue.call(e,"callee")},ce=Array.isArray,de=function(){return!1},ve=S(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?C.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||de}),pe=/^(?:0|[1-9]\d*)$/,me=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&pe.test(e))&&e>-1&&e%1==0&&e<t},fe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},he={};he["[object Float32Array]"]=he["[object Float64Array]"]=he["[object Int8Array]"]=he["[object Int16Array]"]=he["[object Int32Array]"]=he["[object Uint8Array]"]=he["[object Uint8ClampedArray]"]=he["[object Uint16Array]"]=he["[object Uint32Array]"]=!0,he["[object Arguments]"]=he["[object Array]"]=he["[object ArrayBuffer]"]=he["[object Boolean]"]=he["[object DataView]"]=he["[object Date]"]=he["[object Error]"]=he["[object Function]"]=he["[object Map]"]=he["[object Number]"]=he["[object Object]"]=he["[object RegExp]"]=he["[object Set]"]=he["[object String]"]=he["[object WeakMap]"]=!1;var Ee=function(e){return function(t){return e(t)}},ge=S(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&y.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),_e=ge&&ge.isTypedArray,Se=_e?Ee(_e):function(e){return ie(e)&&fe(e.length)&&!!he[P(e)]},be=Object.prototype.hasOwnProperty,ye=function(e,t){var n=ce(e),l=!n&&se(e),i=!n&&!l&&ve(e),o=!n&&!l&&!i&&Se(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!be.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||me(s,u))||r.push(s);return r},Ae=Object.prototype,Ce=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)},De=function(e,t){return function(n){return e(t(n))}},Te=De(Object.keys,Object),we=Object.prototype.hasOwnProperty,Oe=function(e){return null!=e&&fe(e.length)&&!R(e)},Ne=function(e){return Oe(e)?ye(e):function(e){if(!Ce(e))return Te(e);var t=[];for(var n in Object(e))we.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},xe=Object.prototype.hasOwnProperty,Ie=function(e){return Oe(e)?ye(e,!0):function(e){if(!L(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ce(e),n=[];for(var l in e)("constructor"!=l||!t&&xe.call(e,l))&&n.push(l);return n}(e)},Pe=S(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?C.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Le=function(){return[]},Re=Object.prototype.propertyIsEnumerable,Fe=Object.getOwnPropertySymbols,Me=Fe?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];Re.call(e,r)&&(a[o++]=r)}return a}(Fe(e)))}:Le,Be=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ke=De(Object.getPrototypeOf,Object),Ue=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Be(t,Me(e)),e=ke(e);return t}:Le,We=function(e,t,n){var l=t(e);return ce(e)?l:Be(l,n(e))},je=function(e){return We(e,Ne,Me)},He=function(e){return We(e,Ie,Ue)},ze=j(C,"DataView"),Ve=j(C,"Promise"),Ye=j(C,"Set"),Ge=j(C,"WeakMap"),qe=k(ze),Ke=k(H),Xe=k(Ve),Je=k(Ye),$e=k(Ge),Ze=P;(ze&&"[object DataView]"!=Ze(new ze(new ArrayBuffer(1)))||H&&"[object Map]"!=Ze(new H)||Ve&&"[object Promise]"!=Ze(Ve.resolve())||Ye&&"[object Set]"!=Ze(new Ye)||Ge&&"[object WeakMap]"!=Ze(new Ge))&&(Ze=function(e){var t=P(e),n="[object Object]"==t?e.constructor:void 0,l=n?k(n):"";if(l)switch(l){case qe:return"[object DataView]";case Ke:return"[object Map]";case Xe:return"[object Promise]";case Je:return"[object Set]";case $e:return"[object WeakMap]"}return t});var Qe=Ze,et=Object.prototype.hasOwnProperty,tt=C.Uint8Array,nt=function(e){var t=new e.constructor(e.byteLength);return new tt(t).set(new tt(e)),t},lt=/\w*$/,it=D?D.prototype:void 0,ot=it?it.valueOf:void 0,at=Object.create,rt=function(){function e(){}return function(t){if(!L(t))return{};if(at)return at(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),ut=ge&&ge.isMap,st=ut?Ee(ut):function(e){return ie(e)&&"[object Map]"==Qe(e)},ct=ge&&ge.isSet,dt=ct?Ee(ct):function(e){return ie(e)&&"[object Set]"==Qe(e)},vt={};vt["[object Arguments]"]=vt["[object Array]"]=vt["[object ArrayBuffer]"]=vt["[object DataView]"]=vt["[object Boolean]"]=vt["[object Date]"]=vt["[object Float32Array]"]=vt["[object Float64Array]"]=vt["[object Int8Array]"]=vt["[object Int16Array]"]=vt["[object Int32Array]"]=vt["[object Map]"]=vt["[object Number]"]=vt["[object Object]"]=vt["[object RegExp]"]=vt["[object Set]"]=vt["[object String]"]=vt["[object Symbol]"]=vt["[object Uint8Array]"]=vt["[object Uint8ClampedArray]"]=vt["[object Uint16Array]"]=vt["[object Uint32Array]"]=!0,vt["[object Error]"]=vt["[object Function]"]=vt["[object WeakMap]"]=!1;var pt=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!L(t))return t;var d=ce(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&et.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var v=Qe(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(ve(t))return Pe(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(r=s||p?{}:function(e){return"function"!=typeof e.constructor||Ce(e)?{}:rt(ke(e))}(t),!u)return s?function(e,t){return le(e,Ue(e),t)}(t,function(e,t){return e&&le(t,Ie(t),e)}(r,t)):function(e,t){return le(e,Me(e),t)}(t,function(e,t){return e&&le(t,Ne(t),e)}(r,t))}else{if(!vt[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return nt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?nt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?nt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(l=e).constructor(l.source,lt.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ot?Object(ot.call(e)):{}}}(t,v,u)}}a||(a=new Z);var m=a.get(t);if(m)return m;a.set(t,r),dt(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):st(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(c?s?He:je:s?Ie:Ne)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),ne(r,o,e(i,n,l,o,t,a))}),r},mt=function(e){return pt(e,5)};const ft=e=>{var i,a;const{t:r}=o.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),d=v();let p=[];1==(null==d?void 0:d.length)&&(p=[null==d||null===(i=d[0])||void 0===i?void 0:i.code]),(null==d?void 0:d.length)>1&&(null==d||d.forEach(e=>{p.push(e.code)}));const[m,f]=n.useState({offset:0,limit:10,tenantId:s,nocType:p[0]}),h={offset:0,limit:10,tenantId:s,nocType:p[0]},E=window.Digit.Utils.browser.isMobile(),{data:g,isLoading:_,isSuccess:S,error:b}=Digit.Hooks.noc.useNOCSearchApplication(s,m,{});return l.createElement("div",null,l.createElement(t.CardHeader,{styles:E?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},r("ACTION_TEST_SEARCH_NOC_APPLICATION")),l.createElement(c,{t:r,tenantId:s,onSubmit:function(e,t){void 0===t&&(t=!1);let n=mt(e),l=h;for(const[t,n]of Object.entries(e))null!=n&&null!=n&&""!=n&&(l=u({},l,{[t]:n}));f(1==t?n:l)},isLoading:_,Count:null==g?void 0:g.count,error:b,data:!_&&S&&(null==g||null===(a=g.Noc)||void 0===a?void 0:a.length)>0?g.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},ht=e=>{var n,a;const{state:r}=e.location,{t:u}=o.useTranslation(),s=i.useHistory(),c=null==r||null===(n=r.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:u("NOC_"+d(null==c?void 0:c.nocType,".","_")+"_"+d(null==c?void 0:c.applicationStatus,".","_")+"_HEADER"),applicationNumber:null==c?void 0:c.nocNo,info:"REJECTED"==(null==c?void 0:c.applicationStatus)?"":u("NOC_"+d(null==c?void 0:c.nocType,".","_")+"_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.applicationStatus)?l.createElement(t.CardText,null,u("NOC_"+d(null==c?void 0:c.nocType,".","_")+"_"+d(null==c?void 0:c.applicationStatus,".","_")+"_SUB_HEADER")):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/employee")}}))))},Et=e=>{let{location:n}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!!n.pathname.includes("noc/inbox")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return l.createElement(t.BreadCrumb,{crumbs:a})},gt=e=>{var a,r,s,c;let{path:d}=e;const v=i.useLocation(),p=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),m=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NOCInbox"),f=window.location.href.includes("/response"),h=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,f?null:l.createElement("div",{style:window.location.href.includes("application-overview")||h?{marginLeft:"10px"}:{}},l.createElement(Et,{location:v})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:d+"/inbox/application-overview/:id",component:p}),l.createElement(t.PrivateRoute,{path:d+"/search/application-overview/:id",component:p}),l.createElement(t.PrivateRoute,{path:d+"/inbox",component:e=>l.createElement(m,u({},e,{parentRoute:d}))}),l.createElement(t.PrivateRoute,{path:d+"/search",component:e=>l.createElement(ft,u({},e,{parentRoute:d}))}),l.createElement(t.PrivateRoute,{path:d+"/response",component:ht})))};function _t(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const St=e=>l.createElement("h1",{className:"heading-m"},e.label),bt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),yt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(bt,null)),At=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:E,data:g}=Digit.Hooks.pt.useMDMS(s,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,S]=n.useState({}),[b,y]=n.useState({}),[A,C]=n.useState([]),[D,T]=n.useState(null),[w,O]=n.useState(null),[N,x]=n.useState(null),[I,P]=n.useState(null),[L,R]=n.useState([]),[F,M]=n.useState(null),[B,k]=n.useState(!1);function U(e){O(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&R(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(w){const e=function(){if(w.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",w,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):P(a("CS_FILE_UPLOAD_ERROR"))})},function(){P(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[w]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:L,selectedFinancialYear:F,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:v,businessService:p}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:D,setSelectedApprover:T,selectFile:U,uploadedFile:N,setUploadedFile:x,businessService:p}))},[r,A,L,F,N]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(St,{label:a(_.label.heading)}),headerBarEnd:l.createElement(yt,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:h||(null==r?void 0:r.docUploadRequired)&&!N,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};v.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==v?void 0:v.propertyId,tenantId:s,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:N}]),d({Property:u({},v,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},Ct=e=>l.createElement("h1",{className:"heading-m"},e.label),Dt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Tt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Dt,null)),wt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:h}=Digit.Hooks.pt.useMDMS(s,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,g]=n.useState({}),[_,S]=n.useState({}),[b,y]=n.useState([]),[A,C]=n.useState({}),[D,T]=n.useState(null),[w,O]=n.useState(null),[N,x]=n.useState(null),[I,P]=n.useState([]),[L,R]=n.useState(null);n.useEffect(()=>{var e;h&&h["egf-master"]&&P(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]);const{data:F}=Digit.Hooks.useCustomMDMS(s,"common-masters",[{name:"Department"}]);function M(e){T(e.target.files[0])}return n.useEffect(()=>{if(m&&F){var e;const t=F["common-masters"].Department;y(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[m]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:M,uploadedFile:w,setUploadedFile:O,businessService:p}))},[r,b,I,L,w]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ct,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Tt,{onClick:c}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:w?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:w}]:null}),d({Licenses:[v]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Ot=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Nt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),xt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nt,null)),It=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState({}),[C,D]=n.useState(null),[T,w]=n.useState(null),[O,N]=n.useState(null),x=!!Digit.Utils.browser.isMobile();function I(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))N(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&E((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:I,uploadedFile:T,setUploadedFile:w,businessService:p,error:O}))},[r,S,T,O]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ot,{label:a(h.label.heading)}),headerBarEnd:l.createElement(xt,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:x?{width:"720px"}:{},style:x?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:x?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null}),d({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Pt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Lt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Lt,null)),Ft=e=>{var i,o,r,s,c,d,v,p,m,f,h,E;let{t:g,action:_,tenantId:S,closeModal:b,submitAction:y,applicationDetails:A,applicationData:C,businessService:D,workflowDetails:T,blockReason:w}=e;console.log("applicationData",C),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(s=C)||void 0===s||null===(c=s.landInfo)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city:S,!1);const{data:O,isLoading:N}=Digit.Hooks.useEmployeeSearch(S,{roles:null==T||null===(v=T.data)||void 0===v||null===(p=v.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===f||null===(h=f[0])||void 0===h||null===(E=h.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[x,I]=(a.useQueryClient(),n.useState({})),[P,L]=n.useState({}),[R,F]=n.useState([]),[M,B]=n.useState([]),[k,U]=n.useState({}),[W,j]=n.useState({}),[H,z]=n.useState(null),[V,Y]=n.useState(null),[G,q]=n.useState(null),[K,X]=n.useState(null),J=!!Digit.Utils.browser.isMobile();function $(e){z(e.target.files[0])}n.useEffect(()=>{var e;F(null==O||null===(e=O.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[O]),n.useEffect(()=>{!function(){try{q(null);const e=function(){if(H){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(H.size>=5242880)q(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=H&&H.type&&!e.test(null==H?void 0:H.type))q(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",H,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?Y(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):q(g("CS_FILE_UPLOAD_ERROR"))})},function(){q(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[H]);const Z=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},Q=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},ee=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{B(null==w?void 0:w.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&I((e=>{var n,i,o,a,r,u,s;let{t:c,action:d,approvers:v,selectedApprover:p,setSelectedApprover:m,selectedBlockReason:f,setBlockReason:h,selectFile:E,uploadedFile:g,setUploadedFile:_,assigneeLabel:S,businessService:b,error:y,blockReasonFiltered:A}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+b+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(i=d.state)||void 0===i?void 0:i.state)?null:c(S||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:p})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:E,onDelete:()=>{_(null)},message:g?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:y})}]}]}})({t:g,action:_,approvers:R,selectedApprover:k,setSelectedApprover:U,selectedBlockReason:W,setBlockReason:j,selectFile:$,uploadedFile:V,setUploadedFile:Y,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:M}))},[_,R,K,V,G]),_&&x.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pt,{label:g(x.label.heading)}),headerBarEnd:l.createElement(Rt,{onClick:b}),actionCancelLabel:g(x.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:g(x.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:J?{width:"720px"}:{},style:J?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:J?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:x.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,s,c,d,v,p,m,f,h,E,D,w,O,N,x,I,P,L,R,F,M;C=u({},C,{documents:te(),additionalDetails:u({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==_?void 0:_.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(i=T.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==T||null===(s=T.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(d=c[0])||void 0===d||null===(v=d.assigner)||void 0===v?void 0:v.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(p=T.data)||void 0===p||null===(m=p.processInstances)||void 0===m||null===(f=m[0])||void 0===f||null===(h=f.state)||void 0===h?void 0:h.applicationStatus)?[null==T||null===(E=T.data)||void 0===E||null===(D=E.processInstances)||void 0===D||null===(w=D[0])||void 0===w||null===(O=w.assigner)||void 0===O?void 0:O.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:V}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(N=T.data)||void 0===N||null===(x=N.processInstances)||void 0===x||null===(I=x[0])||void 0===I||null===(P=I.state)||void 0===P?void 0:P.applicationStatus)?[null==T||null===(L=T.data)||void 0===L||null===(R=L.processInstances)||void 0===R||null===(F=R[0])||void 0===F||null===(M=F.assigner)||void 0===M?void 0:M.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:V?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==H?void 0:H.name,fileStoreId:V}]:null});const B=function(e,t,n,l,i,o,a,r,s,c,d,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=C)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(a=C)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null===(c=C)||void 0===c||null===(d=c.additionalDetails)||void 0===d||null===(v=d.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS))){var p,m,f;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==A||null===(p=A.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(f=m.Noc)||void 0===f?void 0:f.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,a,r,u,s,c,d,v,p,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?y({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(b(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else y({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}b(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},Mt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Bt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bt,null)),Ut=e=>{var o,r;let{t:s,action:c,tenantId:d,closeModal:v,submitAction:p,applicationData:m,businessService:f}=e;const{data:h,isLoading:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(o=c.assigneeRoles)||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[g,_]=(a.useQueryClient(),n.useState({})),[S,b]=n.useState({}),[y,A]=n.useState([]),[C,D]=n.useState({}),[T,w]=n.useState(null),[O,N]=n.useState(null),[x,I]=n.useState(null),P=!!Digit.Utils.browser.isMobile();function L(e){w(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;A(null==h||null===(e=h.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[h]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)I(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))I(s("NOT_SUPPORTED_FILE_TYPE"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(s("CS_FILE_UPLOAD_ERROR"))})},function(){I(s("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{c&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:v,businessService:p,error:m}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+p+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:s,action:c,approvers:y,selectedApprover:C,setSelectedApprover:D,selectFile:L,uploadedFile:O,setUploadedFile:N,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:x}))},[c,y,O,x]),c&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Mt,{label:s(g.label.heading)}),headerBarEnd:l.createElement(kt,{onClick:v}),actionCancelLabel:s(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:P?{width:"720px"}:{},style:P?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:P?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m=u({},m,{workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:O?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:O}]:null},documents:o}),p({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Wt=e=>l.createElement("h1",{className:"heading-m"},e.label),jt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ht=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jt,null)),zt=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Vt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState({}),[C,D]=n.useState(null),[T,w]=n.useState(null),[O,N]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),I=window.location.href.includes("/employee");function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))N(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=v)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&E((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:v,businessService:p,error:m}=e,f=!0,h=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:r}):null},h&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{v(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:P,uploadedFile:T,setUploadedFile:w,businessService:p,error:O})):r&&E((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:v,error:p}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:P,uploadedFile:T,setUploadedFile:w,businessService:p,error:O}))},[r,S,T,O]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Ht,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&I?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,c,p,m,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var h,E,g,_,S,b,A,D,w;const t=u({},null===(h=v)||void 0===h||null===(E=h.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(_=v)||void 0===_||null===(S=_.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:s,businessService:null!==(b=v)&&void 0!==b&&null!==(A=b.applicationType)&&void 0!==A&&A.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=v)&&void 0!==D&&null!==(w=D.applicationType)&&void 0!==w&&w.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]}});d({AmendmentUpdate:n})}else{if(v=u({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:null,processInstance:u({},null===(n=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]:[]})}),null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=mt(null==e?void 0:e.date);v.disconnectionExecutionDate=zt(t)}else if(null!=e&&e.date){const t=mt(null==e?void 0:e.date);v.connectionExecutionDate=zt(t)}var O;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(c=v)||void 0===c||null===(p=c.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(O=v)||void 0===O?void 0:O.serviceType)?d({WaterConnection:v,disconnectRequest:!0}):d({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var N,x,I,P,L,R,F,M,B,k,U,W,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenalty)||""),null!=t&&null!==(I=t.value)&&void 0!==I&&I.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(j=v)||void 0===j?void 0:j.serviceType)?d({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Yt=e=>l.createElement("h1",{className:"heading-m"},e.label),Gt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gt,null)),Kt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[T,w]=n.useState(null),[O,N]=n.useState(null),[x,I]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&E((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:P,uploadedFile:T,setUploadedFile:w,businessService:p}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Yt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(qt,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};v.creationReason="CREATE",d({PetRegistrationApplications:[u({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),d({PetRegistrationApplications:[u({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Xt=e=>l.createElement("h1",{className:"heading-m"},e.label),Jt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Jt,null)),Zt=e=>{var i,o,a;let{t:r,action:s,closeModal:c,submitAction:d,applicationData:v,businessService:p}=e;const m=Digit.ULBService.getStateId(),{data:f,isLoading:h}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[E,g]=n.useState({}),[_,S]=n.useState({}),[b,y]=n.useState([]),[A,C]=n.useState(""),[D,T]=n.useState([]),[w,O]=n.useState(null),N=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",N);const x=n.useMemo(()=>{var e;if(h||!f||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[h,f,N]);return console.log("years",x),n.useEffect(()=>{s&&g((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:s,years:x,selectedApprover:A,setSelectedApprover:C,businessService:p}))},[s,x,D,w]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xt,{label:r(E.label.heading)}),headerBarEnd:l.createElement($t,{onClick:c}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=v)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);v=u({},v,{financialYear:i,action:"INITIATE",additionalDetail:u({},v.additionalDetail,{validityYears:A.length>0?parseInt(A):""})}),d({Licenses:[v]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Qt=e=>l.createElement("h1",{className:"heading-m"},e.label),en=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),tn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(en,null)),nn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[T,w]=n.useState(null),[O,N]=n.useState(null),[x,I]=n.useState(!1);function P(e){I(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,s)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(I(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,v),n.useEffect(()=>{E((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:s,setSelectedApprover:c,isUploading:d}=e;const v=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:c,selected:s})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(v,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:P,uploadedFile:T,setUploadedFile:w,businessService:p,isUploading:x}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(tn,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:T}]),d({streetVendingDetail:u({},v,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ln=e=>l.createElement("h1",{className:"heading-m"},e.label),on=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),an=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(on,null)),rn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[y,A]=n.useState(null),[C,D]=n.useState(null),[T,w]=n.useState(null),[O,N]=n.useState(null),[x,I]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{N(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&E((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:y,setSelectedApprover:A,selectFile:P,uploadedFile:T,setUploadedFile:w,businessService:p}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ln,{label:a(h.label.heading)}),headerBarEnd:l.createElement(an,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:T}]),d({hallsBookingApplication:[u({},v,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},un=e=>l.createElement("h1",{className:"heading-m"},e.label),sn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),cn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sn,null)),dn=e=>{var o,a,r;let{t:s,action:c,tenantId:d,closeModal:v,submitAction:p,applicationData:m,businessService:f,moduleCode:h}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(o=c.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),g=i.useHistory(),[_,S]=n.useState({}),[b,y]=n.useState({}),[A,C]=n.useState([]),[D,T]=n.useState(null),[w,O]=n.useState(null);return n.useEffect(()=>{var e;C(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{"INITIATED"===(null==c?void 0:c.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:s,action:c,approvers:A,selectedApprover:D,setSelectedApprover:T,uploadedFile:w,setUploadedFile:O,businessService:f}))},[c,A,w]),c&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(un,{label:s(_.label.heading)}),headerBarEnd:l.createElement(cn,{onClick:v}),actionCancelLabel:s(_.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:s(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==c?void 0:c.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:h};w&&(t.documents=[]),p({Asset:u({},m,{workflow:t})})},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},vn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(At,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Kt,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(wt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Zt,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(It,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Ft,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Ut,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Vt,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(nn,e):null!=e&&e.businessService.includes("chb")?l.createElement(rn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(dn,e):void 0;function pn(e){let{documents:n,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:s}=o.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,i)=>{var o,c,d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),a?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}S(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",v="[object Map]",p="[object Number]",m="[object Object]",f="[object RegExp]",h="[object Set]",E="[object String]",_="[object Symbol]",S="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",O="[object Uint8Array]",N="[object Uint16Array]",x="[object Uint32Array]",I=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,M=RegExp(R.source),B=RegExp(F.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(V.source),G=/^\s+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ve="["+de+"]",pe="["+ce+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ye="(?:"+fe+"|"+he+")",Ae="(?:"+be+"|"+he+")",Ce="(?:"+pe+"|"+Ee+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,_e,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Te="(?:"+["[\\u2700-\\u27bf]",_e,Se].join("|")+")"+De,we="(?:"+[ge+pe+"?",pe,_e,Se,"[\\ud800-\\udfff]"].join("|")+")",Oe=RegExp("['’]","g"),Ne=RegExp(pe,"g"),xe=RegExp(Ee+"(?="+Ee+")|"+we+De,"g"),Ie=RegExp([be+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,be+ye,"$"].join("|")+")",be+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Te].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fe=-1,Me={};Me[A]=Me[C]=Me[D]=Me[T]=Me[w]=Me[O]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[x]=!0,Me[o]=Me[a]=Me[b]=Me[r]=Me[y]=Me[u]=Me[s]=Me[c]=Me[v]=Me[p]=Me[m]=Me[f]=Me[h]=Me[E]=Me[S]=!1;var Be={};Be[o]=Be[a]=Be[b]=Be[y]=Be[r]=Be[u]=Be[A]=Be[C]=Be[D]=Be[T]=Be[w]=Be[v]=Be[p]=Be[m]=Be[f]=Be[h]=Be[E]=Be[_]=Be[O]=Be["[object Uint8ClampedArray]"]=Be[N]=Be[x]=!0,Be[s]=Be[c]=Be[S]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,We=parseInt,je="object"==typeof g&&g&&g.Object===Object&&g,He="object"==typeof self&&self&&self.Object===Object&&self,ze=je||He||Function("return this")(),Ve=t&&!t.nodeType&&t,Ye=Ve&&e&&!e.nodeType&&e,Ge=Ye&&Ye.exports===Ve,qe=Ge&&je.process,Ke=function(){try{return Ye&&Ye.require&&Ye.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Je=Ke&&Ke.isDate,$e=Ke&&Ke.isMap,Ze=Ke&&Ke.isRegExp,Qe=Ke&&Ke.isSet,et=Ke&&Ke.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&Et(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function pt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Et(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):ht(e,_t,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function _t(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function yt(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Dt(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Tt(e){return e?e.slice(0,Vt(e)+1).replace(G,""):e}function wt(e){return function(t){return e(t)}}function Ot(e,t){return st(t,function(t){return e[t]})}function Nt(e,t){return e.has(t)}function xt(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function Pt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=yt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=yt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ft(e){return"\\"+ke[e]}function Mt(e){return Pe.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function kt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Ht(e){return Mt(e)?function(e){for(var t=xe.lastIndex=0;xe.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(xe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Yt=yt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var g=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,fe=t.String,he=t.TypeError,Ee=g.prototype,ge=pe.prototype,_e=t["__core-js_shared__"],Se=de.prototype.toString,be=ge.hasOwnProperty,ye=0,Ae=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,De=Se.call(pe),Te=ze._,we=me("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=Ge?t.Buffer:void 0,Pe=t.Symbol,ke=t.Uint8Array,je=xe?xe.allocUnsafe:void 0,He=kt(pe.getPrototypeOf,pe),Ve=pe.create,Ye=ge.propertyIsEnumerable,qe=Ee.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,mt=Pe?Pe.iterator:void 0,yt=Pe?Pe.toStringTag:void 0,qt=function(){try{var e=$i(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=q&&q.now!==ze.Date.now&&q.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,$t=ve.ceil,Zt=ve.floor,Qt=pe.getOwnPropertySymbols,en=xe?xe.isBuffer:void 0,tn=t.isFinite,nn=Ee.join,ln=kt(pe.keys,pe),on=ve.max,an=ve.min,rn=q.now,un=t.parseInt,sn=ve.random,cn=Ee.reverse,dn=$i(t,"DataView"),vn=$i(t,"Map"),pn=$i(t,"Promise"),mn=$i(t,"Set"),fn=$i(t,"WeakMap"),hn=$i(pe,"create"),En=fn&&new fn,gn={},_n=wo(dn),Sn=wo(vn),bn=wo(pn),yn=wo(mn),An=wo(fn),Cn=Pe?Pe.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Tn=Cn?Cn.toString:void 0;function wn(e){if(Va(e)&&!La(e)&&!(e instanceof In)){if(e instanceof xn)return e;if(be.call(e,"__wrapped__"))return Oo(e)}return new xn(e)}var On=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Nn(){}function xn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Bn(e,t){var n=La(e),l=!n&&Pa(e),i=!n&&!l&&Ba(e),o=!n&&!l&&!i&&Za(e),a=n||l||i||o,r=a?Dt(e.length,fe):[],u=r.length;for(var s in e)!t&&!be.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function kn(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function Un(e,t){return yo(fi(e),Kn(t,0,e.length))}function Wn(e){return yo(fi(e))}function jn(e,t,n){(void 0!==n&&!Na(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var l=e[t];be.call(e,t)&&Na(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Na(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return Qn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Yn(e,t){return e&&hi(t,Sr(t),e)}function Gn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=g(l),o=null==e;++n<l;)i[n]=o?void 0:fr(e,t[n]);return i}function Kn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,a){var s,g=1&t,S=2&t,I=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!za(e))return e;var P=La(e);if(P){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!g)return fi(e,s)}else{var L=eo(e),R=L==c||L==d;if(Ba(e))return si(e,g);if(L==m||L==o||R&&!i){if(s=S||R?{}:no(e),!g)return S?function(e,t){return hi(e,Qi(e),t)}(e,function(e,t){return e&&hi(t,br(t),e)}(s,e)):function(e,t){return hi(e,Zi(e),t)}(e,Yn(s,e))}else{if(!Be[L])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case b:return ci(e);case r:case u:return new l(+e);case y:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case A:case C:case D:case T:case w:case O:case"[object Uint8ClampedArray]":case N:case x:return di(e,n);case v:return new l;case p:case E:return new l(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return new l;case _:return Dn?pe(Dn.call(e)):{}}}(e,L,g)}}a||(a=new Mn);var F=a.get(e);if(F)return F;a.set(e,s),Xa(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,a))}):Ya(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,a))});var M=P?void 0:(I?S?Vi:zi:S?br:Sr)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),Hn(s,i,Xn(l,t,n,i,e,a))}),s}function Jn(e,t,n){var l=n.length;if(null==e)return!l;for(e=pe(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function $n(e,t,l){if("function"!=typeof e)throw new he(n);return go(function(){e.apply(void 0,l)},t)}function Zn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,wt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Nt,a=!1,t=new Fn(t));e:for(;++i<r;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&d==d){for(var v=s;v--;)if(t[v]===d)continue e;u.push(c)}else o(t,d,l)||u.push(c)}return u}wn.templateSettings={escape:k,evaluate:U,interpolate:W,variable:"",imports:{_:wn}},(wn.prototype=Nn.prototype).constructor=wn,(xn.prototype=On(Nn.prototype)).constructor=xn,(In.prototype=On(Nn.prototype)).constructor=In,Pn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},Pn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Pn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Pn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:be.call(t,e)},Pn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return zn(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new Pn,map:new(vn||Ln),string:new Pn}},Rn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return Xi(this,e).get(e)},Rn.prototype.has=function(e){return Xi(this,e).has(e)},Rn.prototype.set=function(e,t){var n=Xi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Qn=_i(rl),el=_i(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!$a(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):ct(i,r):l||(i[i.length]=r)}return i}var ol=Si(),al=Si(!0);function rl(e,t){return e&&ol(e,t,Sr)}function ul(e,t){return e&&al(e,t,Sr)}function sl(e,t){return at(t,function(t){return Wa(e[t])})}function cl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[To(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return La(e)?l:ct(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yt&&yt in pe(e)?function(e){var t=be.call(e,yt),n=e[yt];try{e[yt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[yt]=n:delete e[yt]),i}(e):function(e){return Ce.call(e)}(e)}function pl(e,t){return e>t}function ml(e,t){return null!=e&&be.call(e,t)}function fl(e,t){return null!=e&&t in pe(e)}function hl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=g(o),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,wt(t))),u=an(c.length,u),r[a]=!n&&(t||i>=120&&c.length>=120)?new Fn(a&&c):void 0}c=e[0];var d=-1,v=r[0];e:for(;++d<i&&s.length<u;){var p=c[d],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?Nt(v,m):l(s,m,n))){for(a=o;--a;){var f=r[a];if(!(f?Nt(f,m):l(e[a],m,n)))continue e}v&&v.push(m),s.push(p)}}return s}function El(e,t,n){var l=null==(e=mo(e,t=oi(t,e)))?e:e[To(Uo(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Va(e)&&vl(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=La(e),g=La(t),S=d?a:eo(e),A=g?a:eo(t),C=(S=S==o?m:S)==m,D=(A=A==o?m:A)==m,T=S==A;if(T&&Ba(e)){if(!Ba(t))return!1;d=!0,C=!1}if(T&&!C)return c||(c=new Mn),d||Za(e)?ji(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case r:case u:case p:return Na(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case E:return e==t+"";case v:var c=Bt;case h:if(c||(c=Wt),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var m=ji(c(e),c(t),l,i,o,a);return a.delete(e),m;case _:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,S,n,l,i,c);if(!(1&n)){var w=C&&be.call(e,"__wrapped__"),O=D&&be.call(t,"__wrapped__");if(w||O){var N=w?e.value():e,x=O?t.value():t;return c||(c=new Mn),i(N,x,n,l,c)}}return!!T&&(c||(c=new Mn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:be.call(t,c)))return!1}var d=o.get(e),v=o.get(t);if(d&&v)return d==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++s<u;){var f=e[c=r[s]],h=t[c];if(l)var E=a?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===E?f===h||i(f,h,n,l,o):E)){p=!1;break}m||(m="constructor"==c)}if(p&&!m){var g=e.constructor,_=t.constructor;g==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,l,i,c))}(e,t,n,l,_l,i))}function Sl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=pe(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Mn;if(l)var v=l(s,c,u,e,t,d);if(!(void 0===v?_l(c,s,3,l,d):v))return!1}}return!0}function bl(e){return!(!za(e)||(t=e,Ae&&Ae in t))&&(Wa(e)?we:ie).test(wo(e));var t}function yl(e){return"function"==typeof e?e:null==e?Gr:"object"==typeof e?La(e)?wl(e[0],e[1]):Tl(e):tu(e)}function Al(e){if(!so(e))return ln(e);var t=[];for(var n in pe(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=Fa(e)?g(e.length):[];return Qn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=Ji(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function wl(e,t){return ao(e)&&co(t)?vo(To(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?hr(n,e):_l(t,l,3)}}function Ol(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Mn),za(o))!function(e,t,n,l,i,o,a){var r=ho(e,n),u=ho(t,n),s=a.get(u);if(s)jn(e,n,s);else{var c=o?o(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var v=La(u),p=!v&&Ba(u),m=!v&&!p&&Za(u);c=u,v||p||m?La(r)?c=r:Ma(r)?c=fi(r):p?(d=!1,c=si(u,!0)):m?(d=!1,c=di(u,!0)):c=[]:qa(u)||Pa(u)?(c=r,Pa(r)?c=ar(r):za(r)&&!Wa(r)||(c=no(u))):d=!1}d&&(a.set(u,c),i(c,u,l,o,a),a.delete(u)),jn(e,n,c)}}(e,t,a,n,Ol,l,i);else{var r=l?l(ho(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),jn(e,a,r)}},br)}function Nl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function xl(e,t,n){t=t.length?st(t,function(e){return La(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Gr];var l=-1;return t=st(t,wt(Ki())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Il(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,oi(a,e),r)}return o}function Pl(e,t,n,l){var i=l?gt:Et,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=st(e,wt(n)));++o<a;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(r,c,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;io(i)?qe.call(e,i,1):$l(e,i)}}return e}function Rl(e,t){return e+Zt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Ml(e,t){return _o(po(e,t,Gr),e+"")}function Bl(e){return kn(Nr(e))}function kl(e,t){var n=Nr(e);return yo(n,Kn(t,0,n.length))}function Ul(e,t,n,l){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=To(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=za(c)?c:io(t[i+1])?[]:{})}Hn(r,u,s),r=r[u]}return e}var Wl=En?function(e,t){return En.set(e,t),e}:Gr,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Gr;function Hl(e){return yo(Nr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=g(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return Qn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Yl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!$a(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Gl(e,t,Gr,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=$a(t),s=void 0===t;i<o;){var c=Zt((i+o)/2),d=n(e[c]),v=void 0!==d,p=null===d,m=d==d,f=$a(d);if(a)var h=l||m;else h=s?m&&(l||v):r?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Na(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Kl(e){return"number"==typeof e?e:$a(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(La(e))return st(e,Xl)+"";if($a(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:Fi(e);if(s)return Wt(s);a=!1,i=Nt,u=new Fn}else u=t?[]:r;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var v=u.length;v--;)if(u[v]===d)continue e;t&&u.push(d),r.push(c)}else i(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function $l(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[To(Uo(t))]}function Zl(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function Ql(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof In&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Jl(e[0]):[];for(var i=-1,o=g(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Zn(o[i]||a,e[r],t,n));return Jl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Ma(e)?e:[]}function ii(e){return"function"==typeof e?e:Gr}function oi(e,t){return La(e)?e:ao(e,t)?[e]:Do(rr(e))}var ai=Ml;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Kt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function di(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=$a(e),a=void 0!==t,r=null===t,u=t==t,s=$a(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function pi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),c=g(u+s),d=!l;++r<u;)c[r]=t[r];for(;++i<a;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[r++]=e[i++];return c}function mi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(o-r,0),d=g(c+s),v=!l;++i<c;)d[i]=e[i];for(var p=i;++u<s;)d[p+u]=t[u];for(;++a<r;)(v||i<o)&&(d[p+n[a]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=g(l));++n<l;)t[n]=e[n];return t}function hi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Gn(n,r,u):Hn(n,r,u)}return n}function Ei(e,t){return function(n,l){var i=La(n)?nt:Vn,o=t?t():{};return i(n,e,Ki(l,2),o)}}function gi(e){return Ml(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function _i(e,t){return function(n,l){if(null==n)return n;if(!Fa(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=pe(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=pe(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Mt(t=rr(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function yi(e){return function(t){return dt(Wr(Pr(t).replace(Oe,"")),e,"")}}function Ai(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=On(e.prototype),l=e.apply(n,t);return za(l)?l:n}}function Ci(e){return function(t,n,l){var i=pe(t);if(!Fa(t)){var o=Ki(n,3);t=Sr(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return Hi(function(t){var l=t.length,i=l,o=xn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new he(n);if(o&&!r&&"wrapper"==Gi(a))var r=new xn([],!0)}for(i=r?i:l;++i<l;){var u=Gi(a=t[i]),s="wrapper"==u?Yi(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Gi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&La(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ti(e,t,n,l,i,o,a,r,u,s){var c=128&t,d=1&t,v=2&t,p=24&t,m=512&t,f=v?void 0:Ai(e);return function h(){for(var E=arguments.length,_=g(E),S=E;S--;)_[S]=arguments[S];if(p)var b=qi(h),y=Pt(_,b);if(l&&(_=pi(_,l,i,p)),o&&(_=mi(_,o,a,p)),E-=y,p&&E<s){var A=Ut(_,b);return Li(e,t,Ti,h.placeholder,n,_,A,r,u,s-E)}var C=d?n:this,D=v?C[e]:e;return E=_.length,r?_=fo(_,r):m&&E>1&&_.reverse(),c&&u<E&&(_.length=u),this&&this!==ze&&this instanceof h&&(D=f||Ai(D)),D.apply(C,_)}}function wi(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Oi(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=Xl(n),l=Xl(l)):(n=Kl(n),l=Kl(l)),i=e(n,l)}return i}}function Ni(e){return Hi(function(t){return t=st(t,wt(Ki())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function xi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,$t(e/Ht(t)));return Mt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function Ii(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n,l){for(var i=-1,o=on($t((t-e)/(n||1)),0),a=g(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:nr(l),e)}}function Pi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=or(t),n=or(n)),e(t,n)}}function Li(e,t,n,l,i,o,a,r,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,r,u,s],v=n.apply(void 0,d);return ro(e)&&Eo(v,d),v.placeholder=l,So(v,e,t)}function Ri(e){var t=ve[e];return function(e,n){if(e=or(e),(n=null==n?0:an(lr(n),292))&&tn(e)){var l=(rr(e)+"e").split("e");return+((l=(rr(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Fi=mn&&1/Wt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:$r;function Mi(e){return function(t){var n=eo(t);return n==v?Bt(t):n==h?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,r,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=o?o.length:0;if(d||(t&=-97,o=a=void 0),u=void 0===u?u:on(lr(u),0),s=void 0===s?s:lr(s),d-=a?a.length:0,64&t){var v=o,p=a;o=a=void 0}var m=c?void 0:Yi(e),f=[e,t,i,o,a,v,p,r,u,s];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?pi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?mi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:on(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=g(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=s.length)<n)return Li(e,t,Ti,i.placeholder,void 0,a,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Ti.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=g(s+r),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,i?n:this,c)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((m?Wl:Eo)(h,f),e,t)}function ki(e,t,n,l){return void 0===e||Na(e,ge[n])&&!be.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ol(e,t,void 0,Ui,o),o.delete(t)),e}function Wi(e){return qa(e)?void 0:e}function ji(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,v=!0,p=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var m=e[d],f=t[d];if(l)var h=a?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==h){if(h)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!Nt(p,t)&&(m===e||i(m,e,n,l,o)))return p.push(t)})){v=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function Hi(e){return _o(po(e,void 0,Ro),e+"")}function zi(e){return dl(e,Sr,Zi)}function Vi(e){return dl(e,br,Qi)}var Yi=En?function(e){return En.get(e)}:$r;function Gi(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(be.call(wn,"placeholder")?wn:e).placeholder}function Ki(){var e=wn.iteratee||qr;return e=e===qr?yl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ji(e){for(var t=Sr(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function $i(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Zi=Qt?function(e){return null==e?[]:(e=pe(e),at(Qt(e),function(t){return Ye.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)ct(t,Zi(e)),e=He(e);return t}:iu,eo=vl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=To(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Ha(i)&&io(a,i)&&(La(e)||Pa(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:On(He(e))}function lo(e){return La(e)||Pa(e)||!!(Ke&&e&&e[Ke])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!za(n))return!1;var l=typeof t;return!!("number"==l?Fa(n)&&io(t,n.length):"string"==l&&t in n)&&Na(n[t],e)}function ao(e,t){if(La(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$a(e))||H.test(e)||!j.test(e)||null!=t&&e in pe(t)}function ro(e){var t=Gi(e),n=wn[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var l=Yi(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=y||vn&&eo(new vn)!=v||pn&&"[object Promise]"!=eo(pn.resolve())||mn&&eo(new mn)!=h||fn&&eo(new fn)!=S)&&(eo=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?wo(n):"";if(l)switch(l){case _n:return y;case Sn:return v;case bn:return"[object Promise]";case yn:return h;case An:return S}return t});var uo=_e?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in pe(n))}}function po(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=g(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=g(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function mo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(e);l--;){var o=t[l];e[l]=io(o,n)?i[o]:void 0}return e}function ho(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Eo=bo(Wl),go=Jt||function(e,t){return ze.setTimeout(e,t)},_o=bo(jl);function So(e,t,n){var l=t+"";return _o(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(J):[]}(l),n)))}function bo(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function yo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Rl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao,Co,Do=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=Ao.cache,Ao);function To(e){if("string"==typeof e||$a(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function wo(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oo(e){if(e instanceof In)return e.clone();var t=new xn(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var No=Ml(function(e,t){return Ma(e)?Zn(e,il(t,1,Ma,!0)):[]}),xo=Ml(function(e,t){var n=Uo(t);return Ma(n)&&(n=void 0),Ma(e)?Zn(e,il(t,1,Ma,!0),Ki(n,2)):[]}),Io=Ml(function(e,t){var n=Uo(t);return Ma(n)&&(n=void 0),Ma(e)?Zn(e,il(t,1,Ma,!0),void 0,n):[]});function Po(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),ht(e,Ki(t,3),i)}function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=lr(n),i=n<0?on(l+i,0):an(i,l-1)),ht(e,Ki(t,3),i,!0)}function Ro(e){return null!=e&&e.length?il(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var Mo=Ml(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),Bo=Ml(function(e){var t=Uo(e),n=st(e,li);return t===Uo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Ki(t,2)):[]}),ko=Ml(function(e){var t=Uo(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Ml(jo);function jo(e,t){return e&&e.length&&t&&t.length?Pl(e,t):e}var Ho=Hi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ll(e,st(t,function(e){return io(e,n)?+e:e}).sort(vi)),l});function zo(e){return null==e?e:cn.call(e)}var Vo=Ml(function(e){return Jl(il(e,1,Ma,!0))}),Yo=Ml(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Jl(il(e,1,Ma,!0),Ki(t,2))}),Go=Ml(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Jl(il(e,1,Ma,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ma(e))return t=on(e.length,t),!0}),Dt(t,function(t){return st(e,bt(t))})}function Ko(e,t){if(!e||!e.length)return[];var n=qo(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Ml(function(e,t){return Ma(e)?Zn(e,t):[]}),Jo=Ml(function(e){return ti(at(e,Ma))}),$o=Ml(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),ti(at(e,Ma),Ki(t,2))}),Zo=Ml(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ma),void 0,t)}),Qo=Ml(qo),ea=Ml(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ko(e,n)});function ta(e){var t=wn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=Hi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof In&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new xn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=Ei(function(e,t,n){be.call(e,n)?++e[n]:Gn(e,n,1)}),oa=Ci(Po),aa=Ci(Lo);function ra(e,t){return(La(e)?lt:Qn)(e,Ki(t,3))}function ua(e,t){return(La(e)?it:el)(e,Ki(t,3))}var sa=Ei(function(e,t,n){be.call(e,n)?e[n].push(t):Gn(e,n,[t])}),ca=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Fa(e)?g(e.length):[];return Qn(e,function(e){o[++l]=i?tt(t,e,n):El(e,t,n)}),o}),da=Ei(function(e,t,n){Gn(e,n,t)});function va(e,t){return(La(e)?st:Dl)(e,Ki(t,3))}var pa=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ma=Ml(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),xl(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function ha(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var l;if("function"!=typeof t)throw new he(n);return e=lr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ga=Ml(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(ga));l|=32}return Bi(e,l,t,n,i)}),_a=Ml(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(_a));l|=32}return Bi(t,l,e,n,i)});function Sa(e,t,l){var i,o,a,r,u,s,c=0,d=!1,v=!1,p=!0;if("function"!=typeof e)throw new he(n);function m(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function f(e){return c=e,u=go(E,t),d?m(e):r}function h(e){var n=e-s;return void 0===s||n>=t||n<0||v&&e-c>=a}function E(){var e=fa();if(h(e))return g(e);u=go(E,function(e){var n=t-(e-s);return v?an(n,a-(e-c)):n}(e))}function g(e){return u=void 0,p&&i?m(e):(i=o=void 0,r)}function _(){var e=fa(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(v)return ui(u),u=go(E,t),m(s)}return void 0===u&&(u=go(E,t)),r}return t=or(t)||0,za(l)&&(d=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==u&&ui(u),c=0,i=s=o=u=void 0},_.flush=function(){return void 0===u?r:g(fa())},_}var ba=Ml(function(e,t){return $n(e,1,t)}),ya=Ml(function(e,t,n){return $n(e,or(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(Aa.Cache||Rn),l}function Ca(e){if("function"!=typeof e)throw new he(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Rn;var Da=ai(function(e,t){var n=(t=1==t.length&&La(t[0])?st(t[0],wt(Ki())):st(il(t,1),wt(Ki()))).length;return Ml(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ta=Ml(function(e,t){return Bi(e,32,void 0,t,Ut(t,qi(Ta)))}),wa=Ml(function(e,t){return Bi(e,64,void 0,t,Ut(t,qi(wa)))}),Oa=Hi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Na(e,t){return e===t||e!=e&&t!=t}var xa=Pi(pl),Ia=Pi(function(e,t){return e>=t}),Pa=gl(function(){return arguments}())?gl:function(e){return Va(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},La=g.isArray,Ra=Xe?wt(Xe):function(e){return Va(e)&&vl(e)==b};function Fa(e){return null!=e&&Ha(e.length)&&!Wa(e)}function Ma(e){return Va(e)&&Fa(e)}var Ba=en||ou,ka=Je?wt(Je):function(e){return Va(e)&&vl(e)==u};function Ua(e){if(!Va(e))return!1;var t=vl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Wa(e){if(!za(e))return!1;var t=vl(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ja(e){return"number"==typeof e&&e==lr(e)}function Ha(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ya=$e?wt($e):function(e){return Va(e)&&eo(e)==v};function Ga(e){return"number"==typeof e||Va(e)&&vl(e)==p}function qa(e){if(!Va(e)||vl(e)!=m)return!1;var t=He(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Ka=Ze?wt(Ze):function(e){return Va(e)&&vl(e)==f},Xa=Qe?wt(Qe):function(e){return Va(e)&&eo(e)==h};function Ja(e){return"string"==typeof e||!La(e)&&Va(e)&&vl(e)==E}function $a(e){return"symbol"==typeof e||Va(e)&&vl(e)==_}var Za=et?wt(et):function(e){return Va(e)&&Ha(e.length)&&!!Me[vl(e)]},Qa=Pi(Cl),er=Pi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return Ja(e)?zt(e):fi(e);if(mt&&e[mt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[mt]());var t=eo(e);return(t==v?Bt:t==h?Wt:Nr)(e)}function nr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function lr(e){var t=nr(e),n=t%1;return t==t?n?t-n:t:0}function ir(e){return e?Kn(lr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if($a(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=le.test(e);return n||oe.test(e)?We(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ar(e){return hi(e,br(e))}function rr(e){return null==e?"":Xl(e)}var ur=gi(function(e,t){if(so(t)||Fa(t))hi(t,Sr(t),e);else for(var n in t)be.call(t,n)&&Hn(e,n,t[n])}),sr=gi(function(e,t){hi(t,br(t),e)}),cr=gi(function(e,t,n,l){hi(t,br(t),e,l)}),dr=gi(function(e,t,n,l){hi(t,Sr(t),e,l)}),vr=Hi(qn),pr=Ml(function(e,t){e=pe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=br(o),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||Na(c,ge[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),mr=Ml(function(e){return e.push(void 0,Ui),tt(Ar,void 0,e)});function fr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function hr(e,t){return null!=e&&to(e,t,fl)}var Er=wi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Gr)),gr=wi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Ki),_r=Ml(El);function Sr(e){return Fa(e)?Bn(e):Al(e)}function br(e){return Fa(e)?Bn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in pe(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var yr=gi(function(e,t,n){Ol(e,t,n)}),Ar=gi(function(e,t,n,l){Ol(e,t,n,l)}),Cr=Hi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),hi(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)$l(n,t[i]);return n}),Dr=Hi(function(e,t){return null==e?{}:function(e,t){return Il(e,t,function(t,n){return hr(e,n)})}(e,t)});function Tr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Ki(t),Il(e,n,function(e,n){return t(e,n[0])})}var wr=Mi(Sr),Or=Mi(br);function Nr(e){return null==e?[]:Ot(e,Sr(e))}var xr=yi(function(e,t,n){return t=t.toLowerCase(),e+(n?Ir(t):t)});function Ir(e){return Ur(rr(e).toLowerCase())}function Pr(e){return(e=rr(e))&&e.replace(re,Lt).replace(Ne,"")}var Lr=yi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=yi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=bi("toLowerCase"),Mr=yi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Br=yi(function(e,t,n){return e+(n?" ":"")+Ur(t)}),kr=yi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ur=bi("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var jr=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new ce(e)}}),Hr=Hi(function(e,t){return lt(t,function(t){t=To(t),Gn(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Di(),Yr=Di(!0);function Gr(e){return e}function qr(e){return yl("function"==typeof e?e:Xn(e,1))}var Kr=Ml(function(e,t){return function(n){return El(n,e,t)}}),Xr=Ml(function(e,t){return function(n){return El(e,n,t)}});function Jr(e,t,n){var l=Sr(t),i=sl(t,l);null!=n||za(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Sr(t)));var o=!(za(n)&&"chain"in n&&!n.chain),a=Wa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=fi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function $r(){}var Zr=Ni(st),Qr=Ni(ot),eu=Ni(pt);function tu(e){return ao(e)?bt(To(e)):function(e){return function(t){return cl(t,e)}}(e)}var nu=Ii(),lu=Ii(!0);function iu(){return[]}function ou(){return!1}var au,ru=Oi(function(e,t){return e+t},0),uu=Ri("ceil"),su=Oi(function(e,t){return e/t},1),cu=Ri("floor"),du=Oi(function(e,t){return e*t},1),vu=Ri("round"),pu=Oi(function(e,t){return e-t},0);return wn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=lr(e),function(){if(--e<1)return t.apply(this,arguments)}},wn.ary=ha,wn.assign=ur,wn.assignIn=sr,wn.assignInWith=cr,wn.assignWith=dr,wn.at=vr,wn.before=Ea,wn.bind=ga,wn.bindAll=Hr,wn.bindKey=_a,wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},wn.chain=ta,wn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(lr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=g($t(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},wn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},wn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=g(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(La(n)?fi(n):[n],il(t,1))},wn.cond=function(e){var t=null==e?0:e.length,l=Ki();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[l(e[0]),e[1]]}):[],Ml(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},wn.conforms=function(e){return function(e){var t=Sr(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},wn.constant=zr,wn.countBy=ia,wn.create=function(e,t){var n=On(e);return null==t?n:Yn(n,t)},wn.curry=function e(t,n,l){var i=Bi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},wn.curryRight=function e(t,n,l){var i=Bi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},wn.debounce=Sa,wn.defaults=pr,wn.defaultsDeep=mr,wn.defer=ba,wn.delay=ya,wn.difference=No,wn.differenceBy=xo,wn.differenceWith=Io,wn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:lr(t))<0?0:t,l):[]},wn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t):[]},wn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!0,!0):[]},wn.dropWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!0):[]},wn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=lr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:lr(l))<0&&(l+=i),l=n>l?0:ir(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},wn.filter=function(e,t){return(La(e)?at:ll)(e,Ki(t,3))},wn.flatMap=function(e,t){return il(va(e,t),1)},wn.flatMapDeep=function(e,t){return il(va(e,t),1/0)},wn.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},wn.flatten=Ro,wn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},wn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},wn.flip=function(e){return Bi(e,512)},wn.flow=Vr,wn.flowRight=Yr,wn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},wn.functions=function(e){return null==e?[]:sl(e,Sr(e))},wn.functionsIn=function(e){return null==e?[]:sl(e,br(e))},wn.groupBy=sa,wn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},wn.intersection=Mo,wn.intersectionBy=Bo,wn.intersectionWith=ko,wn.invert=Er,wn.invertBy=gr,wn.invokeMap=ca,wn.iteratee=qr,wn.keyBy=da,wn.keys=Sr,wn.keysIn=br,wn.map=va,wn.mapKeys=function(e,t){var n={};return t=Ki(t,3),rl(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},wn.mapValues=function(e,t){var n={};return t=Ki(t,3),rl(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},wn.matches=function(e){return Tl(Xn(e,1))},wn.matchesProperty=function(e,t){return wl(e,Xn(t,1))},wn.memoize=Aa,wn.merge=yr,wn.mergeWith=Ar,wn.method=Kr,wn.methodOf=Xr,wn.mixin=Jr,wn.negate=Ca,wn.nthArg=function(e){return e=lr(e),Ml(function(t){return Nl(t,e)})},wn.omit=Cr,wn.omitBy=function(e,t){return Tr(e,Ca(Ki(t)))},wn.once=function(e){return Ea(2,e)},wn.orderBy=function(e,t,n,l){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(n=l?void 0:n)||(n=null==n?[]:[n]),xl(e,t,n))},wn.over=Zr,wn.overArgs=Da,wn.overEvery=Qr,wn.overSome=eu,wn.partial=Ta,wn.partialRight=wa,wn.partition=pa,wn.pick=Dr,wn.pickBy=Tr,wn.property=tu,wn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},wn.pull=Wo,wn.pullAll=jo,wn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,Ki(n,2)):e},wn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,void 0,n):e},wn.pullAt=Ho,wn.range=nu,wn.rangeRight=lu,wn.rearg=Oa,wn.reject=function(e,t){return(La(e)?at:ll)(e,Ca(Ki(t,3)))},wn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Ki(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Ll(e,i),n},wn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(e,t=void 0===t?t:lr(t))},wn.reverse=zo,wn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(La(e)?Un:kl)(e,t)},wn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},wn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},wn.shuffle=function(e){return(La(e)?Wn:Hl)(e)},wn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:lr(t),n=void 0===n?l:lr(n)),zl(e,t,n)):[]},wn.sortBy=ma,wn.sortedUniq=function(e){return e&&e.length?ql(e):[]},wn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Ki(t,2)):[]},wn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xl(t))&&Mt(e)?ri(zt(e),0,n):e.split(t,n):[]},wn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:on(lr(t),0),Ml(function(n){var l=n[t],i=ri(n,0,t);return l&&ct(i,l),tt(e,this,i)})},wn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},wn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},wn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:lr(t)))<0?0:t,l):[]},wn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!1,!0):[]},wn.takeWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3)):[]},wn.tap=function(e,t){return t(e),e},wn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new he(n);return za(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Sa(e,t,{leading:i,maxWait:t,trailing:o})},wn.thru=na,wn.toArray=tr,wn.toPairs=wr,wn.toPairsIn=Or,wn.toPath=function(e){return La(e)?st(e,To):$a(e)?[e]:fi(Do(rr(e)))},wn.toPlainObject=ar,wn.transform=function(e,t,n){var l=La(e),i=l||Ba(e)||Za(e);if(t=Ki(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?On(He(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},wn.unary=function(e){return ha(e,1)},wn.union=Vo,wn.unionBy=Yo,wn.unionWith=Go,wn.uniq=function(e){return e&&e.length?Jl(e):[]},wn.uniqBy=function(e,t){return e&&e.length?Jl(e,Ki(t,2)):[]},wn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},wn.unset=function(e,t){return null==e||$l(e,t)},wn.unzip=qo,wn.unzipWith=Ko,wn.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},wn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},wn.values=Nr,wn.valuesIn=function(e){return null==e?[]:Ot(e,br(e))},wn.without=Xo,wn.words=Wr,wn.wrap=function(e,t){return Ta(ii(t),e)},wn.xor=Jo,wn.xorBy=$o,wn.xorWith=Zo,wn.zip=Qo,wn.zipObject=function(e,t){return ni(e||[],t||[],Hn)},wn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},wn.zipWith=ea,wn.entries=wr,wn.entriesIn=Or,wn.extend=sr,wn.extendWith=cr,Jr(wn,wn),wn.add=ru,wn.attempt=jr,wn.camelCase=xr,wn.capitalize=Ir,wn.ceil=uu,wn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=or(n))==n?n:0),void 0!==t&&(t=(t=or(t))==t?t:0),Kn(or(e),t,n)},wn.clone=function(e){return Xn(e,4)},wn.cloneDeep=function(e){return Xn(e,5)},wn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},wn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},wn.conformsTo=function(e,t){return null==t||Jn(e,t,Sr(t))},wn.deburr=Pr,wn.defaultTo=function(e,t){return null==e||e!=e?t:e},wn.divide=su,wn.endsWith=function(e,t,n){e=rr(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Kn(lr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},wn.eq=Na,wn.escape=function(e){return(e=rr(e))&&B.test(e)?e.replace(F,Rt):e},wn.escapeRegExp=function(e){return(e=rr(e))&&Y.test(e)?e.replace(V,"\\$&"):e},wn.every=function(e,t,n){var l=La(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Ki(t,3))},wn.find=oa,wn.findIndex=Po,wn.findKey=function(e,t){return ft(e,Ki(t,3),rl)},wn.findLast=aa,wn.findLastIndex=Lo,wn.findLastKey=function(e,t){return ft(e,Ki(t,3),ul)},wn.floor=cu,wn.forEach=ra,wn.forEachRight=ua,wn.forIn=function(e,t){return null==e?e:ol(e,Ki(t,3),br)},wn.forInRight=function(e,t){return null==e?e:al(e,Ki(t,3),br)},wn.forOwn=function(e,t){return e&&rl(e,Ki(t,3))},wn.forOwnRight=function(e,t){return e&&ul(e,Ki(t,3))},wn.get=fr,wn.gt=xa,wn.gte=Ia,wn.has=function(e,t){return null!=e&&to(e,t,ml)},wn.hasIn=hr,wn.head=Fo,wn.identity=Gr,wn.includes=function(e,t,n,l){e=Fa(e)?e:Nr(e),n=n&&!l?lr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Et(e,t,n)>-1},wn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:lr(n);return i<0&&(i=on(l+i,0)),Et(e,t,i)},wn.inRange=function(e,t,n){return t=nr(t),void 0===n?(n=t,t=0):n=nr(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=or(e),t,n)},wn.invoke=_r,wn.isArguments=Pa,wn.isArray=La,wn.isArrayBuffer=Ra,wn.isArrayLike=Fa,wn.isArrayLikeObject=Ma,wn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},wn.isBuffer=Ba,wn.isDate=ka,wn.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},wn.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(La(e)||"string"==typeof e||"function"==typeof e.splice||Ba(e)||Za(e)||Pa(e)))return!e.length;var t=eo(e);if(t==v||t==h)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},wn.isEqual=function(e,t){return _l(e,t)},wn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?_l(e,t,void 0,n):!!l},wn.isError=Ua,wn.isFinite=function(e){return"number"==typeof e&&tn(e)},wn.isFunction=Wa,wn.isInteger=ja,wn.isLength=Ha,wn.isMap=Ya,wn.isMatch=function(e,t){return e===t||Sl(e,t,Ji(t))},wn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Ji(t),n)},wn.isNaN=function(e){return Ga(e)&&e!=+e},wn.isNative=function(e){if(uo(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},wn.isNil=function(e){return null==e},wn.isNull=function(e){return null===e},wn.isNumber=Ga,wn.isObject=za,wn.isObjectLike=Va,wn.isPlainObject=qa,wn.isRegExp=Ka,wn.isSafeInteger=function(e){return ja(e)&&e>=-9007199254740991&&e<=9007199254740991},wn.isSet=Xa,wn.isString=Ja,wn.isSymbol=$a,wn.isTypedArray=Za,wn.isUndefined=function(e){return void 0===e},wn.isWeakMap=function(e){return Va(e)&&eo(e)==S},wn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},wn.join=function(e,t){return null==e?"":nn.call(e,t)},wn.kebabCase=Lr,wn.last=Uo,wn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=lr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ht(e,_t,i,!0)},wn.lowerCase=Rr,wn.lowerFirst=Fr,wn.lt=Qa,wn.lte=er,wn.max=function(e){return e&&e.length?nl(e,Gr,pl):void 0},wn.maxBy=function(e,t){return e&&e.length?nl(e,Ki(t,2),pl):void 0},wn.mean=function(e){return St(e,Gr)},wn.meanBy=function(e,t){return St(e,Ki(t,2))},wn.min=function(e){return e&&e.length?nl(e,Gr,Cl):void 0},wn.minBy=function(e,t){return e&&e.length?nl(e,Ki(t,2),Cl):void 0},wn.stubArray=iu,wn.stubFalse=ou,wn.stubObject=function(){return{}},wn.stubString=function(){return""},wn.stubTrue=function(){return!0},wn.multiply=du,wn.nth=function(e,t){return e&&e.length?Nl(e,lr(t)):void 0},wn.noConflict=function(){return ze._===this&&(ze._=Te),this},wn.noop=$r,wn.now=fa,wn.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?Ht(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return xi(Zt(i),n)+e+xi($t(i),n)},wn.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?Ht(e):0;return t&&l<t?e+xi(t-l,n):e},wn.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?Ht(e):0;return t&&l<t?xi(t-l,n)+e:e},wn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(G,""),t||0)},wn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nr(e),void 0===t?(t=e,e=0):t=nr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Rl(e,t)},wn.reduce=function(e,t,n){var l=La(e)?dt:At,i=arguments.length<3;return l(e,Ki(t,4),n,i,Qn)},wn.reduceRight=function(e,t,n){var l=La(e)?vt:At,i=arguments.length<3;return l(e,Ki(t,4),n,i,el)},wn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Fl(rr(e),t)},wn.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},wn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[To(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},wn.round=vu,wn.runInContext=e,wn.sample=function(e){return(La(e)?kn:Bl)(e)},wn.size=function(e){if(null==e)return 0;if(Fa(e))return Ja(e)?Ht(e):e.length;var t=eo(e);return t==v||t==h?e.size:Al(e).length},wn.snakeCase=Mr,wn.some=function(e,t,n){var l=La(e)?pt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,Ki(t,3))},wn.sortedIndex=function(e,t){return Yl(e,t)},wn.sortedIndexBy=function(e,t,n){return Gl(e,t,Ki(n,2))},wn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Na(e[l],t))return l}return-1},wn.sortedLastIndex=function(e,t){return Yl(e,t,!0)},wn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Ki(n,2),!0)},wn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Na(e[n],t))return n}return-1},wn.startCase=Br,wn.startsWith=function(e,t,n){return e=rr(e),n=null==n?0:Kn(lr(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},wn.subtract=pu,wn.sum=function(e){return e&&e.length?Ct(e,Gr):0},wn.sumBy=function(e,t){return e&&e.length?Ct(e,Ki(t,2)):0},wn.template=function(e,t,n){var l=wn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=cr({},t,l,ki);var i,o,a=cr({},t.imports,l.imports,ki),r=Sr(a),u=Ot(a,r),s=0,c=t.interpolate||ue,d="__p += '",v=me((t.escape||ue).source+"|"+c.source+"|"+(c===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(v,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,Ft),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(I,""):d).replace(P,"$1").replace(L,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=jr(function(){return de(r,p+"return "+d).apply(void 0,u)});if(f.source=d,Ua(f))throw f;return f},wn.times=function(e,t){if((e=lr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Dt(l,t=Ki(t));++n<e;)t(n);return i},wn.toFinite=nr,wn.toInteger=lr,wn.toLength=ir,wn.toLower=function(e){return rr(e).toLowerCase()},wn.toNumber=or,wn.toSafeInteger=function(e){return e?Kn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},wn.toString=rr,wn.toUpper=function(e){return rr(e).toUpperCase()},wn.trim=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ri(l,xt(l,i),It(l,i)+1).join("")},wn.trimEnd=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,0,It(l,zt(t))+1).join("")},wn.trimStart=function(e,t,n){if((e=rr(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ri(l,xt(l,zt(t))).join("")},wn.truncate=function(e,t){var n=30,l="...";if(za(t)){var i="separator"in t?t.separator:i;n="length"in t?lr(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=rr(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-Ht(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),Ka(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=me(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Xl(i),r)!=r){var v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+l},wn.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(R,Yt):e},wn.uniqueId=function(e){var t=++ye;return rr(e)+t},wn.upperCase=kr,wn.upperFirst=Ur,wn.each=ra,wn.eachRight=ua,wn.first=Fo,Jr(wn,(au={},rl(wn,function(e,t){be.call(wn.prototype,t)||(au[t]=e)}),au),{chain:!1}),wn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){wn[e].placeholder=wn}),lt(["drop","take"],function(e,t){In.prototype[e]=function(n){n=void 0===n?1:on(lr(n),0);var l=this.__filtered__&&!t?new In(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}}),In.prototype.compact=function(){return this.filter(Gr)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new In(this):this.map(function(n){return El(n,e,t)})}),In.prototype.reject=function(e){return this.filter(Ca(Ki(e)))},In.prototype.slice=function(e,t){e=lr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=lr(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},rl(In.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=wn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(wn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof In,u=a[0],s=r||La(t),c=function(e){var t=i.apply(wn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,v=!!this.__actions__.length,p=o&&!d,m=r&&!v;if(!o&&s){t=m?t:new In(this);var f=e.apply(t,a);return f.__actions__.push({func:na,args:[c],thisArg:void 0}),new xn(f,d)}return p&&m?e.apply(this,a):(f=this.thru(c),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);wn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),rl(In.prototype,function(e,t){var n=wn[t];if(n){var l=n.name+"";be.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,v=0,p=an(u,this.__takeCount__);if(!n||!l&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,h=e[s+=t];++f<d;){var E=c[f],g=E.type,_=(0,E.iteratee)(h);if(2==g)h=_;else if(!_){if(1==g)continue e;break e}}m[v++]=h}return m},wn.prototype.at=la,wn.prototype.chain=function(){return ta(this)},wn.prototype.commit=function(){return new xn(this.value(),this.__chain__)},wn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},wn.prototype.plant=function(e){for(var t,n=this;n instanceof Nn;){var l=Oo(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:na,args:[zo],thisArg:void 0}),new xn(t,this.__chain__)}return this.thru(zo)},wn.prototype.toJSON=wn.prototype.valueOf=wn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},wn.prototype.first=wn.prototype.head,mt&&(wn.prototype[mt]=function(){return this}),wn}();Ye?((Ye.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(g)});const mn=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],v=Digit.ULBService.getStateId(),[p,m]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,h]=n.useState(null),[E,g]=n.useState([]),[_,S]=n.useState(!0),[b,y]=n.useState(!1),[A,C]=n.useState(!1),{isLoading:D,data:T}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:w,data:O}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let s=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==O||null===(t=O["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!D,!w]),n.useEffect(()=>{let e=0;E.map(t=>{let n=!1;p.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(p.length>0))},[p,b]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==E?void 0:E.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(fn,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:m,documents:p,setCheckRequiredFields:y,applicationStatus:c,actions:d,bpaTaxDocuments:E,checkEnablingDocs:A}))))};function fn(e){var i,o;let{t:a,document:r,setDocuments:s,documents:c,index:d,bpaTaxDocuments:v,checkEnablingDocs:p}=e;const m=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[h,E]=n.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,_]=n.useState(null),[S,b]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[y,A]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&s(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==h?void 0:h.code,fileStoreId:S,documentUid:S,fileName:(null==g?void 0:g.name)||"",id:c?null===(t=c.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[S,h]),n.useEffect(()=>{try{y.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],y.map(e=>{var t,n,l;null!=h&&h.code&&r.newUploadedDocs.push({documentType:null==h?void 0:h.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),v[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[y,h]),n.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(pn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:h,optionKey:"i18nKey",select:e=>E(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&A(l),(i=l[l.length-1])&&_(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function hn(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,s,c,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(pn,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function En(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,v]=n.useState(),[p,m]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==p?void 0:p.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=_t(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&m(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const gn=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==s?void 0:s.status)||"",m=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,_]=n.useState([]),[S,b]=n.useState([]),[y,A]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,w]=n.useState(null),O=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(null==E||null===(e=E["common-masters"])||void 0===e?void 0:e.DocumentType)},[E]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,c,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),b(v))},[f,g]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[s,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:O?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:O?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(pn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),y&&(null==S?void 0:S.map((e,t)=>l.createElement(En,{key:t,document:e,t:o,error:T,setError:w,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:y}))))},_n=e=>{let{permissions:i,t:o}=e;const[a,r,s]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[c,d,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==c?void 0:c.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==c?void 0:c.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...c,{label:""}])}}))};function Sn(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:a}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function bn(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function yn(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=o.useTranslation(),r=(null==n?void 0:n.length)||1;let s={marginTop:"19px"},c={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?s={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(s={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(s=u({},s,{maxWidth:"950px"}),s=u({},s,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:s,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:c},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const An=e=>{var i,a,r,u,s,c,d,v,p,m,f,h,E,g,_,S,b,y,A,C,D,T,w;let{scrutinyDetails:O,paymentsList:N=[],additionalDetails:x,applicationData:I}=e;const P=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==I?void 0:I.status))&&window.location.href.includes("bpa"),[L,R]=n.useState(),[F,M]=n.useState(),[B,k]=n.useState(),U=Digit.ULBService.getStateId(),[W,j]=n.useState(),[H,z]=n.useState(),[V,Y]=n.useState([]),[G,q]=n.useState(),[K,X]=n.useState(""),[J,$]=n.useState(null),[Z,Q]=n.useState({}),ee={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[te,ne]=n.useState(!1),[le,ie]=n.useState(!1);n.useEffect(()=>{!function(){try{$(null);const e=function(){if(G&&null!=G&&G.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(G.size>=2e6)$(oe("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=_t(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?Y([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):$(oe("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else $(oe("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=x&&null!==(e=x.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==x?void 0:x.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==x||null===(n=x.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==x||null===(l=x.lessAdjustmentFeeFiles[(null==x||null===(i=x.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,U).then(e=>Q(null==e?void 0:e.data))}R(null==x||null===(t=x.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==x||null===(n=x.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),M(null==x||null===(l=x.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==x||null===(i=x.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),k(null==x||null===(o=x.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==x||null===(a=x.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),j(null==x?void 0:x.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==x?void 0:x.otherFeesDiscription),Y(null==x?void 0:x.lessAdjustmentFeeFiles)},[x]);const{t:oe}=o.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},oe(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?oe(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void oe("NA");return l.createElement(n.Fragment,null,!(null!=O&&O.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==O||null===(i=O.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+oe(""+e.title),text:null!=e&&e.value?ae(e)+" "+oe(null==e?void 0:e.isUnit):oe("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+oe(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},oe(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},oe(null==e?void 0:e.title))),null==O||null===(a=O.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(r=O.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ie(!0)}},oe("SHOW_P1_FEES_DETAILS"))),le&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ie(!1)}},oe("HIDE_P1_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,oe("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:oe("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==x?void 0:x.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:oe("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==x?void 0:x.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==O||null===(u=O.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},oe("SHOW_P2_FEES_DETAILS"))),te&&l.createElement("div",{style:ee.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},oe("HIDE_P2_FEES_DETAILS"))),te&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,oe("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:oe("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==x||null===(s=x.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:oe("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==x||null===(c=x.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:oe("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==x||null===(d=x.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:oe("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==x||null===(v=x.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,oe("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,oe("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==x||null===(p=x.selfCertificationCharges)||void 0===p?void 0:p.BPA_DEVELOPMENT_CHARGES)||0,value:L,disabled:!P,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(R(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,oe("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==x||null===(m=x.selfCertificationCharges)||void 0===m?void 0:m.BPA_OTHER_CHARGES)||0,value:F,disabled:!P,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,oe("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:oe,type:"text",name:"otherChargesDiscription",defaultValue:null==x||null===(f=x.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!P,onChange:e=>{!function(e){j(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,oe("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:oe,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==x||null===(h=x.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!P,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(L)?parseFloat(L):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==x||null===(t=x.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==x||null===(n=x.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==x||null===(l=x.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==x||null===(i=x.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(k(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>0&&P?l.createElement("div",null,l.createElement(t.CardLabel,null,oe("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),q(e.target.files[0])},disabled:!P,onDelete:()=>{z(null),q("")},message:H?"1 "+oe("FILEUPLOADED"):oe("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:K})):null,(null==Z||null===(E=Z.fileStoreIds)||void 0===E?void 0:E.length)&&parseInt(null==x||null===(g=x.selfCertificationCharges)||void 0===g?void 0:g.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},oe("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Z||null===(_=Z.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==x||null===(S=x.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Z||null===(b=Z.fileStoreIds[(null==Z||null===(y=Z.fileStoreIds)||void 0===y?void 0:y.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:oe("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(L)?parseFloat(L):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==x||null===(A=x.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==x||null===(C=x.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==x||null===(D=x.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==x||null===(T=x.selfCertificationCharges)||void 0===T?void 0:T.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(B)?parseFloat(B):0))}))),l.createElement("div",null,null==O||null===(w=O.scruntinyDetails)||void 0===w?void 0:w.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+oe(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},oe(null==e?void 0:e.text))))))))},Cn=e=>{var i,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:v}=o.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>m.map(e=>({Header:v(""+e.name),accessor:f(e.id),id:e.id})));function E(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r,u,s;n.push({Floor:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+v("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==c||null===(i=c.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==c||null===(a=c.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==c||null===(i=c.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:E(e),columns:h,getCellProps:e=>({style:{}})})))})))},Dn=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Tn=e=>{var i,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,v]=n.useState(!1),{t:p}=o.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,p("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Dn,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{v(!0)},style:{color:"#800000"}},p("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},p("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,p("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function wn(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function On(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Nn=e=>{var i,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=o.useTranslation();let v=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const m=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails:E,roadCuttingAddlDetails:g,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(i=c.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},xn=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],In=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Pn=e=>{var i,a,r,s;let{wsAdditionalDetails:c}=e;const{t:d}=o.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,h,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==c||null===(i=c.additionalDetails)||void 0===i||!i.isPaid),[S,b]=n.useState(!1),[y,A]=n.useState(v||{}),[C,D]=n.useState(null),[T,w]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[O,N]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),x=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(x,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==c||null===(e=c.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,s,d,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(r=v.billDetails)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(d=v.billDetails)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount)}];N(e),w(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else p(i),A(i)},[]);let I={};const P=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),F=function(e,t,n){void 0===t&&(t=!1);let l=u({},y);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}A(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},O&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==O?void 0:O.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==T?void 0:T.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=c&&null!==(a=c.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{b(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(P,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{A(v),b(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{A(v),b(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=y&&y.adhocPenalty?Number(null==y?void 0:y.adhocPenalty):0,n=null!=y&&y.adhocRebate?Number(null==y?void 0:y.adhocRebate):0;var l,i;if(t||n)if(n>(null==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,s,v,m,f,E,g,S;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==c||null===(r=c.additionalDetails)||void 0===r||null===(s=r.appDetails)||void 0===s?void 0:s.tenantId,n=u({},null==c||null===(v=c.additionalDetails)||void 0===v||null===(m=v.appDetails)||void 0===m?void 0:m.additionalDetails,y);c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(f=c.additionalDetails)||void 0===f||null===(E=f.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(g=c.additionalDetails)||void 0===g||null===(S=g.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,m,f,E,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.taxAmount}];h(mt(e.Calculation[0])),w(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),N(S),y.billDetails=null==e?void 0:e.Calculation,p(y),b(!1)}).catch(e=>{var t,n,l,i,o,a;D({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:xn,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==y?void 0:y.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==y||null===(r=y.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==y?void 0:y.adhocPenaltyComment)||"",onChange:e=>F("adhocPenaltyComment",!1,e)},I={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==y?void 0:y.adhocPenalty)||"",onChange:e=>F("adhocPenalty",!1,e)},I={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:In,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==y?void 0:y.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==y||null===(s=y.adhocRebateReason_data)||void 0===s?void 0:s.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==y?void 0:y.adhocRebateComment)||"",onChange:e=>F("adhocRebateComment",!1,e)},I={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==y?void 0:y.adhocRebate)||"",onChange:e=>F("adhocRebate",!1,e)},I={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},Ln=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Rn=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Ln,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Fn=e=>{var i,a,r,u,s,c,d;let{wsAdditionalDetails:v}=e;const{t:p}=o.useTranslation(),[m,f]=n.useState(!1),[h,E]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),E(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:p("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_APPLICATION_FEE_HEADER")),null==h||null===(a=h.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Mn={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Bn=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:a=0}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Mn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Mn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},Mn.cell,Mn.cellLeft,Mn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},Mn.cell,n.length==t+1?Mn.cellRight:{},Mn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},Mn.cell,Mn.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,i)=>l.createElement("td",{style:u({},Mn.cell,{textAlign:"left"},n.length==i+1?Mn.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},Mn.cell,Mn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},Mn.cell,Mn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:u({},Mn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Mn.cell,key:t,numeric:!0})))))))},kn={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Un=e=>{var t,i,a;let{bill:r={}}=e;const{t:u}=o.useTranslation();let s={},c=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(i=c)||void 0===i?void 0:i.reduce((e,t,n)=>e+t.amount,0))||0;let v="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let p={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{p[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[f,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:kn.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Bn,{headers:[...m],values:s,arrears:v}),!f&&l.createElement("div",{style:kn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:kn.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))},Wn=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},jn=e=>{var t;let{applicationData:o}=e;const[a,r]=n.useState(!1);return i.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=o.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Hn=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function zn(e){var a,r,s,c,d,v,p,m,f,h,E,g,S,b,y,A;let{applicationDetails:C,demandData:D,workflowDetails:T,isDataLoading:w,applicationData:O,timelineStatusPrefix:N,showTimeLine:x=!0,statusAttribute:I="status",paymentsList:P,oldValue:L,isInfoLabel:R=!1,propertyId:F}=e;const{t:M}=o.useTranslation(),B=i.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[U,W]=n.useState(null),[j,H]=n.useState([]);let z=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function V(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",C);const[Y,G]=n.useState({}),[q,K]=n.useState(),[X,J]=n.useState([]),[$,Z]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==O?void 0:O.status)||$.loading||$.loaded||$.canLoad||Z({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(Z({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return J(o),console.log(o),K(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==O?void 0:O.tenantId)||k,null==O?void 0:O.propertyId,G,Z));const Q=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},ee=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:Q(null==O||null===(i=O.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==O?void 0:O.channel)||""};return l.createElement(Tn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s,c,d,v,p,m,f,h,E,g,S,b,y,A;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},D=n[t-1],T={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==O||null===(c=O.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=O&&null!==(f=O.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(E=h[0])&&void 0!==E&&E.mobileNumber?null==O||null===(g=O.processInstance)||void 0===g||null===(S=g.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(A=y[0])||void 0===A?void 0:A.mobileNumber,comment:M(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Tn,{data:T,OpenImage:V,privacy:i})}{var D,T,w,N,x;const t={date:Q(null==O||null===(D=O.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(T=e.assignes)||void 0===T||null===(w=T[0])||void 0===w?void 0:w.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(N=e.assignes)||void 0===N||null===(x=N[0])||void 0===x?void 0:x.mobileNumber};return l.createElement(Tn,{data:t})}},te=(e,t)=>e?t?e:M(e):M("NA"),ne=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/noc"),ie=window.location.href.includes("employee/obps"),oe=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ae=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+M(null==e?void 0:e.isUnit):M("N/A"):null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):M("N/A"),[re,ue]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const se=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=u({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:u({},e.additionalDetails,{propertytobestatus:t}),workflow:u({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:u({},l)},k,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ce=null==C?void 0:C.applicationData,de=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",ve=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C),console.log("infolabel",R),console.log("assessment details",q),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:k,filters:{consumerCodes:F},auth:!0}).then(e=>{H(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(Rn,{t:M,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==C||null===(s=C.applicationDetails)||void 0===s?void 0:s.map((e,o)=>{var a,r,u,s,c,d,v,p,m,f,h,E,g,_,S,b,y,A,D,w,O,N,x,I,R,F,B,k,U,W,j,H,V,G,q,K,X,J;return l.createElement(l.Fragment,{key:o},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:ne?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&ne?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},le?""+M(e.title):M(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},M(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},M(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},M(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},M(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,o)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:M(n.title),label:M(n.title),text:l.createElement("img",{src:M(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:M(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==n?void 0:n.title)))):le||ie?""+M(n.title):M(n.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:oe(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+M(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:M(n.title),label:M(n.title),text:ae(n),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:oe(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Un,{bill:null===(r=Y.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(An,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(s=C.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(hn,{fiReport:null==C||null===(p=C.applicationData)||void 0===p||null===(m=p.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(bn,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(yn,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units)&&l.createElement(On,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(wn,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories}),!z&&(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(w=D.nextActions)||void 0===w?void 0:w.length)>0&&l.createElement(_n,{applicationData:null==C?void 0:C.applicationData,t:M,permissions:null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(mn,{t:M,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.noc)&&l.createElement(gn,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(I=e.additionalDetails)||void 0===I?void 0:I.data,bpaActionsDetails:T}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(An,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(An,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(Cn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&l.createElement(pn,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(Sn,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Nn,{wsAdditionalDetails:e,oldValue:L}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(V=e.additionalDetails)||void 0===V||null===(G=V.redirectUrl)||void 0===G?void 0:G.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(q=e.additionalDetails)||void 0===q||null===(K=q.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Pn,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(Fn,{wsAdditionalDetails:e,workflowDetails:T}))}),(null==q?void 0:q.length)>0&&l.createElement(Wn,{assessmentData:X}),l.createElement(Hn,{payments:j}),l.createElement(jn,{applicationData:null==C?void 0:C.applicationData}),x&&(null==T||null===(c=T.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||w)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!w&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},M("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(v=T.data)&&void 0!==v&&v.timeline&&1===(null==T||null===(p=T.data)||void 0===p||null===(m=p.timeline)||void 0===m?void 0:m.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+N+(null==T||null===(f=T.data)||void 0===f||null===(h=f.timeline[0])||void 0===h?void 0:h.state)),customChild:ee(null==T||null===(E=T.data)||void 0===E?void 0:E.timeline[0],null==T||null===(g=T.data)||void 0===g?void 0:g.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(S=T.data)||void 0===S?void 0:S.timeline)&&(null==T||null===(b=T.data)||void 0===b?void 0:b.timeline.slice(0,re?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,c,d,v;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=T&&null!==(c=T.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(v=d.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:M(""+N+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I])+a),customChild:ee(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(y=T.data)||void 0===y||null===(A=y.timeline)||void 0===A?void 0:A.length)>2&&l.createElement(t.LinkButton,{label:M(re?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ue(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==ve?se(ce,"ACTIVE",de):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==ve?se(ce,"INACTIVE",de):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&B.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&B.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),U&&l.createElement(t.Toast,{error:U.isError,label:M(U.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function Vn(e){var n,i,o,a,r,u,s,c,d,v,p,m,f,h,E,g,_,S;let{t:b,showToast:y,closeToast:A,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var D;let e="";switch(null==y||null===(D=y.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==y?void 0:y.key)?null==y||null===(n=y.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==y?void 0:y.key)?null==y||null===(i=y.error)||void 0===i?void 0:i.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==y?void 0:y.key)?null==y||null===(o=y.error)||void 0===o?void 0:o.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==y?void 0:y.key)?null==y||null===(a=y.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==y?void 0:y.key)?null==y||null===(r=y.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==y?void 0:y.key)?null==y||null===(u=y.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==y?void 0:y.key)?null==y||null===(s=y.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==y?void 0:y.key)?null==y||null===(c=y.error)||void 0===c?void 0:c.message:b("ES_"+C+"_"+(null==y||null===(d=y.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:e,onClose:A}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var T;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?b(e[1]):b(e[0]),n};let n="";switch(null==y||null===(T=y.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==y?void 0:y.key)?null==y||null===(v=y.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(p=y.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==y?void 0:y.key)?null==y||null===(m=y.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==y?void 0:y.key)?null==y||null===(f=y.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==y?void 0:y.key)?null==y||null===(h=y.error)||void 0===h?void 0:h.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==y?void 0:y.key)?null==y||null===(E=y.error)||void 0===E?void 0:E.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==y?void 0:y.key)?null==y||null===(g=y.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==y?void 0:y.key)?null==y||null===(_=y.error)||void 0===_?void 0:_.message:b("ES_"+C+"_"+(null==y||null===(S=y.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:n,onClose:A}))}{var w,O;const e="error"===(null==y?void 0:y.key)?null==y||null===(w=y.error)||void 0===w?void 0:w.message:"ES_"+C+"_"+(null==y||null===(O=y.action)||void 0===O?void 0:O.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,y&&l.createElement(t.Toast,{error:"error"===y.key,label:b(e),onClose:A}))}}function Yn(e){var i,a,r,s,c,d,v,p,m,f,h,E,g,_,S,b;let{workflowDetails:y,displayMenu:A,onActionSelect:C,setDisplayMenu:D,businessService:T,forcedActionPrefix:w,ActionBarStyle:O={},MenuStyle:N={}}=e;const{t:x}=o.useTranslation();let I=Digit.UserService.getUser();const P=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};I=null==t?void 0:t.value}const L=null===(i=I)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,F=!1,M=(null==y||null===(s=y.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(d=c.nextActions)||void 0===d?void 0:d.filter(e=>(null==L?void 0:L.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==y||null===(v=y.data)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==L?void 0:L.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(P,()=>{D(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(m=M[0])&&void 0!==m&&null!==(f=m.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(F=!1,R=!0):(null==M?void 0:M.length)>0&&(F=!0,R=!1),l.createElement(l.Fragment,null,!(null!=y&&y.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:u({},O)},A&&(null!=y&&null!==(h=y.data)&&void 0!==h&&null!==(E=h.actionState)&&void 0!==E&&E.nextActions||null!=y&&null!==(g=y.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:w||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:M,optionKey:"action",t:x,onSelect:C,style:N}):null,l.createElement(t.SubmitBar,{ref:P,label:x("WF_TAKE_ACTION"),onSubmit:()=>D(!A)})),!(null!=y&&y.isLoading)&&!F&&R&&l.createElement(t.ActionBar,{style:u({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(_=M[0])||void 0===_?void 0:_.action,value:null==M||null===(S=M[0])||void 0===S?void 0:S.action,onClick:e=>{C((null==M?void 0:M[0])||{})}},x((w||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()))+"_"+(null==M||null===(b=M[0])||void 0===b?void 0:b.action)))))}const Gn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null));function Kn(e){let{action:n,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(qn,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Xn=e=>{var r,s;console.log("props",e);let c=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:m}=o.useTranslation(),f=i.useHistory();let{id:h}=i.useParams();const[E,g]=n.useState(!1),[_,S]=n.useState(null),[b,y]=n.useState(!1),[A,C]=n.useState(!1),[D,T]=n.useState(!1),{data:w}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:O,demandData:N,totalDemandTax:x,totalBalanceTax:I,showToast:P,setShowToast:L,isLoading:R,isDataLoading:F,applicationData:M,mutate:B,nocMutation:k,workflowDetails:U,id:W,businessService:j,closeToast:H,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:Y,statusAttribute:G,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:J=!0,oldValue:$,isInfoLabel:Z=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{P&&U.revalidate()},[P]);const te=a.useQueryClient(),ne=()=>{S(null),y(!1)};return R||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(zn,{applicationDetails:O,demandData:N,id:W,workflowDetails:U,isDataLoading:F,applicationData:M,totalDemandTax:x,totalBalanceTax:I,businessService:j,timelineStatusPrefix:V,statusAttribute:G,paymentsList:X,showTimeLine:J,oldValue:$,isInfoLabel:Z,propertyId:ee}),b?l.createElement(vn,{t:m,action:_,tenantId:d,state:v,id:h,applicationDetails:O,applicationData:null==O?void 0:O.applicationData,closeModal:ne,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,s,c,d,v,p,h,E,g,S,b,y,A,D,T){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.action)?0==(null==e||null===(c=e.Licenses)||void 0===c||null===(d=c[0])||void 0===d||null===(v=d.additionalDetail)||void 0===v||null===(p=v.validityYears)||void 0===p?void 0:p.length):0==(null==e||null===(h=e.Licenses)||void 0===h||null===(E=h[0])||void 0===E||null===(g=E.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.SewerageConnection)||void 0===y||null===(A=y.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(T=D.comment)||void 0===T?void 0:T.length)){var w,O;"INITIATE"===(null==e||null===(w=e.Licenses)||void 0===w||null===(O=w[0])||void 0===O?void 0:O.action)?alert(m("Please fill in the validity before submitting")):alert(m("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,s){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(s=r.workflow)||void 0===s?void 0:s.action)){function c(t){if(l)return t;B&&(C(!0),B(e,{onError:(e,t)=>{C(!1),L({key:"error",error:e}),setTimeout(H,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=_,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,v,p,h,E,g;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(v=d.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(h=p.workflow)&&void 0!==h&&h.action.includes("APPROVE")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(g=E.workflow)&&void 0!==g&&g.action.includes("REJECT")&&L({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return L({key:"success",action:_}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));L({key:"success",action:_}),Q&&setTimeout(Q,3e3),setTimeout(H,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&k){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=_t(function(){return C(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,s,c,d,v,p;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?m(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(v=d.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.message)||e;ne(),L({key:"error",error:{message:f}}),setTimeout(H,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(c):c(i)}alert(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(s=p.BPA)||void 0===s?void 0:s.BlockReason}):null,D?l.createElement(Kn,{action:_,workflowDetails:U,businessService:j,isWarningPop:D,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(Vn,{t:m,showToast:P,closeToast:H,businessService:j}),l.createElement("div",null,c?l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==w||null===(t=w.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==O||null===(n=O.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==O||null===(o=O.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,a,r,s,c,v,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(p=v.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,d)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Yn,{workflowDetails:U,displayMenu:E,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,s;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(s=location)||void 0===s?void 0:s.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var c,d;f.push(""+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var v;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(v=e.redirectionUrll)||void 0===v?void 0:v.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),y(!0);else{var p,m;f.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:u({},null===(m=e.redirectionUrl)||void 0===m?void 0:m.state)})}else y(!0);S(e),g(!1)},setDisplayMenu:g,businessService:j,forcedActionPrefix:Y,ActionBarStyle:q,MenuStyle:K}))))};function Jn(e){var i;let{t:o,document:a,setNocDocuments:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],c=Digit.ULBService.getStateId(),[d,v]=n.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[p,m]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{null!=d&&d.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==d?void 0:d.code,fileStoreId:f,documentUid:f,fileName:(null==p?void 0:p.name)||""}])},[f,d]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),l.createElement("div",{className:"field"},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t),l=n&&(null==n?void 0:n.map(e=>{var t,n,l;return{documentType:null==d?void 0:d.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,fileName:(null==e||null===(l=e.file)||void 0===l?void 0:l.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(l)),(i=n[n.length-1])&&m(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const $n=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),l.createElement(t.SearchField,null,l.createElement("label",null,r("NOC_BPA_APPLICATION_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Zn=e=>{let{statuses:i,isInboxLoading:a,controlFilterForm:u,setFilterFormValue:s,applicationTypesOfBPA:c}=e;const{t:d}=o.useTranslation(),p=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);null==c||c.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)});const m=r.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(n.Fragment,null,l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"assignee",control:u,render:e=>l.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:p.filter(t=>t.code===e.value)[0],optionsKey:"name",options:p})})),l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"businessService",control:u,render:e=>l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("BUSINESS_SERVICE")),l.createElement(t.RadioButtons,{onSelect:t=>{s("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:v()||[]}))})),m?l.createElement(t.FilterFormField,null,l.createElement(r.Controller,{name:"applicationStatus",control:u,render:e=>{const o=n.useMemo(()=>{var n;return null==i||null===(n=i.filter(e=>e.businessservice===m.code))||void 0===n?void 0:n.map(n=>{var i;return l.createElement(t.CheckBox,{onChange:t=>{var l;return function(t){e.onChange(t)}(t.target.checked?[...e.value,null==n?void 0:n.statusid]:null===(l=e.value)||void 0===l?void 0:l.filter(e=>e!==(null==n?void 0:n.statusid)))},checked:null===(i=e.value)||void 0===i?void 0:i.includes(null==n?void 0:n.statusid),label:d("WF_"+n.businessservice+"_"+n.applicationstatus.split("_").pop())+" ("+n.count+")"})})},[e.value,i,m]);return l.createElement(n.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},d("ACTION_TEST_APPLICATION_STATUS")),a?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,o))}})):null)};function Qn(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function el(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function tl(e){el(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function nl(e,t){el(2,arguments);var n=tl(e).getTime(),l=Qn(t);return new Date(n+l)}function ll(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function il(e){return el(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function ol(e){if(el(1,arguments),!il(e)&&"number"!=typeof e)return!1;var t=tl(e);return!isNaN(Number(t))}var al={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function rl(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,l=e.formats[n]||e.formats[e.defaultWidth];return l}}var ul={date:rl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rl({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function cl(e){return function(t,n){var l,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;l=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;l=e.values[u]||e.values[r]}return l[e.argumentCallback?e.argumentCallback(t):t]}}function dl(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.width,i=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?pl(u,function(e){return e.test(r)}):vl(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(s):s,a=n.valueCallback?n.valueCallback(a):a;var c=t.slice(r.length);return{value:a,rest:c}}}function vl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function pl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var ml,fl={code:"en-US",formatDistance:function(e,t,n){var l,i=al[e];return l="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+l:l+" ago":l},formatLong:ul,formatRelative:function(e,t,n,l){return sl[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),l=n%100;if(l>20||l<10)switch(l%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:cl({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:cl({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:cl({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:cl({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:cl({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ml={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(ml.matchPattern);if(!n)return null;var l=n[0],i=e.match(ml.parsePattern);if(!i)return null;var o=ml.valueCallback?ml.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:dl({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:dl({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:dl({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:dl({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:dl({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function hl(e,t){el(2,arguments);var n=Qn(t);return nl(e,-n)}function El(e){el(1,arguments);var t=1,n=tl(e),l=n.getUTCDay(),i=(l<t?7:0)+l-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function gl(e){el(1,arguments);var t=tl(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=El(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=El(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function _l(e){el(1,arguments);var t=gl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=El(n);return l}function Sl(e,t){el(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:Qn(i),a=null==n.weekStartsOn?o:Qn(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=tl(e),u=r.getUTCDay(),s=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-s),r.setUTCHours(0,0,0,0),r}function bl(e,t){el(1,arguments);var n=tl(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:Qn(a),u=null==i.firstWeekContainsDate?r:Qn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(l+1,0,u),s.setUTCHours(0,0,0,0);var c=Sl(s,t),d=new Date(0);d.setUTCFullYear(l,0,u),d.setUTCHours(0,0,0,0);var v=Sl(d,t);return n.getTime()>=c.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function yl(e,t){el(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:Qn(i),a=null==n.firstWeekContainsDate?o:Qn(n.firstWeekContainsDate),r=bl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Sl(u,t);return s}function Al(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Cl={G:function(e,t,n){var l=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(l,{width:"abbreviated"});case"GGGGG":return n.era(l,{width:"narrow"});case"GGGG":default:return n.era(l,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var l=e.getUTCFullYear();return n.ordinalNumber(l>0?l:1-l,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),l=n>0?n:1-n;return Al("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=bl(e,l),o=i>0?i:1-i;return"YY"===t?Al(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):Al(o,t.length)},R:function(e,t){return Al(gl(e),t.length)},u:function(e,t){return Al(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(l);case"QQ":return Al(l,2);case"Qo":return n.ordinalNumber(l,{unit:"quarter"});case"QQQ":return n.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(l,{width:"wide",context:"formatting"})}},q:function(e,t,n){var l=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(l);case"qq":return Al(l,2);case"qo":return n.ordinalNumber(l,{unit:"quarter"});case"qqq":return n.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(l,{width:"wide",context:"standalone"})}},M:function(e,t,n){var l=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Al(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(l+1,{unit:"month"});case"MMM":return n.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(l,{width:"wide",context:"formatting"})}},L:function(e,t,n){var l=e.getUTCMonth();switch(t){case"L":return String(l+1);case"LL":return Al(l+1,2);case"Lo":return n.ordinalNumber(l+1,{unit:"month"});case"LLL":return n.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(l,{width:"wide",context:"standalone"})}},w:function(e,t,n,l){var i=function(e,t){el(1,arguments);var n=tl(e),l=Sl(n,t).getTime()-yl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):Al(i,t.length)},I:function(e,t,n){var l=function(e){el(1,arguments);var t=tl(e),n=El(t).getTime()-_l(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Al(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Al(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){el(1,arguments);var t=tl(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var l=t.getTime(),i=n-l;return Math.floor(i/864e5)+1}(e);return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):Al(l,t.length)},E:function(e,t,n){var l=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(l,{width:"short",context:"formatting"});case"EEEE":default:return n.day(l,{width:"wide",context:"formatting"})}},e:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Al(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,l){var i=e.getUTCDay(),o=(i-l.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Al(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var l=e.getUTCDay(),i=0===l?7:l;switch(t){case"i":return String(i);case"ii":return Al(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(l,{width:"short",context:"formatting"});case"iiii":default:return n.day(l,{width:"wide",context:"formatting"})}},a:function(e,t,n){var l=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var l,i=e.getUTCHours();switch(l=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var l,i=e.getUTCHours();switch(l=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var l=e.getUTCHours()%12;return 0===l&&(l=12),n.ordinalNumber(l,{unit:"hour"})}return function(e,t){return Al(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Al(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Al(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Al(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Al(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Al(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Al(Math.floor(l*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Tl(i);case"XXXX":case"XX":return wl(i);case"XXXXX":case"XXX":default:return wl(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Tl(i);case"xxxx":case"xx":return wl(i);case"xxxxx":case"xxx":default:return wl(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Dl(i,":");case"OOOO":default:return"GMT"+wl(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Dl(i,":");case"zzzz":default:return"GMT"+wl(i,":")}},t:function(e,t,n,l){return Al(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Al((l._originalDate||e).getTime(),t.length)}};function Dl(e,t){var n=e>0?"-":"+",l=Math.abs(e),i=Math.floor(l/60),o=l%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+Al(o,2)}function Tl(e,t){return e%60==0?(e>0?"-":"+")+Al(Math.abs(e)/60,2):wl(e,t)}function wl(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+Al(Math.floor(i/60),2)+n+Al(i%60,2)}function Ol(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Nl(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var xl={p:Nl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return Ol(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Ol(i,t)).replace("{{time}}",Nl(o,t))}},Il=["D","DD"],Pl=["YY","YYYY"];function Ll(e){return-1!==Il.indexOf(e)}function Rl(e){return-1!==Pl.indexOf(e)}function Fl(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Ml=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kl=/^'([^]*?)'?$/,Ul=/''/g,Wl=/[a-zA-Z]/;function jl(e,t,n){el(2,arguments);var l=String(t),i=n||{},o=i.locale||fl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:Qn(a),u=null==i.firstWeekContainsDate?r:Qn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=o.options&&o.options.weekStartsOn,c=null==s?0:Qn(s),d=null==i.weekStartsOn?c:Qn(i.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var v=tl(e);if(!ol(v))throw new RangeError("Invalid time value");var p=ll(v),m=hl(v,p),f={firstWeekContainsDate:u,weekStartsOn:d,locale:o,_originalDate:v},h=l.match(Bl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,xl[t])(e,o.formatLong,f):e}).join("").match(Ml).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return Hl(n);var a=Cl[l];if(a)return!i.useAdditionalWeekYearTokens&&Rl(n)&&Fl(n,t,e),!i.useAdditionalDayOfYearTokens&&Ll(n)&&Fl(n,t,e),a(m,n,o.localize,f);if(l.match(Wl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return h}function Hl(e){return e.match(kl)[1].replace(Ul,"'")}const zl=e=>{var i,a;const{register:u,control:s,setValue:c,getValues:d,reset:p,formState:m}=r.useFormContext(),{t:f}=o.useTranslation(),h=v();return l.createElement(n.Fragment,null,l.createElement(t.SearchField,null,l.createElement("label",null,f("NOC_APP_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,f("NOC_SOURCE_MODULE_NUMBER")),l.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),l.createElement(t.SearchField,null,l.createElement("label",null,f("NOC_TYPE_LABEL")),l.createElement(r.Controller,{control:s,name:"nocType",render:e=>l.createElement(t.Dropdown,{selected:1==(null==h?void 0:h.length)?h[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:h||[],optionKey:"i18nKey",t:f,disable:1==(null==h?void 0:h.length)})})),l.createElement(t.SearchField,null,l.createElement("label",null,f("NOC_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:f("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,f("NOC_NUMBER_LABEL")),l.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:f("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;c("applicationNo",null),c("sourceRefId",null),c("mobileNumber",null),c("nocType",null==h||null===(t=h[0])||void 0===t?void 0:t.code),c("offset",0),c("limit",10),c("sortBy","commencementDate"),c("sortOrder","DESC"),c("isSubmitSuccessful","false"),p({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),c("offset",d("offset")-d("limit")),null==e||e.onSubmit({nocType:null==h||null===(n=h[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},f("ES_COMMON_CLEAR_ALL"))))},Vl=["currentlyActiveMobileModal"],Yl=["currentlyActiveMobileModal"],Gl=e=>{var i,a;let{SearchFormFieldsComponent:c,propsMobileInboxCards:d,isLoading:v,data:p,onSubmit:m}=e;const{t:f}=o.useTranslation(),{handleSubmit:h}=r.useFormContext(),[E,g]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),_=()=>{g({type:"remove"})},S=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:_},l.createElement(t.CloseSvg,null)),b=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=s(e,Vl);const{closeMobilePopupModal:o}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(S,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),l.createElement(c,{onSubmit:m,handleSubmit:h,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(u({currentlyActiveMobileModal:n},s(e,Yl)))},[E]);return v?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),E?l.createElement(t.PopUp,null,l.createElement(b,{onSubmit:e=>{g({type:"remove"}),m(e)},handleSubmit:h,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:E,closeMobilePopupModal:_})):null,null!=p&&null!==(i=p[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==p||null===(a=p[0])||void 0===a?void 0:a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APP_NO_LABEL")}))},ql=e=>{let{columns:i,SearchFormFieldsComponent:a,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:v,setValue:p,getValues:m}=r.useFormContext();null==m("offset")&&p("offset",0),null==m("limit")&&p("limit",10);const[f,h]=n.useState(Number(m("offset"))/Number(m("limit"))),{t:E}=o.useTranslation(),g=()=>{p("offset",d&&10*Math.ceil(d/10)-m("limit")),v(u)()},_=()=>{p("offset",0),v(u)()},S=n.useCallback(e=>{0!==e.length&&(p("sortBy",e.id),p("sortOrder",e.desc?"DESC":"ASC"))},[]);function b(e){p("limit",Number(e.target.value)),v(u)()}function y(){p("offset",Number(m("offset"))+Number(m("limit"))),v(u)()}function A(){p("offset",Number(m("offset"))-Number(m("limit"))),v(u)()}n.useEffect(()=>{null!=m("offset")&&null!=m("limit")&&h(Number(m("offset"))/Number(m("limit")))},[m("offset"),m("limit")]);const C=()=>{return c?l.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?l.createElement(t.Card,{style:{marginTop:20}},E(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Table,{t:E,data:s,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===E("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:b,currentPage:f,onNextPage:y,onPrevPage:A,pageSizeLimit:Number(m("limit")),onSort:S,totalRecords:d,disableSort:!1,onLastPage:g,onFirstPage:_,sortParams:[{id:m("sortBy"),desc:"DESC"===m("sortOrder")}]});var e,n};return l.createElement(l.Fragment,null,l.createElement(t.SearchForm,{onSubmit:u,handleSubmit:v},l.createElement(a,{onSubmit:u,handleSubmit:v,isMobileView:!1})),l.createElement(C,null))},Kl={NOCModule:e=>{let{stateCode:n,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"common-noc",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),s?l.createElement(t.Loader,null):"citizen"===o?l.createElement("div",null):l.createElement(gt,{path:r,stateCode:n})},NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),s=i.useLocation(),c=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const d={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:v(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:p,data:{totalCount:m,nearingSlaCount:f}={}}=Digit.Hooks.noc.useInbox({tenantId:c,filters:u({},d),config:{enabled:(null==d||null===(e=d.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),h=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},l.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),l.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===s.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[s.pathname]);const E=n.useMemo(()=>({Icon:l.createElement(h,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:p?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:p?"-":f,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:m,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[p,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,E):null},NOCApplicationOverview:()=>{var e,a,r,s,v,p,m,f,h;const{id:E}=i.useParams(),{t:g}=o.useTranslation(),_=Digit.ULBService.getCurrentTenantId(),S=null==_?void 0:_.split(".")[0],[b,y]=n.useState({}),[A,C]=n.useState(null),D={},[T]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[w,O]=n.useState(null),[N,x]=n.useState([]),[I,P]=n.useState([]),[L,R]=n.useState([]),[F,M]=n.useState([]),[B,k]=n.useState([]),[U,W]=n.useState({}),[j,H]=n.useState(()=>[]),[z,V]=n.useState(!1),Y=window.Digit.Utils.browser.isMobile(),{data:G}=Digit.Hooks.obps.useMDMS(S,"NOC",["DocumentTypeMapping"]),{data:q}=Digit.Hooks.obps.useMDMS(S,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(g,_,{applicationNo:E}),{mutate:J}=Digit.Hooks.noc.useNOCApplicationActions(_),$=Digit.Hooks.useWorkflowDetails({tenantId:_,id:E,moduleCode:"NOC"});var Z,Q;null!=$&&null!==(e=$.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!$.isLoading&&($.data.actionState.nextActions=[...null==$||null===(r=$.data)||void 0===r?void 0:r.nextActions]),$&&$.data&&!$.isLoading&&($.data.initialActionState=(null==$||null===(Z=$.data)||void 0===Z?void 0:Z.initialActionState)||u({},null==$||null===(Q=$.data)||void 0===Q?void 0:Q.actionState)||{},$.data.actionState=u({},$.data)),n.useEffect(()=>{P([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;R(null==G||null===(e=G.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[G]),n.useEffect(()=>{var e;M(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.DocumentType)},[q]),n.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(B))},[B]),n.useEffect(()=>{if(null!=I&&I.length&&null!=L&&L.length){let e=[];I.map(t=>{var n,l;const i=L.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(n=i[0])&&void 0!==n&&null!==(l=n.docTypes)&&void 0!==l&&l[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let n=e.documentType;e.dropdownData=[],F.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),x(t)}},[I,L,F]),n.useEffect(()=>{var e,t;let n=[];null==I||null===(e=I[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,l)=>{n.push(null==e?void 0:e.fileStoreId)}),H(null==n?void 0:n.map(e=>e))},[null==I||null===(s=I[0])||void 0===s?void 0:s.documents]),n.useEffect(()=>{null!=j&&j.length&&Digit.UploadServices.Filefetch(j,Digit.ULBService.getStateId()).then(e=>{W(null==e?void 0:e.data)})},[j]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,s,v,p,m,f,h,E,g,_,S,b,y,A,C,D,T,x,I;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return l.createElement(n.Fragment,null,l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+d(null==a||null===(s=a[0])||void 0===s?void 0:s.code,".","_")+"_LABEL")),l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(v=o[0])||void 0===v?void 0:v.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(p=o[0])||void 0===p?void 0:p.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(m=o[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(h=o[0])&&void 0!==h&&null!==(E=h.additionalDetails)&&void 0!==E&&E.SubmittedOn?c(Number(null==o||null===(g=o[0])||void 0===g||null===(_=g.additionalDetails)||void 0===_?void 0:_.SubmittedOn)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(S=o[0])||void 0===S?void 0:S.nocNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?c(Number(null==o||null===(b=o[0])||void 0===b||null===(y=b.auditDetails)||void 0===y?void 0:y.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(A=o[0])&&void 0!==A&&A.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(D=o[0])||void 0===D||null===(T=D.documents)||void 0===T?void 0:T.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=U[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+d(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):l.createElement("div",null,l.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),l.createElement("div",null,(null==$||null===(x=$.data)||void 0===x||null===(I=x.nextActions)||void 0===I?void 0:I.length)>0?null==N?void 0:N.map((e,t)=>l.createElement(Jn,{key:t,document:e,t:i,error:w,setError:O,setNocDocuments:k,nocDocuments:B})):null)))}return l.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>l.createElement(n.Fragment,null,l.createElement("div",{style:{maxWidth:"950px"}},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>l.createElement(t.Row,{className:"border-none",label:""+g(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return n.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;y(u({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:g,data:X,nocDataDetails:I,nocDocumentsList:N})}]})),V(!1)}},[X,N,I,T,j,U]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},g("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(Xn,{applicationDetails:b,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:$,businessService:null!=$&&null!==(v=$.data)&&void 0!==v&&v.applicationBusinessService?null==$||null===(p=$.data)||void 0===p?void 0:p.applicationBusinessService:null==X||null===(m=X.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:Y?{}:{paddingRight:"50px"},MenuStyle:Y?{}:{right:"50px"},showToast:A,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(h=f.additionalDetails)||void 0===h?void 0:h.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:a}=e;const{t:s}=o.useTranslation(),c=Digit.ULBService.getCurrentTenantId(),d={},p={moduleName:"noc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:v(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},f=Digit.SessionStorage.get("NOC.INBOX"),h=n.useMemo(()=>f||{filterForm:p,searchForm:d,tableForm:m},[Object.values((null==f?void 0:f.filterForm)||{}),Object.values((null==f?void 0:f.searchForm)||{}),Object.values((null==f?void 0:f.tableForm)||{})]),[E,g]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",u({},e,{searchForm:t.data})),u({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",u({},e,{filterForm:t.data})),u({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",u({},e,{tableForm:t.data})),u({},e,{tableForm:t.data})}},h),{data:_,isLoading:S}=Digit.Hooks.useBoundaryLocalities(c,"revenue",{},s),{isLoading:b,data:{table:y,statuses:A,totalCount:C}={}}=Digit.Hooks.noc.useInbox({tenantId:c,filters:u({},E)}),D={logoIcon:l.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:s("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]},T=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement($n,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),w=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Zn,{statuses:A,isInboxLoading:b,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:S})},[A,b,_,S]),O={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:u({},m)}),g({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),g({action:"mutateSearchForm",data:d})}},N={FilterFormFields:w,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:u({},m)}),g({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),g({action:"mutateFilterForm",data:p})}},x=(e=>{var t,a,r,s;let{parentRoute:c,onPageSizeChange:d,formState:v,totalCount:p,table:m,dispatch:f,onSortingByData:h}=e;const{t:E}=o.useTranslation(),g=n.useMemo(()=>[{Header:E("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:c+"/inbox/application-overview/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:E("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(jl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:E("NOC_MODULE_SOURCE_LABEL"),accessor:e=>E("MODULE_"+(null==e?void 0:e.source)),disableSortBy:!0},{Header:E("NOC_STATUS_LABEL"),accessor:e=>E(null==e?void 0:e.status),disableSortBy:!0},{Header:E("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:E("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?E(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(t=v.tableForm)||void 0===t?void 0:t.offset)/(null===(a=v.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:u({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:u({},v.tableForm,{offset:parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=v.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=v.tableForm)||void 0===r?void 0:r.limit,onSort:h,totalRecords:p,onSearch:null==v||null===(s=v.searchForm)||void 0===s?void 0:s.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:u({},v.tableForm,{offset:10*Math.ceil(p/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:u({},v.tableForm,{offset:0})}),data:m,columns:g}})(u({},{parentRoute:a,onPageSizeChange:e=>{g({action:"mutateTableForm",data:u({},E.tableForm,{limit:e.target.value})})},formState:E,totalCount:C,table:y,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===l||g({action:"mutateTableForm",data:u({},E.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),I=(e=>{let{parentRoute:n,table:i}=e;const{t:a}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:n,source:l,status:i,owner:o,sla:r}=e;return{[a("NOC_APP_NO_LABEL")]:t,[a("TL_COMMON_TABLE_COL_APP_DATE")]:jl(new Date(n),"dd/MM/yyyy"),[a("NOC_MODULE_SOURCE_LABEL")]:a("MODULE_"+l),[a("NOC_STATUS_LABEL")]:a(i),[a("WF_INBOX_HEADER_CURRENT_OWNER")]:o,[a("ES_INBOX_SLA_DAYS_REMAINING")]:a(r)}}),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:a("NOC_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=r.useFormContext();return l.createElement(t.SearchField,null,l.createElement(r.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:i,value:o}=n;return l.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:a,table:y}),P={onMobileSortOrderData:e=>{const{sortOrder:t}=e;g({action:"mutateTableForm",data:u({},E.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),g({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,s("ES_COMMON_INBOX"),C?l.createElement("p",{className:"inbox-count"},C):null),l.createElement(t.InboxComposer,u({isInboxLoading:b,PropsForInboxLinks:D},O,N,P,{propsForInboxTable:x,propsForInboxMobileCards:I,formState:E})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:s,isLoading:c,Count:d}=e;const[v,p]=n.useState(null),m=r.useForm({defaultValues:{}});n.useEffect(()=>{m.register("offset",0),m.register("limit",10),m.register("sortBy","commencementDate"),m.register("sortOrder","DESC")},[m.register]);const f=(()=>{const{t:e}=o.useTranslation(),t=e=>l.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,l;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var l,i;return t(e((null==n||null===(l=n.additionalDetails)||void 0===l?void 0:l.currentOwner)&&""+(null==n||null===(i=n.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-"))},disableSortBy:!0}],[])})(),h=window.Digit.Utils.browser.isMobile(),E=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,l,i;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return l.createElement(r.FormProvider,m,h?l.createElement(Gl,{SearchFormFieldsComponent:zl,propsMobileInboxCards:E,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(ql,{columns:f,SearchFormFieldsComponent:zl,onSubmit:a,data:u,error:s,isLoading:c,Count:d}))}};exports.initNOCComponents=()=>{Object.entries(Kl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};