@mseva/digit-ui-module-noc 1.0.7 → 1.0.9
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 +1 -1
- package/package.json +1 -1
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,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e,t){return e(t={exports:{}},t.exports),t.exports}var C,D="object"==typeof A&&A&&A.Object===Object&&A,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},U=T["__core-js_shared__"],k=(C=/[^.]+$/.exec(U&&U.keys&&U.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,k&&k in t))&&(M(e)?z:j).test(H(e));var t}(n)?n:void 0},G=V(T,"Map"),q=V(Object,"create"),Y=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__=q?q(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(q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Y.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return q?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]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var Q=X,$=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 Q,map:new(G||b),string:new Q}},J.prototype.delete=function(e){var t=$(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return $(this,e).get(e)},J.prototype.has=function(e){return $(this,e).has(e)},J.prototype.set=function(e,t){var n=$(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=y(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=y(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}),Ae=be&&be.isTypedArray,ye=Ae?Se(Ae):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&&ye(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=y(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,Ue=Object.getOwnPropertySymbols,ke=Ue?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}(Ue(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,ke(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,ke)},Ge=function(e){return ze(e,Re,je)},qe=V(T,"DataView"),Ye=V(T,"Promise"),Ke=V(T,"Set"),Xe=V(T,"WeakMap"),Qe=H(qe),$e=H(G),Je=H(Ye),Ze=H(Ke),et=H(Xe),tt=F;(qe&&"[object DataView]"!=tt(new qe(new ArrayBuffer(1)))||G&&"[object Map]"!=tt(new G)||Ye&&"[object Promise]"!=tt(Ye.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 Qe:return"[object DataView]";case $e: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]&<.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,ke(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 At(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 yt=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,A]=n.useState({}),[y,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,U]=n.useState(!1);function k(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=At(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:y,selectedApprover:D,setSelectedApprover:N,selectFile:k,uploadedFile:O,setUploadedFile:I,businessService:v}))},[r,y,P,F,O]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yt,{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,A]=n.useState([]),[y,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;A(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=At(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:y,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!=y&&y.uuid?[null==y?void 0:y.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([]),[A,y]=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=At(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:A,setSelectedApprover:y,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!=A&&A.uuid?[null==A?void 0:A.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)),Ut=e=>{var o,i,r,u,s,c,m,v,p,f,E,g;let{t:h,action:_,tenantId:S,closeModal:b,submitAction:A,applicationDetails:y,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([]),[U,k]=n.useState({}),[W,H]=n.useState({}),[j,z]=n.useState(null),[V,G]=n.useState(null),[q,Y]=n.useState(null),[K,X]=n.useState(null),Q=!!Digit.Utils.browser.isMobile();function $(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{Y(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)Y(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))Y(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=At(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):Y(h("CS_FILE_UPLOAD_ERROR"))})},function(){Y(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:A,blockReasonFiltered:y}=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:y,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:A})}]}]}})({t:h,action:_,approvers:R,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:$,uploadedFile:V,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:q,blockReasonFiltered:B}))},[_,R,K,V,q]),_&&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:Q?{width:"720px"}:{},style:Q?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Q?{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!=U&&U.uuid?[null==U?void 0:U.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!=U&&U.uuid?[null==U?void 0:U.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!=U&&U.uuid?[null==U?void 0:U.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==y||null===(v=y.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?A({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 A({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)},kt=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({}),[A,y]=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;y(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=At(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:A,selectedApprover:C,setSelectedApprover:D,selectFile:P,uploadedFile:L,setUploadedFile:O,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,A,L,I]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(kt,{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)),qt=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}},Yt=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([]),[A,y]=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=At(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:A,setSelectedApprover:y,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:A,setSelectedApprover:y,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,y,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!==(y=b.applicationType)&&void 0!==y&&y.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!=A&&A.uuid?[{uuid:null==A?void 0:A.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!=A&&A.uuid?[{uuid:null==A?void 0:A.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!=A&&A.uuid?[null==A?void 0:A.uuid]:[],assignes:null!=A&&A.uuid?[{uuid:null==A?void 0:A.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!=A&&A.uuid?[{uuid:null==A?void 0:A.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=qt(t)}else if(null!=e&&e.date){const t=gt(null==e?void 0:e.date);m.connectionExecutionDate=qt(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,U,k,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===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.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"})),Qt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xt,null)),$t=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([]),[A,y]=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=At(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:A,setSelectedApprover:y,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(Qt,{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||!A?[]:[A],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,A]=n.useState([]),[y,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:y,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:y.length>0?parseInt(y):""})}),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([]),[A,y]=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=At(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:A,setSelectedApprover:y,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!=A&&A.uuid?[null==A?void 0:A.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([]),[A,y]=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=At(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:A,setSelectedApprover:y,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,A]=n.useState({}),[y,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:y,selectedApprover:D,setSelectedApprover:N,uploadedFile:T,setUploadedFile:L,businessService:f}))},[s,y,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($t,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(Ut,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(jt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Yt,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=y(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]",y="[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),U=/<%-([\s\S]+?)%>/g,k=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),q=/^\s+/,Y=/\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]",Ae="(?:"+fe+"|"+Ee+")",ye="(?:"+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("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,be+Ae,"$"].join("|")+")",be+"?"+Ae+"+(?:['’](?: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[y]=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[y]=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 Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof A&&A&&A.Object===Object&&A,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,qe=Ge&&Ge.exports===Ve,Ye=qe&&He.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Qe=Ke&&Ke.isDate,$e=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)&>(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 At(e){return function(t){return null==e?void 0:e[t]}}function yt(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(q,""):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&>(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&>(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=At({"À":"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=At({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Ue[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 Ut(e,t){return function(n){return e(t(n))}}function kt(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--&&Y.test(e.charAt(t)););return t}var Gt=At({"&":"&","<":"<",">":">",""":'"',"'":"'"}),qt=function e(t){var A=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,Re))).Array,Y=t.Date,ce=t.Error,de=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=A.prototype,he=ve.prototype,_e=t["__core-js_shared__"],Se=de.prototype.toString,be=he.hasOwnProperty,Ae=0,ye=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=qe?t.Buffer:void 0,xe=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(ve.getPrototypeOf,ve),Ve=ve.create,Ge=he.propertyIsEnumerable,Ye=ge.splice,Ke=xe?xe.isConcatSpreadable:void 0,pt=xe?xe.iterator:void 0,At=xe?xe.toStringTag:void 0,Yt=function(){try{var e=Jo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=Y&&Y.now!==ze.Date.now&&Y.now,Qt=t.setTimeout!==ze.setTimeout&&t.setTimeout,$t=me.ceil,Jt=me.floor,Zt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ut(ve.keys,ve),on=me.max,an=me.min,rn=Y.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),An=Ti(pn),yn=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 Un(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function kn(e,t){return Ai(Eo(e),Kn(t,0,e.length))}function Wn(e){return Ai(Eo(e))}function Hn(e,t,n){(void 0!==n&&!Oa(e[t],n)||void 0===n&&!(t in e))&&qn(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)||qn(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 qn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,l=t.length,o=A(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,A=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=A||R?{}:li(e),!_)return A?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 y: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?A?Go:Vo:A?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 Qn(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 $n(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:U,evaluate:k,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():Ye.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=Qo(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return Qo(this,e).get(e)},Rn.prototype.has=function(e){return Qo(this,e).has(e)},Rn.prototype.set=function(e,t){var n=Qo(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&&!$a(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]":At&&At in ve(e)?function(e){var t=be.call(e,At),n=e[At];try{e[At]=void 0;var l=!0}catch(e){}var o=Ce.call(e);return l&&(t?e[At]=n:delete e[At]),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=A(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(ki(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),A=d?a:ti(e),y=_?a:ti(t),C=(A=A==i?p:A)==p,D=(y=y==i?p:y)==p,N=A==y;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 Ue(e),new Ue(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,A,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,ye&&ye in t))&&(Wa(e)?Te:oe).test(Ti(e));var t}function Al(e){return"function"==typeof e?e:null==e?qr:"object"==typeof e?Pa(e)?Tl(e[0],e[1]):Nl(e):tu(e)}function yl(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)?A(e.length):[];return Zn(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Nl(e){var t=$o(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=[]:Ya(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}):[qr];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)&&kl(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&&Ye.call(r,u,1),Ye.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)?Ye.call(e,o,1):$l(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,qr),e+"")}function Ml(e){return Un(Or(e))}function Ul(e,t){var n=Or(e);return Ai(n,Kn(t,0,n.length))}function kl(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}:qr,Hl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:qr;function jl(e){return Ai(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=A(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&&!$a(a)&&(n?a<=t:a<t)?l=i+1:o=i}return o}return ql(e,t,qr,n)}function ql(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=$a(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=$a(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 Yl(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:$a(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Pa(e))return st(e,Xl)+"";if($a(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ql(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 $l(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Ni(ki(t))]}function Jl(e,t,n,l){return kl(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?Ql(e[0]):[];for(var o=-1,i=A(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 Ql(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:qr}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 Ue(t).set(new Ue(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=$a(e),a=void 0!==t,r=null===t,u=t==t,s=$a(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=A(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=A(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=A(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?qn(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 Ao(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 yo(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"==Yo(a))var r=new In([],!0)}for(o=r?o:l;++o<l;){var u=Yo(a=t[o]),s="wrapper"==u?qo(a):void 0;r=s&&ui(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Yo(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=A(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 y=kt(h,S);return Ro(e,t,To,E.placeholder,n,h,y,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,$t(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($t((t-e)/(n||1)),0),a=A(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)}:$r;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 Uo(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:qo(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?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fo(r,a,t[6]):a,e[6]=r?kt(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=A(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var s=i<3&&a[0]!==u&&a[i-1]!==u?[]:kt(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=A(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 ko(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 Ya(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 qo=gn?function(e){return gn.get(e)}:$r;function Yo(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||Yr;return e=e===Yr?Al:e,arguments.length?e(arguments[0],arguments[1]):e}function Qo(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 $o(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&&!$a(e))||j.test(e)||!H.test(e)||null!=t&&e in ve(t)}function ui(e){var t=Yo(e),n=Tn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=qo(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 An:return E;case yn: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=A(i);++o<i;)a[o]=l[t+o];o=-1;for(var r=A(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=Qt||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(Q):[]}(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 Ai(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 yi,Ci,Di=(yi=ya(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=yi.cache,yi);function Ni(e){if("string"==typeof e||$a(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=ki(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=ki(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=ki(e),n=st(e,lo);return t===ki(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Xo(t,2)):[]}),Ui=Bl(function(e){var t=ki(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 ki(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=Yn(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 Ql(ol(e,1,Ba,!0))}),Gi=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),Ql(ol(e,1,Ba,!0),Xo(t,2))}),qi=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,Ql(ol(e,1,Ba,!0),void 0,t)});function Yi(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=Yi(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):[]}),Qi=Bl(function(e){return to(at(e,Ba))}),$i=Bl(function(e){var t=ki(e);return Ba(t)&&(t=void 0),to(at(e,Ba),Xo(t,2))}),Ji=Bl(function(e){var t=ki(e);return t="function"==typeof t?t:void 0,to(at(e,Ba),void 0,t)}),Zi=Bl(Yi),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 Yn(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]:qn(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):qn(e,n,[t])}),ca=Bl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fa(e)?A(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){qn(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,Uo(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=kt(n,Ko(ha));l|=32}return Uo(e,l,t,n,o)}),_a=Bl(function(e,t,n){var l=3;if(n.length){var o=kt(n,Ko(_a));l|=32}return Uo(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 $n(e,1,t)}),Aa=Bl(function(e,t,n){return $n(e,ir(t)||0,n)});function ya(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(ya.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)}}ya.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 Uo(e,32,void 0,t,kt(t,Ko(Na)))}),Ta=Bl(function(e,t){return Uo(e,64,void 0,t,kt(t,Ko(Ta)))}),La=zo(function(e,t){return Uo(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=A.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,Ua=Qe?Tt(Qe):function(e){return Va(e)&&ml(e)==u};function ka(e){if(!Va(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(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=$e?Tt($e):function(e){return Va(e)&&ti(e)==m};function qa(e){return"number"==typeof e||Va(e)&&ml(e)==v}function Ya(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 Qa(e){return"string"==typeof e||!Pa(e)&&Va(e)&&ml(e)==g}function $a(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 Qa(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($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=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(Yn),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(yr,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(qr)),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):yl(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 Ar=_o(function(e,t,n){Ll(e,t,n)}),yr=_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--;)$l(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=yo(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function xr(e){return(e=rr(e))&&e.replace(re,Pt).replace(Oe,"")}var Pr=yo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=yo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=Ao("toLowerCase"),Br=yo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=yo(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=yo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Ao("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($)||[]}(e):e.match(t)||[]}var Hr=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new ce(e)}}),jr=zo(function(e,t){return lt(t,function(t){t=Ni(t),qn(e,t,ha(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=No(),Gr=No(!0);function qr(e){return e}function Yr(e){return Al("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 Qr(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 $r(){}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=A($t(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=A(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 Qn(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=Uo(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=Uo(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=Aa,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 Uo(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=Ui,Tn.invert=gr,Tn.invertBy=hr,Tn.invokeMap=ca,Tn.iteratee=Yr,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){qn(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){qn(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=ya,Tn.merge=Ar,Tn.mergeWith=yr,Tn.method=Kr,Tn.methodOf=Xr,Tn.mixin=Qr,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)?kn:Ul)(e,t)},Tn.set=function(e,t,n){return null==e?e:kl(e,t,n)},Tn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(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?Yl(e):[]},Tn.sortedUniqBy=function(e,t){return e&&e.length?Yl(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):$a(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=qi,Tn.uniq=function(e){return e&&e.length?Ql(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?Ql(e,Xo(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Ql(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||$l(e,t)},Tn.unzip=Yi,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=Qi,Tn.xorBy=$i,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||[],kl)},Tn.zipWith=ea,Tn.entries=Tr,Tn.entriesIn=Lr,Tn.extend=sr,Tn.extendWith=cr,Qr(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||Qn(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=qr,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)),Qa(e)?n<=o&&e.indexOf(t,n)>-1:!!o&>(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=Ua,Tn.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ya(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!yl(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=ka,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,$o(t))},Tn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,$o(t),n)},Tn.isNaN=function(e){return qa(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=qa,Tn.isObject=za,Tn.isObjectLike=Va,Tn.isPlainObject=Ya,Tn.isRegExp=Ka,Tn.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Tn.isSet=Xa,Tn.isString=Qa,Tn.isSymbol=$a,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=ki,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,qr,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,qr)},Tn.meanBy=function(e,t){return St(e,Xo(t,2))},Tn.min=function(e){return e&&e.length?nl(e,qr,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=$r,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($t(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(q,""),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+ke("1e-"+((o+"").length-1))),t)}return Rl(e,t)},Tn.reduce=function(e,t,n){var l=Pa(e)?dt:yt,o=arguments.length<3;return l(e,Xo(t,4),n,o,Zn)},Tn.reduceRight=function(e,t,n){var l=Pa(e)?mt:yt,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)?Un:Ml)(e)},Tn.size=function(e){if(null==e)return 0;if(Fa(e))return Qa(e)?jt(e):e.length;var t=ti(e);return t==m||t==E?e.size:yl(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 ql(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 ql(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,qr):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,ko);var o,i,a=cr({},t.imports,l.imports,ko),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,ka(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(q,"");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=++Ae;return rr(e)+t},Tn.upperCase=Ur,Tn.upperFirst=kr,Tn.each=ra,Tn.eachRight=ua,Tn.first=Fi,Qr(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(qr)},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=qt)._=qt,Ve._=qt):ze._=qt}).call(A)});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,A]=n.useState(!1),[y,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:A,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:y}))))};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),[A,y]=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{A.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],A.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)}},[A,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&&y(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=At(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 An=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([]),[A,y]=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(()=>{y("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"}}),A&&(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:A}))))},yn=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,A,y,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,U]=n.useState(),k=Digit.ULBService.getStateId(),[W,H]=n.useState(),[j,z]=n.useState(),[V,G]=n.useState([]),[q,Y]=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{$(null);const e=function(){if(q&&null!=q&&q.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==q||null===(t=q.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(q.size>=2e6)$(ie("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",q,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}]):$(ie("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else $(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)}}()},[q]),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,k).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),U(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"):(U(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]),Y(e.target.files[0])},disabled:!x,onDelete:()=>{z(null),Y("")},message:j?"1 "+ie("FILEUPLOADED"):ie("ES_NO_FILE_SELECTED_LABEL"),error:Q,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===(A=J.fileStoreIds)||void 0===A?void 0:A.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===(y=I.selfCertificationCharges)||void 0===y?void 0:y.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),[A,y]=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),y(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({},A);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:""}y(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:()=>{y(m),b(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(m),b(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=A&&A.adhocPenalty?Number(null==A?void 0:A.adhocPenalty):0,n=null!=A&&A.adhocRebate?Number(null==A?void 0:A.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,A);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),A.billDetails=null==e?void 0:e.Calculation,v(A),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==A?void 0:A.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==A||null===(r=A.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==A?void 0:A.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==A?void 0:A.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==A?void 0:A.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==A||null===(u=A.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==A?void 0:A.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==A?void 0:A.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"})))},Un=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)))))},kn=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)))))};function Gn(e){var a,r,u,s,c,m,v,p,f,E,g,h,S,b,A,y;let{applicationDetails:C,demandData:D,workflowDetails:N,isDataLoading:T,applicationData:L,businessService:O,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:x="status",paymentsList:P,oldValue:R,isInfoLabel:F=!1,propertyId:B,moduleCode:M}=e;const{t:U}=i.useTranslation(),k=o.useHistory(),W=Digit.ULBService.getCurrentTenantId(),[H,j]=n.useState(null),[z,V]=n.useState([]);let G=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function q(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,K]=n.useState({}),[X,Q]=n.useState(),[$,J]=n.useState([]),[Z,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||Z.loading||Z.loaded||Z.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Z||!Z.canLoad||Z.loading||Z.loaded||(ee({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 J(i),console.log(i),Q(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)||W,null==L?void 0:L.propertyId,K,ee));const te=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()},ne=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:te(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,A,y;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===(A=e.assignes)||void 0===A||null===(y=A[0])||void 0===y?void 0:y.mobileNumber,comment:U(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(In,{data:N,OpenImage:q,privacy:o})}{var D,N,T,O,I;const t={date:te(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})}},le=(e,t)=>e?t?e:U(e):U("NA"),oe=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||oe?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+U(null==e?void 0:e.isUnit):U("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):U("N/A"),[se,ce]=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 de=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)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},me=null==C?void 0:C.applicationData,ve=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C,O),console.log("infolabel",F),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:B};const t=!0;"BPREG"===M?Digit.OBPSService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)}):Digit.PTService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},F?l.createElement(Un,{t:U,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,A,y,D,T,L,O,I,w,x,F,B,M,k,W,H,j,z,V,q,K,X,Q;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"}:oe?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&oe?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+U(e.title):U(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},U(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"}},U(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"}},U(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},U(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||oe?{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:U(n.title),label:U(n.title),text:l.createElement("img",{src:U(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:U(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"}},U(null==n?void 0:n.title)))):ie||ae?""+U(n.title):U(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:re(),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:""+U(""+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:U(n.title),label:U(n.title),text:ue(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:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(zn,{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(Tn,{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===(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===(A=e.additionalDetails)||void 0===A?void 0:A.accessories}),!G&&(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==N||null===(D=N.data)||void 0===D||null===(T=D.nextActions)||void 0===T?void 0:T.length)>0&&l.createElement(yn,{applicationData:null==C?void 0:C.applicationData,t:U,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:U,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(An,{t:U,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===(x=e.additionalDetails)||void 0===x?void 0:x.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===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(Ln,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&l.createElement(gn,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.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:R}),(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===(z=e.additionalDetails)||void 0===z||null===(V=z.redirectUrl)||void 0===V?void 0:V.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===(Q=e.additionalDetails)||void 0===Q?void 0:Q.estimationDetails)&&l.createElement(kn,{wsAdditionalDetails:e,workflowDetails:N}))}),(null==X?void 0:X.length)>0&&l.createElement(Vn,{assessmentData:$}),w&&(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"}},U("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:U(""+I+(null==N||null===(f=N.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(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,se?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:U(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[x])+a),customChild:ne(e,n,null==N||null===(i=N.data)||void 0===i?void 0:i.timeline)}))}))),(null==N||null===(A=N.data)||void 0===A||null===(y=A.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:U(se?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ce(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"==pe?de(me,"ACTIVE",ve):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"==pe?de(me,"INACTIVE",ve):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)&&k.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)&&k.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),H&&l.createElement(t.Toast,{error:H.isError,label:U(H.label),onClose:()=>{j(null)},isDleteBtn:"false"}))}function qn(e){var n,o,i,a,r,u,s,c,d,m,v,p,f,E,g,h,_,S;let{t:b,showToast:A,closeToast:y,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==A||null===(D=A.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==A?void 0:A.key)?null==A||null===(n=A.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==A?void 0:A.key)?null==A||null===(o=A.error)||void 0===o?void 0:o.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==A?void 0:A.key)?null==A||null===(i=A.error)||void 0===i?void 0:i.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==A?void 0:A.key)?null==A||null===(a=A.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==A?void 0:A.key)?null==A||null===(r=A.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==A?void 0:A.key)?null==A||null===(u=A.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==A?void 0:A.key)?null==A||null===(s=A.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==A?void 0:A.key)?null==A||null===(c=A.error)||void 0===c?void 0:c.message:b("ES_"+C+"_"+(null==A||null===(d=A.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:e,onClose:y}))}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==A||null===(N=A.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==A?void 0:A.key)?null==A||null===(m=A.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==A?void 0:A.key)?null==A||null===(v=A.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==A?void 0:A.key)?null==A||null===(p=A.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==A?void 0:A.key)?null==A||null===(f=A.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==A?void 0:A.key)?null==A||null===(E=A.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==A?void 0:A.key)?null==A||null===(g=A.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==A?void 0:A.key)?null==A||null===(h=A.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==A?void 0:A.key)?null==A||null===(_=A.error)||void 0===_?void 0:_.message:b("ES_"+C+"_"+(null==A||null===(S=A.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:n,onClose:y}))}{var T,L;const e="error"===(null==A?void 0:A.key)?null==A||null===(T=A.error)||void 0===T?void 0:T.message:"ES_"+C+"_"+(null==A||null===(L=A.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,A&&l.createElement(t.Toast,{error:"error"===A.key,label:b(e),onClose:y}))}}function Yn(e){var o,a,r,u,s,c,m,v,p,f,E,g,h,_,S,b;let{workflowDetails:A,displayMenu:y,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==A||null===(u=A.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==A||null===(m=A.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)},y),(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!=A&&A.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:d({},L)},y&&(null!=A&&null!==(E=A.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=A&&null!==(h=A.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(!y)})),!(null!=A&&A.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 Kn=()=>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"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null));function Qn(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(Xn,{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 $n=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,A]=n.useState(!1),[y,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:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:q,ActionBarStyle:Y,MenuStyle:K,paymentsList:X,showTimeLine:Q=!0,oldValue:$,isInfoLabel:J=!1,clearDataDetails:Z,propertyId:ee}=e;n.useEffect(()=>{x&&k.revalidate()},[x]);const te=a.useQueryClient(),ne=()=>{S(null),A(!1)};return R||y?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Gn,{applicationDetails:L,demandData:O,id:W,workflowDetails:k,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:q,paymentsList:X,showTimeLine:Q,oldValue:$,isInfoLabel:J,propertyId:ee,moduleCode:z}),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,A,y,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===(A=e.SewerageConnection)||void 0===A||null===(y=A.comment)||void 0===y?void 0:y.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,A;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===(A=e.Licenses[0])||void 0===A?void 0:A.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&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),o=At(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==k||null===(r=k.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Qn,{action:_,workflowDetails:k,businessService:H,isWarningPop:D,closeWarningPopup:()=>{N(!1)}}):null,l.createElement(qn,{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(Yn,{workflowDetails:k,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"),A(!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 A(!0);S(e),h(!1)},setDisplayMenu:h,businessService:H,forcedActionPrefix:G,ActionBarStyle:Y,MenuStyle:K}))))};function Jn(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 Zn=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)))))},el=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 tl(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 nl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ll(e){nl(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 ol(e,t){nl(2,arguments);var n=ll(e).getTime(),l=tl(t);return new Date(n+l)}function il(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 al(e){return nl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function rl(e){if(nl(1,arguments),!al(e)&&"number"!=typeof e)return!1;var t=ll(e);return!isNaN(Number(t))}var ul={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 sl(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 cl={date:sl({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:sl({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:sl({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},dl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ml(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 vl(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)?fl(u,function(e){return e.test(r)}):pl(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 pl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var El,gl={code:"en-US",formatDistance:function(e,t,n){var l,o=ul[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:cl,formatRelative:function(e,t,n,l){return dl[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:ml({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ml({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:ml({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:ml({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:ml({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:(El={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(El.matchPattern);if(!n)return null;var l=n[0],o=e.match(El.parsePattern);if(!o)return null;var i=El.valueCallback?El.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(l.length);return{value:i,rest:a}}),era:vl({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:vl({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:vl({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:vl({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:vl({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){nl(2,arguments);var n=tl(t);return ol(e,-n)}function _l(e){nl(1,arguments);var t=1,n=ll(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 Sl(e){nl(1,arguments);var t=ll(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var o=_l(l),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=_l(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function bl(e){nl(1,arguments);var t=Sl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=_l(n);return l}function Al(e,t){nl(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.weekStartsOn,i=null==o?0:tl(o),a=null==n.weekStartsOn?i:tl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=ll(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 yl(e,t){nl(1,arguments);var n=ll(e),l=n.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:tl(a),u=null==o.firstWeekContainsDate?r:tl(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=Al(s,t),d=new Date(0);d.setUTCFullYear(l,0,u),d.setUTCHours(0,0,0,0);var m=Al(d,t);return n.getTime()>=c.getTime()?l+1:n.getTime()>=m.getTime()?l:l-1}function Cl(e,t){nl(1,arguments);var n=t||{},l=n.locale,o=l&&l.options&&l.options.firstWeekContainsDate,i=null==o?1:tl(o),a=null==n.firstWeekContainsDate?i:tl(n.firstWeekContainsDate),r=yl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=Al(u,t);return s}function Dl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Nl={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 Dl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var o=yl(e,l),i=o>0?o:1-o;return"YY"===t?Dl(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Dl(i,t.length)},R:function(e,t){return Dl(Sl(e),t.length)},u:function(e,t){return Dl(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 Dl(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 Dl(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):Dl(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 Dl(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){nl(1,arguments);var n=ll(e),l=Al(n,t).getTime()-Cl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Dl(o,t.length)},I:function(e,t,n){var l=function(e){nl(1,arguments);var t=ll(e),n=_l(t).getTime()-bl(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Dl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Dl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){nl(1,arguments);var t=ll(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"}):Dl(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 Dl(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 Dl(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 Dl(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 Dl(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 Dl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Dl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Dl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Dl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Dl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Dl(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 Ll(o);case"XXXX":case"XX":return Ol(o);case"XXXXX":case"XXX":default:return Ol(o,":")}},x:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ll(o);case"xxxx":case"xx":return Ol(o);case"xxxxx":case"xxx":default:return Ol(o,":")}},O:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tl(o,":");case"OOOO":default:return"GMT"+Ol(o,":")}},z:function(e,t,n,l){var o=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tl(o,":");case"zzzz":default:return"GMT"+Ol(o,":")}},t:function(e,t,n,l){return Dl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Dl((l._originalDate||e).getTime(),t.length)}};function Tl(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+Dl(i,2)}function Ll(e,t){return e%60==0?(e>0?"-":"+")+Dl(Math.abs(e)/60,2):Ol(e,t)}function Ol(e,t){var n=t||"",l=e>0?"-":"+",o=Math.abs(e);return l+Dl(Math.floor(o/60),2)+n+Dl(o%60,2)}function Il(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 wl(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:wl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],o=l[1],i=l[2];if(!i)return Il(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}}",Il(o,t)).replace("{{time}}",wl(i,t))}},Pl=["D","DD"],Rl=["YY","YYYY"];function Fl(e){return-1!==Pl.indexOf(e)}function Bl(e){return-1!==Rl.indexOf(e)}function Ml(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 Ul=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wl=/^'([^]*?)'?$/,Hl=/''/g,jl=/[a-zA-Z]/;function zl(e,t,n){nl(2,arguments);var l=String(t),o=n||{},i=o.locale||gl,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:tl(a),u=null==o.firstWeekContainsDate?r:tl(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:tl(s),d=null==o.weekStartsOn?c:tl(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=ll(e);if(!rl(m))throw new RangeError("Invalid time value");var v=il(m),p=hl(m,v),f={firstWeekContainsDate:u,weekStartsOn:d,locale:i,_originalDate:m},E=l.match(kl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,xl[t])(e,i.formatLong,f):e}).join("").match(Ul).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return Vl(n);var a=Nl[l];if(a)return!o.useAdditionalWeekYearTokens&&Bl(n)&&Ml(n,t,e),!o.useAdditionalDayOfYearTokens&&Fl(n)&&Ml(n,t,e),a(p,n,i.localize,f);if(l.match(jl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function Vl(e){return e.match(Wl)[1].replace(Hl,"'")}const Gl=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"))))},ql=["currentlyActiveMobileModal"],Yl=["currentlyActiveMobileModal"],Kl=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,ql);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,Yl)))},[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")}))},Xl=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 A(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function y(){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:A,onPrevPage:y,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))},Ql={step:1,isValid:!1,formData:{}},$l=function(e,t){switch(void 0===e&&(e=Ql),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 Ql;default:return e}},Jl=["path","url"],Zl=[],eo=()=>{var e,n;const a=o.useRouteMatch(),{path:r}=a,u=(m(a,Jl),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=Zl)&&(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},to=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))},no=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(to,{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}))})())},lo=[{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"}]}],oo=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),io=[{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:lo.filter(t=>t.stepNumber===e.stepNumber)})),ao=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")},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)||"")))},ro=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})}))),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})}))),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})}))),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)||""))},uo=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:A,Controller:y,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,U]=n.useState((null==A||null===(o=A.siteDetails)||void 0===o?void 0:o.ulbName)||null),[k,W]=n.useState((null==A||null===(i=A.siteDetails)||void 0===i?void 0:i.ulbType)||""),[H,j]=n.useState((null==A||null===(a=A.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:z,isLoading:V}=Digit.Hooks.noc.useBuildingType(S),{data:G,isLoading:q}=Digit.Hooks.noc.useRoadType(S),{data:Y,isLoading:K}=Digit.Hooks.useTenants(),X=null==Y?void 0:Y.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==A||null===(r=A.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==A||null===(u=A.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==A?void 0:A.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||""})})}},[A,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(y,{control:C,name:"plotNo",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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(y,{control:C,name:"proposedSiteAddress",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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(y,{control:C,name:"ulbName",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{U(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(y,{control:C,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:k||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(y,{control:C,name:"khasraNo",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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(y,{control:C,name:"hadbastNo",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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"),"*"),!q&&l.createElement(y,{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(y,{control:C,name:"areaLeftForRoadWidening",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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(y,{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(y,{control:C,name:"roadWidthAtSite",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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(y,{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(y,{control:C,name:"isBasementAreaAvailable",rules:{required:b("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{$(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==Q?void 0:Q.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(y,{control:C,name:"basementArea",rules:{required:b("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:b("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},minLength:{value:1,message:b("MIN_1_CHARACTER_REQUIRED")},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(y,{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")},minLength:{value:1,message:b("MIN_1_CHARACTER_REQUIRED")},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(y,{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(y,{control:C,name:"wardNo",rules:{required:b("REQUIRED_FIELD"),minLength:{value:2,message:b("MIN_2_CHARACTERS_REQUIRED")},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(y,{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(y,{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(y,{control:C,name:"villageName",rules:{required:b("REQUIRED_FIELD"),minLength:{value:4,message:b("MIN_4_CHARACTERS_REQUIRED")},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)))},so=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",rules:{required:i("REQUIRED_FIELD"),minLength:{value:4,message:i("MIN_4_CHARACTERS_REQUIRED")},maxLength:{value:100,message:i("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)},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 co(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,A]=n.useState(()=>(null==E?void 0:E.filestoreId)||null);function y(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),o=I(n);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}]})},[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),A(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)u(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=At(function(){return A(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?A(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&&A(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(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement(t.UploadFile,"OWNER.BUILDINGDRAWING"===(null==a?void 0:a.code)?{onUpload:y,onDelete:()=>{A(null)},id:f,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf",buttonType:"button",error:!b}:{onUpload:y,onDelete:()=>{A(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 mo=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 vo(e){var n,o,a,r,u;let{value:s={}}=e;const{t:c}=i.useTranslation(),{isLoading:d,data:m}=Digit.Hooks.tl.useTLDocumentSearch({value:s},{value:s});let v=window.location.href.includes("/tl/tradelicence/application/")?null==s||null===(n=s.tradeLicenseDetail)||void 0===n?void 0:n.applicationDocuments:[];return null!=s&&s.workflowDocs&&(v=null==s?void 0:s.workflowDocs),null!=s&&null!==(o=s.owners)&&void 0!==o&&o.documents.ProofOfIdentity&&v.push(s.owners.documents.ProofOfIdentity),null!=s&&null!==(a=s.owners)&&void 0!==a&&a.documents.ProofOfOwnership&&v.push(s.owners.documents.ProofOfOwnership),null!=s&&null!==(r=s.owners)&&void 0!==r&&r.documents.OwnerPhotoProof&&v.push(s.owners.documents.OwnerPhotoProof),d?l.createElement(t.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null===(u=v)||void 0===u?void 0:u.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}(m.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_",href:n,style:{minWidth:"100px",marginRight:"10px"},key:t},l.createElement(mo,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",textAlign:"center"}},c(null!=s&&s.workflowDocs?""+(null==e?void 0:e.documentType):"TL_"+(null==e?void 0:e.documentType)+"_LABEL")))}))))}const po=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,A]=n.useState(null),[y,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===y||null==(null==y?void 0:y.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==y.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===y||null==(null==y?void 0:y.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)!==y.fileStoreId),{documentType:null==_?void 0:_.code,fileStoreId:y.fileStoreId,documentUid:y.fileStoreId,fileName:(null==b?void 0:b.name)||y.fileName||"document",id:m?null===(t=m.find(e=>e.documentType===(null==_?void 0:_.code)))||void 0===t?void 0:t.id:void 0}]})},[y,_]),n.useEffect(()=>{_.code||null===y||L([...T,y])},[y]);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&&A(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)," ")))}),fo=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"})})},Eo=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(eo,null):l.createElement(bt,{path:r,stateCode:n})},go={NOCModule:Eo,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:fo,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,A]=n.useState({}),[y,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,U]=n.useState([]),[k,W]=n.useState({}),[H,j]=n.useState(()=>[]),[z,V]=n.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:q}=Digit.Hooks.obps.useMDMS(S,"NOC",["DocumentTypeMapping"]),{data:Y}=Digit.Hooks.obps.useMDMS(S,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(h,_,{applicationNo:g}),{mutate:Q}=Digit.Hooks.noc.useNOCApplicationActions(_),$=Digit.Hooks.useWorkflowDetails({tenantId:_,id:g,moduleCode:"NOC"});var J,Z;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===(J=$.data)||void 0===J?void 0:J.initialActionState)||d({},null==$||null===(Z=$.data)||void 0===Z?void 0:Z.actionState)||{},$.data.actionState=d({},$.data)),n.useEffect(()=>{x([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),n.useEffect(()=>{var e;R(null==q||null===(e=q.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[q]),n.useEffect(()=>{var e;B(null==Y||null===(e=Y["common-masters"])||void 0===e?void 0:e.DocumentType)},[Y]),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,A,y,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===(A=b.auditDetails)||void 0===A?void 0:A.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(y=i[0])&&void 0!==y&&y.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=k[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==$||null===(I=$.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(Jn,{key:t,document:e,t:o,error:T,setError:L,setNocDocuments:U,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;A(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,k]),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($n,{applicationDetails:b,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:Q,workflowDetails:$,businessService:null!=$&&null!==(s=$.data)&&void 0!==s&&s.applicationBusinessService?null==$||null===(c=$.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:y,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:A,totalCount:y}={}}=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(Zn,{registerRef:t,searchFormState:n,searchFieldComponents:o})},[]),T=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:o,getFilterFormValue:i}=e;return l.createElement(el,{statuses:A,isInboxLoading:b,registerRef:t,controlFilterForm:n,setFilterFormValue:o,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:S})},[A,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))(zl(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:y,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")]:zl(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"),y?l.createElement("p",{className:"inbox-count"},y):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(Kl,{SearchFormFieldsComponent:Gl,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(Xl,{columns:f,SearchFormFieldsComponent:Gl,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(no,{stepsList:io,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;let{config:a,onGoNext:u,onBackClick:c}=e;const m=s.useDispatch(),{t:v}=i.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState(""),h=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),_=Digit.UserService.getUser(),{control:S,handleSubmit:b,setValue:A,formState:{errors:y},trigger:C}=r.useForm(),D={Controller:r.Controller,control:S,setValue:A,errors:y,trigger:C,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}};function N(e){m(oo(a.key,e)),u()}function T(e){c(a.key,e)}return l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:b(e=>{C(),y.length>0?console.log("Plz fill mandatory fields in Step1"):N(e)})},l.createElement("div",{className:"employeeCard"},"CITIZEN"===(null==_||null===(o=_.info)||void 0===o?void 0:o.type)?l.createElement(ao,d({onGoBack:T,goNext:N,currentStepData:h,t:v},D)):l.createElement(ro,d({onGoBack:T,goNext:N,currentStepData:h,t:v},D))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),p&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:E,onClose:()=>{f(!1),g("")}}))},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:A}=r.useForm({defaultValues:{floorArea:[{value:""}]}}),y=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:A};function D(e){m(oo(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(uo,d({onGoBack:N,goNext:D,currentStepData:y,t:c},C)),l.createElement(so,d({onGoBack:N,goNext:D,currentStepData:y,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=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:p,config:o.currStepConfig,onSubmit:function(e){console.log("goNext data in NewPTRStepFormThree: ",e);const{missingFields:t}={missingFields:[],notFormattedFields:[]};if(t.length>0)return v("Please fill the following field: "+t[0]),void d(!0);i()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!En.isEqual(t,p)),En.isEqual(t,p)||u(oo(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(oo(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:ao,NOCProfessionalDetails:ro,NOCSiteDetails:uo,NOCSpecificationDetails:so,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:A}=Digit.Hooks.pt.usePropertyMDMS(S,"NOC",["Documents"]),y=()=>{let e;e=d({},c.documents,{documents:m}),s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==A||null===(e=A.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:y,onSkip:()=>s(),isDisabled:E,onAdd:function(){}},null==A||null===(i=A.NOC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(co,{key:t,document:e,t:r,error:p,setError:f,setDocuments:v,documents:m,setCheckRequiredFields:_,handleSubmit:y})),p&&l.createElement(t.Toast,{label:p,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,A,y,C,D,N,T,L,O,I,w,x,P,R,F,B,M,U,k,W,H,j,z,V,G,q,Y,K,X,Q,$,J,Z,ee,te;let{formData:ne,t:le}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",ne);const oe={backgroundColor:"#ffffff",padding:"1rem 1.5rem",borderRadius:"8px",marginBottom:"2rem",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)"},ie={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e0e0e0",padding:"0.5rem 0",color:"#333"},ae={fontSize:"1.5rem",borderBottom:"2px solid #ccc",paddingBottom:"0.3rem",color:"#2e4a66",marginTop:"2rem",marginBottom:"1rem"},re={fontWeight:"bold",color:"#555"},ue=(e,n)=>l.createElement("div",{style:ie},l.createElement(t.CardLabel,{style:re},e),l.createElement("div",null,n||"NA")),se=Digit.UserService.getUser(),ce=null==se||null===(n=se.info)||void 0===n?void 0:n.type;return l.createElement("div",{style:{padding:"2rem",backgroundColor:"#f9f9f9",fontFamily:"'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",color:"#333"}},"CITIZEN"===ce?l.createElement(l.Fragment,null,l.createElement("h2",{style:ae},le("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:oe},ue(le("NOC_FIRM_OWNER_NAME_LABEL"),null==ne||null===(i=ne.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName),ue(le("NOC_APPLICANT_EMAIL_LABEL"),null==ne||null===(a=ne.applicationDetails)||void 0===a?void 0:a.applicantEmailId),ue(le("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==ne||null===(r=ne.applicationDetails)||void 0===r?void 0:r.applicantFatherHusbandName),ue(le("NOC_APPLICANT_MOBILE_NO_LABEL"),null==ne||null===(u=ne.applicationDetails)||void 0===u?void 0:u.applicantMobileNumber),ue(le("NOC_APPLICANT_DOB_LABEL"),null==ne||null===(c=ne.applicationDetails)||void 0===c?void 0:c.applicantDateOfBirth),ue(le("NOC_APPLICANT_GENDER_LABEL"),null==ne||null===(d=ne.applicationDetails)||void 0===d||null===(m=d.applicantGender)||void 0===m?void 0:m.code),ue(le("NOC_APPLICANT_ADDRESS_LABEL"),null==ne||null===(v=ne.applicationDetails)||void 0===v?void 0:v.applicantAddress))):l.createElement(l.Fragment,null,l.createElement("h2",{style:ae},le("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:oe},ue(le("NOC_PROFESSIONAL_NAME_LABEL"),null==ne||null===(p=ne.applicationDetails)||void 0===p?void 0:p.professionalName),ue(le("NOC_PROFESSIONAL_EMAIL_LABEL"),null==ne||null===(f=ne.applicationDetails)||void 0===f?void 0:f.professionalEmailId),ue(le("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==ne||null===(E=ne.applicationDetails)||void 0===E?void 0:E.professionalRegId),ue(le("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==ne||null===(g=ne.applicationDetails)||void 0===g?void 0:g.professionalMobileNumber),ue(le("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==ne||null===(h=ne.applicationDetails)||void 0===h?void 0:h.professionalAddress))),l.createElement("h2",{style:ae},le("NOC_SITE_DETAILS")),l.createElement("div",{style:oe},ue(le("NOC_PLOT_NO_LABEL"),null==ne||null===(_=ne.siteDetails)||void 0===_?void 0:_.plotNo),ue(le("NOC_PROPOSED_SITE_ADDRESS"),null==ne||null===(S=ne.siteDetails)||void 0===S?void 0:S.proposedSiteAddress),ue(le("NOC_ULB_NAME_LABEL"),null==ne||null===(b=ne.siteDetails)||void 0===b||null===(A=b.ulbName)||void 0===A?void 0:A.name),ue(le("NOC_ULB_TYPE_LABEL"),null==ne||null===(y=ne.siteDetails)||void 0===y?void 0:y.ulbType),ue(le("NOC_KHASRA_NO_LABEL"),null==ne||null===(C=ne.siteDetails)||void 0===C?void 0:C.khasraNo),ue(le("NOC_HADBAST_NO_LABEL"),null==ne||null===(D=ne.siteDetails)||void 0===D?void 0:D.hadbastNo),ue(le("NOC_ROAD_TYPE_LABEL"),null==ne||null===(N=ne.siteDetails)||void 0===N||null===(T=N.roadType)||void 0===T?void 0:T.name),ue(le("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==ne||null===(L=ne.siteDetails)||void 0===L?void 0:L.areaLeftForRoadWidening),ue(le("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==ne||null===(O=ne.siteDetails)||void 0===O?void 0:O.netPlotAreaAfterWidening),ue(le("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==ne||null===(I=ne.siteDetails)||void 0===I?void 0:I.roadWidthAtSite),ue(le("NOC_BUILDING_STATUS_LABEL"),null==ne||null===(w=ne.siteDetails)||void 0===w||null===(x=w.buildingStatus)||void 0===x?void 0:x.name),ue(le("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==ne||null===(P=ne.siteDetails)||void 0===P||null===(R=P.isBasementAreaAvailable)||void 0===R?void 0:R.code),"BUILTUP"===(null==ne||null===(F=ne.siteDetails)||void 0===F||null===(B=F.buildingStatus)||void 0===B?void 0:B.code)&&ue(le("NOC_BASEMENT_AREA_LABEL"),null==ne||null===(M=ne.siteDetails)||void 0===M?void 0:M.basementArea),"BUILTUP"===(null==ne||null===(U=ne.siteDetails)||void 0===U||null===(k=U.buildingStatus)||void 0===k?void 0:k.code)&&(null==ne||null===(W=ne.siteDetails)||void 0===W||null===(H=W.floorArea)||void 0===H?void 0:H.map((e,t)=>ue((e=>0===e?le("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+le("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==ne||null===(j=ne.siteDetails)||void 0===j||null===(z=j.buildingStatus)||void 0===z?void 0:z.code)&&ue(le("NOC_TOTAL_FLOOR_AREA_LABEL"),null==ne||null===(V=ne.siteDetails)||void 0===V?void 0:V.totalFloorArea),ue(le("NOC_DISTRICT_LABEL"),null==ne||null===(G=ne.siteDetails)||void 0===G||null===(q=G.district)||void 0===q?void 0:q.name),ue(le("NOC_ZONE_LABEL"),null==ne||null===(Y=ne.siteDetails)||void 0===Y||null===(K=Y.zone)||void 0===K?void 0:K.name),ue(le("NOC_SITE_WARD_NO_LABEL"),null==ne||null===(X=ne.siteDetails)||void 0===X?void 0:X.wardNo),ue(le("NOC_SITE_VILLAGE_NAME_LABEL"),null==ne||null===(Q=ne.siteDetails)||void 0===Q?void 0:Q.villageName)),l.createElement("h2",{style:ae},le("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:oe},ue(le("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==ne||null===($=ne.siteDetails)||void 0===$?void 0:$.specificationPlotArea),ue(le("NOC_BUILDING_CATEGORY_LABEL"),null==ne||null===(J=ne.siteDetails)||void 0===J||null===(Z=J.specificationBuildingCategory)||void 0===Z?void 0:Z.name)),l.createElement("h2",{style:ae},le("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:oe},Array.isArray(null==ne||null===(ee=ne.documents)||void 0===ee||null===(te=ee.documents)||void 0===te?void 0:te.documents)&&ne.documents.documents.documents.length>0?l.createElement(vo,{value:{workflowDocs:ne.documents.documents.documents}}):l.createElement("div",null,le("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,A]=n.useState(!1),y=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(po,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:S,formData:c,beforeUploadDocuments:y||[],isNextButtonDisabled:b,setIsNextButtonDisabled:A,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=fo,exports.NOCModule=Eo,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:$l}),exports.initNOCComponents=()=>{Object.entries(go).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
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),i=require("react-router-dom"),o=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 v(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 m=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},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=[],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},E=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=0),decodeURIComponent(e.split("?")[0].split("/").pop().slice(13))||"Document - "+(t+1)},g=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var h=function(e,t){return e===t||e!=e&&t!=t},S=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1},A=Array.prototype.splice;function b(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])}}b.prototype.clear=function(){this.__data__=[],this.size=0},b.prototype.delete=function(e){var t=this.__data__,n=S(t,e);return!(n<0||(n==t.length-1?t.pop():A.call(t,n,1),--this.size,0))},b.prototype.get=function(e){var t=this.__data__,n=S(t,e);return n<0?void 0:t[n][1]},b.prototype.has=function(e){return S(this.__data__,e)>-1},b.prototype.set=function(e,t){var n=this.__data__,l=S(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var y=b,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(e,t){return e(t={exports:{}},t.exports),t.exports}var N,O="object"==typeof C&&C&&C.Object===Object&&C,L="object"==typeof self&&self&&self.Object===Object&&self,T=O||L||Function("return this")(),I=T.Symbol,w=Object.prototype,P=w.hasOwnProperty,x=w.toString,R=I?I.toStringTag:void 0,F=Object.prototype.toString,B=I?I.toStringTag:void 0,M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=P.call(e,R),n=e[R];try{e[R]=void 0;var l=!0}catch(e){}var i=x.call(e);return l&&(t?e[R]=n:delete e[R]),i}(e):function(e){return F.call(e)}(e)},U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!U(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},W=T["__core-js_shared__"],H=(N=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",j=Function.prototype.toString,z=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""},V=/^\[object .+?Constructor\]$/,G=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!U(e)||(t=e,H&&H in t))&&(k(e)?G:V).test(z(e));var t}(n)?n:void 0},q=Y(T,"Map"),K=Y(Object,"create"),X=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function $(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])}}$.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},$.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return X.call(t,e)?t[e]:void 0},$.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:J.call(t,e)},$.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=K&&void 0===t?"__lodash_hash_undefined__":t,this};var Z=$,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 ee(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])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||y),string:new Z}},ee.prototype.delete=function(e){var t=Q(this,e).delete(e);return this.size-=t?1:0,t},ee.prototype.get=function(e){return Q(this,e).get(e)},ee.prototype.has=function(e){return Q(this,e).has(e)},ee.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 te=ee;function ne(e){var t=this.__data__=new y(e);this.size=t.size}ne.prototype.clear=function(){this.__data__=new y,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof y){var l=n.__data__;if(!q||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(l)}return n.set(e,t),this.size=n.size,this};var le=ne,ie=function(){try{var e=Y(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oe=function(e,t,n){"__proto__"==t&&ie?ie(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ae=Object.prototype.hasOwnProperty,re=function(e,t,n){var l=e[t];ae.call(e,t)&&h(l,n)&&(void 0!==n||t in e)||oe(e,t,n)},ue=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?oe(n,r,u):re(n,r,u)}return n},se=function(e){return null!=e&&"object"==typeof e},ce=function(e){return se(e)&&"[object Arguments]"==M(e)},de=Object.prototype,ve=de.hasOwnProperty,me=de.propertyIsEnumerable,pe=ce(function(){return arguments}())?ce:function(e){return se(e)&&ve.call(e,"callee")&&!me.call(e,"callee")},fe=Array.isArray,Ee=function(){return!1},ge=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),_e=/^(?:0|[1-9]\d*)$/,he=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&_e.test(e))&&e>-1&&e%1==0&&e<t},Se=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var be=function(e){return function(t){return e(t)}},ye=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&O.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ce=ye&&ye.isTypedArray,De=Ce?be(Ce):function(e){return se(e)&&Se(e.length)&&!!Ae[M(e)]},Ne=Object.prototype.hasOwnProperty,Oe=function(e,t){var n=fe(e),l=!n&&pe(e),i=!n&&!l&&ge(e),o=!n&&!l&&!i&&De(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&&!Ne.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||he(s,u))||r.push(s);return r},Le=Object.prototype,Te=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)},Ie=function(e,t){return function(n){return e(t(n))}},we=Ie(Object.keys,Object),Pe=Object.prototype.hasOwnProperty,xe=function(e){return null!=e&&Se(e.length)&&!k(e)},Re=function(e){return xe(e)?Oe(e):function(e){if(!Te(e))return we(e);var t=[];for(var n in Object(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Fe=Object.prototype.hasOwnProperty,Be=function(e){return xe(e)?Oe(e,!0):function(e){if(!U(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&&Fe.call(e,l))&&n.push(l);return n}(e)},Me=D(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?T.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}}),Ue=function(){return[]},ke=Object.prototype.propertyIsEnumerable,We=Object.getOwnPropertySymbols,He=We?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];ke.call(e,r)&&(a[o++]=r)}return a}(We(e)))}:Ue,je=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},ze=Ie(Object.getPrototypeOf,Object),Ve=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)je(t,He(e)),e=ze(e);return t}:Ue,Ge=function(e,t,n){var l=t(e);return fe(e)?l:je(l,n(e))},Ye=function(e){return Ge(e,Re,He)},qe=function(e){return Ge(e,Be,Ve)},Ke=Y(T,"DataView"),Xe=Y(T,"Promise"),Je=Y(T,"Set"),$e=Y(T,"WeakMap"),Ze=z(Ke),Qe=z(q),et=z(Xe),tt=z(Je),nt=z($e),lt=M;(Ke&&"[object DataView]"!=lt(new Ke(new ArrayBuffer(1)))||q&&"[object Map]"!=lt(new q)||Xe&&"[object Promise]"!=lt(Xe.resolve())||Je&&"[object Set]"!=lt(new Je)||$e&&"[object WeakMap]"!=lt(new $e))&&(lt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,l=n?z(n):"";if(l)switch(l){case Ze:return"[object DataView]";case Qe:return"[object Map]";case et:return"[object Promise]";case tt:return"[object Set]";case nt:return"[object WeakMap]"}return t});var it=lt,ot=Object.prototype.hasOwnProperty,at=T.Uint8Array,rt=function(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t},ut=/\w*$/,st=I?I.prototype:void 0,ct=st?st.valueOf:void 0,dt=Object.create,vt=function(){function e(){}return function(t){if(!U(t))return{};if(dt)return dt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),mt=ye&&ye.isMap,pt=mt?be(mt):function(e){return se(e)&&"[object Map]"==it(e)},ft=ye&&ye.isSet,Et=ft?be(ft):function(e){return se(e)&&"[object Set]"==it(e)},gt={};gt["[object Arguments]"]=gt["[object Array]"]=gt["[object ArrayBuffer]"]=gt["[object DataView]"]=gt["[object Boolean]"]=gt["[object Date]"]=gt["[object Float32Array]"]=gt["[object Float64Array]"]=gt["[object Int8Array]"]=gt["[object Int16Array]"]=gt["[object Int32Array]"]=gt["[object Map]"]=gt["[object Number]"]=gt["[object Object]"]=gt["[object RegExp]"]=gt["[object Set]"]=gt["[object String]"]=gt["[object Symbol]"]=gt["[object Uint8Array]"]=gt["[object Uint8ClampedArray]"]=gt["[object Uint16Array]"]=gt["[object Uint32Array]"]=!0,gt["[object Error]"]=gt["[object Function]"]=gt["[object WeakMap]"]=!1;var _t=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(!U(t))return t;var d=fe(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ot.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=it(t),m="[object Function]"==v||"[object GeneratorFunction]"==v;if(ge(t))return Me(t,u);if("[object Object]"==v||"[object Arguments]"==v||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Te(e)?{}:vt(ze(e))}(t),!u)return s?function(e,t){return ue(e,Ve(e),t)}(t,function(e,t){return e&&ue(t,Be(t),e)}(r,t)):function(e,t){return ue(e,He(e),t)}(t,function(e,t){return e&&ue(t,Re(t),e)}(r,t))}else{if(!gt[v])return o?t:{};r=function(e,t,n){var l,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return rt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?rt(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?rt(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,ut.exec(l))).lastIndex=l.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ct?Object(ct.call(e)):{}}}(t,v,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):pt(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(c?s?qe:Ye:s?Be:Re)(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]),re(r,o,e(i,n,l,o,t,a))}),r},ht=function(e){return _t(e,5)};const St=e=>{var i,a;const{t:r}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),s=Digit.ComponentRegistryService.getComponent("NOCSearchApplication"),c=f();let v=[];1==(null==c?void 0:c.length)&&(v=[null==c||null===(i=c[0])||void 0===i?void 0:i.code]),(null==c?void 0:c.length)>1&&(null==c||c.forEach(e=>{v.push(e.code)}));const[m,p]=n.useState({offset:0,limit:10,tenantId:u,nocType:v[0]}),E={offset:0,limit:10,tenantId:u,nocType:v[0]},g=window.Digit.Utils.browser.isMobile(),{data:_,isLoading:h,isSuccess:S,error:A}=Digit.Hooks.noc.useNOCSearchApplication(u,m,{});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=ht(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:h,Count:null==_?void 0:_.count,error:A,data:!h&&S&&(null==_||null===(a=_.Noc)||void 0===a?void 0:a.length)>0?_.Noc:[{display:"ES_COMMON_NO_DATA"}]}))},At=e=>e.substr(0,1).toUpperCase()+e.substr(1),bt=(e,t)=>0===e?t("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+t("NOC_FLOOR_AREA_LABEL"),yt=(e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,m,p,f,E,g,_,h,S,A,b,y;let C=[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.applicantOwnerOrFirmName},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.applicantEmailId},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.applicationDetails)||void 0===c?void 0:c.applicantFatherHusbandName},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:null==e||null===(d=e.nocDetails)||void 0===d||null===(v=d.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.applicantMobileNumber},{title:t("NOC_APPLICANT_DOB_LABEL"),value:null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.applicantDateOfBirth},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:null==e||null===(g=e.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_||null===(h=_.applicationDetails)||void 0===h||null===(S=h.applicantGender)||void 0===S?void 0:S.code},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:null==e||null===(A=e.nocDetails)||void 0===A||null===(b=A.additionalDetails)||void 0===b||null===(y=b.applicationDetails)||void 0===y?void 0:y.applicantAddress}];return{title:t("NOC_APPLICANT_DETAILS"),values:C}},Ct=(e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,m,p,f,E,g,_,h,S,A,b,y,C,D,N,O,L,T,I,w,P,x,R,F,B,M,U,k,W,H,j,z,V,G,Y,q,K,X,J,$,Z,Q,ee,te,ne,le,ie,oe,ae,re,ue,se,ce,de,ve,me;let pe=[{title:t("NOC_PLOT_NO_LABEL"),value:null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.plotNo},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress},{title:t("NOC_ULB_NAME_LABEL"),value:null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.siteDetails)||void 0===c||null===(d=c.ulbName)||void 0===d?void 0:d.name},{title:t("NOC_ULB_TYPE_LABEL"),value:null==e||null===(v=e.nocDetails)||void 0===v||null===(m=v.additionalDetails)||void 0===m||null===(p=m.siteDetails)||void 0===p?void 0:p.ulbType},{title:t("NOC_KHASRA_NO_LABEL"),value:null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(g=E.siteDetails)||void 0===g?void 0:g.khasraNo},{title:t("NOC_HADBAST_NO_LABEL"),value:null==e||null===(_=e.nocDetails)||void 0===_||null===(h=_.additionalDetails)||void 0===h||null===(S=h.siteDetails)||void 0===S?void 0:S.hadbastNo},{title:t("NOC_ROAD_TYPE_LABEL"),value:null==e||null===(A=e.nocDetails)||void 0===A||null===(b=A.additionalDetails)||void 0===b||null===(y=b.siteDetails)||void 0===y||null===(C=y.roadType)||void 0===C?void 0:C.name},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:null==e||null===(D=e.nocDetails)||void 0===D||null===(N=D.additionalDetails)||void 0===N||null===(O=N.siteDetails)||void 0===O?void 0:O.areaLeftForRoadWidening},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:null==e||null===(L=e.nocDetails)||void 0===L||null===(T=L.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.netPlotAreaAfterWidening},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:null==e||null===(w=e.nocDetails)||void 0===w||null===(P=w.additionalDetails)||void 0===P||null===(x=P.siteDetails)||void 0===x?void 0:x.roadWidthAtSite},{title:t("NOC_DISTRICT_LABEL"),value:null==e||null===(R=e.nocDetails)||void 0===R||null===(F=R.additionalDetails)||void 0===F||null===(B=F.siteDetails)||void 0===B||null===(M=B.district)||void 0===M?void 0:M.name},{title:t("NOC_ZONE_LABEL"),value:null==e||null===(U=e.nocDetails)||void 0===U||null===(k=U.additionalDetails)||void 0===k||null===(W=k.siteDetails)||void 0===W||null===(H=W.zone)||void 0===H?void 0:H.name},{title:t("NOC_SITE_WARD_NO_LABEL"),value:null==e||null===(j=e.nocDetails)||void 0===j||null===(z=j.additionalDetails)||void 0===z||null===(V=z.siteDetails)||void 0===V?void 0:V.wardNo},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:null==e||null===(G=e.nocDetails)||void 0===G||null===(Y=G.additionalDetails)||void 0===Y||null===(q=Y.siteDetails)||void 0===q?void 0:q.villageName},{title:t("NOC_BUILDING_STATUS_LABEL"),value:null==e||null===(K=e.nocDetails)||void 0===K||null===(X=K.additionalDetails)||void 0===X||null===(J=X.siteDetails)||void 0===J||null===($=J.buildingStatus)||void 0===$?void 0:$.name},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:null==e||null===(Z=e.nocDetails)||void 0===Z||null===(Q=Z.additionalDetails)||void 0===Q||null===(ee=Q.siteDetails)||void 0===ee||null===(te=ee.isBasementAreaAvailable)||void 0===te?void 0:te.code}];var fe,Ee,ge,_e,he,Se,Ae,be,ye,Ce;return"BUILTUP"===(null==e||null===(ne=e.nocDetails)||void 0===ne||null===(le=ne.additionalDetails)||void 0===le||null===(ie=le.siteDetails)||void 0===ie||null===(oe=ie.buildingStatus)||void 0===oe?void 0:oe.code)&&pe.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(ge=Ee.siteDetails)||void 0===ge?void 0:ge.basementArea}),"BUILTUP"===(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue||null===(se=ue.buildingStatus)||void 0===se?void 0:se.code)&&(null==e||null===(_e=e.nocDetails)||void 0===_e||null===(he=_e.additionalDetails)||void 0===he||null===(Se=he.siteDetails)||void 0===Se||null===(Ae=Se.floorArea)||void 0===Ae||Ae.map((e,n)=>pe.push({title:bt(n,t),value:null==e?void 0:e.value}))),"BUILTUP"===(null==e||null===(ce=e.nocDetails)||void 0===ce||null===(de=ce.additionalDetails)||void 0===de||null===(ve=de.siteDetails)||void 0===ve||null===(me=ve.buildingStatus)||void 0===me?void 0:me.code)&&pe.push({title:t("NOC_TOTAL_FLOOR_AREA_LABEL"),value:null==e||null===(be=e.nocDetails)||void 0===be||null===(ye=be.additionalDetails)||void 0===ye||null===(Ce=ye.siteDetails)||void 0===Ce?void 0:Ce.totalFloorArea}),{title:t("NOC_SITE_DETAILS"),values:pe}},Dt=(e,t)=>{var n,l,i,o,a,r,u;let s=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.siteDetails)||void 0===i?void 0:i.specificationPlotArea},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:s}},Nt=function(e,t){try{var n;function l(n){return console.log("res here==>",n),{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e?void 0:e.documents.length)>0?e.documents.map((e,l)=>{let i=g(null==n?void 0:n.data,null==e?void 0:e.uuid);return console.log("doc link",i),{title:t((null==e?void 0:e.documentType)||t("CS_NA")),value:E(i,l)||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(l):l(o))}catch(e){return Promise.reject(e)}},Ot=function(e,t,n){try{var l,i,o,a;let u=[];return null!=e&&null!==(l=e.nocDetails)&&void 0!==l&&null!==(i=l.additionalDetails)&&void 0!==i&&null!==(o=i.applicationDetails)&&void 0!==o&&o.professionalName&&u.push(((e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,m,p,f,E;let g=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:null==e||null===(n=e.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l||null===(i=l.applicationDetails)||void 0===i?void 0:i.professionalName},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:null==e||null===(u=e.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s||null===(c=s.applicationDetails)||void 0===c?void 0:c.professionalRegId},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:null==e||null===(d=e.nocDetails)||void 0===d||null===(v=d.additionalDetails)||void 0===v||null===(m=v.applicationDetails)||void 0===m?void 0:m.professionalMobileNumber},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalAddress}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:g}})(e,n)),Promise.resolve({t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(r=n("ULBGRADE_"+(null==t||null===(a=t.city)||void 0===a?void 0:a.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),r.toLowerCase().split(" ").map(At).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("NOC_REGISTRATION_CERTIFICATE"),applicationNumber:(null==e?void 0:e.applicationNo)||"NA",details:[...u,yt(e,n),Ct(e,n),Dt(e,n),Nt(e,n)]})}catch(e){return Promise.reject(e)}var r},Lt=e=>{var n,a;const r=i.useLocation(),{pathname:u,state:s}=r,{t:c}=o.useTranslation(),d=i.useHistory(),v=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0],m=window.localStorage.getItem("Employee.tenant-id"),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=u.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c(p(null==v?void 0:v.nocType,".","_")+"_"+p(null==v?void 0:v.applicationStatus,".","_")+"_HEADER"),applicationNumber:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{d.push("/digit-ui/employee")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{d.push("/digit-ui/employee/noc/inbox")}}),l.createElement(t.SubmitBar,{label:c("COMMON_MAKE_PAYMENT"),onSubmit:()=>{d.push("/digit-ui/employee/payment/collect/NOC/"+g+"/"+m)}}))))},Tt=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})},It=e=>{var a,r,u,s,c,v;let{path:m}=e;const p=i.useLocation(),f=(o.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===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("NewNOCStepperForm"),_=window.location.href.includes("/response"),h=window.Digit.Utils.browser.isMobile();return l.createElement(n.Fragment,null,_?null:l.createElement("div",{style:window.location.href.includes("application-overview")||h?{marginLeft:"10px"}:{}},l.createElement(Tt,{location:p})),l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:m+"/inbox/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:m+"/search/application-overview/:id",component:f}),l.createElement(t.PrivateRoute,{path:m+"/new-application",component:g}),l.createElement(t.PrivateRoute,{path:m+"/inbox",component:e=>l.createElement(E,d({},e,{parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/search",component:e=>l.createElement(St,d({},e,{parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/response/:id",component:Lt})))};function wt(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 Pt=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"})),Rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xt,null)),Ft=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{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:g,data:_}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,S]=n.useState({}),[A,b]=n.useState({}),[y,C]=n.useState([]),[D,N]=n.useState(null),[O,L]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState(null),[x,R]=n.useState([]),[F,B]=n.useState(null),[M,U]=n.useState(!1);function k(e){L(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&R(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),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(O){const e=function(){if(O.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",O,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?I(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)}}()},[O]),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:x,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:v,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(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:y,selectedApprover:D,setSelectedApprover:N,selectFile:k,uploadedFile:T,setUploadedFile:I,businessService:m}))},[r,y,x,F,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pt,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Rt,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.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",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:d({},v,{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==v?void 0:v.propertyId,tenantId:u,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:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:T}]),c({Property:d({},v,{workflow:t})})}},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},Bt=e=>l.createElement("h1",{className:"heading-m"},e.label),Mt=()=>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"})),Ut=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Mt,null)),kt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{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:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,_]=n.useState({}),[h,S]=n.useState({}),[A,b]=n.useState([]),[y,C]=n.useState({}),[D,N]=n.useState(null),[O,L]=n.useState(null),[T,I]=n.useState(null),[w,P]=n.useState([]),[x,R]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&P(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;b(null==p||null===(e=p.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)}}))}},[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=wt(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?L(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.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&&_((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:A,selectedApprover:y,setSelectedApprover:C,selectFile:B,uploadedFile:O,setUploadedFile:L,businessService:m}))},[r,A,w,x,O]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(Ut,{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){v=d({},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:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:O}]:null}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Wt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ht=()=>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"})),jt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ht,null)),zt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{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)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[S,A]=n.useState([]),[b,y]=n.useState({}),[C,D]=n.useState(null),[N,O]=n.useState(null),[L,T]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return n.useEffect(()=>{var e;A(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{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(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,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):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(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:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:v}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!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:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?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:b,setSelectedApprover:y,selectFile:w,uploadedFile:N,setUploadedFile:O,businessService:m,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(jt,{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){v=d({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),c({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),Yt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gt,null)),qt=e=>{var i,o,r,u,s,c,v,m,p,f,E,g;let{t:_,action:h,tenantId:S,closeModal:A,submitAction:b,applicationDetails:y,applicationData:C,businessService:D,workflowDetails:N,blockReason:O}=e;console.log("applicationData",C),console.log("workflowDetails",N),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===(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:T}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(v=N.data)||void 0===v||null===(m=v.initialActionState)||void 0===m||null===(p=m.nextActions)||void 0===p||null===(f=p.filter(e=>(null==e?void 0:e.action)==(null==h?void 0:h.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!=h&&h.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[P,x]=n.useState({}),[R,F]=n.useState([]),[B,M]=n.useState([]),[U,k]=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),J=!!Digit.Utils.browser.isMobile();function $(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(_("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))q(_("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(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,i;(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===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):q(_("CS_FILE_UPLOAD_ERROR"))})},function(){q(_("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 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=()=>{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==O?void 0:O.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),h&&w((e=>{var n,i,o,a,r,u,s;let{t:c,action:d,approvers:v,selectedApprover:m,setSelectedApprover:p,selectedBlockReason:f,setBlockReason:E,selectFile:g,uploadedFile:_,setUploadedFile:h,assigneeLabel:S,businessService:A,error:b,blockReasonFiltered:y}=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_"+A+"_"+(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:p,selected:m})},{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:y,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:()=>{h(null)},message:_?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:_,action:h,approvers:R,selectedApprover:U,setSelectedApprover:k,selectedBlockReason:W,setBlockReason:H,selectFile:$,uploadedFile:V,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:B}))},[h,R,K,V,Y]),h&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vt,{label:_(I.label.heading)}),headerBarEnd:l.createElement(Yt,{onClick:A}),actionCancelLabel:_(I.label.cancel),actionCancelOnSubmit:A,actionSaveLabel:_(I.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"}:{}},T?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,i,o,a,r,u,s,c,v,m,p,f,E,g,S,D,O,L,T,I,w,P,x,R,F,B,M,k,H,z,G,Y,q,K,X,J,$,Z,Q,ne;if(C=d({},C,{documents:null===(t=C)||void 0===t?void 0:t.documents,additionalDetails:d({},null===(n=C)||void 0===n?void 0:n.additionalDetails,{fieldinspection_pending:ee(C),pendingapproval:te(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==h?void 0:h.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(o=N.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==N||null===(s=N.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.assigner)||void 0===m?void 0:m.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(p=N.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(g=E.state)||void 0===g?void 0:g.applicationStatus)?[null==N||null===(S=N.data)||void 0===S||null===(D=S.processInstances)||void 0===D||null===(O=D[0])||void 0===O||null===(L=O.assigner)||void 0===L?void 0:L.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null},action:null==h?void 0:h.action,riskType:null===(T=C)||void 0===T||null===(I=T.additionalDetails)||void 0===I?void 0:I.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(w=N.data)||void 0===w||null===(P=w.processInstances)||void 0===P||null===(x=P[0])||void 0===x||null===(R=x.state)||void 0===R?void 0:R.applicationStatus)?[null==N||null===(F=N.data)||void 0===F||null===(B=F.processInstances)||void 0===B||null===(M=B[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:V}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(H=C)||void 0===H||null===(z=H.additionalDetails)||void 0===z||null===(G=z.selfCertificationCharges)||void 0===G?void 0:G.BPA_MALBA_CHARGES)+parseInt(null===(Y=C)||void 0===Y||null===(q=Y.additionalDetails)||void 0===q||null===(K=q.selfCertificationCharges)||void 0===K?void 0:K.BPA_LABOUR_CESS)+parseInt(null===(X=C)||void 0===X||null===(J=X.additionalDetails)||void 0===J||null===($=J.selfCertificationCharges)||void 0===$?void 0:$.BPA_WATER_CHARGES)+parseInt(null===(Z=C)||void 0===Z||null===(Q=Z.additionalDetails)||void 0===Q||null===(ne=Q.selfCertificationCharges)||void 0===ne?void 0:ne.BPA_GAUSHALA_CHARGES_CESS))A(),alert(_("Enterd Less Adjustment amount is invalid"));else{var le,ie;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");const e=null==y||null===(le=y.nocData)||void 0===le?void 0:le.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||[]]})}}),t={};let n=!0,l=!0;null==t||null===(ie=t.Noc)||void 0===ie||ie.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.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!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];if(e&&e.map(e=>{var t,o,a,r,u,s,c,d,v,m,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.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===(m=v.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&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?b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0}):(A(),alert(_("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},Kt=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"})),Jt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xt,null)),$t=e=>{var o,r;let{t:u,action:s,tenantId:c,closeModal:v,submitAction:m,applicationData:p,businessService:f}=e;const{data:E,isLoading:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(r=o.map)||void 0===r?void 0:r.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[_,h]=(a.useQueryClient(),n.useState({})),[S,A]=n.useState({}),[b,y]=n.useState([]),[C,D]=n.useState({}),[N,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(null),P=!!Digit.Utils.browser.isMobile();function x(e){O(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;y(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=wt(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,i;(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===(i=l.files[0])||void 0===i?void 0:i.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&&h((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:v,businessService:m,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(v||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?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:p})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:D,selectFile:x,uploadedFile:L,setUploadedFile:T,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,b,L,I]),s&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Kt,{label:u(_.label.heading)}),headerBarEnd:l.createElement(Jt,{onClick:v}),actionCancelLabel:u(_.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(_.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"}:{}},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.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=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]:[];i.map((e,t)=>{o.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:o}),m({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),Qt=()=>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(Qt,null)),tn=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}},nn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{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)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[S,A]=n.useState([]),[b,y]=n.useState({}),[C,D]=n.useState(null),[N,O]=n.useState(null),[L,T]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;A(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{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(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?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(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&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:v,businessService:m,error:p}=e,f=!0,E=!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)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.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:u,selected:r}):null},E&&{label:i("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: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:()=>{v(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:b,setSelectedApprover:y,selectFile:P,uploadedFile:N,setUploadedFile:O,businessService:m,error:L})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:v,error:m}=e,p=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(p=!1),o.isTerminateState&&(p=!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:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("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: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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:P,uploadedFile:N,setUploadedFile:O,businessService:m,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(en,{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,i,o,a,s,m,p,f;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,g,_,h,S,A,y,D,O;const t=d({},null===(E=v)||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===(_=v)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(h=v)||void 0===h||null===(S=h.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(A=v)&&void 0!==A&&null!==(y=A.applicationType)&&void 0!==y&&y.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=v)&&void 0!==D&&null!==(O=D.applicationType)&&void 0!==O&&O.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.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!=b&&b.uuid?[{uuid:null==b?void 0:b.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(v=d({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.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=v)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.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=v)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ht(null==e?void 0:e.date);v.disconnectionExecutionDate=tn(t)}else if(null!=e&&e.date){const t=ht(null==e?void 0:e.date);v.connectionExecutionDate=tn(t)}var L;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(m=s.processInstance)||void 0===m?void 0:m.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(L=v)||void 0===L?void 0:L.serviceType)?c({WaterConnection:v,disconnectRequest:!0}):c({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=v)||void 0===f?void 0:f.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,P,x,R,F,B,M,U,k,W,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(v.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&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyComment)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.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===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(W=t.value)||void 0===W?void 0:W.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:_,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:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{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)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[S,A]=n.useState([]),[b,y]=n.useState(null),[C,D]=n.useState(null),[N,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;A(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{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(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?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(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:b,setSelectedApprover:y,selectFile:P,uploadedFile:N,setUploadedFile:O,businessService:m}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ln,{label:a(E.label.heading)}),headerBarEnd:l.createElement(an,{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"};v.creationReason="CREATE",c({PetRegistrationApplications:[d({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]),c({PetRegistrationApplications:[d({},v,{workflow:t})]})},defaultValues:_,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 i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:v,businessService:m}=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===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",v);const[g,_]=n.useState({}),[h,S]=n.useState({}),[A,b]=n.useState([]),[y,C]=n.useState(""),[D,N]=n.useState([]),[O,L]=n.useState(null),T=null===(o=v)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=n.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.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,T]);return console.log("years",I),n.useEffect(()=>{u&&_((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:u,years:I,selectedApprover:y,setSelectedApprover:C,businessService:m}))},[u,I,D,O]),u&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(un,{label:r(g.label.heading)}),headerBarEnd:l.createElement(cn,{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=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=d({},v,{financialYear:i,action:"INITIATE",additionalDetail:d({},v.additionalDetail,{validityYears:y.length>0?parseInt(y):""})}),c({Licenses:[v]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},vn=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"})),pn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mn,null)),fn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{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}),[E,g]=n.useState({}),[_,h]=n.useState({}),[S,A]=n.useState([]),[b,y]=n.useState(null),[C,D]=n.useState(null),[N,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){w(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;A(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{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).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):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(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,v),n.useEffect(()=>{g((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:b,setSelectedApprover:y,selectFile:P,uploadedFile:N,setUploadedFile:O,businessService:m,isUploading:I}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(pn,{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:m,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.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({},v,{workflow:n})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},En=e=>l.createElement("h1",{className:"heading-m"},e.label),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"})),_n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(gn,null)),hn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:v,businessService:m,moduleCode:p}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{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)}),[E,g]=n.useState({}),[_,h]=n.useState({}),[S,A]=n.useState([]),[b,y]=n.useState(null),[C,D]=n.useState(null),[N,O]=n.useState(null),[L,T]=n.useState(null),[I,w]=n.useState(!1);function P(e){D(e.target.files[0])}return n.useEffect(()=>{var e;A(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{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(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?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(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: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:b,setSelectedApprover:y,selectFile:P,uploadedFile:N,setUploadedFile:O,businessService:m}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(En,{label:a(E.label.heading)}),headerBarEnd:l.createElement(_n,{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:m,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({},v,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Sn=e=>l.createElement("h1",{className:"heading-m"},e.label),An=()=>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"})),bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(An,null)),yn=e=>{var o,a,r;let{t:u,action:s,tenantId:c,closeModal:v,submitAction:m,applicationData:p,businessService:f,moduleCode:E}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.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!=s&&s.isTerminateState)}),_=i.useHistory(),[h,S]=n.useState({}),[A,b]=n.useState({}),[y,C]=n.useState([]),[D,N]=n.useState(null),[O,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)?_.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:y,selectedApprover:D,setSelectedApprover:N,uploadedFile:O,setUploadedFile:L,businessService:f}))},[s,y,O]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Sn,{label:u(h.label.heading)}),headerBarEnd:l.createElement(bn,{onClick:v}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:u(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==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};O&&(t.documents=[]),m({Asset:d({},p,{workflow:t})})},defaultValues:A,formId:"modal-action"})):l.createElement(t.Loader,null)},Cn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ft,e):null!=e&&e.businessService.includes("ptr")?l.createElement(rn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(kt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(dn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(zt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(qt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement($t,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(nn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(fn,e):null!=e&&e.businessService.includes("chb")?l.createElement(hn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(yn,e):void 0;var Dn=D(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]",m="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",A="[object DataView]",b="[object Float32Array]",y="[object Float64Array]",D="[object Int8Array]",N="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,x=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(R.source),M=RegExp(F.source),U=/<%-([\s\S]+?)%>/g,k=/<%([\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 (.+)\] \*/,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+"]",me="["+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]",_e="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",ye="(?:"+Ae+"|"+Ee+")",Ce="(?:"+me+"|"+ge+")?",De="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,he,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Ne="(?:"+["[\\u2700-\\u27bf]",he,Se].join("|")+")"+De,Oe="(?:"+[_e+me+"?",me,he,Se,"[\\ud800-\\udfff]"].join("|")+")",Le=RegExp("['’]","g"),Te=RegExp(me,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Oe+De,"g"),we=RegExp([Ae+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Ae,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Ae+be,"$"].join("|")+")",Ae+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ae+"+(?:['’](?: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"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),xe=/[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[b]=Be[y]=Be[D]=Be[N]=Be[O]=Be[L]=Be["[object Uint8ClampedArray]"]=Be[T]=Be[I]=!0,Be[o]=Be[a]=Be[S]=Be[r]=Be[A]=Be[u]=Be[s]=Be[c]=Be[v]=Be[m]=Be[p]=Be[f]=Be[E]=Be[g]=Be[h]=!1;var Me={};Me[o]=Me[a]=Me[S]=Me[A]=Me[r]=Me[u]=Me[b]=Me[y]=Me[D]=Me[N]=Me[O]=Me[v]=Me[m]=Me[p]=Me[f]=Me[E]=Me[g]=Me[_]=Me[L]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[s]=Me[c]=Me[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ke=parseFloat,We=parseInt,He="object"==typeof C&&C&&C.Object===Object&&C,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,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)&>(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 mt(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=At("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 Et(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 gt(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):Et(e,ht,n)}function _t(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function ht(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function At(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function yt(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 Nt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Ot(e){return function(t){return e(t)}}function Lt(e,t){return st(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&>(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&>(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 xt=bt({"À":"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=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Ue[e]}function Bt(e){return Pe.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function kt(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 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=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var C=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,ge=C.prototype,_e=me.prototype,he=t["__core-js_shared__"],Se=de.prototype.toString,Ae=_e.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=_e.toString,De=Se.call(me),Ne=ze._,Oe=pe("^"+Se.call(Ae).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,Pe=t.Symbol,Ue=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,je=Ut(me.getPrototypeOf,me),Ve=me.create,Ge=_e.propertyIsEnumerable,qe=ge.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,bt=Pe?Pe.toStringTag:void 0,qt=function(){try{var e=$i(me,"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=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ut(me.keys,me),on=ve.max,an=ve.min,rn=q.now,un=t.parseInt,sn=ve.random,cn=ge.reverse,dn=$i(t,"DataView"),vn=$i(t,"Map"),mn=$i(t,"Promise"),pn=$i(t,"Set"),fn=$i(t,"WeakMap"),En=$i(me,"create"),gn=fn&&new fn,_n={},hn=Oo(dn),Sn=Oo(vn),An=Oo(mn),bn=Oo(pn),yn=Oo(fn),Cn=Pe?Pe.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function On(e){if(Va(e)&&!xa(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(Ae.call(e,"__wrapped__"))return Lo(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 Tn(){}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 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 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 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 xn(e);this.size=t.size}function Mn(e,t){var n=xa(e),l=!n&&Pa(e),i=!n&&!l&&Ma(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&&!Ae.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 Un(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function kn(e,t){return bo(fi(e),Kn(t,0,e.length))}function Wn(e){return bo(fi(e))}function Hn(e,t,n){(void 0!==n&&!Ta(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function jn(e,t,n){var l=e[t];Ae.call(e,t)&&Ta(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Ta(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 Gn(e,t){return e&&Ei(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,i=C(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,h=1&t,C=2&t,w=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=xa(e);if(P){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ae.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return fi(e,s)}else{var x=eo(e),R=x==c||x==d;if(Ma(e))return si(e,h);if(x==p||x==o||R&&!i){if(s=C||R?{}:no(e),!h)return C?function(e,t){return Ei(e,Qi(e),t)}(e,function(e,t){return e&&Ei(t,Ar(t),e)}(s,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Gn(s,e))}else{if(!Me[x])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case S:return ci(e);case r:case u:return new l(+e);case A:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case y:case D:case N:case O:case L:case"[object Uint8ClampedArray]":case T:case I:return di(e,n);case v:return new l;case m: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 _:return Dn?me(Dn.call(e)):{}}}(e,x,h)}}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,i){s.set(i,Xn(l,t,n,i,e,a))});var B=P?void 0:(w?C?Vi:zi:C?Ar:Sr)(e);return lt(B||e,function(l,i){B&&(l=e[i=l]),jn(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=me(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 Ee(n);return _o(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,Ot(n))),l?(o=ut,a=!1):t.length>=200&&(o=Tt,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}On.templateSettings={escape:U,evaluate:k,interpolate:W,variable:"",imports:{_:On}},(On.prototype=Tn.prototype).constructor=On,(In.prototype=Ln(Tn.prototype)).constructor=In,(wn.prototype=Ln(Tn.prototype)).constructor=wn,Pn.prototype.clear=function(){this.__data__=En?En(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(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ae.call(t,e)?t[e]:void 0},Pn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Ae.call(t,e)},Pn.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},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.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))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.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||xn),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)},Bn.prototype.clear=function(){this.__data__=new xn,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 xn){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=hi(rl),el=hi(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[No(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return xa(e)?l:ct(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in me(e)?function(e){var t=Ae.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function pl(e,t){return null!=e&&Ae.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=C(o),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,Ot(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 m=c[d],p=t?t(m):m;if(m=n||0!==m?m:0,!(v?Tt(v,p):l(s,p,n))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):l(e[a],p,n)))continue e}v&&v.push(p),s.push(m)}}return s}function gl(e,t,n){var l=null==(e=po(e,t=oi(t,e)))?e:e[No(ko(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return Va(e)&&vl(e)==o}function hl(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=xa(e),h=xa(t),b=d?a:eo(e),y=h?a:eo(t),C=(b=b==o?p:b)==p,D=(y=y==o?p:y)==p,N=b==y;if(N&&Ma(e)){if(!Ma(t))return!1;d=!0,C=!1}if(N&&!C)return c||(c=new Bn),d||Za(e)?Hi(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case r:case u:case m:return Ta(+e,+t);case s:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case v: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=Hi(c(e),c(t),l,i,o,a);return a.delete(e),p;case _:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,b,n,l,i,c);if(!(1&n)){var O=C&&Ae.call(e,"__wrapped__"),L=D&&Ae.call(t,"__wrapped__");if(O||L){var T=O?e.value():e,I=L?t.value():t;return c||(c=new Bn),i(T,I,n,l,c)}}return!!N&&(c||(c=new Bn),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:Ae.call(t,c)))return!1}var d=o.get(e),v=o.get(t);if(d&&v)return d==t&&v==e;var m=!0;o.set(e,t),o.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,o):l(f,E,c,e,t,o);if(!(void 0===g?f===E||i(f,E,n,l,o):g)){m=!1;break}p||(p="constructor"==c)}if(m&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,c))}(e,t,n,l,hl,i))}function Sl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(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 Bn;if(l)var v=l(s,c,u,e,t,d);if(!(void 0===v?hl(c,s,3,l,d):v))return!1}}return!0}function Al(e){return!(!za(e)||(t=e,ye&&ye in t))&&(Wa(e)?Oe:ie).test(Oo(e));var t}function bl(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?xa(e)?Ol(e[0],e[1]):Nl(e):tu(e)}function yl(e){if(!so(e))return ln(e);var t=[];for(var n in me(e))Ae.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)?C(e.length):[];return Qn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(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 Ol(e,t){return ao(e)&&co(t)?vo(No(e),t):function(n){var l=fr(n,e);return void 0===l&&l===t?Er(n,e):hl(t,l,3)}}function Ll(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Bn),za(o))!function(e,t,n,l,i,o,a){var r=Eo(e,n),u=Eo(t,n),s=a.get(u);if(s)Hn(e,n,s);else{var c=o?o(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var v=xa(u),m=!v&&Ma(u),p=!v&&!m&&Za(u);c=u,v||m||p?xa(r)?c=r:Ba(r)?c=fi(r):m?(d=!1,c=si(u,!0)):p?(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)),Hn(e,n,c)}}(e,t,a,n,Ll,l,i);else{var r=l?l(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hn(e,a,r)}},Ar)}function Tl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return xa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Yr];var l=-1;return t=st(t,Ot(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 wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&kl(o,oi(a,e),r)}return o}function Pl(e,t,n,l){var i=l?_t:gt,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),n&&(r=st(e,Ot(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 xl(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 Bl(e,t){return ho(mo(e,t,Yr),e+"")}function Ml(e){return Un(Tr(e))}function Ul(e,t){var n=Tr(e);return bo(n,Kn(t,0,n.length))}function kl(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=No(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])?[]:{})}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 bo(Tr(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=C(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 Gl(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 Yl(e,t,Yr,n)}function Yl(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,m=null===d,p=d==d,f=$a(d);if(a)var E=l||p;else E=s?p&&(l||v):r?p&&v&&(l||!m):u?p&&v&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);E?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||!Ta(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(xa(e))return st(e,Xl)+"";if($a(e))return Nn?Nn.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=Tt,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=po(e,t=oi(t,e)))||delete e[No(ko(t))]}function Zl(e,t,n,l){return kl(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 wn&&(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=C(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 Ba(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return xa(e)?e:ao(e,t)?[e]:Do(rr(e))}var ai=Bl;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=He?He(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(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 mi(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=C(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 pi(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=C(c+s),v=!l;++i<c;)d[i]=e[i];for(var m=i;++u<s;)d[m+u]=t[u];for(;++a<r;)(v||i<o)&&(d[m+n[a]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=C(l));++n<l;)t[n]=e[n];return t}function Ei(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?Yn(n,r,u):jn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=xa(n)?nt:Vn,o=t?t():{};return i(n,e,Ki(l,2),o)}}function _i(e){return Bl(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=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function hi(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=me(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=me(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 Ai(e){return function(t){var n=Bt(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 bi(e){return function(t){return dt(Wr(Pr(t).replace(Le,"")),e,"")}}function yi(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 Ci(e){return function(t,n,l){var i=me(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 ji(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(n);if(o&&!r&&"wrapper"==Yi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Yi(a=t[i]),s="wrapper"==u?Gi(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Yi(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&&xa(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 Ni(e,t,n,l,i,o,a,r,u,s){var c=128&t,d=1&t,v=2&t,m=24&t,p=512&t,f=v?void 0:yi(e);return function E(){for(var g=arguments.length,_=C(g),h=g;h--;)_[h]=arguments[h];if(m)var S=qi(E),A=Pt(_,S);if(l&&(_=mi(_,l,i,m)),o&&(_=pi(_,o,a,m)),g-=A,m&&g<s){var b=kt(_,S);return xi(e,t,Ni,E.placeholder,n,_,b,r,u,s-g)}var y=d?n:this,D=v?y[e]:e;return g=_.length,r?_=fo(_,r):p&&g>1&&_.reverse(),c&&u<g&&(_.length=u),this&&this!==ze&&this instanceof E&&(D=f||yi(D)),D.apply(y,_)}}function Oi(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 Li(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 Ti(e){return ji(function(t){return t=st(t,Ot(Ki())),Bl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(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/jt(t)));return Bt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function wi(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=C(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 xi(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)&&go(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=pn&&1/Wt(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:$r;function Bi(e){return function(t){var n=eo(t);return n==v?Mt(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(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,m=a;o=a=void 0}var p=c?void 0:Gi(e),f=[e,t,i,o,a,v,m,r,u,s];if(p&&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?mi(r,a,t[4]):a,e[4]=r?kt(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?kt(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,p),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)E=8==t||16==t?function(e,t,n){var l=yi(e);return function i(){for(var o=arguments.length,a=C(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:kt(a,u);if((o-=s.length)<n)return xi(e,t,Ni,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?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=C(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 E=function(e,t,n){var l=1&t,i=yi(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((p?Wl:go)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ta(e,_e[n])&&!Ae.call(l,n)?t:e}function ki(e,t,n,l,i,o){return za(e)&&za(t)&&(o.set(t,e),Ll(e,t,void 0,ki,o),o.delete(t)),e}function Wi(e){return qa(e)?void 0:e}function Hi(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,m=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var p=e[d],f=t[d];if(l)var E=a?l(f,p,d,t,e,o):l(p,f,d,e,t,o);if(void 0!==E){if(E)continue;v=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(p===e||i(p,e,n,l,o)))return m.push(t)})){v=!1;break}}else if(p!==f&&!i(p,f,n,l,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return ho(mo(e,void 0,Ro),e+"")}function zi(e){return dl(e,Sr,Zi)}function Vi(e){return dl(e,Ar,Qi)}var Gi=gn?function(e){return gn.get(e)}:$r;function Yi(e){for(var t=e.name+"",n=_n[t],l=Ae.call(_n,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(Ae.call(On,"placeholder")?On:e).placeholder}function Ki(){var e=On.iteratee||qr;return e=e===qr?bl: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 Al(n)?n:void 0}var Zi=Qt?function(e){return null==e?[]:(e=me(e),at(Qt(e),function(t){return Ge.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)ct(t,Zi(e)),e=je(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=No(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(xa(e)||Pa(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:Ln(je(e))}function lo(e){return xa(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)&&Ta(n[t],e)}function ao(e,t){if(xa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$a(e))||j.test(e)||!H.test(e)||null!=t&&e in me(t)}function ro(e){var t=Yi(e),n=On[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=A||vn&&eo(new vn)!=v||mn&&"[object Promise]"!=eo(mn.resolve())||pn&&eo(new pn)!=E||fn&&eo(new fn)!=h)&&(eo=function(e){var t=vl(e),n=t==p?e.constructor:void 0,l=n?Oo(n):"";if(l)switch(l){case hn:return A;case Sn:return v;case An:return"[object Promise]";case bn:return E;case yn:return h}return t});var uo=he?Wa:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}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 me(n))}}function mo(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=C(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=C(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function po(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 Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=Ao(Wl),_o=Jt||function(e,t){return ze.setTimeout(e,t)},ho=Ao(Hl);function So(e,t,n){var l=t+"";return ho(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 Ao(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 bo(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 yo,Co,Do=(yo=ya(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=yo.cache,yo);function No(e){if("string"==typeof e||$a(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Oo(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Bl(function(e,t){return Ba(e)?Zn(e,il(t,1,Ba,!0)):[]}),Io=Bl(function(e,t){var n=ko(t);return Ba(n)&&(n=void 0),Ba(e)?Zn(e,il(t,1,Ba,!0),Ki(n,2)):[]}),wo=Bl(function(e,t){var n=ko(t);return Ba(n)&&(n=void 0),Ba(e)?Zn(e,il(t,1,Ba,!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)),Et(e,Ki(t,3),i)}function xo(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)),Et(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 Bo=Bl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Mo=Bl(function(e){var t=ko(e),n=st(e,li);return t===ko(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Ki(t,2)):[]}),Uo=Bl(function(e){var t=ko(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function ko(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Wo=Bl(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?Pl(e,t):e}var jo=ji(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(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=Bl(function(e){return Jl(il(e,1,Ba,!0))}),Go=Bl(function(e){var t=ko(e);return Ba(t)&&(t=void 0),Jl(il(e,1,Ba,!0),Ki(t,2))}),Yo=Bl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,Jl(il(e,1,Ba,!0),void 0,t)});function qo(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,At(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=Bl(function(e,t){return Ba(e)?Zn(e,t):[]}),Jo=Bl(function(e){return ti(at(e,Ba))}),$o=Bl(function(e){var t=ko(e);return Ba(t)&&(t=void 0),ti(at(e,Ba),Ki(t,2))}),Zo=Bl(function(e){var t=ko(e);return t="function"==typeof t?t:void 0,ti(at(e,Ba),void 0,t)}),Qo=Bl(qo),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,Ko(e,n)});function ta(e){var t=On(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var la=ji(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 wn&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=gi(function(e,t,n){Ae.call(e,n)?++e[n]:Yn(e,n,1)}),oa=Ci(Po),aa=Ci(xo);function ra(e,t){return(xa(e)?lt:Qn)(e,Ki(t,3))}function ua(e,t){return(xa(e)?it:el)(e,Ki(t,3))}var sa=gi(function(e,t,n){Ae.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ca=Bl(function(e,t,n){var l=-1,i="function"==typeof t,o=Fa(e)?C(e.length):[];return Qn(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),da=gi(function(e,t,n){Yn(e,n,t)});function va(e,t){return(xa(e)?st:Dl)(e,Ki(t,3))}var ma=gi(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&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,n){return t=n?void 0:t,Mi(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 _a=Bl(function(e,t,n){var l=1;if(n.length){var i=kt(n,qi(_a));l|=32}return Mi(e,l,t,n,i)}),ha=Bl(function(e,t,n){var l=3;if(n.length){var i=kt(n,qi(ha));l|=32}return Mi(t,l,e,n,i)});function Sa(e,t,l){var i,o,a,r,u,s,c=0,d=!1,v=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function p(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=_o(g,t),d?p(e):r}function E(e){var n=e-s;return void 0===s||n>=t||n<0||v&&e-c>=a}function g(){var e=fa();if(E(e))return _(e);u=_o(g,function(e){var n=t-(e-s);return v?an(n,a-(e-c)):n}(e))}function _(e){return u=void 0,m&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),n=E(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(v)return ui(u),u=_o(g,t),p(s)}return void 0===u&&(u=_o(g,t)),r}return t=or(t)||0,za(l)&&(d=!!l.leading,a=(v="maxWait"in l)?on(or(l.maxWait)||0,t):a,m="trailing"in l?!!l.trailing:m),h.cancel=function(){void 0!==u&&ui(u),c=0,i=s=o=u=void 0},h.flush=function(){return void 0===u?r:_(fa())},h}var Aa=Bl(function(e,t){return $n(e,1,t)}),ba=Bl(function(e,t,n){return $n(e,or(t)||0,n)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(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(ya.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)}}ya.Cache=Rn;var Da=ai(function(e,t){var n=(t=1==t.length&&xa(t[0])?st(t[0],Ot(Ki())):st(il(t,1),Ot(Ki()))).length;return Bl(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)})}),Na=Bl(function(e,t){return Mi(e,32,void 0,t,kt(t,qi(Na)))}),Oa=Bl(function(e,t){return Mi(e,64,void 0,t,kt(t,qi(Oa)))}),La=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Pi(ml),wa=Pi(function(e,t){return e>=t}),Pa=_l(function(){return arguments}())?_l:function(e){return Va(e)&&Ae.call(e,"callee")&&!Ge.call(e,"callee")},xa=C.isArray,Ra=Xe?Ot(Xe):function(e){return Va(e)&&vl(e)==S};function Fa(e){return null!=e&&ja(e.length)&&!Wa(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=en||ou,Ua=Je?Ot(Je):function(e){return Va(e)&&vl(e)==u};function ka(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 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=$e?Ot($e):function(e){return Va(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Va(e)&&vl(e)==m}function qa(e){if(!Va(e)||vl(e)!=p)return!1;var t=je(e);if(null===t)return!0;var n=Ae.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Ka=Ze?Ot(Ze):function(e){return Va(e)&&vl(e)==f},Xa=Qe?Ot(Qe):function(e){return Va(e)&&eo(e)==E};function Ja(e){return"string"==typeof e||!xa(e)&&Va(e)&&vl(e)==g}function $a(e){return"symbol"==typeof e||Va(e)&&vl(e)==_}var Za=et?Ot(et):function(e){return Va(e)&&ja(e.length)&&!!Be[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(pt&&e[pt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[pt]());var t=eo(e);return(t==v?Mt:t==E?Wt:Tr)(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=Nt(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 Ei(e,Ar(e))}function rr(e){return null==e?"":Xl(e)}var ur=_i(function(e,t){if(so(t)||Fa(t))Ei(t,Sr(t),e);else for(var n in t)Ae.call(t,n)&&jn(e,n,t[n])}),sr=_i(function(e,t){Ei(t,Ar(t),e)}),cr=_i(function(e,t,n,l){Ei(t,Ar(t),e,l)}),dr=_i(function(e,t,n,l){Ei(t,Sr(t),e,l)}),vr=ji(qn),mr=Bl(function(e,t){e=me(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=Ar(o),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||Ta(c,_e[s])&&!Ae.call(e,s))&&(e[s]=o[s])}return e}),pr=Bl(function(e){return e.push(void 0,ki),tt(yr,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&&to(e,t,fl)}var gr=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},zr(Yr)),_r=Oi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Ae.call(e,t)?e[t].push(n):e[t]=[n]},Ki),hr=Bl(gl);function Sr(e){return Fa(e)?Mn(e):yl(e)}function Ar(e){return Fa(e)?Mn(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Ae.call(e,l))&&n.push(l);return n}(e)}var br=_i(function(e,t,n){Ll(e,t,n)}),yr=_i(function(e,t,n,l){Ll(e,t,n,l)}),Cr=ji(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}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)$l(n,t[i]);return n}),Dr=ji(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(Vi(e),function(e){return[e]});return t=Ki(t),wl(e,n,function(e,n){return t(e,n[0])})}var Or=Bi(Sr),Lr=Bi(Ar);function Tr(e){return null==e?[]:Lt(e,Sr(e))}var Ir=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return kr(rr(e).toLowerCase())}function Pr(e){return(e=rr(e))&&e.replace(re,xt).replace(Te,"")}var xr=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Rr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=Ai("toLowerCase"),Br=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Mr=bi(function(e,t,n){return e+(n?" ":"")+kr(t)}),Ur=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),kr=Ai("toUpperCase");function Wr(e,t,n){return e=rr(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Hr=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return ka(e)?e:new ce(e)}}),jr=ji(function(e,t){return lt(t,function(t){t=No(t),Yn(e,t,_a(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Di(),Gr=Di(!0);function Yr(e){return e}function qr(e){return bl("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 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=Ti(st),Qr=Ti(ot),eu=Ti(mt);function tu(e){return ao(e)?At(No(e)):function(e){return function(t){return cl(t,e)}}(e)}var nu=wi(),lu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Li(function(e,t){return e+t},0),uu=Ri("ceil"),su=Li(function(e,t){return e/t},1),cu=Ri("floor"),du=Li(function(e,t){return e*t},1),vu=Ri("round"),mu=Li(function(e,t){return e-t},0);return On.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)}},On.ary=Ea,On.assign=ur,On.assignIn=sr,On.assignInWith=cr,On.assignWith=dr,On.at=vr,On.before=ga,On.bind=_a,On.bindAll=jr,On.bindKey=ha,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xa(e)?e:[e]},On.chain=ta,On.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=C($t(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},On.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},On.concat=function(){var e=arguments.length;if(!e)return[];for(var t=C(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(xa(n)?fi(n):[n],il(t,1))},On.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 Ee(n);return[l(e[0]),e[1]]}):[],Bl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},On.conforms=function(e){return function(e){var t=Sr(e);return function(n){return Jn(n,e,t)}}(Xn(e,1))},On.constant=zr,On.countBy=ia,On.create=function(e,t){var n=Ln(e);return null==t?n:Gn(n,t)},On.curry=function e(t,n,l){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},On.curryRight=function e(t,n,l){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},On.debounce=Sa,On.defaults=mr,On.defaultsDeep=pr,On.defer=Aa,On.delay=ba,On.difference=To,On.differenceBy=Io,On.differenceWith=wo,On.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):[]},On.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):[]},On.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!0,!0):[]},On.dropWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!0):[]},On.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)):[]},On.filter=function(e,t){return(xa(e)?at:ll)(e,Ki(t,3))},On.flatMap=function(e,t){return il(va(e,t),1)},On.flatMapDeep=function(e,t){return il(va(e,t),1/0)},On.flatMapDepth=function(e,t,n){return n=void 0===n?1:lr(n),il(va(e,t),n)},On.flatten=Ro,On.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},On.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:lr(t)):[]},On.flip=function(e){return Mi(e,512)},On.flow=Vr,On.flowRight=Gr,On.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},On.functions=function(e){return null==e?[]:sl(e,Sr(e))},On.functionsIn=function(e){return null==e?[]:sl(e,Ar(e))},On.groupBy=sa,On.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},On.intersection=Bo,On.intersectionBy=Mo,On.intersectionWith=Uo,On.invert=gr,On.invertBy=_r,On.invokeMap=ca,On.iteratee=qr,On.keyBy=da,On.keys=Sr,On.keysIn=Ar,On.map=va,On.mapKeys=function(e,t){var n={};return t=Ki(t,3),rl(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},On.mapValues=function(e,t){var n={};return t=Ki(t,3),rl(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},On.matches=function(e){return Nl(Xn(e,1))},On.matchesProperty=function(e,t){return Ol(e,Xn(t,1))},On.memoize=ya,On.merge=br,On.mergeWith=yr,On.method=Kr,On.methodOf=Xr,On.mixin=Jr,On.negate=Ca,On.nthArg=function(e){return e=lr(e),Bl(function(t){return Tl(t,e)})},On.omit=Cr,On.omitBy=function(e,t){return Nr(e,Ca(Ki(t)))},On.once=function(e){return ga(2,e)},On.orderBy=function(e,t,n,l){return null==e?[]:(xa(t)||(t=null==t?[]:[t]),xa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},On.over=Zr,On.overArgs=Da,On.overEvery=Qr,On.overSome=eu,On.partial=Na,On.partialRight=Oa,On.partition=ma,On.pick=Dr,On.pickBy=Nr,On.property=tu,On.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},On.pull=Wo,On.pullAll=Ho,On.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,Ki(n,2)):e},On.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Pl(e,t,void 0,n):e},On.pullAt=jo,On.range=nu,On.rangeRight=lu,On.rearg=La,On.reject=function(e,t){return(xa(e)?at:ll)(e,Ca(Ki(t,3)))},On.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 xl(e,i),n},On.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Bl(e,t=void 0===t?t:lr(t))},On.reverse=zo,On.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),(xa(e)?kn:Ul)(e,t)},On.set=function(e,t,n){return null==e?e:kl(e,t,n)},On.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:kl(e,t,n,l)},On.shuffle=function(e){return(xa(e)?Wn:jl)(e)},On.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)):[]},On.sortBy=pa,On.sortedUniq=function(e){return e&&e.length?ql(e):[]},On.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Ki(t,2)):[]},On.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))&&Bt(e)?ri(zt(e),0,n):e.split(t,n):[]},On.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],i=ri(n,0,t);return l&&ct(i,l),tt(e,this,i)})},On.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},On.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:lr(t))<0?0:t):[]},On.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):[]},On.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?Ql(e,Ki(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(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})},On.thru=na,On.toArray=tr,On.toPairs=Or,On.toPairsIn=Lr,On.toPath=function(e){return xa(e)?st(e,No):$a(e)?[e]:fi(Do(rr(e)))},On.toPlainObject=ar,On.transform=function(e,t,n){var l=xa(e),i=l||Ma(e)||Za(e);if(t=Ki(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:za(e)&&Wa(o)?Ln(je(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},On.unary=function(e){return Ea(e,1)},On.union=Vo,On.unionBy=Go,On.unionWith=Yo,On.uniq=function(e){return e&&e.length?Jl(e):[]},On.uniqBy=function(e,t){return e&&e.length?Jl(e,Ki(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jl(e,void 0,t):[]},On.unset=function(e,t){return null==e||$l(e,t)},On.unzip=qo,On.unzipWith=Ko,On.update=function(e,t,n){return null==e?e:Zl(e,t,ii(n))},On.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Zl(e,t,ii(n),l)},On.values=Tr,On.valuesIn=function(e){return null==e?[]:Lt(e,Ar(e))},On.without=Xo,On.words=Wr,On.wrap=function(e,t){return Na(ii(t),e)},On.xor=Jo,On.xorBy=$o,On.xorWith=Zo,On.zip=Qo,On.zipObject=function(e,t){return ni(e||[],t||[],jn)},On.zipObjectDeep=function(e,t){return ni(e||[],t||[],kl)},On.zipWith=ea,On.entries=Or,On.entriesIn=Lr,On.extend=sr,On.extendWith=cr,Jr(On,On),On.add=ru,On.attempt=Hr,On.camelCase=Ir,On.capitalize=wr,On.ceil=uu,On.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)},On.clone=function(e){return Xn(e,4)},On.cloneDeep=function(e){return Xn(e,5)},On.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},On.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},On.conformsTo=function(e,t){return null==t||Jn(e,t,Sr(t))},On.deburr=Pr,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=su,On.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},On.eq=Ta,On.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,Rt):e},On.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},On.every=function(e,t,n){var l=xa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Ki(t,3))},On.find=oa,On.findIndex=Po,On.findKey=function(e,t){return ft(e,Ki(t,3),rl)},On.findLast=aa,On.findLastIndex=xo,On.findLastKey=function(e,t){return ft(e,Ki(t,3),ul)},On.floor=cu,On.forEach=ra,On.forEachRight=ua,On.forIn=function(e,t){return null==e?e:ol(e,Ki(t,3),Ar)},On.forInRight=function(e,t){return null==e?e:al(e,Ki(t,3),Ar)},On.forOwn=function(e,t){return e&&rl(e,Ki(t,3))},On.forOwnRight=function(e,t){return e&&ul(e,Ki(t,3))},On.get=fr,On.gt=Ia,On.gte=wa,On.has=function(e,t){return null!=e&&to(e,t,pl)},On.hasIn=Er,On.head=Fo,On.identity=Yr,On.includes=function(e,t,n,l){e=Fa(e)?e:Tr(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&>(e,t,n)>-1},On.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)),gt(e,t,i)},On.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)},On.invoke=hr,On.isArguments=Pa,On.isArray=xa,On.isArrayBuffer=Ra,On.isArrayLike=Fa,On.isArrayLikeObject=Ba,On.isBoolean=function(e){return!0===e||!1===e||Va(e)&&vl(e)==r},On.isBuffer=Ma,On.isDate=Ua,On.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},On.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(xa(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Pa(e)))return!e.length;var t=eo(e);if(t==v||t==E)return!e.size;if(so(e))return!yl(e).length;for(var n in e)if(Ae.call(e,n))return!1;return!0},On.isEqual=function(e,t){return hl(e,t)},On.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},On.isError=ka,On.isFinite=function(e){return"number"==typeof e&&tn(e)},On.isFunction=Wa,On.isInteger=Ha,On.isLength=ja,On.isMap=Ga,On.isMatch=function(e,t){return e===t||Sl(e,t,Ji(t))},On.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Ji(t),n)},On.isNaN=function(e){return Ya(e)&&e!=+e},On.isNative=function(e){if(uo(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Al(e)},On.isNil=function(e){return null==e},On.isNull=function(e){return null===e},On.isNumber=Ya,On.isObject=za,On.isObjectLike=Va,On.isPlainObject=qa,On.isRegExp=Ka,On.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},On.isSet=Xa,On.isString=Ja,On.isSymbol=$a,On.isTypedArray=Za,On.isUndefined=function(e){return void 0===e},On.isWeakMap=function(e){return Va(e)&&eo(e)==h},On.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==vl(e)},On.join=function(e,t){return null==e?"":nn.call(e,t)},On.kebabCase=xr,On.last=ko,On.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):Et(e,ht,i,!0)},On.lowerCase=Rr,On.lowerFirst=Fr,On.lt=Qa,On.lte=er,On.max=function(e){return e&&e.length?nl(e,Yr,ml):void 0},On.maxBy=function(e,t){return e&&e.length?nl(e,Ki(t,2),ml):void 0},On.mean=function(e){return St(e,Yr)},On.meanBy=function(e,t){return St(e,Ki(t,2))},On.min=function(e){return e&&e.length?nl(e,Yr,Cl):void 0},On.minBy=function(e,t){return e&&e.length?nl(e,Ki(t,2),Cl):void 0},On.stubArray=iu,On.stubFalse=ou,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=du,On.nth=function(e,t){return e&&e.length?Tl(e,lr(t)):void 0},On.noConflict=function(){return ze._===this&&(ze._=Ne),this},On.noop=$r,On.now=fa,On.pad=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Zt(i),n)+e+Ii($t(i),n)},On.padEnd=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?e+Ii(t-l,n):e},On.padStart=function(e,t,n){e=rr(e);var l=(t=lr(t))?jt(e):0;return t&&l<t?Ii(t-l,n)+e:e},On.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(rr(e).replace(Y,""),t||0)},On.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+ke("1e-"+((i+"").length-1))),t)}return Rl(e,t)},On.reduce=function(e,t,n){var l=xa(e)?dt:yt,i=arguments.length<3;return l(e,Ki(t,4),n,i,Qn)},On.reduceRight=function(e,t,n){var l=xa(e)?vt:yt,i=arguments.length<3;return l(e,Ki(t,4),n,i,el)},On.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:lr(t),Fl(rr(e),t)},On.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.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[No(t[l])];void 0===o&&(l=i,o=n),e=Wa(o)?o.call(e):o}return e},On.round=vu,On.runInContext=e,On.sample=function(e){return(xa(e)?Un:Ml)(e)},On.size=function(e){if(null==e)return 0;if(Fa(e))return Ja(e)?jt(e):e.length;var t=eo(e);return t==v||t==E?e.size:yl(e).length},On.snakeCase=Br,On.some=function(e,t,n){var l=xa(e)?mt:Vl;return n&&oo(e,t,n)&&(t=void 0),l(e,Ki(t,3))},On.sortedIndex=function(e,t){return Gl(e,t)},On.sortedIndexBy=function(e,t,n){return Yl(e,t,Ki(n,2))},On.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&Ta(e[l],t))return l}return-1},On.sortedLastIndex=function(e,t){return Gl(e,t,!0)},On.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Ki(n,2),!0)},On.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ta(e[n],t))return n}return-1},On.startCase=Mr,On.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},On.subtract=mu,On.sum=function(e){return e&&e.length?Ct(e,Yr):0},On.sumBy=function(e,t){return e&&e.length?Ct(e,Ki(t,2)):0},On.template=function(e,t,n){var l=On.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=rr(e),t=cr({},t,l,Ui);var i,o,a=cr({},t.imports,l.imports,Ui),r=Sr(a),u=Lt(a,r),s=0,c=t.interpolate||ue,d="__p += '",v=pe((t.escape||ue).source+"|"+c.source+"|"+(c===W?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Ae.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 p=Ae.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(w,""):d).replace(P,"$1").replace(x,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"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=Hr(function(){return de(r,m+"return "+d).apply(void 0,u)});if(f.source=d,ka(f))throw f;return f},On.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},On.toFinite=nr,On.toInteger=lr,On.toLength=ir,On.toLower=function(e){return rr(e).toLowerCase()},On.toNumber=or,On.toSafeInteger=function(e){return e?Kn(lr(e),-9007199254740991,9007199254740991):0===e?e:0},On.toString=rr,On.toUpper=function(e){return rr(e).toUpperCase()},On.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),i=zt(t);return ri(l,It(l,i),wt(l,i)+1).join("")},On.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,wt(l,zt(t))+1).join("")},On.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 ri(l,It(l,zt(t))).join("")},On.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(Bt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-jt(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=pe(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},On.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(R,Gt):e},On.uniqueId=function(e){var t=++be;return rr(e)+t},On.upperCase=Ur,On.upperFirst=kr,On.each=ra,On.eachRight=ua,On.first=Fo,Jr(On,(au={},rl(On,function(e,t){Ae.call(On.prototype,t)||(au[t]=e)}),au),{chain:!1}),On.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){On[e].placeholder=On}),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:Ki(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(Ki(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),i=On[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(On.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof wn,u=a[0],s=r||xa(t),c=function(e){var t=i.apply(On,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,m=o&&!d,p=r&&!v;if(!o&&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 m&&p?e.apply(this,a):(f=this.thru(c),m?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);On.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(xa(i)?i:[],e)}return this[n](function(n){return t.apply(xa(n)?n:[],e)})}}),rl(wn.prototype,function(e,t){var n=On[t];if(n){var l=n.name+"";Ae.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(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},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=xa(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,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&v<m;){for(var f=-1,E=e[s+=t];++f<d;){var g=c[f],_=g.type,h=(0,g.iteratee)(E);if(2==_)E=h;else if(!h){if(1==_)continue e;break e}}p[v++]=E}return p},On.prototype.at=la,On.prototype.chain=function(){return ta(this)},On.prototype.commit=function(){return new In(this.value(),this.__chain__)},On.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__++]}},On.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var l=Lo(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},On.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:[zo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(zo)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,pt&&(On.prototype[pt]=function(){return this}),On}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(C)});function Nn(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")))))})))}const On=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(),[m,p]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState([]),[h,S]=n.useState(!0),[A,b]=n.useState(!1),[y,C]=n.useState(!1),{isLoading:D,data:N}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:O,data:L}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=N&&null!==(e=N.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==N||null===(o=N.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==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,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)),_(s)},[!D,!O]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;m.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||!(m.length>0))},[m,A]),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(Ln,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:y}))))};function Ln(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:v,checkEnablingDocs:m}=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===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[_,h]=n.useState(null),[S,A]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[b,y]=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==_?void 0:_.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{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.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})}),v[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(v)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[_]),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(Nn,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?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 i;0!==Object.keys(n).length&&y(l),(i=l[l.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Tn(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(Nn,{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 In(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(),[m,p]=n.useState(null),[f,E]=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==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,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?E(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)}}()},[m]),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])&&p(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const wn=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(),m=(null==s?void 0:s.status)||"",p=(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:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[_,h]=n.useState([]),[S,A]=n.useState([]),[b,y]=n.useState(!1),[C,D]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[N,O]=n.useState(null),L=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),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==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},i.push(l[0].docTypes[0]));let v=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.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)}),A(v))},[f,_]),n.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===m&&(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?""+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:L?""+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:L?""+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(Nn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(In,{key:t,document:e,t:o,error:N,setError:O,setNocDocuments:D,nocDocuments:C,checkEnablingDocs:b}))))},Pn=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,c,v]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=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:m?"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 i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:m?"96%":"830px",width:m?"96%":"830px"},style:m?{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:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function xn(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 Rn(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 Fn(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 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"},i.map((e,n)=>{var i;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===(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:c}))}))))})))}const Bn=e=>{var i,a,r,u,s,c,d,v,m,p,f,E,g,_,h,S,A,b,y,C,D,N,O;let{scrutinyDetails:L,paymentsList:T=[],additionalDetails:I,applicationData:w}=e;const P=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[x,R]=n.useState(),[F,B]=n.useState(),[M,U]=n.useState(),k=Digit.ULBService.getStateId(),[W,H]=n.useState(),[j,z]=n.useState(),[V,G]=n.useState([]),[Y,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(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)$(oe("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Y,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?G([...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)}}()},[Y]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,i,o,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,i;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===(i=I.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,k).then(e=>Q(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===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.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: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!=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===(i=L.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==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:()=>{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==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:oe("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)}},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==I||null===(s=I.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==I||null===(c=I.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==I||null===(d=I.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==I||null===(v=I.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==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:x,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==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_OTHER_CHARGES)||0,value:F,disabled:!P,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,oe("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:oe,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:!P,onChange:e=>{!function(e){H(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==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:M,disabled:!P,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(x)?parseFloat(x):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===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>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:j?"1 "+oe("FILEUPLOADED"):oe("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:K})):null,(null==Z||null===(g=Z.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==I||null===(_=I.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},oe("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Z||null===(h=Z.fileStoreIds)||void 0===h?void 0:h.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==Z||null===(A=Z.fileStoreIds[(null==Z||null===(b=Z.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===A?void 0:A.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(x)?parseFloat(x):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==I||null===(y=I.selfCertificationCharges)||void 0===y?void 0:y.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===(O=L.scruntinyDetails)||void 0===O?void 0:O.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))))))))},Mn=e=>{var i,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:v}=o.useTranslation(),m=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:v(""+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,i,o,a,r;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:Number(null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea).toFixed(2),FloorArea:Number(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea).toFixed(2)||0,key:v("BPA_FLOOR_NAME_"+e.number)})}),n}function _(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:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{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:g(e),columns:E,getCellProps:e=>({style:{}})})))})))},Un=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))},kn=e=>{var i,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,v]=n.useState(!1),{t:m}=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,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Un,{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,m("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"}},m("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"}},m("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,m("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 Hn(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 jn=e=>{var i,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=o.useTranslation();let v=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const p=null==v?void 0:v.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:g,roadCuttingAddlDetails:_,activationDetails:h}=(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"!=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==_?void 0:_.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==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:""})))))))},zn=[{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"}],Vn=[{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"}],Gn=e=>{var i,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation(),[v,m,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[S,A]=n.useState(!1),[b,y]=n.useState(v||{}),[C,D]=n.useState(null),[N,O]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[L,T]=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 i=d({},null==s||null===(e=s.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,u,c,p,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===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==v||null===(c=v.billDetails)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount)}];T(e),O(null==v||null===(f=v.billDetails)||void 0===f?void 0:f[0])}else m(i),y(i)},[]);let w={};const P=e=>l.createElement("h1",{className:"heading-m"},e.label),x=()=>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(x,null)),F=function(e,t,n){void 0===t&&(t=!1);let l=d({},b);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:""}y(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=>{A(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(P,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{y(v),A(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(v),A(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))D({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,v,p,f,g,h,S;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.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===(v=s.additionalDetails)||void 0===v||null===(p=v.appDetails)||void 0===p?void 0:p.additionalDetails,b);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 i="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,i).then((e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,p,f,g,h;(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===(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===(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}];E(ht(e.Calculation[0])),O(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(S),b.billDetails=null==e?void 0:e.Calculation,m(b),A(!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?c(""+(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)):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:zn,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==b||null===(r=b.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==b?void 0:b.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==b?void 0:b.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:Vn,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==b||null===(u=b.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==b?void 0:b.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==b?void 0:b.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})))},Yn=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"})))},qn=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(Yn,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Kn=e=>{var i,a,r,u,s,c,d;let{wsAdditionalDetails:v}=e;const{t:m}=o.useTranslation(),[p,f]=n.useState(!1),[E,g]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),h=()=>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(h,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),g(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:m("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"}},m("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:""+m(""+(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:""+m("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"}},m("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:""+m(""+(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:""+m("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:""+m(""+(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:""+m("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"}})))))},Xn={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:{}},Jn=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:Xn.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Xn.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},Xn.cell,Xn.cellLeft,Xn.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},Xn.cell,n.length==t+1?Xn.cellRight:{},Xn.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:d({},Xn.cell,Xn.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,i)=>l.createElement("td",{style:d({},Xn.cell,{textAlign:"left"},n.length==i+1?Xn.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},Xn.cell,Xn.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},Xn.cell,Xn.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:d({},Xn.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Xn.cell,key:t,numeric:!0})))))))},$n={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,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 m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let p=[];p=Object.keys(m),p.sort((e,t)=>m[e]-m[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:$n.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Jn,{headers:[...p],values:s,arrears:v}),!f&&l.createElement("div",{style:$n.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:$n.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Qn=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)))))};function el(e){var a,r,u,s,c,v,m,p,f,E,g,h,S,A,b,y;let{applicationDetails:C,demandData:D,workflowDetails:N,isDataLoading:O,applicationData:L,businessService:T,timelineStatusPrefix:I,showTimeLine:w=!0,statusAttribute:P="status",paymentsList:x,oldValue:R,isInfoLabel:F=!1,propertyId:B,moduleCode:M}=e;const{t:U}=o.useTranslation(),k=i.useHistory(),W=Digit.ULBService.getCurrentTenantId(),[H,j]=n.useState(null),[z,V]=n.useState([]);let G=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function Y(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[q,K]=n.useState({}),[X,J]=n.useState(),[$,Z]=n.useState([]),[Q,ee]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||Q.loading||Q.loaded||Q.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Q||!Q.canLoad||Q.loading||Q.loaded||(ee({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 Z(o),console.log(o),J(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==L?void 0:L.tenantId)||W,null==L?void 0:L.propertyId,K,ee));const te=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()},ne=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:te(null==L||null===(i=L.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==L?void 0:L.channel)||""};return l.createElement(kn,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s;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}}},c=n[t-1],d={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,comment:U(null==e?void 0:e.comment),wfComment:c?c.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(kn,{data:d,OpenImage:Y,privacy:i})}{var c,d,v,m,p;const t={date:te(null==L||null===(c=L.auditDetails)||void 0===c?void 0:c.lastModifiedTime),name:null==e||null===(d=e.assignes)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(m=e.assignes)||void 0===m||null===(p=m[0])||void 0===p?void 0:p.mobileNumber};return l.createElement(kn,{data:t})}},le=(e,t)=>e?t?e:U(e):U("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+U(null==e?void 0:e.isUnit):U("N/A"):null!=e&&e.value?le(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):U("N/A"),[se,ce]=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 de=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)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ve=null==C?void 0:C.applicationData,me=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C,T),console.log("infolabel",F),console.log("assessment details",X),n.useEffect(()=>{try{let e={consumerCodes:B};const t=!0;"BPREG"===M?Digit.OBPSService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)}):Digit.PTService.paymentsearch({tenantId:W,filters:e,auth:t}).then(e=>{V(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},F?l.createElement(qn,{t:U,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,o)=>{var a,r,u,s,c,d,v,m,p,f,E,g,_,h,S,A,b,y,D,O,L,T,I,w,P,F,B,M,k,W,H,j,z,V,Y,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"}:ie?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==o||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+U(e.title):U(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},U(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"}},U(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"}},U(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},U(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{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:U(n.title),label:U(n.title),text:l.createElement("img",{src:U(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:U(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"}},U(null==n?void 0:n.title)))):oe||ae?""+U(n.title):U(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:re(),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:""+U(""+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:U(n.title),label:U(n.title),text:ue(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:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Zn,{bill:null===(r=q.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(Bn,{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===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(Tn,{fiReport:null==C||null===(m=C.applicationData)||void 0===m||null===(p=m.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(Rn,{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(Fn,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(Hn,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.accessories)&&l.createElement(Wn,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!G&&(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.permissions)&&(null==N||null===(D=N.data)||void 0===D||null===(O=D.nextActions)||void 0===O?void 0:O.length)>0&&l.createElement(Pn,{applicationData:null==C?void 0:C.applicationData,t:U,permissions:null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(On,{t:U,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(wn,{t:U,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===(P=e.additionalDetails)||void 0===P?void 0:P.scruntinyDetails)&&l.createElement(Bn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(Bn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&l.createElement(Mn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.documentsWithUrl)&&l.createElement(Nn,{documents:null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(xn,{taxHeadEstimatesCalculation:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(jn,{wsAdditionalDetails:e,oldValue:R}),(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(i.Link,{to:null==e||null===(z=e.additionalDetails)||void 0===z||null===(V=z.redirectUrl)||void 0===V?void 0:V.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(K=Y.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Gn,{wsAdditionalDetails:e,workflowDetails:N}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&l.createElement(Kn,{wsAdditionalDetails:e,workflowDetails:N}))}),(null==X?void 0:X.length)>0&&l.createElement(Qn,{assessmentData:$}),w&&(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)||O)&&l.createElement(t.Loader,null),!(null!=N&&N.isLoading)&&!O&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},U("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=N&&null!==(v=N.data)&&void 0!==v&&v.timeline&&1===(null==N||null===(m=N.data)||void 0===m||null===(p=m.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:U(""+I+(null==N||null===(f=N.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ne(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===(A=N.data)||void 0===A?void 0:A.timeline.slice(0,se?null==N?void 0:N.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!=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!==(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:U(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[P])+a),customChild:ne(e,n,null==N||null===(o=N.data)||void 0===o?void 0:o.timeline)}))}))),(null==N||null===(b=N.data)||void 0===b||null===(y=b.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:U(se?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ce(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"==pe?de(ve,"ACTIVE",me):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"==pe?de(ve,"INACTIVE",me):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)&&k.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)&&k.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),H&&l.createElement(t.Toast,{error:H.isError,label:U(H.label),onClose:()=>{j(null)},isDleteBtn:"false"}))}function tl(e){var n,i,o,a,r,u,s,c,d,v,m,p,f,E,g,_,h,S;let{t:A,showToast:b,closeToast:y,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==b||null===(D=b.action)||void 0===D?void 0:D.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:A("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:A("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:A("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:A("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:A("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:A("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:A("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:A("ES_"+C+"_"+(null==b||null===(d=b.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:y}))}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")?A(e[1]):A(e[0]),n};let n="";switch(null==b||null===(N=b.action)||void 0===N?void 0:N.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.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==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.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==b?void 0:b.key)?null==b||null===(g=b.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==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:A("ES_"+C+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:y}))}{var O,L;const e="error"===(null==b?void 0:b.key)?null==b||null===(O=b.error)||void 0===O?void 0:O.message:"ES_"+C+"_"+(null==b||null===(L=b.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:A(e),onClose:y}))}}function nl(e){var i,a,r,u,s,c,v,m,p,f,E,g,_,h,S,A;let{workflowDetails:b,displayMenu:y,onActionSelect:C,setDisplayMenu:D,businessService:N,forcedActionPrefix:O,ActionBarStyle:L={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=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):{};w=null==t?void 0:t.value}const x=null===(i=w)||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,B=(null==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(v=b.data)||void 0===v||null===(m=v.nextActions)||void 0===m?void 0:m.filter(e=>(null==x?void 0:x.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("ActionsInPayment",b),Digit.Hooks.useClickOutside(P,()=>{D(!1)},y),(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!=b&&b.isLoading)&&F&&!R&&l.createElement(t.ActionBar,{style:d({},L)},y&&(null!=b&&null!==(E=b.data)&&void 0!==E&&null!==(g=E.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(_=b.data)&&void 0!==_&&_.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:C,style:T}):null,l.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!y)})),!(null!=b&&b.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===(h=B[0])||void 0===h?void 0:h.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((O||"WF_EMPLOYEE_"+(null==N?void 0:N.toUpperCase()))+"_"+(null==B||null===(A=B[0])||void 0===A?void 0:A.action)))))}const ll=()=>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"})),il=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ll,null));function ol(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(il,{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 al=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(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[g,_]=n.useState(!1),[h,S]=n.useState(null),[A,b]=n.useState(!1),[y,C]=n.useState(!1),[D,N]=n.useState(!1),{data:O}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:L,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:x,isLoading:R,isDataLoading:F,applicationData:B,mutate:M,nocMutation:U,workflowDetails:k,id:W,businessService:H,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:J=!0,oldValue:$,isInfoLabel:Z=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{P&&k.revalidate()},[P]);const te=a.useQueryClient(),ne=()=>{S(null),b(!1)};return console.log("ActionsInPayment2",k),R||y?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(el,{applicationDetails:L,demandData:T,id:W,workflowDetails:k,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:H,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:J,oldValue:$,isInfoLabel:Z,propertyId:ee,moduleCode:z}),A?l.createElement(Cn,{t:p,action:h,tenantId:c,state:v,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 i=function(i,o,a,r,u,s,c,v,m,E,g,_,S,A,b,y,D,N){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===(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===(v=c.additionalDetail)||void 0===v||null===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(g=E[0])||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(A=S.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(y=b.comment)||void 0===y?void 0:y.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(N=D.comment)||void 0===N?void 0:N.length)){var O,L;"INITIATE"===(null==e||null===(O=e.Licenses)||void 0===O||null===(L=O[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 i=function(i,o,a,r,u){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===(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),x({key:"error",error:e}),setTimeout(j,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=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,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,m,E,g,_;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?x({key:"success",label:p("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")?x({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?x({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(_=g.workflow)&&void 0!==_&&_.action.includes("REJECT")&&x({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S,A,b;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!==(A=S.businessService)&&void 0!==A&&A.includes("BPAREG")?(x({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(x({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(b=e.Licenses[0])||void 0===b?void 0:b.applicationNumber)));x({key:"success",action:h}),Q&&setTimeout(Q,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 i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=wt(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,m;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?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===(v=d.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;ne(),x({key:"error",error:{message:f}}),setTimeout(j,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(p("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==k||null===(r=k.data)||void 0===r?void 0:r.timeline,businessService:H,workflowDetails:k,moduleCode:z,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(ol,{action:h,workflowDetails:k,businessService:H,isWarningPop:D,closeWarningPopup:()=>{N(!1)}}):null,l.createElement(tl,{t:p,showToast:P,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 console.log("JJJJJJ"),Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==O||null===(t=O.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===(i=l.plot)||void 0===i?void 0:i.area,null==L||null===(o=L.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");const s=function(e,t,n,l,i,o,a,r,s,d,v,m){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===(d=u.BPA)||void 0===d||null===(v=d.additionalDetails)||void 0===v||null===(m=v.selfCertificationCharges)||void 0===m?void 0:m.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(nl,{workflowDetails:k,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 i,o,a,r,u;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===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.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 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"),b(!0);else{var m,p;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:d({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else b(!0);S(e),_(!1)},setDisplayMenu:_,businessService:H,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function rl(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]),[m,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==m?void 0:m.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])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const ul=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)))))},sl=e=>{let{statuses:i,isInboxLoading:a,controlFilterForm:u,setFilterFormValue:s,applicationTypesOfBPA:c}=e;const{t:d}=o.useTranslation(),v=(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:v.filter(t=>t.code===e.value)[0],optionsKey:"name",options:v})})),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()||[]}))})),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 cl(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 dl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function vl(e){dl(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 ml(e,t){dl(2,arguments);var n=vl(e).getTime(),l=cl(t);return new Date(n+l)}function pl(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 fl(e){return dl(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function El(e){if(dl(1,arguments),!fl(e)&&"number"!=typeof e)return!1;var t=vl(e);return!isNaN(Number(t))}var gl={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 _l(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 hl={date:_l({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:_l({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:_l({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 Al(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 bl(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)?Cl(u,function(e){return e.test(r)}):yl(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 yl(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Cl(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var Dl,Nl={code:"en-US",formatDistance:function(e,t,n){var l,i=gl[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:hl,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:Al({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Al({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:Al({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:Al({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:Al({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:(Dl={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(Dl.matchPattern);if(!n)return null;var l=n[0],i=e.match(Dl.parsePattern);if(!i)return null;var o=Dl.valueCallback?Dl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(l.length);return{value:o,rest:a}}),era:bl({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:bl({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:bl({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:bl({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:bl({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 Ol(e,t){dl(2,arguments);var n=cl(t);return ml(e,-n)}function Ll(e){dl(1,arguments);var t=1,n=vl(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 Tl(e){dl(1,arguments);var t=vl(e),n=t.getUTCFullYear(),l=new Date(0);l.setUTCFullYear(n+1,0,4),l.setUTCHours(0,0,0,0);var i=Ll(l),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Ll(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Il(e){dl(1,arguments);var t=Tl(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var l=Ll(n);return l}function wl(e,t){dl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.weekStartsOn,o=null==i?0:cl(i),a=null==n.weekStartsOn?o:cl(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=vl(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 Pl(e,t){dl(1,arguments);var n=vl(e),l=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:cl(a),u=null==i.firstWeekContainsDate?r:cl(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=wl(s,t),d=new Date(0);d.setUTCFullYear(l,0,u),d.setUTCHours(0,0,0,0);var v=wl(d,t);return n.getTime()>=c.getTime()?l+1:n.getTime()>=v.getTime()?l:l-1}function xl(e,t){dl(1,arguments);var n=t||{},l=n.locale,i=l&&l.options&&l.options.firstWeekContainsDate,o=null==i?1:cl(i),a=null==n.firstWeekContainsDate?o:cl(n.firstWeekContainsDate),r=Pl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var s=wl(u,t);return s}function Rl(e,t){for(var n=e<0?"-":"",l=Math.abs(e).toString();l.length<t;)l="0"+l;return n+l}var Fl={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 Rl("yy"===t?l%100:l,t.length)}(e,t)},Y:function(e,t,n,l){var i=Pl(e,l),o=i>0?i:1-i;return"YY"===t?Rl(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):Rl(o,t.length)},R:function(e,t){return Rl(Tl(e),t.length)},u:function(e,t){return Rl(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 Rl(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 Rl(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):Rl(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 Rl(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){dl(1,arguments);var n=vl(e),l=wl(n,t).getTime()-xl(n,t).getTime();return Math.round(l/6048e5)+1}(e,l);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):Rl(i,t.length)},I:function(e,t,n){var l=function(e){dl(1,arguments);var t=vl(e),n=Ll(t).getTime()-Il(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(l,{unit:"week"}):Rl(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Rl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var l=function(e){dl(1,arguments);var t=vl(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"}):Rl(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 Rl(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 Rl(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 Rl(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 Rl(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 Rl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var l=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(l,{unit:"hour"}):Rl(l,t.length)},k:function(e,t,n){var l=e.getUTCHours();return 0===l&&(l=24),"ko"===t?n.ordinalNumber(l,{unit:"hour"}):Rl(l,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Rl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Rl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,l=e.getUTCMilliseconds();return Rl(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 Ml(i);case"XXXX":case"XX":return Ul(i);case"XXXXX":case"XXX":default:return Ul(i,":")}},x:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ml(i);case"xxxx":case"xx":return Ul(i);case"xxxxx":case"xxx":default:return Ul(i,":")}},O:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bl(i,":");case"OOOO":default:return"GMT"+Ul(i,":")}},z:function(e,t,n,l){var i=(l._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bl(i,":");case"zzzz":default:return"GMT"+Ul(i,":")}},t:function(e,t,n,l){return Rl(Math.floor((l._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,l){return Rl((l._originalDate||e).getTime(),t.length)}};function Bl(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+Rl(o,2)}function Ml(e,t){return e%60==0?(e>0?"-":"+")+Rl(Math.abs(e)/60,2):Ul(e,t)}function Ul(e,t){var n=t||"",l=e>0?"-":"+",i=Math.abs(e);return l+Rl(Math.floor(i/60),2)+n+Rl(i%60,2)}function kl(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 Wl(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 Hl={p:Wl,P:function(e,t){var n,l=e.match(/(P+)(p+)?/)||[],i=l[1],o=l[2];if(!o)return kl(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}}",kl(i,t)).replace("{{time}}",Wl(o,t))}},jl=["D","DD"],zl=["YY","YYYY"];function Vl(e){return-1!==jl.indexOf(e)}function Gl(e){return-1!==zl.indexOf(e)}function Yl(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 ql=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Kl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xl=/^'([^]*?)'?$/,Jl=/''/g,$l=/[a-zA-Z]/;function Zl(e,t,n){dl(2,arguments);var l=String(t),i=n||{},o=i.locale||Nl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:cl(a),u=null==i.firstWeekContainsDate?r:cl(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:cl(s),d=null==i.weekStartsOn?c:cl(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=vl(e);if(!El(v))throw new RangeError("Invalid time value");var m=pl(v),p=Ol(v,m),f={firstWeekContainsDate:u,weekStartsOn:d,locale:o,_originalDate:v},E=l.match(Kl).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Hl[t])(e,o.formatLong,f):e}).join("").match(ql).map(function(n){if("''"===n)return"'";var l=n[0];if("'"===l)return Ql(n);var a=Fl[l];if(a)return!i.useAdditionalWeekYearTokens&&Gl(n)&&Yl(n,t,e),!i.useAdditionalDayOfYearTokens&&Vl(n)&&Yl(n,t,e),a(p,n,o.localize,f);if(l.match($l))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");return n}).join("");return E}function Ql(e){return e.match(Xl)[1].replace(Jl,"'")}const ei=e=>{var i,a;const{register:u,control:s,setValue:c,getValues:d,reset:v,formState:m}=r.useFormContext(),{t:p}=o.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==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,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"),v({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"))))},ti=["currentlyActiveMobileModal"],ni=["currentlyActiveMobileModal"],li=e=>{var i,a;let{SearchFormFieldsComponent:u,propsMobileInboxCards:s,isLoading:c,data:m,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=r.useFormContext(),[g,_]=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:h},l.createElement(t.CloseSvg,null)),A=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,i=v(e,ti);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(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return l.createElement("span",null)}})(d({currentlyActiveMobileModal:n},v(e,ni)))},[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:()=>_({type:"set",payload:"SearchFormComponent"})})),g?l.createElement(t.PopUp,null,l.createElement(A,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=m&&null!==(i=m[0])&&void 0!==i&&i.display?l.createElement(t.Card,{style:{marginTop:20}},f(null==m||null===(a=m[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")}))},ii=e=>{let{columns:i,SearchFormFieldsComponent:a,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:v,setValue:m,getValues:p}=r.useFormContext();null==p("offset")&&m("offset",0),null==p("limit")&&m("limit",10);const[f,E]=n.useState(Number(p("offset"))/Number(p("limit"))),{t:g}=o.useTranslation(),_=()=>{m("offset",d&&10*Math.ceil(d/10)-p("limit")),v(u)()},h=()=>{m("offset",0),v(u)()},S=n.useCallback(e=>{0!==e.length&&(m("sortBy",e.id),m("sortOrder",e.desc?"DESC":"ASC"))},[]);function A(e){m("limit",Number(e.target.value)),v(u)()}function b(){m("offset",Number(p("offset"))+Number(p("limit"))),v(u)()}function y(){m("offset",Number(p("offset"))-Number(p("limit"))),v(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:i,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:A,currentPage:f,onNextPage:b,onPrevPage:y,pageSizeLimit:Number(p("limit")),onSort:S,totalRecords:d,disableSort:!1,onLastPage:_,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("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))},oi={step:1,isValid:!1,formData:{}},ai=function(e,t){switch(void 0===e&&(e=oi),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 oi;default:return e}},ri=["path","url"],ui=[],si=()=>{var e,n,a,r;const u=i.useRouteMatch(),{path:s}=u,c=(v(u,ri),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewNOCStepperForm")),d=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),m=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),p=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview");return l.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,(void 0===(f=ui)&&(f=[]),f.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:s+"/new-application",component:c}),l.createElement(t.PrivateRoute,{path:s+"/response/:id",component:d}),l.createElement(t.PrivateRoute,{path:s+"/my-application",component:m}),l.createElement(t.PrivateRoute,{path:s+"/search/application-overview/:id",component:p}))));var f},ci=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.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(),i.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:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#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(i[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var o})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},di=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function s(){i<r.length?d():i===r.length&&n()}function c(){i>1&&v()}const d=()=>a(i+1),v=()=>a(i-1);return l.createElement(ci,{currentStep:i,nextStep:d,prevStep:v,stepsList:r},(()=>{var e,t;const n=r[i-1],{component:o,key:a,texts:d,currStepConfig:v}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:d,component:o,currStepNumber:i,currStepConfig:v},onGoNext:s,onBackClick:c,t:u}))})())},vi=[{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"}]}],mi=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),pi=[{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:vi.filter(t=>t.stepNumber===e.stepNumber)})),fi=e=>{var i,o,a,r,u;const{t:s,currentStepData:c,Controller:d,control:v,setValue:m,errors:p,errorStyle:f}=e,E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:g}=Digit.Hooks.obps.useMDMS(E,"common-masters",["GenderType"]);let _=[];g&&g["common-masters"].GenderType.filter(e=>e.active).map(e=>{_.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;m(t,n)})},[c,m]);const[h,S]=n.useState(""),[A,b]=n.useState(null),[y,C]=n.useState(null);return Digit.Utils.browser.isMobile(),n.useEffect(()=>{y&&Object.entries(y).forEach(e=>{let[t,n]=e;"name"===t?m("applicantOwnerOrFirmName",n,{shouldValidate:!0,shouldDirty:!0}):"emailId"===t?m("applicantEmailId",n,{shouldValidate:!0,shouldDirty:!0}):"gender"===t?m("applicantGender",n,{shouldValidate:!0,shouldDirty:!0}):"dob"===t?m("applicantDateOfBirth",n,{shouldValidate:!0,shouldDirty:!0}):"fatherOrHusbandName"===t?m("applicantFatherHusbandName",n):"permanentAddress"===t&&m("applicantAddress",n,{shouldValidate:!0,shouldDirty:!0})})},[y]),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_APPLICANT_MOBILE_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:v,name:"applicantMobileNumber",rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value),S(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s})})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick:function(){try{return""===h||10!==h.length?(b({key:"true",error:!0,message:"ERR_MOBILE_NUMBER_INCORRECT"}),Promise.resolve()):Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:h},{})).then(function(e){var t,n;0===(null==e||null===(t=e.user)||void 0===t?void 0:t.length)?b({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"}):C(null==e||null===(n=e.user)||void 0===n?void 0:n[0])})}catch(e){return Promise.reject(e)}}}," ",l.createElement(t.SearchIcon,null)," ")),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_FIRM_OWNER_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:v,name:"applicantOwnerOrFirmName",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextInput,{value:e.value||(null==y?void 0:y.name),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:v,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||(null==y?void 0:y.emailId),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:v,name:"applicantFatherHusbandName",render:e=>l.createElement(t.TextInput,{value:e.value||(null==y?void 0:y.fatherOrHusbandName),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_ADDRESS_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(d,{control:v,name:"applicantAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("MAX_100_CHARACTERS_ALLOWED")}},render:e=>l.createElement(t.TextArea,{value:e.value||(null==y?void 0:y.permanentAddress),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:v,name:"applicantDateOfBirth",rules:{required:s("REQUIRED_FIELD"),validate:e=>{const t=new Date,n=new Date(e),l=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth(),o=t.getDate()-n.getDate();return l>=18||18===l&&(i>0||0===i&&o>=0)||s("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value||(null==y?void 0:y.dob),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:v,name:"applicantGender",rules:{required:s("REQUIRED_FIELD")},render:e=>l.createElement(t.RadioButtons,{t:s,options:_,optionsKey:"code",value:e.value||(null==y?void 0:y.gender),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)||"")),A&&l.createElement(t.Toast,{error:null==A?void 0:A.error,warning:null==A?void 0:A.warning,label:s(null==A?void 0:A.message),isDleteBtn:!0,onClose:()=>{b(null)}}))},Ei=e=>{var i,o,a,r,u,s,c;const{t:d,currentStepData:v,Controller:m,control:p,setValue:f,errors:E,errorStyle:g}=e,_=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),Digit.UserService.getUser());n.useEffect(()=>{console.log("currentStepData2",v);const e=null==v?void 0:v.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,n]=e;f(t,n)})},[v,f]);const{data:h}=Digit.Hooks.noc.useTenants(),[S,A]=n.useState(h);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(m,{control:p,name:"professionalName",defaultValue:null==_||null===(i=_.info)||void 0===i?void 0:i.name,rules:{required:d("REQUIRED_FIELD"),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(m,{control:p,name:"professionalEmailId",defaultValue:null==_||null===(o=_.info)||void 0===o?void 0:o.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(m,{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(m,{control:p,name:"professionalMobileNumber",defaultValue:null==_||null===(u=_.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(m,{control:p,name:"professionalAddress",rules:{required:d("REQUIRED_FIELD"),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)||""))},gi=e=>{var i,o,a,r,u,s,c,v,m,p,f,E,g,_,h;Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),{t:A,currentStepData:b,Controller:y,control:C,setValue:D,errors:N,errorStyle:O,useFieldArray:L,watch:T}=e,[I,w]=n.useState("0.00"),{fields:P,append:x,remove:R}=L({control:C,name:"floorArea"}),F=T("floorArea"),B=T("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,U]=n.useState((null==b||null===(i=b.siteDetails)||void 0===i?void 0:i.ulbName)||null),[k,W]=n.useState((null==b||null===(o=b.siteDetails)||void 0===o?void 0:o.ulbType)||""),[H,j]=n.useState((null==b||null===(a=b.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:A(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[J,$]=n.useState((null==b||null===(r=b.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),Z=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Q=Digit.Hooks.noc.useTenants(),[ee,te]=n.useState(Q),[ne,le]=n.useState((null==b||null===(u=b.siteDetails)||void 0===u?void 0:u.district)||null),[ie,oe]=n.useState([]),{data:ae}=Digit.Hooks.useBoundaryLocalities(null==ne?void 0:ne.code,"revenue",{enabled:!!ne},A);return n.useEffect(()=>{(null==ae?void 0:ae.length)>0&&oe(ae)},[ae]),n.useEffect(()=>{oe([]),D("zone",null)},[ne]),n.useEffect(()=>{const e=null==b?void 0:b.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,n]=e;"floorArea"!==t&&D(t,n)}),Array.isArray(e.floorArea))){for(let e=P.length-1;e>=0;e--)R(e);e.floorArea.forEach(e=>{x({value:e.value||""})})}},[b,D,x,R]),l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.CardSectionHeader,{className:"card-section-header"},A("NOC_SITE_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_PLOT_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"plotNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},null!=N&&N.plotNo?N.plotNo.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},A("NOC_PROPOSED_SITE_ADDRESS"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"proposedSiteAddress",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:200,message:A("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:O},null!=N&&N.proposedSiteAddress?N.proposedSiteAddress.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ULB_NAME_LABEL"),"*"),!K&&l.createElement(y,{control:C,name:"ulbName",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{U(t),e.onChange(t)},selected:e.value,option:X,optionKey:"displayName"})})),l.createElement(t.CardLabelError,{style:O},null!=N&&N.ulbName?N.ulbName.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_ULB_TYPE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"ulbType",render:e=>l.createElement(t.TextInput,{value:k||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"},""+A("NOC_KHASRA_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"khasraNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(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"},""+A("NOC_HADBAST_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"hadbastNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(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"},""+A("NOC_ROAD_TYPE_LABEL"),"*"),!Y&&l.createElement(y,{control:C,name:"roadType",rules:{required:A("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:O},(null==N||null===(v=N.roadType)||void 0===v?void 0:v.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"areaLeftForRoadWidening",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==N||null===(m=N.areaLeftForRoadWidening)||void 0===m?void 0:m.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL")),l.createElement("div",{className:"field"},l.createElement(y,{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"},""+A("NOC_ROAD_WIDTH_AT_SITE_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"roadWidthAtSite",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},null!=N&&N.roadWidthAtSite?N.roadWidthAtSite.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_BUILDING_STATUS_LABEL"),"*"),!V&&l.createElement(y,{control:C,name:"buildingStatus",rules:{required:A("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:O},(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"},""+A("NOC_IS_BASEMENT_AREA_PRESENT_LABEL")," *"),l.createElement(y,{control:C,name:"isBasementAreaAvailable",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:t=>{$(t),e.onChange(t)},selected:e.value,option:Z,optionKey:"i18nKey"})})),l.createElement(t.CardLabelError,{style:O},(null==N||null===(f=N.isBasementAreaAvailable)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==H?void 0:H.code)&&"YES"===(null==J?void 0:J.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_BASEMENT_AREA_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"basementArea",rules:{required:A("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:A("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:A("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:O},null!=N&&N.basementArea?N.basementArea.message:""),"BUILTUP"===(null==H?void 0:H.code)&&P.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(y,{control:C,name:"floorArea."+n+".value",defaultValue:e.value,rules:{required:A("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:A("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:A("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;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===(i=N.floorArea)||void 0===i||null===(o=i[n])||void 0===o?void 0:o.value)&&l.createElement(t.CardLabelError,{className:O},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:()=>x({value:""})},"➕ Add Floor"),"BUILTUP"===(null==H?void 0:H.code)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_TOTAL_FLOOR_AREA_LABEL")),l.createElement("div",{className:"field"},l.createElement(y,{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"},""+A("NOC_SITE_WARD_NO_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"wardNo",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(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"},""+A("NOC_DISTRICT_LABEL"),"*"),l.createElement(y,{control:C,name:"district",rules:{required:A("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:O},(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"},""+A("NOC_ZONE_LABEL"),"*"),l.createElement(y,{control:C,name:"zone",rules:{required:A("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:ie,optionKey:"i18nkey"})})),l.createElement(t.CardLabelError,{style:O},(null==N||null===(_=N.zone)||void 0===_?void 0:_.message)||""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+A("NOC_SITE_VILLAGE_NAME_LABEL"),"*"),l.createElement("div",{className:"field"},l.createElement(y,{control:C,name:"villageName",rules:{required:A("REQUIRED_FIELD"),maxLength:{value:100,message:A("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:O},(null==N||null===(h=N.villageName)||void 0===h?void 0:h.message)||"")),l.createElement(t.BreakLine,null)))},_i=e=>{var i;const{t:o,currentStepData:a,Controller:r,control:u,setValue:s,errors:c,errorStyle:d}=e,v=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,p]=n.useState((null==a||null===(i=a.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||[]),{data:f,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(v);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,o("NOC_SPECIFICATION_DETAILS")),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("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:o})}))),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"},""+o("NOC_BUILDING_CATEGORY_LABEL"),"*"),!E&&f.length>0&&l.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:o("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 hi(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:v,formData:m,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,_]=(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===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[h,S]=n.useState(null),[A,b]=n.useState(()=>(null==E?void 0:E.filestoreId)||null);function y(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),i=I(n).toFixed(2);t({latitude:l,longitude:i})}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,O]=n.useState(!1),[L,T]=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==A?void 0:A.length)||null===A?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==A))||[],{documentType:null==g?void 0:g.code,filestoreId:A,documentUid:A,documentAttachment:A}]})},[A,g]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),n.useEffect(()=>{if("update"===v){var e,t;const n=null==m||null===(e=m.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?(_(l),b(null==n?void 0:n.fileStoreId)):O(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||_({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(h){T(!0);const e=function(){if(h.size>=5242880)T(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;T(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){T(!1),u(o("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)}}()},[h]),n.useEffect(()=>{N&&b(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"},o(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=>_(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(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:y,onDelete:()=>{b(null)},id:f,message:A?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".jpg, .jpeg, .png",buttonType:"button",error:!A}:{onUpload:y,onDelete:()=>{b(null)},id:f,message:A?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!A}),"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 Si=e=>{let{width:t=20,height:n=20,style:i}=e;return l.createElement("svg",{style:i,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 Ai(e){var t;let{value:n={}}=e;const{t:i}=o.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=g(a.pdfFiles,null==e?void 0:e.documentAttachment);return l.createElement("a",{target:"_",href:n,style:{minWidth:"100px",marginRight:"10px"},key:t},l.createElement(Si,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),l.createElement("p",{style:{marginTop:"8px",textAlign:"center"}},i(null==e?void 0:e.documentType.replace(".","_").toUpperCase())))}))))}const bi=l.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:s,documents:v,formData:m,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",v);const g=(null==v?void 0:v.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 _=Digit.ULBService.getStateId(),[h,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===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[A,b]=n.useState(null),[y,C]=n.useState(()=>(null==v?void 0:v.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([]),[O,L]=n.useState([]),[T,I]=n.useState([]||(null==m||null===(o=m.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,P]=n.useState(null),[x,R]=n.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}n.useEffect(()=>{(null==v?void 0:v.length)>0&&E()},[v]),n.useEffect(()=>{O.length>0&&null!=h&&h.code&&(s(e=>{if(null===y||null==(null==y?void 0:y.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==y.fileStoreId);let n=[];return O&&O.map((e,t)=>{var l,i;n.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:x},documentUid:e.fileStoreId,fileName:(null===(l=T[t])||void 0===l?void 0:l.name)||"",id:v?null===(i=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",n),[...t,...n]}),L([])),null!=h&&h.code&&s(e=>{var t;return null===y||null==(null==y?void 0:y.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,n,l,i,o;(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==h||null===(l=h.code)||void 0===l?void 0:l.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==y.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:y.fileStoreId,documentUid:y.fileStoreId,fileName:(null==A?void 0:A.name)||y.fileName||"document",id:v?null===(t=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[y,h]),n.useEffect(()=>{h.code||null===y||L([...O,y])},[y]);const B=n.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",m);let n=[];return null==m||null===(e=m.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>n.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:_}}])),console.log("selectedUplDocs here",n),n},[m]);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:_,getFormState:function(e){let t,n,l=h.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),i=F(n);t({latitude:l,longitude:i})}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(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),P(i.latitude),R(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),n=Object.values(t),n=null==m||null===(o=m.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),N(n);let c=[];null==e||e.map((e,t)=>{var n,l,o,a;c.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.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===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:v?null===(a=v.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const d=[...v.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&&b(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...v.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(Nn,{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)," ")))}),yi=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const s=[{link:n+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:s,Icon:()=>l.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Ci=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:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),s?l.createElement(t.Loader,null):"citizen"===o?l.createElement(si,null):l.createElement(It,{path:r,stateCode:n})},Di={NOCModule:Ci,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.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:v,data:{totalCount:m,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:v?"":m,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,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"}]}),[v,m]);return Digit.Utils.NOCAccess()?l.createElement(t.EmployeeModuleCard,g):null},NOCLinks:yi,NOCApplicationOverview:()=>{var e,a,r,u,s,c,v,f,E;const{id:g}=i.useParams(),{t:_}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),S=null==h?void 0:h.split(".")[0],[A,b]=n.useState({}),[y,C]=n.useState(null),D={},[N]=n.useState(()=>(null==D?void 0:D.fileStoreId)||null),[O,L]=n.useState(null),[T,I]=n.useState([]),[w,P]=n.useState([]),[x,R]=n.useState([]),[F,B]=n.useState([]),[M,U]=n.useState([]),[k,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:J}=Digit.Hooks.noc.useNOCApplicationActions(h),$=Digit.Hooks.useWorkflowDetails({tenantId:h,id:g,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)||d({},null==$||null===(Q=$.data)||void 0===Q?void 0:Q.actionState)||{},$.data.actionState=d({},$.data)),n.useEffect(()=>{P([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!=x&&x.length){let e=[];w.map(t=>{var n,l;const i=x.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})}),I(t)}},[w,x,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: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,c,d,v,f,E,g,_,h,S,A,b,y,C,D,N,I,w;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_"+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:""+i("NOC_"+(null==o||null===(c=o[0])||void 0===c?void 0:c.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(d=o[0])||void 0===d?void 0:d.applicationNo)||"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(v=o[0])||void 0===v?void 0:v.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!==(E=o[0])&&void 0!==E&&null!==(g=E.additionalDetails)&&void 0!==g&&g.SubmittedOn?m(Number(null==o||null===(_=o[0])||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.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?m(Number(null==o||null===(A=o[0])||void 0===A||null===(b=A.auditDetails)||void 0===b?void 0:b.lastModifiedTime)):"NA"}),l.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(y=o[0])&&void 0!==y&&y.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===(N=D.documents)||void 0===N?void 0:N.map((e,n)=>{var o,r;return l.createElement("a",{target:"_",href:null===(o=k[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_"+p(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===(I=$.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>l.createElement(rl,{key:t,document:e,t:i,error:O,setError:L,setNocDocuments:U,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:""+_(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;b(d({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>l.createElement(ee,{t:_,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,N,H,k]),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",null,l.createElement(t.Header,{styles:{fontSize:"32px"}},_("NOC_APP_OVER_VIEW_HEADER"))),l.createElement(al,{applicationDetails:A,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:J,workflowDetails:$,businessService:null!=$&&null!==(s=$.data)&&void 0!==s&&s.applicationBusinessService?null==$||null===(c=$.data)||void 0===c?void 0:c.applicationBusinessService:null==X||null===(v=X.applicationData)||void 0===v?void 0:v.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:y,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}=o.useTranslation(),s=window.localStorage.getItem("Employee.tenant-id"),c={},v={moduleName:"noc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},m={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=n.useMemo(()=>p||{filterForm:v,searchForm:c,tableForm:m},[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,_]=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:h,isLoading:S}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},u),{isLoading:A,data:{statuses:b,totalCount:y}={}}=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("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},N=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(ul,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),O=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(sl,{statuses:b,isInboxLoading:A,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:S})},[b,A,h,S]),L={SearchFormFields:N,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:d({},m)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},T={FilterFormFields:O,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:d({},m)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({action:"mutateFilterForm",data:v})}},I=(e=>{var t,a,r,u;let{parentRoute:s,onPageSizeChange:c,formState:v,totalCount:m,table:p,dispatch:f,onSortingByData:E}=e;const{t:g}=o.useTranslation(),_=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(i.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:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Zl(new Date(null===(n=i.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=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:d({},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:d({},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:E,totalRecords:m,onSearch:null==v||null===(u=v.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:d({},v.tableForm,{offset:10*Math.ceil(m/10)-parseInt(null===(e=v.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:d({},v.tableForm,{offset:0})}),data:p,columns:_}})(d({},{parentRoute:a,onPageSizeChange:e=>{_({action:"mutateTableForm",data:d({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:y,table:C,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,l=n?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===l||_({action:"mutateTableForm",data:d({},g.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),w=(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")]:Zl(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:C}),P={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:d({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:m})}};return l.createElement(n.Fragment,null,l.createElement(t.Header,null,u("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),l.createElement(t.InboxComposer,d({isInboxLoading:A,PropsForInboxLinks:D},L,T,P,{propsForInboxTable:I,propsForInboxMobileCards:w,formState:g})))},NOCSearchApplication:e=>{let{t:t,onSubmit:a,data:u,error:s,isLoading:c,Count:d}=e;const[v,m]=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}=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}],[])})(),E=window.Digit.Utils.browser.isMobile(),g=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,p,E?l.createElement(li,{SearchFormFieldsComponent:ei,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:a}):l.createElement(ii,{columns:f,SearchFormFieldsComponent:ei,onSubmit:a,data:u,error:s,isLoading:c,Count:d}))},NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.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(di,{stepsList:pi,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 i,a,u;let{config:c,onGoNext:v,onBackClick:m}=e;const p=s.useDispatch(),{t:f}=o.useTranslation(),[E,g]=n.useState(null),[_,h]=n.useState(""),S=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),A=Digit.UserService.getUser(),{control:b,handleSubmit:y,setValue:C,formState:{errors:D},trigger:N,reset:O}=r.useForm(),L={Controller:r.Controller,control:b,setValue:C,errors:D,trigger:N,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:O};function T(e){p(mi(c.key,e)),v()}function I(e){m(c.key,e)}const[w,P]=n.useState((null==S||null===(i=S.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),x=Digit.ULBService.getStateId(),[R,F]=n.useState(!1),B=null==A||null===(a=A.info)||void 0===a||null===(u=a.roles)||void 0===u?void 0:u.map(e=>e.code),{data:M,isLoading:U}=Digit.Hooks.obps.useMDMS(x,"StakeholderRegistraition","TradeTypetoRoleMapping");return n.useEffect(()=>{if(!U){var e,t;let n=[];null==M||null===(e=M.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!=B&&B.includes(e)&&P(!0)})}},[U]),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:y(e=>{N(),D.length>0?console.log("Plz fill mandatory fields in Step1"):T(e)})},l.createElement("div",{className:"employeeCard"},w?l.createElement(l.Fragment,null,l.createElement(Ei,d({onGoBack:I,goNext:T,currentStepData:S,t:f},L)),l.createElement(fi,d({onGoBack:I,goNext:T,currentStepData:S,t:f},L))):l.createElement(l.Fragment,null,l.createElement(fi,d({onGoBack:I,goNext:T,currentStepData:S,t:f},L)))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:_,onClose:()=>{g(null),h("")}}))},NewNOCStepFormTwo:e=>{var i;let{config:a,onBackClick:u,onGoNext:c}=e;const{t:v}=o.useTranslation(),m=s.useDispatch(),[p,f]=n.useState(!1),[E,g]=n.useState(""),_=(null===(i=Digit.UserService.getUser())||void 0===i?void 0:i.info)||{},{control:h,handleSubmit:S,setValue:A,formState:{errors:b},trigger:y,watch:C}=r.useForm({defaultValues:{floorArea:[{value:""}]}}),D=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),N={Controller:r.Controller,control:h,setValue:A,errors:b,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:r.useFieldArray,watch:C};let O;function L(e){m(mi(a.key,e)),c()}function T(e){u(a.key,e)}return O=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:S(e=>{var t,n,l;y(),m(mi(a.key,e)),null!=D&&null!==(t=D.apiData)&&void 0!==t&&null!==(n=t.Noc)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&l.applicationNo?c():function(e){try{const t=d({},e),n={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:O,owners:[{mobileNumber:(null==_?void 0:_.mobileNumber)||"",name:(null==_?void 0:_.name)||"",emailId:(null==_?void 0:_.emailId)||"",type:(null==_?void 0:_.type)||"",userName:(null==_?void 0:_.userName)||""}],workflow:{action:"INITIATE"},nocDetails:{additionalDetails:t,tenantId:O}}};console.log("final Payload here==>",n),Promise.resolve(Digit.NOCService.NOCcreate({tenantId:O,details:n})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),m(mi("apiData",e)),c(),{isSuccess:!0,response:e}):(console.log("error : create api not executed successfully !!!"),{isSuccess:!1,response:e})})}catch(e){return Promise.reject(e)}}(d({},D,{siteDetails:d({},e)}))})},l.createElement("div",{className:"employeeCard"},l.createElement(gi,d({onGoBack:T,goNext:L,currentStepData:D,t:v},N)),l.createElement(_i,d({onGoBack:T,goNext:L,currentStepData:D,t:v},N))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:T}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),p&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:E,onClose:()=>{f(!1),g("")}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[v,m]=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==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:g,config:i.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)||[],i=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],o=l.filter(e=>e.required).map(e=>e.code),a=i.map(e=>e.documentType);return o.filter(e=>!a.includes(e))}}(e);return t.length>0?(m(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 o():(m(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),void d(!0))},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!Dn.isEqual(t,g)),Dn.isEqual(t,g)||u(mi(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{d(!1),m("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,c,v,m,p,f,E;let{config:g,onGoNext:_,onBackClick:h,t:S}=e;const A=s.useDispatch(),[b,y]=n.useState(!1),[C,D]=n.useState(""),N=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData||{}}),O=n.useRef();let L=Digit.UserService.getUser();const T=null==L||null===(o=L.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[I,w]=n.useState(!1);Digit.Hooks.useClickOutside(O,()=>{w(!1)},I);const P=i.useHistory();let x;x=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const R=function(e){try{function t(){_()}console.log("formData in parent SummaryPage",N);const n=wt(function(){return Promise.resolve(F(N,e)).then(function(e){var t,n,l,i,o,a,r,u;null!=e&&e.isSuccess?window.location.href.includes("citizen")?(console.log("we are calling citizen response page"),P.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Noc)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.applicationNo),state:{data:null==e?void 0:e.response}})):(console.log("we are calling employee response page"),P.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(i=e.response)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:null==e?void 0:e.response}})):(console.error("Submission failed, not moving to next step.",null==e?void 0:e.response),D((null==e||null===(r=e.Errors)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.message)||"Update failed, Please try again"),y(!0))})},function(){var e,t,n;D((null===(e=res)||void 0===e||null===(t=e.Errors)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.message)||"Update failed due to some error occurred"),y(!0)});return Promise.resolve(n&&n.then?n.then(t):t())}catch(e){return Promise.reject(e)}},F=function(e,t){try{console.log("formData inside onSubmit",e);const n=function(e,t){var n,l,i,o,a,r,u,s,c,v;console.log("nocFormData",e);const m=d({},null==e||null===(n=e.apiData)||void 0===n||null===(l=n.Noc)||void 0===l?void 0:l[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:d({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:d({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.nocDetails.additionalDetails,{applicationDetails:d({},null==e?void 0:e.applicationDetails),siteDetails:d({},null==e?void 0:e.siteDetails)})}),documents:[]});return((null==e||null===(c=e.documents)||void 0===c||null===(v=c.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{m.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})}),{Noc:d({},m)}}(e,t);return console.log("finalPayload here==>",n),Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:x,details:n})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success: Update API "),A({type:"RESET_NOC_NEW_APPLICATION_FORM"}),{isSuccess:!0,response:e}):(console.log("Error: Update API"),{isSuccess:!1,response:e})})}catch(e){return Promise.reject(e)}};function B(e){h(g.key,e)}console.log("currentStepData in StepFour",N);const M=(null==N||null===(r=N.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.applicationNo)||"";console.log("applicationNo here==>",M);const U=Digit.Hooks.useWorkflowDetails({tenantId:x,id:M,moduleCode:"NOC"});console.log("workflow Details here==>",U);let k=(null==U||null===(v=U.data)||void 0===v||null===(m=v.actionState)||void 0===m||null===(p=m.nextActions)||void 0===p?void 0:p.filter(e=>(null==T?void 0:T.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==U||null===(f=U.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==T?void 0:T.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return console.log("actions here",k),l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:N,config:g.currStepConfig,onSubmit:R,onFormValueChange:function(e,t){Dn.isEqual(t,N)||A(mi(g.key,t))},label:S(""+g.texts.submitBarLabel),currentStep:g.currStepNumber,onBackClick:B}),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:B}),I&&k?l.createElement(t.Menu,{localeKeyPrefix:"WF_NOC",options:k,optionKey:"action",t:S,onSelect:function(e){R(e),console.log("selectedAction here",e)}}):null,l.createElement(t.SubmitBar,{ref:O,label:S("WF_TAKE_ACTION"),onSubmit:()=>w(!I)})),b&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:C,onClose:()=>{y(!1),D("")}}))},NOCApplicantDetails:fi,NOCProfessionalDetails:Ei,NOCSiteDetails:gi,NOCSpecificationDetails:_i,NOCDocumentsRequired:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[v,m]=n.useState(null==c||null===(i=c.documents)||void 0===i?void 0:i.documents),[p,f]=n.useState(null),[E,g]=n.useState(!0),[_,h]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:A,data:b}=Digit.Hooks.pt.usePropertyMDMS(S,"NOC",["Documents"]),y=()=>{let e;e=d({},c.documents,{documents:v}),s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==b||null===(e=b.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==v||v.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),g("0"!=n&&0!=n||!((null==v?void 0:v.length)>0))},[v,_]),l.createElement("div",null,A?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:y,onSkip:()=>s(),isDisabled:E,onAdd:function(){}},null==b||null===(o=b.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(hi,{key:t,document:e,t:r,error:p,setError:f,setDocuments:m,documents:v,setCheckRequiredFields:h,handleSubmit:y})),p&&l.createElement(t.Toast,{label:p,isDleteBtn:!0,onClose:()=>f(null),error:!0})))},NOCSummary:function(e){var n,o,a,r,u,c,d,v,m,p,f,E,g,_,h,S,A,b,y,C,D,N,O,L,T,I,w,P,x,R,F,B,M,U,k,W,H,j,z,V,G,Y,q,K,X,J,$,Z,Q,ee,te,ne,le;let{formData:ie,t:oe}=e;i.useLocation(),i.useHistory(),s.useDispatch(),console.log("formData in Summary Page",ie);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==ie||null===(n=ie.documents)||void 0===n||null===(o=n.documents)||void 0===o?void 0:o.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},oe("NOC_APPLICANT_DETAILS")),l.createElement("div",{style:ae},ce(oe("NOC_FIRM_OWNER_NAME_LABEL"),null==ie||null===(a=ie.applicationDetails)||void 0===a?void 0:a.applicantOwnerOrFirmName),ce(oe("NOC_APPLICANT_EMAIL_LABEL"),null==ie||null===(r=ie.applicationDetails)||void 0===r?void 0:r.applicantEmailId),ce(oe("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==ie||null===(u=ie.applicationDetails)||void 0===u?void 0:u.applicantFatherHusbandName),ce(oe("NOC_APPLICANT_MOBILE_NO_LABEL"),null==ie||null===(c=ie.applicationDetails)||void 0===c?void 0:c.applicantMobileNumber),ce(oe("NOC_APPLICANT_DOB_LABEL"),null==ie||null===(d=ie.applicationDetails)||void 0===d?void 0:d.applicantDateOfBirth),ce(oe("NOC_APPLICANT_GENDER_LABEL"),null==ie||null===(v=ie.applicationDetails)||void 0===v||null===(m=v.applicantGender)||void 0===m?void 0:m.code),ce(oe("NOC_APPLICANT_ADDRESS_LABEL"),null==ie||null===(p=ie.applicationDetails)||void 0===p?void 0:p.applicantAddress)),(null==ie||null===(f=ie.applicationDetails)||void 0===f?void 0:f.professionalName)&&l.createElement(l.Fragment,null,l.createElement("h2",{style:ue},oe("NOC_PROFESSIONAL_DETAILS")),l.createElement("div",{style:ae},ce(oe("NOC_PROFESSIONAL_NAME_LABEL"),null==ie||null===(E=ie.applicationDetails)||void 0===E?void 0:E.professionalName),ce(oe("NOC_PROFESSIONAL_EMAIL_LABEL"),null==ie||null===(g=ie.applicationDetails)||void 0===g?void 0:g.professionalEmailId),ce(oe("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==ie||null===(_=ie.applicationDetails)||void 0===_?void 0:_.professionalRegId),ce(oe("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==ie||null===(h=ie.applicationDetails)||void 0===h?void 0:h.professionalMobileNumber),ce(oe("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==ie||null===(S=ie.applicationDetails)||void 0===S?void 0:S.professionalAddress))),l.createElement("h2",{style:ue},oe("NOC_SITE_DETAILS")),l.createElement("div",{style:ae},ce(oe("NOC_PLOT_NO_LABEL"),null==ie||null===(A=ie.siteDetails)||void 0===A?void 0:A.plotNo),ce(oe("NOC_PROPOSED_SITE_ADDRESS"),null==ie||null===(b=ie.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),ce(oe("NOC_ULB_NAME_LABEL"),null==ie||null===(y=ie.siteDetails)||void 0===y||null===(C=y.ulbName)||void 0===C?void 0:C.name),ce(oe("NOC_ULB_TYPE_LABEL"),null==ie||null===(D=ie.siteDetails)||void 0===D?void 0:D.ulbType),ce(oe("NOC_KHASRA_NO_LABEL"),null==ie||null===(N=ie.siteDetails)||void 0===N?void 0:N.khasraNo),ce(oe("NOC_HADBAST_NO_LABEL"),null==ie||null===(O=ie.siteDetails)||void 0===O?void 0:O.hadbastNo),ce(oe("NOC_ROAD_TYPE_LABEL"),null==ie||null===(L=ie.siteDetails)||void 0===L||null===(T=L.roadType)||void 0===T?void 0:T.name),ce(oe("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==ie||null===(I=ie.siteDetails)||void 0===I?void 0:I.areaLeftForRoadWidening),ce(oe("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==ie||null===(w=ie.siteDetails)||void 0===w?void 0:w.netPlotAreaAfterWidening),ce(oe("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==ie||null===(P=ie.siteDetails)||void 0===P?void 0:P.roadWidthAtSite),ce(oe("NOC_BUILDING_STATUS_LABEL"),null==ie||null===(x=ie.siteDetails)||void 0===x||null===(R=x.buildingStatus)||void 0===R?void 0:R.name),ce(oe("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==ie||null===(F=ie.siteDetails)||void 0===F||null===(B=F.isBasementAreaAvailable)||void 0===B?void 0:B.code),"BUILTUP"===(null==ie||null===(M=ie.siteDetails)||void 0===M||null===(U=M.buildingStatus)||void 0===U?void 0:U.code)&&ce(oe("NOC_BASEMENT_AREA_LABEL"),null==ie||null===(k=ie.siteDetails)||void 0===k?void 0:k.basementArea),"BUILTUP"===(null==ie||null===(W=ie.siteDetails)||void 0===W||null===(H=W.buildingStatus)||void 0===H?void 0:H.code)&&(null==ie||null===(j=ie.siteDetails)||void 0===j||null===(z=j.floorArea)||void 0===z?void 0:z.map((e,t)=>ce((e=>0===e?oe("NOC_GROUND_FLOOR_AREA_LABEL"):""+e+(["st","nd","rd"][(e-1)%10-1]||"th")+" "+oe("NOC_FLOOR_AREA_LABEL"))(t),null==e?void 0:e.value))),"BUILTUP"===(null==ie||null===(V=ie.siteDetails)||void 0===V||null===(G=V.buildingStatus)||void 0===G?void 0:G.code)&&ce(oe("NOC_TOTAL_FLOOR_AREA_LABEL"),null==ie||null===(Y=ie.siteDetails)||void 0===Y?void 0:Y.totalFloorArea),ce(oe("NOC_DISTRICT_LABEL"),null==ie||null===(q=ie.siteDetails)||void 0===q||null===(K=q.district)||void 0===K?void 0:K.name),ce(oe("NOC_ZONE_LABEL"),null==ie||null===(X=ie.siteDetails)||void 0===X||null===(J=X.zone)||void 0===J?void 0:J.name),ce(oe("NOC_SITE_WARD_NO_LABEL"),null==ie||null===($=ie.siteDetails)||void 0===$?void 0:$.wardNo),ce(oe("NOC_SITE_VILLAGE_NAME_LABEL"),null==ie||null===(Z=ie.siteDetails)||void 0===Z?void 0:Z.villageName)),l.createElement("h2",{style:ue},oe("NOC_SPECIFICATION_DETAILS")),l.createElement("div",{style:ae},ce(oe("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==ie||null===(Q=ie.siteDetails)||void 0===Q?void 0:Q.specificationPlotArea),ce(oe("NOC_BUILDING_CATEGORY_LABEL"),null==ie||null===(ee=ie.siteDetails)||void 0===ee||null===(te=ee.specificationBuildingCategory)||void 0===te?void 0:te.name)),l.createElement("h2",{style:ue},oe("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:ae},Array.isArray(null==ie||null===(ne=ie.documents)||void 0===ne||null===(le=ne.documents)||void 0===le?void 0:le.documents)&&ie.documents.documents.documents.length>0?l.createElement(Ai,{value:{workflowDocs:ie.documents.documents.documents}}):l.createElement("div",null,oe("NOC_NO_DOCUMENTS_MSG"))))},NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c}=e;const v=Digit.ULBService.getStateId(),[m,p]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[g,_]=n.useState(!0),[h,S]=n.useState(!1),[A,b]=n.useState(!1),y=ht((null==c?void 0:c.PrevStateDocuments)||[]),{isLoading:C,data:D}=Digit.Hooks.pt.usePropertyMDMS(v,"NOC",["Documents"]),N=()=>{let e;e=d({},c.documents,{documents:m}),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=>m.reduce((t,n)=>{var l,i,o,a;return e==(null==n||null===(l=n.documentType)||void 0===l||null===(i=l.split("."))||void 0===i?void 0:i[0])+"."+(null==n||null===(o=n.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));_(!((null==l?void 0:l.length)==(null==n?void 0:n.length)&&(null==m?void 0:m.length)>0))},[m,h]),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===(o=D.NOC)||void 0===o||null===(a=o.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(bi,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:m,setCheckRequiredFields:S,formData:c,beforeUploadDocuments:y||[],isNextButtonDisabled:A,setIsNextButtonDisabled:b,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"}):"")},NOCResponseCitizen:e=>{var n,a;const r=i.useLocation(),{pathname:u,state:s}=r,{t:c}=o.useTranslation(),d=i.useHistory(),v=null==s||null===(n=s.data)||void 0===n||null===(a=n.Noc)||void 0===a?void 0:a[0];console.log("nocData here",v);const m=window.localStorage.getItem("CITIZEN.CITY"),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},g=u.split("/").pop();return l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.Banner,{message:c(p(null==v?void 0:v.nocType,".","_")+"_"+p(null==v?void 0:v.applicationStatus,".","_")+"_HEADER"),applicationNumber:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,t=E.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})):null,l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{d.push("/digit-ui/citizen")}}),l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{d.push("/digit-ui/citizen/noc-home")}}),l.createElement(t.SubmitBar,{label:c("COMMON_MAKE_PAYMENT"),onSubmit:()=>{d.push("/digit-ui/citizen/payment/collect/NOC/"+g+"/"+m)}}))))},NOCCitizenMyApplications:e=>{var n,a,r;const{t:u}=o.useTranslation(),s=(i.useHistory(),(null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.info)||{}),c=window.localStorage.getItem("CITIZEN.CITY");console.log("userInfo========",s);const{isLoading:d,data:v}=Digit.Hooks.noc.useNOCCitizenSearchApplication({mobileNumber:s.mobileNumber},c);return console.log("data herein NOC==>",v),d?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"applications-list-container"},l.createElement(t.Header,null,""+u("NOC_MY_APPLICATION")),0===(null==v||null===(a=v.data)||void 0===a?void 0:a.length)&&l.createElement(t.Card,{style:{textAlign:"center"}},u("NO_APPLICATIONS_MSG")),null==v||null===(r=v.data)||void 0===r?void 0:r.map((e,n)=>{var o,a,r,s;const d=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return console.log("applications here==>",null==e?void 0:e.Applications),l.createElement("div",{key:"card-"+n},l.createElement(t.Card,null,Object.keys(d).filter(e=>null!==d[e]).map(e=>l.createElement(t.KeyNote,{keyValue:u(e),note:u(d[e])})),"PENDINGPAYMENT"!=(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationStatus)&&l.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(a=e.Applications)||void 0===a?void 0:a.uuid)},l.createElement(t.SubmitBar,{label:u("TL_VIEW_DETAILS")})),"PENDINGPAYMENT"===(null==e||null===(r=e.Applications)||void 0===r?void 0:r.applicationStatus)&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/NOC/"+(null==e||null===(s=e.Applications)||void 0===s?void 0:s.uuid)+"/"+c+"?tenantId="+c}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.SubmitBar,{label:u("COMMON_MAKE_PAYMENT")})))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,s,c,d,v,m,p,f;const{id:E}=i.useParams(),{t:g}=o.useTranslation(),_=window.localStorage.getItem("CITIZEN.CITY"),[h,S]=n.useState({}),{isLoading:A,data:b}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:E},_),{data:y}=Digit.Hooks.useStore.getInitData(),{tenants:C}=y||{};let D=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};D=null==t?void 0:t.value}return null===(e=D)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r||r.map(e=>e.code),n.useEffect(()=>{var e;const t=null==b||null===(e=b.Applications)||void 0===e?void 0:e[0];if(t){var n,l,i,o;const e=null==t||null===(n=t.nocDetails)||void 0===n||null===(l=n.additionalDetails)||void 0===l?void 0:l.applicationDetails,a=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails;console.log("applicantDetails",e),console.log("siteDetails",a),S({applicantDetails:e,siteDetails:a})}},[null==b?void 0:b.Applications]),A?l.createElement(t.Loader,null):l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},g("NDC_APP_OVER_VIEW_HEADER")),"APPROVED"===(null==b||null===(u=b.Applications)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationStatus)&&l.createElement(t.LinkButton,{label:g("DOWNLOAD_CERTIFICATE"),style:{color:"#A52A2A"},onClick:function(){try{const e=b;console.log("applicationDetails in NOC",b),console.log("tenants",C);const t=C.find(t=>t.code===e.tenantId);return Promise.resolve(Ot(e,t,g)).then(function(e){console.log("acknowledgementData",e),Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),"/**If no applicants then show MSG as per PGR */",l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,g("NOC_APPLICANT_DETAILS")),null==h||null===(c=h.applicantDetails)||void 0===c?void 0:c.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:g("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.applicantOwnerOrFirmName)||"N/A"}),l.createElement(t.Row,{label:g("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.applicantEmailId)||"N/A"}),l.createElement(t.Row,{label:g("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.applicantFatherHusbandName)||"N/A"}),l.createElement(t.Row,{label:g("NOC_APPLICANT_MOBILE_NO_LABEL"),text:null==e?void 0:e.applicantMobileNumber}),l.createElement(t.Row,{label:g("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.applicantDateOfBirth)||"N/A"}),l.createElement(t.Row,{label:g("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.applicantGender)||void 0===i?void 0:i.code)||"N/A"}),l.createElement(t.Row,{label:g("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.applicantAddress)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,g("NOC_PROFESSIONAL_DETAILS")),(null==h||null===(d=h.applicantDetails)||void 0===d?void 0:d.professionalName)&&(null==h||null===(v=h.applicantDetails)||void 0===v?void 0:v.map((e,n)=>l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:g("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),l.createElement(t.Row,{label:g("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),l.createElement(t.Row,{label:g("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),l.createElement(t.Row,{label:g("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:null==e?void 0:e.professionalMobileNumber}),l.createElement(t.Row,{label:g("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"})))))),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,g("NOC_SITE_DETAILS")),null==h||null===(m=h.siteDetails)||void 0===m?void 0:m.map((e,n)=>{var i,o,a,r,u,s,c,d,v,m;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:g("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),l.createElement(t.Row,{label:g("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),l.createElement(t.Row,{label:g("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||"N/A"}),l.createElement(t.Row,{label:g("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),l.createElement(t.Row,{label:g("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),l.createElement(t.Row,{label:g("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),l.createElement(t.Row,{label:g("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||"N/A"}),l.createElement(t.Row,{label:g("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),l.createElement(t.Row,{label:g("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),l.createElement(t.Row,{label:g("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),l.createElement(t.Row,{label:g("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||"N/A"}),l.createElement(t.Row,{label:g("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||"N/A"}),"BUILTUP"==(null==e||null===(u=e.buildingStatus)||void 0===u?void 0:u.code)&&l.createElement(t.Row,{label:g("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"BUILTUP"==(null==e||null===(s=e.buildingStatus)||void 0===s?void 0:s.code)&&(null==e||null===(c=e.floorArea)||void 0===c?void 0:c.map((e,t)=>{(e=>{g(0===e?"NOC_GROUND_FLOOR_AREA_LABEL":"NOC_FLOOR_AREA_LABEL")})(t)})),"BUILTUP"==(null==e||null===(d=e.buildingStatus)||void 0===d?void 0:d.code)&&l.createElement(t.Row,{label:g("NOC_TOTAL_FLOOR_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),l.createElement(t.Row,{label:g("NOC_DISTRICT_LABEL"),text:(null==e||null===(v=e.district)||void 0===v?void 0:v.name)||"N/A"}),l.createElement(t.Row,{label:g("NOC_ZONE_LABEL"),text:(null==e||null===(m=e.zone)||void 0===m?void 0:m.name)||"N/A"}),l.createElement(t.Row,{label:g("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),l.createElement(t.Row,{label:g("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,g("NOC_SPECIFICATION_DETAILS")),null==h||null===(p=h.siteDetails)||void 0===p?void 0:p.map((e,n)=>{var i;return l.createElement("div",{key:n,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:g("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),l.createElement(t.Row,{label:g("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||"N/A"})))})),l.createElement(t.Card,null,l.createElement(t.CardSubHeader,null,g("NOC_TITILE_DOCUMENT_UPLOADED")),l.createElement("div",{style:{display:"flex",gap:"16px"}},Array.isArray(null==h?void 0:h.Documents)&&(null==h||null===(f=h.Documents)||void 0===f?void 0:f.length)>0?l.createElement(Ai,{value:{workflowDocs:null==h?void 0:h.Documents}}):l.createElement("div",null,g("NOC_NO_DOCUMENTS_MSG")))))}};exports.NOCLinks=yi,exports.NOCModule=Ci,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:ai}),exports.initNOCComponents=()=>{Object.entries(Di).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|